summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-09-04 12:02:54 +0200
committerNoel Grandin <noel@peralex.com>2016-09-05 08:21:46 +0200
commit87ee6c044d79978d2121087f5e1a10f417adf9c7 (patch)
tree5b1747d9d625da42a47c3ff0635f0124de0cd511 /sd
parent04a8ba2084950f998d791edad29739c124c8c4b8 (diff)
convert Orientation to scoped enum
Change-Id: Ifbfcf3557ca2a16d21e7a1d613ee54c1c6625f07
Diffstat (limited to 'sd')
-rw-r--r--sd/source/core/sdpage.cxx8
-rw-r--r--sd/source/ui/func/fupage.cxx4
-rw-r--r--sd/source/ui/unoidl/unopage.cxx4
-rw-r--r--sd/source/ui/view/DocumentRenderer.cxx20
-rw-r--r--sd/source/ui/view/drviews7.cxx2
5 files changed, 19 insertions, 19 deletions
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index d794cff6e101..f7e073fcadea 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -126,11 +126,11 @@ SdPage::SdPage(SdDrawDocument& rNewDoc, bool bMasterPage)
if (aPageSize.Width() > aPageSize.Height())
{
- meOrientation = ORIENTATION_LANDSCAPE;
+ meOrientation = Orientation::Landscape;
}
else
{
- meOrientation = ORIENTATION_PORTRAIT;
+ meOrientation = Orientation::Portrait;
}
}
@@ -1732,11 +1732,11 @@ void SdPage::SetSize(const Size& aSize)
// we initialize the orientation.
if (aSize.Width() > aSize.Height())
{
- meOrientation = ORIENTATION_LANDSCAPE;
+ meOrientation = Orientation::Landscape;
}
else
{
- meOrientation = ORIENTATION_PORTRAIT;
+ meOrientation = Orientation::Portrait;
}
}
}
diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx
index 02df0da5defc..b4c6095b64c1 100644
--- a/sd/source/ui/func/fupage.cxx
+++ b/sd/source/ui/func/fupage.cxx
@@ -239,7 +239,7 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* pParent )
SvxPageItem aPageItem( SID_ATTR_PAGE );
aPageItem.SetDescName( mpPage->GetName() );
aPageItem.SetPageUsage( (SvxPageUsage) SVX_PAGE_ALL );
- aPageItem.SetLandscape( mpPage->GetOrientation() == ORIENTATION_LANDSCAPE );
+ aPageItem.SetLandscape( mpPage->GetOrientation() == Orientation::Landscape );
aPageItem.SetNumType( mpDoc->GetPageNumType() );
aNewAttr.Put( aPageItem );
@@ -524,7 +524,7 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs )
mpDoc->SetPageNumType(static_cast<const SvxPageItem*>(pPoolItem)->GetNumType());
eOrientation = static_cast<const SvxPageItem*>(pPoolItem)->IsLandscape() ?
- ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT;
+ Orientation::Landscape : Orientation::Portrait;
if( mpPage->GetOrientation() != eOrientation )
bSetPageSizeAndBorder = true;
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 11269c1dec0b..206cc01f233b 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -694,7 +694,7 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName
if(!::cppu::enum2int( nEnum, aValue ))
throw lang::IllegalArgumentException();
- Orientation eOri = (((view::PaperOrientation)nEnum) == view::PaperOrientation_PORTRAIT)?ORIENTATION_PORTRAIT:ORIENTATION_LANDSCAPE;
+ Orientation eOri = (((view::PaperOrientation)nEnum) == view::PaperOrientation_PORTRAIT)?Orientation::Portrait:Orientation::Landscape;
if( eOri != GetPage()->GetOrientation() )
{
@@ -1054,7 +1054,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName )
break;
case WID_PAGE_ORIENT:
aAny <<= view::PaperOrientation(
- GetPage()->GetOrientation() == ORIENTATION_PORTRAIT
+ GetPage()->GetOrientation() == Orientation::Portrait
? view::PaperOrientation_PORTRAIT
: view::PaperOrientation_LANDSCAPE);
break;
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx
index 3eee8172e629..886f21f6305a 100644
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -266,7 +266,7 @@ namespace {
msPageString(),
maPrintSize(0,0),
maPageSize(0,0),
- meOrientation(ORIENTATION_PORTRAIT),
+ meOrientation(Orientation::Portrait),
maMap(),
mbPrintMarkedOnly(bPrintMarkedOnly)
{}
@@ -1374,14 +1374,14 @@ private:
PrintInfo& rInfo)
{
SdDrawDocument* pDocument = mrBase.GetMainViewShell()->GetDoc();
- rInfo.meOrientation = ORIENTATION_PORTRAIT;
+ rInfo.meOrientation = Orientation::Portrait;
if( ! mpOptions->IsBooklet())
{
rInfo.meOrientation = pDocument->GetSdPage(0, ePageKind)->GetOrientation();
}
else if (rInfo.maPageSize.Width() < rInfo.maPageSize.Height())
- rInfo.meOrientation = ORIENTATION_LANDSCAPE;
+ rInfo.meOrientation = Orientation::Landscape;
// Draw and Notes should usually abide by their specified paper size
Size aPaperSize;
@@ -1400,10 +1400,10 @@ private:
if (mpOptions->IsPrinterPreferred(pDocument->GetDocumentType()))
{
- if( (rInfo.meOrientation == ORIENTATION_LANDSCAPE &&
+ if( (rInfo.meOrientation == Orientation::Landscape &&
(aPaperSize.Width() < aPaperSize.Height()))
||
- (rInfo.meOrientation == ORIENTATION_PORTRAIT &&
+ (rInfo.meOrientation == Orientation::Portrait &&
(aPaperSize.Width() > aPaperSize.Height()))
)
{
@@ -1788,10 +1788,10 @@ private:
rInfo.meOrientation = rMaster.GetOrientation();
const Size aPaperSize (rInfo.mpPrinter->GetPaperSize());
- if( (rInfo.meOrientation == ORIENTATION_LANDSCAPE &&
+ if( (rInfo.meOrientation == Orientation::Landscape &&
(aPaperSize.Width() < aPaperSize.Height()))
||
- (rInfo.meOrientation == ORIENTATION_PORTRAIT &&
+ (rInfo.meOrientation == Orientation::Portrait &&
(aPaperSize.Width() > aPaperSize.Height()))
)
{
@@ -2003,7 +2003,7 @@ private:
Size aPrintSize_2 (rInfo.maPrintSize);
Size aPageSize_2 (rInfo.maPageSize);
- if (rInfo.meOrientation == ORIENTATION_LANDSCAPE)
+ if (rInfo.meOrientation == Orientation::Landscape)
aPrintSize_2.Width() >>= 1;
else
aPrintSize_2.Height() >>= 1;
@@ -2032,7 +2032,7 @@ private:
aStdMap,
aMap));
- if (rInfo.meOrientation == ORIENTATION_LANDSCAPE)
+ if (rInfo.meOrientation == Orientation::Landscape)
{
aOffset.X() = ( ( aAdjustedPrintSize.Width() >> 1 ) - rInfo.maPageSize.Width() ) >> 1;
aOffset.Y() = ( aAdjustedPrintSize.Height() - rInfo.maPageSize.Height() ) >> 1;
@@ -2093,7 +2093,7 @@ private:
{
const std::pair<sal_uInt16, sal_uInt16> aPair (aPairVector[nIndex]);
Point aSecondOffset (aOffset);
- if (rInfo.meOrientation == ORIENTATION_LANDSCAPE)
+ if (rInfo.meOrientation == Orientation::Landscape)
aSecondOffset.X() += aAdjustedPrintSize.Width() / 2;
else
aSecondOffset.Y() += aAdjustedPrintSize.Height() / 2;
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index 83e3b28c8ac2..c821eef43d40 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -1650,7 +1650,7 @@ void DrawViewShell::GetPageProperties( SfxItemSet &rSet )
if (pPage != nullptr && GetDoc() != nullptr)
{
SvxPageItem aPageItem(SID_ATTR_PAGE);
- aPageItem.SetLandscape( pPage->GetOrientation() == ORIENTATION_LANDSCAPE );
+ aPageItem.SetLandscape( pPage->GetOrientation() == Orientation::Landscape );
rSet.Put(SvxSizeItem( SID_ATTR_PAGE_SIZE, pPage->GetSize() ));
rSet.Put(aPageItem);