diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2025-02-19 16:25:35 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2025-02-20 17:27:12 +0100 |
commit | 8712673a445edeb28a5f3029bbcaa096f38d72e6 (patch) | |
tree | 220244cd8f170bca3c3d0bf34367a726de4d186e /sw/qa | |
parent | c42af7177292011d313188be547f65058a9949c6 (diff) |
sw: use same paragraph properties as Word for hidden text
This is a follow-up to commit 2bcfb7231b5ca74f02274cfb74ca8463f78905d6
"tdf#152872 sw: conditionally hide paragraph breaks".
Word determines the paragraph properties differently depending on
whether paragraphs are merged by hidden text (where the first paragraph
containing non-hidden text wins) or delete redlines (where the last
paragraph wins).
This fixes the hidden text situation while leaving the delete redline
situation as it is.
The problem is that CheckParaRedlineMerge() only considers hidden text
on the paragraph end marker (RES_PARATR_LIST_AUTOFMT) but not elsewhere
in the paragraph, so there are extents for the hidden text.
The actual hiding of that is done via ScriptInfo::m_HiddenChg, which
cannot be removed and replaced by merging because it is required for
Writer's notion of hidden paragraphs in SwTextFrame::IsHiddenNowImpl().
* FindParaPropsNodeIgnoreHidden() skips over nodes that contain only
hidden text in case hidden text isn't shown
* factor out ScriptInfo::InitScriptInfoHidden() because it is now needed
to find the pParaPropsNode, but the rest of InitScriptInfo() requires
the pParaPropsNode...
* testTdf152872 requires changes as it was relying on ControlCharacters
alone toggling the merging
list of commits that tweaked setting pParaPropsNode:
58353884dc86bdb3c1464f8bbf8c3e131584b78a (related: tdf#130685) sw: adapt definition of sw_redlinehide index 0
b86ff2c6a88aa41379e74f11e8ec8497ff85ffd0 tdf#118699 sw_redlinehide: need some more changes to use the last node
fa5eb82b398e29ae033f7b7c8c8195dfc10cf5b0 tdf#118699 change tracking: don't number empty lines
beec1594587d0bf1ea2268f9a435c948b5580278 tdf#125319 sw_redlinehide: handle empty paragraphs more like Word
c20308f1b919ca5ce61233068946e5fddb7eadb3 sw_redlinehide_4b: surprising discoveries
Change-Id: If0e49a4d105dbf7d71e753967f36f2ec56f21f1d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181918
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Jenkins
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/layout/data/merge_hidden_redline.docx | bin | 0 -> 15478 bytes | |||
-rw-r--r-- | sw/qa/extras/layout/layout2.cxx | 247 |
2 files changed, 237 insertions, 10 deletions
diff --git a/sw/qa/extras/layout/data/merge_hidden_redline.docx b/sw/qa/extras/layout/data/merge_hidden_redline.docx Binary files differnew file mode 100644 index 000000000000..7a7013321402 --- /dev/null +++ b/sw/qa/extras/layout/data/merge_hidden_redline.docx diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx index 5dc1e6fff241..9364add9ecaf 100644 --- a/sw/qa/extras/layout/layout2.cxx +++ b/sw/qa/extras/layout/layout2.cxx @@ -20,6 +20,10 @@ #include <o3tl/string_view.hxx> #include <rootfrm.hxx> +#include <pagefrm.hxx> +#include <bodyfrm.hxx> +#include <txtfrm.hxx> +#include <ndtxt.hxx> #include <wrtsh.hxx> #include <IDocumentLayoutAccess.hxx> #include <IDocumentRedlineAccess.hxx> @@ -707,24 +711,25 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf152872) // 5 is empty and hidden assertXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds", "height", u"0"); - dispatchCommand(mxComponent, u".uno:ControlCodes"_ustr, {}); + SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); + SwViewOption aViewOptions(*pWrtShell->GetViewOptions()); + aViewOptions.SetShowHiddenChar(true); + aViewOptions.SetViewMetaChars(true); + pWrtShell->ApplyViewOptions(aViewOptions); pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt", 5); assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout", "portion", u"C "); assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout", "portion", u"D"); - // 3 is an empty paragraph with RES_CHRATR_HIDDEN which results in 0-height - // frame; ideally it should only be hidden when control codes are hidden - // and be a full-height frame now, but that needs more work... - assertXPath(pXmlDoc, "/root/page/body/txt[3]/infos/bounds", "height", u"0"); + // 3 is an empty paragraph with RES_CHRATR_HIDDEN + assertXPath(pXmlDoc, "/root/page/body/txt[3]/infos/bounds", "height", u"398"); assertXPath(pXmlDoc, "/root/page/body/txt[4]/SwParaPortion/SwLineLayout", "portion", u"E"); - // 5 is an empty paragraph with RES_CHRATR_HIDDEN which results in 0-height - // frame; ideally it should only be hidden when control codes are hidden - // and be a full-height frame now, but that needs more work... - assertXPath(pXmlDoc, "/root/page/body/txt[5]/infos/bounds", "height", u"0"); + // 5 is an empty paragraph with RES_CHRATR_HIDDEN + assertXPath(pXmlDoc, "/root/page/body/txt[5]/infos/bounds", "height", u"398"); - dispatchCommand(mxComponent, u".uno:ControlCodes"_ustr, {}); + aViewOptions.SetViewMetaChars(false); + pWrtShell->ApplyViewOptions(aViewOptions); pXmlDoc = parseLayoutDump(); @@ -734,6 +739,228 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf152872) assertXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds", "height", u"0"); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testHiddenParaProps) +{ + createSwDoc("merge_hidden_redline.docx"); + + SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); + SwViewOption aViewOptions(*pWrtShell->GetViewOptions()); + aViewOptions.SetShowHiddenChar(true); + aViewOptions.SetViewMetaChars(true); + pWrtShell->ApplyViewOptions(aViewOptions); + + // note: do not use layout dump here, because it doesn't work: + // SwTextFrame::Format doesn't actually create the SwMarginPortion for + // non-left-aligned frames; instead, it sets SetFormatAdj() flag and later + // *SwTextPainter* checks via GetAdjusted() if the flag is set and calls + // CalcAdjLine() which inserts the SwMarginPortion. + + SwRootFrame* pRoot = pWrtShell->GetLayout(); + CPPUNIT_ASSERT(pRoot->GetLower()->IsPageFrame()); + SwPageFrame* pPage = static_cast<SwPageFrame*>(pRoot->GetLower()); + CPPUNIT_ASSERT(pPage->GetLower()->IsBodyFrame()); + SwBodyFrame* pBody = static_cast<SwBodyFrame*>(pPage->GetLower()); + CPPUNIT_ASSERT(pBody->GetLower()->IsTextFrame()); + SwTextFrame* pTextFrame = dynamic_cast<SwTextFrame*>(pBody->GetLower()); + + CPPUNIT_ASSERT_EQUAL(u"1 hidden, delete-merge"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + // TODO: redlines don't merge like in Word yet + CPPUNIT_ASSERT_EQUAL(u"Abcdef"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"ghi"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"2 visible, delete-merge"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"abcghi"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"def"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"3 delete-merge"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"def"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"ghi"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"4 delete-merge, delete-merge"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"abc"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"def"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u""_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"5 visible, hidden-merge, visible"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"abc"_ustr, pTextFrame->GetText()); + CPPUNIT_ASSERT_EQUAL( + SvxAdjust::Center, + pTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().Get(RES_PARATR_ADJUST).GetAdjust()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"def"_ustr, pTextFrame->GetText()); + CPPUNIT_ASSERT_EQUAL( + SvxAdjust::Left, + pTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().Get(RES_PARATR_ADJUST).GetAdjust()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"6 hidden-merge, visible"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"abc"_ustr, pTextFrame->GetText()); + CPPUNIT_ASSERT_EQUAL( + SvxAdjust::Center, + pTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().Get(RES_PARATR_ADJUST).GetAdjust()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"def"_ustr, pTextFrame->GetText()); + CPPUNIT_ASSERT_EQUAL( + SvxAdjust::Left, + pTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().Get(RES_PARATR_ADJUST).GetAdjust()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"7 visible, hidden-merge"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"abcdef"_ustr, pTextFrame->GetText()); + CPPUNIT_ASSERT_EQUAL( + SvxAdjust::Center, + pTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().Get(RES_PARATR_ADJUST).GetAdjust()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"ghi"_ustr, pTextFrame->GetText()); + CPPUNIT_ASSERT_EQUAL( + SvxAdjust::Left, + pTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().Get(RES_PARATR_ADJUST).GetAdjust()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"8 visible, delete-merge, visible, hidden-merge, visible"_ustr, + pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"abc"_ustr, pTextFrame->GetText()); + CPPUNIT_ASSERT_EQUAL( + SvxAdjust::Right, + pTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().Get(RES_PARATR_ADJUST).GetAdjust()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"def"_ustr, pTextFrame->GetText()); + CPPUNIT_ASSERT_EQUAL( + SvxAdjust::Center, + pTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().Get(RES_PARATR_ADJUST).GetAdjust()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"ghi"_ustr, pTextFrame->GetText()); + CPPUNIT_ASSERT_EQUAL( + SvxAdjust::Left, + pTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().Get(RES_PARATR_ADJUST).GetAdjust()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"9 hidden-merge"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"abc"_ustr, pTextFrame->GetText()); + CPPUNIT_ASSERT_EQUAL( + SvxAdjust::Center, + pTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().Get(RES_PARATR_ADJUST).GetAdjust()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"def"_ustr, pTextFrame->GetText()); + CPPUNIT_ASSERT_EQUAL( + SvxAdjust::Left, + pTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().Get(RES_PARATR_ADJUST).GetAdjust()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"10 visible, hidden-merge, visible, delete-merge, visible"_ustr, + pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"abc"_ustr, pTextFrame->GetText()); + CPPUNIT_ASSERT_EQUAL( + SvxAdjust::Right, + pTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().Get(RES_PARATR_ADJUST).GetAdjust()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"def"_ustr, pTextFrame->GetText()); + CPPUNIT_ASSERT_EQUAL( + SvxAdjust::Center, + pTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().Get(RES_PARATR_ADJUST).GetAdjust()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"ghi"_ustr, pTextFrame->GetText()); + CPPUNIT_ASSERT_EQUAL( + SvxAdjust::Left, + pTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().Get(RES_PARATR_ADJUST).GetAdjust()); + + aViewOptions.SetShowHiddenChar(false); + pWrtShell->ApplyViewOptions(aViewOptions); + + // the problem was that the wrong SwTextNode was used for properties + pTextFrame = dynamic_cast<SwTextFrame*>(pBody->GetLower()); + CPPUNIT_ASSERT_EQUAL(u"1 hidden, delete-merge"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + // TODO: redlines don't merge like in Word yet + CPPUNIT_ASSERT_EQUAL(u"Abcdef"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"ghi"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"2 visible, delete-merge"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"abcghi"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"def"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"3 delete-merge"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"def"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"ghi"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"4 delete-merge, delete-merge"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"abc"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"def"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u""_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"5 visible, hidden-merge, visible"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"abcdef"_ustr, pTextFrame->GetText()); + CPPUNIT_ASSERT_EQUAL( + SvxAdjust::Center, + pTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().Get(RES_PARATR_ADJUST).GetAdjust()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"6 hidden-merge, visible"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"abcdef"_ustr, pTextFrame->GetText()); + CPPUNIT_ASSERT_EQUAL( + SvxAdjust::Left, + pTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().Get(RES_PARATR_ADJUST).GetAdjust()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"7 visible, hidden-merge"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"abcdefghi"_ustr, pTextFrame->GetText()); + CPPUNIT_ASSERT_EQUAL( + SvxAdjust::Center, + pTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().Get(RES_PARATR_ADJUST).GetAdjust()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"8 visible, delete-merge, visible, hidden-merge, visible"_ustr, + pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"abc"_ustr, pTextFrame->GetText()); + CPPUNIT_ASSERT_EQUAL( + SvxAdjust::Right, + pTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().Get(RES_PARATR_ADJUST).GetAdjust()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"defghi"_ustr, pTextFrame->GetText()); + CPPUNIT_ASSERT_EQUAL( + SvxAdjust::Center, + pTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().Get(RES_PARATR_ADJUST).GetAdjust()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"9 hidden-merge"_ustr, pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"abcdef"_ustr, pTextFrame->GetText()); + CPPUNIT_ASSERT_EQUAL( + SvxAdjust::Left, + pTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().Get(RES_PARATR_ADJUST).GetAdjust()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"10 visible, hidden-merge, visible, delete-merge, visible"_ustr, + pTextFrame->GetText()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"abcdef"_ustr, pTextFrame->GetText()); + CPPUNIT_ASSERT_EQUAL( + SvxAdjust::Right, + pTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().Get(RES_PARATR_ADJUST).GetAdjust()); + pTextFrame = dynamic_cast<SwTextFrame*>(pTextFrame->GetNext()); + CPPUNIT_ASSERT_EQUAL(u"ghi"_ustr, pTextFrame->GetText()); + CPPUNIT_ASSERT_EQUAL( + SvxAdjust::Left, + pTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().Get(RES_PARATR_ADJUST).GetAdjust()); +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf151954) { createSwDoc("tdf151954.docx"); |