[Libreoffice-commits] core.git: sw/source

Muhammet Kara (via logerrit) logerrit at kemper.freedesktop.org
Fri Dec 20 21:58:12 UTC 2019


 sw/source/uibase/sidebar/PageOrientationControl.cxx |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit aeab5bfa024f7d15099730fa536d78b5a7a7ea01
Author:     Muhammet Kara <muhammet.kara at collabora.com>
AuthorDate: Fri Dec 20 20:35:00 2019 +0300
Commit:     Muhammet Kara <muhammet.kara at collabora.com>
CommitDate: Fri Dec 20 22:56:56 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.kara at collabora.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()) );
 


More information about the Libreoffice-commits mailing list