summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-07-19 09:52:29 +0100
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2018-08-02 21:38:42 +0200
commit256ebfc14dc09e070d755f87010ddcc0264ae9ac (patch)
tree407d1116b7937007a90fa9cbe981ab7abbba1e60
parentfe2fac02e81fb26969bf507e09aaf0bd7d5ca43b (diff)
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 <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 9f01dca60e6539f48cd529180f0d64c2131e0ea1) Reviewed-on: https://gerrit.libreoffice.org/57760 Reviewed-by: Eike Rathke <erack@redhat.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r--cui/source/inc/transfrm.hxx2
-rw-r--r--cui/source/tabpages/transfrm.cxx44
2 files changed, 32 insertions, 14 deletions
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);