summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2018-08-05 12:50:46 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-08-05 14:46:38 +0200
commit74edd968e9bd760a4635aa1658b8143410e74c50 (patch)
tree7d30cb6900dd197a1b9ee42af004f00e6d77ecce /cui
parentf8046f991587aa569866d82d98b626c94badc400 (diff)
cppcheck: knownConditionTrueFalse
Change-Id: I7aa3e47db67072c06f4de4c219710325cfdb748e Reviewed-on: https://gerrit.libreoffice.org/58613 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/tabpages/numfmt.cxx46
1 files changed, 21 insertions, 25 deletions
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();