Kaydet (Commit) 37a4651c authored tarafından Matteo Casalin's avatar Matteo Casalin

Use Orientation enum instead of sal_uInt16 + some bool

Change-Id: I8c0cd02cb339111442a99e8051f585bb0599633a
üst 36e52cbb
...@@ -351,7 +351,7 @@ public: ...@@ -351,7 +351,7 @@ public:
static inline bool IsLstEndAction() { return SwViewShell::mbLstAct; } static inline bool IsLstEndAction() { return SwViewShell::mbLstAct; }
// Change of all page descriptors. // Change of all page descriptors.
void ChgAllPageOrientation( sal_uInt16 eOri ); void ChgAllPageOrientation( Orientation eOri );
void ChgAllPageSize( Size &rSz ); void ChgAllPageSize( Size &rSz );
// Printing of one page. // Printing of one page.
......
...@@ -216,13 +216,13 @@ void SwViewShell::InitPrt( OutputDevice *pOutDev ) ...@@ -216,13 +216,13 @@ void SwViewShell::InitPrt( OutputDevice *pOutDev )
mpOut = pOutDev; mpOut = pOutDev;
} }
void SwViewShell::ChgAllPageOrientation( sal_uInt16 eOri ) void SwViewShell::ChgAllPageOrientation( Orientation eOri )
{ {
OSL_ENSURE( mnStartAction, "missing an Action" ); OSL_ENSURE( mnStartAction, "missing an Action" );
SET_CURR_SHELL( this ); SET_CURR_SHELL( this );
const sal_uInt16 nAll = GetDoc()->GetPageDescCnt(); const sal_uInt16 nAll = GetDoc()->GetPageDescCnt();
bool bNewOri = Orientation(eOri) == ORIENTATION_PORTRAIT ? sal_False : sal_True; bool bNewOri = eOri != ORIENTATION_PORTRAIT;
for( sal_uInt16 i = 0; i < nAll; ++ i ) for( sal_uInt16 i = 0; i < nAll; ++ i )
{ {
......
...@@ -1667,7 +1667,7 @@ sal_uInt16 SwPagePreview::SetPrinter( SfxPrinter *pNew, sal_uInt16 nDiffFlags, ...@@ -1667,7 +1667,7 @@ sal_uInt16 SwPagePreview::SetPrinter( SfxPrinter *pNew, sal_uInt16 nDiffFlags,
{ {
rESh.StartAllAction(); rESh.StartAllAction();
if ( bChgOri ) if ( bChgOri )
rSh.ChgAllPageOrientation( sal_uInt16(pNew->GetOrientation()) ); rSh.ChgAllPageOrientation( pNew->GetOrientation() );
if ( bChgSize ) if ( bChgSize )
{ {
Size aSz( SvxPaperInfo::GetPaperSize( pNew ) ); Size aSz( SvxPaperInfo::GetPaperSize( pNew ) );
......
...@@ -121,13 +121,13 @@ sal_uInt16 SwView::SetPrinter(SfxPrinter* pNew, sal_uInt16 nDiffFlags, bool ) ...@@ -121,13 +121,13 @@ sal_uInt16 SwView::SetPrinter(SfxPrinter* pNew, sal_uInt16 nDiffFlags, bool )
if ( nDiffFlags & SFX_PRINTER_OPTIONS ) if ( nDiffFlags & SFX_PRINTER_OPTIONS )
::SetPrinter( rSh.getIDocumentDeviceAccess(), pNew, bWeb ); ::SetPrinter( rSh.getIDocumentDeviceAccess(), pNew, bWeb );
const bool bChgOri = nDiffFlags & SFX_PRINTER_CHG_ORIENTATION ? sal_True : sal_False; const bool bChgOri = nDiffFlags & SFX_PRINTER_CHG_ORIENTATION;
const bool bChgSize= nDiffFlags & SFX_PRINTER_CHG_SIZE ? sal_True : sal_False; const bool bChgSize= nDiffFlags & SFX_PRINTER_CHG_SIZE;
if ( bChgOri || bChgSize ) if ( bChgOri || bChgSize )
{ {
rSh.StartAllAction(); rSh.StartAllAction();
if ( bChgOri ) if ( bChgOri )
rSh.ChgAllPageOrientation( sal_uInt16(pNew->GetOrientation()) ); rSh.ChgAllPageOrientation( pNew->GetOrientation() );
if ( bChgSize ) if ( bChgSize )
{ {
Size aSz( SvxPaperInfo::GetPaperSize( pNew ) ); Size aSz( SvxPaperInfo::GetPaperSize( pNew ) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment