diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-10-03 11:40:13 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-10-05 10:06:44 +0200 |
commit | a6a69211230226ac8b6c17d016fc19eb8ee11261 (patch) | |
tree | 321a5c4a7657baa966185d3757595ff6107d820a /sw/qa/extras/layout | |
parent | 95e2bdf97d987c845927bd44210547fd3c2f2387 (diff) |
Use good old string literals in assertXPath and friends
These are only sent to an external API expecting char*-like strings,
or for comparison. Having every assertXPath having three of _[ou]str
is too much syntactic noise, making the unit tests almost unreadable.
Change-Id: Ic004a36ea75e7bfe0b96f405c40f926a957b51cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174416
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/qa/extras/layout')
-rw-r--r-- | sw/qa/extras/layout/layout.cxx | 3021 | ||||
-rw-r--r-- | sw/qa/extras/layout/layout2.cxx | 1517 | ||||
-rw-r--r-- | sw/qa/extras/layout/layout3.cxx | 1819 |
3 files changed, 2932 insertions, 3425 deletions
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 779921aa2b04..ac340366deea 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -41,85 +41,63 @@ protected: void SwLayoutWriter::CheckRedlineFootnotesHidden() { xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"24"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "type"_ostr, u"PortionType::Footnote"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "expand"_ostr, u"1"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"foaz"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr, - "type"_ostr, u"PortionType::Footnote"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr, - "expand"_ostr, u"2"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/merged"_ostr, - "paraPropsNodeIndex"_ostr, u"13"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "type"_ostr, u"PortionType::FootnoteNum"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "expand"_ostr, u"1"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"ac"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/merged"_ostr, - "paraPropsNodeIndex"_ostr, u"16"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "type"_ostr, u"PortionType::FootnoteNum"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "expand"_ostr, u"2"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"mo"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", u"24"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "type", u"PortionType::Footnote"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "expand", u"1"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"foaz"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]", + "type", u"PortionType::Footnote"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]", + "expand", u"2"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/merged", "paraPropsNodeIndex", u"13"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "type", u"PortionType::FootnoteNum"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "expand", u"1"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"ac"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/merged", "paraPropsNodeIndex", u"16"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "type", u"PortionType::FootnoteNum"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "expand", u"2"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"mo"); } void SwLayoutWriter::CheckRedlineSectionsHidden() { xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"12"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"folah"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt[1]/merged"_ostr, - "paraPropsNodeIndex"_ostr, u"20"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"folah"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", u"12"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"folah"); + assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt[1]/merged", "paraPropsNodeIndex", + u"20"); + assertXPath(pXmlDoc, + "/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); + assertXPath(pXmlDoc, + "/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"folah"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf156077) @@ -128,10 +106,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf156077) CPPUNIT_ASSERT_EQUAL_MESSAGE("Number of pages does not match!", 3, getPages()); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/anchored/fly"_ostr, 3); - assertXPath(pXmlDoc, "/root/page[2]/anchored/fly"_ostr, 1); + assertXPath(pXmlDoc, "/root/page[1]/anchored/fly", 3); + assertXPath(pXmlDoc, "/root/page[2]/anchored/fly", 1); // this was 0, the at-page anchored flys were not displayed - assertXPath(pXmlDoc, "/root/page[3]/anchored/fly"_ostr, 3); + assertXPath(pXmlDoc, "/root/page[3]/anchored/fly", 3); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFootnotes) @@ -151,188 +129,138 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFootnotes) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // show: nothing is merged - assertXPath(pXmlDoc, "//merged"_ostr, 0); - - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "type"_ostr, u"PortionType::Footnote"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "expand"_ostr, u"1"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"fo"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"o"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr, - "type"_ostr, u"PortionType::Footnote"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr, - "expand"_ostr, u"2"_ustr); - - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "type"_ostr, u"PortionType::FootnoteNum"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "expand"_ostr, u"1"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"a"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"b"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "portion"_ostr, u"c"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "type"_ostr, u"PortionType::FootnoteNum"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "expand"_ostr, u"2"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"def"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + assertXPath(pXmlDoc, "//merged", 0); + + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "type", u"PortionType::Footnote"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "expand", u"1"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"fo"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"o"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]", + "type", u"PortionType::Footnote"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]", + "expand", u"2"); + + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "type", u"PortionType::FootnoteNum"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "expand", u"1"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"a"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"b"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "portion", u"c"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "type", u"PortionType::FootnoteNum"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "expand", u"2"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"def"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"b"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "type", u"PortionType::Footnote"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "expand", u"3"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"ar"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[3]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "type", u"PortionType::FootnoteNum"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[3]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "expand", u"3"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[3]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[3]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"ghi"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "type", u"PortionType::Footnote"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "expand", u"4"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"b"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"az"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion[2]", + "type", u"PortionType::Footnote"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion[2]", + "expand", u"5"); + + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[4]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "type", u"PortionType::FootnoteNum"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[4]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "expand", u"4"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[4]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, + "/root/page[1]/ftncont/ftn[4]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"jkl"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"b"_ustr); + "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "type", u"PortionType::FootnoteNum"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "type"_ostr, u"PortionType::Footnote"_ustr); + "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "expand", u"5"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "expand"_ostr, u"3"_ustr); + "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"m"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"ar"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[3]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "type"_ostr, u"PortionType::FootnoteNum"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[3]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "expand"_ostr, u"3"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[3]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[3]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"ghi"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "type"_ostr, u"PortionType::Footnote"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "expand"_ostr, u"4"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"b"_ustr); + "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"n"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"az"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr, - "type"_ostr, u"PortionType::Footnote"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr, - "expand"_ostr, u"5"_ustr); - - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[4]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "type"_ostr, u"PortionType::FootnoteNum"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[4]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "expand"_ostr, u"4"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[4]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[4]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"jkl"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "type"_ostr, u"PortionType::FootnoteNum"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "expand"_ostr, u"5"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"m"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"n"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "portion"_ostr, u"o"_ustr); + "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "portion", u"o"); // verify after hide dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); @@ -347,8 +275,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf136588) CPPUNIT_ASSERT(pXMLLayoutDump); //there was a bad line break before, the correct break layout is this: - assertXPath(pXMLLayoutDump, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[2]"_ostr, - "portion"_ostr, u"effectively by modern-day small to "_ustr); + assertXPath(pXMLLayoutDump, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[2]", "portion", + u"effectively by modern-day small to "); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody) @@ -409,102 +337,101 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody) dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(pLayout->IsHideRedlines()); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"14"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", u"14"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type", + u"PortionType::Para"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"foaz"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/merged"_ostr, - "paraPropsNodeIndex"_ostr, u"6"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"foaz"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/merged", + "paraPropsNodeIndex", u"6"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "portion"_ostr, u"ahi"_ustr); + "SwParaPortion[1]", + "portion", u"ahi"); dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(!pLayout->IsHideRedlines()); pXmlDoc = parseLayoutDump(); // show: nothing is merged - assertXPath(pXmlDoc, "//merged"_ostr, 0); + assertXPath(pXmlDoc, "//merged", 0); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "type", + u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"fo"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"fo"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type", + u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"o"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"o"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "portion"_ostr, u"a"_ustr); + "SwLinePortion[1]", + "portion", u"a"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "portion"_ostr, u"bc"_ustr); + "SwLinePortion[2]", + "portion", u"bc"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "portion"_ostr, u"def"_ustr); + "SwParaPortion[1]", + "portion", u"def"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "portion"_ostr, u"g"_ustr); + "SwLinePortion[1]", + "portion", u"g"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "portion"_ostr, u"hi"_ustr); + "SwLinePortion[2]", + "portion", u"hi"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type", + u"PortionType::Para"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"bar"_ustr); + "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"bar"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "type", + u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"b"_ustr); + "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"b"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type", + u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"az"_ustr); + "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"az"); } // anchor to 2nd (deleted) paragraph @@ -528,95 +455,94 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody) dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(pLayout->IsHideRedlines()); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"14"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", u"14"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type", + u"PortionType::Para"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"foaz"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"foaz"); // hide: no anchored object shown - assertXPath(pXmlDoc, "//anchored"_ostr, 0); + assertXPath(pXmlDoc, "//anchored", 0); dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(!pLayout->IsHideRedlines()); pXmlDoc = parseLayoutDump(); // show: nothing is merged - assertXPath(pXmlDoc, "//merged"_ostr, 0); + assertXPath(pXmlDoc, "//merged", 0); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "type", + u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"fo"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"fo"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type", + u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"o"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"o"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type", + u"PortionType::Para"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"bar"_ustr); + "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"bar"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "portion"_ostr, u"a"_ustr); + "SwLinePortion[1]", + "portion", u"a"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "portion"_ostr, u"bc"_ustr); + "SwLinePortion[2]", + "portion", u"bc"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "portion"_ostr, u"def"_ustr); + "SwParaPortion[1]", + "portion", u"def"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "portion"_ostr, u"g"_ustr); + "SwLinePortion[1]", + "portion", u"g"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "portion"_ostr, u"hi"_ustr); + "SwLinePortion[2]", + "portion", u"hi"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "type", + u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"b"_ustr); + "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"b"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type", + u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"az"_ustr); + "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"az"); } // anchor to 3rd paragraph @@ -639,102 +565,101 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody) dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(pLayout->IsHideRedlines()); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"14"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", u"14"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type", + u"PortionType::Para"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"foaz"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/merged"_ostr, - "paraPropsNodeIndex"_ostr, u"6"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"foaz"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/merged", + "paraPropsNodeIndex", u"6"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "portion"_ostr, u"ahi"_ustr); + "SwParaPortion[1]", + "portion", u"ahi"); dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(!pLayout->IsHideRedlines()); pXmlDoc = parseLayoutDump(); // show: nothing is merged - assertXPath(pXmlDoc, "//merged"_ostr, 0); + assertXPath(pXmlDoc, "//merged", 0); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "type", + u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"fo"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"fo"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type", + u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"o"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"o"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type", + u"PortionType::Para"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"bar"_ustr); + "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"bar"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "type", + u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"b"_ustr); + "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"b"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type", + u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"az"_ustr); + "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"az"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "portion"_ostr, u"a"_ustr); + "SwLinePortion[1]", + "portion", u"a"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "portion"_ostr, u"bc"_ustr); + "SwLinePortion[2]", + "portion", u"bc"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "portion"_ostr, u"def"_ustr); + "SwParaPortion[1]", + "portion", u"def"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "portion"_ostr, u"g"_ustr); + "SwLinePortion[1]", + "portion", u"g"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "portion"_ostr, u"hi"_ustr); + "SwLinePortion[2]", + "portion", u"hi"); } } @@ -754,38 +679,32 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testFlyHiddenParagraph) Scheduler::ProcessEventsToIdle(); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly/txt/infos/bounds"_ostr, - "height"_ostr, "0"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly/infos/bounds"_ostr, "height"_ostr, - "448"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly/txt/infos/bounds", "height", u"0"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly/infos/bounds", "height", u"448"); // the problem was that now the fly was the same height as before hiding dispatchCommand(mxComponent, ".uno:Fieldnames", {}); Scheduler::ProcessEventsToIdle(); pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly/txt/infos/bounds"_ostr, - "height"_ostr, "828"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly/infos/bounds"_ostr, "height"_ostr, - "1000"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly/txt/infos/bounds", "height", + u"828"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly/infos/bounds", "height", u"1000"); dispatchCommand(mxComponent, ".uno:Fieldnames", {}); Scheduler::ProcessEventsToIdle(); pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly/txt/infos/bounds"_ostr, - "height"_ostr, "0"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly/infos/bounds"_ostr, "height"_ostr, - "448"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly/txt/infos/bounds", "height", u"0"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly/infos/bounds", "height", u"448"); dispatchCommand(mxComponent, ".uno:Fieldnames", {}); Scheduler::ProcessEventsToIdle(); pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly/txt/infos/bounds"_ostr, - "height"_ostr, "828"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly/infos/bounds"_ostr, "height"_ostr, - "1000"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly/txt/infos/bounds", "height", + u"828"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly/infos/bounds", "height", u"1000"); // other test like testTdf143239 and testTdf159101 depend on this; // seems getting the previous value is only possible with a listener @@ -801,9 +720,9 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testFieldHideSection) CPPUNIT_ASSERT(pDoc); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/section/tab/row"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/body/section/tab/row"_ostr, 1); - assertXPath(pXmlDoc, "/root/page"_ostr, 2); + assertXPath(pXmlDoc, "/root/page[1]/body/section/tab/row", 1); + assertXPath(pXmlDoc, "/root/page[2]/body/section/tab/row", 1); + assertXPath(pXmlDoc, "/root/page", 2); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); ::std::unique_ptr<SwField> pField(pWrtShell->GetCurField()->CopyField()); @@ -815,14 +734,12 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testFieldHideSection) Scheduler::ProcessEventsToIdle(); pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/section/tab/row"_ostr, 2); - assertXPath(pXmlDoc, "/root/page[1]/body/section/tab/row[1]/infos/bounds"_ostr, "height"_ostr, - "0"); - assertXPath(pXmlDoc, "/root/page[1]/body/section/tab/row[2]/infos/bounds"_ostr, "height"_ostr, - "0"); - assertXPath(pXmlDoc, "/root/page[1]/body/section/infos/bounds"_ostr, "height"_ostr, "0"); + assertXPath(pXmlDoc, "/root/page[1]/body/section/tab/row", 2); + assertXPath(pXmlDoc, "/root/page[1]/body/section/tab/row[1]/infos/bounds", "height", u"0"); + assertXPath(pXmlDoc, "/root/page[1]/body/section/tab/row[2]/infos/bounds", "height", u"0"); + assertXPath(pXmlDoc, "/root/page[1]/body/section/infos/bounds", "height", u"0"); // the problem was that there were 3 pages now - assertXPath(pXmlDoc, "/root/page"_ostr, 1); + assertXPath(pXmlDoc, "/root/page", 1); pWrtShell->StartAllAction(); manager.UpdateCurField(10000 /*(?)*/, "Foo", "0", std::move(pField)); @@ -830,9 +747,9 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testFieldHideSection) Scheduler::ProcessEventsToIdle(); pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/section/tab/row"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/body/section/tab/row"_ostr, 1); - assertXPath(pXmlDoc, "/root/page"_ostr, 2); + assertXPath(pXmlDoc, "/root/page[1]/body/section/tab/row", 1); + assertXPath(pXmlDoc, "/root/page[2]/body/section/tab/row", 1); + assertXPath(pXmlDoc, "/root/page", 2); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestI94666) @@ -843,11 +760,11 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestI94666) { xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page"_ostr, 2); + assertXPath(pXmlDoc, "/root/page", 2); assertXPath( pXmlDoc, - "/root/page[2]/body/section/txt[1]/SwParaPortion/SwLineLayout[1]/SwLinePortion[1]"_ostr, - "portion"_ostr, "pulled off "); + "/root/page[2]/body/section/txt[1]/SwParaPortion/SwLineLayout[1]/SwLinePortion[1]", + "portion", u"pulled off "); } SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); @@ -862,20 +779,21 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestI94666) // the problem was that the last paragraph moved to page 3 assertXPath( pXmlDoc, - "/root/page[2]/body/section/txt[1]/SwParaPortion/SwLineLayout[1]/SwLinePortion[1]"_ostr, - "portion"_ostr, - "Widows & orphans He heard quiet steps behind him. That didn't bode well. Who could be " + "/root/page[2]/body/section/txt[1]/SwParaPortion/SwLineLayout[1]/SwLinePortion[1]", + "portion", + u"Widows & orphans He heard quiet steps behind him. That didn't bode well. Who could " + u"be " "following"); assertXPath( pXmlDoc, - "/root/page[2]/body/section/txt[1]/SwParaPortion/SwLineLayout[3]/SwLinePortion[1]"_ostr, - "portion"_ostr, "pulled off "); + "/root/page[2]/body/section/txt[1]/SwParaPortion/SwLineLayout[3]/SwLinePortion[1]", + "portion", u"pulled off "); assertXPath( pXmlDoc, - "/root/page[2]/body/section/txt[2]/SwParaPortion/SwLineLayout[1]/SwParaPortion[1]"_ostr, - "portion"_ostr, "Moved paragraph"); - assertXPath(pXmlDoc, "/root/page[2]//txt"_ostr, 3); - assertXPath(pXmlDoc, "/root/page"_ostr, 2); + "/root/page[2]/body/section/txt[2]/SwParaPortion/SwLineLayout[1]/SwParaPortion[1]", + "portion", u"Moved paragraph"); + assertXPath(pXmlDoc, "/root/page[2]//txt", 3); + assertXPath(pXmlDoc, "/root/page", 2); } } @@ -885,10 +803,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf134272) SwDoc* pDoc = getSwDoc(); CPPUNIT_ASSERT(pDoc); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/infos/bounds"_ostr, "height"_ostr, - u"843"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/infos/bounds"_ostr, "bottom"_ostr, - u"2819"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/infos/bounds", "height", u"843"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/infos/bounds", "bottom", u"2819"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestNestedTableMoveFwd) @@ -898,11 +814,11 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestNestedTableMoveFwd) CPPUNIT_ASSERT(pDoc); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // the row with the nested table should not be split but be the first row on page 2 - assertXPathContent(pXmlDoc, "/root/page[1]/body/tab[1]/row[last()]/cell[1]/txt[1]"_ostr, - u"Tabelle 1"_ustr); + assertXPathContent(pXmlDoc, "/root/page[1]/body/tab[1]/row[last()]/cell[1]/txt[1]", + u"Tabelle 1"); assertXPathContent(pXmlDoc, - "/root/page[2]/body/tab[1]/row[1]/cell[1]/tab[1]/row[1]/cell[1]/txt"_ostr, - u"Tabelle 2"_ustr); + "/root/page[2]/body/tab[1]/row[1]/cell[1]/tab[1]/row[1]/cell[1]/txt", + u"Tabelle 2"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf136613) @@ -944,7 +860,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf88496) CPPUNIT_ASSERT(pDoc); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was 4, table fallback "switch off repeating header" started on a new page - assertXPath(pXmlDoc, "/root/page"_ostr, 3); + assertXPath(pXmlDoc, "/root/page", 3); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader) @@ -1009,108 +925,107 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader) dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(pLayout->IsHideRedlines()); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, - "length"_ostr, u"0"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"6"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, - "portion"_ostr, u"foaz"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/merged"_ostr, - "paraPropsNodeIndex"_ostr, u"11"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout", "type", + u"PortionType::Para"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]", "length", + u"0"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/merged", "paraPropsNodeIndex", u"6"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout[1]", "type", + u"PortionType::Para"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout[1]", "portion", + u"foaz"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/merged", + "paraPropsNodeIndex", u"11"); assertXPath( pXmlDoc, - "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout[1]", + "type", u"PortionType::Para"); assertXPath( pXmlDoc, - "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, - "portion"_ostr, u"ahi"_ustr); + "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout[1]", + "portion", u"ahi"); dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(!pLayout->IsHideRedlines()); pXmlDoc = parseLayoutDump(); // show: nothing is merged - assertXPath(pXmlDoc, "//merged"_ostr, 0); + assertXPath(pXmlDoc, "//merged", 0); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, - "length"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]", "type", + u"PortionType::Para"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]", "length", + u"0"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"fo"_ustr); + "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"fo"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"o"_ustr); + "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"o"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "portion"_ostr, u"a"_ustr); + "SwLinePortion[1]", + "portion", u"a"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "portion"_ostr, u"bc"_ustr); + "SwLinePortion[2]", + "portion", u"bc"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "portion"_ostr, u"def"_ustr); + "SwParaPortion[1]", + "portion", u"def"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "portion"_ostr, u"g"_ustr); + "SwLinePortion[1]", + "portion", u"g"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "portion"_ostr, u"hi"_ustr); + "SwLinePortion[2]", + "portion", u"hi"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/header/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"bar"_ustr); + "/root/page[1]/header/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"bar"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"b"_ustr); + "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"b"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"az"_ustr); + "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"az"); } // anchor to 2nd (deleted) paragraph @@ -1137,101 +1052,100 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader) // now the frame has no Text portion? not sure why it's a 0-length one first and now none? // assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type", "PortionType::Para"); // assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "length", "0"); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"6"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/merged", "paraPropsNodeIndex", u"6"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"foaz"_ustr); + "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"foaz"); // hide: no anchored object shown - assertXPath(pXmlDoc, "//anchored"_ostr, 0); + assertXPath(pXmlDoc, "//anchored", 0); dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(!pLayout->IsHideRedlines()); pXmlDoc = parseLayoutDump(); // show: nothing is merged - assertXPath(pXmlDoc, "//merged"_ostr, 0); + assertXPath(pXmlDoc, "//merged", 0); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type", + u"PortionType::Para"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "length"_ostr, u"0"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "length", u"0"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"fo"_ustr); + "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"fo"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"o"_ustr); + "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"o"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/header/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"bar"_ustr); + "/root/page[1]/header/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"bar"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "portion"_ostr, u"a"_ustr); + "SwLinePortion[1]", + "portion", u"a"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "portion"_ostr, u"bc"_ustr); + "SwLinePortion[2]", + "portion", u"bc"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "portion"_ostr, u"def"_ustr); + "SwParaPortion[1]", + "portion", u"def"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "portion"_ostr, u"g"_ustr); + "SwLinePortion[1]", + "portion", u"g"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "portion"_ostr, u"hi"_ustr); + "SwLinePortion[2]", + "portion", u"hi"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"b"_ustr); + "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"b"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"az"_ustr); + "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"az"); } // anchor to 3rd paragraph @@ -1255,113 +1169,112 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader) CPPUNIT_ASSERT(pLayout->IsHideRedlines()); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type", + u"PortionType::Para"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "length"_ostr, u"0"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"6"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "length", u"0"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/merged", "paraPropsNodeIndex", u"6"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"foaz"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/merged"_ostr, - "paraPropsNodeIndex"_ostr, u"11"_ustr); + "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"foaz"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/merged", + "paraPropsNodeIndex", u"11"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "portion"_ostr, u"ahi"_ustr); + "SwParaPortion[1]", + "portion", u"ahi"); dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(!pLayout->IsHideRedlines()); pXmlDoc = parseLayoutDump(); // show: nothing is merged - assertXPath(pXmlDoc, "//merged"_ostr, 0); + assertXPath(pXmlDoc, "//merged", 0); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type", + u"PortionType::Para"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "length"_ostr, u"0"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "length", u"0"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"fo"_ustr); + "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"fo"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"o"_ustr); + "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"o"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/header/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"bar"_ustr); + "/root/page[1]/header/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"bar"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"b"_ustr); + "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"b"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"az"_ustr); + "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"az"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "portion"_ostr, u"a"_ustr); + "SwLinePortion[1]", + "portion", u"a"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "portion"_ostr, u"bc"_ustr); + "SwLinePortion[2]", + "portion", u"bc"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "portion"_ostr, u"def"_ustr); + "SwParaPortion[1]", + "portion", u"def"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "portion"_ostr, u"g"_ustr); + "SwLinePortion[1]", + "portion", u"g"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "portion"_ostr, u"hi"_ustr); + "SwLinePortion[2]", + "portion", u"hi"); } } @@ -1376,55 +1289,55 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf150606) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/section/column[1]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[1]/body/section/column[2]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[1]/body/section/column"_ostr, 2); - assertXPath(pXmlDoc, "/root/page[2]/body/section/column[1]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/body/section/column[2]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/body/section/column"_ostr, 2); - assertXPath(pXmlDoc, "/root/page[3]/body/section/column[1]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[3]/body/section/column[2]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[3]/body/section/column"_ostr, 2); - assertXPath(pXmlDoc, "/root/page[4]/body/section/column[1]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[4]/body/section/column[2]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[4]/body/section/column"_ostr, 2); + assertXPath(pXmlDoc, "/root/page[1]/body/section/column[1]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[1]/body/section/column[2]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[1]/body/section/column", 2); + assertXPath(pXmlDoc, "/root/page[2]/body/section/column[1]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[2]/body/section/column[2]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[2]/body/section/column", 2); + assertXPath(pXmlDoc, "/root/page[3]/body/section/column[1]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[3]/body/section/column[2]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[3]/body/section/column", 2); + assertXPath(pXmlDoc, "/root/page[4]/body/section/column[1]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[4]/body/section/column[2]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[4]/body/section/column", 2); // on page 5 the table is split across balanced columns - assertXPath(pXmlDoc, "/root/page[5]/body/section/column[1]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[5]/body/section/column[2]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[5]/body/section/column"_ostr, 2); - assertXPath(pXmlDoc, "/root/page"_ostr, 5); + assertXPath(pXmlDoc, "/root/page[5]/body/section/column[1]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[5]/body/section/column[2]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[5]/body/section/column", 2); + assertXPath(pXmlDoc, "/root/page", 5); pWrtShell->Down(false, 1); dispatchCommand(mxComponent, u".uno:DeleteTable"_ustr, {}); pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/section/column/body/tab"_ostr, 0); - assertXPath(pXmlDoc, "/root/page"_ostr, 1); + assertXPath(pXmlDoc, "/root/page[1]/body/section/column/body/tab", 0); + assertXPath(pXmlDoc, "/root/page", 1); pWrtShell->Undo(); Scheduler::ProcessEventsToIdle(); pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/section/column[1]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[1]/body/section/column[2]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[1]/body/section/column"_ostr, 2); - assertXPath(pXmlDoc, "/root/page[2]/body/section/column[1]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/body/section/column[2]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/body/section/column"_ostr, 2); - assertXPath(pXmlDoc, "/root/page[3]/body/section/column[1]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[3]/body/section/column[2]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[3]/body/section/column"_ostr, 2); - assertXPath(pXmlDoc, "/root/page[4]/body/section/column[1]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[4]/body/section/column[2]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[4]/body/section/column"_ostr, 2); + assertXPath(pXmlDoc, "/root/page[1]/body/section/column[1]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[1]/body/section/column[2]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[1]/body/section/column", 2); + assertXPath(pXmlDoc, "/root/page[2]/body/section/column[1]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[2]/body/section/column[2]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[2]/body/section/column", 2); + assertXPath(pXmlDoc, "/root/page[3]/body/section/column[1]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[3]/body/section/column[2]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[3]/body/section/column", 2); + assertXPath(pXmlDoc, "/root/page[4]/body/section/column[1]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[4]/body/section/column[2]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[4]/body/section/column", 2); // on page 5 the table is split across balanced columns // (problem was that there were empty pages and table was on page 10) - assertXPath(pXmlDoc, "/root/page[5]/body/section/column[1]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[5]/body/section/column[2]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[5]/body/section/column"_ostr, 2); - assertXPath(pXmlDoc, "/root/page"_ostr, 5); + assertXPath(pXmlDoc, "/root/page[5]/body/section/column[1]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[5]/body/section/column[2]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[5]/body/section/column", 2); + assertXPath(pXmlDoc, "/root/page", 5); } #endif @@ -1450,28 +1363,28 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf137025) "/DefaultProperties/SfxItemSet/SdrMetricItem/SfxInt32Item" "[@whichId='" + OString::number(SDRATTR_TEXT_LEFTDIST) + "']", - "value"_ostr, u"567"_ustr); + "value", u"567"); // SDRATTR_TEXT_RIGHTDIST assertXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject/SdrObject" "/DefaultProperties/SfxItemSet/SdrMetricItem/SfxInt32Item" "[@whichId='" + OString::number(SDRATTR_TEXT_RIGHTDIST) + "']", - "value"_ostr, u"1134"_ustr); + "value", u"1134"); // SDRATTR_TEXT_UPPERDIST assertXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject/SdrObject" "/DefaultProperties/SfxItemSet/SdrMetricItem/SfxInt32Item" "[@whichId='" + OString::number(SDRATTR_TEXT_UPPERDIST) + "']", - "value"_ostr, u"1701"_ustr); + "value", u"1701"); // SDRATTR_TEXT_LOWERDIST assertXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject/SdrObject" "/DefaultProperties/SfxItemSet/SdrMetricItem/SfxInt32Item" "[@whichId='" + OString::number(SDRATTR_TEXT_LOWERDIST) + "']", - "value"_ostr, u"2268"_ustr); + "value", u"2268"); // Check the textbox-shape import too auto xShp = getShape(1); @@ -1600,161 +1513,159 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote) dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(pLayout->IsHideRedlines()); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"25"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", u"25"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/" - "child::*[@type='PortionType::Footnote']"_ostr, - "type"_ostr, u"PortionType::Footnote"_ustr); + "child::*[@type='PortionType::Footnote']", + "type", u"PortionType::Footnote"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/" - "child::*[@type='PortionType::Footnote']"_ostr, - "expand"_ostr, u"1"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/merged"_ostr, - "paraPropsNodeIndex"_ostr, u"7"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/merged"_ostr, - "paraPropsNodeIndex"_ostr, u"17"_ustr); + "child::*[@type='PortionType::Footnote']", + "expand", u"1"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/merged", "paraPropsNodeIndex", + u"7"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/merged", + "paraPropsNodeIndex", u"17"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"ahi"_ustr); + "SwLineLayout/SwParaPortion[1]", + "portion", u"ahi"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "type"_ostr, u"PortionType::FootnoteNum"_ustr); + "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "type", u"PortionType::FootnoteNum"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "expand"_ostr, u"1"_ustr); + "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "expand", u"1"); dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(!pLayout->IsHideRedlines()); pXmlDoc = parseLayoutDump(); // show: nothing is merged - assertXPath(pXmlDoc, "//merged"_ostr, 0); + assertXPath(pXmlDoc, "//merged", 0); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "type"_ostr, u"PortionType::Footnote"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "type", u"PortionType::Footnote"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "expand"_ostr, u"1"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "expand", u"1"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr, - "type"_ostr, u"PortionType::Footnote"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]", + "type", u"PortionType::Footnote"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr, - "expand"_ostr, u"2"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]", + "expand", u"2"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"quux"_ustr); + "SwLineLayout/SwParaPortion[1]", + "portion", u"quux"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "type"_ostr, u"PortionType::FootnoteNum"_ustr); + "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "type", u"PortionType::FootnoteNum"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "expand"_ostr, u"1"_ustr); + "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "expand", u"1"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"a"_ustr); + "SwLineLayout/SwLinePortion[1]", + "portion", u"a"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"bc"_ustr); + "SwLineLayout/SwLinePortion[2]", + "portion", u"bc"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[2]/SwParaPortion/" - "SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[2]/SwParaPortion/" - "SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"def"_ustr); + "SwLineLayout/SwParaPortion[1]", + "portion", u"def"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/" - "SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/" - "SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"g"_ustr); + "SwLineLayout/SwLinePortion[1]", + "portion", u"g"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/" - "SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/" - "SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"hi"_ustr); + "SwLineLayout/SwLinePortion[2]", + "portion", u"hi"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "type"_ostr, u"PortionType::FootnoteNum"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "type", u"PortionType::FootnoteNum"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "expand"_ostr, u"2"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "expand", u"2"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"fo"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"fo"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"o"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"o"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"bar"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"bar"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"b"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"b"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"az"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"az"); } // anchor to 2nd (deleted) paragraph @@ -1781,151 +1692,150 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote) CPPUNIT_ASSERT(pLayout->IsHideRedlines()); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"25"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", u"25"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "type"_ostr, u"PortionType::Footnote"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "type", u"PortionType::Footnote"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "expand"_ostr, u"1"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/merged"_ostr, - "paraPropsNodeIndex"_ostr, u"7"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "expand", u"1"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/merged", "paraPropsNodeIndex", + u"7"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "type"_ostr, u"PortionType::FootnoteNum"_ustr); + "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "type", u"PortionType::FootnoteNum"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "expand"_ostr, u"1"_ustr); + "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "expand", u"1"); // hide: no anchored object shown - assertXPath(pXmlDoc, "//anchored"_ostr, 0); + assertXPath(pXmlDoc, "//anchored", 0); dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(!pLayout->IsHideRedlines()); pXmlDoc = parseLayoutDump(); // show: nothing is merged - assertXPath(pXmlDoc, "//merged"_ostr, 0); + assertXPath(pXmlDoc, "//merged", 0); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "type"_ostr, u"PortionType::Footnote"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "type", u"PortionType::Footnote"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "expand"_ostr, u"1"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "expand", u"1"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr, - "type"_ostr, u"PortionType::Footnote"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]", + "type", u"PortionType::Footnote"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr, - "expand"_ostr, u"2"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]", + "expand", u"2"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"quux"_ustr); + "SwLineLayout/SwParaPortion[1]", + "portion", u"quux"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "type"_ostr, u"PortionType::FootnoteNum"_ustr); + "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "type", u"PortionType::FootnoteNum"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "expand"_ostr, u"1"_ustr); + "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "expand", u"1"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "type"_ostr, u"PortionType::FootnoteNum"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "type", u"PortionType::FootnoteNum"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "expand"_ostr, u"2"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "expand", u"2"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"fo"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"fo"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"o"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"o"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"a"_ustr); + "SwLineLayout/SwLinePortion[1]", + "portion", u"a"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"bc"_ustr); + "SwLineLayout/SwLinePortion[2]", + "portion", u"bc"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[2]/SwParaPortion/" - "SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[2]/SwParaPortion/" - "SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"def"_ustr); + "SwLineLayout/SwParaPortion[1]", + "portion", u"def"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/" - "SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/" - "SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"g"_ustr); + "SwLineLayout/SwLinePortion[1]", + "portion", u"g"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/" - "SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/" - "SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"hi"_ustr); + "SwLineLayout/SwLinePortion[2]", + "portion", u"hi"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"bar"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"bar"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"b"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"b"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"az"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"az"); } // anchor to 3rd paragraph @@ -1952,163 +1862,161 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote) dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(pLayout->IsHideRedlines()); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"25"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "type"_ostr, u"PortionType::Footnote"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", u"25"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "expand"_ostr, u"1"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/merged"_ostr, - "paraPropsNodeIndex"_ostr, u"7"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "type", u"PortionType::Footnote"); assertXPath(pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/merged"_ostr, - "paraPropsNodeIndex"_ostr, u"17"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "expand", u"1"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/merged", "paraPropsNodeIndex", + u"7"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/merged", + "paraPropsNodeIndex", u"17"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"ahi"_ustr); + "SwLineLayout/SwParaPortion[1]", + "portion", u"ahi"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "type"_ostr, u"PortionType::FootnoteNum"_ustr); + "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "type", u"PortionType::FootnoteNum"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "expand"_ostr, u"1"_ustr); + "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "expand", u"1"); dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(!pLayout->IsHideRedlines()); pXmlDoc = parseLayoutDump(); // show: nothing is merged - assertXPath(pXmlDoc, "//merged"_ostr, 0); + assertXPath(pXmlDoc, "//merged", 0); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/" - "child::*[@type='PortionType::Footnote'][1]"_ostr, - "type"_ostr, u"PortionType::Footnote"_ustr); + "child::*[@type='PortionType::Footnote'][1]", + "type", u"PortionType::Footnote"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/" - "child::*[@type='PortionType::Footnote'][1]"_ostr, - "expand"_ostr, u"1"_ustr); + "child::*[@type='PortionType::Footnote'][1]", + "expand", u"1"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/" - "child::*[@type='PortionType::Footnote'][2]"_ostr, - "type"_ostr, u"PortionType::Footnote"_ustr); + "child::*[@type='PortionType::Footnote'][2]", + "type", u"PortionType::Footnote"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/" - "child::*[@type='PortionType::Footnote'][2]"_ostr, - "expand"_ostr, u"2"_ustr); + "child::*[@type='PortionType::Footnote'][2]", + "expand", u"2"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"quux"_ustr); + "SwLineLayout/SwParaPortion[1]", + "portion", u"quux"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "type"_ostr, u"PortionType::FootnoteNum"_ustr); + "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "type", u"PortionType::FootnoteNum"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "expand"_ostr, u"1"_ustr); + "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "expand", u"1"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "type"_ostr, u"PortionType::FootnoteNum"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "type", u"PortionType::FootnoteNum"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "expand"_ostr, u"2"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "expand", u"2"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"fo"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"fo"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"o"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"o"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"bar"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"bar"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"a"_ustr); + "SwLineLayout/SwLinePortion[1]", + "portion", u"a"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"bc"_ustr); + "SwLineLayout/SwLinePortion[2]", + "portion", u"bc"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[2]/SwParaPortion/" - "SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[2]/SwParaPortion/" - "SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"def"_ustr); + "SwLineLayout/SwParaPortion[1]", + "portion", u"def"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/" - "SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/" - "SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"g"_ustr); + "SwLineLayout/SwLinePortion[1]", + "portion", u"g"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/" - "SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/" - "SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"hi"_ustr); + "SwLineLayout/SwLinePortion[2]", + "portion", u"hi"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"b"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"b"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath( pXmlDoc, - "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"az"_ustr); + "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"az"); } } @@ -2124,22 +2032,22 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf143239) { xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds"_ostr, - "top"_ostr, u"18540"_ustr); - p2txt1Left = getXPath( - pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds"_ostr, "left"_ostr); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/anchored/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds"_ostr, - "top"_ostr, u"23894"_ustr); - p2txt2Left = getXPath( - pXmlDoc, "/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds"_ostr, "left"_ostr); - assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds"_ostr, - "top"_ostr, u"35662"_ustr); - p3txt1Left = getXPath( - pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds"_ostr, "left"_ostr); - assertXPath(pXmlDoc, "/root/page"_ostr, 3); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly", 1); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "top", + u"18540"); + p2txt1Left + = getXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "left"); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/anchored/fly", 1); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "top", + u"23894"); + p2txt2Left + = getXPath(pXmlDoc, "/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "left"); + assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly", 1); + assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "top", + u"35662"); + p3txt1Left + = getXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "left"); + assertXPath(pXmlDoc, "/root/page", 3); } pWrtShell->SelAll(); @@ -2150,22 +2058,22 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf143239) { xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // now the 1st fly was on page 1, and the fly on page 2 was the 2nd one - assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds"_ostr, - "top"_ostr, u"18540"_ustr); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds"_ostr, - "left"_ostr, p2txt1Left); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/anchored/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds"_ostr, - "top"_ostr, u"23894"_ustr); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds"_ostr, - "left"_ostr, p2txt2Left); - assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds"_ostr, - "top"_ostr, u"35662"_ustr); - assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds"_ostr, - "left"_ostr, p3txt1Left); - assertXPath(pXmlDoc, "/root/page"_ostr, 3); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly", 1); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "top", + u"18540"); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "left", + p2txt1Left); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/anchored/fly", 1); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "top", + u"23894"); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "left", + p2txt2Left); + assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly", 1); + assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "top", + u"35662"); + assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "left", + p3txt1Left); + assertXPath(pXmlDoc, "/root/page", 3); } } @@ -2178,25 +2086,24 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTableOverlapFooterFly) // no fly portions, was: 8 assertXPath(pLayout, "/root/page[2]/body/tab[1]/row[5]/cell[5]/txt[1]/SwParaPortion/SwLineLayout/" - "SwFixPortion[@type='PortionType::Fly'][@type='PortionType::Fly']"_ostr, + "SwFixPortion[@type='PortionType::Fly'][@type='PortionType::Fly']", 0); // one line break, was: 5 assertXPath(pLayout, - "/root/page[2]/body/tab[1]/row[5]/cell[5]/txt[1]/SwParaPortion/SwLineLayout"_ostr, - 1); + "/root/page[2]/body/tab[1]/row[5]/cell[5]/txt[1]/SwParaPortion/SwLineLayout", 1); // one text portion, was: 1 assertXPath( pLayout, - "/root/page[2]/body/tab[1]/row[5]/cell[5]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr, + "/root/page[2]/body/tab[1]/row[5]/cell[5]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion", 1); assertXPath( pLayout, - "/root/page[2]/body/tab[1]/row[5]/cell[5]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr, - "portion"_ostr, u"Abc def ghi jkl mno pqr stu vwx yz."_ustr); + "/root/page[2]/body/tab[1]/row[5]/cell[5]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion", + "portion", u"Abc def ghi jkl mno pqr stu vwx yz."); // height was: 1517 // tdf#134782 height was: 379 - assertXPath(pLayout, "/root/page[2]/body/tab[1]/row[5]/cell[5]/txt[1]/infos/bounds"_ostr, - "height"_ostr, u"253"_ustr); + assertXPath(pLayout, "/root/page[2]/body/tab[1]/row[5]/cell[5]/txt[1]/infos/bounds", "height", + u"253"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf134277) @@ -2212,7 +2119,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf134277) xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); - assertXPath(pXmlDoc, "/metafile/push/push/push/layoutmode[2]"_ostr, 0); + assertXPath(pXmlDoc, "/metafile/push/push/push/layoutmode[2]", 0); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf116486) @@ -2223,8 +2130,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf116486) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); OUString aTop = getXPath( pXmlDoc, - "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/child::*[@type='PortionType::Fly']"_ostr, - "height"_ostr); + "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/child::*[@type='PortionType::Fly']", + "height"); CPPUNIT_ASSERT_EQUAL(u"4006"_ustr, aTop); } @@ -2237,14 +2144,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf142080) // check the first paragraph on page 9 with its fly; the column was empty too assertXPath(pLayout, "/root/page[9]/body/section[1]/column[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]/" - "SwLinePortion"_ostr, - "portion"_ostr, - u"De kleur u (rood) in het rechtervlak (R), de kleur r (wit) beneden (D),"_ustr); - SwTwips nPage9Top = getXPath(pLayout, "/root/page[9]/infos/bounds"_ostr, "top"_ostr).toInt32(); + "SwLinePortion", + "portion", + u"De kleur u (rood) in het rechtervlak (R), de kleur r (wit) beneden (D),"); + SwTwips nPage9Top = getXPath(pLayout, "/root/page[9]/infos/bounds", "top").toInt32(); assertXPath( pLayout, - "/root/page[9]/body/section[1]/column[1]/body/txt[1]/anchored/fly[1]/notxt/infos/bounds"_ostr, - "top"_ostr, OUString::number(nPage9Top + 1460)); + "/root/page[9]/body/section[1]/column[1]/body/txt[1]/anchored/fly[1]/notxt/infos/bounds", + "top", OUString::number(nPage9Top + 1460)); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf152106) @@ -2255,7 +2162,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf152106) xmlDocUniquePtr pLayout = parseLayoutDump(); // frame on page 3 - assertXPath(pLayout, "/root/page[3]/sorted_objs/fly"_ostr, 1); + assertXPath(pLayout, "/root/page[3]/sorted_objs/fly", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128198) @@ -2266,12 +2173,11 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128198) xmlDocUniquePtr pLayout = parseLayoutDump(); // the problem was that line 5 was truncated at "this " // due to the fly anchored in previous paragraph - assertXPath(pLayout, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[5]"_ostr, - "portion"_ostr, + assertXPath(pLayout, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[5]", "portion", u"to access any service, any time, anywhere. From this perspective, satellite " - "boasts some "_ustr); - assertXPath(pLayout, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[6]"_ostr, - "portion"_ostr, u"significant advantages. "_ustr); + "boasts some "); + assertXPath(pLayout, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[6]", "portion", + u"significant advantages. "); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testNoLineBreakAtSlash) @@ -2280,24 +2186,22 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testNoLineBreakAtSlash) xmlDocUniquePtr pLayout = parseLayoutDump(); // the line break was between "Foostrasse 13/c/" and "2" - assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, 2); - assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]/child::*"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); - assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]/child::*[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]/child::*[2]"_ostr, - "type"_ostr, u"PortionType::Blank"_ustr); - assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]/child::*[3]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - - assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, - "portion"_ostr, u"Blah blah bla bla bla "_ustr); - assertXPath(pLayout, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]/SwLinePortion[1]"_ostr, - "portion"_ostr, u"Foostrasse"_ustr); - assertXPath(pLayout, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]/SwLinePortion[2]"_ostr, - "portion"_ostr, u"13/c/2, etc."_ustr); + assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout", 2); + assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]/child::*", "type", + u"PortionType::Para"); + assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]/child::*[1]", + "type", u"PortionType::Text"); + assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]/child::*[2]", + "type", u"PortionType::Blank"); + assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]/child::*[3]", + "type", u"PortionType::Text"); + + assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]", "portion", + u"Blah blah bla bla bla "); + assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]/SwLinePortion[1]", + "portion", u"Foostrasse"); + assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]/SwLinePortion[2]", + "portion", u"13/c/2, etc."); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf106153) @@ -2305,27 +2209,19 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf106153) createSwDoc("tdf106153.docx"); xmlDocUniquePtr pDump = parseLayoutDump(); - const sal_Int64 nPageValLeft - = getXPath(pDump, "/root/page/infos/bounds"_ostr, "left"_ostr).toInt64(); - const sal_Int64 nPageValTop - = getXPath(pDump, "/root/page/infos/bounds"_ostr, "top"_ostr).toInt64(); - const sal_Int64 nPageValRight - = getXPath(pDump, "/root/page/infos/bounds"_ostr, "right"_ostr).toInt64(); - const sal_Int64 nPageValBottom - = getXPath(pDump, "/root/page/infos/bounds"_ostr, "bottom"_ostr).toInt64(); + const sal_Int64 nPageValLeft = getXPath(pDump, "/root/page/infos/bounds", "left").toInt64(); + const sal_Int64 nPageValTop = getXPath(pDump, "/root/page/infos/bounds", "top").toInt64(); + const sal_Int64 nPageValRight = getXPath(pDump, "/root/page/infos/bounds", "right").toInt64(); + const sal_Int64 nPageValBottom = getXPath(pDump, "/root/page/infos/bounds", "bottom").toInt64(); const sal_Int64 nShape1ValTop - = getXPath(pDump, "/root/page/body/txt/anchored/fly[1]/infos/bounds"_ostr, "top"_ostr) - .toInt64(); + = getXPath(pDump, "/root/page/body/txt/anchored/fly[1]/infos/bounds", "top").toInt64(); const sal_Int64 nShape2ValLeft - = getXPath(pDump, "/root/page/body/txt/anchored/fly[2]/infos/bounds"_ostr, "left"_ostr) - .toInt64(); + = getXPath(pDump, "/root/page/body/txt/anchored/fly[2]/infos/bounds", "left").toInt64(); const sal_Int64 nShape3ValRight - = getXPath(pDump, "/root/page/body/txt/anchored/fly[3]/infos/bounds"_ostr, "right"_ostr) - .toInt64(); + = getXPath(pDump, "/root/page/body/txt/anchored/fly[3]/infos/bounds", "right").toInt64(); const sal_Int64 nShape4ValBottom - = getXPath(pDump, "/root/page/body/txt/anchored/fly[4]/infos/bounds"_ostr, "bottom"_ostr) - .toInt64(); + = getXPath(pDump, "/root/page/body/txt/anchored/fly[4]/infos/bounds", "bottom").toInt64(); CPPUNIT_ASSERT_MESSAGE("The whole top textbox is inside the page!", nPageValTop > nShape1ValTop); @@ -2420,164 +2316,163 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFlys) dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(pLayout->IsHideRedlines()); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"19"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/merged"_ostr, - "paraPropsNodeIndex"_ostr, u"6"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", u"19"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/merged", + "paraPropsNodeIndex", u"6"); assertXPath( pXmlDoc, - "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/merged"_ostr, - "paraPropsNodeIndex"_ostr, u"11"_ustr); + "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/merged", + "paraPropsNodeIndex", u"11"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/" - "SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/" - "SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"jqr"_ustr); + "SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"jqr"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwFixPortion[1]"_ostr, - "type"_ostr, - u"PortionType::Fly"_ustr); // remove??? + "SwFixPortion[1]", + "type", + u"PortionType::Fly"); // remove??? assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLineLayout[1]"_ostr, - "type"_ostr, u"PortionType::Lay"_ustr); + "SwLineLayout[1]", + "type", u"PortionType::Lay"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLineLayout[1]"_ostr, - "portion"_ostr, u"abhi"_ustr); + "SwLineLayout[1]", + "portion", u"abhi"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type", + u"PortionType::Para"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"foaz"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"foaz"); dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(!pLayout->IsHideRedlines()); pXmlDoc = parseLayoutDump(); // show: nothing is merged - assertXPath(pXmlDoc, "//merged"_ostr, 0); + assertXPath(pXmlDoc, "//merged", 0); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/" - "SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/" - "SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"j"_ustr); + "SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"j"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/" - "SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/" - "SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"kl"_ustr); + "SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"kl"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[2]/" - "SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[2]/" - "SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"mno"_ustr); + "SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"mno"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[3]/" - "SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[3]/" - "SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"p"_ustr); + "SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"p"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[3]/" - "SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[3]/" - "SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"qr"_ustr); + "SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"qr"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwFixPortion[1]"_ostr, - "type"_ostr, - u"PortionType::Fly"_ustr); // remove??? + "SwFixPortion[1]", + "type", + u"PortionType::Fly"); // remove??? assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "portion"_ostr, u"ab"_ustr); + "SwLinePortion[1]", + "portion", u"ab"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "portion"_ostr, u"c"_ustr); + "SwLinePortion[2]", + "portion", u"c"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "portion"_ostr, u"def"_ustr); + "SwParaPortion[1]", + "portion", u"def"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "portion"_ostr, u"g"_ustr); + "SwLinePortion[1]", + "portion", u"g"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "portion"_ostr, u"hi"_ustr); + "SwLinePortion[2]", + "portion", u"hi"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "type", + u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"fo"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"fo"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type", + u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"o"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"o"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type", + u"PortionType::Para"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"bar"_ustr); + "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"bar"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "type", + u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"b"_ustr); + "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"b"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type", + u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"az"_ustr); + "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"az"); } // anchor to 2nd (deleted) paragraph @@ -2611,140 +2506,139 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFlys) dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(pLayout->IsHideRedlines()); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"19"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", u"19"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type", + u"PortionType::Para"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"foaz"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"foaz"); // hide: no anchored object shown - assertXPath(pXmlDoc, "//anchored"_ostr, 0); + assertXPath(pXmlDoc, "//anchored", 0); dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(!pLayout->IsHideRedlines()); pXmlDoc = parseLayoutDump(); // show: nothing is merged - assertXPath(pXmlDoc, "//merged"_ostr, 0); + assertXPath(pXmlDoc, "//merged", 0); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "type", + u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"fo"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"fo"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type", + u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"o"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"o"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "portion"_ostr, u"j"_ustr); + "SwLinePortion[1]", + "portion", u"j"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "portion"_ostr, u"kl"_ustr); + "SwLinePortion[2]", + "portion", u"kl"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/anchored[1]/fly[1]/txt[1]/" - "SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/anchored[1]/fly[1]/txt[1]/" - "SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"ab"_ustr); + "SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"ab"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/anchored[1]/fly[1]/txt[1]/" - "SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/anchored[1]/fly[1]/txt[1]/" - "SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"c"_ustr); + "SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"c"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/anchored[1]/fly[1]/txt[2]/" - "SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/anchored[1]/fly[1]/txt[2]/" - "SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"def"_ustr); + "SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"def"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/anchored[1]/fly[1]/txt[3]/" - "SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/anchored[1]/fly[1]/txt[3]/" - "SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"g"_ustr); + "SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"g"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/anchored[1]/fly[1]/txt[3]/" - "SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/anchored[1]/fly[1]/txt[3]/" - "SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"hi"_ustr); + "SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"hi"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/" - "SwFixPortion[1]"_ostr, - "type"_ostr, - u"PortionType::Fly"_ustr); // remove??? + "SwFixPortion[1]", + "type", + u"PortionType::Fly"); // remove??? assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/" - "SwLineLayout[1]"_ostr, - "type"_ostr, u"PortionType::Lay"_ustr); + "SwLineLayout[1]", + "type", u"PortionType::Lay"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/" - "SwLineLayout[1]"_ostr, - "portion"_ostr, u"mno"_ustr); + "SwLineLayout[1]", + "portion", u"mno"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "portion"_ostr, u"p"_ustr); + "SwLinePortion[1]", + "portion", u"p"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "portion"_ostr, u"qr"_ustr); + "SwLinePortion[2]", + "portion", u"qr"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type", + u"PortionType::Para"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"bar"_ustr); + "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"bar"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "type", + u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"b"_ustr); + "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"b"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type", + u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"az"_ustr); + "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"az"); } // anchor to 3rd paragraph @@ -2776,164 +2670,163 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFlys) dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(pLayout->IsHideRedlines()); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"19"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/merged"_ostr, - "paraPropsNodeIndex"_ostr, u"6"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", u"19"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/merged", + "paraPropsNodeIndex", u"6"); assertXPath( pXmlDoc, - "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/merged"_ostr, - "paraPropsNodeIndex"_ostr, u"11"_ustr); + "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/merged", + "paraPropsNodeIndex", u"11"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/" - "SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/" - "SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"jqr"_ustr); + "SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"jqr"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwFixPortion[1]"_ostr, - "type"_ostr, - u"PortionType::Fly"_ustr); // remove??? + "SwFixPortion[1]", + "type", + u"PortionType::Fly"); // remove??? assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLineLayout[1]"_ostr, - "type"_ostr, u"PortionType::Lay"_ustr); + "SwLineLayout[1]", + "type", u"PortionType::Lay"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLineLayout[1]"_ostr, - "portion"_ostr, u"abhi"_ustr); + "SwLineLayout[1]", + "portion", u"abhi"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type", + u"PortionType::Para"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"foaz"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"foaz"); dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(!pLayout->IsHideRedlines()); pXmlDoc = parseLayoutDump(); // show: nothing is merged - assertXPath(pXmlDoc, "//merged"_ostr, 0); + assertXPath(pXmlDoc, "//merged", 0); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "type", + u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"fo"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"fo"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type", + u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"o"_ustr); + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"o"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type", + u"PortionType::Para"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"bar"_ustr); + "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"bar"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "portion"_ostr, u"ab"_ustr); + "SwLinePortion[1]", + "portion", u"ab"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "portion"_ostr, u"c"_ustr); + "SwLinePortion[2]", + "portion", u"c"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "portion"_ostr, u"def"_ustr); + "SwParaPortion[1]", + "portion", u"def"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/anchored[1]/fly[1]/txt[1]/" - "SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/anchored[1]/fly[1]/txt[1]/" - "SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"j"_ustr); + "SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"j"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/anchored[1]/fly[1]/txt[1]/" - "SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/anchored[1]/fly[1]/txt[1]/" - "SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"kl"_ustr); + "SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"kl"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/anchored[1]/fly[1]/txt[2]/" - "SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/anchored[1]/fly[1]/txt[2]/" - "SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"mno"_ustr); + "SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"mno"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/anchored[1]/fly[1]/txt[3]/" - "SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/anchored[1]/fly[1]/txt[3]/" - "SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"p"_ustr); + "SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"p"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/anchored[1]/fly[1]/txt[3]/" - "SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/anchored[1]/fly[1]/txt[3]/" - "SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"qr"_ustr); + "SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"qr"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwFixPortion[1]"_ostr, - "type"_ostr, - u"PortionType::Fly"_ustr); // remove??? + "SwFixPortion[1]", + "type", + u"PortionType::Fly"); // remove??? assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "portion"_ostr, u"g"_ustr); + "SwLinePortion[1]", + "portion", u"g"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "portion"_ostr, u"hi"_ustr); + "SwLinePortion[2]", + "portion", u"hi"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "type", + u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"b"_ustr); + "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"b"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type", + u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"az"_ustr); + "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"az"); } } @@ -3005,163 +2898,150 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysAtFlys) dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(pLayout->IsHideRedlines()); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"19"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/merged"_ostr, - "paraPropsNodeIndex"_ostr, u"6"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", u"19"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/merged", + "paraPropsNodeIndex", u"6"); assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/merged"_ostr, - "paraPropsNodeIndex"_ostr, u"11"_ustr); + "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/merged", + "paraPropsNodeIndex", u"11"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"jqr"_ustr); + "SwLineLayout/SwParaPortion[1]", + "portion", u"jqr"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwFixPortion[1]"_ostr, - "type"_ostr, - u"PortionType::Fly"_ustr); // remove??? + "SwFixPortion[1]", + "type", + u"PortionType::Fly"); // remove??? assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLineLayout[1]"_ostr, - "type"_ostr, u"PortionType::Lay"_ustr); + "SwLineLayout[1]", + "type", u"PortionType::Lay"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLineLayout[1]"_ostr, - "portion"_ostr, u"abhi"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"foaz"_ustr); + "SwLineLayout[1]", + "portion", u"abhi"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"foaz"); dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(!pLayout->IsHideRedlines()); pXmlDoc = parseLayoutDump(); // show: nothing is merged - assertXPath(pXmlDoc, "//merged"_ostr, 0); + assertXPath(pXmlDoc, "//merged", 0); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"j"_ustr); + "SwLineLayout/SwLinePortion[1]", + "portion", u"j"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"kl"_ustr); + "SwLineLayout/SwLinePortion[2]", + "portion", u"kl"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[2]/SwParaPortion/" - "SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[2]/SwParaPortion/" - "SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"mno"_ustr); + "SwLineLayout/SwParaPortion[1]", + "portion", u"mno"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[3]/SwParaPortion/" - "SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[3]/SwParaPortion/" - "SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"p"_ustr); + "SwLineLayout/SwLinePortion[1]", + "portion", u"p"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[3]/SwParaPortion/" - "SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[3]/SwParaPortion/" - "SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"qr"_ustr); + "SwLineLayout/SwLinePortion[2]", + "portion", u"qr"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwFixPortion[1]"_ostr, - "type"_ostr, - u"PortionType::Fly"_ustr); // remove??? + "SwFixPortion[1]", + "type", + u"PortionType::Fly"); // remove??? assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "portion"_ostr, u"ab"_ustr); + "SwLinePortion[1]", + "portion", u"ab"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "portion"_ostr, u"c"_ustr); + "SwLinePortion[2]", + "portion", u"c"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "portion"_ostr, u"def"_ustr); + "SwParaPortion[1]", + "portion", u"def"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "portion"_ostr, u"g"_ustr); + "SwLinePortion[1]", + "portion", u"g"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "portion"_ostr, u"hi"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"fo"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"o"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"bar"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"b"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"az"_ustr); + "SwLinePortion[2]", + "portion", u"hi"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"fo"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"o"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"bar"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"b"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"az"); // anchor to 2nd (deleted) paragraph pWrtShell->StartOfSection(); @@ -3173,140 +3053,127 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysAtFlys) dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(pLayout->IsHideRedlines()); pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"19"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"foaz"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", u"19"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"foaz"); // hide: no anchored object shown - assertXPath(pXmlDoc, "//anchored"_ostr, 0); + assertXPath(pXmlDoc, "//anchored", 0); dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(!pLayout->IsHideRedlines()); pXmlDoc = parseLayoutDump(); // show: nothing is merged - assertXPath(pXmlDoc, "//merged"_ostr, 0); + assertXPath(pXmlDoc, "//merged", 0); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"fo"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"o"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"fo"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"o"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"j"_ustr); + "SwLineLayout/SwLinePortion[1]", + "portion", u"j"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"kl"_ustr); + "SwLineLayout/SwLinePortion[2]", + "portion", u"kl"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[2]/SwParaPortion/" - "SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[2]/SwParaPortion/" - "SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"mno"_ustr); + "SwLineLayout/SwParaPortion[1]", + "portion", u"mno"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[3]/SwParaPortion/" - "SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[3]/SwParaPortion/" - "SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"p"_ustr); + "SwLineLayout/SwLinePortion[1]", + "portion", u"p"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[3]/SwParaPortion/" - "SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[3]/SwParaPortion/" - "SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"qr"_ustr); + "SwLineLayout/SwLinePortion[2]", + "portion", u"qr"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwFixPortion[1]"_ostr, - "type"_ostr, - u"PortionType::Fly"_ustr); // remove??? + "SwFixPortion[1]", + "type", + u"PortionType::Fly"); // remove??? assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "portion"_ostr, u"ab"_ustr); + "SwLinePortion[1]", + "portion", u"ab"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "portion"_ostr, u"c"_ustr); + "SwLinePortion[2]", + "portion", u"c"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "portion"_ostr, u"def"_ustr); + "SwParaPortion[1]", + "portion", u"def"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[1]"_ostr, - "portion"_ostr, u"g"_ustr); + "SwLinePortion[1]", + "portion", u"g"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "SwLinePortion[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/" - "SwLinePortion[2]"_ostr, - "portion"_ostr, u"hi"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"bar"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"b"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"az"_ustr); + "SwLinePortion[2]", + "portion", u"hi"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"bar"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"b"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"az"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineSections) @@ -3328,74 +3195,74 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineSections) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // show: nothing is merged - assertXPath(pXmlDoc, "//merged"_ostr, 0); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*[1]"_ostr, - "portion"_ostr, u"fo"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*[2]"_ostr, - "portion"_ostr, u"o"_ustr); + assertXPath(pXmlDoc, "//merged", 0); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*[1]", "type", + u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*[1]", + "portion", u"fo"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*[2]", "type", + u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*[2]", + "portion", u"o"); assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/child::*[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwLineLayout/child::*[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/" - "SwLineLayout/child::*[1]"_ostr, - "portion"_ostr, u"FRAME"_ustr); + "SwLineLayout/child::*[1]", + "portion", u"FRAME"); assertXPath(pXmlDoc, - "/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout/child::*[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout/child::*[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, - "/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout/child::*[1]"_ostr, - "portion"_ostr, u"bar"_ustr); + "/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout/child::*[1]", + "portion", u"bar"); assertXPath(pXmlDoc, - "/root/page[1]/body/section[1]/txt[2]/SwParaPortion/SwLineLayout/child::*[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/body/section[1]/txt[2]/SwParaPortion/SwLineLayout/child::*[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, - "/root/page[1]/body/section[1]/txt[2]/SwParaPortion/SwLineLayout/child::*[1]"_ostr, - "portion"_ostr, u"baz"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/child::*[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/child::*[1]"_ostr, - "portion"_ostr, u"b"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/child::*[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/child::*[2]"_ostr, - "portion"_ostr, u"lah"_ustr); + "/root/page[1]/body/section[1]/txt[2]/SwParaPortion/SwLineLayout/child::*[1]", + "portion", u"baz"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/child::*[1]", "type", + u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/child::*[1]", + "portion", u"b"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/child::*[2]", "type", + u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/child::*[2]", + "portion", u"lah"); assertXPath(pXmlDoc, - "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/child::*[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/child::*[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/child::*[1]"_ostr, - "portion"_ostr, u"fo"_ustr); + "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/child::*[1]", + "portion", u"fo"); assertXPath(pXmlDoc, - "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/child::*[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/child::*[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/child::*[2]"_ostr, - "portion"_ostr, u"o"_ustr); + "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/child::*[2]", + "portion", u"o"); assertXPath(pXmlDoc, - "/root/page[1]/body/section[2]/txt[2]/SwParaPortion/SwLineLayout/child::*[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "/root/page[1]/body/section[2]/txt[2]/SwParaPortion/SwLineLayout/child::*[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, - "/root/page[1]/body/section[2]/txt[2]/SwParaPortion/SwLineLayout/child::*[1]"_ostr, - "portion"_ostr, u"bar"_ustr); + "/root/page[1]/body/section[2]/txt[2]/SwParaPortion/SwLineLayout/child::*[1]", + "portion", u"bar"); assertXPath(pXmlDoc, - "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/child::*[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/child::*[1]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/child::*[1]"_ostr, - "portion"_ostr, u"b"_ustr); + "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/child::*[1]", + "portion", u"b"); assertXPath(pXmlDoc, - "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/child::*[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/child::*[2]", + "type", u"PortionType::Text"); assertXPath(pXmlDoc, - "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/child::*[2]"_ostr, - "portion"_ostr, u"lah"_ustr); + "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/child::*[2]", + "portion", u"lah"); // verify after hide dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); @@ -3432,14 +3299,11 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineTables) // verify after load xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"12"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"foar"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", u"12"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"foar"); dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(!pLayout->IsHideRedlines()); @@ -3448,56 +3312,48 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineTables) pXmlDoc = parseLayoutDump(); // show: nothing is merged - assertXPath(pXmlDoc, "//merged"_ostr, 0); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"fo"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"o"_ustr); + assertXPath(pXmlDoc, "//merged", 0); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"fo"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"o"); assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row[1]/cell[1]/txt[1]/anchored/fly[1]/txt[1]/" - "SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row[1]/cell[1]/txt[1]/anchored/fly[1]/txt[1]/" - "SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"FRAME"_ustr); + "SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"FRAME"); assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row[1]/cell[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row[1]/cell[1]/txt[1]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "portion"_ostr, u"aaa"_ustr); + "SwParaPortion[1]", + "portion", u"aaa"); assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); + "SwParaPortion[1]", + "type", u"PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/" - "SwParaPortion[1]"_ostr, - "portion"_ostr, u"ddd"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"b"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"ar"_ustr); + "SwParaPortion[1]", + "portion", u"ddd"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"b"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"ar"); // verify after hide dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); @@ -3505,14 +3361,11 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineTables) // why is this needed explicitly? calcLayout(); pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"12"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"foar"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", u"12"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"foar"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144057) @@ -3525,23 +3378,19 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144057) CPPUNIT_ASSERT(!pLayout->IsHideRedlines()); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // show tracked row deletions - assertXPath(pXmlDoc, "/root/page"_ostr, 4); - assertXPath( - pXmlDoc, - "/root/page[1]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion"_ostr, - "portion"_ostr, u"A6"_ustr); - assertXPath( - pXmlDoc, - "/root/page[2]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion"_ostr, - "portion"_ostr, u"A12"_ustr); - assertXPath( - pXmlDoc, - "/root/page[3]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion"_ostr, - "portion"_ostr, u"B6"_ustr); - assertXPath( - pXmlDoc, - "/root/page[4]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion"_ostr, - "portion"_ostr, u"B12"_ustr); + assertXPath(pXmlDoc, "/root/page", 4); + assertXPath(pXmlDoc, + "/root/page[1]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion", + "portion", u"A6"); + assertXPath(pXmlDoc, + "/root/page[2]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion", + "portion", u"A12"); + assertXPath(pXmlDoc, + "/root/page[3]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion", + "portion", u"B6"); + assertXPath(pXmlDoc, + "/root/page[4]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion", + "portion", u"B12"); // hide tracked table and table row deletions dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); @@ -3550,36 +3399,31 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144057) pXmlDoc = parseLayoutDump(); // This was 4 (unhidden tracked table and table row deletions) - assertXPath(pXmlDoc, "/root/page"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[1]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[1]/body/tab/row"_ostr, 5); - assertXPath( - pXmlDoc, - "/root/page[1]/body/tab/row[5]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion"_ostr, - "portion"_ostr, u"B12"_ustr); + assertXPath(pXmlDoc, "/root/page", 1); + assertXPath(pXmlDoc, "/root/page[1]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 5); + assertXPath(pXmlDoc, + "/root/page[1]/body/tab/row[5]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion", + "portion", u"B12"); // show tracked table and table row deletions again dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(!pLayout->IsHideRedlines()); calcLayout(); pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page"_ostr, 4); - assertXPath( - pXmlDoc, - "/root/page[1]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion"_ostr, - "portion"_ostr, u"A6"_ustr); - assertXPath( - pXmlDoc, - "/root/page[2]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion"_ostr, - "portion"_ostr, u"A12"_ustr); - assertXPath( - pXmlDoc, - "/root/page[3]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion"_ostr, - "portion"_ostr, u"B6"_ustr); - assertXPath( - pXmlDoc, - "/root/page[4]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion"_ostr, - "portion"_ostr, u"B12"_ustr); + assertXPath(pXmlDoc, "/root/page", 4); + assertXPath(pXmlDoc, + "/root/page[1]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion", + "portion", u"A6"); + assertXPath(pXmlDoc, + "/root/page[2]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion", + "portion", u"A12"); + assertXPath(pXmlDoc, + "/root/page[3]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion", + "portion", u"B6"); + assertXPath(pXmlDoc, + "/root/page[4]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion", + "portion", u"B12"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144347) @@ -3605,8 +3449,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144347) calcLayout(); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // show tracked row deletions - assertXPath(pXmlDoc, "/root/page"_ostr, 2); - assertXPath(pXmlDoc, "/root/page[1]/body/tab"_ostr, 1); + assertXPath(pXmlDoc, "/root/page", 2); + assertXPath(pXmlDoc, "/root/page[1]/body/tab", 1); // select all the text, including the texts before and after the table // Note: this table contains tracked changes, which was a @@ -3619,8 +3463,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144347) pXmlDoc = parseLayoutDump(); // table is deleted with change tracking: it still exists - assertXPath(pXmlDoc, "/root/page"_ostr, 2); - assertXPath(pXmlDoc, "/root/page[1]/body/tab"_ostr, 1); + assertXPath(pXmlDoc, "/root/page", 2); + assertXPath(pXmlDoc, "/root/page[1]/body/tab", 1); // accept all deletions, removing the table completely while (pEditShell->GetRedlineCount() > 0) @@ -3629,9 +3473,9 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144347) calcLayout(); pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page"_ostr, 1); + assertXPath(pXmlDoc, "/root/page", 1); // This was 1 (bad empty table) - assertXPath(pXmlDoc, "/root/page[1]/body/tab"_ostr, 0); + assertXPath(pXmlDoc, "/root/page[1]/body/tab", 0); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf155345) @@ -3656,7 +3500,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf155345) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // show tracked column deletions - assertXPath(pXmlDoc, "/root/page"_ostr, 4); + assertXPath(pXmlDoc, "/root/page", 4); // hide tracked table column deletions dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); @@ -3665,14 +3509,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf155345) pXmlDoc = parseLayoutDump(); // This was 4 (unhidden tracked table column deletions) - assertXPath(pXmlDoc, "/root/page"_ostr, 2); + assertXPath(pXmlDoc, "/root/page", 2); // show tracked table column deletions again dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); CPPUNIT_ASSERT(!pLayout->IsHideRedlines()); calcLayout(); pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page"_ostr, 4); + assertXPath(pXmlDoc, "/root/page", 4); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf109137) @@ -3689,7 +3533,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf109137) mxComponent = loadFromDesktop(maTempFile.GetURL(), u"com.sun.star.text.TextDocument"_ustr); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was 0, the blue rectangle moved from the 1st to the 2nd page. - assertXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/fly/notxt"_ostr, + assertXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/fly/notxt", /*nNumberOfNodes=*/1); } @@ -3774,7 +3618,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128611) // - Actual : 14 // i.e. there were multiple portions in the first paragraph of the A1 cell, which means that the // rotated text was broken into multiple lines without a good reason. - assertXPathContent(pXmlDoc, "//tab/row/cell[1]/txt"_ostr, u"Abcd efghijkl"_ustr); + assertXPathContent(pXmlDoc, "//tab/row/cell[1]/txt", u"Abcd efghijkl"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf159101) @@ -3784,14 +3628,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf159101) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT(pXmlDoc); - assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/SwFieldPortion"_ostr, - "expand"_ostr, u"One"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/SwFieldPortion", + "expand", u"One"); // Without the fix in place, this test would have failed with // - Expected: two // - Actual : two - assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[2]/SwFieldPortion"_ostr, - "expand"_ostr, u"two"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[2]/SwFieldPortion", + "expand", u"two"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf157628) @@ -3801,10 +3645,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf157628) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT(pXmlDoc); - assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwLinePortion"_ostr, - "portion"_ostr, u"This is in first row"_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[2]/SwLinePortion"_ostr, - "portion"_ostr, u"This is second row*"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwLinePortion", + "portion", u"This is in first row"); + assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[2]/SwLinePortion", + "portion", u"This is second row*"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf142694) @@ -3819,17 +3663,16 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf142694) // repeated header row; currently it's split so that the 3rd text frame is // on a page of its own and extends outside the table. - assertXPathNoAttribute(pXmlDoc, "/root/page[4]/body/tab[1]"_ostr, "precede"_ostr); - CPPUNIT_ASSERT(!getXPath(pXmlDoc, "/root/page[4]/body/tab[1]"_ostr, "follow"_ostr).isEmpty()); - assertXPath(pXmlDoc, "/root/page[4]/body/tab[1]/row[1]/cell[1]/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[4]/body/tab[1]/row[2]/cell[1]/txt"_ostr, 2); - CPPUNIT_ASSERT(!getXPath(pXmlDoc, "/root/page[5]/body/tab[1]"_ostr, "precede"_ostr).isEmpty()); - assertXPathNoAttribute(pXmlDoc, "/root/page[5]/body/tab[1]"_ostr, "follow"_ostr); - assertXPath(pXmlDoc, "/root/page[5]/body/tab[1]/row[1]/cell[1]/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[5]/body/tab[1]/row[2]/cell[1]/tab"_ostr, 1); - assertXPathNoAttribute(pXmlDoc, "/root/page[5]/body/tab[1]/row[2]/cell[1]/tab"_ostr, - "follow"_ostr); - assertXPath(pXmlDoc, "/root/page[5]/body/tab[1]/row[2]/cell[1]/tab/row/cell/txt"_ostr, 1); + assertXPathNoAttribute(pXmlDoc, "/root/page[4]/body/tab[1]", "precede"); + CPPUNIT_ASSERT(!getXPath(pXmlDoc, "/root/page[4]/body/tab[1]", "follow").isEmpty()); + assertXPath(pXmlDoc, "/root/page[4]/body/tab[1]/row[1]/cell[1]/tab", 1); + assertXPath(pXmlDoc, "/root/page[4]/body/tab[1]/row[2]/cell[1]/txt", 2); + CPPUNIT_ASSERT(!getXPath(pXmlDoc, "/root/page[5]/body/tab[1]", "precede").isEmpty()); + assertXPathNoAttribute(pXmlDoc, "/root/page[5]/body/tab[1]", "follow"); + assertXPath(pXmlDoc, "/root/page[5]/body/tab[1]/row[1]/cell[1]/tab", 1); + assertXPath(pXmlDoc, "/root/page[5]/body/tab[1]/row[2]/cell[1]/tab", 1); + assertXPathNoAttribute(pXmlDoc, "/root/page[5]/body/tab[1]/row[2]/cell[1]/tab", "follow"); + assertXPath(pXmlDoc, "/root/page[5]/body/tab[1]/row[2]/cell[1]/tab/row/cell/txt", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf152413) @@ -3841,8 +3684,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf152413) // - Expected: 1 // - Actual : 2 // - In <>, XPath '/root/page/body/txt/SwParaPortion/SwLineLayout/SwLinePortion' number of nodes is incorrect - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/SwLinePortion"_ostr, - "portion"_ostr, u"صِرَ ٰطَ"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/SwLinePortion", "portion", + u"صِرَ ٰطَ"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf125893) @@ -3850,7 +3693,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf125893) createSwDoc("tdf125893.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was 400. The paragraph must have zero top border. - assertXPath(pXmlDoc, "/root/page/body/txt[4]/infos/prtBounds"_ostr, "top"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt[4]/infos/prtBounds", "top", u"0"); } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx index 59d546c616d8..64f5768eff42 100644 --- a/sw/qa/extras/layout/layout2.cxx +++ b/sw/qa/extras/layout/layout2.cxx @@ -50,142 +50,93 @@ protected: void SwLayoutWriter2::CheckRedlineCharAttributesHidden() { xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"9"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"foobaz"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"10"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"foobaz"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"11"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"foo"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"baz"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"12"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"foo"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"baz"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"13"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"foo"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"baz"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"14"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"foo"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"baz"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"15"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"foo"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"baz"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"16"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"foo"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"baz"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"17"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"foobaz"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"18"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"fo"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"ob"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "portion"_ostr, u"az"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/merged"_ostr, "paraPropsNodeIndex"_ostr, - u"19"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "type"_ostr, u"PortionType::Para"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, - "portion"_ostr, u"foobaz"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", u"9"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"foobaz"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/merged", "paraPropsNodeIndex", u"10"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"foobaz"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/merged", "paraPropsNodeIndex", u"11"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"foo"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"baz"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/merged", "paraPropsNodeIndex", u"12"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"foo"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"baz"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/merged", "paraPropsNodeIndex", u"13"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"foo"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"baz"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/merged", "paraPropsNodeIndex", u"14"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"foo"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"baz"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/merged", "paraPropsNodeIndex", u"15"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"foo"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"baz"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/merged", "paraPropsNodeIndex", u"16"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"foo"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"baz"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/merged", "paraPropsNodeIndex", u"17"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"foobaz"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/merged", "paraPropsNodeIndex", u"18"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"fo"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"ob"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "portion", u"az"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/merged", "paraPropsNodeIndex", u"19"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "type", u"PortionType::Para"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwParaPortion[1]", + "portion", u"foobaz"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf148897) @@ -194,20 +145,19 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf148897) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/sorted_objs/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/sorted_objs/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[3]/anchored/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[3]/sorted_objs/fly"_ostr, 0); - assertXPath(pXmlDoc, "/root/page[3]/body/txt/anchored/fly"_ostr, 0); - assertXPath(pXmlDoc, "/root/page[4]/sorted_objs/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[4]/body/txt[1]/anchored/fly"_ostr, 1); + assertXPath(pXmlDoc, "/root/page[1]/sorted_objs/fly", 1); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly", 1); + assertXPath(pXmlDoc, "/root/page[2]/sorted_objs/fly", 1); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[3]/anchored/fly", 1); + assertXPath(pXmlDoc, "/root/page[3]/sorted_objs/fly", 0); + assertXPath(pXmlDoc, "/root/page[3]/body/txt/anchored/fly", 0); + assertXPath(pXmlDoc, "/root/page[4]/sorted_objs/fly", 1); + assertXPath(pXmlDoc, "/root/page[4]/body/txt[1]/anchored/fly", 1); // fly portion exists, no overlapping text - assertXPath(pXmlDoc, - "/root/page[4]/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwFixPortion"_ostr, - "height"_ostr, u"5797"_ustr); - assertXPath(pXmlDoc, "/root/page[5]/sorted_objs/fly"_ostr, 0); - assertXPath(pXmlDoc, "/root/page"_ostr, 5); + assertXPath(pXmlDoc, "/root/page[4]/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwFixPortion", + "height", u"5797"); + assertXPath(pXmlDoc, "/root/page[5]/sorted_objs/fly", 0); + assertXPath(pXmlDoc, "/root/page", 5); auto xModel = mxComponent.queryThrow<frame::XModel>(); uno::Reference<drawing::XShape> xShape(getShapeByName(u"Image3")); @@ -218,56 +168,53 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf148897) pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/sorted_objs/fly"_ostr, 0); - assertXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/fly"_ostr, 0); - assertXPath(pXmlDoc, "/root/page[2]/sorted_objs/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[3]/sorted_objs/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[3]/body/txt[2]/anchored/fly"_ostr, 1); + assertXPath(pXmlDoc, "/root/page[1]/sorted_objs/fly", 0); + assertXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/fly", 0); + assertXPath(pXmlDoc, "/root/page[2]/sorted_objs/fly", 1); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly", 1); + assertXPath(pXmlDoc, "/root/page[3]/sorted_objs/fly", 1); + assertXPath(pXmlDoc, "/root/page[3]/body/txt[2]/anchored/fly", 1); // fly portion exists, no overlapping text - assertXPath(pXmlDoc, - "/root/page[3]/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwFixPortion"_ostr, - "height"_ostr, u"5797"_ustr); - assertXPath(pXmlDoc, "/root/page[4]/sorted_objs/fly"_ostr, 0); - assertXPath(pXmlDoc, "/root/page[4]/body/txt/anchored/fly"_ostr, 0); - assertXPath(pXmlDoc, "/root/page"_ostr, 4); + assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwFixPortion", + "height", u"5797"); + assertXPath(pXmlDoc, "/root/page[4]/sorted_objs/fly", 0); + assertXPath(pXmlDoc, "/root/page[4]/body/txt/anchored/fly", 0); + assertXPath(pXmlDoc, "/root/page", 4); dispatchCommand(mxComponent, u".uno:Undo"_ustr, {}); pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/sorted_objs/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/sorted_objs/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[3]/anchored/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[3]/sorted_objs/fly"_ostr, 0); - assertXPath(pXmlDoc, "/root/page[3]/body/txt/anchored/fly"_ostr, 0); - assertXPath(pXmlDoc, "/root/page[4]/sorted_objs/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[4]/body/txt[1]/anchored/fly"_ostr, 1); + assertXPath(pXmlDoc, "/root/page[1]/sorted_objs/fly", 1); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly", 1); + assertXPath(pXmlDoc, "/root/page[2]/sorted_objs/fly", 1); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[3]/anchored/fly", 1); + assertXPath(pXmlDoc, "/root/page[3]/sorted_objs/fly", 0); + assertXPath(pXmlDoc, "/root/page[3]/body/txt/anchored/fly", 0); + assertXPath(pXmlDoc, "/root/page[4]/sorted_objs/fly", 1); + assertXPath(pXmlDoc, "/root/page[4]/body/txt[1]/anchored/fly", 1); // fly portion exists, no overlapping text - assertXPath(pXmlDoc, - "/root/page[4]/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwFixPortion"_ostr, - "height"_ostr, u"5797"_ustr); - assertXPath(pXmlDoc, "/root/page[5]/sorted_objs/fly"_ostr, 0); - assertXPath(pXmlDoc, "/root/page"_ostr, 5); + assertXPath(pXmlDoc, "/root/page[4]/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwFixPortion", + "height", u"5797"); + assertXPath(pXmlDoc, "/root/page[5]/sorted_objs/fly", 0); + assertXPath(pXmlDoc, "/root/page", 5); dispatchCommand(mxComponent, u".uno:Redo"_ustr, {}); pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/sorted_objs/fly"_ostr, 0); - assertXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/fly"_ostr, 0); - assertXPath(pXmlDoc, "/root/page[2]/sorted_objs/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[3]/sorted_objs/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[3]/body/txt[2]/anchored/fly"_ostr, 1); + assertXPath(pXmlDoc, "/root/page[1]/sorted_objs/fly", 0); + assertXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/fly", 0); + assertXPath(pXmlDoc, "/root/page[2]/sorted_objs/fly", 1); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly", 1); + assertXPath(pXmlDoc, "/root/page[3]/sorted_objs/fly", 1); + assertXPath(pXmlDoc, "/root/page[3]/body/txt[2]/anchored/fly", 1); // fly portion exists, no overlapping text - assertXPath(pXmlDoc, - "/root/page[3]/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwFixPortion"_ostr, - "height"_ostr, u"5797"_ustr); - assertXPath(pXmlDoc, "/root/page[4]/sorted_objs/fly"_ostr, 0); - assertXPath(pXmlDoc, "/root/page[4]/body/txt/anchored/fly"_ostr, 0); - assertXPath(pXmlDoc, "/root/page"_ostr, 4); + assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwFixPortion", + "height", u"5797"); + assertXPath(pXmlDoc, "/root/page[4]/sorted_objs/fly", 0); + assertXPath(pXmlDoc, "/root/page[4]/body/txt/anchored/fly", 0); + assertXPath(pXmlDoc, "/root/page", 4); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineCharAttributes) @@ -289,235 +236,159 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineCharAttributes) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // show: nothing is merged - assertXPath(pXmlDoc, "//merged"_ostr, 0); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"foo"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"bar"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "portion"_ostr, u"baz"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"foo"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"bar"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "portion"_ostr, u"baz"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"foo"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"bar"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "portion"_ostr, u"baz"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"foo"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"bar"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "portion"_ostr, u"baz"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"foo"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"bar"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "portion"_ostr, u"baz"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"foo"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"bar"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "portion"_ostr, u"baz"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"foo"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"bar"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "portion"_ostr, u"baz"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"foo"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"ba"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "portion"_ostr, u"r"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[4]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[4]"_ostr, - "portion"_ostr, u"baz"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"foo"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"bar"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "portion"_ostr, u"baz"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"fo"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"o"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "portion"_ostr, u"bar"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[4]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[4]"_ostr, - "portion"_ostr, u"b"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[5]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[5]"_ostr, - "portion"_ostr, u"az"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"foo"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"b"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "portion"_ostr, u"a"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[4]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[4]"_ostr, - "portion"_ostr, u"r"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[5]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[5]"_ostr, - "portion"_ostr, u"baz"_ustr); + assertXPath(pXmlDoc, "//merged", 0); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"foo"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"bar"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "portion", u"baz"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"foo"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"bar"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "portion", u"baz"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"foo"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"bar"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "portion", u"baz"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"foo"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"bar"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "portion", u"baz"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"foo"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"bar"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "portion", u"baz"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"foo"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"bar"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "portion", u"baz"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"foo"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"bar"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "portion", u"baz"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"foo"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"ba"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "portion", u"r"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[4]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[4]", + "portion", u"baz"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"foo"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"bar"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "portion", u"baz"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"fo"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"o"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "portion", u"bar"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[4]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[4]", + "portion", u"b"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[5]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[5]", + "portion", u"az"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"foo"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"b"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "portion", u"a"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[4]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[4]", + "portion", u"r"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[5]", + "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[5]", + "portion", u"baz"); // verify after hide dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); @@ -539,23 +410,22 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineShowHideFootnotePagination) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // check footnotes - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn"_ostr, 6); - assertXPath(pXmlDoc, "/root/page[2]/ftncont/ftn"_ostr, 3); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn", 6); + assertXPath(pXmlDoc, "/root/page[2]/ftncont/ftn", 3); // check that first page ends with the y line and second page starts with z - assertXPath(pXmlDoc, "/root/page[1]/body/txt[last()]/SwParaPortion/SwLineLayout[last()]"_ostr, - "portion"_ostr, - u"yyyyyyyyy yyy yyyyyyyyyyyyyyyy yyyyyyy yyy yyyyy yyyyyyyyy yyy yyyyyyyyy "_ustr); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, - "portion"_ostr, - u"zzz. zzz zzzz zzzz* zzz zzz zzzzzzz zzz zzzz zzzzzzzzzzzzzz zzzzzzzzzzzz "_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[last()]/SwParaPortion/SwLineLayout[last()]", + "portion", + u"yyyyyyyyy yyy yyyyyyyyyyyyyyyy yyyyyyy yyy yyyyy yyyyyyyyy yyy yyyyyyyyy "); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/SwParaPortion/SwLineLayout[1]", "portion", + u"zzz. zzz zzzz zzzz* zzz zzz zzzzzzz zzz zzzz zzzzzzzzzzzzzz zzzzzzzzzzzz "); // hide redlines - all still visible footnotes move to page 1 dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn"_ostr, 2); - assertXPath(pXmlDoc, "/root/page[2]/ftncont/ftn"_ostr, 0); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn", 2); + assertXPath(pXmlDoc, "/root/page[2]/ftncont/ftn", 0); // show again - should now get the same result as on loading dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); @@ -563,15 +433,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineShowHideFootnotePagination) pXmlDoc = parseLayoutDump(); // check footnotes - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn"_ostr, 6); - assertXPath(pXmlDoc, "/root/page[2]/ftncont/ftn"_ostr, 3); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn", 6); + assertXPath(pXmlDoc, "/root/page[2]/ftncont/ftn", 3); // check that first page ends with the y line and second page starts with z - assertXPath(pXmlDoc, "/root/page[1]/body/txt[last()]/SwParaPortion/SwLineLayout[last()]"_ostr, - "portion"_ostr, - u"yyyyyyyyy yyy yyyyyyyyyyyyyyyy yyyyyyy yyy yyyyy yyyyyyyyy yyy yyyyyyyyy "_ustr); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, - "portion"_ostr, - u"zzz. zzz zzzz zzzz* zzz zzz zzzzzzz zzz zzzz zzzzzzzzzzzzzz zzzzzzzzzzzz "_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[last()]/SwParaPortion/SwLineLayout[last()]", + "portion", + u"yyyyyyyyy yyy yyyyyyyyyyyyyyyy yyyyyyy yyy yyyyy yyyyyyyyy yyy yyyyyyyyy "); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/SwParaPortion/SwLineLayout[1]", "portion", + u"zzz. zzz zzzz zzzz* zzz zzz zzzzzzz zzz zzzz zzzzzzzzzzzzzz zzzzzzzzzzzz "); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testtdf138951) @@ -610,21 +479,21 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150717) createSwDoc("tdf150717.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // check bookmark colors defined in metadata - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[2]"_ostr, - "colors"_ostr, u"#Bookmark1 Bookmark Start"_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[4]"_ostr, - "colors"_ostr, u"#Bookmark2 Bookmark Start"_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[6]"_ostr, - "colors"_ostr, u"#Bookmark2 Bookmark End#Bookmark1 Bookmark End"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[2]", "colors", + u"#Bookmark1 Bookmark Start"); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[4]", "colors", + u"#Bookmark2 Bookmark Start"); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[6]", "colors", + u"#Bookmark2 Bookmark End#Bookmark1 Bookmark End"); // full text, if bookmarks are visible - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[1]"_ostr, - "portion"_ostr, u"Lorem "_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[3]"_ostr, - "portion"_ostr, u"ipsum dolor et "_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[5]"_ostr, - "portion"_ostr, u"ames"_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[7]"_ostr, - "portion"_ostr, u"."_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[1]", "portion", + u"Lorem "); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[3]", "portion", + u"ipsum dolor et "); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[5]", "portion", + u"ames"); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[7]", "portion", + u"."); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150790) @@ -632,20 +501,17 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150790) createSwDoc("tdf150790.fodt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // point bookmark is shown as I-beam (only its text dump is |, as before on the screen) - assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout/SwBookmarkPortion"_ostr, - "colors"_ostr, u"#Bookmark 1 Bookmark"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout/SwBookmarkPortion", + "colors", u"#Bookmark 1 Bookmark"); // single start bookmark - assertXPath(pXmlDoc, - "/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwBookmarkPortion[1]"_ostr, - "colors"_ostr, u"#Bookmark 2 Bookmark Start"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwBookmarkPortion[1]", + "colors", u"#Bookmark 2 Bookmark Start"); // single end bookmark - assertXPath(pXmlDoc, - "/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwBookmarkPortion[3]"_ostr, - "colors"_ostr, u"#Bookmark 3 Bookmark End"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwBookmarkPortion[3]", + "colors", u"#Bookmark 3 Bookmark End"); // This was |, as before the point bookmark (neighboring end and start bookmarks) - assertXPath(pXmlDoc, - "/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwBookmarkPortion[2]"_ostr, - "colors"_ostr, u"#Bookmark 2 Bookmark End#Bookmark 3 Bookmark Start"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwBookmarkPortion[2]", + "colors", u"#Bookmark 2 Bookmark End#Bookmark 3 Bookmark Start"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf129357) @@ -662,8 +528,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf129357) CPPUNIT_ASSERT(pXmlDoc); // visible soft hyphen - assertXPathContent(pXmlDoc, "/metafile/push/push/push/push/push/textarray[2]/text"_ostr, - u"-"_ustr); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/push/push/textarray[2]/text", u"-"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineNumberInNumbering) @@ -684,12 +549,11 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineNumberInNumbering) // (and not COL_GREEN color of the tracked text movement, see testRedlineMoving) elements assertXPath( pXmlDoc, - "/metafile/push/push/push/textcolor[not(@color='#000000') and not(@color='#008000')]"_ostr, - 5); + "/metafile/push/push/push/textcolor[not(@color='#000000') and not(@color='#008000')]", 5); // tdf#145068 numbering shows changes in the associated list item, not the next one // This was 1 (black numbering of the first list item previously) - assertXPath(pXmlDoc, "/metafile/push/push/push/font[4][@color='#000000']"_ostr, 0); + assertXPath(pXmlDoc, "/metafile/push/push/push/font[4][@color='#000000']", 0); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineNumbering) @@ -707,11 +571,11 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineNumbering) // Show the correct and the original line numbering instead of counting // the deleted list items in Show Changes mode, as part of the list - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[1]/text"_ostr, u"1."_ustr); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[1]/text", u"1."); // This was "2." (deleted text node, now its text content is part of the first list item) - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text"_ostr, u"[2.] "_ustr); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text", u"[2.] "); // This was "3." (now it's the second list item) - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[5]/text"_ostr, u"2.[3.] "_ustr); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[5]/text", u"2.[3.] "); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineNumbering2) @@ -728,12 +592,12 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineNumbering2) CPPUNIT_ASSERT(pXmlDoc); // Show the correct and the original line numbering in Show Changes mode - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[1]/text"_ostr, u"1."_ustr); - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text"_ostr, u"2."_ustr); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[1]/text", u"1."); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text", u"2."); // FIXME: show as 3.[2.] - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[5]/text"_ostr, u"3."_ustr); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[5]/text", u"3."); // This was "4." (not shown the original number) - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[7]/text"_ostr, u"4.[3.] "_ustr); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[7]/text", u"4.[3.] "); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf149710_RedlineNumberingEditing) @@ -764,19 +628,19 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf149710_RedlineNumberingEditing) // Show the correct and the original line numbering instead of counting // the deleted list items in Show Changes mode, as part of the list // This was "1." - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[1]/text"_ostr, u"[1.] "_ustr); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[1]/text", u"[1.] "); // This was "2." (deleted text node, now its text content is part of the first list item) - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text"_ostr, u"1.[2.] "_ustr); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text", u"1.[2.] "); // This was "3." (now it's the second list item) - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[5]/text"_ostr, u"2.[3.] "_ustr); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[5]/text", u"2.[3.] "); // remove the tracked deletion, and check the layout again pWrtShell->Undo(); xMetaFile = pShell->GetPreviewMetaFile(); pXmlDoc = dumpAndParse(dumper, *xMetaFile); - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[1]/text"_ostr, u"1."_ustr); - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text"_ostr, u"2."_ustr); - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[5]/text"_ostr, u"3."_ustr); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[1]/text", u"1."); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text", u"2."); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[5]/text", u"3."); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf149709_RedlineNumberingLevel) @@ -806,35 +670,35 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf149709_RedlineNumberingLevel) // Show the correct and the original line numbering instead of counting // the deleted list items in Show Changes mode, as part of the list - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[1]/text"_ostr, u"1."_ustr); - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text"_ostr, u"a)"_ustr); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[1]/text", u"1."); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text", u"a)"); // This was "b)[2.]" - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[4]/text"_ostr, u"b)[a)] "_ustr); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[4]/text", u"b)[a)] "); // This was "c)[3.]" - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[6]/text"_ostr, u"c)[b)] "_ustr); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[6]/text", u"c)[b)] "); // This was "4.[2.]" (after disabling Show Changes, and enabling again) - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[8]/text"_ostr, u"2."_ustr); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[8]/text", u"2."); // remove the tracked deletion, and check the layout again pWrtShell->Undo(); xMetaFile = pShell->GetPreviewMetaFile(); pXmlDoc = dumpAndParse(dumper, *xMetaFile); - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[1]/text"_ostr, u"1."_ustr); - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text"_ostr, u"a)"_ustr); - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[5]/text"_ostr, u"b)"_ustr); - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[7]/text"_ostr, u"2."_ustr); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[1]/text", u"1."); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text", u"a)"); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[5]/text", u"b)"); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[7]/text", u"2."); // check Redo pWrtShell->Redo(); xMetaFile = pShell->GetPreviewMetaFile(); pXmlDoc = dumpAndParse(dumper, *xMetaFile); - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[1]/text"_ostr, u"1."_ustr); - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text"_ostr, u"a)"_ustr); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[1]/text", u"1."); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text", u"a)"); // TODO: show as b)[a)] - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[4]/text"_ostr, u"b)"_ustr); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[4]/text", u"b)"); // FIXME: This must be "c)[b]" - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[6]/text"_ostr, u"c)[a)] "_ustr); - assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[8]/text"_ostr, u"2."_ustr); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[6]/text", u"c)[a)] "); + assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[8]/text", u"2."); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf149711_importDOCXMoveToParagraphMark) @@ -842,7 +706,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf149711_importDOCXMoveToParagraphMar createSwDoc("tdf149711.docx"); SwDoc* pDoc = getSwDoc(); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 6); + assertXPath(pXmlDoc, "/root/page[1]/body/txt", 6); // reject tracked insertion (moveTo) SwEditShell* const pEditShell(pDoc->GetEditShell()); @@ -852,7 +716,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf149711_importDOCXMoveToParagraphMar pXmlDoc = parseLayoutDump(); // This was 6 (not tracked paragraph mark of the moveTo list item) - assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 5); + assertXPath(pXmlDoc, "/root/page[1]/body/txt", 5); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf152872) @@ -860,41 +724,36 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf152872) createSwDoc("hidden-para-separator.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 2); - assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, "portion"_ostr, - u"C DE"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt", 2); + assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout", "portion", u"C DE"); // 5 is empty and hidden - assertXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds"_ostr, "height"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds", "height", u"0"); dispatchCommand(mxComponent, u".uno:ControlCodes"_ustr, {}); pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 5); - assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, "portion"_ostr, - u"C "_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout"_ostr, "portion"_ostr, - u"D"_ustr); + 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"_ostr, "height"_ostr, u"0"_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt[4]/SwParaPortion/SwLineLayout"_ostr, "portion"_ostr, - u"E"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt[3]/infos/bounds", "height", u"0"); + 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"_ostr, "height"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt[5]/infos/bounds", "height", u"0"); dispatchCommand(mxComponent, u".uno:ControlCodes"_ustr, {}); pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 2); - assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, "portion"_ostr, - u"C DE"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt", 2); + assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout", "portion", u"C DE"); // 5 is empty and hidden - assertXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds"_ostr, "height"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds", "height", u"0"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf151954) @@ -902,7 +761,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf151954) createSwDoc("tdf151954.docx"); SwDoc* pDoc = getSwDoc(); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 2); + assertXPath(pXmlDoc, "/root/page[1]/body/txt", 2); // accept tracked insertion (moveTo) SwEditShell* const pEditShell(pDoc->GetEditShell()); @@ -912,7 +771,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf151954) pXmlDoc = parseLayoutDump(); // This was 1 (moveFrom was extended to the paragraph mark) - assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 2); + assertXPath(pXmlDoc, "/root/page[1]/body/txt", 2); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf152952) @@ -920,11 +779,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf152952) createSwDoc("Hyphenated-link.rtf"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // URL should not be hyphenated - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, - "portion"_ostr, u" NNNNNNNNNN NNNNNNNNNNNNNNN "_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]"_ostr, - "portion"_ostr, - u"https://example.com/xxxxxxx/testtesttesttest/hyphenate/testtesttest "_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]", "portion", + u" NNNNNNNNNN NNNNNNNNNNNNNNN "); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]", "portion", + u"https://example.com/xxxxxxx/testtesttesttest/hyphenate/testtesttest "); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf152952_compat) @@ -936,11 +794,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf152952_compat) createSwDoc("Hyphenated-link.fodt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // URL hyphenated for backward compatibility - assertXPath( - pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, "portion"_ostr, - u" NNNNNNNNNN NNNNNNNNNNNNNNN https://example.com/xxxxxxx/testtesttesttest/hyphen"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]"_ostr, - "portion"_ostr, u"ate/testtesttest "_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]", "portion", + u" NNNNNNNNNN NNNNNNNNNNNNNNN https://example.com/xxxxxxx/testtesttesttest/hyphen"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]", "portion", + u"ate/testtesttest "); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf158885_compound_remain) @@ -959,12 +816,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf158885_compound_remain) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // hyphenate compound word with 3- or more character distance from the stem boundary // This was "emberel=lenes" (now "ember=ellenes", i.e. hyphenating at the stem boundary) - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, - "portion"_ostr, - u"emberellenes emberellenes emberellenes emberellenes emberellenes ember"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]"_ostr, - "portion"_ostr, - u"ellenes emberellenes emberellenes emberellenes emberellenes emberellenes "_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]", "portion", + u"emberellenes emberellenes emberellenes emberellenes emberellenes ember"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]", "portion", + u"ellenes emberellenes emberellenes emberellenes emberellenes emberellenes "); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf158885_not_compound_remain) @@ -984,12 +839,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf158885_not_compound_remain) // hyphenate compound word with 2-character distance from the stem boundary, // resulting less readable hyphenation "emberel=lenes" ("emberel" and "lenes" have // different meanings, than the original word parts) - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, - "portion"_ostr, - u"emberellenes emberellenes emberellenes emberellenes emberellenes emberel"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]"_ostr, - "portion"_ostr, - u"lenes emberellenes emberellenes emberellenes emberellenes emberellenes "_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]", "portion", + u"emberellenes emberellenes emberellenes emberellenes emberellenes emberel"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]", "portion", + u"lenes emberellenes emberellenes emberellenes emberellenes emberellenes "); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineNumberInFootnote) @@ -1008,7 +861,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineNumberInFootnote) // changed color of numbers of footnote 1 (deleted footnote) and footnote 2 (inserted footnote) // decreased the black <font> elements by 2: // This was 7 - assertXPath(pXmlDoc, "/metafile/push/push/push/font[@color='#000000']"_ostr, 5); + assertXPath(pXmlDoc, "/metafile/push/push/push/font[@color='#000000']", 5); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineMoving) @@ -1036,8 +889,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineMoving) // text and numbering colors show moving of the list item // tdf#157663: the moved text item "It" is detected as text moving again! - assertXPath(pXmlDoc, "/metafile/push/push/push/textcolor[@color='#008000']"_ostr, 5); - assertXPath(pXmlDoc, "/metafile/push/push/push/font[@color='#008000']"_ostr, 11); + assertXPath(pXmlDoc, "/metafile/push/push/push/textcolor[@color='#008000']", 5); + assertXPath(pXmlDoc, "/metafile/push/push/push/font[@color='#008000']", 11); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineMoving2) @@ -1071,8 +924,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineMoving2) // text and numbering colors show moving of the list item // These were 0 (other color, not COL_GREEN, color of the tracked text movement) - assertXPath(pXmlDoc, "/metafile/push/push/push/textcolor[@color='#008000']"_ostr, 5); - assertXPath(pXmlDoc, "/metafile/push/push/push/font[@color='#008000']"_ostr, 11); + assertXPath(pXmlDoc, "/metafile/push/push/push/textcolor[@color='#008000']", 5); + assertXPath(pXmlDoc, "/metafile/push/push/push/font[@color='#008000']", 11); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineMovingDOCX) @@ -1094,7 +947,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineMovingDOCX) // text colors show moved text // These were 0 (other color, not COL_GREEN, color of the tracked text movement) - assertXPath(pXmlDoc, "/metafile/push/push/push/textcolor[@color='#008000']"_ostr, 6); + assertXPath(pXmlDoc, "/metafile/push/push/push/textcolor[@color='#008000']", 6); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTableCellInvalidate) @@ -1119,35 +972,27 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTableCellInvalidate) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // somehow these 2 rows overlapped in the PDF unless CalcLayout() runs - assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/infos/bounds"_ostr, "top"_ostr, - u"6969"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/infos/bounds"_ostr, - "height"_ostr, u"231"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/cell[1]/infos/bounds"_ostr, - "top"_ostr, u"6969"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/cell[1]/infos/bounds"_ostr, - "height"_ostr, u"231"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/anchored/fly/tab[1]/row[1]/cell[1]/txt[1]/infos/bounds"_ostr, - "top"_ostr, u"6969"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/anchored/fly/tab[1]/row[1]/cell[1]/txt[1]/infos/bounds"_ostr, - "height"_ostr, u"231"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/infos/bounds"_ostr, "top"_ostr, - u"7200"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/infos/bounds"_ostr, - "height"_ostr, u"231"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/infos/bounds", "top", u"6969"); + assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/infos/bounds", "height", u"231"); + assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/cell[1]/infos/bounds", "top", + u"6969"); + assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/cell[1]/infos/bounds", "height", + u"231"); + assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/cell[1]/txt[1]/infos/bounds", + "top", u"6969"); + assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/cell[1]/txt[1]/infos/bounds", + "height", u"231"); + assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/infos/bounds", "top", u"7200"); + assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/infos/bounds", "height", u"231"); // this was 6969, causing the overlap - assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/cell[1]/infos/bounds"_ostr, - "top"_ostr, u"7200"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/cell[1]/infos/bounds"_ostr, - "height"_ostr, u"231"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/anchored/fly/tab[1]/row[2]/cell[1]/txt[1]/infos/bounds"_ostr, - "top"_ostr, u"7200"_ustr); - assertXPath(pXmlDoc, - "/root/page[1]/anchored/fly/tab[1]/row[2]/cell[1]/txt[1]/infos/bounds"_ostr, - "height"_ostr, u"231"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/cell[1]/infos/bounds", "top", + u"7200"); + assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/cell[1]/infos/bounds", "height", + u"231"); + assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/cell[1]/txt[1]/infos/bounds", + "top", u"7200"); + assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/cell[1]/txt[1]/infos/bounds", + "height", u"231"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf145719) @@ -1164,7 +1009,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf145719) // text colors show moved text // This was 0 (other color, not COL_GREEN, color of the tracked text movement) - assertXPath(pXmlDoc, "/metafile/push/push/push/textcolor[@color='#008000']"_ostr, 4); + assertXPath(pXmlDoc, "/metafile/push/push/push/textcolor[@color='#008000']", 4); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testChangedTableRows) @@ -1180,11 +1025,11 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testChangedTableRows) CPPUNIT_ASSERT(pXmlDoc); // This was 0 (other color, not COL_AUTHOR_TABLE_DEL, color of the tracked row deletion) - assertXPath(pXmlDoc, "/metafile/push/push/push/push/push/fillcolor[@color='#fce6f4']"_ostr, 1); + assertXPath(pXmlDoc, "/metafile/push/push/push/push/push/fillcolor[@color='#fce6f4']", 1); // This was 0 (other color, not COL_AUTHOR_TABLE_INS, color of the tracked row insertion) - assertXPath(pXmlDoc, "/metafile/push/push/push/push/push/fillcolor[@color='#e1f2fa']"_ostr, 1); + assertXPath(pXmlDoc, "/metafile/push/push/push/push/push/fillcolor[@color='#e1f2fa']", 1); // This was 3 (color of the cells of the last column, 2 of them disabled by change tracking ) - assertXPath(pXmlDoc, "/metafile/push/push/push/push/push/fillcolor[@color='#3faf46']"_ostr, 1); + assertXPath(pXmlDoc, "/metafile/push/push/push/push/push/fillcolor[@color='#3faf46']", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf155187_TableInTextChange) @@ -1200,9 +1045,9 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf155187_TableInTextChange) CPPUNIT_ASSERT(pXmlDoc); // This was 0 (other color, not COL_AUTHOR_TABLE_DEL, color of the tracked row deletion) - assertXPath(pXmlDoc, "/metafile/push/push/push/push/push/fillcolor[@color='#fce6f4']"_ostr, 2); + assertXPath(pXmlDoc, "/metafile/push/push/push/push/push/fillcolor[@color='#fce6f4']", 2); // This was 0 (other color, not COL_AUTHOR_TABLE_INS, color of the tracked row insertion) - assertXPath(pXmlDoc, "/metafile/push/push/push/push/push/fillcolor[@color='#e1f2fa']"_ostr, 2); + assertXPath(pXmlDoc, "/metafile/push/push/push/push/push/fillcolor[@color='#e1f2fa']", 2); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf145225_RedlineMovingWithBadInsertion) @@ -1272,8 +1117,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf146964_ReappearingMovedTextInHideCh xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT(pXmlDoc); // This was "Lorem Lorem ipsum" (reappearing deletion in Hide Changes mode) - assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr, - "portion"_ostr, u"Lorem ipsum"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion", + "portion", u"Lorem ipsum"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf125300) @@ -1291,12 +1136,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf125300) // Keep line spacing before bottom cell border (it was 1892) sal_Int32 y1 - = getXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[7]/polyline/point[1]"_ostr, - "y"_ostr) + = getXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[7]/polyline/point[1]", "y") .toInt32(); sal_Int32 y2 - = getXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[7]/polyline/point[2]"_ostr, - "y"_ostr) + = getXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[7]/polyline/point[2]", "y") .toInt32(); CPPUNIT_ASSERT_DOUBLES_EQUAL(2092, y1, 7); CPPUNIT_ASSERT_EQUAL(y1, y2); @@ -1320,16 +1163,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf116830) // Cell background: 1.1.1.3 assertXPath( pXmlDoc, - "/metafile/push[1]/push[1]/push[1]/push[2]/push[1]/push[1]/fillcolor[@color='#729fcf']"_ostr, - 1); - assertXPath(pXmlDoc, - "/metafile/push[1]/push[1]/push[1]/push[2]/push[1]/push[1]/polypolygon"_ostr, 1); + "/metafile/push[1]/push[1]/push[1]/push[2]/push[1]/push[1]/fillcolor[@color='#729fcf']", 1); + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[2]/push[1]/push[1]/polypolygon", + 1); // This failed: cell background was painted before the background shape. - assertXPath( - pXmlDoc, - "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/fillcolor[@color='#ffff00']"_ostr, 1); - assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/rect"_ostr, 1); + assertXPath(pXmlDoc, + "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/fillcolor[@color='#ffff00']", 1); + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/rect", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf114163) @@ -1344,7 +1185,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf114163) xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); - assertXPathContent(pXmlDoc, "(//textarray)[12]/text"_ostr, u"Data3"_ustr); + assertXPathContent(pXmlDoc, "(//textarray)[12]/text", u"Data3"); // This failed, if the legend first label is not "Data3". The legend position is right. } @@ -1353,11 +1194,9 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf131707) createSwDoc("tdf131707_flyWrap.doc"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "//body/tab/row[3]/cell[2]/txt/infos/bounds"_ostr, "top"_ostr, - u"2185"_ustr); + assertXPath(pXmlDoc, "//body/tab/row[3]/cell[2]/txt/infos/bounds", "top", u"2185"); // the image should be inside of the cell boundary - so the same top or higher - assertXPath(pXmlDoc, "//body/tab/row[3]/cell[2]/txt/anchored/fly/infos/bounds"_ostr, "top"_ostr, - u"2185"_ustr); + assertXPath(pXmlDoc, "//body/tab/row[3]/cell[2]/txt/anchored/fly/infos/bounds", "top", u"2185"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf122225) @@ -1374,14 +1213,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf122225) // Bug 122225 - FILEOPEN DOCX Textbox of Column chart legend reduces and text of legend disappears const sal_Int32 nLegendLabelLines - = getXPathContent(pXmlDoc, "count(//text[contains(text(),\"Advanced Diploma\")])"_ostr) + = getXPathContent(pXmlDoc, "count(//text[contains(text(),\"Advanced Diploma\")])") .toInt32(); // This failed, if the legend label is not "Advanced Diploma". CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nLegendLabelLines); // Bug 140623 - Fileopen DOCX: Text Orientation of X-Axis 0 instead of 45 degrees const sal_Int32 nThirdLabelLines - = getXPathContent(pXmlDoc, "count(//text[contains(text(),\"Hispanic\")])"_ostr).toInt32(); + = getXPathContent(pXmlDoc, "count(//text[contains(text(),\"Hispanic\")])").toInt32(); // This failed, if the third X axis label broke to multiple lines. CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nThirdLabelLines); } @@ -1398,7 +1237,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf125335) xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); - assertXPathContent(pXmlDoc, "(//textarray)[12]/text"_ostr, u"Data3"_ustr); + assertXPathContent(pXmlDoc, "(//textarray)[12]/text", u"Data3"); // This failed, if the legend first label is not "Data3". The legend position is bottom. } @@ -1414,7 +1253,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134247) xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); - assertXPathContent(pXmlDoc, "(//textarray)[14]/text"_ostr, u"1. adatsor"_ustr); + assertXPathContent(pXmlDoc, "(//textarray)[14]/text", u"1. adatsor"); // This failed, if the legend first label is not "1. adatsor". } @@ -1430,9 +1269,9 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf75659) xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); - assertXPathContent(pXmlDoc, "(//textarray)[17]/text"_ostr, u"Series1"_ustr); - assertXPathContent(pXmlDoc, "(//textarray)[18]/text"_ostr, u"Series2"_ustr); - assertXPathContent(pXmlDoc, "(//textarray)[19]/text"_ostr, u"Series3"_ustr); + assertXPathContent(pXmlDoc, "(//textarray)[17]/text", u"Series1"); + assertXPathContent(pXmlDoc, "(//textarray)[18]/text", u"Series2"); + assertXPathContent(pXmlDoc, "(//textarray)[19]/text", u"Series3"); // These failed, if the legend names are empty strings. } @@ -1449,7 +1288,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf136816) CPPUNIT_ASSERT(pXmlDoc); // Check number of legend entries - assertXPath(pXmlDoc, "//text[contains(text(),\"Column\")]"_ostr, 2); + assertXPath(pXmlDoc, "//text[contains(text(),\"Column\")]", 2); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf126425) @@ -1467,7 +1306,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf126425) // - Expected: 14 // - Actual : 12 // i.e. the text of the chart legend lost. - assertXPath(pXmlDoc, "//textarray"_ostr, 14); + assertXPath(pXmlDoc, "//textarray", 14); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testUnusedOLEprops) @@ -1482,8 +1321,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testUnusedOLEprops) // i.e. the formula squashed CPPUNIT_ASSERT_GREATEREQUAL( double(300), - getXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/fly/notxt/infos/bounds"_ostr, - "height"_ostr) + getXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/fly/notxt/infos/bounds", "height") .toDouble()); } @@ -1502,8 +1340,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf123268) // - Expected: 53 // - Actual : 0 // i.e. the chart lost. - assertXPath(pXmlDoc, - "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/push"_ostr, 53); + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/push", + 53); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf133005) @@ -1520,13 +1358,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf133005) sal_Int32 nXChartWall = getXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/" - "push[1]/push[1]/polyline[1]/point[2]"_ostr, - "x"_ostr) + "push[1]/push[1]/polyline[1]/point[2]", + "x") .toInt32(); sal_Int32 nXColumn = getXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/" - "push[1]/push[41]/polypolygon/polygon/point[1]"_ostr, - "x"_ostr) + "push[1]/push[41]/polypolygon/polygon/point[1]", + "x") .toInt32(); // This failed, if the value axis doesn't appear inside category. @@ -1547,16 +1385,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf115630) // Test wide of inner chart area. sal_Int32 nXRight - = getXPath( - pXmlDoc, - "/metafile/push[1]/push[1]/push[1]/push[6]/push[1]/push[3]/polyline[1]/point[1]"_ostr, - "x"_ostr) + = getXPath(pXmlDoc, + "/metafile/push[1]/push[1]/push[1]/push[6]/push[1]/push[3]/polyline[1]/point[1]", + "x") .toInt32(); sal_Int32 nXLeft - = getXPath( - pXmlDoc, - "/metafile/push[1]/push[1]/push[1]/push[6]/push[1]/push[3]/polyline[1]/point[2]"_ostr, - "x"_ostr) + = getXPath(pXmlDoc, + "/metafile/push[1]/push[1]/push[1]/push[6]/push[1]/push[3]/polyline[1]/point[2]", + "x") .toInt32(); CPPUNIT_ASSERT_DOUBLES_EQUAL(2895, nXRight - nXLeft, 50); } @@ -1573,7 +1409,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf108021) xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); - assertXPath(pXmlDoc, "//textarray[@length='22']"_ostr, 8); + assertXPath(pXmlDoc, "//textarray[@length='22']", 8); // This failed, if the textarray length of the first axis label not 22. } @@ -1589,7 +1425,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf125334) xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); - int nCount = countXPathNodes(pXmlDoc, "//textarray[@length='17']"_ostr); + int nCount = countXPathNodes(pXmlDoc, "//textarray[@length='17']"); CPPUNIT_ASSERT_EQUAL(4, nCount); // This failed, if the textarray length of the category axis label not 17. } @@ -1606,7 +1442,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf122800) xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); - assertXPath(pXmlDoc, "//textarray[@length='22']"_ostr, 9); + assertXPath(pXmlDoc, "//textarray[@length='22']", 9); // This failed, if the textarray length of the first axis label not 22. } @@ -1623,10 +1459,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTruncatedAxisLabel) CPPUNIT_ASSERT(pXmlDoc); // test the X axis label visibility - assertXPathContent(pXmlDoc, "(//textarray)[1]/text"_ostr, u"Long axis label truncated 1"_ustr); + assertXPathContent(pXmlDoc, "(//textarray)[1]/text", u"Long axis label truncated 1"); // test the Y axis label visibility - assertXPathContent(pXmlDoc, "(//textarray)[3]/text"_ostr, u"-5.00"_ustr); + assertXPathContent(pXmlDoc, "(//textarray)[3]/text", u"-5.00"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf128996) @@ -1641,7 +1477,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf128996) xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); - assertXPathContent(pXmlDoc, "(//textarray)[1]/text"_ostr, u"A very long category name 1"_ustr); + assertXPathContent(pXmlDoc, "(//textarray)[1]/text", u"A very long category name 1"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf126244) @@ -1656,13 +1492,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf126244) xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); // Test the first level of vertical category axis labels orientation. The first level orientation should be horizontal. - assertXPath(pXmlDoc, "(//font)[1]"_ostr, "orientation"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, "(//font)[1]", "orientation", u"0"); // Test the second level of vertical category axis labels orientation. The second level orientation should be vertical. - sal_Int32 nRotation = getXPath(pXmlDoc, "(//font)[5]"_ostr, "orientation"_ostr).toInt32(); + sal_Int32 nRotation = getXPath(pXmlDoc, "(//font)[5]", "orientation").toInt32(); CPPUNIT_ASSERT(nRotation >= 899); CPPUNIT_ASSERT(nRotation <= 900); // Test the third level of vertical category axis labels orientation. The third level orientation should be vertical. - nRotation = getXPath(pXmlDoc, "(//font)[7]"_ostr, "orientation"_ostr).toInt32(); + nRotation = getXPath(pXmlDoc, "(//font)[7]", "orientation").toInt32(); CPPUNIT_ASSERT(nRotation >= 899); CPPUNIT_ASSERT(nRotation <= 900); } @@ -1679,13 +1515,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf127304) xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); // Test the first level of horizontal category axis labels orientation. The first level orientation should be vertical. - sal_Int32 nRotation = getXPath(pXmlDoc, "(//font)[1]"_ostr, "orientation"_ostr).toInt32(); + sal_Int32 nRotation = getXPath(pXmlDoc, "(//font)[1]", "orientation").toInt32(); CPPUNIT_ASSERT(nRotation >= 899); CPPUNIT_ASSERT(nRotation <= 900); // Test the second level of horizontal category axis labels orientation. The second level orientation should be horizontal. - assertXPath(pXmlDoc, "(//font)[5]"_ostr, "orientation"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, "(//font)[5]", "orientation", u"0"); // Test the third level of horizontal category axis labels orientation. The third level orientation should be horizontal. - assertXPath(pXmlDoc, "(//font)[7]"_ostr, "orientation"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, "(//font)[7]", "orientation", u"0"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testHorizontal_multilevel) @@ -1700,7 +1536,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testHorizontal_multilevel) xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); // Test the Y position of horizontal category axis label. - sal_Int32 nYposition = getXPath(pXmlDoc, "(//textarray)[7]"_ostr, "y"_ostr).toInt32(); + sal_Int32 nYposition = getXPath(pXmlDoc, "(//textarray)[7]", "y").toInt32(); CPPUNIT_ASSERT_DOUBLES_EQUAL(11248, nYposition, 20); } @@ -1710,16 +1546,16 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf69648) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT(pXmlDoc); - OString sShapeXPath[2] = { - "/root/page/body/txt/anchored/SwAnchoredDrawObject/SdrObjGroup/SdrObjList/SdrObject[1]"_ostr, - "/root/page/body/txt/anchored/SwAnchoredDrawObject/SdrObjGroup/SdrObjList/SdrObject[2]"_ostr + const char* sShapeXPath[2] = { + "/root/page/body/txt/anchored/SwAnchoredDrawObject/SdrObjGroup/SdrObjList/SdrObject[1]", + "/root/page/body/txt/anchored/SwAnchoredDrawObject/SdrObjGroup/SdrObjList/SdrObject[2]" }; - OString sFrameXPath[2] = { "/root/page/body/txt/anchored/fly[1]/infos/bounds"_ostr, - "/root/page/body/txt/anchored/fly[2]/infos/bounds"_ostr }; + const char* sFrameXPath[2] = { "/root/page/body/txt/anchored/fly[1]/infos/bounds", + "/root/page/body/txt/anchored/fly[2]/infos/bounds" }; for (int i = 0; i < 2; ++i) { - const auto sDrawRect = getXPath(pXmlDoc, sShapeXPath[i], "aOutRect"_ostr); + const auto sDrawRect = getXPath(pXmlDoc, sShapeXPath[i], "aOutRect"); const auto nComaPos1 = sDrawRect.indexOf(',', 0); const auto nComaPos2 = sDrawRect.indexOf(',', nComaPos1 + 1); const auto nComaPos3 = sDrawRect.indexOf(',', nComaPos2 + 1); @@ -1731,10 +1567,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf69648) sDrawRect.subView(nComaPos3 + 1, sDrawRect.getLength() - nComaPos3 - 1)); const auto aChildShape = SwRect(nDraw1, nDraw2, nDraw3, nDraw4); - const auto nFlyLeft = getXPath(pXmlDoc, sFrameXPath[i], "left"_ostr).toInt64(); - const auto nFlyTop = getXPath(pXmlDoc, sFrameXPath[i], "top"_ostr).toInt64(); - const auto nFlyWidth = getXPath(pXmlDoc, sFrameXPath[i], "width"_ostr).toInt64(); - const auto nFlyHeight = getXPath(pXmlDoc, sFrameXPath[i], "height"_ostr).toInt64(); + const auto nFlyLeft = getXPath(pXmlDoc, sFrameXPath[i], "left").toInt64(); + const auto nFlyTop = getXPath(pXmlDoc, sFrameXPath[i], "top").toInt64(); + const auto nFlyWidth = getXPath(pXmlDoc, sFrameXPath[i], "width").toInt64(); + const auto nFlyHeight = getXPath(pXmlDoc, sFrameXPath[i], "height").toInt64(); const auto aFrame = SwRect(nFlyLeft, nFlyTop, nFlyWidth, nFlyHeight); @@ -1759,25 +1595,21 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf116256) auto pLayout = parseLayoutDump(); // Get the position of the shape const auto nCellLeft - = getXPath(pLayout, "//page/body/txt/anchored/fly/tab/row[1]/cell/infos/bounds"_ostr, - "left"_ostr) + = getXPath(pLayout, "//page/body/txt/anchored/fly/tab/row[1]/cell/infos/bounds", "left") .toInt64(); const auto nCellTop - = getXPath(pLayout, "//page/body/txt/anchored/fly/tab/row[1]/cell/infos/bounds"_ostr, - "top"_ostr) + = getXPath(pLayout, "//page/body/txt/anchored/fly/tab/row[1]/cell/infos/bounds", "top") .toInt64(); // Get the position of the textframe too. const auto nTextBoxFrameLeft - = getXPath( - pLayout, - "/root/page/body/txt/anchored/fly/tab/row[1]/cell/txt/anchored/fly/infos/bounds"_ostr, - "left"_ostr) + = getXPath(pLayout, + "/root/page/body/txt/anchored/fly/tab/row[1]/cell/txt/anchored/fly/infos/bounds", + "left") .toInt64(); const auto nTextBoxFrameTop - = getXPath( - pLayout, - "/root/page/body/txt/anchored/fly/tab/row[1]/cell/txt/anchored/fly/infos/bounds"_ostr, - "top"_ostr) + = getXPath(pLayout, + "/root/page/body/txt/anchored/fly/tab/row[1]/cell/txt/anchored/fly/infos/bounds", + "top") .toInt64(); // Without the fix in place these were less than they supposed to. @@ -1800,7 +1632,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf138194) // - Expected: 8 // - Actual : 7 // i.e. the X axis label flowed out of chart area. - assertXPath(pXmlDoc, "//textarray"_ostr, 8); + assertXPath(pXmlDoc, "//textarray", 8); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf146272) @@ -1837,7 +1669,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf138773) CPPUNIT_ASSERT(pXmlDoc); const sal_Int32 nFirstLabelLines - = getXPathContent(pXmlDoc, "count(//text[contains(text(),\"2000-01\")])"_ostr).toInt32(); + = getXPathContent(pXmlDoc, "count(//text[contains(text(),\"2000-01\")])").toInt32(); // This failed, if the first X axis label broke to multiple lines. CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nFirstLabelLines); @@ -1856,10 +1688,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf124796) CPPUNIT_ASSERT(pXmlDoc); // This failed, if the minimum value of Y axis is not -10. - assertXPathContent(pXmlDoc, "(//textarray)[5]/text"_ostr, u"-10"_ustr); + assertXPathContent(pXmlDoc, "(//textarray)[5]/text", u"-10"); // This failed, if the maximum value of Y axis is not 15. - assertXPathContent(pXmlDoc, "(//textarray)[10]/text"_ostr, u"15"_ustr); + assertXPathContent(pXmlDoc, "(//textarray)[10]/text", u"15"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf72727) @@ -1877,9 +1709,9 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf72727) // Without the fix in place, this test would have failed with // - Expected: 1 // - Actual : Series1 - assertXPathContent(pXmlDoc, "(//textarray)[1]/text"_ostr, u"1"_ustr); - assertXPathContent(pXmlDoc, "(//textarray)[2]/text"_ostr, u"2"_ustr); - assertXPathContent(pXmlDoc, "(//textarray)[3]/text"_ostr, u"3"_ustr); + assertXPathContent(pXmlDoc, "(//textarray)[1]/text", u"1"); + assertXPathContent(pXmlDoc, "(//textarray)[2]/text", u"2"); + assertXPathContent(pXmlDoc, "(//textarray)[3]/text", u"3"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130969) @@ -1895,7 +1727,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130969) CPPUNIT_ASSERT(pXmlDoc); // This failed, if the minimum value of Y axis is not 0.35781 - assertXPathContent(pXmlDoc, "(//textarray)[5]/text"_ostr, u"0.35781"_ustr); + assertXPathContent(pXmlDoc, "(//textarray)[5]/text", u"0.35781"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf40260) @@ -1912,9 +1744,9 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf40260) // Without the fix in place, this test would have failed with // - Expected: f(x) = 1.26510397865547E-06 x − 5.95245604996327E-12 // - Actual : f(x) = 0 x − 0 - assertXPathContent(pXmlDoc, "(//textarray)[19]/text"_ostr, - "f(x) = 1.26510397865547E-06 x " + OUStringChar(u'\x2212') - + " 5.95245604996327E-12"); + assertXPathContent(pXmlDoc, "(//textarray)[19]/text", + Concat2View("f(x) = 1.26510397865547E-06 x " + OUStringChar(u'\x2212') + + " 5.95245604996327E-12")); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf129054) @@ -1931,16 +1763,15 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf129054) // Test the size of diameter of Pie chart. sal_Int32 nYTop - = getXPath( - pXmlDoc, - "/metafile/push[1]/push[1]/push[1]/push[6]/push[1]/push[4]/polyline[1]/point[1]"_ostr, - "y"_ostr) + = getXPath(pXmlDoc, + "/metafile/push[1]/push[1]/push[1]/push[6]/push[1]/push[4]/polyline[1]/point[1]", + "y") .toInt32(); sal_Int32 nYBottom = getXPath( pXmlDoc, - "/metafile/push[1]/push[1]/push[1]/push[6]/push[1]/push[4]/polyline[1]/point[31]"_ostr, - "y"_ostr) + "/metafile/push[1]/push[1]/push[1]/push[6]/push[1]/push[4]/polyline[1]/point[31]", + "y") .toInt32(); CPPUNIT_ASSERT_DOUBLES_EQUAL(4615, nYTop - nYBottom, 5); } @@ -1958,7 +1789,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf129173) CPPUNIT_ASSERT(pXmlDoc); // Check the first data label of area chart. - assertXPathContent(pXmlDoc, "(//textarray)[22]/text"_ostr, u"56"_ustr); + assertXPathContent(pXmlDoc, "(//textarray)[22]/text", u"56"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134866) @@ -1974,7 +1805,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134866) CPPUNIT_ASSERT(pXmlDoc); // Check the data label of pie chart. - assertXPathContent(pXmlDoc, "(//textarray)[2]/text"_ostr, u"100%"_ustr); + assertXPathContent(pXmlDoc, "(//textarray)[2]/text", u"100%"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf137116) @@ -1988,10 +1819,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf137116) MetafileXmlDump dumper; xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); - sal_Int32 nX2 - = getXPath(pXmlDoc, "(//textarray)[2]"_ostr, "x"_ostr).toInt32(); // second data label - sal_Int32 nX4 - = getXPath(pXmlDoc, "(//textarray)[4]"_ostr, "x"_ostr).toInt32(); // fourth data label + sal_Int32 nX2 = getXPath(pXmlDoc, "(//textarray)[2]", "x").toInt32(); // second data label + sal_Int32 nX4 = getXPath(pXmlDoc, "(//textarray)[4]", "x").toInt32(); // fourth data label // Without the accompanying fix in place, this test would have failed with: // - Expected: 1229 // - Actual : -225 @@ -2011,10 +1840,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf137154) MetafileXmlDump dumper; xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); - sal_Int32 nX1 - = getXPath(pXmlDoc, "(//textarray)[1]"_ostr, "x"_ostr).toInt32(); // first data label - sal_Int32 nX4 - = getXPath(pXmlDoc, "(//textarray)[4]"_ostr, "x"_ostr).toInt32(); // fourth data label + sal_Int32 nX1 = getXPath(pXmlDoc, "(//textarray)[1]", "x").toInt32(); // first data label + sal_Int32 nX4 = getXPath(pXmlDoc, "(//textarray)[4]", "x").toInt32(); // fourth data label // Without the accompanying fix in place, this test would have failed with: // - Expected: 10865 // - Actual : 10252 @@ -2036,7 +1863,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf138777) CPPUNIT_ASSERT(pXmlDoc); const sal_Int32 nFirstLabelLines - = getXPathContent(pXmlDoc, "count(//text[contains(text(),\"really\")])"_ostr).toInt32(); + = getXPathContent(pXmlDoc, "count(//text[contains(text(),\"really\")])").toInt32(); // This failed, if the first data label didn't break to multiple lines. CPPUNIT_ASSERT_GREATER(static_cast<sal_Int32>(1), nFirstLabelLines); @@ -2053,7 +1880,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130031) MetafileXmlDump dumper; xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); - sal_Int32 nY = getXPath(pXmlDoc, "(//textarray)[11]"_ostr, "y"_ostr).toInt32(); + sal_Int32 nY = getXPath(pXmlDoc, "(//textarray)[11]", "y").toInt32(); // Without the accompanying fix in place, this test would have failed with: // - Expected: 4653 // - Actual : 2182 @@ -2073,7 +1900,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130242) MetafileXmlDump dumper; xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); - sal_Int32 nY = getXPath(pXmlDoc, "(//textarray)[11]"_ostr, "y"_ostr).toInt32(); + sal_Int32 nY = getXPath(pXmlDoc, "(//textarray)[11]", "y").toInt32(); // Without the accompanying fix in place, this test would have failed with: // - Expected: 5758 // - Actual : 3352 @@ -2081,7 +1908,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130242) // i.e. the data label appeared above the data point. CPPUNIT_ASSERT_DOUBLES_EQUAL(5758, nY, 50); - nY = getXPath(pXmlDoc, "(//textarray)[13]"_ostr, "y"_ostr).toInt32(); + nY = getXPath(pXmlDoc, "(//textarray)[13]", "y").toInt32(); // Without the accompanying fix in place, this test would have failed with: // - Expected: 2335 // - Actual : 2343 @@ -2103,7 +1930,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134121) CPPUNIT_ASSERT(pXmlDoc); // Check the custom leader line on pie chart. - assertXPath(pXmlDoc, "//polyline"_ostr, 1); + assertXPath(pXmlDoc, "//polyline", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf138018) @@ -2121,7 +1948,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf138018) // - Expected: 2 // - Actual : 3 // i.e. the leader line was visible. - assertXPath(pXmlDoc, "//polyline"_ostr, 2); + assertXPath(pXmlDoc, "//polyline", 2); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130380) @@ -2137,8 +1964,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130380) CPPUNIT_ASSERT(pXmlDoc); sal_Int32 nY = getXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[6]/push[1]/push[1]/polypolygon/" - "polygon/point[1]"_ostr, - "y"_ostr) + "polygon/point[1]", + "y") .toInt32(); // Without the accompanying fix in place, this test would have failed with: // - Expected: 6727 @@ -2161,7 +1988,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf129095) CPPUNIT_ASSERT(pXmlDoc); // check the inner chart area (relative size) visibility with testing the X axis label - assertXPathContent(pXmlDoc, "//textarray/text"_ostr, u"Category 1"_ustr); + assertXPathContent(pXmlDoc, "//textarray/text", u"Category 1"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf132956) @@ -2177,7 +2004,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf132956) CPPUNIT_ASSERT(pXmlDoc); // check the inner chart area (default size) visibility with testing the X axis label - assertXPathContent(pXmlDoc, "//textarray/text"_ostr, u"Category 1"_ustr); + assertXPathContent(pXmlDoc, "//textarray/text", u"Category 1"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf137819) @@ -2196,9 +2023,9 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf137819) // Make the layout xml dump after the change auto pXml = parseLayoutDump(); auto sTextRightSidePosition - = getXPath(pXml, "/root/page/body/txt[6]/anchored/fly/infos/bounds"_ostr, "right"_ostr); - auto sShapeRightSidePosition = getXPath( - pXml, "/root/page/body/txt[6]/anchored/SwAnchoredDrawObject/bounds"_ostr, "right"_ostr); + = getXPath(pXml, "/root/page/body/txt[6]/anchored/fly/infos/bounds", "right"); + auto sShapeRightSidePosition + = getXPath(pXml, "/root/page/body/txt[6]/anchored/SwAnchoredDrawObject/bounds", "right"); // Before the textframe did not follow the shape, now it supposed to // so the right side of the shape must be greater than the right side of // textframe: @@ -2225,30 +2052,30 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testParagraphMarkLineHeight) { xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page/header/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, - "height"_ostr, "184"); - assertXPath(pXmlDoc, "/root/page/header/txt[1]/SwParaPortion/SwLineLayout[2]"_ostr, - "height"_ostr, "184"); - assertXPath(pXmlDoc, "/root/page/header/txt[1]/SwParaPortion/SwLineLayout[3]"_ostr, - "height"_ostr, "184"); - assertXPath(pXmlDoc, "/root/page/header/txt[2]/SwParaPortion/SwLineLayout[1]"_ostr, - "height"_ostr, "184"); - assertXPath(pXmlDoc, "/root/page/header/txt[2]/SwParaPortion/SwLineLayout[2]"_ostr, - "height"_ostr, "184"); - assertXPath(pXmlDoc, "/root/page/header/txt[2]/SwParaPortion/SwLineLayout[3]"_ostr, - "height"_ostr, "184"); - assertXPath(pXmlDoc, "/root/page/header/txt[2]/SwParaPortion/SwLineLayout[4]"_ostr, - "height"_ostr, "184"); - assertXPath(pXmlDoc, "/root/page/header/txt[2]/SwParaPortion/SwLineLayout[5]"_ostr, - "height"_ostr, "253"); + assertXPath(pXmlDoc, "/root/page/header/txt[1]/SwParaPortion/SwLineLayout[1]", "height", + u"184"); + assertXPath(pXmlDoc, "/root/page/header/txt[1]/SwParaPortion/SwLineLayout[2]", "height", + u"184"); + assertXPath(pXmlDoc, "/root/page/header/txt[1]/SwParaPortion/SwLineLayout[3]", "height", + u"184"); + assertXPath(pXmlDoc, "/root/page/header/txt[2]/SwParaPortion/SwLineLayout[1]", "height", + u"184"); + assertXPath(pXmlDoc, "/root/page/header/txt[2]/SwParaPortion/SwLineLayout[2]", "height", + u"184"); + assertXPath(pXmlDoc, "/root/page/header/txt[2]/SwParaPortion/SwLineLayout[3]", "height", + u"184"); + assertXPath(pXmlDoc, "/root/page/header/txt[2]/SwParaPortion/SwLineLayout[4]", "height", + u"184"); + assertXPath(pXmlDoc, "/root/page/header/txt[2]/SwParaPortion/SwLineLayout[5]", "height", + u"253"); } xViewSettings->setPropertyValue(u"ShowNonprintingCharacters"_ustr, uno::Any(false)); { xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page/header/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, - "height"_ostr, "253"); + assertXPath(pXmlDoc, "/root/page/header/txt[1]/SwParaPortion/SwLineLayout[1]", "height", + u"253"); } } @@ -2265,8 +2092,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf122014) CPPUNIT_ASSERT(pXmlDoc); // This failed, if the chart title is aligned to left. - sal_Int32 nX1 = getXPath(pXmlDoc, "(//textarray)[13]"_ostr, "x"_ostr).toInt32(); - sal_Int32 nX2 = getXPath(pXmlDoc, "(//textarray)[14]"_ostr, "x"_ostr).toInt32(); + sal_Int32 nX1 = getXPath(pXmlDoc, "(//textarray)[13]", "x").toInt32(); + sal_Int32 nX2 = getXPath(pXmlDoc, "(//textarray)[14]", "x").toInt32(); CPPUNIT_ASSERT_GREATER(nX1 + 100, nX2); } @@ -2283,8 +2110,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134659) CPPUNIT_ASSERT(pXmlDoc); // This failed, if the axis label is aligned to left. - sal_Int32 nX1 = getXPath(pXmlDoc, "(//textarray)[1]"_ostr, "x"_ostr).toInt32(); - sal_Int32 nX2 = getXPath(pXmlDoc, "(//textarray)[2]"_ostr, "x"_ostr).toInt32(); + sal_Int32 nX1 = getXPath(pXmlDoc, "(//textarray)[1]", "x").toInt32(); + sal_Int32 nX2 = getXPath(pXmlDoc, "(//textarray)[2]", "x").toInt32(); CPPUNIT_ASSERT_GREATER(nX1 + 250, nX2); } @@ -2303,7 +2130,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134235) // - Expected: 14 // - Actual : 13 // i.e. the chart title flowed out of chart area. - assertXPath(pXmlDoc, "//textarray"_ostr, 14); + assertXPath(pXmlDoc, "//textarray", 14); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134676) @@ -2321,7 +2148,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134676) // - Expected: 14 // - Actual : 13 // i.e. the X axis title didn't break to multiple lines. - assertXPath(pXmlDoc, "//textarray"_ostr, 14); + assertXPath(pXmlDoc, "//textarray", 14); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134146) @@ -2337,7 +2164,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134146) CPPUNIT_ASSERT(pXmlDoc); const sal_Int32 nTitleLines - = getXPathContent(pXmlDoc, "count(//text[contains(text(),\"Horizontal\")])"_ostr).toInt32(); + = getXPathContent(pXmlDoc, "count(//text[contains(text(),\"Horizontal\")])").toInt32(); // Without the accompanying fix in place, this test would have failed. // i.e. the Y axis title didn't break to multiple lines. @@ -2356,7 +2183,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf136061) xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); // This failed, if the custom text of data label is missing. - assertXPathContent(pXmlDoc, "(//textarray)[16]/text"_ostr, u"Customlabel"_ustr); + assertXPathContent(pXmlDoc, "(//textarray)[16]/text", u"Customlabel"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf116925) @@ -2371,14 +2198,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf116925) xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); - assertXPathContent( - pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[6]/push[1]/push[3]/textarray/text"_ostr, - u"hello"_ustr); + assertXPathContent(pXmlDoc, + "/metafile/push[1]/push[1]/push[1]/push[6]/push[1]/push[3]/textarray/text", + u"hello"); // This failed, text color was #000000. assertXPath( pXmlDoc, - "/metafile/push[1]/push[1]/push[1]/push[6]/push[1]/push[3]/textcolor[@color='#ffffff']"_ostr, - 1); + "/metafile/push[1]/push[1]/push[1]/push[6]/push[1]/push[3]/textcolor[@color='#ffffff']", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf117028) @@ -2395,10 +2221,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf117028) // The only polypolygon in the rendering result was the white background we // want to avoid. - assertXPath(pXmlDoc, "//polypolygon"_ostr, 0); + assertXPath(pXmlDoc, "//polypolygon", 0); // Make sure the text is still rendered. - assertXPathContent(pXmlDoc, "//textarray/text"_ostr, u"Hello"_ustr); + assertXPathContent(pXmlDoc, "//textarray/text", u"Hello"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf106390) @@ -2412,7 +2238,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf106390) MetafileXmlDump dumper; xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); - sal_Int32 nBottom = getXPath(pXmlDoc, "//sectrectclipregion"_ostr, "bottom"_ostr).toInt32(); + sal_Int32 nBottom = getXPath(pXmlDoc, "//sectrectclipregion", "bottom").toInt32(); // No end point of line segments shall go below the bottom of the clipping area. const OString sXPath = "//polyline/point[@y>" + OString::number(nBottom) + "]"; @@ -2431,7 +2257,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTableExtrusion1) MetafileXmlDump dumper; xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); - sal_Int32 nRight = getXPath(pXmlDoc, "//sectrectclipregion"_ostr, "right"_ostr).toInt32(); + sal_Int32 nRight = getXPath(pXmlDoc, "//sectrectclipregion", "right").toInt32(); sal_Int32 nLeft = static_cast<sal_Int32>(nRight * 0.95); // Expect table borders in right page margin. @@ -2453,7 +2279,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTableExtrusion2) xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); CPPUNIT_ASSERT(pXmlDoc); // End point position of the outer table. - sal_Int32 nX = getXPath(pXmlDoc, "(//polyline[1]/point)[2]"_ostr, "x"_ostr).toInt32(); + sal_Int32 nX = getXPath(pXmlDoc, "(//polyline[1]/point)[2]", "x").toInt32(); // Do not allow inner table extrude outer table. const OString sXPath = "//polyline/point[@x>" + OString::number(nX) + "]"; @@ -2474,10 +2300,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf117245) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was 2, TabOverMargin did not use a single line when there was // enough space for the text. - assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, 1); + assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout", 1); // This was 2, same problem elsewhere due to code duplication. - assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout"_ostr, 1); + assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf118672) @@ -2492,10 +2318,9 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf118672) // This ended as "fol*1 2 3 4 5 6 7 8 9", i.e. "10con-" was moved to the next line. // Bizarrely, Word lets the text run into the right margin (loaded from .rtf) - assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, - "portion"_ostr, + assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]", "portion", u"He heard quiet steps behind him. That didn't bode well. Who could be fol*1 2 " - "3 4 5 6 7 8 9 10consetetur"_ustr); + "3 4 5 6 7 8 9 10consetetur"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150200) @@ -2503,23 +2328,23 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150200) createSwDoc("tdf150200.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // dash - OUString sFirstLine = getXPathContent( - pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/@portion"_ostr); + OUString sFirstLine + = getXPathContent(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/@portion"); CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"-(dash)")); CPPUNIT_ASSERT_EQUAL(sal_Int32(93), sFirstLine.getLength()); // en-dash - sFirstLine = getXPathContent( - pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/@portion"_ostr); + sFirstLine + = getXPathContent(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/@portion"); CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"–(en-dash)")); CPPUNIT_ASSERT_EQUAL(sal_Int32(88), sFirstLine.getLength()); // em-dash - sFirstLine = getXPathContent( - pXmlDoc, "/root/page/body/txt[3]/SwParaPortion/SwLineLayout[1]/@portion"_ostr); + sFirstLine + = getXPathContent(pXmlDoc, "/root/page/body/txt[3]/SwParaPortion/SwLineLayout[1]/@portion"); CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"—(em-dash)")); CPPUNIT_ASSERT_EQUAL(sal_Int32(77), sFirstLine.getLength()); // figure dash - sFirstLine = getXPathContent( - pXmlDoc, "/root/page/body/txt[4]/SwParaPortion/SwLineLayout[1]/@portion"_ostr); + sFirstLine + = getXPathContent(pXmlDoc, "/root/page/body/txt[4]/SwParaPortion/SwLineLayout[1]/@portion"); CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"‒(figure dash)")); CPPUNIT_ASSERT_EQUAL(sal_Int32(87), sFirstLine.getLength()); } @@ -2529,23 +2354,23 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150200_DOCX) createSwDoc("tdf150200.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // dash - OUString sFirstLine = getXPathContent( - pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/@portion"_ostr); + OUString sFirstLine + = getXPathContent(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/@portion"); CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"-(dash)")); CPPUNIT_ASSERT_EQUAL(sal_Int32(93), sFirstLine.getLength()); // en-dash - sFirstLine = getXPathContent( - pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/@portion"_ostr); + sFirstLine + = getXPathContent(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/@portion"); CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"–(en-dash)")); CPPUNIT_ASSERT_EQUAL(sal_Int32(88), sFirstLine.getLength()); // em-dash - sFirstLine = getXPathContent( - pXmlDoc, "/root/page/body/txt[3]/SwParaPortion/SwLineLayout[1]/@portion"_ostr); + sFirstLine + = getXPathContent(pXmlDoc, "/root/page/body/txt[3]/SwParaPortion/SwLineLayout[1]/@portion"); CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"—(em-dash)")); CPPUNIT_ASSERT_EQUAL(sal_Int32(77), sFirstLine.getLength()); // figure dash - sFirstLine = getXPathContent( - pXmlDoc, "/root/page/body/txt[4]/SwParaPortion/SwLineLayout[1]/@portion"_ostr); + sFirstLine + = getXPathContent(pXmlDoc, "/root/page/body/txt[4]/SwParaPortion/SwLineLayout[1]/@portion"); CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"‒(figure dash)")); CPPUNIT_ASSERT_EQUAL(sal_Int32(87), sFirstLine.getLength()); } @@ -2555,23 +2380,23 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150438) createSwDoc("tdf150438.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // left double quotation mark - OUString sFirstLine = getXPathContent( - pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/@portion"_ostr); + OUString sFirstLine + = getXPathContent(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/@portion"); CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"“Lorem ipsum")); CPPUNIT_ASSERT_EQUAL(sal_Int32(92), sFirstLine.getLength()); // right double quotation mark - sFirstLine = getXPathContent( - pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/@portion"_ostr); + sFirstLine + = getXPathContent(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/@portion"); CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"”Nunc viverra imperdiet enim.")); CPPUNIT_ASSERT_EQUAL(sal_Int32(97), sFirstLine.getLength()); // left single quotation mark - sFirstLine = getXPathContent( - pXmlDoc, "/root/page/body/txt[3]/SwParaPortion/SwLineLayout[1]/@portion"_ostr); + sFirstLine + = getXPathContent(pXmlDoc, "/root/page/body/txt[3]/SwParaPortion/SwLineLayout[1]/@portion"); CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"‘Aenean nec lorem.")); CPPUNIT_ASSERT_EQUAL(sal_Int32(85), sFirstLine.getLength()); // right single quotation mark or apostrophe - sFirstLine = getXPathContent( - pXmlDoc, "/root/page/body/txt[4]/SwParaPortion/SwLineLayout[1]/@portion"_ostr); + sFirstLine + = getXPathContent(pXmlDoc, "/root/page/body/txt[4]/SwParaPortion/SwLineLayout[1]/@portion"); CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"’Aenean nec lorem.")); CPPUNIT_ASSERT_EQUAL(sal_Int32(85), sFirstLine.getLength()); } @@ -2581,23 +2406,23 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150438_DOCX) createSwDoc("tdf150438.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // left double quotation mark - OUString sFirstLine = getXPathContent( - pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/@portion"_ostr); + OUString sFirstLine + = getXPathContent(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/@portion"); CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"“Lorem ipsum")); CPPUNIT_ASSERT_EQUAL(sal_Int32(92), sFirstLine.getLength()); // right double quotation mark - sFirstLine = getXPathContent( - pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/@portion"_ostr); + sFirstLine + = getXPathContent(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/@portion"); CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"”Nunc viverra imperdiet enim.")); CPPUNIT_ASSERT_EQUAL(sal_Int32(97), sFirstLine.getLength()); // left single quotation mark - sFirstLine = getXPathContent( - pXmlDoc, "/root/page/body/txt[3]/SwParaPortion/SwLineLayout[1]/@portion"_ostr); + sFirstLine + = getXPathContent(pXmlDoc, "/root/page/body/txt[3]/SwParaPortion/SwLineLayout[1]/@portion"); CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"‘Aenean nec lorem.")); CPPUNIT_ASSERT_EQUAL(sal_Int32(85), sFirstLine.getLength()); // right single quotation mark or apostrophe - sFirstLine = getXPathContent( - pXmlDoc, "/root/page/body/txt[4]/SwParaPortion/SwLineLayout[1]/@portion"_ostr); + sFirstLine + = getXPathContent(pXmlDoc, "/root/page/body/txt[4]/SwParaPortion/SwLineLayout[1]/@portion"); CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"’Aenean nec lorem.")); CPPUNIT_ASSERT_EQUAL(sal_Int32(85), sFirstLine.getLength()); } @@ -2616,21 +2441,18 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf117923) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Check that we actually test the line we need - assertXPathContent(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]"_ostr, - u"GHI GHI GHI GHI"_ustr); - assertXPath( - pXmlDoc, - "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, - "type"_ostr, u"PortionType::Number"_ustr); - assertXPath( - pXmlDoc, - "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, - "expand"_ostr, u"2."_ustr); + assertXPathContent(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]", u"GHI GHI GHI GHI"); + assertXPath(pXmlDoc, + "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion", + "type", u"PortionType::Number"); + assertXPath(pXmlDoc, + "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion", + "expand", u"2."); // The numbering height was 960. assertXPath( pXmlDoc, - "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont"_ostr, - "height"_ostr, u"220"_ustr); + "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont", + "height", u"220"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf127606) @@ -2647,21 +2469,18 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf127606) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Check that we actually test the line we need - assertXPathContent(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]"_ostr, - u"GHI GHI GHI GHI"_ustr); - assertXPath( - pXmlDoc, - "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, - "type"_ostr, u"PortionType::Number"_ustr); - assertXPath( - pXmlDoc, - "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, - "expand"_ostr, u"2."_ustr); + assertXPathContent(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]", u"GHI GHI GHI GHI"); + assertXPath(pXmlDoc, + "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion", + "type", u"PortionType::Number"); + assertXPath(pXmlDoc, + "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion", + "expand", u"2."); // The numbering height was 960 in DOC format. assertXPath( pXmlDoc, - "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont"_ostr, - "height"_ostr, u"220"_ustr); + "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont", + "height", u"220"); // tdf#127606: now it's possible to change formatting of numbering // increase font size (220 -> 260) @@ -2671,8 +2490,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf127606) pXmlDoc = parseLayoutDump(); assertXPath( pXmlDoc, - "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont"_ostr, - "height"_ostr, u"260"_ustr); + "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont", + "height", u"260"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf127118) @@ -2680,8 +2499,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf127118) createSwDoc("tdf127118.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was Horizontal: merged cell split between pages didn't keep vertical writing direction - assertXPath(pXmlDoc, "/root/page[2]/body/tab/row[1]/cell[1]/txt[1]"_ostr, "WritingMode"_ostr, - u"VertBTLR"_ustr); + assertXPath(pXmlDoc, "/root/page[2]/body/tab/row[1]/cell[1]/txt[1]", "WritingMode", + u"VertBTLR"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf141220) @@ -2690,9 +2509,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf141220) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nShapeTop - = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds"_ostr, "top"_ostr).toInt32(); - sal_Int32 nTextBoxTop - = getXPath(pXmlDoc, "//anchored/fly/infos/bounds"_ostr, "top"_ostr).toInt32(); + = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "top").toInt32(); + sal_Int32 nTextBoxTop = getXPath(pXmlDoc, "//anchored/fly/infos/bounds", "top").toInt32(); // Make sure the textbox stays inside the shape. CPPUNIT_ASSERT_LESS(static_cast<sal_Int32>(15), nTextBoxTop - nShapeTop); } @@ -2800,8 +2618,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134685) createSwDoc("tdf134685.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nWidth - = getXPath(pXmlDoc, "/root/page/body/tab/row[6]/cell[1]/infos/bounds"_ostr, "width"_ostr) - .toInt32(); + = getXPath(pXmlDoc, "/root/page/body/tab/row[6]/cell[1]/infos/bounds", "width").toInt32(); // This was 2223: the content was only partially visible according to the lost cell width CPPUNIT_ASSERT_GREATER(static_cast<sal_Int32>(14000), nWidth); } @@ -2811,9 +2628,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf109077) createSwDoc("tdf109077.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nShapeTop - = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds"_ostr, "top"_ostr).toInt32(); - sal_Int32 nTextBoxTop - = getXPath(pXmlDoc, "//anchored/fly/infos/bounds"_ostr, "top"_ostr).toInt32(); + = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "top").toInt32(); + sal_Int32 nTextBoxTop = getXPath(pXmlDoc, "//anchored/fly/infos/bounds", "top").toInt32(); // This was 281: the top of the shape and its textbox should match, though // tolerate differences <= 1px (about 15 twips). CPPUNIT_ASSERT_LESS(static_cast<sal_Int32>(15), nTextBoxTop - nShapeTop); @@ -2840,8 +2656,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testUserFieldTypeLanguage) // 123,456.00 transform chain. assertXPath( pXmlDoc, - "/root/page/body/txt/SwParaPortion/SwLineLayout/SwFieldPortion[@type='PortionType::Field']"_ostr, - "expand"_ostr, u"1,234.56"_ustr); + "/root/page/body/txt/SwParaPortion/SwLineLayout/SwFieldPortion[@type='PortionType::Field']", + "expand", u"1,234.56"); // Now change the system locale to English (before this was failing, 1234,56 -> 0.00) aOptions.SetLocaleConfigString(u"en-GB"_ustr); @@ -2855,8 +2671,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testUserFieldTypeLanguage) // We expect, that the field value is not changed. Otherwise there is a problem: assertXPath( pXmlDoc, - "/root/page/body/txt/SwParaPortion/SwLineLayout/SwFieldPortion[@type='PortionType::Field']"_ostr, - "expand"_ostr, u"1,234.56"_ustr); + "/root/page/body/txt/SwParaPortion/SwLineLayout/SwFieldPortion[@type='PortionType::Field']", + "expand", u"1,234.56"); // Now change the system locale to German aOptions.SetLocaleConfigString(u"de-DE"_ustr); aOptions.Commit(); @@ -2869,8 +2685,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testUserFieldTypeLanguage) // We expect, that the field value is not changed. Otherwise there is a problem: assertXPath( pXmlDoc, - "/root/page/body/txt/SwParaPortion/SwLineLayout/SwFieldPortion[@type='PortionType::Field']"_ostr, - "expand"_ostr, u"1,234.56"_ustr); + "/root/page/body/txt/SwParaPortion/SwLineLayout/SwFieldPortion[@type='PortionType::Field']", + "expand", u"1,234.56"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf124261) @@ -2913,7 +2729,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf135991) createSwDoc("tdf135991.odt"); auto pDump = parseLayoutDump(); // There used to be negative values that made the column frames invisible. - assertXPath(pDump, "//bounds[@top<0]"_ostr, 0); + assertXPath(pDump, "//bounds[@top<0]", 0); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150642) @@ -2921,8 +2737,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150642) createSwDoc("tdf150642.odt"); auto pDump = parseLayoutDump(); // There used to be negative values that made the cell frame invisible. - assertXPath(pDump, "//bounds[@left<0]"_ostr, 0); - assertXPath(pDump, "//bounds[@right<0]"_ostr, 0); + assertXPath(pDump, "//bounds[@left<0]", 0); + assertXPath(pDump, "//bounds[@right<0]", 0); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf152085) @@ -2930,9 +2746,9 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf152085) createSwDoc("tdf152085-section-tblr.odt"); auto pDump = parseLayoutDump(); sal_Int32 nSectionHeight - = getXPath(pDump, "//section/infos/bounds"_ostr, "bottom"_ostr).toInt32(); // was 8391 + = getXPath(pDump, "//section/infos/bounds", "bottom").toInt32(); // was 8391 sal_Int32 nColumnHeight - = getXPath(pDump, "(//column/infos/bounds)[2]"_ostr, "bottom"_ostr).toInt32(); // was 16216 + = getXPath(pDump, "(//column/infos/bounds)[2]", "bottom").toInt32(); // was 16216 CPPUNIT_ASSERT_MESSAGE("The column in a TBRL page should be shorter than the section.", nColumnHeight <= nSectionHeight); } @@ -2954,8 +2770,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf152031) auto pDump = parseLayoutDump(); // There was a stair effect after change the table size. - sal_Int32 nLeft_Row1 = getXPath(pDump, "(//row/infos/bounds)[1]"_ostr, "left"_ostr).toInt32(); - sal_Int32 nLeft_Row2 = getXPath(pDump, "(//row/infos/bounds)[2]"_ostr, "left"_ostr).toInt32(); + sal_Int32 nLeft_Row1 = getXPath(pDump, "(//row/infos/bounds)[1]", "left").toInt32(); + sal_Int32 nLeft_Row2 = getXPath(pDump, "(//row/infos/bounds)[2]", "left").toInt32(); CPPUNIT_ASSERT_EQUAL_MESSAGE("left values of SwRowFrames should be consistent.", nLeft_Row1, nLeft_Row2); } @@ -2971,66 +2787,65 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf153136) // Page 1: standalone paragraphs // U+0009 CHARACTER TABULATION: height is ignored - sal_Int32 height - = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[1]"_ostr, "height"_ostr).toInt32(); + sal_Int32 height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[1]", "height").toInt32(); CPPUNIT_ASSERT_LESS(small, height); // U+0020 SPACE: height is ignored - height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[2]"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[2]", "height").toInt32(); CPPUNIT_ASSERT_LESS(small, height); // U+00A0 NO-BREAK SPACE: height is considered - height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[3]"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[3]", "height").toInt32(); CPPUNIT_ASSERT_GREATER(large, height); // U+1680 OGHAM SPACE MARK: height is considered; not tested, because Liberation Serif lacks it // U+2000 EN QUAD: height is considered - height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[4]"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[4]", "height").toInt32(); CPPUNIT_ASSERT_GREATER(large, height); // U+2001 EM QUAD: height is considered - height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[5]"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[5]", "height").toInt32(); CPPUNIT_ASSERT_GREATER(large, height); // U+2002 EN SPACE: height is ignored - height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[6]"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[6]", "height").toInt32(); CPPUNIT_ASSERT_LESS(small, height); // U+2003 EM SPACE: height is ignored - height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[7]"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[7]", "height").toInt32(); CPPUNIT_ASSERT_LESS(small, height); // U+2004 THREE-PER-EM SPACE: height is considered - height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[8]"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[8]", "height").toInt32(); CPPUNIT_ASSERT_GREATER(large, height); // U+2005 FOUR-PER-EM SPACE: height is ignored - height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[9]"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[9]", "height").toInt32(); CPPUNIT_ASSERT_LESS(small, height); // U+2006 SIX-PER-EM SPACE: height is considered - height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[10]"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[10]", "height").toInt32(); CPPUNIT_ASSERT_GREATER(large, height); // U+2007 FIGURE SPACE: height is considered - height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[11]"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[11]", "height").toInt32(); CPPUNIT_ASSERT_GREATER(large, height); // U+2008 PUNCTUATION SPACE: height is considered - height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[12]"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[12]", "height").toInt32(); CPPUNIT_ASSERT_GREATER(large, height); // U+2009 THIN SPACE: height is considered - height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[13]"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[13]", "height").toInt32(); CPPUNIT_ASSERT_GREATER(large, height); // U+200A HAIR SPACE: height is considered - height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[14]"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[14]", "height").toInt32(); CPPUNIT_ASSERT_GREATER(large, height); // U+202F NARROW NO-BREAK SPACE: height is considered - height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[15]"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[15]", "height").toInt32(); CPPUNIT_ASSERT_GREATER(large, height); // U+205F MEDIUM MATHEMATICAL SPACE: height is considered; not tested, because Liberation Serif lacks it @@ -3039,75 +2854,61 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf153136) // Page 2: table rows (no paragraph-level size DF) // U+0020 SPACE: height is ignored - height - = getXPath(pXmlDoc, "(/root/page[2]//row)[1]/infos/bounds"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[2]//row)[1]/infos/bounds", "height").toInt32(); CPPUNIT_ASSERT_LESS(small, height); // U+00A0 NO-BREAK SPACE: height is considered (1104 or so) - height - = getXPath(pXmlDoc, "(/root/page[2]//row)[2]/infos/bounds"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[2]//row)[2]/infos/bounds", "height").toInt32(); CPPUNIT_ASSERT_GREATER(large, height); // U+1680 OGHAM SPACE MARK: height is considered; not tested, because Liberation Serif lacks it // U+2000 EN QUAD: height is considered - height - = getXPath(pXmlDoc, "(/root/page[2]//row)[3]/infos/bounds"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[2]//row)[3]/infos/bounds", "height").toInt32(); CPPUNIT_ASSERT_GREATER(large, height); // U+2001 EM QUAD: height is considered - height - = getXPath(pXmlDoc, "(/root/page[2]//row)[4]/infos/bounds"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[2]//row)[4]/infos/bounds", "height").toInt32(); CPPUNIT_ASSERT_GREATER(large, height); // U+2002 EN SPACE: height is ignored - height - = getXPath(pXmlDoc, "(/root/page[2]//row)[5]/infos/bounds"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[2]//row)[5]/infos/bounds", "height").toInt32(); CPPUNIT_ASSERT_LESS(small, height); // U+2003 EM SPACE: height is ignored - height - = getXPath(pXmlDoc, "(/root/page[2]//row)[6]/infos/bounds"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[2]//row)[6]/infos/bounds", "height").toInt32(); CPPUNIT_ASSERT_LESS(small, height); // U+2004 THREE-PER-EM SPACE: height is considered - height - = getXPath(pXmlDoc, "(/root/page[2]//row)[7]/infos/bounds"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[2]//row)[7]/infos/bounds", "height").toInt32(); CPPUNIT_ASSERT_GREATER(large, height); // U+2005 FOUR-PER-EM SPACE: height is ignored - height - = getXPath(pXmlDoc, "(/root/page[2]//row)[8]/infos/bounds"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[2]//row)[8]/infos/bounds", "height").toInt32(); CPPUNIT_ASSERT_LESS(small, height); // U+2006 SIX-PER-EM SPACE: height is considered - height - = getXPath(pXmlDoc, "(/root/page[2]//row)[9]/infos/bounds"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[2]//row)[9]/infos/bounds", "height").toInt32(); CPPUNIT_ASSERT_GREATER(large, height); // U+2007 FIGURE SPACE: height is considered - height - = getXPath(pXmlDoc, "(/root/page[2]//row)[10]/infos/bounds"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[2]//row)[10]/infos/bounds", "height").toInt32(); CPPUNIT_ASSERT_GREATER(large, height); // U+2008 PUNCTUATION SPACE: height is considered - height - = getXPath(pXmlDoc, "(/root/page[2]//row)[11]/infos/bounds"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[2]//row)[11]/infos/bounds", "height").toInt32(); CPPUNIT_ASSERT_GREATER(large, height); // U+2009 THIN SPACE: height is considered - height - = getXPath(pXmlDoc, "(/root/page[2]//row)[12]/infos/bounds"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[2]//row)[12]/infos/bounds", "height").toInt32(); CPPUNIT_ASSERT_GREATER(large, height); // U+200A HAIR SPACE: height is considered - height - = getXPath(pXmlDoc, "(/root/page[2]//row)[13]/infos/bounds"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[2]//row)[13]/infos/bounds", "height").toInt32(); CPPUNIT_ASSERT_GREATER(large, height); // U+202F NARROW NO-BREAK SPACE: height is considered - height - = getXPath(pXmlDoc, "(/root/page[2]//row)[14]/infos/bounds"_ostr, "height"_ostr).toInt32(); + height = getXPath(pXmlDoc, "(/root/page[2]//row)[14]/infos/bounds", "height").toInt32(); CPPUNIT_ASSERT_GREATER(large, height); // U+205F MEDIUM MATHEMATICAL SPACE: height is considered; not tested, because Liberation Serif lacks it diff --git a/sw/qa/extras/layout/layout3.cxx b/sw/qa/extras/layout/layout3.cxx index 0dbffb981b68..8830891fa632 100644 --- a/sw/qa/extras/layout/layout3.cxx +++ b/sw/qa/extras/layout/layout3.cxx @@ -62,7 +62,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf134463) createSwDoc("tdf134463.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was 621. The previous paragraph must have zero bottom border. - assertXPath(pXmlDoc, "/root/page/body/txt[3]/infos/prtBounds"_ostr, "top"_ostr, u"21"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt[3]/infos/prtBounds", "top", u"21"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf117188) @@ -70,19 +70,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf117188) createSwDoc("tdf117188.docx"); saveAndReload(u"writer8"_ustr); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - OUString sWidth - = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds"_ostr, "width"_ostr); - OUString sHeight - = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds"_ostr, "height"_ostr); + OUString sWidth = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds", "width"); + OUString sHeight = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds", "height"); // The text box must have zero border distances - assertXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/prtBounds"_ostr, "left"_ostr, - u"0"_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/prtBounds"_ostr, "top"_ostr, - u"0"_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/prtBounds"_ostr, "width"_ostr, - sWidth); - assertXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/prtBounds"_ostr, "height"_ostr, - sHeight); + assertXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/prtBounds", "left", u"0"); + assertXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/prtBounds", "top", u"0"); + assertXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/prtBounds", "width", sWidth); + assertXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/prtBounds", "height", sHeight); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf117187) @@ -93,8 +87,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf117187) // there should be no fly portions assertXPath( pXmlDoc, - "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[@nType='PortionType::Fly']"_ostr, - 0); + "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[@nType='PortionType::Fly']", 0); } #if defined _WIN32 && defined _ARM64_ // skip for windows arm64 build @@ -104,18 +97,18 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf119875) createSwDoc("tdf119875.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "//page[2]/body/section[1]"_ostr, "formatName"_ostr, u"S10"_ustr); - assertXPath(pXmlDoc, "//page[2]/body/section[2]"_ostr, "formatName"_ostr, u"S11"_ustr); - assertXPath(pXmlDoc, "//page[2]/body/section[3]"_ostr, "formatName"_ostr, u"S13"_ustr); - assertXPath(pXmlDoc, "//page[2]/body/section[4]"_ostr, "formatName"_ostr, u"S14"_ustr); + assertXPath(pXmlDoc, "//page[2]/body/section[1]", "formatName", u"S10"); + assertXPath(pXmlDoc, "//page[2]/body/section[2]", "formatName", u"S11"); + assertXPath(pXmlDoc, "//page[2]/body/section[3]", "formatName", u"S13"); + assertXPath(pXmlDoc, "//page[2]/body/section[4]", "formatName", u"S14"); // Sections "S10" and "S13" are hidden -> their frames are zero-height - assertXPath(pXmlDoc, "//page[2]/body/section[1]/infos/bounds"_ostr, "height"_ostr, u"0"_ustr); - assertXPath(pXmlDoc, "//page[2]/body/section[3]/infos/bounds"_ostr, "height"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, "//page[2]/body/section[1]/infos/bounds", "height", u"0"); + assertXPath(pXmlDoc, "//page[2]/body/section[3]/infos/bounds", "height", u"0"); - OUString S10Top = getXPath(pXmlDoc, "//page[2]/body/section[1]/infos/bounds"_ostr, "top"_ostr); - OUString S11Top = getXPath(pXmlDoc, "//page[2]/body/section[2]/infos/bounds"_ostr, "top"_ostr); - OUString S13Top = getXPath(pXmlDoc, "//page[2]/body/section[3]/infos/bounds"_ostr, "top"_ostr); - OUString S14Top = getXPath(pXmlDoc, "//page[2]/body/section[4]/infos/bounds"_ostr, "top"_ostr); + OUString S10Top = getXPath(pXmlDoc, "//page[2]/body/section[1]/infos/bounds", "top"); + OUString S11Top = getXPath(pXmlDoc, "//page[2]/body/section[2]/infos/bounds", "top"); + OUString S13Top = getXPath(pXmlDoc, "//page[2]/body/section[3]/infos/bounds", "top"); + OUString S14Top = getXPath(pXmlDoc, "//page[2]/body/section[4]/infos/bounds", "top"); CPPUNIT_ASSERT_EQUAL(S10Top, S11Top); CPPUNIT_ASSERT_EQUAL(S13Top, S14Top); @@ -131,10 +124,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf137523) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // the problem was that in the footer, the text frames below the table // had wrong height and were not visible - assertXPath(pXmlDoc, "/root/page/footer/txt[1]/infos/bounds"_ostr, "height"_ostr, u"304"_ustr); - assertXPath(pXmlDoc, "/root/page/footer/txt[2]/infos/bounds"_ostr, "height"_ostr, u"191"_ustr); - assertXPath(pXmlDoc, "/root/page/footer/txt[3]/infos/bounds"_ostr, "height"_ostr, u"219"_ustr); - assertXPath(pXmlDoc, "/root/page/footer/tab/infos/bounds"_ostr, "height"_ostr, u"1378"_ustr); + assertXPath(pXmlDoc, "/root/page/footer/txt[1]/infos/bounds", "height", u"304"); + assertXPath(pXmlDoc, "/root/page/footer/txt[2]/infos/bounds", "height", u"191"); + assertXPath(pXmlDoc, "/root/page/footer/txt[3]/infos/bounds", "height", u"219"); + assertXPath(pXmlDoc, "/root/page/footer/tab/infos/bounds", "height", u"1378"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf120287) @@ -144,7 +137,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf120287) // This was 2, TabOverMargin Word-specific compat flag did not imply // default-in-Word printer-independent layout, resulting in an additional // line break. - assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, 1); + assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout", 1); } auto getXPathIntAttributeValue(xmlXPathContextPtr pXmlXpathCtx, char const* const pXPath) @@ -166,7 +159,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf128966) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); xmlXPathObjectPtr pXmlObj - = getXPathNode(pXmlDoc, "/root/page/body/tab/row/cell[@rowspan > 0][child::txt]"_ostr); + = getXPathNode(pXmlDoc, "/root/page/body/tab/row/cell[@rowspan > 0][child::txt]"); xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; CPPUNIT_ASSERT(pXmlNodes); CPPUNIT_ASSERT_GREATER(300, xmlXPathNodeSetGetLength(pXmlNodes)); // many... @@ -206,14 +199,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf161718) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // everything on one page - assertXPath(pXmlDoc, "/root/page/header"_ostr, 1); - assertXPath(pXmlDoc, "/root/page/header/txt/anchored"_ostr, 1); - assertXPath(pXmlDoc, "/root/page/footer"_ostr, 1); - assertXPath(pXmlDoc, "/root/page/ftncont/ftn"_ostr, 1); - assertXPath(pXmlDoc, "/root/page/ftncont/ftn/txt"_ostr, 1); - assertXPath(pXmlDoc, "/root/page/body/txt"_ostr, 27); - assertXPath(pXmlDoc, "/root/page/body/txt/anchored"_ostr, 1); - assertXPath(pXmlDoc, "/root/page"_ostr, 1); + assertXPath(pXmlDoc, "/root/page/header", 1); + assertXPath(pXmlDoc, "/root/page/header/txt/anchored", 1); + assertXPath(pXmlDoc, "/root/page/footer", 1); + assertXPath(pXmlDoc, "/root/page/ftncont/ftn", 1); + assertXPath(pXmlDoc, "/root/page/ftncont/ftn/txt", 1); + assertXPath(pXmlDoc, "/root/page/body/txt", 27); + assertXPath(pXmlDoc, "/root/page/body/txt/anchored", 1); + assertXPath(pXmlDoc, "/root/page", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf119908) @@ -230,9 +223,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf119908) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Keep real width of the exceeding line portions to calculate shrinking sal_Int32 nPortionWidth - = getXPath(pXmlDoc, - "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[2]/SwLinePortion[2]"_ostr, - "width"_ostr) + = getXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[2]/SwLinePortion[2]", + "width") .toInt32(); // This was 5806 (not real portion width, but stripped to the line width) CPPUNIT_ASSERT_GREATER(sal_Int32(5840), nPortionWidth); @@ -253,32 +245,30 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf158333) // shrink line 2 assertXPath( - pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[2]"_ostr, "portion"_ostr, - u"viverra odio. Donec auctor molestie sem, sit amet tristique lectus hendrerit sed. "_ustr); + pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[2]", "portion", + u"viverra odio. Donec auctor molestie sem, sit amet tristique lectus hendrerit sed. "); // shrink line 7 assertXPath( - pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[7]"_ostr, "portion"_ostr, + pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[7]", "portion", // This was "...diam ", not "...diam tempor " - u"laoreet vel leo nec, volutpat facilisis eros. Donec consequat arcu ut diam tempor "_ustr); + u"laoreet vel leo nec, volutpat facilisis eros. Donec consequat arcu ut diam tempor "); // shrink line 2 of paragraph 2 assertXPath( - pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[2]"_ostr, "portion"_ostr, + pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[2]", "portion", // This was "...Cras ", not "...Cras sodales " - u"Donec auctor molestie sem, sit amet tristique lectus hendrerit sed. Cras sodales "_ustr); + u"Donec auctor molestie sem, sit amet tristique lectus hendrerit sed. Cras sodales "); // shrink line 2 of paragraph 4 - assertXPath( - pXmlDoc, "/root/page/body/txt[4]/SwParaPortion/SwLineLayout[2]"_ostr, "portion"_ostr, - // This was "...et ", not "...et magnis " - u"consequat arcu ut diam tempor luctus. Cum sociis natoque penatibus et magnis "_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt[4]/SwParaPortion/SwLineLayout[2]", "portion", + // This was "...et ", not "...et magnis " + u"consequat arcu ut diam tempor luctus. Cum sociis natoque penatibus et magnis "); // tdf#158776 don't shrink line 11 of paragraph 4 - assertXPath(pXmlDoc, "/root/page/body/txt[4]/SwParaPortion/SwLineLayout[11]"_ostr, - "portion"_ostr, + assertXPath(pXmlDoc, "/root/page/body/txt[4]/SwParaPortion/SwLineLayout[11]", "portion", // This was "...quis curcus ", not "...quis " - u"venenatis, quis commodo dolor posuere. Curabitur dignissim sapien quis "_ustr); + u"venenatis, quis commodo dolor posuere. Curabitur dignissim sapien quis "); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf159085) @@ -295,14 +285,12 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf159085) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was "... cursus" instead of breaking the word at soft hyphen - assertXPath( - pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, "portion"_ostr, - u"venenatis, quis commodo dolor posuere. Curabitur dignissim sapien quis cur"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]", "portion", + u"venenatis, quis commodo dolor posuere. Curabitur dignissim sapien quis cur"); // This was "... cursus" instead of breaking the word at soft hyphen - assertXPath( - pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]"_ostr, "portion"_ostr, - u"venenatis, quis commodo dolor posuere. Curabitur dignissim sapien quis cur"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]", "portion", + u"venenatis, quis commodo dolor posuere. Curabitur dignissim sapien quis cur"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf158419) @@ -326,13 +314,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf158419) SwWrtShell* pWrtShell = pShell->GetWrtShell(); SwPosition aPosition(*pWrtShell->GetCursor()->Start()); SwTwips nSecondParaLeft - = getXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds"_ostr, "left"_ostr).toInt32(); + = getXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds", "left").toInt32(); SwTwips nSecondParaWidth - = getXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds"_ostr, "width"_ostr).toInt32(); + = getXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds", "width").toInt32(); SwTwips nSecondParaTop - = getXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds"_ostr, "top"_ostr).toInt32(); + = getXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds", "top").toInt32(); SwTwips nSecondParaHeight - = getXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds"_ostr, "height"_ostr).toInt32(); + = getXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds", "height").toInt32(); Point aPoint; // click at the end of the second line of the second paragraph @@ -367,14 +355,12 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf163042) SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); SwWrtShell* pWrtShell = pShell->GetWrtShell(); SwPosition aPosition(*pWrtShell->GetCursor()->Start()); - SwTwips nParaLeft - = getXPath(pXmlDoc, "/root/page/body/txt[1]/infos/bounds"_ostr, "left"_ostr).toInt32(); + SwTwips nParaLeft = getXPath(pXmlDoc, "/root/page/body/txt[1]/infos/bounds", "left").toInt32(); SwTwips nParaWidth - = getXPath(pXmlDoc, "/root/page/body/txt[1]/infos/bounds"_ostr, "width"_ostr).toInt32(); - SwTwips nParaTop - = getXPath(pXmlDoc, "/root/page/body/txt[1]/infos/bounds"_ostr, "top"_ostr).toInt32(); + = getXPath(pXmlDoc, "/root/page/body/txt[1]/infos/bounds", "width").toInt32(); + SwTwips nParaTop = getXPath(pXmlDoc, "/root/page/body/txt[1]/infos/bounds", "top").toInt32(); SwTwips nParaHeight - = getXPath(pXmlDoc, "/root/page/body/txt[1]/infos/bounds"_ostr, "height"_ostr).toInt32(); + = getXPath(pXmlDoc, "/root/page/body/txt[1]/infos/bounds", "height").toInt32(); Point aPoint; // click before the last but one character of the paragraph @@ -407,12 +393,11 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf163060) // before the last text portion "i" // This ends in "dolorsi" (not "dolors", as before) - assertXPath( - pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, "portion"_ostr, - u"Quis pretium semper. Proin luctus orci a neque venenatis, quis commodo dolorsi"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]", "portion", + u"Quis pretium semper. Proin luctus orci a neque venenatis, quis commodo dolorsi"); // no second line (there was a second line with the text portion "i"). - assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, 1); + assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf162109) @@ -429,7 +414,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf162109) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // There was no SwGluePortion, because of missing justification of the last paragraph line, // despite it is a full line with shrunk spaces - assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwGluePortion"_ostr); + assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwGluePortion"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf162220) @@ -446,7 +431,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf162220) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // There was no SwGluePortion, because of missing justification of the last paragraph line, // despite it is a full line with shrunk spaces - assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwGluePortion"_ostr); + assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwGluePortion"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf162725) @@ -463,7 +448,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf162725) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // There was no SwGluePortion, because of missing justification of the last paragraph line, // despite it is a full line with shrunk spaces - assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwGluePortion"_ostr); + assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwGluePortion"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf161810) @@ -518,13 +503,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf132599_always) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // 2nd paragraph: hyphenated last full line - assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[2]"_ostr, - "portion"_ostr, u"ent to any other celes"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[2]", "portion", + u"ent to any other celes"); // hyphenation-keep-type='always' // 3rd paragraph: not hyphenated last full line of the hyphenated paragraph - assertXPath(pXmlDoc, "/root/page/body/txt[3]/SwParaPortion/SwLineLayout[2]"_ostr, - "portion"_ostr, u"ent to any other "_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt[3]/SwParaPortion/SwLineLayout[2]", "portion", + u"ent to any other "); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf132599_frames_on_same_page_no_hyphenation) @@ -546,9 +531,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf132599_frames_on_same_page_no_hyphe // loext:hyphenation-keep-type="column" // 2nd frame: shifted hyphenated line (no hyphenation at the end of the first frame) - assertXPath(pXmlDoc, - "/root/page/body/txt/anchored/fly[2]/txt/SwParaPortion/SwLineLayout[1]"_ostr, - "portion"_ostr, u"space, ex"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt/anchored/fly[2]/txt/SwParaPortion/SwLineLayout[1]", + "portion", u"space, ex"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf132599_frames_on_same_page_hyphenation) @@ -571,9 +555,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf132599_frames_on_same_page_hyphenat // loext:hyphenation-keep-type="page" // 2nd frame: not shifted hyphenated line (hyphenation at the end of the first frame), // This was "space, ex" (bad shifting) - assertXPath(pXmlDoc, - "/root/page/body/txt/anchored/fly[2]/txt/SwParaPortion/SwLineLayout[1]"_ostr, - "portion"_ostr, u"cept that it "_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt/anchored/fly[2]/txt/SwParaPortion/SwLineLayout[1]", + "portion", u"cept that it "); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf132599_frames_on_right_pages_no_hyphenation) @@ -596,9 +579,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf132599_frames_on_right_pages_no_hyp // loext:hyphenation-keep-type="spread" // 2nd frame: shifted hyphenated line // This was "cept that it" (missing shifting) - assertXPath(pXmlDoc, - "/root/page[3]/body/txt/anchored/fly/txt/SwParaPortion/SwLineLayout[1]"_ostr, - "portion"_ostr, u"space, ex"_ustr); + assertXPath(pXmlDoc, "/root/page[3]/body/txt/anchored/fly/txt/SwParaPortion/SwLineLayout[1]", + "portion", u"space, ex"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf132599_frames_on_spread_hyphenation) @@ -621,9 +603,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf132599_frames_on_spread_hyphenation // loext:hyphenation-keep-type="spread" // 2nd frame on left page and 3rd frame on right page -> not shifted hyphenated line // 2nd frame: not shifted hyphenated line (hyphenation at the end of the first frame), - assertXPath(pXmlDoc, - "/root/page[3]/body/txt/anchored/fly/txt/SwParaPortion/SwLineLayout[1]"_ostr, - "portion"_ostr, u"cept that it "_ustr); + assertXPath(pXmlDoc, "/root/page[3]/body/txt/anchored/fly/txt/SwParaPortion/SwLineLayout[1]", + "portion", u"cept that it "); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf106234) @@ -639,16 +620,16 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf106234) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // In justified paragraphs, there is justification between left tabulators and manual line breaks - assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwGluePortion"_ostr, - "type"_ostr, u"PortionType::Margin"_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwGluePortion"_ostr, - "width"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwGluePortion", + "type", u"PortionType::Margin"); + assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwGluePortion", + "width", u"0"); // but not after centered, right and decimal tabulators - assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/SwGluePortion"_ostr, - "type"_ostr, u"PortionType::Margin"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/SwGluePortion", + "type", u"PortionType::Margin"); // This was a justified line, without width - assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/SwGluePortion"_ostr, - "width"_ostr, u"7882"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/SwGluePortion", + "width", u"7882"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf155324) @@ -660,36 +641,29 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf155324) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // the problem was that the first entry was on page 7, 2nd on page 9 etc. - assertXPath( - pXmlDoc, - "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"Foo"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"5"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/body/section[2]/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"bar"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/body/section[2]/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"7"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "portion"_ostr, u"Three"_ustr); - assertXPath( - pXmlDoc, - "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "portion"_ostr, u"7"_ustr); + assertXPath(pXmlDoc, + "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"Foo"); + assertXPath(pXmlDoc, + "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"5"); + assertXPath(pXmlDoc, + "/root/page[1]/body/section[2]/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"bar"); + assertXPath(pXmlDoc, + "/root/page[1]/body/section[2]/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"7"); + assertXPath(pXmlDoc, + "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "portion", u"Three"); + assertXPath(pXmlDoc, + "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "portion", u"7"); // check first content page has the footnotes - assertXPath(pXmlDoc, "/root/page[5]/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, - "portion"_ostr, u"Foo"_ustr); - assertXPath(pXmlDoc, "/root/page[4]/ftncont"_ostr, 0); - assertXPath(pXmlDoc, "/root/page[5]/ftncont/ftn"_ostr, 5); + assertXPath(pXmlDoc, "/root/page[5]/body/txt[1]/SwParaPortion/SwLineLayout", "portion", u"Foo"); + assertXPath(pXmlDoc, "/root/page[4]/ftncont", 0); + assertXPath(pXmlDoc, "/root/page[5]/ftncont/ftn", 5); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf120287b) @@ -701,8 +675,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf120287b) // line. assertXPath( pXmlDoc, - "/root/page/body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::TabRight']"_ostr, - "width"_ostr, u"1"_ustr); + "/root/page/body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::TabRight']", + "width", u"1"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf120287c) @@ -711,7 +685,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf120287c) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // This was 3, the second line was broken into a 2nd and a 3rd one, // not rendering text outside the paragraph frame like Word 2013 does. - assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, 2); + assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout", 2); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf158658a) @@ -720,19 +694,19 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf158658a) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Word 2013 puts all tabs into one line, the last 8 of them are off the page - assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath( - pXmlDoc, - "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::TabCenter']"_ostr, - 1); - assertXPath( - pXmlDoc, - "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::TabRight']"_ostr, - 1); - assertXPath( - pXmlDoc, - "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::TabLeft']"_ostr, - 9); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout", 1); + assertXPath(pXmlDoc, + "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/" + "child::*[@type='PortionType::TabCenter']", + 1); + assertXPath(pXmlDoc, + "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/" + "child::*[@type='PortionType::TabRight']", + 1); + assertXPath(pXmlDoc, + "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/" + "child::*[@type='PortionType::TabLeft']", + 9); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf158658b) @@ -742,23 +716,23 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf158658b) // Word 2013 puts all tabs and the field following into one line // and also puts the field off the page - assertXPath(pXmlDoc, "/root/page[1]/footer/txt[1]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath( - pXmlDoc, - "/root/page[1]/footer/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::TabCenter']"_ostr, - 1); - assertXPath( - pXmlDoc, - "/root/page[1]/footer/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::TabRight']"_ostr, - 1); - assertXPath( - pXmlDoc, - "/root/page[1]/footer/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::TabRight']"_ostr, - "width"_ostr, u"4446"_ustr); // was very small: 24 - assertXPath( - pXmlDoc, - "/root/page[1]/footer/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::TabLeft']"_ostr, - 0); + assertXPath(pXmlDoc, "/root/page[1]/footer/txt[1]/SwParaPortion/SwLineLayout", 1); + assertXPath(pXmlDoc, + "/root/page[1]/footer/txt[1]/SwParaPortion/SwLineLayout/" + "child::*[@type='PortionType::TabCenter']", + 1); + assertXPath(pXmlDoc, + "/root/page[1]/footer/txt[1]/SwParaPortion/SwLineLayout/" + "child::*[@type='PortionType::TabRight']", + 1); + assertXPath(pXmlDoc, + "/root/page[1]/footer/txt[1]/SwParaPortion/SwLineLayout/" + "child::*[@type='PortionType::TabRight']", + "width", u"4446"); // was very small: 24 + assertXPath(pXmlDoc, + "/root/page[1]/footer/txt[1]/SwParaPortion/SwLineLayout/" + "child::*[@type='PortionType::TabLeft']", + 0); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf158658c) @@ -767,20 +741,20 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf158658c) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Word 2013 puts all tabs into one line, the last 17 of them are off the page - assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath( - pXmlDoc, - "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::TabCenter']"_ostr, - 1); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout", 1); + assertXPath(pXmlDoc, + "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/" + "child::*[@type='PortionType::TabCenter']", + 1); // the right tab is exactly at the margin of the paragraph - assertXPath( - pXmlDoc, - "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::TabRight']"_ostr, - 1); - assertXPath( - pXmlDoc, - "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::TabLeft']"_ostr, - 20); + assertXPath(pXmlDoc, + "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/" + "child::*[@type='PortionType::TabRight']", + 1); + assertXPath(pXmlDoc, + "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/" + "child::*[@type='PortionType::TabLeft']", + 20); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf155177) @@ -793,13 +767,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf155177) { xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[2]/body/txt"_ostr, 6); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[6]/SwParaPortion/SwLineLayout"_ostr, 2); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[6]/SwParaPortion/SwLineLayout[2]"_ostr, - "portion"_ostr, u"long as two lines."_ustr); - assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, 3); - assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, - "portion"_ostr, u"This paragraph is even longer so that "_ustr); + assertXPath(pXmlDoc, "/root/page[2]/body/txt", 6); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[6]/SwParaPortion/SwLineLayout", 2); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[6]/SwParaPortion/SwLineLayout[2]", "portion", + u"long as two lines."); + assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/SwParaPortion/SwLineLayout", 3); + assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/SwParaPortion/SwLineLayout[1]", "portion", + u"This paragraph is even longer so that "); } // this should bring one line back @@ -809,13 +783,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf155177) { xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[2]/body/txt"_ostr, 7); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[7]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[7]/SwParaPortion/SwLineLayout[1]"_ostr, - "portion"_ostr, u"This paragraph is even longer so that "_ustr); - assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, 2); - assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, - "portion"_ostr, u"it is now three lines long though "_ustr); + assertXPath(pXmlDoc, "/root/page[2]/body/txt", 7); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[7]/SwParaPortion/SwLineLayout", 1); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[7]/SwParaPortion/SwLineLayout[1]", "portion", + u"This paragraph is even longer so that "); + assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/SwParaPortion/SwLineLayout", 2); + assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/SwParaPortion/SwLineLayout[1]", "portion", + u"it is now three lines long though "); } // this should bring second line back @@ -825,15 +799,15 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf155177) { xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[2]/body/txt"_ostr, 7); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[7]/SwParaPortion/SwLineLayout"_ostr, 2); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[7]/SwParaPortion/SwLineLayout[1]"_ostr, - "portion"_ostr, u"This paragraph is even longer so that "_ustr); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[7]/SwParaPortion/SwLineLayout[2]"_ostr, - "portion"_ostr, u"it is now three lines long though "_ustr); - assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, - "portion"_ostr, u"containing a single sentence."_ustr); + assertXPath(pXmlDoc, "/root/page[2]/body/txt", 7); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[7]/SwParaPortion/SwLineLayout", 2); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[7]/SwParaPortion/SwLineLayout[1]", "portion", + u"This paragraph is even longer so that "); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[7]/SwParaPortion/SwLineLayout[2]", "portion", + u"it is now three lines long though "); + assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/SwParaPortion/SwLineLayout", 1); + assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/SwParaPortion/SwLineLayout[1]", "portion", + u"containing a single sentence."); } } @@ -842,8 +816,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf122878) createSwDoc("tdf122878.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); const sal_Int32 nTblTop - = getXPath(pXmlDoc, "/root/page[1]/footer/txt/anchored/fly/tab/infos/bounds"_ostr, - "top"_ostr) + = getXPath(pXmlDoc, "/root/page[1]/footer/txt/anchored/fly/tab/infos/bounds", "top") .toInt32(); SwDoc* pDoc = getSwDoc(); SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); @@ -866,23 +839,23 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf115094) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nTopOfD1 - = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/tab/row[1]/cell[4]/infos/bounds"_ostr, - "top"_ostr) + = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/tab/row[1]/cell[4]/infos/bounds", + "top") .toInt32(); sal_Int32 nTopOfD1Anchored = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/tab/row[1]/cell[4]/" - "txt[2]/anchored/fly/infos/bounds"_ostr, - "top"_ostr) + "txt[2]/anchored/fly/infos/bounds", + "top") .toInt32(); CPPUNIT_ASSERT_LESS(nTopOfD1Anchored, nTopOfD1); sal_Int32 nTopOfB2 - = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/tab/row[2]/cell[2]/infos/bounds"_ostr, - "top"_ostr) + = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/tab/row[2]/cell[2]/infos/bounds", + "top") .toInt32(); sal_Int32 nTopOfB2Anchored = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/tab/row[2]/cell[2]/" - "txt[1]/anchored/fly/infos/bounds"_ostr, - "top"_ostr) + "txt[1]/anchored/fly/infos/bounds", + "top") .toInt32(); CPPUNIT_ASSERT_LESS(nTopOfB2Anchored, nTopOfB2); } @@ -893,8 +866,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf112290) SwDoc* pDoc = getSwDoc(); CPPUNIT_ASSERT(pDoc); auto pXml = parseLayoutDump(); - assertXPath(pXml, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]"_ostr, "portion"_ostr, - u"Xxxx Xxxx"_ustr); + assertXPath(pXml, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]", "portion", u"Xxxx Xxxx"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testKeepWithNextPlusFlyFollowTextFlow) @@ -904,17 +876,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testKeepWithNextPlusFlyFollowTextFlow) { xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // 3 text frames on page 1 - assertXPath(pXmlDoc, "/root/page[1]/body/infos/bounds"_ostr, "bottom"_ostr, u"7540"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/bounds"_ostr, "height"_ostr, - u"276"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/infos/bounds"_ostr, "height"_ostr, - u"276"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly/infos/bounds"_ostr, "top"_ostr, - u"1694"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/infos/bounds"_ostr, "height"_ostr, - u"276"_ustr); - assertXPath(pXmlDoc, "/root/page"_ostr, 1); + assertXPath(pXmlDoc, "/root/page[1]/body/infos/bounds", "bottom", u"7540"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/bounds", "height", u"276"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/infos/bounds", "height", u"276"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly", 1); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly/infos/bounds", "top", u"1694"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/infos/bounds", "height", u"276"); + assertXPath(pXmlDoc, "/root/page", 1); } dispatchCommand(mxComponent, u".uno:Fieldnames"_ustr, {}); @@ -922,20 +890,16 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testKeepWithNextPlusFlyFollowTextFlow) { xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // 1 text frame on page 1, and some empty space - assertXPath(pXmlDoc, "/root/page[1]/body/infos/bounds"_ostr, "bottom"_ostr, u"7540"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/bounds"_ostr, "height"_ostr, - u"5796"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/bounds"_ostr, "bottom"_ostr, - u"7213"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/infos/bounds", "bottom", u"7540"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/bounds", "height", u"5796"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/bounds", "bottom", u"7213"); // 2 text frames on page 2 - assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/infos/bounds"_ostr, "height"_ostr, - u"276"_ustr); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly/infos/bounds"_ostr, "top"_ostr, - u"10093"_ustr); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/infos/bounds"_ostr, "height"_ostr, - u"276"_ustr); - assertXPath(pXmlDoc, "/root/page"_ostr, 2); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/infos/bounds", "height", u"276"); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly", 1); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly/infos/bounds", "top", + u"10093"); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/infos/bounds", "height", u"276"); + assertXPath(pXmlDoc, "/root/page", 2); } dispatchCommand(mxComponent, u".uno:Fieldnames"_ustr, {}); @@ -943,17 +907,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testKeepWithNextPlusFlyFollowTextFlow) { xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // 3 text frames on page 1 - assertXPath(pXmlDoc, "/root/page[1]/body/infos/bounds"_ostr, "bottom"_ostr, u"7540"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/bounds"_ostr, "height"_ostr, - u"276"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/infos/bounds"_ostr, "height"_ostr, - u"276"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly/infos/bounds"_ostr, "top"_ostr, - u"1694"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/infos/bounds"_ostr, "height"_ostr, - u"276"_ustr); - assertXPath(pXmlDoc, "/root/page"_ostr, 1); + assertXPath(pXmlDoc, "/root/page[1]/body/infos/bounds", "bottom", u"7540"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/bounds", "height", u"276"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/infos/bounds", "height", u"276"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly", 1); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly/infos/bounds", "top", u"1694"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/infos/bounds", "height", u"276"); + assertXPath(pXmlDoc, "/root/page", 1); } } @@ -963,16 +923,16 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf122607) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/txt[1]/anchored/fly/tab/row[2]/cell/txt[7]/anchored/" - "fly/txt/SwParaPortion/SwLineLayout/child::*[1]"_ostr, - "height"_ostr, u"253"_ustr); + "fly/txt/SwParaPortion/SwLineLayout/child::*[1]", + "height", u"253"); assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/txt[1]/anchored/fly/tab/row[2]/cell/txt[7]/anchored/" - "fly/txt/SwParaPortion/SwLineLayout/child::*[1]"_ostr, - "width"_ostr, u"428"_ustr); + "fly/txt/SwParaPortion/SwLineLayout/child::*[1]", + "width", u"428"); assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/txt[1]/anchored/fly/tab/row[2]/cell/txt[7]/anchored/" - "fly/txt/SwParaPortion/SwLineLayout/child::*[1]"_ostr, - "portion"_ostr, u"Fax:"_ustr); + "fly/txt/SwParaPortion/SwLineLayout/child::*[1]", + "portion", u"Fax:"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf122607_regression) @@ -1002,19 +962,15 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf122607_regression) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // somehow these 2 rows overlapped in the PDF unless CalcLayout() runs - assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/infos/bounds"_ostr, - "mbFixSize"_ostr, u"false"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/infos/bounds"_ostr, "top"_ostr, - u"2977"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/infos/bounds"_ostr, - "height"_ostr, u"241"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/infos/bounds"_ostr, - "mbFixSize"_ostr, u"true"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/infos/bounds", "mbFixSize", + u"false"); + assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/infos/bounds", "top", u"2977"); + assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/infos/bounds", "height", u"241"); + assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/infos/bounds", "mbFixSize", + u"true"); // this was 3034, causing the overlap - assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/infos/bounds"_ostr, "top"_ostr, - u"3218"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/infos/bounds"_ostr, - "height"_ostr, u"164"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/infos/bounds", "top", u"3218"); + assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/infos/bounds", "height", u"164"); aTempFile.EnableKillingFile(); } @@ -1049,19 +1005,19 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf150616) // this one was 0 height assertXPath(pXmlDoc, - "/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[2]/SwParaPortion/SwLineLayout"_ostr, - "portion"_ostr, u"Important information here!"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[2]/infos/bounds"_ostr, - "height"_ostr, u"253"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[2]/infos/bounds"_ostr, - "top"_ostr, u"7925"_ustr); + "/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[2]/SwParaPortion/SwLineLayout", + "portion", u"Important information here!"); + assertXPath(pXmlDoc, "/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[2]/infos/bounds", "height", + u"253"); + assertXPath(pXmlDoc, "/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[2]/infos/bounds", "top", + u"7925"); assertXPath(pXmlDoc, - "/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[3]/SwParaPortion/SwLineLayout"_ostr, - "portion"_ostr, u"xxx 111 "_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[3]/infos/bounds"_ostr, - "height"_ostr, u"697"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[3]/infos/bounds"_ostr, - "top"_ostr, u"8178"_ustr); + "/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[3]/SwParaPortion/SwLineLayout", + "portion", u"xxx 111 "); + assertXPath(pXmlDoc, "/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[3]/infos/bounds", "height", + u"697"); + assertXPath(pXmlDoc, "/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[3]/infos/bounds", "top", + u"8178"); aTempFile.EnableKillingFile(); } @@ -1081,25 +1037,24 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testBtlrCell) // Without the accompanying fix in place, this test would have failed, as // the orientation was 0 (layout did not take btlr direction request from // doc model). - assertXPath(pXmlDoc, "//font[1]"_ostr, "orientation"_ostr, u"900"_ustr); + assertXPath(pXmlDoc, "//font[1]", "orientation", u"900"); #if !defined(MACOSX) && !defined(_WIN32) // macOS fails with x == 2662 for some reason. // Without the accompanying fix in place, this test would have failed with 'Expected: 1915; // Actual : 1756', i.e. the AAA1 text was too close to the left cell border due to an ascent vs // descent mismatch when calculating the baseline offset of the text portion. - assertXPath(pXmlDoc, "//textarray[1]"_ostr, "x"_ostr, u"1915"_ustr); - assertXPath(pXmlDoc, "//textarray[1]"_ostr, "y"_ostr, u"2707"_ustr); + assertXPath(pXmlDoc, "//textarray[1]", "x", u"1915"); + assertXPath(pXmlDoc, "//textarray[1]", "y", u"2707"); // Without the accompanying fix in place, this test would have failed with 'Expected: 1979; // Actual : 2129', i.e. the gray background of the "AAA2." text was too close to the right edge // of the text portion. Now it's exactly behind the text portion. - assertXPath(pXmlDoc, "(//rect)[2]"_ostr, "left"_ostr, u"1979"_ustr); + assertXPath(pXmlDoc, "(//rect)[2]", "left", u"1979"); // Without the accompanying fix in place, this test would have failed with 'Expected: 269; // Actual : 0', i.e. the AAA2 frame was not visible due to 0 width. pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt[2]/infos/bounds"_ostr, "width"_ostr, - u"269"_ustr); + assertXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt[2]/infos/bounds", "width", u"269"); // Test the position of the cursor after doc load. // We expect that it's inside the first text frame in the first cell. @@ -1110,11 +1065,9 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testBtlrCell) const SwRect& rCharRect = pWrtShell->GetCharRect(); SwTwips nFirstParaTop - = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt[1]/infos/bounds"_ostr, "top"_ostr) - .toInt32(); + = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt[1]/infos/bounds", "top").toInt32(); SwTwips nFirstParaHeight - = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt[1]/infos/bounds"_ostr, - "height"_ostr) + = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt[1]/infos/bounds", "height") .toInt32(); SwTwips nFirstParaMiddle = nFirstParaTop + nFirstParaHeight / 2; SwTwips nFirstParaBottom = nFirstParaTop + nFirstParaHeight; @@ -1156,18 +1109,15 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testBtlrCell) SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); SwPosition aPosition(aCellStart); SwTwips nSecondParaLeft - = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt[2]/infos/bounds"_ostr, "left"_ostr) + = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt[2]/infos/bounds", "left") .toInt32(); SwTwips nSecondParaWidth - = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt[2]/infos/bounds"_ostr, - "width"_ostr) + = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt[2]/infos/bounds", "width") .toInt32(); SwTwips nSecondParaTop - = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt[2]/infos/bounds"_ostr, "top"_ostr) - .toInt32(); + = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt[2]/infos/bounds", "top").toInt32(); SwTwips nSecondParaHeight - = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt[2]/infos/bounds"_ostr, - "height"_ostr) + = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt[2]/infos/bounds", "height") .toInt32(); Point aPoint; aPoint.setX(nSecondParaLeft + nSecondParaWidth / 2); @@ -1182,17 +1132,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testBtlrCell) // Test that the selection rectangles are inside the cell frame if we select all the cell // content. SwTwips nCellLeft - = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/infos/bounds"_ostr, "left"_ostr) - .toInt32(); + = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/infos/bounds", "left").toInt32(); SwTwips nCellWidth - = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/infos/bounds"_ostr, "width"_ostr) - .toInt32(); + = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/infos/bounds", "width").toInt32(); SwTwips nCellTop - = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/infos/bounds"_ostr, "top"_ostr) - .toInt32(); + = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/infos/bounds", "top").toInt32(); SwTwips nCellHeight - = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/infos/bounds"_ostr, "height"_ostr) - .toInt32(); + = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/infos/bounds", "height").toInt32(); SwRect aCellRect(Point(nCellLeft, nCellTop), Size(nCellWidth, nCellHeight)); pWrtShell->SelAll(); SwShellCursor* pShellCursor = pWrtShell->getShellCursor(/*bBlock=*/false); @@ -1253,10 +1199,9 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf123898) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Make sure that the arrow on the left is not there (the first portion's type is // PortionType::Arrow if it's there) - assertXPath( - pXmlDoc, - "/root/page/body/txt/anchored/fly/txt/SwParaPortion/SwLineLayout[1]/child::*[1]"_ostr, - "type"_ostr, u"PortionType::Text"_ustr); + assertXPath(pXmlDoc, + "/root/page/body/txt/anchored/fly/txt/SwParaPortion/SwLineLayout[1]/child::*[1]", + "type", u"PortionType::Text"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf123651) @@ -1266,7 +1211,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf123651) // Without the accompanying fix in place, this test would have failed with 'Expected: 7639; // Actual: 12926'. The shape was below the second "Lorem ipsum" text, not above it. const sal_Int32 nTopValue - = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds"_ostr, "top"_ostr).toInt32(); + = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "top").toInt32(); CPPUNIT_ASSERT_DOUBLES_EQUAL(7639, nTopValue, 10); } @@ -1313,9 +1258,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf118719) // Without the accompanying fix in place, this test would have failed, as the height of the // first page was 15840 twips, instead of the much smaller 276. xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - sal_Int32 nOther - = getXPath(pXmlDoc, "/root/page[1]/infos/bounds"_ostr, "height"_ostr).toInt32(); - sal_Int32 nLast = getXPath(pXmlDoc, "/root/page[2]/infos/bounds"_ostr, "height"_ostr).toInt32(); + sal_Int32 nOther = getXPath(pXmlDoc, "/root/page[1]/infos/bounds", "height").toInt32(); + sal_Int32 nLast = getXPath(pXmlDoc, "/root/page[2]/infos/bounds", "height").toInt32(); CPPUNIT_ASSERT_GREATER(nOther, nLast); } @@ -1327,7 +1271,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTabOverMargin) // 2nd paragraph has a tab over the right margin, and with the TabOverMargin compat option, // there is enough space to have all content in a single line. // Without the accompanying fix in place, this test would have failed, there were 2 lines. - assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout"_ostr, 1); + assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testImageComment) @@ -1471,8 +1415,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf64222) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout/" - "child::*[@type='PortionType::Number']/SwFont"_ostr, - "height"_ostr, u"560"_ustr); + "child::*[@type='PortionType::Number']/SwFont", + "height", u"560"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf113014) @@ -1490,12 +1434,9 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf113014) // This failed, if numbering of cell A1 is missing // (A1: left indent: 3 cm, first line indent: -3 cm // A2: left indent: 0 cm, first line indent: 0 cm) - assertXPathContent(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/textarray[1]/text"_ostr, - u"1."_ustr); - assertXPathContent(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/textarray[3]/text"_ostr, - u"2."_ustr); - assertXPathContent(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/textarray[5]/text"_ostr, - u"3."_ustr); + assertXPathContent(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/textarray[1]/text", u"1."); + assertXPathContent(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/textarray[3]/text", u"2."); + assertXPathContent(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/textarray[5]/text", u"3."); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf130218) @@ -1512,8 +1453,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf130218) CPPUNIT_ASSERT(pXmlDoc); // This failed, if hanging first line was hidden - assertXPathContent(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/textarray[1]/text"_ostr, - u"Text"_ustr); + assertXPathContent(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/textarray[1]/text", u"Text"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf127235) @@ -1530,22 +1470,21 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf138039) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // there are 3 pages - assertXPath(pXmlDoc, "/root/page"_ostr, 3); + assertXPath(pXmlDoc, "/root/page", 3); // table on first page - assertXPath(pXmlDoc, "/root/page[1]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 0); + assertXPath(pXmlDoc, "/root/page[1]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[1]/body/txt", 0); // paragraph with large fly on second page - assertXPath(pXmlDoc, "/root/page[2]/body/tab"_ostr, 0); - assertXPath(pXmlDoc, "/root/page[2]/body/txt"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds"_ostr, "top"_ostr, - u"17915"_ustr); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds"_ostr, - "height"_ostr, u"15819"_ustr); + assertXPath(pXmlDoc, "/root/page[2]/body/tab", 0); + assertXPath(pXmlDoc, "/root/page[2]/body/txt", 1); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly", 1); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "top", u"17915"); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "height", + u"15819"); // paragraph on third page - assertXPath(pXmlDoc, "/root/page[3]/body/tab"_ostr, 0); - assertXPath(pXmlDoc, "/root/page[3]/body/txt"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored"_ostr, 0); + assertXPath(pXmlDoc, "/root/page[3]/body/tab", 0); + assertXPath(pXmlDoc, "/root/page[3]/body/txt", 1); + assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored", 0); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf134298) @@ -1555,19 +1494,18 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf134298) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // there are 2 pages - assertXPath(pXmlDoc, "/root/page"_ostr, 2); + assertXPath(pXmlDoc, "/root/page", 2); // table and first para on first page - assertXPath(pXmlDoc, "/root/page[1]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored"_ostr, 0); + assertXPath(pXmlDoc, "/root/page[1]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[1]/body/txt", 1); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored", 0); // paragraph with large fly on second page - assertXPath(pXmlDoc, "/root/page[2]/body/tab"_ostr, 0); - assertXPath(pXmlDoc, "/root/page[2]/body/txt"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds"_ostr, "top"_ostr, - u"17897"_ustr); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds"_ostr, - "height"_ostr, u"15819"_ustr); + assertXPath(pXmlDoc, "/root/page[2]/body/tab", 0); + assertXPath(pXmlDoc, "/root/page[2]/body/txt", 1); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly", 1); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "top", u"17897"); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "height", + u"15819"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testShapeAllowOverlap) @@ -1688,7 +1626,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf124600) // - Actual : 2 // i.e. the last line in the body text had 2 lines, while it should have 1, as Word does (as the // fly frame does not intersect with the print area of the paragraph.) - assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout"_ostr, 1); + assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf124601) @@ -1704,8 +1642,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf124601) // - Actual : 3 // i.e. there was a separate endnote page, even when the ContinuousEndnotes compat option was // on. - assertXPath(pXmlDoc, "/root/page"_ostr, 2); - assertXPath(pXmlDoc, "/root/page[2]//ftncont"_ostr, 1); + assertXPath(pXmlDoc, "/root/page", 2); + assertXPath(pXmlDoc, "/root/page[2]//ftncont", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf124601b) @@ -1718,18 +1656,15 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf124601b) createSwDoc("tdf124601b.doc"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - sal_Int32 nFlyTop = getXPath(pXmlDoc, "//anchored/fly/infos/bounds"_ostr, "top"_ostr).toInt32(); - sal_Int32 nFlyLeft - = getXPath(pXmlDoc, "//anchored/fly/infos/bounds"_ostr, "left"_ostr).toInt32(); + sal_Int32 nFlyTop = getXPath(pXmlDoc, "//anchored/fly/infos/bounds", "top").toInt32(); + sal_Int32 nFlyLeft = getXPath(pXmlDoc, "//anchored/fly/infos/bounds", "left").toInt32(); sal_Int32 nFlyRight - = nFlyLeft + getXPath(pXmlDoc, "//anchored/fly/infos/bounds"_ostr, "width"_ostr).toInt32(); - sal_Int32 nSecondRowTop - = getXPath(pXmlDoc, "//tab/row[2]/infos/bounds"_ostr, "top"_ostr).toInt32(); + = nFlyLeft + getXPath(pXmlDoc, "//anchored/fly/infos/bounds", "width").toInt32(); + sal_Int32 nSecondRowTop = getXPath(pXmlDoc, "//tab/row[2]/infos/bounds", "top").toInt32(); sal_Int32 nLastCellLeft - = getXPath(pXmlDoc, "//tab/row[1]/cell[5]/infos/bounds"_ostr, "left"_ostr).toInt32(); + = getXPath(pXmlDoc, "//tab/row[1]/cell[5]/infos/bounds", "left").toInt32(); sal_Int32 nLastCellRight - = nLastCellLeft - + getXPath(pXmlDoc, "//tab/row[1]/cell[5]/infos/bounds"_ostr, "width"_ostr).toInt32(); + = nLastCellLeft + getXPath(pXmlDoc, "//tab/row[1]/cell[5]/infos/bounds", "width").toInt32(); // Without the accompanying fix in place, this test would have failed with: // - Expected greater than: 3736 // - Actual : 2852 @@ -1788,7 +1723,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf124770) // - Expected: 1 // - Actual : 2 // i.e. the italic string was broken into 2 lines, while Word kept it in a single line. - assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, 1); + assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testContinuousEndnotesInsertPageAtStart) @@ -1810,12 +1745,12 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testContinuousEndnotesInsertPageAtStart) // Make sure that the endnote is moved from the 2nd page to the 3rd one. xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page"_ostr, 3); + assertXPath(pXmlDoc, "/root/page", 3); // Without the accompanying fix in place, this test would have failed with: // - Expected: 1 // - Actual : 0 // i.e. the footnote container remained on page 2. - assertXPath(pXmlDoc, "/root/page[3]//ftncont"_ostr, 1); + assertXPath(pXmlDoc, "/root/page[3]//ftncont", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testContinuousEndnotesDeletePageAtStart) @@ -1841,8 +1776,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testContinuousEndnotesDeletePageAtStart) // - Expected: 1 // - Actual : 2 // i.e. the endnote remained on an (otherwise) empty 2nd page. - assertXPath(pXmlDoc, "/root/page"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[1]//ftncont"_ostr, 1); + assertXPath(pXmlDoc, "/root/page", 1); + assertXPath(pXmlDoc, "/root/page[1]//ftncont", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf128399) @@ -1895,13 +1830,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf156724) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // both pages have a tab frame and one footnote - assertXPath(pXmlDoc, "/root/page[1]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[1]/ftncont"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/ftncont"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/ftncont/ftn"_ostr, 1); - assertXPath(pXmlDoc, "/root/page"_ostr, 2); + assertXPath(pXmlDoc, "/root/page[1]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[1]/ftncont", 1); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn", 1); + assertXPath(pXmlDoc, "/root/page[2]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[2]/ftncont", 1); + assertXPath(pXmlDoc, "/root/page[2]/ftncont/ftn", 1); + assertXPath(pXmlDoc, "/root/page", 2); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testSectionUnhide) @@ -1910,7 +1845,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testSectionUnhide) { xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page/body/section/txt/infos/bounds[@height='0']"_ostr, 0); + assertXPath(pXmlDoc, "/root/page/body/section/txt/infos/bounds[@height='0']", 0); } // Hide the section @@ -1923,7 +1858,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testSectionUnhide) { xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page/body/section/txt/infos/bounds[@height='0']"_ostr, 4); + assertXPath(pXmlDoc, "/root/page/body/section/txt/infos/bounds[@height='0']", 4); } xSection->setPropertyValue(u"IsVisible"_ustr, css::uno::Any(true)); @@ -1932,7 +1867,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testSectionUnhide) { xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // the problem was that 3 of the text frames had 0 height because Format was skipped - assertXPath(pXmlDoc, "/root/page/body/section/txt/infos/bounds[@height='0']"_ostr, 0); + assertXPath(pXmlDoc, "/root/page/body/section/txt/infos/bounds[@height='0']", 0); } } @@ -1952,7 +1887,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testHiddenSectionFlys) // these are hidden by moving to invisible layer, they're still in layout { xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "//anchored/fly"_ostr, 6); + assertXPath(pXmlDoc, "//anchored/fly", 6); CPPUNIT_ASSERT_EQUAL(size_t(6), pDrawPage->GetObjCount()); for (int i = 0; i < 6; ++i) @@ -1971,7 +1906,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testHiddenSectionFlys) { xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "//anchored/fly"_ostr, 6); + assertXPath(pXmlDoc, "//anchored/fly", 6); CPPUNIT_ASSERT_EQUAL(size_t(6), pDrawPage->GetObjCount()); for (int i = 0; i < 6; ++i) @@ -1985,7 +1920,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testHiddenSectionFlys) { xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "//anchored/fly"_ostr, 6); + assertXPath(pXmlDoc, "//anchored/fly", 6); CPPUNIT_ASSERT_EQUAL(size_t(6), pDrawPage->GetObjCount()); for (int i = 0; i < 6; ++i) @@ -2011,26 +1946,21 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testHiddenSectionPageDescs) { xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page"_ostr, 2); - assertXPath(pXmlDoc, "/root/page[1]"_ostr, "formatName"_ostr, "Hotti"); - assertXPath(pXmlDoc, "/root/page[1]/body/section"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[1]/body/section[1]"_ostr, "formatName"_ostr, - u"Verfügung"_ustr); - assertXPath(pXmlDoc, "/root/page[2]/body/section"_ostr, 2); - assertXPath(pXmlDoc, "/root/page[2]/body/section[1]"_ostr, "formatName"_ostr, - u"Verfügung"_ustr); + assertXPath(pXmlDoc, "/root/page", 2); + assertXPath(pXmlDoc, "/root/page[1]", "formatName", u"Hotti"); + assertXPath(pXmlDoc, "/root/page[1]/body/section", 1); + assertXPath(pXmlDoc, "/root/page[1]/body/section[1]", "formatName", u"Verfügung"); + assertXPath(pXmlDoc, "/root/page[2]/body/section", 2); + assertXPath(pXmlDoc, "/root/page[2]/body/section[1]", "formatName", u"Verfügung"); // should be > 0, no idea why it's different on Windows #ifdef _WIN32 - assertXPath(pXmlDoc, "/root/page[2]/body/section[1]/infos/bounds"_ostr, "height"_ostr, - "552"); + assertXPath(pXmlDoc, "/root/page[2]/body/section[1]/infos/bounds", "height", u"552"); #else - assertXPath(pXmlDoc, "/root/page[2]/body/section[1]/infos/bounds"_ostr, "height"_ostr, - "532"); + assertXPath(pXmlDoc, "/root/page[2]/body/section[1]/infos/bounds", "height", u"532"); #endif - assertXPath(pXmlDoc, "/root/page[2]/body/section[2]"_ostr, "formatName"_ostr, - "Rueckantwort"); - assertXPath(pXmlDoc, "/root/page[2]/body/section[2]/infos/bounds"_ostr, "height"_ostr, "0"); - assertXPath(pXmlDoc, "/root/page[2]"_ostr, "formatName"_ostr, "Folgeseite"); + assertXPath(pXmlDoc, "/root/page[2]/body/section[2]", "formatName", u"Rueckantwort"); + assertXPath(pXmlDoc, "/root/page[2]/body/section[2]/infos/bounds", "height", u"0"); + assertXPath(pXmlDoc, "/root/page[2]", "formatName", u"Folgeseite"); } // toggle one section hidden and other visible @@ -2044,26 +1974,21 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testHiddenSectionPageDescs) // tdf#152919: Without the fix in place, this test would have failed with // - Expected: 3 // - Actual : 2 - assertXPath(pXmlDoc, "/root/page"_ostr, 3); - assertXPath(pXmlDoc, "/root/page[1]"_ostr, "formatName"_ostr, "Hotti"); - assertXPath(pXmlDoc, "/root/page[1]/body/section"_ostr, 2); - assertXPath(pXmlDoc, "/root/page[1]/body/section[1]"_ostr, "formatName"_ostr, - u"Verfügung"_ustr); - assertXPath(pXmlDoc, "/root/page[1]/body/section[2]"_ostr, "formatName"_ostr, - "Rueckantwort"); - assertXPath(pXmlDoc, "/root/page[2]"_ostr, "formatName"_ostr, "Empty Page"); - assertXPath(pXmlDoc, "/root/page[3]/body/section"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[3]/body/section[1]"_ostr, "formatName"_ostr, - "Rueckantwort"); + assertXPath(pXmlDoc, "/root/page", 3); + assertXPath(pXmlDoc, "/root/page[1]", "formatName", u"Hotti"); + assertXPath(pXmlDoc, "/root/page[1]/body/section", 2); + assertXPath(pXmlDoc, "/root/page[1]/body/section[1]", "formatName", u"Verfügung"); + assertXPath(pXmlDoc, "/root/page[1]/body/section[2]", "formatName", u"Rueckantwort"); + assertXPath(pXmlDoc, "/root/page[2]", "formatName", u"Empty Page"); + assertXPath(pXmlDoc, "/root/page[3]/body/section", 1); + assertXPath(pXmlDoc, "/root/page[3]/body/section[1]", "formatName", u"Rueckantwort"); // should be > 0, no idea why it's different on Windows #ifdef _WIN32 - assertXPath(pXmlDoc, "/root/page[3]/body/section[1]/infos/bounds"_ostr, "height"_ostr, - "552"); + assertXPath(pXmlDoc, "/root/page[3]/body/section[1]/infos/bounds", "height", u"552"); #else - assertXPath(pXmlDoc, "/root/page[3]/body/section[1]/infos/bounds"_ostr, "height"_ostr, - "532"); + assertXPath(pXmlDoc, "/root/page[3]/body/section[1]/infos/bounds", "height", u"532"); #endif - assertXPath(pXmlDoc, "/root/page[3]"_ostr, "formatName"_ostr, "RueckantwortRechts"); + assertXPath(pXmlDoc, "/root/page[3]", "formatName", u"RueckantwortRechts"); } // toggle one section hidden and other visible @@ -2073,26 +1998,21 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testHiddenSectionPageDescs) { xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page"_ostr, 2); - assertXPath(pXmlDoc, "/root/page[1]"_ostr, "formatName"_ostr, "Hotti"); - assertXPath(pXmlDoc, "/root/page[1]/body/section"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[1]/body/section[1]"_ostr, "formatName"_ostr, - u"Verfügung"_ustr); - assertXPath(pXmlDoc, "/root/page[2]/body/section"_ostr, 2); - assertXPath(pXmlDoc, "/root/page[2]/body/section[1]"_ostr, "formatName"_ostr, - u"Verfügung"_ustr); + assertXPath(pXmlDoc, "/root/page", 2); + assertXPath(pXmlDoc, "/root/page[1]", "formatName", u"Hotti"); + assertXPath(pXmlDoc, "/root/page[1]/body/section", 1); + assertXPath(pXmlDoc, "/root/page[1]/body/section[1]", "formatName", u"Verfügung"); + assertXPath(pXmlDoc, "/root/page[2]/body/section", 2); + assertXPath(pXmlDoc, "/root/page[2]/body/section[1]", "formatName", u"Verfügung"); // should be > 0, no idea why it's different on Windows #ifdef _WIN32 - assertXPath(pXmlDoc, "/root/page[2]/body/section[1]/infos/bounds"_ostr, "height"_ostr, - "552"); + assertXPath(pXmlDoc, "/root/page[2]/body/section[1]/infos/bounds", "height", u"552"); #else - assertXPath(pXmlDoc, "/root/page[2]/body/section[1]/infos/bounds"_ostr, "height"_ostr, - "532"); + assertXPath(pXmlDoc, "/root/page[2]/body/section[1]/infos/bounds", "height", u"532"); #endif - assertXPath(pXmlDoc, "/root/page[2]/body/section[2]"_ostr, "formatName"_ostr, - "Rueckantwort"); - assertXPath(pXmlDoc, "/root/page[2]/body/section[2]/infos/bounds"_ostr, "height"_ostr, "0"); - assertXPath(pXmlDoc, "/root/page[2]"_ostr, "formatName"_ostr, "Folgeseite"); + assertXPath(pXmlDoc, "/root/page[2]/body/section[2]", "formatName", u"Rueckantwort"); + assertXPath(pXmlDoc, "/root/page[2]/body/section[2]/infos/bounds", "height", u"0"); + assertXPath(pXmlDoc, "/root/page[2]", "formatName", u"Folgeseite"); } } @@ -2101,26 +2021,20 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf156725) createSwDoc("tdf156725.fodt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page"_ostr, 2); + assertXPath(pXmlDoc, "/root/page", 2); // the fly has 2 columns, the section in it has 2 columns, and is split // across the fly columns => 4 columns with 1 text frame each - assertXPath(pXmlDoc, "/root/page[2]/body/txt/anchored/fly/column"_ostr, 2); - assertXPath(pXmlDoc, "/root/page[2]/body/txt/anchored/fly/column[1]/body/section/column"_ostr, - 2); - assertXPath( - pXmlDoc, - "/root/page[2]/body/txt/anchored/fly/column[1]/body/section/column[1]/body/txt"_ostr, 1); - assertXPath( - pXmlDoc, - "/root/page[2]/body/txt/anchored/fly/column[1]/body/section/column[2]/body/txt"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[2]/body/txt/anchored/fly/column[2]/body/section/column"_ostr, - 2); - assertXPath( - pXmlDoc, - "/root/page[2]/body/txt/anchored/fly/column[2]/body/section/column[1]/body/txt"_ostr, 1); - assertXPath( - pXmlDoc, - "/root/page[2]/body/txt/anchored/fly/column[2]/body/section/column[2]/body/txt"_ostr, 1); + assertXPath(pXmlDoc, "/root/page[2]/body/txt/anchored/fly/column", 2); + assertXPath(pXmlDoc, "/root/page[2]/body/txt/anchored/fly/column[1]/body/section/column", 2); + assertXPath(pXmlDoc, + "/root/page[2]/body/txt/anchored/fly/column[1]/body/section/column[1]/body/txt", 1); + assertXPath(pXmlDoc, + "/root/page[2]/body/txt/anchored/fly/column[1]/body/section/column[2]/body/txt", 1); + assertXPath(pXmlDoc, "/root/page[2]/body/txt/anchored/fly/column[2]/body/section/column", 2); + assertXPath(pXmlDoc, + "/root/page[2]/body/txt/anchored/fly/column[2]/body/section/column[1]/body/txt", 1); + assertXPath(pXmlDoc, + "/root/page[2]/body/txt/anchored/fly/column[2]/body/section/column[2]/body/txt", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf156419) @@ -2128,23 +2042,17 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf156419) createSwDoc("linked_frames_section_bug.odt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page"_ostr, 2); + assertXPath(pXmlDoc, "/root/page", 2); // there are 2 flys on page 1, and 1 on page 2, all linked - assertXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/fly[1]/section/column"_ostr, 2); - assertXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/fly[1]/section/column[1]/body/txt"_ostr, - 11); - assertXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/fly[1]/section/column[2]/body/txt"_ostr, - 11); - assertXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/fly[2]/section/column"_ostr, 2); - assertXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/fly[2]/section/column[1]/body/txt"_ostr, - 12); - assertXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/fly[2]/section/column[2]/body/txt"_ostr, - 12); - assertXPath(pXmlDoc, "/root/page[2]/body/txt/anchored/fly[1]/section/column"_ostr, 2); - assertXPath(pXmlDoc, "/root/page[2]/body/txt/anchored/fly[1]/section/column[1]/body/txt"_ostr, - 2); - assertXPath(pXmlDoc, "/root/page[2]/body/txt/anchored/fly[1]/section/column[2]/body/txt"_ostr, - 1); + assertXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/fly[1]/section/column", 2); + assertXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/fly[1]/section/column[1]/body/txt", 11); + assertXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/fly[1]/section/column[2]/body/txt", 11); + assertXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/fly[2]/section/column", 2); + assertXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/fly[2]/section/column[1]/body/txt", 12); + assertXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/fly[2]/section/column[2]/body/txt", 12); + assertXPath(pXmlDoc, "/root/page[2]/body/txt/anchored/fly[1]/section/column", 2); + assertXPath(pXmlDoc, "/root/page[2]/body/txt/anchored/fly[1]/section/column[1]/body/txt", 2); + assertXPath(pXmlDoc, "/root/page[2]/body/txt/anchored/fly[1]/section/column[2]/body/txt", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf145826) @@ -2153,15 +2061,15 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf145826) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT(pXmlDoc); - assertXPath(pXmlDoc, "/root/page/body/section/column"_ostr, 2); + assertXPath(pXmlDoc, "/root/page/body/section/column", 2); // Without the fix in place, this test would have failed with // - Expected: 1 // - Actual : 0 - assertXPath(pXmlDoc, "/root/page/body/section/column[1]/ftncont"_ostr, 1); - assertXPath(pXmlDoc, "/root/page/body/section/column[2]/ftncont"_ostr, 1); - assertXPath(pXmlDoc, "/root/page/body/section/column[1]/ftncont/ftn"_ostr, 3); - assertXPath(pXmlDoc, "/root/page/body/section/column[2]/ftncont/ftn"_ostr, 3); + assertXPath(pXmlDoc, "/root/page/body/section/column[1]/ftncont", 1); + assertXPath(pXmlDoc, "/root/page/body/section/column[2]/ftncont", 1); + assertXPath(pXmlDoc, "/root/page/body/section/column[1]/ftncont/ftn", 3); + assertXPath(pXmlDoc, "/root/page/body/section/column[2]/ftncont/ftn", 3); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTable0HeightRows) @@ -2172,10 +2080,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTable0HeightRows) CPPUNIT_ASSERT(pXmlDoc); // the problem was that the table was erroneously split across 2 or 3 pages - assertXPath(pXmlDoc, "/root/page[1]/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page[1]/body/tab/row"_ostr, 28); - assertXPath(pXmlDoc, "/root/page[1]/body/tab/row/infos/bounds[@height='0']"_ostr, 25); - assertXPath(pXmlDoc, "/root/page"_ostr, 1); + assertXPath(pXmlDoc, "/root/page[1]/body/tab", 1); + assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 28); + assertXPath(pXmlDoc, "/root/page[1]/body/tab/row/infos/bounds[@height='0']", 25); + assertXPath(pXmlDoc, "/root/page", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf105481) @@ -2190,38 +2098,38 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf105481) SwTwips nTxtTop = getXPath(pXmlDoc, "/root/page/anchored/fly/txt[2]" - "/infos/bounds"_ostr, - "top"_ostr) + "/infos/bounds", + "top") .toInt32(); SwTwips nTxtBottom = nTxtTop + getXPath(pXmlDoc, "/root/page/anchored/fly/txt[2]" - "/infos/bounds"_ostr, - "height"_ostr) + "/infos/bounds", + "height") .toInt32(); SwTwips nFormula1Top = getXPath(pXmlDoc, "/root/page/anchored/fly/txt[2]" - "/anchored/fly[1]/infos/bounds"_ostr, - "top"_ostr) + "/anchored/fly[1]/infos/bounds", + "top") .toInt32(); SwTwips nFormula1Bottom = nFormula1Top + getXPath(pXmlDoc, "/root/page/anchored/fly/txt[2]" - "/anchored/fly[1]/infos/bounds"_ostr, - "height"_ostr) + "/anchored/fly[1]/infos/bounds", + "height") .toInt32(); SwTwips nFormula2Top = getXPath(pXmlDoc, "/root/page/anchored/fly/txt[2]" - "/anchored/fly[2]/infos/bounds"_ostr, - "top"_ostr) + "/anchored/fly[2]/infos/bounds", + "top") .toInt32(); SwTwips nFormula2Bottom = nFormula2Top + getXPath(pXmlDoc, "/root/page/anchored/fly/txt[2]" - "/anchored/fly[2]/infos/bounds"_ostr, - "height"_ostr) + "/anchored/fly[2]/infos/bounds", + "height") .toInt32(); // Ensure that the two formula positions are at least between top and bottom of the text frame. @@ -2249,8 +2157,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf117982) std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); MetafileXmlDump dumper; xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); - assertXPathContent(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/textarray[1]/text"_ostr, - u"FOO AAA"_ustr); + assertXPathContent(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/textarray[1]/text", u"FOO AAA"); //The first cell must be "FOO AAA". If not, this means the first cell content not visible in //the source document. } @@ -2266,20 +2173,17 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf128959) // first two lines of the paragraph in the split table cell on the first page // (these lines were completely lost) assertXPath( - pXmlDoc, - "/root/page[1]/body/tab[1]/row[1]/cell[1]/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, - "portion"_ostr, - u"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue "_ustr); + pXmlDoc, "/root/page[1]/body/tab[1]/row[1]/cell[1]/txt[1]/SwParaPortion/SwLineLayout[1]", + "portion", + u"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue "); assertXPath( - pXmlDoc, - "/root/page[1]/body/tab[1]/row[1]/cell[1]/txt[1]/SwParaPortion/SwLineLayout[2]"_ostr, - "portion"_ostr, - u"massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit "_ustr); + pXmlDoc, "/root/page[1]/body/tab[1]/row[1]/cell[1]/txt[1]/SwParaPortion/SwLineLayout[2]", + "portion", + u"massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit "); // last line of the paragraph in the split table cell on the second page - assertXPath( - pXmlDoc, - "/root/page[2]/body/tab[1]/row[1]/cell[1]/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, - "portion"_ostr, u"amet commodo magna eros quis urna."_ustr); + assertXPath(pXmlDoc, + "/root/page[2]/body/tab[1]/row[1]/cell[1]/txt[1]/SwParaPortion/SwLineLayout[1]", + "portion", u"amet commodo magna eros quis urna."); // Also check that the widow control for the paragraph is not turned off: sw::TableFrameFormats& rTableFormats = *pDocument->GetTableFrameFormats(); @@ -2308,7 +2212,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf121658) // Only 2 hyphenated words should appear in the document (in the lowercase words). // Uppercase words should not be hyphenated. - assertXPath(pXmlDoc, "//SwLineLayout/child::*[@type='PortionType::Hyphen']"_ostr, 2); + assertXPath(pXmlDoc, "//SwLineLayout/child::*[@type='PortionType::Hyphen']", 2); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf149420) @@ -2323,7 +2227,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf149420) // Only 3 hyphenated words should appear in the document (last paragraph // has got a 1 cm hyphenation zone, removing two hyphenations, which visible // in the second paragraph). - assertXPath(pXmlDoc, "//SwLineLayout/child::*[@type='PortionType::Hyphen']"_ostr, 8); + assertXPath(pXmlDoc, "//SwLineLayout/child::*[@type='PortionType::Hyphen']", 8); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf149324) @@ -2338,7 +2242,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf149324) // Only 3 hyphenated words should appear in the document (last paragraph // has got a 7-character word limit for hyphenation, removing the // hyphenation "ex-cept". - assertXPath(pXmlDoc, "//SwLineLayout/child::*[@type='PortionType::Hyphen']"_ostr, 3); + assertXPath(pXmlDoc, "//SwLineLayout/child::*[@type='PortionType::Hyphen']", 3); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf149248) @@ -2353,7 +2257,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf149248) // Only 1 hyphenated word should appear in the document (last word of the second // paragraph). Last word should not be hyphenated for the fourth paragraph // (the same paragraph, but with forbidden hyphenation of the last word). - assertXPath(pXmlDoc, "//SwLineLayout/child::*[@type='PortionType::Hyphen']"_ostr, 1); + assertXPath(pXmlDoc, "//SwLineLayout/child::*[@type='PortionType::Hyphen']", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testWriterImageNoCapture) @@ -2361,9 +2265,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testWriterImageNoCapture) createSwDoc("writer-image-no-capture.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); CPPUNIT_ASSERT(pXmlDoc); - sal_Int32 nPageLeft = getXPath(pXmlDoc, "//page/infos/bounds"_ostr, "left"_ostr).toInt32(); - sal_Int32 nImageLeft - = getXPath(pXmlDoc, "//anchored/fly/infos/bounds"_ostr, "left"_ostr).toInt32(); + sal_Int32 nPageLeft = getXPath(pXmlDoc, "//page/infos/bounds", "left").toInt32(); + sal_Int32 nImageLeft = getXPath(pXmlDoc, "//anchored/fly/infos/bounds", "left").toInt32(); // Without the accompanying fix in place, this test would have failed with: // - Expected less than: 284 // - Actual : 284 @@ -2424,25 +2327,21 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf134548) // Second paragraph has two non zero width tabs in beginning of line { OUString sNodeType = getXPath( - pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwFixPortion[1]"_ostr, - "type"_ostr); + pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwFixPortion[1]", "type"); CPPUNIT_ASSERT_EQUAL(u"PortionType::TabLeft"_ustr, sNodeType); sal_Int32 nWidth - = getXPath(pXmlDoc, - "/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwFixPortion[1]"_ostr, - "width"_ostr) + = getXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwFixPortion[1]", + "width") .toInt32(); CPPUNIT_ASSERT_GREATER(sal_Int32(0), nWidth); } { OUString sNodeType = getXPath( - pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwFixPortion[2]"_ostr, - "type"_ostr); + pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwFixPortion[2]", "type"); CPPUNIT_ASSERT_EQUAL(u"PortionType::TabLeft"_ustr, sNodeType); sal_Int32 nWidth - = getXPath(pXmlDoc, - "/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwFixPortion[2]"_ostr, - "width"_ostr) + = getXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwFixPortion[2]", + "width") .toInt32(); CPPUNIT_ASSERT_GREATER(sal_Int32(0), nWidth); } @@ -2453,20 +2352,18 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf124423) createSwDoc("tdf124423.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nFly1Width - = getXPath(pXmlDoc, "(//anchored/fly)[1]/infos/prtBounds"_ostr, "width"_ostr).toInt32(); + = getXPath(pXmlDoc, "(//anchored/fly)[1]/infos/prtBounds", "width").toInt32(); sal_Int32 nFly2Width - = getXPath(pXmlDoc, "(//anchored/fly)[2]/infos/prtBounds"_ostr, "width"_ostr).toInt32(); - sal_Int32 nPageWidth = getXPath(pXmlDoc, "//page/infos/prtBounds"_ostr, "width"_ostr).toInt32(); + = getXPath(pXmlDoc, "(//anchored/fly)[2]/infos/prtBounds", "width").toInt32(); + sal_Int32 nPageWidth = getXPath(pXmlDoc, "//page/infos/prtBounds", "width").toInt32(); CPPUNIT_ASSERT_EQUAL(nPageWidth, nFly2Width); CPPUNIT_ASSERT_LESS(nPageWidth / 2, nFly1Width); createSwDoc("tdf124423.odt"); pXmlDoc = parseLayoutDump(); - nFly1Width - = getXPath(pXmlDoc, "(//anchored/fly)[1]/infos/prtBounds"_ostr, "width"_ostr).toInt32(); - nFly2Width - = getXPath(pXmlDoc, "(//anchored/fly)[2]/infos/prtBounds"_ostr, "width"_ostr).toInt32(); - nPageWidth = getXPath(pXmlDoc, "//page/infos/prtBounds"_ostr, "width"_ostr).toInt32(); + nFly1Width = getXPath(pXmlDoc, "(//anchored/fly)[1]/infos/prtBounds", "width").toInt32(); + nFly2Width = getXPath(pXmlDoc, "(//anchored/fly)[2]/infos/prtBounds", "width").toInt32(); + nPageWidth = getXPath(pXmlDoc, "//page/infos/prtBounds", "width").toInt32(); CPPUNIT_ASSERT_LESS(nPageWidth / 2, nFly2Width); CPPUNIT_ASSERT_LESS(nPageWidth / 2, nFly1Width); } @@ -2522,11 +2419,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf138782) // - Expected less than: 13327 // - Actual : 14469 - CPPUNIT_ASSERT_LESS(getXPath(pXml, "/root/page/infos/bounds"_ostr, "right"_ostr).toInt32(), - getXPath(pXml, - "/root/page/body/txt[8]/anchored/SwAnchoredDrawObject/bounds"_ostr, - "right"_ostr) - .toInt32()); + CPPUNIT_ASSERT_LESS( + getXPath(pXml, "/root/page/infos/bounds", "right").toInt32(), + getXPath(pXml, "/root/page/body/txt[8]/anchored/SwAnchoredDrawObject/bounds", "right") + .toInt32()); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf135035) @@ -2534,26 +2430,22 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf135035) createSwDoc("tdf135035.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nFly1Width - = getXPath(pXmlDoc, "(//anchored/fly)[1]/infos/prtBounds"_ostr, "width"_ostr).toInt32(); + = getXPath(pXmlDoc, "(//anchored/fly)[1]/infos/prtBounds", "width").toInt32(); sal_Int32 nFly2Width - = getXPath(pXmlDoc, "(//anchored/fly)[2]/infos/prtBounds"_ostr, "width"_ostr).toInt32(); + = getXPath(pXmlDoc, "(//anchored/fly)[2]/infos/prtBounds", "width").toInt32(); sal_Int32 nFly3Width - = getXPath(pXmlDoc, "(//anchored/fly)[3]/infos/prtBounds"_ostr, "width"_ostr).toInt32(); - sal_Int32 nParentWidth - = getXPath(pXmlDoc, "(//txt)[1]/infos/prtBounds"_ostr, "width"_ostr).toInt32(); + = getXPath(pXmlDoc, "(//anchored/fly)[3]/infos/prtBounds", "width").toInt32(); + sal_Int32 nParentWidth = getXPath(pXmlDoc, "(//txt)[1]/infos/prtBounds", "width").toInt32(); CPPUNIT_ASSERT_EQUAL(nParentWidth, nFly2Width); CPPUNIT_ASSERT_EQUAL(nParentWidth, nFly3Width); CPPUNIT_ASSERT_LESS(nParentWidth / 2, nFly1Width); createSwDoc("tdf135035.odt"); pXmlDoc = parseLayoutDump(); - nFly1Width - = getXPath(pXmlDoc, "(//anchored/fly)[1]/infos/prtBounds"_ostr, "width"_ostr).toInt32(); - nFly2Width - = getXPath(pXmlDoc, "(//anchored/fly)[2]/infos/prtBounds"_ostr, "width"_ostr).toInt32(); - nFly3Width - = getXPath(pXmlDoc, "(//anchored/fly)[3]/infos/prtBounds"_ostr, "width"_ostr).toInt32(); - nParentWidth = getXPath(pXmlDoc, "(//txt)[1]/infos/prtBounds"_ostr, "width"_ostr).toInt32(); + nFly1Width = getXPath(pXmlDoc, "(//anchored/fly)[1]/infos/prtBounds", "width").toInt32(); + nFly2Width = getXPath(pXmlDoc, "(//anchored/fly)[2]/infos/prtBounds", "width").toInt32(); + nFly3Width = getXPath(pXmlDoc, "(//anchored/fly)[3]/infos/prtBounds", "width").toInt32(); + nParentWidth = getXPath(pXmlDoc, "(//txt)[1]/infos/prtBounds", "width").toInt32(); CPPUNIT_ASSERT_LESS(nParentWidth / 2, nFly2Width); CPPUNIT_ASSERT_LESS(nParentWidth / 2, nFly1Width); CPPUNIT_ASSERT_GREATER(nParentWidth, nFly3Width); @@ -2566,7 +2458,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf146704_EndnoteInSection) CPPUNIT_ASSERT(pDoc); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Without the fix, the endnote placed to 2. page - assertXPath(pXmlDoc, "/root/page"_ostr, 1); + assertXPath(pXmlDoc, "/root/page", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage) @@ -2580,7 +2472,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf139336_ColumnsWithFootnoteDoNotOccu // when writer import (from docx) the last section with columns, then it does not set // the evenly distributed settings, and this settings is required for the fix now, to // avoid some regression. - assertXPath(pXmlDoc, "/root/page"_ostr, 2); + assertXPath(pXmlDoc, "/root/page", 2); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage) @@ -2595,7 +2487,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf54465_ColumnsWithFootnoteDoNotOccup CPPUNIT_ASSERT(pDoc); Scheduler::ProcessEventsToIdle(); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "/root/page"_ostr); + xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "/root/page"); xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; CPPUNIT_ASSERT_GREATER(1, xmlXPathNodeSetGetLength(pXmlNodes)); xmlXPathFreeObject(pXmlObj); @@ -2604,7 +2496,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf54465_ColumnsWithFootnoteDoNotOccup pDoc = getSwDoc(); CPPUNIT_ASSERT(pDoc); pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page"_ostr, 1); + assertXPath(pXmlDoc, "/root/page", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf138124) @@ -2622,8 +2514,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf138124) // but an assertion in SwTextPainter::DrawTextLine would fail during paint. xmlDocUniquePtr pXml = parseLayoutDump(); - assertXPath(pXml, "/root/page"_ostr, 1); - assertXPath(pXml, "/root/page/ftncont/ftn/txt/anchored"_ostr, 1); + assertXPath(pXml, "/root/page", 1); + assertXPath(pXml, "/root/page/ftncont/ftn/txt/anchored", 1); // And finally, if there were no assertion in SwTextPainter::DrawTextLine, it would have // produced multiple lines with FootnoteNum portions, failing the following check like @@ -2631,10 +2523,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf138124) // - Actual : 49 assertXPath(pXml, - "/root/page/ftncont/ftn/txt//SwFieldPortion[@type='PortionType::FootnoteNum']"_ostr, - 1); - assertXPath(pXml, "/root/page/ftncont/ftn/txt//SwLinePortion[@type='PortionType::FlyCnt']"_ostr, - 1); + "/root/page/ftncont/ftn/txt//SwFieldPortion[@type='PortionType::FootnoteNum']", 1); + assertXPath(pXml, "/root/page/ftncont/ftn/txt//SwLinePortion[@type='PortionType::FlyCnt']", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf161348) @@ -2645,8 +2535,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf161348) // the floating table is on page 1 // apparently both parts of the split table are on this text frame - assertXPath(pXml, "/root/page[1]/body/txt[2]/anchored/fly"_ostr, 2); - assertXPath(pXml, "/root/page[1]/body/txt[2]/anchored/fly/tab"_ostr, 2); + assertXPath(pXml, "/root/page[1]/body/txt[2]/anchored/fly", 2); + assertXPath(pXml, "/root/page[1]/body/txt[2]/anchored/fly/tab", 2); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf154113) @@ -2682,13 +2572,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf154113) // Without the fix in place, this would fail with // - Expected: 3 // - Actual : 2 - assertXPath(pXml, "/root/page/body/section"_ostr, 3); - assertXPath(pXml, "/root/page/body/section[1]/txt/SwParaPortion/SwLineLayout"_ostr, - "portion"_ostr, u"<-- Start selection here. Section1"_ustr); - assertXPath(pXml, "/root/page/body/section[2]/txt/SwParaPortion/SwLineLayout"_ostr, - "portion"_ostr, u"Section2"_ustr); - assertXPath(pXml, "/root/page/body/section[3]/txt/SwParaPortion/SwLineLayout"_ostr, - "portion"_ostr, u"Section3. End selection here -->"_ustr); + assertXPath(pXml, "/root/page/body/section", 3); + assertXPath(pXml, "/root/page/body/section[1]/txt/SwParaPortion/SwLineLayout", "portion", + u"<-- Start selection here. Section1"); + assertXPath(pXml, "/root/page/body/section[2]/txt/SwParaPortion/SwLineLayout", "portion", + u"Section2"); + assertXPath(pXml, "/root/page/body/section[3]/txt/SwParaPortion/SwLineLayout", "portion", + u"Section3. End selection here -->"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf155611) @@ -2702,22 +2592,22 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf155611) // Check the layout: single page, two section frames (no section frames after the one for Inner // section), correct table structure and content in the first section frame, including nested // table in the last cell, and the last section text. - assertXPath(pXml, "/root/page"_ostr); + assertXPath(pXml, "/root/page"); // Without the fix in place, this would fail with // - Expected: 2 // - Actual : 3 - assertXPath(pXml, "/root/page/body/section"_ostr, 2); - assertXPath(pXml, "/root/page/body/section[1]/tab"_ostr); - assertXPath(pXml, "/root/page/body/section[1]/tab/row"_ostr); - assertXPath(pXml, "/root/page/body/section[1]/tab/row/cell"_ostr, 2); + assertXPath(pXml, "/root/page/body/section", 2); + assertXPath(pXml, "/root/page/body/section[1]/tab"); + assertXPath(pXml, "/root/page/body/section[1]/tab/row"); + assertXPath(pXml, "/root/page/body/section[1]/tab/row/cell", 2); assertXPath(pXml, "/root/page/body/section[1]/tab/row/cell[1]/txt/SwParaPortion/SwLineLayout/" - "SwParaPortion[@portion='foo']"_ostr); + "SwParaPortion[@portion='foo']"); assertXPath(pXml, "/root/page/body/section[1]/tab/row/cell[2]/txt/SwParaPortion/SwLineLayout/" - "SwParaPortion[@portion='bar']"_ostr); + "SwParaPortion[@portion='bar']"); assertXPath(pXml, "/root/page/body/section[1]/tab/row/cell[2]/tab/row/cell/txt/SwParaPortion/" - "SwLineLayout/SwParaPortion[@portion='baz']"_ostr); + "SwLineLayout/SwParaPortion[@portion='baz']"); assertXPath(pXml, "/root/page/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/" - "SwParaPortion[@portion='abc']"_ostr); + "SwParaPortion[@portion='abc']"); // Also must not crash on close because of a frame that accidentally fell off of the layout } @@ -2737,7 +2627,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf152307) // XML dump and some basic assertions sal_Int32 nPage = 7, nPages = 0; xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - nPages = countXPathNodes(pXmlDoc, "/root/page"_ostr); + nPages = countXPathNodes(pXmlDoc, "/root/page"); CPPUNIT_ASSERT_MESSAGE("tdf152307.odt / testTdf152307: Not enough pages.", nPage < nPages); assertXPath(pXmlDoc, "/root/page[" + OString::number(nPage) + "]/body/section", 1); @@ -2754,12 +2644,11 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf152307) "/root/page[" + OString::number(nPage) + "]/body/section/tab[" + OString::number(nTables) + "]/row[" + OString::number(nRowsLastTable) + "]/infos/bounds", - "bottom"_ostr) + "bottom") .toInt32(); // Where does the footer start (footer/info/bounds/top)? sal_Int32 nFooterTop - = getXPath(pXmlDoc, "/root/page[" + OString::number(nPage) + "]/footer/infos/bounds", - "top"_ostr) + = getXPath(pXmlDoc, "/root/page[" + OString::number(nPage) + "]/footer/infos/bounds", "top") .toInt32(); // Is the bottom value of the last row above the top value of the footer? OString aMsg = "tdf152307.odt / testTdf152307: Bottom value of last table row on page " @@ -2774,10 +2663,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf57187_Tdf158900) createSwDoc("space+break.fodt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Make sure there is only one page, one paragraph, and five lines - assertXPath(pXmlDoc, "/root/page"_ostr, 1); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion"_ostr, 1); + assertXPath(pXmlDoc, "/root/page", 1); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion", 1); // Without the fix in place, this would fail: there used to be 6 lines - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout"_ostr, 5); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout", 5); // tdf#57187: Check that relatively short lines have spaces not participating in layout. // First line has 11 spaces in the end, and then a manual line break. It is rather short: @@ -2785,45 +2674,42 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf57187_Tdf158900) // It uses the "first check if everything fits to line" return path in SwTextGuess::Guess. // Check that the spaces are put into a Hole portion, thus not participating in layout. // Without the fix, this would fail: there were only 2 portions, no Hole nor Margin portions. - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*"_ostr, 4); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*[1]"_ostr, "type"_ostr, - u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*[1]"_ostr, - "length"_ostr, u"11"_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*[2]"_ostr, "type"_ostr, - u"PortionType::Hole"_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*[2]"_ostr, - "length"_ostr, u"11"_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*[3]"_ostr, "type"_ostr, - u"PortionType::Break"_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*[4]"_ostr, "type"_ostr, - u"PortionType::Margin"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*", 4); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*[1]", "type", + u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*[1]", "length", u"11"); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*[2]", "type", + u"PortionType::Hole"); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*[2]", "length", u"11"); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*[3]", "type", + u"PortionType::Break"); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*[4]", "type", + u"PortionType::Margin"); // Second line has 101 spaces in the end, and then a manual line break. // It uses the "second check if everything fits to line" return path in SwTextGuess::Guess. // Check that the spaces are put into a Hole portion, thus not participating in layout. // Without the fix, this would fail: there were only 2 portions, no Hole portion. - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]/*"_ostr, 3); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]/*[1]"_ostr, "type"_ostr, - u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]/*[1]"_ostr, - "length"_ostr, u"11"_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]/*[2]"_ostr, "type"_ostr, - u"PortionType::Hole"_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]/*[2]"_ostr, - "length"_ostr, u"101"_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]/*[3]"_ostr, "type"_ostr, - u"PortionType::Break"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]/*", 3); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]/*[1]", "type", + u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]/*[1]", "length", u"11"); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]/*[2]", "type", + u"PortionType::Hole"); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]/*[2]", "length", + u"101"); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]/*[3]", "type", + u"PortionType::Break"); // tdf#158900: Check that the break after a long line with trailing spaces is kept on same line. // Without the fix in place, this would fail: the line had only 2 portions (text + hole), // and the break was on a separate third line - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[3]/*"_ostr, 3); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[3]/*[1]"_ostr, "type"_ostr, - u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[3]/*[2]"_ostr, "type"_ostr, - u"PortionType::Hole"_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[3]/*[3]"_ostr, "type"_ostr, - u"PortionType::Break"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[3]/*", 3); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[3]/*[1]", "type", + u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[3]/*[2]", "type", + u"PortionType::Hole"); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[3]/*[3]", "type", + u"PortionType::Break"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf147666) @@ -2835,10 +2721,9 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf147666) dispatchCommand(mxComponent, u".uno:GoDown"_ustr, {}); save(u"writer8"_ustr); - sal_Int32 nNonInsertedViewTop - = getXPathContent(parseExport(u"settings.xml"_ustr), - "//config:config-item[@config:name='ViewTop']"_ostr) - .toInt32(); + sal_Int32 nNonInsertedViewTop = getXPathContent(parseExport(u"settings.xml"_ustr), + "//config:config-item[@config:name='ViewTop']") + .toInt32(); // Insert image below the end of the paragraph on page one uno::Sequence<beans::PropertyValue> aArgs = { @@ -2847,10 +2732,9 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf147666) dispatchCommand(mxComponent, u".uno:InsertGraphic"_ustr, aArgs); save(u"writer8"_ustr); - sal_Int32 nInsertedViewTop - = getXPathContent(parseExport(u"settings.xml"_ustr), - "//config:config-item[@config:name='ViewTop']"_ostr) - .toInt32(); + sal_Int32 nInsertedViewTop = getXPathContent(parseExport(u"settings.xml"_ustr), + "//config:config-item[@config:name='ViewTop']") + .toInt32(); // Without the fix in place this will fail with // nInsertedViewTop = nNonInsertedViewTop @@ -2865,25 +2749,23 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf159050) createSwDoc("tdf159050-wrap-adjust.fodt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Make sure there is only one page, one anchored object, one paragraph, and two lines - assertXPath(pXmlDoc, "/root/page"_ostr, 1); - assertXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject"_ostr, 1); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion"_ostr, 1); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout"_ostr, 2); + assertXPath(pXmlDoc, "/root/page", 1); + assertXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject", 1); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion", 1); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout", 2); // Without the fix, this would fail: there was an unexpected second fly portion. - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*"_ostr, 4); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*[1]"_ostr, "type"_ostr, - u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*[1]"_ostr, - "length"_ostr, u"91"_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*[2]"_ostr, "type"_ostr, - u"PortionType::Hole"_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*[2]"_ostr, - "length"_ostr, u"1"_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*[3]"_ostr, "type"_ostr, - u"PortionType::Fly"_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*[4]"_ostr, "type"_ostr, - u"PortionType::Margin"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*", 4); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*[1]", "type", + u"PortionType::Text"); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*[1]", "length", u"91"); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*[2]", "type", + u"PortionType::Hole"); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*[2]", "length", u"1"); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*[3]", "type", + u"PortionType::Fly"); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/*[4]", "type", + u"PortionType::Margin"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf159271) @@ -2892,19 +2774,19 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf159271) createSwDoc("fld-in-tbl.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Make sure there is only one page, one table with one row and two cells, and one paragraph - assertXPath(pXmlDoc, "/root/page"_ostr, 1); - assertXPath(pXmlDoc, "/root/page/body/tab"_ostr, 1); - assertXPath(pXmlDoc, "/root/page/body/tab/row"_ostr, 1); - assertXPath(pXmlDoc, "/root/page/body/tab/row/cell"_ostr, 2); - assertXPath(pXmlDoc, "/root/page/body/txt"_ostr, 1); - assertXPath(pXmlDoc, "/root/page/body/tab/row/cell[2]/txt/SwParaPortion"_ostr, 1); + assertXPath(pXmlDoc, "/root/page", 1); + assertXPath(pXmlDoc, "/root/page/body/tab", 1); + assertXPath(pXmlDoc, "/root/page/body/tab/row", 1); + assertXPath(pXmlDoc, "/root/page/body/tab/row/cell", 2); + assertXPath(pXmlDoc, "/root/page/body/txt", 1); + assertXPath(pXmlDoc, "/root/page/body/tab/row/cell[2]/txt/SwParaPortion", 1); // Without the fix, this would fail: // - Expected: 1 // - Actual : 16 // - In <>, XPath '/root/page/body/tab/row/cell[2]/txt//SwLineLayout' number of nodes is incorrect - assertXPath(pXmlDoc, "/root/page/body/tab/row/cell[2]/txt//SwLineLayout"_ostr, 1); - assertXPath(pXmlDoc, "/root/page/body/tab/row/cell[2]/txt//SwFieldPortion"_ostr, 1); + assertXPath(pXmlDoc, "/root/page/body/tab/row/cell[2]/txt//SwLineLayout", 1); + assertXPath(pXmlDoc, "/root/page/body/tab/row/cell[2]/txt//SwFieldPortion", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf159259) @@ -2913,31 +2795,29 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf159259) createSwDoc("sdt+framePr.docx"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Make sure there is only one page and one paragraph with one line and one anchored object - assertXPath(pXmlDoc, "/root/page"_ostr, 1); + assertXPath(pXmlDoc, "/root/page", 1); // Without the fix, this would fail: there were two paragraphs - assertXPath(pXmlDoc, "/root/page/body/txt"_ostr, 1); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion"_ostr, 1); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout"_ostr, 1); + assertXPath(pXmlDoc, "/root/page/body/txt", 1); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion", 1); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout", 1); // Without the fix, this would fail: there was a field portion in the line - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, 0); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/SwFieldPortion", 0); // Without the fix, this would fail: there was no anchored objects - assertXPath(pXmlDoc, "/root/page/body/txt/anchored"_ostr, 1); - assertXPath(pXmlDoc, "/root/page/body/txt/anchored/fly"_ostr, 1); + assertXPath(pXmlDoc, "/root/page/body/txt/anchored", 1); + assertXPath(pXmlDoc, "/root/page/body/txt/anchored/fly", 1); const sal_Int32 paraRight - = getXPath(pXmlDoc, "/root/page/body/txt/infos/bounds"_ostr, "right"_ostr).toInt32(); + = getXPath(pXmlDoc, "/root/page/body/txt/infos/bounds", "right").toInt32(); const sal_Int32 paraHeight - = getXPath(pXmlDoc, "/root/page/body/txt/infos/bounds"_ostr, "height"_ostr).toInt32(); + = getXPath(pXmlDoc, "/root/page/body/txt/infos/bounds", "height").toInt32(); CPPUNIT_ASSERT_GREATER(sal_Int32(0), paraRight); CPPUNIT_ASSERT_GREATER(sal_Int32(0), paraHeight); const sal_Int32 flyRight - = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds"_ostr, "right"_ostr) - .toInt32(); + = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds", "right").toInt32(); const sal_Int32 flyHeight - = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds"_ostr, "height"_ostr) - .toInt32(); + = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds", "height").toInt32(); CPPUNIT_ASSERT_EQUAL(paraRight, flyRight); // The fly is right-aligned CPPUNIT_ASSERT_EQUAL(paraHeight, flyHeight); @@ -2949,11 +2829,11 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testLargeTopParaMarginAfterHiddenSection) createSwDoc("largeTopMarginAndHiddenFirstSection.fodt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // Make sure there is only one page and two sections, first hidden (zero-height) - assertXPath(pXmlDoc, "//page"_ostr, 1); - assertXPath(pXmlDoc, "//page/body/section"_ostr, 2); - assertXPath(pXmlDoc, "//page/body/section[1]/infos/bounds"_ostr, "height"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, "//page", 1); + assertXPath(pXmlDoc, "//page/body/section", 2); + assertXPath(pXmlDoc, "//page/body/section[1]/infos/bounds", "height", u"0"); // Check that the top margin (1 in = 1440 twip) is added to line height (12 pt = 240 twip) - assertXPath(pXmlDoc, "//page/body/section[2]/infos/bounds"_ostr, "height"_ostr, u"1680"_ustr); + assertXPath(pXmlDoc, "//page/body/section[2]/infos/bounds", "height", u"1680"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testPageBreakInHiddenSection) @@ -2961,26 +2841,26 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testPageBreakInHiddenSection) // Given a paragraph with page-break-before with page style and page number createSwDoc("pageBreakInHiddenSection.fodt"); xmlDocUniquePtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "//page"_ostr, 4); - assertXPath(pXmlDoc, "//section"_ostr, 4); - assertXPath(pXmlDoc, "//page[1]/body/txt"_ostr, 1); + assertXPath(pXmlDoc, "//page", 4); + assertXPath(pXmlDoc, "//section", 4); + assertXPath(pXmlDoc, "//page[1]/body/txt", 1); // The page break inside the hidden section is ignored (otherwise, there would be one section // on the first page) - assertXPath(pXmlDoc, "//page[1]/body/section"_ostr, 2); + assertXPath(pXmlDoc, "//page[1]/body/section", 2); // The first section is hidden - assertXPath(pXmlDoc, "//page[1]/body/section[1]/infos/bounds"_ostr, "height"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, "//page[1]/body/section[1]/infos/bounds", "height", u"0"); // Page 2 is empty even page (generated by the next page's section with page-break-before) - assertXPath(pXmlDoc, "//page[2]/body"_ostr, 0); + assertXPath(pXmlDoc, "//page[2]/body", 0); // The section on page 3 is not hidden, only text in it is, therefore its page break works - assertXPath(pXmlDoc, "//page[3]/body/section"_ostr, 1); - assertXPath(pXmlDoc, "//page[3]/body/section/infos/bounds"_ostr, "height"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, "//page[3]/body/section", 1); + assertXPath(pXmlDoc, "//page[3]/body/section/infos/bounds", "height", u"0"); // The section on page 4 is hidden, thus page break in it is ignored (no further pages, where // the section would be moved to otherwise) - assertXPath(pXmlDoc, "//page[4]/body/section"_ostr, 1); - assertXPath(pXmlDoc, "//page[4]/body/section/infos/bounds"_ostr, "height"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, "//page[4]/body/section", 1); + assertXPath(pXmlDoc, "//page[4]/body/section/infos/bounds", "height", u"0"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf159443) @@ -3001,16 +2881,16 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf159443) //// - In <>, XPath contents of child does not match assertXPathContent( pXmlDoc, - "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/push[47]/textarray/text"_ostr, - u"DataSeries1"_ustr); + "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/push[47]/textarray/text", + u"DataSeries1"); assertXPathContent( pXmlDoc, - "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/push[49]/textarray/text"_ostr, - u"Category1"_ustr); + "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/push[49]/textarray/text", + u"Category1"); assertXPathContent( pXmlDoc, - "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/push[51]/textarray/text"_ostr, - u"4.3"_ustr); + "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/push[51]/textarray/text", + u"4.3"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf159422) @@ -3029,26 +2909,23 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf159422) //// - Expected: 5877 //// - Actual : 5649 //// - Delta : 20 - sal_Int32 nYSymbol1 - = getXPath( - pXmlDoc, - "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/push[99]/polypolygon/polygon/point[1]"_ostr, - "y"_ostr) - .toInt32(); + sal_Int32 nYSymbol1 = getXPath(pXmlDoc, + "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/" + "push[1]/push[99]/polypolygon/polygon/point[1]", + "y") + .toInt32(); CPPUNIT_ASSERT_DOUBLES_EQUAL(5877, nYSymbol1, 20); - sal_Int32 nYSymbol2 - = getXPath( - pXmlDoc, - "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/push[100]/polypolygon/polygon/point[1]"_ostr, - "y"_ostr) - .toInt32(); + sal_Int32 nYSymbol2 = getXPath(pXmlDoc, + "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/" + "push[1]/push[100]/polypolygon/polygon/point[1]", + "y") + .toInt32(); CPPUNIT_ASSERT_DOUBLES_EQUAL(6225, nYSymbol2, 20); - sal_Int32 nYSymbol3 - = getXPath( - pXmlDoc, - "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/push[101]/polypolygon/polygon/point[1]"_ostr, - "y"_ostr) - .toInt32(); + sal_Int32 nYSymbol3 = getXPath(pXmlDoc, + "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/" + "push[1]/push[101]/polypolygon/polygon/point[1]", + "y") + .toInt32(); CPPUNIT_ASSERT_DOUBLES_EQUAL(6573, nYSymbol3, 20); } @@ -3067,14 +2944,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf159456) //// - Expected: 1 //// - Actual : 1.5 //// - In <>, XPath contents of child does not match - assertXPathContent( - pXmlDoc, - "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/push[103]/textarray/text"_ostr, - u"1"_ustr); - assertXPathContent( - pXmlDoc, - "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/push[104]/textarray/text"_ostr, - u"2"_ustr); + assertXPathContent(pXmlDoc, + "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/" + "push[103]/textarray/text", + u"1"); + assertXPathContent(pXmlDoc, + "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/" + "push[104]/textarray/text", + u"2"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, test_i84870) @@ -3103,7 +2980,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf160526) // It must move to the next page CPPUNIT_ASSERT_EQUAL(2, getPages()); auto pExportDump = parseLayoutDump(); - assertXPath(pExportDump, "//page[2]/body/txt/anchored/SwAnchoredDrawObject"_ostr); + assertXPath(pExportDump, "//page[2]/body/txt/anchored/SwAnchoredDrawObject"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf160958_page_break) @@ -3111,23 +2988,23 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf160958_page_break) // Given a document with a section with the first paragraph having a page break createSwDoc("tdf160958_page_break.fodt"); auto pExportDump = parseLayoutDump(); - assertXPath(pExportDump, "//page"_ostr, 2); + assertXPath(pExportDump, "//page", 2); // A single paragraph on the first page, with 6 lines - assertXPath(pExportDump, "//page[1]/body/txt"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt/SwParaPortion/SwLineLayout"_ostr, 6); + assertXPath(pExportDump, "//page[1]/body/txt", 1); + assertXPath(pExportDump, "//page[1]/body/txt/SwParaPortion/SwLineLayout", 6); // A section with 7 paragraphs, and two more paragraphs after the section - assertXPath(pExportDump, "//page[2]/body/section"_ostr, 1); - assertXPath(pExportDump, "//page[2]/body/section/txt"_ostr, 7); - assertXPath(pExportDump, "//page[2]/body/section/txt[1]/SwParaPortion"_ostr, 0); - assertXPath(pExportDump, "//page[2]/body/section/txt[2]/SwParaPortion"_ostr, 0); - assertXPath(pExportDump, "//page[2]/body/section/txt[3]/SwParaPortion"_ostr, 0); - assertXPath(pExportDump, "//page[2]/body/section/txt[4]/SwParaPortion/SwLineLayout"_ostr, 5); - assertXPath(pExportDump, "//page[2]/body/section/txt[5]/SwParaPortion"_ostr, 0); - assertXPath(pExportDump, "//page[2]/body/section/txt[6]/SwParaPortion"_ostr, 0); - assertXPath(pExportDump, "//page[2]/body/section/txt[7]/SwParaPortion"_ostr, 0); - assertXPath(pExportDump, "//page[2]/body/txt"_ostr, 2); - assertXPath(pExportDump, "//page[2]/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, 7); - assertXPath(pExportDump, "//page[2]/body/txt[2]/SwParaPortion"_ostr, 0); + assertXPath(pExportDump, "//page[2]/body/section", 1); + assertXPath(pExportDump, "//page[2]/body/section/txt", 7); + assertXPath(pExportDump, "//page[2]/body/section/txt[1]/SwParaPortion", 0); + assertXPath(pExportDump, "//page[2]/body/section/txt[2]/SwParaPortion", 0); + assertXPath(pExportDump, "//page[2]/body/section/txt[3]/SwParaPortion", 0); + assertXPath(pExportDump, "//page[2]/body/section/txt[4]/SwParaPortion/SwLineLayout", 5); + assertXPath(pExportDump, "//page[2]/body/section/txt[5]/SwParaPortion", 0); + assertXPath(pExportDump, "//page[2]/body/section/txt[6]/SwParaPortion", 0); + assertXPath(pExportDump, "//page[2]/body/section/txt[7]/SwParaPortion", 0); + assertXPath(pExportDump, "//page[2]/body/txt", 2); + assertXPath(pExportDump, "//page[2]/body/txt[1]/SwParaPortion/SwLineLayout", 7); + assertXPath(pExportDump, "//page[2]/body/txt[2]/SwParaPortion", 0); // Hide the section auto xTextSectionsSupplier = mxComponent.queryThrow<css::text::XTextSectionsSupplier>(); @@ -3138,24 +3015,24 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf160958_page_break) calcLayout(); pExportDump = parseLayoutDump(); - assertXPath(pExportDump, "//page"_ostr, 1); + assertXPath(pExportDump, "//page", 1); // Three paragraphs and a hidden section on the first page - assertXPath(pExportDump, "//page/body/txt"_ostr, 3); - assertXPath(pExportDump, "//page/body/section"_ostr, 1); - - assertXPath(pExportDump, "//page/body/section/infos/bounds"_ostr, "height"_ostr, u"0"_ustr); - assertXPath(pExportDump, "//page/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, 6); - assertXPath(pExportDump, "//page/body/section/txt"_ostr, 7); - assertXPath(pExportDump, "//page/body/section/txt[1]/SwParaPortion"_ostr, 0); - assertXPath(pExportDump, "//page/body/section/txt[2]/SwParaPortion"_ostr, 0); - assertXPath(pExportDump, "//page/body/section/txt[3]/SwParaPortion"_ostr, 0); - assertXPath(pExportDump, "//page/body/section/txt[4]/SwParaPortion"_ostr, 0); - assertXPath(pExportDump, "//page/body/section/txt[5]/SwParaPortion"_ostr, 0); - assertXPath(pExportDump, "//page/body/section/txt[6]/SwParaPortion"_ostr, 0); - assertXPath(pExportDump, "//page/body/section/txt[7]/SwParaPortion"_ostr, 0); - - assertXPath(pExportDump, "//page/body/txt[2]/SwParaPortion/SwLineLayout"_ostr, 7); - assertXPath(pExportDump, "//page/body/txt[3]/SwParaPortion"_ostr, 0); + assertXPath(pExportDump, "//page/body/txt", 3); + assertXPath(pExportDump, "//page/body/section", 1); + + assertXPath(pExportDump, "//page/body/section/infos/bounds", "height", u"0"); + assertXPath(pExportDump, "//page/body/txt[1]/SwParaPortion/SwLineLayout", 6); + assertXPath(pExportDump, "//page/body/section/txt", 7); + assertXPath(pExportDump, "//page/body/section/txt[1]/SwParaPortion", 0); + assertXPath(pExportDump, "//page/body/section/txt[2]/SwParaPortion", 0); + assertXPath(pExportDump, "//page/body/section/txt[3]/SwParaPortion", 0); + assertXPath(pExportDump, "//page/body/section/txt[4]/SwParaPortion", 0); + assertXPath(pExportDump, "//page/body/section/txt[5]/SwParaPortion", 0); + assertXPath(pExportDump, "//page/body/section/txt[6]/SwParaPortion", 0); + assertXPath(pExportDump, "//page/body/section/txt[7]/SwParaPortion", 0); + + assertXPath(pExportDump, "//page/body/txt[2]/SwParaPortion/SwLineLayout", 7); + assertXPath(pExportDump, "//page/body/txt[3]/SwParaPortion", 0); // Show the section again xSection->setPropertyValue(u"IsVisible"_ustr, css::uno::Any(true)); @@ -3163,21 +3040,21 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf160958_page_break) // Check that the layout has been restored calcLayout(); pExportDump = parseLayoutDump(); - assertXPath(pExportDump, "//page"_ostr, 2); - assertXPath(pExportDump, "//page[1]/body/txt"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt/SwParaPortion/SwLineLayout"_ostr, 6); - assertXPath(pExportDump, "//page[2]/body/section"_ostr, 1); - assertXPath(pExportDump, "//page[2]/body/section/txt"_ostr, 7); - assertXPath(pExportDump, "//page[2]/body/section/txt[1]/SwParaPortion"_ostr, 0); - assertXPath(pExportDump, "//page[2]/body/section/txt[2]/SwParaPortion"_ostr, 0); - assertXPath(pExportDump, "//page[2]/body/section/txt[3]/SwParaPortion"_ostr, 0); - assertXPath(pExportDump, "//page[2]/body/section/txt[4]/SwParaPortion/SwLineLayout"_ostr, 5); - assertXPath(pExportDump, "//page[2]/body/section/txt[5]/SwParaPortion"_ostr, 0); - assertXPath(pExportDump, "//page[2]/body/section/txt[6]/SwParaPortion"_ostr, 0); - assertXPath(pExportDump, "//page[2]/body/section/txt[7]/SwParaPortion"_ostr, 0); - assertXPath(pExportDump, "//page[2]/body/txt"_ostr, 2); - assertXPath(pExportDump, "//page[2]/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, 7); - assertXPath(pExportDump, "//page[2]/body/txt[2]/SwParaPortion"_ostr, 0); + assertXPath(pExportDump, "//page", 2); + assertXPath(pExportDump, "//page[1]/body/txt", 1); + assertXPath(pExportDump, "//page[1]/body/txt/SwParaPortion/SwLineLayout", 6); + assertXPath(pExportDump, "//page[2]/body/section", 1); + assertXPath(pExportDump, "//page[2]/body/section/txt", 7); + assertXPath(pExportDump, "//page[2]/body/section/txt[1]/SwParaPortion", 0); + assertXPath(pExportDump, "//page[2]/body/section/txt[2]/SwParaPortion", 0); + assertXPath(pExportDump, "//page[2]/body/section/txt[3]/SwParaPortion", 0); + assertXPath(pExportDump, "//page[2]/body/section/txt[4]/SwParaPortion/SwLineLayout", 5); + assertXPath(pExportDump, "//page[2]/body/section/txt[5]/SwParaPortion", 0); + assertXPath(pExportDump, "//page[2]/body/section/txt[6]/SwParaPortion", 0); + assertXPath(pExportDump, "//page[2]/body/section/txt[7]/SwParaPortion", 0); + assertXPath(pExportDump, "//page[2]/body/txt", 2); + assertXPath(pExportDump, "//page[2]/body/txt[1]/SwParaPortion/SwLineLayout", 7); + assertXPath(pExportDump, "//page[2]/body/txt[2]/SwParaPortion", 0); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf160958_orphans) @@ -3185,38 +3062,38 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf160958_orphans) // Given a document with a section which moves to the next page as a whole, because of orphans createSwDoc("tdf160958_orphans_move_section.fodt"); auto pExportDump = parseLayoutDump(); - assertXPath(pExportDump, "//page"_ostr, 2); + assertXPath(pExportDump, "//page", 2); // 21 paragraphs on the first page - assertXPath(pExportDump, "//page[1]/body/txt"_ostr, 21); - assertXPath(pExportDump, "//page[1]/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, 6); - assertXPath(pExportDump, "//page[1]/body/txt[2]/SwParaPortion/SwLineLayout"_ostr, 5); - assertXPath(pExportDump, "//page[1]/body/txt[3]/SwParaPortion/SwLineLayout"_ostr, 7); - assertXPath(pExportDump, "//page[1]/body/txt[4]/SwParaPortion/SwLineLayout"_ostr, 16); - assertXPath(pExportDump, "//page[1]/body/txt[5]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[6]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[7]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[8]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[9]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[10]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[11]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[12]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[13]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[14]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[15]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[16]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[17]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[18]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[19]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[20]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[21]/SwParaPortion/SwLineLayout"_ostr, 1); + assertXPath(pExportDump, "//page[1]/body/txt", 21); + assertXPath(pExportDump, "//page[1]/body/txt[1]/SwParaPortion/SwLineLayout", 6); + assertXPath(pExportDump, "//page[1]/body/txt[2]/SwParaPortion/SwLineLayout", 5); + assertXPath(pExportDump, "//page[1]/body/txt[3]/SwParaPortion/SwLineLayout", 7); + assertXPath(pExportDump, "//page[1]/body/txt[4]/SwParaPortion/SwLineLayout", 16); + assertXPath(pExportDump, "//page[1]/body/txt[5]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[6]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[7]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[8]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[9]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[10]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[11]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[12]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[13]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[14]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[15]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[16]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[17]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[18]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[19]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[20]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[21]/SwParaPortion/SwLineLayout", 1); // A section and one more paragraph after the section - assertXPath(pExportDump, "//page[2]/body/section"_ostr, 1); - assertXPath(pExportDump, "//page[2]/body/section/txt"_ostr, 3); - assertXPath(pExportDump, "//page[2]/body/section/txt[1]/SwParaPortion/SwLineLayout"_ostr, 6); - assertXPath(pExportDump, "//page[2]/body/section/txt[2]/SwParaPortion/SwLineLayout"_ostr, 5); - assertXPath(pExportDump, "//page[2]/body/section/txt[3]/SwParaPortion/SwLineLayout"_ostr, 7); - assertXPath(pExportDump, "//page[2]/body/txt"_ostr, 1); - assertXPath(pExportDump, "//page[2]/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, 1); + assertXPath(pExportDump, "//page[2]/body/section", 1); + assertXPath(pExportDump, "//page[2]/body/section/txt", 3); + assertXPath(pExportDump, "//page[2]/body/section/txt[1]/SwParaPortion/SwLineLayout", 6); + assertXPath(pExportDump, "//page[2]/body/section/txt[2]/SwParaPortion/SwLineLayout", 5); + assertXPath(pExportDump, "//page[2]/body/section/txt[3]/SwParaPortion/SwLineLayout", 7); + assertXPath(pExportDump, "//page[2]/body/txt", 1); + assertXPath(pExportDump, "//page[2]/body/txt[1]/SwParaPortion/SwLineLayout", 1); // Hide the section auto xTextSectionsSupplier = mxComponent.queryThrow<css::text::XTextSectionsSupplier>(); @@ -3227,10 +3104,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf160958_orphans) calcLayout(); pExportDump = parseLayoutDump(); - assertXPath(pExportDump, "//page"_ostr, 1); - assertXPath(pExportDump, "//page/body/txt"_ostr, 22); - assertXPath(pExportDump, "//page/body/section"_ostr, 1); - assertXPath(pExportDump, "//page/body/section/infos/bounds"_ostr, "height"_ostr, u"0"_ustr); + assertXPath(pExportDump, "//page", 1); + assertXPath(pExportDump, "//page/body/txt", 22); + assertXPath(pExportDump, "//page/body/section", 1); + assertXPath(pExportDump, "//page/body/section/infos/bounds", "height", u"0"); // Show the section again xSection->setPropertyValue(u"IsVisible"_ustr, css::uno::Any(true)); @@ -3238,36 +3115,36 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf160958_orphans) // Check that the layout has been restored calcLayout(); pExportDump = parseLayoutDump(); - assertXPath(pExportDump, "//page"_ostr, 2); - assertXPath(pExportDump, "//page[1]/body/txt"_ostr, 21); - assertXPath(pExportDump, "//page[1]/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, 6); - assertXPath(pExportDump, "//page[1]/body/txt[2]/SwParaPortion/SwLineLayout"_ostr, 5); - assertXPath(pExportDump, "//page[1]/body/txt[3]/SwParaPortion/SwLineLayout"_ostr, 7); - assertXPath(pExportDump, "//page[1]/body/txt[4]/SwParaPortion/SwLineLayout"_ostr, 16); - assertXPath(pExportDump, "//page[1]/body/txt[5]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[6]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[7]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[8]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[9]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[10]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[11]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[12]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[13]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[14]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[15]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[16]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[17]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[18]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[19]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[20]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[21]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[2]/body/section"_ostr, 1); - assertXPath(pExportDump, "//page[2]/body/section/txt"_ostr, 3); - assertXPath(pExportDump, "//page[2]/body/section/txt[1]/SwParaPortion/SwLineLayout"_ostr, 6); - assertXPath(pExportDump, "//page[2]/body/section/txt[2]/SwParaPortion/SwLineLayout"_ostr, 5); - assertXPath(pExportDump, "//page[2]/body/section/txt[3]/SwParaPortion/SwLineLayout"_ostr, 7); - assertXPath(pExportDump, "//page[2]/body/txt"_ostr, 1); - assertXPath(pExportDump, "//page[2]/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, 1); + assertXPath(pExportDump, "//page", 2); + assertXPath(pExportDump, "//page[1]/body/txt", 21); + assertXPath(pExportDump, "//page[1]/body/txt[1]/SwParaPortion/SwLineLayout", 6); + assertXPath(pExportDump, "//page[1]/body/txt[2]/SwParaPortion/SwLineLayout", 5); + assertXPath(pExportDump, "//page[1]/body/txt[3]/SwParaPortion/SwLineLayout", 7); + assertXPath(pExportDump, "//page[1]/body/txt[4]/SwParaPortion/SwLineLayout", 16); + assertXPath(pExportDump, "//page[1]/body/txt[5]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[6]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[7]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[8]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[9]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[10]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[11]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[12]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[13]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[14]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[15]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[16]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[17]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[18]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[19]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[20]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[21]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[2]/body/section", 1); + assertXPath(pExportDump, "//page[2]/body/section/txt", 3); + assertXPath(pExportDump, "//page[2]/body/section/txt[1]/SwParaPortion/SwLineLayout", 6); + assertXPath(pExportDump, "//page[2]/body/section/txt[2]/SwParaPortion/SwLineLayout", 5); + assertXPath(pExportDump, "//page[2]/body/section/txt[3]/SwParaPortion/SwLineLayout", 7); + assertXPath(pExportDump, "//page[2]/body/txt", 1); + assertXPath(pExportDump, "//page[2]/body/txt[1]/SwParaPortion/SwLineLayout", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf161368) @@ -3277,11 +3154,11 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf161368) auto pExportDump = parseLayoutDump(); // one page, three paragraphs, each one line (it was four pages, each paragraph split into // tens of short (<= 4 mm wide) lines) - assertXPath(pExportDump, "//page"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt"_ostr, 3); - assertXPath(pExportDump, "//page[1]/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[2]/SwParaPortion/SwLineLayout"_ostr, 1); - assertXPath(pExportDump, "//page[1]/body/txt[3]/SwParaPortion/SwLineLayout"_ostr, 1); + assertXPath(pExportDump, "//page", 1); + assertXPath(pExportDump, "//page[1]/body/txt", 3); + assertXPath(pExportDump, "//page[1]/body/txt[1]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[2]/SwParaPortion/SwLineLayout", 1); + assertXPath(pExportDump, "//page[1]/body/txt[3]/SwParaPortion/SwLineLayout", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestCrashHyphenation) @@ -3296,8 +3173,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf161508) createSwDoc("tdf161508.fodt"); auto pExportDump = parseLayoutDump(); // The table must move completely to the second page - assertXPath(pExportDump, "//page[1]/body/tab"_ostr, 0); - assertXPath(pExportDump, "//page[2]/body/tab"_ostr, 1); + assertXPath(pExportDump, "//page[1]/body/tab", 0); + assertXPath(pExportDump, "//page[2]/body/tab", 1); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf92091) @@ -3307,43 +3184,39 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf92091) auto pXmlDoc = parseLayoutDump(); sal_Int32 nLayoutWidth - = getXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, - "width"_ostr) + = getXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout", "width") .toInt32(); CPPUNIT_ASSERT_GREATER(sal_Int32(3210), nLayoutWidth); sal_Int32 nPor1Width - = getXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, - "width"_ostr) + = getXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", + "width") .toInt32(); CPPUNIT_ASSERT_GREATER(sal_Int32(55), nPor1Width); sal_Int32 nPor2Width = getXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, - "width"_ostr) + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", + "width") .toInt32(); CPPUNIT_ASSERT_GREATER(sal_Int32(75), nPor2Width); sal_Int32 nPor3Width - = getXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, - "width"_ostr) + = getXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", + "width") .toInt32(); CPPUNIT_ASSERT_GREATER(sal_Int32(2870), nPor3Width); sal_Int32 nPor4Width = getXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr, - "width"_ostr) + "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]", + "width") .toInt32(); CPPUNIT_ASSERT_GREATER(sal_Int32(75), nPor4Width); sal_Int32 nPor5Width - = getXPath(pXmlDoc, - "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, - "width"_ostr) + = getXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]", + "width") .toInt32(); CPPUNIT_ASSERT_GREATER(sal_Int32(110), nPor5Width); } @@ -3354,14 +3227,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf104209VertLTR) createSwDoc("tdf107209-vert-ltr.fodt"); auto pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "//page"_ostr, 2); + assertXPath(pXmlDoc, "//page", 2); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout"_ostr, - "portion"_ostr, u"AAAAAAAAAAAAAAAAAAA"_ustr); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, - "portion"_ostr, u"BBBBBBBBBBBBBBBBBBBBBB"_ustr); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/SwParaPortion/SwLineLayout[2]"_ostr, - "portion"_ostr, u"B"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout", "portion", + u"AAAAAAAAAAAAAAAAAAA"); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/SwParaPortion/SwLineLayout[1]", "portion", + u"BBBBBBBBBBBBBBBBBBBBBB"); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/SwParaPortion/SwLineLayout[2]", "portion", + u"B"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf104209VertRTL) @@ -3370,14 +3243,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf104209VertRTL) createSwDoc("tdf107209-vert-rtl.fodt"); auto pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "//page"_ostr, 2); + assertXPath(pXmlDoc, "//page", 2); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout"_ostr, - "portion"_ostr, u"AAAAAAAAAAAAAAAAAAA"_ustr); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, - "portion"_ostr, u"BBBBBBBBBBBBBBBBBBBBBB"_ustr); - assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/SwParaPortion/SwLineLayout[2]"_ostr, - "portion"_ostr, u"B"_ustr); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout", "portion", + u"AAAAAAAAAAAAAAAAAAA"); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/SwParaPortion/SwLineLayout[1]", "portion", + u"BBBBBBBBBBBBBBBBBBBBBB"); + assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/SwParaPortion/SwLineLayout[2]", "portion", + u"B"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf56408LTR) @@ -3386,12 +3259,12 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf56408LTR) createSwDoc("tdf56408-ltr.fodt"); auto pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "//page"_ostr, 1); + assertXPath(pXmlDoc, "//page", 1); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]"_ostr, "portion"_ostr, - u"English English English "_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]"_ostr, "portion"_ostr, - u"((((עברית)))) English"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]", "portion", + u"English English English "); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]", "portion", + u"((((עברית)))) English"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf56408RTL) @@ -3400,12 +3273,12 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf56408RTL) createSwDoc("tdf56408-rtl.fodt"); auto pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "//page"_ostr, 1); + assertXPath(pXmlDoc, "//page", 1); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]"_ostr, "portion"_ostr, - u"עברית עברית עברית "_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]"_ostr, "portion"_ostr, - u"((((English)))) עברית"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]", "portion", + u"עברית עברית עברית "); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]", "portion", + u"((((English)))) עברית"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf56408NoUnderflow) @@ -3416,12 +3289,12 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf56408NoUnderflow) createSwDoc("tdf56408-no-underflow.fodt"); auto pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "//page"_ostr, 1); + assertXPath(pXmlDoc, "//page", 1); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]"_ostr, "portion"_ostr, - u"English English English "_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]"_ostr, "portion"_ostr, - u"עברית English"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]", "portion", + u"English English English "); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]", "portion", + u"עברית English"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf56408AfterFieldCrash) @@ -3438,19 +3311,19 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf146081) auto pXmlDoc = parseLayoutDump(); SwTwips nTotalHeight - = getXPath(pXmlDoc, "/root/page/body/txt/infos/bounds"_ostr, "height"_ostr).toInt32(); + = getXPath(pXmlDoc, "/root/page/body/txt/infos/bounds", "height").toInt32(); SwTwips nHeight1 - = getXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]"_ostr, "height"_ostr) + = getXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]", "height") .toInt32(); SwTwips nHeight2 - = getXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]"_ostr, "height"_ostr) + = getXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]", "height") .toInt32(); SwTwips nHeight3 - = getXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[3]"_ostr, "height"_ostr) + = getXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[3]", "height") .toInt32(); SwTwips nHeight4 - = getXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[4]"_ostr, "height"_ostr) + = getXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[4]", "height") .toInt32(); // All of the lines must have the same height @@ -3468,8 +3341,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf155229RowAtLeast) xmlDocUniquePtr pXmlDoc = parseLayoutDump(); sal_Int32 nTableHeight - = getXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row[11]/infos/bounds"_ostr, "bottom"_ostr) - .toInt32(); + = getXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row[11]/infos/bounds", "bottom").toInt32(); // Without the fix, this was Actual : 14174 CPPUNIT_ASSERT_EQUAL(sal_Int32(15494), nTableHeight); @@ -3481,12 +3353,12 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf157829LTR) createSwDoc("tdf157829-ltr.fodt"); auto pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "//page"_ostr, 1); + assertXPath(pXmlDoc, "//page", 1); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]"_ostr, "portion"_ostr, - u"English English English "_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]"_ostr, "portion"_ostr, - u"עברית English"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]", "portion", + u"English English English "); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]", "portion", + u"עברית English"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf157829RTL) @@ -3495,12 +3367,12 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf157829RTL) createSwDoc("tdf157829-rtl.fodt"); auto pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "//page"_ostr, 1); + assertXPath(pXmlDoc, "//page", 1); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]"_ostr, "portion"_ostr, - u"עברית עברית עברית עברית "_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]"_ostr, "portion"_ostr, - u"English עברית"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]", "portion", + u"עברית עברית עברית עברית "); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]", "portion", + u"English עברית"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf162314) @@ -3510,12 +3382,11 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf162314) createSwDoc("tdf162314.fodt"); auto pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "//page"_ostr, 1); + assertXPath(pXmlDoc, "//page", 1); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]"_ostr, "portion"_ostr, - u"Aa aa aaaa ﷽ "_ustr); - assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]"_ostr, "portion"_ostr, - u"aaaa"_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]", "portion", + u"Aa aa aaaa ﷽ "); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]", "portion", u"aaaa"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf162614) @@ -3531,97 +3402,97 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf162614) // I find the clang-formatted version of the following awful (it is already ugly enough) // clang-format off - assertXPath(pXmlDoc, "//page"_ostr, 2); + assertXPath(pXmlDoc, "//page", 2); // One top-level table on page 1 (Table1), with a single row and a single cell - assertXPath(pXmlDoc, "//page[1]/body/tab"_ostr, 1); - OUString sTable1PrecedeId = getXPath(pXmlDoc, "//page[1]/body/tab"_ostr, "id"_ostr); - OUString sTable1FollowId = getXPath(pXmlDoc, "//page[1]/body/tab"_ostr, "follow"_ostr); - assertXPath(pXmlDoc, "//page[1]/body/tab/infos/bounds"_ostr, "top"_ostr, u"2261"_ustr); - assertXPath(pXmlDoc, "//page[1]/body/tab/infos/bounds"_ostr, "height"_ostr, u"810"_ustr); - assertXPath(pXmlDoc, "//page[1]/body/tab/row"_ostr, 1); - assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell"_ostr, 1); - OUString sTable1A1PrecedeId = getXPath(pXmlDoc, "//page[1]/body/tab/row/cell"_ostr, "id"_ostr); - OUString sTable1A1FollowId = getXPath(pXmlDoc, "//page[1]/body/tab/row/cell"_ostr, "follow"_ostr); + assertXPath(pXmlDoc, "//page[1]/body/tab", 1); + OUString sTable1PrecedeId = getXPath(pXmlDoc, "//page[1]/body/tab", "id"); + OUString sTable1FollowId = getXPath(pXmlDoc, "//page[1]/body/tab", "follow"); + assertXPath(pXmlDoc, "//page[1]/body/tab/infos/bounds", "top", u"2261"); + assertXPath(pXmlDoc, "//page[1]/body/tab/infos/bounds", "height", u"810"); + assertXPath(pXmlDoc, "//page[1]/body/tab/row", 1); + assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell", 1); + OUString sTable1A1PrecedeId = getXPath(pXmlDoc, "//page[1]/body/tab/row/cell", "id"); + OUString sTable1A1FollowId = getXPath(pXmlDoc, "//page[1]/body/tab/row/cell", "follow"); // One sub-table inside it (Table2): - assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab"_ostr, 1); - OUString sTable2PrecedeId = getXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab"_ostr, "id"_ostr); - OUString sTable2FollowId = getXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab"_ostr, "follow"_ostr); - assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/infos/bounds"_ostr, "top"_ostr, u"2508"_ustr); - assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/infos/bounds"_ostr, "height"_ostr, u"543"_ustr); - assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row"_ostr, 1); - assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell"_ostr, 2); + assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab", 1); + OUString sTable2PrecedeId = getXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab", "id"); + OUString sTable2FollowId = getXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab", "follow"); + assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/infos/bounds", "top", u"2508"); + assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/infos/bounds", "height", u"543"); + assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row", 1); + assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell", 2); // A1 - assertXPathNoAttribute(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[1]"_ostr, "follow"_ostr); - assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[1]"_ostr, "rowspan"_ostr, u"1"_ustr); - assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[1]/txt/SwParaPortion/SwLineLayout/*"_ostr, 1); - assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[1]/txt/SwParaPortion/SwLineLayout/*[1]"_ostr, "type"_ostr, u"PortionType::Para"_ustr); - assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[1]/txt/SwParaPortion/SwLineLayout/*[1]"_ostr, "portion"_ostr, u"Table2.A1"_ustr); + assertXPathNoAttribute(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[1]", "follow"); + assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[1]", "rowspan", u"1"); + assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[1]/txt/SwParaPortion/SwLineLayout/*", 1); + assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[1]/txt/SwParaPortion/SwLineLayout/*[1]", "type", u"PortionType::Para"); + assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[1]/txt/SwParaPortion/SwLineLayout/*[1]", "portion", u"Table2.A1"); // B1 - OUString sTable2B1PrecedeId = getXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]"_ostr, "id"_ostr); - OUString sTable2B1FollowId = getXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]"_ostr, "follow"_ostr); - assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]"_ostr, "rowspan"_ostr, u"2"_ustr); - assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]/infos/bounds"_ostr, "height"_ostr, u"523"_ustr); - assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]/infos/prtBounds"_ostr, "height"_ostr, u"503"_ustr); - OUString sTable2B1TextPrecedeId = getXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]/txt"_ostr, "id"_ostr); - OUString sTable2B1TextFollowId = getXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]/txt"_ostr, "follow"_ostr); - assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]/txt"_ostr, "offset"_ostr, u"0"_ustr); - assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]/txt/infos/bounds"_ostr, "height"_ostr, u"276"_ustr); - assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]/txt/infos/prtBounds"_ostr, "height"_ostr, u"276"_ustr); - assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]/txt/SwParaPortion/SwLineLayout/*"_ostr, 2); - assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]/txt/SwParaPortion/SwLineLayout/*[1]"_ostr, "type"_ostr, u"PortionType::Text"_ustr); - assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]/txt/SwParaPortion/SwLineLayout/*[1]"_ostr, "portion"_ostr, u"Table2.B1"_ustr); - assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]/txt/SwParaPortion/SwLineLayout/*[2]"_ostr, "type"_ostr, u"PortionType::Hole"_ustr); + OUString sTable2B1PrecedeId = getXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]", "id"); + OUString sTable2B1FollowId = getXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]", "follow"); + assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]", "rowspan", u"2"); + assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]/infos/bounds", "height", u"523"); + assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]/infos/prtBounds", "height", u"503"); + OUString sTable2B1TextPrecedeId = getXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]/txt", "id"); + OUString sTable2B1TextFollowId = getXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]/txt", "follow"); + assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]/txt", "offset", u"0"); + assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]/txt/infos/bounds", "height", u"276"); + assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]/txt/infos/prtBounds", "height", u"276"); + assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]/txt/SwParaPortion/SwLineLayout/*", 2); + assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]/txt/SwParaPortion/SwLineLayout/*[1]", "type", u"PortionType::Text"); + assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]/txt/SwParaPortion/SwLineLayout/*[1]", "portion", u"Table2.B1"); + assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell[2]/txt/SwParaPortion/SwLineLayout/*[2]", "type", u"PortionType::Hole"); // Two top-level tables on page 2 - assertXPath(pXmlDoc, "//page[2]/body/tab"_ostr, 2); + assertXPath(pXmlDoc, "//page[2]/body/tab", 2); // Table1 (follow) - CPPUNIT_ASSERT_EQUAL(sTable1FollowId, getXPath(pXmlDoc, "//page[2]/body/tab[1]"_ostr, "id"_ostr)); - CPPUNIT_ASSERT_EQUAL(sTable1PrecedeId, getXPath(pXmlDoc, "//page[2]/body/tab[1]"_ostr, "precede"_ostr)); - assertXPath(pXmlDoc, "//page[2]/body/tab[1]/infos/bounds"_ostr, "top"_ostr, u"3403"_ustr); - assertXPath(pXmlDoc, "//page[2]/body/tab[1]/infos/bounds"_ostr, "height"_ostr, u"514"_ustr); - assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row"_ostr, 1); - assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell"_ostr, 1); - CPPUNIT_ASSERT_EQUAL(sTable1A1FollowId, getXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell"_ostr, "id"_ostr)); - CPPUNIT_ASSERT_EQUAL(sTable1A1PrecedeId, getXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell"_ostr, "precede"_ostr)); + CPPUNIT_ASSERT_EQUAL(sTable1FollowId, getXPath(pXmlDoc, "//page[2]/body/tab[1]", "id")); + CPPUNIT_ASSERT_EQUAL(sTable1PrecedeId, getXPath(pXmlDoc, "//page[2]/body/tab[1]", "precede")); + assertXPath(pXmlDoc, "//page[2]/body/tab[1]/infos/bounds", "top", u"3403"); + assertXPath(pXmlDoc, "//page[2]/body/tab[1]/infos/bounds", "height", u"514"); + assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row", 1); + assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell", 1); + CPPUNIT_ASSERT_EQUAL(sTable1A1FollowId, getXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell", "id")); + CPPUNIT_ASSERT_EQUAL(sTable1A1PrecedeId, getXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell", "precede")); // Table2 (follow) - assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab"_ostr, 1); - CPPUNIT_ASSERT_EQUAL(sTable2FollowId, getXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab"_ostr, "id"_ostr)); - CPPUNIT_ASSERT_EQUAL(sTable2PrecedeId, getXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab"_ostr, "precede"_ostr)); - assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/infos/bounds"_ostr, "top"_ostr, u"3423"_ustr); - assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/infos/bounds"_ostr, "height"_ostr, u"474"_ustr); - assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row"_ostr, 2); + assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab", 1); + CPPUNIT_ASSERT_EQUAL(sTable2FollowId, getXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab", "id")); + CPPUNIT_ASSERT_EQUAL(sTable2PrecedeId, getXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab", "precede")); + assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/infos/bounds", "top", u"3423"); + assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/infos/bounds", "height", u"474"); + assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row", 2); // Table2 row 1 (continued) - assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[1]/cell"_ostr, 2); + assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[1]/cell", 2); // Placeholder for the cell in column 1 - assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[1]/cell[1]/infos/bounds"_ostr, "height"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[1]/cell[1]/infos/bounds", "height", u"0"); // B1 (follow) - CPPUNIT_ASSERT_EQUAL(sTable2B1FollowId, getXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[1]/cell[2]"_ostr, "id"_ostr)); - CPPUNIT_ASSERT_EQUAL(sTable2B1PrecedeId, getXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[1]/cell[2]"_ostr, "precede"_ostr)); - assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[1]/cell[2]"_ostr, "rowspan"_ostr, u"2"_ustr); + CPPUNIT_ASSERT_EQUAL(sTable2B1FollowId, getXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[1]/cell[2]", "id")); + CPPUNIT_ASSERT_EQUAL(sTable2B1PrecedeId, getXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[1]/cell[2]", "precede")); + assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[1]/cell[2]", "rowspan", u"2"); // Without the fix, this failed with // - Expected: 1 // - Actual : 2 // - In <>, XPath '//page[2]/body/tab[1]/row/cell/tab/row[1]/cell[2]/txt' number of nodes is incorrect - CPPUNIT_ASSERT_EQUAL(sTable2B1TextFollowId, getXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[1]/cell[2]/txt"_ostr, "id"_ostr)); - CPPUNIT_ASSERT_EQUAL(sTable2B1TextPrecedeId, getXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[1]/cell[2]/txt"_ostr, "precede"_ostr)); - assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[1]/cell[2]/txt/SwParaPortion/SwLineLayout/*"_ostr, 1); - assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[1]/cell[2]/txt/SwParaPortion/SwLineLayout/*[1]"_ostr, "type"_ostr, u"PortionType::Para"_ustr); - assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[1]/cell[2]/txt/SwParaPortion/SwLineLayout/*[1]"_ostr, "portion"_ostr, u"(contd.)"_ustr); + CPPUNIT_ASSERT_EQUAL(sTable2B1TextFollowId, getXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[1]/cell[2]/txt", "id")); + CPPUNIT_ASSERT_EQUAL(sTable2B1TextPrecedeId, getXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[1]/cell[2]/txt", "precede")); + assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[1]/cell[2]/txt/SwParaPortion/SwLineLayout/*", 1); + assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[1]/cell[2]/txt/SwParaPortion/SwLineLayout/*[1]", "type", u"PortionType::Para"); + assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[1]/cell[2]/txt/SwParaPortion/SwLineLayout/*[1]", "portion", u"(contd.)"); // Table2 row 2 - assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[2]/cell"_ostr, 2); + assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[2]/cell", 2); // A2 - assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[2]/cell[1]/txt/SwParaPortion/SwLineLayout/*"_ostr, 1); - assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[2]/cell[1]/txt/SwParaPortion/SwLineLayout/*[1]"_ostr, "type"_ostr, u"PortionType::Para"_ustr); - assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[2]/cell[1]/txt/SwParaPortion/SwLineLayout/*[1]"_ostr, "portion"_ostr, u"Table2.A2"_ustr); + assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[2]/cell[1]/txt/SwParaPortion/SwLineLayout/*", 1); + assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[2]/cell[1]/txt/SwParaPortion/SwLineLayout/*[1]", "type", u"PortionType::Para"); + assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[2]/cell[1]/txt/SwParaPortion/SwLineLayout/*[1]", "portion", u"Table2.A2"); // B2 (covered cell) - assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[2]/cell[2]"_ostr, "rowspan"_ostr, u"-1"_ustr); + assertXPath(pXmlDoc, "//page[2]/body/tab[1]/row/cell/tab/row[2]/cell[2]", "rowspan", u"-1"); // Table3 (must not be collapsed) - assertXPath(pXmlDoc, "//page[2]/body/tab[2]/infos/bounds"_ostr, "top"_ostr, u"4696"_ustr); + assertXPath(pXmlDoc, "//page[2]/body/tab[2]/infos/bounds", "top", u"4696"); // Without the fix, this failed with // - Expected: 770 // - Actual : 267 - assertXPath(pXmlDoc, "//page[2]/body/tab[2]/infos/bounds"_ostr, "height"_ostr, u"770"_ustr); + assertXPath(pXmlDoc, "//page[2]/body/tab[2]/infos/bounds", "height", u"770"); // Now a test for a case that took me some time to fix when creating the patch. // It is the greatly simplified tdf124795-5. @@ -3632,9 +3503,9 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf162614) // The first line of C4 text must start on the first page - the initial version of the fix // moved it to page 2. - assertXPath(pXmlDoc, "//page[1]/body/tab/row[4]/cell[3]/txt/SwParaPortion/SwLineLayout/*"_ostr, 1); - assertXPath(pXmlDoc, "//page[1]/body/tab/row[4]/cell[3]/txt/SwParaPortion/SwLineLayout/*[1]"_ostr, "type"_ostr, u"PortionType::Para"_ustr); - assertXPath(pXmlDoc, "//page[1]/body/tab/row[4]/cell[3]/txt/SwParaPortion/SwLineLayout/*[1]"_ostr, "portion"_ostr, u"C4_xxxxxxxxxxxxxxxxxxxx"_ustr); + assertXPath(pXmlDoc, "//page[1]/body/tab/row[4]/cell[3]/txt/SwParaPortion/SwLineLayout/*", 1); + assertXPath(pXmlDoc, "//page[1]/body/tab/row[4]/cell[3]/txt/SwParaPortion/SwLineLayout/*[1]", "type", u"PortionType::Para"); + assertXPath(pXmlDoc, "//page[1]/body/tab/row[4]/cell[3]/txt/SwParaPortion/SwLineLayout/*[1]", "portion", u"C4_xxxxxxxxxxxxxxxxxxxx"); // clang-format on } @@ -3645,24 +3516,20 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf152142) createSwDoc("tdf152142.fodt"); auto pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "//page"_ostr, 1); + assertXPath(pXmlDoc, "//page", 1); SwTwips nTextBoxBegin - = getXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/fly/txt/infos/bounds"_ostr, - "left"_ostr) + = getXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/fly/txt/infos/bounds", "left") .toInt32(); SwTwips nTextBoxEnd - = getXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/fly/txt/infos/bounds"_ostr, - "right"_ostr) + = getXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/fly/txt/infos/bounds", "right") .toInt32(); SwTwips nShapeBegin - = getXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/SwAnchoredDrawObject/bounds"_ostr, - "left"_ostr) + = getXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/SwAnchoredDrawObject/bounds", "left") .toInt32(); SwTwips nShapeEnd - = getXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/SwAnchoredDrawObject/bounds"_ostr, - "right"_ostr) + = getXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/SwAnchoredDrawObject/bounds", "right") .toInt32(); CPPUNIT_ASSERT_GREATER(nShapeBegin, nTextBoxBegin); @@ -3676,24 +3543,20 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf152142DoNotMirrorRtlDrawObjs) createSwDoc("tdf152142-donotmirror.fodt"); auto pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "//page"_ostr, 1); + assertXPath(pXmlDoc, "//page", 1); SwTwips nTextBoxBegin - = getXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/fly/txt/infos/bounds"_ostr, - "left"_ostr) + = getXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/fly/txt/infos/bounds", "left") .toInt32(); SwTwips nTextBoxEnd - = getXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/fly/txt/infos/bounds"_ostr, - "right"_ostr) + = getXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/fly/txt/infos/bounds", "right") .toInt32(); SwTwips nShapeBegin - = getXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/SwAnchoredDrawObject/bounds"_ostr, - "left"_ostr) + = getXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/SwAnchoredDrawObject/bounds", "left") .toInt32(); SwTwips nShapeEnd - = getXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/SwAnchoredDrawObject/bounds"_ostr, - "right"_ostr) + = getXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/SwAnchoredDrawObject/bounds", "right") .toInt32(); CPPUNIT_ASSERT_GREATER(nShapeBegin, nTextBoxBegin); @@ -3705,22 +3568,22 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf152298) createSwDoc("tdf152298.docx"); auto pDump = parseLayoutDump(); - assertXPath(pDump, "//page"_ostr, 2); + assertXPath(pDump, "//page", 2); // Without the fix, this was 39 - assertXPath(pDump, "//page[1]/body/tab/row"_ostr, 38); - assertXPath(pDump, "//page[1]/body/tab/row[38]/cell[1]"_ostr, "rowspan"_ostr, u"4"_ustr); - OUString a38_id = getXPath(pDump, "//page[1]/body/tab/row[38]/cell[1]"_ostr, "id"_ostr); - OUString follow_id = getXPath(pDump, "//page[1]/body/tab/row[38]/cell[1]"_ostr, "follow"_ostr); + assertXPath(pDump, "//page[1]/body/tab/row", 38); + assertXPath(pDump, "//page[1]/body/tab/row[38]/cell[1]", "rowspan", u"4"); + OUString a38_id = getXPath(pDump, "//page[1]/body/tab/row[38]/cell[1]", "id"); + OUString follow_id = getXPath(pDump, "//page[1]/body/tab/row[38]/cell[1]", "follow"); // The text of A38, that spans four rows, must be split: empty paragraph here - assertXPathContent(pDump, "//page[1]/body/tab/row[38]/cell[1]/txt"_ostr, u""_ustr); + assertXPathContent(pDump, "//page[1]/body/tab/row[38]/cell[1]/txt", u""); // First row is the repeating line - assertXPathContent(pDump, "//page[2]/body/tab/row[1]/cell[1]/txt"_ostr, u"1"_ustr); - assertXPathContent(pDump, "//page[2]/body/tab/row[1]/cell[2]/txt"_ostr, u"2"_ustr); - assertXPathContent(pDump, "//page[2]/body/tab/row[1]/cell[3]/txt"_ostr, u"3"_ustr); + assertXPathContent(pDump, "//page[2]/body/tab/row[1]/cell[1]/txt", u"1"); + assertXPathContent(pDump, "//page[2]/body/tab/row[1]/cell[2]/txt", u"2"); + assertXPathContent(pDump, "//page[2]/body/tab/row[1]/cell[3]/txt", u"3"); // The text in the follow row's first cell is the second paragraph of A38, "10" - assertXPath(pDump, "//page[2]/body/tab/row[2]/cell[1]"_ostr, "id"_ostr, follow_id); - assertXPath(pDump, "//page[2]/body/tab/row[2]/cell[1]"_ostr, "precede"_ostr, a38_id); - assertXPathContent(pDump, "//page[2]/body/tab/row[2]/cell[1]/txt"_ostr, u"10"_ustr); + assertXPath(pDump, "//page[2]/body/tab/row[2]/cell[1]", "id", follow_id); + assertXPath(pDump, "//page[2]/body/tab/row[2]/cell[1]", "precede", a38_id); + assertXPathContent(pDump, "//page[2]/body/tab/row[2]/cell[1]/txt", u"10"); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf163230) @@ -3729,7 +3592,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf163230) auto pExportDump = parseLayoutDump(); // The first row must split across pages, despite its "do not break" attribute, because it // doesn't fit on the page. Before the fix, the document had only two pages. - assertXPath(pExportDump, "//page"_ostr, 3); + assertXPath(pExportDump, "//page", 3); } } // end of anonymous namespace |