sw/source/uibase/sidebar/PageOrientationControl.cxx | 8 ++++++++ 1 file changed, 8 insertions(+)
New commits: commit 1ef21ea98b46267d82da017ab2fec8e05d8e638b Author: Muhammet Kara <muhammet.k...@collabora.com> AuthorDate: Fri Dec 20 20:35:00 2019 +0300 Commit: Adolfo Jayme Barrientos <fit...@ubuntu.com> CommitDate: Tue Dec 24 05:48:32 2019 +0100 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.k...@collabora.com> (cherry picked from commit aeab5bfa024f7d15099730fa536d78b5a7a7ea01) Reviewed-on: https://gerrit.libreoffice.org/85737 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/sw/source/uibase/sidebar/PageOrientationControl.cxx b/sw/source/uibase/sidebar/PageOrientationControl.cxx index 0d9844efef36..9d9caa418b1d 100644 --- a/sw/source/uibase/sidebar/PageOrientationControl.cxx +++ b/sw/source/uibase/sidebar/PageOrientationControl.cxx @@ -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()) ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits