diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-01-24 13:52:31 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-01-24 20:01:20 +0100 |
commit | c66027d18eecaf29962e251def4203091d1669f3 (patch) | |
tree | 88316f7c3a45c705488037a4f89675c3f7cc9ce6 /cui | |
parent | 9a2954f566b88c06c9e3aa34e1fa7e23200182ee (diff) |
Related: tdf#122914 visiting alignment page sets an SvxAdjustItem
even if the user doesn't interact with anything, since...
commit 122da2eea23faf6916c3f3b9e1895f5c404b26c7
Author: Jim Raykowski <raykowj@gmail.com>
Date: Sat Nov 18 22:21:24 2017 -0900
tdf#107567 et al. Paragraph dialog preview windows fixes
tdf#107567 tdf#98211 tdf#98212 tdf#113275
Checking those issues, I don't see a change if I put this
part back to only set SvxAdjustItem in FillItemSet if the radio-button
has changed (or justify subcontrols if justify was already set)
Change-Id: Ia68c50fd659be5b507d6e0989caecb353b494df7
Reviewed-on: https://gerrit.libreoffice.org/66872
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/tabpages/paragrph.cxx | 56 |
1 files changed, 37 insertions, 19 deletions
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index 40dbffd567ea..4ceb0c88b0a7 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -1059,34 +1059,52 @@ bool SvxParaAlignTabPage::FillItemSet( SfxItemSet* rOutSet ) { bool bModified = false; + bool bAdj = false; SvxAdjust eAdjust = SvxAdjust::Left; - if ( m_xLeft->get_active() ) + if (m_xLeft->get_active()) + { eAdjust = SvxAdjust::Left; - else if ( m_xRight->get_active() ) + bAdj = m_xLeft->get_saved_state() == TRISTATE_FALSE; + } + else if (m_xRight->get_active()) + { eAdjust = SvxAdjust::Right; - else if ( m_xCenter->get_active() ) + bAdj = m_xRight->get_saved_state() == TRISTATE_FALSE; + } + else if (m_xCenter->get_active()) + { eAdjust = SvxAdjust::Center; - else if ( m_xJustify->get_active() ) + bAdj = m_xCenter->get_saved_state() == TRISTATE_FALSE; + } + else if (m_xJustify->get_active()) + { eAdjust = SvxAdjust::Block; + bAdj = m_xJustify->get_saved_state() == TRISTATE_FALSE || + m_xExpandCB->get_state_changed_from_saved() || + m_xLastLineLB->get_value_changed_from_saved(); + } sal_uInt16 _nWhich = GetWhich( SID_ATTR_PARA_ADJUST ); - SvxAdjust eOneWord = m_xExpandCB->get_active() ? SvxAdjust::Block : SvxAdjust::Left; - - int nLBPos = m_xLastLineLB->get_active(); - SvxAdjust eLastBlock = SvxAdjust::Left; - if ( 1 == nLBPos ) - eLastBlock = SvxAdjust::Center; - else if ( 2 == nLBPos ) - eLastBlock = SvxAdjust::Block; - - SvxAdjustItem aAdj( static_cast<const SvxAdjustItem&>(GetItemSet().Get( _nWhich )) ); - aAdj.SetAdjust( eAdjust ); - aAdj.SetOneWord( eOneWord ); - aAdj.SetLastBlock( eLastBlock ); - rOutSet->Put( aAdj ); - bModified = true; + if (bAdj) + { + SvxAdjust eOneWord = m_xExpandCB->get_active() ? SvxAdjust::Block : SvxAdjust::Left; + + int nLBPos = m_xLastLineLB->get_active(); + SvxAdjust eLastBlock = SvxAdjust::Left; + if ( 1 == nLBPos ) + eLastBlock = SvxAdjust::Center; + else if ( 2 == nLBPos ) + eLastBlock = SvxAdjust::Block; + + SvxAdjustItem aAdj( static_cast<const SvxAdjustItem&>(GetItemSet().Get( _nWhich )) ); + aAdj.SetAdjust( eAdjust ); + aAdj.SetOneWord( eOneWord ); + aAdj.SetLastBlock( eLastBlock ); + rOutSet->Put( aAdj ); + bModified = true; + } if (m_xSnapToGridCB->get_state_changed_from_saved()) { |