sw/source/core/text/txtfrm.cxx |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit a93ae87551c552b981ac447d27c7ff62379e5d81
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Tue Nov 5 20:04:20 2024 +0100
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Tue Nov 5 21:19:25 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/+/176064
    Tested-by: Thorsten Behrens <thorsten.behr...@allotropia.de>
    Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de>

diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 793a03b98903..6ed5ac1f0232 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -1578,7 +1578,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