summaryrefslogtreecommitdiff
path: root/sc/source/ui
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 /sc/source/ui
parentb39feae4f12b07a0fdb2c8c2a48d5aae613cd7c9 (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 'sc/source/ui')
-rw-r--r--sc/source/ui/docshell/docsh4.cxx10
-rw-r--r--sc/source/ui/inc/printfun.hxx2
-rw-r--r--sc/source/ui/inc/tphf.hxx2
-rw-r--r--sc/source/ui/pagedlg/hfedtdlg.cxx3
-rw-r--r--sc/source/ui/pagedlg/tphf.cxx4
-rw-r--r--sc/source/ui/view/printfun.cxx8
6 files changed, 13 insertions, 16 deletions
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 26ac1ab2f238..e9a362c15e0f 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1651,12 +1651,12 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller,
switch ( eUsage )
{
- case SVX_PAGE_LEFT:
- case SVX_PAGE_RIGHT:
+ case SvxPageUsage::Left:
+ case SvxPageUsage::Right:
{
if ( bHeaderOn && bFooterOn )
nResId = RID_SCDLG_HFEDIT;
- else if ( SVX_PAGE_RIGHT == eUsage )
+ else if ( SvxPageUsage::Right == eUsage )
{
if ( !bHeaderOn && bFooterOn )
nResId = RID_SCDLG_HFEDIT_RIGHTFOOTER;
@@ -1678,8 +1678,8 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller,
}
break;
- case SVX_PAGE_MIRROR:
- case SVX_PAGE_ALL:
+ case SvxPageUsage::Mirror:
+ case SvxPageUsage::All:
default:
{
if ( !bShareHeader && !bShareFooter )
diff --git a/sc/source/ui/inc/printfun.hxx b/sc/source/ui/inc/printfun.hxx
index 000d58917ee9..3271aa9f9d3d 100644
--- a/sc/source/ui/inc/printfun.hxx
+++ b/sc/source/ui/inc/printfun.hxx
@@ -162,7 +162,7 @@ private:
bool bLandscape;
bool bSourceRangeValid;
- sal_uInt16 nPageUsage;
+ SvxPageUsage nPageUsage;
Size aPageSize; // Printer Twips
const SvxBoxItem* pBorderItem;
const SvxBrushItem* pBackgroundItem;
diff --git a/sc/source/ui/inc/tphf.hxx b/sc/source/ui/inc/tphf.hxx
index 06544a0afeda..eadfedd9a256 100644
--- a/sc/source/ui/inc/tphf.hxx
+++ b/sc/source/ui/inc/tphf.hxx
@@ -50,7 +50,7 @@ private:
VclPtr<PushButton> m_pBtnEdit;
SfxItemSet aDataSet;
OUString aStrPageStyle;
- sal_uInt16 nPageUsage;
+ SvxPageUsage nPageUsage;
VclPtr<ScStyleDlg> pStyleDlg;
DECL_LINK( BtnHdl, Button*, void );
diff --git a/sc/source/ui/pagedlg/hfedtdlg.cxx b/sc/source/ui/pagedlg/hfedtdlg.cxx
index 637532239e70..0b0d99f67e3a 100644
--- a/sc/source/ui/pagedlg/hfedtdlg.cxx
+++ b/sc/source/ui/pagedlg/hfedtdlg.cxx
@@ -166,8 +166,7 @@ ScHFEditActiveDlg::ScHFEditActiveDlg(
rCoreSet.Get(
rCoreSet.GetPool()->GetWhich(SID_ATTR_PAGE) ));
- bool bRightPage = ( SVX_PAGE_LEFT !=
- SvxPageUsage(rPageItem.GetPageUsage()) );
+ bool bRightPage = SvxPageUsage::Left != rPageItem.GetPageUsage();
if ( bRightPage )
{
diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx
index a5cb7116a982..c67cebb028cb 100644
--- a/sc/source/ui/pagedlg/tphf.cxx
+++ b/sc/source/ui/pagedlg/tphf.cxx
@@ -46,7 +46,7 @@ ScHFPage::ScHFPage( vcl::Window* pParent, const SfxItemSet& rSet, sal_uInt16 nSe
aDataSet ( *rSet.GetPool(),
ATTR_PAGE_HEADERLEFT, ATTR_PAGE_FOOTERRIGHT,
ATTR_PAGE, ATTR_PAGE, 0 ),
- nPageUsage ( (sal_uInt16)SVX_PAGE_ALL ),
+ nPageUsage ( SvxPageUsage::All ),
pStyleDlg ( nullptr )
{
get(m_pBtnEdit, "buttonEdit");
@@ -201,7 +201,7 @@ IMPL_LINK_NOARG(ScHFPage, HFEditHdl, void*, void)
VclPtrInstance< SfxSingleTabDialog > pDlg(this, aDataSet);
const int nSettingsId = 42;
bool bRightPage = m_pCntSharedBox->IsChecked()
- || ( SVX_PAGE_LEFT != SvxPageUsage(nPageUsage) );
+ || ( SvxPageUsage::Left != nPageUsage );
if ( nId == SID_ATTR_PAGE_HEADERSET )
{
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 83d763432837..9b99d7ad5273 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -1651,17 +1651,15 @@ void ScPrintFunc::PrintArea( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
bool ScPrintFunc::IsMirror( long nPageNo ) // Mirror margins?
{
- SvxPageUsage eUsage = (SvxPageUsage) ( nPageUsage & 0x000f );
- return ( eUsage == SVX_PAGE_MIRROR && (nPageNo & 1) );
+ return nPageUsage == SvxPageUsage::Mirror && (nPageNo & 1);
}
bool ScPrintFunc::IsLeft( long nPageNo ) // left foot notes?
{
- SvxPageUsage eUsage = (SvxPageUsage) ( nPageUsage & 0x000f );
bool bLeft;
- if (eUsage == SVX_PAGE_LEFT)
+ if (nPageUsage == SvxPageUsage::Left)
bLeft = true;
- else if (eUsage == SVX_PAGE_RIGHT)
+ else if (nPageUsage == SvxPageUsage::Right)
bLeft = false;
else
bLeft = (nPageNo & 1) != 0;