[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sw/source

Muhammet Kara (via logerrit) logerrit at kemper.freedesktop.org
Sat Dec 21 09:55:51 UTC 2019


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

New commits:
commit 142df3a7baa0ada853787ead27f36e08e5947360
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: 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 <jenkinscollaboraoffice at gmail.com>
    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 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()) );
 


More information about the Libreoffice-commits mailing list