[Libreoffice-commits] core.git: cui/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Jul 19 10:43:57 UTC 2018
cui/source/inc/transfrm.hxx | 2 +
cui/source/tabpages/transfrm.cxx | 44 ++++++++++++++++++++++++++-------------
2 files changed, 32 insertions(+), 14 deletions(-)
New commits:
commit 9f01dca60e6539f48cd529180f0d64c2131e0ea1
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Jul 19 09:52:29 2018 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Jul 19 12:43:32 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 <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
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);
More information about the Libreoffice-commits
mailing list