summaryrefslogtreecommitdiff
path: root/cui/source/tabpages/transfrm.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-07-19 09:52:29 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-07-19 12:43:32 +0200
commit9f01dca60e6539f48cd529180f0d64c2131e0ea1 (patch)
treed43649c24fe636e9f8f7f64ad76ed64751b6193c /cui/source/tabpages/transfrm.cxx
parentefe42fca7c386340575088ecf94952f3ba0447de (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>
Diffstat (limited to 'cui/source/tabpages/transfrm.cxx')
-rw-r--r--cui/source/tabpages/transfrm.cxx44
1 files changed, 30 insertions, 14 deletions
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);