cui/source/tabpages/paragrph.cxx              |   10 ++--------
 sw/qa/uitest/writer_tests2/formatParagraph.py |    2 +-
 2 files changed, 3 insertions(+), 9 deletions(-)

New commits:
commit cf370be03dfc6eb2cd4643548f2f25ad3bfc6612
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Sat Apr 27 10:52:29 2024 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon Apr 29 18:57:24 2024 +0200

    tdf#159625: fix "allow to split paragraph"
    
    2 pbs here:
    1) bug described in the bugtracker, the uncheck isn't kept
    => just remove all the buggy GetOldItem stuff
    2) after unchecked the option then saving the file and reloading the file, 
the option is still checked
    => change the buggy
    rOutSet->Put( SvxFormatSplitItem( eState == TRISTATE_FALSE, _nWhich ) );
    to
    rOutSet->Put( SvxFormatSplitItem( eState == TRISTATE_TRUE, _nWhich ) );
    
    In fact, I just mimicked the code used for "keep paragraphs" which works 
well.
    
    Also change the QA test since "allow to split paragraph" is checked by 
default
    so if the QA simulates a click on it, we expect the value to be false when 
dialog is opened again
    
    Change-Id: I947feb02e0c282304621a252ad5e4c168c1d295a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166774
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>
    (cherry picked from commit 83236587bfca52513515b0b7a7dbfa18eed11503)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166725
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 132b125f0293..7675f1f7f0ec 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -1774,14 +1774,8 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* 
rOutSet )
 
     if (m_xAllowSplitBox->get_state_changed_from_saved())
     {
-        pOld = GetOldItem( *rOutSet, SID_ATTR_PARA_SPLIT );
-
-        if ( !pOld || static_cast<const SvxFormatSplitItem*>(pOld)->GetValue() 
!=
-                      ( eState == TRISTATE_FALSE ) )
-        {
-            rOutSet->Put( SvxFormatSplitItem( eState == TRISTATE_FALSE, 
_nWhich ) );
-            bModified = true;
-        }
+        rOutSet->Put( SvxFormatSplitItem( eState == TRISTATE_TRUE, _nWhich ) );
+        bModified = true;
     }
 
     // keep paragraphs
diff --git a/sw/qa/uitest/writer_tests2/formatParagraph.py 
b/sw/qa/uitest/writer_tests2/formatParagraph.py
index e90d0fd7f980..bfa6eff48dc9 100644
--- a/sw/qa/uitest/writer_tests2/formatParagraph.py
+++ b/sw/qa/uitest/writer_tests2/formatParagraph.py
@@ -177,7 +177,7 @@ class formatParagraph(UITestCase):
                 self.assertEqual(get_state_as_dict(xspinWidow)["Text"], "2")
                 self.assertEqual(get_state_as_dict(xcheckWidow)["Selected"], 
"false")
                 self.assertEqual(get_state_as_dict(xcheckOrphan)["Selected"], 
"false")
-                
self.assertEqual(get_state_as_dict(xcheckSplitPara)["Selected"], "true")
+                
self.assertEqual(get_state_as_dict(xcheckSplitPara)["Selected"], "false")
                 
self.assertEqual(get_state_as_dict(xcheckKeepPara)["Selected"], "true")
 
 

Reply via email to