sw/qa/extras/layout/layout2.cxx | 3 +-- sw/source/core/text/txtfrm.cxx | 11 ++++++++++- 2 files changed, 11 insertions(+), 3 deletions(-)
New commits: commit c9bc2df1f1f68c7cfca84c0b205b34d82528a28e Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Tue Nov 5 20:04:20 2024 +0100 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Mon Nov 11 01:43:00 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> (cherry picked from commit 7fa083459eb5c5b620454c6e3092d35cdde1b281) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176076 Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx index 6319e9335bba..f5402cbc2c30 100644 --- a/sw/qa/extras/layout/layout2.cxx +++ b/sw/qa/extras/layout/layout2.cxx @@ -2255,8 +2255,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testParagraphMarkInCell) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page/body/txt[1]/infos/bounds"_ostr, "height"_ostr, "230"); // the problem was that the table rows were not hidden - //TODO assertXPath(pXmlDoc, "/root/page/body/tab[1]/row[1]/infos/bounds"_ostr, "height"_ostr, - // "0"); + assertXPath(pXmlDoc, "/root/page/body/tab[1]/row[1]/infos/bounds"_ostr, "height"_ostr, "0"); assertXPath(pXmlDoc, "/root/page/body/tab[1]/row[2]/infos/bounds"_ostr, "height"_ostr, "0"); assertXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds"_ostr, "height"_ostr, "230"); discardDumpedLayout(); 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;