summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-07-30 16:43:44 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-07-30 21:14:29 +0200
commitee0613bd9ed3a9539f1ebb58b51962c9ccd13376 (patch)
treeeff71257cbe9853528b564dfbc62fab9446fbf3d /cui
parent588f50ac41666e73a7c73c13e677a9927bad991f (diff)
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/76619 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
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 d11c655a472f..54d7e5817fe2 100644
--- a/cui/source/options/optfltr.cxx
+++ b/cui/source/options/optfltr.cxx
@@ -210,12 +210,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 )
{
@@ -223,7 +225,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)() )
@@ -283,12 +285,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 )
{