summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-01-24 13:52:31 +0000
committerMiklos Vajna <vmiklos@collabora.com>2019-01-25 09:31:58 +0100
commit14f9cd1009074e447a73a66ca65349ac3c2440bc (patch)
treed7e5fc37ad1fdf54b468393212acbc1db591bf4a /cui
parent7666c1e958a6e2326b38497b4acb763f8fa53ea6 (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/66882 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/tabpages/paragrph.cxx56
1 files changed, 37 insertions, 19 deletions
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 4ea53b306251..f522b62b95d1 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())
{