[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - cui/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Jan 25 08:32:27 UTC 2019


 cui/source/tabpages/paragrph.cxx |   56 +++++++++++++++++++++++++--------------
 1 file changed, 37 insertions(+), 19 deletions(-)

New commits:
commit 14f9cd1009074e447a73a66ca65349ac3c2440bc
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Jan 24 13:52:31 2019 +0000
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Jan 25 09:31:58 2019 +0100

    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 at 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 at collabora.com>

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())
     {


More information about the Libreoffice-commits mailing list