sw/source/uibase/sidebar/PageOrientationControl.cxx | 8 ++++++++ 1 file changed, 8 insertions(+)
New commits: commit 142df3a7baa0ada853787ead27f36e08e5947360 Author: Muhammet Kara <[email protected]> AuthorDate: Fri Dec 20 20:35:00 2019 +0300 Commit: Muhammet Kara <[email protected]> CommitDate: Sat Dec 21 10:54:58 2019 +0100 tdf#129526: Prevent accidental toggling of page orientation Change-Id: I3145cb34ec782c1aa60fe864a6ec7c195185ad18 Reviewed-on: https://gerrit.libreoffice.org/85626 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Muhammet Kara <[email protected]> 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()) ); _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
