diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-12 15:55:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-13 06:54:23 +0000 |
commit | 8fce16fb573506c24aa06e86b476fa6f42ea60b9 (patch) | |
tree | 2817c8c6ff49b141dcb2dfd38582b7272ecff0f1 /sw/source/uibase/sidebar/PageStylesPanel.cxx | |
parent | b39feae4f12b07a0fdb2c8c2a48d5aae613cd7c9 (diff) |
convert SvxPageUsage to scoped enum
and expand out the bit-tricks some of the code was playing to make it
more obvious what is going on
Change-Id: I9c98334393b939b1d900425f6133556ce88247ae
Reviewed-on: https://gerrit.libreoffice.org/29734
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase/sidebar/PageStylesPanel.cxx')
-rw-r--r-- | sw/source/uibase/sidebar/PageStylesPanel.cxx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sw/source/uibase/sidebar/PageStylesPanel.cxx b/sw/source/uibase/sidebar/PageStylesPanel.cxx index 7cc75c5da45c..95985af7ed5a 100644 --- a/sw/source/uibase/sidebar/PageStylesPanel.cxx +++ b/sw/source/uibase/sidebar/PageStylesPanel.cxx @@ -41,28 +41,28 @@ using namespace ::com::sun::star; namespace sw { namespace sidebar{ -const sal_uInt16 aArr[] = +const SvxPageUsage aArr[] = { - SVX_PAGE_ALL, - SVX_PAGE_MIRROR, - SVX_PAGE_RIGHT, - SVX_PAGE_LEFT + SvxPageUsage::All, + SvxPageUsage::Mirror, + SvxPageUsage::Right, + SvxPageUsage::Left }; -sal_uInt16 PageUsageToPos_Impl( sal_uInt16 nUsage ) +sal_uInt16 PageUsageToPos_Impl( SvxPageUsage nUsage ) { for ( sal_uInt16 i = 0; i < SAL_N_ELEMENTS(aArr); ++i ) - if ( aArr[i] == ( nUsage & 0x000f ) ) + if ( aArr[i] == nUsage ) return i; - return SVX_PAGE_ALL; + return 3; } -sal_uInt16 PosToPageUsage_Impl( sal_uInt16 nPos ) +SvxPageUsage PosToPageUsage_Impl( sal_uInt16 nPos ) { if ( nPos >= SAL_N_ELEMENTS(aArr) ) - return 0; + return SvxPageUsage::NONE; return aArr[nPos]; } @@ -357,7 +357,7 @@ void PageStylesPanel::NotifyItemUpdate( SvxNumType eNumType = mpPageItem->GetNumType(); mpNumberSelectLB->SetSelection(eNumType); - sal_uInt16 nUse = mpPageItem->GetPageUsage(); + SvxPageUsage nUse = mpPageItem->GetPageUsage(); mpLayoutSelectLB->SelectEntryPos( PageUsageToPos_Impl( nUse ) ); } } |