summaryrefslogtreecommitdiffstats
path: root/cui/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-10-12 15:55:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-10-13 06:54:23 +0000
commit8fce16fb573506c24aa06e86b476fa6f42ea60b9 (patch)
tree2817c8c6ff49b141dcb2dfd38582b7272ecff0f1 /cui/source
parenttdf#89317 ww8export: don't corrupt table with postponed text (diff)
downloadcore-8fce16fb573506c24aa06e86b476fa6f42ea60b9.tar.gz
core-8fce16fb573506c24aa06e86b476fa6f42ea60b9.zip
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 'cui/source')
-rw-r--r--cui/source/tabpages/page.cxx26
1 files changed, 13 insertions, 13 deletions
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index a6097ea8aaa2..b15879f5af5e 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -79,28 +79,28 @@ const sal_uInt16 SvxPageDescPage::pRanges[] =
};
// ------- Mapping page layout ------------------------------------------
-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];
}
@@ -468,7 +468,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
// general page data
SvxNumType eNumType = css::style::NumberingType::ARABIC;
bLandscape = ( mpDefPrinter->GetOrientation() == Orientation::Landscape );
- sal_uInt16 nUse = (sal_uInt16)SVX_PAGE_ALL;
+ SvxPageUsage nUse = SvxPageUsage::All;
pItem = GetItem( *rSet, SID_ATTR_PAGE );
if ( pItem )
@@ -894,9 +894,9 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet )
IMPL_LINK_NOARG(SvxPageDescPage, LayoutHdl_Impl, ListBox&, void)
{
// switch inside outside
- const sal_uInt16 nPos = PosToPageUsage_Impl( m_pLayoutBox->GetSelectEntryPos() );
+ const SvxPageUsage nUsage = PosToPageUsage_Impl( m_pLayoutBox->GetSelectEntryPos() );
- if ( nPos == SVX_PAGE_MIRROR )
+ if ( nUsage == SvxPageUsage::Mirror )
{
m_pLeftMarginLbl->Hide();
m_pRightMarginLbl->Hide();