summaryrefslogtreecommitdiffstats
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-07-30 16:43:44 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2019-08-07 10:44:27 +0200
commit19741593b2f53b35354732808ebd09fbeb335efc (patch)
treebb8f8131e041eadb0e6b54a5f4c80084e7456f8e /cui
parentUpdate git submodules (diff)
downloadcore-19741593b2f53b35354732808ebd09fbeb335efc.tar.gz
core-19741593b2f53b35354732808ebd09fbeb335efc.zip
bFirst means 1st vs 2nd column, and needs to alternate on each loop
this went wrong at... commit f423ac2d3bdba4263f1f41e31e7e2b7715afdd6e Date: Tue Mar 5 15:16:16 2019 +0200 remove sal_IntPtr in OfaMSFilterTabPage2 and just use a scoped enum Change-Id: I74bcca9ffee9faf4600da64b3c409dbf19a1290e Reviewed-on: https://gerrit.libreoffice.org/76620 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/options/optfltr.cxx22
1 files changed, 13 insertions, 9 deletions
diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx
index 764614a6030e..d4abe42070ed 100644
--- a/cui/source/options/optfltr.cxx
+++ b/cui/source/options/optfltr.cxx
@@ -226,12 +226,14 @@ bool OfaMSFilterTabPage2::FillItemSet( SfxItemSet* )
&SvtFilterOptions::SetSmartArt2Shape },
};
- bool bCheck, bFirst = true;
+ bool bFirstCol = true;
for( const ChkCBoxEntries & rEntry : aChkArr )
{
- sal_uInt16 nCol = bFirst ? 1 : 2;
- if (bFirst)
- bFirst = false;
+ // we loop through the list, alternating reading the first/second column,
+ // each row appears twice in the list (except for smartart, which is import
+ // only
+ sal_uInt16 nCol = bFirstCol ? 1 : 2;
+ bFirstCol = !bFirstCol;
SvTreeListEntry* pEntry = GetEntry4Type( rEntry.eType );
if( pEntry )
{
@@ -239,7 +241,7 @@ bool OfaMSFilterTabPage2::FillItemSet( SfxItemSet* )
if (rItem.GetType() == SvLBoxItemType::Button)
{
SvItemStateFlags nButtonFlags = rItem.GetButtonFlags();
- bCheck = SvButtonState::Checked ==
+ bool bCheck = SvButtonState::Checked ==
SvLBoxButtonData::ConvertToButtonState( nButtonFlags );
if( bCheck != (rOpt.*rEntry.FnIs)() )
@@ -299,12 +301,14 @@ void OfaMSFilterTabPage2::Reset( const SfxItemSet* )
{ MSFltrPg2_CheckBoxEntries::SmartArt, &SvtFilterOptions::IsSmartArt2Shape },
};
- bool bFirst = true;
+ bool bFirstCol = true;
for( const ChkCBoxEntries & rArr : aChkArr )
{
- sal_uInt16 nCol = bFirst ? 1 : 2;
- if (bFirst)
- bFirst = false;
+ // we loop through the list, alternating reading the first/second column,
+ // each row appears twice in the list (except for smartart, which is import
+ // only
+ sal_uInt16 nCol = bFirstCol ? 1 : 2;
+ bFirstCol = !bFirstCol;
SvTreeListEntry* pEntry = GetEntry4Type( rArr.eType );
if( pEntry )
{