tdf#129526: Prevent accidental toggling of page orientation

Change-Id: I3145cb34ec782c1aa60fe864a6ec7c195185ad18
Reviewed-on: https://gerrit.libreoffice.org/85637
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
This commit is contained in:
Muhammet Kara
2019-12-20 22:56:56 +01:00
parent df52a21327
commit aeab5bfa02
@@ -114,6 +114,14 @@ void PageOrientationControl::ExecuteOrientationChange( const bool bLandscape )
SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_PAGE_SIZE, pItem);
mpPageSizeItem.reset( static_cast<SvxSizeItem*>(pItem->Clone()) );
// Prevent accidental toggling of page orientation
if ((mpPageSizeItem->GetWidth() > mpPageSizeItem->GetHeight()) == bLandscape)
{
if ( mxUndoManager.is() )
mxUndoManager->leaveUndoContext();
return;
}
SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_PAGE_LRSPACE, pItem);
mpPageLRMarginItem.reset( static_cast<SvxLongLRSpaceItem*>(pItem->Clone()) );