cui/source/inc/transfrm.hxx      |    2 +
 cui/source/tabpages/transfrm.cxx |   44 ++++++++++++++++++++++++++-------------
 2 files changed, 32 insertions(+), 14 deletions(-)

New commits:
commit e8b10d012b14942f79202147b0ef311909413228
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Jul 19 09:52:29 2018 +0100
Commit:     Miklos Vajna <vmik...@collabora.co.uk>
CommitDate: Thu Jul 26 10:28:22 2018 +0200

    tdf#118816 recover initial intent of enabled possibility of tristate as a 
flag
    
    Change-Id: I0150b96e063818cc20e2404081b906ccc5ff0be6
    Reviewed-on: https://gerrit.libreoffice.org/57712
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>
    (cherry picked from commit 9f01dca60e6539f48cd529180f0d64c2131e0ea1)
    Reviewed-on: https://gerrit.libreoffice.org/57713
    Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/cui/source/inc/transfrm.hxx b/cui/source/inc/transfrm.hxx
index d4f9be4e6917..95c137a2b051 100644
--- a/cui/source/inc/transfrm.hxx
+++ b/cui/source/inc/transfrm.hxx
@@ -85,6 +85,8 @@ private:
     bool                mbProtectDisabled;
     bool                mbSizeDisabled;
     bool                mbAdjustDisabled;
+    bool                mbIgnoreAutoGrowWidth;
+    bool                mbIgnoreAutoGrowHeight;
 
     // from size
     // #i75273#
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index fcd86eb7c082..134ac9b3e988 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -763,6 +763,8 @@ 
SvxPositionSizeTabPage::SvxPositionSizeTabPage(TabPageParent pParent, const SfxI
     , mbProtectDisabled(false)
     , mbSizeDisabled(false)
     , mbAdjustDisabled(true)
+    , mbIgnoreAutoGrowWidth(true)
+    , mbIgnoreAutoGrowHeight(true)
     , mfOldWidth(0.0)
     , mfOldHeight(0.0)
     , m_aCtlPos(this)
@@ -890,6 +892,10 @@ void SvxPositionSizeTabPage::Construct()
 
             m_xTsbAutoGrowWidth->connect_toggled( LINK( this, 
SvxPositionSizeTabPage, ClickSizeProtectHdl ) );
             m_xTsbAutoGrowHeight->connect_toggled( LINK( this, 
SvxPositionSizeTabPage, ClickSizeProtectHdl ) );
+
+            // is used as flag to evaluate if its selectable
+            mbIgnoreAutoGrowWidth = false;
+            mbIgnoreAutoGrowHeight = false;
         }
     }
 
@@ -997,23 +1003,33 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* 
rOutAttrs )
 
     if (m_xTsbAutoGrowWidth->get_state_changed_from_saved())
     {
-        if( m_xTsbAutoGrowWidth->get_inconsistent() )
-            rOutAttrs->InvalidateItem( SID_ATTR_TRANSFORM_AUTOWIDTH );
-        else
-            rOutAttrs->Put(
-                SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_AUTOWIDTH ),
-                m_xTsbAutoGrowWidth->get_active() ) );
+        if (!mbIgnoreAutoGrowWidth)
+        {
+            if( m_xTsbAutoGrowWidth->get_inconsistent() )
+                rOutAttrs->InvalidateItem( SID_ATTR_TRANSFORM_AUTOWIDTH );
+            else
+                rOutAttrs->Put(
+                    SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_AUTOWIDTH ),
+                    m_xTsbAutoGrowWidth->get_active() ) );
+        }
         bModified = true;
     }
 
     if (m_xTsbAutoGrowHeight->get_state_changed_from_saved())
     {
-        if (m_xTsbAutoGrowHeight->get_inconsistent())
-            rOutAttrs->InvalidateItem( SID_ATTR_TRANSFORM_AUTOHEIGHT );
-        else
-            rOutAttrs->Put(
-                SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_AUTOHEIGHT ),
-                m_xTsbAutoGrowHeight->get_active() ) );
+        if (!mbIgnoreAutoGrowHeight)
+        {
+            if (m_xTsbAutoGrowHeight->get_inconsistent())
+            {
+                rOutAttrs->InvalidateItem( SID_ATTR_TRANSFORM_AUTOHEIGHT );
+            }
+            else
+            {
+                rOutAttrs->Put(
+                    SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_AUTOHEIGHT ),
+                    m_xTsbAutoGrowHeight->get_active() ) );
+            }
+        }
         bModified = true;
     }
 
@@ -1170,8 +1186,8 @@ void SvxPositionSizeTabPage::UpdateControlStates()
 {
     const bool bPosProtect =  m_xTsbPosProtect->get_state() == TRISTATE_TRUE;
     const bool bSizeProtect = m_xTsbSizeProtect->get_state() == TRISTATE_TRUE;
-    const bool bHeightChecked = !m_xTsbAutoGrowHeight->get_inconsistent() && 
(m_xTsbAutoGrowHeight->get_active());
-    const bool bWidthChecked = !m_xTsbAutoGrowWidth->get_inconsistent() && 
(m_xTsbAutoGrowWidth->get_active());
+    const bool bHeightChecked = !mbIgnoreAutoGrowHeight && 
(m_xTsbAutoGrowHeight->get_active());
+    const bool bWidthChecked = !mbIgnoreAutoGrowWidth && 
(m_xTsbAutoGrowWidth->get_active());
 
     m_xFlPosition->set_sensitive(!bPosProtect && !mbPageDisabled);
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to