summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-06-29 20:02:26 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-06-30 10:34:19 +0200
commit0313b1eeee7f287650c7c9819984e1a35ee96110 (patch)
tree4859f3b20e0bba8ae8d12cf4dfd81c002d6f4e0a
parent011a4932aa35475a81917d5931e2a0f3a43c7336 (diff)
tdf#134360 some sidebar widgets getting stuck in a disabled state
Change-Id: I655525679dd2471e9d0c1a5af246901594b188ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97454 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.cxx26
1 files changed, 12 insertions, 14 deletions
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
index 324a2e587916..12a9eba7e7dd 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
@@ -254,7 +254,12 @@ void ParaPropertyPanel::StateChangedIndentImpl( SfxItemState eState, const SfxPo
break;
}
- if( pState && eState >= SfxItemState::DEFAULT )
+ bool bDisabled = eState == SfxItemState::DISABLED;
+ mxLeftIndent->set_sensitive(!bDisabled);
+ mxRightIndent->set_sensitive(!bDisabled);
+ mxFLineIndent->set_sensitive(!bDisabled);
+
+ if (pState && eState >= SfxItemState::DEFAULT)
{
const SvxLRSpaceItem* pSpace = static_cast<const SvxLRSpaceItem*>(pState);
maTxtLeft = pSpace->GetTextLeft();
@@ -314,13 +319,7 @@ void ParaPropertyPanel::StateChangedIndentImpl( SfxItemState eState, const SfxPo
nfVal = static_cast<long>(mxFLineIndent->normalize( nfVal ));
mxFLineIndent->set_value( nfVal, FieldUnit::MM_100TH );
}
- else if( eState == SfxItemState::DISABLED )
- {
- mxLeftIndent->set_sensitive(false);
- mxRightIndent->set_sensitive(false);
- mxFLineIndent->set_sensitive(false);
- }
- else
+ else if (eState != SfxItemState::DISABLED )
{
mxLeftIndent->set_text("");
mxRightIndent->set_text("");
@@ -335,6 +334,10 @@ void ParaPropertyPanel::StateChangedULImpl( SfxItemState eState, const SfxPoolIt
mxTopDist->set_max( mxTopDist->normalize( MAX_DURCH ), MapToFieldUnit(m_eULSpaceUnit) );
mxBottomDist->set_max( mxBottomDist->normalize( MAX_DURCH ), MapToFieldUnit(m_eULSpaceUnit) );
+ bool bDisabled = eState == SfxItemState::DISABLED;
+ mxTopDist->set_sensitive(!bDisabled);
+ mxBottomDist->set_sensitive(!bDisabled);
+
if( pState && eState >= SfxItemState::DEFAULT )
{
const SvxULSpaceItem* pOldItem = static_cast<const SvxULSpaceItem*>(pState);
@@ -355,12 +358,7 @@ void ParaPropertyPanel::StateChangedULImpl( SfxItemState eState, const SfxPoolIt
nVal = mxBottomDist->normalize( nVal );
mxBottomDist->set_value( nVal, FieldUnit::MM_100TH );
}
- else if(eState == SfxItemState::DISABLED )
- {
- mxTopDist->set_sensitive(false);
- mxBottomDist->set_sensitive(false);
- }
- else
+ else if (eState != SfxItemState::DISABLED )
{
mxTopDist->set_text("");
mxBottomDist->set_text("");