summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-05-11 12:38:25 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-05-11 16:20:00 +0200
commita66e2231c15321835e34469edb748947d6de3464 (patch)
tree953f8090205278e73e4cf89131c542a33c33473e /cui
parentc1c5ac11658966bddb60482e83bfd0cb7a88a318 (diff)
tdf#148730 set current widow/orphan state even if do not split para is set
Change-Id: Ibdb6a830ad502cf04598ce9cd1c232ad6d9d8ade Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134166 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/tabpages/paragrph.cxx81
1 files changed, 40 insertions, 41 deletions
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 32146becdf75..14a43480caa5 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -1779,55 +1779,54 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet )
else
{
m_xKeepTogetherBox->set_state(TRISTATE_FALSE);
-
- // widows and orphans
+ // default widows and orphans to enabled
m_xWidowBox->set_sensitive(true);
- _nWhich = GetWhich( SID_ATTR_PARA_WIDOWS );
- SfxItemState eTmpState = rSet->GetItemState( _nWhich );
-
- if ( eTmpState >= SfxItemState::DEFAULT )
- {
- const SvxWidowsItem& rWidow =
- static_cast<const SvxWidowsItem&>(rSet->Get( _nWhich ));
- aWidowState.bTriStateEnabled = false;
- const sal_uInt16 nLines = rWidow.GetValue();
+ m_xOrphanBox->set_sensitive(true);
+ }
- bool _bEnable = nLines > 0;
- m_xWidowRowNo->set_value(m_xWidowRowNo->normalize(nLines));
- m_xWidowBox->set_state(_bEnable ? TRISTATE_TRUE : TRISTATE_FALSE);
- m_xWidowRowNo->set_sensitive(_bEnable);
- //m_xWidowRowLabel->set_sensitive(_bEnable);
+ // widows and orphans
+ _nWhich = GetWhich( SID_ATTR_PARA_WIDOWS );
+ SfxItemState eTmpState = rSet->GetItemState( _nWhich );
- }
- else if ( SfxItemState::DONTCARE == eTmpState )
- m_xWidowBox->set_state( TRISTATE_INDET );
- else
- m_xWidowBox->set_sensitive(false);
+ if ( eTmpState >= SfxItemState::DEFAULT )
+ {
+ const SvxWidowsItem& rWidow =
+ static_cast<const SvxWidowsItem&>(rSet->Get( _nWhich ));
+ aWidowState.bTriStateEnabled = false;
+ const sal_uInt16 nLines = rWidow.GetValue();
+
+ bool _bEnable = nLines > 0;
+ m_xWidowRowNo->set_value(m_xWidowRowNo->normalize(nLines));
+ m_xWidowBox->set_state(_bEnable ? TRISTATE_TRUE : TRISTATE_FALSE);
+ m_xWidowRowNo->set_sensitive(_bEnable);
+ }
+ else if ( SfxItemState::DONTCARE == eTmpState )
+ m_xWidowBox->set_state( TRISTATE_INDET );
+ else
+ m_xWidowBox->set_sensitive(false);
- m_xOrphanBox->set_sensitive(true);
- _nWhich = GetWhich( SID_ATTR_PARA_ORPHANS );
- eTmpState = rSet->GetItemState( _nWhich );
+ _nWhich = GetWhich( SID_ATTR_PARA_ORPHANS );
+ eTmpState = rSet->GetItemState( _nWhich );
- if ( eTmpState >= SfxItemState::DEFAULT )
- {
- const SvxOrphansItem& rOrphan =
- static_cast<const SvxOrphansItem&>(rSet->Get( _nWhich ));
- const sal_uInt16 nLines = rOrphan.GetValue();
- aOrphanState.bTriStateEnabled = false;
+ if ( eTmpState >= SfxItemState::DEFAULT )
+ {
+ const SvxOrphansItem& rOrphan =
+ static_cast<const SvxOrphansItem&>(rSet->Get( _nWhich ));
+ const sal_uInt16 nLines = rOrphan.GetValue();
+ aOrphanState.bTriStateEnabled = false;
- bool _bEnable = nLines > 0;
- m_xOrphanBox->set_state(_bEnable ? TRISTATE_TRUE : TRISTATE_FALSE);
- m_xOrphanRowNo->set_value(m_xOrphanRowNo->normalize(nLines));
- m_xOrphanRowNo->set_sensitive(_bEnable);
- m_xOrphanRowLabel->set_sensitive(_bEnable);
+ bool _bEnable = nLines > 0;
+ m_xOrphanBox->set_state(_bEnable ? TRISTATE_TRUE : TRISTATE_FALSE);
+ m_xOrphanRowNo->set_value(m_xOrphanRowNo->normalize(nLines));
+ m_xOrphanRowNo->set_sensitive(_bEnable);
+ m_xOrphanRowLabel->set_sensitive(_bEnable);
- }
- else if ( SfxItemState::DONTCARE == eTmpState )
- m_xOrphanBox->set_state(TRISTATE_INDET);
- else
- m_xOrphanBox->set_sensitive(false);
- aOrphanState.eState = m_xOrphanBox->get_state();
}
+ else if ( SfxItemState::DONTCARE == eTmpState )
+ m_xOrphanBox->set_state(TRISTATE_INDET);
+ else
+ m_xOrphanBox->set_sensitive(false);
+ aOrphanState.eState = m_xOrphanBox->get_state();
}
else if ( SfxItemState::DONTCARE == eItemState )
m_xKeepTogetherBox->set_state(TRISTATE_INDET);