tdf#162268 sw: formatting: paragraph style also applies to para marker

... so check it in SwTextFrame::IsHiddenNow().

During RTF import, the \v 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 7b8cec8322)

Change-Id: I064ecdc04c26afab7ef2196ac4da338b9d0bb1f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176093
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
This commit is contained in:
Michael Stahl
2024-11-06 20:28:37 +01:00
parent a6d0b7f683
commit 7fa083459e
2 changed files with 11 additions and 3 deletions
+1 -2
View File
@@ -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");
}
+10 -1
View File
@@ -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;