diff options
author | Muhammet Kara <muhammet.kara@collabora.com> | 2019-12-20 20:35:00 +0300 |
---|---|---|
committer | Muhammet Kara <muhammet.kara@collabora.com> | 2019-12-21 10:54:58 +0100 |
commit | 142df3a7baa0ada853787ead27f36e08e5947360 (patch) | |
tree | ac58aea6805e40f321a58fcc420b6ed110478af5 /sw/source/uibase | |
parent | 21a33d9c7045efeae819a91b12cd35d0a161848f (diff) |
tdf#129526: Prevent accidental toggling of page orientation
Change-Id: I3145cb34ec782c1aa60fe864a6ec7c195185ad18
Reviewed-on: https://gerrit.libreoffice.org/85626
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/sidebar/PageOrientationControl.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sw/source/uibase/sidebar/PageOrientationControl.cxx b/sw/source/uibase/sidebar/PageOrientationControl.cxx index aa810867aae9..3602e2b76411 100644 --- a/sw/source/uibase/sidebar/PageOrientationControl.cxx +++ b/sw/source/uibase/sidebar/PageOrientationControl.cxx @@ -113,6 +113,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()) ); |