[Libreoffice-commits] core.git: cui/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sun Aug 5 12:46:59 UTC 2018
cui/source/tabpages/numfmt.cxx | 46 ++++++++++++++++++-----------------------
1 file changed, 21 insertions(+), 25 deletions(-)
New commits:
commit 74edd968e9bd760a4635aa1658b8143410e74c50
Author: Jochen Nitschke <j.nitschke+logerrit at ok.de>
AuthorDate: Sun Aug 5 12:50:46 2018 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun Aug 5 14:46:38 2018 +0200
cppcheck: knownConditionTrueFalse
Change-Id: I7aa3e47db67072c06f4de4c219710325cfdb748e
Reviewed-on: https://gerrit.libreoffice.org/58613
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index 339451961612..9e518219d7d5 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -1342,7 +1342,6 @@ IMPL_LINK( SvxNumberFormatTabPage, ClickHdl_Impl, Button*, pIB, void)
}
bool SvxNumberFormatTabPage::Click_Impl(PushButton* pIB)
{
- bool bDeleted = false;
sal_uLong nReturn = 0;
const sal_uLong nReturnChanged = 0x1; // THE boolean return value
const sal_uLong nReturnAdded = 0x2; // temp: format added
@@ -1391,7 +1390,6 @@ bool SvxNumberFormatTabPage::Click_Impl(PushButton* pIB)
nCatLbSelPos,
nFmtLbSelPos,
a2EntryList);
- bDeleted = true;
a2EntryList.clear();
m_pEdFormat->GrabFocus();
m_pEdFormat->SetSelection( Selection( 0, SELECTION_MAX ) );
@@ -1449,36 +1447,34 @@ bool SvxNumberFormatTabPage::Click_Impl(PushButton* pIB)
nCatLbSelPos,
nFmtLbSelPos,
aEntryList );
- bDeleted = true;
m_pEdComment->SetText(m_pLbCategory->GetEntry(1));
- if ( bDeleted )
+
+ if( nFmtLbSelPos>=0 && static_cast<size_t>(nFmtLbSelPos)<aEntryList.size() )
{
- if( nFmtLbSelPos>=0 && static_cast<size_t>(nFmtLbSelPos)<aEntryList.size() )
- {
- aFormat = aEntryList[nFmtLbSelPos];
- }
+ aFormat = aEntryList[nFmtLbSelPos];
+ }
- FillFormatListBox_Impl( aEntryList );
+ FillFormatListBox_Impl( aEntryList );
- if ( nFmtLbSelPos != SELPOS_NONE )
- {
- if(bOneAreaFlag) //@@ ???
- SetCategory(0);
- else
- SetCategory(nCatLbSelPos );
+ if ( nFmtLbSelPos != SELPOS_NONE )
+ {
+ if(bOneAreaFlag) //@@ ???
+ SetCategory(0);
+ else
+ SetCategory(nCatLbSelPos );
- m_pLbFormat->SelectEntryPos( static_cast<sal_uInt16>(nFmtLbSelPos) );
- m_pEdFormat->SetText( aFormat );
- ChangePreviewText( static_cast<sal_uInt16>(nFmtLbSelPos) );
- }
- else
- {
- // set to "all/standard"
- SetCategory(0);
- SelFormatHdl_Impl(m_pLbCategory);
- }
+ m_pLbFormat->SelectEntryPos( static_cast<sal_uInt16>(nFmtLbSelPos) );
+ m_pEdFormat->SetText( aFormat );
+ ChangePreviewText( static_cast<sal_uInt16>(nFmtLbSelPos) );
}
+ else
+ {
+ // set to "all/standard"
+ SetCategory(0);
+ SelFormatHdl_Impl(m_pLbCategory);
+ }
+
EditHdl_Impl(m_pEdFormat);
aEntryList.clear();
More information about the Libreoffice-commits
mailing list