sw/qa/extras/layout/layout2.cxx |    3 +--
 sw/source/core/text/txtfrm.cxx  |   11 ++++++++++-
 2 files changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 7fa083459eb5c5b620454c6e3092d35cdde1b281
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Tue Nov 5 20:04:20 2024 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Wed Nov 6 20:28:37 2024 +0100

    tdf#162268 sw: formatting: paragraph style also applies to para marker
    
    ... so check it in SwTextFrame::IsHiddenNow().
    
    During RTF import, the  produces a RTFSprm that may be deleted before
    inserting by cloneAndDeduplicate() because the style already has the
    same value; this happens in one paragraph in the table in the footer of
    the bugdoc and that's why that row is visible.
    
    (regression from commit 7b8cec8322b60673e686660caf875bc71117bbd0)
    
    Change-Id: I064ecdc04c26afab7ef2196ac4da338b9d0bb1f2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176093
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index 876b437e6f2b..42fa4bba58dc 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -1995,8 +1995,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, 
testParagraphMarkInCell)
         xmlDocUniquePtr pXmlDoc = parseLayoutDump();
         assertXPath(pXmlDoc, "/root/page/body/txt[1]/infos/bounds", "height", 
u"230");
         // the problem was that the table rows were not hidden
-        //TODO        assertXPath(pXmlDoc, 
"/root/page/body/tab[1]/row[1]/infos/bounds", "height",
-        //                    u"0");
+        assertXPath(pXmlDoc, "/root/page/body/tab[1]/row[1]/infos/bounds", 
"height", u"0");
         assertXPath(pXmlDoc, "/root/page/body/tab[1]/row[2]/infos/bounds", 
"height", u"0");
         assertXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds", "height", 
u"230");
     }
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 5420f0b90aa6..2067c2981ae4 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -1577,7 +1577,16 @@ bool SwTextFrame::IsHiddenNow() const
         {
             SwFormatAutoFormat const& 
rListAutoFormat{pNode->GetAttr(RES_PARATR_LIST_AUTOFMT)};
             std::shared_ptr<SfxItemSet> const 
pSet{rListAutoFormat.GetStyleHandle()};
-            SvxCharHiddenItem const*const pItem{pSet ? 
pSet->GetItemIfSet(RES_CHRATR_HIDDEN) : nullptr};
+            SvxCharHiddenItem const* pItem{pSet ? 
pSet->GetItemIfSet(RES_CHRATR_HIDDEN) : nullptr};
+            if (!pItem)
+            {
+                // don't use node's mpAttrSet, it doesn't apply to para marker
+                SwFormatColl const*const pStyle{pNode->GetFormatColl()};
+                if (pStyle)
+                {
+                    pItem = &pStyle->GetFormatAttr(RES_CHRATR_HIDDEN);
+                }
+            }
             if (!pItem || !pItem->GetValue())
             {
                 bHiddenCharsHidePara = false;

Reply via email to