summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2023-11-19 13:25:26 +0100
committerStephan Bergmann <sbergman@redhat.com>2023-11-19 17:29:47 +0100
commit7724e504be75fdf2a90b0ffc19dce3df76ed14a6 (patch)
treeb17fc046d3792b25cdf7b84ccfc02ccf4d6713a3
parent35972b1fbe3dd26c2e384d6e65ef77ef90d5d2a3 (diff)
Extended loplugin:ostr: sw
Change-Id: I210f61f6d90776b086b7058fb1a831d235699fb7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159670 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--sw/qa/core/doc/doc.cxx2
-rw-r--r--sw/qa/core/frmedt/frmedt.cxx3
-rw-r--r--sw/qa/core/layout/layout.cxx105
-rw-r--r--sw/qa/core/layout/paintfrm.cxx6
-rw-r--r--sw/qa/core/layout/tabfrm.cxx2
-rw-r--r--sw/qa/core/objectpositioning/objectpositioning.cxx68
-rw-r--r--sw/qa/core/text/text.cxx130
-rw-r--r--sw/qa/core/txtnode/txtnode.cxx4
-rw-r--r--sw/qa/core/unocore/unocore.cxx18
-rw-r--r--sw/qa/extras/docbookexport/docbookexport.cxx2
-rw-r--r--sw/qa/extras/fodfexport/fodfexport.cxx8
-rw-r--r--sw/qa/extras/globalfilter/globalfilter.cxx216
-rw-r--r--sw/qa/extras/htmlexport/htmlexport.cxx371
-rw-r--r--sw/qa/extras/htmlexport/xhtmlexport.cxx6
-rw-r--r--sw/qa/extras/indexing/IndexingExportTest.cxx258
-rw-r--r--sw/qa/extras/indexing/SearchResultLocatorTest.cxx6
-rw-r--r--sw/qa/extras/layout/layout.cxx2900
-rw-r--r--sw/qa/extras/layout/layout2.cxx1401
-rw-r--r--sw/qa/extras/layout/layout3.cxx672
-rw-r--r--sw/qa/extras/mailmerge/mailmerge.cxx44
-rw-r--r--sw/qa/extras/mailmerge/mailmerge2.cxx28
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx402
-rw-r--r--sw/qa/extras/odfexport/odfexport2.cxx238
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx54
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx302
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport10.cxx54
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport11.cxx76
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport12.cxx719
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport13.cxx224
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport14.cxx380
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport15.cxx244
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport16.cxx126
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport17.cxx130
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport18.cxx110
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport19.cxx71
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport2.cxx128
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport20.cxx398
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport3.cxx362
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport4.cxx280
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport5.cxx226
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport6.cxx290
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport7.cxx614
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport8.cxx14
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport9.cxx326
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx4
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx192
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmllinks.cxx28
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlw14export.cxx772
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx48
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport2.cxx14
-rw-r--r--sw/qa/extras/rtfexport/rtfexport3.cxx7
-rw-r--r--sw/qa/extras/rtfexport/rtfexport4.cxx28
-rw-r--r--sw/qa/extras/rtfexport/rtfexport5.cxx33
-rw-r--r--sw/qa/extras/rtfexport/rtfexport6.cxx21
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx10
-rw-r--r--sw/qa/extras/tiledrendering/tiledrendering.cxx86
-rw-r--r--sw/qa/extras/txtexport/txtexport.cxx6
-rw-r--r--sw/qa/extras/txtimport/txtimport.cxx2
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx10
-rw-r--r--sw/qa/extras/uiwriter/uiwriter2.cxx161
-rw-r--r--sw/qa/extras/uiwriter/uiwriter3.cxx251
-rw-r--r--sw/qa/extras/uiwriter/uiwriter4.cxx183
-rw-r--r--sw/qa/extras/uiwriter/uiwriter5.cxx260
-rw-r--r--sw/qa/extras/uiwriter/uiwriter6.cxx188
-rw-r--r--sw/qa/extras/uiwriter/uiwriter7.cxx20
-rw-r--r--sw/qa/extras/uiwriter/uiwriter8.cxx195
-rw-r--r--sw/qa/extras/ww8export/ww8export.cxx82
-rw-r--r--sw/qa/extras/ww8export/ww8export2.cxx18
-rw-r--r--sw/qa/extras/ww8export/ww8export3.cxx8
-rw-r--r--sw/qa/extras/ww8export/ww8export4.cxx4
-rw-r--r--sw/qa/extras/ww8import/ww8import.cxx6
-rw-r--r--sw/qa/filter/html/html.cxx15
-rw-r--r--sw/qa/filter/ww8/ww8.cxx30
-rw-r--r--sw/qa/uibase/shells/shells.cxx16
-rw-r--r--sw/qa/uibase/shells/textsh.cxx2
-rw-r--r--sw/qa/uibase/uiview/uiview.cxx2
-rw-r--r--sw/source/core/crsr/bookmark.cxx2
-rw-r--r--sw/source/core/frmedt/feshview.cxx2
-rw-r--r--sw/source/core/inc/swfntcch.hxx2
-rw-r--r--sw/source/core/layout/dbg_lay.cxx6
-rw-r--r--sw/source/core/layout/newfrm.cxx2
-rw-r--r--sw/source/core/model/SearchResultLocator.cxx6
-rw-r--r--sw/source/core/text/txtfrm.cxx2
-rw-r--r--sw/source/core/text/txtinit.cxx2
-rw-r--r--sw/source/filter/html/css1atr.cxx82
-rw-r--r--sw/source/filter/html/htmlatr.cxx12
-rw-r--r--sw/source/filter/html/htmlflywriter.cxx10
-rw-r--r--sw/source/filter/html/htmlforw.cxx2
-rw-r--r--sw/source/filter/html/htmlftn.cxx2
-rw-r--r--sw/source/filter/html/htmlplug.cxx2
-rw-r--r--sw/source/filter/html/htmlreqifreader.cxx8
-rw-r--r--sw/source/filter/html/htmltabw.cxx2
-rw-r--r--sw/source/filter/html/wrthtml.cxx2
-rw-r--r--sw/source/filter/indexing/IndexingExport.cxx14
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx164
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx101
-rw-r--r--sw/source/ui/misc/translatelangselect.cxx56
-rw-r--r--sw/source/uibase/app/swmodule.cxx2
-rw-r--r--sw/source/uibase/shells/translatehelper.cxx14
-rw-r--r--sw/source/uibase/uiview/view.cxx6
-rw-r--r--sw/source/uibase/uiview/viewsrch.cxx2
-rw-r--r--sw/source/uibase/uiview/viewstat.cxx4
102 files changed, 7947 insertions, 7282 deletions
diff --git a/sw/qa/core/doc/doc.cxx b/sw/qa/core/doc/doc.cxx
index 2fad46194174..b653a1cc2201 100644
--- a/sw/qa/core/doc/doc.cxx
+++ b/sw/qa/core/doc/doc.cxx
@@ -230,7 +230,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testTextBoxMakeFlyFrame)
// Without the accompanying fix in place, this test would have failed, because the first text
// frame in the body frame had an SwAnchoredDrawObject anchored to it, but not a fly frame, so
// a blank square was painted, not the image.
- assertXPath(pLayout, "/root/page/body/txt/anchored/fly", 1);
+ assertXPath(pLayout, "/root/page/body/txt/anchored/fly"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testIMEGrouping)
diff --git a/sw/qa/core/frmedt/frmedt.cxx b/sw/qa/core/frmedt/frmedt.cxx
index 55c6c7b9d01f..618fe7fb574f 100644
--- a/sw/qa/core/frmedt/frmedt.cxx
+++ b/sw/qa/core/frmedt/frmedt.cxx
@@ -89,7 +89,8 @@ CPPUNIT_TEST_FIXTURE(SwCoreFrmedtTest, testVertPosFromBottomBoundingBox)
// Get the absolute position of the top of the page bottom margin area.
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- SwTwips nPagePrintAreaBottom = getXPath(pXmlDoc, "//page/infos/prtBounds", "bottom").toInt32();
+ SwTwips nPagePrintAreaBottom
+ = getXPath(pXmlDoc, "//page/infos/prtBounds"_ostr, "bottom"_ostr).toInt32();
// Calculate the allowed bounding box of the shape, e.g. the shape's position & size dialog uses
// this to limit the vertical position to sensible values.
diff --git a/sw/qa/core/layout/layout.cxx b/sw/qa/core/layout/layout.cxx
index 4399c01a0074..5971e870304d 100644
--- a/sw/qa/core/layout/layout.cxx
+++ b/sw/qa/core/layout/layout.cxx
@@ -54,11 +54,13 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTableFlyOverlap)
// Load a document that has an image anchored in the header.
// It also has a table which has the wrap around the image.
createSwDoc("table-fly-overlap.docx");
- SwTwips nFlyTop = parseDump("//header/txt/anchored/fly/infos/bounds", "top").toInt32();
- SwTwips nFlyHeight = parseDump("//header/txt/anchored/fly/infos/bounds", "height").toInt32();
+ SwTwips nFlyTop
+ = parseDump("//header/txt/anchored/fly/infos/bounds"_ostr, "top"_ostr).toInt32();
+ SwTwips nFlyHeight
+ = parseDump("//header/txt/anchored/fly/infos/bounds"_ostr, "height"_ostr).toInt32();
SwTwips nFlyBottom = nFlyTop + nFlyHeight;
- SwTwips nTableFrameTop = parseDump("//tab/infos/bounds", "top").toInt32();
- SwTwips nTablePrintTop = parseDump("//tab/infos/prtBounds", "top").toInt32();
+ SwTwips nTableFrameTop = parseDump("//tab/infos/bounds"_ostr, "top"_ostr).toInt32();
+ SwTwips nTablePrintTop = parseDump("//tab/infos/prtBounds"_ostr, "top"_ostr).toInt32();
SwTwips nTableTop = nTableFrameTop + nTablePrintTop;
// Without the accompanying fix in place, this test would have failed with:
// - Expected greater or equal than: 3579
@@ -73,8 +75,8 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTdf128195)
// Load a document that has two paragraphs in the header.
// The second paragraph should have its bottom spacing applied.
createSwDoc("tdf128195.docx");
- sal_Int32 nTxtHeight = parseDump("//header/txt[2]/infos/bounds", "height").toInt32();
- sal_Int32 nTxtBottom = parseDump("//header/txt[2]/infos/bounds", "bottom").toInt32();
+ sal_Int32 nTxtHeight = parseDump("//header/txt[2]/infos/bounds"_ostr, "height"_ostr).toInt32();
+ sal_Int32 nTxtBottom = parseDump("//header/txt[2]/infos/bounds"_ostr, "bottom"_ostr).toInt32();
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2269), nTxtHeight);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3529), nTxtBottom);
}
@@ -102,7 +104,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testBorderCollapseCompat)
// - Actual : 48
// i.e. there was no single cell border with width=20, rather there were 48 border parts
// (forming a dotted border), all with width=40.
- assertXPath(pXmlDoc, "//polyline[@style='solid']", "width", "20");
+ assertXPath(pXmlDoc, "//polyline[@style='solid']"_ostr, "width"_ostr, "20");
}
CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testBtlrTableRowSpan)
@@ -120,18 +122,19 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testBtlrTableRowSpan)
// - Expected: USA
// - Actual : West
// i.e. the "USA" text completely disappeared.
- assertXPathContent(pXmlDoc, "//textarray[1]/text", "USA");
+ assertXPathContent(pXmlDoc, "//textarray[1]/text"_ostr, "USA");
}
CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTableFlyOverlapSpacing)
{
// Load a document that has an image on the right of a table. The table wraps around the image.
createSwDoc("table-fly-overlap-spacing.docx");
- SwTwips nFlyTop = parseDump("//body/txt/anchored/fly/infos/bounds", "top").toInt32();
- SwTwips nFlyHeight = parseDump("//body/txt/anchored/fly/infos/bounds", "height").toInt32();
+ SwTwips nFlyTop = parseDump("//body/txt/anchored/fly/infos/bounds"_ostr, "top"_ostr).toInt32();
+ SwTwips nFlyHeight
+ = parseDump("//body/txt/anchored/fly/infos/bounds"_ostr, "height"_ostr).toInt32();
SwTwips nFlyBottom = nFlyTop + nFlyHeight;
- SwTwips nTableFrameTop = parseDump("//tab/infos/bounds", "top").toInt32();
- SwTwips nTablePrintTop = parseDump("//tab/infos/prtBounds", "top").toInt32();
+ SwTwips nTableFrameTop = parseDump("//tab/infos/bounds"_ostr, "top"_ostr).toInt32();
+ SwTwips nTablePrintTop = parseDump("//tab/infos/prtBounds"_ostr, "top"_ostr).toInt32();
SwTwips nTableTop = nTableFrameTop + nTablePrintTop;
// Without the accompanying fix in place, this test would have failed with:
// - Expected greater or equal than: 3993
@@ -161,7 +164,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTablesMoveBackwards)
// - Actual : 2
// i.e. there was an unexpected 2nd page, as only 20 out of 21 tables were moved to the first
// page.
- assertXPath(pLayout, "//page", 1);
+ assertXPath(pLayout, "//page"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testContinuousEndnotesMoveBackwards)
@@ -170,15 +173,15 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testContinuousEndnotesMoveBackwards)
createSwDoc("continuous-endnotes-move-backwards.doc");
xmlDocUniquePtr pLayout = parseLayoutDump();
// We have 2 pages.
- assertXPath(pLayout, "/root/page", 2);
+ assertXPath(pLayout, "/root/page"_ostr, 2);
// No endnote container on page 1.
// Without the accompanying fix in place, this test would have failed with:
// - Expected: 0
// - Actual : 1
// i.e. there were unexpected endnotes on page 1.
- assertXPath(pLayout, "/root/page[1]/ftncont", 0);
+ assertXPath(pLayout, "/root/page[1]/ftncont"_ostr, 0);
// All endnotes are in a container on page 2.
- assertXPath(pLayout, "/root/page[2]/ftncont", 1);
+ assertXPath(pLayout, "/root/page[2]/ftncont"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testAnchorPositionBasedOnParagraph)
@@ -188,12 +191,12 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testAnchorPositionBasedOnParagraph)
createSwDoc("tdf134783_testAnchorPositionBasedOnParagraph.fodt");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[1]/bounds", "top", "1671");
- assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[1]/bounds", "bottom", "1732");
- assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[2]/bounds", "top", "1947");
- assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[2]/bounds", "bottom", "2008");
- assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[3]/bounds", "top", "3783");
- assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[3]/bounds", "bottom", "3844");
+ assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[1]/bounds"_ostr, "top"_ostr, "1671");
+ assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[1]/bounds"_ostr, "bottom"_ostr, "1732");
+ assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[2]/bounds"_ostr, "top"_ostr, "1947");
+ assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[2]/bounds"_ostr, "bottom"_ostr, "2008");
+ assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[3]/bounds"_ostr, "top"_ostr, "3783");
+ assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[3]/bounds"_ostr, "bottom"_ostr, "3844");
}
CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextBoxStaysInsideShape)
@@ -206,8 +209,8 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextBoxStaysInsideShape)
// Without the fix in place, this test would have failed with
// - Expected: 1932
// - Actual : 7476
- assertXPath(pXmlDoc, "//anchored/fly/infos/bounds", "top", "1932");
- assertXPath(pXmlDoc, "//anchored/fly/infos/bounds", "bottom", "7184");
+ assertXPath(pXmlDoc, "//anchored/fly/infos/bounds"_ostr, "top"_ostr, "1932");
+ assertXPath(pXmlDoc, "//anchored/fly/infos/bounds"_ostr, "bottom"_ostr, "7184");
}
CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextBoxNotModifiedOnOpen)
@@ -235,10 +238,13 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextBoxAutoGrowVertical)
discardDumpedLayout();
xmlDocUniquePtr pLayout = parseLayoutDump();
CPPUNIT_ASSERT(pLayout);
- sal_Int32 nFlyLeft = getXPath(pLayout, "//anchored/fly/infos/bounds", "left").toInt32();
- sal_Int32 nFlyTop = getXPath(pLayout, "//anchored/fly/infos/bounds", "top").toInt32();
- sal_Int32 nFlyRight = getXPath(pLayout, "//anchored/fly/infos/bounds", "right").toInt32();
- sal_Int32 nFlyBottom = getXPath(pLayout, "//anchored/fly/infos/bounds", "bottom").toInt32();
+ sal_Int32 nFlyLeft
+ = getXPath(pLayout, "//anchored/fly/infos/bounds"_ostr, "left"_ostr).toInt32();
+ sal_Int32 nFlyTop = getXPath(pLayout, "//anchored/fly/infos/bounds"_ostr, "top"_ostr).toInt32();
+ sal_Int32 nFlyRight
+ = getXPath(pLayout, "//anchored/fly/infos/bounds"_ostr, "right"_ostr).toInt32();
+ sal_Int32 nFlyBottom
+ = getXPath(pLayout, "//anchored/fly/infos/bounds"_ostr, "bottom"_ostr).toInt32();
tools::Rectangle aFlyRect(nFlyLeft, nFlyTop, nFlyRight, nFlyBottom);
// Without the accompanying fix in place, this test would have failed, as aFlyRect was too wide,
// so it was not inside aShapeRect anymore.
@@ -269,7 +275,8 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextBoxInHeaderIsPositioned)
// - Actual : 1418
// Comparison with 7000 chosen due to variability between devices
CPPUNIT_ASSERT_GREATEREQUAL(
- double(7000), getXPath(pXmlDoc, "//anchored/fly/infos/bounds", "left").toDouble());
+ double(7000),
+ getXPath(pXmlDoc, "//anchored/fly/infos/bounds"_ostr, "left"_ostr).toDouble());
}
CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testBtlrNestedCell)
@@ -307,11 +314,11 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testKeepwithnextFullheight)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
CPPUNIT_ASSERT(pXmlDoc);
// Make sure the document has 2 pages.
- assertXPath(pXmlDoc, "//page", 2);
+ assertXPath(pXmlDoc, "//page"_ostr, 2);
// Heading stays on page 1 to avoid a layout loop.
- assertXPathContent(pXmlDoc, "//page[1]/body/txt[2]", "Heading");
+ assertXPathContent(pXmlDoc, "//page[1]/body/txt[2]"_ostr, "Heading");
// Image stays on page 2.
- assertXPath(pXmlDoc, "//page[2]/body/txt/anchored/fly", 1);
+ assertXPath(pXmlDoc, "//page[2]/body/txt/anchored/fly"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testGutterMargin)
@@ -455,7 +462,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testGutterMarginPageBorder)
// - Expected: 2565
// - Actual : 1425
// Where 2565 is close to the left edge of the text area (2553).
- assertXPath(pXmlDoc, "//polyline[@style='solid']/point[1]", "x", "2565");
+ assertXPath(pXmlDoc, "//polyline[@style='solid']/point[1]"_ostr, "x"_ostr, "2565");
#endif
}
@@ -479,7 +486,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testVerticallyMergedCellBorder)
MetafileXmlDump dumper;
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
// Collect vertical positions of all border points.
- xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//polyline[@style='solid']/point");
+ xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//polyline[@style='solid']/point"_ostr);
xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
std::vector<sal_Int32> aBorderPositions;
for (int i = 0; i < xmlXPathNodeSetGetLength(pXmlNodes); ++i)
@@ -492,7 +499,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testVerticallyMergedCellBorder)
xmlXPathFreeObject(pXmlObj);
// Collect top and bottom of the B1->B3 rows.
xmlDocUniquePtr pLayout = parseLayoutDump();
- pXmlObj = getXPathNode(pLayout, "//tab/row/infos/bounds");
+ pXmlObj = getXPathNode(pLayout, "//tab/row/infos/bounds"_ostr);
pXmlNodes = pXmlObj->nodesetval;
std::vector<sal_Int32> aLayoutPositions;
for (int i = 0; i < 3; ++i)
@@ -562,7 +569,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testLinkedBullet)
// - Expected: 1
// - Actual : 0
// i.e. the bullet's bitmap was lost.
- assertXPath(pXmlDoc, "//bmpexscale", 1);
+ assertXPath(pXmlDoc, "//bmpexscale"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testInnerCellBorderIntersect)
@@ -580,7 +587,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testInnerCellBorderIntersect)
MetafileXmlDump dumper;
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
// Collect start/end (vertical) positions of horizontal borders.
- xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//polyline[@style='solid']/point");
+ xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//polyline[@style='solid']/point"_ostr);
xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
std::vector<std::pair<sal_Int32, sal_Int32>> aBorderStartEnds;
for (int i = 0; i < xmlXPathNodeSetGetLength(pXmlNodes); i += 2)
@@ -642,7 +649,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testInnerCellBorderNocompatIntersect)
MetafileXmlDump dumper;
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
// Collect start/end (vertical) positions of horizontal borders.
- xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//polyline[@style='solid']/point");
+ xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//polyline[@style='solid']/point"_ostr);
xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
std::vector<std::pair<sal_Int32, sal_Int32>> aBorderStartEnds;
for (int i = 0; i < xmlXPathNodeSetGetLength(pXmlNodes); i += 2)
@@ -696,7 +703,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testDoubleBorderVertical)
MetafileXmlDump dumper;
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
// Collect widths of vertical lines.
- xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//polyline[@style='solid']/point");
+ xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//polyline[@style='solid']/point"_ostr);
xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
// Horizontal position -> width.
std::map<sal_Int32, sal_Int32> aBorderWidths;
@@ -745,7 +752,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testDoubleBorderHorizontal)
MetafileXmlDump dumper;
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
// Collect widths of horizontal lines.
- xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//polyline[@style='solid']/point");
+ xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//polyline[@style='solid']/point"_ostr);
xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
// Vertical position -> width.
std::map<sal_Int32, sal_Int32> aBorderWidths;
@@ -797,7 +804,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testParaBorderInCellClip)
// - Actual : 0
// - XPath '//clipregion/polygon' number of nodes is incorrect
// i.e. there was no clipping applied, leading to unexpected left/right borders.
- assertXPath(pXmlDoc, "//clipregion/polygon", 2);
+ assertXPath(pXmlDoc, "//clipregion/polygon"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testDoublePageBorder)
@@ -815,7 +822,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testDoublePageBorder)
MetafileXmlDump dumper;
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
// Collect widths of horizontal lines.
- xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//polyline[@style='solid']/point");
+ xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//polyline[@style='solid']/point"_ostr);
xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
// Vertical position -> width.
std::map<sal_Int32, sal_Int32> aBorderWidths;
@@ -887,8 +894,8 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testNegativePageBorder)
// i.e. the negative border distance was rounded up to 0 in lcl_CalcBorderRect().
// Ideally this would be 284 (top of first page) + 284 (top margin) + 366 (border distance) =
// 934.
- assertXPath(pXmlDoc, "//polyline[@style='solid']/point[1]", "y", "899");
- assertXPath(pXmlDoc, "//polyline[@style='solid']/point[2]", "y", "899");
+ assertXPath(pXmlDoc, "//polyline[@style='solid']/point[1]"_ostr, "y"_ostr, "899");
+ assertXPath(pXmlDoc, "//polyline[@style='solid']/point[2]"_ostr, "y"_ostr, "899");
}
CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testNegativePageBorderNoMargin)
@@ -926,8 +933,8 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testNegativePageBorderNoMargin)
// i.e. this failed differently: the lack of top margin caused a second problem.
// Ideally this would be 284 (top of first page) + 650 (border distance) =
// 934.
- assertXPath(pXmlDoc, "//polyline[@style='solid']/point[1]", "y", "899");
- assertXPath(pXmlDoc, "//polyline[@style='solid']/point[2]", "y", "899");
+ assertXPath(pXmlDoc, "//polyline[@style='solid']/point[1]"_ostr, "y"_ostr, "899");
+ assertXPath(pXmlDoc, "//polyline[@style='solid']/point[2]"_ostr, "y"_ostr, "899");
}
CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testFollowTextFlowWrapInBackground)
@@ -958,7 +965,8 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testFollowTextFlowWrapInBackground)
// Then make sure that the cell height grows to have space for the graphic, given that
// background=true is not specified.
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- sal_Int32 nCellHeight = getXPath(pXmlDoc, "//cell[1]/infos/bounds", "height").toInt32();
+ sal_Int32 nCellHeight
+ = getXPath(pXmlDoc, "//cell[1]/infos/bounds"_ostr, "height"_ostr).toInt32();
// Without the accompanying fix in place, this test would have failed with:
// - Expected greater than: 1000
// - Actual : 396
@@ -1030,7 +1038,8 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testNewFollowTextFlowWrapInBackground)
// Then make sure that the cell height grows to have space for the graphic, given that
// background=true is not specified.
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- sal_Int32 nCellHeight = getXPath(pXmlDoc, "//cell[1]/infos/bounds", "height").toInt32();
+ sal_Int32 nCellHeight
+ = getXPath(pXmlDoc, "//cell[1]/infos/bounds"_ostr, "height"_ostr).toInt32();
// Without the accompanying fix in place, this test would have failed with:
// - Expected less than: 1000
// - Actual : 1120
diff --git a/sw/qa/core/layout/paintfrm.cxx b/sw/qa/core/layout/paintfrm.cxx
index baa858020acf..b5990648b20f 100644
--- a/sw/qa/core/layout/paintfrm.cxx
+++ b/sw/qa/core/layout/paintfrm.cxx
@@ -40,7 +40,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSplitTableBorder)
// border:
MetafileXmlDump aDumper;
xmlDocUniquePtr pXmlDoc = dumpAndParse(aDumper, *xMetaFile);
- xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//polyline[@style='solid']/point");
+ xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//polyline[@style='solid']/point"_ostr);
xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
int nHorizontalBorders = 0;
// Count the horizontal borders:
@@ -82,7 +82,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRTLBorderMerge)
// Then make sure the 5 columns all have left and right vertical borders:
MetafileXmlDump aDumper;
xmlDocUniquePtr pXmlDoc = dumpAndParse(aDumper, *xMetaFile);
- xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//polyline[@style='solid']/point");
+ xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//polyline[@style='solid']/point"_ostr);
xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
int nVerticalBorders = 0;
// Count the vertical borders:
@@ -123,7 +123,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSplitTableMergedBorder)
// Then make sure that the master table has a bottom border with the correct widths:
MetafileXmlDump aDumper;
xmlDocUniquePtr pXmlDoc = dumpAndParse(aDumper, *xMetaFile);
- xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//polyline[@style='solid']/point");
+ xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//polyline[@style='solid']/point"_ostr);
xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
std::set<int> aHorizontalBorderStarts;
std::set<int> aHorizontalBorderEnds;
diff --git a/sw/qa/core/layout/tabfrm.cxx b/sw/qa/core/layout/tabfrm.cxx
index 1659cf0df6fd..cfad007cebcd 100644
--- a/sw/qa/core/layout/tabfrm.cxx
+++ b/sw/qa/core/layout/tabfrm.cxx
@@ -32,7 +32,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTablePrintAreaLeft)
createSwDoc("table-print-area-left.docx");
// When laying out that document & parsing the left margin of the table:
- SwTwips nTablePrintLeft = parseDump("//tab/infos/prtBounds", "left").toInt32();
+ SwTwips nTablePrintLeft = parseDump("//tab/infos/prtBounds"_ostr, "left"_ostr).toInt32();
// Then make sure it has ~no left margin:
// Without the accompanying fix in place, this test would have failed with:
diff --git a/sw/qa/core/objectpositioning/objectpositioning.cxx b/sw/qa/core/objectpositioning/objectpositioning.cxx
index 9fea64267a15..bf560cbdaf90 100644
--- a/sw/qa/core/objectpositioning/objectpositioning.cxx
+++ b/sw/qa/core/objectpositioning/objectpositioning.cxx
@@ -75,9 +75,9 @@ CPPUNIT_TEST_FIXTURE(Test, testVertPosFromBottom)
// Verify that the distance between the body and anchored object bottom is indeed around 1cm.
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- sal_Int32 nBodyBottom = getXPath(pXmlDoc, "//body/infos/bounds", "bottom").toInt32();
+ sal_Int32 nBodyBottom = getXPath(pXmlDoc, "//body/infos/bounds"_ostr, "bottom"_ostr).toInt32();
sal_Int32 nAnchoredBottom
- = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "bottom").toInt32();
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds"_ostr, "bottom"_ostr).toInt32();
// Without the accompanying fix in place, this test would have failed with:
// - Expected: 565
// - Actual : 9035
@@ -133,18 +133,22 @@ CPPUNIT_TEST_FIXTURE(Test, testVertAlignBottomMargin)
xDrawPageSupplierTop->getDrawPage()->add(xShapeTop);
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- sal_Int32 nBodyBottom = getXPath(pXmlDoc, "//body/infos/bounds", "bottom").toInt32(); //14989
- sal_Int32 nPageBottom = getXPath(pXmlDoc, "//page/infos/bounds", "bottom").toInt32(); //16123
+ sal_Int32 nBodyBottom
+ = getXPath(pXmlDoc, "//body/infos/bounds"_ostr, "bottom"_ostr).toInt32(); //14989
+ sal_Int32 nPageBottom
+ = getXPath(pXmlDoc, "//page/infos/bounds"_ostr, "bottom"_ostr).toInt32(); //16123
sal_Int32 nFirstShapeBottom
- = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[1]/bounds", "bottom")
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[1]/bounds"_ostr, "bottom"_ostr)
.toInt32(); //16124
sal_Int32 nSecondShapeBottom
- = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds", "bottom")
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds"_ostr, "bottom"_ostr)
.toInt32(); //15699
sal_Int32 nSecondShapeTop
- = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds", "top").toInt32(); //15414
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds"_ostr, "top"_ostr)
+ .toInt32(); //15414
sal_Int32 nThirdShapeTop
- = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[3]/bounds", "top").toInt32(); //14989
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[3]/bounds"_ostr, "top"_ostr)
+ .toInt32(); //14989
// Verify that the distance between the bottom of page and bottom of first shape is around 0cm. (align=bottom)
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nFirstShapeBottom - nPageBottom);
@@ -205,18 +209,22 @@ CPPUNIT_TEST_FIXTURE(Test, testVertAlignBottomMarginWithFooter)
xDrawPageSupplierTop->getDrawPage()->add(xShapeTop);
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- sal_Int32 nBodyBottom = getXPath(pXmlDoc, "//body/infos/bounds", "bottom").toInt32(); //14853
- sal_Int32 nPageBottom = getXPath(pXmlDoc, "//page/infos/bounds", "bottom").toInt32(); //17121
+ sal_Int32 nBodyBottom
+ = getXPath(pXmlDoc, "//body/infos/bounds"_ostr, "bottom"_ostr).toInt32(); //14853
+ sal_Int32 nPageBottom
+ = getXPath(pXmlDoc, "//page/infos/bounds"_ostr, "bottom"_ostr).toInt32(); //17121
sal_Int32 nFirstShapeBottom
- = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[1]/bounds", "bottom")
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[1]/bounds"_ostr, "bottom"_ostr)
.toInt32(); //17122
sal_Int32 nSecondShapeTop
- = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds", "top").toInt32(); //15703
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds"_ostr, "top"_ostr)
+ .toInt32(); //15703
sal_Int32 nSecondShapeBottom
- = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds", "bottom")
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds"_ostr, "bottom"_ostr)
.toInt32(); //16272
sal_Int32 nThirdShapeTop
- = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[3]/bounds", "top").toInt32(); //14853
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[3]/bounds"_ostr, "top"_ostr)
+ .toInt32(); //14853
// Verify that the distance between the bottom of page and bottom of first shape is around 0cm. (align=bottom)
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nFirstShapeBottom - nPageBottom);
@@ -235,13 +243,16 @@ CPPUNIT_TEST_FIXTURE(Test, testInsideOutsideVertAlignBottomMargin)
createSwDoc("inside-outside-vert-align.docx");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- sal_Int32 nBodyBottom = getXPath(pXmlDoc, "//body/infos/bounds", "bottom").toInt32(); //15704
- sal_Int32 nPageBottom = getXPath(pXmlDoc, "//page/infos/bounds", "bottom").toInt32(); //17121
+ sal_Int32 nBodyBottom
+ = getXPath(pXmlDoc, "//body/infos/bounds"_ostr, "bottom"_ostr).toInt32(); //15704
+ sal_Int32 nPageBottom
+ = getXPath(pXmlDoc, "//page/infos/bounds"_ostr, "bottom"_ostr).toInt32(); //17121
sal_Int32 nFirstShapeOutside
- = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[1]/bounds", "bottom")
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[1]/bounds"_ostr, "bottom"_ostr)
.toInt32(); //17098
sal_Int32 nSecondShapeInside
- = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds", "top").toInt32(); //15694
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds"_ostr, "top"_ostr)
+ .toInt32(); //15694
// Verify that the distance between the bottom of page and bottom of first shape is around 0cm. (align=outside)
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), nPageBottom - nFirstShapeOutside);
@@ -258,23 +269,28 @@ CPPUNIT_TEST_FIXTURE(Test, testVMLVertAlignBottomMargin)
createSwDoc("vml-vertical-alignment.docx");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- sal_Int32 nBodyBottom = getXPath(pXmlDoc, "//body/infos/bounds", "bottom").toInt32(); //11803
- sal_Int32 nPageBottom = getXPath(pXmlDoc, "//page/infos/bounds", "bottom").toInt32(); //16123
+ sal_Int32 nBodyBottom
+ = getXPath(pXmlDoc, "//body/infos/bounds"_ostr, "bottom"_ostr).toInt32(); //11803
+ sal_Int32 nPageBottom
+ = getXPath(pXmlDoc, "//page/infos/bounds"_ostr, "bottom"_ostr).toInt32(); //16123
sal_Int32 nFirstVMLShapeInside
- = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[1]/bounds", "top").toInt32(); //11802
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[1]/bounds"_ostr, "top"_ostr)
+ .toInt32(); //11802
sal_Int32 nSecondVMLShapeBottom
- = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds", "bottom")
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds"_ostr, "bottom"_ostr)
.toInt32(); //16124
sal_Int32 nThirdVMLShapeCenterBottom
- = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[3]/bounds", "bottom")
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[3]/bounds"_ostr, "bottom"_ostr)
.toInt32(); //14185
sal_Int32 nThirdVMLShapeCenterTop
- = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[3]/bounds", "top").toInt32(); //13741
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[3]/bounds"_ostr, "top"_ostr)
+ .toInt32(); //13741
sal_Int32 nFourthVMLShapeTop
- = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[4]/bounds", "top").toInt32(); //11802
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[4]/bounds"_ostr, "top"_ostr)
+ .toInt32(); //11802
sal_Int32 nFifthVMLShapeOutside
- = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[5]/bounds", "bottom")
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[5]/bounds"_ostr, "bottom"_ostr)
.toInt32(); //16124
// Verify that the distance between the bottom of body and top of first VMLshape is around 0cm. (align=inside)
diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx
index 496c14006539..8951b9fb6a82 100644
--- a/sw/qa/core/text/text.cxx
+++ b/sw/qa/core/text/text.cxx
@@ -100,7 +100,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testSemiTransparentText)
MetafileXmlDump dumper;
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "//floattransparent");
+ assertXPath(pXmlDoc, "//floattransparent"_ostr);
}
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testBibliographyUrlPdfExport)
@@ -391,8 +391,9 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTabOverMarginSection)
createSwDoc("tabovermargin-section.fodt");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
sal_Int32 nWidth
- = getXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/child::*[@type='PortionType::TabRight']",
- "width")
+ = getXPath(pXmlDoc,
+ "//SwParaPortion/SwLineLayout/child::*[@type='PortionType::TabRight']"_ostr,
+ "width"_ostr)
.toInt32();
// Without the accompanying fix in place, this test would have failed with:
// - Expected less than: 5000
@@ -415,7 +416,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testLineHeight)
// - Expected: 284
// - Actual : -65252
// due to various unsigned integer truncations.
- assertXPath(pXmlDoc, "//fly/infos/bounds", "top", OUString::number(DOCUMENTBORDER));
+ assertXPath(pXmlDoc, "//fly/infos/bounds"_ostr, "top"_ostr, OUString::number(DOCUMENTBORDER));
}
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testLineWidth)
@@ -449,10 +450,12 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testChineseAutoFirstLineIndent)
// Get the line width of the first line for the 1st paragraph.
sal_Int32 nFirstLineWidth
- = getXPath(pXmlDoc, "//body/txt[1]/SwParaPortion/SwLineLayout[1]", "width").toInt32();
+ = getXPath(pXmlDoc, "//body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr, "width"_ostr)
+ .toInt32();
// Get the line width of the first line for the 2nd paragraph.
sal_Int32 nSecondLineWidth
- = getXPath(pXmlDoc, "//body/txt[2]/SwParaPortion/SwLineLayout[1]", "width").toInt32();
+ = getXPath(pXmlDoc, "//body/txt[2]/SwParaPortion/SwLineLayout[1]"_ostr, "width"_ostr)
+ .toInt32();
// Tdf#129448: the changing of line-height should not affect the auto first line indent.
// As a result, the first line width of the two paragraphs should be the same.
@@ -542,7 +545,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreak)
// - Actual : 276
// i.e. the line height wasn't the twips value of the 1.806 cm from the file, but was based on
// the font size of the text, which is only correct for non-clearing breaks.
- assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout[1]", "height", "1024");
+ assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout[1]"_ostr, "height"_ostr, "1024");
}
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreakAtStart)
@@ -572,7 +575,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreakAtStart)
// - Actual : 276
// i.e. the line height was too small, but only in case the full line was a fly and a break
// portion, without any real content.
- assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout[1]", "height", "1024");
+ assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout[1]"_ostr, "height"_ostr, "1024");
}
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreakLeft)
@@ -624,7 +627,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreakLeft)
// - Expected: 2837
// - Actual : 4254
// i.e. any non-none type was handled as type=all, and this was jumping below both shapes.
- assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout[1]", "height", "2837");
+ assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout[1]"_ostr, "height"_ostr, "2837");
}
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreakLeftRTL)
@@ -665,7 +668,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreakLeftRTL)
// - Expected: 276
// - Actual : 2837
// i.e. left/right was not ignored in the RTL case.
- assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout[1]", "height", "276");
+ assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout[1]"_ostr, "height"_ostr, "276");
}
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreakVertical)
@@ -708,7 +711,8 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreakVertical)
// - Actual : 7135
// i.e. the expected break height is the twips value of the 5cm rectangle size, it was much
// more.
- assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout[1]/SwBreakPortion", "height", "2837");
+ assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout[1]/SwBreakPortion"_ostr, "height"_ostr,
+ "2837");
}
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreakHeader)
@@ -724,7 +728,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreakHeader)
// - Expected: 276
// - Actual : 15398
// i.e. the shape was in the background, but we failed to ignore it for the break portion.
- assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout[1]", "height", "276");
+ assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout[1]"_ostr, "height"_ostr, "276");
}
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testAsCharImageDocModelFromViewPoint)
@@ -1218,8 +1222,8 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testNumberPortionFormat)
// i.e. the numbering portion font size was 12pt, not 24pt (but only when the doc had a
// bookmark).
assertXPath(pXmlDoc,
- "//SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']/SwFont",
- "height", "480");
+ "//SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']/SwFont"_ostr,
+ "height"_ostr, "480");
}
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testNumberPortionNoformat)
@@ -1237,7 +1241,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testNumberPortionNoformat)
// i.e. the run color affected the color of the number portion in Writer, but not in Word.
CPPUNIT_ASSERT_EQUAL(
OUString("ffffffff"),
- getXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwFieldPortion/SwFont", "color"));
+ getXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwFieldPortion/SwFont"_ostr, "color"_ostr));
}
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf41652NBSPWidth)
@@ -1258,8 +1262,10 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf41652NBSPWidth)
MetafileXmlDump aDumper;
xmlDocUniquePtr pXmlDoc = dumpAndParse(aDumper, *xMetaFile);
- nSectionAfterNBSPX_legacy_leftAligned = getXPath(pXmlDoc, "//textarray[3]", "x").toInt32();
- nSectionAfterNBSPX_legacy_justified = getXPath(pXmlDoc, "//textarray[8]", "x").toInt32();
+ nSectionAfterNBSPX_legacy_leftAligned
+ = getXPath(pXmlDoc, "//textarray[3]"_ostr, "x"_ostr).toInt32();
+ nSectionAfterNBSPX_legacy_justified
+ = getXPath(pXmlDoc, "//textarray[8]"_ostr, "x"_ostr).toInt32();
}
// Measure the X of sections after NBSPs in a file with the option enabled
@@ -1272,9 +1278,9 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf41652NBSPWidth)
xmlDocUniquePtr pXmlDoc = dumpAndParse(aDumper, *xMetaFile);
nSectionAfterNBSPX_optionDisabled_leftAligned
- = getXPath(pXmlDoc, "//textarray[3]", "x").toInt32();
+ = getXPath(pXmlDoc, "//textarray[3]"_ostr, "x"_ostr).toInt32();
nSectionAfterNBSPX_optionDisabled_justified
- = getXPath(pXmlDoc, "//textarray[8]", "x").toInt32();
+ = getXPath(pXmlDoc, "//textarray[8]"_ostr, "x"_ostr).toInt32();
}
// Measure the X of the sections after NBSPs in a file with the option enabled
@@ -1287,9 +1293,9 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf41652NBSPWidth)
xmlDocUniquePtr pXmlDoc = dumpAndParse(aDumper, *xMetaFile);
nSectionAfterNBSPX_optionEnabled_leftAligned
- = getXPath(pXmlDoc, "//textarray[3]", "x").toInt32();
+ = getXPath(pXmlDoc, "//textarray[3]"_ostr, "x"_ostr).toInt32();
nSectionAfterNBSPX_optionEnabled_justified
- = getXPath(pXmlDoc, "//textarray[8]", "x").toInt32();
+ = getXPath(pXmlDoc, "//textarray[8]"_ostr, "x"_ostr).toInt32();
}
// Assert left aligned NBSP for the legacy file is larger than zero
@@ -1372,39 +1378,47 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf89288)
// Then make sure there is no kern portions between the Western and Complex
// portions:
- assertXPath(pXmlDoc, "//body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion", 3);
+ assertXPath(pXmlDoc, "//body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion"_ostr, 3);
assertXPath(pXmlDoc,
- "//body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Text']", 3);
+ "//body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Text']"_ostr,
+ 3);
assertXPath(pXmlDoc,
- "//body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Kern']", 0);
+ "//body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Kern']"_ostr,
+ 0);
- assertXPath(pXmlDoc, "//body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion", 3);
+ assertXPath(pXmlDoc, "//body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion"_ostr, 3);
assertXPath(pXmlDoc,
- "//body/txt[2]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Text']", 3);
+ "//body/txt[2]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Text']"_ostr,
+ 3);
assertXPath(pXmlDoc,
- "//body/txt[2]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Kern']", 0);
+ "//body/txt[2]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Kern']"_ostr,
+ 0);
// But also make sure there is a kern portion between each Western and Asian
// portion:
- assertXPath(pXmlDoc, "//body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion", 5);
+ assertXPath(pXmlDoc, "//body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion"_ostr, 5);
assertXPath(pXmlDoc,
- "//body/txt[3]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Text']", 3);
+ "//body/txt[3]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Text']"_ostr,
+ 3);
assertXPath(pXmlDoc,
- "//body/txt[3]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Kern']", 2);
- assertXPath(pXmlDoc, "//body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type",
- "PortionType::Kern");
- assertXPath(pXmlDoc, "//body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[4]", "type",
- "PortionType::Kern");
-
- assertXPath(pXmlDoc, "//body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion", 5);
+ "//body/txt[3]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Kern']"_ostr,
+ 2);
+ assertXPath(pXmlDoc, "//body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Kern");
+ assertXPath(pXmlDoc, "//body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[4]"_ostr,
+ "type"_ostr, "PortionType::Kern");
+
+ assertXPath(pXmlDoc, "//body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion"_ostr, 5);
assertXPath(pXmlDoc,
- "//body/txt[4]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Text']", 3);
+ "//body/txt[4]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Text']"_ostr,
+ 3);
assertXPath(pXmlDoc,
- "//body/txt[4]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Kern']", 2);
- assertXPath(pXmlDoc, "//body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type",
- "PortionType::Kern");
- assertXPath(pXmlDoc, "//body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[4]", "type",
- "PortionType::Kern");
+ "//body/txt[4]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Kern']"_ostr,
+ 2);
+ assertXPath(pXmlDoc, "//body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Kern");
+ assertXPath(pXmlDoc, "//body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[4]"_ostr,
+ "type"_ostr, "PortionType::Kern");
}
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf139863)
@@ -1419,8 +1433,8 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf139863)
// Without the fix we don’t even reach here, as the old code resulted in a
// lone surrogate which can’t be converted to UTF-8 for the layout dump and
// we get an assert in OString::toUtf8().
- assertXPath(pXmlDoc, "//body/txt[1]/SwParaPortion/SwLineLayout/child::*", 1);
- assertXPath(pXmlDoc, "//body/txt[2]/SwParaPortion/SwLineLayout/child::*", 1);
+ assertXPath(pXmlDoc, "//body/txt[1]/SwParaPortion/SwLineLayout/child::*"_ostr, 1);
+ assertXPath(pXmlDoc, "//body/txt[2]/SwParaPortion/SwLineLayout/child::*"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testParaUpperMarginFlyIntersect)
@@ -1436,15 +1450,16 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testParaUpperMarginFlyIntersect)
// upper margin, not based on the 1st para lower margin:
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
int nFlyCount
- = getXPathContent(pXmlDoc,
- "count(//SwParaPortion/SwLineLayout/child::*[@type='PortionType::Fly'])")
+ = getXPathContent(
+ pXmlDoc,
+ "count(//SwParaPortion/SwLineLayout/child::*[@type='PortionType::Fly'])"_ostr)
.toInt32();
int nHeight = 0;
for (int i = 1; i <= nFlyCount; ++i)
{
OString xPath = "(//SwParaPortion/SwLineLayout/child::*[@type='PortionType::Fly'])["
+ OString::number(i) + "]";
- nHeight += getXPath(pXmlDoc, xPath, "height").toInt32();
+ nHeight += getXPath(pXmlDoc, xPath, "height"_ostr).toInt32();
}
// Without the accompanying fix in place, this test would have failed with:
// - Expected: 521 (~500)
@@ -1503,20 +1518,20 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testScriptinfosurrogatePairs)
// Without the fix it fails with:
// - Expected: 11
// - Actual : 11◌
- assertXPath(pXmlDoc, "//txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "portion",
- u"11"_ustr);
- assertXPath(pXmlDoc, "//txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "portion",
- u"\u25CC\U00010A01"_ustr);
+ assertXPath(pXmlDoc, "//txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, u"11"_ustr);
+ assertXPath(pXmlDoc, "//txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, u"\u25CC\U00010A01"_ustr);
// Without the fix this would crash because we got a lone surrogate that
// can’t be converted to UTF-8, but if it were not for that it might fail
// with something like:
// - Expected: 11
// - Actual : 11𝐀
- assertXPath(pXmlDoc, "//txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "portion",
- u"11"_ustr);
- assertXPath(pXmlDoc, "//txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "portion",
- u"\U0001D400\u064E"_ustr);
+ assertXPath(pXmlDoc, "//txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, u"11"_ustr);
+ assertXPath(pXmlDoc, "//txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, u"\U0001D400\u064E"_ustr);
}
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf112594)
@@ -1530,8 +1545,9 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf112594)
// - Expected: 11
// - Actual : 11\u202F
// (U+020F is a space, so might not be visible)
- assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion[1]", "portion", u"11"_ustr);
- assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion[2]", "portion",
+ assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, "portion"_ostr,
+ u"11"_ustr);
+ assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, "portion"_ostr,
u"\u202F\u1824"_ustr);
}
diff --git a/sw/qa/core/txtnode/txtnode.cxx b/sw/qa/core/txtnode/txtnode.cxx
index c5d7d8fc740e..9369a187c482 100644
--- a/sw/qa/core/txtnode/txtnode.cxx
+++ b/sw/qa/core/txtnode/txtnode.cxx
@@ -60,12 +60,12 @@ CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testBtlrCellChinese)
std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile();
MetafileXmlDump dumper;
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
- assertXPath(pXmlDoc, "//font[1]", "orientation", "900");
+ assertXPath(pXmlDoc, "//font[1]"_ostr, "orientation"_ostr, "900");
// Without the accompanying fix in place, this test would have failed with:
// - Expected: false
// - Actual : true
// i.e. the glyph was rotated further, so it was upside down.
- assertXPath(pXmlDoc, "//font[1]", "vertical", "false");
+ assertXPath(pXmlDoc, "//font[1]"_ostr, "vertical"_ostr, "false");
}
CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testSpecialInsertAfterMergedCells)
diff --git a/sw/qa/core/unocore/unocore.cxx b/sw/qa/core/unocore/unocore.cxx
index ea0f802ad515..fd5c139e979a 100644
--- a/sw/qa/core/unocore/unocore.cxx
+++ b/sw/qa/core/unocore/unocore.cxx
@@ -425,15 +425,16 @@ CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testContentControlTextPortionEnum)
// Also test the generated layout:
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwFieldPortion", "expand", "");
+ assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr, "");
// Without the accompanying fix in place, this test would have failed with:
// - Expected: PortionType::ContentControl
// - Actual : PortionType::Text
// i.e. SwContentControl generated a plain text portion, not a dedicated content control
// portion.
- assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion", "type",
+ assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion"_ostr, "type"_ostr,
"PortionType::ContentControl");
- assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion", "portion", "test*");
+ assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion"_ostr, "portion"_ostr,
+ "test*");
// Also test the doc model, make sure that there is a dummy character at the start and end, so
// the user can explicitly decide if they want to expand the content control or not:
@@ -844,7 +845,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testParagraphMarkerODFExport)
// i.e. the custom "red" color was lost as RES_PARATR_LIST_AUTOFMT was not serialized to ODT.
CPPUNIT_ASSERT_EQUAL(
OUString("00ff0000"),
- getXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwFieldPortion/SwFont", "color"));
+ getXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwFieldPortion/SwFont"_ostr, "color"_ostr));
}
CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testParagraphMarkerFormattedRun)
@@ -861,9 +862,10 @@ CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testParagraphMarkerFormattedRun)
// - Expected: normal
// - Actual : bold
// i.e. the numbering portion was bold, while its weight should be normal.
- CPPUNIT_ASSERT_EQUAL(
- OUString("normal"),
- getXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwFieldPortion/SwFont", "weight"));
+ CPPUNIT_ASSERT_EQUAL(OUString("normal"),
+ getXPath(pXmlDoc,
+ "//SwParaPortion/SwLineLayout/SwFieldPortion/SwFont"_ostr,
+ "weight"_ostr));
}
CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testFlySplit)
@@ -982,7 +984,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testCollectFrameAtNodeWithLayout)
// element.
xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
// Also make sure that we don't have multiple <draw:frame> elements in the first place.
- assertXPath(pXmlDoc, "//draw:frame", 1);
+ assertXPath(pXmlDoc, "//draw:frame"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testTdf149555)
diff --git a/sw/qa/extras/docbookexport/docbookexport.cxx b/sw/qa/extras/docbookexport/docbookexport.cxx
index 74241d353d33..10568528b10b 100644
--- a/sw/qa/extras/docbookexport/docbookexport.cxx
+++ b/sw/qa/extras/docbookexport/docbookexport.cxx
@@ -24,7 +24,7 @@ DECLARE_DOCBOOKEXPORT_TEST(testsimple, "simple.docx")
xmlDocUniquePtr pDoc = parseXml(maTempFile);
CPPUNIT_ASSERT(pDoc);
- assertXPathContent(pDoc, "/article/para", "aaaa");
+ assertXPathContent(pDoc, "/article/para"_ostr, "aaaa");
}
/* the test actually should crash with this file */
diff --git a/sw/qa/extras/fodfexport/fodfexport.cxx b/sw/qa/extras/fodfexport/fodfexport.cxx
index c666d7a31054..30bcc1fcf54a 100644
--- a/sw/qa/extras/fodfexport/fodfexport.cxx
+++ b/sw/qa/extras/fodfexport/fodfexport.cxx
@@ -28,9 +28,9 @@ DECLARE_FODFEXPORT_TEST(testTdf113696, "tdf113696.odt")
if (xmlDocUniquePtr pXmlDoc = parseExportedFile())
{
assertXPath(pXmlDoc, "/office:document/office:body/office:text/text:p/draw:frame/"
- "draw:image[@draw:mime-type='image/x-vclgraphic']");
+ "draw:image[@draw:mime-type='image/x-vclgraphic']"_ostr);
assertXPath(pXmlDoc, "/office:document/office:body/office:text/text:p/draw:frame/"
- "draw:image[@draw:mime-type='image/png']");
+ "draw:image[@draw:mime-type='image/png']"_ostr);
}
}
@@ -43,9 +43,9 @@ DECLARE_FODFEXPORT_TEST(testTdf113696WriterImage, "tdf113696-writerimage.odt")
if (xmlDocUniquePtr pXmlDoc = parseExportedFile())
{
assertXPath(pXmlDoc, "/office:document/office:body/office:text/text:p/draw:frame/"
- "draw:image[@draw:mime-type='image/x-vclgraphic']");
+ "draw:image[@draw:mime-type='image/x-vclgraphic']"_ostr);
assertXPath(pXmlDoc, "/office:document/office:body/office:text/text:p/draw:frame/"
- "draw:image[@draw:mime-type='image/png']");
+ "draw:image[@draw:mime-type='image/png']"_ostr);
}
}
diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx b/sw/qa/extras/globalfilter/globalfilter.cxx
index cdf56ccf45d5..c12e300ebfaa 100644
--- a/sw/qa/extras/globalfilter/globalfilter.cxx
+++ b/sw/qa/extras/globalfilter/globalfilter.cxx
@@ -983,18 +983,18 @@ void Test::testODF13()
// check XML
xmlDocUniquePtr pContentXml = parseExport("content.xml");
- assertXPath(pContentXml, "/office:document-content/office:automatic-styles/style:style/style:paragraph-properties[@style:contextual-spacing='true']");
- assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:p/office:annotation/meta:creator-initials");
- assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:p/office:annotation/loext:sender-initials", 0);
- assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:illustration-index/text:illustration-index-source/text:illustration-index-entry-template/text:index-entry-link-start");
- assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:illustration-index/text:illustration-index-source/text:illustration-index-entry-template/loext:index-entry-link-start", 0);
- assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:illustration-index/text:illustration-index-source/text:illustration-index-entry-template/text:index-entry-link-end");
- assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:illustration-index/text:illustration-index-source/text:illustration-index-entry-template/loext:index-entry-link-end", 0);
+ assertXPath(pContentXml, "/office:document-content/office:automatic-styles/style:style/style:paragraph-properties[@style:contextual-spacing='true']"_ostr);
+ assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:p/office:annotation/meta:creator-initials"_ostr);
+ assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:p/office:annotation/loext:sender-initials"_ostr, 0);
+ assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:illustration-index/text:illustration-index-source/text:illustration-index-entry-template/text:index-entry-link-start"_ostr);
+ assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:illustration-index/text:illustration-index-source/text:illustration-index-entry-template/loext:index-entry-link-start"_ostr, 0);
+ assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:illustration-index/text:illustration-index-source/text:illustration-index-entry-template/text:index-entry-link-end"_ostr);
+ assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:illustration-index/text:illustration-index-source/text:illustration-index-entry-template/loext:index-entry-link-end"_ostr, 0);
xmlDocUniquePtr pStylesXml = parseExport("styles.xml");
- assertXPath(pStylesXml, "/office:document-styles/office:master-styles/style:master-page/style:header-first");
- assertXPath(pStylesXml, "/office:document-styles/office:master-styles/style:master-page/loext:header-first", 0);
- assertXPath(pStylesXml, "/office:document-styles/office:master-styles/style:master-page/style:footer-first");
- assertXPath(pStylesXml, "/office:document-styles/office:master-styles/style:master-page/loext:footer-first", 0);
+ assertXPath(pStylesXml, "/office:document-styles/office:master-styles/style:master-page/style:header-first"_ostr);
+ assertXPath(pStylesXml, "/office:document-styles/office:master-styles/style:master-page/loext:header-first"_ostr, 0);
+ assertXPath(pStylesXml, "/office:document-styles/office:master-styles/style:master-page/style:footer-first"_ostr);
+ assertXPath(pStylesXml, "/office:document-styles/office:master-styles/style:master-page/loext:footer-first"_ostr, 0);
// check model
verifyText13("1.3 reload");
@@ -1016,18 +1016,18 @@ void Test::testODF13()
// check XML
xmlDocUniquePtr pContentXml = parseExport("content.xml");
- assertXPath(pContentXml, "/office:document-content/office:automatic-styles/style:style/style:paragraph-properties[@loext:contextual-spacing='true']");
- assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:p/office:annotation/loext:sender-initials");
- assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:p/office:annotation/meta:creator-initials", 0);
- assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:illustration-index/text:illustration-index-source/text:illustration-index-entry-template/loext:index-entry-link-start");
- assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:illustration-index/text:illustration-index-source/text:illustration-index-entry-template/text:index-entry-link-start", 0);
- assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:illustration-index/text:illustration-index-source/text:illustration-index-entry-template/loext:index-entry-link-end");
- assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:illustration-index/text:illustration-index-source/text:illustration-index-entry-template/text:index-entry-link-end", 0);
+ assertXPath(pContentXml, "/office:document-content/office:automatic-styles/style:style/style:paragraph-properties[@loext:contextual-spacing='true']"_ostr);
+ assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:p/office:annotation/loext:sender-initials"_ostr);
+ assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:p/office:annotation/meta:creator-initials"_ostr, 0);
+ assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:illustration-index/text:illustration-index-source/text:illustration-index-entry-template/loext:index-entry-link-start"_ostr);
+ assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:illustration-index/text:illustration-index-source/text:illustration-index-entry-template/text:index-entry-link-start"_ostr, 0);
+ assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:illustration-index/text:illustration-index-source/text:illustration-index-entry-template/loext:index-entry-link-end"_ostr);
+ assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:illustration-index/text:illustration-index-source/text:illustration-index-entry-template/text:index-entry-link-end"_ostr, 0);
xmlDocUniquePtr pStylesXml = parseExport("styles.xml");
- assertXPath(pStylesXml, "/office:document-styles/office:master-styles/style:master-page/loext:header-first");
- assertXPath(pStylesXml, "/office:document-styles/office:master-styles/style:master-page/style:header-first", 0);
- assertXPath(pStylesXml, "/office:document-styles/office:master-styles/style:master-page/loext:footer-first");
- assertXPath(pStylesXml, "/office:document-styles/office:master-styles/style:master-page/style:footer-first", 0);
+ assertXPath(pStylesXml, "/office:document-styles/office:master-styles/style:master-page/loext:header-first"_ostr);
+ assertXPath(pStylesXml, "/office:document-styles/office:master-styles/style:master-page/style:header-first"_ostr, 0);
+ assertXPath(pStylesXml, "/office:document-styles/office:master-styles/style:master-page/loext:footer-first"_ostr);
+ assertXPath(pStylesXml, "/office:document-styles/office:master-styles/style:master-page/style:footer-first"_ostr, 0);
// reload
mxComponent->dispose();
@@ -1048,18 +1048,18 @@ void Test::testODF13()
// check XML
xmlDocUniquePtr pContentXml = parseExport("content.xml");
- assertXPathNoAttribute(pContentXml, "/office:document-content/office:automatic-styles/style:style/style:paragraph-properties", "contextual-spacing");
- assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:p/office:annotation/meta:creator-initials", 0);
- assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:p/office:annotation/loext:sender-initials", 0);
- assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:illustration-index/text:illustration-index-source/text:illustration-index-entry-template/text:index-entry-link-start", 0);
- assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:illustration-index/text:illustration-index-source/text:illustration-index-entry-template/loext:index-entry-link-start", 0);
- assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:illustration-index/text:illustration-index-source/text:illustration-index-entry-template/text:index-entry-link-end", 0);
- assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:illustration-index/text:illustration-index-source/text:illustration-index-entry-template/loext:index-entry-link-end", 0);
+ assertXPathNoAttribute(pContentXml, "/office:document-content/office:automatic-styles/style:style/style:paragraph-properties"_ostr, "contextual-spacing"_ostr);
+ assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:p/office:annotation/meta:creator-initials"_ostr, 0);
+ assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:p/office:annotation/loext:sender-initials"_ostr, 0);
+ assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:illustration-index/text:illustration-index-source/text:illustration-index-entry-template/text:index-entry-link-start"_ostr, 0);
+ assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:illustration-index/text:illustration-index-source/text:illustration-index-entry-template/loext:index-entry-link-start"_ostr, 0);
+ assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:illustration-index/text:illustration-index-source/text:illustration-index-entry-template/text:index-entry-link-end"_ostr, 0);
+ assertXPath(pContentXml, "/office:document-content/office:body/office:text/text:illustration-index/text:illustration-index-source/text:illustration-index-entry-template/loext:index-entry-link-end"_ostr, 0);
xmlDocUniquePtr pStylesXml = parseExport("styles.xml");
- assertXPath(pStylesXml, "/office:document-styles/office:master-styles/style:master-page/style:header-first", 0);
- assertXPath(pStylesXml, "/office:document-styles/office:master-styles/style:master-page/loext:header-first", 0);
- assertXPath(pStylesXml, "/office:document-styles/office:master-styles/style:master-page/style:footer-first", 0);
- assertXPath(pStylesXml, "/office:document-styles/office:master-styles/style:master-page/loext:footer-first", 0);
+ assertXPath(pStylesXml, "/office:document-styles/office:master-styles/style:master-page/style:header-first"_ostr, 0);
+ assertXPath(pStylesXml, "/office:document-styles/office:master-styles/style:master-page/loext:header-first"_ostr, 0);
+ assertXPath(pStylesXml, "/office:document-styles/office:master-styles/style:master-page/style:footer-first"_ostr, 0);
+ assertXPath(pStylesXml, "/office:document-styles/office:master-styles/style:master-page/loext:footer-first"_ostr, 0);
}
}
@@ -1318,7 +1318,7 @@ CPPUNIT_TEST_FIXTURE(Test, testListLabelPDFExport)
std::vector<vcl::filter::PDFObjectElement*> aPages = aDocument.GetPages();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aPages.size());
- vcl::filter::PDFObjectElement* pContents = aPages[0]->LookupObject("Contents");
+ vcl::filter::PDFObjectElement* pContents = aPages[0]->LookupObject("Contents"_ostr);
CPPUNIT_ASSERT(pContents);
vcl::filter::PDFStreamElement* pStream = pContents->GetStream();
CPPUNIT_ASSERT(pStream);
@@ -1406,17 +1406,17 @@ CPPUNIT_TEST_FIXTURE(Test, testListLabelPDFExport)
auto pObject0 = dynamic_cast<vcl::filter::PDFObjectElement*>(rDocElement.get());
if (!pObject0)
continue;
- auto pType0 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject0->Lookup("Type"));
+ auto pType0 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject0->Lookup("Type"_ostr));
if (!pType0 || pType0->GetValue() != "StructElem")
{
continue;
}
- auto pS0 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject0->Lookup("S"));
+ auto pS0 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject0->Lookup("S"_ostr));
if (!pS0 || pS0->GetValue() != "Document")
{
continue;
}
- auto pKids0 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject0->Lookup("K"));
+ auto pKids0 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject0->Lookup("K"_ostr));
CPPUNIT_ASSERT(pKids0);
for (const auto& pKid0 : pKids0->GetElements())
@@ -1425,16 +1425,16 @@ CPPUNIT_TEST_FIXTURE(Test, testListLabelPDFExport)
CPPUNIT_ASSERT(pRefKid0);
auto pObject1 = pRefKid0->LookupObject();
CPPUNIT_ASSERT(pObject1);
- auto pType1 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject1->Lookup("Type"));
+ auto pType1 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject1->Lookup("Type"_ostr));
CPPUNIT_ASSERT(pType1);
if (pType1 && pType1->GetValue() == "StructElem")
{
- auto pS1 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject1->Lookup("S"));
+ auto pS1 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject1->Lookup("S"_ostr));
if (pS1 && pS1->GetValue() == "L")
{
++nL;
- auto pKids1 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject1->Lookup("K"));
+ auto pKids1 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject1->Lookup("K"_ostr));
CPPUNIT_ASSERT(pKids1);
// this is purely structural so there should be 1 child
CPPUNIT_ASSERT_EQUAL(size_t(1), pKids1->GetElements().size());
@@ -1443,14 +1443,14 @@ CPPUNIT_TEST_FIXTURE(Test, testListLabelPDFExport)
CPPUNIT_ASSERT(pRefKid11);
auto pObject11 = pRefKid11->LookupObject();
CPPUNIT_ASSERT(pObject11);
- auto pType11 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject11->Lookup("Type"));
+ auto pType11 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject11->Lookup("Type"_ostr));
CPPUNIT_ASSERT(pType11);
- CPPUNIT_ASSERT_EQUAL(OString("StructElem"), pType11->GetValue());
- auto pS11 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject11->Lookup("S"));
+ CPPUNIT_ASSERT_EQUAL("StructElem"_ostr, pType11->GetValue());
+ auto pS11 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject11->Lookup("S"_ostr));
CPPUNIT_ASSERT(pS11);
- CPPUNIT_ASSERT_EQUAL(OString("LI"), pS11->GetValue());
+ CPPUNIT_ASSERT_EQUAL("LI"_ostr, pS11->GetValue());
// LI has 2 children: Lbl and LBody
- auto pKids11 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject11->Lookup("K"));
+ auto pKids11 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject11->Lookup("K"_ostr));
CPPUNIT_ASSERT(pKids11);
CPPUNIT_ASSERT_EQUAL(size_t(2), pKids11->GetElements().size());
@@ -1458,14 +1458,14 @@ CPPUNIT_TEST_FIXTURE(Test, testListLabelPDFExport)
CPPUNIT_ASSERT(pRefKid111);
auto pObject111 = pRefKid111->LookupObject();
CPPUNIT_ASSERT(pObject111);
- auto pType111 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject111->Lookup("Type"));
+ auto pType111 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject111->Lookup("Type"_ostr));
CPPUNIT_ASSERT(pType111);
- CPPUNIT_ASSERT_EQUAL(OString("StructElem"), pType111->GetValue());
- auto pS111 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject111->Lookup("S"));
+ CPPUNIT_ASSERT_EQUAL("StructElem"_ostr, pType111->GetValue());
+ auto pS111 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject111->Lookup("S"_ostr));
CPPUNIT_ASSERT(pS111);
- CPPUNIT_ASSERT_EQUAL(OString("Lbl"), pS111->GetValue());
+ CPPUNIT_ASSERT_EQUAL("Lbl"_ostr, pS111->GetValue());
// Lbl has 2 children: the first 2 mcids (in order)
- auto pKids111 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject111->Lookup("K"));
+ auto pKids111 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject111->Lookup("K"_ostr));
CPPUNIT_ASSERT(pKids111);
CPPUNIT_ASSERT_EQUAL(size_t(2), pKids111->GetElements().size());
@@ -1480,14 +1480,14 @@ CPPUNIT_TEST_FIXTURE(Test, testListLabelPDFExport)
CPPUNIT_ASSERT(pRefKid112);
auto pObject112 = pRefKid112->LookupObject();
CPPUNIT_ASSERT(pObject112);
- auto pType112 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject112->Lookup("Type"));
+ auto pType112 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject112->Lookup("Type"_ostr));
CPPUNIT_ASSERT(pType112);
- CPPUNIT_ASSERT_EQUAL(OString("StructElem"), pType112->GetValue());
- auto pS112 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject112->Lookup("S"));
+ CPPUNIT_ASSERT_EQUAL("StructElem"_ostr, pType112->GetValue());
+ auto pS112 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject112->Lookup("S"_ostr));
CPPUNIT_ASSERT(pS112);
- CPPUNIT_ASSERT_EQUAL(OString("LBody"), pS112->GetValue());
+ CPPUNIT_ASSERT_EQUAL("LBody"_ostr, pS112->GetValue());
// LBody has 2 children: paragraph and nested L (in order)
- auto pKids112 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject112->Lookup("K"));
+ auto pKids112 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject112->Lookup("K"_ostr));
CPPUNIT_ASSERT(pKids112);
CPPUNIT_ASSERT_EQUAL(size_t(2), pKids112->GetElements().size());
@@ -1495,24 +1495,24 @@ CPPUNIT_TEST_FIXTURE(Test, testListLabelPDFExport)
CPPUNIT_ASSERT(pRefKid1121);
auto pObject1121 = pRefKid1121->LookupObject();
CPPUNIT_ASSERT(pObject1121);
- auto pType1121 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject1121->Lookup("Type"));
+ auto pType1121 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject1121->Lookup("Type"_ostr));
CPPUNIT_ASSERT(pType1121);
- CPPUNIT_ASSERT_EQUAL(OString("StructElem"), pType1121->GetValue());
- auto pS1121 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject1121->Lookup("S"));
+ CPPUNIT_ASSERT_EQUAL("StructElem"_ostr, pType1121->GetValue());
+ auto pS1121 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject1121->Lookup("S"_ostr));
CPPUNIT_ASSERT(pS1121);
- CPPUNIT_ASSERT_EQUAL(OString("Standard"), pS1121->GetValue());
+ CPPUNIT_ASSERT_EQUAL("Standard"_ostr, pS1121->GetValue());
auto pRefKid1122 = dynamic_cast<vcl::filter::PDFReferenceElement*>(pKids112->GetElements()[1]);
CPPUNIT_ASSERT(pRefKid1122);
auto pObject1122 = pRefKid1122->LookupObject();
CPPUNIT_ASSERT(pObject1122);
- auto pType1122 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject1122->Lookup("Type"));
+ auto pType1122 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject1122->Lookup("Type"_ostr));
CPPUNIT_ASSERT(pType1122);
- CPPUNIT_ASSERT_EQUAL(OString("StructElem"), pType1122->GetValue());
- auto pS1122 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject1122->Lookup("S"));
+ CPPUNIT_ASSERT_EQUAL("StructElem"_ostr, pType1122->GetValue());
+ auto pS1122 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject1122->Lookup("S"_ostr));
CPPUNIT_ASSERT(pS1122);
- CPPUNIT_ASSERT_EQUAL(OString("L"), pS1122->GetValue());
- auto pKids1122 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject1122->Lookup("K"));
+ CPPUNIT_ASSERT_EQUAL("L"_ostr, pS1122->GetValue());
+ auto pKids1122 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject1122->Lookup("K"_ostr));
CPPUNIT_ASSERT(pKids1122);
// this is purely structural so there should be 1 child
CPPUNIT_ASSERT_EQUAL(size_t(1), pKids1122->GetElements().size());
@@ -1521,14 +1521,14 @@ CPPUNIT_TEST_FIXTURE(Test, testListLabelPDFExport)
CPPUNIT_ASSERT(pRefKid11221);
auto pObject11221 = pRefKid11221->LookupObject();
CPPUNIT_ASSERT(pObject11221);
- auto pType11221 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject11221->Lookup("Type"));
+ auto pType11221 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject11221->Lookup("Type"_ostr));
CPPUNIT_ASSERT(pType11221);
- CPPUNIT_ASSERT_EQUAL(OString("StructElem"), pType11221->GetValue());
- auto pS11221 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject11221->Lookup("S"));
+ CPPUNIT_ASSERT_EQUAL("StructElem"_ostr, pType11221->GetValue());
+ auto pS11221 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject11221->Lookup("S"_ostr));
CPPUNIT_ASSERT(pS11221);
- CPPUNIT_ASSERT_EQUAL(OString("LI"), pS11221->GetValue());
+ CPPUNIT_ASSERT_EQUAL("LI"_ostr, pS11221->GetValue());
// LI has 2 children: Lbl and LBody
- auto pKids11221 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject11221->Lookup("K"));
+ auto pKids11221 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject11221->Lookup("K"_ostr));
CPPUNIT_ASSERT(pKids11221);
CPPUNIT_ASSERT_EQUAL(size_t(2), pKids11221->GetElements().size());
@@ -1536,14 +1536,14 @@ CPPUNIT_TEST_FIXTURE(Test, testListLabelPDFExport)
CPPUNIT_ASSERT(pRefKid112211);
auto pObject112211 = pRefKid112211->LookupObject();
CPPUNIT_ASSERT(pObject112211);
- auto pType112211 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject112211->Lookup("Type"));
+ auto pType112211 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject112211->Lookup("Type"_ostr));
CPPUNIT_ASSERT(pType112211);
- CPPUNIT_ASSERT_EQUAL(OString("StructElem"), pType112211->GetValue());
- auto pS112211 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject112211->Lookup("S"));
+ CPPUNIT_ASSERT_EQUAL("StructElem"_ostr, pType112211->GetValue());
+ auto pS112211 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject112211->Lookup("S"_ostr));
CPPUNIT_ASSERT(pS112211);
- CPPUNIT_ASSERT_EQUAL(OString("Lbl"), pS112211->GetValue());
+ CPPUNIT_ASSERT_EQUAL("Lbl"_ostr, pS112211->GetValue());
// Lbl has 2 children: the first 2 mcids (in order)
- auto pKids112211 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject112211->Lookup("K"));
+ auto pKids112211 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject112211->Lookup("K"_ostr));
CPPUNIT_ASSERT(pKids112211);
CPPUNIT_ASSERT_EQUAL(size_t(2), pKids112211->GetElements().size());
@@ -1558,14 +1558,14 @@ CPPUNIT_TEST_FIXTURE(Test, testListLabelPDFExport)
CPPUNIT_ASSERT(pRefKid112212);
auto pObject112212 = pRefKid112212->LookupObject();
CPPUNIT_ASSERT(pObject112212);
- auto pType112212 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject112212->Lookup("Type"));
+ auto pType112212 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject112212->Lookup("Type"_ostr));
CPPUNIT_ASSERT(pType112212);
- CPPUNIT_ASSERT_EQUAL(OString("StructElem"), pType112212->GetValue());
- auto pS112212 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject112212->Lookup("S"));
+ CPPUNIT_ASSERT_EQUAL("StructElem"_ostr, pType112212->GetValue());
+ auto pS112212 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject112212->Lookup("S"_ostr));
CPPUNIT_ASSERT(pS112212);
- CPPUNIT_ASSERT_EQUAL(OString("LBody"), pS112212->GetValue());
+ CPPUNIT_ASSERT_EQUAL("LBody"_ostr, pS112212->GetValue());
// LBody has 2 children: paragraph and nested L (in order)
- auto pKids112212 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject112212->Lookup("K"));
+ auto pKids112212 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject112212->Lookup("K"_ostr));
CPPUNIT_ASSERT(pKids112212);
CPPUNIT_ASSERT_EQUAL(size_t(2), pKids112212->GetElements().size());
@@ -1573,24 +1573,24 @@ CPPUNIT_TEST_FIXTURE(Test, testListLabelPDFExport)
CPPUNIT_ASSERT(pRefKid1122121);
auto pObject1122121 = pRefKid1122121->LookupObject();
CPPUNIT_ASSERT(pObject1122121);
- auto pType1122121 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject1122121->Lookup("Type"));
+ auto pType1122121 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject1122121->Lookup("Type"_ostr));
CPPUNIT_ASSERT(pType1122121);
- CPPUNIT_ASSERT_EQUAL(OString("StructElem"), pType1122121->GetValue());
- auto pS1122121 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject1122121->Lookup("S"));
+ CPPUNIT_ASSERT_EQUAL("StructElem"_ostr, pType1122121->GetValue());
+ auto pS1122121 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject1122121->Lookup("S"_ostr));
CPPUNIT_ASSERT(pS1122121);
- CPPUNIT_ASSERT_EQUAL(OString("Standard"), pS1122121->GetValue());
+ CPPUNIT_ASSERT_EQUAL("Standard"_ostr, pS1122121->GetValue());
auto pRefKid1122122 = dynamic_cast<vcl::filter::PDFReferenceElement*>(pKids112212->GetElements()[1]);
CPPUNIT_ASSERT(pRefKid1122122);
auto pObject1122122 = pRefKid1122122->LookupObject();
CPPUNIT_ASSERT(pObject1122122);
- auto pType1122122 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject1122122->Lookup("Type"));
+ auto pType1122122 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject1122122->Lookup("Type"_ostr));
CPPUNIT_ASSERT(pType1122122);
- CPPUNIT_ASSERT_EQUAL(OString("StructElem"), pType1122122->GetValue());
- auto pS1122122 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject1122122->Lookup("S"));
+ CPPUNIT_ASSERT_EQUAL("StructElem"_ostr, pType1122122->GetValue());
+ auto pS1122122 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject1122122->Lookup("S"_ostr));
CPPUNIT_ASSERT(pS1122122);
- CPPUNIT_ASSERT_EQUAL(OString("L"), pS1122122->GetValue());
- auto pKids1122122 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject1122122->Lookup("K"));
+ CPPUNIT_ASSERT_EQUAL("L"_ostr, pS1122122->GetValue());
+ auto pKids1122122 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject1122122->Lookup("K"_ostr));
CPPUNIT_ASSERT(pKids1122122);
// this is purely structural so there should be 1 child
CPPUNIT_ASSERT_EQUAL(size_t(1), pKids1122122->GetElements().size());
@@ -1599,14 +1599,14 @@ CPPUNIT_TEST_FIXTURE(Test, testListLabelPDFExport)
CPPUNIT_ASSERT(pRefKid11221221);
auto pObject11221221 = pRefKid11221221->LookupObject();
CPPUNIT_ASSERT(pObject11221221);
- auto pType11221221 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject11221221->Lookup("Type"));
+ auto pType11221221 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject11221221->Lookup("Type"_ostr));
CPPUNIT_ASSERT(pType11221221);
- CPPUNIT_ASSERT_EQUAL(OString("StructElem"), pType11221221->GetValue());
- auto pS11221221 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject11221221->Lookup("S"));
+ CPPUNIT_ASSERT_EQUAL("StructElem"_ostr, pType11221221->GetValue());
+ auto pS11221221 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject11221221->Lookup("S"_ostr));
CPPUNIT_ASSERT(pS11221221);
- CPPUNIT_ASSERT_EQUAL(OString("LI"), pS11221221->GetValue());
+ CPPUNIT_ASSERT_EQUAL("LI"_ostr, pS11221221->GetValue());
// LI has 2 children: Lbl and LBody
- auto pKids11221221 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject11221221->Lookup("K"));
+ auto pKids11221221 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject11221221->Lookup("K"_ostr));
CPPUNIT_ASSERT(pKids11221221);
CPPUNIT_ASSERT_EQUAL(size_t(2), pKids11221221->GetElements().size());
@@ -1614,14 +1614,14 @@ CPPUNIT_TEST_FIXTURE(Test, testListLabelPDFExport)
CPPUNIT_ASSERT(pRefKid112212211);
auto pObject112212211 = pRefKid112212211->LookupObject();
CPPUNIT_ASSERT(pObject112212211);
- auto pType112212211 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject112212211->Lookup("Type"));
+ auto pType112212211 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject112212211->Lookup("Type"_ostr));
CPPUNIT_ASSERT(pType112212211);
- CPPUNIT_ASSERT_EQUAL(OString("StructElem"), pType112212211->GetValue());
- auto pS112212211 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject112212211->Lookup("S"));
+ CPPUNIT_ASSERT_EQUAL("StructElem"_ostr, pType112212211->GetValue());
+ auto pS112212211 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject112212211->Lookup("S"_ostr));
CPPUNIT_ASSERT(pS112212211);
- CPPUNIT_ASSERT_EQUAL(OString("Lbl"), pS112212211->GetValue());
+ CPPUNIT_ASSERT_EQUAL("Lbl"_ostr, pS112212211->GetValue());
// Lbl has 2 children: the first 2 mcids (in order)
- auto pKids112212211 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject112212211->Lookup("K"));
+ auto pKids112212211 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject112212211->Lookup("K"_ostr));
CPPUNIT_ASSERT(pKids112212211);
CPPUNIT_ASSERT_EQUAL(size_t(2), pKids112212211->GetElements().size());
@@ -1636,14 +1636,14 @@ CPPUNIT_TEST_FIXTURE(Test, testListLabelPDFExport)
CPPUNIT_ASSERT(pRefKid112212212);
auto pObject112212212 = pRefKid112212212->LookupObject();
CPPUNIT_ASSERT(pObject112212212);
- auto pType112212212 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject112212212->Lookup("Type"));
+ auto pType112212212 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject112212212->Lookup("Type"_ostr));
CPPUNIT_ASSERT(pType112212212);
- CPPUNIT_ASSERT_EQUAL(OString("StructElem"), pType112212212->GetValue());
- auto pS112212212 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject112212212->Lookup("S"));
+ CPPUNIT_ASSERT_EQUAL("StructElem"_ostr, pType112212212->GetValue());
+ auto pS112212212 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject112212212->Lookup("S"_ostr));
CPPUNIT_ASSERT(pS112212212);
- CPPUNIT_ASSERT_EQUAL(OString("LBody"), pS112212212->GetValue());
+ CPPUNIT_ASSERT_EQUAL("LBody"_ostr, pS112212212->GetValue());
// inner LBody has 1 children: paragraph
- auto pKids112212212 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject112212212->Lookup("K"));
+ auto pKids112212212 = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject112212212->Lookup("K"_ostr));
CPPUNIT_ASSERT(pKids112212212);
CPPUNIT_ASSERT_EQUAL(size_t(1), pKids112212212->GetElements().size());
@@ -1651,12 +1651,12 @@ CPPUNIT_TEST_FIXTURE(Test, testListLabelPDFExport)
CPPUNIT_ASSERT(pRefKid1122122121);
auto pObject1122122121 = pRefKid1122122121->LookupObject();
CPPUNIT_ASSERT(pObject1122122121);
- auto pType1122122121 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject1122122121->Lookup("Type"));
+ auto pType1122122121 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject1122122121->Lookup("Type"_ostr));
CPPUNIT_ASSERT(pType1122122121);
- CPPUNIT_ASSERT_EQUAL(OString("StructElem"), pType1122122121->GetValue());
- auto pS1122122121 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject1122122121->Lookup("S"));
+ CPPUNIT_ASSERT_EQUAL("StructElem"_ostr, pType1122122121->GetValue());
+ auto pS1122122121 = dynamic_cast<vcl::filter::PDFNameElement*>(pObject1122122121->Lookup("S"_ostr));
CPPUNIT_ASSERT(pS1122122121);
- CPPUNIT_ASSERT_EQUAL(OString("Standard"), pS1122122121->GetValue());
+ CPPUNIT_ASSERT_EQUAL("Standard"_ostr, pS1122122121->GetValue());
}
}
}
@@ -1713,7 +1713,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143311)
std::vector<vcl::filter::PDFObjectElement*> aPages = aDocument.GetPages();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aPages.size());
- vcl::filter::PDFObjectElement* pContents = aPages[0]->LookupObject("Contents");
+ vcl::filter::PDFObjectElement* pContents = aPages[0]->LookupObject("Contents"_ostr);
CPPUNIT_ASSERT(pContents);
vcl::filter::PDFStreamElement* pStream = pContents->GetStream();
CPPUNIT_ASSERT(pStream);
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx
index b4d3bfaaf10a..c436411daf52 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -234,8 +234,9 @@ OUString SwHtmlDomExportTest::GetObjectPath(const OUString& ext)
{
assert(ext.startsWith("."));
xmlDocUniquePtr pDoc = WrapReqifFromTempFile();
- OUString aOlePath = getXPath(
- pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p/reqif-xhtml:object", "data");
+ OUString aOlePath
+ = getXPath(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p/reqif-xhtml:object"_ostr,
+ "data"_ostr);
CPPUNIT_ASSERT(aOlePath.endsWith(ext));
INetURLObject aUrl(maTempFile.GetURL());
aUrl.setBase(aOlePath.subView(0, aOlePath.getLength() - ext.getLength()));
@@ -382,8 +383,8 @@ DECLARE_HTMLEXPORT_TEST(testExportOfImages, "textAndImage.docx")
htmlDocUniquePtr pDoc = parseHtml(maTempFile);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/html/body", 1);
- assertXPath(pDoc, "/html/body/p/img", 1);
+ assertXPath(pDoc, "/html/body"_ostr, 1);
+ assertXPath(pDoc, "/html/body/p/img"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(HtmlExportTest, testExportOfImagesWithSkipImagesEnabled)
@@ -395,8 +396,8 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testExportOfImagesWithSkipImagesEnabled)
htmlDocUniquePtr pDoc = parseHtml(maTempFile);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/html/body", 1);
- assertXPath(pDoc, "/html/body/p/img", 0);
+ assertXPath(pDoc, "/html/body"_ostr, 1);
+ assertXPath(pDoc, "/html/body/p/img"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(HtmlExportTest, testSkipImagesEmbedded)
@@ -411,11 +412,11 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testSkipImagesEmbedded)
CPPUNIT_ASSERT(pDoc);
// This was 0.
- assertXPath(pDoc, "//table", 1);
+ assertXPath(pDoc, "//table"_ostr, 1);
// This was 2, the HTML header was in the document two times.
- assertXPath(pDoc, "//meta[@name='generator']", 1);
+ assertXPath(pDoc, "//meta[@name='generator']"_ostr, 1);
// This was 0, <table> was directly under <p>, which caused errors in the parser.
- assertXPath(pDoc, "//span/table", 1);
+ assertXPath(pDoc, "//span/table"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(HtmlExportTest, testSkipImagesEmbeddedDocument)
@@ -430,9 +431,9 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testSkipImagesEmbeddedDocument)
CPPUNIT_ASSERT(pDoc);
// This was 2, the HTML header was in the document two times.
- assertXPath(pDoc, "//meta[@name='generator']", 1);
+ assertXPath(pDoc, "//meta[@name='generator']"_ostr, 1);
// Text of embedded document was missing.
- assertXPathContent(pDoc, "/html/body/p/span/p/span", "Inner.");
+ assertXPathContent(pDoc, "/html/body/p/span/p/span"_ostr, "Inner.");
}
DECLARE_HTMLEXPORT_TEST(testExportImageProperties, "HTMLImage.odt")
@@ -440,23 +441,23 @@ DECLARE_HTMLEXPORT_TEST(testExportImageProperties, "HTMLImage.odt")
htmlDocUniquePtr pDoc = parseHtml(maTempFile);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/html/body", 1);
+ assertXPath(pDoc, "/html/body"_ostr, 1);
- assertXPath(pDoc, "/html/body/p/map/area", "shape", "poly");
- assertXPath(pDoc, "/html/body/p/map/area", "href", "http://www.microsoft.com/");
- assertXPath(pDoc, "/html/body/p/map/area", "target", "_self");
- assertXPath(pDoc, "/html/body/p/map/area", "alt", "microsoft");
+ assertXPath(pDoc, "/html/body/p/map/area"_ostr, "shape"_ostr, "poly");
+ assertXPath(pDoc, "/html/body/p/map/area"_ostr, "href"_ostr, "http://www.microsoft.com/");
+ assertXPath(pDoc, "/html/body/p/map/area"_ostr, "target"_ostr, "_self");
+ assertXPath(pDoc, "/html/body/p/map/area"_ostr, "alt"_ostr, "microsoft");
- assertXPath(pDoc, "/html/body/p/a", 1);
- assertXPath(pDoc, "/html/body/p/a", "href", "http://www.google.com/");
+ assertXPath(pDoc, "/html/body/p/a"_ostr, 1);
+ assertXPath(pDoc, "/html/body/p/a"_ostr, "href"_ostr, "http://www.google.com/");
- assertXPath(pDoc, "/html/body/p/a/font", 1);
- assertXPath(pDoc, "/html/body/p/a/font", "color", "#ff0000");
+ assertXPath(pDoc, "/html/body/p/a/font"_ostr, 1);
+ assertXPath(pDoc, "/html/body/p/a/font"_ostr, "color"_ostr, "#ff0000");
- assertXPath(pDoc, "/html/body/p/a/font/img", 1);
- assertXPath(pDoc, "/html/body/p/a/font/img", "name", "Text");
- assertXPath(pDoc, "/html/body/p/a/font/img", "alt", "Four colors");
- assertXPath(pDoc, "/html/body/p/a/font/img", "align", "middle");
+ assertXPath(pDoc, "/html/body/p/a/font/img"_ostr, 1);
+ assertXPath(pDoc, "/html/body/p/a/font/img"_ostr, "name"_ostr, "Text");
+ assertXPath(pDoc, "/html/body/p/a/font/img"_ostr, "alt"_ostr, "Four colors");
+ assertXPath(pDoc, "/html/body/p/a/font/img"_ostr, "align"_ostr, "middle");
// Probably the DPI in OSX is different and Twip -> Pixel conversion produces
// different results - so disable OSX for now.
@@ -472,7 +473,7 @@ DECLARE_HTMLEXPORT_TEST(testExportImageProperties, "HTMLImage.odt")
assertXPath(pDoc, "/html/body/p/a/font/img", "border", "3");
#endif
- assertXPath(pDoc, "/html/body/p/a/font/img", "usemap", "#map1");
+ assertXPath(pDoc, "/html/body/p/a/font/img"_ostr, "usemap"_ostr, "#map1");
}
DECLARE_HTMLEXPORT_TEST(testExportCheckboxRadioButtonState, "checkbox-radiobutton.doc")
@@ -480,19 +481,19 @@ DECLARE_HTMLEXPORT_TEST(testExportCheckboxRadioButtonState, "checkbox-radiobutto
htmlDocUniquePtr pDoc = parseHtml(maTempFile);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/html/body", 1);
- assertXPath(pDoc, "/html/body/p[1]/input", "type", "checkbox");
- assertXPath(pDoc, "/html/body/p[1]/input", "checked", "checked");
- assertXPath(pDoc, "/html/body/p[2]/input", "type", "checkbox");
- assertXPathNoAttribute(pDoc, "/html/body/p[2]/input", "checked");
- assertXPath(pDoc, "/html/body/form/p[1]/input", "type", "checkbox");
- assertXPath(pDoc, "/html/body/form/p[1]/input", "checked", "checked");
- assertXPath(pDoc, "/html/body/form/p[2]/input", "type", "checkbox");
- assertXPathNoAttribute(pDoc, "/html/body/form/p[2]/input", "checked");
- assertXPath(pDoc, "/html/body/form/p[3]/input", "type", "radio");
- assertXPath(pDoc, "/html/body/form/p[3]/input", "checked", "checked");
- assertXPath(pDoc, "/html/body/form/p[4]/input", "type", "radio");
- assertXPathNoAttribute(pDoc, "/html/body/form/p[4]/input", "checked");
+ assertXPath(pDoc, "/html/body"_ostr, 1);
+ assertXPath(pDoc, "/html/body/p[1]/input"_ostr, "type"_ostr, "checkbox");
+ assertXPath(pDoc, "/html/body/p[1]/input"_ostr, "checked"_ostr, "checked");
+ assertXPath(pDoc, "/html/body/p[2]/input"_ostr, "type"_ostr, "checkbox");
+ assertXPathNoAttribute(pDoc, "/html/body/p[2]/input"_ostr, "checked"_ostr);
+ assertXPath(pDoc, "/html/body/form/p[1]/input"_ostr, "type"_ostr, "checkbox");
+ assertXPath(pDoc, "/html/body/form/p[1]/input"_ostr, "checked"_ostr, "checked");
+ assertXPath(pDoc, "/html/body/form/p[2]/input"_ostr, "type"_ostr, "checkbox");
+ assertXPathNoAttribute(pDoc, "/html/body/form/p[2]/input"_ostr, "checked"_ostr);
+ assertXPath(pDoc, "/html/body/form/p[3]/input"_ostr, "type"_ostr, "radio");
+ assertXPath(pDoc, "/html/body/form/p[3]/input"_ostr, "checked"_ostr, "checked");
+ assertXPath(pDoc, "/html/body/form/p[4]/input"_ostr, "type"_ostr, "radio");
+ assertXPathNoAttribute(pDoc, "/html/body/form/p[4]/input"_ostr, "checked"_ostr);
}
DECLARE_HTMLEXPORT_TEST(testExportUrlEncoding, "tdf76291.odt")
@@ -501,7 +502,7 @@ DECLARE_HTMLEXPORT_TEST(testExportUrlEncoding, "tdf76291.odt")
CPPUNIT_ASSERT(pDoc);
// Test URI encoded hyperlink with Chinese characters
- assertXPath(pDoc, "/html/body/p/a", "href",
+ assertXPath(pDoc, "/html/body/p/a"_ostr, "href"_ostr,
"http://www.youtube.com/results?search_query=%E7%B2%B5%E8%AA%9Emv&sm=12");
}
@@ -511,8 +512,8 @@ DECLARE_HTMLEXPORT_TEST(testExportInternalUrl, "tdf90905.odt")
CPPUNIT_ASSERT(pDoc);
// Internal url should be valid
- assertXPath(pDoc, "/html/body/p[1]/a", "href", "#0.0.1.Text|outline");
- assertXPath(pDoc, "/html/body/p[2]/a", "href", "#bookmark");
+ assertXPath(pDoc, "/html/body/p[1]/a"_ostr, "href"_ostr, "#0.0.1.Text|outline");
+ assertXPath(pDoc, "/html/body/p[2]/a"_ostr, "href"_ostr, "#bookmark");
}
DECLARE_HTMLEXPORT_TEST(testExportImageBulletList, "tdf66822.odt")
@@ -521,9 +522,9 @@ DECLARE_HTMLEXPORT_TEST(testExportImageBulletList, "tdf66822.odt")
CPPUNIT_ASSERT(pDoc);
// Encoded base64 SVG bullet should match and render on browser
- assertXPath(pDoc, "/html/body/ul", 1);
+ assertXPath(pDoc, "/html/body/ul"_ostr, 1);
assertXPath(
- pDoc, "/html/body/ul", "style",
+ pDoc, "/html/body/ul"_ostr, "style"_ostr,
"list-style-image: url(data:image/svg+xml;base64,"
"PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3"
"RyYXRvciAxMi4wLjEsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDUxNDQ4KSAg"
@@ -558,7 +559,7 @@ DECLARE_HTMLEXPORT_TEST(testTdf83890, "tdf83890.odt")
htmlDocUniquePtr pDoc = parseHtml(maTempFile);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/html/body/ol[2]/ol", "start", "2");
+ assertXPath(pDoc, "/html/body/ol[2]/ol"_ostr, "start"_ostr, "2");
}
DECLARE_HTMLEXPORT_TEST(testExtbChars, "extb.html")
@@ -578,10 +579,10 @@ DECLARE_HTMLEXPORT_TEST(testNormalImageExport, "textAndImage.docx")
htmlDocUniquePtr pDoc = parseHtml(maTempFile);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/html/body", 1);
+ assertXPath(pDoc, "/html/body"_ostr, 1);
// the HTML export normally does not embed the images
- OUString imgSrc = getXPath(pDoc, "/html/body/p/img", "src");
+ OUString imgSrc = getXPath(pDoc, "/html/body/p/img"_ostr, "src"_ostr);
CPPUNIT_ASSERT(imgSrc.endsWith(".png"));
}
@@ -594,13 +595,13 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testEmbedImagesEnabled)
htmlDocUniquePtr pDoc = parseHtml(maTempFile);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/html/body", 1);
+ assertXPath(pDoc, "/html/body"_ostr, 1);
// the HTML export normally does not embed the images, but here the test
// name triggers setting of the "EmbedImages" filter option, meaning the
// image will not be a separate PNG, but an embedded base64 encoded
// version of that
- OUString imgSrc = getXPath(pDoc, "/html/body/p/img", "src");
+ OUString imgSrc = getXPath(pDoc, "/html/body/p/img"_ostr, "src"_ostr);
CPPUNIT_ASSERT(imgSrc.startsWith("data:image/png;base64,"));
}
@@ -610,7 +611,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testXHTML)
setFilterOptions("XHTML");
save(mpFilter);
- OString aExpected("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML");
+ OString aExpected("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML"_ostr);
SvStream* pStream = maTempFile.GetStream(StreamMode::READ);
CPPUNIT_ASSERT(pStream);
OString aActual(read_uInt8s_ToOString(*pStream, aExpected.getLength()));
@@ -620,7 +621,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testXHTML)
htmlDocUniquePtr pDoc = parseHtml(maTempFile);
CPPUNIT_ASSERT(pDoc);
// This was lang, not xml:lang.
- assertXPath(pDoc, "/html/body", "xml:lang", "en-US");
+ assertXPath(pDoc, "/html/body"_ostr, "xml:lang"_ostr, "en-US");
}
CPPUNIT_TEST_FIXTURE(HtmlExportTest, testReqIfParagraph)
@@ -638,7 +639,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testReqIfParagraph)
OString aExpected = "<reqif-xhtml:div><reqif-xhtml:p>aaa<reqif-xhtml:br/>\nbbb"
"</reqif-xhtml:p>" SAL_NEWLINE_STRING
// This was '<table' instead.
- "<reqif-xhtml:table";
+ "<reqif-xhtml:table"_ostr;
OString aStream(read_uInt8s_ToOString(*pStream, nLength));
pStream->Seek(0);
@@ -814,17 +815,20 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testReqIfTable)
// <div> was missing, so the XHTML fragment wasn't a valid
// xhtml.BlkStruct.class type anymore.
- assertXPath(pDoc,
- "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:table/reqif-xhtml:tr/reqif-xhtml:th",
- 1);
+ assertXPath(
+ pDoc,
+ "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:table/reqif-xhtml:tr/reqif-xhtml:th"_ostr,
+ 1);
// Make sure that the cell background is not written using CSS.
assertXPathNoAttribute(
- pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:table/reqif-xhtml:tr/reqif-xhtml:th",
- "style");
+ pDoc,
+ "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:table/reqif-xhtml:tr/reqif-xhtml:th"_ostr,
+ "style"_ostr);
// The attribute was present, which is not valid in reqif-xhtml.
assertXPathNoAttribute(
- pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:table/reqif-xhtml:tr/reqif-xhtml:th",
- "bgcolor");
+ pDoc,
+ "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:table/reqif-xhtml:tr/reqif-xhtml:th"_ostr,
+ "bgcolor"_ostr);
}
CPPUNIT_TEST_FIXTURE(HtmlExportTest, testReqIfTable2)
@@ -864,7 +868,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIfTableHeight)
xmlDocUniquePtr pDoc = WrapReqifFromTempFile();
// Without the accompanying fix in place, this test would have failed, explicit height was
// written, which is not valid reqif-xhtml.
- assertXPathNoAttribute(pDoc, "//reqif-xhtml:td", "height");
+ assertXPathNoAttribute(pDoc, "//reqif-xhtml:td"_ostr, "height"_ostr);
}
CPPUNIT_TEST_FIXTURE(HtmlExportTest, testXHTMLUseCSS)
@@ -934,7 +938,8 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testReqIfOle2)
xmlDocUniquePtr pDoc = WrapReqifFromTempFile();
// Get the path of the RTF data.
OUString aOlePath = getXPath(
- pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p/reqif-xhtml:object", "data");
+ pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p/reqif-xhtml:object"_ostr,
+ "data"_ostr);
OUString aOleSuffix(".ole");
CPPUNIT_ASSERT(aOlePath.endsWith(aOleSuffix));
INetURLObject aUrl(maTempFile.GetURL());
@@ -1000,7 +1005,7 @@ DECLARE_HTMLEXPORT_TEST(testTransparentImage, "transparent-image.odt")
htmlDocUniquePtr pDoc = parseHtml(maTempFile);
CPPUNIT_ASSERT(pDoc);
- OUString aSource = getXPath(pDoc, "/html/body/p/img", "src");
+ OUString aSource = getXPath(pDoc, "/html/body/p/img"_ostr, "src"_ostr);
OUString aMessage = "src attribute is: " + aSource;
// This was a jpeg, transparency was lost.
CPPUNIT_ASSERT_MESSAGE(aMessage.toUtf8().getStr(), aSource.endsWith(".gif"));
@@ -1020,8 +1025,8 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testTransparentImageReqIf)
OUString aSource = getXPath(
pDoc,
- "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p/reqif-xhtml:object/reqif-xhtml:object",
- "data");
+ "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p/reqif-xhtml:object/reqif-xhtml:object"_ostr,
+ "data"_ostr);
OUString aMessage = "src attribute is: " + aSource;
// This was GIF, when the intention was to force PNG.
CPPUNIT_ASSERT_MESSAGE(aMessage.toUtf8().getStr(), aSource.endsWith(".png"));
@@ -1039,8 +1044,8 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testOleNodataReqIf)
// Make sure the native <object> element has the required data attribute.
OUString aSource = getXPath(
pDoc,
- "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p/reqif-xhtml:object/reqif-xhtml:object",
- "data");
+ "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p/reqif-xhtml:object/reqif-xhtml:object"_ostr,
+ "data"_ostr);
CPPUNIT_ASSERT(!aSource.isEmpty());
}
@@ -1053,7 +1058,8 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testNoLangReqIf)
xmlDocUniquePtr pDoc = WrapReqifFromTempFile();
// Make sure that xml:lang is not written in ReqIF mode.
- assertXPathNoAttribute(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:h1", "lang");
+ assertXPathNoAttribute(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:h1"_ostr,
+ "lang"_ostr);
}
DECLARE_HTMLEXPORT_TEST(testFieldShade, "field-shade.odt")
@@ -1063,13 +1069,13 @@ DECLARE_HTMLEXPORT_TEST(testFieldShade, "field-shade.odt")
// Without the accompanying fix in place, this test would have failed with 'Expected: 1; Actual:
// 0', i.e. shading for the field was lost.
- assertXPath(pDoc, "/html/body/p[1]/span", "style", "background: #c0c0c0");
+ assertXPath(pDoc, "/html/body/p[1]/span"_ostr, "style"_ostr, "background: #c0c0c0");
// Check that field shading is written only in case there is no user-defined span background.
- assertXPath(pDoc, "/html/body/p[2]/span", "style", "background: #ff0000");
+ assertXPath(pDoc, "/html/body/p[2]/span"_ostr, "style"_ostr, "background: #ff0000");
// Without the accompanying fix in place, this test would have failed with 'Expected: 0; Actual:
// 1', i.e there was an inner span hiding the wanted background color.
- assertXPath(pDoc, "/html/body/p[2]/span/span", 0);
+ assertXPath(pDoc, "/html/body/p[2]/span/span"_ostr, 0);
}
DECLARE_HTMLEXPORT_TEST(testTdf132739, "tdf132739.odt")
@@ -1080,7 +1086,7 @@ DECLARE_HTMLEXPORT_TEST(testTdf132739, "tdf132739.odt")
// Without the fix in place, this test would have failed with
// - Expected: background: #5983b0; border: 1px solid #333333; padding: 0.04in
// - Actual : background: #5983b0
- assertXPath(pDoc, "/html/body/table/tr[1]/td", "style",
+ assertXPath(pDoc, "/html/body/table/tr[1]/td"_ostr, "style"_ostr,
"background: #5983b0; border: 1px solid #333333; padding: 0.04in");
}
@@ -1098,8 +1104,8 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testFieldShadeReqIf)
// - Actual : 2
// i.e. the ReqIF subset of xhtml had a background color and a page number field, resulting in
// an invalid ReqIF-XHTML.
- assertXPath(pDoc, "/html/body/div/p[1]/span", 0);
- assertXPath(pDoc, "/html/body/div/p[1]/sdfield", 0);
+ assertXPath(pDoc, "/html/body/div/p[1]/span"_ostr, 0);
+ assertXPath(pDoc, "/html/body/div/p[1]/sdfield"_ostr, 0);
}
DECLARE_HTMLEXPORT_TEST(testTdf126879, "tdf126879.odt")
@@ -1130,7 +1136,8 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testBlockQuoteReqIf)
// - Expected: 1
// - Actual : 0
// i.e. <blackquote> had character (direct) children, which is invalid xhtml.
- assertXPath(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:blockquote/reqif-xhtml:p", 1);
+ assertXPath(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:blockquote/reqif-xhtml:p"_ostr,
+ 1);
}
CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testRTFOLEMimeType)
@@ -1153,8 +1160,8 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testRTFOLEMimeType)
// - Expected: test/rtf
// - Actual : text/rtf
// i.e. the MIME type was always text/rtf, not taking the store parameter into account.
- assertXPath(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p/reqif-xhtml:object", "type",
- aType);
+ assertXPath(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p/reqif-xhtml:object"_ostr,
+ "type"_ostr, aType);
}
CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testChinese)
@@ -1207,7 +1214,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifFontNameSize)
// - Expected: 1
// - Actual : 3
// i.e. font name and size was written, even if that's not relevant for ReqIF.
- assertXPath(pDoc, "//reqif-xhtml:span", 1);
+ assertXPath(pDoc, "//reqif-xhtml:span"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifParagraphAlignment)
@@ -1226,7 +1233,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifParagraphAlignment)
// - Expected:
// - Actual : right
// i.e. the <reqif-xhtml:p align="..."> markup was used, which is invalid.
- assertXPathNoAttribute(pDoc, "//reqif-xhtml:p", "align");
+ assertXPathNoAttribute(pDoc, "//reqif-xhtml:p"_ostr, "align"_ostr);
}
CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifOle1PDF)
@@ -1313,7 +1320,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifOle1Paint)
// - Expected: PBrush
// - Actual : Package
// i.e. a hardcoded class name was written.
- CPPUNIT_ASSERT_EQUAL(OString("PBrush"), aClassName);
+ CPPUNIT_ASSERT_EQUAL("PBrush"_ostr, aClassName);
}
CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifOle1PaintBitmapFormat)
@@ -1379,13 +1386,13 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testMultiParaListItem)
ExportToReqif();
xmlDocUniquePtr pXmlDoc = WrapReqifFromTempFile();
- assertXPathContent(pXmlDoc, "//reqif-xhtml:ol/reqif-xhtml:li[1]/reqif-xhtml:p", "A");
- assertXPathContent(pXmlDoc, "//reqif-xhtml:ol/reqif-xhtml:li[2]/reqif-xhtml:p[1]", "B");
+ assertXPathContent(pXmlDoc, "//reqif-xhtml:ol/reqif-xhtml:li[1]/reqif-xhtml:p"_ostr, "A");
+ assertXPathContent(pXmlDoc, "//reqif-xhtml:ol/reqif-xhtml:li[2]/reqif-xhtml:p[1]"_ostr, "B");
// Without the accompanying fix in place, this test would have failed with:
// XPath '//reqif-xhtml:ol/reqif-xhtml:li[2]/reqif-xhtml:p[2]' not found
// i.e. </li> was written before "C", not after "C", so "C" was not in the 2nd list item.
- assertXPathContent(pXmlDoc, "//reqif-xhtml:ol/reqif-xhtml:li[2]/reqif-xhtml:p[2]", "C");
- assertXPathContent(pXmlDoc, "//reqif-xhtml:ol/reqif-xhtml:li[3]/reqif-xhtml:p", "D");
+ assertXPathContent(pXmlDoc, "//reqif-xhtml:ol/reqif-xhtml:li[2]/reqif-xhtml:p[2]"_ostr, "C");
+ assertXPathContent(pXmlDoc, "//reqif-xhtml:ol/reqif-xhtml:li[3]/reqif-xhtml:p"_ostr, "D");
}
CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testUnderlineNone)
@@ -1404,7 +1411,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testUnderlineNone)
// Make sure that the paragraph has no explicit style, because "text-decoration: none" is
// filtered out.
xmlDocUniquePtr pXmlDoc = WrapReqifFromTempFile();
- assertXPathNoAttribute(pXmlDoc, "//reqif-xhtml:div/reqif-xhtml:p", "style");
+ assertXPathNoAttribute(pXmlDoc, "//reqif-xhtml:div/reqif-xhtml:p"_ostr, "style"_ostr);
}
CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifOle1PresDataNoOle2)
@@ -1510,7 +1517,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testListHeading)
// because a </li> but no <li> is not well-formed and <ol> with a non-li children is invalid.
OUString aContent
= getXPathContent(pXmlDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ol/"
- "reqif-xhtml:li[@style='display: block']/reqif-xhtml:p");
+ "reqif-xhtml:li[@style='display: block']/reqif-xhtml:p"_ostr);
CPPUNIT_ASSERT_EQUAL(OUString("list header"), aContent.trim());
}
@@ -1549,8 +1556,9 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testPartiallyNumberedList)
// - actual : <li><p>...</p><p>...</p>
// because a <li> without a matching </li> is not well-formed, and the </li> was omitted because
// the second para was not numbered.
- assertXPath(pXmlDoc,
- "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ol/reqif-xhtml:li/reqif-xhtml:p", 2);
+ assertXPath(
+ pXmlDoc,
+ "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ol/reqif-xhtml:li/reqif-xhtml:p"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testPartiallyNumberedListHTML)
@@ -1592,7 +1600,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testPartiallyNumberedListHTML)
// because a <li> without a matching </li> is not well-formed, and the </li> was omitted because
// the second para was not numbered.
- assertXPath(pXmlDoc, "/html/body/ol/li/p", 2);
+ assertXPath(pXmlDoc, "/html/body/ol/li/p"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testListHeaderAndItem)
@@ -1629,8 +1637,9 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testListHeaderAndItem)
xmlDocUniquePtr pXmlDoc = WrapReqifFromTempFile();
// Make sure that in case the list has a header and an item, then both are wrapped in an <li>
// element.
- assertXPath(pXmlDoc,
- "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ol/reqif-xhtml:li/reqif-xhtml:p", 2);
+ assertXPath(
+ pXmlDoc,
+ "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ol/reqif-xhtml:li/reqif-xhtml:p"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testBlockQuoteNoMargin)
@@ -1655,9 +1664,9 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testBlockQuoteNoMargin)
// - expected: <blockquote><p>...</p></blockquote>
// - actual : <blockquote>...</blockquote>
// i.e. <blockquote> is can't have character children, but it had.
- assertXPathContent(pXmlDoc,
- "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:blockquote/reqif-xhtml:p",
- "string");
+ assertXPathContent(
+ pXmlDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:blockquote/reqif-xhtml:p"_ostr,
+ "string");
}
CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifImageToOle)
@@ -1721,7 +1730,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifEmbedPNGDirectly)
// - Expected: image/png
// - Actual : text/rtf
// i.e. even PNG was wrapped in an RTF.
- assertXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object", "type", "image/png");
+ assertXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object"_ostr, "type"_ostr, "image/png");
}
CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifEmbedJPGDirectly)
@@ -1738,12 +1747,12 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifEmbedJPGDirectly)
// Then make sure the JPG is embedded directly, without an RTF wrapper:
xmlDocUniquePtr pXmlDoc = WrapReqifFromTempFile();
- assertXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object", "type", "image/jpeg");
+ assertXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object"_ostr, "type"_ostr, "image/jpeg");
// Without the accompanying fix in place, this test would have failed with:
// - Expected: image/jpeg
// - Actual : image/png
// i.e. first the original JPG data was lost, then the inner PNG fallback was missing.
- assertXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object/reqif-xhtml:object", "type",
+ assertXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object/reqif-xhtml:object"_ostr, "type"_ostr,
"image/png");
}
@@ -1768,7 +1777,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifEmbedPNGShapeDirectly)
// Without the accompanying fix in place, this test would have failed with:
// - no attribute 'type' exist
// i.e. the PNG was exported as GIF, without an explicit type.
- assertXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object", "type", "image/png");
+ assertXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object"_ostr, "type"_ostr, "image/png");
}
CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifEmbedJPGShapeDirectly)
@@ -1793,8 +1802,8 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifEmbedJPGShapeDirectly)
// - Expected: image/jpeg
// - Actual : image/png
// i.e. first the original JPG data was lost, then the inner PNG fallback was missing.
- assertXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object", "type", "image/jpeg");
- assertXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object/reqif-xhtml:object", "type",
+ assertXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object"_ostr, "type"_ostr, "image/jpeg");
+ assertXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object/reqif-xhtml:object"_ostr, "type"_ostr,
"image/png");
}
@@ -1826,7 +1835,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifEmbedPNGShapeAsOLE)
// - Expected: text/rtf
// - Actual : image/png
// i.e. the OLE wrapper around the PNG was missing.
- assertXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object", "type", "text/rtf");
+ assertXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object"_ostr, "type"_ostr, "text/rtf");
}
CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifEmbedShapeAsPNG)
@@ -1849,7 +1858,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifEmbedShapeAsPNG)
// - Expected: image/png
// - Actual : image/x-vclgraphic
// i.e. the result was invalid ReqIF.
- assertXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object", "type", "image/png");
+ assertXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object"_ostr, "type"_ostr, "image/png");
// Then check the pixel size of the shape:
Size aPixelSize(Application::GetDefaultDevice()->LogicToPixel(Size(10000, 10000),
@@ -1857,7 +1866,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifEmbedShapeAsPNG)
// Without the accompanying fix in place, this test would have failed with:
// - no attribute 'width' exist
// i.e. shapes had no width.
- assertXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object", "width",
+ assertXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object"_ostr, "width"_ostr,
OUString::number(aPixelSize.getWidth()));
}
@@ -1933,7 +1942,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifEmbedShapeAsPNGCustomDPI)
// Then make sure the shape is embedded as a PNG:
xmlDocUniquePtr pXmlDoc = WrapReqifFromTempFile();
- assertXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object", "type", "image/png");
+ assertXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object"_ostr, "type"_ostr, "image/png");
// Then check the pixel size of the shape:
Size aPixelSize(Application::GetDefaultDevice()->LogicToPixel(Size(5080, 2540),
@@ -1951,7 +1960,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifEmbedShapeAsPNGCustomDPI)
CPPUNIT_ASSERT_EQUAL(nPNGWidth, aDescriptor.GetSizePixel().getWidth());
// Then make sure the shape's logic size (in CSS pixels) don't change:
- assertXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object", "width",
+ assertXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object"_ostr, "width"_ostr,
OUString::number(aPixelSize.getWidth()));
}
@@ -2071,7 +2080,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testListsHeading)
OUString aContent
= getXPathContent(pXmlDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ol/"
- "reqif-xhtml:li[@style='display: block']/reqif-xhtml:p");
+ "reqif-xhtml:li[@style='display: block']/reqif-xhtml:p"_ostr);
CPPUNIT_ASSERT_EQUAL(OUString("list 1, header 1"), aContent.trim());
}
@@ -2089,7 +2098,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testOleEmfPreviewToHtml)
// Then make sure the <img> tag has matching file extension and data:
htmlDocUniquePtr pDoc = parseHtml(maTempFile);
- OUString aPath = getXPath(pDoc, "/html/body/p/img", "src");
+ OUString aPath = getXPath(pDoc, "/html/body/p/img"_ostr, "src"_ostr);
// Without the accompanying fix in place, this test would have failed, as aPath was
// ole_html_3978e5f373402b43.JPG, with EMF data.
CPPUNIT_ASSERT(aPath.endsWith("gif"));
@@ -2128,7 +2137,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testNestedBullets)
// - XPath '//reqif-xhtml:ol/reqif-xhtml:li/reqif-xhtml:ol/reqif-xhtml:li/reqif-xhtml:p' not found
// i.e. the <li> inside the outer <ol> was missing.
assertXPathContent(
- pXmlDoc, "//reqif-xhtml:ol/reqif-xhtml:li/reqif-xhtml:ol/reqif-xhtml:li/reqif-xhtml:p",
+ pXmlDoc, "//reqif-xhtml:ol/reqif-xhtml:li/reqif-xhtml:ol/reqif-xhtml:li/reqif-xhtml:p"_ostr,
"second");
}
@@ -2149,7 +2158,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testTrailingLineBreak)
// - Expected: 1
// - Actual : 2
// - XPath '//reqif-xhtml:br' number of nodes is incorrect
- assertXPath(pXmlDoc, "//reqif-xhtml:br", 1);
+ assertXPath(pXmlDoc, "//reqif-xhtml:br"_ostr, 1);
// Then test the import side:
@@ -2197,11 +2206,11 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testLeadingTab)
// - Expected: <nbsp><nbsp><space>first
// - Actual : <tab><space>first
// i.e. the leading tab was not replaced by 2 nbsps.
- assertXPathContent(pXmlDoc, "//reqif-xhtml:p[1]", u"\xa0\xa0 first"_ustr);
+ assertXPathContent(pXmlDoc, "//reqif-xhtml:p[1]"_ostr, u"\xa0\xa0 first"_ustr);
// Test a leading tab that is not at the start of the paragraph:
- assertXPathContent(pXmlDoc, "//reqif-xhtml:p[2]", u"\xa0\xa0\xa0\xa0 second"_ustr);
+ assertXPathContent(pXmlDoc, "//reqif-xhtml:p[2]"_ostr, u"\xa0\xa0\xa0\xa0 second"_ustr);
// Test a tab which is not leading:
- assertXPathContent(pXmlDoc, "//reqif-xhtml:p[3]", u"thi \t rd"_ustr);
+ assertXPathContent(pXmlDoc, "//reqif-xhtml:p[3]"_ostr, u"thi \t rd"_ustr);
}
CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testLeadingTabHTML)
@@ -2227,7 +2236,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testLeadingTabHTML)
// - Expected: <newline><nbsp><nbsp><space>test
// - Actual : <newline><tab><space>test
// i.e. the leading tab was not replaced by 2 nbsps.
- assertXPathContent(pHtmlDoc, "/html/body/p", SAL_NEWLINE_STRING u"\xa0\xa0 test"_ustr);
+ assertXPathContent(pHtmlDoc, "/html/body/p"_ostr, SAL_NEWLINE_STRING u"\xa0\xa0 test"_ustr);
}
CPPUNIT_TEST_FIXTURE(HtmlExportTest, testClearingBreak)
@@ -2304,13 +2313,14 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testTableBackground)
// Without the accompanying fix in place, this test would have failed with:
// - XPath '//reqif-xhtml:table[1]' no attribute 'style' exist
// i.e. HTML markup was used for the table background color.
- assertXPath(pXmlDoc, "//reqif-xhtml:table[1]", "style", "background: #ff0000");
- assertXPathNoAttribute(pXmlDoc, "//reqif-xhtml:table[1]", "bgcolor");
- assertXPath(pXmlDoc, "//reqif-xhtml:table[2]/reqif-xhtml:tr[1]", "style",
+ assertXPath(pXmlDoc, "//reqif-xhtml:table[1]"_ostr, "style"_ostr, "background: #ff0000");
+ assertXPathNoAttribute(pXmlDoc, "//reqif-xhtml:table[1]"_ostr, "bgcolor"_ostr);
+ assertXPath(pXmlDoc, "//reqif-xhtml:table[2]/reqif-xhtml:tr[1]"_ostr, "style"_ostr,
"background: #00ff00");
- assertXPathNoAttribute(pXmlDoc, "//reqif-xhtml:table[2]/reqif-xhtml:tr[1]", "bgcolor");
+ assertXPathNoAttribute(pXmlDoc, "//reqif-xhtml:table[2]/reqif-xhtml:tr[1]"_ostr,
+ "bgcolor"_ostr);
// Second row has no explicit style, the default is not written.
- assertXPathNoAttribute(pXmlDoc, "//reqif-xhtml:table[2]/reqif-xhtml:tr[2]", "style");
+ assertXPathNoAttribute(pXmlDoc, "//reqif-xhtml:table[2]/reqif-xhtml:tr[2]"_ostr, "style"_ostr);
}
CPPUNIT_TEST_FIXTURE(HtmlExportTest, testImageKeepRatio)
@@ -2344,7 +2354,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testImageKeepRatio)
// - Expected: auto
// - Actual : 2
// i.e. a static (CSS pixel) height was written.
- assertXPath(pDoc, "/html/body/p/img", "height", "auto");
+ assertXPath(pDoc, "/html/body/p/img"_ostr, "height"_ostr, "auto");
}
CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testSectionDir)
@@ -2366,7 +2376,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testSectionDir)
// Without the accompanying fix in place, this test would have failed with:
// - XPath '//reqif-xhtml:div[@id='mysect']' no attribute 'style' exist
// i.e. the dir="ltr" HTML attribute was used instead.
- assertXPath(pXmlDoc, "//reqif-xhtml:div[@id='mysect']", "style", "dir: ltr");
+ assertXPath(pXmlDoc, "//reqif-xhtml:div[@id='mysect']"_ostr, "style"_ostr, "dir: ltr");
}
CPPUNIT_TEST_FIXTURE(HtmlExportTest, testTdf114769)
@@ -2417,14 +2427,15 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testTdf114769)
CPPUNIT_ASSERT(pHtmlDoc);
CPPUNIT_ASSERT_EQUAL(OUString("http://libreoffice.org/"),
- getXPath(pHtmlDoc, "/html/body/p[1]/a", "href"));
+ getXPath(pHtmlDoc, "/html/body/p[1]/a"_ostr, "href"_ostr));
CPPUNIT_ASSERT_EQUAL(OUString("#some_bookmark"),
- getXPath(pHtmlDoc, "/html/body/p[2]/a", "href"));
- CPPUNIT_ASSERT_EQUAL(OUString("C:\\test.txt"), getXPath(pHtmlDoc, "/html/body/p[3]/a", "href"));
+ getXPath(pHtmlDoc, "/html/body/p[2]/a"_ostr, "href"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("C:\\test.txt"),
+ getXPath(pHtmlDoc, "/html/body/p[3]/a"_ostr, "href"_ostr));
CPPUNIT_ASSERT_EQUAL(OUString("..\\..\\test.odt"),
- getXPath(pHtmlDoc, "/html/body/p[4]/a", "href"));
+ getXPath(pHtmlDoc, "/html/body/p[4]/a"_ostr, "href"_ostr));
CPPUNIT_ASSERT_EQUAL(OUString(".\\another.odt"),
- getXPath(pHtmlDoc, "/html/body/p[5]/a", "href"));
+ getXPath(pHtmlDoc, "/html/body/p[5]/a"_ostr, "href"_ostr));
}
CPPUNIT_TEST_FIXTURE(HtmlExportTest, testTdf153923)
@@ -2437,9 +2448,9 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testTdf153923)
// Without the fix in place, this would fail
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/html/body//dl", 3);
+ assertXPath(pDoc, "/html/body//dl"_ostr, 3);
// The 'dd' tag was not closed
- assertXPath(pDoc, "/html/body//dd", 3);
+ assertXPath(pDoc, "/html/body//dd"_ostr, 3);
}
CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testTdf153923_ReqIF)
@@ -2449,10 +2460,10 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testTdf153923_ReqIF)
xmlDocUniquePtr pDoc = WrapReqifFromTempFile();
- assertXPath(pDoc, "//reqif-xhtml:table");
+ assertXPath(pDoc, "//reqif-xhtml:table"_ostr);
// There should be no 'dd' or 'dl' tags, used as a hack for table indentation
- assertXPath(pDoc, "//reqif-xhtml:dl", 0);
- assertXPath(pDoc, "//reqif-xhtml:dd", 0);
+ assertXPath(pDoc, "//reqif-xhtml:dl"_ostr, 0);
+ assertXPath(pDoc, "//reqif-xhtml:dd"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIfTransparentTifImg)
@@ -2462,8 +2473,9 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIfTransparentTifImg)
ExportToReqif();
xmlDocUniquePtr pXmlDoc = WrapReqifFromTempFile();
- assertXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object[1]", "type", "image/tiff");
- OUString imageName = getXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object[1]", "data");
+ assertXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object[1]"_ostr, "type"_ostr, "image/tiff");
+ OUString imageName
+ = getXPath(pXmlDoc, "//reqif-xhtml:p/reqif-xhtml:object[1]"_ostr, "data"_ostr);
// Without the accompanying fix in place, this test would have failed,
// ending with .gif, because XOutFlags::UseGifIfSensible flag combined
// with the transparent image would result in GIF export
@@ -2485,25 +2497,27 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testTdf155387)
xmlDocUniquePtr pDoc = WrapReqifFromTempFile();
// Single top-level list
- assertXPath(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul");
+ assertXPath(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul"_ostr);
// Single top-level item
- assertXPath(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul/reqif-xhtml:li");
+ assertXPath(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul/reqif-xhtml:li"_ostr);
// 4 top-level paragraphs in the item
- assertXPath(pDoc,
- "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul/reqif-xhtml:li/reqif-xhtml:p", 4);
+ assertXPath(
+ pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul/reqif-xhtml:li/reqif-xhtml:p"_ostr,
+ 4);
// 2 sublists in the item
assertXPath(
- pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul/reqif-xhtml:li/reqif-xhtml:ul", 2);
+ pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul/reqif-xhtml:li/reqif-xhtml:ul"_ostr,
+ 2);
// 2 items in the first sublist
assertXPath(pDoc,
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul/reqif-xhtml:li/reqif-xhtml:ul[1]/"
- "reqif-xhtml:li",
+ "reqif-xhtml:li"_ostr,
2);
// Check the last (most nested) subitem's text
assertXPathContent(
pDoc,
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul/reqif-xhtml:li/reqif-xhtml:ul[2]/"
- "reqif-xhtml:li/reqif-xhtml:ul/reqif-xhtml:li/reqif-xhtml:p",
+ "reqif-xhtml:li/reqif-xhtml:ul/reqif-xhtml:li/reqif-xhtml:p"_ostr,
"l3");
}
@@ -2516,23 +2530,25 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testTdf155496)
xmlDocUniquePtr pDoc = WrapReqifFromTempFile();
// Two top-level lists
- assertXPath(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul", 2);
+ assertXPath(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul"_ostr, 2);
// Single top-level item
- assertXPath(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul[1]/reqif-xhtml:li");
+ assertXPath(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul[1]/reqif-xhtml:li"_ostr);
// One top-level paragraph in the item
- assertXPath(pDoc,
- "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul[1]/reqif-xhtml:li/reqif-xhtml:p");
+ assertXPath(
+ pDoc,
+ "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul[1]/reqif-xhtml:li/reqif-xhtml:p"_ostr);
// One sublist in the item
assertXPath(
- pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul[1]/reqif-xhtml:li/reqif-xhtml:ul");
+ pDoc,
+ "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul[1]/reqif-xhtml:li/reqif-xhtml:ul"_ostr);
// One item in the sublist
assertXPath(pDoc,
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul[1]/reqif-xhtml:li/reqif-xhtml:ul/"
- "reqif-xhtml:li");
+ "reqif-xhtml:li"_ostr);
// Check its text
OUString aContent = getXPathContent(
pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul[1]/reqif-xhtml:li/reqif-xhtml:ul/"
- "reqif-xhtml:li/reqif-xhtml:p");
+ "reqif-xhtml:li/reqif-xhtml:p"_ostr);
CPPUNIT_ASSERT_EQUAL(OUString("list 1 item 1\n\t\tsub-header"), aContent.trim());
}
@@ -2544,7 +2560,8 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIF_RightAlignedTable)
xmlDocUniquePtr pDoc = WrapReqifFromTempFile();
// No 'align' attribute must be present in 'div'
- assertXPathNoAttribute(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:div", "align");
+ assertXPathNoAttribute(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:div"_ostr,
+ "align"_ostr);
}
CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIF_ListsWithNumFormat)
@@ -2555,10 +2572,14 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIF_ListsWithNumFormat)
xmlDocUniquePtr pDoc = WrapReqifFromTempFile();
// No 'type' attribute must be present in 'ol'
- assertXPathNoAttribute(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ol[1]", "type");
- assertXPathNoAttribute(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ol[2]", "type");
- assertXPathNoAttribute(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ol[3]", "type");
- assertXPathNoAttribute(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ol[4]", "type");
+ assertXPathNoAttribute(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ol[1]"_ostr,
+ "type"_ostr);
+ assertXPathNoAttribute(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ol[2]"_ostr,
+ "type"_ostr);
+ assertXPathNoAttribute(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ol[3]"_ostr,
+ "type"_ostr);
+ assertXPathNoAttribute(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ol[4]"_ostr,
+ "type"_ostr);
}
CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testTdf155871)
@@ -2578,7 +2599,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIF_ListsNoStartAttribute)
xmlDocUniquePtr pDoc = WrapReqifFromTempFile();
// No 'start' attribute must be present in 'ol'
- assertXPath(pDoc, "//reqif-xhtml:ol[@start]", 0);
+ assertXPath(pDoc, "//reqif-xhtml:ol[@start]"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIF_FrameTextAsObjectAltText)
@@ -2593,7 +2614,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIF_FrameTextAsObjectAltText)
// - Actual : Frame1
// i.e., frame name was used as the object element content, not frame text
assertXPathContent(pDoc,
- "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p[2]/reqif-xhtml:object",
+ "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p[2]/reqif-xhtml:object"_ostr,
"Some text in frame & <foo>");
}
@@ -2622,13 +2643,13 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testSingleOleExport)
xmlDocUniquePtr pXmlDoc = WrapReqifFromTempFile();
// The root element must be reqif-xhtml:object
- assertXPath(pXmlDoc, "/reqif-xhtml:html/reqif-xhtml:object", "type", "text/rtf");
+ assertXPath(pXmlDoc, "/reqif-xhtml:html/reqif-xhtml:object"_ostr, "type"_ostr, "text/rtf");
// It has no children
- assertXPathChildren(pXmlDoc, "/reqif-xhtml:html/reqif-xhtml:object", 0);
+ assertXPathChildren(pXmlDoc, "/reqif-xhtml:html/reqif-xhtml:object"_ostr, 0);
// And the content is empty
- assertXPathContent(pXmlDoc, "/reqif-xhtml:html/reqif-xhtml:object", "");
+ assertXPathContent(pXmlDoc, "/reqif-xhtml:html/reqif-xhtml:object"_ostr, "");
- OUString aRtfData = getXPath(pXmlDoc, "/reqif-xhtml:html/reqif-xhtml:object", "data");
+ OUString aRtfData = getXPath(pXmlDoc, "/reqif-xhtml:html/reqif-xhtml:object"_ostr, "data"_ostr);
INetURLObject aUrl(maTempFile.GetURL());
aUrl.setName(aRtfData);
SvMemoryStream aRtf;
@@ -2651,62 +2672,63 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIF_Tdf156602)
// and its A1 starts with a nested table
// Only two sub-elements must be inside the div: an outer table and a trailing paragraph
- assertXPathChildren(pDoc, "/reqif-xhtml:html/reqif-xhtml:div", 2);
+ assertXPathChildren(pDoc, "/reqif-xhtml:html/reqif-xhtml:div"_ostr, 2);
// The outer table must have exactly two rows
- assertXPath(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:table/reqif-xhtml:tr", 2);
+ assertXPath(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:table/reqif-xhtml:tr"_ostr, 2);
// First outer table cell must have two sub-elements: an inner table and a trailing paragraph
assertXPathChildren(
pDoc,
- "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:table/reqif-xhtml:tr[1]/reqif-xhtml:td[1]",
+ "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:table/reqif-xhtml:tr[1]/reqif-xhtml:td[1]"_ostr,
2);
// The inner table must have exactly two rows
assertXPath(
pDoc,
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:table/reqif-xhtml:tr[1]/reqif-xhtml:td[1]/"
- "reqif-xhtml:table/reqif-xhtml:tr",
+ "reqif-xhtml:table/reqif-xhtml:tr"_ostr,
2);
// Check all the elements' content
assertXPathContent(
pDoc,
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:table/reqif-xhtml:tr[1]/reqif-xhtml:td[1]/"
- "reqif-xhtml:table/reqif-xhtml:tr[1]/reqif-xhtml:td[1]/reqif-xhtml:p",
+ "reqif-xhtml:table/reqif-xhtml:tr[1]/reqif-xhtml:td[1]/reqif-xhtml:p"_ostr,
"Inner.A1");
assertXPathContent(
pDoc,
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:table/reqif-xhtml:tr[1]/reqif-xhtml:td[1]/"
- "reqif-xhtml:table/reqif-xhtml:tr[1]/reqif-xhtml:td[2]/reqif-xhtml:p",
+ "reqif-xhtml:table/reqif-xhtml:tr[1]/reqif-xhtml:td[2]/reqif-xhtml:p"_ostr,
"Inner.B1");
assertXPathContent(
pDoc,
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:table/reqif-xhtml:tr[1]/reqif-xhtml:td[1]/"
- "reqif-xhtml:table/reqif-xhtml:tr[2]/reqif-xhtml:td[1]/reqif-xhtml:p",
+ "reqif-xhtml:table/reqif-xhtml:tr[2]/reqif-xhtml:td[1]/reqif-xhtml:p"_ostr,
"Inner.A2");
assertXPathContent(
pDoc,
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:table/reqif-xhtml:tr[1]/reqif-xhtml:td[1]/"
- "reqif-xhtml:table/reqif-xhtml:tr[2]/reqif-xhtml:td[2]/reqif-xhtml:p",
+ "reqif-xhtml:table/reqif-xhtml:tr[2]/reqif-xhtml:td[2]/reqif-xhtml:p"_ostr,
"Inner.B2");
assertXPathContent(
pDoc,
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:table/reqif-xhtml:tr[1]/reqif-xhtml:td[1]/"
- "reqif-xhtml:p",
+ "reqif-xhtml:p"_ostr,
"Outer.A1");
assertXPathContent(
pDoc,
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:table/reqif-xhtml:tr[1]/reqif-xhtml:td[2]/"
- "reqif-xhtml:p",
+ "reqif-xhtml:p"_ostr,
"Outer.B1");
assertXPathContent(
pDoc,
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:table/reqif-xhtml:tr[2]/reqif-xhtml:td[1]/"
- "reqif-xhtml:p",
+ "reqif-xhtml:p"_ostr,
"Outer.A2");
assertXPathContent(
pDoc,
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:table/reqif-xhtml:tr[2]/reqif-xhtml:td[2]/"
- "reqif-xhtml:p",
+ "reqif-xhtml:p"_ostr,
"Outer.B2");
- assertXPathContent(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p", "Following text");
+ assertXPathContent(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p"_ostr,
+ "Following text");
}
CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testTdf156647_CellPaddingRoundtrip)
@@ -2723,7 +2745,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testTdf156647_CellPaddingRoundtrip)
ExportToReqif();
// Make sure that we export it:
xmlDocUniquePtr pXmlDoc = WrapReqifFromTempFile();
- assertXPath(pXmlDoc, "//reqif-xhtml:table", "cellpadding", "48"); // px
+ assertXPath(pXmlDoc, "//reqif-xhtml:table"_ostr, "cellpadding"_ostr, "48"); // px
// Now import it
mxComponent->dispose();
ImportFromReqif(maTempFile.GetURL());
@@ -2748,7 +2770,8 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testTdf157643_WideHBorder)
ExportToReqif();
// Make sure that there's no extra tr's:
xmlDocUniquePtr pXmlDoc = WrapReqifFromTempFile();
- assertXPath(pXmlDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:table/reqif-xhtml:tr", 2);
+ assertXPath(pXmlDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:table/reqif-xhtml:tr"_ostr,
+ 2);
}
CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testHTML_PreserveSpaces)
@@ -2769,10 +2792,10 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testHTML_PreserveSpaces)
// Then make sure that "white-space: pre-wrap" is written into the paragraph's style:
htmlDocUniquePtr pHtmlDoc = parseHtml(maTempFile);
CPPUNIT_ASSERT(pHtmlDoc);
- const OUString style = getXPath(pHtmlDoc, "/html/body/p", "style"_ostr);
+ const OUString style = getXPath(pHtmlDoc, "/html/body/p"_ostr, "style"_ostr);
CPPUNIT_ASSERT(style.indexOf("white-space: pre-wrap") >= 0);
// Also check that the paragraph text is correct, without modifications in whitespace
- assertXPathContent(pHtmlDoc, "/html/body/p", paraText);
+ assertXPathContent(pHtmlDoc, "/html/body/p"_ostr, paraText);
// Test import
@@ -2799,10 +2822,10 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIF_PreserveSpaces)
// Then make sure that xml:space="preserve" attribute exists in the paragraph element:
xmlDocUniquePtr pXmlDoc = WrapReqifFromTempFile();
- assertXPath(pXmlDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p", "space"_ostr,
+ assertXPath(pXmlDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p"_ostr, "space"_ostr,
u"preserve"_ustr);
// Also check that the paragraph text is correct, without modifications in whitespace
- assertXPathContent(pXmlDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p", paraText);
+ assertXPathContent(pXmlDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p"_ostr, paraText);
// Test import
diff --git a/sw/qa/extras/htmlexport/xhtmlexport.cxx b/sw/qa/extras/htmlexport/xhtmlexport.cxx
index f8a700c90af1..86026dbd70bd 100644
--- a/sw/qa/extras/htmlexport/xhtmlexport.cxx
+++ b/sw/qa/extras/htmlexport/xhtmlexport.cxx
@@ -29,9 +29,9 @@ CPPUNIT_TEST_FIXTURE(XHtmlExportTest, testImageEmbedding)
htmlDocUniquePtr pDoc = parseHtml(maTempFile);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/html/body", 1);
- assertXPath(pDoc, "/html/body/div[1]/div[1]/img", 1);
- OUString aValue = getXPath(pDoc, "/html/body/div[1]/div[1]/img", "src");
+ assertXPath(pDoc, "/html/body"_ostr, 1);
+ assertXPath(pDoc, "/html/body/div[1]/div[1]/img"_ostr, 1);
+ OUString aValue = getXPath(pDoc, "/html/body/div[1]/div[1]/img"_ostr, "src"_ostr);
CPPUNIT_ASSERT(aValue.startsWith("data:image/svg+xml;base64"));
}
diff --git a/sw/qa/extras/indexing/IndexingExportTest.cxx b/sw/qa/extras/indexing/IndexingExportTest.cxx
index fa56aa3c53a0..ac32db4fb8b1 100644
--- a/sw/qa/extras/indexing/IndexingExportTest.cxx
+++ b/sw/qa/extras/indexing/IndexingExportTest.cxx
@@ -56,26 +56,26 @@ void IndexingExportTest::testIndexingExport_Paragraphs()
xmlDocUniquePtr pXmlDoc = parseXmlStream(&aMemoryStream);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/indexing");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[1]", "Title");
- assertXPath(pXmlDoc, "/indexing/paragraph[1]", "node_type", "writer");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[2]", "Heading 1");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[3]", "Heading 2");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[4]", "Paragraph 1");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[5]", "Paragraph 2");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[6]", "Bullet 1");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[7]", "Bullet 2");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[8]", "Bullet 3");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[9]", "Paragraph 3");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[10]", "Paragraph 4");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[11]", "List 1");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[12]", "List 2");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[13]", "List 3");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[14]", "Left");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[15]", "Center");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[16]", "Right");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[17]", "Bold Italic Underline Strikeout");
- assertXPath(pXmlDoc, "/indexing/paragraph[17]", "node_type", "writer");
+ assertXPath(pXmlDoc, "/indexing"_ostr);
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[1]"_ostr, "Title");
+ assertXPath(pXmlDoc, "/indexing/paragraph[1]"_ostr, "node_type"_ostr, "writer");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[2]"_ostr, "Heading 1");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[3]"_ostr, "Heading 2");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[4]"_ostr, "Paragraph 1");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[5]"_ostr, "Paragraph 2");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[6]"_ostr, "Bullet 1");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[7]"_ostr, "Bullet 2");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[8]"_ostr, "Bullet 3");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[9]"_ostr, "Paragraph 3");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[10]"_ostr, "Paragraph 4");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[11]"_ostr, "List 1");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[12]"_ostr, "List 2");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[13]"_ostr, "List 3");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[14]"_ostr, "Left");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[15]"_ostr, "Center");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[16]"_ostr, "Right");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[17]"_ostr, "Bold Italic Underline Strikeout");
+ assertXPath(pXmlDoc, "/indexing/paragraph[17]"_ostr, "node_type"_ostr, "writer");
}
void IndexingExportTest::testIndexingExport_Images()
@@ -92,13 +92,15 @@ void IndexingExportTest::testIndexingExport_Images()
xmlDocUniquePtr pXmlDoc = parseXmlStream(&aMemoryStream);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/indexing");
- assertXPath(pXmlDoc, "/indexing/object[1]", "alt", "Image_NonCaption - Alternative text");
- assertXPath(pXmlDoc, "/indexing/object[1]", "name", "Image_NonCaption");
- assertXPath(pXmlDoc, "/indexing/object[1]", "object_type", "graphic");
- assertXPath(pXmlDoc, "/indexing/object[2]", "alt", "Image_InCaption - Alternative text");
- assertXPath(pXmlDoc, "/indexing/object[2]", "name", "Image_InCaption");
- assertXPath(pXmlDoc, "/indexing/object[2]", "object_type", "graphic");
+ assertXPath(pXmlDoc, "/indexing"_ostr);
+ assertXPath(pXmlDoc, "/indexing/object[1]"_ostr, "alt"_ostr,
+ "Image_NonCaption - Alternative text");
+ assertXPath(pXmlDoc, "/indexing/object[1]"_ostr, "name"_ostr, "Image_NonCaption");
+ assertXPath(pXmlDoc, "/indexing/object[1]"_ostr, "object_type"_ostr, "graphic");
+ assertXPath(pXmlDoc, "/indexing/object[2]"_ostr, "alt"_ostr,
+ "Image_InCaption - Alternative text");
+ assertXPath(pXmlDoc, "/indexing/object[2]"_ostr, "name"_ostr, "Image_InCaption");
+ assertXPath(pXmlDoc, "/indexing/object[2]"_ostr, "object_type"_ostr, "graphic");
}
void IndexingExportTest::testIndexingExport_OLE()
@@ -115,10 +117,10 @@ void IndexingExportTest::testIndexingExport_OLE()
xmlDocUniquePtr pXmlDoc = parseXmlStream(&aMemoryStream);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/indexing");
- assertXPath(pXmlDoc, "/indexing/object[1]", "name", "Object - Chart");
- assertXPath(pXmlDoc, "/indexing/object[1]", "alt", "Alt Text");
- assertXPath(pXmlDoc, "/indexing/object[1]", "object_type", "ole");
+ assertXPath(pXmlDoc, "/indexing"_ostr);
+ assertXPath(pXmlDoc, "/indexing/object[1]"_ostr, "name"_ostr, "Object - Chart");
+ assertXPath(pXmlDoc, "/indexing/object[1]"_ostr, "alt"_ostr, "Alt Text");
+ assertXPath(pXmlDoc, "/indexing/object[1]"_ostr, "object_type"_ostr, "ole");
}
void IndexingExportTest::testIndexingExport_Shapes()
@@ -135,30 +137,30 @@ void IndexingExportTest::testIndexingExport_Shapes()
xmlDocUniquePtr pXmlDoc = parseXmlStream(&aMemoryStream);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/indexing");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[1]", "Drawing : Just a Diamond");
- assertXPath(pXmlDoc, "/indexing/paragraph[1]", "node_type", "writer");
-
- assertXPath(pXmlDoc, "/indexing/object[1]", "name", "Circle");
- assertXPath(pXmlDoc, "/indexing/object[1]", "object_type", "shape");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[2]", "This is a circle");
- assertXPath(pXmlDoc, "/indexing/paragraph[2]", "node_type", "common");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[3]", "This is a second paragraph");
- assertXPath(pXmlDoc, "/indexing/paragraph[3]", "node_type", "common");
-
- assertXPath(pXmlDoc, "/indexing/object[2]", "name", "Diamond");
- assertXPath(pXmlDoc, "/indexing/object[2]", "object_type", "shape");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[4]", "This is a diamond");
- assertXPath(pXmlDoc, "/indexing/paragraph[4]", "node_type", "common");
-
- assertXPath(pXmlDoc, "/indexing/object[3]", "name", "Text Frame 1");
- assertXPath(pXmlDoc, "/indexing/object[3]", "object_type", "shape");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[5]", "This is a TextBox - Para1");
- assertXPath(pXmlDoc, "/indexing/paragraph[5]", "node_type", "common");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[6]", "Para2");
- assertXPath(pXmlDoc, "/indexing/paragraph[6]", "node_type", "common");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[7]", "Para3");
- assertXPath(pXmlDoc, "/indexing/paragraph[7]", "node_type", "common");
+ assertXPath(pXmlDoc, "/indexing"_ostr);
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[1]"_ostr, "Drawing : Just a Diamond");
+ assertXPath(pXmlDoc, "/indexing/paragraph[1]"_ostr, "node_type"_ostr, "writer");
+
+ assertXPath(pXmlDoc, "/indexing/object[1]"_ostr, "name"_ostr, "Circle");
+ assertXPath(pXmlDoc, "/indexing/object[1]"_ostr, "object_type"_ostr, "shape");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[2]"_ostr, "This is a circle");
+ assertXPath(pXmlDoc, "/indexing/paragraph[2]"_ostr, "node_type"_ostr, "common");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[3]"_ostr, "This is a second paragraph");
+ assertXPath(pXmlDoc, "/indexing/paragraph[3]"_ostr, "node_type"_ostr, "common");
+
+ assertXPath(pXmlDoc, "/indexing/object[2]"_ostr, "name"_ostr, "Diamond");
+ assertXPath(pXmlDoc, "/indexing/object[2]"_ostr, "object_type"_ostr, "shape");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[4]"_ostr, "This is a diamond");
+ assertXPath(pXmlDoc, "/indexing/paragraph[4]"_ostr, "node_type"_ostr, "common");
+
+ assertXPath(pXmlDoc, "/indexing/object[3]"_ostr, "name"_ostr, "Text Frame 1");
+ assertXPath(pXmlDoc, "/indexing/object[3]"_ostr, "object_type"_ostr, "shape");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[5]"_ostr, "This is a TextBox - Para1");
+ assertXPath(pXmlDoc, "/indexing/paragraph[5]"_ostr, "node_type"_ostr, "common");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[6]"_ostr, "Para2");
+ assertXPath(pXmlDoc, "/indexing/paragraph[6]"_ostr, "node_type"_ostr, "common");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[7]"_ostr, "Para3");
+ assertXPath(pXmlDoc, "/indexing/paragraph[7]"_ostr, "node_type"_ostr, "common");
}
void IndexingExportTest::testIndexingExport_Tables()
@@ -175,58 +177,58 @@ void IndexingExportTest::testIndexingExport_Tables()
xmlDocUniquePtr pXmlDoc = parseXmlStream(&aMemoryStream);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/indexing");
+ assertXPath(pXmlDoc, "/indexing"_ostr);
- assertXPath(pXmlDoc, "/indexing/object[1]", "name", "Table1");
- assertXPath(pXmlDoc, "/indexing/object[1]", "object_type", "table");
- assertXPath(pXmlDoc, "/indexing/object[1]", "index", "9");
+ assertXPath(pXmlDoc, "/indexing/object[1]"_ostr, "name"_ostr, "Table1");
+ assertXPath(pXmlDoc, "/indexing/object[1]"_ostr, "object_type"_ostr, "table");
+ assertXPath(pXmlDoc, "/indexing/object[1]"_ostr, "index"_ostr, "9");
// Search paragraph with parent_index = 9
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=9][1]", "A");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=9][2]", "B");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=9][3]", "1");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=9][4]", "2");
-
- assertXPath(pXmlDoc, "/indexing/object[2]", "name", "Table2");
- assertXPath(pXmlDoc, "/indexing/object[2]", "object_type", "table");
- assertXPath(pXmlDoc, "/indexing/object[2]", "index", "24");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=9][1]"_ostr, "A");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=9][2]"_ostr, "B");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=9][3]"_ostr, "1");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=9][4]"_ostr, "2");
+
+ assertXPath(pXmlDoc, "/indexing/object[2]"_ostr, "name"_ostr, "Table2");
+ assertXPath(pXmlDoc, "/indexing/object[2]"_ostr, "object_type"_ostr, "table");
+ assertXPath(pXmlDoc, "/indexing/object[2]"_ostr, "index"_ostr, "24");
// Search paragraph with parent_index = 24
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][1]", "A");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][2]", "B");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][3]", "C");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][4]", "1");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][5]", "10");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][6]", "100");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][7]", "2");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][8]", "20");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][9]", "200");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][10]", "3");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][11]", "30");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][12]", "300");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][13]", "4");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][14]", "40");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][15]", "400");
-
- assertXPath(pXmlDoc, "/indexing/object[3]", "name", "WeirdTable");
- assertXPath(pXmlDoc, "/indexing/object[3]", "object_type", "table");
- assertXPath(pXmlDoc, "/indexing/object[3]", "index", "72");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][1]"_ostr, "A");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][2]"_ostr, "B");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][3]"_ostr, "C");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][4]"_ostr, "1");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][5]"_ostr, "10");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][6]"_ostr, "100");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][7]"_ostr, "2");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][8]"_ostr, "20");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][9]"_ostr, "200");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][10]"_ostr, "3");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][11]"_ostr, "30");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][12]"_ostr, "300");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][13]"_ostr, "4");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][14]"_ostr, "40");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=24][15]"_ostr, "400");
+
+ assertXPath(pXmlDoc, "/indexing/object[3]"_ostr, "name"_ostr, "WeirdTable");
+ assertXPath(pXmlDoc, "/indexing/object[3]"_ostr, "object_type"_ostr, "table");
+ assertXPath(pXmlDoc, "/indexing/object[3]"_ostr, "index"_ostr, "72");
// Search paragraph with parent_index = 72
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][1]", "A1");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][2]", "B1");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][3]", "C1");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][4]", "D1");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][5]", "A2B2");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][6]", "C2D2");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][7]", "A3B3C3D3");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][8]", "A4-1");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][9]", "A4-2");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][10]", "B4-1");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][11]", "C4-1");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][12]", "D4-1");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][13]", "D4-2");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][14]", "B4-2");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][15]", "C4-2");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][16]", "A5B5C5");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][17]", "D5");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][1]"_ostr, "A1");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][2]"_ostr, "B1");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][3]"_ostr, "C1");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][4]"_ostr, "D1");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][5]"_ostr, "A2B2");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][6]"_ostr, "C2D2");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][7]"_ostr, "A3B3C3D3");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][8]"_ostr, "A4-1");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][9]"_ostr, "A4-2");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][10]"_ostr, "B4-1");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][11]"_ostr, "C4-1");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][12]"_ostr, "D4-1");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][13]"_ostr, "D4-2");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][14]"_ostr, "B4-2");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][15]"_ostr, "C4-2");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][16]"_ostr, "A5B5C5");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[@parent_index=72][17]"_ostr, "D5");
}
void IndexingExportTest::testIndexingExport_Sections()
@@ -243,22 +245,24 @@ void IndexingExportTest::testIndexingExport_Sections()
xmlDocUniquePtr pXmlDoc = parseXmlStream(&aMemoryStream);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/indexing");
+ assertXPath(pXmlDoc, "/indexing"_ostr);
- assertXPath(pXmlDoc, "/indexing/object[1]", "name", "Section1");
- assertXPath(pXmlDoc, "/indexing/object[1]", "object_type", "section");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[1]", "This is a paragraph in a Section1");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[2]", "Section1 - Paragraph 2");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[3]", "Section1 - Paragraph 3");
+ assertXPath(pXmlDoc, "/indexing/object[1]"_ostr, "name"_ostr, "Section1");
+ assertXPath(pXmlDoc, "/indexing/object[1]"_ostr, "object_type"_ostr, "section");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[1]"_ostr, "This is a paragraph in a Section1");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[2]"_ostr, "Section1 - Paragraph 2");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[3]"_ostr, "Section1 - Paragraph 3");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[4]", "This is a paragraph outside sections");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[4]"_ostr,
+ "This is a paragraph outside sections");
- assertXPath(pXmlDoc, "/indexing/object[2]", "name", "Section2");
- assertXPath(pXmlDoc, "/indexing/object[2]", "object_type", "section");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[5]", "Section2 - Paragraph 1");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[6]", "Section2 - Paragraph 2");
+ assertXPath(pXmlDoc, "/indexing/object[2]"_ostr, "name"_ostr, "Section2");
+ assertXPath(pXmlDoc, "/indexing/object[2]"_ostr, "object_type"_ostr, "section");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[5]"_ostr, "Section2 - Paragraph 1");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[6]"_ostr, "Section2 - Paragraph 2");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[7]", "This is a paragraph outside sections");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[7]"_ostr,
+ "This is a paragraph outside sections");
}
void IndexingExportTest::testIndexingExport_Fontwork()
@@ -275,15 +279,15 @@ void IndexingExportTest::testIndexingExport_Fontwork()
xmlDocUniquePtr pXmlDoc = parseXmlStream(&aMemoryStream);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/indexing");
+ assertXPath(pXmlDoc, "/indexing"_ostr);
- assertXPath(pXmlDoc, "/indexing/object[1]", "name", "Gray");
- assertXPath(pXmlDoc, "/indexing/object[1]", "object_type", "shape");
+ assertXPath(pXmlDoc, "/indexing/object[1]"_ostr, "name"_ostr, "Gray");
+ assertXPath(pXmlDoc, "/indexing/object[1]"_ostr, "object_type"_ostr, "shape");
- assertXPath(pXmlDoc, "/indexing/paragraph[1]", "object_name", "Gray");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[1]", "Fontwork Text 1");
- assertXPath(pXmlDoc, "/indexing/paragraph[2]", "object_name", "Gray");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[2]", "Fontwork Text 2");
+ assertXPath(pXmlDoc, "/indexing/paragraph[1]"_ostr, "object_name"_ostr, "Gray");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[1]"_ostr, "Fontwork Text 1");
+ assertXPath(pXmlDoc, "/indexing/paragraph[2]"_ostr, "object_name"_ostr, "Gray");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[2]"_ostr, "Fontwork Text 2");
}
void IndexingExportTest::testIndexingExport_Header_Footer()
@@ -300,12 +304,12 @@ void IndexingExportTest::testIndexingExport_Header_Footer()
xmlDocUniquePtr pXmlDoc = parseXmlStream(&aMemoryStream);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/indexing");
+ assertXPath(pXmlDoc, "/indexing"_ostr);
- assertXPathContent(pXmlDoc, "/indexing/paragraph[1]", "Header Text");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[2]", "Footer Text");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[3]", "Paragraph 1");
- assertXPathContent(pXmlDoc, "/indexing/paragraph[4]", "Paragraph 2");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[1]"_ostr, "Header Text");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[2]"_ostr, "Footer Text");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[3]"_ostr, "Paragraph 1");
+ assertXPathContent(pXmlDoc, "/indexing/paragraph[4]"_ostr, "Paragraph 2");
}
CPPUNIT_TEST_SUITE_REGISTRATION(IndexingExportTest);
diff --git a/sw/qa/extras/indexing/SearchResultLocatorTest.cxx b/sw/qa/extras/indexing/SearchResultLocatorTest.cxx
index 7265cc2c1e53..3772456c1d4c 100644
--- a/sw/qa/extras/indexing/SearchResultLocatorTest.cxx
+++ b/sw/qa/extras/indexing/SearchResultLocatorTest.cxx
@@ -76,7 +76,7 @@ void SearchResultLocatorTest::testSearchResultLocatorUsingXmlPayload()
sw::search::SearchResultLocator aLocator(pDoc);
OString payload = "<indexing>"
"<paragraph node_type=\"writer\" index=\"14\" />"
- "</indexing>";
+ "</indexing>"_ostr;
sw::search::LocationResult aResult = aLocator.findForPayload(payload.getStr());
CPPUNIT_ASSERT_EQUAL(size_t(1), aResult.maRectangles.size());
@@ -105,7 +105,7 @@ void SearchResultLocatorTest::testSearchResultLocatorUsingJsonPayload()
sw::search::SearchResultLocator aLocator(pDoc);
OString payload = "["
"{ \"node_type\" : \"writer\", \"index\" : 14 }"
- "]";
+ "]"_ostr;
sw::search::LocationResult aResult = aLocator.findForPayload(payload.getStr());
CPPUNIT_ASSERT_EQUAL(size_t(1), aResult.maRectangles.size());
@@ -162,7 +162,7 @@ void SearchResultLocatorTest::testSearchResultLocatorForSdrObjectsUsingJsonPaylo
sw::search::SearchResultLocator aLocator(pDoc);
OString payload = "["
"{ \"node_type\" : \"common\", \"index\" : 1, \"object_name\" : \"Circle\" }"
- "]";
+ "]"_ostr;
sw::search::LocationResult aResult = aLocator.findForPayload(payload.getStr());
CPPUNIT_ASSERT_EQUAL(size_t(1), aResult.maRectangles.size());
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 47f2eddbc42d..668f61f99088 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -41,63 +41,84 @@ void SwLayoutWriter::CheckRedlineFootnotesHidden()
{
discardDumpedLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "24");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "type", "PortionType::Footnote");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "1");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "foaz");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]",
- "type", "PortionType::Footnote");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]",
- "expand", "2");
- assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/merged", "paraPropsNodeIndex", "13");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "type", "PortionType::FootnoteNum");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "1");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "ac");
- assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/merged", "paraPropsNodeIndex", "16");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "type", "PortionType::FootnoteNum");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "2");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "mo");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, "24");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Footnote");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "1");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "foaz");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr,
+ "type"_ostr, "PortionType::Footnote");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr,
+ "expand"_ostr, "2");
+ assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/merged"_ostr,
+ "paraPropsNodeIndex"_ostr, "13");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "type"_ostr, "PortionType::FootnoteNum");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "1");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "ac");
+ assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/merged"_ostr,
+ "paraPropsNodeIndex"_ostr, "16");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "type"_ostr, "PortionType::FootnoteNum");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "2");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "mo");
}
void SwLayoutWriter::CheckRedlineSectionsHidden()
{
discardDumpedLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "12");
- 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]",
- "portion", "folah");
- assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt[1]/merged", "paraPropsNodeIndex", "20");
- assertXPath(pXmlDoc,
- "/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
- assertXPath(pXmlDoc,
- "/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "folah");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, "12");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "folah");
+ assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt[1]/merged"_ostr,
+ "paraPropsNodeIndex"_ostr, "20");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "folah");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf156077)
@@ -106,10 +127,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", 3);
- assertXPath(pXmlDoc, "/root/page[2]/anchored/fly", 1);
+ assertXPath(pXmlDoc, "/root/page[1]/anchored/fly"_ostr, 3);
+ assertXPath(pXmlDoc, "/root/page[2]/anchored/fly"_ostr, 1);
// this was 0, the at-page anchored flys were not displayed
- assertXPath(pXmlDoc, "/root/page[3]/anchored/fly", 3);
+ assertXPath(pXmlDoc, "/root/page[3]/anchored/fly"_ostr, 3);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFootnotes)
@@ -130,138 +151,188 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFootnotes)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// show: nothing is merged
- assertXPath(pXmlDoc, "//merged", 0);
-
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "type", "PortionType::Footnote");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "1");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "fo");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "o");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]",
- "type", "PortionType::Footnote");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]",
- "expand", "2");
-
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "type", "PortionType::FootnoteNum");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "1");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "a");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "b");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "portion", "c");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "type", "PortionType::FootnoteNum");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "2");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "def");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "b");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "type", "PortionType::Footnote");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "3");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "ar");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[3]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "type", "PortionType::FootnoteNum");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[3]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "3");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[3]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[3]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "ghi");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "type", "PortionType::Footnote");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "4");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "b");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "az");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion[2]",
- "type", "PortionType::Footnote");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion[2]",
- "expand", "5");
-
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[4]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "type", "PortionType::FootnoteNum");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[4]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "4");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[4]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[4]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "jkl");
+ assertXPath(pXmlDoc, "//merged"_ostr, 0);
+
assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "type", "PortionType::FootnoteNum");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Footnote");
assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "5");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "1");
assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "m");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "fo");
assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "n");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "o");
assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "type", "PortionType::Text");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr,
+ "type"_ostr, "PortionType::Footnote");
assertXPath(pXmlDoc,
- "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "portion", "o");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr,
+ "expand"_ostr, "2");
+
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "type"_ostr, "PortionType::FootnoteNum");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "1");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "a");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "b");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "portion"_ostr, "c");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "type"_ostr, "PortionType::FootnoteNum");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "2");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "def");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "b");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Footnote");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "3");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "ar");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[3]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "type"_ostr, "PortionType::FootnoteNum");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[3]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "3");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[3]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[3]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "ghi");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Footnote");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "4");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "b");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "az");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr,
+ "type"_ostr, "PortionType::Footnote");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr,
+ "expand"_ostr, "5");
+
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[4]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "type"_ostr, "PortionType::FootnoteNum");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[4]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "4");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[4]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[4]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "jkl");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "type"_ostr, "PortionType::FootnoteNum");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "5");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "m");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "n");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/ftncont/ftn[5]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "portion"_ostr, "o");
// verify after hide
dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
@@ -277,8 +348,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]", "portion",
- "effectively by modern-day small to ");
+ assertXPath(pXMLLayoutDump, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[2]"_ostr,
+ "portion"_ostr, "effectively by modern-day small to ");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody)
@@ -340,23 +411,24 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody)
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "14");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr,
+ "14");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type",
- "PortionType::Para");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "foaz");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/merged",
- "paraPropsNodeIndex", "6");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "foaz");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/merged"_ostr,
+ "paraPropsNodeIndex"_ostr, "6");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "portion", "ahi");
+ "SwParaPortion[1]"_ostr,
+ "portion"_ostr, "ahi");
dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
@@ -364,78 +436,78 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody)
pXmlDoc = parseLayoutDump();
// show: nothing is merged
- assertXPath(pXmlDoc, "//merged", 0);
+ assertXPath(pXmlDoc, "//merged"_ostr, 0);
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "type",
- "PortionType::Text");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "fo");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "fo");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type",
- "PortionType::Text");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "o");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "o");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "portion", "a");
+ "SwLinePortion[1]"_ostr,
+ "portion"_ostr, "a");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "portion", "bc");
+ "SwLinePortion[2]"_ostr,
+ "portion"_ostr, "bc");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "portion", "def");
+ "SwParaPortion[1]"_ostr,
+ "portion"_ostr, "def");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "portion", "g");
+ "SwLinePortion[1]"_ostr,
+ "portion"_ostr, "g");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "portion", "hi");
+ "SwLinePortion[2]"_ostr,
+ "portion"_ostr, "hi");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type",
- "PortionType::Para");
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "bar");
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "bar");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "type",
- "PortionType::Text");
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "b");
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "b");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type",
- "PortionType::Text");
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "az");
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "az");
}
// anchor to 2nd (deleted) paragraph
@@ -460,16 +532,17 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody)
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "14");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr,
+ "14");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type",
- "PortionType::Para");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "foaz");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "foaz");
// hide: no anchored object shown
- assertXPath(pXmlDoc, "//anchored", 0);
+ assertXPath(pXmlDoc, "//anchored"_ostr, 0);
dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
@@ -477,78 +550,78 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody)
pXmlDoc = parseLayoutDump();
// show: nothing is merged
- assertXPath(pXmlDoc, "//merged", 0);
+ assertXPath(pXmlDoc, "//merged"_ostr, 0);
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "type",
- "PortionType::Text");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "fo");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "fo");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type",
- "PortionType::Text");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "o");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "o");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type",
- "PortionType::Para");
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "bar");
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "bar");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "portion", "a");
+ "SwLinePortion[1]"_ostr,
+ "portion"_ostr, "a");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "portion", "bc");
+ "SwLinePortion[2]"_ostr,
+ "portion"_ostr, "bc");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "portion", "def");
+ "SwParaPortion[1]"_ostr,
+ "portion"_ostr, "def");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "portion", "g");
+ "SwLinePortion[1]"_ostr,
+ "portion"_ostr, "g");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "portion", "hi");
+ "SwLinePortion[2]"_ostr,
+ "portion"_ostr, "hi");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "type",
- "PortionType::Text");
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "b");
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "b");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type",
- "PortionType::Text");
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "az");
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "az");
}
// anchor to 3rd paragraph
@@ -572,23 +645,24 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody)
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "14");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr,
+ "14");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type",
- "PortionType::Para");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "foaz");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/merged",
- "paraPropsNodeIndex", "6");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "foaz");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/merged"_ostr,
+ "paraPropsNodeIndex"_ostr, "6");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "portion", "ahi");
+ "SwParaPortion[1]"_ostr,
+ "portion"_ostr, "ahi");
dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
@@ -596,78 +670,78 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody)
pXmlDoc = parseLayoutDump();
// show: nothing is merged
- assertXPath(pXmlDoc, "//merged", 0);
+ assertXPath(pXmlDoc, "//merged"_ostr, 0);
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "type",
- "PortionType::Text");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "fo");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "fo");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type",
- "PortionType::Text");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "o");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "o");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type",
- "PortionType::Para");
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "bar");
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "bar");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "type",
- "PortionType::Text");
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "b");
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "b");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type",
- "PortionType::Text");
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "az");
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "az");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "portion", "a");
+ "SwLinePortion[1]"_ostr,
+ "portion"_ostr, "a");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "portion", "bc");
+ "SwLinePortion[2]"_ostr,
+ "portion"_ostr, "bc");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "portion", "def");
+ "SwParaPortion[1]"_ostr,
+ "portion"_ostr, "def");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "portion", "g");
+ "SwLinePortion[1]"_ostr,
+ "portion"_ostr, "g");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "portion", "hi");
+ "SwLinePortion[2]"_ostr,
+ "portion"_ostr, "hi");
}
}
@@ -677,8 +751,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", "height", "843");
- assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/infos/bounds", "bottom", "2819");
+ assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/infos/bounds"_ostr, "height"_ostr, "843");
+ assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/infos/bounds"_ostr, "bottom"_ostr, "2819");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestNestedTableMoveFwd)
@@ -688,10 +762,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]",
+ assertXPathContent(pXmlDoc, "/root/page[1]/body/tab[1]/row[last()]/cell[1]/txt[1]"_ostr,
"Tabelle 1");
- assertXPathContent(
- pXmlDoc, "/root/page[2]/body/tab[1]/row[1]/cell[1]/tab[1]/row[1]/cell[1]/txt", "Tabelle 2");
+ assertXPathContent(pXmlDoc,
+ "/root/page[2]/body/tab[1]/row[1]/cell[1]/tab[1]/row[1]/cell[1]/txt"_ostr,
+ "Tabelle 2");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf136613)
@@ -733,7 +808,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", 3);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 3);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader)
@@ -799,25 +874,26 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader)
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout", "type",
- "PortionType::Para");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]", "length",
- "0");
- assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/merged", "paraPropsNodeIndex", "6");
- assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout[1]", "type",
- "PortionType::Para");
- assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout[1]", "portion",
- "foaz");
- assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/merged",
- "paraPropsNodeIndex", "11");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout"_ostr,
+ "type"_ostr, "PortionType::Para");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr,
+ "length"_ostr, "0");
+ assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr,
+ "6");
+ assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
+ assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr,
+ "portion"_ostr, "foaz");
+ assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/merged"_ostr,
+ "paraPropsNodeIndex"_ostr, "11");
assertXPath(
pXmlDoc,
- "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout[1]",
- "type", "PortionType::Para");
+ "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(
pXmlDoc,
- "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout[1]",
- "portion", "ahi");
+ "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr,
+ "portion"_ostr, "ahi");
dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
@@ -825,82 +901,82 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader)
pXmlDoc = parseLayoutDump();
// show: nothing is merged
- assertXPath(pXmlDoc, "//merged", 0);
+ assertXPath(pXmlDoc, "//merged"_ostr, 0);
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]", "type",
- "PortionType::Para");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]", "length",
- "0");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr,
+ "length"_ostr, "0");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "fo");
+ "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "fo");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "o");
+ "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "o");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "portion", "a");
+ "SwLinePortion[1]"_ostr,
+ "portion"_ostr, "a");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "portion", "bc");
+ "SwLinePortion[2]"_ostr,
+ "portion"_ostr, "bc");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[1]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[1]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "portion", "def");
+ "SwParaPortion[1]"_ostr,
+ "portion"_ostr, "def");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "portion", "g");
+ "SwLinePortion[1]"_ostr,
+ "portion"_ostr, "g");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "portion", "hi");
+ "SwLinePortion[2]"_ostr,
+ "portion"_ostr, "hi");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
+ "/root/page[1]/header/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "bar");
+ "/root/page[1]/header/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "bar");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "b");
+ "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "b");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "az");
+ "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "az");
}
// anchor to 2nd (deleted) paragraph
@@ -928,16 +1004,17 @@ 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", "paraPropsNodeIndex", "6");
+ assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr,
+ "6");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
+ "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "foaz");
+ "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "foaz");
// hide: no anchored object shown
- assertXPath(pXmlDoc, "//anchored", 0);
+ assertXPath(pXmlDoc, "//anchored"_ostr, 0);
dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
@@ -945,84 +1022,84 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader)
pXmlDoc = parseLayoutDump();
// show: nothing is merged
- assertXPath(pXmlDoc, "//merged", 0);
+ assertXPath(pXmlDoc, "//merged"_ostr, 0);
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type",
- "PortionType::Para");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "length", "0");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "length"_ostr, "0");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "fo");
+ "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "fo");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "o");
+ "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "o");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
+ "/root/page[1]/header/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "bar");
+ "/root/page[1]/header/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "bar");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "portion", "a");
+ "SwLinePortion[1]"_ostr,
+ "portion"_ostr, "a");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "portion", "bc");
+ "SwLinePortion[2]"_ostr,
+ "portion"_ostr, "bc");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[2]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[2]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "portion", "def");
+ "SwParaPortion[1]"_ostr,
+ "portion"_ostr, "def");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "portion", "g");
+ "SwLinePortion[1]"_ostr,
+ "portion"_ostr, "g");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "portion", "hi");
+ "SwLinePortion[2]"_ostr,
+ "portion"_ostr, "hi");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "b");
+ "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "b");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "az");
+ "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "az");
}
// anchor to 3rd paragraph
@@ -1047,28 +1124,29 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader)
discardDumpedLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type",
- "PortionType::Para");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "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", "paraPropsNodeIndex", "6");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "length"_ostr, "0");
+ assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr,
+ "6");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
+ "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "foaz");
- assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/merged",
- "paraPropsNodeIndex", "11");
+ "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "foaz");
+ assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/merged"_ostr,
+ "paraPropsNodeIndex"_ostr, "11");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "portion", "ahi");
+ "SwParaPortion[1]"_ostr,
+ "portion"_ostr, "ahi");
dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
@@ -1076,84 +1154,84 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader)
pXmlDoc = parseLayoutDump();
// show: nothing is merged
- assertXPath(pXmlDoc, "//merged", 0);
+ assertXPath(pXmlDoc, "//merged"_ostr, 0);
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type",
- "PortionType::Para");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "length", "0");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "length"_ostr, "0");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "fo");
+ "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "fo");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "o");
+ "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "o");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
+ "/root/page[1]/header/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "bar");
+ "/root/page[1]/header/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "bar");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "b");
+ "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "b");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "az");
+ "/root/page[1]/header/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "az");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "portion", "a");
+ "SwLinePortion[1]"_ostr,
+ "portion"_ostr, "a");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "portion", "bc");
+ "SwLinePortion[2]"_ostr,
+ "portion"_ostr, "bc");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[3]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[3]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "portion", "def");
+ "SwParaPortion[1]"_ostr,
+ "portion"_ostr, "def");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "portion", "g");
+ "SwLinePortion[1]"_ostr,
+ "portion"_ostr, "g");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/header/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "portion", "hi");
+ "SwLinePortion[2]"_ostr,
+ "portion"_ostr, "hi");
}
}
@@ -1168,23 +1246,23 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf150606)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- 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);
+ 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);
// on page 5 the table is split across balanced columns
- 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);
+ 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);
pWrtShell->Down(false, 1);
dispatchCommand(mxComponent, ".uno:DeleteTable", {});
@@ -1192,8 +1270,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf150606)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/section/column/body/tab", 0);
- assertXPath(pXmlDoc, "/root/page", 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/section/column/body/tab"_ostr, 0);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 1);
pWrtShell->Undo();
Scheduler::ProcessEventsToIdle();
@@ -1201,24 +1279,24 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf150606)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- 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);
+ 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);
// 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", 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);
+ 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);
}
#endif
@@ -1244,28 +1322,28 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf137025)
"/DefaultProperties/SfxItemSet/SdrMetricItem/SfxInt32Item"
"[@whichId='"
+ OString::number(SDRATTR_TEXT_LEFTDIST) + "']",
- "value", "567");
+ "value"_ostr, "567");
// SDRATTR_TEXT_RIGHTDIST
assertXPath(pXmlDoc,
"/root/page/body/txt/anchored/SwAnchoredDrawObject/SdrObject"
"/DefaultProperties/SfxItemSet/SdrMetricItem/SfxInt32Item"
"[@whichId='"
+ OString::number(SDRATTR_TEXT_RIGHTDIST) + "']",
- "value", "1134");
+ "value"_ostr, "1134");
// SDRATTR_TEXT_UPPERDIST
assertXPath(pXmlDoc,
"/root/page/body/txt/anchored/SwAnchoredDrawObject/SdrObject"
"/DefaultProperties/SfxItemSet/SdrMetricItem/SfxInt32Item"
"[@whichId='"
+ OString::number(SDRATTR_TEXT_UPPERDIST) + "']",
- "value", "1701");
+ "value"_ostr, "1701");
// SDRATTR_TEXT_LOWERDIST
assertXPath(pXmlDoc,
"/root/page/body/txt/anchored/SwAnchoredDrawObject/SdrObject"
"/DefaultProperties/SfxItemSet/SdrMetricItem/SfxInt32Item"
"[@whichId='"
+ OString::number(SDRATTR_TEXT_LOWERDIST) + "']",
- "value", "2268");
+ "value"_ostr, "2268");
// Check the textbox-shape import too
auto xShp = getShape(1);
@@ -1395,35 +1473,37 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote)
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "25");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr,
+ "25");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/"
- "child::*[@type='PortionType::Footnote']",
- "type", "PortionType::Footnote");
+ "child::*[@type='PortionType::Footnote']"_ostr,
+ "type"_ostr, "PortionType::Footnote");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/"
- "child::*[@type='PortionType::Footnote']",
- "expand", "1");
- assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/merged", "paraPropsNodeIndex",
- "7");
- assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/merged",
- "paraPropsNodeIndex", "17");
+ "child::*[@type='PortionType::Footnote']"_ostr,
+ "expand"_ostr, "1");
+ assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/merged"_ostr,
+ "paraPropsNodeIndex"_ostr, "7");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/merged"_ostr,
+ "paraPropsNodeIndex"_ostr, "17");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwParaPortion[1]",
- "portion", "ahi");
+ "SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "ahi");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "type", "PortionType::FootnoteNum");
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "type"_ostr, "PortionType::FootnoteNum");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "1");
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "1");
dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
@@ -1431,124 +1511,124 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote)
pXmlDoc = parseLayoutDump();
// show: nothing is merged
- assertXPath(pXmlDoc, "//merged", 0);
+ assertXPath(pXmlDoc, "//merged"_ostr, 0);
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "type", "PortionType::Footnote");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Footnote");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "1");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "1");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]",
- "type", "PortionType::Footnote");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr,
+ "type"_ostr, "PortionType::Footnote");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]",
- "expand", "2");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr,
+ "expand"_ostr, "2");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwParaPortion[1]",
- "portion", "quux");
+ "SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "quux");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "type", "PortionType::FootnoteNum");
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "type"_ostr, "PortionType::FootnoteNum");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "1");
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "1");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[1]",
- "portion", "a");
+ "SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "a");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[2]",
- "portion", "bc");
+ "SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "bc");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[2]/SwParaPortion/"
- "SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[2]/SwParaPortion/"
- "SwLineLayout/SwParaPortion[1]",
- "portion", "def");
+ "SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "def");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[1]",
- "portion", "g");
+ "SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "g");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[2]",
- "portion", "hi");
+ "SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "hi");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "type", "PortionType::FootnoteNum");
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "type"_ostr, "PortionType::FootnoteNum");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "2");
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "2");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "fo");
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "fo");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "o");
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "o");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
+ "/root/page[1]/ftncont/ftn[2]/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "bar");
+ "/root/page[1]/ftncont/ftn[2]/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "bar");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "b");
+ "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "b");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "az");
+ "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "az");
}
// anchor to 2nd (deleted) paragraph
@@ -1576,26 +1656,27 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote)
discardDumpedLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "25");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr,
+ "25");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "type", "PortionType::Footnote");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Footnote");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "1");
- assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/merged", "paraPropsNodeIndex",
- "7");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "1");
+ assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/merged"_ostr,
+ "paraPropsNodeIndex"_ostr, "7");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "type", "PortionType::FootnoteNum");
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "type"_ostr, "PortionType::FootnoteNum");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "1");
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "1");
// hide: no anchored object shown
- assertXPath(pXmlDoc, "//anchored", 0);
+ assertXPath(pXmlDoc, "//anchored"_ostr, 0);
dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
@@ -1603,124 +1684,124 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote)
pXmlDoc = parseLayoutDump();
// show: nothing is merged
- assertXPath(pXmlDoc, "//merged", 0);
+ assertXPath(pXmlDoc, "//merged"_ostr, 0);
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "type", "PortionType::Footnote");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Footnote");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "1");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "1");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]",
- "type", "PortionType::Footnote");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr,
+ "type"_ostr, "PortionType::Footnote");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]",
- "expand", "2");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr,
+ "expand"_ostr, "2");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwParaPortion[1]",
- "portion", "quux");
+ "SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "quux");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "type", "PortionType::FootnoteNum");
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "type"_ostr, "PortionType::FootnoteNum");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "1");
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "1");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "type", "PortionType::FootnoteNum");
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "type"_ostr, "PortionType::FootnoteNum");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "2");
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "2");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "fo");
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "fo");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "o");
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "o");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[1]",
- "portion", "a");
+ "SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "a");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[2]",
- "portion", "bc");
+ "SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "bc");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[2]/SwParaPortion/"
- "SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[2]/SwParaPortion/"
- "SwLineLayout/SwParaPortion[1]",
- "portion", "def");
+ "SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "def");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[1]",
- "portion", "g");
+ "SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "g");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[2]",
- "portion", "hi");
+ "SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "hi");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
+ "/root/page[1]/ftncont/ftn[2]/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "bar");
+ "/root/page[1]/ftncont/ftn[2]/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "bar");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "b");
+ "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "b");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "az");
+ "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "az");
}
// anchor to 3rd paragraph
@@ -1748,33 +1829,35 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote)
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "25");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr,
+ "25");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Footnote");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "type", "PortionType::Footnote");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "1");
+ assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/merged"_ostr,
+ "paraPropsNodeIndex"_ostr, "7");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "1");
- assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/merged", "paraPropsNodeIndex",
- "7");
- assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/merged",
- "paraPropsNodeIndex", "17");
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/merged"_ostr,
+ "paraPropsNodeIndex"_ostr, "17");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwParaPortion[1]",
- "portion", "ahi");
+ "SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "ahi");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "type", "PortionType::FootnoteNum");
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "type"_ostr, "PortionType::FootnoteNum");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "1");
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "1");
dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
@@ -1782,128 +1865,128 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote)
pXmlDoc = parseLayoutDump();
// show: nothing is merged
- assertXPath(pXmlDoc, "//merged", 0);
+ assertXPath(pXmlDoc, "//merged"_ostr, 0);
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/"
- "child::*[@type='PortionType::Footnote'][1]",
- "type", "PortionType::Footnote");
+ "child::*[@type='PortionType::Footnote'][1]"_ostr,
+ "type"_ostr, "PortionType::Footnote");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/"
- "child::*[@type='PortionType::Footnote'][1]",
- "expand", "1");
+ "child::*[@type='PortionType::Footnote'][1]"_ostr,
+ "expand"_ostr, "1");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/"
- "child::*[@type='PortionType::Footnote'][2]",
- "type", "PortionType::Footnote");
+ "child::*[@type='PortionType::Footnote'][2]"_ostr,
+ "type"_ostr, "PortionType::Footnote");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/"
- "child::*[@type='PortionType::Footnote'][2]",
- "expand", "2");
+ "child::*[@type='PortionType::Footnote'][2]"_ostr,
+ "expand"_ostr, "2");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwParaPortion[1]",
- "portion", "quux");
+ "SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "quux");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "type", "PortionType::FootnoteNum");
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "type"_ostr, "PortionType::FootnoteNum");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "1");
+ "/root/page[1]/ftncont/ftn[1]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "1");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "type", "PortionType::FootnoteNum");
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "type"_ostr, "PortionType::FootnoteNum");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "2");
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "2");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "fo");
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "fo");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "o");
+ "/root/page[1]/ftncont/ftn[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "o");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
+ "/root/page[1]/ftncont/ftn[2]/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "bar");
+ "/root/page[1]/ftncont/ftn[2]/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "bar");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[1]",
- "portion", "a");
+ "SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "a");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[2]",
- "portion", "bc");
+ "SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "bc");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[2]/SwParaPortion/"
- "SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[2]/SwParaPortion/"
- "SwLineLayout/SwParaPortion[1]",
- "portion", "def");
+ "SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "def");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[1]",
- "portion", "g");
+ "SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "g");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[2]",
- "portion", "hi");
+ "SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "hi");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "b");
+ "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "b");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(
pXmlDoc,
- "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "az");
+ "/root/page[1]/ftncont/ftn[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "az");
}
}
@@ -1919,22 +2002,22 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf143239)
{
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- 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",
- "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",
- "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",
- "35662");
- p3txt1Left
- = getXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "left");
- assertXPath(pXmlDoc, "/root/page", 3);
+ 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, "18540");
+ 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, "23894");
+ 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, "35662");
+ p3txt1Left = getXPath(
+ pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds"_ostr, "left"_ostr);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 3);
discardDumpedLayout();
}
@@ -1946,22 +2029,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", 1);
- assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "top",
- "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",
- "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",
- "35662");
- assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "left",
- p3txt1Left);
- assertXPath(pXmlDoc, "/root/page", 3);
+ 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, "18540");
+ 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, "23894");
+ 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, "35662");
+ assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds"_ostr,
+ "left"_ostr, p3txt1Left);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 3);
discardDumpedLayout();
}
}
@@ -1975,24 +2058,25 @@ 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']",
+ "SwFixPortion[@type='PortionType::Fly'][@type='PortionType::Fly']"_ostr,
0);
// one line break, was: 5
assertXPath(pLayout,
- "/root/page[2]/body/tab[1]/row[5]/cell[5]/txt[1]/SwParaPortion/SwLineLayout", 1);
+ "/root/page[2]/body/tab[1]/row[5]/cell[5]/txt[1]/SwParaPortion/SwLineLayout"_ostr,
+ 1);
// one text portion, was: 1
assertXPath(
pLayout,
- "/root/page[2]/body/tab[1]/row[5]/cell[5]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion",
+ "/root/page[2]/body/tab[1]/row[5]/cell[5]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
1);
assertXPath(
pLayout,
- "/root/page[2]/body/tab[1]/row[5]/cell[5]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion",
- "portion", "Abc def ghi jkl mno pqr stu vwx yz.");
+ "/root/page[2]/body/tab[1]/row[5]/cell[5]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "portion"_ostr, "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", "height",
- "253");
+ assertXPath(pLayout, "/root/page[2]/body/tab[1]/row[5]/cell[5]/txt[1]/infos/bounds"_ostr,
+ "height"_ostr, "253");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf134277)
@@ -2008,7 +2092,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf134277)
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/metafile/push/push/push/layoutmode[2]", 0);
+ assertXPath(pXmlDoc, "/metafile/push/push/push/layoutmode[2]"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf116486)
@@ -2017,8 +2101,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf116486)
SwDoc* pDoc = getSwDoc();
CPPUNIT_ASSERT(pDoc);
OUString aTop = parseDump(
- "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/child::*[@type='PortionType::Fly']",
- "height");
+ "/root/page/body/txt/SwParaPortion/SwLineLayout[1]/child::*[@type='PortionType::Fly']"_ostr,
+ "height"_ostr);
CPPUNIT_ASSERT_EQUAL(OUString("4006"), aTop);
}
@@ -2031,14 +2115,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",
- "portion",
+ "SwLinePortion"_ostr,
+ "portion"_ostr,
"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();
+ SwTwips nPage9Top = getXPath(pLayout, "/root/page[9]/infos/bounds"_ostr, "top"_ostr).toInt32();
assertXPath(
pLayout,
- "/root/page[9]/body/section[1]/column[1]/body/txt[1]/anchored/fly[1]/notxt/infos/bounds",
- "top", OUString::number(nPage9Top + 1460));
+ "/root/page[9]/body/section[1]/column[1]/body/txt[1]/anchored/fly[1]/notxt/infos/bounds"_ostr,
+ "top"_ostr, OUString::number(nPage9Top + 1460));
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf152106)
@@ -2049,7 +2133,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf152106)
xmlDocUniquePtr pLayout = parseLayoutDump();
// frame on page 3
- assertXPath(pLayout, "/root/page[3]/sorted_objs/fly", 1);
+ assertXPath(pLayout, "/root/page[3]/sorted_objs/fly"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128198)
@@ -2060,11 +2144,12 @@ 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]", "portion",
+ assertXPath(pLayout, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[5]"_ostr,
+ "portion"_ostr,
"to access any service, any time, anywhere. From this perspective, satellite "
"boasts some ");
- assertXPath(pLayout, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[6]", "portion",
- "significant advantages. ");
+ assertXPath(pLayout, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[6]"_ostr,
+ "portion"_ostr, "significant advantages. ");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testNoLineBreakAtSlash)
@@ -2073,22 +2158,24 @@ 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", 2);
- assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]/child::*", "type",
- "PortionType::Para");
- assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]/child::*[1]",
- "type", "PortionType::Text");
- assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]/child::*[2]",
- "type", "PortionType::Blank");
- assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]/child::*[3]",
- "type", "PortionType::Text");
-
- assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]", "portion",
- "Blah blah bla bla bla ");
- assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]/SwLinePortion[1]",
- "portion", "Foostrasse");
- assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]/SwLinePortion[2]",
- "portion", "13/c/2, etc.");
+ 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, "PortionType::Para");
+ assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]/child::*[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]/child::*[2]"_ostr,
+ "type"_ostr, "PortionType::Blank");
+ assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]/child::*[3]"_ostr,
+ "type"_ostr, "PortionType::Text");
+
+ assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr,
+ "portion"_ostr, "Blah blah bla bla bla ");
+ assertXPath(pLayout,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "Foostrasse");
+ assertXPath(pLayout,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "13/c/2, etc.");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf106153)
@@ -2096,19 +2183,27 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf106153)
createSwDoc("tdf106153.docx");
xmlDocUniquePtr pDump = parseLayoutDump();
- 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 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 nShape1ValTop
- = getXPath(pDump, "/root/page/body/txt/anchored/fly[1]/infos/bounds", "top").toInt64();
+ = getXPath(pDump, "/root/page/body/txt/anchored/fly[1]/infos/bounds"_ostr, "top"_ostr)
+ .toInt64();
const sal_Int64 nShape2ValLeft
- = getXPath(pDump, "/root/page/body/txt/anchored/fly[2]/infos/bounds", "left").toInt64();
+ = getXPath(pDump, "/root/page/body/txt/anchored/fly[2]/infos/bounds"_ostr, "left"_ostr)
+ .toInt64();
const sal_Int64 nShape3ValRight
- = getXPath(pDump, "/root/page/body/txt/anchored/fly[3]/infos/bounds", "right").toInt64();
+ = getXPath(pDump, "/root/page/body/txt/anchored/fly[3]/infos/bounds"_ostr, "right"_ostr)
+ .toInt64();
const sal_Int64 nShape4ValBottom
- = getXPath(pDump, "/root/page/body/txt/anchored/fly[4]/infos/bounds", "bottom").toInt64();
+ = getXPath(pDump, "/root/page/body/txt/anchored/fly[4]/infos/bounds"_ostr, "bottom"_ostr)
+ .toInt64();
CPPUNIT_ASSERT_MESSAGE("The whole top textbox is inside the page!",
nPageValTop > nShape1ValTop);
@@ -2204,40 +2299,41 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFlys)
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "19");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/merged",
- "paraPropsNodeIndex", "6");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr,
+ "19");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/merged"_ostr,
+ "paraPropsNodeIndex"_ostr, "6");
assertXPath(
pXmlDoc,
- "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/merged",
- "paraPropsNodeIndex", "11");
+ "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/merged"_ostr,
+ "paraPropsNodeIndex"_ostr, "11");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/"
- "SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "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]",
- "portion", "jqr");
+ "SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "jqr");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwFixPortion[1]",
- "type",
+ "SwFixPortion[1]"_ostr,
+ "type"_ostr,
"PortionType::Fly"); // remove???
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLineLayout[1]",
- "type", "PortionType::Lay");
+ "SwLineLayout[1]"_ostr,
+ "type"_ostr, "PortionType::Lay");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLineLayout[1]",
- "portion", "abhi");
+ "SwLineLayout[1]"_ostr,
+ "portion"_ostr, "abhi");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type",
- "PortionType::Para");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "foaz");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "foaz");
dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
@@ -2245,123 +2341,123 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFlys)
pXmlDoc = parseLayoutDump();
// show: nothing is merged
- assertXPath(pXmlDoc, "//merged", 0);
+ assertXPath(pXmlDoc, "//merged"_ostr, 0);
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/"
- "SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "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]",
- "portion", "j");
+ "SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "j");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/"
- "SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "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]",
- "portion", "kl");
+ "SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "kl");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[2]/"
- "SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "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]",
- "portion", "mno");
+ "SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "mno");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[3]/"
- "SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "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]",
- "portion", "p");
+ "SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "p");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[3]/"
- "SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "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]",
- "portion", "qr");
+ "SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "qr");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwFixPortion[1]",
- "type",
+ "SwFixPortion[1]"_ostr,
+ "type"_ostr,
"PortionType::Fly"); // remove???
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "portion", "ab");
+ "SwLinePortion[1]"_ostr,
+ "portion"_ostr, "ab");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "portion", "c");
+ "SwLinePortion[2]"_ostr,
+ "portion"_ostr, "c");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "portion", "def");
+ "SwParaPortion[1]"_ostr,
+ "portion"_ostr, "def");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "portion", "g");
+ "SwLinePortion[1]"_ostr,
+ "portion"_ostr, "g");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "portion", "hi");
+ "SwLinePortion[2]"_ostr,
+ "portion"_ostr, "hi");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "type",
- "PortionType::Text");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "fo");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "fo");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type",
- "PortionType::Text");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "o");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "o");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type",
- "PortionType::Para");
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "bar");
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "bar");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "type",
- "PortionType::Text");
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "b");
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "b");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type",
- "PortionType::Text");
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "az");
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "az");
}
// anchor to 2nd (deleted) paragraph
@@ -2396,16 +2492,17 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFlys)
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "19");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr,
+ "19");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type",
- "PortionType::Para");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "foaz");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "foaz");
// hide: no anchored object shown
- assertXPath(pXmlDoc, "//anchored", 0);
+ assertXPath(pXmlDoc, "//anchored"_ostr, 0);
dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
@@ -2413,123 +2510,123 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFlys)
pXmlDoc = parseLayoutDump();
// show: nothing is merged
- assertXPath(pXmlDoc, "//merged", 0);
+ assertXPath(pXmlDoc, "//merged"_ostr, 0);
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "type",
- "PortionType::Text");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "fo");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "fo");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type",
- "PortionType::Text");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "o");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "o");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "portion", "j");
+ "SwLinePortion[1]"_ostr,
+ "portion"_ostr, "j");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "portion", "kl");
+ "SwLinePortion[2]"_ostr,
+ "portion"_ostr, "kl");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/anchored[1]/fly[1]/txt[1]/"
- "SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "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]",
- "portion", "ab");
+ "SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "ab");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/anchored[1]/fly[1]/txt[1]/"
- "SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "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]",
- "portion", "c");
+ "SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "c");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/anchored[1]/fly[1]/txt[2]/"
- "SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "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]",
- "portion", "def");
+ "SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "def");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/anchored[1]/fly[1]/txt[3]/"
- "SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "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]",
- "portion", "g");
+ "SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "g");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/anchored[1]/fly[1]/txt[3]/"
- "SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "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]",
- "portion", "hi");
+ "SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "hi");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/"
- "SwFixPortion[1]",
- "type",
+ "SwFixPortion[1]"_ostr,
+ "type"_ostr,
"PortionType::Fly"); // remove???
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/"
- "SwLineLayout[1]",
- "type", "PortionType::Lay");
+ "SwLineLayout[1]"_ostr,
+ "type"_ostr, "PortionType::Lay");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/"
- "SwLineLayout[1]",
- "portion", "mno");
+ "SwLineLayout[1]"_ostr,
+ "portion"_ostr, "mno");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "portion", "p");
+ "SwLinePortion[1]"_ostr,
+ "portion"_ostr, "p");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "portion", "qr");
+ "SwLinePortion[2]"_ostr,
+ "portion"_ostr, "qr");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type",
- "PortionType::Para");
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "bar");
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "bar");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "type",
- "PortionType::Text");
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "b");
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "b");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type",
- "PortionType::Text");
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "az");
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "az");
}
// anchor to 3rd paragraph
@@ -2562,40 +2659,41 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFlys)
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "19");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/merged",
- "paraPropsNodeIndex", "6");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr,
+ "19");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/merged"_ostr,
+ "paraPropsNodeIndex"_ostr, "6");
assertXPath(
pXmlDoc,
- "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/merged",
- "paraPropsNodeIndex", "11");
+ "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/merged"_ostr,
+ "paraPropsNodeIndex"_ostr, "11");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/"
- "SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "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]",
- "portion", "jqr");
+ "SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "jqr");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwFixPortion[1]",
- "type",
+ "SwFixPortion[1]"_ostr,
+ "type"_ostr,
"PortionType::Fly"); // remove???
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLineLayout[1]",
- "type", "PortionType::Lay");
+ "SwLineLayout[1]"_ostr,
+ "type"_ostr, "PortionType::Lay");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLineLayout[1]",
- "portion", "abhi");
+ "SwLineLayout[1]"_ostr,
+ "portion"_ostr, "abhi");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type",
- "PortionType::Para");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "foaz");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "foaz");
dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
@@ -2603,123 +2701,123 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFlys)
pXmlDoc = parseLayoutDump();
// show: nothing is merged
- assertXPath(pXmlDoc, "//merged", 0);
+ assertXPath(pXmlDoc, "//merged"_ostr, 0);
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "type",
- "PortionType::Text");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "fo");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "fo");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type",
- "PortionType::Text");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "o");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "o");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "type",
- "PortionType::Para");
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "bar");
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "bar");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "portion", "ab");
+ "SwLinePortion[1]"_ostr,
+ "portion"_ostr, "ab");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "portion", "c");
+ "SwLinePortion[2]"_ostr,
+ "portion"_ostr, "c");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "portion", "def");
+ "SwParaPortion[1]"_ostr,
+ "portion"_ostr, "def");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/anchored[1]/fly[1]/txt[1]/"
- "SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "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]",
- "portion", "j");
+ "SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "j");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/anchored[1]/fly[1]/txt[1]/"
- "SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "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]",
- "portion", "kl");
+ "SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "kl");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/anchored[1]/fly[1]/txt[2]/"
- "SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "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]",
- "portion", "mno");
+ "SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "mno");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/anchored[1]/fly[1]/txt[3]/"
- "SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "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]",
- "portion", "p");
+ "SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "p");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/anchored[1]/fly[1]/txt[3]/"
- "SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "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]",
- "portion", "qr");
+ "SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "qr");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwFixPortion[1]",
- "type",
+ "SwFixPortion[1]"_ostr,
+ "type"_ostr,
"PortionType::Fly"); // remove???
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "portion", "g");
+ "SwLinePortion[1]"_ostr,
+ "portion"_ostr, "g");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "portion", "hi");
+ "SwLinePortion[2]"_ostr,
+ "portion"_ostr, "hi");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "type",
- "PortionType::Text");
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "b");
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "b");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "type",
- "PortionType::Text");
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "az");
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "az");
}
}
@@ -2792,37 +2890,39 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysAtFlys)
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "19");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/merged",
- "paraPropsNodeIndex", "6");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, "19");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/merged"_ostr,
+ "paraPropsNodeIndex"_ostr, "6");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/merged",
- "paraPropsNodeIndex", "11");
+ "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/merged"_ostr,
+ "paraPropsNodeIndex"_ostr, "11");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwParaPortion[1]",
- "portion", "jqr");
+ "SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "jqr");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwFixPortion[1]",
- "type",
+ "SwFixPortion[1]"_ostr,
+ "type"_ostr,
"PortionType::Fly"); // remove???
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLineLayout[1]",
- "type", "PortionType::Lay");
+ "SwLineLayout[1]"_ostr,
+ "type"_ostr, "PortionType::Lay");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLineLayout[1]",
- "portion", "abhi");
- 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]",
- "portion", "foaz");
+ "SwLineLayout[1]"_ostr,
+ "portion"_ostr, "abhi");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "foaz");
dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
@@ -2830,113 +2930,123 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysAtFlys)
pXmlDoc = parseLayoutDump();
// show: nothing is merged
- assertXPath(pXmlDoc, "//merged", 0);
+ assertXPath(pXmlDoc, "//merged"_ostr, 0);
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[1]",
- "portion", "j");
+ "SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "j");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[2]",
- "portion", "kl");
+ "SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "kl");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[2]/SwParaPortion/"
- "SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[2]/SwParaPortion/"
- "SwLineLayout/SwParaPortion[1]",
- "portion", "mno");
+ "SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "mno");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[3]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[3]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[1]",
- "portion", "p");
+ "SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "p");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[3]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[3]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[2]",
- "portion", "qr");
+ "SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "qr");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwFixPortion[1]",
- "type",
+ "SwFixPortion[1]"_ostr,
+ "type"_ostr,
"PortionType::Fly"); // remove???
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "portion", "ab");
+ "SwLinePortion[1]"_ostr,
+ "portion"_ostr, "ab");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "portion", "c");
+ "SwLinePortion[2]"_ostr,
+ "portion"_ostr, "c");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "portion", "def");
+ "SwParaPortion[1]"_ostr,
+ "portion"_ostr, "def");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "portion", "g");
+ "SwLinePortion[1]"_ostr,
+ "portion"_ostr, "g");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "portion", "hi");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "fo");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "o");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "bar");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "b");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "az");
+ "SwLinePortion[2]"_ostr,
+ "portion"_ostr, "hi");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "fo");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "o");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "bar");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "b");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "az");
// anchor to 2nd (deleted) paragraph
pWrtShell->StartOfSection();
@@ -2949,14 +3059,16 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysAtFlys)
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "19");
- 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]",
- "portion", "foaz");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, "19");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "foaz");
// hide: no anchored object shown
- assertXPath(pXmlDoc, "//anchored", 0);
+ assertXPath(pXmlDoc, "//anchored"_ostr, 0);
dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
@@ -2964,113 +3076,123 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysAtFlys)
pXmlDoc = parseLayoutDump();
// show: nothing is merged
- assertXPath(pXmlDoc, "//merged", 0);
+ assertXPath(pXmlDoc, "//merged"_ostr, 0);
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "fo");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "o");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "fo");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "o");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[1]",
- "portion", "j");
+ "SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "j");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[2]",
- "portion", "kl");
+ "SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "kl");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[2]/SwParaPortion/"
- "SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[2]/SwParaPortion/"
- "SwLineLayout/SwParaPortion[1]",
- "portion", "mno");
+ "SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "mno");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[3]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[3]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[1]",
- "portion", "p");
+ "SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "p");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[3]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[3]/SwParaPortion/"
- "SwLineLayout/SwLinePortion[2]",
- "portion", "qr");
+ "SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "qr");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwFixPortion[1]",
- "type",
+ "SwFixPortion[1]"_ostr,
+ "type"_ostr,
"PortionType::Fly"); // remove???
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "portion", "ab");
+ "SwLinePortion[1]"_ostr,
+ "portion"_ostr, "ab");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "portion", "c");
+ "SwLinePortion[2]"_ostr,
+ "portion"_ostr, "c");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "portion", "def");
+ "SwParaPortion[1]"_ostr,
+ "portion"_ostr, "def");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "type", "PortionType::Text");
+ "SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[1]",
- "portion", "g");
+ "SwLinePortion[1]"_ostr,
+ "portion"_ostr, "g");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "type", "PortionType::Text");
+ "SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
"/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/SwParaPortion/SwLineLayout/"
- "SwLinePortion[2]",
- "portion", "hi");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "bar");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "b");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "az");
+ "SwLinePortion[2]"_ostr,
+ "portion"_ostr, "hi");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "bar");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "b");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "az");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineSections)
@@ -3093,74 +3215,74 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineSections)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// show: nothing is merged
- assertXPath(pXmlDoc, "//merged", 0);
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*[1]", "type",
- "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*[1]",
- "portion", "fo");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*[2]", "type",
- "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*[2]",
- "portion", "o");
+ assertXPath(pXmlDoc, "//merged"_ostr, 0);
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*[1]"_ostr,
+ "portion"_ostr, "fo");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*[2]"_ostr,
+ "portion"_ostr, "o");
assertXPath(pXmlDoc,
"/root/page[1]/body/section[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/child::*[1]",
- "type", "PortionType::Para");
+ "SwLineLayout/child::*[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/body/section[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/"
- "SwLineLayout/child::*[1]",
- "portion", "FRAME");
+ "SwLineLayout/child::*[1]"_ostr,
+ "portion"_ostr, "FRAME");
assertXPath(pXmlDoc,
- "/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout/child::*[1]",
- "type", "PortionType::Para");
+ "/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout/child::*[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
- "/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout/child::*[1]",
- "portion", "bar");
+ "/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout/child::*[1]"_ostr,
+ "portion"_ostr, "bar");
assertXPath(pXmlDoc,
- "/root/page[1]/body/section[1]/txt[2]/SwParaPortion/SwLineLayout/child::*[1]",
- "type", "PortionType::Para");
+ "/root/page[1]/body/section[1]/txt[2]/SwParaPortion/SwLineLayout/child::*[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
- "/root/page[1]/body/section[1]/txt[2]/SwParaPortion/SwLineLayout/child::*[1]",
- "portion", "baz");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/child::*[1]", "type",
- "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/child::*[1]",
- "portion", "b");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/child::*[2]", "type",
- "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/child::*[2]",
- "portion", "lah");
+ "/root/page[1]/body/section[1]/txt[2]/SwParaPortion/SwLineLayout/child::*[1]"_ostr,
+ "portion"_ostr, "baz");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/child::*[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/child::*[1]"_ostr,
+ "portion"_ostr, "b");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/child::*[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/child::*[2]"_ostr,
+ "portion"_ostr, "lah");
assertXPath(pXmlDoc,
- "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/child::*[1]",
- "type", "PortionType::Text");
+ "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/child::*[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/child::*[1]",
- "portion", "fo");
+ "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/child::*[1]"_ostr,
+ "portion"_ostr, "fo");
assertXPath(pXmlDoc,
- "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/child::*[2]",
- "type", "PortionType::Text");
+ "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/child::*[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/child::*[2]",
- "portion", "o");
+ "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/child::*[2]"_ostr,
+ "portion"_ostr, "o");
assertXPath(pXmlDoc,
- "/root/page[1]/body/section[2]/txt[2]/SwParaPortion/SwLineLayout/child::*[1]",
- "type", "PortionType::Para");
+ "/root/page[1]/body/section[2]/txt[2]/SwParaPortion/SwLineLayout/child::*[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
- "/root/page[1]/body/section[2]/txt[2]/SwParaPortion/SwLineLayout/child::*[1]",
- "portion", "bar");
+ "/root/page[1]/body/section[2]/txt[2]/SwParaPortion/SwLineLayout/child::*[1]"_ostr,
+ "portion"_ostr, "bar");
assertXPath(pXmlDoc,
- "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/child::*[1]",
- "type", "PortionType::Text");
+ "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/child::*[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/child::*[1]",
- "portion", "b");
+ "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/child::*[1]"_ostr,
+ "portion"_ostr, "b");
assertXPath(pXmlDoc,
- "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/child::*[2]",
- "type", "PortionType::Text");
+ "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/child::*[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
assertXPath(pXmlDoc,
- "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/child::*[2]",
- "portion", "lah");
+ "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/child::*[2]"_ostr,
+ "portion"_ostr, "lah");
// verify after hide
dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
@@ -3199,11 +3321,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineTables)
// verify after load
discardDumpedLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "12");
- 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]",
- "portion", "foar");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, "12");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "foar");
dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
@@ -3213,48 +3337,56 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineTables)
pXmlDoc = parseLayoutDump();
// show: nothing is merged
- assertXPath(pXmlDoc, "//merged", 0);
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "fo");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "o");
+ assertXPath(pXmlDoc, "//merged"_ostr, 0);
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "fo");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "o");
assertXPath(pXmlDoc,
"/root/page[1]/body/tab[1]/row[1]/cell[1]/txt[1]/anchored/fly[1]/txt[1]/"
- "SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "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]",
- "portion", "FRAME");
+ "SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "FRAME");
assertXPath(pXmlDoc,
"/root/page[1]/body/tab[1]/row[1]/cell[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/body/tab[1]/row[1]/cell[1]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "portion", "aaa");
+ "SwParaPortion[1]"_ostr,
+ "portion"_ostr, "aaa");
assertXPath(pXmlDoc,
"/root/page[1]/body/tab[1]/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "type", "PortionType::Para");
+ "SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
"/root/page[1]/body/tab[1]/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[1]",
- "portion", "ddd");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "b");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "ar");
+ "SwParaPortion[1]"_ostr,
+ "portion"_ostr, "ddd");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "b");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "ar");
// verify after hide
dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
@@ -3263,11 +3395,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineTables)
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "12");
- 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]",
- "portion", "foar");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, "12");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "foar");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144057)
@@ -3281,19 +3415,23 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144057)
discardDumpedLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// show tracked row deletions
- assertXPath(pXmlDoc, "/root/page", 4);
- assertXPath(pXmlDoc,
- "/root/page[1]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion",
- "portion", "A6");
- assertXPath(pXmlDoc,
- "/root/page[2]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion",
- "portion", "A12");
- assertXPath(pXmlDoc,
- "/root/page[3]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion",
- "portion", "B6");
- assertXPath(pXmlDoc,
- "/root/page[4]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion",
- "portion", "B12");
+ assertXPath(pXmlDoc, "/root/page"_ostr, 4);
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "portion"_ostr, "A6");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[2]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "portion"_ostr, "A12");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[3]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "portion"_ostr, "B6");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[4]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "portion"_ostr, "B12");
// hide tracked table and table row deletions
dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
@@ -3303,12 +3441,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144057)
pXmlDoc = parseLayoutDump();
// This was 4 (unhidden tracked table and table row deletions)
- 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", "B12");
+ 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, "B12");
// show tracked table and table row deletions again
dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
@@ -3316,19 +3455,23 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144057)
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page", 4);
- assertXPath(pXmlDoc,
- "/root/page[1]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion",
- "portion", "A6");
- assertXPath(pXmlDoc,
- "/root/page[2]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion",
- "portion", "A12");
- assertXPath(pXmlDoc,
- "/root/page[3]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion",
- "portion", "B6");
- assertXPath(pXmlDoc,
- "/root/page[4]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion",
- "portion", "B12");
+ assertXPath(pXmlDoc, "/root/page"_ostr, 4);
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "portion"_ostr, "A6");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[2]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "portion"_ostr, "A12");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[3]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "portion"_ostr, "B6");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[4]/body/tab/row[6]/cell/txt/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "portion"_ostr, "B12");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144347)
@@ -3354,8 +3497,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144347)
discardDumpedLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// show tracked row deletions
- assertXPath(pXmlDoc, "/root/page", 2);
- assertXPath(pXmlDoc, "/root/page[1]/body/tab", 1);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 2);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab"_ostr, 1);
// select all the text, including the texts before and after the table
// Note: this table contains tracked changes, which was a
@@ -3369,8 +3512,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144347)
pXmlDoc = parseLayoutDump();
// table is deleted with change tracking: it still exists
- assertXPath(pXmlDoc, "/root/page", 2);
- assertXPath(pXmlDoc, "/root/page[1]/body/tab", 1);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 2);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab"_ostr, 1);
// accept all deletions, removing the table completely
while (pEditShell->GetRedlineCount() > 0)
@@ -3380,9 +3523,9 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144347)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page", 1);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 1);
// This was 1 (bad empty table)
- assertXPath(pXmlDoc, "/root/page[1]/body/tab", 0);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf155345)
@@ -3408,7 +3551,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf155345)
discardDumpedLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// show tracked column deletions
- assertXPath(pXmlDoc, "/root/page", 4);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 4);
// hide tracked table column deletions
dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
@@ -3418,7 +3561,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf155345)
pXmlDoc = parseLayoutDump();
// This was 4 (unhidden tracked table column deletions)
- assertXPath(pXmlDoc, "/root/page", 2);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 2);
// show tracked table column deletions again
dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
@@ -3426,7 +3569,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf155345)
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page", 4);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 4);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf109137)
@@ -3443,7 +3586,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf109137)
mxComponent = loadFromDesktop(maTempFile.GetURL(), "com.sun.star.text.TextDocument");
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",
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/fly/notxt"_ostr,
/*nNumberOfNodes=*/1);
}
@@ -3529,7 +3672,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", "Abcd efghijkl");
+ assertXPathContent(pXmlDoc, "//tab/row/cell[1]/txt"_ostr, "Abcd efghijkl");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf142694)
@@ -3544,16 +3687,17 @@ 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]", "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);
+ 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);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf152413)
@@ -3565,8 +3709,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", "portion",
- u"صِرَ ٰطَ"_ustr);
+ assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/SwLinePortion"_ostr,
+ "portion"_ostr, u"صِرَ ٰطَ"_ustr);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf125893)
@@ -3574,7 +3718,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", "top", "0");
+ assertXPath(pXmlDoc, "/root/page/body/txt[4]/infos/prtBounds"_ostr, "top"_ostr, "0");
}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index a550dd60a269..12dba9a65ce6 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -48,93 +48,131 @@ void SwLayoutWriter2::CheckRedlineCharAttributesHidden()
{
discardDumpedLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "9");
- 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]",
- "portion", "foobaz");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/merged", "paraPropsNodeIndex", "10");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "foobaz");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/merged", "paraPropsNodeIndex", "11");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "foo");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "baz");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/merged", "paraPropsNodeIndex", "12");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "foo");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "baz");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/merged", "paraPropsNodeIndex", "13");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "foo");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "baz");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/merged", "paraPropsNodeIndex", "14");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "foo");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "baz");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/merged", "paraPropsNodeIndex", "15");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "foo");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "baz");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/merged", "paraPropsNodeIndex", "16");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "foo");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "baz");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/merged", "paraPropsNodeIndex", "17");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "foobaz");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/merged", "paraPropsNodeIndex", "18");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "fo");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "ob");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "portion", "az");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/merged", "paraPropsNodeIndex", "19");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "type", "PortionType::Para");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
- "portion", "foobaz");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr, "9");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "foobaz");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/merged"_ostr, "paraPropsNodeIndex"_ostr, "10");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "foobaz");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/merged"_ostr, "paraPropsNodeIndex"_ostr, "11");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "foo");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "baz");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/merged"_ostr, "paraPropsNodeIndex"_ostr, "12");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "foo");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "baz");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/merged"_ostr, "paraPropsNodeIndex"_ostr, "13");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "foo");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "baz");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/merged"_ostr, "paraPropsNodeIndex"_ostr, "14");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "foo");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "baz");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/merged"_ostr, "paraPropsNodeIndex"_ostr, "15");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "foo");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "baz");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/merged"_ostr, "paraPropsNodeIndex"_ostr, "16");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "foo");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "baz");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/merged"_ostr, "paraPropsNodeIndex"_ostr, "17");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "foobaz");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/merged"_ostr, "paraPropsNodeIndex"_ostr, "18");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "fo");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "ob");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "portion"_ostr, "az");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/merged"_ostr, "paraPropsNodeIndex"_ostr, "19");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr,
+ "portion"_ostr, "foobaz");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf148897)
@@ -143,19 +181,20 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf148897)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- 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);
+ 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);
// fly portion exists, no overlapping text
- assertXPath(pXmlDoc, "/root/page[4]/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwFixPortion",
- "height", "5797");
- assertXPath(pXmlDoc, "/root/page[5]/sorted_objs/fly", 0);
- assertXPath(pXmlDoc, "/root/page", 5);
+ assertXPath(pXmlDoc,
+ "/root/page[4]/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwFixPortion"_ostr,
+ "height"_ostr, "5797");
+ assertXPath(pXmlDoc, "/root/page[5]/sorted_objs/fly"_ostr, 0);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 5);
auto xModel = mxComponent.queryThrow<frame::XModel>();
uno::Reference<drawing::XShape> xShape(getShapeByName(u"Image3"));
@@ -167,55 +206,58 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf148897)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- 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);
+ 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);
// fly portion exists, no overlapping text
- assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwFixPortion",
- "height", "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);
+ assertXPath(pXmlDoc,
+ "/root/page[3]/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwFixPortion"_ostr,
+ "height"_ostr, "5797");
+ 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);
dispatchCommand(mxComponent, ".uno:Undo", {});
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- 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);
+ 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);
// fly portion exists, no overlapping text
- assertXPath(pXmlDoc, "/root/page[4]/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwFixPortion",
- "height", "5797");
- assertXPath(pXmlDoc, "/root/page[5]/sorted_objs/fly", 0);
- assertXPath(pXmlDoc, "/root/page", 5);
+ assertXPath(pXmlDoc,
+ "/root/page[4]/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwFixPortion"_ostr,
+ "height"_ostr, "5797");
+ assertXPath(pXmlDoc, "/root/page[5]/sorted_objs/fly"_ostr, 0);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 5);
dispatchCommand(mxComponent, ".uno:Redo", {});
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- 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);
+ 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);
// fly portion exists, no overlapping text
- assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwFixPortion",
- "height", "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);
+ assertXPath(pXmlDoc,
+ "/root/page[3]/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwFixPortion"_ostr,
+ "height"_ostr, "5797");
+ 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);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineCharAttributes)
@@ -238,159 +280,235 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineCharAttributes)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// show: nothing is merged
- assertXPath(pXmlDoc, "//merged", 0);
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "foo");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "bar");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "portion", "baz");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "foo");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "bar");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "portion", "baz");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "foo");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "bar");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "portion", "baz");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "foo");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "bar");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "portion", "baz");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "foo");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "bar");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "portion", "baz");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "foo");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "bar");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "portion", "baz");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "foo");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "bar");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "portion", "baz");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "foo");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "ba");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "portion", "r");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[4]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[4]",
- "portion", "baz");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "foo");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "bar");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "portion", "baz");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "fo");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "o");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "portion", "bar");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[4]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[4]",
- "portion", "b");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[5]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[5]",
- "portion", "az");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "foo");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "b");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[3]",
- "portion", "a");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[4]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[4]",
- "portion", "r");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[5]",
- "type", "PortionType::Text");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[5]",
- "portion", "baz");
+ assertXPath(pXmlDoc, "//merged"_ostr, 0);
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "foo");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "bar");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "portion"_ostr, "baz");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "foo");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "bar");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "portion"_ostr, "baz");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "foo");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "bar");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "portion"_ostr, "baz");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "foo");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "bar");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "portion"_ostr, "baz");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "foo");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "bar");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "portion"_ostr, "baz");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "foo");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "bar");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "portion"_ostr, "baz");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "foo");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "bar");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "portion"_ostr, "baz");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "foo");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "ba");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "portion"_ostr, "r");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[4]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion[4]"_ostr,
+ "portion"_ostr, "baz");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "foo");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "bar");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[9]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "portion"_ostr, "baz");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "fo");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "o");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "portion"_ostr, "bar");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[4]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[4]"_ostr,
+ "portion"_ostr, "b");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[5]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwLinePortion[5]"_ostr,
+ "portion"_ostr, "az");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "foo");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "b");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr,
+ "portion"_ostr, "a");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[4]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[4]"_ostr,
+ "portion"_ostr, "r");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[5]"_ostr,
+ "type"_ostr, "PortionType::Text");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/txt[11]/SwParaPortion/SwLineLayout/SwLinePortion[5]"_ostr,
+ "portion"_ostr, "baz");
// verify after hide
dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
@@ -412,13 +530,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineShowHideFootnotePagination)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// check footnotes
- assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn", 6);
- assertXPath(pXmlDoc, "/root/page[2]/ftncont/ftn", 3);
+ assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn"_ostr, 6);
+ assertXPath(pXmlDoc, "/root/page[2]/ftncont/ftn"_ostr, 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()]",
- "portion",
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[last()]/SwParaPortion/SwLineLayout[last()]"_ostr,
+ "portion"_ostr,
"yyyyyyyyy yyy yyyyyyyyyyyyyyyy yyyyyyy yyy yyyyy yyyyyyyyy yyy yyyyyyyyy ");
- assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/SwParaPortion/SwLineLayout[1]", "portion",
+ assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr,
+ "portion"_ostr,
"zzz. zzz zzzz zzzz* zzz zzz zzzzzzz zzz zzzz zzzzzzzzzzzzzz zzzzzzzzzzzz ");
// hide redlines - all still visible footnotes move to page 1
@@ -427,8 +546,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineShowHideFootnotePagination)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn", 2);
- assertXPath(pXmlDoc, "/root/page[2]/ftncont/ftn", 0);
+ assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn"_ostr, 2);
+ assertXPath(pXmlDoc, "/root/page[2]/ftncont/ftn"_ostr, 0);
// show again - should now get the same result as on loading
dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
@@ -437,13 +556,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineShowHideFootnotePagination)
pXmlDoc = parseLayoutDump();
// check footnotes
- assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn", 6);
- assertXPath(pXmlDoc, "/root/page[2]/ftncont/ftn", 3);
+ assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn"_ostr, 6);
+ assertXPath(pXmlDoc, "/root/page[2]/ftncont/ftn"_ostr, 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()]",
- "portion",
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[last()]/SwParaPortion/SwLineLayout[last()]"_ostr,
+ "portion"_ostr,
"yyyyyyyyy yyy yyyyyyyyyyyyyyyy yyyyyyy yyy yyyyy yyyyyyyyy yyy yyyyyyyyy ");
- assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/SwParaPortion/SwLineLayout[1]", "portion",
+ assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr,
+ "portion"_ostr,
"zzz. zzz zzzz zzzz* zzz zzz zzzzzzz zzz zzzz zzzzzzzzzzzzzz zzzzzzzzzzzz ");
}
@@ -484,21 +604,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]", "colors",
- "#Bookmark1 Bookmark Start");
- assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[4]", "colors",
- "#Bookmark2 Bookmark Start");
- assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[6]", "colors",
- "#Bookmark2 Bookmark End#Bookmark1 Bookmark End");
+ assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[2]"_ostr,
+ "colors"_ostr, "#Bookmark1 Bookmark Start");
+ assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[4]"_ostr,
+ "colors"_ostr, "#Bookmark2 Bookmark Start");
+ assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[6]"_ostr,
+ "colors"_ostr, "#Bookmark2 Bookmark End#Bookmark1 Bookmark End");
// full text, if bookmarks are visible
- assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[1]", "portion",
- "Lorem ");
- assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[3]", "portion",
- "ipsum dolor et ");
- assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[5]", "portion",
- "ames");
- assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[7]", "portion",
- ".");
+ assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[1]"_ostr,
+ "portion"_ostr, "Lorem ");
+ assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[3]"_ostr,
+ "portion"_ostr, "ipsum dolor et ");
+ assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[5]"_ostr,
+ "portion"_ostr, "ames");
+ assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[7]"_ostr,
+ "portion"_ostr, ".");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150790)
@@ -506,17 +626,20 @@ 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",
- "colors", "#Bookmark 1 Bookmark");
+ assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout/SwBookmarkPortion"_ostr,
+ "colors"_ostr, "#Bookmark 1 Bookmark");
// single start bookmark
- assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwBookmarkPortion[1]",
- "colors", "#Bookmark 2 Bookmark Start");
+ assertXPath(pXmlDoc,
+ "/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwBookmarkPortion[1]"_ostr,
+ "colors"_ostr, "#Bookmark 2 Bookmark Start");
// single end bookmark
- assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwBookmarkPortion[3]",
- "colors", "#Bookmark 3 Bookmark End");
+ assertXPath(pXmlDoc,
+ "/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwBookmarkPortion[3]"_ostr,
+ "colors"_ostr, "#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]",
- "colors", "#Bookmark 2 Bookmark End#Bookmark 3 Bookmark Start");
+ assertXPath(pXmlDoc,
+ "/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwBookmarkPortion[2]"_ostr,
+ "colors"_ostr, "#Bookmark 2 Bookmark End#Bookmark 3 Bookmark Start");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineNumberInNumbering)
@@ -537,11 +660,12 @@ 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')]", 5);
+ "/metafile/push/push/push/textcolor[not(@color='#000000') and not(@color='#008000')]"_ostr,
+ 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']", 0);
+ assertXPath(pXmlDoc, "/metafile/push/push/push/font[4][@color='#000000']"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineNumbering)
@@ -559,11 +683,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", "1.");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[1]/text"_ostr, "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", "[2.] ");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text"_ostr, "[2.] ");
// This was "3." (now it's the second list item)
- assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[5]/text", "2.[3.] ");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[5]/text"_ostr, "2.[3.] ");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineNumbering2)
@@ -580,12 +704,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", "1.");
- assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text", "2.");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[1]/text"_ostr, "1.");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text"_ostr, "2.");
// FIXME: show as 3.[2.]
- assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[5]/text", "3.");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[5]/text"_ostr, "3.");
// This was "4." (not shown the original number)
- assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[7]/text", "4.[3.] ");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[7]/text"_ostr, "4.[3.] ");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf149710_RedlineNumberingEditing)
@@ -616,19 +740,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", "[1.] ");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[1]/text"_ostr, "[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", "1.[2.] ");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text"_ostr, "1.[2.] ");
// This was "3." (now it's the second list item)
- assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[5]/text", "2.[3.] ");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[5]/text"_ostr, "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", "1.");
- assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text", "2.");
- assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[5]/text", "3.");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[1]/text"_ostr, "1.");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text"_ostr, "2.");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[5]/text"_ostr, "3.");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf149709_RedlineNumberingLevel)
@@ -658,35 +782,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", "1.");
- assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text", "a)");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[1]/text"_ostr, "1.");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text"_ostr, "a)");
// This was "b)[2.]"
- assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[4]/text", "b)[a)] ");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[4]/text"_ostr, "b)[a)] ");
// This was "c)[3.]"
- assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[6]/text", "c)[b)] ");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[6]/text"_ostr, "c)[b)] ");
// This was "4.[2.]" (after disabling Show Changes, and enabling again)
- assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[8]/text", "2.");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[8]/text"_ostr, "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", "1.");
- assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text", "a)");
- assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[5]/text", "b)");
- assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[7]/text", "2.");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[1]/text"_ostr, "1.");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text"_ostr, "a)");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[5]/text"_ostr, "b)");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[7]/text"_ostr, "2.");
// check Redo
pWrtShell->Redo();
xMetaFile = pShell->GetPreviewMetaFile();
pXmlDoc = dumpAndParse(dumper, *xMetaFile);
- assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[1]/text", "1.");
- assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text", "a)");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[1]/text"_ostr, "1.");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[3]/text"_ostr, "a)");
// TODO: show as b)[a)]
- assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[4]/text", "b)");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[4]/text"_ostr, "b)");
// FIXME: This must be "c)[b]"
- assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[6]/text", "c)[a)] ");
- assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[8]/text", "2.");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[6]/text"_ostr, "c)[a)] ");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[8]/text"_ostr, "2.");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf149711_importDOCXMoveToParagraphMark)
@@ -694,7 +818,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf149711_importDOCXMoveToParagraphMar
createSwDoc("tdf149711.docx");
SwDoc* pDoc = getSwDoc();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt", 6);
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 6);
// reject tracked insertion (moveTo)
SwEditShell* const pEditShell(pDoc->GetEditShell());
@@ -704,7 +828,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf149711_importDOCXMoveToParagraphMar
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
// This was 6 (not tracked paragraph mark of the moveTo list item)
- assertXPath(pXmlDoc, "/root/page[1]/body/txt", 5);
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 5);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf152872)
@@ -712,39 +836,44 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf152872)
createSwDoc("hidden-para-separator.docx");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt", 2);
- assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout", "portion", "C DE");
- assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion", 0); // 5 is empty and hidden
- assertXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds", "height", "0");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 2);
+ assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, "portion"_ostr,
+ "C DE");
+ assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion"_ostr, 0); // 5 is empty and hidden
+ assertXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds"_ostr, "height"_ostr, "0");
dispatchCommand(mxComponent, ".uno:ControlCodes", {});
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt", 5);
- assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout", "portion", "C ");
- assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout", "portion", "D");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 5);
+ assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, "portion"_ostr,
+ "C ");
+ assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout"_ostr, "portion"_ostr,
+ "D");
// 3 is an empty paragraph with RES_CHRATR_HIDDEN which results in 0-height
// frame; ideally it should only be hidden when control codes are hidden
// and be a full-height frame now, but that needs more work...
- assertXPath(pXmlDoc, "/root/page/body/txt[3]/infos/bounds", "height", "0");
- assertXPath(pXmlDoc, "/root/page/body/txt[4]/SwParaPortion/SwLineLayout", "portion", "E");
+ assertXPath(pXmlDoc, "/root/page/body/txt[3]/infos/bounds"_ostr, "height"_ostr, "0");
+ assertXPath(pXmlDoc, "/root/page/body/txt[4]/SwParaPortion/SwLineLayout"_ostr, "portion"_ostr,
+ "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]/SwParaPortion", 0); // 5 is empty
- assertXPath(pXmlDoc, "/root/page/body/txt[5]/infos/bounds", "height", "0");
+ assertXPath(pXmlDoc, "/root/page/body/txt[5]/SwParaPortion"_ostr, 0); // 5 is empty
+ assertXPath(pXmlDoc, "/root/page/body/txt[5]/infos/bounds"_ostr, "height"_ostr, "0");
dispatchCommand(mxComponent, ".uno:ControlCodes", {});
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt", 2);
- assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout", "portion", "C DE");
- assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion", 0); // 5 is empty and hidden
- assertXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds", "height", "0");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 2);
+ assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, "portion"_ostr,
+ "C DE");
+ assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion"_ostr, 0); // 5 is empty and hidden
+ assertXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds"_ostr, "height"_ostr, "0");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf151954)
@@ -752,7 +881,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf151954)
createSwDoc("tdf151954.docx");
SwDoc* pDoc = getSwDoc();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt", 2);
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 2);
// accept tracked insertion (moveTo)
SwEditShell* const pEditShell(pDoc->GetEditShell());
@@ -762,7 +891,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf151954)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
// This was 1 (moveFrom was extended to the paragraph mark)
- assertXPath(pXmlDoc, "/root/page[1]/body/txt", 2);
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf152952)
@@ -770,9 +899,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]", "portion",
- " NNNNNNNNNN NNNNNNNNNNNNNNN ");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]", "portion",
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr,
+ "portion"_ostr, " NNNNNNNNNN NNNNNNNNNNNNNNN ");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]"_ostr,
+ "portion"_ostr,
"https://example.com/xxxxxxx/testtesttesttest/hyphenate/testtesttest ");
}
@@ -785,10 +915,11 @@ 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]", "portion",
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr,
+ "portion"_ostr,
" NNNNNNNNNN NNNNNNNNNNNNNNN https://example.com/xxxxxxx/testtesttesttest/hyphen");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]", "portion",
- "ate/testtesttest ");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout[2]"_ostr,
+ "portion"_ostr, "ate/testtesttest ");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineNumberInFootnote)
@@ -807,7 +938,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']", 5);
+ assertXPath(pXmlDoc, "/metafile/push/push/push/font[@color='#000000']"_ostr, 5);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineMoving)
@@ -834,8 +965,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']", 5);
- assertXPath(pXmlDoc, "/metafile/push/push/push/font[@color='#008000']", 11);
+ assertXPath(pXmlDoc, "/metafile/push/push/push/textcolor[@color='#008000']"_ostr, 5);
+ assertXPath(pXmlDoc, "/metafile/push/push/push/font[@color='#008000']"_ostr, 11);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineMoving2)
@@ -868,8 +999,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']", 5);
- assertXPath(pXmlDoc, "/metafile/push/push/push/font[@color='#008000']", 11);
+ assertXPath(pXmlDoc, "/metafile/push/push/push/textcolor[@color='#008000']"_ostr, 5);
+ assertXPath(pXmlDoc, "/metafile/push/push/push/font[@color='#008000']"_ostr, 11);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineMovingDOCX)
@@ -890,7 +1021,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']", 6);
+ assertXPath(pXmlDoc, "/metafile/push/push/push/textcolor[@color='#008000']"_ostr, 6);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTableCellInvalidate)
@@ -915,27 +1046,35 @@ 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", "top", "6969");
- assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/infos/bounds", "height", "231");
- assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/cell[1]/infos/bounds", "top",
+ assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/infos/bounds"_ostr, "top"_ostr,
"6969");
- assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/cell[1]/infos/bounds", "height",
- "231");
- assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/cell[1]/txt[1]/infos/bounds",
- "top", "6969");
- assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/cell[1]/txt[1]/infos/bounds",
- "height", "231");
- assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/infos/bounds", "top", "7200");
- assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/infos/bounds", "height", "231");
- // this was 6969, causing the overlap
- assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/cell[1]/infos/bounds", "top",
+ assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/infos/bounds"_ostr,
+ "height"_ostr, "231");
+ assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/cell[1]/infos/bounds"_ostr,
+ "top"_ostr, "6969");
+ assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/cell[1]/infos/bounds"_ostr,
+ "height"_ostr, "231");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/anchored/fly/tab[1]/row[1]/cell[1]/txt[1]/infos/bounds"_ostr,
+ "top"_ostr, "6969");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/anchored/fly/tab[1]/row[1]/cell[1]/txt[1]/infos/bounds"_ostr,
+ "height"_ostr, "231");
+ assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/infos/bounds"_ostr, "top"_ostr,
"7200");
- assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/cell[1]/infos/bounds", "height",
- "231");
- assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/cell[1]/txt[1]/infos/bounds",
- "top", "7200");
- assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/cell[1]/txt[1]/infos/bounds",
- "height", "231");
+ assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/infos/bounds"_ostr,
+ "height"_ostr, "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, "7200");
+ assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/cell[1]/infos/bounds"_ostr,
+ "height"_ostr, "231");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/anchored/fly/tab[1]/row[2]/cell[1]/txt[1]/infos/bounds"_ostr,
+ "top"_ostr, "7200");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/anchored/fly/tab[1]/row[2]/cell[1]/txt[1]/infos/bounds"_ostr,
+ "height"_ostr, "231");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf145719)
@@ -952,7 +1091,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']", 4);
+ assertXPath(pXmlDoc, "/metafile/push/push/push/textcolor[@color='#008000']"_ostr, 4);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testChangedTableRows)
@@ -968,11 +1107,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']", 1);
+ assertXPath(pXmlDoc, "/metafile/push/push/push/push/push/fillcolor[@color='#fce6f4']"_ostr, 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']", 1);
+ assertXPath(pXmlDoc, "/metafile/push/push/push/push/push/fillcolor[@color='#e1f2fa']"_ostr, 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']", 1);
+ assertXPath(pXmlDoc, "/metafile/push/push/push/push/push/fillcolor[@color='#3faf46']"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf155187_TableInTextChange)
@@ -988,9 +1127,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']", 2);
+ assertXPath(pXmlDoc, "/metafile/push/push/push/push/push/fillcolor[@color='#fce6f4']"_ostr, 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']", 2);
+ assertXPath(pXmlDoc, "/metafile/push/push/push/push/push/fillcolor[@color='#e1f2fa']"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf145225_RedlineMovingWithBadInsertion)
@@ -1058,8 +1197,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",
- "portion", "Lorem ipsum");
+ assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "portion"_ostr, "Lorem ipsum");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf125300)
@@ -1077,10 +1216,12 @@ 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[5]/polyline/point[1]", "y")
+ = getXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[5]/polyline/point[1]"_ostr,
+ "y"_ostr)
.toInt32();
sal_Int32 y2
- = getXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[5]/polyline/point[2]", "y")
+ = getXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[5]/polyline/point[2]"_ostr,
+ "y"_ostr)
.toInt32();
CPPUNIT_ASSERT_DOUBLES_EQUAL(2092, y1, 7);
CPPUNIT_ASSERT_EQUAL(y1, y2);
@@ -1104,14 +1245,16 @@ 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']", 1);
- assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[2]/push[1]/push[1]/polypolygon",
- 1);
+ "/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);
// 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']", 1);
- assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/rect", 1);
+ 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);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf114163)
@@ -1126,7 +1269,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf114163)
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPathContent(pXmlDoc, "(//textarray)[12]/text", "Data3");
+ assertXPathContent(pXmlDoc, "(//textarray)[12]/text"_ostr, "Data3");
// This failed, if the legend first label is not "Data3". The legend position is right.
}
@@ -1135,9 +1278,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf131707)
createSwDoc("tdf131707_flyWrap.doc");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//body/tab/row[3]/cell[2]/txt/infos/bounds", "top", "2185");
+ assertXPath(pXmlDoc, "//body/tab/row[3]/cell[2]/txt/infos/bounds"_ostr, "top"_ostr, "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", "top", "2185");
+ assertXPath(pXmlDoc, "//body/tab/row[3]/cell[2]/txt/anchored/fly/infos/bounds"_ostr, "top"_ostr,
+ "2185");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf122225)
@@ -1154,14 +1298,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\")])")
+ = getXPathContent(pXmlDoc, "count(//text[contains(text(),\"Advanced Diploma\")])"_ostr)
.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\")])").toInt32();
+ = getXPathContent(pXmlDoc, "count(//text[contains(text(),\"Hispanic\")])"_ostr).toInt32();
// This failed, if the third X axis label broke to multiple lines.
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nThirdLabelLines);
}
@@ -1178,7 +1322,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf125335)
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPathContent(pXmlDoc, "(//textarray)[12]/text", "Data3");
+ assertXPathContent(pXmlDoc, "(//textarray)[12]/text"_ostr, "Data3");
// This failed, if the legend first label is not "Data3". The legend position is bottom.
}
@@ -1194,7 +1338,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134247)
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPathContent(pXmlDoc, "(//textarray)[14]/text", "1. adatsor");
+ assertXPathContent(pXmlDoc, "(//textarray)[14]/text"_ostr, "1. adatsor");
// This failed, if the legend first label is not "1. adatsor".
}
@@ -1210,9 +1354,9 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf75659)
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPathContent(pXmlDoc, "(//textarray)[17]/text", "Series1");
- assertXPathContent(pXmlDoc, "(//textarray)[18]/text", "Series2");
- assertXPathContent(pXmlDoc, "(//textarray)[19]/text", "Series3");
+ assertXPathContent(pXmlDoc, "(//textarray)[17]/text"_ostr, "Series1");
+ assertXPathContent(pXmlDoc, "(//textarray)[18]/text"_ostr, "Series2");
+ assertXPathContent(pXmlDoc, "(//textarray)[19]/text"_ostr, "Series3");
// These failed, if the legend names are empty strings.
}
@@ -1229,7 +1373,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf136816)
CPPUNIT_ASSERT(pXmlDoc);
// Check number of legend entries
- assertXPath(pXmlDoc, "//text[contains(text(),\"Column\")]", 2);
+ assertXPath(pXmlDoc, "//text[contains(text(),\"Column\")]"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf126425)
@@ -1247,7 +1391,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf126425)
// - Expected: 14
// - Actual : 12
// i.e. the text of the chart legend lost.
- assertXPath(pXmlDoc, "//textarray", 14);
+ assertXPath(pXmlDoc, "//textarray"_ostr, 14);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testUnusedOLEprops)
@@ -1262,7 +1406,8 @@ 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", "height")
+ getXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/fly/notxt/infos/bounds"_ostr,
+ "height"_ostr)
.toDouble());
}
@@ -1281,8 +1426,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",
- 53);
+ assertXPath(pXmlDoc,
+ "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/push"_ostr, 53);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf133005)
@@ -1299,13 +1444,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]",
- "x")
+ "push[1]/push[1]/polyline[1]/point[2]"_ostr,
+ "x"_ostr)
.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]",
- "x")
+ "push[1]/push[41]/polypolygon/polygon/point[1]"_ostr,
+ "x"_ostr)
.toInt32();
// This failed, if the value axis doesn't appear inside category.
@@ -1326,14 +1471,16 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf115630)
// Test wide of inner chart area.
sal_Int32 nXRight
- = getXPath(pXmlDoc,
- "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/push[3]/polyline[1]/point[1]",
- "x")
+ = getXPath(
+ pXmlDoc,
+ "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/push[3]/polyline[1]/point[1]"_ostr,
+ "x"_ostr)
.toInt32();
sal_Int32 nXLeft
- = getXPath(pXmlDoc,
- "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/push[3]/polyline[1]/point[2]",
- "x")
+ = getXPath(
+ pXmlDoc,
+ "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/push[3]/polyline[1]/point[2]"_ostr,
+ "x"_ostr)
.toInt32();
CPPUNIT_ASSERT_DOUBLES_EQUAL(2895, nXRight - nXLeft, 50);
}
@@ -1350,7 +1497,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf108021)
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "//textarray[@length='22']", 8);
+ assertXPath(pXmlDoc, "//textarray[@length='22']"_ostr, 8);
// This failed, if the textarray length of the first axis label not 22.
}
@@ -1366,7 +1513,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf125334)
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
CPPUNIT_ASSERT(pXmlDoc);
- int nCount = countXPathNodes(pXmlDoc, "//textarray[@length='17']");
+ int nCount = countXPathNodes(pXmlDoc, "//textarray[@length='17']"_ostr);
CPPUNIT_ASSERT_EQUAL(4, nCount);
// This failed, if the textarray length of the category axis label not 17.
}
@@ -1383,7 +1530,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf122800)
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "//textarray[@length='22']", 9);
+ assertXPath(pXmlDoc, "//textarray[@length='22']"_ostr, 9);
// This failed, if the textarray length of the first axis label not 22.
}
@@ -1400,10 +1547,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTruncatedAxisLabel)
CPPUNIT_ASSERT(pXmlDoc);
// test the X axis label visibility
- assertXPathContent(pXmlDoc, "(//textarray)[1]/text", "Long axis label truncated 1");
+ assertXPathContent(pXmlDoc, "(//textarray)[1]/text"_ostr, "Long axis label truncated 1");
// test the Y axis label visibility
- assertXPathContent(pXmlDoc, "(//textarray)[3]/text", "-5.00");
+ assertXPathContent(pXmlDoc, "(//textarray)[3]/text"_ostr, "-5.00");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf128996)
@@ -1418,7 +1565,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf128996)
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPathContent(pXmlDoc, "(//textarray)[1]/text", "A very long category name 1");
+ assertXPathContent(pXmlDoc, "(//textarray)[1]/text"_ostr, "A very long category name 1");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf126244)
@@ -1433,13 +1580,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]", "orientation", "0");
+ assertXPath(pXmlDoc, "(//font)[1]"_ostr, "orientation"_ostr, "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]", "orientation").toInt32();
+ sal_Int32 nRotation = getXPath(pXmlDoc, "(//font)[5]"_ostr, "orientation"_ostr).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]", "orientation").toInt32();
+ nRotation = getXPath(pXmlDoc, "(//font)[7]"_ostr, "orientation"_ostr).toInt32();
CPPUNIT_ASSERT(nRotation >= 899);
CPPUNIT_ASSERT(nRotation <= 900);
}
@@ -1456,13 +1603,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]", "orientation").toInt32();
+ sal_Int32 nRotation = getXPath(pXmlDoc, "(//font)[1]"_ostr, "orientation"_ostr).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]", "orientation", "0");
+ assertXPath(pXmlDoc, "(//font)[5]"_ostr, "orientation"_ostr, "0");
// Test the third level of horizontal category axis labels orientation. The third level orientation should be horizontal.
- assertXPath(pXmlDoc, "(//font)[7]", "orientation", "0");
+ assertXPath(pXmlDoc, "(//font)[7]"_ostr, "orientation"_ostr, "0");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testHorizontal_multilevel)
@@ -1477,7 +1624,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]", "y").toInt32();
+ sal_Int32 nYposition = getXPath(pXmlDoc, "(//textarray)[7]"_ostr, "y"_ostr).toInt32();
CPPUNIT_ASSERT_DOUBLES_EQUAL(11248, nYposition, 20);
}
@@ -1488,15 +1635,15 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf69648)
CPPUNIT_ASSERT(pXmlDoc);
OString sShapeXPath[2] = {
- "/root/page/body/txt/anchored/SwAnchoredDrawObject/SdrObjGroup/SdrObjList/SdrObject[1]",
- "/root/page/body/txt/anchored/SwAnchoredDrawObject/SdrObjGroup/SdrObjList/SdrObject[2]"
+ "/root/page/body/txt/anchored/SwAnchoredDrawObject/SdrObjGroup/SdrObjList/SdrObject[1]"_ostr,
+ "/root/page/body/txt/anchored/SwAnchoredDrawObject/SdrObjGroup/SdrObjList/SdrObject[2]"_ostr
};
- OString sFrameXPath[2] = { "/root/page/body/txt/anchored/fly[1]/infos/bounds",
- "/root/page/body/txt/anchored/fly[2]/infos/bounds" };
+ OString sFrameXPath[2] = { "/root/page/body/txt/anchored/fly[1]/infos/bounds"_ostr,
+ "/root/page/body/txt/anchored/fly[2]/infos/bounds"_ostr };
for (int i = 0; i < 2; ++i)
{
- const auto sDrawRect = getXPath(pXmlDoc, sShapeXPath[i], "aOutRect");
+ const auto sDrawRect = getXPath(pXmlDoc, sShapeXPath[i], "aOutRect"_ostr);
const auto nComaPos1 = sDrawRect.indexOf(',', 0);
const auto nComaPos2 = sDrawRect.indexOf(',', nComaPos1 + 1);
const auto nComaPos3 = sDrawRect.indexOf(',', nComaPos2 + 1);
@@ -1508,10 +1655,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").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 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 aFrame = SwRect(nFlyLeft, nFlyTop, nFlyWidth, nFlyHeight);
@@ -1537,24 +1684,26 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf116256)
// Get the position of the shape
const auto nTextBoxShapeLeft = getXPath(pLayout,
"/root/page/body/txt/anchored/fly/tab/row[1]/cell/txt/"
- "anchored/SwAnchoredDrawObject/bounds",
- "left")
+ "anchored/SwAnchoredDrawObject/bounds"_ostr,
+ "left"_ostr)
.toInt64();
const auto nTextBoxShapeTop = getXPath(pLayout,
"/root/page/body/txt/anchored/fly/tab/row[1]/cell/txt/"
- "anchored/SwAnchoredDrawObject/bounds",
- "top")
+ "anchored/SwAnchoredDrawObject/bounds"_ostr,
+ "top"_ostr)
.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",
- "left")
+ = getXPath(
+ pLayout,
+ "/root/page/body/txt/anchored/fly/tab/row[1]/cell/txt/anchored/fly/infos/bounds"_ostr,
+ "left"_ostr)
.toInt64();
const auto nTextBoxFrameTop
- = getXPath(pLayout,
- "/root/page/body/txt/anchored/fly/tab/row[1]/cell/txt/anchored/fly/infos/bounds",
- "top")
+ = getXPath(
+ pLayout,
+ "/root/page/body/txt/anchored/fly/tab/row[1]/cell/txt/anchored/fly/infos/bounds"_ostr,
+ "top"_ostr)
.toInt64();
// Without the fix in place these were less than they supposed to.
@@ -1577,7 +1726,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf138194)
// - Expected: 8
// - Actual : 7
// i.e. the X axis label flowed out of chart area.
- assertXPath(pXmlDoc, "//textarray", 8);
+ assertXPath(pXmlDoc, "//textarray"_ostr, 8);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf146272)
@@ -1614,7 +1763,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf138773)
CPPUNIT_ASSERT(pXmlDoc);
const sal_Int32 nFirstLabelLines
- = getXPathContent(pXmlDoc, "count(//text[contains(text(),\"2000-01\")])").toInt32();
+ = getXPathContent(pXmlDoc, "count(//text[contains(text(),\"2000-01\")])"_ostr).toInt32();
// This failed, if the first X axis label broke to multiple lines.
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nFirstLabelLines);
@@ -1633,10 +1782,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", "-10");
+ assertXPathContent(pXmlDoc, "(//textarray)[5]/text"_ostr, "-10");
// This failed, if the maximum value of Y axis is not 15.
- assertXPathContent(pXmlDoc, "(//textarray)[10]/text", "15");
+ assertXPathContent(pXmlDoc, "(//textarray)[10]/text"_ostr, "15");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf72727)
@@ -1654,9 +1803,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", "1");
- assertXPathContent(pXmlDoc, "(//textarray)[2]/text", "2");
- assertXPathContent(pXmlDoc, "(//textarray)[3]/text", "3");
+ assertXPathContent(pXmlDoc, "(//textarray)[1]/text"_ostr, "1");
+ assertXPathContent(pXmlDoc, "(//textarray)[2]/text"_ostr, "2");
+ assertXPathContent(pXmlDoc, "(//textarray)[3]/text"_ostr, "3");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130969)
@@ -1672,7 +1821,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", "0.35781");
+ assertXPathContent(pXmlDoc, "(//textarray)[5]/text"_ostr, "0.35781");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf40260)
@@ -1689,7 +1838,7 @@ 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",
+ assertXPathContent(pXmlDoc, "(//textarray)[19]/text"_ostr,
"f(x) = 1.26510397865547E-06 x " + OUStringChar(u'\x2212')
+ " 5.95245604996327E-12");
}
@@ -1708,15 +1857,16 @@ 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[4]/push[1]/push[4]/polyline[1]/point[1]",
- "y")
+ = getXPath(
+ pXmlDoc,
+ "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/push[4]/polyline[1]/point[1]"_ostr,
+ "y"_ostr)
.toInt32();
sal_Int32 nYBottom
= getXPath(
pXmlDoc,
- "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/push[4]/polyline[1]/point[31]",
- "y")
+ "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/push[4]/polyline[1]/point[31]"_ostr,
+ "y"_ostr)
.toInt32();
CPPUNIT_ASSERT_DOUBLES_EQUAL(4615, nYTop - nYBottom, 5);
}
@@ -1734,7 +1884,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf129173)
CPPUNIT_ASSERT(pXmlDoc);
// Check the first data label of area chart.
- assertXPathContent(pXmlDoc, "(//textarray)[22]/text", "56");
+ assertXPathContent(pXmlDoc, "(//textarray)[22]/text"_ostr, "56");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134866)
@@ -1750,7 +1900,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134866)
CPPUNIT_ASSERT(pXmlDoc);
// Check the data label of pie chart.
- assertXPathContent(pXmlDoc, "(//textarray)[2]/text", "100%");
+ assertXPathContent(pXmlDoc, "(//textarray)[2]/text"_ostr, "100%");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf137116)
@@ -1764,8 +1914,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf137116)
MetafileXmlDump dumper;
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
CPPUNIT_ASSERT(pXmlDoc);
- sal_Int32 nX2 = getXPath(pXmlDoc, "(//textarray)[2]", "x").toInt32(); // second data label
- sal_Int32 nX4 = getXPath(pXmlDoc, "(//textarray)[4]", "x").toInt32(); // fourth data label
+ 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
// Without the accompanying fix in place, this test would have failed with:
// - Expected: 1229
// - Actual : -225
@@ -1785,8 +1937,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf137154)
MetafileXmlDump dumper;
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
CPPUNIT_ASSERT(pXmlDoc);
- sal_Int32 nX1 = getXPath(pXmlDoc, "(//textarray)[1]", "x").toInt32(); // first data label
- sal_Int32 nX4 = getXPath(pXmlDoc, "(//textarray)[4]", "x").toInt32(); // fourth data label
+ 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
// Without the accompanying fix in place, this test would have failed with:
// - Expected: 10865
// - Actual : 10252
@@ -1808,7 +1962,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf138777)
CPPUNIT_ASSERT(pXmlDoc);
const sal_Int32 nFirstLabelLines
- = getXPathContent(pXmlDoc, "count(//text[contains(text(),\"really\")])").toInt32();
+ = getXPathContent(pXmlDoc, "count(//text[contains(text(),\"really\")])"_ostr).toInt32();
// This failed, if the first data label didn't break to multiple lines.
CPPUNIT_ASSERT_GREATER(static_cast<sal_Int32>(1), nFirstLabelLines);
@@ -1825,7 +1979,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130031)
MetafileXmlDump dumper;
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
CPPUNIT_ASSERT(pXmlDoc);
- sal_Int32 nY = getXPath(pXmlDoc, "(//textarray)[11]", "y").toInt32();
+ sal_Int32 nY = getXPath(pXmlDoc, "(//textarray)[11]"_ostr, "y"_ostr).toInt32();
// Without the accompanying fix in place, this test would have failed with:
// - Expected: 4653
// - Actual : 2182
@@ -1845,7 +1999,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130242)
MetafileXmlDump dumper;
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
CPPUNIT_ASSERT(pXmlDoc);
- sal_Int32 nY = getXPath(pXmlDoc, "(//textarray)[11]", "y").toInt32();
+ sal_Int32 nY = getXPath(pXmlDoc, "(//textarray)[11]"_ostr, "y"_ostr).toInt32();
// Without the accompanying fix in place, this test would have failed with:
// - Expected: 5758
// - Actual : 3352
@@ -1853,7 +2007,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]", "y").toInt32();
+ nY = getXPath(pXmlDoc, "(//textarray)[13]"_ostr, "y"_ostr).toInt32();
// Without the accompanying fix in place, this test would have failed with:
// - Expected: 2335
// - Actual : 2343
@@ -1875,7 +2029,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134121)
CPPUNIT_ASSERT(pXmlDoc);
// Check the custom leader line on pie chart.
- assertXPath(pXmlDoc, "//polyline", 1);
+ assertXPath(pXmlDoc, "//polyline"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf138018)
@@ -1893,7 +2047,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf138018)
// - Expected: 2
// - Actual : 3
// i.e. the leader line was visible.
- assertXPath(pXmlDoc, "//polyline", 2);
+ assertXPath(pXmlDoc, "//polyline"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130380)
@@ -1909,8 +2063,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130380)
CPPUNIT_ASSERT(pXmlDoc);
sal_Int32 nY = getXPath(pXmlDoc,
"/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/push[1]/polypolygon/"
- "polygon/point[1]",
- "y")
+ "polygon/point[1]"_ostr,
+ "y"_ostr)
.toInt32();
// Without the accompanying fix in place, this test would have failed with:
// - Expected: 6727
@@ -1933,7 +2087,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", "Category 1");
+ assertXPathContent(pXmlDoc, "//textarray/text"_ostr, "Category 1");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf132956)
@@ -1949,7 +2103,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", "Category 1");
+ assertXPathContent(pXmlDoc, "//textarray/text"_ostr, "Category 1");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf137819)
@@ -1967,9 +2121,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", "right");
- auto sShapeRightSidePosition
- = getXPath(pXml, "/root/page/body/txt[6]/anchored/SwAnchoredDrawObject/bounds", "right");
+ = 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);
// 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:
@@ -1989,8 +2143,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]", "x").toInt32();
- sal_Int32 nX2 = getXPath(pXmlDoc, "(//textarray)[14]", "x").toInt32();
+ sal_Int32 nX1 = getXPath(pXmlDoc, "(//textarray)[13]"_ostr, "x"_ostr).toInt32();
+ sal_Int32 nX2 = getXPath(pXmlDoc, "(//textarray)[14]"_ostr, "x"_ostr).toInt32();
CPPUNIT_ASSERT_GREATER(nX1 + 100, nX2);
}
@@ -2007,8 +2161,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]", "x").toInt32();
- sal_Int32 nX2 = getXPath(pXmlDoc, "(//textarray)[2]", "x").toInt32();
+ sal_Int32 nX1 = getXPath(pXmlDoc, "(//textarray)[1]"_ostr, "x"_ostr).toInt32();
+ sal_Int32 nX2 = getXPath(pXmlDoc, "(//textarray)[2]"_ostr, "x"_ostr).toInt32();
CPPUNIT_ASSERT_GREATER(nX1 + 250, nX2);
}
@@ -2027,7 +2181,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134235)
// - Expected: 14
// - Actual : 13
// i.e. the chart title flowed out of chart area.
- assertXPath(pXmlDoc, "//textarray", 14);
+ assertXPath(pXmlDoc, "//textarray"_ostr, 14);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134676)
@@ -2045,7 +2199,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", 14);
+ assertXPath(pXmlDoc, "//textarray"_ostr, 14);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134146)
@@ -2061,7 +2215,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf134146)
CPPUNIT_ASSERT(pXmlDoc);
const sal_Int32 nTitleLines
- = getXPathContent(pXmlDoc, "count(//text[contains(text(),\"Horizontal\")])").toInt32();
+ = getXPathContent(pXmlDoc, "count(//text[contains(text(),\"Horizontal\")])"_ostr).toInt32();
// Without the accompanying fix in place, this test would have failed.
// i.e. the Y axis title didn't break to multiple lines.
@@ -2080,7 +2234,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", "Customlabel");
+ assertXPathContent(pXmlDoc, "(//textarray)[16]/text"_ostr, "Customlabel");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf116925)
@@ -2095,13 +2249,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf116925)
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
CPPUNIT_ASSERT(pXmlDoc);
- assertXPathContent(pXmlDoc,
- "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/push[3]/textarray/text",
- "hello");
+ assertXPathContent(
+ pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/push[3]/textarray/text"_ostr,
+ "hello");
// This failed, text color was #000000.
assertXPath(
pXmlDoc,
- "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/push[3]/textcolor[@color='#ffffff']", 1);
+ "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/push[3]/textcolor[@color='#ffffff']"_ostr,
+ 1);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf117028)
@@ -2118,10 +2273,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf117028)
// The only polypolygon in the rendering result was the white background we
// want to avoid.
- assertXPath(pXmlDoc, "//polypolygon", 0);
+ assertXPath(pXmlDoc, "//polypolygon"_ostr, 0);
// Make sure the text is still rendered.
- assertXPathContent(pXmlDoc, "//textarray/text", "Hello");
+ assertXPathContent(pXmlDoc, "//textarray/text"_ostr, "Hello");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf106390)
@@ -2135,7 +2290,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf106390)
MetafileXmlDump dumper;
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
CPPUNIT_ASSERT(pXmlDoc);
- sal_Int32 nBottom = getXPath(pXmlDoc, "//sectrectclipregion", "bottom").toInt32();
+ sal_Int32 nBottom = getXPath(pXmlDoc, "//sectrectclipregion"_ostr, "bottom"_ostr).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) + "]";
@@ -2154,7 +2309,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTableExtrusion1)
MetafileXmlDump dumper;
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
CPPUNIT_ASSERT(pXmlDoc);
- sal_Int32 nRight = getXPath(pXmlDoc, "//sectrectclipregion", "right").toInt32();
+ sal_Int32 nRight = getXPath(pXmlDoc, "//sectrectclipregion"_ostr, "right"_ostr).toInt32();
sal_Int32 nLeft = static_cast<sal_Int32>(nRight * 0.95);
// Expect table borders in right page margin.
@@ -2176,7 +2331,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]", "x").toInt32();
+ sal_Int32 nX = getXPath(pXmlDoc, "(//polyline[1]/point)[2]"_ostr, "x"_ostr).toInt32();
// Do not allow inner table extrude outer table.
const OString sXPath = "//polyline/point[@x>" + OString::number(nX) + "]";
@@ -2198,10 +2353,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", 1);
+ assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, 1);
// This was 2, same problem elsewhere due to code duplication.
- assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout", 1);
+ assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf118672)
@@ -2215,11 +2370,12 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf118672)
return;
// This ended as "fol*1 2 3 4 5 6 7 8 9", i.e. "10con-" was moved to the next line.
- assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]", "portion",
+ assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr,
+ "portion"_ostr,
"He heard quiet steps behind him. That didn't bode well. Who could be fol*1 2 "
"3 4 5 6 7 8 9 10con");
- assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[2]", "portion",
- "setetur");
+ assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[2]"_ostr,
+ "portion"_ostr, "setetur");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150200)
@@ -2228,19 +2384,19 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150200)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// dash
OUString sFirstLine
- = parseDump("/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/@portion");
+ = parseDump("/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/@portion"_ostr);
CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"-(dash)"));
CPPUNIT_ASSERT_EQUAL(sal_Int32(93), sFirstLine.getLength());
// en-dash
- sFirstLine = parseDump("/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/@portion");
+ sFirstLine = parseDump("/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/@portion"_ostr);
CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"–(en-dash)"));
CPPUNIT_ASSERT_EQUAL(sal_Int32(88), sFirstLine.getLength());
// em-dash
- sFirstLine = parseDump("/root/page/body/txt[3]/SwParaPortion/SwLineLayout[1]/@portion");
+ sFirstLine = parseDump("/root/page/body/txt[3]/SwParaPortion/SwLineLayout[1]/@portion"_ostr);
CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"—(em-dash)"));
CPPUNIT_ASSERT_EQUAL(sal_Int32(77), sFirstLine.getLength());
// figure dash
- sFirstLine = parseDump("/root/page/body/txt[4]/SwParaPortion/SwLineLayout[1]/@portion");
+ sFirstLine = parseDump("/root/page/body/txt[4]/SwParaPortion/SwLineLayout[1]/@portion"_ostr);
CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"‒(figure dash)"));
CPPUNIT_ASSERT_EQUAL(sal_Int32(87), sFirstLine.getLength());
}
@@ -2251,19 +2407,19 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150200_DOCX)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// dash
OUString sFirstLine
- = parseDump("/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/@portion");
+ = parseDump("/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/@portion"_ostr);
CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"-(dash)"));
CPPUNIT_ASSERT_EQUAL(sal_Int32(93), sFirstLine.getLength());
// en-dash
- sFirstLine = parseDump("/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/@portion");
+ sFirstLine = parseDump("/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/@portion"_ostr);
CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"–(en-dash)"));
CPPUNIT_ASSERT_EQUAL(sal_Int32(88), sFirstLine.getLength());
// em-dash
- sFirstLine = parseDump("/root/page/body/txt[3]/SwParaPortion/SwLineLayout[1]/@portion");
+ sFirstLine = parseDump("/root/page/body/txt[3]/SwParaPortion/SwLineLayout[1]/@portion"_ostr);
CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"—(em-dash)"));
CPPUNIT_ASSERT_EQUAL(sal_Int32(77), sFirstLine.getLength());
// figure dash
- sFirstLine = parseDump("/root/page/body/txt[4]/SwParaPortion/SwLineLayout[1]/@portion");
+ sFirstLine = parseDump("/root/page/body/txt[4]/SwParaPortion/SwLineLayout[1]/@portion"_ostr);
CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"‒(figure dash)"));
CPPUNIT_ASSERT_EQUAL(sal_Int32(87), sFirstLine.getLength());
}
@@ -2274,19 +2430,19 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150438)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// left double quotation mark
OUString sFirstLine
- = parseDump("/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/@portion");
+ = parseDump("/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/@portion"_ostr);
CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"“Lorem ipsum"));
CPPUNIT_ASSERT_EQUAL(sal_Int32(92), sFirstLine.getLength());
// right double quotation mark
- sFirstLine = parseDump("/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/@portion");
+ sFirstLine = parseDump("/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/@portion"_ostr);
CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"”Nunc viverra imperdiet enim."));
CPPUNIT_ASSERT_EQUAL(sal_Int32(97), sFirstLine.getLength());
// left single quotation mark
- sFirstLine = parseDump("/root/page/body/txt[3]/SwParaPortion/SwLineLayout[1]/@portion");
+ sFirstLine = parseDump("/root/page/body/txt[3]/SwParaPortion/SwLineLayout[1]/@portion"_ostr);
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 = parseDump("/root/page/body/txt[4]/SwParaPortion/SwLineLayout[1]/@portion");
+ sFirstLine = parseDump("/root/page/body/txt[4]/SwParaPortion/SwLineLayout[1]/@portion"_ostr);
CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"’Aenean nec lorem."));
CPPUNIT_ASSERT_EQUAL(sal_Int32(85), sFirstLine.getLength());
}
@@ -2297,19 +2453,19 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150438_DOCX)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// left double quotation mark
OUString sFirstLine
- = parseDump("/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/@portion");
+ = parseDump("/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/@portion"_ostr);
CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"“Lorem ipsum"));
CPPUNIT_ASSERT_EQUAL(sal_Int32(92), sFirstLine.getLength());
// right double quotation mark
- sFirstLine = parseDump("/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/@portion");
+ sFirstLine = parseDump("/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/@portion"_ostr);
CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"”Nunc viverra imperdiet enim."));
CPPUNIT_ASSERT_EQUAL(sal_Int32(97), sFirstLine.getLength());
// left single quotation mark
- sFirstLine = parseDump("/root/page/body/txt[3]/SwParaPortion/SwLineLayout[1]/@portion");
+ sFirstLine = parseDump("/root/page/body/txt[3]/SwParaPortion/SwLineLayout[1]/@portion"_ostr);
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 = parseDump("/root/page/body/txt[4]/SwParaPortion/SwLineLayout[1]/@portion");
+ sFirstLine = parseDump("/root/page/body/txt[4]/SwParaPortion/SwLineLayout[1]/@portion"_ostr);
CPPUNIT_ASSERT_EQUAL(true, sFirstLine.startsWith(u"’Aenean nec lorem."));
CPPUNIT_ASSERT_EQUAL(sal_Int32(85), sFirstLine.getLength());
}
@@ -2328,18 +2484,20 @@ 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]", "GHI GHI GHI GHI");
- assertXPath(pXmlDoc,
- "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion",
- "type", "PortionType::Number");
- assertXPath(pXmlDoc,
- "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion",
- "expand", "2.");
+ assertXPathContent(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]"_ostr, "GHI GHI GHI GHI");
+ assertXPath(
+ pXmlDoc,
+ "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr,
+ "type"_ostr, "PortionType::Number");
+ assertXPath(
+ pXmlDoc,
+ "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr,
+ "expand"_ostr, "2.");
// The numbering height was 960.
assertXPath(
pXmlDoc,
- "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont",
- "height", "220");
+ "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont"_ostr,
+ "height"_ostr, "220");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf127606)
@@ -2356,18 +2514,20 @@ 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]", "GHI GHI GHI GHI");
- assertXPath(pXmlDoc,
- "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion",
- "type", "PortionType::Number");
- assertXPath(pXmlDoc,
- "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion",
- "expand", "2.");
+ assertXPathContent(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]"_ostr, "GHI GHI GHI GHI");
+ assertXPath(
+ pXmlDoc,
+ "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr,
+ "type"_ostr, "PortionType::Number");
+ assertXPath(
+ pXmlDoc,
+ "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr,
+ "expand"_ostr, "2.");
// The numbering height was 960 in DOC format.
assertXPath(
pXmlDoc,
- "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont",
- "height", "220");
+ "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont"_ostr,
+ "height"_ostr, "220");
// tdf#127606: now it's possible to change formatting of numbering
// increase font size (220 -> 260)
@@ -2378,8 +2538,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf127606)
pXmlDoc = parseLayoutDump();
assertXPath(
pXmlDoc,
- "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont",
- "height", "260");
+ "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont"_ostr,
+ "height"_ostr, "260");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf127118)
@@ -2387,7 +2547,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]", "WritingMode", "VertBTLR");
+ assertXPath(pXmlDoc, "/root/page[2]/body/tab/row[1]/cell[1]/txt[1]"_ostr, "WritingMode"_ostr,
+ "VertBTLR");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf141220)
@@ -2396,8 +2557,9 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf141220)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
sal_Int32 nShapeTop
- = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "top").toInt32();
- sal_Int32 nTextBoxTop = getXPath(pXmlDoc, "//anchored/fly/infos/bounds", "top").toInt32();
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds"_ostr, "top"_ostr).toInt32();
+ sal_Int32 nTextBoxTop
+ = getXPath(pXmlDoc, "//anchored/fly/infos/bounds"_ostr, "top"_ostr).toInt32();
// Make sure the textbox stays inside the shape.
CPPUNIT_ASSERT_LESS(static_cast<sal_Int32>(15), nTextBoxTop - nShapeTop);
}
@@ -2505,7 +2667,8 @@ 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", "width").toInt32();
+ = getXPath(pXmlDoc, "/root/page/body/tab/row[6]/cell[1]/infos/bounds"_ostr, "width"_ostr)
+ .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);
}
@@ -2515,8 +2678,9 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf109077)
createSwDoc("tdf109077.docx");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
sal_Int32 nShapeTop
- = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "top").toInt32();
- sal_Int32 nTextBoxTop = getXPath(pXmlDoc, "//anchored/fly/infos/bounds", "top").toInt32();
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds"_ostr, "top"_ostr).toInt32();
+ sal_Int32 nTextBoxTop
+ = getXPath(pXmlDoc, "//anchored/fly/infos/bounds"_ostr, "top"_ostr).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);
@@ -2543,8 +2707,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testUserFieldTypeLanguage)
// 123,456.00 transform chain.
assertXPath(
pXmlDoc,
- "/root/page/body/txt/SwParaPortion/SwLineLayout/SwFieldPortion[@type='PortionType::Field']",
- "expand", "1,234.56");
+ "/root/page/body/txt/SwParaPortion/SwLineLayout/SwFieldPortion[@type='PortionType::Field']"_ostr,
+ "expand"_ostr, "1,234.56");
discardDumpedLayout();
// Now change the system locale to English (before this was failing, 1234,56 -> 0.00)
@@ -2559,8 +2723,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']",
- "expand", "1,234.56");
+ "/root/page/body/txt/SwParaPortion/SwLineLayout/SwFieldPortion[@type='PortionType::Field']"_ostr,
+ "expand"_ostr, "1,234.56");
discardDumpedLayout();
// Now change the system locale to German
aOptions.SetLocaleConfigString("de-DE");
@@ -2574,8 +2738,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']",
- "expand", "1,234.56");
+ "/root/page/body/txt/SwParaPortion/SwLineLayout/SwFieldPortion[@type='PortionType::Field']"_ostr,
+ "expand"_ostr, "1,234.56");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf124261)
@@ -2618,7 +2782,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]", 0);
+ assertXPath(pDump, "//bounds[@top<0]"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150642)
@@ -2626,8 +2790,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]", 0);
- assertXPath(pDump, "//bounds[@right<0]", 0);
+ assertXPath(pDump, "//bounds[@left<0]"_ostr, 0);
+ assertXPath(pDump, "//bounds[@right<0]"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf152085)
@@ -2635,9 +2799,9 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf152085)
createSwDoc("tdf152085-section-tblr.odt");
auto pDump = parseLayoutDump();
sal_Int32 nSectionHeight
- = getXPath(pDump, "//section/infos/bounds", "bottom").toInt32(); // was 8391
+ = getXPath(pDump, "//section/infos/bounds"_ostr, "bottom"_ostr).toInt32(); // was 8391
sal_Int32 nColumnHeight
- = getXPath(pDump, "(//column/infos/bounds)[2]", "bottom").toInt32(); // was 16216
+ = getXPath(pDump, "(//column/infos/bounds)[2]"_ostr, "bottom"_ostr).toInt32(); // was 16216
CPPUNIT_ASSERT_MESSAGE("The column in a TBRL page should be shorter than the section.",
nColumnHeight <= nSectionHeight);
}
@@ -2659,8 +2823,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]", "left").toInt32();
- sal_Int32 nLeft_Row2 = getXPath(pDump, "(//row/infos/bounds)[2]", "left").toInt32();
+ 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();
CPPUNIT_ASSERT_EQUAL_MESSAGE("left values of SwRowFrames should be consistent.", nLeft_Row1,
nLeft_Row2);
}
@@ -2676,65 +2840,66 @@ 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]", "height").toInt32();
+ sal_Int32 height
+ = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[1]"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_LESS(small, height);
// U+0020 SPACE: height is ignored
- height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[2]", "height").toInt32();
+ height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[2]"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_LESS(small, height);
// U+00A0 NO-BREAK SPACE: height is considered
- height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[3]", "height").toInt32();
+ height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[3]"_ostr, "height"_ostr).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]", "height").toInt32();
+ height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[4]"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_GREATER(large, height);
// U+2001 EM QUAD: height is considered
- height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[5]", "height").toInt32();
+ height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[5]"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_GREATER(large, height);
// U+2002 EN SPACE: height is ignored
- height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[6]", "height").toInt32();
+ height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[6]"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_LESS(small, height);
// U+2003 EM SPACE: height is ignored
- height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[7]", "height").toInt32();
+ height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[7]"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_LESS(small, height);
// U+2004 THREE-PER-EM SPACE: height is considered
- height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[8]", "height").toInt32();
+ height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[8]"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_GREATER(large, height);
// U+2005 FOUR-PER-EM SPACE: height is ignored
- height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[9]", "height").toInt32();
+ height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[9]"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_LESS(small, height);
// U+2006 SIX-PER-EM SPACE: height is considered
- height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[10]", "height").toInt32();
+ height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[10]"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_GREATER(large, height);
// U+2007 FIGURE SPACE: height is considered
- height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[11]", "height").toInt32();
+ height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[11]"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_GREATER(large, height);
// U+2008 PUNCTUATION SPACE: height is considered
- height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[12]", "height").toInt32();
+ height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[12]"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_GREATER(large, height);
// U+2009 THIN SPACE: height is considered
- height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[13]", "height").toInt32();
+ height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[13]"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_GREATER(large, height);
// U+200A HAIR SPACE: height is considered
- height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[14]", "height").toInt32();
+ height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[14]"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_GREATER(large, height);
// U+202F NARROW NO-BREAK SPACE: height is considered
- height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[15]", "height").toInt32();
+ height = getXPath(pXmlDoc, "(/root/page[1]//SwLineLayout)[15]"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_GREATER(large, height);
// U+205F MEDIUM MATHEMATICAL SPACE: height is considered; not tested, because Liberation Serif lacks it
@@ -2743,61 +2908,75 @@ 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", "height").toInt32();
+ height
+ = getXPath(pXmlDoc, "(/root/page[2]//row)[1]/infos/bounds"_ostr, "height"_ostr).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", "height").toInt32();
+ height
+ = getXPath(pXmlDoc, "(/root/page[2]//row)[2]/infos/bounds"_ostr, "height"_ostr).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", "height").toInt32();
+ height
+ = getXPath(pXmlDoc, "(/root/page[2]//row)[3]/infos/bounds"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_GREATER(large, height);
// U+2001 EM QUAD: height is considered
- height = getXPath(pXmlDoc, "(/root/page[2]//row)[4]/infos/bounds", "height").toInt32();
+ height
+ = getXPath(pXmlDoc, "(/root/page[2]//row)[4]/infos/bounds"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_GREATER(large, height);
// U+2002 EN SPACE: height is ignored
- height = getXPath(pXmlDoc, "(/root/page[2]//row)[5]/infos/bounds", "height").toInt32();
+ height
+ = getXPath(pXmlDoc, "(/root/page[2]//row)[5]/infos/bounds"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_LESS(small, height);
// U+2003 EM SPACE: height is ignored
- height = getXPath(pXmlDoc, "(/root/page[2]//row)[6]/infos/bounds", "height").toInt32();
+ height
+ = getXPath(pXmlDoc, "(/root/page[2]//row)[6]/infos/bounds"_ostr, "height"_ostr).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", "height").toInt32();
+ height
+ = getXPath(pXmlDoc, "(/root/page[2]//row)[7]/infos/bounds"_ostr, "height"_ostr).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", "height").toInt32();
+ height
+ = getXPath(pXmlDoc, "(/root/page[2]//row)[8]/infos/bounds"_ostr, "height"_ostr).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", "height").toInt32();
+ height
+ = getXPath(pXmlDoc, "(/root/page[2]//row)[9]/infos/bounds"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_GREATER(large, height);
// U+2007 FIGURE SPACE: height is considered
- height = getXPath(pXmlDoc, "(/root/page[2]//row)[10]/infos/bounds", "height").toInt32();
+ height
+ = getXPath(pXmlDoc, "(/root/page[2]//row)[10]/infos/bounds"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_GREATER(large, height);
// U+2008 PUNCTUATION SPACE: height is considered
- height = getXPath(pXmlDoc, "(/root/page[2]//row)[11]/infos/bounds", "height").toInt32();
+ height
+ = getXPath(pXmlDoc, "(/root/page[2]//row)[11]/infos/bounds"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_GREATER(large, height);
// U+2009 THIN SPACE: height is considered
- height = getXPath(pXmlDoc, "(/root/page[2]//row)[12]/infos/bounds", "height").toInt32();
+ height
+ = getXPath(pXmlDoc, "(/root/page[2]//row)[12]/infos/bounds"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_GREATER(large, height);
// U+200A HAIR SPACE: height is considered
- height = getXPath(pXmlDoc, "(/root/page[2]//row)[13]/infos/bounds", "height").toInt32();
+ height
+ = getXPath(pXmlDoc, "(/root/page[2]//row)[13]/infos/bounds"_ostr, "height"_ostr).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", "height").toInt32();
+ height
+ = getXPath(pXmlDoc, "(/root/page[2]//row)[14]/infos/bounds"_ostr, "height"_ostr).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 11a9c0191d24..11b9aec05ad2 100644
--- a/sw/qa/extras/layout/layout3.cxx
+++ b/sw/qa/extras/layout/layout3.cxx
@@ -57,7 +57,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", "top", "21");
+ assertXPath(pXmlDoc, "/root/page/body/txt[3]/infos/prtBounds"_ostr, "top"_ostr, "21");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf117188)
@@ -65,13 +65,17 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf117188)
createSwDoc("tdf117188.docx");
saveAndReload("writer8");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- 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");
+ 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);
// The text box must have zero border distances
- assertXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/prtBounds", "left", "0");
- assertXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/prtBounds", "top", "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);
+ assertXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/prtBounds"_ostr, "left"_ostr, "0");
+ assertXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/prtBounds"_ostr, "top"_ostr, "0");
+ 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);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf117187)
@@ -82,7 +86,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf117187)
// there should be no fly portions
assertXPath(
pXmlDoc,
- "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[@nType='PortionType::Fly']", 0);
+ "/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[@nType='PortionType::Fly']"_ostr,
+ 0);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf119875)
@@ -90,9 +95,11 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf119875)
createSwDoc("tdf119875.odt");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
sal_Int32 nFirstTop
- = getXPath(pXmlDoc, "/root/page[2]/body/section[1]/infos/bounds", "top").toInt32();
+ = getXPath(pXmlDoc, "/root/page[2]/body/section[1]/infos/bounds"_ostr, "top"_ostr)
+ .toInt32();
sal_Int32 nSecondTop
- = getXPath(pXmlDoc, "/root/page[2]/body/section[2]/infos/bounds", "top").toInt32();
+ = getXPath(pXmlDoc, "/root/page[2]/body/section[2]/infos/bounds"_ostr, "top"_ostr)
+ .toInt32();
// The first section had the same top value as the second one, so they
// overlapped.
CPPUNIT_ASSERT_LESS(nSecondTop, nFirstTop);
@@ -104,10 +111,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", "height", "304");
- assertXPath(pXmlDoc, "/root/page/footer/txt[2]/infos/bounds", "height", "191");
- assertXPath(pXmlDoc, "/root/page/footer/txt[3]/infos/bounds", "height", "219");
- assertXPath(pXmlDoc, "/root/page/footer/tab/infos/bounds", "height", "1378");
+ assertXPath(pXmlDoc, "/root/page/footer/txt[1]/infos/bounds"_ostr, "height"_ostr, "304");
+ assertXPath(pXmlDoc, "/root/page/footer/txt[2]/infos/bounds"_ostr, "height"_ostr, "191");
+ assertXPath(pXmlDoc, "/root/page/footer/txt[3]/infos/bounds"_ostr, "height"_ostr, "219");
+ assertXPath(pXmlDoc, "/root/page/footer/tab/infos/bounds"_ostr, "height"_ostr, "1378");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf120287)
@@ -117,7 +124,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", 1);
+ assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, 1);
}
static auto getXPathIntAttributeValue(xmlXPathContextPtr pXmlXpathCtx, char const* const pXPath)
@@ -139,7 +146,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf128966)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
xmlXPathObjectPtr pXmlObj
- = getXPathNode(pXmlDoc, "/root/page/body/tab/row/cell[@rowspan > 0][child::txt]");
+ = getXPathNode(pXmlDoc, "/root/page/body/tab/row/cell[@rowspan > 0][child::txt]"_ostr);
xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
CPPUNIT_ASSERT(pXmlNodes);
CPPUNIT_ASSERT_GREATER(300, xmlXPathNodeSetGetLength(pXmlNodes)); // many...
@@ -186,8 +193,9 @@ 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]",
- "width")
+ = getXPath(pXmlDoc,
+ "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[2]/SwLinePortion[2]"_ostr,
+ "width"_ostr)
.toInt32();
// This was 5806 (not real portion width, but stripped to the line width)
CPPUNIT_ASSERT_GREATER(sal_Int32(5840), nPortionWidth);
@@ -206,16 +214,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",
- "type", "PortionType::Margin");
- assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwGluePortion",
- "width", "0");
+ assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwGluePortion"_ostr,
+ "type"_ostr, "PortionType::Margin");
+ assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwGluePortion"_ostr,
+ "width"_ostr, "0");
// but not after centered, right and decimal tabulators
- assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/SwGluePortion",
- "type", "PortionType::Margin");
+ assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/SwGluePortion"_ostr,
+ "type"_ostr, "PortionType::Margin");
// This was a justified line, without width
- assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/SwGluePortion",
- "width", "7882");
+ assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/SwGluePortion"_ostr,
+ "width"_ostr, "7882");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf155324)
@@ -227,29 +235,36 @@ 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]",
- "portion", "Foo");
- assertXPath(pXmlDoc,
- "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "5");
- assertXPath(pXmlDoc,
- "/root/page[1]/body/section[2]/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "bar");
- assertXPath(pXmlDoc,
- "/root/page[1]/body/section[2]/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "7");
- assertXPath(pXmlDoc,
- "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]",
- "portion", "Three");
- assertXPath(pXmlDoc,
- "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]",
- "portion", "7");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "Foo");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "5");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/body/section[2]/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "bar");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/body/section[2]/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "7");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "Three");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr,
+ "portion"_ostr, "7");
// check first content page has the footnotes
- assertXPath(pXmlDoc, "/root/page[5]/body/txt[1]/SwParaPortion/SwLineLayout", "portion", "Foo");
- assertXPath(pXmlDoc, "/root/page[4]/ftncont", 0);
- assertXPath(pXmlDoc, "/root/page[5]/ftncont/ftn", 5);
+ assertXPath(pXmlDoc, "/root/page[5]/body/txt[1]/SwParaPortion/SwLineLayout"_ostr,
+ "portion"_ostr, "Foo");
+ assertXPath(pXmlDoc, "/root/page[4]/ftncont"_ostr, 0);
+ assertXPath(pXmlDoc, "/root/page[5]/ftncont/ftn"_ostr, 5);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf120287b)
@@ -261,8 +276,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf120287b)
// line.
assertXPath(
pXmlDoc,
- "/root/page/body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::TabRight']",
- "width", "18");
+ "/root/page/body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::TabRight']"_ostr,
+ "width"_ostr, "18");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf120287c)
@@ -271,7 +286,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf120287c)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// This was 2, the second line was not broken into a 2nd and a 3rd one,
// rendering text outside the paragraph frame.
- assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout", 3);
+ assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, 3);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf155177)
@@ -284,13 +299,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf155177)
{
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- 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",
- "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",
- "This paragraph is even longer so that ");
+ 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, "long as two lines.");
+ 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, "This paragraph is even longer so that ");
discardDumpedLayout();
}
@@ -301,13 +316,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf155177)
{
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- 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",
- "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",
- "it is now three lines long though ");
+ 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, "This paragraph is even longer so that ");
+ 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, "it is now three lines long though ");
discardDumpedLayout();
}
@@ -318,15 +333,15 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf155177)
{
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- 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",
- "This paragraph is even longer so that ");
- assertXPath(pXmlDoc, "/root/page[2]/body/txt[7]/SwParaPortion/SwLineLayout[2]", "portion",
- "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",
- "containing a single sentence.");
+ 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, "This paragraph is even longer so that ");
+ assertXPath(pXmlDoc, "/root/page[2]/body/txt[7]/SwParaPortion/SwLineLayout[2]"_ostr,
+ "portion"_ostr, "it is now three lines long though ");
+ 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, "containing a single sentence.");
discardDumpedLayout();
}
}
@@ -336,7 +351,8 @@ 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", "top")
+ = getXPath(pXmlDoc, "/root/page[1]/footer/txt/anchored/fly/tab/infos/bounds"_ostr,
+ "top"_ostr)
.toInt32();
SwDoc* pDoc = getSwDoc();
SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
@@ -359,23 +375,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",
- "top")
+ = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/tab/row[1]/cell[4]/infos/bounds"_ostr,
+ "top"_ostr)
.toInt32();
sal_Int32 nTopOfD1Anchored = getXPath(pXmlDoc,
"/root/page/body/txt/anchored/fly/tab/row[1]/cell[4]/"
- "txt[2]/anchored/fly/infos/bounds",
- "top")
+ "txt[2]/anchored/fly/infos/bounds"_ostr,
+ "top"_ostr)
.toInt32();
CPPUNIT_ASSERT_LESS(nTopOfD1Anchored, nTopOfD1);
sal_Int32 nTopOfB2
- = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/tab/row[2]/cell[2]/infos/bounds",
- "top")
+ = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/tab/row[2]/cell[2]/infos/bounds"_ostr,
+ "top"_ostr)
.toInt32();
sal_Int32 nTopOfB2Anchored = getXPath(pXmlDoc,
"/root/page/body/txt/anchored/fly/tab/row[2]/cell[2]/"
- "txt[1]/anchored/fly/infos/bounds",
- "top")
+ "txt[1]/anchored/fly/infos/bounds"_ostr,
+ "top"_ostr)
.toInt32();
CPPUNIT_ASSERT_LESS(nTopOfB2Anchored, nTopOfB2);
}
@@ -386,7 +402,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf112290)
SwDoc* pDoc = getSwDoc();
CPPUNIT_ASSERT(pDoc);
auto pXml = parseLayoutDump();
- assertXPath(pXml, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]", "portion", "Xxxx Xxxx");
+ assertXPath(pXml, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]"_ostr, "portion"_ostr,
+ "Xxxx Xxxx");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testKeepWithNextPlusFlyFollowTextFlow)
@@ -396,13 +413,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testKeepWithNextPlusFlyFollowTextFlow)
{
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// 3 text frames on page 1
- assertXPath(pXmlDoc, "/root/page[1]/body/infos/bounds", "bottom", "7540");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/bounds", "height", "276");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/infos/bounds", "height", "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", "1694");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/infos/bounds", "height", "276");
- assertXPath(pXmlDoc, "/root/page", 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/infos/bounds"_ostr, "bottom"_ostr, "7540");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/bounds"_ostr, "height"_ostr, "276");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/infos/bounds"_ostr, "height"_ostr, "276");
+ 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,
+ "1694");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/infos/bounds"_ostr, "height"_ostr, "276");
+ assertXPath(pXmlDoc, "/root/page"_ostr, 1);
discardDumpedLayout();
}
@@ -411,15 +429,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", "bottom", "7540");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/bounds", "height", "5796");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/bounds", "bottom", "7213");
+ assertXPath(pXmlDoc, "/root/page[1]/body/infos/bounds"_ostr, "bottom"_ostr, "7540");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/bounds"_ostr, "height"_ostr, "5796");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/bounds"_ostr, "bottom"_ostr, "7213");
// 2 text frames on page 2
- assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/infos/bounds", "height", "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", "10093");
- assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/infos/bounds", "height", "276");
- assertXPath(pXmlDoc, "/root/page", 2);
+ assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/infos/bounds"_ostr, "height"_ostr, "276");
+ 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,
+ "10093");
+ assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/infos/bounds"_ostr, "height"_ostr, "276");
+ assertXPath(pXmlDoc, "/root/page"_ostr, 2);
discardDumpedLayout();
}
@@ -428,13 +447,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testKeepWithNextPlusFlyFollowTextFlow)
{
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// 3 text frames on page 1
- assertXPath(pXmlDoc, "/root/page[1]/body/infos/bounds", "bottom", "7540");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/bounds", "height", "276");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/infos/bounds", "height", "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", "1694");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/infos/bounds", "height", "276");
- assertXPath(pXmlDoc, "/root/page", 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/infos/bounds"_ostr, "bottom"_ostr, "7540");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/bounds"_ostr, "height"_ostr, "276");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/infos/bounds"_ostr, "height"_ostr, "276");
+ 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,
+ "1694");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/infos/bounds"_ostr, "height"_ostr, "276");
+ assertXPath(pXmlDoc, "/root/page"_ostr, 1);
discardDumpedLayout();
}
}
@@ -445,16 +465,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]",
- "height", "253");
+ "fly/txt/SwParaPortion/SwLineLayout/child::*[1]"_ostr,
+ "height"_ostr, "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]",
- "width", "428");
+ "fly/txt/SwParaPortion/SwLineLayout/child::*[1]"_ostr,
+ "width"_ostr, "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]",
- "portion", "Fax:");
+ "fly/txt/SwParaPortion/SwLineLayout/child::*[1]"_ostr,
+ "portion"_ostr, "Fax:");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf122607_regression)
@@ -484,15 +504,19 @@ 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", "mbFixSize",
- "false");
- assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/infos/bounds", "top", "2977");
- assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/infos/bounds", "height", "241");
- assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/infos/bounds", "mbFixSize",
- "true");
+ assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/infos/bounds"_ostr,
+ "mbFixSize"_ostr, "false");
+ assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/infos/bounds"_ostr, "top"_ostr,
+ "2977");
+ assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[1]/infos/bounds"_ostr,
+ "height"_ostr, "241");
+ assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/infos/bounds"_ostr,
+ "mbFixSize"_ostr, "true");
// this was 3034, causing the overlap
- assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/infos/bounds", "top", "3218");
- assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/infos/bounds", "height", "164");
+ assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/infos/bounds"_ostr, "top"_ostr,
+ "3218");
+ assertXPath(pXmlDoc, "/root/page[1]/anchored/fly/tab[1]/row[2]/infos/bounds"_ostr,
+ "height"_ostr, "164");
aTempFile.EnableKillingFile();
}
@@ -527,19 +551,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",
- "portion", "Important information here!");
- assertXPath(pXmlDoc, "/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[2]/infos/bounds", "height",
- "253");
- assertXPath(pXmlDoc, "/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[2]/infos/bounds", "top",
- "7925");
+ "/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[2]/SwParaPortion/SwLineLayout"_ostr,
+ "portion"_ostr, "Important information here!");
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[2]/infos/bounds"_ostr,
+ "height"_ostr, "253");
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[2]/infos/bounds"_ostr,
+ "top"_ostr, "7925");
assertXPath(pXmlDoc,
- "/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[3]/SwParaPortion/SwLineLayout",
- "portion", "xxx 111 ");
- assertXPath(pXmlDoc, "/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[3]/infos/bounds", "height",
- "697");
- assertXPath(pXmlDoc, "/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[3]/infos/bounds", "top",
- "8178");
+ "/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[3]/SwParaPortion/SwLineLayout"_ostr,
+ "portion"_ostr, "xxx 111 ");
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[3]/infos/bounds"_ostr,
+ "height"_ostr, "697");
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab[3]/row[2]/cell[2]/txt[3]/infos/bounds"_ostr,
+ "top"_ostr, "8178");
aTempFile.EnableKillingFile();
}
@@ -559,24 +583,25 @@ 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]", "orientation", "900");
+ assertXPath(pXmlDoc, "//font[1]"_ostr, "orientation"_ostr, "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]", "x", "1915");
- assertXPath(pXmlDoc, "//textarray[1]", "y", "2707");
+ assertXPath(pXmlDoc, "//textarray[1]"_ostr, "x"_ostr, "1915");
+ assertXPath(pXmlDoc, "//textarray[1]"_ostr, "y"_ostr, "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]", "left", "1979");
+ assertXPath(pXmlDoc, "(//rect)[2]"_ostr, "left"_ostr, "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", "width", "269");
+ assertXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt[2]/infos/bounds"_ostr, "width"_ostr,
+ "269");
// Test the position of the cursor after doc load.
// We expect that it's inside the first text frame in the first cell.
@@ -587,9 +612,11 @@ 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", "top").toInt32();
+ = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt[1]/infos/bounds"_ostr, "top"_ostr)
+ .toInt32();
SwTwips nFirstParaHeight
- = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt[1]/infos/bounds", "height")
+ = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt[1]/infos/bounds"_ostr,
+ "height"_ostr)
.toInt32();
SwTwips nFirstParaMiddle = nFirstParaTop + nFirstParaHeight / 2;
SwTwips nFirstParaBottom = nFirstParaTop + nFirstParaHeight;
@@ -631,15 +658,18 @@ 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", "left")
+ = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt[2]/infos/bounds"_ostr, "left"_ostr)
.toInt32();
SwTwips nSecondParaWidth
- = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt[2]/infos/bounds", "width")
+ = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt[2]/infos/bounds"_ostr,
+ "width"_ostr)
.toInt32();
SwTwips nSecondParaTop
- = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt[2]/infos/bounds", "top").toInt32();
+ = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt[2]/infos/bounds"_ostr, "top"_ostr)
+ .toInt32();
SwTwips nSecondParaHeight
- = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt[2]/infos/bounds", "height")
+ = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt[2]/infos/bounds"_ostr,
+ "height"_ostr)
.toInt32();
Point aPoint;
aPoint.setX(nSecondParaLeft + nSecondParaWidth / 2);
@@ -654,13 +684,17 @@ 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", "left").toInt32();
+ = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/infos/bounds"_ostr, "left"_ostr)
+ .toInt32();
SwTwips nCellWidth
- = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/infos/bounds", "width").toInt32();
+ = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/infos/bounds"_ostr, "width"_ostr)
+ .toInt32();
SwTwips nCellTop
- = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/infos/bounds", "top").toInt32();
+ = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/infos/bounds"_ostr, "top"_ostr)
+ .toInt32();
SwTwips nCellHeight
- = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/infos/bounds", "height").toInt32();
+ = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/infos/bounds"_ostr, "height"_ostr)
+ .toInt32();
SwRect aCellRect(Point(nCellLeft, nCellTop), Size(nCellWidth, nCellHeight));
pWrtShell->SelAll();
SwShellCursor* pShellCursor = pWrtShell->getShellCursor(/*bBlock=*/false);
@@ -717,9 +751,10 @@ 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]",
- "type", "PortionType::Para");
+ assertXPath(
+ pXmlDoc,
+ "/root/page/body/txt/anchored/fly/txt/SwParaPortion/SwLineLayout[1]/child::*[1]"_ostr,
+ "type"_ostr, "PortionType::Para");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf123651)
@@ -729,7 +764,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", "top").toInt32();
+ = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds"_ostr, "top"_ostr).toInt32();
CPPUNIT_ASSERT_DOUBLES_EQUAL(7639, nTopValue, 10);
}
@@ -769,8 +804,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.
- sal_Int32 nOther = parseDump("/root/page[1]/infos/bounds", "height").toInt32();
- sal_Int32 nLast = parseDump("/root/page[2]/infos/bounds", "height").toInt32();
+ sal_Int32 nOther = parseDump("/root/page[1]/infos/bounds"_ostr, "height"_ostr).toInt32();
+ sal_Int32 nLast = parseDump("/root/page[2]/infos/bounds"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_GREATER(nOther, nLast);
}
@@ -782,7 +817,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", 1);
+ assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testImageComment)
@@ -926,8 +961,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf64222)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
assertXPath(pXmlDoc,
"/root/page/body/txt[2]/SwParaPortion/SwLineLayout/"
- "child::*[@type='PortionType::Number']/SwFont",
- "height", "560");
+ "child::*[@type='PortionType::Number']/SwFont"_ostr,
+ "height"_ostr, "560");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf113014)
@@ -945,9 +980,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", "1.");
- assertXPathContent(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/textarray[3]/text", "2.");
- assertXPathContent(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/textarray[5]/text", "3.");
+ assertXPathContent(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/textarray[1]/text"_ostr, "1.");
+ assertXPathContent(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/textarray[3]/text"_ostr, "2.");
+ assertXPathContent(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/textarray[5]/text"_ostr, "3.");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf130218)
@@ -964,7 +999,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", "Text");
+ assertXPathContent(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/textarray[1]/text"_ostr, "Text");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf127235)
@@ -982,21 +1017,22 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf138039)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// there are 3 pages
- assertXPath(pXmlDoc, "/root/page", 3);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 3);
// table on first page
- assertXPath(pXmlDoc, "/root/page[1]/body/tab", 1);
- assertXPath(pXmlDoc, "/root/page[1]/body/txt", 0);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab"_ostr, 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 0);
// paragraph with large fly on second page
- 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", "17915");
- assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "height",
- "15819");
+ 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,
+ "17915");
+ assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds"_ostr,
+ "height"_ostr, "15819");
// paragraph on third page
- 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);
+ 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);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf134298)
@@ -1006,18 +1042,19 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf134298)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// there are 2 pages
- assertXPath(pXmlDoc, "/root/page", 2);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 2);
// table and first para on first page
- 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);
+ 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);
// paragraph with large fly on second page
- 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", "17897");
- assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "height",
- "15819");
+ 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,
+ "17897");
+ assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds"_ostr,
+ "height"_ostr, "15819");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testShapeAllowOverlap)
@@ -1136,7 +1173,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", 1);
+ assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf124601)
@@ -1152,8 +1189,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", 2);
- assertXPath(pXmlDoc, "/root/page[2]/ftncont", 1);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 2);
+ assertXPath(pXmlDoc, "/root/page[2]/ftncont"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf124601b)
@@ -1166,15 +1203,18 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf124601b)
createSwDoc("tdf124601b.doc");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- sal_Int32 nFlyTop = getXPath(pXmlDoc, "//anchored/fly/infos/bounds", "top").toInt32();
- sal_Int32 nFlyLeft = getXPath(pXmlDoc, "//anchored/fly/infos/bounds", "left").toInt32();
+ 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 nFlyRight
- = nFlyLeft + getXPath(pXmlDoc, "//anchored/fly/infos/bounds", "width").toInt32();
- sal_Int32 nSecondRowTop = getXPath(pXmlDoc, "//tab/row[2]/infos/bounds", "top").toInt32();
+ = 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();
sal_Int32 nLastCellLeft
- = getXPath(pXmlDoc, "//tab/row[1]/cell[5]/infos/bounds", "left").toInt32();
+ = getXPath(pXmlDoc, "//tab/row[1]/cell[5]/infos/bounds"_ostr, "left"_ostr).toInt32();
sal_Int32 nLastCellRight
- = nLastCellLeft + getXPath(pXmlDoc, "//tab/row[1]/cell[5]/infos/bounds", "width").toInt32();
+ = nLastCellLeft
+ + getXPath(pXmlDoc, "//tab/row[1]/cell[5]/infos/bounds"_ostr, "width"_ostr).toInt32();
// Without the accompanying fix in place, this test would have failed with:
// - Expected greater than: 3736
// - Actual : 2852
@@ -1233,7 +1273,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", 1);
+ assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testContinuousEndnotesInsertPageAtStart)
@@ -1255,12 +1295,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", 3);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 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", 1);
+ assertXPath(pXmlDoc, "/root/page[3]/ftncont"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testContinuousEndnotesDeletePageAtStart)
@@ -1286,8 +1326,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", 1);
- assertXPath(pXmlDoc, "/root/page[1]/ftncont", 1);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 1);
+ assertXPath(pXmlDoc, "/root/page[1]/ftncont"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf128399)
@@ -1340,13 +1380,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", 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);
+ 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);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf156725)
@@ -1354,20 +1394,26 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf156725)
createSwDoc("tdf156725.fodt");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page", 2);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 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", 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);
+ 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);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf156419)
@@ -1375,17 +1421,23 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf156419)
createSwDoc("linked_frames_section_bug.odt");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page", 2);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 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", 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);
+ 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);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf145826)
@@ -1394,15 +1446,15 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf145826)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/root/page/body/section/column", 2);
+ assertXPath(pXmlDoc, "/root/page/body/section/column"_ostr, 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", 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);
+ 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);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf105481)
@@ -1417,38 +1469,38 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf105481)
SwTwips nTxtTop = getXPath(pXmlDoc,
"/root/page/anchored/fly/txt[2]"
- "/infos/bounds",
- "top")
+ "/infos/bounds"_ostr,
+ "top"_ostr)
.toInt32();
SwTwips nTxtBottom = nTxtTop
+ getXPath(pXmlDoc,
"/root/page/anchored/fly/txt[2]"
- "/infos/bounds",
- "height")
+ "/infos/bounds"_ostr,
+ "height"_ostr)
.toInt32();
SwTwips nFormula1Top = getXPath(pXmlDoc,
"/root/page/anchored/fly/txt[2]"
- "/anchored/fly[1]/infos/bounds",
- "top")
+ "/anchored/fly[1]/infos/bounds"_ostr,
+ "top"_ostr)
.toInt32();
SwTwips nFormula1Bottom = nFormula1Top
+ getXPath(pXmlDoc,
"/root/page/anchored/fly/txt[2]"
- "/anchored/fly[1]/infos/bounds",
- "height")
+ "/anchored/fly[1]/infos/bounds"_ostr,
+ "height"_ostr)
.toInt32();
SwTwips nFormula2Top = getXPath(pXmlDoc,
"/root/page/anchored/fly/txt[2]"
- "/anchored/fly[2]/infos/bounds",
- "top")
+ "/anchored/fly[2]/infos/bounds"_ostr,
+ "top"_ostr)
.toInt32();
SwTwips nFormula2Bottom = nFormula2Top
+ getXPath(pXmlDoc,
"/root/page/anchored/fly/txt[2]"
- "/anchored/fly[2]/infos/bounds",
- "height")
+ "/anchored/fly[2]/infos/bounds"_ostr,
+ "height"_ostr)
.toInt32();
// Ensure that the two formula positions are at least between top and bottom of the text frame.
@@ -1476,7 +1528,8 @@ 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", "FOO AAA");
+ assertXPathContent(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/textarray[1]/text"_ostr,
+ "FOO AAA");
//The first cell must be "FOO AAA". If not, this means the first cell content not visible in
//the source document.
}
@@ -1493,17 +1546,20 @@ 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]",
- "portion",
+ pXmlDoc,
+ "/root/page[1]/body/tab[1]/row[1]/cell[1]/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr,
+ "portion"_ostr,
"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]",
- "portion",
+ pXmlDoc,
+ "/root/page[1]/body/tab[1]/row[1]/cell[1]/txt[1]/SwParaPortion/SwLineLayout[2]"_ostr,
+ "portion"_ostr,
"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]",
- "portion", "amet commodo magna eros quis urna.");
+ assertXPath(
+ pXmlDoc,
+ "/root/page[2]/body/tab[1]/row[1]/cell[1]/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr,
+ "portion"_ostr, "amet commodo magna eros quis urna.");
// Also check that the widow control for the paragraph is not turned off:
sw::TableFrameFormats& rTableFormats = *pDocument->GetTableFrameFormats();
@@ -1532,7 +1588,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']", 2);
+ assertXPath(pXmlDoc, "//SwLineLayout/child::*[@type='PortionType::Hyphen']"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf149420)
@@ -1547,7 +1603,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']", 8);
+ assertXPath(pXmlDoc, "//SwLineLayout/child::*[@type='PortionType::Hyphen']"_ostr, 8);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf149324)
@@ -1562,7 +1618,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']", 3);
+ assertXPath(pXmlDoc, "//SwLineLayout/child::*[@type='PortionType::Hyphen']"_ostr, 3);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf149248)
@@ -1577,7 +1633,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']", 1);
+ assertXPath(pXmlDoc, "//SwLineLayout/child::*[@type='PortionType::Hyphen']"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testWriterImageNoCapture)
@@ -1585,8 +1641,9 @@ 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", "left").toInt32();
- sal_Int32 nImageLeft = getXPath(pXmlDoc, "//anchored/fly/infos/bounds", "left").toInt32();
+ 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();
// Without the accompanying fix in place, this test would have failed with:
// - Expected less than: 284
// - Actual : 284
@@ -1647,21 +1704,21 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf134548)
// Second paragraph has two non zero width tabs in beginning of line
{
OUString sNodeType = parseDump(
- "/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwFixPortion[1]", "type");
+ "/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwFixPortion[1]"_ostr, "type"_ostr);
CPPUNIT_ASSERT_EQUAL(OUString("PortionType::TabLeft"), sNodeType);
sal_Int32 nWidth
- = parseDump("/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwFixPortion[1]",
- "width")
+ = parseDump("/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwFixPortion[1]"_ostr,
+ "width"_ostr)
.toInt32();
CPPUNIT_ASSERT_GREATER(sal_Int32(0), nWidth);
}
{
OUString sNodeType = parseDump(
- "/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwFixPortion[2]", "type");
+ "/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwFixPortion[2]"_ostr, "type"_ostr);
CPPUNIT_ASSERT_EQUAL(OUString("PortionType::TabLeft"), sNodeType);
sal_Int32 nWidth
- = parseDump("/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwFixPortion[2]",
- "width")
+ = parseDump("/root/page/body/txt[2]/SwParaPortion/SwLineLayout/SwFixPortion[2]"_ostr,
+ "width"_ostr)
.toInt32();
CPPUNIT_ASSERT_GREATER(sal_Int32(0), nWidth);
}
@@ -1672,18 +1729,20 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf124423)
createSwDoc("tdf124423.docx");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
sal_Int32 nFly1Width
- = getXPath(pXmlDoc, "(//anchored/fly)[1]/infos/prtBounds", "width").toInt32();
+ = getXPath(pXmlDoc, "(//anchored/fly)[1]/infos/prtBounds"_ostr, "width"_ostr).toInt32();
sal_Int32 nFly2Width
- = getXPath(pXmlDoc, "(//anchored/fly)[2]/infos/prtBounds", "width").toInt32();
- sal_Int32 nPageWidth = getXPath(pXmlDoc, "//page/infos/prtBounds", "width").toInt32();
+ = getXPath(pXmlDoc, "(//anchored/fly)[2]/infos/prtBounds"_ostr, "width"_ostr).toInt32();
+ sal_Int32 nPageWidth = getXPath(pXmlDoc, "//page/infos/prtBounds"_ostr, "width"_ostr).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", "width").toInt32();
- nFly2Width = getXPath(pXmlDoc, "(//anchored/fly)[2]/infos/prtBounds", "width").toInt32();
- nPageWidth = getXPath(pXmlDoc, "//page/infos/prtBounds", "width").toInt32();
+ 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();
CPPUNIT_ASSERT_LESS(nPageWidth / 2, nFly2Width);
CPPUNIT_ASSERT_LESS(nPageWidth / 2, nFly1Width);
}
@@ -1739,10 +1798,11 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf138782)
// - Expected less than: 13327
// - Actual : 14469
- CPPUNIT_ASSERT_LESS(
- getXPath(pXml, "/root/page/infos/bounds", "right").toInt32(),
- getXPath(pXml, "/root/page/body/txt[8]/anchored/SwAnchoredDrawObject/bounds", "right")
- .toInt32());
+ 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_TEST_FIXTURE(SwLayoutWriter3, testTdf135035)
@@ -1750,22 +1810,26 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf135035)
createSwDoc("tdf135035.docx");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
sal_Int32 nFly1Width
- = getXPath(pXmlDoc, "(//anchored/fly)[1]/infos/prtBounds", "width").toInt32();
+ = getXPath(pXmlDoc, "(//anchored/fly)[1]/infos/prtBounds"_ostr, "width"_ostr).toInt32();
sal_Int32 nFly2Width
- = getXPath(pXmlDoc, "(//anchored/fly)[2]/infos/prtBounds", "width").toInt32();
+ = getXPath(pXmlDoc, "(//anchored/fly)[2]/infos/prtBounds"_ostr, "width"_ostr).toInt32();
sal_Int32 nFly3Width
- = getXPath(pXmlDoc, "(//anchored/fly)[3]/infos/prtBounds", "width").toInt32();
- sal_Int32 nParentWidth = getXPath(pXmlDoc, "(//txt)[1]/infos/prtBounds", "width").toInt32();
+ = getXPath(pXmlDoc, "(//anchored/fly)[3]/infos/prtBounds"_ostr, "width"_ostr).toInt32();
+ sal_Int32 nParentWidth
+ = getXPath(pXmlDoc, "(//txt)[1]/infos/prtBounds"_ostr, "width"_ostr).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", "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();
+ 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();
CPPUNIT_ASSERT_LESS(nParentWidth / 2, nFly2Width);
CPPUNIT_ASSERT_LESS(nParentWidth / 2, nFly1Width);
CPPUNIT_ASSERT_GREATER(nParentWidth, nFly3Width);
@@ -1778,7 +1842,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", 1);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage)
@@ -1792,7 +1856,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", 2);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage)
@@ -1807,7 +1871,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf54465_ColumnsWithFootnoteDoNotOccup
CPPUNIT_ASSERT(pDoc);
Scheduler::ProcessEventsToIdle();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "/root/page");
+ xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "/root/page"_ostr);
xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
CPPUNIT_ASSERT_GREATER(1, xmlXPathNodeSetGetLength(pXmlNodes));
xmlXPathFreeObject(pXmlObj);
@@ -1817,7 +1881,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf54465_ColumnsWithFootnoteDoNotOccup
pDoc = getSwDoc();
CPPUNIT_ASSERT(pDoc);
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page", 1);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf138124)
@@ -1835,8 +1899,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf138124)
// but an assertion in SwTextPainter::DrawTextLine would fail during paint.
xmlDocUniquePtr pXml = parseLayoutDump();
- assertXPath(pXml, "/root/page", 1);
- assertXPath(pXml, "/root/page/ftncont/ftn/txt/anchored", 1);
+ assertXPath(pXml, "/root/page"_ostr, 1);
+ assertXPath(pXml, "/root/page/ftncont/ftn/txt/anchored"_ostr, 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
@@ -1844,8 +1908,10 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf138124)
// - Actual : 49
assertXPath(pXml,
- "/root/page/ftncont/ftn/txt//SwFieldPortion[@type='PortionType::FootnoteNum']", 1);
- assertXPath(pXml, "/root/page/ftncont/ftn/txt//SwLinePortion[@type='PortionType::FlyCnt']", 1);
+ "/root/page/ftncont/ftn/txt//SwFieldPortion[@type='PortionType::FootnoteNum']"_ostr,
+ 1);
+ assertXPath(pXml, "/root/page/ftncont/ftn/txt//SwLinePortion[@type='PortionType::FlyCnt']"_ostr,
+ 1);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf154113)
@@ -1880,13 +1946,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", 3);
- assertXPath(pXml, "/root/page/body/section[1]/txt/SwParaPortion/SwLineLayout", "portion",
- "<-- Start selection here. Section1");
- assertXPath(pXml, "/root/page/body/section[2]/txt/SwParaPortion/SwLineLayout", "portion",
- "Section2");
- assertXPath(pXml, "/root/page/body/section[3]/txt/SwParaPortion/SwLineLayout", "portion",
- "Section3. End selection here -->");
+ assertXPath(pXml, "/root/page/body/section"_ostr, 3);
+ assertXPath(pXml, "/root/page/body/section[1]/txt/SwParaPortion/SwLineLayout"_ostr,
+ "portion"_ostr, "<-- Start selection here. Section1");
+ assertXPath(pXml, "/root/page/body/section[2]/txt/SwParaPortion/SwLineLayout"_ostr,
+ "portion"_ostr, "Section2");
+ assertXPath(pXml, "/root/page/body/section[3]/txt/SwParaPortion/SwLineLayout"_ostr,
+ "portion"_ostr, "Section3. End selection here -->");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf155611)
@@ -1900,22 +1966,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");
+ assertXPath(pXml, "/root/page"_ostr);
// Without the fix in place, this would fail with
// - Expected: 2
// - Actual : 3
- 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"_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[1]/tab/row/cell[1]/txt/SwParaPortion/SwLineLayout/"
- "SwParaPortion[@portion='foo']");
+ "SwParaPortion[@portion='foo']"_ostr);
assertXPath(pXml, "/root/page/body/section[1]/tab/row/cell[2]/txt/SwParaPortion/SwLineLayout/"
- "SwParaPortion[@portion='bar']");
+ "SwParaPortion[@portion='bar']"_ostr);
assertXPath(pXml, "/root/page/body/section[1]/tab/row/cell[2]/tab/row/cell/txt/SwParaPortion/"
- "SwLineLayout/SwParaPortion[@portion='baz']");
+ "SwLineLayout/SwParaPortion[@portion='baz']"_ostr);
assertXPath(pXml, "/root/page/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/"
- "SwParaPortion[@portion='abc']");
+ "SwParaPortion[@portion='abc']"_ostr);
// Also must not crash on close because of a frame that accidentally fell off of the layout
}
diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx
index 62d7d19fbbc4..921680d382f1 100644
--- a/sw/qa/extras/mailmerge/mailmerge.cxx
+++ b/sw/qa/extras/mailmerge/mailmerge.cxx
@@ -409,8 +409,8 @@ DECLARE_FILE_MAILMERGE_TEST(testMissingDefaultLineColor, "missing-default-line-c
CPPUNIT_ASSERT_EQUAL( COL_BLACK, lineColor );
// And check that the resulting file has the proper default.
xmlDocUniquePtr pXmlDoc = parseMailMergeExport( "styles.xml" );
- CPPUNIT_ASSERT_EQUAL( OUString( "graphic" ), getXPath(pXmlDoc, "/office:document-styles/office:styles/style:default-style[1]", "family"));
- CPPUNIT_ASSERT_EQUAL( OUString( "#000000" ), getXPath(pXmlDoc, "/office:document-styles/office:styles/style:default-style[1]/style:graphic-properties", "stroke-color"));
+ CPPUNIT_ASSERT_EQUAL( OUString( "graphic" ), getXPath(pXmlDoc, "/office:document-styles/office:styles/style:default-style[1]"_ostr, "family"_ostr));
+ CPPUNIT_ASSERT_EQUAL( OUString( "#000000" ), getXPath(pXmlDoc, "/office:document-styles/office:styles/style:default-style[1]/style:graphic-properties"_ostr, "stroke-color"_ostr));
}
DECLARE_FILE_MAILMERGE_TEST(testSimpleMailMerge, "simple-mail-merge.odt", "10-testing-addresses.ods", "testing-addresses")
@@ -476,11 +476,11 @@ DECLARE_FILE_MAILMERGE_TEST(test2Pages, "simple-mail-merge-2pages.odt", "10-test
CPPUNIT_ASSERT_EQUAL( OUString( "Second page." ), getRun( getParagraph( 5 ), 1 )->getString());
CPPUNIT_ASSERT_EQUAL( firstname, getRun( getParagraph( 6 ), 1 )->getString());
// Also verify the layout.
- CPPUNIT_ASSERT_EQUAL( lastname, parseDump("/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
- CPPUNIT_ASSERT_EQUAL( OUString( "Fixed text." ), parseDump("/root/page[1]/body/txt[1]", ""));
- CPPUNIT_ASSERT_EQUAL( OUString(), parseDump("/root/page[1]/body/txt[4]", ""));
- CPPUNIT_ASSERT_EQUAL( OUString( "Second page." ), parseDump("/root/page[2]/body/txt[1]", ""));
- CPPUNIT_ASSERT_EQUAL( firstname, parseDump("/root/page[2]/body/txt[2]/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
+ CPPUNIT_ASSERT_EQUAL( lastname, parseDump("/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr));
+ CPPUNIT_ASSERT_EQUAL( OUString( "Fixed text." ), parseDump("/root/page[1]/body/txt[1]"_ostr, ""_ostr));
+ CPPUNIT_ASSERT_EQUAL( OUString(), parseDump("/root/page[1]/body/txt[4]"_ostr, ""_ostr));
+ CPPUNIT_ASSERT_EQUAL( OUString( "Second page." ), parseDump("/root/page[2]/body/txt[1]"_ostr, ""_ostr));
+ CPPUNIT_ASSERT_EQUAL( firstname, parseDump("/root/page[2]/body/txt[2]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr));
}
}
@@ -592,21 +592,21 @@ DECLARE_SHELL_MAILMERGE_TEST(testBookmarkCondition, "bookmarkcondition.fodt", "b
xmlBufferLength(mpXmlBuffer)));
// check that conditions on sections and bookmarks are evaluated the same
- assertXPath(pLayout, "/root/page", 7);
- assertXPath(pLayout, "/root/page[1]/body/section", 1);
- assertXPath(pLayout, "/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout", "portion", u"In den Bergen war es anstrengend."_ustr);
- assertXPath(pLayout, "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout", "portion", u"Mein Urlaub war anstrengend . "_ustr);
- assertXPath(pLayout, "/root/page[3]/body/section", 1);
- assertXPath(pLayout, "/root/page[3]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout", "portion", u"In Barcelona war es schön."_ustr);
- assertXPath(pLayout, "/root/page[3]/body/txt[5]/SwParaPortion/SwLineLayout", "portion", u"Mein Urlaub war schön . "_ustr);
- assertXPath(pLayout, "/root/page[5]/body/section", 1);
- assertXPath(pLayout, "/root/page[5]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout", "portion", "In Paris war es erlebnisreich.");
- assertXPath(pLayout, "/root/page[5]/body/txt[5]/SwParaPortion/SwLineLayout", "portion", u"Mein Urlaub war erlebnisreich . "_ustr);
- assertXPath(pLayout, "/root/page[7]/body/section", 3);
- assertXPath(pLayout, "/root/page[7]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout", "portion", u"In den Bergen war es anstrengend."_ustr);
- assertXPath(pLayout, "/root/page[7]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout", "portion", u"In Barcelona war es schön."_ustr);
- assertXPath(pLayout, "/root/page[7]/body/section[3]/txt[1]/SwParaPortion/SwLineLayout", "portion", u"In Paris war es erlebnisreich."_ustr);
- assertXPath(pLayout, "/root/page[7]/body/txt[5]/SwParaPortion/SwLineLayout", "portion", u"Mein Urlaub war anstrengend schön erlebnisreich . "_ustr);
+ assertXPath(pLayout, "/root/page"_ostr, 7);
+ assertXPath(pLayout, "/root/page[1]/body/section"_ostr, 1);
+ assertXPath(pLayout, "/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout"_ostr, "portion"_ostr, u"In den Bergen war es anstrengend."_ustr);
+ assertXPath(pLayout, "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout"_ostr, "portion"_ostr, u"Mein Urlaub war anstrengend . "_ustr);
+ assertXPath(pLayout, "/root/page[3]/body/section"_ostr, 1);
+ assertXPath(pLayout, "/root/page[3]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout"_ostr, "portion"_ostr, u"In Barcelona war es schön."_ustr);
+ assertXPath(pLayout, "/root/page[3]/body/txt[5]/SwParaPortion/SwLineLayout"_ostr, "portion"_ostr, u"Mein Urlaub war schön . "_ustr);
+ assertXPath(pLayout, "/root/page[5]/body/section"_ostr, 1);
+ assertXPath(pLayout, "/root/page[5]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout"_ostr, "portion"_ostr, "In Paris war es erlebnisreich.");
+ assertXPath(pLayout, "/root/page[5]/body/txt[5]/SwParaPortion/SwLineLayout"_ostr, "portion"_ostr, u"Mein Urlaub war erlebnisreich . "_ustr);
+ assertXPath(pLayout, "/root/page[7]/body/section"_ostr, 3);
+ assertXPath(pLayout, "/root/page[7]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout"_ostr, "portion"_ostr, u"In den Bergen war es anstrengend."_ustr);
+ assertXPath(pLayout, "/root/page[7]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout"_ostr, "portion"_ostr, u"In Barcelona war es schön."_ustr);
+ assertXPath(pLayout, "/root/page[7]/body/section[3]/txt[1]/SwParaPortion/SwLineLayout"_ostr, "portion"_ostr, u"In Paris war es erlebnisreich."_ustr);
+ assertXPath(pLayout, "/root/page[7]/body/txt[5]/SwParaPortion/SwLineLayout"_ostr, "portion"_ostr, u"Mein Urlaub war anstrengend schön erlebnisreich . "_ustr);
}
DECLARE_SHELL_MAILMERGE_TEST_SELECTION(testTdf95292, "linked-labels.odt", "10-testing-addresses.ods", "testing-addresses", 5)
diff --git a/sw/qa/extras/mailmerge/mailmerge2.cxx b/sw/qa/extras/mailmerge/mailmerge2.cxx
index d91de2056042..c86ae9cc48fb 100644
--- a/sw/qa/extras/mailmerge/mailmerge2.cxx
+++ b/sw/qa/extras/mailmerge/mailmerge2.cxx
@@ -357,14 +357,14 @@ DECLARE_SHELL_MAILMERGE_TEST(testTd78611_shell, "tdf78611.odt", "10-testing-addr
// All header paragraphs should have numbering.
// check first page
- CPPUNIT_ASSERT_EQUAL( OUString("1"), parseDump("/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
- CPPUNIT_ASSERT_EQUAL( OUString("1.1"), parseDump("/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
- CPPUNIT_ASSERT_EQUAL( OUString("1.2"), parseDump("/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
+ CPPUNIT_ASSERT_EQUAL( OUString("1"), parseDump("/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr));
+ CPPUNIT_ASSERT_EQUAL( OUString("1.1"), parseDump("/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr));
+ CPPUNIT_ASSERT_EQUAL( OUString("1.2"), parseDump("/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr));
// check some other pages
- CPPUNIT_ASSERT_EQUAL( OUString("1"), parseDump("/root/page[3]/body/txt[6]/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
- CPPUNIT_ASSERT_EQUAL( OUString("1.1"), parseDump("/root/page[5]/body/txt[8]/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
- CPPUNIT_ASSERT_EQUAL( OUString("1.2"), parseDump("/root/page[7]/body/txt[10]/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
+ CPPUNIT_ASSERT_EQUAL( OUString("1"), parseDump("/root/page[3]/body/txt[6]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr));
+ CPPUNIT_ASSERT_EQUAL( OUString("1.1"), parseDump("/root/page[5]/body/txt[8]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr));
+ CPPUNIT_ASSERT_EQUAL( OUString("1.2"), parseDump("/root/page[7]/body/txt[10]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr));
}
@@ -374,9 +374,9 @@ DECLARE_FILE_MAILMERGE_TEST(testTd78611_file, "tdf78611.odt", "10-testing-addres
for (int doc = 0; doc < 10; ++doc)
{
loadMailMergeDocument( doc );
- CPPUNIT_ASSERT_EQUAL( OUString("1"), parseDump("/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
- CPPUNIT_ASSERT_EQUAL( OUString("1.1"), parseDump("/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
- CPPUNIT_ASSERT_EQUAL( OUString("1.2"), parseDump("/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
+ CPPUNIT_ASSERT_EQUAL( OUString("1"), parseDump("/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr));
+ CPPUNIT_ASSERT_EQUAL( OUString("1.1"), parseDump("/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr));
+ CPPUNIT_ASSERT_EQUAL( OUString("1.2"), parseDump("/root/page[1]/body/txt[10]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr));
}
}
@@ -582,11 +582,11 @@ DECLARE_SHELL_MAILMERGE_TEST(testTdf81750_shell, "tdf81750.odt", "10-testing-add
// check several pages page
OUString aExpected("Text: Foo ");
- CPPUNIT_ASSERT_EQUAL( aExpected, parseDump("/root/page[1]/body/txt[2]", ""));
- CPPUNIT_ASSERT_EQUAL( aExpected, parseDump("/root/page[3]/body/txt[2]", ""));
- CPPUNIT_ASSERT_EQUAL( aExpected, parseDump("/root/page[5]/body/txt[2]", ""));
- CPPUNIT_ASSERT_EQUAL( aExpected, parseDump("/root/page[7]/body/txt[2]", ""));
- CPPUNIT_ASSERT_EQUAL( aExpected, parseDump("/root/page[9]/body/txt[2]", ""));
+ CPPUNIT_ASSERT_EQUAL( aExpected, parseDump("/root/page[1]/body/txt[2]"_ostr, ""_ostr));
+ CPPUNIT_ASSERT_EQUAL( aExpected, parseDump("/root/page[3]/body/txt[2]"_ostr, ""_ostr));
+ CPPUNIT_ASSERT_EQUAL( aExpected, parseDump("/root/page[5]/body/txt[2]"_ostr, ""_ostr));
+ CPPUNIT_ASSERT_EQUAL( aExpected, parseDump("/root/page[7]/body/txt[2]"_ostr, ""_ostr));
+ CPPUNIT_ASSERT_EQUAL( aExpected, parseDump("/root/page[9]/body/txt[2]"_ostr, ""_ostr));
}
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 3bb0e585f6fc..c8ff08965f93 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -228,14 +228,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133487)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
// shape in background has lowest index
- assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[2]/draw:custom-shape", "z-index", "0");
- assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name = /office:document-content/office:body/office:text/text:p[2]/draw:custom-shape[@draw:z-index = '0']/attribute::draw:style-name]/style:graphic-properties", "run-through", "background");
+ assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[2]/draw:custom-shape"_ostr, "z-index"_ostr, "0");
+ assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name = /office:document-content/office:body/office:text/text:p[2]/draw:custom-shape[@draw:z-index = '0']/attribute::draw:style-name]/style:graphic-properties"_ostr, "run-through"_ostr, "background");
// shape in foreground, previously index 1
- assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[1]/draw:custom-shape", "z-index", "2");
- assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name = /office:document-content/office:body/office:text/text:p[1]/draw:custom-shape[@draw:z-index = '2']/attribute::draw:style-name]/style:graphic-properties", "run-through", "foreground");
+ assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[1]/draw:custom-shape"_ostr, "z-index"_ostr, "2");
+ assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name = /office:document-content/office:body/office:text/text:p[1]/draw:custom-shape[@draw:z-index = '2']/attribute::draw:style-name]/style:graphic-properties"_ostr, "run-through"_ostr, "foreground");
// shape in foreground, previously index 0
- assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[3]/draw:custom-shape", "z-index", "1");
- assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name = /office:document-content/office:body/office:text/text:p[3]/draw:custom-shape[@draw:z-index = '1']/attribute::draw:style-name]/style:graphic-properties", "run-through", "foreground");
+ assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[3]/draw:custom-shape"_ostr, "z-index"_ostr, "1");
+ assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name = /office:document-content/office:body/office:text/text:p[3]/draw:custom-shape[@draw:z-index = '1']/attribute::draw:style-name]/style:graphic-properties"_ostr, "run-through"_ostr, "foreground");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf141467)
@@ -245,12 +245,12 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf141467)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
// shape in foreground has lowest index
- assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[2]/draw:custom-shape", "z-index", "0");
- assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name = /office:document-content/office:body/office:text/text:p[2]/draw:custom-shape[@draw:z-index = '0']/attribute::draw:style-name]/style:graphic-properties", "run-through", "foreground");
+ assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[2]/draw:custom-shape"_ostr, "z-index"_ostr, "0");
+ assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name = /office:document-content/office:body/office:text/text:p[2]/draw:custom-shape[@draw:z-index = '0']/attribute::draw:style-name]/style:graphic-properties"_ostr, "run-through"_ostr, "foreground");
// form control, previously index 0
- assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[2]/draw:control", "z-index", "1");
+ assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[2]/draw:control"_ostr, "z-index"_ostr, "1");
// no run-through on form's style
- assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name = /office:document-content/office:body/office:text/text:p[2]/draw:control[@draw:z-index = '1']/attribute::draw:style-name]/style:graphic-properties/attribute::run-through", 0);
+ assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name = /office:document-content/office:body/office:text/text:p[2]/draw:control[@draw:z-index = '1']/attribute::draw:style-name]/style:graphic-properties/attribute::run-through"_ostr, 0);
}
DECLARE_ODFEXPORT_TEST(testTdf139126, "tdf139126.odt")
@@ -293,8 +293,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf150149)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
// This was 0 (lost table header in multi-column section)
- assertXPath(pXmlDoc, "//table:table-header-rows", 1);
- assertXPath(pXmlDoc, "//table:table-header-rows/table:table-row/table:table-cell", 3);
+ assertXPath(pXmlDoc, "//table:table-header-rows"_ostr, 1);
+ assertXPath(pXmlDoc, "//table:table-header-rows/table:table-row/table:table-cell"_ostr, 3);
}
DECLARE_ODFEXPORT_TEST(testTdf103567, "tdf103567.odt")
@@ -342,7 +342,7 @@ CPPUNIT_TEST_FIXTURE(Test, testUserFieldDecl)
// Without the accompanying fix in place, this test would have failed with 'Expected: 2;
// Actual: 1', i.e. the in-table field had no declaration (in the header), while the
// outside-table one had the declaration.
- assertXPath(pXmlDoc, "//style:header/text:user-field-decls/text:user-field-decl", 2);
+ assertXPath(pXmlDoc, "//style:header/text:user-field-decls/text:user-field-decl"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(Test, testUserFieldDeclFly)
@@ -354,7 +354,7 @@ CPPUNIT_TEST_FIXTURE(Test, testUserFieldDeclFly)
// Without the accompanying fix in place, this test would have failed with 'Expected: 2;
// Actual: 1', i.e. the in-textframe field had no declaration (in the header), while the
// outside-textframe one had the declaration.
- assertXPath(pXmlDoc, "//style:header/text:user-field-decls/text:user-field-decl", 2);
+ assertXPath(pXmlDoc, "//style:header/text:user-field-decls/text:user-field-decl"_ostr, 2);
}
DECLARE_ODFEXPORT_TEST(testFramebackgrounds, "framebackgrounds.odt")
@@ -477,12 +477,12 @@ DECLARE_ODFEXPORT_TEST(testFramebackgrounds, "framebackgrounds.odt")
{
xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
// check that there are 3 background-image elements
- assertXPath(pXmlDoc, "//style:style[@style:parent-style-name='Frame' and @style:family='graphic']/style:graphic-properties[@draw:fill='bitmap']/style:background-image[@style:repeat='stretch']", 3);
+ assertXPath(pXmlDoc, "//style:style[@style:parent-style-name='Frame' and @style:family='graphic']/style:graphic-properties[@draw:fill='bitmap']/style:background-image[@style:repeat='stretch']"_ostr, 3);
// tdf#90640: check that one of them is 55% opaque
- assertXPath(pXmlDoc, "//style:style[@style:parent-style-name='Frame' and @style:family='graphic']/style:graphic-properties[@draw:fill='bitmap' and @fo:background-color='transparent' and @draw:opacity='55%']/style:background-image[@style:repeat='stretch' and @draw:opacity='55%']", 1);
+ assertXPath(pXmlDoc, "//style:style[@style:parent-style-name='Frame' and @style:family='graphic']/style:graphic-properties[@draw:fill='bitmap' and @fo:background-color='transparent' and @draw:opacity='55%']/style:background-image[@style:repeat='stretch' and @draw:opacity='55%']"_ostr, 1);
// tdf#90640: check that one of them is 43% opaque
// (emulated - hopefully not with rounding errors)
- assertXPath(pXmlDoc, "//style:style[@style:parent-style-name='Frame' and @style:family='graphic']/style:graphic-properties[@draw:fill='bitmap' and @fo:background-color='transparent' and @draw:opacity-name='Transparency_20_1']/style:background-image[@style:repeat='stretch' and @draw:opacity='43%']", 1);
+ assertXPath(pXmlDoc, "//style:style[@style:parent-style-name='Frame' and @style:family='graphic']/style:graphic-properties[@draw:fill='bitmap' and @fo:background-color='transparent' and @draw:opacity-name='Transparency_20_1']/style:background-image[@style:repeat='stretch' and @draw:opacity='43%']"_ostr, 1);
}
}
@@ -682,8 +682,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf92379)
{
xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
// check that fo:background-color attribute is exported properly
- assertXPath(pXmlDoc, "//style:style[@style:family='graphic' and @style:name='encarts']/style:graphic-properties[@fo:background-color='#ffcc99']", 1);
- assertXPath(pXmlDoc, "//style:style[@style:family='graphic' and @style:name='Untitled1']/style:graphic-properties[@fo:background-color='transparent']", 1);
+ assertXPath(pXmlDoc, "//style:style[@style:family='graphic' and @style:name='encarts']/style:graphic-properties[@fo:background-color='#ffcc99']"_ostr, 1);
+ assertXPath(pXmlDoc, "//style:style[@style:family='graphic' and @style:name='Untitled1']/style:graphic-properties[@fo:background-color='transparent']"_ostr, 1);
}
// paragraph style fo:background-color was wrongly inherited despite being
@@ -731,10 +731,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf92379)
{
xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
// check that fo:background-color attribute is exported properly
- assertXPath(pXmlDoc, "//style:style[@style:family='paragraph' and @style:display-name='Titre Avis expert']/style:paragraph-properties[@fo:background-color='#661900']", 1);
- assertXPath(pXmlDoc, "//style:style[@style:family='paragraph' and @style:display-name='Avis expert questions']/style:paragraph-properties[@fo:background-color='transparent']", 1);
- assertXPath(pXmlDoc, "//style:style[@style:family='paragraph' and @style:display-name='avis expert questions non cadres']/style:paragraph-properties[@fo:background-color='#801900']", 1);
- assertXPath(pXmlDoc, "//style:style[@style:family='paragraph' and @style:display-name='Avis expert rXponses']/style:paragraph-properties[@fo:background-color='transparent']", 1);
+ assertXPath(pXmlDoc, "//style:style[@style:family='paragraph' and @style:display-name='Titre Avis expert']/style:paragraph-properties[@fo:background-color='#661900']"_ostr, 1);
+ assertXPath(pXmlDoc, "//style:style[@style:family='paragraph' and @style:display-name='Avis expert questions']/style:paragraph-properties[@fo:background-color='transparent']"_ostr, 1);
+ assertXPath(pXmlDoc, "//style:style[@style:family='paragraph' and @style:display-name='avis expert questions non cadres']/style:paragraph-properties[@fo:background-color='#801900']"_ostr, 1);
+ assertXPath(pXmlDoc, "//style:style[@style:family='paragraph' and @style:display-name='Avis expert rXponses']/style:paragraph-properties[@fo:background-color='transparent']"_ostr, 1);
}
}
@@ -764,18 +764,18 @@ DECLARE_ODFEXPORT_TEST(testFirstHeaderFooter, "first-header-footer.odt")
// Test import and export of the header-first token.
// The document has 6 pages, two page styles for the first and second half of pages.
- CPPUNIT_ASSERT_EQUAL(OUString("First header"), parseDump("/root/page[1]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("First footer"), parseDump("/root/page[1]/footer/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Left header"), parseDump("/root/page[2]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Left footer"), parseDump("/root/page[2]/footer/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Right header"), parseDump("/root/page[3]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Right footer"), parseDump("/root/page[3]/footer/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("First header2"), parseDump("/root/page[4]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("First footer2"), parseDump("/root/page[4]/footer/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Right header2"), parseDump("/root/page[5]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Right footer2"), parseDump("/root/page[5]/footer/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Left header2"), parseDump("/root/page[6]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Left footer2"), parseDump("/root/page[6]/footer/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("First header"), parseDump("/root/page[1]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("First footer"), parseDump("/root/page[1]/footer/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Left header"), parseDump("/root/page[2]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Left footer"), parseDump("/root/page[2]/footer/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Right header"), parseDump("/root/page[3]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Right footer"), parseDump("/root/page[3]/footer/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("First header2"), parseDump("/root/page[4]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("First footer2"), parseDump("/root/page[4]/footer/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Right header2"), parseDump("/root/page[5]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Right footer2"), parseDump("/root/page[5]/footer/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Left header2"), parseDump("/root/page[6]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Left footer2"), parseDump("/root/page[6]/footer/txt/text()"_ostr));
}
DECLARE_ODFEXPORT_TEST(testTextframeGradient, "textframe-gradient.odt")
@@ -1219,10 +1219,10 @@ CPPUNIT_TEST_FIXTURE(Test, testProtectionKey)
if (isExported())
{
xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
- assertXPath(pXmlDoc, "//text:section[@text:name='Section0' and @text:protected='true' and @text:protection-key='vbnhxyBKtPHCA1wB21zG1Oha8ZA=']");
- assertXPath(pXmlDoc, "//text:section[@text:name='Section1' and @text:protected='true' and @text:protection-key='nLHas0RIwepGDaH4c2hpyIUvIS8=']");
- assertXPath(pXmlDoc, "//text:section[@text:name='Section2' and @text:protected='true' and @text:protection-key-digest-algorithm='http://www.w3.org/2000/09/xmldsig#sha256' and @text:protection-key='1tnJohagR2T0yF/v69hLPuumSTsj32CumW97nkKGuSQ=']");
- assertXPath(pXmlDoc, "//text:section[@text:name='Section3' and @text:protected='true' and @text:protection-key-digest-algorithm='http://www.w3.org/2000/09/xmldsig#sha256' and @text:protection-key='1tnJohagR2T0yF/v69hLPuumSTsj32CumW97nkKGuSQ=']");
+ assertXPath(pXmlDoc, "//text:section[@text:name='Section0' and @text:protected='true' and @text:protection-key='vbnhxyBKtPHCA1wB21zG1Oha8ZA=']"_ostr);
+ assertXPath(pXmlDoc, "//text:section[@text:name='Section1' and @text:protected='true' and @text:protection-key='nLHas0RIwepGDaH4c2hpyIUvIS8=']"_ostr);
+ assertXPath(pXmlDoc, "//text:section[@text:name='Section2' and @text:protected='true' and @text:protection-key-digest-algorithm='http://www.w3.org/2000/09/xmldsig#sha256' and @text:protection-key='1tnJohagR2T0yF/v69hLPuumSTsj32CumW97nkKGuSQ=']"_ostr);
+ assertXPath(pXmlDoc, "//text:section[@text:name='Section3' and @text:protected='true' and @text:protection-key-digest-algorithm='http://www.w3.org/2000/09/xmldsig#sha256' and @text:protection-key='1tnJohagR2T0yF/v69hLPuumSTsj32CumW97nkKGuSQ=']"_ostr);
}
}
@@ -1348,7 +1348,7 @@ DECLARE_ODFEXPORT_TEST(testRelhPage, "relh-page.odt")
CPPUNIT_ASSERT_EQUAL(text::RelOrientation::FRAME, getProperty<sal_Int16>(xTextFrame, "RelativeWidthRelation"));
// This was 2601, 20% height was relative from margin, not page.
- CPPUNIT_ASSERT_EQUAL(sal_Int32(3168), parseDump("/root/page/body/txt/anchored/fly/infos/bounds", "height").toInt32());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(3168), parseDump("/root/page/body/txt/anchored/fly/infos/bounds"_ostr, "height"_ostr).toInt32());
}
DECLARE_ODFEXPORT_TEST(testRelhPageTdf80282, "relh-page-tdf80282.odt")
@@ -1356,8 +1356,8 @@ DECLARE_ODFEXPORT_TEST(testRelhPageTdf80282, "relh-page-tdf80282.odt")
CPPUNIT_ASSERT_EQUAL(1, getShapes());
CPPUNIT_ASSERT_EQUAL(1, getPages());
uno::Reference<drawing::XShape> xTextFrame = getShape(1);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Height", sal_Int32(8391), parseDump("//anchored/fly/infos/bounds", "height").toInt32());
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Width", sal_Int32(5953), parseDump("//anchored/fly/infos/bounds", "width").toInt32());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Height", sal_Int32(8391), parseDump("//anchored/fly/infos/bounds"_ostr, "height"_ostr).toInt32());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Width", sal_Int32(5953), parseDump("//anchored/fly/infos/bounds"_ostr, "width"_ostr).toInt32());
}
DECLARE_ODFEXPORT_TEST(testRelwPage, "relw-page.odt")
@@ -1371,7 +1371,7 @@ DECLARE_ODFEXPORT_TEST(testRelwPage, "relw-page.odt")
CPPUNIT_ASSERT_EQUAL(text::RelOrientation::FRAME, getProperty<sal_Int16>(xTextFrame, "RelativeHeightRelation"));
// This was 3762, 40% width was relative from margin, not page.
- CPPUNIT_ASSERT_EQUAL(sal_Int32(4896), parseDump("/root/page/body/txt/anchored/fly/infos/bounds", "width").toInt32());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(4896), parseDump("/root/page/body/txt/anchored/fly/infos/bounds"_ostr, "width"_ostr).toInt32());
}
DECLARE_ODFEXPORT_TEST(testTextFrameVertAdjust, "textframe-vertadjust.odt")
@@ -1435,7 +1435,7 @@ DECLARE_ODFEXPORT_TEST(testTextboxRoundedCorners, "textbox-rounded-corners.odt")
{
xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
// This failed, as draw:custom-shape had a table:table child.
- assertXPath(pXmlDoc, "//draw:custom-shape/loext:table", "name", "Table1");
+ assertXPath(pXmlDoc, "//draw:custom-shape/loext:table"_ostr, "name"_ostr, "Table1");
}
}
@@ -1771,11 +1771,11 @@ DECLARE_ODFEXPORT_TEST(testTdf136645, "tdf136645.odt")
// Without the fix in place, this would have failed with
//- Expected: 2640
//- Actual : 3000
- CPPUNIT_ASSERT_EQUAL(sal_Int32(2640), parseDump("/root/page/body/section/column[1]/body/infos/bounds", "width").toInt32());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2640), parseDump("/root/page/body/section/column[1]/body/infos/bounds"_ostr, "width"_ostr).toInt32());
//- Expected: 6000
//- Actual : 6360
- CPPUNIT_ASSERT_EQUAL(sal_Int32(6000), parseDump("/root/page/body/section/column[2]/body/infos/bounds", "width").toInt32());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(6000), parseDump("/root/page/body/section/column[2]/body/infos/bounds"_ostr, "width"_ostr).toInt32());
}
DECLARE_ODFEXPORT_TEST(testBtlrCell, "btlr-cell.odt")
@@ -1886,33 +1886,33 @@ DECLARE_ODFEXPORT_TEST(testTdf118393, "tdf118393.odt")
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// check first page
- assertXPath(pXmlDoc, "/root/page[1]/header", 0);
- assertXPath(pXmlDoc, "/root/page[1]/footer", 0);
+ assertXPath(pXmlDoc, "/root/page[1]/header"_ostr, 0);
+ assertXPath(pXmlDoc, "/root/page[1]/footer"_ostr, 0);
// check second page in the same way
- assertXPath(pXmlDoc, "/root/page[2]/header");
- assertXPath(pXmlDoc, "/root/page[2]/footer");
+ assertXPath(pXmlDoc, "/root/page[2]/header"_ostr);
+ assertXPath(pXmlDoc, "/root/page[2]/footer"_ostr);
}
// All other pages should have header/footer
- CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[2]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[2]/footer/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[2]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[2]/footer/txt/text()"_ostr));
- CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[3]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[3]/footer/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[3]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[3]/footer/txt/text()"_ostr));
- CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[4]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[4]/footer/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[4]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[4]/footer/txt/text()"_ostr));
- CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[5]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[5]/footer/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[5]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[5]/footer/txt/text()"_ostr));
- CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[6]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[6]/footer/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[6]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[6]/footer/txt/text()"_ostr));
- CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[7]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[7]/footer/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[7]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[7]/footer/txt/text()"_ostr));
}
DECLARE_ODFEXPORT_TEST(testTdf135338_firstLeftPageFooter, "tdf135338_firstLeftPageFooter.odt")
@@ -1920,7 +1920,7 @@ DECLARE_ODFEXPORT_TEST(testTdf135338_firstLeftPageFooter, "tdf135338_firstLeftPa
CPPUNIT_ASSERT_EQUAL(6, getPages());
// The first page is a left page only style, but it should still show the first page footer
// instead of the left footer text "EVEN/LEFT (Left page only)"
- CPPUNIT_ASSERT_EQUAL(OUString("First (Left page only)"), parseDump("/root/page[2]/footer/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("First (Left page only)"), parseDump("/root/page[2]/footer/txt/text()"_ostr));
}
DECLARE_ODFEXPORT_TEST(testGerrit13858, "gerrit13858.odt")
@@ -1984,53 +1984,53 @@ CPPUNIT_TEST_FIXTURE(Test, testPageStyleBackgroundFullSizeOOo)
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "background-size", "border");
+ "]/style:drawing-page-properties"_ostr, "background-size"_ostr, "border");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill", "solid");
+ "]/style:drawing-page-properties"_ostr, "fill"_ostr, "solid");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill-color", "#99ccff");
+ "]/style:drawing-page-properties"_ostr, "fill-color"_ostr, "#99ccff");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "opacity", "100%");
+ "]/style:drawing-page-properties"_ostr, "opacity"_ostr, "100%");
// Endnote
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "background-size", "border");
+ "]/style:drawing-page-properties"_ostr, "background-size"_ostr, "border");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill", "bitmap");
+ "]/style:drawing-page-properties"_ostr, "fill"_ostr, "bitmap");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "repeat", "repeat");
+ "]/style:drawing-page-properties"_ostr, "repeat"_ostr, "repeat");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill-image-ref-point", "top-left");
+ "]/style:drawing-page-properties"_ostr, "fill-image-ref-point"_ostr, "top-left");
// Footnote
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "background-size", "border");
+ "]/style:drawing-page-properties"_ostr, "background-size"_ostr, "border");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill", "bitmap");
+ "]/style:drawing-page-properties"_ostr, "fill"_ostr, "bitmap");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "repeat", "stretch");
+ "]/style:drawing-page-properties"_ostr, "repeat"_ostr, "stretch");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill-image-ref-point", "top-left");
+ "]/style:drawing-page-properties"_ostr, "fill-image-ref-point"_ostr, "top-left");
}
CPPUNIT_TEST_FIXTURE(Test, testPageStyleBackgroundFullSizeLO64)
@@ -2042,104 +2042,104 @@ CPPUNIT_TEST_FIXTURE(Test, testPageStyleBackgroundFullSizeLO64)
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "background-size", "full");
+ "]/style:drawing-page-properties"_ostr, "background-size"_ostr, "full");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill", "solid");
+ "]/style:drawing-page-properties"_ostr, "fill"_ostr, "solid");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill-color", "#99ccff");
+ "]/style:drawing-page-properties"_ostr, "fill-color"_ostr, "#99ccff");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "opacity", "100%");
+ "]/style:drawing-page-properties"_ostr, "opacity"_ostr, "100%");
// Endnote
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "background-size", "full");
+ "]/style:drawing-page-properties"_ostr, "background-size"_ostr, "full");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill", "bitmap");
+ "]/style:drawing-page-properties"_ostr, "fill"_ostr, "bitmap");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "repeat", "repeat");
+ "]/style:drawing-page-properties"_ostr, "repeat"_ostr, "repeat");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill-image-ref-point", "top-left");
+ "]/style:drawing-page-properties"_ostr, "fill-image-ref-point"_ostr, "top-left");
// Footnote
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "background-size", "border");
+ "]/style:drawing-page-properties"_ostr, "background-size"_ostr, "border");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill", "bitmap");
+ "]/style:drawing-page-properties"_ostr, "fill"_ostr, "bitmap");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "repeat", "stretch");
+ "]/style:drawing-page-properties"_ostr, "repeat"_ostr, "stretch");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill-image-ref-point", "top-left");
+ "]/style:drawing-page-properties"_ostr, "fill-image-ref-point"_ostr, "top-left");
// Landscape
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Landscape']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "background-size", "border");
+ "]/style:drawing-page-properties"_ostr, "background-size"_ostr, "border");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Landscape']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill", "bitmap");
+ "]/style:drawing-page-properties"_ostr, "fill"_ostr, "bitmap");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Landscape']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "repeat", "no-repeat");
+ "]/style:drawing-page-properties"_ostr, "repeat"_ostr, "no-repeat");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Landscape']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill-image-ref-point", "top-left");
+ "]/style:drawing-page-properties"_ostr, "fill-image-ref-point"_ostr, "top-left");
// Index
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Index']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "background-size", "full");
+ "]/style:drawing-page-properties"_ostr, "background-size"_ostr, "full");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Index']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill", "gradient");
+ "]/style:drawing-page-properties"_ostr, "fill"_ostr, "gradient");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Index']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "gradient-step-count", "0");
+ "]/style:drawing-page-properties"_ostr, "gradient-step-count"_ostr, "0");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Index']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "opacity", "100%");
+ "]/style:drawing-page-properties"_ostr, "opacity"_ostr, "100%");
// First Page
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='First_20_Page']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "background-size", "full");
+ "]/style:drawing-page-properties"_ostr, "background-size"_ostr, "full");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='First_20_Page']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill", "hatch");
+ "]/style:drawing-page-properties"_ostr, "fill"_ostr, "hatch");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='First_20_Page']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill-hatch-solid", "false");
+ "]/style:drawing-page-properties"_ostr, "fill-hatch-solid"_ostr, "false");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='First_20_Page']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "opacity", "100%");
+ "]/style:drawing-page-properties"_ostr, "opacity"_ostr, "100%");
}
CPPUNIT_TEST_FIXTURE(Test, testPageStyleBackgroundFullSizeLO70)
@@ -2151,104 +2151,104 @@ CPPUNIT_TEST_FIXTURE(Test, testPageStyleBackgroundFullSizeLO70)
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "background-size", "full");
+ "]/style:drawing-page-properties"_ostr, "background-size"_ostr, "full");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill", "solid");
+ "]/style:drawing-page-properties"_ostr, "fill"_ostr, "solid");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill-color", "#99ccff");
+ "]/style:drawing-page-properties"_ostr, "fill-color"_ostr, "#99ccff");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Standard']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "opacity", "100%");
+ "]/style:drawing-page-properties"_ostr, "opacity"_ostr, "100%");
// Endnote
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "background-size", "full");
+ "]/style:drawing-page-properties"_ostr, "background-size"_ostr, "full");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill", "bitmap");
+ "]/style:drawing-page-properties"_ostr, "fill"_ostr, "bitmap");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "repeat", "repeat");
+ "]/style:drawing-page-properties"_ostr, "repeat"_ostr, "repeat");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Endnote']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill-image-ref-point", "top-left");
+ "]/style:drawing-page-properties"_ostr, "fill-image-ref-point"_ostr, "top-left");
// Footnote
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "background-size", "border");
+ "]/style:drawing-page-properties"_ostr, "background-size"_ostr, "border");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill", "bitmap");
+ "]/style:drawing-page-properties"_ostr, "fill"_ostr, "bitmap");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "repeat", "stretch");
+ "]/style:drawing-page-properties"_ostr, "repeat"_ostr, "stretch");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Footnote']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill-image-ref-point", "top-left");
+ "]/style:drawing-page-properties"_ostr, "fill-image-ref-point"_ostr, "top-left");
// Landscape
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Landscape']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "background-size", "border");
+ "]/style:drawing-page-properties"_ostr, "background-size"_ostr, "border");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Landscape']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill", "bitmap");
+ "]/style:drawing-page-properties"_ostr, "fill"_ostr, "bitmap");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Landscape']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "repeat", "no-repeat");
+ "]/style:drawing-page-properties"_ostr, "repeat"_ostr, "no-repeat");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Landscape']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill-image-ref-point", "top-left");
+ "]/style:drawing-page-properties"_ostr, "fill-image-ref-point"_ostr, "top-left");
// Index
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Index']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "background-size", "full");
+ "]/style:drawing-page-properties"_ostr, "background-size"_ostr, "full");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Index']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill", "gradient");
+ "]/style:drawing-page-properties"_ostr, "fill"_ostr, "gradient");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Index']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "gradient-step-count", "0");
+ "]/style:drawing-page-properties"_ostr, "gradient-step-count"_ostr, "0");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='Index']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "opacity", "100%");
+ "]/style:drawing-page-properties"_ostr, "opacity"_ostr, "100%");
// First Page
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='First_20_Page']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "background-size", "full");
+ "]/style:drawing-page-properties"_ostr, "background-size"_ostr, "full");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='First_20_Page']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill", "hatch");
+ "]/style:drawing-page-properties"_ostr, "fill"_ostr, "hatch");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='First_20_Page']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "fill-hatch-solid", "false");
+ "]/style:drawing-page-properties"_ostr, "fill-hatch-solid"_ostr, "false");
assertXPath(pXmlDoc,
"/office:document-styles/office:automatic-styles/style:style[@style:family='drawing-page' and @style:name = "
"/office:document-styles/office:master-styles/style:master-page[@style:name='First_20_Page']/attribute::draw:style-name"
- "]/style:drawing-page-properties", "opacity", "100%");
+ "]/style:drawing-page-properties"_ostr, "opacity"_ostr, "100%");
}
CPPUNIT_TEST_FIXTURE(Test, testFillBitmapUnused)
@@ -2261,56 +2261,56 @@ CPPUNIT_TEST_FIXTURE(Test, testFillBitmapUnused)
// paragraph style
assertXPath(pXmlDoc,
- "/office:document-styles/office:styles/style:style[@style:name='Text_20_body']/loext:graphic-properties", "fill", "solid");
+ "/office:document-styles/office:styles/style:style[@style:name='Text_20_body']/loext:graphic-properties"_ostr, "fill"_ostr, "solid");
assertXPath(pXmlDoc,
- "/office:document-styles/office:styles/style:style[@style:name='Text_20_body']/loext:graphic-properties", "fill-color", "#c0c0c0");
+ "/office:document-styles/office:styles/style:style[@style:name='Text_20_body']/loext:graphic-properties"_ostr, "fill-color"_ostr, "#c0c0c0");
assertXPath(pXmlDoc,
- "/office:document-styles/office:styles/style:style[@style:name='Text_20_body']/loext:graphic-properties[@draw:fill-image-name]", 0);
+ "/office:document-styles/office:styles/style:style[@style:name='Text_20_body']/loext:graphic-properties[@draw:fill-image-name]"_ostr, 0);
// page style page-layout
assertXPath(pXmlDoc,
- "/office:document-styles/office:automatic-styles/style:page-layout[@style:name='Mpm1']/style:page-layout-properties", "fill", "bitmap");
+ "/office:document-styles/office:automatic-styles/style:page-layout[@style:name='Mpm1']/style:page-layout-properties"_ostr, "fill"_ostr, "bitmap");
assertXPath(pXmlDoc,
- "/office:document-styles/office:automatic-styles/style:page-layout[@style:name='Mpm1']/style:page-layout-properties", "fill-image-name", "nav_5f_up");
+ "/office:document-styles/office:automatic-styles/style:page-layout[@style:name='Mpm1']/style:page-layout-properties"_ostr, "fill-image-name"_ostr, "nav_5f_up");
assertXPath(pXmlDoc,
- "/office:document-styles/office:automatic-styles/style:page-layout[@style:name='Mpm1']/style:header-style/style:header-footer-properties", "fill", "bitmap");
+ "/office:document-styles/office:automatic-styles/style:page-layout[@style:name='Mpm1']/style:header-style/style:header-footer-properties"_ostr, "fill"_ostr, "bitmap");
assertXPath(pXmlDoc,
- "/office:document-styles/office:automatic-styles/style:page-layout[@style:name='Mpm1']/style:header-style/style:header-footer-properties", "fill-image-name", "nav_5f_up");
+ "/office:document-styles/office:automatic-styles/style:page-layout[@style:name='Mpm1']/style:header-style/style:header-footer-properties"_ostr, "fill-image-name"_ostr, "nav_5f_up");
assertXPath(pXmlDoc,
- "/office:document-styles/office:automatic-styles/style:page-layout[@style:name='Mpm1']/style:footer-style/style:header-footer-properties", "fill", "bitmap");
+ "/office:document-styles/office:automatic-styles/style:page-layout[@style:name='Mpm1']/style:footer-style/style:header-footer-properties"_ostr, "fill"_ostr, "bitmap");
assertXPath(pXmlDoc,
- "/office:document-styles/office:automatic-styles/style:page-layout[@style:name='Mpm1']/style:footer-style/style:header-footer-properties", "fill-image-name", "nav_5f_up");
+ "/office:document-styles/office:automatic-styles/style:page-layout[@style:name='Mpm1']/style:footer-style/style:header-footer-properties"_ostr, "fill-image-name"_ostr, "nav_5f_up");
assertXPath(pXmlDoc,
- "/office:document-styles/office:automatic-styles/style:page-layout[@style:name='Mpm2']/style:page-layout-properties", "fill", "solid");
+ "/office:document-styles/office:automatic-styles/style:page-layout[@style:name='Mpm2']/style:page-layout-properties"_ostr, "fill"_ostr, "solid");
assertXPath(pXmlDoc,
- "/office:document-styles/office:automatic-styles/style:page-layout[@style:name='Mpm2']/style:page-layout-properties[@draw:fill-image-name]", 0);
+ "/office:document-styles/office:automatic-styles/style:page-layout[@style:name='Mpm2']/style:page-layout-properties[@draw:fill-image-name]"_ostr, 0);
assertXPath(pXmlDoc,
- "/office:document-styles/office:automatic-styles/style:page-layout[@style:name='Mpm2']/style:header-style/style:header-footer-properties", "fill", "solid");
+ "/office:document-styles/office:automatic-styles/style:page-layout[@style:name='Mpm2']/style:header-style/style:header-footer-properties"_ostr, "fill"_ostr, "solid");
assertXPath(pXmlDoc,
- "/office:document-styles/office:automatic-styles/style:page-layout[@style:name='Mpm2']/style:header-style/style:header-footer-properties[@draw:fill-image-name]", 0);
+ "/office:document-styles/office:automatic-styles/style:page-layout[@style:name='Mpm2']/style:header-style/style:header-footer-properties[@draw:fill-image-name]"_ostr, 0);
assertXPath(pXmlDoc,
- "/office:document-styles/office:automatic-styles/style:page-layout[@style:name='Mpm2']/style:footer-style/style:header-footer-properties", "fill", "solid");
+ "/office:document-styles/office:automatic-styles/style:page-layout[@style:name='Mpm2']/style:footer-style/style:header-footer-properties"_ostr, "fill"_ostr, "solid");
assertXPath(pXmlDoc,
- "/office:document-styles/office:automatic-styles/style:page-layout[@style:name='Mpm2']/style:footer-style/style:header-footer-properties[@draw:fill-image-name]", 0);
+ "/office:document-styles/office:automatic-styles/style:page-layout[@style:name='Mpm2']/style:footer-style/style:header-footer-properties[@draw:fill-image-name]"_ostr, 0);
// page style drawing-page
assertXPath(pXmlDoc,
- "/office:document-styles/office:automatic-styles/style:style[@style:name='Mdp1']/style:drawing-page-properties", "fill", "bitmap");
+ "/office:document-styles/office:automatic-styles/style:style[@style:name='Mdp1']/style:drawing-page-properties"_ostr, "fill"_ostr, "bitmap");
assertXPath(pXmlDoc,
- "/office:document-styles/office:automatic-styles/style:style[@style:name='Mdp1']/style:drawing-page-properties", "fill-image-name", "nav_5f_up");
+ "/office:document-styles/office:automatic-styles/style:style[@style:name='Mdp1']/style:drawing-page-properties"_ostr, "fill-image-name"_ostr, "nav_5f_up");
assertXPath(pXmlDoc,
- "/office:document-styles/office:automatic-styles/style:style[@style:name='Mdp2']/style:drawing-page-properties", "fill", "solid");
+ "/office:document-styles/office:automatic-styles/style:style[@style:name='Mdp2']/style:drawing-page-properties"_ostr, "fill"_ostr, "solid");
assertXPath(pXmlDoc,
- "/office:document-styles/office:automatic-styles/style:style[@style:name='Mdp2']/style:drawing-page-properties", "fill-color", "#c0c0c0");
+ "/office:document-styles/office:automatic-styles/style:style[@style:name='Mdp2']/style:drawing-page-properties"_ostr, "fill-color"_ostr, "#c0c0c0");
assertXPath(pXmlDoc,
- "/office:document-styles/office:automatic-styles/style:style[@style:name='Mdp2']/style:drawing-page-properties[@draw:fill-image-name]", 0);
+ "/office:document-styles/office:automatic-styles/style:style[@style:name='Mdp2']/style:drawing-page-properties[@draw:fill-image-name]"_ostr, 0);
// the named items
assertXPath(pXmlDoc,
- "/office:document-styles/office:styles/draw:fill-image", 1);
+ "/office:document-styles/office:styles/draw:fill-image"_ostr, 1);
assertXPath(pXmlDoc,
- "/office:document-styles/office:styles/draw:fill-image", "name", "nav_5f_up");
+ "/office:document-styles/office:styles/draw:fill-image"_ostr, "name"_ostr, "nav_5f_up");
}
DECLARE_ODFEXPORT_TEST(testCellUserDefineAttr, "userdefattr-tablecell.odt")
@@ -2616,55 +2616,55 @@ CPPUNIT_TEST_FIXTURE(Test, testTableStyles3)
// <style:paragraph-properties>
// For this element the only exported attributes are: "border-left", "border-bottom"
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:table-cell-properties", "background-color");
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:table-cell-properties"_ostr, "background-color"_ostr);
// border-left place
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:table-cell-properties", "border-right");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:table-cell-properties", "border-top");
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:table-cell-properties"_ostr, "border-right"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:table-cell-properties"_ostr, "border-top"_ostr);
// border-bottom place
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:table-cell-properties", "padding");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:table-cell-properties", "padding-left");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:table-cell-properties", "padding-right");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:table-cell-properties", "padding-top");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:table-cell-properties", "padding-bottom");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:table-cell-properties", "writing-mode");
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:table-cell-properties"_ostr, "padding"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:table-cell-properties"_ostr, "padding-left"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:table-cell-properties"_ostr, "padding-right"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:table-cell-properties"_ostr, "padding-top"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:table-cell-properties"_ostr, "padding-bottom"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:table-cell-properties"_ostr, "writing-mode"_ostr);
// <style:paragraph-properties> should be absent, because it has only "text-align" attribute, which shouldn't be exported.
// Assume that style:paragraph-properties and style:text-properties exists.
- assertXPathChildren(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']", 2);
+ assertXPathChildren(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']"_ostr, 2);
// <style:text-properties>
// For this element the only exported attributes are: "use-window-font-color place", "font-size-asian", "font-name-asian", "font-family-asian", "font-name-complex", "font-family-complex"
// use-window-font-color place
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties", "text-shadow");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties", "text-outline");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties", "text-line-through-style");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties", "text-line-through-type");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties", "text-underline-style");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties", "text-underline-color");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties", "font-size");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties", "font-weight");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties", "font-style");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties", "font-name");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties", "font-family");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties", "font-style-name");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties", "font-family-generic");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties", "font-pitch");
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties"_ostr, "text-shadow"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties"_ostr, "text-outline"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties"_ostr, "text-line-through-style"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties"_ostr, "text-line-through-type"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties"_ostr, "text-underline-style"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties"_ostr, "text-underline-color"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties"_ostr, "font-size"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties"_ostr, "font-weight"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties"_ostr, "font-style"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties"_ostr, "font-name"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties"_ostr, "font-family"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties"_ostr, "font-style-name"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties"_ostr, "font-family-generic"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties"_ostr, "font-pitch"_ostr);
// font-size-asian place
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties", "font-weight-asian");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties", "font-style-asian");
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties"_ostr, "font-weight-asian"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties"_ostr, "font-style-asian"_ostr);
// font-name-asian place
// font-family-asian place
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties", "font-style-name-asian");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties", "font-family-generic-asian");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties", "font-pitch-asian");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties", "font-size-complex");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties", "font-weight-complex");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties", "font-style-complex");
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties"_ostr, "font-style-name-asian"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties"_ostr, "font-family-generic-asian"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties"_ostr, "font-pitch-asian"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties"_ostr, "font-size-complex"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties"_ostr, "font-weight-complex"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties"_ostr, "font-style-complex"_ostr);
// font-name-complex place
// font-family-complex place
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties", "font-style-name-complex");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties", "font-family-generic-complex");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties", "font-pitch-complex");
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties"_ostr, "font-style-name-complex"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties"_ostr, "font-family-generic-complex"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style3.2']/style:text-properties"_ostr, "font-pitch-complex"_ostr);
}
@@ -2689,22 +2689,22 @@ CPPUNIT_TEST_FIXTURE(Test, testTableStyles5)
// Test if cell styles doesn't have a style:parent-style-name attribute.
xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.1']", "parent-style-name");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.2']", "parent-style-name");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.3']", "parent-style-name");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.4']", "parent-style-name");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.5']", "parent-style-name");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.6']", "parent-style-name");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.7']", "parent-style-name");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.8']", "parent-style-name");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.9']", "parent-style-name");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.10']", "parent-style-name");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.11']", "parent-style-name");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.12']", "parent-style-name");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.13']", "parent-style-name");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.14']", "parent-style-name");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.15']", "parent-style-name");
- assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.16']", "parent-style-name");
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.1']"_ostr, "parent-style-name"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.2']"_ostr, "parent-style-name"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.3']"_ostr, "parent-style-name"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.4']"_ostr, "parent-style-name"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.5']"_ostr, "parent-style-name"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.6']"_ostr, "parent-style-name"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.7']"_ostr, "parent-style-name"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.8']"_ostr, "parent-style-name"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.9']"_ostr, "parent-style-name"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.10']"_ostr, "parent-style-name"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.11']"_ostr, "parent-style-name"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.12']"_ostr, "parent-style-name"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.13']"_ostr, "parent-style-name"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.14']"_ostr, "parent-style-name"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.15']"_ostr, "parent-style-name"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-styles/office:styles/style:style[@style:display-name='Test style.16']"_ostr, "parent-style-name"_ostr);
}
@@ -2714,10 +2714,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf145226)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
- assertXPathNoAttribute(pXmlDoc, "/office:document-content/office:body/office:text/table:table/table:table-row[1]", "style-name");
- assertXPathNoAttribute(pXmlDoc, "/office:document-content/office:body/office:text/table:table/table:table-row[2]", "style-name");
- assertXPathNoAttribute(pXmlDoc, "/office:document-content/office:body/office:text/table:table/table:table-row[3]", "style-name");
- assertXPathNoAttribute(pXmlDoc, "/office:document-content/office:body/office:text/table:table/table:table-row[4]", "style-name");
+ assertXPathNoAttribute(pXmlDoc, "/office:document-content/office:body/office:text/table:table/table:table-row[1]"_ostr, "style-name"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-content/office:body/office:text/table:table/table:table-row[2]"_ostr, "style-name"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-content/office:body/office:text/table:table/table:table-row[3]"_ostr, "style-name"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/office:document-content/office:body/office:text/table:table/table:table-row[4]"_ostr, "style-name"_ostr);
}
DECLARE_ODFEXPORT_TEST(testTdf101710, "tdf101710.odt")
@@ -2761,7 +2761,7 @@ CPPUNIT_TEST_FIXTURE(Test, testImageMimetype)
// Test that the loext:mimetype attribute is written for exported images, tdf#109202
xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
// Original image (svg)
- assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p/draw:frame/draw:image[@draw:mime-type='image/svg+xml']");
+ assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p/draw:frame/draw:image[@draw:mime-type='image/svg+xml']"_ostr);
}
diff --git a/sw/qa/extras/odfexport/odfexport2.cxx b/sw/qa/extras/odfexport/odfexport2.cxx
index 3a24f2896b5e..6db396c40dee 100644
--- a/sw/qa/extras/odfexport/odfexport2.cxx
+++ b/sw/qa/extras/odfexport/odfexport2.cxx
@@ -49,14 +49,14 @@ CPPUNIT_TEST_FIXTURE(Test, testEmbeddedFontProps)
// Test file is a normal ODT, except EmbedFonts is set to true in settings.xml.
xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
// These failed, the attributes were missing.
- assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[1]", "font-style", "normal");
- assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[1]", "font-weight", "normal");
- assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[2]", "font-style", "normal");
- assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[2]", "font-weight", "bold");
- assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[3]", "font-style", "italic");
- assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[3]", "font-weight", "normal");
- assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[4]", "font-style", "italic");
- assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[4]", "font-weight", "bold");
+ assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[1]"_ostr, "font-style"_ostr, "normal");
+ assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[1]"_ostr, "font-weight"_ostr, "normal");
+ assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[2]"_ostr, "font-style"_ostr, "normal");
+ assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[2]"_ostr, "font-weight"_ostr, "bold");
+ assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[3]"_ostr, "font-style"_ostr, "italic");
+ assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[3]"_ostr, "font-weight"_ostr, "normal");
+ assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[4]"_ostr, "font-style"_ostr, "italic");
+ assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation Serif']/svg:font-face-src/svg:font-face-uri[4]"_ostr, "font-weight"_ostr, "bold");
#endif
}
@@ -142,8 +142,8 @@ CPPUNIT_TEST_FIXTURE(Test, testRubyPosition)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
- assertXPath(pXmlDoc, "//style:style[@style:family='ruby']/style:ruby-properties[@loext:ruby-position='inter-character']", 1);
- assertXPath(pXmlDoc, "//style:style[@style:family='ruby']/style:ruby-properties[@style:ruby-position='below']", 1);
+ assertXPath(pXmlDoc, "//style:style[@style:family='ruby']/style:ruby-properties[@loext:ruby-position='inter-character']"_ostr, 1);
+ assertXPath(pXmlDoc, "//style:style[@style:family='ruby']/style:ruby-properties[@style:ruby-position='below']"_ostr, 1);
}
DECLARE_ODFEXPORT_TEST(testAllowOverlap, "allow-overlap.odt")
@@ -337,12 +337,12 @@ CPPUNIT_TEST_FIXTURE(Test, tdf99631)
loadAndReload("tdf99631.docx");
// check import of VisualArea settings of the embedded XLSX OLE objects
xmlDocUniquePtr pXmlDoc = parseExport("Object 1/settings.xml");
- assertXPathContent(pXmlDoc, "//config:config-item[@config:name='VisibleAreaWidth']", "4516");
- assertXPathContent(pXmlDoc, "//config:config-item[@config:name='VisibleAreaHeight']", "903");
+ assertXPathContent(pXmlDoc, "//config:config-item[@config:name='VisibleAreaWidth']"_ostr, "4516");
+ assertXPathContent(pXmlDoc, "//config:config-item[@config:name='VisibleAreaHeight']"_ostr, "903");
xmlDocUniquePtr pXmlDoc2 = parseExport("Object 2/settings.xml");
- assertXPathContent(pXmlDoc2, "//config:config-item[@config:name='VisibleAreaWidth']", "4516");
- assertXPathContent(pXmlDoc2, "//config:config-item[@config:name='VisibleAreaHeight']", "1355");
+ assertXPathContent(pXmlDoc2, "//config:config-item[@config:name='VisibleAreaWidth']"_ostr, "4516");
+ assertXPathContent(pXmlDoc2, "//config:config-item[@config:name='VisibleAreaHeight']"_ostr, "1355");
}
CPPUNIT_TEST_FIXTURE(Test, tdf145871)
@@ -511,10 +511,10 @@ CPPUNIT_TEST_FIXTURE(Test, tdf124470)
xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
- assertXPath(pXmlDoc, "/office:document-content/office:font-face-decls/style:style", 0);
- assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:family='table']", 1);
- assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:family='table-column']", 2);
- assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:family='paragraph']", 1);
+ assertXPath(pXmlDoc, "/office:document-content/office:font-face-decls/style:style"_ostr, 0);
+ assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:family='table']"_ostr, 1);
+ assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:family='table-column']"_ostr, 2);
+ assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:family='paragraph']"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, tdf135942)
@@ -526,7 +526,7 @@ CPPUNIT_TEST_FIXTURE(Test, tdf135942)
xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
- assertXPath(pXmlDoc, "/office:document-styles/office:automatic-styles/style:style[@style:family='table']", 2);
+ assertXPath(pXmlDoc, "/office:document-styles/office:automatic-styles/style:style[@style:family='table']"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(Test, tdf150927)
@@ -540,7 +540,7 @@ CPPUNIT_TEST_FIXTURE(Test, tdf150927)
xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
- assertXPath(pXmlDoc, "/office:document-styles/office:automatic-styles/style:style[@style:family='table']", 2);
+ assertXPath(pXmlDoc, "/office:document-styles/office:automatic-styles/style:style[@style:family='table']"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(Test, tdf151100)
@@ -554,7 +554,7 @@ CPPUNIT_TEST_FIXTURE(Test, tdf151100)
xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
- assertXPath(pXmlDoc, "/office:document-styles/office:automatic-styles/style:style[@style:family='table']", 1);
+ assertXPath(pXmlDoc, "/office:document-styles/office:automatic-styles/style:style[@style:family='table']"_ostr, 1);
}
DECLARE_ODFEXPORT_TEST(testGutterLeft, "gutter-left.odt")
@@ -574,11 +574,11 @@ DECLARE_ODFEXPORT_TEST(testGutterLeft, "gutter-left.odt")
DECLARE_ODFEXPORT_TEST(testTdf52065_centerTabs, "testTdf52065_centerTabs.odt")
{
CPPUNIT_ASSERT_EQUAL(1, getPages());
- sal_Int32 nTabStop = parseDump("//body/txt[4]/SwParaPortion/SwLineLayout/child::*[3]", "width").toInt32();
+ sal_Int32 nTabStop = parseDump("//body/txt[4]/SwParaPortion/SwLineLayout/child::*[3]"_ostr, "width"_ostr).toInt32();
// Without the fix, the text was unseen, with a tabstop width of 64057. It should be 3057
CPPUNIT_ASSERT(nTabStop < 4000);
CPPUNIT_ASSERT(3000 < nTabStop);
- CPPUNIT_ASSERT_EQUAL(u"Pečiatka zamestnávateľa"_ustr, parseDump("//body/txt[4]/SwParaPortion/SwLineLayout/child::*[4]", "portion"));
+ CPPUNIT_ASSERT_EQUAL(u"Pečiatka zamestnávateľa"_ustr, parseDump("//body/txt[4]/SwParaPortion/SwLineLayout/child::*[4]"_ostr, "portion"_ostr));
// tdf#149547: __XXX___invalid CharacterStyles should not be imported/exported
CPPUNIT_ASSERT(!getStyles("CharacterStyles")->hasByName("__XXX___invalid"));
@@ -590,7 +590,7 @@ DECLARE_ODFEXPORT_TEST(testTdf104254_noHeaderWrapping, "tdf104254_noHeaderWrappi
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- sal_Int32 nParaHeight = getXPath(pXmlDoc, "//header/txt[1]/infos/bounds", "height").toInt32();
+ sal_Int32 nParaHeight = getXPath(pXmlDoc, "//header/txt[1]/infos/bounds"_ostr, "height"_ostr).toInt32();
// The wrapping on header images is supposed to be ignored (since OOo for MS compat reasons),
// thus making the text run underneath the image. Before, height was 1104. Now it is 552.
CPPUNIT_ASSERT_MESSAGE("Paragraph should fit on a single line", nParaHeight < 600);
@@ -632,7 +632,7 @@ DECLARE_ODFEXPORT_TEST(testTdf143793_noBodyWrapping, "tdf143793_noBodyWrapping.o
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- sal_Int32 nParaHeight = getXPath(pXmlDoc, "//page[1]/header/txt[1]/infos/bounds", "height").toInt32();
+ sal_Int32 nParaHeight = getXPath(pXmlDoc, "//page[1]/header/txt[1]/infos/bounds"_ostr, "height"_ostr).toInt32();
// The header text should wrap around the header image in OOo 1.1 and prior,
// thus taking up two lines instead of one. One line is 276. It should be 552.
CPPUNIT_ASSERT_MESSAGE("Header text should fill two lines", nParaHeight > 400);
@@ -700,25 +700,25 @@ CPPUNIT_TEST_FIXTURE(Test, testListFormatDocx)
// Check also that in numbering styles we have num-list-format defined
xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
assertXPath(pXmlDoc, "/office:document-styles/office:styles/text:list-style[@style:name='WWNum1']/"
- "text:list-level-style-number[@text:level='1']", "num-list-format", ">%1%<");
+ "text:list-level-style-number[@text:level='1']"_ostr, "num-list-format"_ostr, ">%1%<");
assertXPath(pXmlDoc, "/office:document-styles/office:styles/text:list-style[@style:name='WWNum1']/"
- "text:list-level-style-number[@text:level='2']", "num-list-format", ">>%1%/%2%<<");
+ "text:list-level-style-number[@text:level='2']"_ostr, "num-list-format"_ostr, ">>%1%/%2%<<");
assertXPath(pXmlDoc, "/office:document-styles/office:styles/text:list-style[@style:name='WWNum1']/"
- "text:list-level-style-number[@text:level='3']", "num-list-format", ">>%1%/%2%/%3%<<");
+ "text:list-level-style-number[@text:level='3']"_ostr, "num-list-format"_ostr, ">>%1%/%2%/%3%<<");
// But for compatibility there are still prefix/suffix
assertXPath(pXmlDoc, "/office:document-styles/office:styles/text:list-style[@style:name='WWNum1']/"
- "text:list-level-style-number[@text:level='1']", "num-prefix", ">");
+ "text:list-level-style-number[@text:level='1']"_ostr, "num-prefix"_ostr, ">");
assertXPath(pXmlDoc, "/office:document-styles/office:styles/text:list-style[@style:name='WWNum1']/"
- "text:list-level-style-number[@text:level='1']", "num-suffix", "<");
+ "text:list-level-style-number[@text:level='1']"_ostr, "num-suffix"_ostr, "<");
assertXPath(pXmlDoc, "/office:document-styles/office:styles/text:list-style[@style:name='WWNum1']/"
- "text:list-level-style-number[@text:level='2']", "num-prefix", ">>");
+ "text:list-level-style-number[@text:level='2']"_ostr, "num-prefix"_ostr, ">>");
assertXPath(pXmlDoc, "/office:document-styles/office:styles/text:list-style[@style:name='WWNum1']/"
- "text:list-level-style-number[@text:level='2']", "num-suffix", "<<");
+ "text:list-level-style-number[@text:level='2']"_ostr, "num-suffix"_ostr, "<<");
assertXPath(pXmlDoc, "/office:document-styles/office:styles/text:list-style[@style:name='WWNum1']/"
- "text:list-level-style-number[@text:level='3']", "num-prefix", ">>");
+ "text:list-level-style-number[@text:level='3']"_ostr, "num-prefix"_ostr, ">>");
assertXPath(pXmlDoc, "/office:document-styles/office:styles/text:list-style[@style:name='WWNum1']/"
- "text:list-level-style-number[@text:level='3']", "num-suffix", "<<");
+ "text:list-level-style-number[@text:level='3']"_ostr, "num-suffix"_ostr, "<<");
}
DECLARE_ODFEXPORT_TEST(testShapeWithHyperlink, "shape-with-hyperlink.odt")
@@ -729,8 +729,8 @@ DECLARE_ODFEXPORT_TEST(testShapeWithHyperlink, "shape-with-hyperlink.odt")
{
xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
// Check how conversion from prefix/suffix to list format did work
- assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p/draw:a",
- "href", "http://shape.com/");
+ assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p/draw:a"_ostr,
+ "href"_ostr, "http://shape.com/");
}
}
@@ -768,25 +768,25 @@ DECLARE_ODFEXPORT_TEST(testListFormatOdt, "listformat.odt")
xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
// Check how conversion from prefix/suffix to list format did work
assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/text:list-style[@style:name='L1']/"
- "text:list-level-style-number[@text:level='1']", "num-list-format", ">%1%<");
+ "text:list-level-style-number[@text:level='1']"_ostr, "num-list-format"_ostr, ">%1%<");
assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/text:list-style[@style:name='L1']/"
- "text:list-level-style-number[@text:level='2']", "num-list-format", ">>%1%.%2%<<");
+ "text:list-level-style-number[@text:level='2']"_ostr, "num-list-format"_ostr, ">>%1%.%2%<<");
assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/text:list-style[@style:name='L1']/"
- "text:list-level-style-number[@text:level='3']", "num-list-format", ">>%1%.%2%.%3%<<");
+ "text:list-level-style-number[@text:level='3']"_ostr, "num-list-format"_ostr, ">>%1%.%2%.%3%<<");
// But for compatibility there are still prefix/suffix as they were before
assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/text:list-style[@style:name='L1']/"
- "text:list-level-style-number[@text:level='1']", "num-prefix", ">");
+ "text:list-level-style-number[@text:level='1']"_ostr, "num-prefix"_ostr, ">");
assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/text:list-style[@style:name='L1']/"
- "text:list-level-style-number[@text:level='1']", "num-suffix", "<");
+ "text:list-level-style-number[@text:level='1']"_ostr, "num-suffix"_ostr, "<");
assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/text:list-style[@style:name='L1']/"
- "text:list-level-style-number[@text:level='2']", "num-prefix", ">>");
+ "text:list-level-style-number[@text:level='2']"_ostr, "num-prefix"_ostr, ">>");
assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/text:list-style[@style:name='L1']/"
- "text:list-level-style-number[@text:level='2']", "num-suffix", "<<");
+ "text:list-level-style-number[@text:level='2']"_ostr, "num-suffix"_ostr, "<<");
assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/text:list-style[@style:name='L1']/"
- "text:list-level-style-number[@text:level='3']", "num-prefix", ">>");
+ "text:list-level-style-number[@text:level='3']"_ostr, "num-prefix"_ostr, ">>");
assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/text:list-style[@style:name='L1']/"
- "text:list-level-style-number[@text:level='3']", "num-suffix", "<<");
+ "text:list-level-style-number[@text:level='3']"_ostr, "num-suffix"_ostr, "<<");
}
}
@@ -819,12 +819,12 @@ CPPUNIT_TEST_FIXTURE(Test, tdf120972)
OUString cDecimal(SvtSysLocale().GetLocaleData().getNumDecimalSep()[0]);
assertXPath(
pXmlDoc,
- "//style:style[@style:name='P1']/style:paragraph-properties/style:tab-stops/style:tab-stop",
- "char", cDecimal);
+ "//style:style[@style:name='P1']/style:paragraph-properties/style:tab-stops/style:tab-stop"_ostr,
+ "char"_ostr, cDecimal);
assertXPath(
pXmlDoc,
- "//style:style[@style:name='P2']/style:paragraph-properties/style:tab-stops/style:tab-stop",
- "char", cDecimal);
+ "//style:style[@style:name='P2']/style:paragraph-properties/style:tab-stops/style:tab-stop"_ostr,
+ "char"_ostr, cDecimal);
}
DECLARE_ODFEXPORT_TEST(testTdf114287, "tdf114287.odt")
@@ -862,14 +862,14 @@ DECLARE_ODFEXPORT_TEST(testTdf114287, "tdf114287.odt")
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(getParagraph(16), "ParaRightMargin"));
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/infos/prtBounds", "left", "2268");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/infos/prtBounds", "right", "11339");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/infos/prtBounds"_ostr, "left"_ostr, "2268");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/infos/prtBounds"_ostr, "right"_ostr, "11339");
// the problem was that the list style name of the list must override the
// paragraph style even though it's the same list style
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/infos/prtBounds", "left", "357");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/infos/prtBounds", "right", "11339");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[16]/infos/prtBounds", "left", "357");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[16]/infos/prtBounds", "right", "11339");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/infos/prtBounds"_ostr, "left"_ostr, "357");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/infos/prtBounds"_ostr, "right"_ostr, "11339");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[16]/infos/prtBounds"_ostr, "left"_ostr, "357");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[16]/infos/prtBounds"_ostr, "right"_ostr, "11339");
}
DECLARE_ODFEXPORT_TEST(testSectionColumnSeparator, "section-columns-separator.fodt")
@@ -974,31 +974,31 @@ DECLARE_ODFEXPORT_TEST(testTdf78510, "WordTest_edit.odt")
// painting)
{
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/prtBounds", "left", "567");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/prtBounds", "right", "9359");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/infos/prtBounds", "left", "1134");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/infos/prtBounds", "right", "9359");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/infos/prtBounds", "left", "1134");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/infos/prtBounds", "right", "9359");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/infos/prtBounds", "left", "567");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/infos/prtBounds", "right", "9359");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/infos/prtBounds", "left", "0");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/infos/prtBounds", "right", "9359");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/infos/prtBounds", "left", "567");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/infos/prtBounds", "right", "9359");
-
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/infos/prtBounds", "left", "567");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/infos/prtBounds", "right", "9359");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/infos/prtBounds", "left", "567");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/infos/prtBounds", "right", "9359");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/infos/prtBounds", "left", "1701");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/infos/prtBounds", "right", "9359");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/infos/prtBounds", "left", "567");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/infos/prtBounds", "right", "9359");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[12]/infos/prtBounds", "left", "-567");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[12]/infos/prtBounds", "right", "9359");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[13]/infos/prtBounds", "left", "567");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[13]/infos/prtBounds", "right", "9359");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/prtBounds"_ostr, "left"_ostr, "567");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/prtBounds"_ostr, "right"_ostr, "9359");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/infos/prtBounds"_ostr, "left"_ostr, "1134");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/infos/prtBounds"_ostr, "right"_ostr, "9359");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/infos/prtBounds"_ostr, "left"_ostr, "1134");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/infos/prtBounds"_ostr, "right"_ostr, "9359");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/infos/prtBounds"_ostr, "left"_ostr, "567");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/infos/prtBounds"_ostr, "right"_ostr, "9359");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/infos/prtBounds"_ostr, "left"_ostr, "0");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/infos/prtBounds"_ostr, "right"_ostr, "9359");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/infos/prtBounds"_ostr, "left"_ostr, "567");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/infos/prtBounds"_ostr, "right"_ostr, "9359");
+
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/infos/prtBounds"_ostr, "left"_ostr, "567");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/infos/prtBounds"_ostr, "right"_ostr, "9359");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/infos/prtBounds"_ostr, "left"_ostr, "567");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/infos/prtBounds"_ostr, "right"_ostr, "9359");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/infos/prtBounds"_ostr, "left"_ostr, "1701");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/infos/prtBounds"_ostr, "right"_ostr, "9359");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/infos/prtBounds"_ostr, "left"_ostr, "567");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/infos/prtBounds"_ostr, "right"_ostr, "9359");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[12]/infos/prtBounds"_ostr, "left"_ostr, "-567");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[12]/infos/prtBounds"_ostr, "right"_ostr, "9359");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[13]/infos/prtBounds"_ostr, "left"_ostr, "567");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[13]/infos/prtBounds"_ostr, "right"_ostr, "9359");
}
// now check the positions where text is actually painted -
@@ -1015,54 +1015,54 @@ DECLARE_ODFEXPORT_TEST(testTdf78510, "WordTest_edit.odt")
// 1: inherited from paragraph style and overridden by list
// bullet char is extra
- assertXPath(pXmlDoc, "//textarray[1]", "x", "2306");
+ assertXPath(pXmlDoc, "//textarray[1]"_ostr, "x"_ostr, "2306");
// text is after a tab from list - haven't checked if that is correct?
- assertXPath(pXmlDoc, "//textarray[2]", "x", "2873");
+ assertXPath(pXmlDoc, "//textarray[2]"_ostr, "x"_ostr, "2873");
// second line
- assertXPath(pXmlDoc, "//textarray[3]", "x", "2873");
+ assertXPath(pXmlDoc, "//textarray[3]"_ostr, "x"_ostr, "2873");
// 2: as 1 + paragraph sets firstline
- assertXPath(pXmlDoc, "//textarray[4]", "x", "3440");
- assertXPath(pXmlDoc, "//textarray[5]", "x", "3593");
- assertXPath(pXmlDoc, "//textarray[6]", "x", "2873");
+ assertXPath(pXmlDoc, "//textarray[4]"_ostr, "x"_ostr, "3440");
+ assertXPath(pXmlDoc, "//textarray[5]"_ostr, "x"_ostr, "3593");
+ assertXPath(pXmlDoc, "//textarray[6]"_ostr, "x"_ostr, "2873");
// 3: as 1 + paragraph sets textleft
- assertXPath(pXmlDoc, "//textarray[7]", "x", "2873");
- assertXPath(pXmlDoc, "//textarray[8]", "x", "3440");
- assertXPath(pXmlDoc, "//textarray[9]", "x", "3440");
+ assertXPath(pXmlDoc, "//textarray[7]"_ostr, "x"_ostr, "2873");
+ assertXPath(pXmlDoc, "//textarray[8]"_ostr, "x"_ostr, "3440");
+ assertXPath(pXmlDoc, "//textarray[9]"_ostr, "x"_ostr, "3440");
// 4: as 1 + paragraph sets firstline, textleft
- assertXPath(pXmlDoc, "//textarray[10]", "x", "2306");
- assertXPath(pXmlDoc, "//textarray[11]", "x", "3440");
- assertXPath(pXmlDoc, "//textarray[12]", "x", "3440");
+ assertXPath(pXmlDoc, "//textarray[10]"_ostr, "x"_ostr, "2306");
+ assertXPath(pXmlDoc, "//textarray[11]"_ostr, "x"_ostr, "3440");
+ assertXPath(pXmlDoc, "//textarray[12]"_ostr, "x"_ostr, "3440");
// 5: as 1 + paragraph sets firstline
- assertXPath(pXmlDoc, "//textarray[13]", "x", "1739");
- assertXPath(pXmlDoc, "//textarray[14]", "x", "2873");
- assertXPath(pXmlDoc, "//textarray[15]", "x", "2873");
+ assertXPath(pXmlDoc, "//textarray[13]"_ostr, "x"_ostr, "1739");
+ assertXPath(pXmlDoc, "//textarray[14]"_ostr, "x"_ostr, "2873");
+ assertXPath(pXmlDoc, "//textarray[15]"_ostr, "x"_ostr, "2873");
// 6: as 1
- assertXPath(pXmlDoc, "//textarray[16]", "x", "2306");
- assertXPath(pXmlDoc, "//textarray[17]", "x", "2873");
+ assertXPath(pXmlDoc, "//textarray[16]"_ostr, "x"_ostr, "2306");
+ assertXPath(pXmlDoc, "//textarray[17]"_ostr, "x"_ostr, "2873");
// 8: inherited from paragraph style and overridden by list
- assertXPath(pXmlDoc, "//textarray[18]", "x", "2873");
- assertXPath(pXmlDoc, "//textarray[19]", "x", "3746");
- assertXPath(pXmlDoc, "//textarray[20]", "x", "2306");
+ assertXPath(pXmlDoc, "//textarray[18]"_ostr, "x"_ostr, "2873");
+ assertXPath(pXmlDoc, "//textarray[19]"_ostr, "x"_ostr, "3746");
+ assertXPath(pXmlDoc, "//textarray[20]"_ostr, "x"_ostr, "2306");
// 9: as 8 + paragraph sets firstline
- assertXPath(pXmlDoc, "//textarray[21]", "x", "3440");
- assertXPath(pXmlDoc, "//textarray[22]", "x", "3746");
- assertXPath(pXmlDoc, "//textarray[23]", "x", "2306");
+ assertXPath(pXmlDoc, "//textarray[21]"_ostr, "x"_ostr, "3440");
+ assertXPath(pXmlDoc, "//textarray[22]"_ostr, "x"_ostr, "3746");
+ assertXPath(pXmlDoc, "//textarray[23]"_ostr, "x"_ostr, "2306");
// 10: as 8 + paragraph sets textleft
- assertXPath(pXmlDoc, "//textarray[24]", "x", "4007");
- assertXPath(pXmlDoc, "//textarray[25]", "x", "4880");
- assertXPath(pXmlDoc, "//textarray[26]", "x", "3440");
+ assertXPath(pXmlDoc, "//textarray[24]"_ostr, "x"_ostr, "4007");
+ assertXPath(pXmlDoc, "//textarray[25]"_ostr, "x"_ostr, "4880");
+ assertXPath(pXmlDoc, "//textarray[26]"_ostr, "x"_ostr, "3440");
// 11: as 8 + paragraph sets firstline, textleft
- assertXPath(pXmlDoc, "//textarray[27]", "x", "2306");
- assertXPath(pXmlDoc, "//textarray[28]", "x", "3440");
- assertXPath(pXmlDoc, "//textarray[29]", "x", "3440");
+ assertXPath(pXmlDoc, "//textarray[27]"_ostr, "x"_ostr, "2306");
+ assertXPath(pXmlDoc, "//textarray[28]"_ostr, "x"_ostr, "3440");
+ assertXPath(pXmlDoc, "//textarray[29]"_ostr, "x"_ostr, "3440");
// 12: as 8 + paragraph sets firstline
- assertXPath(pXmlDoc, "//textarray[30]", "x", "1172");
- assertXPath(pXmlDoc, "//textarray[31]", "x", "1739");
- assertXPath(pXmlDoc, "//textarray[32]", "x", "2306");
+ assertXPath(pXmlDoc, "//textarray[30]"_ostr, "x"_ostr, "1172");
+ assertXPath(pXmlDoc, "//textarray[31]"_ostr, "x"_ostr, "1739");
+ assertXPath(pXmlDoc, "//textarray[32]"_ostr, "x"_ostr, "2306");
// 13: as 8
- assertXPath(pXmlDoc, "//textarray[33]", "x", "2873");
- assertXPath(pXmlDoc, "//textarray[34]", "x", "3746");
+ assertXPath(pXmlDoc, "//textarray[33]"_ostr, "x"_ostr, "2873");
+ assertXPath(pXmlDoc, "//textarray[34]"_ostr, "x"_ostr, "3746");
}
#endif
}
@@ -1072,9 +1072,9 @@ CPPUNIT_TEST_FIXTURE(Test, testParagraphMarkerMarkupRoundtrip)
loadAndReload("ParagraphMarkerMarkup.fodt");
// Test that the markup stays at save-and-reload
xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
- assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p", "marker-style-name", "T2");
- assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name='T2']/style:text-properties", "font-size", "9pt");
- assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name='T2']/style:text-properties", "color", "#ff0000");
+ assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p"_ostr, "marker-style-name"_ostr, "T2");
+ assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name='T2']/style:text-properties"_ostr, "font-size"_ostr, "9pt");
+ assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name='T2']/style:text-properties"_ostr, "color"_ostr, "#ff0000");
}
CPPUNIT_TEST_FIXTURE(Test, testCommentStyles)
@@ -1124,8 +1124,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf150408_IsLegal)
xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
assertXPath(
pXmlDoc,
- "/office:document-styles/office:styles/text:outline-style/text:outline-level-style[2]",
- "is-legal", "true");
+ "/office:document-styles/office:styles/text:outline-style/text:outline-level-style[2]"_ostr,
+ "is-legal"_ostr, "true");
}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 29df94d9afd6..6ccc8cce3bc5 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -918,18 +918,18 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf92586)
CPPUNIT_TEST_FIXTURE(Test, testTdf103025)
{
createSwDoc("tdf103025.odt");
- CPPUNIT_ASSERT_EQUAL(OUString("2014-01"), parseDump("/root/page[1]/header/tab[2]/row[2]/cell[3]/txt/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
- CPPUNIT_ASSERT_EQUAL(OUString("2014-01"), parseDump("/root/page[2]/header/tab[2]/row[2]/cell[3]/txt/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
- CPPUNIT_ASSERT_EQUAL(OUString("2014-02"), parseDump("/root/page[3]/header/tab[2]/row[2]/cell[3]/txt/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
- CPPUNIT_ASSERT_EQUAL(OUString("2014-03"), parseDump("/root/page[4]/header/tab[2]/row[2]/cell[3]/txt/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
- CPPUNIT_ASSERT_EQUAL(OUString("2014-03"), parseDump("/root/page[5]/header/tab[2]/row[2]/cell[3]/txt/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
+ CPPUNIT_ASSERT_EQUAL(OUString("2014-01"), parseDump("/root/page[1]/header/tab[2]/row[2]/cell[3]/txt/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("2014-01"), parseDump("/root/page[2]/header/tab[2]/row[2]/cell[3]/txt/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("2014-02"), parseDump("/root/page[3]/header/tab[2]/row[2]/cell[3]/txt/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("2014-03"), parseDump("/root/page[4]/header/tab[2]/row[2]/cell[3]/txt/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("2014-03"), parseDump("/root/page[5]/header/tab[2]/row[2]/cell[3]/txt/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr));
}
CPPUNIT_TEST_FIXTURE(Test, testTdf76322_columnBreakInHeader)
{
createSwDoc("tdf76322_columnBreakInHeader.docx");
// column breaks were ignored. First line should start in column 2
- CPPUNIT_ASSERT_EQUAL( OUString("Test1"), parseDump("/root/page[1]/header/section/column[2]/body/txt/text()") );
+ CPPUNIT_ASSERT_EQUAL( OUString("Test1"), parseDump("/root/page[1]/header/section/column[2]/body/txt/text()"_ostr) );
}
CPPUNIT_TEST_FIXTURE(Test, testTdf76349_1columnBreak)
@@ -958,16 +958,16 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf75221)
// When "Don't add space between paragraphs of the same style" setting set,
// spacing between same-style paragraphs must be equal to their line spacing.
// It used to be 0.
- OUString top = parseDump("/root/page/body/txt[2]/infos/prtBounds", "top");
+ OUString top = parseDump("/root/page/body/txt[2]/infos/prtBounds"_ostr, "top"_ostr);
CPPUNIT_ASSERT(top.toInt32() > 0);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf101729)
{
createSwDoc("tdf101729.odt");
- sal_Int32 l = parseDump("/root/page/body/tab/row/cell[1]/infos/bounds", "left").toInt32();
- sal_Int32 w = parseDump("/root/page/body/tab/row/cell[1]/infos/bounds", "width").toInt32();
- sal_Int32 x = parseDump("/root/page/body/tab/row/cell[1]/txt/infos/bounds", "left").toInt32();
+ sal_Int32 l = parseDump("/root/page/body/tab/row/cell[1]/infos/bounds"_ostr, "left"_ostr).toInt32();
+ sal_Int32 w = parseDump("/root/page/body/tab/row/cell[1]/infos/bounds"_ostr, "width"_ostr).toInt32();
+ sal_Int32 x = parseDump("/root/page/body/tab/row/cell[1]/txt/infos/bounds"_ostr, "left"_ostr).toInt32();
// Make sure the text does not go outside and verify it is centered roughly
CPPUNIT_ASSERT( l + w / 4 < x );
CPPUNIT_ASSERT( x < l + 3 * w / 4);
@@ -1031,14 +1031,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf109080_loext_ns)
// Test we can import <loext:header-first> and <loext:footer-first>
CPPUNIT_ASSERT_EQUAL(OUString("This is the first page header"),
- parseDump("/root/page[1]/header/txt/text()"));
+ parseDump("/root/page[1]/header/txt/text()"_ostr));
CPPUNIT_ASSERT_EQUAL(OUString("This is the non-first-page header"),
- parseDump("/root/page[2]/header/txt/text()"));
+ parseDump("/root/page[2]/header/txt/text()"_ostr));
CPPUNIT_ASSERT_EQUAL(OUString("This is the first page footer"),
- parseDump("/root/page[1]/footer/txt/text()"));
+ parseDump("/root/page[1]/footer/txt/text()"_ostr));
CPPUNIT_ASSERT_EQUAL(OUString("This is the non-first-page footer"),
- parseDump("/root/page[2]/footer/txt/text()"));
+ parseDump("/root/page[2]/footer/txt/text()"_ostr));
}
CPPUNIT_TEST_FIXTURE(Test, testTdf109080_style_ns)
@@ -1048,14 +1048,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf109080_style_ns)
// (produced by LibreOffice 4.0 - 5.x)
CPPUNIT_ASSERT_EQUAL(OUString("This is the first page header"),
- parseDump("/root/page[1]/header/txt/text()"));
+ parseDump("/root/page[1]/header/txt/text()"_ostr));
CPPUNIT_ASSERT_EQUAL(OUString("This is the non-first-page header"),
- parseDump("/root/page[2]/header/txt/text()"));
+ parseDump("/root/page[2]/header/txt/text()"_ostr));
CPPUNIT_ASSERT_EQUAL(OUString("This is the first page footer"),
- parseDump("/root/page[1]/footer/txt/text()"));
+ parseDump("/root/page[1]/footer/txt/text()"_ostr));
CPPUNIT_ASSERT_EQUAL(OUString("This is the non-first-page footer"),
- parseDump("/root/page[2]/footer/txt/text()"));
+ parseDump("/root/page[2]/footer/txt/text()"_ostr));
}
CPPUNIT_TEST_FIXTURE(Test, testTdf109228)
@@ -1073,7 +1073,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf94882)
// due to the page number being even)
OUString headertext = parseDump(
"/root/page[starts-with(body/txt/text(),'The paragraph style on this')]"
- "/header/txt/text()"
+ "/header/txt/text()"_ostr
);
// This header should be the first page header
CPPUNIT_ASSERT_EQUAL(OUString("This is the first page header"), headertext);
@@ -1086,7 +1086,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBlankBeforeFirstPage)
// blank page inserted before it to make it a left page
CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be 1 pages output",
- OUString("1"), parseDump("count(/root/page)")
+ OUString("1"), parseDump("count(/root/page)"_ostr)
);
}
@@ -1100,15 +1100,15 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf108482)
{
createSwDoc("tdf108482.odt");
CPPUNIT_ASSERT_EQUAL_MESSAGE("The table on second page must have two rows",
- OUString("2"), parseDump("count(/root/page[2]/body/tab/row)")
+ OUString("2"), parseDump("count(/root/page[2]/body/tab/row)"_ostr)
);
CPPUNIT_ASSERT_EQUAL_MESSAGE("The second page table's first row must be the repeated headline",
- OUString("Header"), parseDump("/root/page[2]/body/tab/row[1]/cell/txt")
+ OUString("Header"), parseDump("/root/page[2]/body/tab/row[1]/cell/txt"_ostr)
);
// The first (repeated headline) row with vertical text orientation must have non-zero height
// (in my tests, it was 1135)
CPPUNIT_ASSERT_GREATER(
- sal_Int32(1000), parseDump("/root/page[2]/body/tab/row[1]/infos/bounds", "height").toInt32()
+ sal_Int32(1000), parseDump("/root/page[2]/body/tab/row[1]/infos/bounds"_ostr, "height"_ostr).toInt32()
);
}
@@ -1117,7 +1117,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf116195)
createSwDoc("tdf116195.odt");
// The image was set to zero height due to a regression
CPPUNIT_ASSERT_EQUAL(
- sal_Int32(12960), parseDump("/root/page/anchored/fly/notxt/infos/bounds", "height").toInt32()
+ sal_Int32(12960), parseDump("/root/page/anchored/fly/notxt/infos/bounds"_ostr, "height"_ostr).toInt32()
);
}
@@ -1310,7 +1310,7 @@ CPPUNIT_TEST_FIXTURE(Test, testVerticallyMergedCellBorder)
xmlDocUniquePtr pXmlSettings = parseExport("content.xml");
// Without the accompanying fix in place, this test would have failed with:
// - In <...>, XPath '//table:covered-table-cell' no attribute 'style-name' exist
- assertXPath(pXmlSettings, "//table:covered-table-cell", "style-name", "Table1.A2");
+ assertXPath(pXmlSettings, "//table:covered-table-cell"_ostr, "style-name"_ostr, "Table1.A2");
}
CPPUNIT_TEST_FIXTURE(Test, testPageAnchorZIndexFirstPage)
@@ -1528,8 +1528,8 @@ CPPUNIT_TEST_FIXTURE(Test, testEmptyTrailingSpans)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- auto height1 = getXPath(pXmlDoc, "/root/page/body/txt[1]/infos/bounds", "height").toInt32();
- auto height2 = getXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds", "height").toInt32();
+ auto height1 = getXPath(pXmlDoc, "/root/page/body/txt[1]/infos/bounds"_ostr, "height"_ostr).toInt32();
+ auto height2 = getXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_EQUAL(height1, height2);
CPPUNIT_ASSERT_DOUBLES_EQUAL(184, height2, 1); // allow a bit of room for rounding just in case
}
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index c4530aa44f6a..1d66a55b331d 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -43,7 +43,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo81381)
{
loadAndSave("fdo81381.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:object[1]/o:OLEObject[1]", "DrawAspect", "Icon");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:object[1]/o:OLEObject[1]"_ostr, "DrawAspect"_ostr, "Icon");
}
CPPUNIT_TEST_FIXTURE(Test, testSdtAlias)
@@ -52,7 +52,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtAlias)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// <w:alias> was completely missing.
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:alias", "val", "Subtitle");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:alias"_ostr, "val"_ostr, "Subtitle");
}
CPPUNIT_TEST_FIXTURE(Test, testFooterBodyDistance)
@@ -60,7 +60,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFooterBodyDistance)
loadAndSave("footer-body-distance.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Page break was exported as section break, this was 0
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br"_ostr, 1);
}
// Check for correct header/footer with special first page with TOC inside:
@@ -76,33 +76,33 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf118393)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// check first page
- assertXPath(pXmlDoc, "/root/page[1]/header", 0);
- assertXPath(pXmlDoc, "/root/page[1]/footer", 0);
+ assertXPath(pXmlDoc, "/root/page[1]/header"_ostr, 0);
+ assertXPath(pXmlDoc, "/root/page[1]/footer"_ostr, 0);
// check second page in the same way
- assertXPath(pXmlDoc, "/root/page[2]/header");
- assertXPath(pXmlDoc, "/root/page[2]/footer");
+ assertXPath(pXmlDoc, "/root/page[2]/header"_ostr);
+ assertXPath(pXmlDoc, "/root/page[2]/footer"_ostr);
}
// All other pages should have header/footer
- CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[2]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[2]/footer/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[2]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[2]/footer/txt/text()"_ostr));
- CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[3]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[3]/footer/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[3]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[3]/footer/txt/text()"_ostr));
- CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[4]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[4]/footer/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[4]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[4]/footer/txt/text()"_ostr));
- CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[5]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[5]/footer/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[5]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[5]/footer/txt/text()"_ostr));
- CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[6]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[6]/footer/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[6]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[6]/footer/txt/text()"_ostr));
- CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[7]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[7]/footer/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[7]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Seite * von *"), parseDump("/root/page[7]/footer/txt/text()"_ostr));
}
DECLARE_OOXMLEXPORT_TEST(testfdo81031, "fdo81031.docx")
@@ -125,7 +125,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPlausableBorder)
// sw::util::IsPlausableSingleWordSection() did not merge two page styles due to borders.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Page break was exported as section break, this was 0
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br"_ostr, 1);
CPPUNIT_ASSERT_EQUAL( 2, getPages() );
}
@@ -135,14 +135,14 @@ CPPUNIT_TEST_FIXTURE(Test, testUnwantedSectionBreak)
loadAndSave("unwanted-section-break.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// This was 2: an additional sectPr was added to the document.
- assertXPath(pXmlDoc, "//w:sectPr", 1);
+ assertXPath(pXmlDoc, "//w:sectPr"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testfdo80897 )
{
loadAndSave("fdo80897.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:bodyPr/a:prstTxWarp", "prst", "textTriangle");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:bodyPr/a:prstTxWarp"_ostr, "prst"_ostr, "textTriangle");
}
@@ -159,7 +159,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo80902)
// The problem was that the docGrid type was set as default so fix it for other grid type
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:docGrid", "type", "lines");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:docGrid"_ostr, "type"_ostr, "lines");
}
CPPUNIT_TEST_FIXTURE(Test, testParaShading)
@@ -167,7 +167,7 @@ CPPUNIT_TEST_FIXTURE(Test, testParaShading)
loadAndSave("para-shading.docx");
// Make sure the themeColor attribute is not written when it would be empty.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:shd", "themeColor");
+ assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:shd"_ostr, "themeColor"_ostr);
}
DECLARE_OOXMLEXPORT_TEST(testFirstHeaderFooter, "first-header-footer.docx")
@@ -179,18 +179,18 @@ DECLARE_OOXMLEXPORT_TEST(testFirstHeaderFooter, "first-header-footer.docx")
// The document has 6 pages. Note that we don't test if 4 or just 2 page
// styles are created, the point is that layout should be correct.
- CPPUNIT_ASSERT_EQUAL(OUString("First page header"), parseDump("/root/page[1]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("First page footer"), parseDump("/root/page[1]/footer/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Even page header"), parseDump("/root/page[2]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Even page footer"), parseDump("/root/page[2]/footer/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Odd page header"), parseDump("/root/page[3]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Odd page footer"), parseDump("/root/page[3]/footer/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("First page header2"), parseDump("/root/page[4]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("First page footer 2"), parseDump("/root/page[4]/footer/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Odd page header 2"), parseDump("/root/page[5]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Odd page footer 2"), parseDump("/root/page[5]/footer/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Even page header 2"), parseDump("/root/page[6]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Even page footer 2"), parseDump("/root/page[6]/footer/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("First page header"), parseDump("/root/page[1]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("First page footer"), parseDump("/root/page[1]/footer/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Even page header"), parseDump("/root/page[2]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Even page footer"), parseDump("/root/page[2]/footer/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Odd page header"), parseDump("/root/page[3]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Odd page footer"), parseDump("/root/page[3]/footer/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("First page header2"), parseDump("/root/page[4]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("First page footer 2"), parseDump("/root/page[4]/footer/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Odd page header 2"), parseDump("/root/page[5]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Odd page footer 2"), parseDump("/root/page[5]/footer/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Even page header 2"), parseDump("/root/page[6]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Even page footer 2"), parseDump("/root/page[6]/footer/txt/text()"_ostr));
}
CPPUNIT_TEST_FIXTURE(Test, testFirstHeaderFooterB)
@@ -198,18 +198,18 @@ CPPUNIT_TEST_FIXTURE(Test, testFirstHeaderFooterB)
loadAndReload("first-header-footerB.odt");
CPPUNIT_ASSERT_EQUAL( 6, getPages() );
- CPPUNIT_ASSERT_EQUAL(OUString("First page header"), parseDump("/root/page[1]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("First page footer"), parseDump("/root/page[1]/footer/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Even page header"), parseDump("/root/page[2]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Even page footer"), parseDump("/root/page[2]/footer/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Odd page header"), parseDump("/root/page[3]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Odd page footer"), parseDump("/root/page[3]/footer/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("First page header2"), parseDump("/root/page[4]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("First page footer 2"), parseDump("/root/page[4]/footer/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Odd page header 2"), parseDump("/root/page[5]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Odd page footer 2"), parseDump("/root/page[5]/footer/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Even page header 2"), parseDump("/root/page[6]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Even page footer 2"), parseDump("/root/page[6]/footer/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("First page header"), parseDump("/root/page[1]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("First page footer"), parseDump("/root/page[1]/footer/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Even page header"), parseDump("/root/page[2]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Even page footer"), parseDump("/root/page[2]/footer/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Odd page header"), parseDump("/root/page[3]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Odd page footer"), parseDump("/root/page[3]/footer/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("First page header2"), parseDump("/root/page[4]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("First page footer 2"), parseDump("/root/page[4]/footer/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Odd page header 2"), parseDump("/root/page[5]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Odd page footer 2"), parseDump("/root/page[5]/footer/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Even page header 2"), parseDump("/root/page[6]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Even page footer 2"), parseDump("/root/page[6]/footer/txt/text()"_ostr));
}
CPPUNIT_TEST_FIXTURE(Test, testFDO83044)
@@ -217,7 +217,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO83044)
loadAndSave("fdo83044.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:text", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:text"_ostr, 1);
}
DECLARE_OOXMLEXPORT_TEST(testfdo83428, "fdo83428.docx")
@@ -233,10 +233,10 @@ CPPUNIT_TEST_FIXTURE(Test, testShapeInFloattable)
loadAndSave("shape-in-floattable.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// No nested drawingML w:txbxContent.
- assertXPath(pXmlDoc, "//mc:Choice//w:txbxContent//w:txbxContent", 0);
+ assertXPath(pXmlDoc, "//mc:Choice//w:txbxContent//w:txbxContent"_ostr, 0);
// Instead, make sure we have a separate shape and a table
- assertXPath(pXmlDoc, "//mc:AlternateContent//mc:Choice[@Requires='wpg']", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl", 1);
+ assertXPath(pXmlDoc, "//mc:AlternateContent//mc:Choice[@Requires='wpg']"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testEmptyAnnotationMark)
@@ -252,11 +252,11 @@ CPPUNIT_TEST_FIXTURE(Test, testEmptyAnnotationMark)
// Then inspect the OOXML markup of the modified document model.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// There were two commentReference nodes.
- assertXPath(pXmlDoc, "//w:commentReference", "id", "0");
+ assertXPath(pXmlDoc, "//w:commentReference"_ostr, "id"_ostr, "0");
// Empty comment range was not ignored on export, this was 1.
- assertXPath(pXmlDoc, "//w:commentRangeStart", 0);
+ assertXPath(pXmlDoc, "//w:commentRangeStart"_ostr, 0);
// Ditto.
- assertXPath(pXmlDoc, "//w:commentRangeEnd", 0);
+ assertXPath(pXmlDoc, "//w:commentRangeEnd"_ostr, 0);
}
DECLARE_OOXMLEXPORT_TEST(testDropdownInCell, "dropdown-in-cell.docx")
@@ -324,7 +324,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtIgnoredFooter)
loadAndSave("sdt-ignored-footer.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// This was 1, make sure no w:sdt sneaks into the main document from the footer.
- assertXPath(pXmlDoc, "//w:sdt", 0);
+ assertXPath(pXmlDoc, "//w:sdt"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testSdtRunPicture)
@@ -333,9 +333,9 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtRunPicture)
// SDT around run was exported as SDT around paragraph
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// This was 1: there was an SDT around w:p.
- assertXPath(pXmlDoc, "//w:body/w:sdt", 0);
+ assertXPath(pXmlDoc, "//w:body/w:sdt"_ostr, 0);
// This was 0: there were no SDT around w:r.
- assertXPath(pXmlDoc, "//w:body/w:p/w:sdt", 1);
+ assertXPath(pXmlDoc, "//w:body/w:p/w:sdt"_ostr, 1);
}
DECLARE_OOXMLEXPORT_TEST(testChartDupe, "chart-dupe.docx")
@@ -353,22 +353,22 @@ DECLARE_OOXMLEXPORT_TEST(testChartDupe, "chart-dupe.docx")
xmlDocUniquePtr pXmlDocCT = parseExport("[Content_Types].xml");
assertXPath(pXmlDocCT,
- "/ContentType:Types/ContentType:Override[@PartName='/word/charts/chart1.xml']",
- "ContentType",
+ "/ContentType:Types/ContentType:Override[@PartName='/word/charts/chart1.xml']"_ostr,
+ "ContentType"_ostr,
"application/vnd.openxmlformats-officedocument.drawingml.chart+xml");
- assertXPath(pXmlDocCT, "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/Microsoft_Excel_Worksheet1.xlsx']", "ContentType", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
+ assertXPath(pXmlDocCT, "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/Microsoft_Excel_Worksheet1.xlsx']"_ostr, "ContentType"_ostr, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
// check the rels too
xmlDocUniquePtr pXmlDocRels = parseExport("word/charts/_rels/chart1.xml.rels");
assertXPath(pXmlDocRels,
- "/rels:Relationships/rels:Relationship[@Target='../embeddings/Microsoft_Excel_Worksheet1.xlsx']",
- "Type",
+ "/rels:Relationships/rels:Relationship[@Target='../embeddings/Microsoft_Excel_Worksheet1.xlsx']"_ostr,
+ "Type"_ostr,
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
// check the content too
xmlDocUniquePtr pXmlDocChart1 = parseExport("word/charts/chart1.xml");
assertXPath(pXmlDocChart1,
- "/c:chartSpace/c:externalData",
- "id",
+ "/c:chartSpace/c:externalData"_ostr,
+ "id"_ostr,
"rId1");
}
@@ -419,11 +419,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf106541_noinheritChapterNumbering)
CPPUNIT_ASSERT_EQUAL(sPara3NumberingStyle, getProperty<OUString>(getParagraph(4), "NumberingStyleName"));
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//body/txt/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']", 3); //three of the four paragraphs have numbering
- assertXPath(pXmlDoc, "//body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']", "expand", "1");
- assertXPath(pXmlDoc, "//body/txt[2]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']", 0); //second paragraph style disables numbering
- assertXPath(pXmlDoc, "//body/txt[3]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']", "expand", "I.");
- assertXPath(pXmlDoc, "//body/txt[4]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']", "expand", "II.");
+ assertXPath(pXmlDoc, "//body/txt/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']"_ostr, 3); //three of the four paragraphs have numbering
+ assertXPath(pXmlDoc, "//body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']"_ostr, "expand"_ostr, "1");
+ assertXPath(pXmlDoc, "//body/txt[2]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']"_ostr, 0); //second paragraph style disables numbering
+ assertXPath(pXmlDoc, "//body/txt[3]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']"_ostr, "expand"_ostr, "I.");
+ assertXPath(pXmlDoc, "//body/txt[4]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']"_ostr, "expand"_ostr, "II.");
}
DECLARE_OOXMLEXPORT_TEST(testTdf53856_conflictingStyle, "tdf53856_conflictingStyle.docx")
@@ -450,7 +450,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDrawingmlFlipv)
loadAndSave("drawingml-flipv.docx");
// The problem was that the shape had vertical flip only, but then we added rotation as well on export.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathNoAttribute(pXmlDoc, "//a:xfrm", "rot");
+ assertXPathNoAttribute(pXmlDoc, "//a:xfrm"_ostr, "rot"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testRot90Fliph)
@@ -458,9 +458,9 @@ CPPUNIT_TEST_FIXTURE(Test, testRot90Fliph)
loadAndSave("rot90-fliph.docx");
// The problem was that a shape rotation of 90° got turned into 270° after roundtrip.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//a:xfrm", "flipH", "1");
+ assertXPath(pXmlDoc, "//a:xfrm"_ostr, "flipH"_ostr, "1");
// This was 16200000 (270 * 60000).
- assertXPath(pXmlDoc, "//a:xfrm", "rot", "5400000");
+ assertXPath(pXmlDoc, "//a:xfrm"_ostr, "rot"_ostr, "5400000");
}
CPPUNIT_TEST_FIXTURE(Test, testRot180Flipv)
@@ -468,9 +468,9 @@ CPPUNIT_TEST_FIXTURE(Test, testRot180Flipv)
loadAndSave("rot180-flipv.docx");
// 180° rotation got lost after roundtrip.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//a:xfrm", "flipV", "1");
+ assertXPath(pXmlDoc, "//a:xfrm"_ostr, "flipV"_ostr, "1");
// This attribute was completely missing.
- assertXPath(pXmlDoc, "//a:xfrm", "rot", "10800000");
+ assertXPath(pXmlDoc, "//a:xfrm"_ostr, "rot"_ostr, "10800000");
}
CPPUNIT_TEST_FIXTURE(Test, testRot270Flipv)
@@ -478,9 +478,9 @@ CPPUNIT_TEST_FIXTURE(Test, testRot270Flipv)
loadAndSave("rot270-flipv.docx");
// 270° rotation got turned into 90° after roundtrip.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//a:xfrm", "flipV", "1");
+ assertXPath(pXmlDoc, "//a:xfrm"_ostr, "flipV"_ostr, "1");
// This was 5400000.
- assertXPath(pXmlDoc, "//a:xfrm", "rot", "16200000");
+ assertXPath(pXmlDoc, "//a:xfrm"_ostr, "rot"_ostr, "16200000");
}
CPPUNIT_TEST_FIXTURE(Test, testMsoPosition)
@@ -490,31 +490,31 @@ CPPUNIT_TEST_FIXTURE(Test, testMsoPosition)
xmlDocUniquePtr doc = parseExport("word/footer1.xml");
// We write the frames out in different order than they were read, so check it's the correct
// textbox first by checking width. These tests may need reordering if that gets fixed.
- OUString style1 = getXPath(doc, "/w:ftr/w:p/w:r[3]/mc:AlternateContent/mc:Fallback/w:pict/v:rect", "style");
+ OUString style1 = getXPath(doc, "/w:ftr/w:p/w:r[3]/mc:AlternateContent/mc:Fallback/w:pict/v:rect"_ostr, "style"_ostr);
CPPUNIT_ASSERT( style1.indexOf( ";width:531pt;" ) >= 0 );
CPPUNIT_ASSERT( style1.indexOf( ";mso-position-vertical-relative:page" ) >= 0 );
CPPUNIT_ASSERT( style1.indexOf( ";mso-position-horizontal-relative:page" ) >= 0 );
- OUString style2 = getXPath(doc, "/w:ftr/w:p/w:r[4]/mc:AlternateContent/mc:Fallback/w:pict/v:rect", "style");
+ OUString style2 = getXPath(doc, "/w:ftr/w:p/w:r[4]/mc:AlternateContent/mc:Fallback/w:pict/v:rect"_ostr, "style"_ostr);
CPPUNIT_ASSERT( style2.indexOf( ";width:549pt;" ) >= 0 );
CPPUNIT_ASSERT( style2.indexOf( ";mso-position-vertical-relative:text" ) >= 0 );
CPPUNIT_ASSERT( style2.indexOf( ";mso-position-horizontal:center" ) >= 0 );
CPPUNIT_ASSERT( style2.indexOf( ";mso-position-horizontal-relative:text" ) >= 0 );
- OUString style3 = getXPath(doc, "/w:ftr/w:p/w:r[5]/mc:AlternateContent/mc:Fallback/w:pict/v:rect", "style");
+ OUString style3 = getXPath(doc, "/w:ftr/w:p/w:r[5]/mc:AlternateContent/mc:Fallback/w:pict/v:rect"_ostr, "style"_ostr);
CPPUNIT_ASSERT( style3.indexOf( ";width:36pt;" ) >= 0 );
CPPUNIT_ASSERT( style3.indexOf( ";mso-position-horizontal-relative:text" ) >= 0 );
CPPUNIT_ASSERT( style3.indexOf( ";mso-position-vertical-relative:text" ) >= 0 );
}
xmlDocUniquePtr doc = parseExport("word/header1.xml");
- OUString style1 = getXPath(doc, "/w:hdr/w:p/w:r[2]/mc:AlternateContent/mc:Fallback/w:pict/v:rect", "style");
+ OUString style1 = getXPath(doc, "/w:hdr/w:p/w:r[2]/mc:AlternateContent/mc:Fallback/w:pict/v:rect"_ostr, "style"_ostr);
CPPUNIT_ASSERT( style1.indexOf( ";width:335.75pt;" ) >= 0 );
CPPUNIT_ASSERT( style1.indexOf( ";mso-position-horizontal-relative:page" ) >= 0 );
CPPUNIT_ASSERT( style1.indexOf( ";mso-position-vertical-relative:page" ) >= 0 );
- OUString style2 = getXPath(doc, "/w:hdr/w:p/w:r[3]/mc:AlternateContent/mc:Fallback/w:pict/v:rect", "style");
+ OUString style2 = getXPath(doc, "/w:hdr/w:p/w:r[3]/mc:AlternateContent/mc:Fallback/w:pict/v:rect"_ostr, "style"_ostr);
CPPUNIT_ASSERT( style2.indexOf( ";width:138.15pt;" ) >= 0 );
CPPUNIT_ASSERT( style2.indexOf( ";mso-position-horizontal-relative:page" ) >= 0 );
CPPUNIT_ASSERT( style2.indexOf( ";mso-position-vertical-relative:page" ) >= 0 );
- OUString style3 = getXPath(doc, "/w:hdr/w:p/w:r[4]/mc:AlternateContent/mc:Fallback/w:pict/v:rect", "style");
+ OUString style3 = getXPath(doc, "/w:hdr/w:p/w:r[4]/mc:AlternateContent/mc:Fallback/w:pict/v:rect"_ostr, "style"_ostr);
CPPUNIT_ASSERT( style3.indexOf( ";width:163.8pt;" ) >= 0 );
CPPUNIT_ASSERT( style3.indexOf( ";mso-position-horizontal-relative:page" ) >= 0 );
CPPUNIT_ASSERT( style3.indexOf( ";mso-position-vertical-relative:page" ) >= 0 );
@@ -604,7 +604,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCropPixel)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// This is 17667 in the original document, was 504666 (so the image
// become invisible), now is around 19072.
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "//a:srcRect", "l").toInt32() <= 22452);
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "//a:srcRect"_ostr, "l"_ostr).toInt32() <= 22452);
}
/* FixMe: tdf#142805 Test disabled, because the picture is not load at all.
CPPUNIT_TEST_FIXTURE(Test, testEffectExtent)
@@ -624,10 +624,10 @@ CPPUNIT_TEST_FIXTURE(Test, testEffectExtentInline)
// wrote a <wp:effectExtent> full or zeros.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// E.g. this was 0.
- assertXPath(pXmlDoc, "//wp:effectExtent", "l", "609600");
- assertXPath(pXmlDoc, "//wp:effectExtent", "r", "590550");
- assertXPath(pXmlDoc, "//wp:effectExtent", "t", "590550");
- assertXPath(pXmlDoc, "//wp:effectExtent", "b", "571500");
+ assertXPath(pXmlDoc, "//wp:effectExtent"_ostr, "l"_ostr, "609600");
+ assertXPath(pXmlDoc, "//wp:effectExtent"_ostr, "r"_ostr, "590550");
+ assertXPath(pXmlDoc, "//wp:effectExtent"_ostr, "t"_ostr, "590550");
+ assertXPath(pXmlDoc, "//wp:effectExtent"_ostr, "b"_ostr, "571500");
}
DECLARE_OOXMLEXPORT_TEST(testEm, "em.docx")
@@ -683,7 +683,7 @@ CPPUNIT_TEST_FIXTURE(Test, testParagraphMarkNonempty)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// There were two <w:sz> elements, make sure the 40 one is dropped and the 20 one is kept.
- assertXPath(pXmlDoc, "//w:p/w:pPr/w:rPr/w:sz", "val", "20");
+ assertXPath(pXmlDoc, "//w:p/w:pPr/w:rPr/w:sz"_ostr, "val"_ostr, "20");
}
DECLARE_OOXMLEXPORT_TEST(testPageBreakBefore, "page-break-before.docx")
@@ -770,7 +770,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOoxmlNumListZHTW)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml");
- assertXPath ( pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt","val","taiwaneseCountingThousand" );
+ assertXPath ( pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt"_ostr,"val"_ostr,"taiwaneseCountingThousand" );
}
CPPUNIT_TEST_FIXTURE(Test, testOoxmlNumListZHCN)
@@ -779,7 +779,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOoxmlNumListZHCN)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml");
- assertXPath ( pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt","val","chineseCountingThousand" );
+ assertXPath ( pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt"_ostr,"val"_ostr,"chineseCountingThousand" );
}
CPPUNIT_TEST_FIXTURE(Test, testOOxmlOutlineNumberTypes)
@@ -788,31 +788,31 @@ CPPUNIT_TEST_FIXTURE(Test, testOOxmlOutlineNumberTypes)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:pStyle", "val", "Heading1");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt", "val", "none");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[2]/w:numFmt", "val", "decimalEnclosedCircle");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[3]/w:numFmt", "val", "decimal"); // CHARS_GREEK_UPPER_LETTER fallback to decimal
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[4]/w:numFmt", "val", "decimal"); // CHARS_GREEK_LOWER_LETTER fallback to decimal
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[5]/w:numFmt", "val", "arabicAlpha");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[6]/w:numFmt", "val", "hindiVowels");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[7]/w:numFmt", "val", "thaiLetters");
-
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[1]/w:numFmt", "val", "decimal");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[2]/w:numFmt", "val", "decimal");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[3]/w:numFmt", "val", "decimal");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[4]/w:numFmt", "val", "decimal");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[5]/w:numFmt", "val", "russianUpper");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[6]/w:numFmt", "val", "russianLower");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[7]/w:numFmt", "val", "russianUpper");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[8]/w:numFmt", "val", "russianLower");
-
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[1]/w:numFmt", "val", "decimal");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[2]/w:numFmt", "val", "decimal");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[3]/w:numFmt", "val", "decimal");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[4]/w:numFmt", "val", "decimal");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[5]/w:numFmt", "val", "decimal");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[6]/w:numFmt", "val", "decimal");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[7]/w:numFmt", "val", "decimal");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:pStyle"_ostr, "val"_ostr, "Heading1");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt"_ostr, "val"_ostr, "none");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[2]/w:numFmt"_ostr, "val"_ostr, "decimalEnclosedCircle");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[3]/w:numFmt"_ostr, "val"_ostr, "decimal"); // CHARS_GREEK_UPPER_LETTER fallback to decimal
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[4]/w:numFmt"_ostr, "val"_ostr, "decimal"); // CHARS_GREEK_LOWER_LETTER fallback to decimal
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[5]/w:numFmt"_ostr, "val"_ostr, "arabicAlpha");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[6]/w:numFmt"_ostr, "val"_ostr, "hindiVowels");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[7]/w:numFmt"_ostr, "val"_ostr, "thaiLetters");
+
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[1]/w:numFmt"_ostr, "val"_ostr, "decimal");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[2]/w:numFmt"_ostr, "val"_ostr, "decimal");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[3]/w:numFmt"_ostr, "val"_ostr, "decimal");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[4]/w:numFmt"_ostr, "val"_ostr, "decimal");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[5]/w:numFmt"_ostr, "val"_ostr, "russianUpper");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[6]/w:numFmt"_ostr, "val"_ostr, "russianLower");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[7]/w:numFmt"_ostr, "val"_ostr, "russianUpper");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[8]/w:numFmt"_ostr, "val"_ostr, "russianLower");
+
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[1]/w:numFmt"_ostr, "val"_ostr, "decimal");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[2]/w:numFmt"_ostr, "val"_ostr, "decimal");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[3]/w:numFmt"_ostr, "val"_ostr, "decimal");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[4]/w:numFmt"_ostr, "val"_ostr, "decimal");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[5]/w:numFmt"_ostr, "val"_ostr, "decimal");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[6]/w:numFmt"_ostr, "val"_ostr, "decimal");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[7]/w:numFmt"_ostr, "val"_ostr, "decimal");
}
@@ -842,7 +842,7 @@ DECLARE_OOXMLEXPORT_TEST(testNumOverrideLvltext, "num-override-lvltext.docx")
CPPUNIT_ASSERT_EQUAL(OUString("1.1"), getProperty<OUString>(xPara, "ListLabelString"));
// The paragraph marker's red font color was inherited by the number portion, this was ff0000.
- CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), parseDump("//SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']/SwFont", "color"));
+ CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), parseDump("//SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']/SwFont"_ostr, "color"_ostr));
}
DECLARE_OOXMLEXPORT_TEST(testNumOverrideStart, "num-override-start.docx")
@@ -863,10 +863,10 @@ DECLARE_OOXMLEXPORT_TEST(testTextboxRightEdge, "textbox-right-edge.docx")
// I'm fairly sure this is not specific to DOCX, but the doc model created
// by the ODF import doesn't trigger this bug, so let's test this here
// instead of uiwriter.
- int nShapeLeft = parseDump("//anchored/SwAnchoredDrawObject/bounds", "left").toInt32();
- int nShapeWidth = parseDump("//anchored/SwAnchoredDrawObject/bounds", "width").toInt32();
- int nTextboxLeft = parseDump("//anchored/fly/infos/bounds", "left").toInt32();
- int nTextboxWidth = parseDump("//anchored/fly/infos/bounds", "width").toInt32();
+ int nShapeLeft = parseDump("//anchored/SwAnchoredDrawObject/bounds"_ostr, "left"_ostr).toInt32();
+ int nShapeWidth = parseDump("//anchored/SwAnchoredDrawObject/bounds"_ostr, "width"_ostr).toInt32();
+ int nTextboxLeft = parseDump("//anchored/fly/infos/bounds"_ostr, "left"_ostr).toInt32();
+ int nTextboxWidth = parseDump("//anchored/fly/infos/bounds"_ostr, "width"_ostr).toInt32();
// This is a rectangle, make sure the right edge of the textbox is still
// inside the draw shape.
CPPUNIT_ASSERT(nShapeLeft + nShapeWidth >= nTextboxLeft + nTextboxWidth);
@@ -1012,12 +1012,12 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf118682)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Formula fields were completely missing.
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r/w:fldChar", 3);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r/w:fldChar", 3);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r/w:fldChar"_ostr, 3);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r/w:fldChar"_ostr, 3);
// Cell references were parenthesized: <A1>+<A2> and SUM(<A1:A3>)
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r[2]/w:instrText", " =A1+A2");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r[2]/w:instrText", " =SUM(A1:A3)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r[2]/w:instrText"_ostr, " =A1+A2");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r[2]/w:instrText"_ostr, " =SUM(A1:A3)");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf133163)
@@ -1026,12 +1026,12 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133163)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Formula cells were completely missing.
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r/w:fldChar", 3);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r/w:fldChar", 3);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r/w:fldChar"_ostr, 3);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r/w:fldChar"_ostr, 3);
// Cell references were parenthesized: <A1>+<A2> and SUM(<A1:A3>)
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r[2]/w:instrText", " =A1+A2");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r[2]/w:instrText", " =SUM(A1:A3)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r[2]/w:instrText"_ostr, " =A1+A2");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r[2]/w:instrText"_ostr, " =SUM(A1:A3)");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf133647)
@@ -1040,14 +1040,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133647)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Keep original formula during round-trip
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[4]/w:p/w:r[2]/w:instrText", " =SUM(A1,B1)");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc[4]/w:p/w:r[2]/w:instrText", " =SUM(C1:D1)");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc[4]/w:p/w:r[2]/w:instrText", " =SUM(A1,5,B1:C1,6)");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[7]/w:tc[4]/w:p/w:r[2]/w:instrText", " =(1+2)*SUM(C1,D1)");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[8]/w:tc[4]/w:p/w:r[2]/w:instrText", " =3*(2+SUM(A1:C1)+7)");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[9]/w:tc[4]/w:p/w:r[2]/w:instrText", " =1+(SUM(1,2))");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[10]/w:tc[4]/w:p/w:r[2]/w:instrText", " =(SUM(C1,5)*(2+7))*(3+SUM(1,B1))");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[11]/w:tc[4]/w:p/w:r[2]/w:instrText", " =sum(a1,b1)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[4]/w:p/w:r[2]/w:instrText"_ostr, " =SUM(A1,B1)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc[4]/w:p/w:r[2]/w:instrText"_ostr, " =SUM(C1:D1)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc[4]/w:p/w:r[2]/w:instrText"_ostr, " =SUM(A1,5,B1:C1,6)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[7]/w:tc[4]/w:p/w:r[2]/w:instrText"_ostr, " =(1+2)*SUM(C1,D1)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[8]/w:tc[4]/w:p/w:r[2]/w:instrText"_ostr, " =3*(2+SUM(A1:C1)+7)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[9]/w:tc[4]/w:p/w:r[2]/w:instrText"_ostr, " =1+(SUM(1,2))");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[10]/w:tc[4]/w:p/w:r[2]/w:instrText"_ostr, " =(SUM(C1,5)*(2+7))*(3+SUM(1,B1))");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[11]/w:tc[4]/w:p/w:r[2]/w:instrText"_ostr, " =sum(a1,b1)");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf123386)
@@ -1056,16 +1056,16 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123386)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Keep original formula during round-trip
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[4]/w:p/w:r[2]/w:instrText", " =A1 < 2");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[4]/w:p/w:r[2]/w:instrText", " =B1 > 1");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc[4]/w:p/w:r[2]/w:instrText", " =C1=3");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc[4]/w:p/w:r[2]/w:instrText", " =D1 <> 3");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[7]/w:tc[4]/w:p/w:r[2]/w:instrText", " =AND(A1=1,B1=2)");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[8]/w:tc[4]/w:p/w:r[2]/w:instrText", " =AND((A1<1),(B1<>2))");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[9]/w:tc[4]/w:p/w:r[2]/w:instrText", " =OR(A1=1,B1=2)");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[10]/w:tc[4]/w:p/w:r[2]/w:instrText", " =OR(TRUE,FALSE)");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[11]/w:tc[4]/w:p/w:r[2]/w:instrText", " =NOT(TRUE)");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[12]/w:tc[4]/w:p/w:r[2]/w:instrText", " =AND(1,DEFINED(ABC1))");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[4]/w:p/w:r[2]/w:instrText"_ostr, " =A1 < 2");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[4]/w:p/w:r[2]/w:instrText"_ostr, " =B1 > 1");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc[4]/w:p/w:r[2]/w:instrText"_ostr, " =C1=3");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc[4]/w:p/w:r[2]/w:instrText"_ostr, " =D1 <> 3");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[7]/w:tc[4]/w:p/w:r[2]/w:instrText"_ostr, " =AND(A1=1,B1=2)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[8]/w:tc[4]/w:p/w:r[2]/w:instrText"_ostr, " =AND((A1<1),(B1<>2))");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[9]/w:tc[4]/w:p/w:r[2]/w:instrText"_ostr, " =OR(A1=1,B1=2)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[10]/w:tc[4]/w:p/w:r[2]/w:instrText"_ostr, " =OR(TRUE,FALSE)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[11]/w:tc[4]/w:p/w:r[2]/w:instrText"_ostr, " =NOT(TRUE)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[12]/w:tc[4]/w:p/w:r[2]/w:instrText"_ostr, " =AND(1,DEFINED(ABC1))");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf123389)
@@ -1074,8 +1074,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123389)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Keep original formula during round-trip
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[4]/w:p/w:r[2]/w:instrText", " =ROUND(2.345,1)");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[4]/w:p/w:r[2]/w:instrText", " =ROUND(A1,2)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[4]/w:p/w:r[2]/w:instrText"_ostr, " =ROUND(2.345,1)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[4]/w:p/w:r[2]/w:instrText"_ostr, " =ROUND(A1,2)");
}
DECLARE_OOXMLEXPORT_TEST(testTdf106953, "tdf106953.docx")
@@ -1102,8 +1102,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf115094v3)
// floating table is now exported directly without surrounding frame
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblpPr", "tblpX", "1996");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblpPr", "tblpY", "1064");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblpPr"_ostr, "tblpX"_ostr, "1996");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblpPr"_ostr, "tblpY"_ostr, "1064");
}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
index 50dc74101a62..3036f83e488e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
@@ -131,7 +131,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFloattableNestedDOCXExport)
// - Expected: 2
// - Actual : 1
// i.e. the inner floating table was lost.
- assertXPath(pXmlDoc, "//w:tblpPr", 2);
+ assertXPath(pXmlDoc, "//w:tblpPr"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(Test, testFloattableNestedCellStartDOCXExport)
@@ -148,7 +148,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFloattableNestedCellStartDOCXExport)
// - Expected: 1
// - Actual : 0
// i.e. the inner <w:tbl> was between the two <w:tr>, not inside the C1 cell.
- assertXPath(pXmlDoc, "//w:tc/w:tbl/w:tblPr/w:tblpPr", 1);
+ assertXPath(pXmlDoc, "//w:tc/w:tbl/w:tblPr/w:tblpPr"_ostr, 1);
}
DECLARE_OOXMLEXPORT_TEST(testWpgOnly, "wpg-only.docx")
@@ -168,13 +168,13 @@ DECLARE_OOXMLEXPORT_TEST(testWpgNested, "wpg-nested.docx")
// This failed, the right edge of the shape was outside the page
// boundaries.
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- sal_Int32 nPageLeft = getXPath(pXmlDoc, "/root/page[1]/infos/bounds", "left").toInt32();
- sal_Int32 nPageWidth = getXPath(pXmlDoc, "/root/page[1]/infos/bounds", "width").toInt32();
+ sal_Int32 nPageLeft = getXPath(pXmlDoc, "/root/page[1]/infos/bounds"_ostr, "left"_ostr).toInt32();
+ sal_Int32 nPageWidth = getXPath(pXmlDoc, "/root/page[1]/infos/bounds"_ostr, "width"_ostr).toInt32();
sal_Int32 nShapeLeft
- = getXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/SwAnchoredDrawObject/bounds", "left")
+ = getXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/SwAnchoredDrawObject/bounds"_ostr, "left"_ostr)
.toInt32();
sal_Int32 nShapeWidth
- = getXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/SwAnchoredDrawObject/bounds", "width")
+ = getXPath(pXmlDoc, "/root/page[1]/body/txt/anchored/SwAnchoredDrawObject/bounds"_ostr, "width"_ostr)
.toInt32();
// Make sure the shape is within the page bounds.
CPPUNIT_ASSERT_GREATEREQUAL(nShapeLeft + nShapeWidth, nPageLeft + nPageWidth);
@@ -213,11 +213,11 @@ CPPUNIT_TEST_FIXTURE(Test, testFontEsc)
loadAndSave("test_tdf120412.docx");
xmlDocUniquePtr pXmlDoc =parseExport("word/document.xml");
// don't lose the run with superscript formatting
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r", 2);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r"_ostr, 2);
// Superscript should be raised by 100% (11pt). Was 110% (12pt)
// calculated using docDefault with fontsize 10pt (note only w:szCs defined as 11pt, not w:sz)
// instead of inherited normal paraStyle fontsize 11pt (related to tdf#99602)
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w:position","val", "22");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w:position"_ostr,"val"_ostr, "22");
}
DECLARE_OOXMLEXPORT_TEST(testMceWpg, "mce-wpg.docx")
@@ -370,8 +370,8 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo73389)
// The recent fix uses fixed width again, according to the fixed width cells.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tblPr/w:tblW","type","dxa");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tblPr/w:tblW","w","1611");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tblPr/w:tblW"_ostr,"type"_ostr,"dxa");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tblPr/w:tblW"_ostr,"w"_ostr,"1611");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf133735)
@@ -379,11 +379,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133735)
loadAndSave("fdo73389.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tr[2]/w:tc[1]/w:p/w:pPr/w:spacing", "after", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tr[2]/w:tc[1]/w:p/w:pPr/w:spacing"_ostr, "after"_ostr, "0");
// This was 200
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing", "after", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tr[1]/w:tc[2]/w:p/w:pPr/w:spacing", "after", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tr[1]/w:tc[3]/w:p/w:pPr/w:spacing", "after", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing"_ostr, "after"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tr[1]/w:tc[2]/w:p/w:pPr/w:spacing"_ostr, "after"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tr[1]/w:tc[3]/w:p/w:pPr/w:spacing"_ostr, "after"_ostr, "0");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf134569_nestedTable)
@@ -399,13 +399,13 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf59274)
// Table with "auto" table width and incomplete grid: 11 columns, but only 4 gridCol elements.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblW", "type", "dxa");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblW"_ostr, "type"_ostr, "dxa");
// This was 7349: sum of the cell widths in first row, but the table width is determined by a longer row later.
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblW", "w", "9048");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblW"_ostr, "w"_ostr, "9048");
// This was 1224: too narrow first cell in first row
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcW", "w", "4291");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcW"_ostr, "w"_ostr, "4291");
// This was 3674: too wide last cell in first row
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[4]/w:tcPr/w:tcW", "w", "1695");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[4]/w:tcPr/w:tcW"_ostr, "w"_ostr, "1695");
}
DECLARE_OOXMLEXPORT_TEST(testDMLGroupshapeSdt, "dml-groupshape-sdt.docx")
@@ -579,7 +579,7 @@ DECLARE_OOXMLEXPORT_TEST(testLargeTwips, "large-twips.docx" )
{
// cp#1000043: MSO seems to ignore large twips values, we didn't, which resulted in different
// layout of broken documents (text not visible in this specific document).
- OUString width = parseDump( "/root/page/body/tab/row[1]/cell[1]/txt/infos/bounds", "width" );
+ OUString width = parseDump( "/root/page/body/tab/row[1]/cell[1]/txt/infos/bounds"_ostr, "width"_ostr );
CPPUNIT_ASSERT( width.toInt32() > 0 );
}
@@ -587,7 +587,7 @@ DECLARE_OOXMLEXPORT_TEST(testNegativeCellMarginTwips, "negative-cell-margin-twip
{
// Slightly related to cp#1000043, the twips value was negative, which wrapped around somewhere,
// while MSO seems to ignore that as well.
- OUString width = parseDump( "/root/page/body/tab/row[1]/cell[1]/txt/infos/bounds", "width" );
+ OUString width = parseDump( "/root/page/body/tab/row[1]/cell[1]/txt/infos/bounds"_ostr, "width"_ostr );
CPPUNIT_ASSERT( width.toInt32() > 0 );
}
@@ -601,8 +601,8 @@ DECLARE_OOXMLEXPORT_TEST(testFdo38414, "fdo38414.docx")
uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY);
uno::Reference<table::XTableColumns> xTableColumns = xTextTable->getColumns();
CPPUNIT_ASSERT_EQUAL( sal_Int32( 5 ), xTableColumns->getCount());
- OUString height3 = parseDump("/root/page/body/tab/row[1]/cell[4]/infos/bounds", "height" );
- OUString height4 = parseDump("/root/page/body/tab/row[1]/cell[5]/infos/bounds", "height" );
+ OUString height3 = parseDump("/root/page/body/tab/row[1]/cell[4]/infos/bounds"_ostr, "height"_ostr );
+ OUString height4 = parseDump("/root/page/body/tab/row[1]/cell[5]/infos/bounds"_ostr, "height"_ostr );
CPPUNIT_ASSERT_EQUAL( height3, height4 );
}
@@ -638,9 +638,9 @@ DECLARE_OOXMLEXPORT_TEST(testGridBefore, "gridbefore.docx")
uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY);
uno::Reference<table::XTableColumns> xTableColumns = xTextTable->getColumns();
CPPUNIT_ASSERT_EQUAL( sal_Int32( 3 ), xTableColumns->getCount());
- OUString textA3 = parseDump("/root/page/body/tab/row[1]/cell[3]/txt/text()" );
- OUString leftA3 = parseDump("/root/page/body/tab/row[1]/cell[3]/infos/bounds", "left" );
- OUString leftB2 = parseDump("/root/page/body/tab/row[2]/cell[2]/infos/bounds", "left" );
+ OUString textA3 = parseDump("/root/page/body/tab/row[1]/cell[3]/txt/text()"_ostr );
+ OUString leftA3 = parseDump("/root/page/body/tab/row[1]/cell[3]/infos/bounds"_ostr, "left"_ostr );
+ OUString leftB2 = parseDump("/root/page/body/tab/row[2]/cell[2]/infos/bounds"_ostr, "left"_ostr );
CPPUNIT_ASSERT_EQUAL( OUString( "A3" ), textA3 );
CPPUNIT_ASSERT( leftA3.toInt32() > leftB2.toInt32());
}
@@ -650,7 +650,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf116194)
loadAndSave("tdf116194.docx");
// The problem was that the importer lost consecutive tables with w:gridBefore
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl", 2);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf134606)
@@ -658,7 +658,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf134606)
loadAndSave("tdf134606.docx");
// The problem was that the importer lost the nested table structure with w:gridBefore
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl"_ostr);
}
DECLARE_OOXMLEXPORT_TEST(testMsoBrightnessContrast, "msobrightnesscontrast.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 4d5f56969272..a4f01adaa7c2 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -162,20 +162,20 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121561_tocTitle)
{
loadAndSave("tdf121456_tabsOffset.odt");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r/w:t", "Inhaltsverzeichnis");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r/w:instrText", " TOC \\f \\o \"1-9\" \\h");
- assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:docPartObj/w:docPartGallery", "val", "Table of Contents");
- assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:docPartObj/w:docPartUnique", 1);
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r/w:t"_ostr, "Inhaltsverzeichnis");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r/w:instrText"_ostr, " TOC \\f \\o \"1-9\" \\h");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:docPartObj/w:docPartGallery"_ostr, "val"_ostr, "Table of Contents");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:docPartObj/w:docPartUnique"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf129525)
{
loadAndSave("tdf129525.rtf");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[4]/w:t", "Overview");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[5]/w:t", "3");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:r[1]/w:t", "More detailed description");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:r[2]/w:t", "4");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[4]/w:t"_ostr, "Overview");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[5]/w:t"_ostr, "3");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:r[1]/w:t"_ostr, "More detailed description");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:r[2]/w:t"_ostr, "4");
}
// Related issue tdf#121561: w:sdt/w:sdtContent around TOC
@@ -203,7 +203,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121561_tocTitleDocx)
CPPUNIT_ASSERT_EQUAL(OUString("Inhaltsverzeichnis"), getProperty<OUString>(xTOCIndex, "Title"));
// ensure TOC end-field mark is placed inside TOC section
- assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[16]/w:r/w:fldChar", "fldCharType", "end");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[16]/w:r/w:fldChar"_ostr, "fldCharType"_ostr, "end");
}
DECLARE_OOXMLEXPORT_TEST(testTdf106174_rtlParaAlign, "tdf106174_rtlParaAlign.docx")
@@ -248,9 +248,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf76683_negativeTwipsMeasure)
{
loadAndSave("tdf76683_negativeTwipsMeasure.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:cols/w:col", 2);
- sal_uInt32 nColumn1 = getXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:cols/w:col[1]", "w").toUInt32();
- sal_uInt32 nColumn2 = getXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:cols/w:col[2]", "w").toUInt32();
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:cols/w:col"_ostr, 2);
+ sal_uInt32 nColumn1 = getXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:cols/w:col[1]"_ostr, "w"_ostr).toUInt32();
+ sal_uInt32 nColumn2 = getXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:cols/w:col[2]"_ostr, "w"_ostr).toUInt32();
CPPUNIT_ASSERT( nColumn1 > nColumn2 );
}
@@ -265,17 +265,17 @@ DECLARE_OOXMLEXPORT_TEST(testTdf112694, "tdf112694.docx")
CPPUNIT_TEST_FIXTURE(Test, testTdf113849_evenAndOddHeaders)
{
loadAndReload("tdf113849_evenAndOddHeaders.odt");
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Header2 text", OUString("L. J. Kendall"), parseDump("/root/page[2]/header/txt"));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Footer2 text", OUString("*"), parseDump("/root/page[2]/footer/txt"));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Header2 text", OUString("L. J. Kendall"), parseDump("/root/page[2]/header/txt"_ostr));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Footer2 text", OUString("*"), parseDump("/root/page[2]/footer/txt"_ostr));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Header3 text", OUString("Shadow Hunt"), parseDump("/root/page[3]/header/txt"));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Footer3 text", OUString("*"), parseDump("/root/page[3]/footer/txt"));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Header3 text", OUString("Shadow Hunt"), parseDump("/root/page[3]/header/txt"_ostr));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Footer3 text", OUString("*"), parseDump("/root/page[3]/footer/txt"_ostr));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Header4 text", OUString("L. J. Kendall"), parseDump("/root/page[4]/header/txt"));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Footer4 text", OUString("*"), parseDump("/root/page[4]/footer/txt"));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Header4 text", OUString("L. J. Kendall"), parseDump("/root/page[4]/header/txt"_ostr));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Footer4 text", OUString("*"), parseDump("/root/page[4]/footer/txt"_ostr));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Footer5 text", OUString(""), parseDump("/root/page[5]/footer/txt"));
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Footer6 text", OUString(""), parseDump("/root/page[6]/footer/txt"));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Footer5 text", OUString(""), parseDump("/root/page[5]/footer/txt"_ostr));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Footer6 text", OUString(""), parseDump("/root/page[6]/footer/txt"_ostr));
CPPUNIT_ASSERT_EQUAL_MESSAGE("Number of pages", 6, getPages() );
}
@@ -382,8 +382,8 @@ CPPUNIT_TEST_FIXTURE(Test, testParagraphSplitOnSectionBorder)
// Test document has only two paragraphs. After splitting, it should contain
// three of them.
- assertXPath(pXmlDoc, "//w:sectPr", 2);
- assertXPath(pXmlDoc, "//w:p", 3);
+ assertXPath(pXmlDoc, "//w:sectPr"_ostr, 2);
+ assertXPath(pXmlDoc, "//w:p"_ostr, 3);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf44832_testSectionWithDifferentHeader)
@@ -391,7 +391,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf44832_testSectionWithDifferentHeader)
loadAndSave("tdf44832_section_new_header.odt");
CPPUNIT_ASSERT_EQUAL(2, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:headerReference", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:headerReference"_ostr, 1);
}
DECLARE_OOXMLEXPORT_TEST(testSignatureLineShape, "signature-line-all-props-set.docx")
@@ -453,13 +453,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf113183, "tdf113183.docx")
// The horizontal positioning of the star shape affected the positioning of
// the triangle one, so the triangle was outside the page frame.
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- sal_Int32 nPageLeft = getXPath(pXmlDoc, "/root/page[1]/infos/bounds", "left").toInt32();
- sal_Int32 nPageWidth = getXPath(pXmlDoc, "/root/page[1]/infos/bounds", "width").toInt32();
+ sal_Int32 nPageLeft = getXPath(pXmlDoc, "/root/page[1]/infos/bounds"_ostr, "left"_ostr).toInt32();
+ sal_Int32 nPageWidth = getXPath(pXmlDoc, "/root/page[1]/infos/bounds"_ostr, "width"_ostr).toInt32();
sal_Int32 nShapeLeft
- = getXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[2]/bounds", "left")
+ = getXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[2]/bounds"_ostr, "left"_ostr)
.toInt32();
sal_Int32 nShapeWidth
- = getXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[2]/bounds", "width")
+ = getXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[2]/bounds"_ostr, "width"_ostr)
.toInt32();
// Make sure the second triangle shape is within the page bounds (with ~1px tolerance).
CPPUNIT_ASSERT_GREATEREQUAL(nShapeLeft + nShapeWidth, nPageLeft + nPageWidth + 21);
@@ -563,21 +563,21 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf137655)
loadAndSave("tdf137655.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// These were 280.
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:p[1]/w:pPr/w:spacing", "before", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[2]/w:p[1]/w:pPr/w:spacing", "before", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:p[1]/w:pPr/w:spacing"_ostr, "before"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[2]/w:p[1]/w:pPr/w:spacing"_ostr, "before"_ostr, "0");
//tdf#142542: ensure that the original beforeAutospacing = 0 is not changed.
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:p[1]/w:pPr/w:spacing", "beforeAutospacing", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:p[1]/w:pPr/w:spacing"_ostr, "beforeAutospacing"_ostr, "0");
}
DECLARE_OOXMLEXPORT_TEST(testTdf120511_eatenSection, "tdf120511_eatenSection.docx")
{
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- sal_Int32 nHeight = getXPath(pXmlDoc, "/root/page[1]/infos/prtBounds", "height").toInt32();
- sal_Int32 nWidth = getXPath(pXmlDoc, "/root/page[1]/infos/prtBounds", "width").toInt32();
+ sal_Int32 nHeight = getXPath(pXmlDoc, "/root/page[1]/infos/prtBounds"_ostr, "height"_ostr).toInt32();
+ sal_Int32 nWidth = getXPath(pXmlDoc, "/root/page[1]/infos/prtBounds"_ostr, "width"_ostr).toInt32();
CPPUNIT_ASSERT_MESSAGE( "Page1 is portrait", nWidth < nHeight );
- nHeight = getXPath(pXmlDoc, "/root/page[2]/infos/prtBounds", "height").toInt32();
- nWidth = getXPath(pXmlDoc, "/root/page[2]/infos/prtBounds", "width").toInt32();
+ nHeight = getXPath(pXmlDoc, "/root/page[2]/infos/prtBounds"_ostr, "height"_ostr).toInt32();
+ nWidth = getXPath(pXmlDoc, "/root/page[2]/infos/prtBounds"_ostr, "width"_ostr).toInt32();
CPPUNIT_ASSERT_MESSAGE( "Page2 is landscape", nWidth > nHeight );
}
@@ -608,7 +608,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPageBreak_after)
loadAndReload("pageBreak_after.odt");
// The problem was that the page breakAfter put the empty page BEFORE the table
xmlDocUniquePtr pDump = parseLayoutDump();
- assertXPath(pDump, "/root/page[1]/body/tab", 1);
+ assertXPath(pDump, "/root/page[1]/body/tab"_ostr, 1);
// There should be two pages actually - a blank page after a page break.
CPPUNIT_ASSERT_EQUAL_MESSAGE("Did you fix?? Table should be on page one of two", 1, getPages());
}
@@ -724,8 +724,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf82177_tblBorders, "tdf82177_tblBorders.docx")
DECLARE_OOXMLEXPORT_TEST(testTdf119760_positionCellBorder, "tdf119760_positionCellBorder.docx")
{
//inconsistent in Word even. 2016 positions on last row, 2003 positions on first cell.
- sal_Int32 nRowLeft = parseDump("/root/page/body/tab[4]/row[1]/infos/bounds", "left").toInt32();
- sal_Int32 nTextLeft = parseDump("/root/page/body/tab[4]/row[1]/cell[1]/txt/infos/bounds", "left").toInt32();
+ sal_Int32 nRowLeft = parseDump("/root/page/body/tab[4]/row[1]/infos/bounds"_ostr, "left"_ostr).toInt32();
+ sal_Int32 nTextLeft = parseDump("/root/page/body/tab[4]/row[1]/cell[1]/txt/infos/bounds"_ostr, "left"_ostr).toInt32();
CPPUNIT_ASSERT( nRowLeft < nTextLeft );
}
@@ -753,7 +753,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf116985, "tdf116985.docx")
// spacing to text on the left/right side. So ideal width would be 4032,
// was 3431. Allow one pixel tolerance, though.
sal_Int32 nWidth
- = parseDump("/root/page[1]/body/txt[1]/anchored/fly/infos/bounds", "width").toInt32();
+ = parseDump("/root/page[1]/body/txt[1]/anchored/fly/infos/bounds"_ostr, "width"_ostr).toInt32();
CPPUNIT_ASSERT(nWidth > 4000);
}
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
index 21e3a97c362e..78ec87bafac6 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
@@ -672,53 +672,54 @@ DECLARE_OOXMLEXPORT_TEST(testTdf112202, "090716_Studentische_Arbeit_VWS.docx")
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// page 1 header: 1 paragraph, 2 flys, 1 draw object
- assertXPath(pXmlDoc, "/root/page[1]/header/txt", 1);
- assertXPath(pXmlDoc, "/root/page[1]/header/txt/anchored/fly", 2);
+ assertXPath(pXmlDoc, "/root/page[1]/header/txt"_ostr, 1);
+ assertXPath(pXmlDoc, "/root/page[1]/header/txt/anchored/fly"_ostr, 2);
if (isExported()) // somehow there's an additional shape on re-import?
- assertXPath(pXmlDoc, "/root/page[1]/header/txt/anchored/SwAnchoredDrawObject", 2);
+ assertXPath(pXmlDoc, "/root/page[1]/header/txt/anchored/SwAnchoredDrawObject"_ostr, 2);
else
- assertXPath(pXmlDoc, "/root/page[1]/header/txt/anchored/SwAnchoredDrawObject", 1);
+ assertXPath(pXmlDoc, "/root/page[1]/header/txt/anchored/SwAnchoredDrawObject"_ostr, 1);
// page 2 header: 3 paragraphs, 1 table, 1 fly on last paragraph
- assertXPath(pXmlDoc, "/root/page[2]/header/txt", 3);
- assertXPath(pXmlDoc, "/root/page[2]/header/tab", 1);
- assertXPath(pXmlDoc, "/root/page[2]/header/txt/anchored/fly", 1);
+ assertXPath(pXmlDoc, "/root/page[2]/header/txt"_ostr, 3);
+ assertXPath(pXmlDoc, "/root/page[2]/header/tab"_ostr, 1);
+ assertXPath(pXmlDoc, "/root/page[2]/header/txt/anchored/fly"_ostr, 1);
// page 3 header: 1 table, 1 paragraph, no text
- assertXPath(pXmlDoc, "/root/page[3]/header/txt", 1);
- assertXPath(pXmlDoc, "/root/page[3]/header/tab", 1);
+ assertXPath(pXmlDoc, "/root/page[3]/header/txt"_ostr, 1);
+ assertXPath(pXmlDoc, "/root/page[3]/header/tab"_ostr, 1);
assertXPath(pXmlDoc,
- "/root/page[3]/header/tab/row/cell/txt/SwParaPortion/SwLineLayout/child::*", 0);
- assertXPath(pXmlDoc, "/root/page[3]/header//anchored", 0);
+ "/root/page[3]/header/tab/row/cell/txt/SwParaPortion/SwLineLayout/child::*"_ostr,
+ 0);
+ assertXPath(pXmlDoc, "/root/page[3]/header//anchored"_ostr, 0);
// tdf#149313: ensure 3rd page does not have extra empty paragraph at top
- assertXPathContent(pXmlDoc, "/root/page[3]/body//txt", "AUFGABENSTELLUNG");
+ assertXPathContent(pXmlDoc, "/root/page[3]/body//txt"_ostr, "AUFGABENSTELLUNG");
// page 4 header: 1 table, 1 paragraph, with text
- assertXPath(pXmlDoc, "/root/page[4]/header/txt", 1);
- assertXPath(pXmlDoc, "/root/page[4]/header/tab", 1);
+ assertXPath(pXmlDoc, "/root/page[4]/header/txt"_ostr, 1);
+ assertXPath(pXmlDoc, "/root/page[4]/header/tab"_ostr, 1);
assertXPath(
pXmlDoc,
- "/root/page[4]/header/tab/row[1]/cell[1]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion",
- "portion", "Titel der studentischen Arbeit");
- assertXPath(pXmlDoc, "/root/page[4]/header//anchored", 0);
+ "/root/page[4]/header/tab/row[1]/cell[1]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "portion"_ostr, "Titel der studentischen Arbeit");
+ assertXPath(pXmlDoc, "/root/page[4]/header//anchored"_ostr, 0);
// page 5: same as page 4
- assertXPath(pXmlDoc, "/root/page[5]/header/txt", 1);
- assertXPath(pXmlDoc, "/root/page[5]/header/tab", 1);
+ assertXPath(pXmlDoc, "/root/page[5]/header/txt"_ostr, 1);
+ assertXPath(pXmlDoc, "/root/page[5]/header/tab"_ostr, 1);
assertXPath(
pXmlDoc,
- "/root/page[5]/header/tab/row[1]/cell[1]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion",
- "portion", "Titel der studentischen Arbeit");
- assertXPath(pXmlDoc, "/root/page[5]/header//anchored", 0);
+ "/root/page[5]/header/tab/row[1]/cell[1]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "portion"_ostr, "Titel der studentischen Arbeit");
+ assertXPath(pXmlDoc, "/root/page[5]/header//anchored"_ostr, 0);
// page 6: same as page 4
- assertXPath(pXmlDoc, "/root/page[6]/header/txt", 1);
- assertXPath(pXmlDoc, "/root/page[6]/header/tab", 1);
+ assertXPath(pXmlDoc, "/root/page[6]/header/txt"_ostr, 1);
+ assertXPath(pXmlDoc, "/root/page[6]/header/tab"_ostr, 1);
assertXPath(
pXmlDoc,
- "/root/page[6]/header/tab/row[1]/cell[1]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion",
- "portion", "Titel der studentischen Arbeit");
- assertXPath(pXmlDoc, "/root/page[6]/header//anchored", 0);
+ "/root/page[6]/header/tab/row[1]/cell[1]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "portion"_ostr, "Titel der studentischen Arbeit");
+ assertXPath(pXmlDoc, "/root/page[6]/header//anchored"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf79435_legacyInputFields)
@@ -780,10 +781,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf79435_legacyInputFields)
CPPUNIT_ASSERT_EQUAL(OUString("date"), sTmp);
xmlDocUniquePtr pXmlDoc = parseExport("word/settings.xml");
- assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[1]", "name", "compatibilityMode");
- assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[1]", "uri",
+ assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[1]"_ostr, "name"_ostr,
+ "compatibilityMode");
+ assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[1]"_ostr, "uri"_ostr,
"http://schemas.microsoft.com/office/word");
- assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[1]", "val", "11");
+ assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[1]"_ostr, "val"_ostr, "11");
}
DECLARE_OOXMLEXPORT_TEST(testTdf120224_textControlCrossRef, "tdf120224_textControlCrossRef.docx")
@@ -870,22 +872,22 @@ CPPUNIT_TEST_FIXTURE(Test, testVMLShapetypeId)
assertXPath(pXmlDoc,
"/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[1]/w:r/mc:AlternateContent/"
"mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wps:wsp/wps:txbx/"
- "w:txbxContent/w:p/w:r/w:object/v:shapetype",
- "id", "_x0000_t75");
+ "w:txbxContent/w:p/w:r/w:object/v:shapetype"_ostr,
+ "id"_ostr, "_x0000_t75");
assertXPath(pXmlDoc,
"/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[1]/w:r/mc:AlternateContent/"
"mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wps:wsp/wps:txbx/"
- "w:txbxContent/w:p/w:r/w:object/v:shape",
- "type", "#_x0000_t75");
+ "w:txbxContent/w:p/w:r/w:object/v:shape"_ostr,
+ "type"_ostr, "#_x0000_t75");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf73547)
{
loadAndSave("tdf73547-dash.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- double nD = getXPath(pXmlDoc, "//a:custDash/a:ds[1]", "d").toDouble();
+ double nD = getXPath(pXmlDoc, "//a:custDash/a:ds[1]"_ostr, "d"_ostr).toDouble();
CPPUNIT_ASSERT_DOUBLES_EQUAL(105000.0, nD, 5000.0); // was 100000
- double nSp = getXPath(pXmlDoc, "//a:custDash/a:ds[1]", "sp").toDouble();
+ double nSp = getXPath(pXmlDoc, "//a:custDash/a:ds[1]"_ostr, "sp"_ostr).toDouble();
CPPUNIT_ASSERT_DOUBLES_EQUAL(35000.0, nSp, 5000.0); // was 100000
}
@@ -913,7 +915,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf105444)
loadAndSave("tdf105444.docx");
xmlDocUniquePtr pXmlComm = parseExport("word/comments.xml");
// there is no extra paragraph on Win32, only a single one.
- assertXPath(pXmlComm, "/w:comments/w:comment/w:p", 1);
+ assertXPath(pXmlComm, "/w:comments/w:comment/w:p"_ostr, 1);
}
DECLARE_OOXMLEXPORT_TEST(testTdf117137, "tdf117137.docx")
@@ -958,9 +960,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf134618)
//Without the fix it in place, it would have failed with
//- Expected: 1
//- Actual : 9
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r"_ostr, 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent", 2);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf99631)
@@ -968,14 +970,18 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf99631)
loadAndSave("tdf99631.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//w:object", 2);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object", 2);
+ assertXPath(pXmlDoc, "//w:object"_ostr, 2);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object"_ostr, 2);
// first XSLX OLE object (1:1 scale)
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:object[1]", "dxaOrig", "2561");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:object[1]", "dyaOrig", "513");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:object[1]"_ostr, "dxaOrig"_ostr,
+ "2561");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:object[1]"_ostr, "dyaOrig"_ostr,
+ "513");
// second XLSX OLE object (same content + 1 row, but zoomed)
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:object[1]", "dxaOrig", "2561");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:object[1]", "dyaOrig", "769");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:object[1]"_ostr, "dxaOrig"_ostr,
+ "2561");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:object[1]"_ostr, "dyaOrig"_ostr,
+ "769");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf138899)
@@ -983,10 +989,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf138899)
loadAndSave("tdf138899.docx");
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
// This was 6, not removed empty temporary paragraph at the end of the section
- assertXPath(pXmlDocument, "/w:document/w:body/w:p", 5);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p"_ostr, 5);
//tdf#134385: Paragraph property to "add space between paragraphs of the same style" was lost
- assertXPath(pXmlDocument, "//w:p[1]/w:pPr/w:contextualSpacing", "val", "false");
+ assertXPath(pXmlDocument, "//w:p[1]/w:pPr/w:contextualSpacing"_ostr, "val"_ostr, "false");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf122563)
@@ -994,9 +1000,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf122563)
loadAndSave("tdf122563.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object"_ostr, 1);
// Size of the embedded OLE spreadsheet was the bad "width:28.35pt;height:28.35pt"
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:object/v:shape", "style",
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:object/v:shape"_ostr, "style"_ostr,
"width:255.75pt;height:63.75pt;mso-wrap-distance-right:0pt");
}
@@ -1086,8 +1092,8 @@ CPPUNIT_TEST_FIXTURE(Test, testLanguageInGroupShape)
assertXPath(pXml,
"/w:document/w:body/w:p[7]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/"
"a:graphic/a:graphicData/wpg:wgp/"
- "wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:lang",
- "val", "de-DE");
+ "wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:lang"_ostr,
+ "val"_ostr, "de-DE");
}
DECLARE_OOXMLEXPORT_TEST(testTdf116883, "tdf116883.docx")
@@ -1138,7 +1144,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf131420)
{
loadAndSave("tdf131420.docx");
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:pPr/w:pBdr/w:top");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:pPr/w:pBdr/w:top"_ostr);
}
DECLARE_OOXMLEXPORT_TEST(testTdf80526_word_wrap, "tdf80526_word_wrap.docx")
@@ -1214,28 +1220,28 @@ DECLARE_OOXMLEXPORT_TEST(testTdf145720, "tdf104797.docx")
{
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// These were 0 (missing move*FromRange* elements)
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:moveFrom/w:moveFromRangeStart", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:moveFromRangeEnd", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:moveTo/w:moveToRangeStart", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:moveToRangeEnd", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:moveFrom/w:moveFromRangeStart"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:moveFromRangeEnd"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:moveTo/w:moveToRangeStart"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:moveToRangeEnd"_ostr, 1);
// paired names
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:moveFrom/w:moveFromRangeStart", "name",
- "move471382752");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:moveTo/w:moveToRangeStart", "name",
- "move471382752");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:moveFrom/w:moveFromRangeStart"_ostr,
+ "name"_ostr, "move471382752");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:moveTo/w:moveToRangeStart"_ostr,
+ "name"_ostr, "move471382752");
// mandatory authors and dates
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:moveFrom/w:moveFromRangeStart", "author",
- u"Tekijä"_ustr);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:moveTo/w:moveToRangeStart", "author",
- u"Tekijä"_ustr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:moveFrom/w:moveFromRangeStart"_ostr,
+ "author"_ostr, u"Tekijä"_ustr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:moveTo/w:moveToRangeStart"_ostr,
+ "author"_ostr, u"Tekijä"_ustr);
// no date (anonymized change)
// This failed, date was exported as w:date="0-00-00T00:00:00Z", and later "1970-01-01T00:00:00Z"
- assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p[1]/w:moveFrom/w:moveFromRangeStart",
- "date");
- assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p[2]/w:moveTo/w:moveToRangeStart",
- "date");
+ assertXPathNoAttribute(
+ pXmlDoc, "/w:document/w:body/w:p[1]/w:moveFrom/w:moveFromRangeStart"_ostr, "date"_ostr);
+ assertXPathNoAttribute(
+ pXmlDoc, "/w:document/w:body/w:p[2]/w:moveTo/w:moveToRangeStart"_ostr, "date"_ostr);
}
}
@@ -1245,18 +1251,18 @@ DECLARE_OOXMLEXPORT_TEST(testTdf150166, "tdf150166.docx")
if (isExported())
{
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//w:moveFromRangeStart", 0);
+ assertXPath(pXmlDoc, "//w:moveFromRangeStart"_ostr, 0);
// This was 2 (missing RangeStart elements, but bad unpaired RangeEnds)
- assertXPath(pXmlDoc, "//w:moveFromRangeEnd", 0);
+ assertXPath(pXmlDoc, "//w:moveFromRangeEnd"_ostr, 0);
// These were 0 (moveFrom, moveTo and t)
- assertXPath(pXmlDoc, "//w:del", 11);
- assertXPath(pXmlDoc, "//w:ins", 12);
- assertXPath(pXmlDoc, "//w:delText", 7);
+ assertXPath(pXmlDoc, "//w:del"_ostr, 11);
+ assertXPath(pXmlDoc, "//w:ins"_ostr, 12);
+ assertXPath(pXmlDoc, "//w:delText"_ostr, 7);
// no more moveFrom/moveTo to avoid of problems with ToC
- assertXPath(pXmlDoc, "//w:moveFrom", 0);
- assertXPath(pXmlDoc, "//w:moveTo", 0);
+ assertXPath(pXmlDoc, "//w:moveFrom"_ostr, 0);
+ assertXPath(pXmlDoc, "//w:moveTo"_ostr, 0);
}
}
@@ -1267,8 +1273,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf143510, "TC-table-DnD-move.docx")
{
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// This was 0 (missing tracked table row deletion/insertion)
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr/w:trPr/w:del", 2);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[2]/w:tr/w:trPr/w:ins", 2);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr/w:trPr/w:del"_ostr, 2);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[2]/w:tr/w:trPr/w:ins"_ostr, 2);
}
}
@@ -1279,10 +1285,10 @@ DECLARE_OOXMLEXPORT_TEST(testTdf143510_table_from_row, "TC-table-Separate-Move.d
{
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// This was 0 (missing tracked table row deletion/insertion)
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr/w:trPr/w:del", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[3]/w:trPr/w:del", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[2]/w:tr", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[2]/w:tr/w:trPr/w:ins", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr/w:trPr/w:del"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[3]/w:trPr/w:del"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[2]/w:tr"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[2]/w:tr/w:trPr/w:ins"_ostr, 1);
}
}
@@ -1293,8 +1299,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf143510_within_table, "TC-table-rowDND.docx")
{
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// This was 0 (missing tracked table row deletion/insertion)
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:trPr/w:del", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:trPr/w:ins", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:trPr/w:del"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:trPr/w:ins"_ostr, 1);
}
}
@@ -1305,8 +1311,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf143510_within_table2, "TC-table-rowDND-front.doc
{
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// This was 0 (missing tracked table row deletion/insertion)
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:trPr/w:ins", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:trPr/w:del", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:trPr/w:ins"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:trPr/w:del"_ostr, 1);
}
}
@@ -1317,9 +1323,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf150824, "tdf150824.fodt")
{
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// This was 0 (missing tracked table row deletion/insertion)
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:trPr/w:ins", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:trPr/w:ins", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:trPr/w:ins", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:trPr/w:ins"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:trPr/w:ins"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:trPr/w:ins"_ostr, 1);
}
}
@@ -1331,14 +1337,14 @@ DECLARE_OOXMLEXPORT_TEST(testTdf157011, "tdf157011_ins_del_empty_cols.docx")
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// This was 1 (missing tracked table cell insertions)
- assertXPath(pXmlDoc, "//w:ins", 3);
+ assertXPath(pXmlDoc, "//w:ins"_ostr, 3);
// This was 4 (missing tracked table cell deletions)
- assertXPath(pXmlDoc, "//w:del", 6);
+ assertXPath(pXmlDoc, "//w:del"_ostr, 6);
// tdf#157187 This was false (dummy w:tc/w:p/w:sdt/w:sdtContent content box)
- assertXPath(pXmlDoc, "//w:tc/w:p/w:del", 6);
- assertXPath(pXmlDoc, "//w:tc/w:p/w:ins", 3);
+ assertXPath(pXmlDoc, "//w:tc/w:p/w:del"_ostr, 6);
+ assertXPath(pXmlDoc, "//w:tc/w:p/w:ins"_ostr, 3);
}
}
@@ -1396,14 +1402,14 @@ CPPUNIT_TEST_FIXTURE(Test, testChart_BorderLine_Style)
*/
xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml");
assertXPath(pXmlDoc,
- "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:spPr/a:ln/a:prstDash",
- "val", "sysDot");
+ "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:spPr/a:ln/a:prstDash"_ostr,
+ "val"_ostr, "sysDot");
assertXPath(pXmlDoc,
- "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[2]/c:spPr/a:ln/a:prstDash",
- "val", "sysDash");
+ "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[2]/c:spPr/a:ln/a:prstDash"_ostr,
+ "val"_ostr, "sysDash");
assertXPath(pXmlDoc,
- "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[3]/c:spPr/a:ln/a:prstDash",
- "val", "dash");
+ "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[3]/c:spPr/a:ln/a:prstDash"_ostr,
+ "val"_ostr, "dash");
}
CPPUNIT_TEST_FIXTURE(Test, testChart_Plot_BorderLine_Style)
@@ -1413,16 +1419,16 @@ CPPUNIT_TEST_FIXTURE(Test, testChart_Plot_BorderLine_Style)
* should get preserved inside an XML tag <a:prstDash> with value "dash", "sysDot, "lgDot", etc.
*/
xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1.xml");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:ln/a:prstDash", "val",
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:ln/a:prstDash"_ostr, "val"_ostr,
"lgDashDot");
- assertXPath(pXmlDoc, "/c:chartSpace/c:spPr/a:ln/a:prstDash", "val", "sysDash");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:spPr/a:ln/a:prstDash"_ostr, "val"_ostr, "sysDash");
}
CPPUNIT_TEST_FIXTURE(Test, testTrackChangesDeletedEmptyParagraph)
{
loadAndSave("testTrackChangesDeletedEmptyParagraph.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:rPr/w:del");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:rPr/w:del"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTrackChangesEmptyParagraphsInADeletion)
@@ -1440,18 +1446,18 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149708)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// keep tracked insertion of a list item
// This was 0 (missing tracked insertion of the paragraph mark)
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:ins");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:ins"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf149707)
{
loadAndSave("tdf149711.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:moveFrom");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:moveTo");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:moveFrom"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:moveTo"_ostr);
// These were missing
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:moveFrom");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:rPr/w:moveTo");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:moveFrom"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:rPr/w:moveTo"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf70234)
@@ -1459,13 +1465,13 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf70234)
loadAndSave("tdf70234.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// import field with tracked deletion
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:del/w:r[1]/w:fldChar");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:del/w:r[1]/w:fldChar"_ostr);
// export multiple runs of a field with tracked deletion
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:del/w:r", 6);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:del/w:r"_ostr, 6);
// export w:delInstrText
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:del/w:r/w:delInstrText");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:del/w:r/w:delInstrText"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf115212)
@@ -1473,7 +1479,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf115212)
loadAndSave("tdf115212.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// export field with tracked deletion
- assertXPath(pXmlDoc, "//w:p[2]/w:del[1]/w:r[1]/w:fldChar");
+ assertXPath(pXmlDoc, "//w:p[2]/w:del[1]/w:r[1]/w:fldChar"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf126243)
@@ -1481,8 +1487,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf126243)
loadAndSave("tdf120338.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// export change tracking rejection data for tracked paragraph style change
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:pPrChange/w:pPr/w:pStyle", "val",
- "Heading3");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:pPrChange/w:pPr/w:pStyle"_ostr,
+ "val"_ostr, "Heading3");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf126245)
@@ -1490,8 +1496,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf126245)
loadAndSave("tdf126245.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// export change tracking rejection data for tracked numbering change
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pPrChange/w:pPr/w:numPr/w:numId", "val",
- "1");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pPrChange/w:pPr/w:numPr/w:numId"_ostr,
+ "val"_ostr, "1");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf124491)
@@ -1499,10 +1505,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf124491)
loadAndSave("tdf124491.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// import format change of empty lines, FIXME: change w:r with w:pPr in export
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/*/w:rPr/w:rPrChange");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/*/w:rPr/w:rPrChange"_ostr);
// empty line without format change
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/*/w:rPrChange", 0);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/*/*/w:rPrChange", 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/*/w:rPrChange"_ostr, 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/*/*/w:rPrChange"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf143911)
@@ -1510,9 +1516,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143911)
loadAndSave("tdf126206.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// export format change of text portions
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w:rPrChange");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w:rPrChange"_ostr);
// This was without tracked bold formatting
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w:rPrChange/w:rPr/w:b");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w:rPrChange/w:rPr/w:b"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf105485)
@@ -1520,7 +1526,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf105485)
loadAndSave("tdf105485.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// import change tracking of deleted comments
- assertXPath(pXmlDoc, "//w:del/w:r/w:commentReference");
+ assertXPath(pXmlDoc, "//w:del/w:r/w:commentReference"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf125894)
@@ -1528,8 +1534,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf125894)
loadAndSave("tdf125894.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// import change tracking in frames
- assertXPath(pXmlDoc, "//w:del", 2);
- assertXPath(pXmlDoc, "//w:ins");
+ assertXPath(pXmlDoc, "//w:del"_ostr, 2);
+ assertXPath(pXmlDoc, "//w:ins"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf149388)
@@ -1540,10 +1546,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149388)
// import change tracking in floating tables
// (don't recognize tracked text moving during the import,
// because the text is too short and it's only a single word)
- assertXPath(pXmlDoc, "//w:del", 2);
- assertXPath(pXmlDoc, "//w:ins", 2);
- assertXPath(pXmlDoc, "//w:moveFrom", 0);
- assertXPath(pXmlDoc, "//w:moveTo", 0);
+ assertXPath(pXmlDoc, "//w:del"_ostr, 2);
+ assertXPath(pXmlDoc, "//w:ins"_ostr, 2);
+ assertXPath(pXmlDoc, "//w:moveFrom"_ostr, 0);
+ assertXPath(pXmlDoc, "//w:moveTo"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf132271)
@@ -1554,18 +1560,18 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132271)
// import change tracking in floating tables
if (!isExported())
{
- assertXPath(pXmlDoc, "//w:del", 2);
- assertXPath(pXmlDoc, "//w:ins", 2);
- assertXPath(pXmlDoc, "//w:moveFrom", 0);
- assertXPath(pXmlDoc, "//w:moveTo", 0);
+ assertXPath(pXmlDoc, "//w:del"_ostr, 2);
+ assertXPath(pXmlDoc, "//w:ins"_ostr, 2);
+ assertXPath(pXmlDoc, "//w:moveFrom"_ostr, 0);
+ assertXPath(pXmlDoc, "//w:moveTo"_ostr, 0);
}
else
{
- assertXPath(pXmlDoc, "//w:del", 1);
- assertXPath(pXmlDoc, "//w:ins", 1);
+ assertXPath(pXmlDoc, "//w:del"_ostr, 1);
+ assertXPath(pXmlDoc, "//w:ins"_ostr, 1);
// tracked text moving recognized during the import
- assertXPath(pXmlDoc, "//w:moveFrom", 1);
- assertXPath(pXmlDoc, "//w:moveTo", 1);
+ assertXPath(pXmlDoc, "//w:moveFrom"_ostr, 1);
+ assertXPath(pXmlDoc, "//w:moveTo"_ostr, 1);
}
}
@@ -1575,10 +1581,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149388_fly)
loadAndSave("tdf136667.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// import change tracking in floating tables
- assertXPath(pXmlDoc, "//w:del", 2);
- assertXPath(pXmlDoc, "//w:ins", 4);
- assertXPath(pXmlDoc, "//w:moveFrom", 0);
- assertXPath(pXmlDoc, "//w:moveTo", 0);
+ assertXPath(pXmlDoc, "//w:del"_ostr, 2);
+ assertXPath(pXmlDoc, "//w:ins"_ostr, 4);
+ assertXPath(pXmlDoc, "//w:moveFrom"_ostr, 0);
+ assertXPath(pXmlDoc, "//w:moveTo"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf136667)
@@ -1589,18 +1595,18 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf136667)
// import change tracking in floating tables
if (!isExported())
{
- assertXPath(pXmlDoc, "//w:del", 2);
- assertXPath(pXmlDoc, "//w:ins", 4);
- assertXPath(pXmlDoc, "//w:moveFrom", 0);
- assertXPath(pXmlDoc, "//w:moveTo", 0);
+ assertXPath(pXmlDoc, "//w:del"_ostr, 2);
+ assertXPath(pXmlDoc, "//w:ins"_ostr, 4);
+ assertXPath(pXmlDoc, "//w:moveFrom"_ostr, 0);
+ assertXPath(pXmlDoc, "//w:moveTo"_ostr, 0);
}
else
{
- assertXPath(pXmlDoc, "//w:del", 1);
- assertXPath(pXmlDoc, "//w:ins", 3);
+ assertXPath(pXmlDoc, "//w:del"_ostr, 1);
+ assertXPath(pXmlDoc, "//w:ins"_ostr, 3);
// tracked text moving recognized during the import
- assertXPath(pXmlDoc, "//w:moveFrom", 1);
- assertXPath(pXmlDoc, "//w:moveTo", 1);
+ assertXPath(pXmlDoc, "//w:moveFrom"_ostr, 1);
+ assertXPath(pXmlDoc, "//w:moveTo"_ostr, 1);
}
}
@@ -1609,7 +1615,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf136850)
loadAndSave("tdf136850.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// import change tracking in floating tables
- assertXPath(pXmlDoc, "//w:del");
+ assertXPath(pXmlDoc, "//w:del"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf128156)
@@ -1619,7 +1625,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128156)
// keep tracked insertion of a paragraph
// This was 0 before 350972a8bffc1a74b531e0336954bf54b1356025,
// and 1 later (missing tracked insertion of the paragraph mark)
- assertXPath(pXmlDoc, "//w:ins", 2);
+ assertXPath(pXmlDoc, "//w:ins"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf125546)
@@ -1627,7 +1633,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf125546)
loadAndSave("tdf125546.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// compress redlines (it was 15)
- assertXPath(pXmlDoc, "//w:rPrChange", 2);
+ assertXPath(pXmlDoc, "//w:rPrChange"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(Test, testLabelWidthAndPosition_Left_FirstLineIndent)
@@ -1639,97 +1645,97 @@ CPPUNIT_TEST_FIXTURE(Test, testLabelWidthAndPosition_Left_FirstLineIndent)
// a) all LTR cases with no number text look good in Word
// 1) negative first line indent on paragraph:
// no list width/indent: this one was 0 previously; this looks good
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind", "start", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind", "hanging", "399");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind", "end", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind"_ostr, "start"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind"_ostr, "hanging"_ostr, "399");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind"_ostr, "end"_ostr, "0");
// list width:
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:ind", "start", "567");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:ind", "hanging", "966");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:ind", "end", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:ind"_ostr, "start"_ostr, "567");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:ind"_ostr, "hanging"_ostr, "966");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:ind"_ostr, "end"_ostr, "0");
// list indent:
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:ind", "start", "567");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:ind", "hanging", "399");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:ind", "end", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:ind"_ostr, "start"_ostr, "567");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:ind"_ostr, "hanging"_ostr, "399");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:ind"_ostr, "end"_ostr, "0");
// list width + list indent:
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:ind", "start", "1134");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:ind", "hanging", "966");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:ind", "end", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:ind"_ostr, "start"_ostr, "1134");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:ind"_ostr, "hanging"_ostr, "966");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:ind"_ostr, "end"_ostr, "0");
// 2) positive first line indent on paragraph:
// no list width/indent:
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:ind", "start", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:ind", "firstLine", "420");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:ind", "end", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:ind"_ostr, "start"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:ind"_ostr, "firstLine"_ostr, "420");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:ind"_ostr, "end"_ostr, "0");
// list width:
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:pPr/w:ind", "start", "567");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:pPr/w:ind", "hanging", "147");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:pPr/w:ind", "end", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:pPr/w:ind"_ostr, "start"_ostr, "567");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:pPr/w:ind"_ostr, "hanging"_ostr, "147");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:pPr/w:ind"_ostr, "end"_ostr, "0");
// list indent:
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:ind", "start", "567");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:ind", "firstLine", "420");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:ind", "end", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:ind"_ostr, "start"_ostr, "567");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:ind"_ostr, "firstLine"_ostr, "420");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:ind"_ostr, "end"_ostr, "0");
// list width + list indent:
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:pPr/w:ind", "start", "1134");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:pPr/w:ind", "hanging", "147");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:pPr/w:ind", "end", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:pPr/w:ind"_ostr, "start"_ostr, "1134");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:pPr/w:ind"_ostr, "hanging"_ostr, "147");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:pPr/w:ind"_ostr, "end"_ostr, "0");
// b) all LTR cases with number text: the indent looks good but some tabs are wrong
// 1) negative first line indent on paragraph:
// no list width/indent: this one was 0 previously; this looks good
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:ind", "start", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:ind", "hanging", "399");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:ind", "end", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:ind"_ostr, "start"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:ind"_ostr, "hanging"_ostr, "399");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:ind"_ostr, "end"_ostr, "0");
// list width:
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:pPr/w:ind", "start", "567");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:pPr/w:ind", "hanging", "966");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:pPr/w:ind", "end", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:pPr/w:ind"_ostr, "start"_ostr, "567");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:pPr/w:ind"_ostr, "hanging"_ostr, "966");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:pPr/w:ind"_ostr, "end"_ostr, "0");
// list indent:
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:ind", "start", "567");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:ind", "hanging", "399");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:ind", "end", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:ind"_ostr, "start"_ostr, "567");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:ind"_ostr, "hanging"_ostr, "399");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:ind"_ostr, "end"_ostr, "0");
// list width + list indent:
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[12]/w:pPr/w:ind", "start", "1134");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[12]/w:pPr/w:ind", "hanging", "966");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[12]/w:pPr/w:ind", "end", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[12]/w:pPr/w:ind"_ostr, "start"_ostr, "1134");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[12]/w:pPr/w:ind"_ostr, "hanging"_ostr, "966");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[12]/w:pPr/w:ind"_ostr, "end"_ostr, "0");
// 2) positive first line indent on paragraph:
// no list width/indent:
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[13]/w:pPr/w:ind", "start", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[13]/w:pPr/w:ind", "firstLine", "420");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[13]/w:pPr/w:ind", "end", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[13]/w:pPr/w:ind"_ostr, "start"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[13]/w:pPr/w:ind"_ostr, "firstLine"_ostr, "420");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[13]/w:pPr/w:ind"_ostr, "end"_ostr, "0");
// list width:
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[14]/w:pPr/w:ind", "start", "567");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[14]/w:pPr/w:ind", "hanging", "147");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[14]/w:pPr/w:ind", "end", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[14]/w:pPr/w:ind"_ostr, "start"_ostr, "567");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[14]/w:pPr/w:ind"_ostr, "hanging"_ostr, "147");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[14]/w:pPr/w:ind"_ostr, "end"_ostr, "0");
// list indent:
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[15]/w:pPr/w:ind", "start", "567");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[15]/w:pPr/w:ind", "firstLine", "420");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[15]/w:pPr/w:ind", "end", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[15]/w:pPr/w:ind"_ostr, "start"_ostr, "567");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[15]/w:pPr/w:ind"_ostr, "firstLine"_ostr, "420");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[15]/w:pPr/w:ind"_ostr, "end"_ostr, "0");
// list width + list indent:
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[16]/w:pPr/w:ind", "start", "1134");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[16]/w:pPr/w:ind", "hanging", "147");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[16]/w:pPr/w:ind", "end", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[16]/w:pPr/w:ind"_ostr, "start"_ostr, "1134");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[16]/w:pPr/w:ind"_ostr, "hanging"_ostr, "147");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[16]/w:pPr/w:ind"_ostr, "end"_ostr, "0");
// (w:p[17] is empty)
// I) RTL
// a) only RTL cases with no number text and no width/indent look good in Word
// 1) negative first line indent on paragraph:
// no list width/indent
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[18]/w:pPr/w:ind", "start", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[18]/w:pPr/w:ind", "hanging", "399");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[18]/w:pPr/w:ind", "end", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[18]/w:pPr/w:ind"_ostr, "start"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[18]/w:pPr/w:ind"_ostr, "hanging"_ostr, "399");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[18]/w:pPr/w:ind"_ostr, "end"_ostr, "0");
// 2) positive first line indent on paragraph:
// no list width/indent:
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[22]/w:pPr/w:ind", "start", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[22]/w:pPr/w:ind", "firstLine", "420");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[22]/w:pPr/w:ind", "end", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[22]/w:pPr/w:ind"_ostr, "start"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[22]/w:pPr/w:ind"_ostr, "firstLine"_ostr, "420");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[22]/w:pPr/w:ind"_ostr, "end"_ostr, "0");
// b) RTL cases with number text: the indent looks good but some tabs are wrong
// 1) negative first line indent on paragraph:
// no list width/indent
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[26]/w:pPr/w:ind", "start", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[26]/w:pPr/w:ind", "hanging", "399");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[26]/w:pPr/w:ind", "end", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[26]/w:pPr/w:ind"_ostr, "start"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[26]/w:pPr/w:ind"_ostr, "hanging"_ostr, "399");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[26]/w:pPr/w:ind"_ostr, "end"_ostr, "0");
// 2) positive first line indent on paragraph:
// no list width/indent:
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[30]/w:pPr/w:ind", "start", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[30]/w:pPr/w:ind", "firstLine", "420");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[30]/w:pPr/w:ind", "end", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[30]/w:pPr/w:ind"_ostr, "start"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[30]/w:pPr/w:ind"_ostr, "firstLine"_ostr, "420");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[30]/w:pPr/w:ind"_ostr, "end"_ostr, "0");
// TODO: other cases
}
@@ -1738,7 +1744,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf124604)
loadAndSave("tdf124604.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// If the numbering comes from a base style, indentation of the base style has also priority.
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:ind", "start", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:ind"_ostr, "start"_ostr, "0");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf95374)
@@ -1746,8 +1752,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf95374)
loadAndSave("tdf95374.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Numbering disabled by non-existent numId=0, disabling also inheritance of indentation of parent styles
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind", "hanging", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind", "start", "1136");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind"_ostr, "hanging"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind"_ostr, "start"_ostr, "1136");
}
DECLARE_OOXMLEXPORT_TEST(testTdf108493, "tdf108493.docx")
@@ -1780,12 +1786,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf64264, "tdf64264.docx")
// table starts on page 1 and finished on page 2
// and it has got only a single repeating header line
- assertXPath(pDump, "/root/page[2]/body/tab", 1);
- assertXPath(pDump, "/root/page[2]/body/tab/row", 47);
+ assertXPath(pDump, "/root/page[2]/body/tab"_ostr, 1);
+ assertXPath(pDump, "/root/page[2]/body/tab/row"_ostr, 47);
CPPUNIT_ASSERT_EQUAL(OUString("Repeating Table Header"),
- parseDump("/root/page[2]/body/tab/row[1]/cell[1]/txt/text()"));
+ parseDump("/root/page[2]/body/tab/row[1]/cell[1]/txt/text()"_ostr));
CPPUNIT_ASSERT_EQUAL(OUString("Text"),
- parseDump("/root/page[2]/body/tab/row[2]/cell[1]/txt/text()"));
+ parseDump("/root/page[2]/body/tab/row[2]/cell[1]/txt/text()"_ostr));
}
DECLARE_OOXMLEXPORT_TEST(testTdf58944RepeatingTableHeader, "tdf58944-repeating-table-header.docx")
@@ -1797,12 +1803,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf58944RepeatingTableHeader, "tdf58944-repeating-t
// table starts on page 1 and finished on page 2
// instead of showing only a part of it on page 2
- assertXPath(pDump, "/root/page[1]/body/tab", 1);
- assertXPath(pDump, "/root/page[1]/body/tab/row", 11);
+ assertXPath(pDump, "/root/page[1]/body/tab"_ostr, 1);
+ assertXPath(pDump, "/root/page[1]/body/tab/row"_ostr, 11);
CPPUNIT_ASSERT_EQUAL(OUString("Test1"),
- parseDump("/root/page[2]/body/tab/row[1]/cell[1]/txt/text()"));
+ parseDump("/root/page[2]/body/tab/row[1]/cell[1]/txt/text()"_ostr));
CPPUNIT_ASSERT_EQUAL(OUString("Test2"),
- parseDump("/root/page[2]/body/tab/row[2]/cell[1]/txt/text()"));
+ parseDump("/root/page[2]/body/tab/row[2]/cell[1]/txt/text()"_ostr));
}
CPPUNIT_TEST_FIXTURE(Test, testTdf81100)
@@ -1811,18 +1817,18 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf81100)
xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml");
CPPUNIT_ASSERT(pXmlDoc);
// keep "repeat table header" setting of table styles
- assertXPath(pXmlDoc, "/w:styles/w:style/w:tblStylePr/w:trPr/w:tblHeader", 4);
+ assertXPath(pXmlDoc, "/w:styles/w:style/w:tblStylePr/w:trPr/w:tblHeader"_ostr, 4);
xmlDocUniquePtr pDump = parseLayoutDump();
CPPUNIT_ASSERT_EQUAL(3, getPages());
// table starts on page 1 and finished on page 2
// and it has got only a single repeating header line
- assertXPath(pDump, "/root/page[2]/body/tab[1]", 1);
- assertXPath(pDump, "/root/page[2]/body/tab[1]/row", 2);
- assertXPath(pDump, "/root/page[3]/body/tab", 1);
+ assertXPath(pDump, "/root/page[2]/body/tab[1]"_ostr, 1);
+ assertXPath(pDump, "/root/page[2]/body/tab[1]/row"_ostr, 2);
+ assertXPath(pDump, "/root/page[3]/body/tab"_ostr, 1);
if (!isExported()) // TODO export tblHeader=false
- assertXPath(pDump, "/root/page[3]/body/tab/row", 1);
+ assertXPath(pDump, "/root/page[3]/body/tab/row"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf88496)
@@ -1854,62 +1860,64 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf130494)
{
loadAndSave("tdf130494.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:pPr/w:rPr/w:highlight", "val",
- "yellow");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:pPr/w:rPr/w:highlight"_ostr,
+ "val"_ostr, "yellow");
// keep direct formatting of table cell paragraph with removed highlighting
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r/w:rPr/w:highlight", 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r/w:rPr/w:highlight"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf130690)
{
loadAndSave("tdf130690.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:pPr/w:rPr/w:highlight", "val",
- "yellow");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[1]/w:rPr/w:highlight", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:pPr/w:rPr/w:highlight"_ostr,
+ "val"_ostr, "yellow");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[1]/w:rPr/w:highlight"_ostr,
+ 1);
// keep direct formatting of table cell paragraph with removed highlighting
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[2]/w:rPr/w:highlight", 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[2]/w:rPr/w:highlight"_ostr,
+ 0);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf105215)
{
loadAndSave("tdf105215.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:pPr/w:rPr/w:rFonts", "ascii",
- "Linux Libertine G");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:pPr/w:rPr/w:rFonts"_ostr,
+ "ascii"_ostr, "Linux Libertine G");
// These were "Linux Libertine G"
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r/w:rPr", 5);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[1]/w:rPr/w:rFonts", "ascii",
- "Lohit Devanagari");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[2]/w:rPr/w:rFonts", "ascii",
- "Lohit Devanagari");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[3]/w:rPr/w:rFonts", "ascii",
- "Lohit Devanagari");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[4]/w:rPr/w:rFonts", "ascii",
- "Lohit Devanagari");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[5]/w:rPr/w:rFonts", "ascii",
- "Lohit Devanagari");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r/w:rPr"_ostr, 5);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[1]/w:rPr/w:rFonts"_ostr,
+ "ascii"_ostr, "Lohit Devanagari");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[2]/w:rPr/w:rFonts"_ostr,
+ "ascii"_ostr, "Lohit Devanagari");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[3]/w:rPr/w:rFonts"_ostr,
+ "ascii"_ostr, "Lohit Devanagari");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[4]/w:rPr/w:rFonts"_ostr,
+ "ascii"_ostr, "Lohit Devanagari");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[5]/w:rPr/w:rFonts"_ostr,
+ "ascii"_ostr, "Lohit Devanagari");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf135187)
{
loadAndSave("tdf135187.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:p/w:pPr/w:rPr/w:b", 0);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[1]/w:p/w:pPr/w:rPr/w:b", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[1]/w:p/w:pPr/w:rPr/w:b", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:p/w:pPr/w:rPr/w:b"_ostr, 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[1]/w:p/w:pPr/w:rPr/w:b"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[1]/w:p/w:pPr/w:rPr/w:b"_ostr, 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:p/w:r[1]/w:rPr/w:b", 1);
- assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:p/w:r[1]/w:rPr/w:b",
- "val");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:p/w:r[1]/w:rPr/w:b"_ostr, 1);
+ assertXPathNoAttribute(
+ pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:p/w:r[1]/w:rPr/w:b"_ostr, "val"_ostr);
// This was 0
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[1]/w:p/w:r[1]/w:rPr/w:b", 1);
- assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[1]/w:p/w:r[1]/w:rPr/w:b",
- "val");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[1]/w:p/w:r[1]/w:rPr/w:b", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[1]/w:p/w:r[1]/w:rPr/w:b", "val",
- "false");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[1]/w:p/w:r[1]/w:rPr/w:b"_ostr, 1);
+ assertXPathNoAttribute(
+ pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[1]/w:p/w:r[1]/w:rPr/w:b"_ostr, "val"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[1]/w:p/w:r[1]/w:rPr/w:b"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[1]/w:p/w:r[1]/w:rPr/w:b"_ostr,
+ "val"_ostr, "false");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf136617)
@@ -1920,8 +1928,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf136617)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[2]/w:p[2]/w:pPr/w:rPr/w:sz", "val",
- "16");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[2]/w:p[2]/w:pPr/w:rPr/w:sz"_ostr,
+ "val"_ostr, "16");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf121597TrackedDeletionOfMultipleParagraphs)
@@ -1931,12 +1939,12 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121597TrackedDeletionOfMultipleParagraphs)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// check paragraphs with removed paragraph mark
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:del");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:del");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:rPr/w:del");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:rPr/w:del");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:rPr/w:del");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:pPr/w:rPr/w:del");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:del"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:del"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:rPr/w:del"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:rPr/w:del"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:rPr/w:del"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:pPr/w:rPr/w:del"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf141660)
@@ -1945,10 +1953,12 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf141660)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:footnoteReference", "id", "2");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:footnoteReference"_ostr, "id"_ostr,
+ "2");
// w:del is imported correctly with its footnote
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:del[2]/w:r/w:footnoteReference", "id", "3");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/w:footnoteReference", "id", "4");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:del[2]/w:r/w:footnoteReference"_ostr,
+ "id"_ostr, "3");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/w:footnoteReference"_ostr, "id"_ostr, "4");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf133643)
@@ -1957,27 +1967,27 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133643)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[1]/w:fldChar", "fldCharType",
- "begin");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[1]/w:fldChar"_ostr,
+ "fldCharType"_ostr, "begin");
assertXPath(
pXmlDoc,
- "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[1]/w:fldChar/w:ffData/w:ddList/w:listEntry[1]",
- "val", "Bourgoin-Jallieu, ");
+ "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[1]/w:fldChar/w:ffData/w:ddList/w:listEntry[1]"_ostr,
+ "val"_ostr, "Bourgoin-Jallieu, ");
assertXPath(
pXmlDoc,
- "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[1]/w:fldChar/w:ffData/w:ddList/w:listEntry[2]",
- "val", "Fontaine, ");
+ "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[1]/w:fldChar/w:ffData/w:ddList/w:listEntry[2]"_ostr,
+ "val"_ostr, "Fontaine, ");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[2]/w:instrText",
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[2]/w:instrText"_ostr,
" FORMDROPDOWN ");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[3]/w:fldChar", "fldCharType",
- "separate");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[5]/w:fldChar", "fldCharType",
- "end");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[3]/w:fldChar"_ostr,
+ "fldCharType"_ostr, "separate");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[5]/w:fldChar"_ostr,
+ "fldCharType"_ostr, "end");
// Without the fix in place, this w:r wouldn't exist
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[6]/w:t",
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[6]/w:t"_ostr,
"le 22 fevrier 2013");
}
@@ -2008,16 +2018,16 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf116084_anonymized)
loadAndSave("tdf116084.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// w:del in w:ins is exported correctly
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:del/w:r/w:delText", "must");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:del/w:r/w:delText"_ostr, "must");
// no date (anonymized changes)
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins[@date]", 0);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:del[@w:date]", 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins[@date]"_ostr, 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:del[@w:date]"_ostr, 0);
// w:ins and w:del have w:author attributes, and the same
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:del[@w:author]", 1);
- OUString sAuthor = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins[2]", "author");
- OUString sAuthor2 = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:del", "author");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:del[@w:author]"_ostr, 1);
+ OUString sAuthor = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins[2]"_ostr, "author"_ostr);
+ OUString sAuthor2 = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:del"_ostr, "author"_ostr);
CPPUNIT_ASSERT_EQUAL(sAuthor, sAuthor2);
}
@@ -2034,16 +2044,16 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121176_anonymized)
loadAndSave("tdf121176.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// w:del in w:ins is exported correctly
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:del/w:r/w:delText", "must");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:del/w:r/w:delText"_ostr, "must");
// no date (anonymized changes)
- assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p/w:ins", "date");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:del[@w:date]", 0);
+ assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p/w:ins"_ostr, "date"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:del[@w:date]"_ostr, 0);
// w:ins and w:del have w:author attributes, and the same
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:del[@w:author]", 1);
- OUString sAuthor = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins", "author");
- OUString sAuthor2 = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:del", "author");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:del[@w:author]"_ostr, 1);
+ OUString sAuthor = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins"_ostr, "author"_ostr);
+ OUString sAuthor2 = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:del"_ostr, "author"_ostr);
CPPUNIT_ASSERT_EQUAL(sAuthor, sAuthor2);
}
@@ -2052,8 +2062,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128913)
loadAndSave("tdf128913.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// w:ins and w:del are imported correctly, if they contain only inline images
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:r/w:drawing/wp:inline/a:graphic");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:del/w:r/w:drawing/wp:inline/a:graphic");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:r/w:drawing/wp:inline/a:graphic"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:del/w:r/w:drawing/wp:inline/a:graphic"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf142700)
@@ -2061,8 +2071,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf142700)
loadAndSave("tdf142700.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// w:ins and w:del are imported correctly, if they contain only images anchored to character
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:r/w:drawing/wp:anchor/a:graphic");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:del/w:r/w:drawing/wp:anchor/a:graphic");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:r/w:drawing/wp:anchor/a:graphic"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:del/w:r/w:drawing/wp:anchor/a:graphic"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf142387)
@@ -2070,7 +2080,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf142387)
loadAndSave("tdf142387.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// w:del in w:ins is exported correctly (only w:del was exported)
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:del/w:r/w:delText", "inserts ");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:ins/w:del/w:r/w:delText"_ostr,
+ "inserts ");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf147892)
@@ -2079,8 +2090,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf147892)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// w:del in w:ins is exported correctly
// (both w:del and w:ins were exported for para marker)
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:del", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:ins", 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:del"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:ins"_ostr, 0);
}
DECLARE_OOXMLEXPORT_TEST(testTdf123054, "tdf123054.docx")
@@ -2134,13 +2145,13 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf101122_noFillForCustomShape)
assertXPath(pXmlDoc,
"/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/"
- "a:graphic/a:graphicData/wps:wsp/wps:spPr/a:custGeom/a:pathLst/a:path",
- "fill", "none");
+ "a:graphic/a:graphicData/wps:wsp/wps:spPr/a:custGeom/a:pathLst/a:path"_ostr,
+ "fill"_ostr, "none");
assertXPathNoAttribute(
pXmlDoc,
"/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/"
- "a:graphicData/wps:wsp/wps:spPr/a:custGeom/a:pathLst/a:path",
- "fill");
+ "a:graphicData/wps:wsp/wps:spPr/a:custGeom/a:pathLst/a:path"_ostr,
+ "fill"_ostr);
}
// The (tdf124678_no_leading_paragraph.odt, tdf124678_with_leading_paragraph.odt) documents are the same,
// except:
@@ -2152,9 +2163,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf124678_case1)
loadAndReload("tdf124678_no_leading_paragraph.odt");
CPPUNIT_ASSERT_EQUAL(2, getPages());
CPPUNIT_ASSERT_EQUAL_MESSAGE("First page header text", OUString(""),
- parseDump("/root/page[1]/header/txt"));
+ parseDump("/root/page[1]/header/txt"_ostr));
CPPUNIT_ASSERT_EQUAL_MESSAGE("Second page header text", OUString("HEADER"),
- parseDump("/root/page[2]/header/txt"));
+ parseDump("/root/page[2]/header/txt"_ostr));
}
// The (tdf124678_no_leading_paragraph.odt, tdf124678_with_leading_paragraph.odt) documents are the same,
@@ -2167,9 +2178,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf124678_case2)
loadAndReload("tdf124678_with_leading_paragraph.odt");
CPPUNIT_ASSERT_EQUAL(2, getPages());
CPPUNIT_ASSERT_EQUAL_MESSAGE("First page header text", OUString(""),
- parseDump("/root/page[1]/header/txt"));
+ parseDump("/root/page[1]/header/txt"_ostr));
CPPUNIT_ASSERT_EQUAL_MESSAGE("Second page header text", OUString("HEADER"),
- parseDump("/root/page[2]/header/txt"));
+ parseDump("/root/page[2]/header/txt"_ostr));
}
static bool lcl_nearEqual(const sal_Int32 nNumber1, const sal_Int32 nNumber2,
@@ -2189,33 +2200,47 @@ DECLARE_OOXMLEXPORT_TEST(testTdf119952_negativeMargins, "tdf119952_negativeMargi
xmlDocUniquePtr pDump = parseLayoutDump();
//Check layout positions / sizes
- sal_Int32 nLeftHead = getXPath(pDump, "//page[1]/header/infos/bounds", "left").toInt32();
- sal_Int32 nLeftBody = getXPath(pDump, "//page[1]/body/infos/bounds", "left").toInt32();
- sal_Int32 nLeftFoot = getXPath(pDump, "//page[1]/footer/infos/bounds", "left").toInt32();
+ sal_Int32 nLeftHead
+ = getXPath(pDump, "//page[1]/header/infos/bounds"_ostr, "left"_ostr).toInt32();
+ sal_Int32 nLeftBody
+ = getXPath(pDump, "//page[1]/body/infos/bounds"_ostr, "left"_ostr).toInt32();
+ sal_Int32 nLeftFoot
+ = getXPath(pDump, "//page[1]/footer/infos/bounds"_ostr, "left"_ostr).toInt32();
sal_Int32 nLeftHFly
- = getXPath(pDump, "//page[1]/header/txt/anchored/fly/infos/bounds", "left").toInt32();
+ = getXPath(pDump, "//page[1]/header/txt/anchored/fly/infos/bounds"_ostr, "left"_ostr)
+ .toInt32();
sal_Int32 nLeftFFly
- = getXPath(pDump, "//page[1]/footer/txt/anchored/fly/infos/bounds", "left").toInt32();
-
- sal_Int32 nTopHead = getXPath(pDump, "//page[1]/header/infos/bounds", "top").toInt32();
- sal_Int32 nTopBody = getXPath(pDump, "//page[1]/body/infos/bounds", "top").toInt32();
- sal_Int32 nTopFoot = getXPath(pDump, "//page[1]/footer/infos/bounds", "top").toInt32();
+ = getXPath(pDump, "//page[1]/footer/txt/anchored/fly/infos/bounds"_ostr, "left"_ostr)
+ .toInt32();
+
+ sal_Int32 nTopHead
+ = getXPath(pDump, "//page[1]/header/infos/bounds"_ostr, "top"_ostr).toInt32();
+ sal_Int32 nTopBody = getXPath(pDump, "//page[1]/body/infos/bounds"_ostr, "top"_ostr).toInt32();
+ sal_Int32 nTopFoot
+ = getXPath(pDump, "//page[1]/footer/infos/bounds"_ostr, "top"_ostr).toInt32();
sal_Int32 nTopHFly
- = getXPath(pDump, "//page[1]/header/txt/anchored/fly/infos/bounds", "top").toInt32();
+ = getXPath(pDump, "//page[1]/header/txt/anchored/fly/infos/bounds"_ostr, "top"_ostr)
+ .toInt32();
sal_Int32 nTopFFly
- = getXPath(pDump, "//page[1]/footer/txt/anchored/fly/infos/bounds", "top").toInt32();
-
- sal_Int32 nHeightHead = getXPath(pDump, "//page[1]/header/infos/bounds", "height").toInt32();
- sal_Int32 nHeightBody = getXPath(pDump, "//page[1]/body/infos/bounds", "height").toInt32();
- sal_Int32 nHeightFoot = getXPath(pDump, "//page[1]/footer/infos/bounds", "height").toInt32();
+ = getXPath(pDump, "//page[1]/footer/txt/anchored/fly/infos/bounds"_ostr, "top"_ostr)
+ .toInt32();
+
+ sal_Int32 nHeightHead
+ = getXPath(pDump, "//page[1]/header/infos/bounds"_ostr, "height"_ostr).toInt32();
+ sal_Int32 nHeightBody
+ = getXPath(pDump, "//page[1]/body/infos/bounds"_ostr, "height"_ostr).toInt32();
+ sal_Int32 nHeightFoot
+ = getXPath(pDump, "//page[1]/footer/infos/bounds"_ostr, "height"_ostr).toInt32();
sal_Int32 nHeightHFly
- = getXPath(pDump, "//page[1]/header/txt/anchored/fly/infos/bounds", "height").toInt32();
+ = getXPath(pDump, "//page[1]/header/txt/anchored/fly/infos/bounds"_ostr, "height"_ostr)
+ .toInt32();
sal_Int32 nHeightFFly
- = getXPath(pDump, "//page[1]/footer/txt/anchored/fly/infos/bounds", "height").toInt32();
+ = getXPath(pDump, "//page[1]/footer/txt/anchored/fly/infos/bounds"_ostr, "height"_ostr)
+ .toInt32();
sal_Int32 nHeightHFlyBound
- = getXPath(pDump, "//page[1]/header/infos/prtBounds", "height").toInt32();
+ = getXPath(pDump, "//page[1]/header/infos/prtBounds"_ostr, "height"_ostr).toInt32();
sal_Int32 nHeightFFlyBound
- = getXPath(pDump, "//page[1]/footer/infos/prtBounds", "height").toInt32();
+ = getXPath(pDump, "//page[1]/footer/infos/prtBounds"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT(lcl_nearEqual(nLeftHead, nLeftBody));
CPPUNIT_ASSERT(lcl_nearEqual(nLeftHead, nLeftFoot));
@@ -2250,63 +2275,63 @@ DECLARE_OOXMLEXPORT_TEST(testTdf119952_negativeMargins, "tdf119952_negativeMargi
OUString("f1"),
getXPath(
pDump,
- "//page[1]/header/txt/anchored/fly/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion",
- "portion"));
+ "//page[1]/header/txt/anchored/fly/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "portion"_ostr));
CPPUNIT_ASSERT_EQUAL(
OUString(" f8"),
getXPath(
pDump,
- "//page[1]/header/txt/anchored/fly/txt[8]/SwParaPortion/SwLineLayout/SwParaPortion",
- "portion"));
+ "//page[1]/header/txt/anchored/fly/txt[8]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "portion"_ostr));
CPPUNIT_ASSERT_EQUAL(
OUString(" f8"),
getXPath(
pDump,
- "//page[1]/footer/txt/anchored/fly/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion",
- "portion"));
+ "//page[1]/footer/txt/anchored/fly/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "portion"_ostr));
CPPUNIT_ASSERT_EQUAL(
OUString("f1"),
getXPath(
pDump,
- "//page[1]/footer/txt/anchored/fly/txt[8]/SwParaPortion/SwLineLayout/SwParaPortion",
- "portion"));
+ "//page[1]/footer/txt/anchored/fly/txt[8]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "portion"_ostr));
CPPUNIT_ASSERT_EQUAL(
OUString("p1"),
getXPath(
pDump,
- "//page[2]/header/txt/anchored/fly/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion",
- "portion"));
+ "//page[2]/header/txt/anchored/fly/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "portion"_ostr));
CPPUNIT_ASSERT_EQUAL(
OUString("p1"),
getXPath(
pDump,
- "//page[2]/footer/txt/anchored/fly/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion",
- "portion"));
+ "//page[2]/footer/txt/anchored/fly/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "portion"_ostr));
CPPUNIT_ASSERT_EQUAL(
OUString(" aaaa"),
getXPath(
pDump,
- "//page[3]/header/txt/anchored/fly/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion",
- "portion"));
+ "//page[3]/header/txt/anchored/fly/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "portion"_ostr));
CPPUNIT_ASSERT_EQUAL(
OUString(" eeee"),
getXPath(
pDump,
- "//page[3]/header/txt/anchored/fly/txt[5]/SwParaPortion/SwLineLayout/SwParaPortion",
- "portion"));
+ "//page[3]/header/txt/anchored/fly/txt[5]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "portion"_ostr));
CPPUNIT_ASSERT_EQUAL(OUString("f1 f2 f3 f4 f5 f6 "
" f7 f8"),
- parseDump("/root/page[1]/header/txt/anchored/fly"));
+ parseDump("/root/page[1]/header/txt/anchored/fly"_ostr));
CPPUNIT_ASSERT_EQUAL(OUString(" f8 f7 f6 f5 "
" f4 f3 f2f1"),
- parseDump("/root/page[1]/footer/txt/anchored/fly"));
- CPPUNIT_ASSERT_EQUAL(OUString("p1"), parseDump("/root/page[2]/header/txt/anchored/fly"));
- CPPUNIT_ASSERT_EQUAL(OUString("p1"), parseDump("/root/page[2]/footer/txt/anchored/fly"));
+ parseDump("/root/page[1]/footer/txt/anchored/fly"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("p1"), parseDump("/root/page[2]/header/txt/anchored/fly"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("p1"), parseDump("/root/page[2]/footer/txt/anchored/fly"_ostr));
CPPUNIT_ASSERT_EQUAL(OUString(" aaaa bbbb cccc dddd eeee"),
- parseDump("/root/page[3]/header/txt/anchored/fly"));
+ parseDump("/root/page[3]/header/txt/anchored/fly"_ostr));
}
DECLARE_OOXMLEXPORT_TEST(testTdf143384_tableInFoot_negativeMargins,
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index eb78d7c470d0..c7c670fe30ad 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -128,11 +128,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121666_lostPage)
{
loadAndSave("tdf121666_lostPage.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:br", "type", "page");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:br"_ostr, "type"_ostr, "page");
// The second page break is exported too.
// Before this fix, if a node had both section break and page break, then only the section break was exported.
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:br", "type", "page");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:sectPr/w:type", "val", "nextPage");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:br"_ostr, "type"_ostr, "page");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:sectPr/w:type"_ostr, "val"_ostr, "nextPage");
}
DECLARE_OOXMLEXPORT_TEST(testTdf140182_extraPagebreak, "tdf140182_extraPagebreak.docx")
@@ -473,7 +473,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123636_newlinePageBreak3, "tdf123636_newlinePage
CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Pages", 2, getPages() );
xmlDocUniquePtr pDump = parseLayoutDump();
- assertXPath(pDump, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "portion", "Last line on page 1");
+ assertXPath(pDump, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, "portion"_ostr, "Last line on page 1");
}
DECLARE_OOXMLEXPORT_TEST(testTdf123636_newlinePageBreak4, "tdf123636_newlinePageBreak4.docx")
@@ -484,7 +484,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123636_newlinePageBreak4, "tdf123636_newlinePage
CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Pages", 2, getPages() );
xmlDocUniquePtr pDump = parseLayoutDump();
- assertXPath(pDump, "/root/page[2]/body/txt[1]/SwParaPortion", 0);
+ assertXPath(pDump, "/root/page[2]/body/txt[1]/SwParaPortion"_ostr, 0);
}
DECLARE_OOXMLEXPORT_TEST(testTdf118947_tableStyle, "tdf118947_tableStyle.docx")
@@ -692,7 +692,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFrameSizeExport)
loadAndSave("floating-tables-anchor.docx");
// Make sure the table width is 4000
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tblPr/w:tblW", "w", "4000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tblPr/w:tblW"_ostr, "w"_ostr, "4000");
}
DECLARE_OOXMLEXPORT_TEST(testTdf119201, "tdf119201.docx")
@@ -715,7 +715,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf124594, "tdf124594.docx")
// Without the accompanying fix in place, this test would have failed, as the portion text was
// only "Er horte leise Schritte hinter", which means the 1st line of the 2nd paragraph was
// split into two by a Special portion, i.e. the top margin of the shape was too large.
- assertXPath(pDump, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/SwLinePortion[1]", "portion",
+ assertXPath(pDump, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/SwLinePortion[1]"_ostr, "portion"_ostr,
"Er horte leise Schritte hinter sich. Das bedeutete nichts Gutes. Wer wu"); // ... until the bookmark.
}
@@ -729,26 +729,26 @@ CPPUNIT_TEST_FIXTURE(Test, testTextInput)
// test the exported DOCX
// no hint, empty
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:instrText", " FILLIN \"\"");
- assertXPathChildren(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[5]", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[5]/w:rPr", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[6]/w:fldChar", "fldCharType", "end");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:instrText"_ostr, " FILLIN \"\"");
+ assertXPathChildren(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[5]"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[5]/w:rPr"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[6]/w:fldChar"_ostr, "fldCharType"_ostr, "end");
// no hint, content
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[3]/w:instrText", " FILLIN \"\"");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[5]/w:t", "content without hint");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[6]/w:fldChar", "fldCharType", "end");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[3]/w:instrText"_ostr, " FILLIN \"\"");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[5]/w:t"_ostr, "content without hint");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[6]/w:fldChar"_ostr, "fldCharType"_ostr, "end");
// hint, empty
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[3]/w:instrText", " FILLIN \"hint empty\"");
- assertXPathChildren(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[5]", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[5]/w:rPr", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[6]/w:fldChar", "fldCharType", "end");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[3]/w:instrText"_ostr, " FILLIN \"hint empty\"");
+ assertXPathChildren(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[5]"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[5]/w:rPr"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[6]/w:fldChar"_ostr, "fldCharType"_ostr, "end");
// hint, content
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[3]/w:instrText", " FILLIN \"hint content\"");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[5]/w:t", "content with hint");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[6]/w:fldChar", "fldCharType", "end");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[3]/w:instrText"_ostr, " FILLIN \"hint content\"");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[5]/w:t"_ostr, "content with hint");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[6]/w:fldChar"_ostr, "fldCharType"_ostr, "end");
// test the imported DOCX
uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
@@ -829,9 +829,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf146140)
// This was 1 (put end of paragraph of the previous moveFrom into a w:del,
// resulting double deletions at the same position, which is an
// ODT back-compatibility issue described in tdf#107292)
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:del", 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:del"_ostr, 0);
// This was 0
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:moveFrom", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:moveFrom"_ostr, 1);
}
//tdf#125298: fix charlimit restrictions in bookmarknames and field references if they contain non-ascii characters
@@ -840,15 +840,15 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf125298)
loadAndSave("tdf125298_crossreflink_nonascii_charlimit.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// check whether test file keeps non-ascii values or not
- OUString bookmarkName1 = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:bookmarkStart[1]", "name");
+ OUString bookmarkName1 = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:bookmarkStart[1]"_ostr, "name"_ostr);
CPPUNIT_ASSERT_EQUAL(OUString::fromUtf8("\u00e1rv\u00edzt\u0171r\u0151_t\u00fck\u00f6rf\u00far\u00f3g\u00e9p"), bookmarkName1);
- OUString bookmarkName2 = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:bookmarkStart[1]", "name");
+ OUString bookmarkName2 = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:bookmarkStart[1]"_ostr, "name"_ostr);
CPPUNIT_ASSERT_EQUAL(OUString::fromUtf8("\u00e91\u00e12\u01713\u01514\u00fa5\u00f66\u00fc7\u00f38\u00ed9"), bookmarkName2);
- OUString fieldName1 = getXPathContent(pXmlDoc, "/w:document/w:body/w:p[5]/w:r[2]/w:instrText[1]");
+ OUString fieldName1 = getXPathContent(pXmlDoc, "/w:document/w:body/w:p[5]/w:r[2]/w:instrText[1]"_ostr);
OUString expectedFieldName1 = " REF " + bookmarkName1 + " \\h ";
CPPUNIT_ASSERT_EQUAL(expectedFieldName1, fieldName1);
- OUString fieldName2 = getXPathContent(pXmlDoc, "/w:document/w:body/w:p[7]/w:r[2]/w:instrText[1]");
+ OUString fieldName2 = getXPathContent(pXmlDoc, "/w:document/w:body/w:p[7]/w:r[2]/w:instrText[1]"_ostr);
OUString expectedFieldName2 = " REF " + bookmarkName2 + " \\h ";
CPPUNIT_ASSERT_EQUAL(expectedFieldName2, fieldName2);
}
@@ -900,55 +900,55 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf119037)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pBdr/w:top", "val", "single");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pBdr/w:left", "val", "single");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pBdr/w:right", "val", "single");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pBdr/w:bottom", "val", "single");
-
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:pBdr/w:top", "val", "dotted");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:pBdr/w:left", "val", "dotted");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:pBdr/w:right", "val", "dotted");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:pBdr/w:bottom", "val", "dotted");
-
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:pBdr/w:top", "val", "dashed");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:pBdr/w:left", "val", "dashed");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:pBdr/w:right", "val", "dashed");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:pBdr/w:bottom", "val", "dashed");
-
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:pBdr/w:top", "val", "dashSmallGap");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:pBdr/w:left", "val", "dashSmallGap");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:pBdr/w:right", "val", "dashSmallGap");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:pBdr/w:bottom", "val", "dashSmallGap");
-
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:pBdr/w:top", "val", "dotDash");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:pBdr/w:left", "val", "dotDash");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:pBdr/w:right", "val", "dotDash");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:pBdr/w:bottom", "val", "dotDash");
-
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:pBdr/w:top", "val", "dotDotDash");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:pBdr/w:left", "val", "dotDotDash");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:pBdr/w:right", "val", "dotDotDash");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:pBdr/w:bottom", "val", "dotDotDash");
-
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[13]/w:pPr/w:pBdr/w:top", "val", "double");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[13]/w:pPr/w:pBdr/w:left", "val", "double");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[13]/w:pPr/w:pBdr/w:right", "val", "double");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[13]/w:pPr/w:pBdr/w:bottom", "val", "double");
-
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[15]/w:pPr/w:pBdr/w:top", "val", "double");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[15]/w:pPr/w:pBdr/w:left", "val", "double");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[15]/w:pPr/w:pBdr/w:right", "val", "double");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[15]/w:pPr/w:pBdr/w:bottom", "val", "double");
-
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[17]/w:pPr/w:pBdr/w:top", "val", "thinThickSmallGap");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[17]/w:pPr/w:pBdr/w:left", "val", "thinThickSmallGap");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[17]/w:pPr/w:pBdr/w:right", "val", "thinThickSmallGap");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[17]/w:pPr/w:pBdr/w:bottom", "val", "thinThickSmallGap");
-
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[19]/w:pPr/w:pBdr/w:top", "val", "double");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[19]/w:pPr/w:pBdr/w:left", "val", "double");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[19]/w:pPr/w:pBdr/w:right", "val", "double");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[19]/w:pPr/w:pBdr/w:bottom", "val", "double");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pBdr/w:top"_ostr, "val"_ostr, "single");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pBdr/w:left"_ostr, "val"_ostr, "single");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pBdr/w:right"_ostr, "val"_ostr, "single");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pBdr/w:bottom"_ostr, "val"_ostr, "single");
+
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:pBdr/w:top"_ostr, "val"_ostr, "dotted");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:pBdr/w:left"_ostr, "val"_ostr, "dotted");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:pBdr/w:right"_ostr, "val"_ostr, "dotted");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:pBdr/w:bottom"_ostr, "val"_ostr, "dotted");
+
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:pBdr/w:top"_ostr, "val"_ostr, "dashed");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:pBdr/w:left"_ostr, "val"_ostr, "dashed");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:pBdr/w:right"_ostr, "val"_ostr, "dashed");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:pBdr/w:bottom"_ostr, "val"_ostr, "dashed");
+
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:pBdr/w:top"_ostr, "val"_ostr, "dashSmallGap");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:pBdr/w:left"_ostr, "val"_ostr, "dashSmallGap");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:pBdr/w:right"_ostr, "val"_ostr, "dashSmallGap");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:pBdr/w:bottom"_ostr, "val"_ostr, "dashSmallGap");
+
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:pBdr/w:top"_ostr, "val"_ostr, "dotDash");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:pBdr/w:left"_ostr, "val"_ostr, "dotDash");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:pBdr/w:right"_ostr, "val"_ostr, "dotDash");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:pBdr/w:bottom"_ostr, "val"_ostr, "dotDash");
+
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:pBdr/w:top"_ostr, "val"_ostr, "dotDotDash");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:pBdr/w:left"_ostr, "val"_ostr, "dotDotDash");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:pBdr/w:right"_ostr, "val"_ostr, "dotDotDash");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[11]/w:pPr/w:pBdr/w:bottom"_ostr, "val"_ostr, "dotDotDash");
+
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[13]/w:pPr/w:pBdr/w:top"_ostr, "val"_ostr, "double");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[13]/w:pPr/w:pBdr/w:left"_ostr, "val"_ostr, "double");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[13]/w:pPr/w:pBdr/w:right"_ostr, "val"_ostr, "double");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[13]/w:pPr/w:pBdr/w:bottom"_ostr, "val"_ostr, "double");
+
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[15]/w:pPr/w:pBdr/w:top"_ostr, "val"_ostr, "double");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[15]/w:pPr/w:pBdr/w:left"_ostr, "val"_ostr, "double");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[15]/w:pPr/w:pBdr/w:right"_ostr, "val"_ostr, "double");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[15]/w:pPr/w:pBdr/w:bottom"_ostr, "val"_ostr, "double");
+
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[17]/w:pPr/w:pBdr/w:top"_ostr, "val"_ostr, "thinThickSmallGap");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[17]/w:pPr/w:pBdr/w:left"_ostr, "val"_ostr, "thinThickSmallGap");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[17]/w:pPr/w:pBdr/w:right"_ostr, "val"_ostr, "thinThickSmallGap");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[17]/w:pPr/w:pBdr/w:bottom"_ostr, "val"_ostr, "thinThickSmallGap");
+
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[19]/w:pPr/w:pBdr/w:top"_ostr, "val"_ostr, "double");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[19]/w:pPr/w:pBdr/w:left"_ostr, "val"_ostr, "double");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[19]/w:pPr/w:pBdr/w:right"_ostr, "val"_ostr, "double");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[19]/w:pPr/w:pBdr/w:bottom"_ostr, "val"_ostr, "double");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf125657)
@@ -959,7 +959,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf125657)
auto checkAttrIsInt = [&](const OString& sAttrName) {
OUString sAttr = getXPath(pXmlDoc,
"/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:inline/a:graphic/"
- "a:graphicData/pic:pic/pic:blipFill/a:srcRect",
+ "a:graphicData/pic:pic/pic:blipFill/a:srcRect"_ostr,
sAttrName);
OString sAssertMsg("Attribute " + sAttrName + " value " + sAttr.toUtf8()
+ " is not a valid integer");
@@ -973,17 +973,17 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf125657)
}
};
// check that we export all coordinates of srcRect as integers
- checkAttrIsInt("l");
- checkAttrIsInt("t");
- checkAttrIsInt("r");
- checkAttrIsInt("b");
+ checkAttrIsInt("l"_ostr);
+ checkAttrIsInt("t"_ostr);
+ checkAttrIsInt("r"_ostr);
+ checkAttrIsInt("b"_ostr);
}
DECLARE_OOXMLEXPORT_TEST(testTdf125324, "tdf125324.docx")
{
discardDumpedLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/fly/tab/infos/bounds", "top", "4193");
+ assertXPath(pXmlDoc, "/root/page/body/txt[2]/anchored/fly/tab/infos/bounds"_ostr, "top"_ostr, "4193");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf78657)
@@ -991,9 +991,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf78657)
loadAndSave("tdf78657_picture_hyperlink.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
xmlDocUniquePtr pXmlRels = parseExport("word/_rels/document.xml.rels");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/wp:docPr/a:hlinkClick", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/pic:pic/pic:nvPicPr/pic:cNvPr/a:hlinkClick", 1);
- assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship[@Target='http://www.google.com']", "TargetMode", "External");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/wp:docPr/a:hlinkClick"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/pic:pic/pic:nvPicPr/pic:cNvPr/a:hlinkClick"_ostr, 1);
+ assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship[@Target='http://www.google.com']"_ostr, "TargetMode"_ostr, "External");
}
CPPUNIT_TEST_FIXTURE(Test, testBtlrFrame)
@@ -1018,19 +1018,19 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf125518)
// First diagram is anchored
- OUString anchorName = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:drawing/wp:anchor/wp:docPr", "name");
+ OUString anchorName = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:drawing/wp:anchor/wp:docPr"_ostr, "name"_ostr);
CPPUNIT_ASSERT_EQUAL(OUString("Object1"), anchorName);
// Second diagram has anchor
- anchorName = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:drawing/wp:anchor/wp:docPr", "name");
+ anchorName = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:drawing/wp:anchor/wp:docPr"_ostr, "name"_ostr);
CPPUNIT_ASSERT_EQUAL(OUString("Objekt1"), anchorName);
// Third diagram has no anchor
- anchorName = getXPath(pXmlDoc, "/w:document/w:body/w:p[12]/w:r[2]/w:drawing/wp:inline/wp:docPr", "name");
+ anchorName = getXPath(pXmlDoc, "/w:document/w:body/w:p[12]/w:r[2]/w:drawing/wp:inline/wp:docPr"_ostr, "name"_ostr);
CPPUNIT_ASSERT_EQUAL(OUString("Object2"), anchorName);
// 4th diagram has anchor too
- anchorName = getXPath(pXmlDoc, "/w:document/w:body/w:p[14]/w:r[3]/w:drawing/wp:anchor/wp:docPr", "name");
+ anchorName = getXPath(pXmlDoc, "/w:document/w:body/w:p[14]/w:r[3]/w:drawing/wp:anchor/wp:docPr"_ostr, "name"_ostr);
CPPUNIT_ASSERT_EQUAL(OUString("Object3"), anchorName);
}
@@ -1056,7 +1056,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf131594)
loadAndSave("tdf131594.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// lnNumType should not be exported if w:countBy="0"
- assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:lnNumType", 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:lnNumType"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf121663)
@@ -1064,7 +1064,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121663)
loadAndSave("tdf121663.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// auto distance of line numbering is 0.5 cm
- assertXPath(pXmlDoc, "//w:lnNumType", "distance", "283");
+ assertXPath(pXmlDoc, "//w:lnNumType"_ostr, "distance"_ostr, "283");
}
DECLARE_OOXMLEXPORT_TEST(testInvalidDateFormField, "invalid_date_form_field.docx")
@@ -1181,8 +1181,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127116)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:bookmarkStart", "name");
- OUString anchor = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:hyperlink", "anchor");
+ OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:bookmarkStart"_ostr, "name"_ostr);
+ OUString anchor = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:hyperlink"_ostr, "anchor"_ostr);
CPPUNIT_ASSERT_EQUAL(anchor, bookmarkName);
}
@@ -1191,7 +1191,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127339)
loadAndSave("tdf127339.docx");
xmlDocUniquePtr pXmlRels = parseExport("word/_rels/document.xml.rels");
- assertXPathNoAttribute(pXmlRels, "/rels:Relationships/rels:Relationship[@Target='#bookmark']", "TargetMode");
+ assertXPathNoAttribute(pXmlRels, "/rels:Relationships/rels:Relationship[@Target='#bookmark']"_ostr, "TargetMode"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf127362)
@@ -1203,8 +1203,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127362)
xmlDocUniquePtr pXmlRels = parseExport("word/_rels/document.xml.rels");
- OUString bookmarkName = "#" + getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:bookmarkStart", "name");
- OUString anchor = getXPath(pXmlRels, "/rels:Relationships/rels:Relationship[@Id='rId3']", "Target");
+ OUString bookmarkName = "#" + getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:bookmarkStart"_ostr, "name"_ostr);
+ OUString anchor = getXPath(pXmlRels, "/rels:Relationships/rels:Relationship[@Id='rId3']"_ostr, "Target"_ostr);
CPPUNIT_ASSERT_EQUAL(anchor, bookmarkName);
}
@@ -1215,8 +1215,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127605)
CPPUNIT_ASSERT_EQUAL(2, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:bookmarkStart", "name");
- OUString anchor = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink", "anchor");
+ OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:bookmarkStart"_ostr, "name"_ostr);
+ OUString anchor = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink"_ostr, "anchor"_ostr);
CPPUNIT_ASSERT_EQUAL(anchor, bookmarkName);
}
@@ -1227,8 +1227,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127732)
CPPUNIT_ASSERT_EQUAL(2, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:textbox/w:txbxContent/w:p/w:bookmarkStart", "name");
- OUString anchor = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink", "anchor");
+ OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:textbox/w:txbxContent/w:p/w:bookmarkStart"_ostr, "name"_ostr);
+ OUString anchor = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink"_ostr, "anchor"_ostr);
CPPUNIT_ASSERT_EQUAL(anchor, bookmarkName);
}
@@ -1240,8 +1240,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127733)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:bookmarkStart", "name");
- OUString anchor = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink", "anchor");
+ OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:bookmarkStart"_ostr, "name"_ostr);
+ OUString anchor = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink"_ostr, "anchor"_ostr);
CPPUNIT_ASSERT_EQUAL(anchor, bookmarkName);
}
@@ -1251,8 +1251,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127734)
CPPUNIT_ASSERT_EQUAL(2, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:bookmarkStart", "name");
- OUString anchor = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink", "anchor");
+ OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:bookmarkStart"_ostr, "name"_ostr);
+ OUString anchor = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink"_ostr, "anchor"_ostr);
CPPUNIT_ASSERT_EQUAL(anchor, bookmarkName);
}
@@ -1262,8 +1262,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127735)
CPPUNIT_ASSERT_EQUAL(2, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:bookmarkStart", "name");
- OUString anchor = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink", "anchor");
+ OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:bookmarkStart"_ostr, "name"_ostr);
+ OUString anchor = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink"_ostr, "anchor"_ostr);
CPPUNIT_ASSERT_EQUAL(anchor, bookmarkName);
}
@@ -1275,8 +1275,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123628)
xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink/w:r/w:rPr/w:rStyle", "val", "Hyperlink");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Hyperlink']/w:name", "val", "Hyperlink");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink/w:r/w:rPr/w:rStyle"_ostr, "val"_ostr, "Hyperlink");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Hyperlink']/w:name"_ostr, "val"_ostr, "Hyperlink");
}
DECLARE_OOXMLEXPORT_TEST(testTdf127741, "tdf127741.docx")
@@ -1293,8 +1293,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf142693_hugePaperSizeImport)
{
loadAndSave("tdf142693_hugePaperSizeImport.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgSz", "w", "90369");
- assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgSz", "h", "104372");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgSz"_ostr, "w"_ostr, "90369");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgSz"_ostr, "h"_ostr, "104372");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf127925)
@@ -1302,7 +1302,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127925)
loadAndSave("tdf127925.odt");
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='FollowedHyperlink']/w:name", "val", "FollowedHyperlink");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='FollowedHyperlink']/w:name"_ostr, "val"_ostr, "FollowedHyperlink");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf127579)
@@ -1310,7 +1310,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127579)
loadAndSave("tdf127579.odt");
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:hyperlink/w:r/w:rPr/w:rStyle", "val", "Hyperlink");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:hyperlink/w:r/w:rPr/w:rStyle"_ostr, "val"_ostr, "Hyperlink");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf128304)
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index a9707e1c305d..71aa3052bf6d 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -76,11 +76,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128197)
{
createSwDoc("128197_compat14.docx");
xmlDocUniquePtr pLayout14 = parseLayoutDump();
- sal_Int32 nHeight14 = getXPath(pLayout14, "//page[1]/body/txt[1]/infos/bounds", "height").toInt32();
+ sal_Int32 nHeight14 = getXPath(pLayout14, "//page[1]/body/txt[1]/infos/bounds"_ostr, "height"_ostr).toInt32();
createSwDoc("128197_compat15.docx");
xmlDocUniquePtr pLayout15 = parseLayoutDump();
- sal_Int32 nHeight15 = getXPath(pLayout15, "//page[1]/body/txt[1]/infos/bounds", "height").toInt32();
+ sal_Int32 nHeight15 = getXPath(pLayout15, "//page[1]/body/txt[1]/infos/bounds"_ostr, "height"_ostr).toInt32();
// In compat mode=14 second line has size of the shape thus entire paragraph height is smaller
// So nHeight14 < nHeight15
@@ -91,7 +91,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf135595_HFtableWrap)
{
loadAndReload("tdf135595_HFtableWrap.odt");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- sal_Int32 nRowHeight = getXPath(pXmlDoc, "//page[1]/header/tab/row/infos/bounds", "height").toInt32();
+ sal_Int32 nRowHeight = getXPath(pXmlDoc, "//page[1]/header/tab/row/infos/bounds"_ostr, "height"_ostr).toInt32();
// tdf#77794: always force bLayoutInCell from false to true for MSO2013+
// The fly is supposed to be inside the cell. Before, height was 998. Now it is 2839.
CPPUNIT_ASSERT_MESSAGE("Image must be contained inside the table cell", nRowHeight > 2000);
@@ -104,10 +104,10 @@ DECLARE_OOXMLEXPORT_TEST(testTdf135943_shapeWithText_L0c15,
// HOWEVER, currently only the shape is correctly placed, while its text is un-synced separately.
// So to prevent this ugly mess, just leave everything together in the historical (wrong) spot.
xmlDocUniquePtr pDump = parseLayoutDump();
- sal_Int32 nFrameLeft = getXPath(pDump, "//anchored/SwAnchoredDrawObject/bounds", "left").toInt32();
- sal_Int32 nFrameRight = getXPath(pDump, "//anchored/SwAnchoredDrawObject/bounds", "right").toInt32();
- sal_Int32 nTextLeft = getXPath(pDump, "//anchored/fly/infos/bounds", "left").toInt32();
- sal_Int32 nTextRight = getXPath(pDump, "//anchored/fly/infos/bounds", "right").toInt32();
+ sal_Int32 nFrameLeft = getXPath(pDump, "//anchored/SwAnchoredDrawObject/bounds"_ostr, "left"_ostr).toInt32();
+ sal_Int32 nFrameRight = getXPath(pDump, "//anchored/SwAnchoredDrawObject/bounds"_ostr, "right"_ostr).toInt32();
+ sal_Int32 nTextLeft = getXPath(pDump, "//anchored/fly/infos/bounds"_ostr, "left"_ostr).toInt32();
+ sal_Int32 nTextRight = getXPath(pDump, "//anchored/fly/infos/bounds"_ostr, "right"_ostr).toInt32();
// The text must be inside of its frame boundaries
CPPUNIT_ASSERT(nFrameRight >= nTextRight);
CPPUNIT_ASSERT(nFrameLeft <= nTextLeft);
@@ -125,7 +125,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf135595_HFtableWrap_c12, "tdf135595_HFtableWrap_c
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// tdf#104596: ignore wrap exception apparently does not apply if it is not "layout in table cell".
// Should be only one page. Row height should be two lines at 722, not wrapped to three lines at 998.
- sal_Int32 nRowHeight = getXPath(pXmlDoc, "//header/tab/row/infos/bounds", "height").toInt32();
+ sal_Int32 nRowHeight = getXPath(pXmlDoc, "//header/tab/row/infos/bounds"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_MESSAGE("Text must not wrap around header image", nRowHeight < 800);
}
@@ -133,9 +133,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf151704_thinColumnHeight, "tdf151704_thinColumnHe
{
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
sal_Int32 nRowHeightT1 = getXPath(
- pXmlDoc, "//page[1]/body/tab[1]/row/cell/tab[1]/row[1]/infos/bounds", "height").toInt32();
+ pXmlDoc, "//page[1]/body/tab[1]/row/cell/tab[1]/row[1]/infos/bounds"_ostr, "height"_ostr).toInt32();
sal_Int32 nRowHeightT2 = getXPath(
- pXmlDoc, "//page[2]/body/tab/row[1]/infos/bounds", "height").toInt32();
+ pXmlDoc, "//page[2]/body/tab/row[1]/infos/bounds"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_EQUAL_MESSAGE("Same row height in both tables", nRowHeightT1, nRowHeightT2);
}
@@ -169,7 +169,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128207)
//There was the charts on each other, because their horizontal and vertical position was 0!
xmlDocUniquePtr p_XmlDoc = parseExport("word/document.xml");
CPPUNIT_ASSERT(p_XmlDoc);
- assertXPathContent(p_XmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:anchor/wp:positionH/wp:posOffset", "4445");
+ assertXPathContent(p_XmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:anchor/wp:positionH/wp:posOffset"_ostr, "4445");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf123873)
@@ -179,7 +179,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123873)
xmlDocUniquePtr p_XmlDoc = parseExport("word/document.xml");
CPPUNIT_ASSERT(p_XmlDoc);
assertXPath(
- p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:drawing/wp:anchor/wp:wrapTopAndBottom");
+ p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:drawing/wp:anchor/wp:wrapTopAndBottom"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, Tdf133065)
@@ -191,25 +191,25 @@ CPPUNIT_TEST_FIXTURE(Test, Tdf133065)
CPPUNIT_ASSERT(pxmldoc);
OUString aVal;
- aVal = getXPath(pxmldoc, "/w:document/w:body/w:p[3]/w:r[2]/w:object/v:shape/w10:wrap", "type");
+ aVal = getXPath(pxmldoc, "/w:document/w:body/w:p[3]/w:r[2]/w:object/v:shape/w10:wrap"_ostr, "type"_ostr);
CPPUNIT_ASSERT(aVal.indexOf("square") > -1);
- aVal = getXPath(pxmldoc, "/w:document/w:body/w:p[3]/w:r[2]/w:object/v:shape/w10:wrap", "side");
+ aVal = getXPath(pxmldoc, "/w:document/w:body/w:p[3]/w:r[2]/w:object/v:shape/w10:wrap"_ostr, "side"_ostr);
CPPUNIT_ASSERT(aVal.indexOf("left") > -1);
- aVal = getXPath(pxmldoc, "/w:document/w:body/w:p[8]/w:r[2]/w:object/v:shape/w10:wrap", "type");
+ aVal = getXPath(pxmldoc, "/w:document/w:body/w:p[8]/w:r[2]/w:object/v:shape/w10:wrap"_ostr, "type"_ostr);
CPPUNIT_ASSERT(aVal.indexOf("square") > -1);
- aVal = getXPath(pxmldoc, "/w:document/w:body/w:p[8]/w:r[2]/w:object/v:shape/w10:wrap", "side");
+ aVal = getXPath(pxmldoc, "/w:document/w:body/w:p[8]/w:r[2]/w:object/v:shape/w10:wrap"_ostr, "side"_ostr);
CPPUNIT_ASSERT(aVal.indexOf("right") > -1);
- aVal = getXPath(pxmldoc, "/w:document/w:body/w:p[12]/w:r[2]/w:object/v:shape/w10:wrap", "type");
+ aVal = getXPath(pxmldoc, "/w:document/w:body/w:p[12]/w:r[2]/w:object/v:shape/w10:wrap"_ostr, "type"_ostr);
CPPUNIT_ASSERT(aVal.indexOf("square") > -1);
- aVal = getXPath(pxmldoc, "/w:document/w:body/w:p[12]/w:r[2]/w:object/v:shape/w10:wrap", "side");
+ aVal = getXPath(pxmldoc, "/w:document/w:body/w:p[12]/w:r[2]/w:object/v:shape/w10:wrap"_ostr, "side"_ostr);
CPPUNIT_ASSERT(aVal.indexOf("largest") > -1);
- aVal = getXPath(pxmldoc, "/w:document/w:body/w:p[20]/w:r[2]/w:object/v:shape/w10:wrap", "type");
+ aVal = getXPath(pxmldoc, "/w:document/w:body/w:p[20]/w:r[2]/w:object/v:shape/w10:wrap"_ostr, "type"_ostr);
CPPUNIT_ASSERT(aVal.indexOf("topAndBottom") > -1);
- aVal = getXPath(pxmldoc, "/w:document/w:body/w:p[24]/w:r[2]/w:object/v:shape/w10:wrap", "type");
+ aVal = getXPath(pxmldoc, "/w:document/w:body/w:p[24]/w:r[2]/w:object/v:shape/w10:wrap"_ostr, "type"_ostr);
CPPUNIT_ASSERT(aVal.indexOf("square") > -1);
}
@@ -230,13 +230,13 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf107020)
xmlDocUniquePtr p_XmlDoc = parseExport("word/document.xml");
CPPUNIT_ASSERT(p_XmlDoc);
assertXPath(
- p_XmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:srcRect", "l", "4910");
+ p_XmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:srcRect"_ostr, "l"_ostr, "4910");
assertXPath(
- p_XmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:srcRect", "t", "27183");
+ p_XmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:srcRect"_ostr, "t"_ostr, "27183");
assertXPath(
- p_XmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:srcRect", "r", "57638");
+ p_XmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:srcRect"_ostr, "r"_ostr, "57638");
assertXPath(
- p_XmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:srcRect", "b", "48360");
+ p_XmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:srcRect"_ostr, "b"_ostr, "48360");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf130814ooxml)
@@ -245,19 +245,19 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf130814ooxml)
xmlDocUniquePtr p_XmlDoc = parseExport("word/document.xml");
CPPUNIT_ASSERT(p_XmlDoc);
assertXPath(
- p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w:rFonts", "eastAsia", "Arial Unicode MS");
+ p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w:rFonts"_ostr, "eastAsia"_ostr, "Arial Unicode MS");
assertXPath(
- p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w:rFonts", "ascii", "Candara");
+ p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w:rFonts"_ostr, "ascii"_ostr, "Candara");
assertXPath(
- p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w:rFonts", "hAnsi", "Candara");
+ p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w:rFonts"_ostr, "hAnsi"_ostr, "Candara");
assertXPath(
- p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w:color", "val", "1F497D");
+ p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w:color"_ostr, "val"_ostr, "1F497D");
assertXPath(
- p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w:sz", "val", "32");
+ p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w:sz"_ostr, "val"_ostr, "32");
assertXPath(
- p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w:szCs", "val", "32");
+ p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w:szCs"_ostr, "val"_ostr, "32");
assertXPath(
- p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w:u", "val", "single");
+ p_XmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w:u"_ostr, "val"_ostr, "single");
}
DECLARE_OOXMLEXPORT_TEST(testTdf129888vml, "tdf129888vml.docx")
@@ -294,7 +294,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf130120)
// Text for exporting the allowincell attribute:
xmlDocUniquePtr p_XmlDoc = parseExport("word/document.xml");
assertXPath(p_XmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r/mc:AlternateContent/"
- "mc:Choice/w:drawing/wp:anchor", "layoutInCell", "0");
+ "mc:Choice/w:drawing/wp:anchor"_ostr, "layoutInCell"_ostr, "0");
}
CPPUNIT_TEST_FIXTURE(Test, Tdf133030)
@@ -303,9 +303,9 @@ CPPUNIT_TEST_FIXTURE(Test, Tdf133030)
auto pExport = parseExport("word/document.xml");
CPPUNIT_ASSERT(pExport);
- assertXPath(pExport, "/w:document/w:body/w:p[3]/m:oMathPara/m:oMathParaPr/m:jc", "val", "center");
- assertXPath(pExport, "/w:document/w:body/w:p[5]/m:oMathPara/m:oMathParaPr/m:jc", "val", "left");
- assertXPath(pExport, "/w:document/w:body/w:p[7]/m:oMathPara/m:oMathParaPr/m:jc", "val", "right");
+ assertXPath(pExport, "/w:document/w:body/w:p[3]/m:oMathPara/m:oMathParaPr/m:jc"_ostr, "val"_ostr, "center");
+ assertXPath(pExport, "/w:document/w:body/w:p[5]/m:oMathPara/m:oMathParaPr/m:jc"_ostr, "val"_ostr, "left");
+ assertXPath(pExport, "/w:document/w:body/w:p[7]/m:oMathPara/m:oMathParaPr/m:jc"_ostr, "val"_ostr, "right");
}
DECLARE_OOXMLEXPORT_TEST(testTdf87569v, "tdf87569_vml.docx")
@@ -322,10 +322,10 @@ DECLARE_OOXMLEXPORT_TEST(testTdf133000_numStyleFormatting, "tdf133000_numStyleFo
{
// Paragraph style's LeftMargin should not override numbering's Left Margin
xmlDocUniquePtr pDump = parseLayoutDump();
- assertXPathContent(pDump, "/root/page[1]/body/txt[2]", "First line");
- const sal_Int32 nLevel1Margin = getXPath(pDump, "//page[1]/body/txt[2]/infos/prtBounds", "left").toInt32();
- assertXPathContent(pDump, "/root/page[1]/body/txt[4]", "One sublevel");
- const sal_Int32 nLevel2Margin = getXPath(pDump, "//page[1]/body/txt[4]/infos/prtBounds", "left").toInt32();
+ assertXPathContent(pDump, "/root/page[1]/body/txt[2]"_ostr, "First line");
+ const sal_Int32 nLevel1Margin = getXPath(pDump, "//page[1]/body/txt[2]/infos/prtBounds"_ostr, "left"_ostr).toInt32();
+ assertXPathContent(pDump, "/root/page[1]/body/txt[4]"_ostr, "One sublevel");
+ const sal_Int32 nLevel2Margin = getXPath(pDump, "//page[1]/body/txt[4]/infos/prtBounds"_ostr, "left"_ostr).toInt32();
CPPUNIT_ASSERT( nLevel1Margin < nLevel2Margin );
}
@@ -437,7 +437,7 @@ CPPUNIT_TEST_FIXTURE(Test, testArabicZeroNumberingFootnote)
// Without the accompanying fix in place, this test would have failed with:
// XPath '/w:document/w:body/w:sectPr/w:footnotePr/w:numFmt' number of nodes is incorrect
// because the exporter had no idea what markup to use for ARABIC_ZERO.
- assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:footnotePr/w:numFmt", "val", "decimalZero");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:footnotePr/w:numFmt"_ostr, "val"_ostr, "decimalZero");
}
CPPUNIT_TEST_FIXTURE(Test, testChicagoNumberingFootnote)
@@ -465,34 +465,34 @@ CPPUNIT_TEST_FIXTURE(Test, testChicagoNumberingFootnote)
// Without the accompanying fix in place, this test would have failed with:
// XPath '/w:document/w:body/w:sectPr/w:footnotePr/w:numFmt' number of nodes is incorrect
// because the exporter had no idea what markup to use for SYMBOL_CHICAGO.
- assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:footnotePr/w:numFmt", "val", "chicago");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:footnotePr/w:numFmt"_ostr, "val"_ostr, "chicago");
}
CPPUNIT_TEST_FIXTURE(Test, testListNotCountedIndent)
{
loadAndReload("list_notcounted_indent.fodt");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:numPr/w:numId", "val", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:numPr/w:numId"_ostr, "val"_ostr, "0");
// wrong: 720
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind", "start", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind", "end", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind", "hanging", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:numPr/w:numId", "val", "2");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:ind", 0);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:numPr/w:numId", "val", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind"_ostr, "start"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind"_ostr, "end"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:ind"_ostr, "hanging"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:numPr/w:numId"_ostr, "val"_ostr, "2");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:ind"_ostr, 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:numPr/w:numId"_ostr, "val"_ostr, "0");
// wrong: 180
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:ind", "start", "720");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:ind", "hanging", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:numPr/w:numId", "val", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:ind"_ostr, "start"_ostr, "720");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:ind"_ostr, "hanging"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:numPr/w:numId"_ostr, "val"_ostr, "0");
// wrong: 720
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:ind", "start", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:ind", "end", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:ind", "hanging", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:numPr/w:numId", "val", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:ind"_ostr, "start"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:ind"_ostr, "end"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:ind"_ostr, "hanging"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:numPr/w:numId"_ostr, "val"_ostr, "0");
// wrong: 720
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:ind", "start", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:ind", "end", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:ind", "hanging", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:ind"_ostr, "start"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:ind"_ostr, "end"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:ind"_ostr, "hanging"_ostr, "0");
}
DECLARE_OOXMLEXPORT_TEST(testTdf87569d, "tdf87569_drawingml.docx")
@@ -530,7 +530,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf130610)
if (isExported())
{
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:rPr/w:b");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:rPr/w:b"_ostr);
}
}
}
@@ -540,21 +540,21 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121045)
loadAndSave("tdf121045.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:pPr/w:rPr/w:sz", "val", "20");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:pPr/w:rPr/w:szCs", "val", "20");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[1]/w:fldChar", "fldCharType", "begin");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[2]/w:instrText", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[3]/w:fldChar", "fldCharType", "separate");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[5]/w:fldChar", "fldCharType", "end");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:pPr/w:rPr/w:sz"_ostr, "val"_ostr, "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:pPr/w:rPr/w:szCs"_ostr, "val"_ostr, "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[1]/w:fldChar"_ostr, "fldCharType"_ostr, "begin");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[2]/w:instrText"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[3]/w:fldChar"_ostr, "fldCharType"_ostr, "separate");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[5]/w:fldChar"_ostr, "fldCharType"_ostr, "end");
// form control keeps its direct formatted font size
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[2]/w:rPr/w:sz", "val", "20");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[2]/w:rPr/w:szCs", "val", "20");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[3]/w:rPr/w:sz", "val", "20");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[3]/w:rPr/w:szCs", "val", "20");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[4]/w:rPr/w:sz", "val", "20");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[4]/w:rPr/w:szCs", "val", "20");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[5]/w:rPr/w:sz", "val", "20");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[5]/w:rPr/w:szCs", "val", "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[2]/w:rPr/w:sz"_ostr, "val"_ostr, "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[2]/w:rPr/w:szCs"_ostr, "val"_ostr, "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[3]/w:rPr/w:sz"_ostr, "val"_ostr, "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[3]/w:rPr/w:szCs"_ostr, "val"_ostr, "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[4]/w:rPr/w:sz"_ostr, "val"_ostr, "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[4]/w:rPr/w:szCs"_ostr, "val"_ostr, "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[5]/w:rPr/w:sz"_ostr, "val"_ostr, "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[5]/w:rPr/w:szCs"_ostr, "val"_ostr, "20");
}
DECLARE_OOXMLEXPORT_TEST(testTdf78352, "tdf78352.docx")
@@ -562,7 +562,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf78352, "tdf78352.docx")
CPPUNIT_ASSERT_EQUAL(1, getPages());
// Ensure that width of first tab is close to zero (previous value was ~1000 twips)
- int nWidth = parseDump("/root/page/body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::TabLeft']", "width").toInt32();
+ int nWidth = parseDump("/root/page/body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::TabLeft']"_ostr, "width"_ostr).toInt32();
CPPUNIT_ASSERT_LESS(150, nWidth);
}
@@ -572,26 +572,26 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf81567)
CPPUNIT_ASSERT_EQUAL(1, getPages());
CPPUNIT_ASSERT_EQUAL(2, getShapes());
- int nFrameWidth = parseDump("/root/page/body/txt/anchored/fly/infos/bounds", "width").toInt32();
+ int nFrameWidth = parseDump("/root/page/body/txt/anchored/fly/infos/bounds"_ostr, "width"_ostr).toInt32();
CPPUNIT_ASSERT_EQUAL(2371, nFrameWidth);
- int nFrameHeight = parseDump("/root/page/body/txt/anchored/fly/infos/bounds", "height").toInt32();
+ int nFrameHeight = parseDump("/root/page/body/txt/anchored/fly/infos/bounds"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_EQUAL(3520, nFrameHeight);
- int nFrameTop = parseDump("/root/page/body/txt/anchored/fly/infos/bounds", "top").toInt32();
+ int nFrameTop = parseDump("/root/page/body/txt/anchored/fly/infos/bounds"_ostr, "top"_ostr).toInt32();
CPPUNIT_ASSERT_EQUAL(1518, nFrameTop);
- int nImageWidth = parseDump("/root/page/body/txt/anchored/fly/txt/anchored/fly/infos/bounds", "width").toInt32();
+ int nImageWidth = parseDump("/root/page/body/txt/anchored/fly/txt/anchored/fly/infos/bounds"_ostr, "width"_ostr).toInt32();
CPPUNIT_ASSERT_EQUAL(2370, nImageWidth);
- int nImageHeight = parseDump("/root/page/body/txt/anchored/fly/txt/anchored/fly/infos/bounds", "height").toInt32();
+ int nImageHeight = parseDump("/root/page/body/txt/anchored/fly/txt/anchored/fly/infos/bounds"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_EQUAL(1605, nImageHeight);
// Check the image is at the top of the frame
// Without the fix in place, this test would have failed with:
// - Expected: 1638
// - Actual : 2236
- int nImageTop = parseDump("/root/page/body/txt/anchored/fly/txt/anchored/fly/infos/bounds", "top").toInt32();
+ int nImageTop = parseDump("/root/page/body/txt/anchored/fly/txt/anchored/fly/infos/bounds"_ostr, "top"_ostr).toInt32();
CPPUNIT_ASSERT_EQUAL(1638, nImageTop);
}
@@ -600,21 +600,21 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf92472)
loadAndSave("tdf92472.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:sz", "val", "20");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:szCs", "val", "20");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:fldChar", "fldCharType", "begin");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:instrText", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[3]/w:fldChar", "fldCharType", "separate");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[5]/w:fldChar", "fldCharType", "end");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:sz"_ostr, "val"_ostr, "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:szCs"_ostr, "val"_ostr, "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:fldChar"_ostr, "fldCharType"_ostr, "begin");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:instrText"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[3]/w:fldChar"_ostr, "fldCharType"_ostr, "separate");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[5]/w:fldChar"_ostr, "fldCharType"_ostr, "end");
// form control keeps its direct formatted font size
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:rPr/w:sz", "val", "20");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:rPr/w:szCs", "val", "20");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[3]/w:rPr/w:sz", "val", "20");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[3]/w:rPr/w:szCs", "val", "20");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[4]/w:rPr/w:sz", "val", "20");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[4]/w:rPr/w:szCs", "val", "20");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[5]/w:rPr/w:sz", "val", "20");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[5]/w:rPr/w:szCs", "val", "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:rPr/w:sz"_ostr, "val"_ostr, "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:rPr/w:szCs"_ostr, "val"_ostr, "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[3]/w:rPr/w:sz"_ostr, "val"_ostr, "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[3]/w:rPr/w:szCs"_ostr, "val"_ostr, "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[4]/w:rPr/w:sz"_ostr, "val"_ostr, "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[4]/w:rPr/w:szCs"_ostr, "val"_ostr, "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[5]/w:rPr/w:sz"_ostr, "val"_ostr, "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[5]/w:rPr/w:szCs"_ostr, "val"_ostr, "20");
}
CPPUNIT_TEST_FIXTURE(Test, Tdf133035)
@@ -622,7 +622,7 @@ CPPUNIT_TEST_FIXTURE(Test, Tdf133035)
loadAndSave("tdf133035.docx");
auto pxml = parseExport("word/document.xml");
CPPUNIT_ASSERT(pxml);
- OUString aXmlVal = getXPath(pxml, "/w:document/w:body/w:p[1]/w:r[1]/w:object/v:shape", "style");
+ OUString aXmlVal = getXPath(pxml, "/w:document/w:body/w:p[1]/w:r[1]/w:object/v:shape"_ostr, "style"_ostr);
CPPUNIT_ASSERT(aXmlVal.indexOf("margin-left:186.6pt") > -1);
}
@@ -742,7 +742,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf83309, "tdf83309.docx")
// First paragraph does not have tab before
// (same applies to all paragraphs in doc, but lets assume they are
// behave same way)
- OUString sNodeType = parseDump("(/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*)[1]", "type");
+ OUString sNodeType = parseDump("(/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*)[1]"_ostr, "type"_ostr);
CPPUNIT_ASSERT_EQUAL(OUString("PortionType::Text"), sNodeType);
// tdf148380: creation-date field in header.xml was unsupported on export
@@ -757,7 +757,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121661)
{
loadAndSave("tdf121661.docx");
xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml");
- assertXPath(pXmlSettings, "/w:settings/w:hyphenationZone", "val", "851");
+ assertXPath(pXmlSettings, "/w:settings/w:hyphenationZone"_ostr, "val"_ostr, "851");
// tdf#149421
uno::Reference<beans::XPropertySet> xStyle(getStyles("ParagraphStyles")->getByName("Standard"), uno::UNO_QUERY);
@@ -789,7 +789,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf121658)
{
loadAndSave("tdf121658.docx");
xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml");
- assertXPath(pXmlSettings, "/w:settings/w:doNotHyphenateCaps");
+ assertXPath(pXmlSettings, "/w:settings/w:doNotHyphenateCaps"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTableStyleConfNested)
@@ -800,7 +800,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableStyleConfNested)
// Without the accompanying fix in place, this test would have failed, as the custom table cell
// border properties were lost, so the outer A2 cell started to have borders, not present in the
// doc model.
- assertXPath(pXmlDoc, "//w:body/w:tbl/w:tr/w:tc[2]/w:tcPr/w:tcBorders/w:top", "val", "nil");
+ assertXPath(pXmlDoc, "//w:body/w:tbl/w:tr/w:tc[2]/w:tcPr/w:tcBorders/w:top"_ostr, "val"_ostr, "nil");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf133771)
@@ -816,7 +816,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133771)
save("Office Open XML Text");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
CPPUNIT_ASSERT(pXmlDoc);
- assertXPathContent(pXmlDoc, "//w:body/w:p/w:r/w:t", "Password Protected");
+ assertXPathContent(pXmlDoc, "//w:body/w:p/w:r/w:t"_ostr, "Password Protected");
}
CPPUNIT_TEST_FIXTURE(Test, testZeroLineSpacing)
@@ -838,8 +838,8 @@ CPPUNIT_TEST_FIXTURE(Test, testZeroLineSpacing)
// - Expected: atLeast
// - Actual : auto
// i.e. the minimal linespacing was lost on export.
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:spacing", "lineRule", "atLeast");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:spacing", "line", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:spacing"_ostr, "lineRule"_ostr, "atLeast");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:spacing"_ostr, "line"_ostr, "0");
}
CPPUNIT_TEST_FIXTURE(Test, testSemiTransparentText)
@@ -862,8 +862,8 @@ CPPUNIT_TEST_FIXTURE(Test, testSemiTransparentText)
CPPUNIT_ASSERT(pXmlDoc);
double fValue = getXPath(
pXmlDoc,
- "/w:document/w:body/w:p/w:r/w:rPr/w14:textFill/w14:solidFill/w14:srgbClr/w14:alpha",
- "val")
+ "/w:document/w:body/w:p/w:r/w:rPr/w14:textFill/w14:solidFill/w14:srgbClr/w14:alpha"_ostr,
+ "val"_ostr)
.toDouble();
sal_Int16 nActual = basegfx::fround(fValue / oox::drawingml::PER_PERCENT);
@@ -907,14 +907,14 @@ CPPUNIT_TEST_FIXTURE(Test, testUserField)
// Without the accompanying fix in place, this test would have failed, the user field was
// exported as <w:t>User Field foo = bar</w:t>.
- assertXPathContent(pXmlDoc, "//w:p/w:r[2]/w:instrText", " DOCVARIABLE foo ");
- assertXPathContent(pXmlDoc, "//w:p/w:r[4]/w:t", "bar");
+ assertXPathContent(pXmlDoc, "//w:p/w:r[2]/w:instrText"_ostr, " DOCVARIABLE foo ");
+ assertXPathContent(pXmlDoc, "//w:p/w:r[4]/w:t"_ostr, "bar");
// Make sure that not only the variables, but also their values are written.
pXmlDoc = parseExport("word/settings.xml");
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "//w:docVars/w:docVar", "name", "foo");
- assertXPath(pXmlDoc, "//w:docVars/w:docVar", "val", "bar");
+ assertXPath(pXmlDoc, "//w:docVars/w:docVar"_ostr, "name"_ostr, "foo");
+ assertXPath(pXmlDoc, "//w:docVars/w:docVar"_ostr, "val"_ostr, "bar");
}
CPPUNIT_TEST_FIXTURE(Test, testHighlightEdit_numbering)
@@ -957,7 +957,7 @@ CPPUNIT_TEST_FIXTURE(Test, testHighlightEdit_numbering)
// Paragraph 2 should have only one w:highlight written per w:rPr. Without the fix, there were two.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//w:body/w:p[2]/w:pPr/w:rPr/w:highlight", "val", "none");
+ assertXPath(pXmlDoc, "//w:body/w:p[2]/w:pPr/w:rPr/w:highlight"_ostr, "val"_ostr, "none");
// Visually, the "none" highlight means the bullet point should not have a character background.
if (bWasExportToShade)
@@ -971,14 +971,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132766)
CPPUNIT_ASSERT(pXmlDoc);
// Ensure that for list=1 and level=0 we wrote correct bullet char and correct font
- assertXPath(pXmlDoc, "//w:numbering/w:abstractNum[@w:abstractNumId='1']/w:lvl[@w:ilvl='0']/w:lvlText",
- "val", u"\uF0B7"_ustr);
- assertXPath(pXmlDoc, "//w:numbering/w:abstractNum[@w:abstractNumId='1']/w:lvl[@w:ilvl='0']/w:rPr/w:rFonts",
- "ascii", "Symbol");
- assertXPath(pXmlDoc, "//w:numbering/w:abstractNum[@w:abstractNumId='1']/w:lvl[@w:ilvl='0']/w:rPr/w:rFonts",
- "hAnsi", "Symbol");
- assertXPath(pXmlDoc, "//w:numbering/w:abstractNum[@w:abstractNumId='1']/w:lvl[@w:ilvl='0']/w:rPr/w:rFonts",
- "cs", "Symbol");
+ assertXPath(pXmlDoc, "//w:numbering/w:abstractNum[@w:abstractNumId='1']/w:lvl[@w:ilvl='0']/w:lvlText"_ostr,
+ "val"_ostr, u"\uF0B7"_ustr);
+ assertXPath(pXmlDoc, "//w:numbering/w:abstractNum[@w:abstractNumId='1']/w:lvl[@w:ilvl='0']/w:rPr/w:rFonts"_ostr,
+ "ascii"_ostr, "Symbol");
+ assertXPath(pXmlDoc, "//w:numbering/w:abstractNum[@w:abstractNumId='1']/w:lvl[@w:ilvl='0']/w:rPr/w:rFonts"_ostr,
+ "hAnsi"_ostr, "Symbol");
+ assertXPath(pXmlDoc, "//w:numbering/w:abstractNum[@w:abstractNumId='1']/w:lvl[@w:ilvl='0']/w:rPr/w:rFonts"_ostr,
+ "cs"_ostr, "Symbol");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf128245)
@@ -987,13 +987,13 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128245)
xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml");
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "//w:num[@w:numId='1']/w:abstractNumId", "val", "1");
- assertXPath(pXmlDoc, "//w:num[@w:numId='2']/w:abstractNumId", "val", "2");
- assertXPath(pXmlDoc, "//w:num[@w:numId='3']/w:abstractNumId", "val", "3");
- assertXPath(pXmlDoc, "//w:num[@w:numId='4']/w:abstractNumId", "val", "1");
- assertXPath(pXmlDoc, "//w:num[@w:numId='4']/w:lvlOverride[@w:ilvl='0']", "ilvl", "0");
- assertXPath(pXmlDoc, "//w:num[@w:numId='4']/w:lvlOverride/w:startOverride", "val", "1");
- assertXPath(pXmlDoc, "//w:num[@w:numId='4']/w:lvlOverride[@w:ilvl='1']", 0);
+ assertXPath(pXmlDoc, "//w:num[@w:numId='1']/w:abstractNumId"_ostr, "val"_ostr, "1");
+ assertXPath(pXmlDoc, "//w:num[@w:numId='2']/w:abstractNumId"_ostr, "val"_ostr, "2");
+ assertXPath(pXmlDoc, "//w:num[@w:numId='3']/w:abstractNumId"_ostr, "val"_ostr, "3");
+ assertXPath(pXmlDoc, "//w:num[@w:numId='4']/w:abstractNumId"_ostr, "val"_ostr, "1");
+ assertXPath(pXmlDoc, "//w:num[@w:numId='4']/w:lvlOverride[@w:ilvl='0']"_ostr, "ilvl"_ostr, "0");
+ assertXPath(pXmlDoc, "//w:num[@w:numId='4']/w:lvlOverride/w:startOverride"_ostr, "val"_ostr, "1");
+ assertXPath(pXmlDoc, "//w:num[@w:numId='4']/w:lvlOverride[@w:ilvl='1']"_ostr, 0);
}
DECLARE_OOXMLEXPORT_TEST(testTdf124367, "tdf124367.docx")
@@ -1055,18 +1055,18 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128820)
// all those, to make sure we don't export wrong elements).
assertXPathChildren(pXml,
"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:inline/a:graphic/a:graphicData/wpg:wgp",
+ "wp:inline/a:graphic/a:graphicData/wpg:wgp"_ostr,
3);
assertXPath(pXml,
"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/"
- "a:graphic/a:graphicData/wpg:wgp/wpg:cNvGrpSpPr");
+ "a:graphic/a:graphicData/wpg:wgp/wpg:cNvGrpSpPr"_ostr);
assertXPath(pXml,
"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/"
- "a:graphic/a:graphicData/wpg:wgp/wpg:grpSpPr");
+ "a:graphic/a:graphicData/wpg:wgp/wpg:grpSpPr"_ostr);
// This one was pic:wsp instead of wps:wsp
assertXPath(pXml,
"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/"
- "a:graphic/a:graphicData/wpg:wgp/wps:wsp");
+ "a:graphic/a:graphicData/wpg:wgp/wps:wsp"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf128889)
@@ -1075,10 +1075,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128889)
xmlDocUniquePtr pXml = parseExport("word/document.xml");
CPPUNIT_ASSERT(pXml);
// There was an w:r (with w:br) as an invalid child of first paragraph's w:pPr
- assertXPath(pXml, "/w:document/w:body/w:p[1]/w:pPr/w:r", 0);
- assertXPath(pXml, "/w:document/w:body/w:p[1]/w:r", 2);
+ assertXPath(pXml, "/w:document/w:body/w:p[1]/w:pPr/w:r"_ostr, 0);
+ assertXPath(pXml, "/w:document/w:body/w:p[1]/w:r"_ostr, 2);
// Check that the break is in proper - last - position
- assertXPath(pXml, "/w:document/w:body/w:p[1]/w:r[2]/w:br", "type", "page");
+ assertXPath(pXml, "/w:document/w:body/w:p[1]/w:r[2]/w:br"_ostr, "type"_ostr, "page");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf132754)
@@ -1131,11 +1131,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf77796)
xmlDocUniquePtr pXml = parseExport("word/document.xml");
CPPUNIT_ASSERT(pXml);
// cell paddings from table style
- assertXPath(pXml, "/w:document/w:body/w:tbl/w:tblPr/w:tblCellMar/w:start", "w", "5");
- assertXPath(pXml, "/w:document/w:body/w:tbl/w:tblPr/w:tblCellMar/w:top", "w", "240");
- assertXPath(pXml, "/w:document/w:body/w:tbl/w:tblPr/w:tblCellMar/w:bottom", "w", "480");
+ assertXPath(pXml, "/w:document/w:body/w:tbl/w:tblPr/w:tblCellMar/w:start"_ostr, "w"_ostr, "5");
+ assertXPath(pXml, "/w:document/w:body/w:tbl/w:tblPr/w:tblCellMar/w:top"_ostr, "w"_ostr, "240");
+ assertXPath(pXml, "/w:document/w:body/w:tbl/w:tblPr/w:tblCellMar/w:bottom"_ostr, "w"_ostr, "480");
// not modified
- assertXPath(pXml, "/w:document/w:body/w:tbl/w:tblPr/w:tblCellMar/w:end", "w", "108");
+ assertXPath(pXml, "/w:document/w:body/w:tbl/w:tblPr/w:tblCellMar/w:end"_ostr, "w"_ostr, "108");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf128290)
@@ -1144,11 +1144,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128290)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXml = parseExport("word/document.xml");
CPPUNIT_ASSERT(pXml);
- assertXPath(pXml, "/w:document/w:body/w:tbl/w:tblPr/w:tblLayout", "type", "fixed");
+ assertXPath(pXml, "/w:document/w:body/w:tbl/w:tblPr/w:tblLayout"_ostr, "type"_ostr, "fixed");
// ensure unnecessary suppressLineNumbers entry is not created.
xmlDocUniquePtr pStylesXml = parseExport("word/styles.xml");
- assertXPath(pStylesXml, "//w:style[@w:styleId='Normal']/w:pPr/w:suppressLineNumbers", 0);
+ assertXPath(pStylesXml, "//w:style[@w:styleId='Normal']/w:pPr/w:suppressLineNumbers"_ostr, 0);
}
DECLARE_OOXMLEXPORT_TEST(testTdf120394, "tdf120394.docx")
@@ -1232,7 +1232,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123757)
loadAndSave("tdf123757.docx");
xmlDocUniquePtr pXml = parseExport("word/document.xml");
CPPUNIT_ASSERT(pXml);
- assertXPath(pXml, "/w:document/w:body/w:tbl", 2);
+ assertXPath(pXml, "/w:document/w:body/w:tbl"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf141172)
@@ -1241,7 +1241,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf141172)
xmlDocUniquePtr pXml = parseExport("word/endnotes.xml");
CPPUNIT_ASSERT(pXml);
// This was 1 (lost table during copying endnote content)
- assertXPath(pXml, "/w:endnotes/w:endnote/w:tbl", 2);
+ assertXPath(pXml, "/w:endnotes/w:endnote/w:tbl"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf141548)
@@ -1250,9 +1250,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf141548)
xmlDocUniquePtr pXml = parseExport("word/endnotes.xml");
CPPUNIT_ASSERT(pXml);
// This was 0 (lost text content of the run with endnoteRef)
- assertXPath(pXml, "/w:endnotes/w:endnote[4]/w:p/w:r[2]/w:t", 2);
- assertXPathContent(pXml, "/w:endnotes/w:endnote[4]/w:p/w:r[2]/w:t[1]", "another endnote");
- assertXPathContent(pXml, "/w:endnotes/w:endnote[4]/w:p/w:r[2]/w:t[2]", "new line");
+ assertXPath(pXml, "/w:endnotes/w:endnote[4]/w:p/w:r[2]/w:t"_ostr, 2);
+ assertXPathContent(pXml, "/w:endnotes/w:endnote[4]/w:p/w:r[2]/w:t[1]"_ostr, "another endnote");
+ assertXPathContent(pXml, "/w:endnotes/w:endnote[4]/w:p/w:r[2]/w:t[2]"_ostr, "new line");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf143399)
@@ -1261,16 +1261,16 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143399)
xmlDocUniquePtr pXml = parseExport("word/footnotes.xml");
CPPUNIT_ASSERT(pXml);
// These were 0 (lost text content of documents both with footnotes and endnotes)
- assertXPath(pXml, "/w:footnotes/w:footnote[3]/w:p/w:r[3]/w:t", 1);
- assertXPathContent(pXml, "/w:footnotes/w:footnote[3]/w:p/w:r[3]/w:t", "Footnotes_graphic2");
- assertXPath(pXml, "/w:footnotes/w:footnote[4]/w:p/w:r[3]/w:t", 1);
- assertXPathContent(pXml, "/w:footnotes/w:footnote[4]/w:p/w:r[3]/w:t", "Footnotes_graphic");
+ assertXPath(pXml, "/w:footnotes/w:footnote[3]/w:p/w:r[3]/w:t"_ostr, 1);
+ assertXPathContent(pXml, "/w:footnotes/w:footnote[3]/w:p/w:r[3]/w:t"_ostr, "Footnotes_graphic2");
+ assertXPath(pXml, "/w:footnotes/w:footnote[4]/w:p/w:r[3]/w:t"_ostr, 1);
+ assertXPathContent(pXml, "/w:footnotes/w:footnote[4]/w:p/w:r[3]/w:t"_ostr, "Footnotes_graphic");
xmlDocUniquePtr pXml2 = parseExport("word/endnotes.xml");
CPPUNIT_ASSERT(pXml);
// This was 0 (lost text content of the run with endnoteRef)
- assertXPath(pXml2, "/w:endnotes/w:endnote[3]/w:p/w:r[3]/w:t", 1);
- assertXPathContent(pXml2, "/w:endnotes/w:endnote[3]/w:p/w:r[3]/w:t[1]", "Endnotes");
+ assertXPath(pXml2, "/w:endnotes/w:endnote[3]/w:p/w:r[3]/w:t"_ostr, 1);
+ assertXPathContent(pXml2, "/w:endnotes/w:endnote[3]/w:p/w:r[3]/w:t[1]"_ostr, "Endnotes");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf143583)
@@ -1278,13 +1278,13 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143583)
loadAndSave("tdf143583_emptyParaAtEndOfFootnote.docx");
xmlDocUniquePtr pXml = parseExport("word/footnotes.xml");
CPPUNIT_ASSERT(pXml);
- assertXPath(pXml, "/w:footnotes/w:footnote[3]/w:p", 2);
+ assertXPath(pXml, "/w:footnotes/w:footnote[3]/w:p"_ostr, 2);
// This was 1
- assertXPath(pXml, "/w:footnotes/w:footnote[4]/w:p", 2);
+ assertXPath(pXml, "/w:footnotes/w:footnote[4]/w:p"_ostr, 2);
// This was 2
- assertXPath(pXml, "/w:footnotes/w:footnote[5]/w:p", 3);
+ assertXPath(pXml, "/w:footnotes/w:footnote[5]/w:p"_ostr, 3);
// This was 2
- assertXPath(pXml, "/w:footnotes/w:footnote[6]/w:p", 3);
+ assertXPath(pXml, "/w:footnotes/w:footnote[6]/w:p"_ostr, 3);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf152203)
@@ -1384,8 +1384,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf146346, "tdf146346.docx")
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// check first page: all tables on the first page
- assertXPath(pXmlDoc, "/root/page[1]//anchored/fly", 8);
- assertXPath(pXmlDoc, "/root/page[1]//anchored/fly/tab", 8);
+ assertXPath(pXmlDoc, "/root/page[1]//anchored/fly"_ostr, 8);
+ assertXPath(pXmlDoc, "/root/page[1]//anchored/fly/tab"_ostr, 8);
// No second page.
// Without the accompanying fix in place, this test would have failed with:
@@ -1393,7 +1393,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf146346, "tdf146346.docx")
// - Actual : 1
// i.e. unwanted lower margin in the floating table's anchor paragraph in the footnote created a
// second page.
- assertXPath(pXmlDoc, "/root/page[2]", 0);
+ assertXPath(pXmlDoc, "/root/page[2]"_ostr, 0);
}
#endif
@@ -1412,18 +1412,18 @@ DECLARE_OOXMLEXPORT_TEST(testContSectBreakHeaderFooter, "cont-sect-break-header-
{
// Load a document with a continuous section break on page 2.
CPPUNIT_ASSERT_EQUAL(OUString("First page header, section 1"),
- parseDump("/root/page[1]/header/txt/text()"));
+ parseDump("/root/page[1]/header/txt/text()"_ostr));
CPPUNIT_ASSERT_EQUAL(OUString("First page footer, section 1"),
- parseDump("/root/page[1]/footer/txt/text()"));
+ parseDump("/root/page[1]/footer/txt/text()"_ostr));
// Make sure the header stays like this; if we naively just update the page style name of the
// first para on page 2, then this would be 'Header, section 2', which is incorrect.
CPPUNIT_ASSERT_EQUAL(OUString("First page header, section 2"),
- parseDump("/root/page[2]/header/txt/text()"));
+ parseDump("/root/page[2]/header/txt/text()"_ostr));
CPPUNIT_ASSERT_EQUAL(OUString("First page footer, section 2"),
- parseDump("/root/page[2]/footer/txt/text()"));
+ parseDump("/root/page[2]/footer/txt/text()"_ostr));
// This is inherited from page 2.
CPPUNIT_ASSERT_EQUAL(OUString("Header, section 2"),
- parseDump("/root/page[3]/header/txt/text()"));
+ parseDump("/root/page[3]/header/txt/text()"_ostr));
// Without the accompanying fix in place, this test would have failed with:
// - Expected: 1
// - Actual : 0
@@ -1431,7 +1431,7 @@ DECLARE_OOXMLEXPORT_TEST(testContSectBreakHeaderFooter, "cont-sect-break-header-
// i.e. the footer had no text (inherited from page 2), while the correct behavior is to provide
// the own footer text.
CPPUNIT_ASSERT_EQUAL(OUString("Footer, section 3"),
- parseDump("/root/page[3]/footer/txt/text()"));
+ parseDump("/root/page[3]/footer/txt/text()"_ostr));
// Without the export fix in place, the import-export-import test would have failed with:
// - Expected: Header, section 2
@@ -1447,7 +1447,7 @@ DECLARE_OOXMLEXPORT_TEST(testContSectBreakHeaderFooter, "cont-sect-break-header-
// - Actual : 2574
// i.e. the top margin on page 3 was too large and now matches the value from the input
// document.
- assertXPath(pXml, "/w:document/w:body/w:sectPr/w:pgMar", "top", "2200");
+ assertXPath(pXml, "/w:document/w:body/w:sectPr/w:pgMar"_ostr, "top"_ostr, "2200");
}
}
@@ -1458,17 +1458,17 @@ CPPUNIT_TEST_FIXTURE(Test, testHyphenationAuto)
// Explicitly set hyphenation=auto on document level
xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml");
CPPUNIT_ASSERT(pXmlSettings);
- assertXPath(pXmlSettings, "/w:settings/w:autoHyphenation", "val", "true");
+ assertXPath(pXmlSettings, "/w:settings/w:autoHyphenation"_ostr, "val"_ostr, "true");
// Second paragraph has explicitly enabled hyphenation
xmlDocUniquePtr pXml = parseExport("word/document.xml");
CPPUNIT_ASSERT(pXml);
- assertXPath(pXml, "/w:document/w:body/w:p[2]/w:pPr/w:suppressAutoHyphens", "val", "false");
+ assertXPath(pXml, "/w:document/w:body/w:p[2]/w:pPr/w:suppressAutoHyphens"_ostr, "val"_ostr, "false");
// Default paragraph style explicitly disables hyphens
xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
CPPUNIT_ASSERT(pXmlStyles);
- assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:pPrDefault/w:pPr/w:suppressAutoHyphens", "val", "true");
+ assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:pPrDefault/w:pPr/w:suppressAutoHyphens"_ostr, "val"_ostr, "true");
}
CPPUNIT_TEST_FIXTURE(Test, testStrikeoutGroupShapeText)
@@ -1480,34 +1480,34 @@ CPPUNIT_TEST_FIXTURE(Test, testStrikeoutGroupShapeText)
// double strike (dstrike)
// no "val" attribute
assertXPath(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/"
- "wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:dstrike");
+ "wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:dstrike"_ostr);
assertXPathNoAttribute(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/"
- "wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:dstrike", "val");
+ "wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:dstrike"_ostr, "val"_ostr);
// "val" attribute is true, this is used in this test file. However, LO is going to export this element without the "val" attribute
// because if the element appears, but without an attribute its "val" true by default.
assertXPath(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/"
- "wps:wsp[2]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:dstrike");
+ "wps:wsp[2]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:dstrike"_ostr);
assertXPathNoAttribute(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/"
- "wps:wsp[2]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:dstrike", "val");
+ "wps:wsp[2]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:dstrike"_ostr, "val"_ostr);
// "val" attribute is false (this was missing, resulting the regression)
assertXPath(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/"
- "wps:wsp[3]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:dstrike", "val", "false");
+ "wps:wsp[3]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:dstrike"_ostr, "val"_ostr, "false");
// simple strike (strike)
// no "val" attribute
assertXPath(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/"
- "wps:wsp[4]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:strike");
+ "wps:wsp[4]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:strike"_ostr);
assertXPathNoAttribute(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/"
- "wps:wsp[4]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:strike", "val");
+ "wps:wsp[4]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:strike"_ostr, "val"_ostr);
// "val" attribute is true, this is used in this test file. However, LO is going to export this element without the "val" attribute
// because if the element appears, but without an attribute its "val" true by default.
assertXPath(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/"
- "wps:wsp[5]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:strike");
+ "wps:wsp[5]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:strike"_ostr);
assertXPathNoAttribute(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/"
- "wps:wsp[5]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:strike", "val");
+ "wps:wsp[5]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:strike"_ostr, "val"_ostr);
// "val" attribute is false
assertXPath(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/"
- "wps:wsp[6]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:strike", "val", "false");
+ "wps:wsp[6]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:strike"_ostr, "val"_ostr, "false");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf131539)
@@ -1518,7 +1518,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf131539)
//The positions of OLE objects were not exported, check if now it is exported correctly
xmlDocUniquePtr p_XmlDoc = parseExport("word/document.xml");
CPPUNIT_ASSERT(p_XmlDoc);
- OUString aXmlVal = getXPath(p_XmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:object/v:shape", "style");
+ OUString aXmlVal = getXPath(p_XmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:object/v:shape"_ostr, "style"_ostr);
// This data was missing
CPPUNIT_ASSERT(aXmlVal.indexOf("margin-left:139.95")>-1);
}
@@ -1529,7 +1529,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLineWidthRounding)
// tdf#126363: check if line with stays the same after export
xmlDocUniquePtr pXml = parseExport("word/document.xml");
// this was 57240 (it differs from the original 57150, losing the preset line width)
- assertXPath(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln", "w", "57150");
+ assertXPath(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln"_ostr, "w"_ostr, "57150");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf108505)
@@ -1553,7 +1553,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorHeightFromTopMarginHasHeader)
// Note: page print area top = margin + header height.
// In this case the header exists.
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "height", "2551");
+ assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds"_ostr, "height"_ostr, "2551");
}
CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorHeightFromTopMarginNoHeader)
@@ -1568,16 +1568,16 @@ CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorHeightFromTopMarginNoHeader)
// Note: page print area top = margin + header height.
// In this case the header does not exist, so OpenDocument and OOXML margins are the same.
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "height", "2551");
+ assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds"_ostr, "height"_ostr, "2551");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf64531)
{
loadAndReload("tdf64531.docx");
xmlDocUniquePtr pXmlDoc= parseExport("word/document.xml");
- OString sPathToTabs= "/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:pPr/w:tabs/";
- assertXPath(pXmlDoc, sPathToTabs+"w:tab[1]", "pos","720");
- assertXPath(pXmlDoc, sPathToTabs+"w:tab[2]", "pos","12950");
+ OString sPathToTabs= "/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:pPr/w:tabs/"_ostr;
+ assertXPath(pXmlDoc, sPathToTabs+"w:tab[1]", "pos"_ostr,"720");
+ assertXPath(pXmlDoc, sPathToTabs+"w:tab[2]", "pos"_ostr,"12950");
}
/* temporarily disabled to get further test results
The import now uses the dml shape, not the VML fallback.
@@ -1602,8 +1602,8 @@ DECLARE_OOXMLEXPORT_TEST(testVmlLineShapeMirroredX, "tdf97517_testVmlLineShapeMi
return;
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
OUString sStyle = getXPath(pXmlDoc,
- "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:line",
- "style");
+ "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:line"_ostr,
+ "style"_ostr);
CPPUNIT_ASSERT(sStyle.indexOf("flip:x") > 0);
}
@@ -1614,8 +1614,8 @@ DECLARE_OOXMLEXPORT_TEST(testVmlLineShapeMirroredY, "tdf137678_testVmlLineShapeM
return;
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
OUString sStyle = getXPath(pXmlDoc,
- "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:line",
- "style");
+ "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:line"_ostr,
+ "style"_ostr);
CPPUNIT_ASSERT(sStyle.indexOf("flip:y") > 0);
}
@@ -1626,13 +1626,13 @@ CPPUNIT_TEST_FIXTURE(Test, testVmlLineShapeRotated)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// it was 1.55pt,279.5pt
assertXPath(pXmlDoc,
- "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:line",
- "from",
+ "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:line"_ostr,
+ "from"_ostr,
"-9pt,296.75pt");
// it was 25.5pt,317.8pt
assertXPath(pXmlDoc,
- "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:line",
- "to",
+ "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:line"_ostr,
+ "to"_ostr,
"36.05pt,300.55pt");
}
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index 17cfde266154..8b5359b37ec7 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -33,7 +33,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123621)
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
assertXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor"
- "/wp:positionV/wp:posOffset", "1080135");
+ "/wp:positionV/wp:posOffset"_ostr, "1080135");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf131540)
@@ -54,50 +54,50 @@ DECLARE_OOXMLEXPORT_TEST(testTdf131801, "tdf131801.docx")
xmlDocUniquePtr pDump = parseLayoutDump();
// "1." is red
- CPPUNIT_ASSERT_EQUAL(OUString("1."), getXPath(pDump, "//page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
- CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"), getXPath(pDump, "//page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont", "color"));
+ CPPUNIT_ASSERT_EQUAL(OUString("1."), getXPath(pDump, "//page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"), getXPath(pDump, "//page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont"_ostr, "color"_ostr));
// "2." is red
- CPPUNIT_ASSERT_EQUAL(OUString("2."), getXPath(pDump, "//page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
- CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"), getXPath(pDump, "//page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont", "color"));
+ CPPUNIT_ASSERT_EQUAL(OUString("2."), getXPath(pDump, "//page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"), getXPath(pDump, "//page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont"_ostr, "color"_ostr));
// "3." is black
- CPPUNIT_ASSERT_EQUAL(OUString("3."), getXPath(pDump, "//page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
- CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), getXPath(pDump, "//page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont", "color"));
+ CPPUNIT_ASSERT_EQUAL(OUString("3."), getXPath(pDump, "//page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), getXPath(pDump, "//page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont"_ostr, "color"_ostr));
// "4." is black
- CPPUNIT_ASSERT_EQUAL(OUString("4."), getXPath(pDump, "//page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
- CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), getXPath(pDump, "//page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont", "color"));
+ CPPUNIT_ASSERT_EQUAL(OUString("4."), getXPath(pDump, "//page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), getXPath(pDump, "//page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont"_ostr, "color"_ostr));
// "5." is red
- CPPUNIT_ASSERT_EQUAL(OUString("5."), getXPath(pDump, "//page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
- CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"), getXPath(pDump, "//page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont", "color"));
+ CPPUNIT_ASSERT_EQUAL(OUString("5."), getXPath(pDump, "//page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"), getXPath(pDump, "//page[1]/body/txt[5]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont"_ostr, "color"_ostr));
// "6." is red
- CPPUNIT_ASSERT_EQUAL(OUString("6."), getXPath(pDump, "//page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
- CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"), getXPath(pDump, "//page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont", "color"));
+ CPPUNIT_ASSERT_EQUAL(OUString("6."), getXPath(pDump, "//page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("00ff0000"), getXPath(pDump, "//page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont"_ostr, "color"_ostr));
// "7." is black
- CPPUNIT_ASSERT_EQUAL(OUString("7."), getXPath(pDump, "//page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwFieldPortion", "expand"));
- CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), getXPath(pDump, "//page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont", "color"));
+ CPPUNIT_ASSERT_EQUAL(OUString("7."), getXPath(pDump, "//page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), getXPath(pDump, "//page[1]/body/txt[7]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont"_ostr, "color"_ostr));
// "8." is black
- CPPUNIT_ASSERT_EQUAL(OUString("8."), getXPath(pDump, "//page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwFieldPortion[1]", "expand"));
- CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), getXPath(pDump, "//page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwFieldPortion[1]/SwFont", "color"));
+ CPPUNIT_ASSERT_EQUAL(OUString("8."), getXPath(pDump, "//page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr, "expand"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), getXPath(pDump, "//page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwFieldPortion[1]/SwFont"_ostr, "color"_ostr));
if (!isExported())
return;
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:rStyle",
- "val", "Emphasis");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:rStyle",
- "val", "Emphasis");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[3]/w:pPr/w:rPr/w:rStyle", 0);
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[4]/w:pPr/w:rPr/w:rStyle", 0);
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[5]/w:pPr/w:rPr/w:rStyle",
- "val", "Emphasis");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[5]/w:pPr/w:rPr/w:sz",
- "val", "32");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:rPr/w:rStyle",
- "val", "Emphasis");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:rPr/w:sz",
- "val", "32");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[7]/w:pPr/w:rPr/w:rStyle", 0);
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[8]/w:pPr/w:rPr/w:rStyle", 0);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:rStyle"_ostr,
+ "val"_ostr, "Emphasis");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:rStyle"_ostr,
+ "val"_ostr, "Emphasis");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[3]/w:pPr/w:rPr/w:rStyle"_ostr, 0);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[4]/w:pPr/w:rPr/w:rStyle"_ostr, 0);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[5]/w:pPr/w:rPr/w:rStyle"_ostr,
+ "val"_ostr, "Emphasis");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[5]/w:pPr/w:rPr/w:sz"_ostr,
+ "val"_ostr, "32");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:rPr/w:rStyle"_ostr,
+ "val"_ostr, "Emphasis");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:rPr/w:sz"_ostr,
+ "val"_ostr, "32");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[7]/w:pPr/w:rPr/w:rStyle"_ostr, 0);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[8]/w:pPr/w:rPr/w:rStyle"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf133334_followPgStyle)
@@ -132,16 +132,16 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf118701)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr[1]/w:numPr", 0);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr[1]/w:numPr", 0);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr[1]/w:numPr", 0);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr[1]/w:numPr", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr[1]/w:numPr"_ostr, 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr[1]/w:numPr"_ostr, 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr[1]/w:numPr"_ostr, 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr[1]/w:numPr"_ostr, 1);
// Keep numbering of the paragraph of the inline image
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:pPr[1]/w:numPr", 0);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr[1]/w:numPr", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:pPr[1]/w:numPr"_ostr, 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr[1]/w:numPr"_ostr, 1);
// This was 0
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:pPr[1]/w:numPr", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:pPr[1]/w:numPr"_ostr, 1);
}
DECLARE_OOXMLEXPORT_TEST(testTdf123388, "tdf123388.docx")
@@ -190,8 +190,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf123401)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// MEAN converted to AVERAGE
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r[2]/w:instrText", " =AVERAGE(A1:A2)");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r[2]/w:instrText", " =AVERAGE(A1:A3)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r[2]/w:instrText"_ostr, " =AVERAGE(A1:A2)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r[2]/w:instrText"_ostr, " =AVERAGE(A1:A3)");
}
DECLARE_OOXMLEXPORT_TEST(testTdf116394, "tdf116394.docx")
@@ -210,7 +210,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf116394, "tdf116394.docx")
if (!isExported())
return;
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:instrText", " MERGEFIELD ab=cd ");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:instrText"_ostr, " MERGEFIELD ab=cd ");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf123356)
@@ -364,12 +364,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123355, "tdf123355.docx")
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// keep original formula IDs
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[2]/w:p/w:r[2]/w:instrText", " =average( below )");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[2]/w:p/w:r[2]/w:instrText", " =AVERAGE(LEFT)");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[3]/w:p/w:r[2]/w:instrText", " =AVERAGE(RIGHT)");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[3]/w:p/w:r[2]/w:instrText", " =AVERAGE(ABOVE)");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc[4]/w:p/w:r[2]/w:instrText", " =AVERAGE(ABOVE)");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc[4]/w:p/w:r[2]/w:instrText", " =SUM(LEFT)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[2]/w:p/w:r[2]/w:instrText"_ostr, " =average( below )");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[2]/w:p/w:r[2]/w:instrText"_ostr, " =AVERAGE(LEFT)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[3]/w:p/w:r[2]/w:instrText"_ostr, " =AVERAGE(RIGHT)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[3]/w:p/w:r[2]/w:instrText"_ostr, " =AVERAGE(ABOVE)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc[4]/w:p/w:r[2]/w:instrText"_ostr, " =AVERAGE(ABOVE)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc[4]/w:p/w:r[2]/w:instrText"_ostr, " =SUM(LEFT)");
}
DECLARE_OOXMLEXPORT_TEST(testTdf123382, "tdf123382.docx")
@@ -415,13 +415,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123382, "tdf123382.docx")
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// keep original formula IDs
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:r[2]/w:instrText", " =MAX(RIGHT)");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:p/w:r[2]/w:instrText", " =MAX(RIGHT)");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[1]/w:p/w:r[2]/w:instrText", " =SUM(RIGHT)");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[2]/w:p/w:r[2]/w:instrText", " =MAX(BELOW)");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[2]/w:p/w:r[2]/w:instrText", " =MAX(RIGHT)");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[4]/w:p/w:r[2]/w:instrText", " =MAX(BELOW)");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[4]/w:p/w:r[2]/w:instrText", " =MAX(LEFT)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:r[2]/w:instrText"_ostr, " =MAX(RIGHT)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:p/w:r[2]/w:instrText"_ostr, " =MAX(RIGHT)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[1]/w:p/w:r[2]/w:instrText"_ostr, " =SUM(RIGHT)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[2]/w:p/w:r[2]/w:instrText"_ostr, " =MAX(BELOW)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[2]/w:p/w:r[2]/w:instrText"_ostr, " =MAX(RIGHT)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[4]/w:p/w:r[2]/w:instrText"_ostr, " =MAX(BELOW)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[4]/w:p/w:r[2]/w:instrText"_ostr, " =MAX(LEFT)");
}
DECLARE_OOXMLEXPORT_TEST(testTdf122648, "tdf122648.docx")
@@ -452,11 +452,11 @@ DECLARE_OOXMLEXPORT_TEST(testTdf122648, "tdf122648.docx")
return;
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[2]/w:p/w:r[2]/w:instrText", " =A1");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[2]/w:tc[2]/w:p/w:r[2]/w:instrText", " =SUM(A1:B1)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[2]/w:p/w:r[2]/w:instrText"_ostr, " =A1");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[2]/w:tc[2]/w:p/w:r[2]/w:instrText"_ostr, " =SUM(A1:B1)");
// These were =<?> and =SUM(<?:?>)
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl[2]/w:tr[1]/w:tc[2]/w:p/w:r[2]/w:instrText", " =A1");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl[2]/w:tr[2]/w:tc[2]/w:p/w:r[2]/w:instrText", " =SUM(A1:B1)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl[2]/w:tr[1]/w:tc[2]/w:p/w:r[2]/w:instrText"_ostr, " =A1");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl[2]/w:tr[2]/w:tc[2]/w:p/w:r[2]/w:instrText"_ostr, " =SUM(A1:B1)");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf98000_changePageStyle)
@@ -491,18 +491,18 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf145998_unnecessaryPageStyles)
CPPUNIT_ASSERT_EQUAL(uno::Any(), xPara->getPropertyValue("PageDescName"));
// CPPUNIT_ASSERT_EQUAL(OUString("Default page style - first page style"),
// parseDump("/root/page[3]/header/txt"));
- CPPUNIT_ASSERT_EQUAL(OUString(), parseDump("/root/page[3]/footer/txt"));
+ CPPUNIT_ASSERT_EQUAL(OUString(), parseDump("/root/page[3]/footer/txt"_ostr));
// Page Style is converted into a page break instead. Shows the "normal" header.
xPara.set(getParagraph(5, "4"), uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT_EQUAL(uno::Any(), xPara->getPropertyValue("PageDescName"));
CPPUNIT_ASSERT_EQUAL(OUString("Default page style"),
- parseDump("/root/page[4]/header/txt"));
+ parseDump("/root/page[4]/header/txt"_ostr));
// Page Style is retained (with wrong header) in order to preserve page re-numbering.
xPara.set(getParagraph(7, "1"), uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT(uno::Any() != xPara->getPropertyValue("PageDescName"));
- CPPUNIT_ASSERT_EQUAL(OUString(), parseDump("/root/page[5]/footer/txt"));
+ CPPUNIT_ASSERT_EQUAL(OUString(), parseDump("/root/page[5]/footer/txt"_ostr));
}
CPPUNIT_TEST_FIXTURE(Test, testTdf145998_firstHeader)
@@ -512,10 +512,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf145998_firstHeader)
// Sanity check - always good to test when dealing with page styles and breaks.
CPPUNIT_ASSERT_EQUAL(2, getPages());
- CPPUNIT_ASSERT_EQUAL(OUString("Very first header"), parseDump("/root/page[1]/header/txt"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Very first header"), parseDump("/root/page[1]/header/txt"_ostr));
// Page Style is already used in prior section - this can't be the first-header
- CPPUNIT_ASSERT_EQUAL(OUString("Normal Header"), parseDump("/root/page[2]/header/txt"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Normal Header"), parseDump("/root/page[2]/header/txt"_ostr));
}
CPPUNIT_TEST_FIXTURE(Test, testTdf135216_evenOddFooter)
@@ -555,7 +555,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf136929_framesOfParagraph)
loadAndReload("tdf136929_framesOfParagraph.odt");
// Before this fix, the image was placed in the footer instead of in the text body - messing everything up.
CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Pages", 5, getPages() );
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Header2 text", OUString("* | *"), parseDump("/root/page[4]/footer/txt"));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Header2 text", OUString("* | *"), parseDump("/root/page[4]/footer/txt"_ostr));
}
DECLARE_OOXMLEXPORT_TEST(testTdf136589_paraHadField, "tdf136589_paraHadField.docx")
@@ -667,24 +667,24 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132149_pgBreak)
xmlDocUniquePtr pDump = parseLayoutDump();
// No header on pages 1,2,3.
- assertXPath(pDump, "//page[2]/header", 0);
+ assertXPath(pDump, "//page[2]/header"_ostr, 0);
// Margins/page orientation between Right and Left page styles are different
- assertXPath(pDump, "//page[1]/infos/prtBounds", "left", "1134"); //Right page style
- assertXPath(pDump, "//page[2]/infos/prtBounds", "left", "2268"); //Left page style
+ assertXPath(pDump, "//page[1]/infos/prtBounds"_ostr, "left"_ostr, "1134"); //Right page style
+ assertXPath(pDump, "//page[2]/infos/prtBounds"_ostr, "left"_ostr, "2268"); //Left page style
- assertXPath(pDump, "//page[1]/infos/bounds", "width", "8391"); //landscape
- assertXPath(pDump, "//page[2]/infos/bounds", "width", "5940"); //portrait
+ assertXPath(pDump, "//page[1]/infos/bounds"_ostr, "width"_ostr, "8391"); //landscape
+ assertXPath(pDump, "//page[2]/infos/bounds"_ostr, "width"_ostr, "5940"); //portrait
// This two-line 3rd page ought not to exist. DID YOU FIX ME? The real page 3 should be "8391" landscape.
- assertXPath(pDump, "//page[3]/infos/bounds", "width", "5940");
+ assertXPath(pDump, "//page[3]/infos/bounds"_ostr, "width"_ostr, "5940");
// This really ought to be on odd page 3, but now it is on odd page 5.
- assertXPath(pDump, "//page[5]/infos/bounds", "width", "8391");
- assertXPath(pDump, "//page[5]/infos/prtBounds", "right", "6122"); //Left page style
+ assertXPath(pDump, "//page[5]/infos/bounds"_ostr, "width"_ostr, "8391");
+ assertXPath(pDump, "//page[5]/infos/prtBounds"_ostr, "right"_ostr, "6122"); //Left page style
//Page style change here must not be lost. This SHOULD be on page 4, but sadly it is not.
- assertXPathContent(pDump, "//page[6]/header/txt", "First Page Style");
- CPPUNIT_ASSERT(getXPathContent(pDump, "//page[6]/body/txt[1]").startsWith("Lorem ipsum"));
+ assertXPathContent(pDump, "//page[6]/header/txt"_ostr, "First Page Style");
+ CPPUNIT_ASSERT(getXPathContent(pDump, "//page[6]/body/txt[1]"_ostr).startsWith("Lorem ipsum"));
}
CPPUNIT_TEST_FIXTURE(Test, testTdf132149_pgBreakB)
@@ -695,9 +695,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132149_pgBreakB)
xmlDocUniquePtr pDump = parseLayoutDump();
//Sanity check to ensure the correct page is being tested. This SHOULD be on page 3, but sadly it is not.
- CPPUNIT_ASSERT(getXPathContent(pDump, "//page[5]/body/txt[1]").startsWith("Lorem ipsum"));
+ CPPUNIT_ASSERT(getXPathContent(pDump, "//page[5]/body/txt[1]"_ostr).startsWith("Lorem ipsum"));
//Prior to this fix, the original alternation between portrait and landscape was completely lost.
- assertXPath(pDump, "//page[5]/infos/bounds", "width", "8391"); //landscape
+ assertXPath(pDump, "//page[5]/infos/bounds"_ostr, "width"_ostr, "8391"); //landscape
}
CPPUNIT_TEST_FIXTURE(Test, testTdf132149_pgBreak2)
@@ -724,15 +724,15 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf136952_pgBreak3B)
//page::breakAfter must not be lost.
//Prior to this bug fix, the Lorem ipsum paragraph was in the middle of a portrait page, with no switch to landscape occurring.
- CPPUNIT_ASSERT(getXPathContent(pDump, "//page[3]/body/txt[1]").startsWith("Lorem ipsum"));
- assertXPath(pDump, "//page[3]/infos/bounds", "width", "8391"); //landscape
+ CPPUNIT_ASSERT(getXPathContent(pDump, "//page[3]/body/txt[1]"_ostr).startsWith("Lorem ipsum"));
+ assertXPath(pDump, "//page[3]/infos/bounds"_ostr, "width"_ostr, "8391"); //landscape
}
DECLARE_OOXMLEXPORT_TEST(testTdf135949_anchoredBeforeBreak, "tdf135949_anchoredBeforeBreak.docx")
{
xmlDocUniquePtr pDump = parseLayoutDump();
//The picture was shown on page 2, because the empty paragraph before the page break was removed
- assertXPath(pDump, "//page[1]/body/txt/anchored/fly", 1);
+ assertXPath(pDump, "//page[1]/body/txt/anchored/fly"_ostr, 1);
}
DECLARE_OOXMLEXPORT_TEST(testTdf129452_excessBorder, "tdf129452_excessBorder.docx")
@@ -796,7 +796,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf135655)
{
loadAndSave("tdf135655.odt");
const xmlDocUniquePtr pExpDoc = parseExport("word/document.xml");
- const OUString sXFillColVal = getXPath(pExpDoc, "/w:document/w:body/w:p/w:r/w:object/v:shape", "fillcolor");
+ const OUString sXFillColVal = getXPath(pExpDoc, "/w:document/w:body/w:p/w:r/w:object/v:shape"_ostr, "fillcolor"_ostr);
CPPUNIT_ASSERT_EQUAL(OUString("#00A933"), sXFillColVal);
}
@@ -804,12 +804,12 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf138374)
{
loadAndSave("tdf138374.odt");
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/w:pict/v:shape", "fillcolor", "#ffd320");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/w:pict/v:shape", "coordsize", "1315,6116");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/w:pict/v:shape"_ostr, "fillcolor"_ostr, "#ffd320");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/w:pict/v:shape"_ostr, "coordsize"_ostr, "1315,6116");
if (IsDefaultDPI())
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/w:pict/v:shape", "path",
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/w:pict/v:shape"_ostr, "path"_ostr,
"m0,0l1314,0l1314,5914l416,5914l416,6115l106,5715l416,5415l416,5715l1014,5715l1014,224l0,224l0,16l0,0e");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/w:pict/v:shape", "style",
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/w:pict/v:shape"_ostr, "style"_ostr,
"position:absolute;margin-left:394.3pt;margin-top:204pt;width:37.2pt;height:173.3pt;mso-wrap-style:none;v-text-anchor:middle");
}
@@ -852,7 +852,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf137683_charHighlightTests, "tdf137683_charHighli
if (isExported())
{
xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Normal']/w:rPr/w:highlight", 0);
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Normal']/w:rPr/w:highlight"_ostr, 0);
}
uno::Reference<beans::XPropertySet> xRun(getRun(getParagraph(10), 2, "no highlight"), uno::UNO_QUERY_THROW);
@@ -887,7 +887,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf138345_numberingHighlight)
// Before the fix, the highlight was completely lost.
xmlDocUniquePtr pXmlStyles = parseExport("word/numbering.xml");
if (pXmlStyles)
- assertXPath(pXmlStyles, "/w:numbering/w:abstractNum[@w:abstractNumId='1']/w:lvl[@w:ilvl='0']/w:rPr/w:highlight", "val", "red");
+ assertXPath(pXmlStyles, "/w:numbering/w:abstractNum[@w:abstractNumId='1']/w:lvl[@w:ilvl='0']/w:rPr/w:highlight"_ostr, "val"_ostr, "red");
}
DECLARE_OOXMLEXPORT_TEST(testTdf134063, "tdf134063.docx")
@@ -897,9 +897,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf134063, "tdf134063.docx")
xmlDocUniquePtr pDump = parseLayoutDump();
// There are three tabs with default width
- CPPUNIT_ASSERT_EQUAL(sal_Int32(720), getXPath(pDump, "//page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFixPortion[1]", "width").toInt32());
- CPPUNIT_ASSERT_EQUAL(sal_Int32(720), getXPath(pDump, "//page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFixPortion[2]", "width").toInt32());
- CPPUNIT_ASSERT_EQUAL(sal_Int32(720), getXPath(pDump, "//page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFixPortion[3]", "width").toInt32());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(720), getXPath(pDump, "//page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFixPortion[1]"_ostr, "width"_ostr).toInt32());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(720), getXPath(pDump, "//page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFixPortion[2]"_ostr, "width"_ostr).toInt32());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(720), getXPath(pDump, "//page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwFixPortion[3]"_ostr, "width"_ostr).toInt32());
}
DECLARE_OOXMLEXPORT_TEST(TestTdf135653, "tdf135653.docx")
@@ -941,30 +941,30 @@ CPPUNIT_TEST_FIXTURE(Test, testAtPageShapeRelOrientation)
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
assertXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor"
- "/wp:positionH/wp:posOffset", "-480060");
+ "/wp:positionH/wp:posOffset"_ostr, "-480060");
assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor"
- "/wp:positionH", "relativeFrom", "page");
+ "/wp:positionH"_ostr, "relativeFrom"_ostr, "page");
assertXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor"
- "/wp:positionV/wp:posOffset", "8147685");
+ "/wp:positionV/wp:posOffset"_ostr, "8147685");
assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor"
- "/wp:positionV", "relativeFrom", "page");
+ "/wp:positionV"_ostr, "relativeFrom"_ostr, "page");
// same for sw
assertXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor"
- "/wp:positionH/wp:posOffset", "720090");
+ "/wp:positionH/wp:posOffset"_ostr, "720090");
assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor"
- "/wp:positionH", "relativeFrom", "page");
+ "/wp:positionH"_ostr, "relativeFrom"_ostr, "page");
assertXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor"
- "/wp:positionV/wp:posOffset", "1080135");
+ "/wp:positionV/wp:posOffset"_ostr, "1080135");
assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor"
- "/wp:positionV", "relativeFrom", "page");
+ "/wp:positionV"_ostr, "relativeFrom"_ostr, "page");
// now test text rotation -> VML writing direction
- assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Fallback/w:pict/v:shape/v:textbox", "style", "mso-layout-flow-alt:bottom-to-top");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Fallback/w:pict/v:shape/v:textbox"_ostr, "style"_ostr, "mso-layout-flow-alt:bottom-to-top");
// text wrap -> VML
- assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Fallback/w:pict/v:shape/w10:wrap", "type", "none");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Fallback/w:pict/v:shape/w10:wrap"_ostr, "type"_ostr, "none");
// vertical alignment -> VML
- OUString const style = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Fallback/w:pict/v:shape", "style");
+ OUString const style = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Fallback/w:pict/v:shape"_ostr, "style"_ostr);
CPPUNIT_ASSERT(style.indexOf("v-text-anchor:middle") != -1);
}
@@ -974,10 +974,10 @@ CPPUNIT_TEST_FIXTURE(Test, testVMLallowincell)
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
// VML o:allowincell, apparently the default is "t"
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[1]/w:r/mc:AlternateContent[1]/mc:Fallback/w:pict/v:shape", "allowincell", "f");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[1]/w:r/mc:AlternateContent[1]/mc:Fallback/w:pict/v:shape"_ostr, "allowincell"_ostr, "f");
// DML layoutInCell
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[1]/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor", "layoutInCell", "0");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[1]/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor"_ostr, "layoutInCell"_ostr, "0");
}
CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorHeightFromBottomMarginHasFooter)
@@ -988,7 +988,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorHeightFromBottomMarginHasFooter)
// Note: page print area bottom = margin + footer height.
// In this case the footer exists.
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "height", "1147");
+ assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds"_ostr, "height"_ostr, "1147");
}
DECLARE_OOXMLEXPORT_TEST(TestTdf132483, "tdf132483.docx")
@@ -1012,7 +1012,7 @@ CPPUNIT_TEST_FIXTURE(Test, TestTdf143028)
auto pExportXml = parseExport("word/document.xml");
assertXPath(pExportXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/"
- "a:graphic/a:graphicData/wps:wsp/wps:spPr/a:xfrm");
+ "a:graphic/a:graphicData/wps:wsp/wps:spPr/a:xfrm"_ostr);
}
@@ -1024,14 +1024,14 @@ CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorHeightFromBottomMarginNoFooter)
// Note: page print area bottom = margin + footer height.
// In this case the footer does not exist, so OpenDocument and OOXML margins are the same.
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "height", "1147");
+ assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds"_ostr, "height"_ostr, "1147");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf133702)
{
loadAndSave("tdf133702.docx");
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf135667)
@@ -1040,16 +1040,16 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf135667)
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
// This was missing.
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/w:object/v:shapetype");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/w:object/v:shapetype"_ostr);
// line settings
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/w:object/v:shape", "stroked", "t");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/w:object/v:shape", "strokecolor", "#FF0000");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/w:object/v:shape", "strokeweight", "4pt");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/w:object/v:shape"_ostr, "stroked"_ostr, "t");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/w:object/v:shape"_ostr, "strokecolor"_ostr, "#FF0000");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/w:object/v:shape"_ostr, "strokeweight"_ostr, "4pt");
// line type
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/w:object/v:shape/v:stroke", "linestyle", "Single");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/w:object/v:shape/v:stroke", "dashstyle", "Dash");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/w:object/v:shape/v:stroke"_ostr, "linestyle"_ostr, "Single");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/w:object/v:shape/v:stroke"_ostr, "dashstyle"_ostr, "Dash");
}
CPPUNIT_TEST_FIXTURE(Test, testImageSpaceSettings)
@@ -1057,10 +1057,10 @@ CPPUNIT_TEST_FIXTURE(Test, testImageSpaceSettings)
loadAndSave("tdf135047_ImageSpaceSettings.fodt");
// tdf#135047 The spaces of image were not saved.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:anchor", "distT", "90170");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:anchor", "distB", "90170");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:anchor", "distL", "90170");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:anchor", "distR", "90170");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:anchor"_ostr, "distT"_ostr, "90170");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:anchor"_ostr, "distB"_ostr, "90170");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:anchor"_ostr, "distL"_ostr, "90170");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:anchor"_ostr, "distR"_ostr, "90170");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf137295)
@@ -1099,10 +1099,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf136814)
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
// Padding in this document is 0.10 cm which should translate to 3 pt (approx. 1.0583mm)
- assertXPath(pXmlDocument, "/w:document/w:body/w:sectPr/w:pgBorders/w:top", "space", "3");
- assertXPath(pXmlDocument, "/w:document/w:body/w:sectPr/w:pgBorders/w:left", "space", "3");
- assertXPath(pXmlDocument, "/w:document/w:body/w:sectPr/w:pgBorders/w:bottom", "space", "3");
- assertXPath(pXmlDocument, "/w:document/w:body/w:sectPr/w:pgBorders/w:right", "space", "3");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:sectPr/w:pgBorders/w:top"_ostr, "space"_ostr, "3");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:sectPr/w:pgBorders/w:left"_ostr, "space"_ostr, "3");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:sectPr/w:pgBorders/w:bottom"_ostr, "space"_ostr, "3");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:sectPr/w:pgBorders/w:right"_ostr, "space"_ostr, "3");
}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
index 730afb8e5d12..6885f0b4b91a 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
@@ -64,8 +64,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143860NonPrimitiveCustomShape)
// is not exported with preset but with custom geometry.
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
CPPUNIT_ASSERT(pXmlDocument);
- assertXPath(pXmlDocument, "//a:prstGeom", 0);
- assertXPath(pXmlDocument, "//a:custGeom", 1);
+ assertXPath(pXmlDocument, "//a:prstGeom"_ostr, 0);
+ assertXPath(pXmlDocument, "//a:custGeom"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testWrapPolygonCurve)
@@ -77,10 +77,10 @@ CPPUNIT_TEST_FIXTURE(Test, testWrapPolygonCurve)
// written and no wrap polygon. Make sure we write wrapTight and a wrapPolygon.
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
CPPUNIT_ASSERT(pXmlDocument);
- assertXPath(pXmlDocument, "//wp:wrapTight", 1);
- assertXPath(pXmlDocument, "//wp:wrapPolygon", 1);
- assertXPath(pXmlDocument, "//wp:start", 1);
- xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDocument, "//wp:lineTo");
+ assertXPath(pXmlDocument, "//wp:wrapTight"_ostr, 1);
+ assertXPath(pXmlDocument, "//wp:wrapPolygon"_ostr, 1);
+ assertXPath(pXmlDocument, "//wp:start"_ostr, 1);
+ xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDocument, "//wp:lineTo"_ostr);
CPPUNIT_ASSERT_GREATER(sal_Int32(2),
static_cast<sal_Int32>(xmlXPathNodeSetGetLength(pXmlObj->nodesetval)));
xmlXPathFreeObject(pXmlObj);
@@ -95,11 +95,11 @@ CPPUNIT_TEST_FIXTURE(Test, testWrapPolygonLineShape)
// no wrap polygon. Now we write 'through' and use wrap polygon 0|0, 21600|21600, 0|0.
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
CPPUNIT_ASSERT(pXmlDocument);
- assertXPath(pXmlDocument, "//wp:wrapThrough", 1);
- assertXPath(pXmlDocument, "//wp:lineTo", 2);
- sal_Int32 nYCoord = getXPath(pXmlDocument, "(//wp:lineTo)[1]", "y").toInt32();
+ assertXPath(pXmlDocument, "//wp:wrapThrough"_ostr, 1);
+ assertXPath(pXmlDocument, "//wp:lineTo"_ostr, 2);
+ sal_Int32 nYCoord = getXPath(pXmlDocument, "(//wp:lineTo)[1]"_ostr, "y"_ostr).toInt32();
CPPUNIT_ASSERT_EQUAL(sal_Int32(21600), nYCoord);
- sal_Int32 nXCoord = getXPath(pXmlDocument, "(//wp:lineTo)[2]", "x").toInt32();
+ sal_Int32 nXCoord = getXPath(pXmlDocument, "(//wp:lineTo)[2]"_ostr, "x"_ostr).toInt32();
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nXCoord);
}
@@ -116,11 +116,11 @@ CPPUNIT_TEST_FIXTURE(Test, testWrapPolygonCustomShape)
// Expected coordinates are 0|10800, 8936|8936, 10800|0, 12664|8936, 21600|10800, 12664|12664,
// 10800|21600, 8936|12664, 0|10800. Assert forth point, which comes from equations. Allow some
// tolerance.
- sal_Int32 nXCoord = getXPath(pXmlDocument, "(//wp:lineTo)[3]", "x").toInt32();
+ sal_Int32 nXCoord = getXPath(pXmlDocument, "(//wp:lineTo)[3]"_ostr, "x"_ostr).toInt32();
// Without fix it would fail with expected 12664, actual 3
CPPUNIT_ASSERT_DOUBLES_EQUAL(12664, nXCoord, 10);
// Without fix it would fail with expected 8936, actual 4
- sal_Int32 nYCoord = getXPath(pXmlDocument, "(//wp:lineTo)[3]", "y").toInt32();
+ sal_Int32 nYCoord = getXPath(pXmlDocument, "(//wp:lineTo)[3]"_ostr, "y"_ostr).toInt32();
CPPUNIT_ASSERT_DOUBLES_EQUAL(8936, nYCoord, 10);
}
@@ -132,8 +132,8 @@ CPPUNIT_TEST_FIXTURE(Test, testFrameWrapTextMode)
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
CPPUNIT_ASSERT(pXmlDocument);
// Without the fix the value "largest" was written to file in both cases.
- assertXPath(pXmlDocument, "(//wp:wrapSquare)[1]", "wrapText", "right");
- assertXPath(pXmlDocument, "(//wp:wrapSquare)[2]", "wrapText", "left");
+ assertXPath(pXmlDocument, "(//wp:wrapSquare)[1]"_ostr, "wrapText"_ostr, "right");
+ assertXPath(pXmlDocument, "(//wp:wrapSquare)[2]"_ostr, "wrapText"_ostr, "left");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf134219ContourWrap_glow_rotate)
@@ -216,8 +216,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf151384Hyperlink, "151384Hyperlink.odt")
loadAndSave("151384Hyperlink.odt");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:hyperlink/w:r/w:rPr/w:rStyle", "val", "Hyperlink");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Hyperlink']/w:name", "val", "Hyperlink");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:hyperlink/w:r/w:rPr/w:rStyle"_ostr, "val"_ostr, "Hyperlink");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Hyperlink']/w:name"_ostr, "val"_ostr, "Hyperlink");
}
DECLARE_OOXMLEXPORT_TEST(testTdf66039, "tdf66039.docx")
@@ -443,7 +443,7 @@ CPPUNIT_TEST_FIXTURE(Test, testGutterTop)
// - Expected: 1
// - Actual : 0
// i.e. <w:gutterAtTop> was lost.
- assertXPath(pXmlSettings, "/w:settings/w:gutterAtTop", 1);
+ assertXPath(pXmlSettings, "/w:settings/w:gutterAtTop"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testCustomShapePresetExport)
@@ -489,10 +489,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf69635)
// Without the accompanying fix in place, this test would have failed with:
// - Expected: "left"
// - Actual : "right"
- assertXPathContent(pXmlHeader1, "/w:hdr/w:p/w:r/w:t", "left");
+ assertXPathContent(pXmlHeader1, "/w:hdr/w:p/w:r/w:t"_ostr, "left");
// Make sure "left" appears as a hidden header
- assertXPath(pXmlSettings, "/w:settings/w:evenAndOddHeaders", 0);
+ assertXPath(pXmlSettings, "/w:settings/w:evenAndOddHeaders"_ostr, 0);
}
DECLARE_OOXMLEXPORT_TEST(testTdf148671, "tdf148671.docx")
@@ -504,7 +504,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf148671, "tdf148671.docx")
return;
// Preserve tag on SDT blocks. (Before the fix, these were all lost)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:tag", 3);
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:tag"_ostr, 3);
}
DECLARE_OOXMLEXPORT_TEST(testTdf140668, "tdf140668.docx")
@@ -564,7 +564,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf135773_numberingShading)
// Before the fix, the imported shading was converted into a red highlight.
xmlDocUniquePtr pXmlStyles = parseExport("word/numbering.xml");
- assertXPath(pXmlStyles, "/w:numbering/w:abstractNum[@w:abstractNumId='1']/w:lvl[@w:ilvl='0']/w:rPr/w:shd", "fill", "ED4C05");
+ assertXPath(pXmlStyles, "/w:numbering/w:abstractNum[@w:abstractNumId='1']/w:lvl[@w:ilvl='0']/w:rPr/w:shd"_ostr, "fill"_ostr, "ED4C05");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf140336_paraNoneShading)
@@ -610,37 +610,37 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf142404_tabOverSpacingC15)
// The original 3-page ODT saved as DOCX would fit on one page in MS Word 2010, but 3 in Word 2013.
CPPUNIT_ASSERT_EQUAL_MESSAGE("too big for two pages", 3, getPages());
// The tab goes over the paragraph margin
- CPPUNIT_ASSERT_EQUAL(OUString("A left tab positioned at"), parseDump("//page[1]/body/txt[2]/SwParaPortion/SwLineLayout[1]/SwLinePortion[1]", "portion"));
- sal_Int32 nTextLen = parseDump("//page[1]/body/txt[2]/SwParaPortion/SwLineLayout[1]/SwLinePortion[1]", "width").toInt32();
- CPPUNIT_ASSERT_EQUAL(OUString("*"), parseDump("//page[1]/body/txt[2]/SwParaPortion/SwLineLayout[1]/SwFixPortion[1]", "portion"));
- sal_Int32 nTabLen = parseDump("//page[1]/body/txt[2]/SwParaPortion/SwLineLayout[1]/SwFixPortion[1]", "width").toInt32();
+ CPPUNIT_ASSERT_EQUAL(OUString("A left tab positioned at"), parseDump("//page[1]/body/txt[2]/SwParaPortion/SwLineLayout[1]/SwLinePortion[1]"_ostr, "portion"_ostr));
+ sal_Int32 nTextLen = parseDump("//page[1]/body/txt[2]/SwParaPortion/SwLineLayout[1]/SwLinePortion[1]"_ostr, "width"_ostr).toInt32();
+ CPPUNIT_ASSERT_EQUAL(OUString("*"), parseDump("//page[1]/body/txt[2]/SwParaPortion/SwLineLayout[1]/SwFixPortion[1]"_ostr, "portion"_ostr));
+ sal_Int32 nTabLen = parseDump("//page[1]/body/txt[2]/SwParaPortion/SwLineLayout[1]/SwFixPortion[1]"_ostr, "width"_ostr).toInt32();
CPPUNIT_ASSERT_MESSAGE("Large left tab", nTextLen < nTabLen);
// Not 1 line high (Word 2010 DOCX), or 3 lines high (LO DOCX) or 5 lines high (ODT), but 4 lines high
- sal_Int32 nHeight = parseDump("//page[1]/body/txt[2]/infos/bounds", "height").toInt32();
+ sal_Int32 nHeight = parseDump("//page[1]/body/txt[2]/infos/bounds"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_MESSAGE("4 lines high", 1100 < nHeight);
CPPUNIT_ASSERT_MESSAGE("4 lines high", nHeight < 1300);
- CPPUNIT_ASSERT_EQUAL(OUString("TabOverflow does what?"), parseDump("//page[1]/body/txt[7]/SwParaPortion/SwLineLayout[1]/SwLinePortion[1]", "portion"));
+ CPPUNIT_ASSERT_EQUAL(OUString("TabOverflow does what?"), parseDump("//page[1]/body/txt[7]/SwParaPortion/SwLineLayout[1]/SwLinePortion[1]"_ostr, "portion"_ostr));
// Not 1 line high (Word 2010 DOCX), or 4 lines high (prev LO DOCX) or 8 lines high (ODT).
// but two lines high. (3 in Word 2016 because it pulls down "what?" to the second line - weird)
- nHeight = parseDump("//page[1]/body/txt[7]/infos/bounds", "height").toInt32();
+ nHeight = parseDump("//page[1]/body/txt[7]/infos/bounds"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("2 lines high (but 3 in Word)", 242*2.5, nHeight, 242);
- CPPUNIT_ASSERT_EQUAL(OUString("A centered tab positioned at"), parseDump("//page[1]/body/txt[3]/SwParaPortion/SwLineLayout[1]/SwLinePortion[1]", "portion"));
- sal_Int32 nLineWidth = parseDump("//page[1]/body/txt[3]/SwParaPortion/SwLineLayout[1]/SwFixPortion[1]", "width").toInt32();
+ CPPUNIT_ASSERT_EQUAL(OUString("A centered tab positioned at"), parseDump("//page[1]/body/txt[3]/SwParaPortion/SwLineLayout[1]/SwLinePortion[1]"_ostr, "portion"_ostr));
+ sal_Int32 nLineWidth = parseDump("//page[1]/body/txt[3]/SwParaPortion/SwLineLayout[1]/SwFixPortion[1]"_ostr, "width"_ostr).toInt32();
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Big tab: full paragraph area used", 737, nLineWidth, 100);
// Pages 2/3 are TabOverMargin - in this particular case tabs should not go over margin.
- CPPUNIT_ASSERT_EQUAL(OUString("A right tab positioned at"), parseDump("//page[2]/body/txt[6]/SwParaPortion/SwLineLayout[1]/SwLinePortion[1]", "portion"));
- sal_Int32 nParaWidth = parseDump("//page[2]/body/txt[6]/infos/prtBounds", "width").toInt32();
+ CPPUNIT_ASSERT_EQUAL(OUString("A right tab positioned at"), parseDump("//page[2]/body/txt[6]/SwParaPortion/SwLineLayout[1]/SwLinePortion[1]"_ostr, "portion"_ostr));
+ sal_Int32 nParaWidth = parseDump("//page[2]/body/txt[6]/infos/prtBounds"_ostr, "width"_ostr).toInt32();
// the clearest non-first-line visual example is this second tab in the right-tab paragraph.
- nLineWidth = parseDump("//page[2]/body/txt[6]/SwParaPortion/SwLineLayout[4]", "width").toInt32();
+ nLineWidth = parseDump("//page[2]/body/txt[6]/SwParaPortion/SwLineLayout[4]"_ostr, "width"_ostr).toInt32();
CPPUNIT_ASSERT_EQUAL_MESSAGE("Full paragraph area used", nLineWidth, nParaWidth);
- CPPUNIT_ASSERT_EQUAL(OUString("TabOverflow does what?"), parseDump("//page[3]/body/txt[2]/SwParaPortion/SwLineLayout[1]/SwLinePortion[1]", "portion"));
+ CPPUNIT_ASSERT_EQUAL(OUString("TabOverflow does what?"), parseDump("//page[3]/body/txt[2]/SwParaPortion/SwLineLayout[1]/SwLinePortion[1]"_ostr, "portion"_ostr));
// Not 1 line high (Word 2010 DOCX and ODT), or 4 lines high (prev LO DOCX),
// but 8 lines high.
- nHeight = parseDump("//page[3]/body/txt[2]/infos/bounds", "height").toInt32();
+ nHeight = parseDump("//page[3]/body/txt[2]/infos/bounds"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("8 lines high", 242*8, nHeight, 121);
}
@@ -668,9 +668,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTextframeHyperlink)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// DML
- assertXPath(pXmlDoc, "//w:drawing/wp:anchor/wp:docPr/a:hlinkClick", 1);
+ assertXPath(pXmlDoc, "//w:drawing/wp:anchor/wp:docPr/a:hlinkClick"_ostr, 1);
// VML
- assertXPath(pXmlDoc, "//w:pict/v:rect", "href", "https://libreoffice.org/");
+ assertXPath(pXmlDoc, "//w:pict/v:rect"_ostr, "href"_ostr, "https://libreoffice.org/");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf146171_invalid_change_date)
@@ -685,13 +685,13 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf146171_invalid_change_date)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// This was 0
- assertXPath(pXmlDoc, "//w:ins", 5);
+ assertXPath(pXmlDoc, "//w:ins"_ostr, 5);
// This was 0
- assertXPath(pXmlDoc, "//w:del", 2);
+ assertXPath(pXmlDoc, "//w:del"_ostr, 2);
// no date (anonymized change)
// This failed, date was exported as w:date="1970-01-01T00:00:00Z" before fixing tdf#147760
- assertXPathNoAttribute(pXmlDoc, "//w:del[1]", "date");
- assertXPathNoAttribute(pXmlDoc, "//w:del[2]", "date");
+ assertXPathNoAttribute(pXmlDoc, "//w:del[1]"_ostr, "date"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "//w:del[2]"_ostr, "date"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf139580)
@@ -717,7 +717,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFooterMarginLost)
// - Expected: 709
// - Actual : 0
// i.e. import + export lost the footer margin value.
- assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgMar", "footer", "709");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgMar"_ostr, "footer"_ostr, "709");
}
CPPUNIT_TEST_FIXTURE(Test, testEffectExtentLineWidth)
@@ -756,7 +756,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRtlGutter)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Without the accompanying fix in place, this test would have failed as the XML element was
// missing.
- assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:rtlGutter", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:rtlGutter"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf140572_docDefault_superscript)
@@ -908,11 +908,11 @@ CPPUNIT_TEST_FIXTURE(Test, testCommentReply)
xmlDocUniquePtr pXmlCommExt = parseExport("word/commentsExtended.xml");
CPPUNIT_ASSERT(pXmlComm);
CPPUNIT_ASSERT(pXmlCommExt);
- OUString sParentId = getXPath(pXmlComm, "/w:comments/w:comment[1]/w:p[1]", "paraId");
- OUString sChildId = getXPath(pXmlComm, "/w:comments/w:comment[2]/w:p[1]", "paraId");
- OUString sChildIdEx = getXPath(pXmlCommExt, "/w15:commentsEx/w15:commentEx", "paraId");
+ OUString sParentId = getXPath(pXmlComm, "/w:comments/w:comment[1]/w:p[1]"_ostr, "paraId"_ostr);
+ OUString sChildId = getXPath(pXmlComm, "/w:comments/w:comment[2]/w:p[1]"_ostr, "paraId"_ostr);
+ OUString sChildIdEx = getXPath(pXmlCommExt, "/w15:commentsEx/w15:commentEx"_ostr, "paraId"_ostr);
OUString sChildParentId = getXPath(pXmlCommExt,
- "/w15:commentsEx/w15:commentEx", "paraIdParent");
+ "/w15:commentsEx/w15:commentEx"_ostr, "paraIdParent"_ostr);
// Make sure exported extended paraId matches the one in comments.xml
CPPUNIT_ASSERT_EQUAL(sChildId, sChildIdEx);
// Make sure the paraIdParent matches the id of its parent
@@ -923,14 +923,14 @@ CPPUNIT_TEST_FIXTURE(Test, testCommentDone)
{
loadAndSave("CommentDone.docx");
xmlDocUniquePtr pXmlComm = parseExport("word/comments.xml");
- assertXPath(pXmlComm, "/w:comments/w:comment[1]/w:p", 2);
- OUString idLastPara = getXPath(pXmlComm, "/w:comments/w:comment[1]/w:p[2]", "paraId");
+ assertXPath(pXmlComm, "/w:comments/w:comment[1]/w:p"_ostr, 2);
+ OUString idLastPara = getXPath(pXmlComm, "/w:comments/w:comment[1]/w:p[2]"_ostr, "paraId"_ostr);
xmlDocUniquePtr pXmlCommExt = parseExport("word/commentsExtended.xml");
- assertXPath(pXmlCommExt, "/w15:commentsEx", "Ignorable", "w15");
- assertXPath(pXmlCommExt, "/w15:commentsEx/w15:commentEx", 1);
- OUString idLastParaEx = getXPath(pXmlCommExt, "/w15:commentsEx/w15:commentEx", "paraId");
+ assertXPath(pXmlCommExt, "/w15:commentsEx"_ostr, "Ignorable"_ostr, "w15");
+ assertXPath(pXmlCommExt, "/w15:commentsEx/w15:commentEx"_ostr, 1);
+ OUString idLastParaEx = getXPath(pXmlCommExt, "/w15:commentsEx/w15:commentEx"_ostr, "paraId"_ostr);
CPPUNIT_ASSERT_EQUAL(idLastPara, idLastParaEx);
- assertXPath(pXmlCommExt, "/w15:commentsEx/w15:commentEx", "done", "1");
+ assertXPath(pXmlCommExt, "/w15:commentsEx/w15:commentEx"_ostr, "done"_ostr, "1");
}
DECLARE_OOXMLEXPORT_TEST(testTableWidth, "frame_size_export.docx")
@@ -999,8 +999,8 @@ CPPUNIT_TEST_FIXTURE(Test, Test_ShadowDirection)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
assertXPath(pXmlDoc,
"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw",
- "rotWithShape", "0");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw"_ostr,
+ "rotWithShape"_ostr, "0");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf150542)
@@ -1011,17 +1011,17 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf150542)
// Ensure that all docvars from input are written back and with correct values.
// Order of document variables is not checked. So this can fail at some time if order is changed.
assertXPath(pSettingsDoc,
- "/w:settings/w:docVars/w:docVar[1]", "name", u"LocalChars\u00C1\u0072\u0076\u00ED\u007A\u0074\u0075\u0072\u006F\u0054\u00FC\u006B\u00F6\u0072\u0066\u00FA\u0072\u00F3\u0067\u00E9\u0070"_ustr);
+ "/w:settings/w:docVars/w:docVar[1]"_ostr, "name"_ostr, u"LocalChars\u00C1\u0072\u0076\u00ED\u007A\u0074\u0075\u0072\u006F\u0054\u00FC\u006B\u00F6\u0072\u0066\u00FA\u0072\u00F3\u0067\u00E9\u0070"_ustr);
assertXPath(pSettingsDoc,
- "/w:settings/w:docVars/w:docVar[1]", "val", u"Correct value (\u00E1\u0072\u0076\u00ED\u007A\u0074\u0075\u0072\u006F\u0020\u0074\u00FC\u006B\u00F6\u0072\u0066\u00FA\u0072\u00F3\u0067\u00E9\u0070)"_ustr);
+ "/w:settings/w:docVars/w:docVar[1]"_ostr, "val"_ostr, u"Correct value (\u00E1\u0072\u0076\u00ED\u007A\u0074\u0075\u0072\u006F\u0020\u0074\u00FC\u006B\u00F6\u0072\u0066\u00FA\u0072\u00F3\u0067\u00E9\u0070)"_ustr);
assertXPath(pSettingsDoc,
- "/w:settings/w:docVars/w:docVar[2]", "name", "DocVar1");
+ "/w:settings/w:docVars/w:docVar[2]"_ostr, "name"_ostr, "DocVar1");
assertXPath(pSettingsDoc,
- "/w:settings/w:docVars/w:docVar[2]", "val", "DocVar1 Value");
+ "/w:settings/w:docVars/w:docVar[2]"_ostr, "val"_ostr, "DocVar1 Value");
assertXPath(pSettingsDoc,
- "/w:settings/w:docVars/w:docVar[3]", "name", "DocVar3");
+ "/w:settings/w:docVars/w:docVar[3]"_ostr, "name"_ostr, "DocVar3");
assertXPath(pSettingsDoc,
- "/w:settings/w:docVars/w:docVar[3]", "val", "DocVar3 Value");
+ "/w:settings/w:docVars/w:docVar[3]"_ostr, "val"_ostr, "DocVar3 Value");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf139549)
@@ -1029,7 +1029,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf139549)
loadAndSave("tdf139549.docx");
// Document contains a VML textbox, the position of the textbox was incorrect.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- OUString aStyle = getXPath(pXmlDoc, "//w:pict/v:shape", "style");
+ OUString aStyle = getXPath(pXmlDoc, "//w:pict/v:shape"_ostr, "style"_ostr);
/* original is: "position:absolute;margin-left:138.5pt;margin-top:40.1pt;width:183pt;
height:68pt;z-index:251675648;mso-position-horizontal:absolute;
mso-position-horizontal-relative:page;mso-position-vertical:absolute;
@@ -1073,7 +1073,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143726)
CPPUNIT_ASSERT(pXmlStyles);
// Without the fix this was "TOA Heading" which belongs to the "Table of Authorities" index in Word
// TOC's heading style should be exported as "TOC Heading" as that's the default Word style name
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='TOCHeading']/w:name", "val", "TOC Heading");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='TOCHeading']/w:name"_ostr, "val"_ostr, "TOC Heading");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf152153)
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
index 6d3d0452740a..49d974b01159 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
@@ -229,7 +229,7 @@ CPPUNIT_TEST_FIXTURE(Test, testParaStyleNumLevel)
// - Expected: 1
// - Actual : 0
// i.e. a custom list level in a para style was lost on import+export.
- assertXPath(pXmlDoc, "/w:styles/w:style[@w:styleId='Mystyle']/w:pPr/w:numPr/w:ilvl", "val", "1");
+ assertXPath(pXmlDoc, "/w:styles/w:style[@w:styleId='Mystyle']/w:pPr/w:numPr/w:ilvl"_ostr, "val"_ostr, "1");
}
CPPUNIT_TEST_FIXTURE(Test, testClearingBreak)
@@ -242,7 +242,7 @@ CPPUNIT_TEST_FIXTURE(Test, testClearingBreak)
// Without the accompanying fix in place, this test would have failed with:
// - XPath '/w:document/w:body/w:p/w:r/w:br' number of nodes is incorrect
// i.e. first the clearing break was turned into a plain break, then it was completely lost.
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br", "clear", "all");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br"_ostr, "clear"_ostr, "all");
}
CPPUNIT_TEST_FIXTURE(Test, testContentControlExport)
@@ -272,8 +272,8 @@ CPPUNIT_TEST_FIXTURE(Test, testContentControlExport)
// - Actual : 0
// XPath '//w:sdt/w:sdtPr/w:showingPlcHdr' number of nodes is incorrect
// i.e. the SDT elements were missing on export.
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:showingPlcHdr", 1);
- assertXPath(pXmlDoc, "//w:sdt/w:sdtContent", 1);
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:showingPlcHdr"_ostr, 1);
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtContent"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testCheckboxContentControlExport)
@@ -306,9 +306,9 @@ CPPUNIT_TEST_FIXTURE(Test, testCheckboxContentControlExport)
// - Actual : 0
// - XPath '//w:sdt/w:sdtPr/w14:checkbox/w14:checked' number of nodes is incorrect
// i.e. <w14:checkbox> and its child elements were lost.
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w14:checkbox/w14:checked", "val", "1");
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w14:checkbox/w14:checkedState", "val", "2612");
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w14:checkbox/w14:uncheckedState", "val", "2610");
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w14:checkbox/w14:checked"_ostr, "val"_ostr, "1");
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w14:checkbox/w14:checkedState"_ostr, "val"_ostr, "2612");
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w14:checkbox/w14:uncheckedState"_ostr, "val"_ostr, "2610");
}
CPPUNIT_TEST_FIXTURE(Test, testDropdownContentControlExport)
@@ -355,12 +355,12 @@ CPPUNIT_TEST_FIXTURE(Test, testDropdownContentControlExport)
// - Actual : 0
// - XPath '//w:sdt/w:sdtPr/w:dropDownList/w:listItem[1]' number of nodes is incorrect
// i.e. the list items were lost on export.
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:dropDownList/w:listItem[1]", "displayText", "red");
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:dropDownList/w:listItem[1]", "value", "R");
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:dropDownList/w:listItem[2]", "displayText", "green");
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:dropDownList/w:listItem[2]", "value", "G");
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:dropDownList/w:listItem[3]", "displayText", "blue");
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:dropDownList/w:listItem[3]", "value", "B");
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:dropDownList/w:listItem[1]"_ostr, "displayText"_ostr, "red");
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:dropDownList/w:listItem[1]"_ostr, "value"_ostr, "R");
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:dropDownList/w:listItem[2]"_ostr, "displayText"_ostr, "green");
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:dropDownList/w:listItem[2]"_ostr, "value"_ostr, "G");
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:dropDownList/w:listItem[3]"_ostr, "displayText"_ostr, "blue");
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:dropDownList/w:listItem[3]"_ostr, "value"_ostr, "B");
}
CPPUNIT_TEST_FIXTURE(Test, testPictureContentControlExport)
@@ -394,7 +394,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPictureContentControlExport)
// - Expected: 1
// - Actual : 0
// i.e. <w:picture> was lost on export.
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:picture", 1);
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:picture"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testDateContentControlExport)
@@ -439,20 +439,20 @@ CPPUNIT_TEST_FIXTURE(Test, testDateContentControlExport)
// - Actual : 0
// - XPath '//w:sdt/w:sdtPr/w:date/w:dateFormat' number of nodes is incorrect
// i.e. the <w:date> was lost on export.
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:date/w:dateFormat", "val", "M/d/yyyy");
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:date/w:lid", "val", "en-US");
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:date", "fullDate", "2022-05-26T00:00:00Z");
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:placeholder/w:docPart", "val", "DefaultPlaceholder_-1854013437");
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:dataBinding", "prefixMappings", "xmlns:ns0='http://schemas.microsoft.com/vsto/samples' ");
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:dataBinding", "xpath", "/ns0:employees[1]/ns0:employee[1]/ns0:hireDate[1]");
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:dataBinding", "storeItemID", "{241A8A02-7FFD-488D-8827-63FBE74E8BC9}");
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w15:color", "val", "008000");
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w15:appearance", "val", "hidden");
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:alias", "val", "myalias");
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:tag", "val", "mytag");
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:id", "val", "123");
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:tabIndex", "val", "-1");
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:lock", "val", "sdtLocked");
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:date/w:dateFormat"_ostr, "val"_ostr, "M/d/yyyy");
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:date/w:lid"_ostr, "val"_ostr, "en-US");
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:date"_ostr, "fullDate"_ostr, "2022-05-26T00:00:00Z");
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:placeholder/w:docPart"_ostr, "val"_ostr, "DefaultPlaceholder_-1854013437");
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:dataBinding"_ostr, "prefixMappings"_ostr, "xmlns:ns0='http://schemas.microsoft.com/vsto/samples' ");
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:dataBinding"_ostr, "xpath"_ostr, "/ns0:employees[1]/ns0:employee[1]/ns0:hireDate[1]");
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:dataBinding"_ostr, "storeItemID"_ostr, "{241A8A02-7FFD-488D-8827-63FBE74E8BC9}");
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w15:color"_ostr, "val"_ostr, "008000");
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w15:appearance"_ostr, "val"_ostr, "hidden");
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:alias"_ostr, "val"_ostr, "myalias");
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:tag"_ostr, "val"_ostr, "mytag");
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:id"_ostr, "val"_ostr, "123");
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:tabIndex"_ostr, "val"_ostr, "-1");
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:lock"_ostr, "val"_ostr, "sdtLocked");
}
CPPUNIT_TEST_FIXTURE(Test, testNegativePageBorder)
@@ -478,13 +478,13 @@ CPPUNIT_TEST_FIXTURE(Test, testNegativePageBorder)
// Then make sure that the page edge -> border space is correct:
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//w:pgMar", "top", "284");
- assertXPath(pXmlDoc, "//w:pgBorders/w:top", "sz", "36");
+ assertXPath(pXmlDoc, "//w:pgMar"_ostr, "top"_ostr, "284");
+ assertXPath(pXmlDoc, "//w:pgBorders/w:top"_ostr, "sz"_ostr, "36");
// Without the fix in place, this test would have failed with:
// - Expected: 28
// - Actual : 0
// i.e. editeng::BorderDistancesToWord() mis-handled negative border distances.
- assertXPath(pXmlDoc, "//w:pgBorders/w:top", "space", "28");
+ assertXPath(pXmlDoc, "//w:pgBorders/w:top"_ostr, "space"_ostr, "28");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf148494)
@@ -496,7 +496,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148494)
// Without the fix in place, this test would have failed with
// - Expected: MACROBUTTON AllCaps Hello World
// - Actual : MACROBUTTONAllCaps Hello World
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[3]/w:instrText", " MACROBUTTON AllCaps Hello World ");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[3]/w:instrText"_ostr, " MACROBUTTON AllCaps Hello World ");
}
DECLARE_OOXMLEXPORT_TEST(testTdf137466, "tdf137466.docx")
@@ -506,11 +506,11 @@ DECLARE_OOXMLEXPORT_TEST(testTdf137466, "tdf137466.docx")
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Ensure that we have <w:placeholder><w:docPart v:val="xxxx"/></w:placeholder>
- OUString sDocPart = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:placeholder/w:docPart", "val");
+ OUString sDocPart = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:placeholder/w:docPart"_ostr, "val"_ostr);
CPPUNIT_ASSERT_EQUAL(OUString("DefaultPlaceholder_-1854013440"), sDocPart);
// Ensure that we have <w15:color v:val="xxxx"/>
- OUString sColor = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w15:color", "val");
+ OUString sColor = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w15:color"_ostr, "val"_ostr);
CPPUNIT_ASSERT_EQUAL(OUString("FF0000"), sColor);
}
@@ -547,7 +547,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDontAddNewStyles)
// - Expected: 0
// - Actual : 1
// i.e. builtin styles were added to the export result, even if we opted out.
- assertXPath(pXmlDoc, "/w:styles/w:style[@w:styleId='Caption']", 0);
+ assertXPath(pXmlDoc, "/w:styles/w:style[@w:styleId='Caption']"_ostr, 0);
}
DECLARE_OOXMLEXPORT_TEST(TestWPGZOrder, "testWPGZOrder.docx")
@@ -604,26 +604,26 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148720)
const OString sShapeXPaths[] =
{
- OString("/root/page/body/txt/anchored/SwAnchoredDrawObject/SdrObjGroup/SdrObjList/SdrObject[1]"),
- OString("/root/page/body/txt/anchored/SwAnchoredDrawObject/SdrObjGroup/SdrObjList/SdrObjGroup/SdrObjList/SdrObjGroup/SdrObjList/SdrObject[1]"),
- OString("/root/page/body/txt/anchored/SwAnchoredDrawObject/SdrObjGroup/SdrObjList/SdrObjGroup/SdrObjList/SdrObjGroup/SdrObjList/SdrObject[2]"),
- OString("/root/page/body/txt/anchored/SwAnchoredDrawObject/SdrObjGroup/SdrObjList/SdrObject[2]")
+ "/root/page/body/txt/anchored/SwAnchoredDrawObject/SdrObjGroup/SdrObjList/SdrObject[1]"_ostr,
+ "/root/page/body/txt/anchored/SwAnchoredDrawObject/SdrObjGroup/SdrObjList/SdrObjGroup/SdrObjList/SdrObjGroup/SdrObjList/SdrObject[1]"_ostr,
+ "/root/page/body/txt/anchored/SwAnchoredDrawObject/SdrObjGroup/SdrObjList/SdrObjGroup/SdrObjList/SdrObjGroup/SdrObjList/SdrObject[2]"_ostr,
+ "/root/page/body/txt/anchored/SwAnchoredDrawObject/SdrObjGroup/SdrObjList/SdrObject[2]"_ostr
};
const OString sTextXPaths[] =
{
- OString("/root/page/body/txt/anchored/fly[1]/infos/bounds"),
- OString("/root/page/body/txt/anchored/fly[2]/infos/bounds"),
- OString("/root/page/body/txt/anchored/fly[3]/infos/bounds"),
- OString("/root/page/body/txt/anchored/fly[4]/infos/bounds")
+ "/root/page/body/txt/anchored/fly[1]/infos/bounds"_ostr,
+ "/root/page/body/txt/anchored/fly[2]/infos/bounds"_ostr,
+ "/root/page/body/txt/anchored/fly[3]/infos/bounds"_ostr,
+ "/root/page/body/txt/anchored/fly[4]/infos/bounds"_ostr
};
const OString sAttribs[] =
{
- OString("left"),
- OString("top"),
- OString("width"),
- OString("height")
+ "left"_ostr,
+ "top"_ostr,
+ "width"_ostr,
+ "height"_ostr
};
for (sal_Int32 i = 0; i < 4; ++i)
@@ -631,7 +631,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148720)
OUString aShapeVals[4];
int aTextVals[4] = {0, 0, 0, 0};
- const auto aOutRect = getXPath(pLayout, sShapeXPaths[i], "aOutRect");
+ const auto aOutRect = getXPath(pLayout, sShapeXPaths[i], "aOutRect"_ostr);
sal_uInt16 nCommaPos[4] = {0, 0, 0, 0};
nCommaPos[1] = aOutRect.indexOf(",");
@@ -678,7 +678,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123642_BookmarkAtDocEnd, "tdf123642.docx")
return; // initial import, no further checks
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- CPPUNIT_ASSERT_EQUAL(OUString("Bookmark1"), getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:bookmarkStart[1]", "name"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Bookmark1"), getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:bookmarkStart[1]"_ostr, "name"_ostr));
}
DECLARE_OOXMLEXPORT_TEST(testTdf148361, "tdf148361.docx")
@@ -875,7 +875,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf148111, "tdf148111.docx")
return;
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// ShowingPlaceholder should be off for 0, false and "on". (This was 21 before the fix)
- assertXPath(pXmlDoc,"//w:p/w:sdt/w:sdtPr/w:showingPlcHdr", 12);
+ assertXPath(pXmlDoc,"//w:p/w:sdt/w:sdtPr/w:showingPlcHdr"_ostr, 12);
}
DECLARE_OOXMLEXPORT_TEST(TestTdf73499, "tdf73499.docx")
@@ -913,14 +913,14 @@ DECLARE_OOXMLEXPORT_TEST(testTdf81507, "tdf81507.docx")
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Ensure that we have <w:text w:multiLine="1"/>
- CPPUNIT_ASSERT_EQUAL(OUString("1"), getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:sdt/w:sdtPr/w:text", "multiLine"));
+ CPPUNIT_ASSERT_EQUAL(OUString("1"), getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:sdt/w:sdtPr/w:text"_ostr, "multiLine"_ostr));
// Ensure that we have <w:text w:multiLine="0"/>
- CPPUNIT_ASSERT_EQUAL(OUString("0"), getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:sdt/w:sdtPr/w:text", "multiLine"));
+ CPPUNIT_ASSERT_EQUAL(OUString("0"), getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:sdt/w:sdtPr/w:text"_ostr, "multiLine"_ostr));
// Ensure that we have <w:text/>
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:sdt/w:sdtPr/w:text");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:sdt/w:sdtPr/w:text");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:sdt/w:sdtPr/w:text"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:sdt/w:sdtPr/w:text"_ostr);
}
DECLARE_OOXMLEXPORT_TEST(testTdf139948, "tdf139948.docx")
@@ -1010,7 +1010,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf148455_2, "tdf148455_2.docx")
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Find list id for restarted list
- sal_Int32 nListId = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:numPr/w:numId", "val").toInt32();
+ sal_Int32 nListId = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:numPr/w:numId"_ostr, "val"_ostr).toInt32();
xmlDocUniquePtr pNumberingDoc = parseExport("word/numbering.xml");
@@ -1018,7 +1018,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf148455_2, "tdf148455_2.docx")
assertXPath(pNumberingDoc, "/w:numbering/w:num[@w:numId='" + OString::number(nListId) +"']/w:lvlOverride[@w:ilvl='0']");
assertXPath(pNumberingDoc, "/w:numbering/w:num[@w:numId='" + OString::number(nListId) +"']/w:lvlOverride[@w:ilvl='1']");
// And normal override for level 2
- getXPath(pNumberingDoc, "/w:numbering/w:num[@w:numId='" + OString::number(nListId) +"']/w:lvlOverride[@w:ilvl='2']/w:startOverride", "val");
+ getXPath(pNumberingDoc, "/w:numbering/w:num[@w:numId='" + OString::number(nListId) +"']/w:lvlOverride[@w:ilvl='2']/w:startOverride", "val"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf147978enhancedPathABVW)
@@ -1076,11 +1076,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149200)
// Ensure there is no unexpected invalid structure <w14:textFill>
// There is just one run property
- xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "count(/w:document/w:body/w:p[1]/w:r[1]/w:rPr/*)");
+ xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "count(/w:document/w:body/w:p[1]/w:r[1]/w:rPr/*)"_ostr);
CPPUNIT_ASSERT(pXmlObj);
CPPUNIT_ASSERT_EQUAL(double(1), pXmlObj->floatval);
// And it is a color definition with themeColor
- CPPUNIT_ASSERT_EQUAL(OUString("dark1"), getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w:color", "themeColor"));
+ CPPUNIT_ASSERT_EQUAL(OUString("dark1"), getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w:color"_ostr, "themeColor"_ostr));
}
DECLARE_OOXMLEXPORT_TEST(testTdf149313, "tdf149313.docx")
@@ -1090,10 +1090,10 @@ DECLARE_OOXMLEXPORT_TEST(testTdf149313, "tdf149313.docx")
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// And ensure that pages are with correct sections (have correct dimensions)
- CPPUNIT_ASSERT_EQUAL(sal_Int32(4989), getXPath(pXmlDoc, "/root/page[1]/infos/bounds", "height").toInt32());
- CPPUNIT_ASSERT_EQUAL(sal_Int32(4989), getXPath(pXmlDoc, "/root/page[1]/infos/bounds", "width").toInt32());
- CPPUNIT_ASSERT_EQUAL(sal_Int32(4989), getXPath(pXmlDoc, "/root/page[2]/infos/bounds", "height").toInt32());
- CPPUNIT_ASSERT_EQUAL(sal_Int32(8000), getXPath(pXmlDoc, "/root/page[2]/infos/bounds", "width").toInt32());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(4989), getXPath(pXmlDoc, "/root/page[1]/infos/bounds"_ostr, "height"_ostr).toInt32());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(4989), getXPath(pXmlDoc, "/root/page[1]/infos/bounds"_ostr, "width"_ostr).toInt32());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(4989), getXPath(pXmlDoc, "/root/page[2]/infos/bounds"_ostr, "height"_ostr).toInt32());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(8000), getXPath(pXmlDoc, "/root/page[2]/infos/bounds"_ostr, "width"_ostr).toInt32());
}
DECLARE_OOXMLEXPORT_TEST(testTdf148360, "tdf148360.docx")
@@ -1101,9 +1101,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf148360, "tdf148360.docx")
const auto& pLayout = parseLayoutDump();
// Ensure first element is a tab
- assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*[1]", "type", "PortionType::TabLeft");
+ assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*[1]"_ostr, "type"_ostr, "PortionType::TabLeft");
// and only then goes content
- assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*[2]", "type", "PortionType::Text");
+ assertXPath(pLayout, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*[2]"_ostr, "type"_ostr, "PortionType::Text");
}
DECLARE_OOXMLEXPORT_TEST(testTdf135923, "tdf135923-min.docx")
@@ -1149,7 +1149,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf139128)
// - Expected: 2
// - Actual : 0
// i.e. the line break was lost on export.
- assertXPath(pXmlDoc, "//w:br", 2);
+ assertXPath(pXmlDoc, "//w:br"_ostr, 2);
}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
index c25a9369bd94..de52a56ff0d2 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
@@ -110,7 +110,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf147646, "tdf147646_mergedCellNumbering.docx")
//Without the fix in place, it would have failed with
//- Expected: 2.
//- Actual : 4.
- CPPUNIT_ASSERT_EQUAL(OUString("2."),parseDump("/root/page/body/tab/row[4]/cell/txt/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']","expand"));
+ CPPUNIT_ASSERT_EQUAL(OUString("2."),parseDump("/root/page/body/tab/row[4]/cell/txt/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']"_ostr,"expand"_ostr));
}
DECLARE_OOXMLEXPORT_TEST(testTdf153526_commentInNumbering, "tdf153526_commentInNumbering.docx")
@@ -133,7 +133,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf153042_largeTab, "tdf153042_largeTab.docx")
const auto& pLayout = parseLayoutDump();
// Ensure a large tabstop is used in the pseudo-numbering (numbering::NONE followed by tabstop)
- assertXPath(pLayout, "//SwFixPortion", "width", "1701");
+ assertXPath(pLayout, "//SwFixPortion"_ostr, "width"_ostr, "1701");
}
DECLARE_OOXMLEXPORT_TEST(testTdf153042_noTab, "tdf153042_noTab.docx")
@@ -149,7 +149,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf153042_noTab, "tdf153042_noTab.docx")
const auto& pLayout = parseLayoutDump();
// Ensure a miniscule tab is used in the pseudo-numbering (numbering::NONE followed by tabstop)
- assertXPath(pLayout, "//SwFixPortion", "width", "10");
+ assertXPath(pLayout, "//SwFixPortion"_ostr, "width"_ostr, "10");
}
DECLARE_OOXMLEXPORT_TEST(testTdf154751_dualStrikethrough, "tdf154751_dualStrikethrough.docx")
@@ -180,7 +180,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153592_columnBreaks)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// The two column breaks were lost on import. (I wouldn't complain if they were at 3,5)
- assertXPath(pXmlDoc, "//w:br", 2);
+ assertXPath(pXmlDoc, "//w:br"_ostr, 2);
}
DECLARE_OOXMLEXPORT_TEST(testTdf104394_lostTextbox, "tdf104394_lostTextbox.docx")
@@ -207,15 +207,15 @@ DECLARE_OOXMLEXPORT_TEST(testTdf105035_framePrB, "tdf105035_framePrB.docx")
// and the frames must not overlap - even though their vertical positions are identical.
const auto& pLayout = parseLayoutDump();
sal_Int32 n1stFlyBottom
- = getXPath(pLayout, "//page[1]//anchored/fly[1]/infos/bounds", "bottom").toInt32();
+ = getXPath(pLayout, "//page[1]//anchored/fly[1]/infos/bounds"_ostr, "bottom"_ostr).toInt32();
sal_Int32 n2ndFlyTop
- = getXPath(pLayout, "//page[1]//anchored/fly[2]/infos/bounds", "top").toInt32();
+ = getXPath(pLayout, "//page[1]//anchored/fly[2]/infos/bounds"_ostr, "top"_ostr).toInt32();
CPPUNIT_ASSERT_GREATER(n1stFlyBottom, n2ndFlyTop); //Top is greater than bottom
// Impossible layout TODO: the textboxes are in the wrong order.
OUString sTextBox1("Preparation of Papers for IEEE TRANSACTIONS and JOURNALS (November 2012)");
CPPUNIT_ASSERT_MESSAGE("DID YOU FIX ME? Wow - I didn't think this would be possible!",
- !getXPathContent(pLayout, "//page[1]//anchored/fly[1]/txt").startsWith(sTextBox1));
+ !getXPathContent(pLayout, "//page[1]//anchored/fly[1]/txt"_ostr).startsWith(sTextBox1));
}
DECLARE_OOXMLEXPORT_TEST(testTdf105035_framePrC, "tdf105035_framePrC.docx")
@@ -224,9 +224,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf105035_framePrC, "tdf105035_framePrC.docx")
// and the frames DO overlap this time.
const auto& pLayout = parseLayoutDump();
sal_Int32 n1stFlyTop
- = getXPath(pLayout, "//page[1]//anchored/fly[1]/infos/bounds", "top").toInt32();
+ = getXPath(pLayout, "//page[1]//anchored/fly[1]/infos/bounds"_ostr, "top"_ostr).toInt32();
sal_Int32 n2ndFlyTop
- = getXPath(pLayout, "//page[1]//anchored/fly[2]/infos/bounds", "top").toInt32();
+ = getXPath(pLayout, "//page[1]//anchored/fly[2]/infos/bounds"_ostr, "top"_ostr).toInt32();
CPPUNIT_ASSERT_EQUAL(n1stFlyTop, n2ndFlyTop); //both frames start at the same position
}
@@ -277,11 +277,11 @@ DECLARE_OOXMLEXPORT_TEST(testTdf154703_framePr2, "tdf154703_framePr2.rtf")
// exported: framed paragraphs without a background should now have a red background
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//w:body/w:p[1]/w:pPr/w:shd", "fill", "800000");
- assertXPath(pXmlDoc, "//w:body/w:p[2]/w:pPr/w:shd", "fill", "548DD4"); // was blue already, no change
- assertXPath(pXmlDoc, "//w:body/w:p[3]/w:pPr/w:shd", "fill", "800000");
- assertXPath(pXmlDoc, "//w:body/w:p[3]/w:pPr/w:framePr", "yAlign", "center");
- assertXPathNoAttribute(pXmlDoc, "//w:body/w:p[3]/w:pPr/w:framePr", "y");
+ assertXPath(pXmlDoc, "//w:body/w:p[1]/w:pPr/w:shd"_ostr, "fill"_ostr, "800000");
+ assertXPath(pXmlDoc, "//w:body/w:p[2]/w:pPr/w:shd"_ostr, "fill"_ostr, "548DD4"); // was blue already, no change
+ assertXPath(pXmlDoc, "//w:body/w:p[3]/w:pPr/w:shd"_ostr, "fill"_ostr, "800000");
+ assertXPath(pXmlDoc, "//w:body/w:p[3]/w:pPr/w:framePr"_ostr, "yAlign"_ostr, "center");
+ assertXPathNoAttribute(pXmlDoc, "//w:body/w:p[3]/w:pPr/w:framePr"_ostr, "y"_ostr);
}
DECLARE_OOXMLEXPORT_TEST(testTdf154703_framePrWrapSpacing, "tdf154703_framePrWrapSpacing.docx")
@@ -292,7 +292,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf154703_framePrWrapSpacing, "tdf154703_framePrWra
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// before the fix, this was half of the correct value.
- assertXPath(pXmlDoc, "//w:body/w:p/w:pPr/w:framePr", "hSpace", "2552");
+ assertXPath(pXmlDoc, "//w:body/w:p/w:pPr/w:framePr"_ostr, "hSpace"_ostr, "2552");
}
DECLARE_OOXMLEXPORT_TEST(testTdf154703_framePrTextDirection, "tdf154703_framePrTextDirection.docx")
@@ -302,28 +302,28 @@ DECLARE_OOXMLEXPORT_TEST(testTdf154703_framePrTextDirection, "tdf154703_framePrT
return;
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//w:body/w:p/w:pPr/w:textDirection", "val", "tbRl");
+ assertXPath(pXmlDoc, "//w:body/w:p/w:pPr/w:textDirection"_ostr, "val"_ostr, "tbRl");
}
DECLARE_OOXMLEXPORT_TEST(testTdf153613_anchoredAfterPgBreak, "tdf153613_anchoredAfterPgBreak.docx")
{
const auto& pLayout = parseLayoutDump();
// An anchored TO character image anchors before the page break.
- assertXPath(pLayout, "//page[1]//anchored", 1);
+ assertXPath(pLayout, "//page[1]//anchored"_ostr, 1);
}
DECLARE_OOXMLEXPORT_TEST(testTdf153613_anchoredAfterPgBreak2, "tdf153613_anchoredAfterPgBreak2.docx")
{
const auto& pLayout = parseLayoutDump();
// An anchored TO character image, followed by more characters moves to the following page
- assertXPath(pLayout, "//page[2]//anchored", 1);
+ assertXPath(pLayout, "//page[2]//anchored"_ostr, 1);
}
DECLARE_OOXMLEXPORT_TEST(testTdf153613_anchoredAfterPgBreak3, "tdf153613_anchoredAfterPgBreak3.docx")
{
const auto& pLayout = parseLayoutDump();
// An anchored TO character image, with setting splitPgBreakAndParaMark moves to the following page
- assertXPath(pLayout, "//page[2]//anchored", 1);
+ assertXPath(pLayout, "//page[2]//anchored"_ostr, 1);
}
DECLARE_OOXMLEXPORT_TEST(testTdf153613_anchoredAfterPgBreak6, "tdf153613_anchoredAfterPgBreak6.docx")
@@ -334,15 +334,15 @@ DECLARE_OOXMLEXPORT_TEST(testTdf153613_anchoredAfterPgBreak6, "tdf153613_anchore
CPPUNIT_ASSERT_EQUAL(4, getParagraphs());
const auto& pLayout = parseLayoutDump();
- CPPUNIT_ASSERT_EQUAL(OUString("y"), getXPathContent(pLayout, "//page[2]/body/txt[1]"));
- assertXPath(pLayout, "//page[1]//anchored", 1); // DID YOU FIX ME? This should be page[2]
+ CPPUNIT_ASSERT_EQUAL(OUString("y"), getXPathContent(pLayout, "//page[2]/body/txt[1]"_ostr));
+ assertXPath(pLayout, "//page[1]//anchored"_ostr, 1); // DID YOU FIX ME? This should be page[2]
}
DECLARE_OOXMLEXPORT_TEST(testTdf153613_inlineAfterPgBreak, "tdf153613_inlineAfterPgBreak.docx")
{
const auto& pLayout = parseLayoutDump();
// An inline AS character image moves to the following page when after the page break.
- assertXPath(pLayout, "//page[2]//anchored", 1);
+ assertXPath(pLayout, "//page[2]//anchored"_ostr, 1);
}
DECLARE_OOXMLEXPORT_TEST(testTdf153613_inlineAfterPgBreak2, "tdf153613_inlineAfterPgBreak2.docx")
@@ -353,8 +353,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf153613_inlineAfterPgBreak2, "tdf153613_inlineAft
CPPUNIT_ASSERT_EQUAL(4, getParagraphs());
const auto& pLayout = parseLayoutDump();
- CPPUNIT_ASSERT_EQUAL(OUString("x"), getXPathContent(pLayout, "//page[1]/body/txt[2]"));
- assertXPath(pLayout, "//page[2]//anchored", 1);
+ CPPUNIT_ASSERT_EQUAL(OUString("x"), getXPathContent(pLayout, "//page[1]/body/txt[2]"_ostr));
+ assertXPath(pLayout, "//page[2]//anchored"_ostr, 1);
}
DECLARE_OOXMLEXPORT_TEST(testTdf153613_textboxAfterPgBreak, "tdf153613_textboxAfterPgBreak.docx")
@@ -362,7 +362,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf153613_textboxAfterPgBreak, "tdf153613_textboxAf
CPPUNIT_ASSERT_EQUAL(3, getParagraphs());
const auto& pLayout = parseLayoutDump();
- assertXPathContent(pLayout, "//page[2]/body/txt", "There should be no prior carriage return.");
+ assertXPathContent(pLayout, "//page[2]/body/txt"_ostr, "There should be no prior carriage return.");
}
DECLARE_OOXMLEXPORT_TEST(testTdf153613_textboxAfterPgBreak2, "tdf153613_textboxAfterPgBreak2.docx")
@@ -371,7 +371,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf153613_textboxAfterPgBreak2, "tdf153613_textboxA
CPPUNIT_ASSERT_EQUAL(2, getParagraphs());
const auto& pLayout = parseLayoutDump();
- assertXPathContent(pLayout, "//page[2]/body/txt", "There should be no prior carriage return.");
+ assertXPathContent(pLayout, "//page[2]/body/txt"_ostr, "There should be no prior carriage return.");
}
DECLARE_OOXMLEXPORT_TEST(testTdf153613_sdtAfterPgBreak, "tdf153613_sdtAfterPgBreak.docx")
@@ -509,11 +509,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148834_lineNumbering)
xmlDocUniquePtr pStylesXml = parseExport("word/styles.xml");
// user specified: do not include in line numbering
- assertXPath(pStylesXml, "//w:style[@w:styleId='Normal']/w:pPr/w:suppressLineNumbers", 1);
+ assertXPath(pStylesXml, "//w:style[@w:styleId='Normal']/w:pPr/w:suppressLineNumbers"_ostr, 1);
// even though it matches the parent style, these should always avoid showing line numbering
- assertXPath(pStylesXml, "//w:style[@w:styleId='Footer']/w:pPr/w:suppressLineNumbers", 1);
+ assertXPath(pStylesXml, "//w:style[@w:styleId='Footer']/w:pPr/w:suppressLineNumbers"_ostr, 1);
assertXPath(pStylesXml,
- "//w:style[@w:styleId='0NUMBERED']/w:pPr/w:suppressLineNumbers", "val", "0");
+ "//w:style[@w:styleId='0NUMBERED']/w:pPr/w:suppressLineNumbers"_ostr, "val"_ostr, "0");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf157598)
@@ -525,7 +525,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf157598)
// Without the fix in place, this test would have failed with
// - Expected: 0
// - Actual : 1
- assertXPath(pStylesXml, "//w:style[@w:styleId='Normal']/w:rPr/w:rtl", 0);
+ assertXPath(pStylesXml, "//w:style[@w:styleId='Normal']/w:rPr/w:rtl"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf76022_textboxWrap)
@@ -568,7 +568,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149551_mongolianVert)
// Without fix the orientation was vert="vert".
save("Office Open XML Text");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//wps:bodyPr", "vert", "mongolianVert");
+ assertXPath(pXmlDoc, "//wps:bodyPr"_ostr, "vert"_ostr, "mongolianVert");
}
DECLARE_OOXMLEXPORT_TEST(testTdf151912, "tdf151912.docx")
@@ -579,7 +579,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf151912, "tdf151912.docx")
if (!isExported())
return;
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//w:sdt//w:sdtPr/w:id", "val", "1802566103");
+ assertXPath(pXmlDoc, "//w:sdt//w:sdtPr/w:id"_ostr, "val"_ostr, "1802566103");
}
DECLARE_OOXMLEXPORT_TEST(testTdf147724, "tdf147724.docx")
@@ -587,11 +587,11 @@ DECLARE_OOXMLEXPORT_TEST(testTdf147724, "tdf147724.docx")
const auto& pLayout = parseLayoutDump();
// Ensure we load field value from external XML correctly (it was "HERUNTERLADEN")
- assertXPathContent(pLayout, "/root/page[1]/body/txt[1]", "Placeholder -> *ABC*");
+ assertXPathContent(pLayout, "/root/page[1]/body/txt[1]"_ostr, "Placeholder -> *ABC*");
// This SDT has no storage id, it is not an error, but content can be taken from any suitable XML
// There 2 variants possible, both are acceptable
- OUString sFieldResult = getXPathContent(pLayout, "/root/page[1]/body/txt[2]");
+ OUString sFieldResult = getXPathContent(pLayout, "/root/page[1]/body/txt[2]"_ostr);
CPPUNIT_ASSERT(sFieldResult == "Placeholder -> *HERUNTERLADEN*" || sFieldResult == "Placeholder -> *ABC*");
}
@@ -624,7 +624,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNumberPortionFormatFromODT)
// - Actual : 0
// - XPath '//w:pPr/w:rPr/w:sz' number of nodes is incorrect
// i.e. <w:sz> was missing under <w:pPr>'s <w:rPr>.
- assertXPath(pXmlDoc, "//w:pPr/w:rPr/w:sz", "val", "48");
+ assertXPath(pXmlDoc, "//w:pPr/w:rPr/w:sz"_ostr, "val"_ostr, "48");
}
CPPUNIT_TEST_FIXTURE(Test, testParaStyleCharPosition)
@@ -642,7 +642,7 @@ CPPUNIT_TEST_FIXTURE(Test, testParaStyleCharPosition)
// - Actual : 0
// - XPath '/w:styles/w:style[@w:styleId='Normal']/w:rPr/w:position' number of nodes is incorrect
// i.e. we wrote <w:vertAlign w:val="subscript"> instead of <w:position>.
- assertXPath(pXmlDoc, "/w:styles/w:style[@w:styleId='Normal']/w:rPr/w:position", "val", "-1");
+ assertXPath(pXmlDoc, "/w:styles/w:style[@w:styleId='Normal']/w:rPr/w:position"_ostr, "val"_ostr, "-1");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf150966_regularInset)
@@ -659,7 +659,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf150966_regularInset)
// and Word displays no text at all.
save("Office Open XML Text");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathAttrs(pXmlDoc, "//wps:bodyPr", { { "tIns", "179640" }, { "bIns", "360000" } });
+ assertXPathAttrs(pXmlDoc, "//wps:bodyPr"_ostr, { { "tIns", "179640" }, { "bIns", "360000" } });
}
CPPUNIT_TEST_FIXTURE(Test, testTdf152636_lostPageBreak)
@@ -690,7 +690,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtDuplicatedId)
// - Expected: 2
// - Actual : 4
// i.e. grab-bags introduced 2 unwanted duplicates.
- assertXPath(pXmlDoc, "//w:sdt", 2);
+ assertXPath(pXmlDoc, "//w:sdt"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(Test, testImageCropping)
@@ -717,9 +717,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf152200)
// Then make sure that fldChar with type 'end' goes prior to the at-char anchored fly.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- const int nRunsBeforeFldCharEnd = countXPathNodes(pXmlDoc, "//w:fldChar[@w:fldCharType='end']/preceding::w:r");
+ const int nRunsBeforeFldCharEnd = countXPathNodes(pXmlDoc, "//w:fldChar[@w:fldCharType='end']/preceding::w:r"_ostr);
CPPUNIT_ASSERT(nRunsBeforeFldCharEnd);
- const int nRunsBeforeAlternateContent = countXPathNodes(pXmlDoc, "//mc:AlternateContent/preceding::w:r");
+ const int nRunsBeforeAlternateContent = countXPathNodes(pXmlDoc, "//mc:AlternateContent/preceding::w:r"_ostr);
CPPUNIT_ASSERT(nRunsBeforeAlternateContent);
// Without the accompanying fix in place, this test would have failed with:
// - Expected greater than: 6
@@ -727,9 +727,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf152200)
CPPUNIT_ASSERT_GREATER(nRunsBeforeFldCharEnd, nRunsBeforeAlternateContent);
// Make sure we only have one paragraph in body, and only three field characters overall,
// located directly in runs of this paragraph
- assertXPath(pXmlDoc, "/w:document/w:body/w:p");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:fldChar", 3);
- assertXPath(pXmlDoc, "//w:fldChar", 3); // no field characters elsewhere
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:fldChar"_ostr, 3);
+ assertXPath(pXmlDoc, "//w:fldChar"_ostr, 3); // no field characters elsewhere
}
CPPUNIT_TEST_FIXTURE(Test, testTdf126477)
@@ -776,7 +776,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153104)
loadAndReload("tdf153104.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- OUString numId = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:numPr/w:numId", "val");
+ OUString numId = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:numPr/w:numId"_ostr, "val"_ostr);
xmlDocUniquePtr pXmlNum = parseExport("word/numbering.xml");
OString numPath = "/w:numbering/w:num[@w:numId='"
@@ -789,8 +789,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153104)
// - Expected: 1
// - Actual : 0
// - In <>, XPath '/w:numbering/w:num[@w:numId='3']/w:lvlOverride[@w:ilvl='0']/w:startOverride' number of nodes is incorrect
- assertXPath(pXmlNum, numPath + "w:lvlOverride[@w:ilvl='0']/w:startOverride", "val", "10");
- assertXPath(pXmlNum, numPath + "w:lvlOverride[@w:ilvl='1']/w:startOverride", "val", "1");
+ assertXPath(pXmlNum, numPath + "w:lvlOverride[@w:ilvl='0']/w:startOverride", "val"_ostr, "10");
+ assertXPath(pXmlNum, numPath + "w:lvlOverride[@w:ilvl='1']/w:startOverride", "val"_ostr, "1");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf153128)
@@ -798,7 +798,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153128)
loadAndReload("tdf153128.docx");
calcLayout();
sal_Int32 nFirstLineHeight
- = parseDump("/root/page/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion", "height")
+ = parseDump("/root/page/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr, "height"_ostr)
.toInt32();
CPPUNIT_ASSERT_GREATER(sal_Int32(0), nFirstLineHeight);
@@ -816,7 +816,7 @@ CPPUNIT_TEST_FIXTURE(Test, testExportingUnknownStyleInRedline)
// (maybe this is wrong, because Word does not do this).
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
assertXPath(pXmlDoc,
- "/w:document/w:body/w:p/w:pPr/w:pPrChange/w:pPr/w:pStyle[@w:val='UnknownStyle']");
+ "/w:document/w:body/w:p/w:pPr/w:pPrChange/w:pPr/w:pStyle[@w:val='UnknownStyle']"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf148026)
@@ -828,7 +828,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148026)
// - Actual : 0
// - In <>, XPath '//w:hyperlink' number of nodes is incorrect
// i.e. a HYPERLINK field was exported instead of the hyperlink XML element.
- assertXPath(pXmlDoc, "//w:hyperlink", "tgtFrame", "_self");
+ assertXPath(pXmlDoc, "//w:hyperlink"_ostr, "tgtFrame"_ostr, "_self");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf153664)
@@ -840,8 +840,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153664)
// Without the fix this was styleId='FigureIndex1' and name was "Figure Index 1"
// This led to style settings being reset when ToF was updated in Word
// TOF's paragraph style should be exported as "Table of Figures" as that's the default Word style name
- assertXPath(pXmlStyles, "/w:styles/w:style[12]", "styleId", "TableofFigures");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='TableofFigures']/w:name", "val", "Table of Figures");
+ assertXPath(pXmlStyles, "/w:styles/w:style[12]"_ostr, "styleId"_ostr, "TableofFigures");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='TableofFigures']/w:name"_ostr, "val"_ostr, "Table of Figures");
}
DECLARE_OOXMLEXPORT_TEST(testTdf124472_hyperlink, "tdf124472.docx")
@@ -867,13 +867,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf155736, "tdf155736_PageNumbers_footer.docx")
CPPUNIT_ASSERT_EQUAL(2, getPages());
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/footer");
- assertXPath(pXmlDoc, "/root/page[2]/footer");
+ assertXPath(pXmlDoc, "/root/page[1]/footer"_ostr);
+ assertXPath(pXmlDoc, "/root/page[2]/footer"_ostr);
//Without the fix in place, it would have failed with
//- Expected: Page * of *
//- Actual : Page of
- CPPUNIT_ASSERT_EQUAL(OUString("Page * of *"), parseDump("/root/page[1]/footer/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Page * of *"), parseDump("/root/page[2]/footer/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Page * of *"), parseDump("/root/page[1]/footer/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Page * of *"), parseDump("/root/page[2]/footer/txt/text()"_ostr));
}
DECLARE_OOXMLEXPORT_TEST(testTdf155903, "tdf155903.odt")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx
index 9006c8306f27..0c1d1a25fb35 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx
@@ -152,13 +152,16 @@ DECLARE_OOXMLEXPORT_TEST(testBnc891663, "bnc891663.docx")
{
// The image should be inside a cell, so the text in the following cell should be below it.
int imageTop
- = parseDump("/root/page/body/tab/row[1]/cell[2]/txt[1]/anchored/fly/infos/bounds", "top")
+ = parseDump("/root/page/body/tab/row[1]/cell[2]/txt[1]/anchored/fly/infos/bounds"_ostr,
+ "top"_ostr)
.toInt32();
int imageHeight
- = parseDump("/root/page/body/tab/row[1]/cell[2]/txt[1]/anchored/fly/infos/bounds", "height")
+ = parseDump("/root/page/body/tab/row[1]/cell[2]/txt[1]/anchored/fly/infos/bounds"_ostr,
+ "height"_ostr)
.toInt32();
int textNextRowTop
- = parseDump("/root/page/body/tab/row[2]/cell[1]/txt[1]/infos/bounds", "top").toInt32();
+ = parseDump("/root/page/body/tab/row[2]/cell[1]/txt[1]/infos/bounds"_ostr, "top"_ostr)
+ .toInt32();
CPPUNIT_ASSERT(textNextRowTop >= imageTop + imageHeight);
}
@@ -409,20 +412,23 @@ DECLARE_OOXMLEXPORT_TEST(testTdf95377, "tdf95377.docx")
//default style has numbering enabled. Styles inherit numbering unless specifically disabled
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
assertXPath(pXmlDoc,
- "//body/txt/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']",
+ "//body/txt/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']"_ostr,
3); //first three paragraphs have numbering
- assertXPath(pXmlDoc,
- "//body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']",
- "expand", "a.");
- assertXPath(pXmlDoc,
- "//body/txt[2]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']",
- "expand", "b.");
- assertXPath(pXmlDoc,
- "//body/txt[3]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']",
- "expand", "c.");
assertXPath(
pXmlDoc,
- "/root/page/body/txt[4]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']",
+ "//body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']"_ostr,
+ "expand"_ostr, "a.");
+ assertXPath(
+ pXmlDoc,
+ "//body/txt[2]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']"_ostr,
+ "expand"_ostr, "b.");
+ assertXPath(
+ pXmlDoc,
+ "//body/txt[3]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']"_ostr,
+ "expand"_ostr, "c.");
+ assertXPath(
+ pXmlDoc,
+ "/root/page/body/txt[4]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']"_ostr,
0); //last paragraph style disables numbering
}
@@ -661,8 +667,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTableMarginAdjustment)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//w:tbl[1]/w:tblPr[1]/w:tblInd[1]", "type", "dxa");
- assertXPath(pXmlDoc, "//w:tbl[1]/w:tblPr[1]/w:tblInd[1]", "w", "0");
+ assertXPath(pXmlDoc, "//w:tbl[1]/w:tblPr[1]/w:tblInd[1]"_ostr, "type"_ostr, "dxa");
+ assertXPath(pXmlDoc, "//w:tbl[1]/w:tblPr[1]/w:tblInd[1]"_ostr, "w"_ostr, "0");
// tdf#143982: automatic tables should export as something better than just left-and-size
CPPUNIT_ASSERT_EQUAL(sal_Int16(100), getProperty<sal_Int16>(xTable, "RelativeWidth"));
@@ -674,10 +680,10 @@ DECLARE_OOXMLEXPORT_TEST(testTdf119760_tableInTablePosition, "tdf119760_tableInT
{
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]/w:tblPr[1]/w:tblInd[1]", "type",
- "dxa");
- assertXPath(pXmlDoc, "//w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]//w:tblPr[1]/w:tblInd[1]", "w",
- "0");
+ assertXPath(pXmlDoc, "//w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]/w:tblPr[1]/w:tblInd[1]"_ostr,
+ "type"_ostr, "dxa");
+ assertXPath(pXmlDoc, "//w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]//w:tblPr[1]/w:tblInd[1]"_ostr,
+ "w"_ostr, "0");
}
uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
@@ -746,8 +752,8 @@ CPPUNIT_TEST_FIXTURE(Test, TestPuzzleExport)
auto pMetaXml = dumpAndParse(aDumper, *pMeta);
CPPUNIT_ASSERT(pMetaXml);
// After parsing check that node...
- auto pXNode
- = getXPathNode(pMetaXml, "/metafile/push/push/push/push[4]/push/push/polypolygon/polygon");
+ auto pXNode = getXPathNode(
+ pMetaXml, "/metafile/push/push/push/push[4]/push/push/polypolygon/polygon"_ostr);
CPPUNIT_ASSERT(pXNode);
auto pNode = pXNode->nodesetval->nodeTab[0];
CPPUNIT_ASSERT(pNode);
@@ -847,7 +853,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf77236_MissingSolidFill)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
assertXPath(
pXmlDoc,
- "//mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:solidFill",
+ "//mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:solidFill"_ostr,
1);
}
@@ -898,10 +904,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133363)
loadAndSave("tdf133363.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// tdf#133363: remove extra auto space between first and second list elements
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p[2]/w:pPr/w:spacing", "before",
- "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p[3]/w:pPr/w:spacing", "after",
- "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p[2]/w:pPr/w:spacing"_ostr,
+ "before"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p[3]/w:pPr/w:spacing"_ostr,
+ "after"_ostr, "0");
}
DECLARE_OOXMLEXPORT_TEST(testTdf138093, "tdf138093.docx")
@@ -909,7 +915,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf138093, "tdf138093.docx")
if (isExported())
{
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//w:sdt", 3);
+ assertXPath(pXmlDoc, "//w:sdt"_ostr, 3);
uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(),
uno::UNO_QUERY);
@@ -962,7 +968,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf131722, "tdf131722.docx")
if (isExported())
{
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//w:sdt", 4);
+ assertXPath(pXmlDoc, "//w:sdt"_ostr, 4);
uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(),
uno::UNO_QUERY);
@@ -1051,14 +1057,15 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf150408_isLvl_RoundTrip)
CPPUNIT_ASSERT_EQUAL(OUString("Sect 2.01"), getProperty<OUString>(xPara, "ListLabelString"));
xmlDocUniquePtr pXml = parseExport("word/numbering.xml");
- assertXPath(pXml, "/w:numbering/w:abstractNum"); // Only one list
+ assertXPath(pXml, "/w:numbering/w:abstractNum"_ostr); // Only one list
// The second list level must keep the isLgl element
- assertXPath(pXml, "/w:numbering/w:abstractNum/w:lvl[2]/w:isLgl");
+ assertXPath(pXml, "/w:numbering/w:abstractNum/w:lvl[2]/w:isLgl"_ostr);
}
DECLARE_OOXMLEXPORT_TEST(testTdf156372, "tdf156372.doc")
{
- sal_Int32 nHeight = parseDump("//page[1]/header/tab/row[1]/infos/bounds", "height").toInt32();
+ sal_Int32 nHeight
+ = parseDump("//page[1]/header/tab/row[1]/infos/bounds"_ostr, "height"_ostr).toInt32();
// Without a fix in place, this would fail with
// - Expected: 847
// - Actual : 1327
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
index eab98f97b2f7..de3d073d9900 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
@@ -63,65 +63,65 @@ CPPUNIT_TEST_FIXTURE(Test, testCustomProperties)
// Extended file properties - specific to Office package,
// eg. docx - Number of Pages, pptx - Number of Slides
xmlDocUniquePtr pXmlDoc = parseExport("docProps/app.xml");
- assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Paragraphs", "1");
+ assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Paragraphs"_ostr, "1");
//assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Lines", "1");
- assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Pages", "1");
- assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Words", "3");
- assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Characters", "22");
- assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:CharactersWithSpaces", "24");
- assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Company", "hhhhkompany");
- assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Manager", "ffffmenadzer;iiiiisecondmanager");
- assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:HyperlinkBase", "gggghiperlink");
+ assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Pages"_ostr, "1");
+ assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Words"_ostr, "3");
+ assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Characters"_ostr, "22");
+ assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:CharactersWithSpaces"_ostr, "24");
+ assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Company"_ostr, "hhhhkompany");
+ assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Manager"_ostr, "ffffmenadzer;iiiiisecondmanager");
+ assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:HyperlinkBase"_ostr, "gggghiperlink");
//assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:DocSecurity", "2");
- assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:AppVersion", "15.0000");
+ assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:AppVersion"_ostr, "15.0000");
// Custom file properties - defined by user
xmlDocUniquePtr pCustomXml = parseExport("docProps/custom.xml");
- assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property", 9);
- assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[1]",
- "name", "testDateProperty");
- assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[1]/vt:filetime",
+ assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property"_ostr, 9);
+ assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[1]"_ostr,
+ "name"_ostr, "testDateProperty");
+ assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[1]/vt:filetime"_ostr,
"1982-04-19T10:00:00Z");
- assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[3]",
- "name", "testNegativeNumberProperty");
- assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[3]/vt:r8",
+ assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[3]"_ostr,
+ "name"_ostr, "testNegativeNumberProperty");
+ assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[3]/vt:r8"_ostr,
"-100");
- assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[4]",
- "name", "testNumberProperty");
+ assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[4]"_ostr,
+ "name"_ostr, "testNumberProperty");
//assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[4]/vt:i4",
// "256");
- assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[5]",
- "name", "testRealNumberProperty");
- assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[5]/vt:r8",
+ assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[5]"_ostr,
+ "name"_ostr, "testRealNumberProperty");
+ assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[5]/vt:r8"_ostr,
"-128.1");
- assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[6]",
- "name", "testScientificNumber");
- assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[6]/vt:r8",
+ assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[6]"_ostr,
+ "name"_ostr, "testScientificNumber");
+ assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[6]/vt:r8"_ostr,
"1.23456789E+023");
- assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[7]",
- "name", "testTextProperty");
- assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[7]/vt:lpwstr",
+ assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[7]"_ostr,
+ "name"_ostr, "testTextProperty");
+ assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[7]/vt:lpwstr"_ostr,
"testPropertyValue");
- assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[8]",
- "name", "testYesNoProperty");
- assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[8]/vt:bool",
+ assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[8]"_ostr,
+ "name"_ostr, "testYesNoProperty");
+ assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[8]/vt:bool"_ostr,
"1");
// Hidden Custom File Property. With Final set, MS Office notifies recipients that the document is final, and sets the document to read-only.
- assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[9]",
- "name", "_MarkAsFinal");
- assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[9]/vt:bool",
+ assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[9]"_ostr,
+ "name"_ostr, "_MarkAsFinal");
+ assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[9]/vt:bool"_ostr,
"1");
// Core file properties - common for all packages (eg. creation date, modify date)
pXmlDoc = parseExport("docProps/core.xml");
- assertXPathContent(pXmlDoc, "/cp:coreProperties/dc:creator", "Bartosz Kosiorek;secondauthor");
- assertXPathContent(pXmlDoc, "/cp:coreProperties/dc:description", "cccckomentarzglowny");
- assertXPathContent(pXmlDoc, "/cp:coreProperties/cp:lastPrinted", "2020-10-15T07:42:00Z");
- assertXPathContent(pXmlDoc, "/cp:coreProperties/dcterms:created", "2020-10-14T16:23:00Z");
- assertXPathContent(pXmlDoc, "/cp:coreProperties/cp:category", "eeeetokategoria");
- assertXPathContent(pXmlDoc, "/cp:coreProperties/cp:version", "xxxxversion");
- assertXPathContent(pXmlDoc, "/cp:coreProperties/cp:contentStatus", "ddddstatusnieznany");
- assertXPathContent(pXmlDoc, "/cp:coreProperties/dc:identifier", "zzzzidentifier");
+ assertXPathContent(pXmlDoc, "/cp:coreProperties/dc:creator"_ostr, "Bartosz Kosiorek;secondauthor");
+ assertXPathContent(pXmlDoc, "/cp:coreProperties/dc:description"_ostr, "cccckomentarzglowny");
+ assertXPathContent(pXmlDoc, "/cp:coreProperties/cp:lastPrinted"_ostr, "2020-10-15T07:42:00Z");
+ assertXPathContent(pXmlDoc, "/cp:coreProperties/dcterms:created"_ostr, "2020-10-14T16:23:00Z");
+ assertXPathContent(pXmlDoc, "/cp:coreProperties/cp:category"_ostr, "eeeetokategoria");
+ assertXPathContent(pXmlDoc, "/cp:coreProperties/cp:version"_ostr, "xxxxversion");
+ assertXPathContent(pXmlDoc, "/cp:coreProperties/cp:contentStatus"_ostr, "ddddstatusnieznany");
+ assertXPathContent(pXmlDoc, "/cp:coreProperties/dc:identifier"_ostr, "zzzzidentifier");
}
DECLARE_OOXMLEXPORT_TEST(testUTF8CustomProperties, "tdf127864.docx")
@@ -163,14 +163,14 @@ DECLARE_OOXMLEXPORT_TEST(testZoom, "zoom.docx")
validate(maTempFile.GetFileName(), test::OOXML);
xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml");
// Order was: rsid, next.
- int nNext = getXPathPosition(pXmlDoc, "/w:styles/w:style[3]", "next");
- int nRsid = getXPathPosition(pXmlDoc, "/w:styles/w:style[3]", "rsid");
+ int nNext = getXPathPosition(pXmlDoc, "/w:styles/w:style[3]"_ostr, "next");
+ int nRsid = getXPathPosition(pXmlDoc, "/w:styles/w:style[3]"_ostr, "rsid");
CPPUNIT_ASSERT(nNext < nRsid);
pXmlDoc = parseExport("docProps/app.xml");
// One paragraph in the document.
- assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Paragraphs", "1");
- assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Company", "Example Ltd");
+ assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Paragraphs"_ostr, "1");
+ assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Company"_ostr, "Example Ltd");
}
CPPUNIT_TEST_FIXTURE(Test, defaultTabStopNotInStyles)
@@ -404,7 +404,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTable)
// Make sure we write qFormat for well-known style names.
xmlDocUniquePtr pXmlDocCT = parseExport("word/styles.xml");
CPPUNIT_ASSERT(pXmlDocCT);
- assertXPath(pXmlDocCT, "//w:style[@w:styleId='Normal']/w:qFormat", 1);
+ assertXPath(pXmlDocCT, "//w:style[@w:styleId='Normal']/w:qFormat"_ostr, 1);
}
namespace {
@@ -497,19 +497,19 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo51550)
if (!pXmlDocCT)
return; // initial import
- assertXPath(pXmlDocCT, "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/oleObject1.xlsx']", "ContentType", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
+ assertXPath(pXmlDocCT, "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/oleObject1.xlsx']"_ostr, "ContentType"_ostr, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
// check the rels too
xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels");
assertXPath(pXmlDocRels,
- "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.xlsx']",
- "Type",
+ "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.xlsx']"_ostr,
+ "Type"_ostr,
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
// check the content too
xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml");
assertXPath(pXmlDocContent,
- "/w:document/w:body/w:p/w:r/w:object/o:OLEObject",
- "ProgID",
+ "/w:document/w:body/w:p/w:r/w:object/o:OLEObject"_ostr,
+ "ProgID"_ostr,
"Excel.Sheet.12");
}
@@ -615,7 +615,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCellBtlr)
*/
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:textDirection", "val", "btLr");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:textDirection"_ostr, "val"_ostr, "btLr");
}
DECLARE_OOXMLEXPORT_TEST(testTableStylerPrSz, "table-style-rPr-sz.docx")
@@ -691,7 +691,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo64826, "fdo64826.docx")
if (isExported())
{
xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml");
- assertXPath(pXmlSettings, "/w:settings/w:revisionView", 0);
+ assertXPath(pXmlSettings, "/w:settings/w:revisionView"_ostr, 0);
}
}
@@ -889,7 +889,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo66543, "fdo66543.docx")
// ensure unnecessary suppressLineNumbers entry is not created.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//w:p[1]/w:pPr/w:suppressLineNumbers", 0);
+ assertXPath(pXmlDoc, "//w:p[1]/w:pPr/w:suppressLineNumbers"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testN822175)
@@ -980,26 +980,26 @@ CPPUNIT_TEST_FIXTURE(Test, testPageBorderSpacingExportCase2)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Assert the XPath expression - page borders
- assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgBorders", "offsetFrom", "page");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgBorders"_ostr, "offsetFrom"_ostr, "page");
// Assert the XPath expression - 'left' border
- assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgBorders/w:left", "space", "24");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgBorders/w:left"_ostr, "space"_ostr, "24");
// Assert the XPath expression - 'right' border
- assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgBorders/w:right", "space", "24");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgBorders/w:right"_ostr, "space"_ostr, "24");
}
DECLARE_OOXMLEXPORT_TEST(testFdo66145, "fdo66145.docx")
{
// The Writer ignored the 'First Is Shared' flag
CPPUNIT_ASSERT_EQUAL(OUString("This is the FIRST page header."),
- parseDump("/root/page[1]/header/txt/text()"));
+ parseDump("/root/page[1]/header/txt/text()"_ostr));
CPPUNIT_ASSERT_EQUAL(
OUString("This is the header for the REST OF THE FILE."),
- parseDump("/root/page[2]/header/txt/text()"));
+ parseDump("/root/page[2]/header/txt/text()"_ostr));
CPPUNIT_ASSERT_EQUAL(
OUString("This is the header for the REST OF THE FILE."),
- parseDump("/root/page[3]/header/txt/text()"));
+ parseDump("/root/page[3]/header/txt/text()"_ostr));
}
CPPUNIT_TEST_FIXTURE(Test, testGrabBag)
@@ -1007,7 +1007,7 @@ CPPUNIT_TEST_FIXTURE(Test, testGrabBag)
loadAndSave("grabbag.docx");
// w:mirrorIndents was lost on roundtrip, now should be handled as a grab bag property
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:mirrorIndents");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:mirrorIndents"_ostr);
}
DECLARE_OOXMLEXPORT_TEST(testFdo66781, "fdo66781.docx")
@@ -1195,9 +1195,9 @@ CPPUNIT_TEST_FIXTURE(Test, NoFillAttrInImagedata)
//source file has v:fill and no v:imagedata. Same should be in the file written by LO.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Fallback/w:pict/v:rect/v:imagedata", 0);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Fallback/w:pict/v:rect/v:fill", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Fallback/w:pict/v:rect/v:fill", "type", "tile");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Fallback/w:pict/v:rect/v:imagedata"_ostr, 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Fallback/w:pict/v:rect/v:fill"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Fallback/w:pict/v:rect/v:fill"_ostr, "type"_ostr, "tile");
}
DECLARE_OOXMLEXPORT_TEST(testBnc837302, "bnc837302.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx
index a8aca5ceb93a..8b5f6cab824b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx
@@ -35,18 +35,19 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo79969_xlsb)
assertXPath(pXmlDoc,
"/ContentType:Types/ContentType:Override[@ContentType='application/"
- "vnd.ms-excel.sheet.binary.macroEnabled.12']",
- "PartName", "/word/embeddings/oleObject1.xlsb");
+ "vnd.ms-excel.sheet.binary.macroEnabled.12']"_ostr,
+ "PartName"_ostr, "/word/embeddings/oleObject1.xlsb");
// check the rels too
xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels");
- assertXPath(
- pXmlDocRels, "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.xlsb']",
- "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
+ assertXPath(pXmlDocRels,
+ "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.xlsb']"_ostr,
+ "Type"_ostr,
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
// check the content too
xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml");
- assertXPath(pXmlDocContent, "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject", "ProgID",
- "Excel.SheetBinaryMacroEnabled.12");
+ assertXPath(pXmlDocContent, "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject"_ostr,
+ "ProgID"_ostr, "Excel.SheetBinaryMacroEnabled.12");
}
CPPUNIT_TEST_FIXTURE(Test, testfdo80097)
@@ -59,45 +60,45 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo80097)
//Table Cell Borders
assertXPath(pXmlDocument,
"/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/"
- "w:top[@w:val = 'single']",
+ "w:top[@w:val = 'single']"_ostr,
1);
assertXPath(pXmlDocument,
"/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/"
- "w:top[@w:sz = 4]",
+ "w:top[@w:sz = 4]"_ostr,
1);
assertXPath(pXmlDocument,
"/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/"
- "w:top[@w:space = 0]",
+ "w:top[@w:space = 0]"_ostr,
1);
assertXPath(pXmlDocument,
"/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/"
- "w:top[@w:color = '000000']",
+ "w:top[@w:color = '000000']"_ostr,
1);
assertXPath(pXmlDocument,
"/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/"
- "w:bottom[@w:val = 'single']",
+ "w:bottom[@w:val = 'single']"_ostr,
1);
assertXPath(pXmlDocument,
"/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/"
- "w:bottom[@w:sz = 4]",
+ "w:bottom[@w:sz = 4]"_ostr,
1);
assertXPath(pXmlDocument,
"/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/"
- "w:bottom[@w:space = 0]",
+ "w:bottom[@w:space = 0]"_ostr,
1);
assertXPath(pXmlDocument,
"/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/"
- "w:bottom[@w:color = '000000']",
+ "w:bottom[@w:color = '000000']"_ostr,
1);
assertXPath(pXmlDocument,
"/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/"
- "w:insideH",
+ "w:insideH"_ostr,
0);
assertXPath(pXmlDocument,
"/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/"
- "w:insideV",
+ "w:insideV"_ostr,
0);
}
@@ -111,22 +112,28 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf95033)
//Not disabled table cell borders
assertXPath(
pXmlDocument,
- "/w:document/w:body/w:tbl/w:tr[5]/w:tc[1]/w:tcPr/w:tcBorders/w:start[@w:val = 'nil']", 0);
- assertXPath(pXmlDocument,
- "/w:document/w:body/w:tbl/w:tr[5]/w:tc[2]/w:tcPr/w:tcBorders/w:end[@w:val = 'nil']",
- 0);
+ "/w:document/w:body/w:tbl/w:tr[5]/w:tc[1]/w:tcPr/w:tcBorders/w:start[@w:val = 'nil']"_ostr,
+ 0);
assertXPath(
pXmlDocument,
- "/w:document/w:body/w:tbl/w:tr[9]/w:tc[1]/w:tcPr/w:tcBorders/w:start[@w:val = 'nil']", 0);
- assertXPath(pXmlDocument,
- "/w:document/w:body/w:tbl/w:tr[9]/w:tc[2]/w:tcPr/w:tcBorders/w:end[@w:val = 'nil']",
- 0);
+ "/w:document/w:body/w:tbl/w:tr[5]/w:tc[2]/w:tcPr/w:tcBorders/w:end[@w:val = 'nil']"_ostr,
+ 0);
assertXPath(
pXmlDocument,
- "/w:document/w:body/w:tbl/w:tr[9]/w:tc[1]/w:tcPr/w:tcBorders/w:bottom[@w:val = 'nil']", 0);
+ "/w:document/w:body/w:tbl/w:tr[9]/w:tc[1]/w:tcPr/w:tcBorders/w:start[@w:val = 'nil']"_ostr,
+ 0);
assertXPath(
pXmlDocument,
- "/w:document/w:body/w:tbl/w:tr[9]/w:tc[2]/w:tcPr/w:tcBorders/w:bottom[@w:val = 'nil']", 0);
+ "/w:document/w:body/w:tbl/w:tr[9]/w:tc[2]/w:tcPr/w:tcBorders/w:end[@w:val = 'nil']"_ostr,
+ 0);
+ assertXPath(
+ pXmlDocument,
+ "/w:document/w:body/w:tbl/w:tr[9]/w:tc[1]/w:tcPr/w:tcBorders/w:bottom[@w:val = 'nil']"_ostr,
+ 0);
+ assertXPath(
+ pXmlDocument,
+ "/w:document/w:body/w:tbl/w:tr[9]/w:tc[2]/w:tcPr/w:tcBorders/w:bottom[@w:val = 'nil']"_ostr,
+ 0);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf133455)
@@ -135,30 +142,38 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133455)
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
//Not disabled table cell borders
- assertXPath(pXmlDocument,
- "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:top[@w:val = 'nil']",
- 0);
assertXPath(
pXmlDocument,
- "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:start[@w:val = 'nil']", 0);
- assertXPath(pXmlDocument,
- "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:end[@w:val = 'nil']",
- 0);
+ "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:top[@w:val = 'nil']"_ostr,
+ 0);
assertXPath(
pXmlDocument,
- "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:tcBorders/w:start[@w:val = 'nil']", 0);
- assertXPath(pXmlDocument,
- "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:tcBorders/w:end[@w:val = 'nil']",
- 0);
+ "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:start[@w:val = 'nil']"_ostr,
+ 0);
+ assertXPath(
+ pXmlDocument,
+ "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:end[@w:val = 'nil']"_ostr,
+ 0);
+ assertXPath(
+ pXmlDocument,
+ "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:tcBorders/w:start[@w:val = 'nil']"_ostr,
+ 0);
assertXPath(
pXmlDocument,
- "/w:document/w:body/w:tbl/w:tr[11]/w:tc[1]/w:tcPr/w:tcBorders/w:start[@w:val = 'nil']", 0);
+ "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:tcBorders/w:end[@w:val = 'nil']"_ostr,
+ 0);
assertXPath(
pXmlDocument,
- "/w:document/w:body/w:tbl/w:tr[11]/w:tc[1]/w:tcPr/w:tcBorders/w:end[@w:val = 'nil']", 0);
+ "/w:document/w:body/w:tbl/w:tr[11]/w:tc[1]/w:tcPr/w:tcBorders/w:start[@w:val = 'nil']"_ostr,
+ 0);
assertXPath(
pXmlDocument,
- "/w:document/w:body/w:tbl/w:tr[11]/w:tc[1]/w:tcPr/w:tcBorders/w:bottom[@w:val = 'nil']", 0);
+ "/w:document/w:body/w:tbl/w:tr[11]/w:tc[1]/w:tcPr/w:tcBorders/w:end[@w:val = 'nil']"_ostr,
+ 0);
+ assertXPath(
+ pXmlDocument,
+ "/w:document/w:body/w:tbl/w:tr[11]/w:tc[1]/w:tcPr/w:tcBorders/w:bottom[@w:val = 'nil']"_ostr,
+ 0);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf138612)
@@ -167,18 +182,18 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf138612)
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
// Row 5 Col 1 - vertically merged cell
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[5]/w:tc[1]/w:tcPr/w:vMerge", "val",
- "restart");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[5]/w:tc[1]/w:tcPr/w:vMerge"_ostr,
+ "val"_ostr, "restart");
// Row 5 Col 2 - split cell
// This was w:vMerge="restart"
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[5]/w:tc[2]/w:tcPr/w:vMerge", 0);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[5]/w:tc[2]/w:tcPr/w:vMerge"_ostr, 0);
// Row 6 Col 1 - merged with cell in Row 5 Col 1
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[6]/w:tc[1]/w:tcPr/w:vMerge", "val",
- "continue");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[6]/w:tc[1]/w:tcPr/w:vMerge"_ostr,
+ "val"_ostr, "continue");
// Row 6 Col 2 - split cell
// This was w:vMerge="continue" (merged with cell in Row 5 Col 2)
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[6]/w:tc[2]/w:tcPr/w:vMerge", 0);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[6]/w:tc[2]/w:tcPr/w:vMerge"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf140597)
@@ -187,15 +202,18 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf140597)
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
// There were missing tblPrEx table exception borders
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:tcBorders/w:top");
assertXPath(pXmlDocument,
- "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:tcBorders/w:start");
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[1]/w:tcPr/w:tcBorders/w:top");
+ "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:tcBorders/w:top"_ostr);
+ assertXPath(pXmlDocument,
+ "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:tcBorders/w:start"_ostr);
+ assertXPath(pXmlDocument,
+ "/w:document/w:body/w:tbl/w:tr[3]/w:tc[1]/w:tcPr/w:tcBorders/w:top"_ostr);
+ assertXPath(pXmlDocument,
+ "/w:document/w:body/w:tbl/w:tr[3]/w:tc[1]/w:tcPr/w:tcBorders/w:start"_ostr);
assertXPath(pXmlDocument,
- "/w:document/w:body/w:tbl/w:tr[3]/w:tc[1]/w:tcPr/w:tcBorders/w:start");
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[1]/w:tcPr/w:tcBorders/w:top");
+ "/w:document/w:body/w:tbl/w:tr[4]/w:tc[1]/w:tcPr/w:tcBorders/w:top"_ostr);
assertXPath(pXmlDocument,
- "/w:document/w:body/w:tbl/w:tr[4]/w:tc[1]/w:tcPr/w:tcBorders/w:start");
+ "/w:document/w:body/w:tbl/w:tr[4]/w:tc[1]/w:tcPr/w:tcBorders/w:start"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf128646)
@@ -204,14 +222,15 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128646)
// The problem was that not hidden shapes anchored to empty hidden paragraphs were imported as hidden.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p[7]/w:pPr/w:rPr/w:vanish", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p[7]/w:pPr/w:rPr/w:vanish"_ostr, 1);
if (!isExported())
// originally no <w:vanish> (the same as <w:vanish val="false">)
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p[7]/w:r/w:rPr/w:vanish", 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p[7]/w:r/w:rPr/w:vanish"_ostr,
+ 0);
else
// This was hidden (<w:vanish/>)
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p[7]/w:r/w:rPr/w:vanish", "val",
- "false");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p[7]/w:r/w:rPr/w:vanish"_ostr,
+ "val"_ostr, "false");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf119800)
@@ -221,13 +240,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf119800)
// (tdf#128646 solved the same only for table paragraphs)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:vanish", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:vanish"_ostr, 1);
if (!isExported())
// originally no <w:vanish> (the same as <w:vanish val="false">)
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:rPr/w:vanish", 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:rPr/w:vanish"_ostr, 0);
else
// This was hidden (<w:vanish/>)
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:rPr/w:vanish", "val", "false");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:rPr/w:vanish"_ostr, "val"_ostr,
+ "false");
}
CPPUNIT_TEST_FIXTURE(Test, testFdo77129)
@@ -237,7 +257,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo77129)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Data was lost from this paragraph.
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:t", "Abstract");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:t"_ostr, "Abstract");
}
// Test the same testdoc used for testFdo77129.
@@ -275,18 +295,19 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo79969_xlsm)
assertXPath(pXmlDoc,
"/ContentType:Types/ContentType:Override[@ContentType='application/"
- "vnd.ms-excel.sheet.macroEnabled.12']",
- "PartName", "/word/embeddings/oleObject1.xlsm");
+ "vnd.ms-excel.sheet.macroEnabled.12']"_ostr,
+ "PartName"_ostr, "/word/embeddings/oleObject1.xlsm");
// check the rels too
xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels");
- assertXPath(
- pXmlDocRels, "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.xlsm']",
- "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
+ assertXPath(pXmlDocRels,
+ "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.xlsm']"_ostr,
+ "Type"_ostr,
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
// check the content too
xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml");
- assertXPath(pXmlDocContent, "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject", "ProgID",
- "Excel.SheetMacroEnabled.12");
+ assertXPath(pXmlDocContent, "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject"_ostr,
+ "ProgID"_ostr, "Excel.SheetMacroEnabled.12");
}
CPPUNIT_TEST_FIXTURE(Test, testfdo80522)
@@ -296,18 +317,19 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo80522)
assertXPath(pXmlDoc,
"/ContentType:Types/ContentType:Override[@ContentType='application/"
- "vnd.ms-word.document.macroEnabled.12']",
- "PartName", "/word/embeddings/oleObject1.docm");
+ "vnd.ms-word.document.macroEnabled.12']"_ostr,
+ "PartName"_ostr, "/word/embeddings/oleObject1.docm");
// check the rels too
xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels");
- assertXPath(
- pXmlDocRels, "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.docm']",
- "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
+ assertXPath(pXmlDocRels,
+ "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.docm']"_ostr,
+ "Type"_ostr,
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
// check the content too
xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml");
- assertXPath(pXmlDocContent, "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject", "ProgID",
- "Word.DocumentMacroEnabled.12");
+ assertXPath(pXmlDocContent, "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject"_ostr,
+ "ProgID"_ostr, "Word.DocumentMacroEnabled.12");
}
CPPUNIT_TEST_FIXTURE(Test, testfdo80523_pptm)
@@ -317,18 +339,19 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo80523_pptm)
assertXPath(pXmlDoc,
"/ContentType:Types/ContentType:Override[@ContentType='application/"
- "vnd.ms-powerpoint.presentation.macroEnabled.12']",
- "PartName", "/word/embeddings/oleObject1.pptm");
+ "vnd.ms-powerpoint.presentation.macroEnabled.12']"_ostr,
+ "PartName"_ostr, "/word/embeddings/oleObject1.pptm");
// check the rels too
xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels");
- assertXPath(
- pXmlDocRels, "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.pptm']",
- "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
+ assertXPath(pXmlDocRels,
+ "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.pptm']"_ostr,
+ "Type"_ostr,
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
// check the content too
xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml");
- assertXPath(pXmlDocContent, "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject", "ProgID",
- "PowerPoint.ShowMacroEnabled.12");
+ assertXPath(pXmlDocContent, "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject"_ostr,
+ "ProgID"_ostr, "PowerPoint.ShowMacroEnabled.12");
}
CPPUNIT_TEST_FIXTURE(Test, testfdo80523_sldm)
@@ -338,18 +361,19 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo80523_sldm)
assertXPath(pXmlDoc,
"/ContentType:Types/ContentType:Override[@ContentType='application/"
- "vnd.ms-powerpoint.slide.macroEnabled.12']",
- "PartName", "/word/embeddings/oleObject1.sldm");
+ "vnd.ms-powerpoint.slide.macroEnabled.12']"_ostr,
+ "PartName"_ostr, "/word/embeddings/oleObject1.sldm");
// check the rels too
xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels");
- assertXPath(
- pXmlDocRels, "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.sldm']",
- "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
+ assertXPath(pXmlDocRels,
+ "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.sldm']"_ostr,
+ "Type"_ostr,
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
// check the content too
xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml");
- assertXPath(pXmlDocContent, "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject", "ProgID",
- "PowerPoint.SlideMacroEnabled.12");
+ assertXPath(pXmlDocContent, "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject"_ostr,
+ "ProgID"_ostr, "PowerPoint.SlideMacroEnabled.12");
}
CPPUNIT_TEST_FIXTURE(Test, testfdo80898)
@@ -359,26 +383,27 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo80898)
xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml");
assertXPath(pXmlDoc,
- "/ContentType:Types/ContentType:Override[@ContentType='application/msword']",
- "PartName", "/word/embeddings/oleObject1.doc");
+ "/ContentType:Types/ContentType:Override[@ContentType='application/msword']"_ostr,
+ "PartName"_ostr, "/word/embeddings/oleObject1.doc");
// check the rels too
xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels");
- assertXPath(
- pXmlDocRels, "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.doc']",
- "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject");
+ assertXPath(pXmlDocRels,
+ "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.doc']"_ostr,
+ "Type"_ostr,
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject");
// check the content too
xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml");
- assertXPath(pXmlDocContent, "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject", "ProgID",
- "Word.Document.8");
+ assertXPath(pXmlDocContent, "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject"_ostr,
+ "ProgID"_ostr, "Word.Document.8");
}
CPPUNIT_TEST_FIXTURE(Test, testOleIconDrawAspect)
{
loadAndSave("tdf131537.odt");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object/o:OLEObject", "DrawAspect",
- "Icon");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object/o:OLEObject"_ostr,
+ "DrawAspect"_ostr, "Icon");
}
CPPUNIT_TEST_FIXTURE(Test, testTableCellWithDirectFormatting)
@@ -391,8 +416,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTableCellWithDirectFormatting)
// Ensure that for Third Table cell Direct Formatting is preserved.
// In file, Direct Formatting used for Third Table cell is Line Spacing="1.5 lines"
// For Line Spacing "1.5 lines" w:line equals 360
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[3]/w:p/w:pPr/w:spacing", "line",
- "360");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[3]/w:p/w:pPr/w:spacing"_ostr,
+ "line"_ostr, "360");
}
DECLARE_OOXMLEXPORT_TEST(testFdo80800b_tableStyle, "fdo80800b_tableStyle.docx")
@@ -478,8 +503,8 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo83048)
// Make sure Date is inside SDT tag.
// This will happen only if right SDT properties are exported.
- assertXPathContent(pXmlDoc, "/w:ftr/w:sdt/w:sdtContent/w:p[1]/w:sdt/w:sdtContent/w:r[2]/w:t",
- "1/2/2013");
+ assertXPathContent(
+ pXmlDoc, "/w:ftr/w:sdt/w:sdtContent/w:p[1]/w:sdt/w:sdtContent/w:r[2]/w:t"_ostr, "1/2/2013");
}
CPPUNIT_TEST_FIXTURE(Test, testSdt2Run)
@@ -488,9 +513,10 @@ CPPUNIT_TEST_FIXTURE(Test, testSdt2Run)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// The problem was that <w:sdt> was closed after "first", not after "second", so the second assert failed.
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:t", "firstsecond");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:t"_ostr,
+ "firstsecond");
// Make sure the third portion is still outside <w:sdt>.
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/w:t", "third");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/w:t"_ostr, "third");
}
CPPUNIT_TEST_FIXTURE(Test, testFD083057)
@@ -504,8 +530,8 @@ CPPUNIT_TEST_FIXTURE(Test, testFD083057)
// one for a separate run as expected, and one incorrectly exported in the alternateContent (FLYFRAME)
// Assert that the file has only one sdt, in a separate run
- assertXPath(pXmlDoc, "//w:sdt", 1);
- assertXPath(pXmlDoc, "//mc:AlternateContent//w:sdt", 0);
+ assertXPath(pXmlDoc, "//w:sdt"_ostr, 1);
+ assertXPath(pXmlDoc, "//mc:AlternateContent//w:sdt"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testHeaderBorder)
@@ -513,11 +539,11 @@ CPPUNIT_TEST_FIXTURE(Test, testHeaderBorder)
loadAndSave("header-border.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// This was 0, as header margin was lost during import.
- assertXPath(pXmlDoc, "//w:pgMar", "header", "720");
+ assertXPath(pXmlDoc, "//w:pgMar"_ostr, "header"_ostr, "720");
// This was 33: 33 points -> 660 twips. We counted 900 - 240 (distance
// of page and body frame) instead of 720 - 240 (distance of page and
// header frame).
- assertXPath(pXmlDoc, "//w:pgBorders/w:top", "space", "24");
+ assertXPath(pXmlDoc, "//w:pgBorders/w:top"_ostr, "space"_ostr, "24");
}
DECLARE_OOXMLEXPORT_TEST(testTablepprShape, "tblppr-shape.docx")
@@ -542,20 +568,21 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf89774)
loadAndSave("tdf89774.fodt");
xmlDocUniquePtr pXmlDoc = parseExport("docProps/app.xml");
// This was 65, as unit was seconds instead of minutes.
- assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:TotalTime",
- "1");
+ assertXPathContent(pXmlDoc,
+ "/extended-properties:Properties/extended-properties:TotalTime"_ostr, "1");
}
CPPUNIT_TEST_FIXTURE(Test, testSectionProtection)
{
loadAndReload("sectionprot.odt");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:sectPr/w:formProt", "val", "true");
- assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:formProt", "val", "false");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:sectPr/w:formProt"_ostr, "val"_ostr,
+ "true");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:formProt"_ostr, "val"_ostr, "false");
xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml");
- assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "enforcement", "true");
- assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "edit", "forms");
+ assertXPath(pXmlSettings, "/w:settings/w:documentProtection"_ostr, "enforcement"_ostr, "true");
+ assertXPath(pXmlSettings, "/w:settings/w:documentProtection"_ostr, "edit"_ostr, "forms");
uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xSections(xTextSectionsSupplier->getTextSections(),
@@ -573,8 +600,8 @@ CPPUNIT_TEST_FIXTURE(Test, testSectionProtection2)
loadAndSave("sectionprot2.odt");
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml");
- assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "enforcement", "true");
- assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "edit", "forms");
+ assertXPath(pXmlSettings, "/w:settings/w:documentProtection"_ostr, "enforcement"_ostr, "true");
+ assertXPath(pXmlSettings, "/w:settings/w:documentProtection"_ostr, "edit"_ostr, "forms");
uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xSections(xTextSectionsSupplier->getTextSections(),
@@ -590,21 +617,23 @@ DECLARE_OOXMLEXPORT_TEST(tdf66398_permissions, "tdf66398_permissions.docx")
if (isExported())
{
xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml");
- assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "edit", "readOnly");
- assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "enforcement", "1");
- assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "cryptProviderType",
+ assertXPath(pXmlSettings, "/w:settings/w:documentProtection"_ostr, "edit"_ostr, "readOnly");
+ assertXPath(pXmlSettings, "/w:settings/w:documentProtection"_ostr, "enforcement"_ostr, "1");
+ assertXPath(pXmlSettings, "/w:settings/w:documentProtection"_ostr, "cryptProviderType"_ostr,
"rsaAES");
- assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "cryptAlgorithmClass",
- "hash");
- assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "cryptAlgorithmType",
- "typeAny");
- assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "cryptAlgorithmSid", "14");
- assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "cryptSpinCount", "100000");
- assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "hash",
+ assertXPath(pXmlSettings, "/w:settings/w:documentProtection"_ostr,
+ "cryptAlgorithmClass"_ostr, "hash");
+ assertXPath(pXmlSettings, "/w:settings/w:documentProtection"_ostr,
+ "cryptAlgorithmType"_ostr, "typeAny");
+ assertXPath(pXmlSettings, "/w:settings/w:documentProtection"_ostr, "cryptAlgorithmSid"_ostr,
+ "14");
+ assertXPath(pXmlSettings, "/w:settings/w:documentProtection"_ostr, "cryptSpinCount"_ostr,
+ "100000");
+ assertXPath(pXmlSettings, "/w:settings/w:documentProtection"_ostr, "hash"_ostr,
"A0/"
"Xy6KcXljJlZjP0TwJMPJuW2rc46UwXqn2ctxckc2nCECE5i89M85z2Noh3ZEA5NBQ9RJ5ycxiUH6nz"
"mJaKw==");
- assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "salt",
+ assertXPath(pXmlSettings, "/w:settings/w:documentProtection"_ostr, "salt"_ostr,
"B8k6wb1pkjUs4Nv/8QBk/w==");
}
@@ -625,16 +654,17 @@ CPPUNIT_TEST_FIXTURE(Test, tdf106843)
loadAndSave("tdf106843.fodt");
// check Track Changes permission set in Writer/OpenDocument (password: "test", encoded by default encoding of Writer)
xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml");
- assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "edit", "trackedChanges");
- assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "enforcement", "1");
+ assertXPath(pXmlSettings, "/w:settings/w:documentProtection"_ostr, "edit"_ostr,
+ "trackedChanges");
+ assertXPath(pXmlSettings, "/w:settings/w:documentProtection"_ostr, "enforcement"_ostr, "1");
// LO intends to export a .docx format that is natively compatible with 2013
// but this document has an implicitly added setting AddExternalLeading = false
- assertXPath(pXmlSettings, "/w:settings/w:compat/w:compatSetting[1]", "name",
+ assertXPath(pXmlSettings, "/w:settings/w:compat/w:compatSetting[1]"_ostr, "name"_ostr,
"compatibilityMode");
- assertXPath(pXmlSettings, "/w:settings/w:compat/w:compatSetting[1]", "uri",
+ assertXPath(pXmlSettings, "/w:settings/w:compat/w:compatSetting[1]"_ostr, "uri"_ostr,
"http://schemas.microsoft.com/office/word");
- assertXPath(pXmlSettings, "/w:settings/w:compat/w:compatSetting[1]", "val",
+ assertXPath(pXmlSettings, "/w:settings/w:compat/w:compatSetting[1]"_ostr, "val"_ostr,
"14"); // compatible with 2010
}
@@ -643,16 +673,16 @@ CPPUNIT_TEST_FIXTURE(Test, tdf89991_revisionView)
loadAndSave("tdf89991.docx");
// check revisionView (Show Changes) import and export
xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml");
- assertXPath(pXmlSettings, "/w:settings/w:revisionView", "insDel", "0");
- assertXPath(pXmlSettings, "/w:settings/w:revisionView", "formatting", "0");
+ assertXPath(pXmlSettings, "/w:settings/w:revisionView"_ostr, "insDel"_ostr, "0");
+ assertXPath(pXmlSettings, "/w:settings/w:revisionView"_ostr, "formatting"_ostr, "0");
// There was no compatibilityMode defined.
// 12: Use word processing features specified in ECMA-376. This is the default.
- assertXPath(pXmlSettings, "/w:settings/w:compat/w:compatSetting[1]", "name",
+ assertXPath(pXmlSettings, "/w:settings/w:compat/w:compatSetting[1]"_ostr, "name"_ostr,
"compatibilityMode");
- assertXPath(pXmlSettings, "/w:settings/w:compat/w:compatSetting[1]", "uri",
+ assertXPath(pXmlSettings, "/w:settings/w:compat/w:compatSetting[1]"_ostr, "uri"_ostr,
"http://schemas.microsoft.com/office/word");
- assertXPath(pXmlSettings, "/w:settings/w:compat/w:compatSetting[1]", "val", "12");
+ assertXPath(pXmlSettings, "/w:settings/w:compat/w:compatSetting[1]"_ostr, "val"_ostr, "12");
}
CPPUNIT_TEST_FIXTURE(Test, tdf122201_editUnprotectedText)
@@ -685,7 +715,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSectionHeader)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// this test must not be zero
- assertXPath(pXmlDoc, "//w:headerReference", 1);
+ assertXPath(pXmlDoc, "//w:headerReference"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf146491)
@@ -693,7 +723,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf146491)
loadAndReload("tdf146491.odt");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// This was 12 - a page style was unnecessarily created for every section.
- assertXPath(pXmlDoc, "//w:footerReference", 1);
+ assertXPath(pXmlDoc, "//w:footerReference"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testOO47778_1)
@@ -702,7 +732,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOO47778_1)
CPPUNIT_ASSERT_EQUAL(5, getShapes());
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathContent(pXmlDoc, "(//w:t)[3]", "c");
+ assertXPathContent(pXmlDoc, "(//w:t)[3]"_ostr, "c");
}
CPPUNIT_TEST_FIXTURE(Test, testOO47778_2)
@@ -711,7 +741,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOO47778_2)
CPPUNIT_ASSERT_EQUAL(1, getShapes());
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathContent(pXmlDoc, "(//w:t)[4]", "c");
+ assertXPathContent(pXmlDoc, "(//w:t)[4]"_ostr, "c");
// tdf116436: The problem was that the table background was undefined, not white.
uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
@@ -727,7 +757,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOO67471)
loadAndReload("ooo67471-2.odt");
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathContent(pXmlDoc, "(//w:t)[2]", "B");
+ assertXPathContent(pXmlDoc, "(//w:t)[2]"_ostr, "B");
}
CPPUNIT_TEST_FIXTURE(Test, testKDE302504)
@@ -736,7 +766,7 @@ CPPUNIT_TEST_FIXTURE(Test, testKDE302504)
CPPUNIT_ASSERT_EQUAL(1, getShapes());
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//v:shape", "ID", "KoPathShape");
+ assertXPath(pXmlDoc, "//v:shape"_ostr, "ID"_ostr, "KoPathShape");
}
CPPUNIT_TEST_FIXTURE(Test, testKDE216114)
@@ -745,7 +775,7 @@ CPPUNIT_TEST_FIXTURE(Test, testKDE216114)
CPPUNIT_ASSERT_EQUAL(1, getShapes());
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//w:pict", 1);
+ assertXPath(pXmlDoc, "//w:pict"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testOO72950)
@@ -753,7 +783,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOO72950)
loadAndReload("ooo72950-1.odt");
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//w:tbl", 1);
+ assertXPath(pXmlDoc, "//w:tbl"_ostr, 1);
}
//There are two tables to export in this doc the second of which is inside a
@@ -763,7 +793,7 @@ CPPUNIT_TEST_FIXTURE(Test, fdo60957)
{
loadAndSave("fdo60957-2.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//w:tbl", 2);
+ assertXPath(pXmlDoc, "//w:tbl"_ostr, 2);
//tdf#154956
uno::Reference<text::XBookmarksSupplier> xBookmarksSupplier(mxComponent, uno::UNO_QUERY);
@@ -781,7 +811,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOO106020)
{
loadAndSave("ooo106020-1.odt");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//w:tbl", 1);
+ assertXPath(pXmlDoc, "//w:tbl"_ostr, 1);
}
DECLARE_OOXMLEXPORT_TEST(testNonBMPChar, "nonbmpchar.docx")
@@ -801,8 +831,8 @@ CPPUNIT_TEST_FIXTURE(Test, testSpacingGroupShapeText)
assertXPath(pXmlDocument,
"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor"
"/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/"
- "w:spacing",
- "val", "200");
+ "w:spacing"_ostr,
+ "val"_ostr, "200");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf100581)
@@ -812,26 +842,28 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf100581)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- assertXPath(pXmlDocument,
- "/w:document/w:body/w:p[1]/w:r[2]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor"
- "/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p[1]/w:pPr/w:pStyle",
- "val", "FrameContents");
+ assertXPath(
+ pXmlDocument,
+ "/w:document/w:body/w:p[1]/w:r[2]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor"
+ "/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p[1]/w:pPr/w:pStyle"_ostr,
+ "val"_ostr, "FrameContents");
// w:sectPr is not exported
- assertXPath(pXmlDocument,
- "/w:document/w:body/w:p[1]/w:r[2]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor"
- "/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p[1]/w:pPr/w:sectPr",
- 0);
+ assertXPath(
+ pXmlDocument,
+ "/w:document/w:body/w:p[1]/w:r[2]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor"
+ "/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p[1]/w:pPr/w:sectPr"_ostr,
+ 0);
assertXPath(pXmlDocument,
"/w:document/w:body/w:p[1]/w:r[2]/mc:AlternateContent/mc:Fallback/w:pict/v:rect"
- "/v:textbox/w:txbxContent/w:p[1]/w:pPr/w:pStyle",
- "val", "FrameContents");
+ "/v:textbox/w:txbxContent/w:p[1]/w:pPr/w:pStyle"_ostr,
+ "val"_ostr, "FrameContents");
// w:sectPr is not exported
assertXPath(pXmlDocument,
"/w:document/w:body/w:p[1]/w:r[2]/mc:AlternateContent/mc:Fallback/w:pict/v:rect"
- "/v:textbox/w:txbxContent/w:p[1]/w:pPr/w:sectPr",
+ "/v:textbox/w:txbxContent/w:p[1]/w:pPr/w:sectPr"_ostr,
0);
}
@@ -842,10 +874,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf112287)
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "vAnchor", "margin");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "hAnchor", "text");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "xAlign", "center");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "yAlign", "bottom");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr"_ostr, "vAnchor"_ostr,
+ "margin");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr"_ostr, "hAnchor"_ostr,
+ "text");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr"_ostr, "xAlign"_ostr,
+ "center");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr"_ostr, "yAlign"_ostr,
+ "bottom");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf157572_defaultVAnchor)
@@ -854,9 +890,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf157572_defaultVAnchor)
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
// vAnchor wasn't defined on import. It should default to 'margin' when w:y=non-zero
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "vAnchor", "margin");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr"_ostr, "vAnchor"_ostr,
+ "margin");
// yAlign=something is not compatible with w:y=non-zero" - don't write anything out
- assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "yAlign");
+ assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr"_ostr,
+ "yAlign"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf157572_insidiousCombination)
@@ -870,11 +908,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf157572_insidiousCombination)
// position and the vAlign ONLY affects the UI.
// vAnchor was defined as text.
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "vAnchor", "text");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr"_ostr, "vAnchor"_ostr,
+ "text");
// yAlign=something is not compatible with "text" - don't write anything out
- assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "yAlign");
+ assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr"_ostr,
+ "yAlign"_ostr);
// y is zero - no need to write out the default value
- assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "y");
+ assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr"_ostr,
+ "y"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf157572_noVAlignAsText)
@@ -882,9 +923,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf157572_noVAlignAsText)
loadAndSave("tdf157572_noVAlignAsText.docx");
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "vAnchor", "text");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr"_ostr, "vAnchor"_ostr,
+ "text");
// yAlign=something is not compatible with vAnchor="text" - don't write anything out
- assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "yAlign");
+ assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr"_ostr,
+ "yAlign"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf112287B)
@@ -892,8 +935,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf112287B)
loadAndSave("tdf112287B.docx");
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "vAnchor", "text");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "hAnchor", "text");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr"_ostr, "vAnchor"_ostr,
+ "text");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr"_ostr, "hAnchor"_ostr,
+ "text");
}
CPPUNIT_TEST_FIXTURE(Test, testZOrderInHeader)
@@ -904,11 +949,12 @@ CPPUNIT_TEST_FIXTURE(Test, testZOrderInHeader)
// Get the Z-Order of the background image and of the shape in front of it.
sal_Int32 nBackground
- = getXPath(pXml, "/w:hdr/w:p[1]/w:r[1]/w:drawing/wp:anchor", "relativeHeight").toInt32();
+ = getXPath(pXml, "/w:hdr/w:p[1]/w:r[1]/w:drawing/wp:anchor"_ostr, "relativeHeight"_ostr)
+ .toInt32();
sal_Int32 nFrontShape = getXPath(pXml,
"/w:hdr/w:p[1]/w:r[1]/mc:AlternateContent[2]"
- "/mc:Choice/w:drawing/wp:anchor",
- "relativeHeight")
+ "/mc:Choice/w:drawing/wp:anchor"_ostr,
+ "relativeHeight"_ostr)
.toInt32();
// Assert that background is in the back.
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index 85a71713219f..bb20cec1a508 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -137,7 +137,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCharacterBorder)
xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
// Make sure we write qFormat for custom style names.
- assertXPath(pXmlStyles, "//w:style[@w:styleId='Heading']/w:qFormat", 1);
+ assertXPath(pXmlStyles, "//w:style[@w:styleId='Heading']/w:qFormat"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testStyleInheritance)
@@ -147,15 +147,15 @@ CPPUNIT_TEST_FIXTURE(Test, testStyleInheritance)
// Check that now styleId's are more like what MSO produces
xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
// the 1st style always must be Normal
- assertXPath(pXmlStyles, "/w:styles/w:style[1]", "styleId", "Normal");
+ assertXPath(pXmlStyles, "/w:styles/w:style[1]"_ostr, "styleId"_ostr, "Normal");
// some random style later
- assertXPath(pXmlStyles, "/w:styles/w:style[4]", "styleId", "Heading3");
+ assertXPath(pXmlStyles, "/w:styles/w:style[4]"_ostr, "styleId"_ostr, "Heading3");
// Check that we do _not_ export w:next for styles that point to themselves.
- assertXPath(pXmlStyles, "/w:styles/w:style[1]/w:next", 0);
+ assertXPath(pXmlStyles, "/w:styles/w:style[1]/w:next"_ostr, 0);
// Check that we roundtrip <w:next> correctly - on XML level
- assertXPath(pXmlStyles, "/w:styles/w:style[2]/w:next", "val", "Normal");
+ assertXPath(pXmlStyles, "/w:styles/w:style[2]/w:next"_ostr, "val"_ostr, "Normal");
// And to be REALLY sure, check it on the API level too ;-)
uno::Reference< container::XNameAccess > paragraphStyles = getStyles("ParagraphStyles");
uno::Reference< beans::XPropertySet > properties(paragraphStyles->getByName("Heading 1"), uno::UNO_QUERY);
@@ -168,18 +168,18 @@ CPPUNIT_TEST_FIXTURE(Test, testStyleInheritance)
CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"), getProperty<OUString>(properties, "FollowStyle"));
// Make sure style #2 is Heading 1.
- assertXPath(pXmlStyles, "/w:styles/w:style[2]", "styleId", "Heading1");
+ assertXPath(pXmlStyles, "/w:styles/w:style[2]"_ostr, "styleId"_ostr, "Heading1");
// w:ind was copied from the parent (Normal) style without a good reason.
- assertXPath(pXmlStyles, "/w:styles/w:style[2]/w:pPr/w:ind", 0);
+ assertXPath(pXmlStyles, "/w:styles/w:style[2]/w:pPr/w:ind"_ostr, 0);
// We output exactly 2 properties in rPrDefault, nothing else was
// introduced as an additional default
- assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/*", 2);
+ assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/*"_ostr, 2);
// Check that we output real content of rPrDefault
- assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:rFonts", "ascii", "Times New Roman");
- assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:lang", "bidi", "ar-SA");
+ assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:rFonts"_ostr, "ascii"_ostr, "Times New Roman");
+ assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:lang"_ostr, "bidi"_ostr, "ar-SA");
// pPrDefault contains only one hyphenation property
- assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:pPrDefault/w:pPr/*", 1);
+ assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:pPrDefault/w:pPr/*"_ostr, 1);
// Check latent styles
uno::Sequence<beans::PropertyValue> aGrabBag = getProperty< uno::Sequence<beans::PropertyValue> >(mxComponent, "InteropGrabBag");
@@ -211,33 +211,33 @@ CPPUNIT_TEST_FIXTURE(Test, testStyleInheritance)
CPPUNIT_ASSERT_EQUAL(OUString("Normal"), aName); // This checks the "name" attribute of the first exception.
// This numbering style wasn't roundtripped.
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='NoList']/w:name", "val", "No List");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='NoList']/w:name"_ostr, "val"_ostr, "No List");
// Table style wasn't roundtripped.
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='TableNormal']/w:tblPr/w:tblCellMar/w:left", "w", "108");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='TableNormal']/w:semiHidden", 1);
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='TableNormal']/w:unhideWhenUsed", 1);
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='TableNormal']/w:tblPr/w:tblCellMar/w:left"_ostr, "w"_ostr, "108");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='TableNormal']/w:semiHidden"_ostr, 1);
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='TableNormal']/w:unhideWhenUsed"_ostr, 1);
// Additional para style properties should be also roundtripped.
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='ListParagraph']/w:uiPriority", "val", "34");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Normal']/w:qFormat", 1);
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Normal']/w:rsid", "val", "00780346");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Normal']", "default", "1");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='ListParagraph']/w:uiPriority"_ostr, "val"_ostr, "34");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Normal']/w:qFormat"_ostr, 1);
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Normal']/w:rsid"_ostr, "val"_ostr, "00780346");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Normal']"_ostr, "default"_ostr, "1");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Heading1']/w:link", "val", "Heading1Char");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Heading1']/w:locked", 1);
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Heading1']/w:link"_ostr, "val"_ostr, "Heading1Char");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Heading1']/w:locked"_ostr, 1);
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Heading11']", "customStyle", "1");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Heading11']/w:autoRedefine", 1);
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Heading11']"_ostr, "customStyle"_ostr, "1");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Heading11']/w:autoRedefine"_ostr, 1);
// Additional char style properties should be also roundtripped.
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='DefaultParagraphFont']", "default", "1");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='DefaultParagraphFont']"_ostr, "default"_ostr, "1");
// Finally check the same for numbering styles.
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='NoList']", "default", "1");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='NoList']"_ostr, "default"_ostr, "1");
// This was 1, the default style had <w:suppressAutoHyphens w:val="true"/> even for a default style having no RES_PARATR_HYPHENZONE set.
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Normal']/w:pPr/w:suppressAutoHyphens", 0);
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Normal']/w:pPr/w:suppressAutoHyphens"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testCalendar1)
@@ -245,32 +245,32 @@ CPPUNIT_TEST_FIXTURE(Test, testCalendar1)
loadAndSave("calendar1.docx");
// Document has a non-trivial table style, test the roundtrip of it.
xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:basedOn", "val", "TableNormal");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:rsid", "val", "00903003");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tblPr/w:tblStyleColBandSize", "val", "1");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tcPr/w:shd", "val", "clear");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:basedOn"_ostr, "val"_ostr, "TableNormal");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:rsid"_ostr, "val"_ostr, "00903003");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tblPr/w:tblStyleColBandSize"_ostr, "val"_ostr, "1");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tcPr/w:shd"_ostr, "val"_ostr, "clear");
// Table style lost its paragraph / run properties.
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:pPr/w:spacing", "lineRule", "auto");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:rPr/w:lang", "eastAsia", "ja-JP");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:pPr/w:spacing"_ostr, "lineRule"_ostr, "auto");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:rPr/w:lang"_ostr, "eastAsia"_ostr, "ja-JP");
// Table style lost its conditional table formatting properties.
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tblStylePr[@w:type='firstRow']/w:pPr/w:wordWrap", 1);
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tblStylePr[@w:type='firstRow']/w:rPr/w:rFonts", "hAnsiTheme", "minorHAnsi");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tblStylePr[@w:type='firstRow']/w:tblPr", 1);
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tblStylePr[@w:type='firstRow']/w:tcPr/w:vAlign", "val", "bottom");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tblStylePr[@w:type='lastRow']/w:tcPr/w:tcBorders/w:tr2bl", "val", "nil");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tblStylePr[@w:type='band2Horz']/w:tcPr/w:tcBorders/w:top", "themeColor", "text1");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tblStylePr[@w:type='firstRow']/w:pPr/w:wordWrap"_ostr, 1);
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tblStylePr[@w:type='firstRow']/w:rPr/w:rFonts"_ostr, "hAnsiTheme"_ostr, "minorHAnsi");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tblStylePr[@w:type='firstRow']/w:tblPr"_ostr, 1);
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tblStylePr[@w:type='firstRow']/w:tcPr/w:vAlign"_ostr, "val"_ostr, "bottom");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tblStylePr[@w:type='lastRow']/w:tcPr/w:tcBorders/w:tr2bl"_ostr, "val"_ostr, "nil");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar1']/w:tblStylePr[@w:type='band2Horz']/w:tcPr/w:tcBorders/w:top"_ostr, "themeColor"_ostr, "text1");
// w:tblLook element and its attributes were missing.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblLook", "firstRow", "1");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblLook", "lastRow", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblLook", "lastColumn", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblLook", "firstColumn", "1");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblLook", "noHBand", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblLook", "noVBand", "1");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblLook", "val", "04a0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblLook"_ostr, "firstRow"_ostr, "1");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblLook"_ostr, "lastRow"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblLook"_ostr, "lastColumn"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblLook"_ostr, "firstColumn"_ostr, "1");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblLook"_ostr, "noHBand"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblLook"_ostr, "noVBand"_ostr, "1");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblLook"_ostr, "val"_ostr, "04a0");
}
DECLARE_OOXMLEXPORT_TEST(testCalendar2, "calendar2.docx")
@@ -290,18 +290,18 @@ DECLARE_OOXMLEXPORT_TEST(testCalendar2, "calendar2.docx")
if (!isExported())
return;
xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:pPr/w:jc", "val", "center");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:pPr/w:jc"_ostr, "val"_ostr, "center");
// These run properties were missing
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:rPr/w:lang", "val", "en-US");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:rPr/w:lang", "bidi", "ar-SA");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:tblStylePr[@w:type='firstRow']/w:rPr/w:caps", 1);
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:tblStylePr[@w:type='firstRow']/w:rPr/w:smallCaps", "val", "0");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:tblStylePr[@w:type='firstRow']/w:rPr/w:color", "themeColor", "accent1");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:tblStylePr[@w:type='firstRow']/w:rPr/w:spacing", "val", "20");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:rPr/w:lang"_ostr, "val"_ostr, "en-US");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:rPr/w:lang"_ostr, "bidi"_ostr, "ar-SA");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:tblStylePr[@w:type='firstRow']/w:rPr/w:caps"_ostr, 1);
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:tblStylePr[@w:type='firstRow']/w:rPr/w:smallCaps"_ostr, "val"_ostr, "0");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:tblStylePr[@w:type='firstRow']/w:rPr/w:color"_ostr, "themeColor"_ostr, "accent1");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:tblStylePr[@w:type='firstRow']/w:rPr/w:spacing"_ostr, "val"_ostr, "20");
// Table borders were also missing
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:tblPr/w:tblBorders/w:insideV", "themeTint", "99");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:tblPr/w:tblBorders/w:insideV"_ostr, "themeTint"_ostr, "99");
}
DECLARE_OOXMLEXPORT_TEST(testCalendar3, "calendar3.docx")
@@ -356,10 +356,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTcBorders)
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- assertXPath(pXmlDocument, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tcPr[1]/w:tcBorders[1]/w:bottom[1][@w:val = 'single']",1);
- assertXPath(pXmlDocument, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tcPr[1]/w:tcBorders[1]/w:bottom[1][@w:sz = 4]", 1);
- assertXPath(pXmlDocument, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tcPr[1]/w:tcBorders[1]/w:bottom[1][@w:space = 0]", 1);
- assertXPath(pXmlDocument, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tcPr[1]/w:tcBorders[1]/w:bottom[1][@w:color = 808080]", 1);
+ assertXPath(pXmlDocument, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tcPr[1]/w:tcBorders[1]/w:bottom[1][@w:val = 'single']"_ostr,1);
+ assertXPath(pXmlDocument, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tcPr[1]/w:tcBorders[1]/w:bottom[1][@w:sz = 4]"_ostr, 1);
+ assertXPath(pXmlDocument, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tcPr[1]/w:tcBorders[1]/w:bottom[1][@w:space = 0]"_ostr, 1);
+ assertXPath(pXmlDocument, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tcPr[1]/w:tcBorders[1]/w:bottom[1][@w:color = 808080]"_ostr, 1);
uno::Reference<beans::XPropertySet> xStyle(
getStyles("CharacterStyles")->getByName("Code Featured Element"),
@@ -373,27 +373,27 @@ CPPUNIT_TEST_FIXTURE(Test, testQuicktables)
xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
// These were missing in the Calendar3 table style.
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar3']/w:rPr/w:rFonts", "cstheme", "majorBidi");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar3']/w:rPr/w:color", "themeTint", "80");
- CPPUNIT_ASSERT(getXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar3']/w:tblStylePr[@w:type='firstRow']/w:rPr/w:color", "themeShade").equalsIgnoreAsciiCase("BF"));
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar3']/w:rPr/w:rFonts"_ostr, "cstheme"_ostr, "majorBidi");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar3']/w:rPr/w:color"_ostr, "themeTint"_ostr, "80");
+ CPPUNIT_ASSERT(getXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar3']/w:tblStylePr[@w:type='firstRow']/w:rPr/w:color"_ostr, "themeShade"_ostr).equalsIgnoreAsciiCase("BF"));
// Calendar4.
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:pPr/w:snapToGrid", "val", "0");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:rPr/w:bCs", 1);
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:tcPr/w:shd", "themeFill", "accent1");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:tcPr/w:shd", "themeFillShade", "80");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:tblStylePr[@w:type='firstCol']/w:pPr/w:ind", "rightChars", "0");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:tblStylePr[@w:type='firstCol']/w:pPr/w:ind", "right", "144");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:tblStylePr[@w:type='band2Horz']/w:tcPr/w:tcMar/w:bottom", "w", "86");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:pPr/w:snapToGrid"_ostr, "val"_ostr, "0");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:rPr/w:bCs"_ostr, 1);
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:tcPr/w:shd"_ostr, "themeFill"_ostr, "accent1");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:tcPr/w:shd"_ostr, "themeFillShade"_ostr, "80");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:tblStylePr[@w:type='firstCol']/w:pPr/w:ind"_ostr, "rightChars"_ostr, "0");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:tblStylePr[@w:type='firstCol']/w:pPr/w:ind"_ostr, "right"_ostr, "144");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:tblStylePr[@w:type='band2Horz']/w:tcPr/w:tcMar/w:bottom"_ostr, "w"_ostr, "86");
// LightList.
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='LightList']/w:tblStylePr[@w:type='firstRow']/w:pPr/w:spacing", "before", "0");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='LightList']/w:tblStylePr[@w:type='firstRow']/w:pPr/w:spacing"_ostr, "before"_ostr, "0");
// MediumList2-Accent1.
- CPPUNIT_ASSERT(getXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='MediumList2-Accent1']/w:tblStylePr[@w:type='band1Vert']/w:tcPr/w:shd", "themeFillTint").equalsIgnoreAsciiCase("3F"));
+ CPPUNIT_ASSERT(getXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='MediumList2-Accent1']/w:tblStylePr[@w:type='band1Vert']/w:tcPr/w:shd"_ostr, "themeFillTint"_ostr).equalsIgnoreAsciiCase("3F"));
// MediumShading2-Accent5.
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='MediumShading2-Accent5']/w:tblStylePr[@w:type='firstRow']/w:tcPr/w:tcBorders/w:top", "color", "auto");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='MediumShading2-Accent5']/w:tblStylePr[@w:type='firstRow']/w:tcPr/w:tcBorders/w:top"_ostr, "color"_ostr, "auto");
}
CPPUNIT_TEST_FIXTURE(Test, testFdo71302)
@@ -402,7 +402,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo71302)
xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
// This got renamed to "Strong Emphasis" without a good reason.
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Strong']", 1);
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Strong']"_ostr, 1);
}
@@ -497,7 +497,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFontNameIsEmpty)
// This test does not fail, if the document contains a font with empty name.
xmlDocUniquePtr pXmlFontTable = parseExport("word/fontTable.xml");
- xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlFontTable, "/w:fonts/w:font");
+ xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlFontTable, "/w:fonts/w:font"_ostr);
xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
sal_Int32 length = xmlXPathNodeSetGetLength(pXmlNodes);
for(sal_Int32 index = 0; index < length; index++){
@@ -515,7 +515,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMultiColumnLineSeparator)
loadAndSave("multi-column-line-separator-SAVED.docx");
// Check for the Column Separator value.It should be FALSE as the document does not contain separator line.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:sectPr/w:cols","sep","false");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:sectPr/w:cols"_ostr,"sep"_ostr,"false");
}
DECLARE_OOXMLEXPORT_TEST(testCustomXmlGrabBag, "customxml.docx")
@@ -553,8 +553,8 @@ CPPUNIT_TEST_FIXTURE(Test, testCustomXmlRelationships)
xmlDocUniquePtr pXmlDoc = parseExport("customXml/_rels/item1.xml.rels");
// Check there is a relation to itemProps1.xml.
- assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship", 1);
- assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target", "itemProps1.xml");
+ assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship"_ostr, 1);
+ assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']"_ostr, "Target"_ostr, "itemProps1.xml");
}
CPPUNIT_TEST_FIXTURE(Test, testFdo69644)
@@ -564,7 +564,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo69644)
// with only 3 columns, instead of 5 columns.
// Check that the table grid is exported with 5 columns
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol", 5);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol"_ostr, 5);
}
DECLARE_OOXMLEXPORT_TEST(testFdo70812, "fdo70812.docx")
@@ -577,7 +577,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPgMargin)
{
loadAndSave("testPgMargin.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgMar", "left", "1440");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgMar"_ostr, "left"_ostr, "1440");
}
DECLARE_OOXMLEXPORT_TEST(testImageCrop, "ImageCrop.docx")
@@ -693,8 +693,8 @@ CPPUNIT_TEST_FIXTURE(Test, testCellGridSpan)
// used to get set wrongly to 5 and 65532 respectively which was the reason for crash during save operation
// Verifying gridSpan element is not present in RoundTripped Document (As it's Default value is 1).
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:tcPr/w:gridSpan",0);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[2]/w:tcPr/w:gridSpan",0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:tcPr/w:gridSpan"_ostr,0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[2]/w:tcPr/w:gridSpan"_ostr,0);
}
DECLARE_OOXMLEXPORT_TEST(testFdo71646, "fdo71646.docx")
{
@@ -713,15 +713,15 @@ CPPUNIT_TEST_FIXTURE(Test, testParaAutoSpacing)
{
loadAndSave("para-auto-spacing.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing", "beforeAutospacing","1");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing", "afterAutospacing","1");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing"_ostr, "beforeAutospacing"_ostr,"1");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing"_ostr, "afterAutospacing"_ostr,"1");
- assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing",
- "beforeAutospacing");
- assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing",
- "afterAutospacing");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing", "before","400");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing", "after","400");
+ assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing"_ostr,
+ "beforeAutospacing"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing"_ostr,
+ "afterAutospacing"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing"_ostr, "before"_ostr,"400");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing"_ostr, "after"_ostr,"400");
}
DECLARE_OOXMLEXPORT_TEST(testGIFImageCrop, "test_GIF_ImageCrop.docx")
@@ -799,22 +799,22 @@ CPPUNIT_TEST_FIXTURE(Test, testFootnoteParagraphTag)
* Check for, paragraph tag is correctly written into footnotes.xml.
*/
xmlDocUniquePtr pXmlFootnotes = parseExport("word/footnotes.xml");
- assertXPath(pXmlFootnotes, "/w:footnotes/w:footnote[3]","id","2");
- assertXPath(pXmlFootnotes, "/w:footnotes/w:footnote[3]/w:p/w:r/w:footnoteRef", 1);
+ assertXPath(pXmlFootnotes, "/w:footnotes/w:footnote[3]"_ostr,"id"_ostr,"2");
+ assertXPath(pXmlFootnotes, "/w:footnotes/w:footnote[3]/w:p/w:r/w:footnoteRef"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testSpacingLineRule)
{
loadAndReload("table_lineRule.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing", "lineRule", "auto");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing"_ostr, "lineRule"_ostr, "auto");
}
CPPUNIT_TEST_FIXTURE(Test, testTableLineSpacing)
{
loadAndSave("table_atleast.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:pPr/w:spacing", "line", "320");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:pPr/w:spacing"_ostr, "line"_ostr, "320");
}
DECLARE_OOXMLEXPORT_TEST(testOoxmlTriangle, "ooxml-triangle.docx")
@@ -835,31 +835,31 @@ CPPUNIT_TEST_FIXTURE(Test, testThemePreservation)
loadAndSave("theme-preservation.docx");
// check default font theme values have been preserved
xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
- assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:rFonts", "asciiTheme", "minorHAnsi");
- assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:rFonts", "cstheme", "minorBidi");
+ assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:rFonts"_ostr, "asciiTheme"_ostr, "minorHAnsi");
+ assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:rFonts"_ostr, "cstheme"_ostr, "minorBidi");
// check the font theme values in style definitions
- assertXPath(pXmlStyles, "/w:styles/w:style[1]/w:rPr/w:rFonts", "eastAsiaTheme", "minorEastAsia");
+ assertXPath(pXmlStyles, "/w:styles/w:style[1]/w:rPr/w:rFonts"_ostr, "eastAsiaTheme"_ostr, "minorEastAsia");
// check the color theme values in style definitions
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Custom1']/w:rPr/w:color", "themeColor", "accent1");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Custom1']/w:rPr/w:color", "themeTint", "99");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Custom1']/w:rPr/w:color"_ostr, "themeColor"_ostr, "accent1");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Custom1']/w:rPr/w:color"_ostr, "themeTint"_ostr, "99");
// check direct format font theme values have been preserved
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[5]/w:r[1]/w:rPr/w:rFonts", "hAnsiTheme", "majorHAnsi");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[5]/w:r[1]/w:rPr/w:rFonts", "asciiTheme", "majorHAnsi");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[5]/w:r[1]/w:rPr/w:rFonts"_ostr, "hAnsiTheme"_ostr, "majorHAnsi");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[5]/w:r[1]/w:rPr/w:rFonts"_ostr, "asciiTheme"_ostr, "majorHAnsi");
// check theme font color value has been preserved
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w:color", "themeColor", "accent3");
- OUString sThemeShade = getXPath(pXmlDocument, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w:color", "themeShade");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w:color"_ostr, "themeColor"_ostr, "accent3");
+ OUString sThemeShade = getXPath(pXmlDocument, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w:color"_ostr, "themeShade"_ostr);
CPPUNIT_ASSERT_EQUAL(sal_Int32(0xbf), sThemeShade.toInt32(16));
// check the themeFontLang values in settings file
xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml");
- assertXPath(pXmlSettings, "/w:settings/w:themeFontLang", "val", "en-US");
- assertXPath(pXmlSettings, "/w:settings/w:themeFontLang", "eastAsia", "zh-CN");
- assertXPath(pXmlSettings, "/w:settings/w:themeFontLang", "bidi", "he-IL");
+ assertXPath(pXmlSettings, "/w:settings/w:themeFontLang"_ostr, "val"_ostr, "en-US");
+ assertXPath(pXmlSettings, "/w:settings/w:themeFontLang"_ostr, "eastAsia"_ostr, "zh-CN");
+ assertXPath(pXmlSettings, "/w:settings/w:themeFontLang"_ostr, "bidi"_ostr, "he-IL");
// check fonts have been applied properly
sal_Unicode fontName[2]; //represents the string "宋体"
@@ -876,11 +876,11 @@ CPPUNIT_TEST_FIXTURE(Test, testThemePreservation)
getProperty<OUString>(getParagraph(5, "Major theme font"), "CharFontName"));
// check the paragraph background pattern has been preserved including theme colors
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:shd", "val", "thinHorzStripe");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:shd", "themeFill", "text2");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:shd", "themeFillTint", "33");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:shd", "themeColor", "accent1");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:shd", "themeShade", "80");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:shd"_ostr, "val"_ostr, "thinHorzStripe");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:shd"_ostr, "themeFill"_ostr, "text2");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:shd"_ostr, "themeFillTint"_ostr, "33");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:shd"_ostr, "themeColor"_ostr, "accent1");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:shd"_ostr, "themeShade"_ostr, "80");
}
CPPUNIT_TEST_FIXTURE(Test, testTableThemePreservation)
@@ -889,50 +889,50 @@ CPPUNIT_TEST_FIXTURE(Test, testTableThemePreservation)
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
// check cell theme colors have been preserved
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:shd", "themeFill", "accent6");
- assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:shd",
- "themeFillShade");
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:shd", "themeFillTint", "33");
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[2]/w:tcPr/w:shd", "themeFill", "accent6");
- assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[2]/w:tcPr/w:shd",
- "themeFillShade");
- assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[2]/w:tcPr/w:shd",
- "themeFillTint");
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[3]/w:tcPr/w:shd", "themeFill", "accent6");
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[3]/w:tcPr/w:shd", "themeFillShade", "80");
- assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[3]/w:tcPr/w:shd",
- "themeFillTint");
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[3]/w:tcPr/w:shd", "val", "horzStripe");
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[3]/w:tcPr/w:shd", "themeColor", "accent3");
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[3]/w:tcPr/w:shd", "themeTint", "33");
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[3]/w:tcPr/w:shd", "color", "E7EEEE");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:shd"_ostr, "themeFill"_ostr, "accent6");
+ assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:shd"_ostr,
+ "themeFillShade"_ostr);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:shd"_ostr, "themeFillTint"_ostr, "33");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[2]/w:tcPr/w:shd"_ostr, "themeFill"_ostr, "accent6");
+ assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[2]/w:tcPr/w:shd"_ostr,
+ "themeFillShade"_ostr);
+ assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[2]/w:tcPr/w:shd"_ostr,
+ "themeFillTint"_ostr);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[3]/w:tcPr/w:shd"_ostr, "themeFill"_ostr, "accent6");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[3]/w:tcPr/w:shd"_ostr, "themeFillShade"_ostr, "80");
+ assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[3]/w:tcPr/w:shd"_ostr,
+ "themeFillTint"_ostr);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[3]/w:tcPr/w:shd"_ostr, "val"_ostr, "horzStripe");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[3]/w:tcPr/w:shd"_ostr, "themeColor"_ostr, "accent3");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[3]/w:tcPr/w:shd"_ostr, "themeTint"_ostr, "33");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[3]/w:tcPr/w:shd"_ostr, "color"_ostr, "E7EEEE");
// check table style has been preserved
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tblPr/w:tblStyle", "val", "Sombreadoclaro-nfasis1");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tblPr/w:tblStyle"_ostr, "val"_ostr, "Sombreadoclaro-nfasis1");
// check table style is not overwritten by other properties
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[2]/w:tcPr/w:tcBorders/*", 0);
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[3]/w:tcPr/w:tcBorders/*", 0);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[2]/w:tcPr/w:tcBorders/*"_ostr, 0);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[3]/w:tcPr/w:tcBorders/*"_ostr, 0);
// check that one cell attribute present in the original document has been preserved
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/*", 1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/*"_ostr, 1);
// Check that w:cnfStyle row, cell and paragraph property is preserved.
- assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:trPr/w:cnfStyle", "val", "100000000000");
- assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:trPr/w:cnfStyle", "firstRow", "1");
- assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:trPr/w:cnfStyle", "lastRow", "0");
- assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:trPr/w:cnfStyle", "firstColumn", "0");
- assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:trPr/w:cnfStyle", "lastColumn", "0");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:trPr/w:cnfStyle"_ostr, "val"_ostr, "100000000000");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:trPr/w:cnfStyle"_ostr, "firstRow"_ostr, "1");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:trPr/w:cnfStyle"_ostr, "lastRow"_ostr, "0");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:trPr/w:cnfStyle"_ostr, "firstColumn"_ostr, "0");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:trPr/w:cnfStyle"_ostr, "lastColumn"_ostr, "0");
- assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc/w:tcPr/w:cnfStyle", "val", "001000000000");
- assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc/w:tcPr/w:cnfStyle", "oddVBand", "0");
- assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc/w:tcPr/w:cnfStyle", "evenVBand", "0");
- assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc/w:tcPr/w:cnfStyle", "oddHBand", "0");
- assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc/w:tcPr/w:cnfStyle", "evenHBand", "0");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc/w:tcPr/w:cnfStyle"_ostr, "val"_ostr, "001000000000");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc/w:tcPr/w:cnfStyle"_ostr, "oddVBand"_ostr, "0");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc/w:tcPr/w:cnfStyle"_ostr, "evenVBand"_ostr, "0");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc/w:tcPr/w:cnfStyle"_ostr, "oddHBand"_ostr, "0");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc/w:tcPr/w:cnfStyle"_ostr, "evenHBand"_ostr, "0");
- assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc[2]/w:p/w:pPr/w:cnfStyle", "val", "100000000000");
- assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc[2]/w:p/w:pPr/w:cnfStyle", "firstRowFirstColumn", "0");
- assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc[2]/w:p/w:pPr/w:cnfStyle", "firstRowLastColumn", "0");
- assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc[2]/w:p/w:pPr/w:cnfStyle", "lastRowFirstColumn", "0");
- assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc[2]/w:p/w:pPr/w:cnfStyle", "lastRowLastColumn", "0");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc[2]/w:p/w:pPr/w:cnfStyle"_ostr, "val"_ostr, "100000000000");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc[2]/w:p/w:pPr/w:cnfStyle"_ostr, "firstRowFirstColumn"_ostr, "0");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc[2]/w:p/w:pPr/w:cnfStyle"_ostr, "firstRowLastColumn"_ostr, "0");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc[2]/w:p/w:pPr/w:cnfStyle"_ostr, "lastRowFirstColumn"_ostr, "0");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc[2]/w:p/w:pPr/w:cnfStyle"_ostr, "lastRowLastColumn"_ostr, "0");
}
@@ -943,8 +943,8 @@ CPPUNIT_TEST_FIXTURE(Test, testcantSplit)
// in table row property,As default row prop is allow row to break across page.
// writing <w:cantSplit w:val="false"/> during export was causing problem that all the cell data used to come on same page
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr/w:trPr/w:cantSplit",0);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[2]/w:tr/w:trPr/w:cantSplit","val","true");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr/w:trPr/w:cantSplit"_ostr,0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[2]/w:tr/w:trPr/w:cantSplit"_ostr,"val"_ostr,"true");
}
CPPUNIT_TEST_FIXTURE(Test, testDontSplitTable)
@@ -952,7 +952,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDontSplitTable)
loadAndReload("tdf101589_dontSplitTable.odt");
CPPUNIT_ASSERT_EQUAL(2, getPages());
//single row tables need to prevent split by setting row to no split
- CPPUNIT_ASSERT_EQUAL( OUString("Row 1"), parseDump("/root/page[2]/body/tab[1]/row[1]/cell[1]/txt[1]") );
+ CPPUNIT_ASSERT_EQUAL( OUString("Row 1"), parseDump("/root/page[2]/body/tab[1]/row[1]/cell[1]/txt[1]"_ostr) );
uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY);
@@ -981,14 +981,14 @@ CPPUNIT_TEST_FIXTURE(Test, testcolumnbreak)
loadAndSave("columnbreak.docx");
CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, getProperty<style::BreakType>(getParagraph(5, "This is first line after col brk."), "BreakType"));
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:r[1]/w:br", "type", "column");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:r[1]/w:br"_ostr, "type"_ostr, "column");
}
CPPUNIT_TEST_FIXTURE(Test, testGlossary)
{
loadAndSave("testGlossary.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/glossary/document.xml");
- assertXPath(pXmlDoc, "/w:glossaryDocument", "Ignorable", "w14 wp14");
+ assertXPath(pXmlDoc, "/w:glossaryDocument"_ostr, "Ignorable"_ostr, "w14 wp14");
}
CPPUNIT_TEST_FIXTURE(Test, testGlossaryWithEmail)
@@ -999,12 +999,12 @@ CPPUNIT_TEST_FIXTURE(Test, testGlossaryWithEmail)
assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@Id='rId4' "
"and @Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink' "
"and @Target='mailto:emailgoeshere@example.com' "
- "and @TargetMode='External']");
+ "and @TargetMode='External']"_ostr);
// preserve the ShowingPlaceholder setting on both block SDTs.
pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:showingPlcHdr", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:hyperlink/w:sdt/w:sdtPr/w:showingPlcHdr", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:showingPlcHdr"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:hyperlink/w:sdt/w:sdtPr/w:showingPlcHdr"_ostr, 1);
}
DECLARE_OOXMLEXPORT_TEST(testFdo71785, "fdo71785.docx")
@@ -1016,7 +1016,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCrashWhileSave)
{
loadAndSave("testCrashWhileSave.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/footer1.xml");
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:ftr/w:tbl/w:tr/w:tc[1]/w:p[1]/w:pPr/w:pStyle", "val").match("Normal"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:ftr/w:tbl/w:tr/w:tc[1]/w:p[1]/w:pPr/w:pStyle"_ostr, "val"_ostr).match("Normal"));
}
CPPUNIT_TEST_FIXTURE(Test, testFileOpenInputOutputError)
@@ -1024,10 +1024,10 @@ CPPUNIT_TEST_FIXTURE(Test, testFileOpenInputOutputError)
loadAndReload("floatingtbl_with_formula.docx");
// Docx containing Floating table with formula was giving "General input/output error" while opening in LibreOffice
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pStyle", "val", "Normal");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pStyle"_ostr, "val"_ostr, "Normal");
// let's also assert that the formula was exported properly
- assertXPathContent(pXmlDoc, "//w:tbl/w:tr/w:tc[2]/w:p/m:oMathPara/m:oMath/m:sSubSup/m:e/m:r/m:t", u"\u03C3"_ustr);
+ assertXPathContent(pXmlDoc, "//w:tbl/w:tr/w:tc[2]/w:p/m:oMathPara/m:oMath/m:sSubSup/m:e/m:r/m:t"_ostr, u"\u03C3"_ustr);
}
CPPUNIT_TEST_FIXTURE(Test, testSingleCellTableBorders)
@@ -1036,8 +1036,8 @@ CPPUNIT_TEST_FIXTURE(Test, testSingleCellTableBorders)
// tdf#124399: Extra borders on single cell tables fixed.
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:tcBorders/w:top [@w:val = 'nil']", 1);
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:tcBorders/w:bottom [@w:val = 'nil']", 1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:tcBorders/w:top [@w:val = 'nil']"_ostr, 1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:tcBorders/w:bottom [@w:val = 'nil']"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testInsideBorders)
@@ -1048,7 +1048,7 @@ CPPUNIT_TEST_FIXTURE(Test, testInsideBorders)
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
// If this is not 0, then inside borders are removed.
- assertXPathChildren(pXmlDocument, "/w:document/w:body/w:tbl/w:tr/w:tc[2]/w:tcPr/w:tcBorders", 0);
+ assertXPathChildren(pXmlDocument, "/w:document/w:body/w:tbl/w:tr/w:tc[2]/w:tcPr/w:tcBorders"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testRightBorder)
@@ -1059,7 +1059,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRightBorder)
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
// If the right border is missing like in the bug, then there is a <w:right w:val="nil" /> tag in tcBorders.
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:tcPr/w:tcBorders/w:end [@w:val = 'nil']", 0);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:tcPr/w:tcBorders/w:end [@w:val = 'nil']"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testBottomBorder)
@@ -1070,7 +1070,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBottomBorder)
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
// If there is no bottom border, it is shown in tcBorders.
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:tcPr/w:tcBorders/w:bottom [@w:val = 'nil']", 0);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:tcPr/w:tcBorders/w:bottom [@w:val = 'nil']"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testBottomBorders)
@@ -1081,11 +1081,11 @@ CPPUNIT_TEST_FIXTURE(Test, testBottomBorders)
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[1]/w:tcPr/w:tcBorders/w:bottom [@w:val = 'nil']", 0);
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[2]/w:tcPr/w:tcBorders/w:bottom [@w:val = 'nil']", 0);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[1]/w:tcPr/w:tcBorders/w:bottom [@w:val = 'nil']"_ostr, 0);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[2]/w:tcPr/w:tcBorders/w:bottom [@w:val = 'nil']"_ostr, 0);
// But also don't treat separately merged cells as one - the topmost merged cell shouldn't gain a border.
- assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[4]/w:tcPr/w:tcBorders/w:bottom", 0);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[4]/w:tcPr/w:tcBorders/w:bottom"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testFontTypes)
@@ -1095,11 +1095,11 @@ CPPUNIT_TEST_FIXTURE(Test, testFontTypes)
// Check the font type of the text, should be Consolas.
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r/w:rPr/w:rFonts [@w:ascii='Consolas']", 1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r/w:rPr/w:rFonts [@w:ascii='Consolas']"_ostr, 1);
// Now the font type of the numbering symbols, should be Arial Black.
xmlDocUniquePtr qXmlDocument = parseExport("word/numbering.xml");
- assertXPath(qXmlDocument, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:rPr/w:rFonts [@w:ascii='Arial Black']", 1);
+ assertXPath(qXmlDocument, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:rPr/w:rFonts [@w:ascii='Arial Black']"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testNumberingLevels)
@@ -1111,14 +1111,14 @@ CPPUNIT_TEST_FIXTURE(Test, testNumberingLevels)
// [this assertXPath is not a very good test, since the numbering definition is not set on the paragraph itself,
// but in a style. This just tests the current copy-to-paragraph implementation. But leaving it for now,
// since this example is very much a corner case, so anyone trespassing here should double-check everything...]
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:numPr/w:ilvl [@w:val = '1']", 1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:numPr/w:ilvl [@w:val = '1']"_ostr, 1);
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// Note: _Toc and _Ref hidden bookmarks are imported from OOXML as normal bookmarks.
// Without hiding them from visible bookmarks (SwBookmarkPortion), this line would be
// shown as "A.2.1 [[[[[.DESCRIPTION]]]] with XML layout dump "A.2.1 #_Ref... Bookmark Start..."
- assertXPath(pXmlDoc, "//body/txt[5]/SwParaPortion/SwLineLayout/child::*[1]", "expand", "A.2.1 ");
- assertXPath(pXmlDoc, "//body/txt[5]/SwParaPortion/SwLineLayout/child::*[2]", "portion", ".DESCRIPTION");
+ assertXPath(pXmlDoc, "//body/txt[5]/SwParaPortion/SwLineLayout/child::*[1]"_ostr, "expand"_ostr, "A.2.1 ");
+ assertXPath(pXmlDoc, "//body/txt[5]/SwParaPortion/SwLineLayout/child::*[2]"_ostr, "portion"_ostr, ".DESCRIPTION");
}
CPPUNIT_TEST_FIXTURE(Test, testVerticalBorders)
@@ -1128,7 +1128,7 @@ CPPUNIT_TEST_FIXTURE(Test, testVerticalBorders)
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
// Left and right borders.
- assertXPathChildren(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[3]/w:tcPr/w:tcBorders", 2);
+ assertXPathChildren(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[3]/w:tcPr/w:tcBorders"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(Test, testArrowFlipXY)
@@ -1140,8 +1140,8 @@ CPPUNIT_TEST_FIXTURE(Test, testArrowFlipXY)
OUString arrowStyle = getXPath(pXmlDocument,
"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/"
- "w:pict/v:group/v:shape[@type='_x0000_t32']",
- "style");
+ "w:pict/v:group/v:shape[@type='_x0000_t32']"_ostr,
+ "style"_ostr);
CPPUNIT_ASSERT(arrowStyle.indexOf(u"flip:xy") != sal_Int32(-1));
}
@@ -1153,7 +1153,7 @@ CPPUNIT_TEST_FIXTURE(Test, testArrowPosition)
// This is the correct Y coordinate, the incorrect was 817880.
assertXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor"
- "/wp:positionV/wp:posOffset", "516255");
+ "/wp:positionV/wp:posOffset"_ostr, "516255");
}
CPPUNIT_TEST_FIXTURE(Test, testArrowMarker)
@@ -1164,7 +1164,7 @@ CPPUNIT_TEST_FIXTURE(Test, testArrowMarker)
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor"
- "/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:tailEnd", "type", "arrow");
+ "/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:tailEnd"_ostr, "type"_ostr, "arrow");
}
CPPUNIT_TEST_FIXTURE(Test, testShapeLineWidth)
@@ -1177,7 +1177,7 @@ CPPUNIT_TEST_FIXTURE(Test, testShapeLineWidth)
// "w" attribute was not exported.
assertXPath(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing"
- "/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln", "w", "0");
+ "/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln"_ostr, "w"_ostr, "0");
}
CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorWidthFromLeftMargin)
@@ -1186,7 +1186,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorWidthFromLeftMargin)
// tdf#132976 The size of the width of this shape should come from the size of the left margin.
// It was set to the size of the width of the entire page before.
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "width", "1133");
+ assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds"_ostr, "width"_ostr, "1133");
}
CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorWidthFromInsideOutsideMargin)
@@ -1196,13 +1196,13 @@ CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorWidthFromInsideOutsideMargin)
// The open book: outside --text-- inside | inside --text-- outside
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// Inside
- assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[1]/bounds", "width", "1440");
+ assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[1]/bounds"_ostr, "width"_ostr, "1440");
// Outside
- assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[2]/bounds", "width", "2552");
+ assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[2]/bounds"_ostr, "width"_ostr, "2552");
// Outside
- assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[3]/bounds", "width", "2552");
+ assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[3]/bounds"_ostr, "width"_ostr, "2552");
// Inside
- assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[4]/bounds", "width", "1440");
+ assertXPath(pXmlDoc, "(//anchored/SwAnchoredDrawObject)[4]/bounds"_ostr, "width"_ostr, "1440");
}
CPPUNIT_TEST_FIXTURE(Test, testBodyPrUpright)
@@ -1213,7 +1213,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBodyPrUpright)
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor"
- "/a:graphic/a:graphicData/wps:wsp/wps:bodyPr", "upright", "1");
+ "/a:graphic/a:graphicData/wps:wsp/wps:bodyPr"_ostr, "upright"_ostr, "1");
}
CPPUNIT_TEST_FIXTURE(Test, testLostArrow)
@@ -1226,7 +1226,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLostArrow)
xmlDocUniquePtr pDoc = parseExport("word/document.xml");
assertXPath(pDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor"
- "/a:graphic/a:graphicData/wps:wsp");
+ "/a:graphic/a:graphicData/wps:wsp"_ostr);
}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index e2a43a696080..56a93d695acb 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -98,42 +98,42 @@ CPPUNIT_TEST_FIXTURE(Test, testTrackChangesDeletedParagraphMark)
{
loadAndSave("testTrackChangesDeletedParagraphMark.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:del");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:del"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTrackChangesInsertedParagraphMark)
{
loadAndSave("testTrackChangesInsertedParagraphMark.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:ins");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:ins"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTrackChangesDeletedTableRow)
{
loadAndSave("testTrackChangesDeletedTableRow.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:trPr/w:del");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:trPr/w:del"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTrackChangesInsertedTableRow)
{
loadAndSave("testTrackChangesInsertedTableRow.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:trPr/w:ins");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:trPr/w:ins"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTrackChangesDeletedTableCell)
{
loadAndSave("testTrackChangesDeletedTableCell.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:tcPr/w:cellDel");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:tcPr/w:cellDel"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTrackChangesInsertedTableCell)
{
loadAndSave("testTrackChangesInsertedTableCell.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:tcPr/w:cellIns");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:tcPr/w:cellIns"_ostr);
}
DECLARE_OOXMLEXPORT_TEST(testTextBoxPictureFill, "textbox_picturefill.docx")
@@ -155,21 +155,21 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO73034)
{
loadAndSave("FDO73034.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:u", "val").match("single"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:u"_ostr, "val"_ostr).match("single"));
}
CPPUNIT_TEST_FIXTURE(Test, testFDO71834)
{
loadAndSave("fdo71834.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[2]/w:tc[1]/w:tcPr[1]/w:tcW[1]","type", "dxa");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[2]/w:tc[1]/w:tcPr[1]/w:tcW[1]"_ostr,"type"_ostr, "dxa");
}
CPPUNIT_TEST_FIXTURE(Test, testTrackChangesParagraphProperties)
{
loadAndSave("testTrackChangesParagraphProperties.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathChildren(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pPrChange", 0);
+ assertXPathChildren(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pPrChange"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testMsoSpt180)
@@ -190,7 +190,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo73550)
loadAndSave("fdo73550.docx");
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
// This was wrap="none".
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:rFonts");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:rFonts"_ostr);
}
DECLARE_OOXMLEXPORT_TEST(testPageRelSize, "pagerelsize.docx")
@@ -215,7 +215,7 @@ DECLARE_OOXMLEXPORT_TEST(testRelSizeRound, "rel-size-round.docx")
DECLARE_OOXMLEXPORT_TEST(testTestTitlePage, "testTitlePage.docx")
{
// this has 2 pages in Word
- CPPUNIT_ASSERT_EQUAL(OUString("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), parseDump("/root/page[2]/footer/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), parseDump("/root/page[2]/footer/txt/text()"_ostr));
}
DECLARE_OOXMLEXPORT_TEST(testTableRowDataDisplayedTwice, "table-row-data-displayed-twice.docx")
@@ -238,11 +238,11 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo73556)
* of 3751 from the Grid.
*/
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol", 3);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol"_ostr, 3);
sal_Int32 tableWidth = 0;
- tableWidth += getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol[1]", "w").toInt32();
- tableWidth += getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol[2]", "w").toInt32();
- tableWidth += getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol[3]", "w").toInt32();
+ tableWidth += getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol[1]"_ostr, "w"_ostr).toInt32();
+ tableWidth += getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol[2]"_ostr, "w"_ostr).toInt32();
+ tableWidth += getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol[3]"_ostr, "w"_ostr).toInt32();
CPPUNIT_ASSERT_EQUAL(sal_Int32(3751), tableWidth);
}
@@ -251,7 +251,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSegFaultWhileSave)
loadAndSave("test_segfault_while_save.docx");
// fdo#74499
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6137), getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol[2]", "w").toInt32());
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6137), getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol[2]"_ostr, "w"_ostr).toInt32());
}
CPPUNIT_TEST_FIXTURE(Test, fdo69656)
@@ -266,7 +266,7 @@ CPPUNIT_TEST_FIXTURE(Test, fdo69656)
// Check for the width type of table and its cells.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblW","type","dxa");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblW"_ostr,"type"_ostr,"dxa");
}
CPPUNIT_TEST_FIXTURE(Test, testFdo76741)
@@ -279,9 +279,9 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo76741)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//w:jc", "val", "center");
- assertXPath(pXmlDoc, "//w:tblW", "w", "10081");
- assertXPath(pXmlDoc, "//w:tblW", "type", "dxa");
+ assertXPath(pXmlDoc, "//w:jc"_ostr, "val"_ostr, "center");
+ assertXPath(pXmlDoc, "//w:tblW"_ostr, "w"_ostr, "10081");
+ assertXPath(pXmlDoc, "//w:tblW"_ostr, "type"_ostr, "dxa");
}
CPPUNIT_TEST_FIXTURE(Test, testFdo73541)
@@ -290,28 +290,28 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo73541)
// fdo#73541: The mirrored margins were not imported and mapped correctly in Page Layout
// Hence <w:mirrorMargins /> tag was not exported back in settings.xml
xmlDocUniquePtr pXmlDoc = parseExport("word/settings.xml");
- assertXPath(pXmlDoc, "/w:settings/w:mirrorMargins");
+ assertXPath(pXmlDoc, "/w:settings/w:mirrorMargins"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testFdo106029)
{
loadAndSave("fdo106029.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/settings.xml");
- assertXPath(pXmlDoc, "/w:settings/w:compat/w:doNotExpandShiftReturn");
+ assertXPath(pXmlDoc, "/w:settings/w:compat/w:doNotExpandShiftReturn"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf146515)
{
loadAndSave("tdf146515.odt");
xmlDocUniquePtr pXmlDoc = parseExport("word/settings.xml");
- assertXPath(pXmlDoc, "/w:settings/w:compat/w:usePrinterMetrics");
+ assertXPath(pXmlDoc, "/w:settings/w:compat/w:usePrinterMetrics"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testFDO74106)
{
loadAndSave("FDO74106.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt", "val","hebrew1");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt"_ostr, "val"_ostr,"hebrew1");
}
CPPUNIT_TEST_FIXTURE(Test, testFDO74215)
@@ -327,7 +327,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO74215)
// On 96 DPI "width:11.25pt;height:11.25pt"; on 120 DPI "width:9pt;height:9pt"
const OUString sStyle
- = getXPath(pXmlDoc, "/w:numbering/w:numPicBullet[2]/w:pict/v:shape", "style");
+ = getXPath(pXmlDoc, "/w:numbering/w:numPicBullet[2]/w:pict/v:shape"_ostr, "style"_ostr);
{
OUString sWidth = sStyle.getToken(0, ';');
CPPUNIT_ASSERT(sWidth.startsWith("width:", &sWidth));
@@ -356,7 +356,7 @@ DECLARE_OOXMLEXPORT_TEST(testColumnBreak_ColumnCountIsZero,"fdo74153.docx")
if (isExported())
{
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:br","type","column");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:br"_ostr,"type"_ostr,"column");
}
//tdf76349 match Word's behavior of treating breaks in single columns as page breaks.
@@ -386,7 +386,7 @@ CPPUNIT_TEST_FIXTURE(Test, testIndentation)
// attributes gets added(w:right=0 & w:left=0) if these attributes are not set in original document.
// This test is to verify <w:ind> does not contain w:right attribute.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:ind", "end");
+ assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:ind"_ostr, "end"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testChartInFooter)
@@ -399,27 +399,27 @@ CPPUNIT_TEST_FIXTURE(Test, testChartInFooter)
// Check footer2.xml.rels contains in doc after roundtrip.
// Check Id = rId1 in footer2.xml.rels
- assertXPath(pXmlDoc,"/rels:Relationships/rels:Relationship","Id","rId1");
+ assertXPath(pXmlDoc,"/rels:Relationships/rels:Relationship"_ostr,"Id"_ostr,"rId1");
assertXPath(pXmlDoc,
- "/rels:Relationships/rels:Relationship[@Id='rId1']",
- "Type",
+ "/rels:Relationships/rels:Relationship[@Id='rId1']"_ostr,
+ "Type"_ostr,
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart");
xmlDocUniquePtr pXmlDocCT = parseExport("[Content_Types].xml");
assertXPath(pXmlDocCT,
- "/ContentType:Types/ContentType:Override[@PartName='/word/charts/chart1.xml']",
- "ContentType",
+ "/ContentType:Types/ContentType:Override[@PartName='/word/charts/chart1.xml']"_ostr,
+ "ContentType"_ostr,
"application/vnd.openxmlformats-officedocument.drawingml.chart+xml");
// check the content too
xmlDocUniquePtr pXmlDocFooter2 = parseExport("word/footer2.xml");
assertXPath(pXmlDocFooter2,
- "/w:ftr/w:p[1]/w:r/w:drawing/wp:inline/a:graphic/a:graphicData",
- "uri",
+ "/w:ftr/w:p[1]/w:r/w:drawing/wp:inline/a:graphic/a:graphicData"_ostr,
+ "uri"_ostr,
"http://schemas.openxmlformats.org/drawingml/2006/chart");
assertXPath(pXmlDocFooter2,
- "/w:ftr/w:p[1]/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/c:chart",
- "id",
+ "/w:ftr/w:p[1]/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/c:chart"_ostr,
+ "id"_ostr,
"rId1");
CPPUNIT_ASSERT_EQUAL(1, getShapes());
@@ -466,10 +466,10 @@ CPPUNIT_TEST_FIXTURE(Test, testAbi11739)
// Validation test: order of elements were wrong.
xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml");
// Order was: uiPriority, link, basedOn.
- CPPUNIT_ASSERT(getXPathPosition(pXmlDoc, "/w:styles/w:style[3]", "basedOn") < getXPathPosition(pXmlDoc, "/w:styles/w:style[3]", "link"));
- CPPUNIT_ASSERT(getXPathPosition(pXmlDoc, "/w:styles/w:style[3]", "link") < getXPathPosition(pXmlDoc, "/w:styles/w:style[3]", "uiPriority"));
+ CPPUNIT_ASSERT(getXPathPosition(pXmlDoc, "/w:styles/w:style[3]"_ostr, "basedOn") < getXPathPosition(pXmlDoc, "/w:styles/w:style[3]"_ostr, "link"));
+ CPPUNIT_ASSERT(getXPathPosition(pXmlDoc, "/w:styles/w:style[3]"_ostr, "link") < getXPathPosition(pXmlDoc, "/w:styles/w:style[3]"_ostr, "uiPriority"));
// Order was: qFormat, unhideWhenUsed.
- CPPUNIT_ASSERT(getXPathPosition(pXmlDoc, "/w:styles/w:style[11]", "unhideWhenUsed") < getXPathPosition(pXmlDoc, "/w:styles/w:style[11]", "qFormat"));
+ CPPUNIT_ASSERT(getXPathPosition(pXmlDoc, "/w:styles/w:style[11]"_ostr, "unhideWhenUsed") < getXPathPosition(pXmlDoc, "/w:styles/w:style[11]"_ostr, "qFormat"));
}
DECLARE_OOXMLEXPORT_TEST(testEmbeddedXlsx, "embedded-xlsx.docx")
@@ -483,7 +483,7 @@ DECLARE_OOXMLEXPORT_TEST(testEmbeddedXlsx, "embedded-xlsx.docx")
if (!isExported())
return;
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/w:object", 2);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/w:object"_ostr, 2);
// finally check the embedded files are present in the zipped document
uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL());
@@ -512,7 +512,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNumberedLists_StartingWithZero)
xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml");
// Check that we do _not_ export w:start for <w:lvl w:ilvl="0">.
- assertXPath(pXmlDoc, "w:numbering/w:abstractNum[1]/w:lvl[1]/w:start", 0);
+ assertXPath(pXmlDoc, "w:numbering/w:abstractNum[1]/w:lvl[1]/w:start"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testPageBreak)
@@ -529,7 +529,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPageBreak)
uno::Reference<text::XTextRange> xParagraph4 = getParagraph(4);
getRun(xParagraph2, 1, "First Page Second Line");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:br","type","page");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:br"_ostr,"type"_ostr,"page");
getRun(xParagraph4, 1, "Second Page First line after Page Break");
}
@@ -538,25 +538,25 @@ CPPUNIT_TEST_FIXTURE(Test, testOleObject)
loadAndSave("test_ole_object.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object/v:shape/v:imagedata",
- "o:title");
+ assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object/v:shape/v:imagedata"_ostr,
+ "o:title"_ostr);
assertXPath(pXmlDoc,
- "/w:document/w:body/w:p[2]/w:r/w:object/o:OLEObject",
- "DrawAspect",
+ "/w:document/w:body/w:p[2]/w:r/w:object/o:OLEObject"_ostr,
+ "DrawAspect"_ostr,
"Content");
// TODO: ProgID="Package" - what is this? Zip with 10k extra header?
// check the rels too
xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels");
assertXPath(pXmlDocRels,
- "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.bin']",
- "Type",
+ "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.bin']"_ostr,
+ "Type"_ostr,
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject");
// check the media type too
xmlDocUniquePtr pXmlDocCT = parseExport("[Content_Types].xml");
assertXPath(pXmlDocCT,
- "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/oleObject1.bin']",
- "ContentType",
+ "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/oleObject1.bin']"_ostr,
+ "ContentType"_ostr,
"application/vnd.openxmlformats-officedocument.oleObject");
}
@@ -570,7 +570,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo74792)
* Added support to grabbag the rels, with associated images.
*/
xmlDocUniquePtr pXmlDoc = parseExport("word/diagrams/_rels/data1.xml.rels");
- assertXPath(pXmlDoc,"/rels:Relationships/rels:Relationship", 4);
+ assertXPath(pXmlDoc,"/rels:Relationships/rels:Relationship"_ostr, 4);
uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(
comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL());
@@ -590,8 +590,8 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo77718)
xmlDocUniquePtr pXmlDataRels2 = parseExport("word/diagrams/_rels/data2.xml.rels");
//ensure that the rels file is present.
- assertXPath(pXmlDataRels1,"/rels:Relationships/rels:Relationship", 4);
- assertXPath(pXmlDataRels2,"/rels:Relationships/rels:Relationship", 4);
+ assertXPath(pXmlDataRels1,"/rels:Relationships/rels:Relationship"_ostr, 4);
+ assertXPath(pXmlDataRels2,"/rels:Relationships/rels:Relationship"_ostr, 4);
uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(
comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL());
@@ -610,7 +610,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableCurruption)
loadAndSave("tableCurrupt.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/header2.xml");
CPPUNIT_ASSERT(pXmlDoc) ;
- assertXPath(pXmlDoc, "/w:hdr/w:tbl[1]/w:tr[1]/w:tc[1]",1);
+ assertXPath(pXmlDoc, "/w:hdr/w:tbl[1]/w:tr[1]/w:tc[1]"_ostr,1);
// tdf#116549: header paragraph should not have a bottom border.
uno::Reference<text::XText> xHeaderText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("First Page"), "HeaderText");
@@ -623,10 +623,10 @@ CPPUNIT_TEST_FIXTURE(Test, testDateControl)
loadAndSave("date-control.docx");
// check XML
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:date", "fullDate", "2014-03-05T00:00:00Z");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:date/w:dateFormat", "val", "dddd, dd' de 'MMMM' de 'yyyy");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:date/w:lid", "val", "es-ES");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:t", u"mi\u00E9rcoles, 05 de marzo de 2014"_ustr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:date"_ostr, "fullDate"_ostr, "2014-03-05T00:00:00Z");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:date/w:dateFormat"_ostr, "val"_ostr, "dddd, dd' de 'MMMM' de 'yyyy");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:date/w:lid"_ostr, "val"_ostr, "es-ES");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:t"_ostr, u"mi\u00E9rcoles, 05 de marzo de 2014"_ustr);
}
CPPUNIT_TEST_FIXTURE(Test, test_Tdf115030)
@@ -635,9 +635,9 @@ CPPUNIT_TEST_FIXTURE(Test, test_Tdf115030)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
sal_Unicode aDot = {0x02D9};
sal_Unicode aDobleDot = {0x00A8};
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[1]/m:acc/m:accPr/m:chr", "val", OUString(aDot));
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[2]/m:acc/m:accPr/m:chr", "val", OUString(aDobleDot));
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/m:oMathPara/m:oMath[1]/m:acc/m:accPr/m:chr", "val", OUString(aDot));
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[1]/m:acc/m:accPr/m:chr"_ostr, "val"_ostr, OUString(aDot));
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[2]/m:acc/m:accPr/m:chr"_ostr, "val"_ostr, OUString(aDobleDot));
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/m:oMathPara/m:oMath[1]/m:acc/m:accPr/m:chr"_ostr, "val"_ostr, OUString(aDot));
}
CPPUNIT_TEST_FIXTURE(Test, test_OpeningBrace)
@@ -645,14 +645,14 @@ CPPUNIT_TEST_FIXTURE(Test, test_OpeningBrace)
loadAndSave("2120112713_OpenBrace.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Checking for OpeningBrace tag
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[1]/m:d[1]/m:dPr[1]/m:begChr[1]","val","");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[1]/m:d[1]/m:dPr[1]/m:begChr[1]"_ostr,"val"_ostr,"");
}
CPPUNIT_TEST_FIXTURE(Test, test_Tdf132305)
{
loadAndSave("tdf132305.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[1]/m:bar/m:barPr/m:pos","val","top");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[1]/m:bar/m:barPr/m:pos"_ostr,"val"_ostr,"top");
}
// Checks that all runs of the field have text properties.
@@ -699,26 +699,26 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf38778)
static constexpr OUString pszCs(u"20"_ustr);
// w:fldCharType="begin"
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w:sz", "val", psz);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w:szCs", "val", pszCs);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w:sz"_ostr, "val"_ostr, psz);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w:szCs"_ostr, "val"_ostr, pszCs);
// PAGE
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[4]/w:rPr/w:sz", "val", psz);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[4]/w:rPr/w:szCs", "val", pszCs);
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[4]/w:instrText", " PAGE ");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[4]/w:rPr/w:sz"_ostr, "val"_ostr, psz);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[4]/w:rPr/w:szCs"_ostr, "val"_ostr, pszCs);
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[4]/w:instrText"_ostr, " PAGE ");
// w:fldCharType="separate"
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[5]/w:rPr/w:sz", "val", psz);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[5]/w:rPr/w:szCs", "val", pszCs);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[5]/w:rPr/w:sz"_ostr, "val"_ostr, psz);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[5]/w:rPr/w:szCs"_ostr, "val"_ostr, pszCs);
// field result: 1
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[6]/w:rPr/w:sz", "val", psz);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[6]/w:rPr/w:szCs", "val", pszCs);
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[6]/w:t", "1"); // field result
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[6]/w:rPr/w:sz"_ostr, "val"_ostr, psz);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[6]/w:rPr/w:szCs"_ostr, "val"_ostr, pszCs);
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[6]/w:t"_ostr, "1"); // field result
// w:fldCharType="end"
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[7]/w:rPr/w:sz", "val", psz);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[7]/w:rPr/w:szCs", "val", pszCs);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[7]/w:rPr/w:sz"_ostr, "val"_ostr, psz);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[7]/w:rPr/w:szCs"_ostr, "val"_ostr, pszCs);
// tdf#127862: page fill color (in this case white) was lost
uno::Reference<beans::XPropertySet> xStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY);
@@ -730,7 +730,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO76312)
loadAndSave("FDO76312.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]"_ostr);
}
void Test::verifyComboBoxExport(bool aComboBoxAsDropDown)
@@ -773,9 +773,9 @@ CPPUNIT_TEST_FIXTURE(Test, testComboBoxControl)
loadAndSave("combobox-control.docx");
// check XML
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dropDownList/w:listItem[1]", "value", "manolo");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dropDownList/w:listItem[2]", "value", "pepito");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:t", "Manolo");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dropDownList/w:listItem[1]"_ostr, "value"_ostr, "manolo");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dropDownList/w:listItem[2]"_ostr, "value"_ostr, "pepito");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:t"_ostr, "Manolo");
// check imported control
verifyComboBoxExport(getShapes() == 0);
@@ -810,9 +810,9 @@ CPPUNIT_TEST_FIXTURE(Test, testCheckBoxControl)
loadAndSave("checkbox-control.docx");
// check XML
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w14:checkbox/w14:checked", "val", "1");
- assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w14:checkbox/w14:checkedState", "val", "2612");
- assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w14:checkbox/w14:uncheckedState", "val", "2610");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w14:checkbox/w14:checked"_ostr, "val"_ostr, "1");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w14:checkbox/w14:checkedState"_ostr, "val"_ostr, "2612");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w14:checkbox/w14:uncheckedState"_ostr, "val"_ostr, "2610");
// TODO: import control and add a check here
}
@@ -827,8 +827,8 @@ CPPUNIT_TEST_FIXTURE(Test, testParagraphWithComments)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
xmlDocUniquePtr pXmlComm = parseExport("word/comments.xml");
- sal_Int32 idInDocXml = getXPath(pXmlDoc,"/w:document/w:body/w:p[3]/w:commentRangeEnd[1]","id").toInt32();
- sal_Int32 idInCommentXml = getXPath(pXmlComm,"/w:comments/w:comment[1]","id").toInt32();
+ sal_Int32 idInDocXml = getXPath(pXmlDoc,"/w:document/w:body/w:p[3]/w:commentRangeEnd[1]"_ostr,"id"_ostr).toInt32();
+ sal_Int32 idInCommentXml = getXPath(pXmlComm,"/w:comments/w:comment[1]"_ostr,"id"_ostr).toInt32();
CPPUNIT_ASSERT_EQUAL( idInDocXml, idInCommentXml );
}
@@ -857,26 +857,26 @@ CPPUNIT_TEST_FIXTURE(Test, testOLEObjectinHeader)
// for headers were missing from document/word/rels.
xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/header2.xml.rels");
- assertXPath(pXmlDoc,"/rels:Relationships/rels:Relationship[1]","Id","rId1");
+ assertXPath(pXmlDoc,"/rels:Relationships/rels:Relationship[1]"_ostr,"Id"_ostr,"rId1");
xmlDocUniquePtr pXmlDocCT = parseExport("[Content_Types].xml");
// check the media type too
assertXPath(pXmlDocCT,
- "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/oleObject1.bin']",
- "ContentType",
+ "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/oleObject1.bin']"_ostr,
+ "ContentType"_ostr,
"application/vnd.openxmlformats-officedocument.oleObject");
// check the content too
xmlDocUniquePtr pXmlDocHeader2 = parseExport("word/header2.xml");
assertXPath(pXmlDocHeader2,
- "/w:hdr/w:tbl/w:tr[1]/w:tc[2]/w:p[1]/w:r/w:object/o:OLEObject",
- "ProgID",
+ "/w:hdr/w:tbl/w:tr[1]/w:tc[2]/w:p[1]/w:r/w:object/o:OLEObject"_ostr,
+ "ProgID"_ostr,
"Word.Picture.8");
xmlDocUniquePtr pXmlDocHeader3 = parseExport("word/header3.xml");
assertXPath(pXmlDocHeader2,
- "/w:hdr/w:tbl/w:tr[1]/w:tc[2]/w:p[1]/w:r/w:object/o:OLEObject",
- "ProgID",
+ "/w:hdr/w:tbl/w:tr[1]/w:tc[2]/w:p[1]/w:r/w:object/o:OLEObject"_ostr,
+ "ProgID"_ostr,
"Word.Picture.8");
}
@@ -885,7 +885,7 @@ CPPUNIT_TEST_FIXTURE(Test, test_ClosingBrace)
loadAndSave("2120112713.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Checking for ClosingBrace tag
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[1]/m:d[2]/m:dPr[1]/m:endChr[1]","val","");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[1]/m:d[2]/m:dPr[1]/m:endChr[1]"_ostr,"val"_ostr,"");
// tdf#154371 paragraph style Подзаголовок ур3 inherits from Heading 3 (includes list level and list id)
uno::Reference<beans::XPropertySet> xParaStyle(getStyles("ParagraphStyles")->getByName(u"Подзаголовок ур3"_ustr), uno::UNO_QUERY);
@@ -897,7 +897,7 @@ CPPUNIT_TEST_FIXTURE(Test, testlvlPicBulletId)
{
loadAndSave("lvlPicBulletId.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml");
- assertXPath(pXmlDoc, "/w:numbering[1]/w:abstractNum[1]/w:lvl[1]/w:lvlPicBulletId[1]", 0);
+ assertXPath(pXmlDoc, "/w:numbering[1]/w:abstractNum[1]/w:lvl[1]/w:lvlPicBulletId[1]"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testSdtContent)
@@ -932,8 +932,8 @@ CPPUNIT_TEST_FIXTURE(Test, testFileWithInvalidImageLink)
assertXPathNoAttribute(pXmlDoc,
"/w:document/w:body/w:p[2]/w:r[2]/w:drawing[1]/wp:inline[1]/"
- "a:graphic[1]/a:graphicData[1]/pic:pic[1]/pic:blipFill[1]/a:blip[1]",
- "embed");
+ "a:graphic[1]/a:graphicData[1]/pic:pic[1]/pic:blipFill[1]/a:blip[1]"_ostr,
+ "embed"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testContentTypeDOCX)
@@ -942,20 +942,20 @@ CPPUNIT_TEST_FIXTURE(Test, testContentTypeDOCX)
xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml");
assertXPath(pXmlDoc,
- "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/oleObject1.docx']",
- "ContentType",
+ "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/oleObject1.docx']"_ostr,
+ "ContentType"_ostr,
"application/vnd.openxmlformats-officedocument.wordprocessingml.document");
// check the rels too
xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels");
assertXPath(pXmlDocRels,
- "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.docx']",
- "Type",
+ "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.docx']"_ostr,
+ "Type"_ostr,
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
// check the content too
xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml");
assertXPath(pXmlDocContent,
- "/w:document/w:body/w:p[6]/w:r/w:object/o:OLEObject",
- "ProgID",
+ "/w:document/w:body/w:p[6]/w:r/w:object/o:OLEObject"_ostr,
+ "ProgID"_ostr,
"Word.Document.12");
}
@@ -964,19 +964,19 @@ CPPUNIT_TEST_FIXTURE(Test, testContentTypeXLSM)
loadAndSave("fdo76098.docx");
xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml");
- assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/Microsoft_Excel_Macro-Enabled_Worksheet1.xlsm']", "ContentType", "application/vnd.ms-excel.sheet.macroEnabled.12");
+ assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/Microsoft_Excel_Macro-Enabled_Worksheet1.xlsm']"_ostr, "ContentType"_ostr, "application/vnd.ms-excel.sheet.macroEnabled.12");
// check the rels too
xmlDocUniquePtr pXmlDocRels = parseExport("word/charts/_rels/chart1.xml.rels");
assertXPath(pXmlDocRels,
- "/rels:Relationships/rels:Relationship[@Target='../embeddings/Microsoft_Excel_Macro-Enabled_Worksheet1.xlsm']",
- "Type",
+ "/rels:Relationships/rels:Relationship[@Target='../embeddings/Microsoft_Excel_Macro-Enabled_Worksheet1.xlsm']"_ostr,
+ "Type"_ostr,
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
// check the content too
xmlDocUniquePtr pXmlDocChart1 = parseExport("word/charts/chart1.xml");
assertXPath(pXmlDocChart1,
- "/c:chartSpace/c:externalData",
- "id",
+ "/c:chartSpace/c:externalData"_ostr,
+ "id"_ostr,
"rId1");
}
@@ -985,7 +985,7 @@ CPPUNIT_TEST_FIXTURE(Test, test76108)
loadAndSave("test76108.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
//docx file after RT is getting corrupted.
- assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:fldChar[1]", "fldCharType", "begin");
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:fldChar[1]"_ostr, "fldCharType"_ostr, "begin");
}
CPPUNIT_TEST_FIXTURE(Test, testTCTagMisMatch)
@@ -995,8 +995,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTCTagMisMatch)
// there was a TC tag mismatch which resulted into a crash.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]/w:tr[1]/w:tc[1]",0);
- assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]", 1);
+ assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]/w:tr[1]/w:tc[1]"_ostr,0);
+ assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testFDO78292)
@@ -1004,7 +1004,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO78292)
loadAndSave("FDO78292.docx");
//text node is a leaf node, it should not have any children
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc,"/w:document/w:body/w:p[14]/w:sdt[3]/w:sdtPr[1]/w:text/w14:checked",0);
+ assertXPath(pXmlDoc,"/w:document/w:body/w:p[14]/w:sdt[3]/w:sdtPr[1]/w:text/w14:checked"_ostr,0);
}
CPPUNIT_TEST_FIXTURE(Test, testSimpleSdts)
@@ -1012,12 +1012,12 @@ CPPUNIT_TEST_FIXTURE(Test, testSimpleSdts)
loadAndSave("simple-sdts.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:sdt/w:sdtPr/w:text", 1);
- assertXPath(pXmlDoc, "//*/w:sdt/w:sdtPr/w:id", 5);
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:lock", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:sdt[1]/w:sdtPr/w:picture", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:sdt[2]/w:sdtPr/w:group", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:sdt/w:sdtPr/w:citation", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:sdt/w:sdtPr/w:text"_ostr, 1);
+ assertXPath(pXmlDoc, "//*/w:sdt/w:sdtPr/w:id"_ostr, 5);
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:lock"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sdt[1]/w:sdtPr/w:picture"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sdt[2]/w:sdtPr/w:group"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:sdt/w:sdtPr/w:citation"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testEmbeddedExcelChart)
@@ -1026,22 +1026,22 @@ CPPUNIT_TEST_FIXTURE(Test, testEmbeddedExcelChart)
xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml");
assertXPath(pXmlDoc,
- "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/oleObject1.xls']",
- "ContentType",
+ "/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/oleObject1.xls']"_ostr,
+ "ContentType"_ostr,
"application/vnd.ms-excel");
// check the rels too
xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels");
assertXPath(pXmlDocRels,
- "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.xls']",
- "Type",
+ "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.xls']"_ostr,
+ "Type"_ostr,
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject");
// check the content too
xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml");
assertXPath(pXmlDocContent,
- "/w:document/w:body/w:p/w:r/w:object/o:OLEObject",
- "ProgID",
+ "/w:document/w:body/w:p/w:r/w:object/o:OLEObject"_ostr,
+ "ProgID"_ostr,
"Excel.Chart.8");
}
@@ -1072,7 +1072,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf92521)
CPPUNIT_ASSERT_EQUAL(2, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// There should be a section break that's in the middle of the document: right after the table.
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:sectPr", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:sectPr"_ostr, 1);
}
DECLARE_OOXMLEXPORT_TEST(testTdf102466, "tdf102466.docx")
@@ -1081,8 +1081,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf102466, "tdf102466.docx")
// More precisely, the table in the first page was clipped.
{
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- sal_Int32 nFlyPrtHeight = getXPath(pXmlDoc, "(/root/page[1]//anchored/fly)[1]/infos/prtBounds", "height").toInt32();
- sal_Int32 nTableHeight = getXPath(pXmlDoc, "(/root/page[1]//anchored/fly)[1]/tab/infos/bounds", "height").toInt32();
+ sal_Int32 nFlyPrtHeight = getXPath(pXmlDoc, "(/root/page[1]//anchored/fly)[1]/infos/prtBounds"_ostr, "height"_ostr).toInt32();
+ sal_Int32 nTableHeight = getXPath(pXmlDoc, "(/root/page[1]//anchored/fly)[1]/tab/infos/bounds"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_MESSAGE("The table is clipped in a fly frame.", nFlyPrtHeight >= nTableHeight);
}
@@ -1118,7 +1118,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf99090_pgbrkAfterTable)
loadAndSave("tdf99090_pgbrkAfterTable.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// There should be a regular page break that's in the middle of the document: right after the table.
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br"_ostr, 1);
}
DECLARE_OOXMLEXPORT_TEST(testTdf96750_landscapeFollow, "tdf96750_landscapeFollow.docx")
@@ -1174,17 +1174,17 @@ DECLARE_OOXMLEXPORT_TEST(testTdf90697_continuousBreaksComplex2,"tdf92724_continu
DECLARE_OOXMLEXPORT_TEST(testTdf95367_inheritFollowStyle, "tdf95367_inheritFollowStyle.docx")
{
- CPPUNIT_ASSERT_EQUAL(OUString("header"), parseDump("/root/page[2]/header/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("header"), parseDump("/root/page[2]/header/txt/text()"_ostr));
}
DECLARE_OOXMLEXPORT_TEST(testInheritFirstHeader,"inheritFirstHeader.docx")
{
// First page headers always link to last used first header, never to a follow header
- CPPUNIT_ASSERT_EQUAL(OUString("First Header"), parseDump("/root/page[1]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Follow Header"), parseDump("/root/page[2]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Follow Header"), parseDump("/root/page[3]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("First Header"), parseDump("/root/page[4]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Last Header"), parseDump("/root/page[5]/header/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("First Header"), parseDump("/root/page[1]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Follow Header"), parseDump("/root/page[2]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Follow Header"), parseDump("/root/page[3]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("First Header"), parseDump("/root/page[4]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Last Header"), parseDump("/root/page[5]/header/txt/text()"_ostr));
}
#if HAVE_MORE_FONTS
@@ -1212,8 +1212,8 @@ CPPUNIT_TEST_FIXTURE(Test, testDocxTablePosition)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// the exported positions were wrong due to some missing shifting in the export code
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblpPr", "tblpX", "3494");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblpPr", "tblpY", "4611");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblpPr"_ostr, "tblpX"_ostr, "3494");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblpPr"_ostr, "tblpY"_ostr, "4611");
}
#if 0
// FIXME:
@@ -1276,11 +1276,11 @@ CPPUNIT_TEST_FIXTURE(Test, testUnderlineColorGroupedShapes)
// tdf#132491 : Check if correct color is used for underline.
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor"
- "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "color", "FF0000");
+ "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u"_ostr, "color"_ostr, "FF0000");
assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor"
- "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[2]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "color", "00B050");
+ "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[2]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u"_ostr, "color"_ostr, "00B050");
assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor"
- "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[3]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "color");
+ "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[3]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u"_ostr, "color"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorWidthFromRightMargin)
@@ -1288,7 +1288,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRelativeAnchorWidthFromRightMargin)
loadAndSave("tdf133670_testRelativeAnchorWidthFromRightMargin.docx");
// tdf#133670 The width was set relative from right margin, but this was handled relative from page width.
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- auto nWidth = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "width").toInt32();
+ auto nWidth = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds"_ostr, "width"_ostr).toInt32();
CPPUNIT_ASSERT_DOUBLES_EQUAL(2408, nWidth, 1);
}
@@ -1298,9 +1298,9 @@ CPPUNIT_TEST_FIXTURE(Test, testAutoFitForLegacyShapes)
// tdf#112312: check if noAutoFit is used instead of spAutoFit even if the TextAutoGrowHeight is set
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:bodyPr/a:noAutofit");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:bodyPr/a:noAutofit"_ostr);
assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:bodyPr", "a:spAutofit");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:bodyPr"_ostr, "a:spAutofit"_ostr);
}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index 007de7af930f..db504be317c1 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -31,7 +31,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO76248)
loadAndSave("FDO76248.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// In two cases the a:graphicData elements had no children, which is invalid.
- assertXPath(pXmlDoc, "//a:graphicData[not(*)]", 0);
+ assertXPath(pXmlDoc, "//a:graphicData[not(*)]"_ostr, 0);
}
DECLARE_OOXMLEXPORT_TEST(testTscp, "tscp.docx")
@@ -83,7 +83,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo76589 )
*/
xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml");
- assertXPath ( pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:lvlText","val","%1" );
+ assertXPath ( pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:lvlText"_ostr,"val"_ostr,"%1" );
}
CPPUNIT_TEST_FIXTURE(Test, testDecimalNumberingNoLeveltext)
@@ -91,7 +91,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDecimalNumberingNoLeveltext)
loadAndSave("decimal-numbering-no-leveltext.docx");
// This was "%1", not empty: we turned a kind-of-none numbering into a decimal one.
xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:lvlText","val","");
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:lvlText"_ostr,"val"_ostr,"");
}
CPPUNIT_TEST_FIXTURE(Test, testNoDuplicateAttributeExport)
@@ -113,7 +113,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo79008)
// tdf#134951: there is only one comment
xmlDocUniquePtr pXmlSettings = parseExport("word/comments.xml");
- assertXPath(pXmlSettings, "/w:comments/w:comment", 1);
+ assertXPath(pXmlSettings, "/w:comments/w:comment"_ostr, 1);
// Read-only is set, but it is not enforced, so it should be off...
SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get());
@@ -126,8 +126,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf120852_readOnlyProtection, "tdf120852_readOnlyPr
if (isExported())
{
xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml");
- assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "enforcement", "1");
- assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "edit", "readOnly");
+ assertXPath(pXmlSettings, "/w:settings/w:documentProtection"_ostr, "enforcement"_ostr, "1");
+ assertXPath(pXmlSettings, "/w:settings/w:documentProtection"_ostr, "edit"_ostr, "readOnly");
}
// Read-only is set, so Enforcement must enable it.
@@ -158,8 +158,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf120852_readOnlyUnProtected, "tdf120852_readOnlyU
{
CPPUNIT_ASSERT_MESSAGE("Section is protected", getProperty<bool>(xSect, "IsProtected"));
xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml");
- assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "edit", "forms");
- assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "enforcement", "true");
+ assertXPath(pXmlSettings, "/w:settings/w:documentProtection"_ostr, "edit"_ostr, "forms");
+ assertXPath(pXmlSettings, "/w:settings/w:documentProtection"_ostr, "enforcement"_ostr, "true");
}
}
@@ -168,8 +168,8 @@ CPPUNIT_TEST_FIXTURE(Test, testAuthorPropertySdt)
loadAndSave("author-property.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "xpath", "/ns1:coreProperties[1]/ns0:creator[1]");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "storeItemID","{6C3C8BC8-F283-45AE-878A-BAB7291924A1}");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding"_ostr, "xpath"_ostr, "/ns1:coreProperties[1]/ns0:creator[1]");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding"_ostr, "storeItemID"_ostr,"{6C3C8BC8-F283-45AE-878A-BAB7291924A1}");
// FIXME: the next property doesn't match, though it's correct in theory. A bug in assertXPath?
// assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "prefixMappings",
// "xmlns:ns0='http://purl.org/dc/elements/1.1/' xmlns:ns1='http://schemas.openxmlformats.org/package/2006/metadata/core-properties'");
@@ -186,16 +186,16 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO76586)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// there is only one table in the test file
- assertXPath(pXmlDoc, "//w:tblGrid/w:gridCol[1]", "w", "1601");
- assertXPath(pXmlDoc, "//w:tblGrid/w:gridCol[2]", "w", "7843");
+ assertXPath(pXmlDoc, "//w:tblGrid/w:gridCol[1]"_ostr, "w"_ostr, "1601");
+ assertXPath(pXmlDoc, "//w:tblGrid/w:gridCol[2]"_ostr, "w"_ostr, "7843");
}
CPPUNIT_TEST_FIXTURE(Test, testFDO76587 )
{
loadAndSave("fdo76587.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml");
- assertXPath(pXmlDoc, "/w:styles/w:style[8]/w:pPr/w:spacing", "line", "240");
- assertXPath(pXmlDoc, "/w:styles/w:style[8]/w:pPr/w:spacing", "lineRule", "auto");
+ assertXPath(pXmlDoc, "/w:styles/w:style[8]/w:pPr/w:spacing"_ostr, "line"_ostr, "240");
+ assertXPath(pXmlDoc, "/w:styles/w:style[8]/w:pPr/w:spacing"_ostr, "lineRule"_ostr, "auto");
}
CPPUNIT_TEST_FIXTURE(Test, testFDO77890 )
@@ -207,7 +207,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO77890 )
For additional comments please refer to https://www.libreoffice.org/bugzilla/show_bug.cgi?id=77890#c2
*/
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:br", "type", "page");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:br"_ostr, "type"_ostr, "page");
}
CPPUNIT_TEST_FIXTURE(Test, testNumberedList)
@@ -215,13 +215,13 @@ CPPUNIT_TEST_FIXTURE(Test, testNumberedList)
loadAndReload("NumberedList.docx");
//fdo74150:In document.xml, for pStyle = "NumberedList1", iLvl and numId was not preserved
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr[1]/w:pStyle", "val", "NumberedList1");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr[1]/w:numPr/w:ilvl","val", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr[1]/w:numPr/w:numId","val", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr[1]/w:pStyle"_ostr, "val"_ostr, "NumberedList1");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr[1]/w:numPr/w:ilvl"_ostr,"val"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr[1]/w:numPr/w:numId"_ostr,"val"_ostr, "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[3]/w:pPr[1]/w:pStyle","val", "NumberedList1");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[3]/w:pPr[1]/w:numPr/w:ilvl","val", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[3]/w:pPr[1]/w:numPr/w:numId","val", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[3]/w:pPr[1]/w:pStyle"_ostr,"val"_ostr, "NumberedList1");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[3]/w:pPr[1]/w:numPr/w:ilvl"_ostr,"val"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[3]/w:pPr[1]/w:numPr/w:numId"_ostr,"val"_ostr, "0");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf131819)
@@ -230,8 +230,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf131819)
// keep width of fixed size cells in the nested table
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// These were 4030 and 4249.
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblGrid/w:gridCol[1]", "w", "3841");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblGrid/w:gridCol[2]", "w", "4049");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblGrid/w:gridCol[1]"_ostr, "w"_ostr, "3841");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblGrid/w:gridCol[2]"_ostr, "w"_ostr, "4049");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf131959)
@@ -240,8 +240,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf131959)
// import tblInd from table style
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// These were 0.
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblInd", "w", "360");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblInd", "w", "360");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblInd"_ostr, "w"_ostr, "360");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblInd"_ostr, "w"_ostr, "360");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf131203)
@@ -249,7 +249,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf131203)
loadAndSave("tdf131203.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// loading thrown divide_by_zero()
- assertXPath(pXmlDoc, "//w:tbl", 2);
+ assertXPath(pXmlDoc, "//w:tbl"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(Test, testFDO76597)
@@ -257,8 +257,8 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO76597)
loadAndSave("fdo76597.docx");
// check XML
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:spacing", "before", "96");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:spacing", "after", "120");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:spacing"_ostr, "before"_ostr, "96");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:spacing"_ostr, "after"_ostr, "120");
}
CPPUNIT_TEST_FIXTURE(Test, testContentTypeTIF)
@@ -266,7 +266,7 @@ CPPUNIT_TEST_FIXTURE(Test, testContentTypeTIF)
loadAndSave("fdo77476.docx");
xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml");
- assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@ContentType='image/tiff']", "PartName", "/word/media/image1.tif");
+ assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@ContentType='image/tiff']"_ostr, "PartName"_ostr, "/word/media/image1.tif");
}
DECLARE_OOXMLEXPORT_TEST(testFDO77117, "fdo77117.docx")
@@ -282,15 +282,15 @@ CPPUNIT_TEST_FIXTURE(Test, testFloatingTable)
loadAndSave("fdo77887.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]", "horzAnchor", "margin");
- assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]", "leftFromText", "141");
- assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]", "rightFromText", "141");
- assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]", "tblpXSpec", "center");
- assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]", "tblpY", "2266");
- assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]", "vertAnchor", "page");
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]"_ostr, "horzAnchor"_ostr, "margin");
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]"_ostr, "leftFromText"_ostr, "141");
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]"_ostr, "rightFromText"_ostr, "141");
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]"_ostr, "tblpXSpec"_ostr, "center");
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]"_ostr, "tblpY"_ostr, "2266");
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]"_ostr, "vertAnchor"_ostr, "page");
//make sure not to write empty attributes which requires enumeration
- assertXPathNoAttribute(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]", "tblpYSpec");
+ assertXPathNoAttribute(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblpPr[1]"_ostr, "tblpYSpec"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testOldComplexMergeRight)
@@ -299,10 +299,10 @@ CPPUNIT_TEST_FIXTURE(Test, testOldComplexMergeRight)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[2]/w:tcPr/w:vMerge", "val", "restart");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[2]/w:tcPr/w:vMerge", "val", "continue");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[2]/w:tcPr/w:vMerge", "val", "continue");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[2]/w:tcPr/w:vMerge", "val", "continue");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[2]/w:tcPr/w:vMerge"_ostr, "val"_ostr, "restart");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[2]/w:tcPr/w:vMerge"_ostr, "val"_ostr, "continue");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[2]/w:tcPr/w:vMerge"_ostr, "val"_ostr, "continue");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[2]/w:tcPr/w:vMerge"_ostr, "val"_ostr, "continue");
}
CPPUNIT_TEST_FIXTURE(Test, testOldComplexMergeleft)
@@ -311,8 +311,8 @@ CPPUNIT_TEST_FIXTURE(Test, testOldComplexMergeleft)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:vMerge", "val", "restart");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:vMerge", "val", "continue");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:vMerge"_ostr, "val"_ostr, "restart");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:vMerge"_ostr, "val"_ostr, "continue");
}
CPPUNIT_TEST_FIXTURE(Test, testOldComplexMergeTableInTable)
@@ -338,8 +338,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTablePreferredWidth)
// Problem :If the table preferred width is in percent, then after RT it changes to 0 & width type changes
// to 'auto' instead of 'pct'.
- assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblW[1]", "w", "3000");
- assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblW[1]", "type","pct");
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblW[1]"_ostr, "w"_ostr, "3000");
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:tblW[1]"_ostr, "type"_ostr,"pct");
}
CPPUNIT_TEST_FIXTURE(Test, testFDO75431)
@@ -347,8 +347,8 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO75431)
loadAndSave("fdo75431.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//w:tbl", 2);
- assertXPath(pXmlDoc, "//w:p/w:pPr/w:sectPr/w:type", "val", "nextPage");
+ assertXPath(pXmlDoc, "//w:tbl"_ostr, 2);
+ assertXPath(pXmlDoc, "//w:p/w:pPr/w:sectPr/w:type"_ostr, "val"_ostr, "nextPage");
}
CPPUNIT_TEST_FIXTURE(Test, testFDO77725)
@@ -356,9 +356,9 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO77725)
loadAndSave("fdo77725.docx");
xmlDocUniquePtr pXmlFootnotes = parseExport("word/footnotes.xml");
- assertXPath(pXmlFootnotes, "//w:footnotes[1]/w:footnote[3]/w:p[3]/w:r[1]/w:br[1]", 0);
- assertXPath(pXmlFootnotes, "//w:footnotes[1]/w:footnote[3]/w:p[3]/w:r[1]/w:br[2]", 0);
- assertXPath(pXmlFootnotes, "//w:footnotes[1]/w:footnote[3]/w:p[3]/w:r[1]/w:br[3]", 0);
+ assertXPath(pXmlFootnotes, "//w:footnotes[1]/w:footnote[3]/w:p[3]/w:r[1]/w:br[1]"_ostr, 0);
+ assertXPath(pXmlFootnotes, "//w:footnotes[1]/w:footnote[3]/w:p[3]/w:r[1]/w:br[2]"_ostr, 0);
+ assertXPath(pXmlFootnotes, "//w:footnotes[1]/w:footnote[3]/w:p[3]/w:r[1]/w:br[3]"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testFieldRotation)
@@ -378,34 +378,34 @@ CPPUNIT_TEST_FIXTURE(Test, testFootnoteSeparator)
loadAndSave("footnotesep.fodt");
// footnote separator definitions - taken from default page style
xmlDocUniquePtr pXmlFootnotes = parseExport("word/footnotes.xml");
- assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[1]", "id", "0");
- assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[1]", "type", "separator");
- assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[1]/w:p[1]/w:r[1]/w:separator", 0);
+ assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[1]"_ostr, "id"_ostr, "0");
+ assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[1]"_ostr, "type"_ostr, "separator");
+ assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[1]/w:p[1]/w:r[1]/w:separator"_ostr, 0);
// use paragraph font size to simulate height
- assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[1]/w:p[1]/w:pPr[1]/w:rPr[1]/w:sz", "val", "12");
- assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[2]", "id", "1");
- assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[2]", "type", "continuationSeparator");
- assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[2]/w:p[1]/w:r[1]/w:continuationSeparator", 0);
- assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[2]/w:p[1]/w:pPr[1]/w:rPr[1]/w:sz", "val", "12");
+ assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[1]/w:p[1]/w:pPr[1]/w:rPr[1]/w:sz"_ostr, "val"_ostr, "12");
+ assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[2]"_ostr, "id"_ostr, "1");
+ assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[2]"_ostr, "type"_ostr, "continuationSeparator");
+ assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[2]/w:p[1]/w:r[1]/w:continuationSeparator"_ostr, 0);
+ assertXPath(pXmlFootnotes, "/w:footnotes[1]/w:footnote[2]/w:p[1]/w:pPr[1]/w:rPr[1]/w:sz"_ostr, "val"_ostr, "12");
xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml");
- assertXPath(pXmlSettings, "/w:settings[1]/w:footnotePr[1]/w:footnote[1]", "id", "0");
- assertXPath(pXmlSettings, "/w:settings[1]/w:footnotePr[1]/w:footnote[2]", "id", "1");
+ assertXPath(pXmlSettings, "/w:settings[1]/w:footnotePr[1]/w:footnote[1]"_ostr, "id"_ostr, "0");
+ assertXPath(pXmlSettings, "/w:settings[1]/w:footnotePr[1]/w:footnote[2]"_ostr, "id"_ostr, "1");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf121441)
{
loadAndSave("tdf121441.docx");
xmlDocUniquePtr pXmlFootnotes = parseExport("word/footnotes.xml");
- assertXPath(pXmlFootnotes, "/w:footnotes/w:footnote[3]/w:p/w:r[1]/w:rPr/w:rStyle", 1);
- assertXPath(pXmlFootnotes, "/w:footnotes/w:footnote[3]/w:p/w:r[2]/w:rPr/w:rStyle", 0);
- assertXPath(pXmlFootnotes, "/w:footnotes/w:footnote[3]/w:p/w:r[2]/w:rPr/w:rFonts", 0);
+ assertXPath(pXmlFootnotes, "/w:footnotes/w:footnote[3]/w:p/w:r[1]/w:rPr/w:rStyle"_ostr, 1);
+ assertXPath(pXmlFootnotes, "/w:footnotes/w:footnote[3]/w:p/w:r[2]/w:rPr/w:rStyle"_ostr, 0);
+ assertXPath(pXmlFootnotes, "/w:footnotes/w:footnote[3]/w:p/w:r[2]/w:rPr/w:rFonts"_ostr, 0);
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:rPr/w:rFonts", "eastAsia", "Symbol");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:rPr/w:rFonts", "cs", "Symbol");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:rPr/w:rFonts", "ascii", "Symbol");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:rPr/w:rFonts", "hAnsi", "Symbol");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:rPr/w:rFonts"_ostr, "eastAsia"_ostr, "Symbol");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:rPr/w:rFonts"_ostr, "cs"_ostr, "Symbol");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:rPr/w:rFonts"_ostr, "ascii"_ostr, "Symbol");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:rPr/w:rFonts"_ostr, "hAnsi"_ostr, "Symbol");
}
CPPUNIT_TEST_FIXTURE(Test, testFDO77812)
@@ -417,12 +417,12 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO77812)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Check no additional section break is inserted.
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:pPr/w:sectPr", 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:pPr/w:sectPr"_ostr, 0);
// Check w:cols comes under Default sectPr
- assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:cols", "num", "2");
- assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:cols/w:col[1]", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:cols/w:col[2]", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:cols"_ostr, "num"_ostr, "2");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:cols/w:col[1]"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:cols/w:col[2]"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testContentTypeOLE)
@@ -431,21 +431,21 @@ CPPUNIT_TEST_FIXTURE(Test, testContentTypeOLE)
xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml");
assertXPath(pXmlDoc,
- "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']",
- "PartName",
+ "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']"_ostr,
+ "PartName"_ostr,
"/word/embeddings/oleObject1.xlsx");
// check the rels too
xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels");
assertXPath(pXmlDocRels,
- "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.xlsx']",
- "Type",
+ "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.xlsx']"_ostr,
+ "Type"_ostr,
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
// check the content too
xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml");
assertXPath(pXmlDocContent,
- "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject",
- "ProgID",
+ "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject"_ostr,
+ "ProgID"_ostr,
"Excel.Sheet.12");
}
@@ -456,7 +456,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo78420)
xmlDocUniquePtr pXmlHeaderRels = parseExport("word/_rels/header2.xml.rels");
- assertXPath(pXmlHeaderRels,"/rels:Relationships/rels:Relationship[1]","Id","rId1");
+ assertXPath(pXmlHeaderRels,"/rels:Relationships/rels:Relationship[1]"_ostr,"Id"_ostr,"rId1");
}
@@ -468,15 +468,15 @@ CPPUNIT_TEST_FIXTURE(Test, testPageBreakInFirstPara)
*/
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:br","type","page");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:br"_ostr,"type"_ostr,"page");
}
CPPUNIT_TEST_FIXTURE(Test, testFDO78284)
{
loadAndSave("fdo78284.docx");
xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml");
- assertXPath(pXmlDoc,"/ContentType:Types/ContentType:Override[@PartName='/word/media/OOXDiagramDataRels1_0.png']",
- "ContentType",
+ assertXPath(pXmlDoc,"/ContentType:Types/ContentType:Override[@PartName='/word/media/OOXDiagramDataRels1_0.png']"_ostr,
+ "ContentType"_ostr,
"image/png");
}
@@ -484,7 +484,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO78384)
{
loadAndReload("fdo78384.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w:rFonts","ascii","Wingdings");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w:rFonts"_ostr,"ascii"_ostr,"Wingdings");
}
CPPUNIT_TEST_FIXTURE(Test, testfdo78469)
@@ -492,8 +492,8 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo78469)
loadAndSave("fdo78469.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/header1.xml");
// make sure dataBinding & text tags not present in sdtcontent
- assertXPath(pXmlDoc, "/w:hdr[1]/w:tbl[1]/w:tr[1]/w:tc[2]/w:p[1]/w:sdt[2]/w:sdtPr[1]/w:dataBinding[1]",0);
- assertXPath(pXmlDoc, "/w:hdr[1]/w:tbl[1]/w:tr[1]/w:tc[2]/w:p[1]/w:sdt[2]/w:sdtPr[1]/w:text[1]",0);
+ assertXPath(pXmlDoc, "/w:hdr[1]/w:tbl[1]/w:tr[1]/w:tc[2]/w:p[1]/w:sdt[2]/w:sdtPr[1]/w:dataBinding[1]"_ostr,0);
+ assertXPath(pXmlDoc, "/w:hdr[1]/w:tbl[1]/w:tr[1]/w:tc[2]/w:p[1]/w:sdt[2]/w:sdtPr[1]/w:text[1]"_ostr,0);
}
CPPUNIT_TEST_FIXTURE(Test, testFDO78887)
@@ -501,9 +501,9 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO78887)
loadAndSave("fdo78887.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:br[1]", 1);
- assertXPathContent(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:t[1]", "Lyrics: ");
- assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:br[2]", 1);
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:br[1]"_ostr, 1);
+ assertXPathContent(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:t[1]"_ostr, "Lyrics: ");
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:br[2]"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testFDO78887b)
@@ -512,10 +512,10 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO78887b)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[2]/w:br[1]", 1);
- assertXPathContent(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:t[1]", "Tab and line break");
- assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[5]/w:br[1]", 1);
- assertXPathContent(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[6]/w:t[1]", "New line");
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[2]/w:br[1]"_ostr, 1);
+ assertXPathContent(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:t[1]"_ostr, "Tab and line break");
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[5]/w:br[1]"_ostr, 1);
+ assertXPathContent(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[6]/w:t[1]"_ostr, "New line");
}
CPPUNIT_TEST_FIXTURE(Test, testFdo78651)
@@ -523,7 +523,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo78651)
loadAndSave("fdo78651.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// ensure that there are only two tables
- assertXPath(pXmlDoc, "//w:tbl", 2);
+ assertXPath(pXmlDoc, "//w:tbl"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(Test, testfdo78882)
@@ -532,10 +532,10 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo78882)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Ensure that Section Break is getting written inside second paragraph
- assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[2]/w:pPr[1]/w:sectPr[1]",1);
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[2]/w:pPr[1]/w:sectPr[1]"_ostr,1);
// Ensure that no dummy paragraph gets created inside second paragraph for Section Break
- assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[2]/w:p[1]/w:pPr[1]/w:sectPr[1]",0);
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[2]/w:p[1]/w:pPr[1]/w:sectPr[1]"_ostr,0);
}
CPPUNIT_TEST_FIXTURE(Test, testfdo76934)
@@ -548,7 +548,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo76934)
xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml");
// Ensure that after fix LO is preserving AutoSpacing property in styles.xml
- assertXPath ( pXmlDoc, "/w:styles[1]/w:style[@w:styleId='Title']/w:pPr[1]/w:spacing[1]", "beforeAutospacing", "1" );
+ assertXPath ( pXmlDoc, "/w:styles[1]/w:style[@w:styleId='Title']/w:pPr[1]/w:spacing[1]"_ostr, "beforeAutospacing"_ostr, "1" );
}
CPPUNIT_TEST_FIXTURE(Test, testfdo79540)
@@ -562,18 +562,18 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo79540)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Ensure that two separate w:drawing tags are written and they are not nested.
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testFDO79062)
{
loadAndSave("fdo79062.docx");
xmlDocUniquePtr pXmlFootNotes = parseExport("word/footnotes.xml");
- assertXPath(pXmlFootNotes, "/w:footnotes", "Ignorable", "w14 wp14 w15");
+ assertXPath(pXmlFootNotes, "/w:footnotes"_ostr, "Ignorable"_ostr, "w14 wp14 w15");
xmlDocUniquePtr pXmlEndNotes = parseExport("word/endnotes.xml");
- assertXPath(pXmlEndNotes, "/w:endnotes", "Ignorable", "w14 wp14 w15");
+ assertXPath(pXmlEndNotes, "/w:endnotes"_ostr, "Ignorable"_ostr, "w14 wp14 w15");
//tdf#93121 don't add fake tabs in front of extra footnote paragraphs
uno::Reference<text::XFootnotesSupplier> xFootnoteSupp(mxComponent, uno::UNO_QUERY);
@@ -620,18 +620,18 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo79668)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// w:pPr's w:shd attributes were getting added to w:pPrChange/w:pPr's w:shd hence checking
// w:fill for both shd elements
- assertXPath ( pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:shd", "fill", "FFFFFF" );
- assertXPath ( pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:pPrChange/w:pPr/w:shd", "fill", "FFFFFF" );
+ assertXPath ( pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:shd"_ostr, "fill"_ostr, "FFFFFF" );
+ assertXPath ( pXmlDoc, "/w:document/w:body/w:p[9]/w:pPr/w:pPrChange/w:pPr/w:shd"_ostr, "fill"_ostr, "FFFFFF" );
}
CPPUNIT_TEST_FIXTURE(Test, testfdo78907)
{
loadAndReload("fdo78907.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:br", "type", "page" );
+ assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:br"_ostr, "type"_ostr, "page" );
xmlDocUniquePtr pXmlDoc1 = parseExport("word/footer1.xml");
- assertXPath ( pXmlDoc1, "/w:ftr[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl", 0 );
+ assertXPath ( pXmlDoc1, "/w:ftr[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl"_ostr, 0 );
}
CPPUNIT_TEST_FIXTURE(Test, tdf118702)
@@ -639,8 +639,8 @@ CPPUNIT_TEST_FIXTURE(Test, tdf118702)
loadAndReload("tdf118702.odt");
CPPUNIT_ASSERT_EQUAL(2, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:sectPr/w:type", "val", "nextPage" );
- assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:sectPr/w:pgSz", "orient", "landscape" );
+ assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:sectPr/w:type"_ostr, "val"_ostr, "nextPage" );
+ assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:sectPr/w:pgSz"_ostr, "orient"_ostr, "landscape" );
}
CPPUNIT_TEST_FIXTURE(Test, testfdo79822)
@@ -657,15 +657,15 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO79915)
loadAndSave("fdo79915.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[9]/w:t", "How much buoyancy does the water provide?");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[9]/w:t"_ostr, "How much buoyancy does the water provide?");
}
CPPUNIT_TEST_FIXTURE(Test, testfdo79817)
{
loadAndSave("fdo79817.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "storeItemID", "{9222E47B-A68B-4AEB-9855-21C912B9D3D2}");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "xpath", "/ns0:properties[1]/documentManagement[1]/ns2:Responsible_x0020_Officer_x0020_Title[1]");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding"_ostr, "storeItemID"_ostr, "{9222E47B-A68B-4AEB-9855-21C912B9D3D2}");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding"_ostr, "xpath"_ostr, "/ns0:properties[1]/documentManagement[1]/ns2:Responsible_x0020_Officer_x0020_Title[1]");
}
@@ -676,21 +676,21 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo79968_sldx)
xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml");
assertXPath(pXmlDoc,
- "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.openxmlformats-officedocument.presentationml.slide']",
- "PartName",
+ "/ContentType:Types/ContentType:Override[@ContentType='application/vnd.openxmlformats-officedocument.presentationml.slide']"_ostr,
+ "PartName"_ostr,
"/word/embeddings/oleObject1.sldx");
// check the rels too
xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels");
assertXPath(pXmlDocRels,
- "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.sldx']",
- "Type",
+ "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.sldx']"_ostr,
+ "Type"_ostr,
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
// check the content too
xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml");
assertXPath(pXmlDocContent,
- "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject",
- "ProgID",
+ "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject"_ostr,
+ "ProgID"_ostr,
"PowerPoint.Slide.12");
}
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
index 2846a716db8f..21b5fb63e01a 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
@@ -38,8 +38,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133701)
loadAndSave("tdf133701.docx");
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "hSpace", "567");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "vSpace", "284");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr"_ostr, "hSpace"_ostr, "567");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr"_ostr, "vSpace"_ostr, "284");
}
DECLARE_OOXMLEXPORT_TEST(testDmlShapeTitle, "dml-shape-title.docx")
@@ -55,7 +55,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDmlZorder)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// This was "0": causing that in Word, the second shape was on top, while in the original odt the first shape is on top.
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor", "relativeHeight", "2");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor"_ostr, "relativeHeight"_ostr, "2");
}
CPPUNIT_TEST_FIXTURE(Test, testDmlShapeRelsize)
@@ -63,7 +63,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDmlShapeRelsize)
loadAndSave("dml-shape-relsize.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Relative size wasn't exported all, then relativeFrom was "page", not "margin".
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp14:sizeRelH", "relativeFrom", "margin");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp14:sizeRelH"_ostr, "relativeFrom"_ostr, "margin");
}
CPPUNIT_TEST_FIXTURE(Test, testDmlPictureInTextframe)
@@ -80,7 +80,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDmlGroupshapeRelsize)
loadAndSave("dml-groupshape-relsize.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Relative size wasn't imported.
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp14:sizeRelH", "relativeFrom", "margin");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp14:sizeRelH"_ostr, "relativeFrom"_ostr, "margin");
}
DECLARE_OOXMLEXPORT_TEST(testDmlTextshape, "dml-textshape.docx")
@@ -97,7 +97,7 @@ DECLARE_OOXMLEXPORT_TEST(testDmlTextshape, "dml-textshape.docx")
return;
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
// This was wrap="none".
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp[2]/wps:bodyPr", "wrap", "square");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp[2]/wps:bodyPr"_ostr, "wrap"_ostr, "square");
xShape.set(xGroup->getByIndex(3), uno::UNO_QUERY);
OUString aType = comphelper::SequenceAsHashMap(getProperty<beans::PropertyValues>(xShape, "CustomShapeGeometry"))["Type"].get<OUString>();
@@ -383,16 +383,16 @@ CPPUNIT_TEST_FIXTURE(Test, testDMLGradientFillTheme)
// check no explicit gradFill has been exported
assertXPath(pXmlDoc,
- "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill",
+ "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill"_ostr,
0);
// check shape style has been exported
assertXPath(pXmlDoc,
- "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:fillRef",
- "idx", "2");
+ "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:fillRef"_ostr,
+ "idx"_ostr, "2");
assertXPath(pXmlDoc,
- "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:fillRef/a:schemeClr",
- "val", "accent1");
+ "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:fillRef/a:schemeClr"_ostr,
+ "val"_ostr, "accent1");
}
DECLARE_OOXMLEXPORT_TEST(testDMLGroupShapeParaSpacing, "dml-groupshape-paraspacing.docx")
@@ -470,7 +470,7 @@ DECLARE_OOXMLEXPORT_TEST(testTableFloatingMargins, "table-floating-margins.docx"
return;
// Paragraph bottom margin wasn't 0 in the A1 cell of the floating table.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing", "after", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing"_ostr, "after"_ostr, "0");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf127814)
@@ -478,7 +478,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127814)
loadAndSave("tdf127814.docx");
// Paragraph top margin was 0 in a table started on a new page
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing", "before", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing"_ostr, "before"_ostr, "0");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf128752)
@@ -486,7 +486,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf128752)
loadAndSave("tdf128752.docx");
// Paragraph bottom margin was 200, docDefault instead of table style setting
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr/w:spacing", "after", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr/w:spacing"_ostr, "after"_ostr, "0");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf119054)
@@ -495,10 +495,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf119054)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Don't overwrite before and after spacing of Heading2 by table style.
// Heading2 overrides table style's values from DocDefaults.
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr/w:spacing", "before", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr/w:spacing", "after", "360");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr/w:spacing"_ostr, "before"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr/w:spacing"_ostr, "after"_ostr, "360");
// Use table style based single line spacing instead of the docDefaults' 254
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr/w:spacing", "line", "240");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr/w:spacing"_ostr, "line"_ostr, "240");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf131258)
@@ -506,7 +506,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf131258)
loadAndSave("tdf131258.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Use table style based bottom margin instead of the docDefaults in empty tables, too
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing", "after", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing"_ostr, "after"_ostr, "0");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf132514)
@@ -514,8 +514,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132514)
loadAndSave("tdf132514.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Keep table style setting, when the footer also contain a table
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[2]/w:p[2]/w:pPr/w:spacing", "before", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[2]/w:p[2]/w:pPr/w:spacing", "after", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[2]/w:p[2]/w:pPr/w:spacing"_ostr, "before"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[2]/w:p[2]/w:pPr/w:spacing"_ostr, "after"_ostr, "0");
}
DECLARE_OOXMLEXPORT_TEST(testTdf153891, "tdf153891.docx")
@@ -533,9 +533,9 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo69636)
*/
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// VML
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:textbox", "style").match("mso-layout-flow-alt:bottom-to-top"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:textbox"_ostr, "style"_ostr).match("mso-layout-flow-alt:bottom-to-top"));
// drawingML
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:bodyPr", "vert", "vert270");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:bodyPr"_ostr, "vert"_ostr, "vert270");
}
CPPUNIT_TEST_FIXTURE(Test, testVMLData)
@@ -544,7 +544,7 @@ CPPUNIT_TEST_FIXTURE(Test, testVMLData)
// The problem was exporter was exporting vml data for shape in w:rPr element.
// vml data should not come under w:rPr element.
xmlDocUniquePtr pXmlDoc = parseExport("word/header1.xml");
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:shape", "stroked").match("f"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:shape"_ostr, "stroked"_ostr).match("f"));
}
CPPUNIT_TEST_FIXTURE(Test, testImageData)
@@ -553,7 +553,7 @@ CPPUNIT_TEST_FIXTURE(Test, testImageData)
// The problem was exporter was exporting v:imagedata data for shape in w:pict as v:fill w element.
xmlDocUniquePtr pXmlDoc = parseExport("word/header1.xml");
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:shape/v:imagedata", "detectmouseclick").match("t"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:shape/v:imagedata"_ostr, "detectmouseclick"_ostr).match("t"));
}
CPPUNIT_TEST_FIXTURE(Test, testFdo70838)
@@ -567,15 +567,15 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo70838)
// Check DML document
sal_Int32 aXPos[4], aYPos[4];
- aXPos[0] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/wp:positionH/wp:posOffset").toInt32();
- aXPos[1] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/wp:positionH/wp:posOffset").toInt32();
- aXPos[2] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/wp:anchor/wp:positionH/wp:posOffset").toInt32();
- aXPos[3] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[4]/mc:Choice/w:drawing/wp:anchor/wp:positionH/wp:posOffset").toInt32();
+ aXPos[0] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/wp:positionH/wp:posOffset"_ostr).toInt32();
+ aXPos[1] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/wp:positionH/wp:posOffset"_ostr).toInt32();
+ aXPos[2] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/wp:anchor/wp:positionH/wp:posOffset"_ostr).toInt32();
+ aXPos[3] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[4]/mc:Choice/w:drawing/wp:anchor/wp:positionH/wp:posOffset"_ostr).toInt32();
- aYPos[0] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/wp:positionV/wp:posOffset").toInt32();
- aYPos[1] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/wp:positionV/wp:posOffset").toInt32();
- aYPos[2] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/wp:anchor/wp:positionV/wp:posOffset").toInt32();
- aYPos[3] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[4]/mc:Choice/w:drawing/wp:anchor/wp:positionV/wp:posOffset").toInt32();
+ aYPos[0] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/wp:positionV/wp:posOffset"_ostr).toInt32();
+ aYPos[1] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/wp:positionV/wp:posOffset"_ostr).toInt32();
+ aYPos[2] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/wp:anchor/wp:positionV/wp:posOffset"_ostr).toInt32();
+ aYPos[3] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[4]/mc:Choice/w:drawing/wp:anchor/wp:positionV/wp:posOffset"_ostr).toInt32();
// certain degree of error is tolerated due to rounding in unit conversions
CPPUNIT_ASSERT(abs(1239520 - aXPos[0]) < 1000);
@@ -589,15 +589,15 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo70838)
CPPUNIT_ASSERT(abs(2094865 - aYPos[3]) < 1000);
sal_Int32 aHSize[4], aVSize[4];
- aHSize[0] = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/wp:extent", "cx").toInt32();
- aHSize[1] = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/wp:extent", "cx").toInt32();
- aHSize[2] = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/wp:anchor/wp:extent", "cx").toInt32();
- aHSize[3] = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[4]/mc:Choice/w:drawing/wp:anchor/wp:extent", "cx").toInt32();
+ aHSize[0] = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/wp:extent"_ostr, "cx"_ostr).toInt32();
+ aHSize[1] = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/wp:extent"_ostr, "cx"_ostr).toInt32();
+ aHSize[2] = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/wp:anchor/wp:extent"_ostr, "cx"_ostr).toInt32();
+ aHSize[3] = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[4]/mc:Choice/w:drawing/wp:anchor/wp:extent"_ostr, "cx"_ostr).toInt32();
- aVSize[0] = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/wp:extent", "cy").toInt32();
- aVSize[1] = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/wp:extent", "cy").toInt32();
- aVSize[2] = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/wp:anchor/wp:extent", "cy").toInt32();
- aVSize[3] = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[4]/mc:Choice/w:drawing/wp:anchor/wp:extent", "cy").toInt32();
+ aVSize[0] = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/wp:extent"_ostr, "cy"_ostr).toInt32();
+ aVSize[1] = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/wp:extent"_ostr, "cy"_ostr).toInt32();
+ aVSize[2] = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/wp:anchor/wp:extent"_ostr, "cy"_ostr).toInt32();
+ aVSize[3] = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[4]/mc:Choice/w:drawing/wp:anchor/wp:extent"_ostr, "cy"_ostr).toInt32();
// certain degree of error is tolerated due to rounding in unit conversions
CPPUNIT_ASSERT(abs(3599280 - aHSize[0]) < 1000);
@@ -614,13 +614,13 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo70838)
// get styles of the four shapes
OUString aStyles[4];
- aStyles[0] = getXPath( pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Fallback/w:pict/v:rect", "style");
+ aStyles[0] = getXPath( pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Fallback/w:pict/v:rect"_ostr, "style"_ostr);
// original is: "position:absolute;margin-left:97.6pt;margin-top:165pt;width:283.4pt;height:141.7pt;rotation:285"
- aStyles[1] = getXPath( pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Fallback/w:pict/v:rect", "style");
+ aStyles[1] = getXPath( pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Fallback/w:pict/v:rect"_ostr, "style"_ostr);
// original is: "position:absolute;margin-left:97.6pt;margin-top:164.95pt;width:283.4pt;height:141.7pt;rotation:255"
- aStyles[2] = getXPath( pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[3]/mc:Fallback/w:pict/v:rect", "style");
+ aStyles[2] = getXPath( pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[3]/mc:Fallback/w:pict/v:rect"_ostr, "style"_ostr);
// original is: "position:absolute;margin-left:97.5pt;margin-top:164.9pt;width:283.4pt;height:141.7pt;rotation:105"
- aStyles[3] = getXPath( pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[4]/mc:Fallback/w:pict/v:rect", "style");
+ aStyles[3] = getXPath( pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[4]/mc:Fallback/w:pict/v:rect"_ostr, "style"_ostr);
// original is: "position:absolute;margin-left:97.55pt;margin-top:164.95pt;width:283.4pt;height:141.7pt;rotation:75"
//check the size and position of each of the shapes
@@ -686,11 +686,11 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo73215)
loadAndSave("fdo73215.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// 'rect' was 'pictureFrame', which isn't valid.
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:spPr/a:prstGeom",
- "prst", "rect");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:spPr/a:prstGeom"_ostr,
+ "prst"_ostr, "rect");
// 'adj1' was 'adj', which is not valid for bentConnector3.
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp[9]/wps:spPr/a:prstGeom/a:avLst/a:gd",
- "name", "adj1");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp[9]/wps:spPr/a:prstGeom/a:avLst/a:gd"_ostr,
+ "name"_ostr, "adj1");
}
CPPUNIT_TEST_FIXTURE(Test, testBehinddoc)
@@ -698,7 +698,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBehinddoc)
loadAndSave("behinddoc.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// This was "0", shape was in the foreground.
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor", "behindDoc", "1");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor"_ostr, "behindDoc"_ostr, "1");
}
CPPUNIT_TEST_FIXTURE(Test, testSmartArtAnchoredInline)
@@ -712,14 +712,14 @@ CPPUNIT_TEST_FIXTURE(Test, testSmartArtAnchoredInline)
*/
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing[2]/wp:anchor/wp:docPr","id","2");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing[2]/wp:anchor/wp:docPr","name","Diagram2");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing[2]/wp:anchor/wp:docPr"_ostr,"id"_ostr,"2");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing[2]/wp:anchor/wp:docPr"_ostr,"name"_ostr,"Diagram2");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp:docPr","id","3");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp:docPr","name","10-Point Star 3");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp:docPr"_ostr,"id"_ostr,"3");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp:docPr"_ostr,"name"_ostr,"10-Point Star 3");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing[1]/wp:anchor/wp:docPr","id","1");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing[1]/wp:anchor/wp:docPr","name","Picture 1");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing[1]/wp:anchor/wp:docPr"_ostr,"id"_ostr,"1");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing[1]/wp:anchor/wp:docPr"_ostr,"name"_ostr,"Picture 1");
}
CPPUNIT_TEST_FIXTURE(Test, testFdo65833)
@@ -727,7 +727,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo65833)
loadAndSave("fdo65833.docx");
// The "editas" attribute for vml group shape was not preserved.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:group", "editas", "canvas");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:group"_ostr, "editas"_ostr, "canvas");
}
CPPUNIT_TEST_FIXTURE(Test, testFdo73247)
@@ -735,16 +735,16 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo73247)
loadAndSave("fdo73247.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:xfrm",
- "rot", "1969200");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:xfrm"_ostr,
+ "rot"_ostr, "1969200");
}
CPPUNIT_TEST_FIXTURE(Test, testFdo70942)
{
loadAndSave("fdo70942.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:prstGeom",
- "prst", "ellipse");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:prstGeom"_ostr,
+ "prst"_ostr, "ellipse");
}
CPPUNIT_TEST_FIXTURE(Test, testDrawinglayerPicPos)
@@ -753,11 +753,11 @@ CPPUNIT_TEST_FIXTURE(Test, testDrawinglayerPicPos)
// The problem was that the position of the picture was incorrect, it was shifted towards the bottom right corner.
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- OString aXPath("/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:xfrm/a:off");
+ OString aXPath("/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:xfrm/a:off"_ostr);
// This was 720.
- assertXPath(pXmlDocument, aXPath, "x", "0");
+ assertXPath(pXmlDocument, aXPath, "x"_ostr, "0");
// This was 1828800.
- assertXPath(pXmlDocument, aXPath, "y", "0");
+ assertXPath(pXmlDocument, aXPath, "y"_ostr, "0");
}
CPPUNIT_TEST_FIXTURE(Test, testShapeThemePreservation)
@@ -767,87 +767,87 @@ CPPUNIT_TEST_FIXTURE(Test, testShapeThemePreservation)
// check shape style has been preserved
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:fillRef",
- "idx", "1");
+ "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:fillRef"_ostr,
+ "idx"_ostr, "1");
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:fillRef/a:schemeClr",
- "val", "accent1");
+ "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:fillRef/a:schemeClr"_ostr,
+ "val"_ostr, "accent1");
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:fillRef",
- "idx", "1");
+ "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:fillRef"_ostr,
+ "idx"_ostr, "1");
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:fillRef/a:schemeClr",
- "val", "accent1");
+ "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:fillRef/a:schemeClr"_ostr,
+ "val"_ostr, "accent1");
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:fillRef",
- "idx", "1");
+ "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:fillRef"_ostr,
+ "idx"_ostr, "1");
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:fillRef/a:schemeClr",
- "val", "accent1");
+ "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:fillRef/a:schemeClr"_ostr,
+ "val"_ostr, "accent1");
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:lnRef",
- "idx", "2");
+ "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:lnRef"_ostr,
+ "idx"_ostr, "2");
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:lnRef/a:schemeClr",
- "val", "accent1");
+ "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:lnRef/a:schemeClr"_ostr,
+ "val"_ostr, "accent1");
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:lnRef/a:schemeClr/a:shade",
- "val", "50000");
+ "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:lnRef/a:schemeClr/a:shade"_ostr,
+ "val"_ostr, "50000");
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:effectRef",
- "idx", "0");
+ "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:effectRef"_ostr,
+ "idx"_ostr, "0");
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:effectRef/a:schemeClr",
- "val", "accent1");
+ "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:style/a:effectRef/a:schemeClr"_ostr,
+ "val"_ostr, "accent1");
// check shape style hasn't been overwritten
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:solidFill",
+ "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:solidFill"_ostr,
1);
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:solidFill",
+ "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:solidFill"_ostr,
1);
// check direct theme assignments have been preserved
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:solidFill/a:schemeClr",
- "val", "accent6");
+ "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:solidFill/a:schemeClr"_ostr,
+ "val"_ostr, "accent6");
// check whether theme color has been converted into native color
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:solidFill/a:srgbClr",
- "val", "9bbb59");
+ "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:solidFill/a:srgbClr"_ostr,
+ "val"_ostr, "9bbb59");
// check color transformations applied to theme colors have been preserved
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:solidFill/a:schemeClr/a:lumMod",
- "val", "40000");
+ "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:solidFill/a:schemeClr/a:lumMod"_ostr,
+ "val"_ostr, "40000");
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:solidFill/a:schemeClr/a:lumOff",
- "val", "60000");
+ "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:solidFill/a:schemeClr/a:lumOff"_ostr,
+ "val"_ostr, "60000");
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:solidFill/a:srgbClr/a:lumMod",
- "val", "50000");
+ "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:solidFill/a:srgbClr/a:lumMod"_ostr,
+ "val"_ostr, "50000");
// check direct color assignments have been preserved
OUString sFillColor = getXPath(pXmlDocument,
- "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:solidFill/a:srgbClr",
- "val");
+ "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:solidFill/a:srgbClr"_ostr,
+ "val"_ostr);
CPPUNIT_ASSERT_EQUAL(Color(0x00b050), Color(ColorTransparency, sFillColor.toInt32(16)));
sal_Int32 nLineColor = getXPath(pXmlDocument,
- "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:solidFill/a:srgbClr",
- "val").toInt32(16);
+ "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:solidFill/a:srgbClr"_ostr,
+ "val"_ostr).toInt32(16);
CPPUNIT_ASSERT_EQUAL(Color(0xff0000), Color(ColorTransparency, nLineColor));
// check direct line type assignments have been preserved
sal_Int32 nLineWidth = getXPath(pXmlDocument,
- "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln",
- "w").toInt32();
+ "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln"_ostr,
+ "w"_ostr).toInt32();
CPPUNIT_ASSERT(abs(63500 - nLineWidth) < 1000); //some rounding errors in the conversion ooxml -> libo -> ooxml are tolerated
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:miter",
+ "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:miter"_ostr,
1);
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash",
+ "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash"_ostr,
1);
uno::Reference<drawing::XShape> xShape1 = getShape(1);
@@ -875,7 +875,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO73546)
{
loadAndSave("FDO73546.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/header2.xml");
- assertXPath(pXmlDoc, "/w:hdr/w:p[1]/w:r[3]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor", "distL","0");
+ assertXPath(pXmlDoc, "/w:hdr/w:p[1]/w:r[3]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor"_ostr, "distL"_ostr,"0");
}
CPPUNIT_TEST_FIXTURE(Test, testFdo69616)
@@ -895,7 +895,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAlignForShape)
//The wp:align tag is missing after roundtrip
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/wp:positionH/wp:align");
+ "wp:anchor/wp:positionH/wp:align"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testLineStyle_DashType)
@@ -906,13 +906,13 @@ CPPUNIT_TEST_FIXTURE(Test, testLineStyle_DashType)
*/
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[7]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "lgDashDotDot");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[6]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "lgDashDot");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[5]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "lgDash");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[4]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "dashDot");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "dash");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "sysDash");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "sysDot");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[7]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash"_ostr, "val"_ostr, "lgDashDotDot");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[6]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash"_ostr, "val"_ostr, "lgDashDot");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[5]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash"_ostr, "val"_ostr, "lgDash");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[4]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash"_ostr, "val"_ostr, "dashDot");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash"_ostr, "val"_ostr, "dash");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash"_ostr, "val"_ostr, "sysDash");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash"_ostr, "val"_ostr, "sysDot");
}
CPPUNIT_TEST_FIXTURE(Test, testGradientFillPreservation)
@@ -922,35 +922,35 @@ CPPUNIT_TEST_FIXTURE(Test, testGradientFillPreservation)
// check rgb colors for every step in the gradient of the first shape
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr",
- "val", "ffff00");
+ "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr"_ostr,
+ "val"_ostr, "ffff00");
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[2]/a:srgbClr",
- "val", "ffff33");
+ "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[2]/a:srgbClr"_ostr,
+ "val"_ostr, "ffff33");
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[3]/a:srgbClr",
- "val", "ff0000");
+ "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[3]/a:srgbClr"_ostr,
+ "val"_ostr, "ff0000");
// check theme colors for every step in the gradient of the second shape
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[@pos='0']/a:schemeClr",
- "val", "accent5");
+ "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[@pos='0']/a:schemeClr"_ostr,
+ "val"_ostr, "accent5");
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[@pos='50000']/a:schemeClr",
- "val", "accent1");
+ "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[@pos='50000']/a:schemeClr"_ostr,
+ "val"_ostr, "accent1");
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[@pos='100000']/a:schemeClr",
- "val", "accent1");
+ "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[@pos='100000']/a:schemeClr"_ostr,
+ "val"_ostr, "accent1");
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[@pos='50000']/a:srgbClr/a:alpha",
- "val", "20000");
+ "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[@pos='50000']/a:srgbClr/a:alpha"_ostr,
+ "val"_ostr, "20000");
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[@pos='50000']/a:schemeClr/a:tint",
- "val", "44500");
+ "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[@pos='50000']/a:schemeClr/a:tint"_ostr,
+ "val"_ostr, "44500");
assertXPath(pXmlDocument,
- "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[@pos='50000']/a:schemeClr/a:satMod",
- "val", "160000");
+ "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:gradFill/a:gsLst/a:gs[@pos='50000']/a:schemeClr/a:satMod"_ostr,
+ "val"_ostr, "160000");
}
CPPUNIT_TEST_FIXTURE(Test, testLineStyle_DashType_VML)
@@ -960,7 +960,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLineStyle_DashType_VML)
* preserved inside an XML tag <v:stroke> with attribute dashstyle having value "dash".
*/
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:stroke", "dashstyle", "dash");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:stroke"_ostr, "dashstyle"_ostr, "dash");
}
CPPUNIT_TEST_FIXTURE(Test, testFdo74110)
@@ -973,23 +973,23 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo74110)
Hence the following test case.
*/
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:prstGeom[1]",
- "prst", "rect");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:prstGeom[1]/a:avLst[1]/a:gd[1]",0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:prstGeom[1]"_ostr,
+ "prst"_ostr, "rect");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:prstGeom[1]/a:avLst[1]/a:gd[1]"_ostr,0);
}
CPPUNIT_TEST_FIXTURE(Test, testOuterShdw)
{
loadAndReload("testOuterShdw.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:effectLst[1]/a:outerShdw[1]", "dist", "1041400");
+ assertXPath(pXmlDoc, "//mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:effectLst[1]/a:outerShdw[1]"_ostr, "dist"_ostr, "1041400");
}
CPPUNIT_TEST_FIXTURE(Test, testExtentValue)
{
loadAndSave("fdo74605.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- sal_Int32 nX = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:extent", "cx").toInt32();
+ sal_Int32 nX = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:extent"_ostr, "cx"_ostr).toInt32();
// This was negative.
CPPUNIT_ASSERT(nX >= 0);
@@ -1009,7 +1009,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSyncedRelativePercent)
// check no explicit pctHeight has been exported, all we care
// about at this point is that it's not 255000
- assertXPath(pXmlDoc, "//wp14:pctHeight", 0);
+ assertXPath(pXmlDoc, "//wp14:pctHeight"_ostr, 0);
}
DECLARE_OOXMLEXPORT_TEST(testTdf107119, "tdf107119.docx")
@@ -1023,7 +1023,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133457)
loadAndSave("tdf133457.docx");
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[3]/w:pPr/w:framePr", "vAnchor", "text");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[3]/w:pPr/w:framePr"_ostr, "vAnchor"_ostr, "text");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf133924)
@@ -1031,8 +1031,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133924)
loadAndSave("tdf133924.docx");
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "wrap", "around");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:framePr", "wrap", "notBeside");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr"_ostr, "wrap"_ostr, "around");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:framePr"_ostr, "wrap"_ostr, "notBeside");
}
DECLARE_OOXMLEXPORT_TEST(testRelativeAlignmentFromTopMargin,
@@ -1045,9 +1045,9 @@ DECLARE_OOXMLEXPORT_TEST(testRelativeAlignmentFromTopMargin,
return;
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[1]/bounds", "top", "1502"); // center
- assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds", "top", "2683"); // bottom
- assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[3]/bounds", "top", "313"); // top
+ assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[1]/bounds"_ostr, "top"_ostr, "1502"); // center
+ assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds"_ostr, "top"_ostr, "2683"); // bottom
+ assertXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[3]/bounds"_ostr, "top"_ostr, "313"); // top
}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
index d1a4378b1b71..736b51886d90 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
@@ -51,7 +51,7 @@ CPPUNIT_TEST_FIXTURE(Test, testChildNodesOfCubicBezierTo)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
assertXPath( pXmlDoc,
- "/w:document/w:body/w:p[2]/w:r[1]/mc:AlternateContent[1]/mc:Choice/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wpg:wgp[1]/wps:wsp[3]/wps:spPr[1]/a:custGeom[1]/a:pathLst[1]/a:path[1]/a:cubicBezTo[2]/a:pt[3]");
+ "/w:document/w:body/w:p[2]/w:r[1]/mc:AlternateContent[1]/mc:Choice/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wpg:wgp[1]/wps:wsp[3]/wps:spPr[1]/a:custGeom[1]/a:pathLst[1]/a:path[1]/a:cubicBezTo[2]/a:pt[3]"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testMSwordHang)
@@ -59,7 +59,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMSwordHang)
loadAndSave("test_msword_hang.docx");
// fdo#74771:
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p/w:r[2]/w:drawing/wp:inline", "distT", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p/w:r[2]/w:drawing/wp:inline"_ostr, "distT"_ostr, "0");
}
DECLARE_OOXMLEXPORT_TEST(testGroupshapeThemeFont, "groupshape-theme-font.docx")
@@ -77,8 +77,8 @@ CPPUNIT_TEST_FIXTURE(Test, testAnchorIdForWP14AndW14)
loadAndSave("AnchorId.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/mc:AlternateContent/mc:Choice/w:drawing/wp:inline", "anchorId", "78735EFD");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/mc:AlternateContent/mc:Fallback/w:pict/v:rect", "anchorId", "78735EFD");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/mc:AlternateContent/mc:Choice/w:drawing/wp:inline"_ostr, "anchorId"_ostr, "78735EFD");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/mc:AlternateContent/mc:Fallback/w:pict/v:rect"_ostr, "anchorId"_ostr, "78735EFD");
}
DECLARE_OOXMLEXPORT_TEST(testDkVert, "dkvert.docx")
@@ -98,10 +98,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTextWatermark)
//It has to have the 'PowerPlusWaterMarkObject' string in it
xmlDocUniquePtr pXmlHeader2 = parseExport("word/header2.xml");
- assertXPath(pXmlHeader2, "/w:hdr[1]/w:p[1]/w:r[1]/w:pict[1]/v:shape[1]","id","PowerPlusWaterMarkObject93701316");
+ assertXPath(pXmlHeader2, "/w:hdr[1]/w:p[1]/w:r[1]/w:pict[1]/v:shape[1]"_ostr,"id"_ostr,"PowerPlusWaterMarkObject93701316");
//The second problem was that Word uses also "o:spid"
- const OUString& sSpid = getXPath(pXmlHeader2, "/w:hdr[1]/w:p[1]/w:r[1]/w:pict[1]/v:shape[1]","spid");
+ const OUString& sSpid = getXPath(pXmlHeader2, "/w:hdr[1]/w:p[1]/w:r[1]/w:pict[1]/v:shape[1]"_ostr,"spid"_ostr);
CPPUNIT_ASSERT(!sSpid.isEmpty());
}
@@ -115,7 +115,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPictureWatermark)
xmlDocUniquePtr pXmlHeader2 = parseExport("word/header2.xml");
// Check the watermark ID
- assertXPath(pXmlHeader2, "/w:hdr[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Fallback[1]/w:pict[1]/v:shape[1]","id","WordPictureWatermark11962361");
+ assertXPath(pXmlHeader2, "/w:hdr[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Fallback[1]/w:pict[1]/v:shape[1]"_ostr,"id"_ostr,"WordPictureWatermark11962361");
}
@@ -129,7 +129,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo76249)
* are not allowed inside the textboxes.
*/
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Fallback[1]/w:pict[1]/v:rect[1]/v:textbox[1]/w:txbxContent[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/lc:lockedCanvas[1]",1);
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Fallback[1]/w:pict[1]/v:rect[1]/v:textbox[1]/w:txbxContent[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/lc:lockedCanvas[1]"_ostr,1);
}
CPPUNIT_TEST_FIXTURE(Test, testFdo76979)
@@ -138,7 +138,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo76979)
// The problem was that black was exported as "auto" fill color, resulting in well-formed, but invalid XML.
xmlDocUniquePtr pXmlDoc = parseExport("word/header2.xml");
// This was "auto", not "FFFFFF".
- assertXPath(pXmlDoc, "//wps:spPr/a:solidFill/a:srgbClr", "val", "FFFFFF");
+ assertXPath(pXmlDoc, "//wps:spPr/a:solidFill/a:srgbClr"_ostr, "val"_ostr, "FFFFFF");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf104539)
@@ -148,8 +148,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104539)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:inline/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw",
- "dir", "13500000");
+ "wp:inline/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw"_ostr,
+ "dir"_ostr, "13500000");
}
DECLARE_OOXMLEXPORT_TEST(testTdf57155, "tdf57155.docx")
@@ -173,131 +173,131 @@ CPPUNIT_TEST_FIXTURE(Test, testShapeEffectPreservation)
// first shape with outer shadow, rgb color
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw",
- "algn", "tl");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw"_ostr,
+ "algn"_ostr, "tl");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw",
- "blurRad", "50760"); // because convertEMUtoHmm rounds fractions into nearest integer 50800 will be 50760
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw"_ostr,
+ "blurRad"_ostr, "50760"); // because convertEMUtoHmm rounds fractions into nearest integer 50800 will be 50760
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw",
- "dir", "2700000");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw"_ostr,
+ "dir"_ostr, "2700000");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw",
- "dist", "37674");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw"_ostr,
+ "dist"_ostr, "37674");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw",
- "rotWithShape", "0");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw"_ostr,
+ "rotWithShape"_ostr, "0");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw/a:srgbClr",
- "val", "000000");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw/a:srgbClr"_ostr,
+ "val"_ostr, "000000");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw/a:srgbClr/a:alpha",
- "val", "40000");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw/a:srgbClr/a:alpha"_ostr,
+ "val"_ostr, "40000");
// second shape with outer shadow, scheme color
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw",
- "algn", "tl");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw"_ostr,
+ "algn"_ostr, "tl");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw",
- "blurRad", "114480"); // because convertEMUtoHmm rounds fractions into nearest integer 114300 will be 114480
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw"_ostr,
+ "blurRad"_ostr, "114480"); // because convertEMUtoHmm rounds fractions into nearest integer 114300 will be 114480
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw",
- "dir", "2700000");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw"_ostr,
+ "dir"_ostr, "2700000");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw",
- "dist", "203137");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw"_ostr,
+ "dist"_ostr, "203137");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw",
- "rotWithShape", "0");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw"_ostr,
+ "rotWithShape"_ostr, "0");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw/a:schemeClr",
- "val", "accent1");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw/a:schemeClr"_ostr,
+ "val"_ostr, "accent1");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw/a:schemeClr/a:lumMod",
- "val", "40000");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw/a:schemeClr/a:lumMod"_ostr,
+ "val"_ostr, "40000");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw/a:schemeClr/a:lumOff",
- "val", "60000");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw/a:schemeClr/a:lumOff"_ostr,
+ "val"_ostr, "60000");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw/a:schemeClr/a:alpha",
- "val", "40000");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw/a:schemeClr/a:alpha"_ostr,
+ "val"_ostr, "40000");
// third shape with inner shadow, rgb color
assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw",
- "blurRad", "63500");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw"_ostr,
+ "blurRad"_ostr, "63500");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw",
- "dir", "16200000");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw"_ostr,
+ "dir"_ostr, "16200000");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw",
- "dist", "50800");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw"_ostr,
+ "dist"_ostr, "50800");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw/a:srgbClr",
- "val", "ffff00");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw/a:srgbClr"_ostr,
+ "val"_ostr, "ffff00");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw/a:srgbClr/a:alpha",
- "val", "50000");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw/a:srgbClr/a:alpha"_ostr,
+ "val"_ostr, "50000");
// 4th shape with soft edge
assertXPathHasApproxEMU(
pXmlDoc,
"/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:softEdge",
- "rad", 127000); // actually, it returns 127080
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:softEdge"_ostr,
+ "rad"_ostr, 127000); // actually, it returns 127080
assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:softEdge/*",
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:softEdge/*"_ostr,
0 ); // should not be present
// 5th shape with glow effect, scheme color
assertXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:glow/a:srgbClr",
- "val", "eb2722");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:glow/a:srgbClr"_ostr,
+ "val"_ostr, "eb2722");
// 6th shape with reflection
assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:reflection",
- "blurRad", "6350");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:reflection"_ostr,
+ "blurRad"_ostr, "6350");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:reflection",
- "stA", "50000");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:reflection"_ostr,
+ "stA"_ostr, "50000");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:reflection",
- "endA", "300");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:reflection"_ostr,
+ "endA"_ostr, "300");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:reflection",
- "endPos", "55500");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:reflection"_ostr,
+ "endPos"_ostr, "55500");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:reflection/*",
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:reflection/*"_ostr,
0 ); // should not be present
// 7th shape with several effects: glow, inner shadow and reflection
assertXPathHasApproxEMU(pXmlDoc,
"/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:glow",
- "rad", 63500); // actually, it returns 63360
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:glow"_ostr,
+ "rad"_ostr, 63500); // actually, it returns 63360
assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:glow/a:srgbClr",
- "val", "eb2722");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:glow/a:srgbClr"_ostr,
+ "val"_ostr, "eb2722");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw",
- "blurRad", "63500");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw"_ostr,
+ "blurRad"_ostr, "63500");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw",
- "dir", "2700000");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw"_ostr,
+ "dir"_ostr, "2700000");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw/a:srgbClr",
- "val", "000000");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw/a:srgbClr"_ostr,
+ "val"_ostr, "000000");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw/a:srgbClr/a:alpha",
- "val", "50000");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw/a:srgbClr/a:alpha"_ostr,
+ "val"_ostr, "50000");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:reflection",
- "blurRad", "6350");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:reflection"_ostr,
+ "blurRad"_ostr, "6350");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:reflection",
- "stA", "52000");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:reflection"_ostr,
+ "stA"_ostr, "52000");
}
@@ -308,107 +308,107 @@ CPPUNIT_TEST_FIXTURE(Test, testShape3DEffectPreservation)
// first shape: extrusion and shift on z, rotated camera with zoom, rotated light rig
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:camera",
- "prst", "perspectiveRelaxedModerately");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:camera"_ostr,
+ "prst"_ostr, "perspectiveRelaxedModerately");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:camera",
- "zoom", "150000");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:camera"_ostr,
+ "zoom"_ostr, "150000");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:camera/a:rot",
- "lat", "19490639");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:camera/a:rot"_ostr,
+ "lat"_ostr, "19490639");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:camera/a:rot",
- "lon", "0");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:camera/a:rot"_ostr,
+ "lon"_ostr, "0");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:camera/a:rot",
- "rev", "12900001");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:camera/a:rot"_ostr,
+ "rev"_ostr, "12900001");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:lightRig",
- "rig", "threePt");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:lightRig"_ostr,
+ "rig"_ostr, "threePt");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:lightRig",
- "dir", "t");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:lightRig"_ostr,
+ "dir"_ostr, "t");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:lightRig/a:rot",
- "lat", "0");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:lightRig/a:rot"_ostr,
+ "lat"_ostr, "0");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:lightRig/a:rot",
- "lon", "0");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:lightRig/a:rot"_ostr,
+ "lon"_ostr, "0");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:lightRig/a:rot",
- "rev", "4800000");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:lightRig/a:rot"_ostr,
+ "rev"_ostr, "4800000");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d",
- "extrusionH", "63500");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d"_ostr,
+ "extrusionH"_ostr, "63500");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d",
- "z", "488950");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d"_ostr,
+ "z"_ostr, "488950");
// second shape: extrusion with theme color, no camera or light rotation, metal material
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:camera",
- "prst", "isometricLeftDown");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:camera"_ostr,
+ "prst"_ostr, "isometricLeftDown");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:camera/a:rot",
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:camera/a:rot"_ostr,
0);
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:lightRig",
- "rig", "threePt");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:lightRig"_ostr,
+ "rig"_ostr, "threePt");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:lightRig",
- "dir", "t");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:lightRig"_ostr,
+ "dir"_ostr, "t");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:lightRig/a:rot",
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:scene3d/a:lightRig/a:rot"_ostr,
0);
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d",
- "extrusionH", "25400");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d"_ostr,
+ "extrusionH"_ostr, "25400");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d",
- "prstMaterial", "metal");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d"_ostr,
+ "prstMaterial"_ostr, "metal");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:extrusionClr/a:schemeClr",
- "val", "accent5");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:extrusionClr/a:schemeClr"_ostr,
+ "val"_ostr, "accent5");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:extrusionClr/a:schemeClr/a:lumMod",
- "val", "40000");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:extrusionClr/a:schemeClr/a:lumMod"_ostr,
+ "val"_ostr, "40000");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:extrusionClr/a:schemeClr/a:lumOff",
- "val", "60000");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:extrusionClr/a:schemeClr/a:lumOff"_ostr,
+ "val"_ostr, "60000");
// third shape: colored contour and top and bottom bevel, plastic material
assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d",
- "contourW", "50800");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d"_ostr,
+ "contourW"_ostr, "50800");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d",
- "prstMaterial", "plastic");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d"_ostr,
+ "prstMaterial"_ostr, "plastic");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:bevelT",
- "w", "139700");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:bevelT"_ostr,
+ "w"_ostr, "139700");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:bevelT",
- "h", "88900");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:bevelT"_ostr,
+ "h"_ostr, "88900");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:bevelT",
- "prst", "cross");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:bevelT"_ostr,
+ "prst"_ostr, "cross");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:bevelB",
- "h", "88900");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:bevelB"_ostr,
+ "h"_ostr, "88900");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:bevelB",
- "prst", "relaxedInset");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:bevelB"_ostr,
+ "prst"_ostr, "relaxedInset");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:contourClr/a:srgbClr",
- "val", "3333ff");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d/a:contourClr/a:srgbClr"_ostr,
+ "val"_ostr, "3333ff");
// fourth shape: wireframe
assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d",
- "prstMaterial", "legacyWireframe");
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:sp3d"_ostr,
+ "prstMaterial"_ostr, "legacyWireframe");
}
CPPUNIT_TEST_FIXTURE(Test, testPictureEffectPreservation)
@@ -418,52 +418,52 @@ CPPUNIT_TEST_FIXTURE(Test, testPictureEffectPreservation)
// first picture: glow effect with theme color and transformations, 3d rotation and extrusion
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:glow",
- "rad", "228600");
+ "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:glow"_ostr,
+ "rad"_ostr, "228600");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:glow/a:srgbClr",
- "val", "267de6");
+ "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:glow/a:srgbClr"_ostr,
+ "val"_ostr, "267de6");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:glow/a:srgbClr/a:alpha",
- "val", "40000");
+ "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:glow/a:srgbClr/a:alpha"_ostr,
+ "val"_ostr, "40000");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:scene3d/a:camera",
- "prst", "isometricRightUp");
+ "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:scene3d/a:camera"_ostr,
+ "prst"_ostr, "isometricRightUp");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:scene3d/a:lightRig",
- "rig", "threePt");
+ "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:scene3d/a:lightRig"_ostr,
+ "rig"_ostr, "threePt");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:sp3d",
- "extrusionH", "76200");
+ "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:sp3d"_ostr,
+ "extrusionH"_ostr, "76200");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:sp3d/a:extrusionClr/a:srgbClr",
- "val", "92d050");
+ "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:sp3d/a:extrusionClr/a:srgbClr"_ostr,
+ "val"_ostr, "92d050");
// second picture: shadow and reflection effects
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:outerShdw",
- "dir", "8100000");
+ "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:outerShdw"_ostr,
+ "dir"_ostr, "8100000");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:outerShdw/a:srgbClr",
- "val", "000000");
+ "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:outerShdw/a:srgbClr"_ostr,
+ "val"_ostr, "000000");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:outerShdw/a:srgbClr/a:alpha",
- "val", "40000");
+ "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:outerShdw/a:srgbClr/a:alpha"_ostr,
+ "val"_ostr, "40000");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:reflection",
- "dir", "5400000");
+ "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:reflection"_ostr,
+ "dir"_ostr, "5400000");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:reflection/*",
+ "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:reflection/*"_ostr,
0 ); // should not be present
// third picture: soft edge effect
assertXPathHasApproxEMU(
pXmlDoc,
"/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:softEdge",
- "rad", 63500); // actually, it returns 63360
+ "wp:anchor/a:graphic/a:graphicData/pic:pic/pic:spPr/a:effectLst/a:softEdge"_ostr,
+ "rad"_ostr, 63500); // actually, it returns 63360
}
CPPUNIT_TEST_FIXTURE(Test, testPictureArtisticEffectPreservation)
@@ -478,86 +478,86 @@ CPPUNIT_TEST_FIXTURE(Test, testPictureArtisticEffectPreservation)
// 1st picture: marker effect
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/"
"a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/"
- "a14:artisticMarker",
- "trans", "14000");
+ "a14:artisticMarker"_ostr,
+ "trans"_ostr, "14000");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/"
"a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/"
- "a14:artisticMarker",
- "size", "80");
+ "a14:artisticMarker"_ostr,
+ "size"_ostr, "80");
OUString sEmbedId1 = getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer",
- "embed");
+ "wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer"_ostr,
+ "embed"_ostr);
OUString sXmlPath = "/rels:Relationships/rels:Relationship[@Id='" + sEmbedId1 + "']";
- OUString sFile = getXPath(pRelsDoc, OUStringToOString( sXmlPath, RTL_TEXTENCODING_UTF8 ), "Target");
+ OUString sFile = getXPath(pRelsDoc, OUStringToOString( sXmlPath, RTL_TEXTENCODING_UTF8 ), "Target"_ostr);
CPPUNIT_ASSERT_EQUAL(true, bool(xNameAccess->hasByName("word/" + sFile)));
// 2nd picture: pencil grayscale
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/"
"a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/"
- "a14:artisticPencilGrayscale",
- "trans", "15000");
+ "a14:artisticPencilGrayscale"_ostr,
+ "trans"_ostr, "15000");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/"
"a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/"
- "a14:artisticPencilGrayscale",
- "pencilSize", "66");
+ "a14:artisticPencilGrayscale"_ostr,
+ "pencilSize"_ostr, "66");
OUString sEmbedId2 = getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer",
- "embed");
+ "wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer"_ostr,
+ "embed"_ostr);
CPPUNIT_ASSERT_EQUAL(sEmbedId1, sEmbedId2);
// 3rd picture: pencil sketch
assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/"
"a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/"
- "a14:artisticPencilSketch",
- "trans", "7000");
+ "a14:artisticPencilSketch"_ostr,
+ "trans"_ostr, "7000");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/"
"a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/"
- "a14:artisticPencilSketch",
- "pressure", "17");
+ "a14:artisticPencilSketch"_ostr,
+ "pressure"_ostr, "17");
OUString sEmbedId3 = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer",
- "embed");
+ "wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer"_ostr,
+ "embed"_ostr);
CPPUNIT_ASSERT_EQUAL(sEmbedId1, sEmbedId3);
// 4th picture: light screen
assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/"
"a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/"
- "a14:artisticLightScreen",
- "trans", "13000");
+ "a14:artisticLightScreen"_ostr,
+ "trans"_ostr, "13000");
assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/"
"a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/"
- "a14:artisticLightScreen",
- "gridSize", "1");
+ "a14:artisticLightScreen"_ostr,
+ "gridSize"_ostr, "1");
OUString sEmbedId4 = getXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer",
- "embed");
+ "wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer"_ostr,
+ "embed"_ostr);
sXmlPath = "/rels:Relationships/rels:Relationship[@Id='" + sEmbedId4 + "']";
- sFile = getXPath(pRelsDoc, OUStringToOString( sXmlPath, RTL_TEXTENCODING_UTF8 ), "Target");
+ sFile = getXPath(pRelsDoc, OUStringToOString( sXmlPath, RTL_TEXTENCODING_UTF8 ), "Target"_ostr);
CPPUNIT_ASSERT_EQUAL(true, bool(xNameAccess->hasByName("word/" + sFile)));
// 5th picture: watercolor sponge
assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/"
"a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/"
- "a14:artisticWatercolorSponge",
- "brushSize", "4");
+ "a14:artisticWatercolorSponge"_ostr,
+ "brushSize"_ostr, "4");
OUString sEmbedId5 = getXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer",
- "embed");
+ "wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer"_ostr,
+ "embed"_ostr);
CPPUNIT_ASSERT_EQUAL(sEmbedId1, sEmbedId5);
// 6th picture: photocopy (no attributes)
assertXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/"
"a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer/a14:imgEffect/"
- "a14:artisticPhotocopy", 1);
+ "a14:artisticPhotocopy"_ostr, 1);
OUString sEmbedId6 = getXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:r/mc:AlternateContent/mc:Choice/w:drawing/"
- "wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer",
- "embed");
+ "wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:extLst/a:ext/a14:imgProps/a14:imgLayer"_ostr,
+ "embed"_ostr);
CPPUNIT_ASSERT_EQUAL(sEmbedId1, sEmbedId6);
// no redundant wdp files saved
@@ -568,7 +568,7 @@ CPPUNIT_TEST_FIXTURE(Test, fdo77719)
{
loadAndSave("fdo77719.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:custGeom[1]", 1);
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:custGeom[1]"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testNestedAlternateContent)
@@ -576,7 +576,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNestedAlternateContent)
loadAndSave("nestedAlternateContent.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// We check alternateContent could not contains alternateContent (i.e. nested alternateContent)
- assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wpg:wgp[1]/wps:wsp[2]/wps:txbx[1]/w:txbxContent[1]/w:p[1]/w:r[2]/mc:AlternateContent[1]",0);
+ assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wpg:wgp[1]/wps:wsp[2]/wps:txbx[1]/w:txbxContent[1]/w:p[1]/w:r[2]/mc:AlternateContent[1]"_ostr,0);
}
#if 0
@@ -596,14 +596,14 @@ CPPUNIT_TEST_FIXTURE(Test, fdo76591)
{
loadAndSave("fdo76591.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[3]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]", "relativeHeight", "3");
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[3]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]"_ostr, "relativeHeight"_ostr, "3");
}
CPPUNIT_TEST_FIXTURE(Test, test76317_2K10)
{
loadAndSave("test76317_2K10.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:prstGeom[1]/a:avLst[1]/a:gd[1]", "name", "adj");
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:prstGeom[1]/a:avLst[1]/a:gd[1]"_ostr, "name"_ostr, "adj");
}
CPPUNIT_TEST_FIXTURE(Test, testFDO77122)
@@ -611,22 +611,22 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO77122)
loadAndSave("LinkedTextBoxes.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
//ensure that the text box links are preserved.
- assertXPath(pXmlDoc, "//wps:txbx[1]", "id", "1");
- assertXPath(pXmlDoc, "//wps:linkedTxbx[1]", "id", "1");
+ assertXPath(pXmlDoc, "//wps:txbx[1]"_ostr, "id"_ostr, "1");
+ assertXPath(pXmlDoc, "//wps:linkedTxbx[1]"_ostr, "id"_ostr, "1");
}
CPPUNIT_TEST_FIXTURE(Test, test76734_2K7)
{
loadAndSave("test76734_2K7.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[3]/mc:AlternateContent[1]/mc:Choice[1]", "Requires", "wps");
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[3]/mc:AlternateContent[1]/mc:Choice[1]"_ostr, "Requires"_ostr, "wps");
}
CPPUNIT_TEST_FIXTURE(Test, test77219)
{
loadAndSave("test77219.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[6]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]", "behindDoc", "1");
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[6]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]"_ostr, "behindDoc"_ostr, "1");
}
DECLARE_OOXMLEXPORT_TEST(testTdf77219_backgroundShape, "tdf77219_backgroundShape.docx")
@@ -665,7 +665,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo76101)
{
loadAndSave("fdo76101.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml");
- xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "/w:styles/w:style");
+ xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "/w:styles/w:style"_ostr);
xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
CPPUNIT_ASSERT(4091 >= xmlXPathNodeSetGetLength(pXmlNodes));
xmlXPathFreeObject(pXmlObj);
@@ -675,8 +675,8 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtAndShapeOverlapping)
{
loadAndSave("ShapeOverlappingWithSdt.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/mc:AlternateContent");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt[1]/w:sdtContent[1]/w:r[1]");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/mc:AlternateContent"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt[1]/w:sdtContent[1]/w:r[1]"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testLockedCanvas)
@@ -684,7 +684,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLockedCanvas)
loadAndSave("fdo78658.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Checking for lockedCanvas tag
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/lc:lockedCanvas", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/lc:lockedCanvas"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, fdo78474)
@@ -692,10 +692,10 @@ CPPUNIT_TEST_FIXTURE(Test, fdo78474)
loadAndSave("fdo78474.docx");
xmlDocUniquePtr pXmlDoc1 = parseExport("word/document.xml");
//docx file after RT is getting corrupted.
- assertXPath(pXmlDoc1, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxContent[1]/w:p[1]/w:r[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/pic:pic[1]/pic:blipFill[1]/a:blip[1]", "embed", "rId2");
+ assertXPath(pXmlDoc1, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxContent[1]/w:p[1]/w:r[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/pic:pic[1]/pic:blipFill[1]/a:blip[1]"_ostr, "embed"_ostr, "rId2");
xmlDocUniquePtr pXmlDoc2 = parseExport("word/_rels/document.xml.rels");
- assertXPath(pXmlDoc2,"/rels:Relationships/rels:Relationship[2]","Id","rId2");
+ assertXPath(pXmlDoc2,"/rels:Relationships/rels:Relationship[2]"_ostr,"Id"_ostr,"rId2");
}
CPPUNIT_TEST_FIXTURE(Test, testAbsolutePositionOffsetValue)
@@ -704,14 +704,14 @@ CPPUNIT_TEST_FIXTURE(Test, testAbsolutePositionOffsetValue)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
xmlXPathObjectPtr pXmlObjs[6];
- pXmlObjs[0] = getXPathNode(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:positionH[1]/wp:posOffset[1]");
- pXmlObjs[1] = getXPathNode(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:positionV[1]/wp:posOffset[1]");
+ pXmlObjs[0] = getXPathNode(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:positionH[1]/wp:posOffset[1]"_ostr);
+ pXmlObjs[1] = getXPathNode(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:positionV[1]/wp:posOffset[1]"_ostr);
- pXmlObjs[2] = getXPathNode(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[2]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:positionH[1]/wp:posOffset[1]");
- pXmlObjs[3] = getXPathNode(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[2]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:positionV[1]/wp:posOffset[1]");
+ pXmlObjs[2] = getXPathNode(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[2]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:positionH[1]/wp:posOffset[1]"_ostr);
+ pXmlObjs[3] = getXPathNode(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[2]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:positionV[1]/wp:posOffset[1]"_ostr);
- pXmlObjs[4] = getXPathNode(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[3]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:positionH[1]/wp:posOffset[1]");
- pXmlObjs[5] = getXPathNode(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[3]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:positionV[1]/wp:posOffset[1]");
+ pXmlObjs[4] = getXPathNode(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[3]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:positionH[1]/wp:posOffset[1]"_ostr);
+ pXmlObjs[5] = getXPathNode(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[3]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:positionV[1]/wp:posOffset[1]"_ostr);
for(sal_Int32 index = 0; index<6; ++index)
{
@@ -734,7 +734,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo78300)
loadAndSave("fdo78300.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
assertXPath(pXmlDoc,
- "/w:document/w:body/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing[1]/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p[1]/w:r[1]/w:drawing[1]",
+ "/w:document/w:body/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing[1]/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p[1]/w:r[1]/w:drawing[1]"_ostr,
0);
}
@@ -751,10 +751,10 @@ CPPUNIT_TEST_FIXTURE(Test, testWordArtWithinDraingtool)
* */
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent",1);
- assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:textbox/w:txbxContent/w:p/w:r/w:pict/v:shape",1);
+ assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent"_ostr,1);
+ assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:textbox/w:txbxContent/w:p/w:r/w:pict/v:shape"_ostr,1);
// Make sure that the shape inside a shape is exported as VML-only, no embedded mc:AlternateContent before w:pict.
- assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p/w:r/w:pict",1);
+ assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p/w:r/w:pict"_ostr,1);
}
CPPUNIT_TEST_FIXTURE(Test, testfdo78663)
@@ -772,10 +772,10 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo78663)
* */
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p/w:r/w:pict/v:shape/v:path",1);
- assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:textbox/w:txbxContent/w:p/w:r/w:pict/v:shape/v:path",1);
+ assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p/w:r/w:pict/v:shape/v:path"_ostr,1);
+ assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:textbox/w:txbxContent/w:p/w:r/w:pict/v:shape/v:path"_ostr,1);
// Make sure that the shape inside a shape is exported as VML-only, no embedded mc:AlternateContent before w:pict.
- assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p/w:r/w:pict",1);
+ assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p/w:r/w:pict"_ostr,1);
}
CPPUNIT_TEST_FIXTURE(Test, testFdo78957)
@@ -785,8 +785,8 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo78957)
const sal_Int64 IntMax = SAL_MAX_INT32;
sal_Int64 cx = 0, cy = 0;
- cx = getXPath(pXmlHeader,"/w:hdr[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:extent[1]","cx").toInt64();
- cy = getXPath(pXmlHeader,"/w:hdr[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:extent[1]","cy").toInt64();
+ cx = getXPath(pXmlHeader,"/w:hdr[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:extent[1]"_ostr,"cx"_ostr).toInt64();
+ cy = getXPath(pXmlHeader,"/w:hdr[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:extent[1]"_ostr,"cy"_ostr).toInt64();
// Here we check the values of extent width & height
CPPUNIT_ASSERT(cx <= IntMax );
CPPUNIT_ASSERT(cy >= 0 );
@@ -800,7 +800,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo79256)
*/
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln/a:prstDash", "val", "lgDash");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln/a:prstDash"_ostr, "val"_ostr, "lgDash");
}
CPPUNIT_TEST_FIXTURE(Test, testDashedLine_CustDash1000thOfPercent)
@@ -812,14 +812,14 @@ CPPUNIT_TEST_FIXTURE(Test, testDashedLine_CustDash1000thOfPercent)
*/
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[1]", "d" , "800000");
- assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[1]", "sp", "300000");
+ assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[1]"_ostr, "d"_ostr , "800000");
+ assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[1]"_ostr, "sp"_ostr, "300000");
- assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[2]", "d" , "100000");
- assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[2]", "sp", "300000");
+ assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[2]"_ostr, "d"_ostr , "100000");
+ assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[2]"_ostr, "sp"_ostr, "300000");
- assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[3]", "d" , "100000");
- assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[3]", "sp", "300000");
+ assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[3]"_ostr, "d"_ostr , "100000");
+ assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[3]"_ostr, "sp"_ostr, "300000");
}
CPPUNIT_TEST_FIXTURE(Test, testDashedLine_CustDashPercentage)
@@ -832,14 +832,14 @@ CPPUNIT_TEST_FIXTURE(Test, testDashedLine_CustDashPercentage)
*/
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[1]", "d" , "800000");
- assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[1]", "sp", "300000");
+ assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[1]"_ostr, "d"_ostr , "800000");
+ assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[1]"_ostr, "sp"_ostr, "300000");
- assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[2]", "d" , "100000");
- assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[2]", "sp", "300000");
+ assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[2]"_ostr, "d"_ostr , "100000");
+ assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[2]"_ostr, "sp"_ostr, "300000");
- assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[3]", "d" , "100000");
- assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[3]", "sp", "300000");
+ assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[3]"_ostr, "d"_ostr , "100000");
+ assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[3]"_ostr, "sp"_ostr, "300000");
}
CPPUNIT_TEST_FIXTURE(Test, testCommentInitials)
@@ -848,7 +848,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCommentInitials)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/comments.xml");
- assertXPath(pXmlDoc,"/w:comments/w:comment[1]", "initials", "initials");
+ assertXPath(pXmlDoc,"/w:comments/w:comment[1]"_ostr, "initials"_ostr, "initials");
}
DECLARE_OOXMLEXPORT_TEST(testTextboxRoundedCorners, "textbox-rounded-corners.docx")
@@ -876,8 +876,8 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo79591)
*/
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp:docPr", "name", "_x0000_t0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:shape", "ID", "_x0000_t0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp:docPr"_ostr, "name"_ostr, "_x0000_t0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:shape"_ostr, "ID"_ostr, "_x0000_t0");
}
DECLARE_OOXMLEXPORT_TEST(testBnc884615, "bnc884615.docx")
@@ -892,8 +892,8 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo80894)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Rotation value was not roundtripped for textframe.
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:xfrm",
- "rot","16200000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:xfrm"_ostr,
+ "rot"_ostr,"16200000");
// w:enforcement defaults to off if not explicitly specified, so DocProtect forms should not be enabled.
uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY);
@@ -910,12 +910,12 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo80895)
// Checking there is a shape in header without <a:noFill/> element.
xmlDocUniquePtr pXmlDoc = parseExport("word/header2.xml");
- assertXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:noFill",0);
- assertXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:noFill",0);
+ assertXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:noFill"_ostr,0);
+ assertXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:noFill"_ostr,0);
// Check for fallback (required for MSO-2007)
- assertXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:rect", "fillcolor", "#4f81bd");
- assertXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:fill", "type", "solid");
+ assertXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:rect"_ostr, "fillcolor"_ostr, "#4f81bd");
+ assertXPath(pXmlDoc, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:rect/v:fill"_ostr, "type"_ostr, "solid");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf118242)
@@ -926,20 +926,20 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf118242)
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r[2]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor"
- "/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p[2]/w:pPr/w:pStyle", "val", "HeaderRight");
+ "/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p[2]/w:pPr/w:pStyle"_ostr, "val"_ostr, "HeaderRight");
// w:sectPr is not exported
assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r[2]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor"
- "/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p[2]/w:pPr/w:sectPr", 0);
+ "/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p[2]/w:pPr/w:sectPr"_ostr, 0);
// and drawing is no longer in the document
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r[3]", 0);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r[3]"_ostr, 0);
//but it's in the header
pXmlDocument = parseExport("word/header1.xml");
assertXPath(pXmlDocument, "/w:hdr/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData"
- "/wps:wsp/wps:txbx/w:txbxContent/w:p[1]/w:r/w:drawing", 1);
+ "/wps:wsp/wps:txbx/w:txbxContent/w:p[1]/w:r/w:drawing"_ostr, 1);
}
@@ -949,9 +949,9 @@ CPPUNIT_TEST_FIXTURE(Test, testWrapTightThrough)
// These were wrapSquare without a wrap polygon before.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// The first shape should be wrapThrough with a wrap polygon (was wrapSquare).
- assertXPath(pXmlDoc, "//w:drawing/wp:anchor[1]/wp:wrapThrough/wp:wrapPolygon/wp:start", "x", "-1104");
+ assertXPath(pXmlDoc, "//w:drawing/wp:anchor[1]/wp:wrapThrough/wp:wrapPolygon/wp:start"_ostr, "x"_ostr, "-1104");
// The second shape should be wrapTight with a wrap polygon (was wrapSquare).
- assertXPath(pXmlDoc, "//w:drawing/wp:anchor[1]/wp:wrapTight/wp:wrapPolygon/wp:start", "y", "792");
+ assertXPath(pXmlDoc, "//w:drawing/wp:anchor[1]/wp:wrapTight/wp:wrapPolygon/wp:start"_ostr, "y"_ostr, "792");
}
DECLARE_OOXMLEXPORT_TEST(testPictureWrapPolygon, "picture-wrap-polygon.docx")
@@ -971,7 +971,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPictureColormodeGrayscale)
// The problem was that the grayscale was not exported
xmlDocUniquePtr pXmlDoc = parseExport ("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:grayscl", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:grayscl"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testPictureColormodeBlackWhite)
@@ -981,7 +981,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPictureColormodeBlackWhite)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport ("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:biLevel", "thresh", "50000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:biLevel"_ostr, "thresh"_ostr, "50000");
}
CPPUNIT_TEST_FIXTURE(Test, testPictureColormodeWatermark)
@@ -990,8 +990,8 @@ CPPUNIT_TEST_FIXTURE(Test, testPictureColormodeWatermark)
CPPUNIT_ASSERT_EQUAL(1, getShapes());
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport ("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:lum", "bright", "70000");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:lum", "contrast", "-70000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:lum"_ostr, "bright"_ostr, "70000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:lum"_ostr, "contrast"_ostr, "-70000");
}
@@ -1003,10 +1003,10 @@ CPPUNIT_TEST_FIXTURE(Test, testExportShadow)
// The problem was that shadows of shapes from non-OOXML origin were not exported to DrawingML
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:spPr/a:effectLst/a:outerShdw", "dist" , "109865");
- assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:spPr/a:effectLst/a:outerShdw", "dir" , "634411");
- assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:spPr/a:effectLst/a:outerShdw/a:srgbClr", "val" , "000000");
- assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:spPr/a:effectLst/a:outerShdw/a:srgbClr/a:alpha", "val" , "38000");
+ assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:spPr/a:effectLst/a:outerShdw"_ostr, "dist"_ostr , "109865");
+ assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:spPr/a:effectLst/a:outerShdw"_ostr, "dir"_ostr , "634411");
+ assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:spPr/a:effectLst/a:outerShdw/a:srgbClr"_ostr, "val"_ostr , "000000");
+ assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:spPr/a:effectLst/a:outerShdw/a:srgbClr/a:alpha"_ostr, "val"_ostr , "38000");
}
CPPUNIT_TEST_FIXTURE(Test, testExportAdjustmentValue)
@@ -1014,7 +1014,7 @@ CPPUNIT_TEST_FIXTURE(Test, testExportAdjustmentValue)
loadAndSave("tdf91429.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd", "fmla", "val 50000");
+ assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd"_ostr, "fmla"_ostr, "val 50000");
}
DECLARE_OOXMLEXPORT_TEST(testTextVerticalAdjustment, "tdf36117_verticalAdjustment.docx")
@@ -1047,57 +1047,57 @@ DECLARE_OOXMLEXPORT_TEST(testTDF87348, "tdf87348_linkedTextboxes.docx")
{
int followCount=0;
int precedeCount=0;
- if( !parseDump("/root/page/body/txt/anchored/fly[1]/txt","follow").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[1]/txt"_ostr,"follow"_ostr).isEmpty() )
followCount++;
- if( !parseDump("/root/page/body/txt/anchored/fly[1]/txt","precede").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[1]/txt"_ostr,"precede"_ostr).isEmpty() )
precedeCount++;
- if( !parseDump("/root/page/body/txt/anchored/fly[2]/txt","follow").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[2]/txt"_ostr,"follow"_ostr).isEmpty() )
followCount++;
- if( !parseDump("/root/page/body/txt/anchored/fly[2]/txt","precede").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[2]/txt"_ostr,"precede"_ostr).isEmpty() )
precedeCount++;
- if( !parseDump("/root/page/body/txt/anchored/fly[3]/txt","follow").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[3]/txt"_ostr,"follow"_ostr).isEmpty() )
followCount++;
- if( !parseDump("/root/page/body/txt/anchored/fly[3]/txt","precede").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[3]/txt"_ostr,"precede"_ostr).isEmpty() )
precedeCount++;
- if( !parseDump("/root/page/body/txt/anchored/fly[4]/txt","follow").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[4]/txt"_ostr,"follow"_ostr).isEmpty() )
followCount++;
- if( !parseDump("/root/page/body/txt/anchored/fly[4]/txt","precede").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[4]/txt"_ostr,"precede"_ostr).isEmpty() )
precedeCount++;
- if( !parseDump("/root/page/body/txt/anchored/fly[5]/txt","follow").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[5]/txt"_ostr,"follow"_ostr).isEmpty() )
followCount++;
- if( !parseDump("/root/page/body/txt/anchored/fly[5]/txt","precede").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[5]/txt"_ostr,"precede"_ostr).isEmpty() )
precedeCount++;
- if( !parseDump("/root/page/body/txt/anchored/fly[6]/txt","follow").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[6]/txt"_ostr,"follow"_ostr).isEmpty() )
followCount++;
- if( !parseDump("/root/page/body/txt/anchored/fly[6]/txt","precede").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[6]/txt"_ostr,"precede"_ostr).isEmpty() )
precedeCount++;
- if( !parseDump("/root/page/body/txt/anchored/fly[7]/txt","follow").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[7]/txt"_ostr,"follow"_ostr).isEmpty() )
followCount++;
- if( !parseDump("/root/page/body/txt/anchored/fly[7]/txt","precede").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[7]/txt"_ostr,"precede"_ostr).isEmpty() )
precedeCount++;
- if( !parseDump("/root/page/body/txt/anchored/fly[8]/txt","follow").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[8]/txt"_ostr,"follow"_ostr).isEmpty() )
followCount++;
- if( !parseDump("/root/page/body/txt/anchored/fly[8]/txt","precede").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[8]/txt"_ostr,"precede"_ostr).isEmpty() )
precedeCount++;
- if( !parseDump("/root/page/body/txt/anchored/fly[9]/txt","follow").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[9]/txt"_ostr,"follow"_ostr).isEmpty() )
followCount++;
- if( !parseDump("/root/page/body/txt/anchored/fly[9]/txt","precede").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[9]/txt"_ostr,"precede"_ostr).isEmpty() )
precedeCount++;
- if( !parseDump("/root/page/body/txt/anchored/fly[10]/txt","follow").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[10]/txt"_ostr,"follow"_ostr).isEmpty() )
followCount++;
- if( !parseDump("/root/page/body/txt/anchored/fly[10]/txt","precede").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[10]/txt"_ostr,"precede"_ostr).isEmpty() )
precedeCount++;
- if( !parseDump("/root/page/body/txt/anchored/fly[11]/txt","follow").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[11]/txt"_ostr,"follow"_ostr).isEmpty() )
followCount++;
- if( !parseDump("/root/page/body/txt/anchored/fly[11]/txt","precede").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[11]/txt"_ostr,"precede"_ostr).isEmpty() )
precedeCount++;
- if( !parseDump("/root/page/body/txt/anchored/fly[12]/txt","follow").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[12]/txt"_ostr,"follow"_ostr).isEmpty() )
followCount++;
- if( !parseDump("/root/page/body/txt/anchored/fly[12]/txt","precede").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[12]/txt"_ostr,"precede"_ostr).isEmpty() )
precedeCount++;
- if( !parseDump("/root/page/body/txt/anchored/fly[13]/txt","follow").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[13]/txt"_ostr,"follow"_ostr).isEmpty() )
followCount++;
- if( !parseDump("/root/page/body/txt/anchored/fly[13]/txt","precede").isEmpty() )
+ if( !parseDump("/root/page/body/txt/anchored/fly[13]/txt"_ostr,"precede"_ostr).isEmpty() )
precedeCount++;
//there should be 4 chains/13 linked textboxes (set of 5, set of 3, set of 3, set of 2)
//that means 9 NEXT links and 9 PREV links.
@@ -1113,7 +1113,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTDF93675)
loadAndSave("no-numlevel-but-indented.odt");
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//w:ind", "start", "1418");
+ assertXPath(pXmlDoc, "//w:ind"_ostr, "start"_ostr, "1418");
}
@@ -1125,29 +1125,29 @@ CPPUNIT_TEST_FIXTURE(Test, testFlipAndRotateCustomShape)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// there should be no flipH
- assertXPathNoAttribute(pXmlDoc, "//a:xfrm", "flipH");
+ assertXPathNoAttribute(pXmlDoc, "//a:xfrm"_ostr, "flipH"_ostr);
// flipV should be there
- assertXPath(pXmlDoc, "//a:xfrm", "flipV", "1");
+ assertXPath(pXmlDoc, "//a:xfrm"_ostr, "flipV"_ostr, "1");
// check rotation angle
- assertXPath(pXmlDoc, "//a:xfrm", "rot", "8100000");
+ assertXPath(pXmlDoc, "//a:xfrm"_ostr, "rot"_ostr, "8100000");
// point values depend on path size, values as of March 2022
- assertXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path", "w", "21600");
- assertXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path", "h", "21600");
+ assertXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path"_ostr, "w"_ostr, "21600");
+ assertXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path"_ostr, "h"_ostr, "21600");
// check the first few coordinates of the polygon
CPPUNIT_ASSERT_DOUBLES_EQUAL(
- 0, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:moveTo/a:pt", "x").toInt32(), 1);
+ 0, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:moveTo/a:pt"_ostr, "x"_ostr).toInt32(), 1);
CPPUNIT_ASSERT_DOUBLES_EQUAL(
- 15831, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:moveTo/a:pt", "y").toInt32(), 1);
+ 15831, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:moveTo/a:pt"_ostr, "y"_ostr).toInt32(), 1);
CPPUNIT_ASSERT_DOUBLES_EQUAL(
- 6098, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[1]/a:pt", "x").toInt32(), 1);
+ 6098, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[1]/a:pt"_ostr, "x"_ostr).toInt32(), 1);
CPPUNIT_ASSERT_DOUBLES_EQUAL(
- 10062, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[1]/a:pt", "y").toInt32(), 1);
+ 10062, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[1]/a:pt"_ostr, "y"_ostr).toInt32(), 1);
CPPUNIT_ASSERT_DOUBLES_EQUAL(
- 13284, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[4]/a:pt", "x").toInt32(), 1);
+ 13284, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[4]/a:pt"_ostr, "x"_ostr).toInt32(), 1);
CPPUNIT_ASSERT_DOUBLES_EQUAL(
- 6098, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[4]/a:pt", "y").toInt32(), 1);
+ 6098, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[4]/a:pt"_ostr, "y"_ostr).toInt32(), 1);
// check path is closed
- assertXPath(pXmlDoc, "//a:close", 1);
+ assertXPath(pXmlDoc, "//a:close"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf92335)
@@ -1156,7 +1156,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf92335)
// Don't export redundant ListLabel character styles
xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
- assertXPath(pXmlStyles, "//w:style[@w:styleId='ListLabel1']", 0);
+ assertXPath(pXmlStyles, "//w:style[@w:styleId='ListLabel1']"_ostr, 0);
}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
index b4ec5dbc6eee..2b9c87dd0dcc 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
@@ -200,8 +200,8 @@ DECLARE_OOXMLEXPORT_TEST(testN750255, "n750255.docx")
Column break without columns on the page is a page break, so check those paragraphs
are on page 2 and page 3
*/
- CPPUNIT_ASSERT_EQUAL( OUString("one"), parseDump("/root/page[2]/body/txt/text()") );
- CPPUNIT_ASSERT_EQUAL( OUString("two"), parseDump("/root/page[3]/body/txt/text()") );
+ CPPUNIT_ASSERT_EQUAL( OUString("one"), parseDump("/root/page[2]/body/txt/text()"_ostr) );
+ CPPUNIT_ASSERT_EQUAL( OUString("two"), parseDump("/root/page[3]/body/txt/text()"_ostr) );
}
DECLARE_OOXMLEXPORT_TEST(testN652364, "n652364.docx")
@@ -540,7 +540,7 @@ DECLARE_OOXMLEXPORT_TEST(testN780853, "n780853.docx")
DECLARE_OOXMLEXPORT_TEST(testN780843, "n780843.docx")
{
- CPPUNIT_ASSERT_EQUAL(OUString("shown footer"), parseDump("/root/page[2]/footer/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("shown footer"), parseDump("/root/page[2]/footer/txt/text()"_ostr));
//tdf64372 this document should only have one page break (2 pages, not 3)
CPPUNIT_ASSERT_EQUAL(2, getPages());
@@ -696,9 +696,9 @@ DECLARE_OOXMLEXPORT_TEST(testN793262, "n793262.docx")
DECLARE_OOXMLEXPORT_TEST(testN793998, "n793998.docx")
{
- sal_Int32 nTextPortion = parseDump("/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[1]", "width").toInt32(); // Width of the first (text) portion
- sal_Int32 nTabPortion = parseDump("/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[2]", "width").toInt32(); // Width of the second (tab) portion
- sal_Int32 nParagraph = parseDump("/root/page/body/txt/infos/bounds", "width").toInt32(); // Width of the paragraph
+ sal_Int32 nTextPortion = parseDump("/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[1]"_ostr, "width"_ostr).toInt32(); // Width of the first (text) portion
+ sal_Int32 nTabPortion = parseDump("/root/page/body/txt/SwParaPortion/SwLineLayout/child::*[2]"_ostr, "width"_ostr).toInt32(); // Width of the second (tab) portion
+ sal_Int32 nParagraph = parseDump("/root/page/body/txt/infos/bounds"_ostr, "width"_ostr).toInt32(); // Width of the paragraph
sal_Int32 const nRightMargin = 3000;
// The problem was that the tab portion didn't ignore the right margin, so text + tab width wasn't larger than body (paragraph - right margin) width.
CPPUNIT_ASSERT(nTextPortion + nTabPortion > nParagraph - nRightMargin);
@@ -732,7 +732,7 @@ CPPUNIT_TEST_FIXTURE(Test, testN779642)
discardDumpedLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// There is no footer text on the first page.
- assertXPath(pXmlDoc, "/root/page[1]/footer/txt", 0);
+ assertXPath(pXmlDoc, "/root/page[1]/footer/txt"_ostr, 0);
};
createSwDoc("n779642.docx");
verify();
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index c0dea13f2075..9886af42c6e7 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -70,8 +70,8 @@ CPPUNIT_TEST_FIXTURE(Test, testDocm)
// name of the import filter was checked.
xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml");
assertXPath(pXmlDoc,
- "/ContentType:Types/ContentType:Override[@PartName='/word/document.xml']",
- "ContentType",
+ "/ContentType:Types/ContentType:Override[@PartName='/word/document.xml']"_ostr,
+ "ContentType"_ostr,
"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml");
}
@@ -80,23 +80,23 @@ CPPUNIT_TEST_FIXTURE(Test, testDefaultContentTypes)
loadAndSave("fdo55381.docx");
xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml");
assertXPath(pXmlDoc,
- "/ContentType:Types/ContentType:Default[@Extension='xml']",
- "ContentType",
+ "/ContentType:Types/ContentType:Default[@Extension='xml']"_ostr,
+ "ContentType"_ostr,
"application/xml");
assertXPath(pXmlDoc,
- "/ContentType:Types/ContentType:Default[@Extension='rels']",
- "ContentType",
+ "/ContentType:Types/ContentType:Default[@Extension='rels']"_ostr,
+ "ContentType"_ostr,
"application/vnd.openxmlformats-package.relationships+xml");
assertXPath(pXmlDoc,
- "/ContentType:Types/ContentType:Default[@Extension='png']",
- "ContentType",
+ "/ContentType:Types/ContentType:Default[@Extension='png']"_ostr,
+ "ContentType"_ostr,
"image/png");
assertXPath(pXmlDoc,
- "/ContentType:Types/ContentType:Default[@Extension='jpeg']",
- "ContentType",
+ "/ContentType:Types/ContentType:Default[@Extension='jpeg']"_ostr,
+ "ContentType"_ostr,
"image/jpeg");
}
@@ -109,8 +109,8 @@ DECLARE_SW_ROUNDTRIP_TEST(testDocmSave, "hello.docm", nullptr, DocmTest)
{
xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml");
assertXPath(pXmlDoc,
- "/ContentType:Types/ContentType:Override[@PartName='/word/document.xml']",
- "ContentType",
+ "/ContentType:Types/ContentType:Override[@PartName='/word/document.xml']"_ostr,
+ "ContentType"_ostr,
"application/vnd.ms-word.document.macroEnabled.main+xml");
}
}
@@ -207,36 +207,36 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132802)
{
loadAndSave("tdf132802.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing", "after", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing", "after", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing"_ostr, "after"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing"_ostr, "after"_ostr, "0");
// This was 0 (list auto spacing is not zero before tables)
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:spacing", "after", "280");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[1]/w:pPr/w:spacing", "after", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:spacing"_ostr, "after"_ostr, "280");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[1]/w:pPr/w:spacing"_ostr, "after"_ostr, "0");
// This was 0 (list auto spacing is not zero at the end of table cells)
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[2]/w:pPr/w:spacing", "after", "280");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p[1]/w:pPr/w:spacing", "after", "280");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p[1]/w:pPr/w:spacing", "after", "280");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[2]/w:pPr/w:spacing"_ostr, "after"_ostr, "280");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p[1]/w:pPr/w:spacing"_ostr, "after"_ostr, "280");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p[1]/w:pPr/w:spacing"_ostr, "after"_ostr, "280");
// This was 0 (list auto spacing is not zero at list end)
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:spacing", "after", "280");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:spacing"_ostr, "after"_ostr, "280");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf132807)
{
loadAndSave("tdf132807.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing", "before", "280");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing"_ostr, "before"_ostr, "280");
// This was 240 (list auto spacing is zero in lists)
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:spacing", "before", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:spacing", "before", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:spacing"_ostr, "before"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:spacing"_ostr, "before"_ostr, "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[1]/w:pPr/w:spacing", "before", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[1]/w:pPr/w:spacing"_ostr, "before"_ostr, "0");
// This was 240 (list auto spacing is zero in lists)
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[2]/w:pPr/w:spacing", "before", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[2]/w:pPr/w:spacing"_ostr, "before"_ostr, "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p[1]/w:pPr/w:spacing", "before", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p[2]/w:pPr/w:spacing", "before", "280");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p[1]/w:pPr/w:spacing", "before", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:spacing", "before", "280");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p[1]/w:pPr/w:spacing"_ostr, "before"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p[2]/w:pPr/w:spacing"_ostr, "before"_ostr, "280");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p[1]/w:pPr/w:spacing"_ostr, "before"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:spacing"_ostr, "before"_ostr, "280");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf133052)
@@ -244,13 +244,13 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133052)
loadAndSave("tdf133052.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// These were 240 (top auto spacing of list subitems are zero)
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:spacing", "before", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:spacing", "before", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:spacing"_ostr, "before"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:spacing"_ostr, "before"_ostr, "0");
// in tables, too
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[2]/w:pPr/w:spacing", "before", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[3]/w:pPr/w:spacing", "before", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[4]/w:pPr/w:spacing", "before", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[5]/w:pPr/w:spacing", "before", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[2]/w:pPr/w:spacing"_ostr, "before"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[3]/w:pPr/w:spacing"_ostr, "before"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[4]/w:pPr/w:spacing"_ostr, "before"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[5]/w:pPr/w:spacing"_ostr, "before"_ostr, "0");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf134648)
@@ -259,11 +259,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf134648)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// list item with direct top auto spacing
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing", "after", "240");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing", "beforeAutospacing", "1");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing"_ostr, "after"_ostr, "240");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing"_ostr, "beforeAutospacing"_ostr, "1");
// This was spacing w:after=200, but bottom auto spacing of first list subitem is zero
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing", 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing"_ostr, 0);
}
DECLARE_OOXMLEXPORT_TEST(testTdf129575_directBefore, "tdf129575-directBefore.docx")
@@ -335,90 +335,90 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf118812)
loadAndSave("tdf118812_tableStyles-comprehensive.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// cell A1
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:pPr/w:pStyle", "val", "Normal");
- assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:pPr/w:spacing", "lineRule");
- assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:pPr/w:spacing", "line");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:pPr/w:spacing", "before", "480");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:pPr/w:spacing", "after", "20");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:r[1]/w:rPr/w:color", 0);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:r[1]/w:rPr/w:sz", "val", "16");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:r[2]/w:rPr/w:rStyle", "val", "CharSubStyleDefaults");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:r[2]/w:rPr/w:color", 0);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:r[2]/w:rPr/w:sz", "val", "16");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:pPr/w:pStyle"_ostr, "val"_ostr, "Normal");
+ assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:pPr/w:spacing"_ostr, "lineRule"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:pPr/w:spacing"_ostr, "line"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:pPr/w:spacing"_ostr, "before"_ostr, "480");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:pPr/w:spacing"_ostr, "after"_ostr, "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:r[1]/w:rPr/w:color"_ostr, 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:r[1]/w:rPr/w:sz"_ostr, "val"_ostr, "16");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:r[2]/w:rPr/w:rStyle"_ostr, "val"_ostr, "CharSubStyleDefaults");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:r[2]/w:rPr/w:color"_ostr, 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p/w:r[2]/w:rPr/w:sz"_ostr, "val"_ostr, "16");
// cell A2
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:pPr/w:pStyle", "val", "Normal");
- assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:pPr/w:spacing", "lineRule");
- assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:pPr/w:spacing", "line");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:pPr/w:spacing", "before", "480");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:pPr/w:spacing", "after", "20");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:r[1]/w:rPr/w:color", 0);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:r[1]/w:rPr/w:sz", "val", "16");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:r[2]/w:rPr/w:rStyle", "val", "ParaSubStyleDefaultsChar");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:r[2]/w:rPr/w:color", 0);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:r[2]/w:rPr/w:sz", "val", "16");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:r[3]/w:rPr/w:rStyle", "val", "CharSubStyleNormal");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:r[3]/w:rPr/w:color", 0);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:r[3]/w:rPr/w:sz", "val", "16");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:pPr/w:pStyle"_ostr, "val"_ostr, "Normal");
+ assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:pPr/w:spacing"_ostr, "lineRule"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:pPr/w:spacing"_ostr, "line"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:pPr/w:spacing"_ostr, "before"_ostr, "480");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:pPr/w:spacing"_ostr, "after"_ostr, "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:r[1]/w:rPr/w:color"_ostr, 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:r[1]/w:rPr/w:sz"_ostr, "val"_ostr, "16");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:r[2]/w:rPr/w:rStyle"_ostr, "val"_ostr, "ParaSubStyleDefaultsChar");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:r[2]/w:rPr/w:color"_ostr, 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:r[2]/w:rPr/w:sz"_ostr, "val"_ostr, "16");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:r[3]/w:rPr/w:rStyle"_ostr, "val"_ostr, "CharSubStyleNormal");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:r[3]/w:rPr/w:color"_ostr, 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p/w:r[3]/w:rPr/w:sz"_ostr, "val"_ostr, "16");
// cell A3
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:pPr/w:pStyle", "val", "ParaSubStyleNormal");
- assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:pPr/w:spacing", "lineRule");
- assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:pPr/w:spacing", "line");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:pPr/w:spacing", "before", "480");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:pPr/w:spacing", "after", "280");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r[1]/w:rPr/w:color", 0);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r[1]/w:rPr/w:sz", 0);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r[2]/w:rPr/w:rStyle", "val", "CharSubStyleNormal");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r[2]/w:rPr/w:color", 0);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r[2]/w:rPr/w:sz", 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:pPr/w:pStyle"_ostr, "val"_ostr, "ParaSubStyleNormal");
+ assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:pPr/w:spacing"_ostr, "lineRule"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:pPr/w:spacing"_ostr, "line"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:pPr/w:spacing"_ostr, "before"_ostr, "480");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:pPr/w:spacing"_ostr, "after"_ostr, "280");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r[1]/w:rPr/w:color"_ostr, 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r[1]/w:rPr/w:sz"_ostr, 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r[2]/w:rPr/w:rStyle"_ostr, "val"_ostr, "CharSubStyleNormal");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r[2]/w:rPr/w:color"_ostr, 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p/w:r[2]/w:rPr/w:sz"_ostr, 0);
// cell A4
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:pPr/w:pStyle", "val", "ParaSubStyleDefaults");
- assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:pPr/w:spacing", "lineRule");
- assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:pPr/w:spacing", "line");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:pPr/w:spacing", "before", "480");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:pPr/w:spacing", "after", "200");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r[1]/w:rPr/w:color", 0);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r[1]/w:rPr/w:sz", 0);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r[2]/w:rPr/w:rStyle", "val", "CharSubStyleDefaults");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r[2]/w:rPr/w:color", 0);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r[2]/w:rPr/w:sz", 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:pPr/w:pStyle"_ostr, "val"_ostr, "ParaSubStyleDefaults");
+ assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:pPr/w:spacing"_ostr, "lineRule"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:pPr/w:spacing"_ostr, "line"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:pPr/w:spacing"_ostr, "before"_ostr, "480");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:pPr/w:spacing"_ostr, "after"_ostr, "200");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r[1]/w:rPr/w:color"_ostr, 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r[1]/w:rPr/w:sz"_ostr, 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r[2]/w:rPr/w:rStyle"_ostr, "val"_ostr, "CharSubStyleDefaults");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r[2]/w:rPr/w:color"_ostr, 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r[2]/w:rPr/w:sz"_ostr, 0);
// cell A5
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:pPr/w:pStyle", "val", "Normal");
- assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:pPr/w:spacing", "lineRule");
- assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:pPr/w:spacing", "line");
- assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:pPr/w:rPr", "color");
- assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:pPr/w:rPr", "sz");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:pPr/w:spacing", "before", "480");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:pPr/w:spacing", "after", "20");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:r[1]/w:rPr/w:color", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:r[1]/w:rPr/w:color", "val", "AAAA00"); // all text in color
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:r[1]/w:rPr/w:sz", "val", "16");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:pPr/w:pStyle"_ostr, "val"_ostr, "Normal");
+ assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:pPr/w:spacing"_ostr, "lineRule"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:pPr/w:spacing"_ostr, "line"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:pPr/w:rPr"_ostr, "color"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:pPr/w:rPr"_ostr, "sz"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:pPr/w:spacing"_ostr, "before"_ostr, "480");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:pPr/w:spacing"_ostr, "after"_ostr, "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:r[1]/w:rPr/w:color"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:r[1]/w:rPr/w:color"_ostr, "val"_ostr, "AAAA00"); // all text in color
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[5]/w:tc/w:p/w:r[1]/w:rPr/w:sz"_ostr, "val"_ostr, "16");
// cell A6
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:pPr/w:pStyle", "val", "Normal");
- assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:pPr/w:spacing", "lineRule");
- assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:pPr/w:spacing", "line");
- assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:pPr/w:rPr", "color");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:pPr/w:rPr/w:sz", "val", "16");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:pPr/w:spacing", "before", "480");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:pPr/w:spacing", "after", "20");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:r[1]/w:rPr/w:color", 0);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:r[1]/w:rPr/w:sz", "val", "16");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:r[2]/w:rPr/w:color", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:r[2]/w:rPr/w:color", "val", "AAAA00");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:r[2]/w:rPr/w:sz", "val", "16");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:pPr/w:pStyle"_ostr, "val"_ostr, "Normal");
+ assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:pPr/w:spacing"_ostr, "lineRule"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:pPr/w:spacing"_ostr, "line"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:pPr/w:rPr"_ostr, "color"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:pPr/w:rPr/w:sz"_ostr, "val"_ostr, "16");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:pPr/w:spacing"_ostr, "before"_ostr, "480");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:pPr/w:spacing"_ostr, "after"_ostr, "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:r[1]/w:rPr/w:color"_ostr, 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:r[1]/w:rPr/w:sz"_ostr, "val"_ostr, "16");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:r[2]/w:rPr/w:color"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:r[2]/w:rPr/w:color"_ostr, "val"_ostr, "AAAA00");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:r[2]/w:rPr/w:sz"_ostr, "val"_ostr, "16");
// tdf#131070 keep paragraph style based right indentation with indentation of direct numbering
// cell A7 - This was <w:ind w:start="1440" w:hanging="0"/>
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[7]/w:tc/w:p/w:pPr/w:ind", 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[7]/w:tc/w:p/w:pPr/w:ind"_ostr, 0);
// cell A8
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[8]/w:tc/w:p/w:pPr/w:ind", "start", "714");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[8]/w:tc/w:p/w:pPr/w:ind", "end", "1701");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[8]/w:tc/w:p/w:pPr/w:ind", "hanging", "357");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[8]/w:tc/w:p/w:pPr/w:ind"_ostr, "start"_ostr, "714");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[8]/w:tc/w:p/w:pPr/w:ind"_ostr, "end"_ostr, "1701");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[8]/w:tc/w:p/w:pPr/w:ind"_ostr, "hanging"_ostr, "357");
// cell A9
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[9]/w:tc/w:p/w:pPr/w:ind", "end", "1440");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[9]/w:tc/w:p/w:pPr/w:ind"_ostr, "end"_ostr, "1440");
// This was 1440
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[9]/w:tc/w:p/w:pPr/w:ind", "start", "720");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[9]/w:tc/w:p/w:pPr/w:ind"_ostr, "start"_ostr, "720");
// This was 0
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[9]/w:tc/w:p/w:pPr/w:ind", "hanging", "360");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[9]/w:tc/w:p/w:pPr/w:ind"_ostr, "hanging"_ostr, "360");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf107626)
@@ -427,7 +427,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf107626)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// This was 2 (missing trailing cell in merged cell range)
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc", 3);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc"_ostr, 3);
}
DECLARE_OOXMLEXPORT_TEST(testTdf106970, "tdf106970.docx")
@@ -449,9 +449,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf79272_strictDxa, "tdf79272_strictDxa.docx")
return;
xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml");
// Validation test: order of elements was wrong. Order was: insideH, end, insideV.
- int nEnd = getXPathPosition(pXmlDoc, "/w:styles/w:style[@w:styleId='TableGrid']/w:tblPr/w:tblBorders", "end");
- int nInsideH = getXPathPosition(pXmlDoc, "/w:styles/w:style[@w:styleId='TableGrid']/w:tblPr/w:tblBorders", "insideH");
- int nInsideV = getXPathPosition(pXmlDoc, "/w:styles/w:style[@w:styleId='TableGrid']/w:tblPr/w:tblBorders", "insideV");
+ int nEnd = getXPathPosition(pXmlDoc, "/w:styles/w:style[@w:styleId='TableGrid']/w:tblPr/w:tblBorders"_ostr, "end");
+ int nInsideH = getXPathPosition(pXmlDoc, "/w:styles/w:style[@w:styleId='TableGrid']/w:tblPr/w:tblBorders"_ostr, "insideH");
+ int nInsideV = getXPathPosition(pXmlDoc, "/w:styles/w:style[@w:styleId='TableGrid']/w:tblPr/w:tblBorders"_ostr, "insideV");
CPPUNIT_ASSERT(nEnd < nInsideH);
CPPUNIT_ASSERT(nInsideH < nInsideV);
}
@@ -788,7 +788,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf109310_endnoteStyleForMSO)
loadAndSave("tdf109310_endnoteStyleForMSO.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/endnotes.xml");
// Check w:rStyle element has w:val attribute - note that w: is not specified for attribute
- assertXPath(pXmlDoc, "/w:endnotes/w:endnote[@w:id='2']/w:p/w:r[1]/w:rPr/w:rStyle", "val",
+ assertXPath(pXmlDoc, "/w:endnotes/w:endnote[@w:id='2']/w:p/w:r[1]/w:rPr/w:rStyle"_ostr, "val"_ostr,
"EndnoteCharacters");
}
@@ -798,15 +798,15 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf103389)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// No geometry was exported for the second canvas
// Check both canvases' geometry
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp/wps:spPr/a:prstGeom", "prst", "rect");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp/wps:spPr/a:prstGeom", "prst", "rect");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp/wps:spPr/a:prstGeom"_ostr, "prst"_ostr, "rect");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp/wps:spPr/a:prstGeom"_ostr, "prst"_ostr, "rect");
}
DECLARE_OOXMLEXPORT_TEST(testTdf84678, "tdf84678.docx")
{
// This was 0, left margin inside a shape+text wasn't imported from DOCX.
// 360000 EMU, but layout uses twips.
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(567), parseDump("/root/page/body/txt/anchored/fly/infos/prtBounds", "left").toInt32());
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(567), parseDump("/root/page/body/txt/anchored/fly/infos/prtBounds"_ostr, "left"_ostr).toInt32());
}
@@ -891,7 +891,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf103982)
{
loadAndReload("tdf103982.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- sal_Int32 nDistB = getXPath(pXmlDoc, "//wp:anchor", "distB").toInt32();
+ sal_Int32 nDistB = getXPath(pXmlDoc, "//wp:anchor"_ostr, "distB"_ostr).toInt32();
// This was -260350, which is not a valid value for an unsigned type.
CPPUNIT_ASSERT(nDistB >= 0);
@@ -906,7 +906,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104115)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// This found 0 nodes: the custom geometry was not written for the Bezier
// curve -> Word refused to open the document.
- assertXPath(pXmlDoc, "//a:custGeom", 1);
+ assertXPath(pXmlDoc, "//a:custGeom"_ostr, 1);
}
DECLARE_OOXMLEXPORT_TEST(testTdf103651, "tdf103651.docx")
@@ -930,7 +930,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf99227)
// and before commit ebf767eeb2a169ba533e1b2ffccf16f41d95df35, the drawing was silently lost.
xmlDocUniquePtr pXmlDoc = parseExport("word/footnotes.xml");
- assertXPath(pXmlDoc, "//w:footnote/w:p/w:r/w:drawing", 1);
+ assertXPath(pXmlDoc, "//w:footnote/w:p/w:r/w:drawing"_ostr, 1);
}
DECLARE_OOXMLEXPORT_TEST(testTdf37153, "tdf37153_considerWrapOnObjPos.docx")
@@ -944,9 +944,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf37153, "tdf37153_considerWrapOnObjPos.docx")
//For MSO compatibility, the textbox should be at the top of the cell, not at the bottom - despite VertOrientation::BOTTOM
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- sal_Int32 nFlyTop = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt/anchored/fly/infos/bounds", "top").toInt32();
+ sal_Int32 nFlyTop = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt/anchored/fly/infos/bounds"_ostr, "top"_ostr).toInt32();
CPPUNIT_ASSERT_MESSAGE("FlyTop should be 2865, not 5649", nFlyTop < sal_Int32(3000));
- sal_Int32 nTextTop = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[2]/txt[1]/infos/bounds", "top").toInt32();
+ sal_Int32 nTextTop = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[2]/txt[1]/infos/bounds"_ostr, "top"_ostr).toInt32();
CPPUNIT_ASSERT_MESSAGE("TextTop should be 3856", nTextTop > 3000);
}
@@ -1105,7 +1105,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf106001_2)
// In test ODT CharScaleWidth = 900, this was not changed upon OOXML export to stay in [1..600], now it's clamped to 600
// Note: we disregard what's set in pPr / rPr and only care about r / rPr
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:rPr/w:w","val","600");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:rPr/w:w"_ostr,"val"_ostr,"600");
}
DECLARE_OOXMLEXPORT_TEST(testTdf99074, "tdf99074.docx")
@@ -1180,7 +1180,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf106492)
loadAndSave("tdf106492.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// This was 4: an additional sectPr was added to the document.
- assertXPath(pXmlDoc, "//w:sectPr", 3);
+ assertXPath(pXmlDoc, "//w:sectPr"_ostr, 3);
}
DECLARE_OOXMLEXPORT_TEST(testTdf107104, "tdf107104.docx")
@@ -1204,7 +1204,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf107889)
auto verify = [this]() {
// This was 1, multi-page table was imported as a non-split fly.
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//tab", 2);
+ assertXPath(pXmlDoc, "//tab"_ostr, 2);
};
createSwDoc("tdf107889.docx");
verify();
@@ -1229,7 +1229,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf107684)
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml");
// This was 1, <w:outlineLvl> was duplicated for Heading1.
- assertXPath(pXmlDoc, "//w:style[@w:styleId='Heading1']/w:pPr/w:outlineLvl", 1);
+ assertXPath(pXmlDoc, "//w:style[@w:styleId='Heading1']/w:pPr/w:outlineLvl"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf107618)
@@ -1397,15 +1397,15 @@ CPPUNIT_TEST_FIXTURE(Test, testActiveXControlAlign)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
CPPUNIT_ASSERT(pXmlDoc);
// For inline controls use w:object as parent element and pictureFrame shapetype
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:object", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:object/v:shapetype", "spt", "75");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:object"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:object/v:shapetype"_ostr, "spt"_ostr, "75");
// For floating controls use w:pict as parent element and hostControl shapetype
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:pict", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:pict/v:shapetype", "spt", "201");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:pict"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:pict/v:shapetype"_ostr, "spt"_ostr, "201");
// Have different shape ids
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:object/v:shape", "id") !=
- getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:pict/v:shape", "id"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:object/v:shape"_ostr, "id"_ostr) !=
+ getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:pict/v:shape"_ostr, "id"_ostr));
}
DECLARE_OOXMLEXPORT_TEST(testTdf109184, "tdf109184.docx")
@@ -1433,7 +1433,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf111964)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Unicode spaces that are not XML whitespace must not be trimmed
static constexpr OUStringLiteral sWSReference = u"\u2002\u2002\u2002\u2002\u2002";
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:t", sWSReference);
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:t"_ostr, sWSReference);
}
DECLARE_OOXMLEXPORT_TEST(testWatermark, "watermark-shapetype.docx")
@@ -1512,8 +1512,8 @@ CPPUNIT_TEST_FIXTURE(Test, tdf112169)
//tdf76683 - Cannot be negative number - use firstLine instead of hanging
xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml");
- assertXPathNoAttribute(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:pPr/w:ind", "hanging");
- assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:pPr/w:ind", "firstLine","360");
+ assertXPathNoAttribute(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:pPr/w:ind"_ostr, "hanging"_ostr);
+ assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:pPr/w:ind"_ostr, "firstLine"_ostr,"360");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf103090)
@@ -1523,13 +1523,13 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf103090)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Get bookmark name
- OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:bookmarkStart", "name");
+ OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:bookmarkStart"_ostr, "name"_ostr);
// Ensure that name has no spaces
CPPUNIT_ASSERT(bookmarkName.indexOf(" ") < 0);
// Get PAGEREF field
- OUString fieldName = getXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:instrText");
+ OUString fieldName = getXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:instrText"_ostr);
// Ensure that PAGEREF field refers exactly our bookmark
OUString expectedFieldName = " PAGEREF " + bookmarkName + " \\h ";
@@ -1542,10 +1542,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf107111)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Ensure that hyperlink and its properties are in place.
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:hyperlink/w:r/w:rPr", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:hyperlink/w:r/w:rPr"_ostr, 1);
// Ensure that hyperlink properties do not contain <w:webHidden/>.
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:hyperlink/w:r/w:rPr/w:webHidden", 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:hyperlink/w:r/w:rPr/w:webHidden"_ostr, 0);
}
DECLARE_OOXMLEXPORT_TEST(testTdf90789, "tdf90789.docx")
@@ -1624,7 +1624,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf137593)
// zero auto spacing, if the first paragraph contains text boxes
// This was 280.
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr/w:tc/w:p[1]/w:pPr/w:spacing", "before", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr/w:tc/w:p[1]/w:pPr/w:spacing"_ostr, "before"_ostr, "0");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf115557)
@@ -1633,7 +1633,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf115557)
// A chart anchored to a footnote multiplied during import
xmlDocUniquePtr pXmlDoc = parseExport("word/footnotes.xml");
- assertXPath(pXmlDoc, "//w:footnote/w:p/w:r/w:drawing", 1);
+ assertXPath(pXmlDoc, "//w:footnote/w:p/w:r/w:drawing"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testAlignmentRelativeFromTopMarginDML)
@@ -1644,27 +1644,27 @@ CPPUNIT_TEST_FIXTURE(Test, testAlignmentRelativeFromTopMarginDML)
assertXPath(pXmlDoc,
"/w:document/w:body/w:p[2]/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/"
- "wp:anchor/wp:positionV",
- "relativeFrom", "topMargin");
+ "wp:anchor/wp:positionV"_ostr,
+ "relativeFrom"_ostr, "topMargin");
assertXPathContent(pXmlDoc,
"/w:document/w:body/w:p[2]/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/"
- "wp:anchor/wp:positionV/wp:align",
+ "wp:anchor/wp:positionV/wp:align"_ostr,
"top");
assertXPath(pXmlDoc,
"/w:document/w:body/w:p[2]/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/"
- "wp:anchor/wp:positionV",
- "relativeFrom", "topMargin");
+ "wp:anchor/wp:positionV"_ostr,
+ "relativeFrom"_ostr, "topMargin");
assertXPathContent(pXmlDoc,
"/w:document/w:body/w:p[2]/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/"
- "wp:anchor/wp:positionV/wp:align",
+ "wp:anchor/wp:positionV/wp:align"_ostr,
"bottom");
assertXPath(pXmlDoc,
"/w:document/w:body/w:p[2]/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/"
- "wp:anchor/wp:positionV",
- "relativeFrom", "topMargin");
+ "wp:anchor/wp:positionV"_ostr,
+ "relativeFrom"_ostr, "topMargin");
assertXPathContent(pXmlDoc,
"/w:document/w:body/w:p[2]/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/"
- "wp:anchor/wp:positionV/wp:align",
+ "wp:anchor/wp:positionV/wp:align"_ostr,
"center");
}
@@ -1676,27 +1676,27 @@ CPPUNIT_TEST_FIXTURE(Test, testAlignmentRelativeFromTopMarginVML)
assertXPath(pXmlDoc,
"/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/"
- "wp:anchor/wp:positionV",
- "relativeFrom", "topMargin");
+ "wp:anchor/wp:positionV"_ostr,
+ "relativeFrom"_ostr, "topMargin");
assertXPathContent(pXmlDoc,
"/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/"
- "wp:anchor/wp:positionV/wp:align",
+ "wp:anchor/wp:positionV/wp:align"_ostr,
"top");
assertXPath(pXmlDoc,
"/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/"
- "wp:anchor/wp:positionV",
- "relativeFrom", "topMargin");
+ "wp:anchor/wp:positionV"_ostr,
+ "relativeFrom"_ostr, "topMargin");
assertXPathContent(pXmlDoc,
"/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/"
- "wp:anchor/wp:positionV/wp:align",
+ "wp:anchor/wp:positionV/wp:align"_ostr,
"bottom");
assertXPath(pXmlDoc,
"/w:document/w:body/w:p/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/"
- "wp:anchor/wp:positionV",
- "relativeFrom", "topMargin");
+ "wp:anchor/wp:positionV"_ostr,
+ "relativeFrom"_ostr, "topMargin");
assertXPathContent(pXmlDoc,
"/w:document/w:body/w:p/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/"
- "wp:anchor/wp:positionV/wp:align",
+ "wp:anchor/wp:positionV/wp:align"_ostr,
"center");
}
@@ -1712,8 +1712,8 @@ CPPUNIT_TEST_FIXTURE(Test, testVmlShapeWithTextbox)
// the wrong value was "rect" instead of "wedgeRectCallout"
assertXPath(pXmlDoc,
"/w:document/w:body/w:p/w:r/"
- "mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:prstGeom",
- "prst", "wedgeRectCallout");
+ "mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:prstGeom"_ostr,
+ "prst"_ostr, "wedgeRectCallout");
}
CPPUNIT_TEST_FIXTURE(Test, testLayoutFlowAltAlone)
@@ -1723,7 +1723,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLayoutFlowAltAlone)
// FIXME: now the DML part is checked, but we should check VML part in Fallback (too)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/"
- "a:graphic/a:graphicData/wps:wsp/wps:bodyPr", "vert", "vert270");
+ "a:graphic/a:graphicData/wps:wsp/wps:bodyPr"_ostr, "vert"_ostr, "vert270");
}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx
index eab792461082..c41b71a96fe4 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx
@@ -26,8 +26,8 @@ CPPUNIT_TEST_FIXTURE(Test, testSaveAsDotX)
// Ensure that document has correct content type
assertXPath(pXmlDocCT,
- "/ContentType:Types/ContentType:Override[@PartName='/word/document.xml']",
- "ContentType",
+ "/ContentType:Types/ContentType:Override[@PartName='/word/document.xml']"_ostr,
+ "ContentType"_ostr,
"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml");
}
diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
index 57db6bf35da0..35901f173749 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
@@ -67,7 +67,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBnc834035)
// <seqname>!<index>|sequence syntax, not a bookmark name.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// This was Figure!1|sequence.
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:hyperlink", "anchor", "_Toc363553908");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:hyperlink"_ostr, "anchor"_ostr, "_Toc363553908");
}
CPPUNIT_TEST_FIXTURE(Test, testCp1000015)
@@ -87,7 +87,7 @@ CPPUNIT_TEST_FIXTURE(Test, testHyperlineIsEnd)
// If document.xml miss any ending tag then parseExport() returns NULL which fail the test case.
CPPUNIT_ASSERT(pXmlDoc) ;
// Check hyperlink is properly open.
- assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:hyperlink",1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:hyperlink"_ostr,1);
}
CPPUNIT_TEST_FIXTURE(Test, testFdo69649)
@@ -96,7 +96,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo69649)
// The DOCX containing the Table of Contents was not exported with correct page nos
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[21]/w:hyperlink/w:r[5]/w:t", "15");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[21]/w:hyperlink/w:r[5]/w:t"_ostr, "15");
}
CPPUNIT_TEST_FIXTURE(Test, testFieldFlagO)
@@ -107,7 +107,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFieldFlagO)
// FIXME "p[2]" will have to be "p[1]", once the TOC import code is fixed
// not to insert an empty paragraph before TOC.
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[2]/w:instrText", " TOC \\z \\f \\o \"1-3\" \\u \\h");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[2]/w:instrText"_ostr, " TOC \\z \\f \\o \"1-3\" \\u \\h");
}
CPPUNIT_TEST_FIXTURE(Test, testTOCFlag_f)
@@ -123,7 +123,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTOCFlag_f)
// FIXME "p[2]" will have to be "p[1]", once the TOC import code is fixed
// not to insert an empty paragraph before TOC.
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[2]/w:instrText", " TOC \\z \\o \"1-3\" \\u \\h");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[2]/w:instrText"_ostr, " TOC \\z \\o \"1-3\" \\u \\h");
}
CPPUNIT_TEST_FIXTURE(Test, testPreserveZfield)
@@ -131,7 +131,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPreserveZfield)
loadAndReload("preserve_Z_field_TOC.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[2]/w:instrText", " TOC \\z \\f \\o \"1-3\" \\h");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[2]/w:instrText"_ostr, " TOC \\z \\f \\o \"1-3\" \\h");
}
CPPUNIT_TEST_FIXTURE(Test, testPreserveWfieldTOC)
@@ -139,7 +139,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPreserveWfieldTOC)
loadAndReload("PreserveWfieldTOC.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r[2]/w:instrText", " TOC \\z \\w \\f \\o \"1-3\" \\h");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r[2]/w:instrText"_ostr, " TOC \\z \\w \\f \\o \"1-3\" \\h");
}
CPPUNIT_TEST_FIXTURE(Test, testFieldFlagB)
@@ -150,7 +150,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFieldFlagB)
// FIXME "p[2]" will have to be "p[1]", once the TOC import code is fixed
// not to insert an empty paragraph before TOC.
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[2]/w:instrText", " TOC \\b \"bookmark111\" \\o \"1-9\" \\h");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[2]/w:instrText"_ostr, " TOC \\b \"bookmark111\" \\o \"1-9\" \\h");
}
CPPUNIT_TEST_FIXTURE(Test, testPreserveXfieldTOC)
@@ -158,7 +158,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPreserveXfieldTOC)
loadAndReload("PreserveXfieldTOC.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r[2]/w:instrText", " TOC \\x \\f \\o \"1-3\" \\h");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r[2]/w:instrText"_ostr, " TOC \\x \\f \\o \"1-3\" \\h");
}
CPPUNIT_TEST_FIXTURE(Test, testFDO77715)
@@ -167,7 +167,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO77715)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// tdf#153090 check that para style is preserved
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:instrText[1]", " TOC \\c \\h \\t \"Block Header\" ");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:instrText[1]"_ostr, " TOC \\c \\h \\t \"Block Header\" ");
uno::Reference<text::XDocumentIndexesSupplier> xIndexSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xIndexes = xIndexSupplier->getDocumentIndexes();
@@ -187,7 +187,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTOCFlag_u)
// FIXME "p[2]" will have to be "p[1]", once the TOC import code is fixed
// not to insert an empty paragraph before TOC.
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r[2]/w:instrText", " TOC \\z \\o \"1-9\" \\u \\h");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r[2]/w:instrText"_ostr, " TOC \\z \\o \"1-9\" \\u \\h");
}
CPPUNIT_TEST_FIXTURE(Test, testfdo73596_RunInStyle)
@@ -196,7 +196,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo73596_RunInStyle)
// INDEX should be preserved.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:instrText[1]", " INDEX \\e \"");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:instrText[1]"_ostr, " INDEX \\e \"");
}
CPPUNIT_TEST_FIXTURE(Test, testfdo73596_AlphaSeparator)
@@ -205,7 +205,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo73596_AlphaSeparator)
// INDEX flag \h "A" should be preserved.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:instrText[1]", " INDEX \\h \"A\" \\e \"");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:instrText[1]"_ostr, " INDEX \\h \"A\" \\e \"");
}
CPPUNIT_TEST_FIXTURE(Test, testCaption1)
@@ -216,7 +216,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCaption1)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[3]/w:instrText", " SEQ scientific \\* ROMAN ");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[3]/w:instrText"_ostr, " SEQ scientific \\* ROMAN ");
}
CPPUNIT_TEST_FIXTURE(Test, testCaption2)
@@ -226,7 +226,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCaption2)
// This test case is to verify that PAGEREF tag is coming with proper values inside <hyperlink> tag.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[5]/w:r[3]/w:instrText", " SEQ Equation \\* ARABIC ");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[5]/w:r[3]/w:instrText"_ostr, " SEQ Equation \\* ARABIC ");
}
CPPUNIT_TEST_FIXTURE(Test, testCaption3)
@@ -236,7 +236,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCaption3)
// This test case is to verify that PAGEREF tag is coming with proper values inside <hyperlink> tag.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[3]/w:instrText", " SEQ picture \\* ARABIC ");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[3]/w:instrText"_ostr, " SEQ picture \\* ARABIC ");
}
CPPUNIT_TEST_FIXTURE(Test, testCaption4)
@@ -246,7 +246,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCaption4)
// This test case is to verify that PAGEREF tag is coming with proper values inside <hyperlink> tag.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:instrText", " SEQ Table \\* ARABIC ");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:instrText"_ostr, " SEQ Table \\* ARABIC ");
}
CPPUNIT_TEST_FIXTURE(Test, testFooterContainHyperlink)
@@ -258,7 +258,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFooterContainHyperlink)
// Check for footer1.xml.rels file.
xmlDocUniquePtr pXmlRels = parseExport("word/_rels/footer1.xml.rels");
// Check the value of Target which is http://www.google.com/.
- assertXPath(pXmlRels,"/rels:Relationships/rels:Relationship","Target","http://www.google.com/");
+ assertXPath(pXmlRels,"/rels:Relationships/rels:Relationship"_ostr,"Target"_ostr,"http://www.google.com/");
}
CPPUNIT_TEST_FIXTURE(Test, testAlphabeticalIndex_MultipleColumns)
@@ -274,13 +274,13 @@ CPPUNIT_TEST_FIXTURE(Test, testAlphabeticalIndex_MultipleColumns)
*/
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:instrText", " INDEX \\c \"4\"\\e \"");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:instrText"_ostr, " INDEX \\c \"4\"\\e \"");
// check for section breaks after and before the Index Section
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:sectPr/w:type","val","continuous");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:pPr/w:sectPr/w:type","val","continuous");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:sectPr/w:type"_ostr,"val"_ostr,"continuous");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:pPr/w:sectPr/w:type"_ostr,"val"_ostr,"continuous");
// check for "w:space" attribute for the columns in Section Properties
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:pPr/w:sectPr/w:cols","space","720");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:pPr/w:sectPr/w:cols"_ostr,"space"_ostr,"720");
}
CPPUNIT_TEST_FIXTURE(Test, testPageref)
@@ -290,7 +290,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPageref)
// This test case is to verify that PAGEREF tag is coming with proper values inside <hyperlink> tag.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:hyperlink/w:r[3]/w:instrText", "PAGEREF _Toc355095261 \\h");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:hyperlink/w:r[3]/w:instrText"_ostr, "PAGEREF _Toc355095261 \\h");
}
CPPUNIT_TEST_FIXTURE(Test, testAlphabeticalIndex_AutoColumn)
@@ -304,10 +304,10 @@ CPPUNIT_TEST_FIXTURE(Test, testAlphabeticalIndex_AutoColumn)
*/
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:instrText", " INDEX \\e \"");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:instrText"_ostr, " INDEX \\e \"");
// check for section break doesn't appear for any paragraph
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:sectPr", 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:sectPr"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testIndexFieldFlagF)
@@ -318,10 +318,10 @@ CPPUNIT_TEST_FIXTURE(Test, testIndexFieldFlagF)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// We check the Index field flag '\f'.
// Note: no syntax error any more (extra quotation mark between "Syn" and \e)
- assertXPathContent(pXmlDoc, "/w:document[1]/w:body[1]/w:p[4]/w:r[2]/w:instrText[1]", " INDEX \\c \"2\"\\f \"Syn\"\\e \"");
+ assertXPathContent(pXmlDoc, "/w:document[1]/w:body[1]/w:p[4]/w:r[2]/w:instrText[1]"_ostr, " INDEX \\c \"2\"\\f \"Syn\"\\e \"");
// XE entries lost their \f "Syn" before
- assertXPathContent(pXmlDoc, "/w:document[1]/w:body[1]/w:p[17]/w:r[21]/w:instrText[1]", " XE \"formatting\" \\f \"Syn\" ");
- assertXPathContent(pXmlDoc, "/w:document[1]/w:body[1]/w:p[17]/w:r[29]/w:instrText[1]", " XE \"choosing:aaaa\" \\f \"Syn\" ");
+ assertXPathContent(pXmlDoc, "/w:document[1]/w:body[1]/w:p[17]/w:r[21]/w:instrText[1]"_ostr, " XE \"formatting\" \\f \"Syn\" ");
+ assertXPathContent(pXmlDoc, "/w:document[1]/w:body[1]/w:p[17]/w:r[29]/w:instrText[1]"_ostr, " XE \"choosing:aaaa\" \\f \"Syn\" ");
}
CPPUNIT_TEST_FIXTURE(Test, testBibliography)
@@ -329,9 +329,9 @@ CPPUNIT_TEST_FIXTURE(Test, testBibliography)
loadAndReload("FDO75133.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r[2]/w:instrText", " BIBLIOGRAPHY ");
- assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:docPartObj/w:docPartGallery", "val", "Bibliographies");
- assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:docPartObj/w:docPartUnique", 1);
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r[2]/w:instrText"_ostr, " BIBLIOGRAPHY ");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:docPartObj/w:docPartGallery"_ostr, "val"_ostr, "Bibliographies");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:docPartObj/w:docPartUnique"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testGenericTextField)
@@ -340,7 +340,7 @@ CPPUNIT_TEST_FIXTURE(Test, testGenericTextField)
// fdo#75158 : This test case is to verify the unsupported textfields are exported properly.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc,"/w:document/w:body/w:p[2]/w:r[2]/w:instrText");
+ xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc,"/w:document/w:body/w:p[2]/w:r[2]/w:instrText"_ostr);
xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0];
OUString contents = OUString::createFromAscii(reinterpret_cast<char*>((pXmlNode->children[0]).content));
@@ -353,17 +353,17 @@ CPPUNIT_TEST_FIXTURE(Test, test_FieldType)
loadAndReload("99_Fields.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Checking for three field types (BIBLIOGRAPHY, BIDIOUTLINE, CITATION) in sequence
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:instrText");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:instrText");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:sdt/w:sdtContent/w:r[2]/w:instrText");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:instrText"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:instrText"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:sdt/w:sdtContent/w:r[2]/w:instrText"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testCitation)
{
loadAndReload("FDO74775.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:sdt/w:sdtContent/w:r[2]/w:instrText", " CITATION Kra06 \\l 1033 ");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:sdt/w:sdtContent/w:r[4]/w:t", "(Kramer & Chen, 2006)");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:sdt/w:sdtContent/w:r[2]/w:instrText"_ostr, " CITATION Kra06 \\l 1033 ");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:sdt/w:sdtContent/w:r[4]/w:t"_ostr, "(Kramer & Chen, 2006)");
}
CPPUNIT_TEST_FIXTURE(Test, testHyperLinkTagEnded)
@@ -375,7 +375,7 @@ CPPUNIT_TEST_FIXTURE(Test, testHyperLinkTagEnded)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[2]/w:tc[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]/w:tr[7]/w:tc[1]/w:tbl[1]/w:tr[2]/w:tc[6]/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[1]/w:hyperlink[1]/w:hyperlink[1]",1);
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[2]/w:tc[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]/w:tr[7]/w:tc[1]/w:tbl[1]/w:tr[2]/w:tc[6]/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[1]/w:hyperlink[1]/w:hyperlink[1]"_ostr,1);
}
CPPUNIT_TEST_FIXTURE(Test, testFDO76163 )
@@ -383,7 +383,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO76163 )
loadAndReload("fdo76163.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
//docx file after RT is getting corrupted.
- assertXPath ( pXmlDoc, "/w:document/w:body/w:p[2]/w:hyperlink/w:r[10]/w:fldChar", "fldCharType", "end" );
+ assertXPath ( pXmlDoc, "/w:document/w:body/w:p[2]/w:hyperlink/w:r[10]/w:fldChar"_ostr, "fldCharType"_ostr, "end" );
}
CPPUNIT_TEST_FIXTURE(Test, testFDO78659)
@@ -391,7 +391,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO78659)
loadAndReload("fdo78659.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[1]/w:hyperlink[1]/w:r[3]/w:fldChar[1]", 0);
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[1]/w:hyperlink[1]/w:r[3]/w:fldChar[1]"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testFDO78654 )
@@ -400,7 +400,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFDO78654 )
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// In case of two "Hyperlink" tags in one paragraph and one of them
// contains "PAGEREF" field then field end tag was missing from hyperlink.
- assertXPath ( pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:hyperlink[3]/w:r[5]/w:fldChar", "fldCharType", "end" );
+ assertXPath ( pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:hyperlink[3]/w:r[5]/w:fldChar"_ostr, "fldCharType"_ostr, "end" );
}
@@ -409,12 +409,12 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo78599)
loadAndReload("fdo78599.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
//docx file after RT is getting corrupted.
- assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink/w:r[6]/w:fldChar", "fldCharType", "end" );
+ assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink/w:r[6]/w:fldChar"_ostr, "fldCharType"_ostr, "end" );
// Check for automatic hyphenation
xmlDocUniquePtr pSettingsXml = parseExport("word/settings.xml");
// This failed as w:settings had no w:autoHyphenation child.
- assertXPath(pSettingsXml, "/w:settings/w:autoHyphenation");
+ assertXPath(pSettingsXml, "/w:settings/w:autoHyphenation"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testfdo78886)
@@ -422,7 +422,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo78886)
loadAndReload("fdo78886.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[2]/w:tr[1]/w:tc[1]/w:p[1]/w:hyperlink[1]/w:r[2]/w:fldChar[1]", 0);
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[2]/w:tr[1]/w:tc[1]/w:p[1]/w:hyperlink[1]/w:r[2]/w:fldChar[1]"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testFdo78910)
@@ -431,8 +431,8 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo78910)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// This is to ensure that the fld starts and ends inside a hyperlink...
- assertXPath ( pXmlDoc, "//w:hyperlink[2]/w:r[1]/w:fldChar", "fldCharType", "begin" );
- assertXPath ( pXmlDoc, "//w:hyperlink[2]/w:r[5]/w:fldChar", "fldCharType", "end" );
+ assertXPath ( pXmlDoc, "//w:hyperlink[2]/w:r[1]/w:fldChar"_ostr, "fldCharType"_ostr, "begin" );
+ assertXPath ( pXmlDoc, "//w:hyperlink[2]/w:r[5]/w:fldChar"_ostr, "fldCharType"_ostr, "end" );
}
// FIXME: During this test a pure VML shape get converted to DML and crash at verifying.
@@ -451,9 +451,9 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtCitationRun)
loadAndReload("sdt-citation-run.docx");
// The problem was that the SDT was around the whole paragraph, not only around the citation field.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:t", "Before sdt.");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:instrText", " CITATION BBC11 \\l 1033 ");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:t", "After sdt.");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:t"_ostr, "Before sdt.");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:instrText"_ostr, " CITATION BBC11 \\l 1033 ");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:t"_ostr, "After sdt.");
}
CPPUNIT_TEST_FIXTURE(Test, testParagraphSdt)
@@ -462,7 +462,7 @@ CPPUNIT_TEST_FIXTURE(Test, testParagraphSdt)
// The problem was that the SDT was around the run only, not the whole paragraph.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// The path to w:sdt contained a w:p.
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:sdt");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:sdt"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testSdt2Run)
@@ -470,10 +470,10 @@ CPPUNIT_TEST_FIXTURE(Test, testSdt2Run)
loadAndReload("sdt-2-para.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// The problem was that <w:sdt> was closed after "first", not after "second", so the second assert failed.
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r/w:t", "first");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:r/w:t", "second");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r/w:t"_ostr, "first");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:r/w:t"_ostr, "second");
// Make sure the third paragraph is still outside <w:sdt>.
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r/w:t", "third");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r/w:t"_ostr, "third");
}
CPPUNIT_TEST_FIXTURE(Test, test2Id)
@@ -481,7 +481,7 @@ CPPUNIT_TEST_FIXTURE(Test, test2Id)
loadAndReload("2-id.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// This was 2, but only one w:id is allowed.
- assertXPath(pXmlDoc, "//w:sdtPr/w:id", 1);
+ assertXPath(pXmlDoc, "//w:sdtPr/w:id"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testTableStart2Sdt)
@@ -489,7 +489,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableStart2Sdt)
loadAndReload("table-start-2-sdt.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// w:docPartGallery should be a child of <w:docPartObj>, make sure it's not a child of w:text.
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:text/w:docPartGallery", 0);
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:text/w:docPartGallery"_ostr, 0);
}
DECLARE_OOXMLEXPORT_TEST(testSdtDateDuplicate, "sdt-date-duplicate.docx")
@@ -498,7 +498,7 @@ DECLARE_OOXMLEXPORT_TEST(testSdtDateDuplicate, "sdt-date-duplicate.docx")
{
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Single <w:sdt> was exported as 2 <w:sdt> elements.
- assertXPath(pXmlDoc, "//w:sdt", 1);
+ assertXPath(pXmlDoc, "//w:sdt"_ostr, 1);
uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY);
uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
@@ -543,7 +543,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo81492)
{
loadAndReload("fdo81492.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[6]/w:instrText", "ADDIN EN.CITE.DATA");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[6]/w:instrText"_ostr, "ADDIN EN.CITE.DATA");
}
CPPUNIT_TEST_FIXTURE(Test, testEditTime)
@@ -556,10 +556,10 @@ CPPUNIT_TEST_FIXTURE(Test, testEditTime)
*/
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
//Ensure that EditTime is written inside w:fldChar in "HH:MM:SS" format.
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:fldChar", "fldCharType", "begin");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[3]/w:fldChar", "fldCharType", "separate");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:t", "00:05");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:fldChar", "fldCharType", "end");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:fldChar"_ostr, "fldCharType"_ostr, "begin");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[3]/w:fldChar"_ostr, "fldCharType"_ostr, "separate");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:t"_ostr, "00:05");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:fldChar"_ostr, "fldCharType"_ostr, "end");
}
CPPUNIT_TEST_FIXTURE(Test, testFlyFieldmark)
@@ -568,11 +568,11 @@ CPPUNIT_TEST_FIXTURE(Test, testFlyFieldmark)
// the problem was that the flys were written after the field start
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// run 1 contains 2 shapes, one was at-page, one was at-char
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent", 2);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent"_ostr, 2);
// run 2 contains the field start
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:fldChar", "fldCharType", "begin");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:fldChar"_ostr, "fldCharType"_ostr, "begin");
// run 3 contains the field instruction text
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:instrText", " FORMTEXT ");
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:instrText"_ostr, " FORMTEXT ");
}
CPPUNIT_TEST_FIXTURE(Test, testFdo81945)
@@ -580,7 +580,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo81945)
loadAndReload("fdo81945.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//w:sdt//w:sdt", 0);
+ assertXPath(pXmlDoc, "//w:sdt//w:sdt"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testfdo82123)
@@ -589,8 +589,8 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo82123)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// make sure there is only one run inside first SDT after RT as in the Original file.
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[2]/w:p/w:sdt[1]/w:sdtContent/w:r/w:t", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[2]/w:p/w:r/w:drawing", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[2]/w:p/w:sdt[1]/w:sdtContent/w:r/w:t"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[2]/w:p/w:r/w:drawing"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testSdtBeforeField)
@@ -598,8 +598,8 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtBeforeField)
loadAndReload("sdt-before-field.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Make sure the field doesn't sneak inside the SDT: the SDT should contain only a single run (there were 6 ones).
- assertXPath(pXmlDoc, "//w:p/w:sdt/w:sdtContent/w:r/w:t", 1);
- assertXPath(pXmlDoc, "//w:p/w:r/w:fldChar", 3);
+ assertXPath(pXmlDoc, "//w:p/w:sdt/w:sdtContent/w:r/w:t"_ostr, 1);
+ assertXPath(pXmlDoc, "//w:p/w:r/w:fldChar"_ostr, 3);
}
CPPUNIT_TEST_FIXTURE(Test, testfdo81946)
@@ -607,7 +607,7 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo81946)
loadAndReload("fdo81946.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/header1.xml");
// make sure AlternateContent should not present in sdt
- assertXPath(pXmlDoc, "/w:hdr[1]/w:p[1]/w:sdt[1]/w:sdtContent[1]/w:r[2]/mc:AlternateContent[1]",0);
+ assertXPath(pXmlDoc, "/w:hdr[1]/w:p[1]/w:sdt[1]/w:sdtContent[1]/w:r[2]/mc:AlternateContent[1]"_ostr,0);
}
CPPUNIT_TEST_FIXTURE(Test, testfdo82492)
@@ -616,8 +616,8 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo82492)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// make sure there is only one run inside first SDT after RT as in the Original file.
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt[1]/w:sdtContent/w:r/w:t", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt[1]/w:sdtContent/w:r/w:t"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testSdtHeader)
@@ -626,7 +626,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtHeader)
// Problem was that w:sdt elements in headers were lost on import.
xmlDocUniquePtr pXmlDoc = parseExport("word/header2.xml");
// This was 0, w:sdt (and then w:date) was missing.
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:date", 1);
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:date"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testSdtCompanyMultipara)
@@ -635,8 +635,8 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtCompanyMultipara)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Here is just a simple text node, so there should be either one or zero paragraph
// (in this case sdt element is inside paragraph)
- assertXPath(pXmlDoc, "//w:sdtContent/w:p", 0);
- assertXPath(pXmlDoc, "//w:sdtContent/w:r", 2);
+ assertXPath(pXmlDoc, "//w:sdtContent/w:p"_ostr, 0);
+ assertXPath(pXmlDoc, "//w:sdtContent/w:r"_ostr, 2);
}
DECLARE_OOXMLEXPORT_TEST(testFixedDateFields, "fixed-date-field.docx")
@@ -658,7 +658,7 @@ DECLARE_OOXMLEXPORT_TEST(testFixedDateFields, "fixed-date-field.docx")
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Previously, fixed fields were exported as static text ("Date (fixed)")
// Check they are now exported correctly as fldChar with fldLock attribute
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:fldChar", "fldLock", "true");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:fldChar"_ostr, "fldLock"_ostr, "true");
}
}
@@ -673,7 +673,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOO34469)
loadAndReload("ooo34469-1.odt");
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink[1]", "anchor", "2.9.2.Creating_New_files|outline");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink[1]"_ostr, "anchor"_ostr, "2.9.2.Creating_New_files|outline");
}
CPPUNIT_TEST_FIXTURE(Test, testOO39845)
@@ -681,7 +681,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOO39845)
loadAndReload("ooo39845-7.odt");
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink[1]", "anchor", "Figure4|graphic");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink[1]"_ostr, "anchor"_ostr, "Figure4|graphic");
}
DECLARE_OOXMLEXPORT_TEST( testTdf85161, "tdf85161.docx" )
@@ -694,12 +694,12 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf66401)
{
loadAndReload("tdf66401.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w:rFonts", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w:rFonts", "ascii", "Arial Black");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w:sz", "val", "24");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[9]/w:rPr/w:rFonts", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[9]/w:rPr/w:rFonts", "ascii", "Arial Black");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[9]/w:rPr/w:sz", "val", "24");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w:rFonts"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w:rFonts"_ostr, "ascii"_ostr, "Arial Black");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w:sz"_ostr, "val"_ostr, "24");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[9]/w:rPr/w:rFonts"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[9]/w:rPr/w:rFonts"_ostr, "ascii"_ostr, "Arial Black");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[9]/w:rPr/w:sz"_ostr, "val"_ostr, "24");
}
DECLARE_OOXMLEXPORT_TEST( testDateFieldInShape, "date_field_in_shape.docx" )
@@ -812,7 +812,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132185)
// Since the default (without xml:space attribute) is to ignore leading and trailing spaces,
// " PAGE \\* roman " will get imported as "PAGE \\* roman". This is also valid, and must be
// treated accordingly. "roman" was ignored before the fix, exporting only " PAGE ".
- assertXPathContent(pXmlDoc, "/w:ftr/w:p/w:r[2]/w:instrText", " PAGE \\* roman ");
+ assertXPathContent(pXmlDoc, "/w:ftr/w:p/w:r[2]/w:instrText"_ostr, " PAGE \\* roman ");
}
CPPUNIT_TEST_FIXTURE(Test, testConditionalText)
@@ -826,7 +826,7 @@ CPPUNIT_TEST_FIXTURE(Test, testConditionalText)
// - Expression: xmlXPathNodeSetGetLength(pXmlNodes) > 0
// - In <...>, XPath '/w:document/w:body/w:p/w:r[2]/w:instrText' not found
// i.e. the field was lost on export.
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:instrText", OUString(aExpected));
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:instrText"_ostr, OUString(aExpected));
}
CPPUNIT_TEST_FIXTURE(Test, testConditionalText2)
@@ -835,7 +835,7 @@ CPPUNIT_TEST_FIXTURE(Test, testConditionalText2)
// Load a document which has a conditional text field in it.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
std::u16string_view aExpected(u" IF 1 = 1 \"test1\" \"test2\"");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:instrText", OUString(aExpected));
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:instrText"_ostr, OUString(aExpected));
getParagraph(1, "test1");
}
@@ -871,7 +871,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf142464_ampm, "tdf142464_ampm.docx")
// - Expected: DATE \@"H:mm\ AM/PM"
// - Actual : DATE \@"H:mm' a'M'/p'M"
// i.e., the AM/PM would be treated as literal 'a' and 'p' followed by a month code
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:instrText",
+ assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:instrText"_ostr,
" DATE \\@\"H:mm\\ AM/PM\" ");
}
}
@@ -884,20 +884,20 @@ DECLARE_OOXMLEXPORT_TEST( testSdtDatePicker, "test_sdt_datepicker.docx" )
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Placeholder is here
- OUString sDocPart = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:placeholder/w:docPart", "val");
+ OUString sDocPart = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:placeholder/w:docPart"_ostr, "val"_ostr);
CPPUNIT_ASSERT_EQUAL(OUString("DefaultPlaceholder_-1854013437"), sDocPart);
// Ensure that we have data binding stuff
- OUString sDBprefix = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "prefixMappings");
+ OUString sDBprefix = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding"_ostr, "prefixMappings"_ostr);
CPPUNIT_ASSERT_EQUAL(OUString("xmlns:ns0='http://schemas.microsoft.com/vsto/samples' "), sDBprefix);
- OUString sDBxpath = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "xpath");
+ OUString sDBxpath = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding"_ostr, "xpath"_ostr);
CPPUNIT_ASSERT_EQUAL(OUString("/ns0:employees[1]/ns0:employee[1]/ns0:hireDate[1]"), sDBxpath);
- OUString sDBstoreid = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "storeItemID");
+ OUString sDBstoreid = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding"_ostr, "storeItemID"_ostr);
CPPUNIT_ASSERT_EQUAL(OUString("{241A8A02-7FFD-488D-8827-63FBE74E8BC9}"), sDBstoreid);
- OUString sColor = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w15:color", "val");
+ OUString sColor = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w15:color"_ostr, "val"_ostr);
CPPUNIT_ASSERT_EQUAL(OUString("008000"), sColor);
}
@@ -954,17 +954,17 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104823)
xmlDocUniquePtr pXmlCustomPropsDoc = parseExport("customXml/item1.xml");
CPPUNIT_ASSERT(pXmlCustomPropsDoc);
// FIXME: strange it won't run simple /employees/employee/name xpath query. Does not like namespaces?
- assertXPathContent(pXmlCustomPropsDoc, "//*/*[local-name()='name']", "New Custom XML Value");
+ assertXPathContent(pXmlCustomPropsDoc, "//*/*[local-name()='name']"_ostr, "New Custom XML Value");
xmlDocUniquePtr pXmlAppPropsDoc = parseExport("docProps/app.xml");
CPPUNIT_ASSERT(pXmlAppPropsDoc);
// TODO: extended properties are not written yet
- assertXPathContent(pXmlAppPropsDoc, "//*/*[local-name()='Company']", "True Extended Property Value");
+ assertXPathContent(pXmlAppPropsDoc, "//*/*[local-name()='Company']"_ostr, "True Extended Property Value");
xmlDocUniquePtr pXmlCorePropsDoc = parseExport("docProps/core.xml");
CPPUNIT_ASSERT(pXmlCorePropsDoc);
// TODO: core properties are not written yet
- assertXPathContent(pXmlCorePropsDoc, "/cp:coreProperties/dc:creator", "True Core Property Value");
+ assertXPathContent(pXmlCorePropsDoc, "/cp:coreProperties/dc:creator"_ostr, "True Core Property Value");
}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/ooxmlexport/ooxmllinks.cxx b/sw/qa/extras/ooxmlexport/ooxmllinks.cxx
index 11b9cc03f4dd..6d5fefb9e968 100644
--- a/sw/qa/extras/ooxmlexport/ooxmllinks.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmllinks.cxx
@@ -150,8 +150,8 @@ DECLARE_LINKS_EXPORT_TEST(testRelativeToRelativeExport, "relative-link.docx", US
{
xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels");
- assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']", "Target",
- "relative.docx");
+ assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']"_ostr,
+ "Target"_ostr, "relative.docx");
}
DECLARE_LINKS_EXPORT_TEST(testRelativeToAbsoluteExport, "relative-link.docx", USE_ABSOLUTE,
@@ -159,7 +159,8 @@ DECLARE_LINKS_EXPORT_TEST(testRelativeToAbsoluteExport, "relative-link.docx", US
{
xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels");
- OUString sTarget = getXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[2]", "Target");
+ OUString sTarget
+ = getXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[2]"_ostr, "Target"_ostr);
CPPUNIT_ASSERT(sTarget.startsWith("file:///"));
CPPUNIT_ASSERT(sTarget.endsWith("relative.docx"));
}
@@ -169,7 +170,8 @@ DECLARE_LINKS_EXPORT_TEST(testAbsoluteToRelativeExport, "absolute-link.docx", US
{
xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels");
- assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[2]", "Target", "test.docx");
+ assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[2]"_ostr, "Target"_ostr,
+ "test.docx");
}
DECLARE_LINKS_EXPORT_TEST(testAbsoluteToAbsoluteExport, "absolute-link.docx", USE_ABSOLUTE,
@@ -177,7 +179,8 @@ DECLARE_LINKS_EXPORT_TEST(testAbsoluteToAbsoluteExport, "absolute-link.docx", US
{
xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels");
- OUString sTarget = getXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[2]", "Target");
+ OUString sTarget
+ = getXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[2]"_ostr, "Target"_ostr);
CPPUNIT_ASSERT(sTarget.startsWith("file:///"));
CPPUNIT_ASSERT(sTarget.endsWith("test.docx"));
}
@@ -186,24 +189,24 @@ DECLARE_LINKS_EXPORT_TEST(testTdf123627_export, "tdf123627.docx", USE_RELATIVE,
{
xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels");
- assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']", "Target",
- "test.docx");
+ assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']"_ostr,
+ "Target"_ostr, "test.docx");
}
DECLARE_LINKS_EXPORT_TEST(testTdf126590_export, "tdf126590.docx", USE_ABSOLUTE, DONT_MODIFY_LINK)
{
xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels");
// in the original file: Target="file:///C:\TEMP\test.docx" => invalid file URI
- assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']", "Target",
- "file:///C:/TEMP/test.docx");
+ assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']"_ostr,
+ "Target"_ostr, "file:///C:/TEMP/test.docx");
}
DECLARE_LINKS_EXPORT_TEST(testTdf126768_export, "tdf126768.docx", USE_ABSOLUTE, DONT_MODIFY_LINK)
{
xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels");
// in the original file: "file:///C:\\TEMP\\test.docx" => invalid file URI
- assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']", "Target",
- "file:///C:/TEMP/test.docx");
+ assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']"_ostr,
+ "Target"_ostr, "file:///C:/TEMP/test.docx");
}
DECLARE_LINKS_EXPORT_TEST(testNon_ascii_link_export, "non_ascii_link.docx", USE_ABSOLUTE,
@@ -211,7 +214,8 @@ DECLARE_LINKS_EXPORT_TEST(testNon_ascii_link_export, "non_ascii_link.docx", USE_
{
xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/document.xml.rels");
- assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']", "Target",
+ assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']"_ostr,
+ "Target"_ostr,
INetURLObject::decode(u"file:///C:/TEMP/%C3%A9kezet.docx",
INetURLObject::DecodeMechanism::ToIUri,
RTL_TEXTENCODING_UTF8));
diff --git a/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx b/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx
index 0d777fdce6b7..aaf74e6afbe8 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx
@@ -21,67 +21,67 @@ CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_GlowShadowReflection)
loadAndReload("TextEffects_Glow_Shadow_Reflection.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:rPr/w14:glow", "rad").match("63500"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:rPr/w14:glow/w14:srgbClr", "val").match("00B0F0"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:rPr/w14:glow/w14:srgbClr/w14:alpha", "val").match("60000"));
-
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w14:glow", "rad").match("228600"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w14:glow/w14:schemeClr", "val").match("accent6"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w14:glow/w14:schemeClr/w14:alpha", "val").match("60000"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w14:glow/w14:schemeClr/w14:satMod", "val").match("175000"));
-
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow", "blurRad").match("63500"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow", "dist").match("0"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow", "dir").match("1800000"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow", "sx").match("100000"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow", "sy").match("-30000"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow", "kx").match("-800400"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow", "ky").match("0"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow", "algn").match("bl"));
-
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow/w14:schemeClr", "val").match("accent3"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow/w14:schemeClr/w14:alpha", "val").match("38000"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow/w14:schemeClr/w14:lumMod", "val").match("75000"));
-
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow", "blurRad").match("190500"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow", "dist").match("190500"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow", "dir").match("3000000"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow", "sx").match("100000"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow", "sy").match("100000"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow", "kx").match("0"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow", "ky").match("0"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow", "algn").match("ctr"));
-
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow/w14:srgbClr", "val").match("FF0000"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow/w14:srgbClr/w14:alpha", "val").match("10000"));
-
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "blurRad").match("6350"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "stA").match("60000"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "stPos").match("0"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "endA").match("900"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "endPos").match("60000"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "dist").match("60007"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "dir").match("5400000"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "fadeDir").match("5400000"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "sx").match("100000"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "sy").match("-100000"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "kx").match("0"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "ky").match("0"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection", "algn").match("bl"));
-
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "blurRad").match("6350"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "stA").match("55000"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "stPos").match("0"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "endA").match("300"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "endPos").match("45500"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "dist").match("0"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "dir").match("5400000"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "fadeDir").match("5400000"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "sx").match("100000"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "sy").match("-100000"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "kx").match("0"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "ky").match("0"));
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "algn").match("bl"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:rPr/w14:glow"_ostr, "rad"_ostr).match("63500"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:rPr/w14:glow/w14:srgbClr"_ostr, "val"_ostr).match("00B0F0"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:rPr/w14:glow/w14:srgbClr/w14:alpha"_ostr, "val"_ostr).match("60000"));
+
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w14:glow"_ostr, "rad"_ostr).match("228600"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w14:glow/w14:schemeClr"_ostr, "val"_ostr).match("accent6"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w14:glow/w14:schemeClr/w14:alpha"_ostr, "val"_ostr).match("60000"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w14:glow/w14:schemeClr/w14:satMod"_ostr, "val"_ostr).match("175000"));
+
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow"_ostr, "blurRad"_ostr).match("63500"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow"_ostr, "dist"_ostr).match("0"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow"_ostr, "dir"_ostr).match("1800000"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow"_ostr, "sx"_ostr).match("100000"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow"_ostr, "sy"_ostr).match("-30000"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow"_ostr, "kx"_ostr).match("-800400"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow"_ostr, "ky"_ostr).match("0"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow"_ostr, "algn"_ostr).match("bl"));
+
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow/w14:schemeClr"_ostr, "val"_ostr).match("accent3"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow/w14:schemeClr/w14:alpha"_ostr, "val"_ostr).match("38000"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[4]/w:rPr/w14:shadow/w14:schemeClr/w14:lumMod"_ostr, "val"_ostr).match("75000"));
+
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow"_ostr, "blurRad"_ostr).match("190500"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow"_ostr, "dist"_ostr).match("190500"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow"_ostr, "dir"_ostr).match("3000000"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow"_ostr, "sx"_ostr).match("100000"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow"_ostr, "sy"_ostr).match("100000"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow"_ostr, "kx"_ostr).match("0"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow"_ostr, "ky"_ostr).match("0"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow"_ostr, "algn"_ostr).match("ctr"));
+
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow/w14:srgbClr"_ostr, "val"_ostr).match("FF0000"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:rPr/w14:shadow/w14:srgbClr/w14:alpha"_ostr, "val"_ostr).match("10000"));
+
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection"_ostr, "blurRad"_ostr).match("6350"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection"_ostr, "stA"_ostr).match("60000"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection"_ostr, "stPos"_ostr).match("0"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection"_ostr, "endA"_ostr).match("900"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection"_ostr, "endPos"_ostr).match("60000"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection"_ostr, "dist"_ostr).match("60007"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection"_ostr, "dir"_ostr).match("5400000"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection"_ostr, "fadeDir"_ostr).match("5400000"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection"_ostr, "sx"_ostr).match("100000"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection"_ostr, "sy"_ostr).match("-100000"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection"_ostr, "kx"_ostr).match("0"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection"_ostr, "ky"_ostr).match("0"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:rPr/w14:reflection"_ostr, "algn"_ostr).match("bl"));
+
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection"_ostr, "blurRad"_ostr).match("6350"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection"_ostr, "stA"_ostr).match("55000"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection"_ostr, "stPos"_ostr).match("0"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection"_ostr, "endA"_ostr).match("300"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection"_ostr, "endPos"_ostr).match("45500"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection"_ostr, "dist"_ostr).match("0"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection"_ostr, "dir"_ostr).match("5400000"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection"_ostr, "fadeDir"_ostr).match("5400000"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection"_ostr, "sx"_ostr).match("100000"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection"_ostr, "sy"_ostr).match("-100000"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection"_ostr, "kx"_ostr).match("0"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection"_ostr, "ky"_ostr).match("0"));
+ CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection"_ostr, "algn"_ostr).match("bl"));
}
CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_TextOutline)
@@ -90,54 +90,54 @@ CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_TextOutline)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Paragraph 1
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline", "w", "50800");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline", "cap", "rnd");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline", "cmpd", "dbl");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline", "algn", "ctr");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline"_ostr, "w"_ostr, "50800");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline"_ostr, "cap"_ostr, "rnd");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline"_ostr, "cmpd"_ostr, "dbl");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline"_ostr, "algn"_ostr, "ctr");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[1]", "pos", "70000");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[1]/w14:srgbClr", "val", "92D050");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[1]/w14:srgbClr/w14:alpha", "val", "30000");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[1]/w14:srgbClr/w14:lumMod", "val", "75000");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[1]/w14:srgbClr/w14:lumOff", "val", "25000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[1]"_ostr, "pos"_ostr, "70000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[1]/w14:srgbClr"_ostr, "val"_ostr, "92D050");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[1]/w14:srgbClr/w14:alpha"_ostr, "val"_ostr, "30000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[1]/w14:srgbClr/w14:lumMod"_ostr, "val"_ostr, "75000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[1]/w14:srgbClr/w14:lumOff"_ostr, "val"_ostr, "25000");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[2]", "pos", "30000");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr", "val", "accent1");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:alpha", "val", "55000");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumMod", "val", "40000");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumOff", "val", "60000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[2]"_ostr, "pos"_ostr, "30000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr"_ostr, "val"_ostr, "accent1");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:alpha"_ostr, "val"_ostr, "55000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumMod"_ostr, "val"_ostr, "40000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumOff"_ostr, "val"_ostr, "60000");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[3]", "pos", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[3]/w14:srgbClr", "val", "0070C0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[3]"_ostr, "pos"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[3]/w14:srgbClr"_ostr, "val"_ostr, "0070C0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[4]", "pos", "100000");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[4]/w14:schemeClr", "val", "accent4");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[4]"_ostr, "pos"_ostr, "100000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:gsLst/w14:gs[4]/w14:schemeClr"_ostr, "val"_ostr, "accent4");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:lin", "ang", "3600000");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:lin", "scaled", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:lin"_ostr, "ang"_ostr, "3600000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:gradFill/w14:lin"_ostr, "scaled"_ostr, "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:prstDash", "val", "dash");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:miter", "lim", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:prstDash"_ostr, "val"_ostr, "dash");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:textOutline/w14:miter"_ostr, "lim"_ostr, "0");
// Paragraph 2
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline", "w", "9525");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline", "cap", "rnd");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline", "cmpd", "sng");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline", "algn", "ctr");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline"_ostr, "w"_ostr, "9525");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline"_ostr, "cap"_ostr, "rnd");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline"_ostr, "cmpd"_ostr, "sng");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline"_ostr, "algn"_ostr, "ctr");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline/w14:solidFill/w14:srgbClr", "val", "FF0000");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline/w14:prstDash", "val", "solid");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline/w14:bevel", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline/w14:solidFill/w14:srgbClr"_ostr, "val"_ostr, "FF0000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline/w14:prstDash"_ostr, "val"_ostr, "solid");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textOutline/w14:bevel"_ostr, 1);
// Paragraph 3
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline", "w", "9525");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline", "cap", "rnd");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline", "cmpd", "sng");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline", "algn", "ctr");
-
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline/w14:noFill", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline/w14:prstDash", "val", "solid");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline/w14:bevel", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline"_ostr, "w"_ostr, "9525");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline"_ostr, "cap"_ostr, "rnd");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline"_ostr, "cmpd"_ostr, "sng");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline"_ostr, "algn"_ostr, "ctr");
+
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline/w14:noFill"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline/w14:prstDash"_ostr, "val"_ostr, "solid");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline/w14:bevel"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_TextFill)
@@ -147,35 +147,35 @@ CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_TextFill)
// Paragraph 1 has no textFill
// Paragraph 2
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textFill/w14:noFill", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:textFill/w14:noFill"_ostr, 1);
// Paragraph 3
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textFill/w14:solidFill", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textFill/w14:solidFill/w14:schemeClr", "val", "accent1");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textFill/w14:solidFill/w14:schemeClr/w14:alpha", "val", "5000");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textFill/w14:solidFill/w14:schemeClr/w14:lumMod", "val", "40000");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textFill/w14:solidFill/w14:schemeClr/w14:lumOff", "val", "60000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textFill/w14:solidFill"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textFill/w14:solidFill/w14:schemeClr"_ostr, "val"_ostr, "accent1");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textFill/w14:solidFill/w14:schemeClr/w14:alpha"_ostr, "val"_ostr, "5000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textFill/w14:solidFill/w14:schemeClr/w14:lumMod"_ostr, "val"_ostr, "40000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textFill/w14:solidFill/w14:schemeClr/w14:lumOff"_ostr, "val"_ostr, "60000");
// Paragraph 4
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[1]", "pos", "0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr", "val", "accent1");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:alpha", "val", "5000");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:lumMod", "val", "67000");
-
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[2]", "pos", "50000");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[2]/w14:srgbClr", "val", "00B0F0");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[2]/w14:srgbClr/w14:alpha", "val", "10000");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[2]/w14:srgbClr/w14:lumMod", "val", "80000");
-
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[3]", "pos", "100000");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr", "val", "accent1");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:alpha", "val", "15000");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:lumMod", "val", "60000");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:lumOff", "val", "40000");
-
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:lin", "ang", "16200000");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:lin", "scaled", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[1]"_ostr, "pos"_ostr, "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr"_ostr, "val"_ostr, "accent1");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:alpha"_ostr, "val"_ostr, "5000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:lumMod"_ostr, "val"_ostr, "67000");
+
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[2]"_ostr, "pos"_ostr, "50000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[2]/w14:srgbClr"_ostr, "val"_ostr, "00B0F0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[2]/w14:srgbClr/w14:alpha"_ostr, "val"_ostr, "10000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[2]/w14:srgbClr/w14:lumMod"_ostr, "val"_ostr, "80000");
+
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[3]"_ostr, "pos"_ostr, "100000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr"_ostr, "val"_ostr, "accent1");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:alpha"_ostr, "val"_ostr, "15000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:lumMod"_ostr, "val"_ostr, "60000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:lumOff"_ostr, "val"_ostr, "40000");
+
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:lin"_ostr, "ang"_ostr, "16200000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w14:textFill/w14:gradFill/w14:lin"_ostr, "scaled"_ostr, "0");
}
CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_Props3d_Ligatures_NumForm_NumSpacing)
@@ -184,44 +184,44 @@ CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_Props3d_Ligatures_NumForm_NumSpacing
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Paragraph 1 - w14:props3d
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d", "extrusionH", "63500");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d", "contourW", "25400");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d", "prstMaterial", "softEdge");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d"_ostr, "extrusionH"_ostr, "63500");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d"_ostr, "contourW"_ostr, "25400");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d"_ostr, "prstMaterial"_ostr, "softEdge");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:bevelT", "w", "38100");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:bevelT", "h", "38100");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:bevelT", "prst", "relaxedInset");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:bevelT"_ostr, "w"_ostr, "38100");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:bevelT"_ostr, "h"_ostr, "38100");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:bevelT"_ostr, "prst"_ostr, "relaxedInset");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:bevelB", "w", "69850");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:bevelB", "h", "38100");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:bevelB", "prst", "cross");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:bevelB"_ostr, "w"_ostr, "69850");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:bevelB"_ostr, "h"_ostr, "38100");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:bevelB"_ostr, "prst"_ostr, "cross");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:extrusionClr", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:extrusionClr/w14:schemeClr", "val", "accent2");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:extrusionClr/w14:schemeClr/w14:lumMod", "val", "20000");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:extrusionClr/w14:schemeClr/w14:lumOff", "val", "80000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:extrusionClr"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:extrusionClr/w14:schemeClr"_ostr, "val"_ostr, "accent2");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:extrusionClr/w14:schemeClr/w14:lumMod"_ostr, "val"_ostr, "20000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:extrusionClr/w14:schemeClr/w14:lumOff"_ostr, "val"_ostr, "80000");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:contourClr", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:contourClr/w14:srgbClr", "val", "92D050");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:contourClr"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:props3d/w14:contourClr/w14:srgbClr"_ostr, "val"_ostr, "92D050");
// Paragraph 2 - w14:ligatures
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:ligatures", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:ligatures", "val", "standard");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:ligatures"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:ligatures"_ostr, "val"_ostr, "standard");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[3]/w:rPr/w14:ligatures", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[3]/w:rPr/w14:ligatures", "val", "standardContextual");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[3]/w:rPr/w14:ligatures"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[3]/w:rPr/w14:ligatures"_ostr, "val"_ostr, "standardContextual");
// Paragraph 3 - w14:numForm and w14:numSpacing
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:rPr/w14:numForm", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:rPr/w14:numForm", "val", "lining");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:rPr/w14:numSpacing", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:rPr/w14:numSpacing", "val", "tabular");
-
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[4]/w:rPr/w14:numForm", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[4]/w:rPr/w14:numForm", "val", "oldStyle");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[4]/w:rPr/w14:numSpacing", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[4]/w:rPr/w14:numSpacing", "val", "proportional");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:rPr/w14:numForm"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:rPr/w14:numForm"_ostr, "val"_ostr, "lining");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:rPr/w14:numSpacing"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/w:rPr/w14:numSpacing"_ostr, "val"_ostr, "tabular");
+
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[4]/w:rPr/w14:numForm"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[4]/w:rPr/w14:numForm"_ostr, "val"_ostr, "oldStyle");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[4]/w:rPr/w14:numSpacing"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[4]/w:rPr/w14:numSpacing"_ostr, "val"_ostr, "proportional");
}
CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_StylisticSets_CntxtAlts)
@@ -230,14 +230,14 @@ CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_StylisticSets_CntxtAlts)
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// Paragraph 1 - w14:stylisticSets
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:stylisticSets/w14:styleSet", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:stylisticSets/w14:styleSet", "id", "4");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:stylisticSets/w14:styleSet"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w14:stylisticSets/w14:styleSet"_ostr, "id"_ostr, "4");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w14:stylisticSets/w14:styleSet", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w14:stylisticSets/w14:styleSet", "id", "2");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w14:stylisticSets/w14:styleSet"_ostr, 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[3]/w:rPr/w14:stylisticSets/w14:styleSet"_ostr, "id"_ostr, "2");
// Paragraph 1 - w14:cntxtAlts
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:cntxtAlts", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:rPr/w14:cntxtAlts"_ostr, 1);
}
@@ -246,11 +246,11 @@ CPPUNIT_TEST_FIXTURE(Test, Test_McIgnorable)
loadAndReload("TextEffects_StylisticSets_CntxtAlts.docx");
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- assertXPath(pXmlDocument, "/w:document", "Ignorable", "w14 wp14 w15");
+ assertXPath(pXmlDocument, "/w:document"_ostr, "Ignorable"_ostr, "w14 wp14 w15");
xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
- assertXPath(pXmlStyles, "/w:styles", "Ignorable", "w14");
+ assertXPath(pXmlStyles, "/w:styles"_ostr, "Ignorable"_ostr, "w14");
}
CPPUNIT_TEST_FIXTURE(Test, Test_CompatSettingsForW14)
@@ -258,27 +258,27 @@ CPPUNIT_TEST_FIXTURE(Test, Test_CompatSettingsForW14)
loadAndReload("TextEffects_StylisticSets_CntxtAlts.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/settings.xml");
- assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting", 5);
+ assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting"_ostr, 5);
- assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[1]", "name", "compatibilityMode");
- assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[1]", "uri", "http://schemas.microsoft.com/office/word");
- assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[1]", "val", "15"); // document was made with Word2013 -> 15
+ assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[1]"_ostr, "name"_ostr, "compatibilityMode");
+ assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[1]"_ostr, "uri"_ostr, "http://schemas.microsoft.com/office/word");
+ assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[1]"_ostr, "val"_ostr, "15"); // document was made with Word2013 -> 15
- assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[2]", "name", "overrideTableStyleFontSizeAndJustification");
- assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[2]", "uri", "http://schemas.microsoft.com/office/word");
- assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[2]", "val", "1");
+ assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[2]"_ostr, "name"_ostr, "overrideTableStyleFontSizeAndJustification");
+ assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[2]"_ostr, "uri"_ostr, "http://schemas.microsoft.com/office/word");
+ assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[2]"_ostr, "val"_ostr, "1");
- assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[3]", "name", "enableOpenTypeFeatures");
- assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[3]", "uri", "http://schemas.microsoft.com/office/word");
- assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[3]", "val", "1");
+ assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[3]"_ostr, "name"_ostr, "enableOpenTypeFeatures");
+ assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[3]"_ostr, "uri"_ostr, "http://schemas.microsoft.com/office/word");
+ assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[3]"_ostr, "val"_ostr, "1");
- assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[4]", "name", "doNotFlipMirrorIndents");
- assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[4]", "uri", "http://schemas.microsoft.com/office/word");
- assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[4]", "val", "1");
+ assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[4]"_ostr, "name"_ostr, "doNotFlipMirrorIndents");
+ assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[4]"_ostr, "uri"_ostr, "http://schemas.microsoft.com/office/word");
+ assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[4]"_ostr, "val"_ostr, "1");
- assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[5]", "name", "differentiateMultirowTableHeaders");
- assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[5]", "uri", "http://schemas.microsoft.com/office/word");
- assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[5]", "val", "1");
+ assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[5]"_ostr, "name"_ostr, "differentiateMultirowTableHeaders");
+ assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[5]"_ostr, "uri"_ostr, "http://schemas.microsoft.com/office/word");
+ assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[5]"_ostr, "val"_ostr, "1");
}
CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_Groupshapes)
@@ -286,7 +286,7 @@ CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_Groupshapes)
loadAndReload("TextEffects_Groupshapes.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- OString sPathToWGP = "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp";
+ OString sPathToWGP = "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp"_ostr;
assertXPath(pXmlDoc, sPathToWGP + "/wps:wsp", 2);
@@ -295,104 +295,104 @@ CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_Groupshapes)
// Glow
OString sPathGlow = sPathToShapeRunProperties + "/w14:glow";
assertXPath(pXmlDoc, sPathGlow, 1);
- assertXPath(pXmlDoc, sPathGlow, "rad", "127000");
- assertXPath(pXmlDoc, sPathGlow+"/w14:srgbClr", "val", "00B050");
- assertXPath(pXmlDoc, sPathGlow+"/w14:srgbClr/w14:alpha", "val", "60000");
+ assertXPath(pXmlDoc, sPathGlow, "rad"_ostr, "127000");
+ assertXPath(pXmlDoc, sPathGlow+"/w14:srgbClr", "val"_ostr, "00B050");
+ assertXPath(pXmlDoc, sPathGlow+"/w14:srgbClr/w14:alpha", "val"_ostr, "60000");
// Shadow
OString sPathShadow = sPathToShapeRunProperties + "/w14:shadow";
assertXPath(pXmlDoc, sPathShadow, 1);
- assertXPath(pXmlDoc, sPathShadow, "blurRad", "127000");
- assertXPath(pXmlDoc, sPathShadow, "dist", "787400");
- assertXPath(pXmlDoc, sPathShadow, "dir", "12720000");
- assertXPath(pXmlDoc, sPathShadow, "sx", "70000");
- assertXPath(pXmlDoc, sPathShadow, "sy", "70000");
- assertXPath(pXmlDoc, sPathShadow, "kx", "0");
- assertXPath(pXmlDoc, sPathShadow, "ky", "0");
- assertXPath(pXmlDoc, sPathShadow, "algn", "l");
- assertXPath(pXmlDoc, sPathShadow+"/w14:srgbClr", "val", "92D050");
- assertXPath(pXmlDoc, sPathShadow+"/w14:srgbClr/w14:alpha", "val", "40000");
+ assertXPath(pXmlDoc, sPathShadow, "blurRad"_ostr, "127000");
+ assertXPath(pXmlDoc, sPathShadow, "dist"_ostr, "787400");
+ assertXPath(pXmlDoc, sPathShadow, "dir"_ostr, "12720000");
+ assertXPath(pXmlDoc, sPathShadow, "sx"_ostr, "70000");
+ assertXPath(pXmlDoc, sPathShadow, "sy"_ostr, "70000");
+ assertXPath(pXmlDoc, sPathShadow, "kx"_ostr, "0");
+ assertXPath(pXmlDoc, sPathShadow, "ky"_ostr, "0");
+ assertXPath(pXmlDoc, sPathShadow, "algn"_ostr, "l");
+ assertXPath(pXmlDoc, sPathShadow+"/w14:srgbClr", "val"_ostr, "92D050");
+ assertXPath(pXmlDoc, sPathShadow+"/w14:srgbClr/w14:alpha", "val"_ostr, "40000");
// Reflection
OString sPathReflection = sPathToShapeRunProperties + "/w14:reflection";
assertXPath(pXmlDoc, sPathReflection, 1);
- assertXPath(pXmlDoc, sPathReflection, "blurRad", "139700");
- assertXPath(pXmlDoc, sPathReflection, "stA", "47000");
- assertXPath(pXmlDoc, sPathReflection, "stPos", "0");
- assertXPath(pXmlDoc, sPathReflection, "endA", "0");
- assertXPath(pXmlDoc, sPathReflection, "endPos", "85000");
- assertXPath(pXmlDoc, sPathReflection, "dist", "63500");
- assertXPath(pXmlDoc, sPathReflection, "dir", "5400000");
- assertXPath(pXmlDoc, sPathReflection, "fadeDir", "5400000");
- assertXPath(pXmlDoc, sPathReflection, "sx", "100000");
- assertXPath(pXmlDoc, sPathReflection, "sy", "-100000");
- assertXPath(pXmlDoc, sPathReflection, "kx", "0");
- assertXPath(pXmlDoc, sPathReflection, "ky", "0");
- assertXPath(pXmlDoc, sPathReflection, "algn", "bl");
+ assertXPath(pXmlDoc, sPathReflection, "blurRad"_ostr, "139700");
+ assertXPath(pXmlDoc, sPathReflection, "stA"_ostr, "47000");
+ assertXPath(pXmlDoc, sPathReflection, "stPos"_ostr, "0");
+ assertXPath(pXmlDoc, sPathReflection, "endA"_ostr, "0");
+ assertXPath(pXmlDoc, sPathReflection, "endPos"_ostr, "85000");
+ assertXPath(pXmlDoc, sPathReflection, "dist"_ostr, "63500");
+ assertXPath(pXmlDoc, sPathReflection, "dir"_ostr, "5400000");
+ assertXPath(pXmlDoc, sPathReflection, "fadeDir"_ostr, "5400000");
+ assertXPath(pXmlDoc, sPathReflection, "sx"_ostr, "100000");
+ assertXPath(pXmlDoc, sPathReflection, "sy"_ostr, "-100000");
+ assertXPath(pXmlDoc, sPathReflection, "kx"_ostr, "0");
+ assertXPath(pXmlDoc, sPathReflection, "ky"_ostr, "0");
+ assertXPath(pXmlDoc, sPathReflection, "algn"_ostr, "bl");
// TextOutline
OString sPathTextOutline = sPathToShapeRunProperties + "/w14:textOutline";
assertXPath(pXmlDoc, sPathTextOutline, 1);
- assertXPath(pXmlDoc, sPathTextOutline, "w", "25400");
- assertXPath(pXmlDoc, sPathTextOutline, "cap", "rnd");
- assertXPath(pXmlDoc, sPathTextOutline, "cmpd", "sng");
- assertXPath(pXmlDoc, sPathTextOutline, "algn", "ctr");
- assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr", "val", "accent2");
- assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr/w14:alpha", "val", "40000");
- assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr/w14:lumMod", "val", "75000");
- assertXPath(pXmlDoc, sPathTextOutline+"/w14:prstDash", "val", "solid");
+ assertXPath(pXmlDoc, sPathTextOutline, "w"_ostr, "25400");
+ assertXPath(pXmlDoc, sPathTextOutline, "cap"_ostr, "rnd");
+ assertXPath(pXmlDoc, sPathTextOutline, "cmpd"_ostr, "sng");
+ assertXPath(pXmlDoc, sPathTextOutline, "algn"_ostr, "ctr");
+ assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr", "val"_ostr, "accent2");
+ assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr/w14:alpha", "val"_ostr, "40000");
+ assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr/w14:lumMod", "val"_ostr, "75000");
+ assertXPath(pXmlDoc, sPathTextOutline+"/w14:prstDash", "val"_ostr, "solid");
assertXPath(pXmlDoc, sPathTextOutline+"/w14:round", 1);
// TextFill
OString sPathTextFill = sPathToShapeRunProperties + "/w14:textFill";
assertXPath(pXmlDoc, sPathTextFill, 1);
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]", "pos", "0");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr", "val", "accent4");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]", "pos", "41000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr", "val", "accent6");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumMod", "val", "60000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumOff", "val", "40000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]", "pos", "87000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr", "val", "accent5");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:lumMod", "val", "60000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:lumOff", "val", "40000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:lin", "ang", "5400000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:lin", "scaled", "0");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]", "pos"_ostr, "0");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr", "val"_ostr, "accent4");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]", "pos"_ostr, "41000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr", "val"_ostr, "accent6");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumMod", "val"_ostr, "60000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumOff", "val"_ostr, "40000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]", "pos"_ostr, "87000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr", "val"_ostr, "accent5");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:lumMod", "val"_ostr, "60000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:lumOff", "val"_ostr, "40000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:lin", "ang"_ostr, "5400000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:lin", "scaled"_ostr, "0");
// Props3D
OString sPathProps3D = sPathToShapeRunProperties + "/w14:props3d";
assertXPath(pXmlDoc, sPathProps3D, 1);
- assertXPath(pXmlDoc, sPathProps3D, "extrusionH", "63500");
- assertXPath(pXmlDoc, sPathProps3D, "contourW", "12700");
- assertXPath(pXmlDoc, sPathProps3D, "prstMaterial", "warmMatte");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "w", "38100");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "h", "38100");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "prst", "circle");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr", "val", "accent2");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr/w14:lumMod", "val", "60000");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr/w14:lumOff", "val", "40000");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:contourClr/w14:schemeClr", "val", "accent4");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:contourClr/w14:schemeClr/w14:lumMod", "val", "75000");
+ assertXPath(pXmlDoc, sPathProps3D, "extrusionH"_ostr, "63500");
+ assertXPath(pXmlDoc, sPathProps3D, "contourW"_ostr, "12700");
+ assertXPath(pXmlDoc, sPathProps3D, "prstMaterial"_ostr, "warmMatte");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "w"_ostr, "38100");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "h"_ostr, "38100");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "prst"_ostr, "circle");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr", "val"_ostr, "accent2");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr/w14:lumMod", "val"_ostr, "60000");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr/w14:lumOff", "val"_ostr, "40000");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:contourClr/w14:schemeClr", "val"_ostr, "accent4");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:contourClr/w14:schemeClr/w14:lumMod", "val"_ostr, "75000");
// Ligatures
OString sPathLigatures = sPathToShapeRunProperties + "/w14:ligatures";
assertXPath(pXmlDoc, sPathLigatures, 1);
- assertXPath(pXmlDoc, sPathLigatures, "val", "standard");
+ assertXPath(pXmlDoc, sPathLigatures, "val"_ostr, "standard");
// NumForm
OString sPathNumForm = sPathToShapeRunProperties + "/w14:numForm";
assertXPath(pXmlDoc, sPathNumForm, 1);
- assertXPath(pXmlDoc, sPathNumForm, "val", "oldStyle");
+ assertXPath(pXmlDoc, sPathNumForm, "val"_ostr, "oldStyle");
// NumSpacing
OString sPathNumSpacing = sPathToShapeRunProperties + "/w14:numSpacing";
assertXPath(pXmlDoc, sPathNumSpacing, 1);
- assertXPath(pXmlDoc, sPathNumSpacing, "val", "tabular");
+ assertXPath(pXmlDoc, sPathNumSpacing, "val"_ostr, "tabular");
// StylisticSets
OString sPathStylisticSets = sPathToShapeRunProperties + "/w14:stylisticSets";
assertXPath(pXmlDoc, sPathStylisticSets, 1);
- assertXPath(pXmlDoc, sPathStylisticSets+"/w14:styleSet", "id", "1");
+ assertXPath(pXmlDoc, sPathStylisticSets+"/w14:styleSet", "id"_ostr, "1");
}
CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_InStyleXml)
@@ -400,226 +400,226 @@ CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_InStyleXml)
loadAndReload("TextEffects_InStyle.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/styles.xml");
- OString sPathToCharacterStyle = "/w:styles/w:style[3]";
+ OString sPathToCharacterStyle = "/w:styles/w:style[3]"_ostr;
- assertXPath(pXmlDoc, sPathToCharacterStyle, "type", "character");
- assertXPath(pXmlDoc, sPathToCharacterStyle, "styleId", "TextEffectsStyleChar");
- assertXPath(pXmlDoc, sPathToCharacterStyle, "customStyle", "1");
+ assertXPath(pXmlDoc, sPathToCharacterStyle, "type"_ostr, "character");
+ assertXPath(pXmlDoc, sPathToCharacterStyle, "styleId"_ostr, "TextEffectsStyleChar");
+ assertXPath(pXmlDoc, sPathToCharacterStyle, "customStyle"_ostr, "1");
{
OString sPathToRun = sPathToCharacterStyle + "/w:rPr";
// Glow
OString sPathGlow = sPathToRun + "/w14:glow";
- assertXPath(pXmlDoc, sPathGlow, "rad", "63500");
- assertXPath(pXmlDoc, sPathGlow+"/w14:schemeClr", "val", "accent2");
- assertXPath(pXmlDoc, sPathGlow+"/w14:schemeClr/w14:alpha", "val", "60000");
- assertXPath(pXmlDoc, sPathGlow+"/w14:schemeClr/w14:satMod", "val", "175000");
+ assertXPath(pXmlDoc, sPathGlow, "rad"_ostr, "63500");
+ assertXPath(pXmlDoc, sPathGlow+"/w14:schemeClr", "val"_ostr, "accent2");
+ assertXPath(pXmlDoc, sPathGlow+"/w14:schemeClr/w14:alpha", "val"_ostr, "60000");
+ assertXPath(pXmlDoc, sPathGlow+"/w14:schemeClr/w14:satMod", "val"_ostr, "175000");
// Shadow
OString sPathShadow = sPathToRun + "/w14:shadow";
- assertXPath(pXmlDoc, sPathShadow, "blurRad", "50800");
- assertXPath(pXmlDoc, sPathShadow, "dist", "38100");
- assertXPath(pXmlDoc, sPathShadow, "dir", "16200000");
- assertXPath(pXmlDoc, sPathShadow, "sx", "100000");
- assertXPath(pXmlDoc, sPathShadow, "sy", "100000");
- assertXPath(pXmlDoc, sPathShadow, "kx", "0");
- assertXPath(pXmlDoc, sPathShadow, "ky", "0");
- assertXPath(pXmlDoc, sPathShadow, "algn", "b");
- assertXPath(pXmlDoc, sPathShadow+"/w14:srgbClr", "val", "000000");
- assertXPath(pXmlDoc, sPathShadow+"/w14:srgbClr/w14:alpha", "val", "60000");
+ assertXPath(pXmlDoc, sPathShadow, "blurRad"_ostr, "50800");
+ assertXPath(pXmlDoc, sPathShadow, "dist"_ostr, "38100");
+ assertXPath(pXmlDoc, sPathShadow, "dir"_ostr, "16200000");
+ assertXPath(pXmlDoc, sPathShadow, "sx"_ostr, "100000");
+ assertXPath(pXmlDoc, sPathShadow, "sy"_ostr, "100000");
+ assertXPath(pXmlDoc, sPathShadow, "kx"_ostr, "0");
+ assertXPath(pXmlDoc, sPathShadow, "ky"_ostr, "0");
+ assertXPath(pXmlDoc, sPathShadow, "algn"_ostr, "b");
+ assertXPath(pXmlDoc, sPathShadow+"/w14:srgbClr", "val"_ostr, "000000");
+ assertXPath(pXmlDoc, sPathShadow+"/w14:srgbClr/w14:alpha", "val"_ostr, "60000");
// Reflection
OString sPathReflection = sPathToRun + "/w14:reflection";
- assertXPath(pXmlDoc, sPathReflection, "blurRad", "6350");
- assertXPath(pXmlDoc, sPathReflection, "stA", "50000");
- assertXPath(pXmlDoc, sPathReflection, "stPos", "0");
- assertXPath(pXmlDoc, sPathReflection, "endA", "300");
- assertXPath(pXmlDoc, sPathReflection, "endPos", "50000");
- assertXPath(pXmlDoc, sPathReflection, "dist", "29997");
- assertXPath(pXmlDoc, sPathReflection, "dir", "5400000");
- assertXPath(pXmlDoc, sPathReflection, "fadeDir", "5400000");
- assertXPath(pXmlDoc, sPathReflection, "sx", "100000");
- assertXPath(pXmlDoc, sPathReflection, "sy", "-100000");
- assertXPath(pXmlDoc, sPathReflection, "kx", "0");
- assertXPath(pXmlDoc, sPathReflection, "ky", "0");
- assertXPath(pXmlDoc, sPathReflection, "algn", "bl");
+ assertXPath(pXmlDoc, sPathReflection, "blurRad"_ostr, "6350");
+ assertXPath(pXmlDoc, sPathReflection, "stA"_ostr, "50000");
+ assertXPath(pXmlDoc, sPathReflection, "stPos"_ostr, "0");
+ assertXPath(pXmlDoc, sPathReflection, "endA"_ostr, "300");
+ assertXPath(pXmlDoc, sPathReflection, "endPos"_ostr, "50000");
+ assertXPath(pXmlDoc, sPathReflection, "dist"_ostr, "29997");
+ assertXPath(pXmlDoc, sPathReflection, "dir"_ostr, "5400000");
+ assertXPath(pXmlDoc, sPathReflection, "fadeDir"_ostr, "5400000");
+ assertXPath(pXmlDoc, sPathReflection, "sx"_ostr, "100000");
+ assertXPath(pXmlDoc, sPathReflection, "sy"_ostr, "-100000");
+ assertXPath(pXmlDoc, sPathReflection, "kx"_ostr, "0");
+ assertXPath(pXmlDoc, sPathReflection, "ky"_ostr, "0");
+ assertXPath(pXmlDoc, sPathReflection, "algn"_ostr, "bl");
// TextOutline
OString sPathTextOutline = sPathToRun + "/w14:textOutline";
- assertXPath(pXmlDoc, sPathTextOutline, "w", "25400");
- assertXPath(pXmlDoc, sPathTextOutline, "cap", "rnd");
- assertXPath(pXmlDoc, sPathTextOutline, "cmpd", "sng");
- assertXPath(pXmlDoc, sPathTextOutline, "algn", "ctr");
- assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr", "val", "accent1");
- assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr/w14:alpha", "val", "40000");
- assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr/w14:lumMod", "val", "75000");
- assertXPath(pXmlDoc, sPathTextOutline+"/w14:prstDash", "val", "solid");
+ assertXPath(pXmlDoc, sPathTextOutline, "w"_ostr, "25400");
+ assertXPath(pXmlDoc, sPathTextOutline, "cap"_ostr, "rnd");
+ assertXPath(pXmlDoc, sPathTextOutline, "cmpd"_ostr, "sng");
+ assertXPath(pXmlDoc, sPathTextOutline, "algn"_ostr, "ctr");
+ assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr", "val"_ostr, "accent1");
+ assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr/w14:alpha", "val"_ostr, "40000");
+ assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr/w14:lumMod", "val"_ostr, "75000");
+ assertXPath(pXmlDoc, sPathTextOutline+"/w14:prstDash", "val"_ostr, "solid");
assertXPath(pXmlDoc, sPathTextOutline+"/w14:bevel", 1);
// TextFill
OString sPathTextFill = sPathToRun + "/w14:textFill";
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]", "pos", "0");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr", "val", "accent1");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:alpha", "val", "10000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:lumMod", "val", "40000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:lumOff", "val", "60000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]", "pos", "46000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr", "val", "accent1");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumMod", "val", "95000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumOff", "val", "5000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]", "pos", "100000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr", "val", "accent1");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:lumMod", "val", "60000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path", "path", "circle");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect", "b", "-30000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect", "r", "50000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect", "t", "130000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect", "l", "50000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]", "pos"_ostr, "0");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr", "val"_ostr, "accent1");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:alpha", "val"_ostr, "10000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:lumMod", "val"_ostr, "40000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:lumOff", "val"_ostr, "60000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]", "pos"_ostr, "46000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr", "val"_ostr, "accent1");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumMod", "val"_ostr, "95000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumOff", "val"_ostr, "5000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]", "pos"_ostr, "100000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr", "val"_ostr, "accent1");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:lumMod", "val"_ostr, "60000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path", "path"_ostr, "circle");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect", "b"_ostr, "-30000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect", "r"_ostr, "50000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect", "t"_ostr, "130000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect", "l"_ostr, "50000");
// Props3D
OString sPathProps3D = sPathToRun + "/w14:props3d";
- assertXPath(pXmlDoc, sPathProps3D, "extrusionH", "57150");
- assertXPath(pXmlDoc, sPathProps3D, "contourW", "12700");
- assertXPath(pXmlDoc, sPathProps3D, "prstMaterial", "metal");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "w", "38100");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "h", "38100");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "prst", "angle");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelB", "w", "69850");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelB", "h", "69850");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelB", "prst", "divot");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr", "val", "accent1");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr/w14:lumMod", "val", "20000");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr/w14:lumOff", "val", "80000");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:contourClr/w14:schemeClr", "val", "accent1");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:contourClr/w14:schemeClr/w14:lumMod", "val", "75000");
+ assertXPath(pXmlDoc, sPathProps3D, "extrusionH"_ostr, "57150");
+ assertXPath(pXmlDoc, sPathProps3D, "contourW"_ostr, "12700");
+ assertXPath(pXmlDoc, sPathProps3D, "prstMaterial"_ostr, "metal");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "w"_ostr, "38100");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "h"_ostr, "38100");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "prst"_ostr, "angle");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelB", "w"_ostr, "69850");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelB", "h"_ostr, "69850");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelB", "prst"_ostr, "divot");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr", "val"_ostr, "accent1");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr/w14:lumMod", "val"_ostr, "20000");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr/w14:lumOff", "val"_ostr, "80000");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:contourClr/w14:schemeClr", "val"_ostr, "accent1");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:contourClr/w14:schemeClr/w14:lumMod", "val"_ostr, "75000");
// Ligatures
OString sPathLigatures = sPathToRun + "/w14:ligatures";
- assertXPath(pXmlDoc, sPathLigatures, "val", "standard");
+ assertXPath(pXmlDoc, sPathLigatures, "val"_ostr, "standard");
// NumForm
OString sPathNumForm = sPathToRun + "/w14:numForm";
- assertXPath(pXmlDoc, sPathNumForm, "val", "lining");
+ assertXPath(pXmlDoc, sPathNumForm, "val"_ostr, "lining");
// NumSpacing
OString sPathNumSpacing = sPathToRun + "/w14:numSpacing";
- assertXPath(pXmlDoc, sPathNumSpacing, "val", "proportional");
+ assertXPath(pXmlDoc, sPathNumSpacing, "val"_ostr, "proportional");
// StylisticSets
OString sPathStylisticSets = sPathToRun + "/w14:stylisticSets";
- assertXPath(pXmlDoc, sPathStylisticSets+"/w14:styleSet", "id", "1");
+ assertXPath(pXmlDoc, sPathStylisticSets+"/w14:styleSet", "id"_ostr, "1");
}
- OString sPathToParagraphStyle = "/w:styles/w:style[9]";
+ OString sPathToParagraphStyle = "/w:styles/w:style[9]"_ostr;
- assertXPath(pXmlDoc, sPathToParagraphStyle, "type", "paragraph");
- assertXPath(pXmlDoc, sPathToParagraphStyle, "styleId", "TextEffectsStyle");
- assertXPath(pXmlDoc, sPathToParagraphStyle, "customStyle", "1");
+ assertXPath(pXmlDoc, sPathToParagraphStyle, "type"_ostr, "paragraph");
+ assertXPath(pXmlDoc, sPathToParagraphStyle, "styleId"_ostr, "TextEffectsStyle");
+ assertXPath(pXmlDoc, sPathToParagraphStyle, "customStyle"_ostr, "1");
{
OString sPathToRun = sPathToParagraphStyle + "/w:rPr";
// Glow
OString sPathGlow = sPathToRun + "/w14:glow";
- assertXPath(pXmlDoc, sPathGlow, "rad", "63500");
- assertXPath(pXmlDoc, sPathGlow+"/w14:schemeClr", "val", "accent2");
- assertXPath(pXmlDoc, sPathGlow+"/w14:schemeClr/w14:alpha", "val", "60000");
- assertXPath(pXmlDoc, sPathGlow+"/w14:schemeClr/w14:satMod", "val", "175000");
+ assertXPath(pXmlDoc, sPathGlow, "rad"_ostr, "63500");
+ assertXPath(pXmlDoc, sPathGlow+"/w14:schemeClr", "val"_ostr, "accent2");
+ assertXPath(pXmlDoc, sPathGlow+"/w14:schemeClr/w14:alpha", "val"_ostr, "60000");
+ assertXPath(pXmlDoc, sPathGlow+"/w14:schemeClr/w14:satMod", "val"_ostr, "175000");
// Shadow
OString sPathShadow = sPathToRun + "/w14:shadow";
- assertXPath(pXmlDoc, sPathShadow, "blurRad", "50800");
- assertXPath(pXmlDoc, sPathShadow, "dist", "38100");
- assertXPath(pXmlDoc, sPathShadow, "dir", "16200000");
- assertXPath(pXmlDoc, sPathShadow, "sx", "100000");
- assertXPath(pXmlDoc, sPathShadow, "sy", "100000");
- assertXPath(pXmlDoc, sPathShadow, "kx", "0");
- assertXPath(pXmlDoc, sPathShadow, "ky", "0");
- assertXPath(pXmlDoc, sPathShadow, "algn", "b");
- assertXPath(pXmlDoc, sPathShadow+"/w14:srgbClr", "val", "000000");
- assertXPath(pXmlDoc, sPathShadow+"/w14:srgbClr/w14:alpha", "val", "60000");
+ assertXPath(pXmlDoc, sPathShadow, "blurRad"_ostr, "50800");
+ assertXPath(pXmlDoc, sPathShadow, "dist"_ostr, "38100");
+ assertXPath(pXmlDoc, sPathShadow, "dir"_ostr, "16200000");
+ assertXPath(pXmlDoc, sPathShadow, "sx"_ostr, "100000");
+ assertXPath(pXmlDoc, sPathShadow, "sy"_ostr, "100000");
+ assertXPath(pXmlDoc, sPathShadow, "kx"_ostr, "0");
+ assertXPath(pXmlDoc, sPathShadow, "ky"_ostr, "0");
+ assertXPath(pXmlDoc, sPathShadow, "algn"_ostr, "b");
+ assertXPath(pXmlDoc, sPathShadow+"/w14:srgbClr", "val"_ostr, "000000");
+ assertXPath(pXmlDoc, sPathShadow+"/w14:srgbClr/w14:alpha", "val"_ostr, "60000");
// Reflection
OString sPathReflection = sPathToRun + "/w14:reflection";
- assertXPath(pXmlDoc, sPathReflection, "blurRad", "6350");
- assertXPath(pXmlDoc, sPathReflection, "stA", "50000");
- assertXPath(pXmlDoc, sPathReflection, "stPos", "0");
- assertXPath(pXmlDoc, sPathReflection, "endA", "300");
- assertXPath(pXmlDoc, sPathReflection, "endPos", "50000");
- assertXPath(pXmlDoc, sPathReflection, "dist", "29997");
- assertXPath(pXmlDoc, sPathReflection, "dir", "5400000");
- assertXPath(pXmlDoc, sPathReflection, "fadeDir", "5400000");
- assertXPath(pXmlDoc, sPathReflection, "sx", "100000");
- assertXPath(pXmlDoc, sPathReflection, "sy", "-100000");
- assertXPath(pXmlDoc, sPathReflection, "kx", "0");
- assertXPath(pXmlDoc, sPathReflection, "ky", "0");
- assertXPath(pXmlDoc, sPathReflection, "algn", "bl");
+ assertXPath(pXmlDoc, sPathReflection, "blurRad"_ostr, "6350");
+ assertXPath(pXmlDoc, sPathReflection, "stA"_ostr, "50000");
+ assertXPath(pXmlDoc, sPathReflection, "stPos"_ostr, "0");
+ assertXPath(pXmlDoc, sPathReflection, "endA"_ostr, "300");
+ assertXPath(pXmlDoc, sPathReflection, "endPos"_ostr, "50000");
+ assertXPath(pXmlDoc, sPathReflection, "dist"_ostr, "29997");
+ assertXPath(pXmlDoc, sPathReflection, "dir"_ostr, "5400000");
+ assertXPath(pXmlDoc, sPathReflection, "fadeDir"_ostr, "5400000");
+ assertXPath(pXmlDoc, sPathReflection, "sx"_ostr, "100000");
+ assertXPath(pXmlDoc, sPathReflection, "sy"_ostr, "-100000");
+ assertXPath(pXmlDoc, sPathReflection, "kx"_ostr, "0");
+ assertXPath(pXmlDoc, sPathReflection, "ky"_ostr, "0");
+ assertXPath(pXmlDoc, sPathReflection, "algn"_ostr, "bl");
// TextOutline
OString sPathTextOutline = sPathToRun + "/w14:textOutline";
- assertXPath(pXmlDoc, sPathTextOutline, "w", "25400");
- assertXPath(pXmlDoc, sPathTextOutline, "cap", "rnd");
- assertXPath(pXmlDoc, sPathTextOutline, "cmpd", "sng");
- assertXPath(pXmlDoc, sPathTextOutline, "algn", "ctr");
- assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr", "val", "accent1");
- assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr/w14:alpha", "val", "40000");
- assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr/w14:lumMod", "val", "75000");
- assertXPath(pXmlDoc, sPathTextOutline+"/w14:prstDash", "val", "solid");
+ assertXPath(pXmlDoc, sPathTextOutline, "w"_ostr, "25400");
+ assertXPath(pXmlDoc, sPathTextOutline, "cap"_ostr, "rnd");
+ assertXPath(pXmlDoc, sPathTextOutline, "cmpd"_ostr, "sng");
+ assertXPath(pXmlDoc, sPathTextOutline, "algn"_ostr, "ctr");
+ assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr", "val"_ostr, "accent1");
+ assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr/w14:alpha", "val"_ostr, "40000");
+ assertXPath(pXmlDoc, sPathTextOutline+"/w14:solidFill/w14:schemeClr/w14:lumMod", "val"_ostr, "75000");
+ assertXPath(pXmlDoc, sPathTextOutline+"/w14:prstDash", "val"_ostr, "solid");
assertXPath(pXmlDoc, sPathTextOutline+"/w14:bevel", 1);
// TextFill
OString sPathTextFill = sPathToRun + "/w14:textFill";
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]", "pos", "0");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr", "val", "accent1");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:alpha", "val", "10000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:lumMod", "val", "40000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:lumOff", "val", "60000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]", "pos", "46000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr", "val", "accent1");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumMod", "val", "95000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumOff", "val", "5000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]", "pos", "100000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr", "val", "accent1");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:lumMod", "val", "60000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path", "path", "circle");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect", "b", "-30000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect", "r", "50000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect", "t", "130000");
- assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect", "l", "50000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]", "pos"_ostr, "0");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr", "val"_ostr, "accent1");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:alpha", "val"_ostr, "10000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:lumMod", "val"_ostr, "40000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[1]/w14:schemeClr/w14:lumOff", "val"_ostr, "60000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]", "pos"_ostr, "46000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr", "val"_ostr, "accent1");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumMod", "val"_ostr, "95000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[2]/w14:schemeClr/w14:lumOff", "val"_ostr, "5000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]", "pos"_ostr, "100000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr", "val"_ostr, "accent1");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:gsLst/w14:gs[3]/w14:schemeClr/w14:lumMod", "val"_ostr, "60000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path", "path"_ostr, "circle");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect", "b"_ostr, "-30000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect", "r"_ostr, "50000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect", "t"_ostr, "130000");
+ assertXPath(pXmlDoc, sPathTextFill+"/w14:gradFill/w14:path/w14:fillToRect", "l"_ostr, "50000");
// Props3D
OString sPathProps3D = sPathToRun + "/w14:props3d";
- assertXPath(pXmlDoc, sPathProps3D, "extrusionH", "57150");
- assertXPath(pXmlDoc, sPathProps3D, "contourW", "12700");
- assertXPath(pXmlDoc, sPathProps3D, "prstMaterial", "metal");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "w", "38100");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "h", "38100");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "prst", "angle");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelB", "w", "69850");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelB", "h", "69850");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelB", "prst", "divot");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr", "val", "accent1");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr/w14:lumMod", "val", "20000");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr/w14:lumOff", "val", "80000");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:contourClr/w14:schemeClr", "val", "accent1");
- assertXPath(pXmlDoc, sPathProps3D+"/w14:contourClr/w14:schemeClr/w14:lumMod", "val", "75000");
+ assertXPath(pXmlDoc, sPathProps3D, "extrusionH"_ostr, "57150");
+ assertXPath(pXmlDoc, sPathProps3D, "contourW"_ostr, "12700");
+ assertXPath(pXmlDoc, sPathProps3D, "prstMaterial"_ostr, "metal");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "w"_ostr, "38100");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "h"_ostr, "38100");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelT", "prst"_ostr, "angle");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelB", "w"_ostr, "69850");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelB", "h"_ostr, "69850");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:bevelB", "prst"_ostr, "divot");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr", "val"_ostr, "accent1");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr/w14:lumMod", "val"_ostr, "20000");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:extrusionClr/w14:schemeClr/w14:lumOff", "val"_ostr, "80000");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:contourClr/w14:schemeClr", "val"_ostr, "accent1");
+ assertXPath(pXmlDoc, sPathProps3D+"/w14:contourClr/w14:schemeClr/w14:lumMod", "val"_ostr, "75000");
// Ligatures
OString sPathLigatures = sPathToRun + "/w14:ligatures";
- assertXPath(pXmlDoc, sPathLigatures, "val", "standard");
+ assertXPath(pXmlDoc, sPathLigatures, "val"_ostr, "standard");
// NumForm
OString sPathNumForm = sPathToRun + "/w14:numForm";
- assertXPath(pXmlDoc, sPathNumForm, "val", "lining");
+ assertXPath(pXmlDoc, sPathNumForm, "val"_ostr, "lining");
// NumSpacing
OString sPathNumSpacing = sPathToRun + "/w14:numSpacing";
- assertXPath(pXmlDoc, sPathNumSpacing, "val", "proportional");
+ assertXPath(pXmlDoc, sPathNumSpacing, "val"_ostr, "proportional");
// StylisticSets
OString sPathStylisticSets = sPathToRun + "/w14:stylisticSets";
- assertXPath(pXmlDoc, sPathStylisticSets+"/w14:styleSet", "id", "1");
+ assertXPath(pXmlDoc, sPathStylisticSets+"/w14:styleSet", "id"_ostr, "1");
}
}
@@ -628,7 +628,7 @@ CPPUNIT_TEST_FIXTURE(Test, Test_no_tag_if_no_fill)
loadAndReload("tdf112103_tablebgnofill.docx");
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:shd", 0);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:shd"_ostr, 0);
}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index cb26e28d748e..3a56fcd7d98f 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -365,14 +365,14 @@ CPPUNIT_TEST_FIXTURE(Test, testN766477)
CPPUNIT_TEST_FIXTURE(Test, testTdf130804)
{
createSwDoc("tdf130804.docx");
- OUString flyHeight = parseDump("/root/page/body/txt[1]/infos/bounds", "height");
- OUString txtHeight = parseDump("/root/page/body/txt[1]/anchored/fly/infos/bounds", "height");
+ OUString flyHeight = parseDump("/root/page/body/txt[1]/infos/bounds"_ostr, "height"_ostr);
+ OUString txtHeight = parseDump("/root/page/body/txt[1]/anchored/fly/infos/bounds"_ostr, "height"_ostr);
//Without the fix in place, txtHeight would have been flyHeight + 55
CPPUNIT_ASSERT_EQUAL(flyHeight, txtHeight);
// Also check the bookmark portion is ignored in the next paragraph
- OUString aTop = parseDump("/root/page/body/txt[2]/infos/prtBounds", "top");
+ OUString aTop = parseDump("/root/page/body/txt[2]/infos/prtBounds"_ostr, "top"_ostr);
CPPUNIT_ASSERT_EQUAL(OUString("240"), aTop);
}
@@ -384,11 +384,11 @@ CPPUNIT_TEST_FIXTURE(Test, testN758883)
* to the numbering. This is easier to test using a layout dump.
*/
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/SwFieldPortion[1]/SwFont", "height", "220");
+ assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/SwFieldPortion[1]/SwFont"_ostr, "height"_ostr, "220");
// hidden _Toc and _Ref bookmarks are not visible in Visible bookmarks mode
// This was PortionType::Bookmark
- assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/SwLinePortion[1]", "type", "PortionType::Text");
+ assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, "type"_ostr, "PortionType::Text");
// insert a not hidden bookmark
uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
@@ -410,14 +410,14 @@ CPPUNIT_TEST_FIXTURE(Test, testN758883)
pXmlDoc = parseLayoutDump();
// check the bookmark portions are of the expected height
- assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/SwBookmarkPortion[1]", "type", "PortionType::Bookmark");
- assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/SwBookmarkPortion[1]", "height", "253");
- assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/SwBookmarkPortion[2]", "type", "PortionType::Bookmark");
- assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/SwBookmarkPortion[2]", "height", "253");
+ assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/SwBookmarkPortion[1]"_ostr, "type"_ostr, "PortionType::Bookmark");
+ assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/SwBookmarkPortion[1]"_ostr, "height"_ostr, "253");
+ assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/SwBookmarkPortion[2]"_ostr, "type"_ostr, "PortionType::Bookmark");
+ assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/SwBookmarkPortion[2]"_ostr, "height"_ostr, "253");
// tdf#150947 check a11y of the newly inserted bookmark portions
- assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/SwBookmarkPortion[1]", "colors", "#BookmarkTest Bookmark Start");
- assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/SwBookmarkPortion[2]", "colors", "#BookmarkTest Bookmark End");
+ assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/SwBookmarkPortion[1]"_ostr, "colors"_ostr, "#BookmarkTest Bookmark Start");
+ assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/SwBookmarkPortion[2]"_ostr, "colors"_ostr, "#BookmarkTest Bookmark End");
/*
* Next problem was that the page margin contained the width of the page border as well.
@@ -795,7 +795,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf105127)
CPPUNIT_TEST_FIXTURE(Test, testTdf105143)
{
createSwDoc("tdf105143.docx");
- OUString aTop = parseDump("/root/page/body/txt/anchored/SwAnchoredDrawObject/bounds", "top");
+ OUString aTop = parseDump("/root/page/body/txt/anchored/SwAnchoredDrawObject/bounds"_ostr, "top"_ostr);
// This was 6272, i.e. the shape was moved up (incorrect position) to be
// inside the page rectangle.
CPPUNIT_ASSERT_EQUAL(OUString("6731"), aTop);
@@ -1029,7 +1029,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf75573)
lcl_countTextFrames( mxComponent, 1 );
// the frame should be on page 1
- CPPUNIT_ASSERT_EQUAL( OUString("lorem ipsum"), parseDump("/root/page[1]/body/section/txt/anchored/fly/txt[1]/text()") );
+ CPPUNIT_ASSERT_EQUAL( OUString("lorem ipsum"), parseDump("/root/page[1]/body/section/txt/anchored/fly/txt[1]/text()"_ostr) );
// the "Proprietary" style should set the vertical and horizontal anchors to the page
uno::Reference<beans::XPropertySet> xPropertySet(getShape(1), uno::UNO_QUERY);
@@ -1232,7 +1232,7 @@ CPPUNIT_TEST_FIXTURE(Test, testUnbalancedColumnsCompat)
CPPUNIT_TEST_FIXTURE(Test, testFloatingTableSectionColumns)
{
createSwDoc("floating-table-section-columns.docx");
- OUString tableWidth = parseDump("/root/page[1]/body/section/column[2]/body/txt/anchored/fly/tab/infos/bounds", "width");
+ OUString tableWidth = parseDump("/root/page[1]/body/section/column[2]/body/txt/anchored/fly/tab/infos/bounds"_ostr, "width"_ostr);
// table width was restricted by a column
CPPUNIT_ASSERT( tableWidth.toInt32() > 10000 );
}
@@ -1252,7 +1252,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBnc821804)
CPPUNIT_ASSERT_EQUAL(OUString("Insert"),getProperty<OUString>(getRun(getParagraph(1), 2), "RedlineType"));
CPPUNIT_ASSERT_EQUAL(true,getProperty<bool>(getRun(getParagraph(1), 2), "IsStart"));
CPPUNIT_ASSERT_EQUAL(OUString("unknown1"),getProperty<OUString>(getRun(getParagraph(1), 2), "RedlineAuthor"));
- CPPUNIT_ASSERT_EQUAL(OString("2006-08-29T09:46:00Z"),dateTimeToString(getProperty<util::DateTime>(getRun(getParagraph(1), 2), "RedlineDateTime")));
+ CPPUNIT_ASSERT_EQUAL("2006-08-29T09:46:00Z"_ostr,dateTimeToString(getProperty<util::DateTime>(getRun(getParagraph(1), 2), "RedlineDateTime")));
// So only the 3rd run is actual text (and the two runs have been merged into one, not sure why, but that shouldn't be a problem).
CPPUNIT_ASSERT_EQUAL(OUString(" (1st run of an insert) (2nd run of an insert)"), getRun(getParagraph(1),3)->getString());
CPPUNIT_ASSERT(!hasProperty(getRun(getParagraph(1), 3), "RedlineType"));
@@ -1260,7 +1260,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBnc821804)
CPPUNIT_ASSERT(hasProperty(getRun(getParagraph(1), 4), "RedlineType"));
CPPUNIT_ASSERT_EQUAL(OUString("Insert"),getProperty<OUString>(getRun(getParagraph(1), 4), "RedlineType"));
CPPUNIT_ASSERT_EQUAL(OUString("unknown1"),getProperty<OUString>(getRun(getParagraph(1), 4), "RedlineAuthor"));
- CPPUNIT_ASSERT_EQUAL(OString("2006-08-29T09:46:00Z"),dateTimeToString(getProperty<util::DateTime>(getRun(getParagraph(1), 4), "RedlineDateTime")));
+ CPPUNIT_ASSERT_EQUAL("2006-08-29T09:46:00Z"_ostr,dateTimeToString(getProperty<util::DateTime>(getRun(getParagraph(1), 4), "RedlineDateTime")));
CPPUNIT_ASSERT_EQUAL(false,getProperty<bool>(getRun(getParagraph(1), 4), "IsStart"));
CPPUNIT_ASSERT_EQUAL(OUString("Normal text"), getRun(getParagraph(2),1)->getString());
@@ -1269,7 +1269,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBnc821804)
CPPUNIT_ASSERT(hasProperty(getRun(getParagraph(3), 1), "RedlineType"));
CPPUNIT_ASSERT_EQUAL(OUString("Delete"),getProperty<OUString>(getRun(getParagraph(3), 1), "RedlineType"));
CPPUNIT_ASSERT_EQUAL(OUString("unknown2"),getProperty<OUString>(getRun(getParagraph(3), 1), "RedlineAuthor"));
- CPPUNIT_ASSERT_EQUAL(OString("2006-08-29T09:47:00Z"),dateTimeToString(getProperty<util::DateTime>(getRun(getParagraph(3), 1), "RedlineDateTime")));
+ CPPUNIT_ASSERT_EQUAL("2006-08-29T09:47:00Z"_ostr,dateTimeToString(getProperty<util::DateTime>(getRun(getParagraph(3), 1), "RedlineDateTime")));
CPPUNIT_ASSERT_EQUAL(OUString("Deleted"), getRun(getParagraph(3),2)->getString());
// This is both inserted and formatted, so there are two SwXRedlinePortion "runs". Given that the redlines overlap and Writer core
@@ -1296,7 +1296,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBnc821804)
CPPUNIT_ASSERT_EQUAL(OUString("Format"),getProperty<OUString>(getRun(getParagraph(6), 1), "RedlineType"));
CPPUNIT_ASSERT_EQUAL(true,getProperty<bool>(getRun(getParagraph(6), 1), "IsStart"));
CPPUNIT_ASSERT_EQUAL(OUString("unknown5"),getProperty<OUString>(getRun(getParagraph(6), 1), "RedlineAuthor"));
- CPPUNIT_ASSERT_EQUAL(OString("2006-08-29T10:02:00Z"),dateTimeToString(getProperty<util::DateTime>(getRun(getParagraph(6), 1), "RedlineDateTime")));
+ CPPUNIT_ASSERT_EQUAL("2006-08-29T10:02:00Z"_ostr,dateTimeToString(getProperty<util::DateTime>(getRun(getParagraph(6), 1), "RedlineDateTime")));
CPPUNIT_ASSERT_EQUAL(OUString("Formatted run"), getRun(getParagraph(6),2)->getString());
CPPUNIT_ASSERT(hasProperty(getRun(getParagraph(6), 3), "RedlineType"));
CPPUNIT_ASSERT_EQUAL(OUString("Format"),getProperty<OUString>(getRun(getParagraph(6), 3), "RedlineType"));
@@ -1307,7 +1307,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBnc821804)
CPPUNIT_ASSERT_EQUAL(OUString("Insert"),getProperty<OUString>(getRun(getParagraph(6), 5), "RedlineType"));
CPPUNIT_ASSERT_EQUAL(true,getProperty<bool>(getRun(getParagraph(6), 5), "IsStart"));
CPPUNIT_ASSERT_EQUAL(OUString("unknown6"),getProperty<OUString>(getRun(getParagraph(6), 5), "RedlineAuthor"));
- CPPUNIT_ASSERT_EQUAL(OString("2006-08-29T09:48:00Z"),dateTimeToString(getProperty<util::DateTime>(getRun(getParagraph(6), 5), "RedlineDateTime")));
+ CPPUNIT_ASSERT_EQUAL("2006-08-29T09:48:00Z"_ostr,dateTimeToString(getProperty<util::DateTime>(getRun(getParagraph(6), 5), "RedlineDateTime")));
CPPUNIT_ASSERT_EQUAL(OUString("and inserted again"), getRun(getParagraph(6),6)->getString());
CPPUNIT_ASSERT(hasProperty(getRun(getParagraph(6), 7), "RedlineType"));
CPPUNIT_ASSERT_EQUAL(OUString("Insert"),getProperty<OUString>(getRun(getParagraph(6), 7), "RedlineType"));
@@ -1501,8 +1501,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf122717)
CPPUNIT_TEST_FIXTURE(Test, testTdf98882)
{
createSwDoc("tdf98882.docx");
- sal_Int32 nFlyHeight = parseDump("//anchored/fly/infos/bounds", "height").toInt32();
- sal_Int32 nContentHeight = parseDump("//notxt/infos/bounds", "height").toInt32();
+ sal_Int32 nFlyHeight = parseDump("//anchored/fly/infos/bounds"_ostr, "height"_ostr).toInt32();
+ sal_Int32 nContentHeight = parseDump("//notxt/infos/bounds"_ostr, "height"_ostr).toInt32();
// The content height was 600, not 360, so the frame and the content height did not match.
CPPUNIT_ASSERT_EQUAL(nFlyHeight, nContentHeight);
}
@@ -1648,10 +1648,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf100072)
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, rMetaFile);
// Get first polyline rightside x coordinate
- sal_Int32 nFirstEnd = getXPath(pXmlDoc, "(//polyline)[1]/point[2]", "x").toInt32();
+ sal_Int32 nFirstEnd = getXPath(pXmlDoc, "(//polyline)[1]/point[2]"_ostr, "x"_ostr).toInt32();
// Get last stroke x coordinate
- sal_Int32 nSecondEnd = getXPath(pXmlDoc, "(//polyline)[last()]/point[2]", "x").toInt32();
+ sal_Int32 nSecondEnd = getXPath(pXmlDoc, "(//polyline)[last()]/point[2]"_ostr, "x"_ostr).toInt32();
// Assert that the difference is less than half point.
CPPUNIT_ASSERT_MESSAGE("Shape line width does not match", abs(nFirstEnd - nSecondEnd) < 10);
@@ -1812,7 +1812,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf136952_pgBreak3)
//Do not lose the page::breakAfter. This SHOULD be on page 4, but sadly it is not.
//The key part of this test is that the page starts with "Lorem ipsum"
//Prior to this, there was no page break, and so it was in the middle of a page.
- CPPUNIT_ASSERT(getXPath(pDump, "//page[6]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]", "portion").startsWith("Lorem ipsum"));
+ CPPUNIT_ASSERT(getXPath(pDump, "//page[6]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]"_ostr, "portion"_ostr).startsWith("Lorem ipsum"));
}
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
index 25816f6dec3a..053f5334021e 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
@@ -257,7 +257,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf114212)
// Without the accompanying fix in place, this test would have failed with:
// - Expected: 1428
// - Actual : 387
- OUString aTop = parseDump("//anchored/fly[1]/infos/bounds", "top");
+ OUString aTop = parseDump("//anchored/fly[1]/infos/bounds"_ostr, "top"_ostr);
CPPUNIT_ASSERT_EQUAL(OUString("1428"), aTop);
}
@@ -406,8 +406,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf124600)
// Make sure that "Shape 1 text" (anchored in the header) has the same left margin as the body
// text.
- OUString aShapeTextLeft = parseDump("/root/page/header/txt/anchored/fly/infos/bounds", "left");
- OUString aBodyTextLeft = parseDump("/root/page/body/txt/infos/bounds", "left");
+ OUString aShapeTextLeft
+ = parseDump("/root/page/header/txt/anchored/fly/infos/bounds"_ostr, "left"_ostr);
+ OUString aBodyTextLeft = parseDump("/root/page/body/txt/infos/bounds"_ostr, "left"_ostr);
// Without the accompanying fix in place, this test would have failed with:
// - Expected: 1701
// - Actual : 1815
@@ -423,7 +424,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf120548)
// Actual: ffffffff', i.e. the numbering portion was black, not red.
CPPUNIT_ASSERT_EQUAL(
OUString("00ff0000"),
- parseDump("//SwFieldPortion[@type='PortionType::Number']/SwFont", "color"));
+ parseDump("//SwFieldPortion[@type='PortionType::Number']/SwFont"_ostr, "color"_ostr));
}
CPPUNIT_TEST_FIXTURE(Test, test120551)
@@ -538,7 +539,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127778)
// - Expected: 0
// - Actual : 1
// i.e. the 2nd page had an unexpected header.
- assertXPath(pLayout, "//page[2]/header", 0);
+ assertXPath(pLayout, "//page[2]/header"_ostr, 0);
}
// related tdf#43017
@@ -652,7 +653,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104167)
CPPUNIT_TEST_FIXTURE(Test, testTdf113946)
{
createSwDoc("tdf113946.docx");
- OUString aTop = parseDump("/root/page/body/txt/anchored/SwAnchoredDrawObject/bounds", "top");
+ OUString aTop
+ = parseDump("/root/page/body/txt/anchored/SwAnchoredDrawObject/bounds"_ostr, "top"_ostr);
// tdf#106792 Checked loading of tdf113946.docx. Before the change, the expected
// value of this test was "1696". Opening the file shows a single short line anchored
// at the doc start. Only diff is that in 'old' version it is slightly rotated, in 'new'
diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx
index 6ce4b179ccfa..85149da53a80 100644
--- a/sw/qa/extras/rtfexport/rtfexport3.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport3.cxx
@@ -188,14 +188,15 @@ DECLARE_RTFEXPORT_TEST(testTdf115180, "tdf115180.docx")
// On export to RTF, column separator positions were written without taking base width
// into account and then arrived huge, ~64000, which resulted in wrong table and cell widths
- sal_Int32 rowWidth = parseDump("/root/page/body/tab/row/infos/bounds", "width").toInt32();
+ sal_Int32 rowWidth
+ = parseDump("/root/page/body/tab/row/infos/bounds"_ostr, "width"_ostr).toInt32();
CPPUNIT_ASSERT_EQUAL_MESSAGE("Row width", sal_Int32(9360), rowWidth);
sal_Int32 cell1Width
- = parseDump("/root/page/body/tab/row/cell[1]/infos/bounds", "width").toInt32();
+ = parseDump("/root/page/body/tab/row/cell[1]/infos/bounds"_ostr, "width"_ostr).toInt32();
CPPUNIT_ASSERT_MESSAGE("First cell width", cell1Width >= 9140);
CPPUNIT_ASSERT_MESSAGE("First cell width", cell1Width <= 9142);
sal_Int32 cell2Width
- = parseDump("/root/page/body/tab/row/cell[2]/infos/bounds", "width").toInt32();
+ = parseDump("/root/page/body/tab/row/cell[2]/infos/bounds"_ostr, "width"_ostr).toInt32();
CPPUNIT_ASSERT_MESSAGE("Second cell width", cell2Width >= 218);
CPPUNIT_ASSERT_MESSAGE("Second cell width", cell2Width <= 220);
}
diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx
index 9547734711ea..2a470f3c9682 100644
--- a/sw/qa/extras/rtfexport/rtfexport4.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport4.cxx
@@ -565,8 +565,8 @@ DECLARE_RTFEXPORT_TEST(testTdf116358, "tdf116358.rtf")
// Entire table should go to page 2, no remains on first page
xmlDocUniquePtr pDump = parseLayoutDump();
- assertXPath(pDump, "/root/page[1]/body/tab", 0);
- assertXPath(pDump, "/root/page[2]/body/tab", 1);
+ assertXPath(pDump, "/root/page[1]/body/tab"_ostr, 0);
+ assertXPath(pDump, "/root/page[2]/body/tab"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testGutterLeft)
@@ -779,33 +779,39 @@ DECLARE_RTFEXPORT_TEST(testTdf103956, "tdf103956.rtf")
// table & cell widths are more than default minimal value of 41.
CPPUNIT_ASSERT_MESSAGE(
"Table #1 is too narrow!",
- 82 < parseDump("/root/page/body/tab[1]/row/infos/bounds", "width").toInt32());
+ 82 < parseDump("/root/page/body/tab[1]/row/infos/bounds"_ostr, "width"_ostr).toInt32());
CPPUNIT_ASSERT_MESSAGE(
"Table #1 cell#1 is too narrow!",
- 41 < parseDump("/root/page/body/tab[1]/row/cell[1]/infos/bounds", "width").toInt32());
+ 41 < parseDump("/root/page/body/tab[1]/row/cell[1]/infos/bounds"_ostr, "width"_ostr)
+ .toInt32());
CPPUNIT_ASSERT_MESSAGE(
"Table #1 cell#2 is too narrow!",
- 41 < parseDump("/root/page/body/tab[1]/row/cell[2]/infos/bounds", "width").toInt32());
+ 41 < parseDump("/root/page/body/tab[1]/row/cell[2]/infos/bounds"_ostr, "width"_ostr)
+ .toInt32());
CPPUNIT_ASSERT_MESSAGE(
"Table #2 is too narrow!",
- 82 < parseDump("/root/page/body/tab[2]/row/infos/bounds", "width").toInt32());
+ 82 < parseDump("/root/page/body/tab[2]/row/infos/bounds"_ostr, "width"_ostr).toInt32());
CPPUNIT_ASSERT_MESSAGE(
"Table #2 cell#1 is too narrow!",
- 41 < parseDump("/root/page/body/tab[2]/row/cell[1]/infos/bounds", "width").toInt32());
+ 41 < parseDump("/root/page/body/tab[2]/row/cell[1]/infos/bounds"_ostr, "width"_ostr)
+ .toInt32());
CPPUNIT_ASSERT_MESSAGE(
"Table #2 cell#2 is too narrow!",
- 41 < parseDump("/root/page/body/tab[2]/row/cell[2]/infos/bounds", "width").toInt32());
+ 41 < parseDump("/root/page/body/tab[2]/row/cell[2]/infos/bounds"_ostr, "width"_ostr)
+ .toInt32());
CPPUNIT_ASSERT_MESSAGE(
"Table #3 is too narrow!",
- 82 < parseDump("/root/page/body/tab[3]/row/infos/bounds", "width").toInt32());
+ 82 < parseDump("/root/page/body/tab[3]/row/infos/bounds"_ostr, "width"_ostr).toInt32());
CPPUNIT_ASSERT_MESSAGE(
"Table #3 cell#1 is too narrow!",
- 41 < parseDump("/root/page/body/tab[3]/row/cell[1]/infos/bounds", "width").toInt32());
+ 41 < parseDump("/root/page/body/tab[3]/row/cell[1]/infos/bounds"_ostr, "width"_ostr)
+ .toInt32());
CPPUNIT_ASSERT_MESSAGE(
"Table #3 cell#2 is too narrow!",
- 41 < parseDump("/root/page/body/tab[3]/row/cell[2]/infos/bounds", "width").toInt32());
+ 41 < parseDump("/root/page/body/tab[3]/row/cell[2]/infos/bounds"_ostr, "width"_ostr)
+ .toInt32());
}
DECLARE_RTFEXPORT_TEST(testTdf148515, "tdf148515.rtf")
diff --git a/sw/qa/extras/rtfexport/rtfexport5.cxx b/sw/qa/extras/rtfexport/rtfexport5.cxx
index cc49b9c30558..e11fc7ae0a3b 100644
--- a/sw/qa/extras/rtfexport/rtfexport5.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport5.cxx
@@ -86,7 +86,7 @@ DECLARE_RTFEXPORT_TEST(testTdf153613_anchoredAfterPgBreak, "tdf153613_anchoredAf
CPPUNIT_ASSERT_EQUAL(3, getParagraphs());
const auto& pLayout = parseLayoutDump();
- assertXPath(pLayout, "//page[1]//anchored", 1);
+ assertXPath(pLayout, "//page[1]//anchored"_ostr, 1);
}
DECLARE_RTFEXPORT_TEST(testTdf153613_anchoredAfterPgBreak2, "tdf153613_anchoredAfterPgBreak2.rtf")
@@ -96,7 +96,7 @@ DECLARE_RTFEXPORT_TEST(testTdf153613_anchoredAfterPgBreak2, "tdf153613_anchoredA
CPPUNIT_ASSERT_EQUAL(3, getParagraphs());
const auto& pLayout = parseLayoutDump();
- assertXPath(pLayout, "//page[2]//anchored", 1);
+ assertXPath(pLayout, "//page[2]//anchored"_ostr, 1);
}
DECLARE_RTFEXPORT_TEST(testTdf153613_anchoredAfterPgBreak4, "tdf153613_anchoredAfterPgBreak4.rtf")
@@ -107,7 +107,7 @@ DECLARE_RTFEXPORT_TEST(testTdf153613_anchoredAfterPgBreak4, "tdf153613_anchoredA
CPPUNIT_ASSERT_EQUAL(3, getParagraphs());
const auto& pLayout = parseLayoutDump();
- assertXPath(pLayout, "//page[1]//anchored", 1);
+ assertXPath(pLayout, "//page[1]//anchored"_ostr, 1);
}
DECLARE_RTFEXPORT_TEST(testTdf153613_anchoredAfterPgBreak5, "tdf153613_anchoredAfterPgBreak5.rtf")
@@ -118,7 +118,7 @@ DECLARE_RTFEXPORT_TEST(testTdf153613_anchoredAfterPgBreak5, "tdf153613_anchoredA
CPPUNIT_ASSERT_EQUAL(3, getParagraphs());
const auto& pLayout = parseLayoutDump();
- assertXPath(pLayout, "//page[1]//anchored", 1);
+ assertXPath(pLayout, "//page[1]//anchored"_ostr, 1);
}
DECLARE_RTFEXPORT_TEST(testTdf153613_inlineAfterPgBreak, "tdf153613_inlineAfterPgBreak.rtf")
@@ -128,7 +128,7 @@ DECLARE_RTFEXPORT_TEST(testTdf153613_inlineAfterPgBreak, "tdf153613_inlineAfterP
CPPUNIT_ASSERT_EQUAL(3, getParagraphs());
const auto& pLayout = parseLayoutDump();
- assertXPath(pLayout, "//page[2]//anchored", 1);
+ assertXPath(pLayout, "//page[2]//anchored"_ostr, 1);
}
DECLARE_RTFEXPORT_TEST(testTdf153613_inlineAfterPgBreak2, "tdf153613_inlineAfterPgBreak2.rtf")
@@ -139,8 +139,8 @@ DECLARE_RTFEXPORT_TEST(testTdf153613_inlineAfterPgBreak2, "tdf153613_inlineAfter
CPPUNIT_ASSERT_EQUAL(4, getParagraphs());
const auto& pLayout = parseLayoutDump();
- CPPUNIT_ASSERT_EQUAL(OUString("x"), getXPathContent(pLayout, "//page[1]/body/txt[2]"));
- assertXPath(pLayout, "//page[2]//anchored", 1);
+ CPPUNIT_ASSERT_EQUAL(OUString("x"), getXPathContent(pLayout, "//page[1]/body/txt[2]"_ostr));
+ assertXPath(pLayout, "//page[2]//anchored"_ostr, 1);
}
DECLARE_RTFEXPORT_TEST(testFdo64671, "fdo64671.rtf")
@@ -450,26 +450,29 @@ DECLARE_RTFEXPORT_TEST(testTdf107413, "tdf107413.rtf")
xmlDocUniquePtr pDump = parseLayoutDump();
const double nLeftFooter
- = getXPath(pDump, "/root/page[1]/footer/infos/bounds", "left").toDouble();
+ = getXPath(pDump, "/root/page[1]/footer/infos/bounds"_ostr, "left"_ostr).toDouble();
const double nRightFooter
- = getXPath(pDump, "/root/page[1]/footer/infos/bounds", "right").toDouble();
+ = getXPath(pDump, "/root/page[1]/footer/infos/bounds"_ostr, "right"_ostr).toDouble();
const double nTopFooter
- = getXPath(pDump, "/root/page[1]/footer/infos/bounds", "top").toDouble();
+ = getXPath(pDump, "/root/page[1]/footer/infos/bounds"_ostr, "top"_ostr).toDouble();
const double nBottomFooter
- = getXPath(pDump, "/root/page[1]/footer/infos/bounds", "bottom").toDouble();
+ = getXPath(pDump, "/root/page[1]/footer/infos/bounds"_ostr, "bottom"_ostr).toDouble();
// Without the fix in place, this test would have failed with
// - Expected: 1
// - Actual : 0
// - In <>, XPath '/root/page[1]/footer/txt/anchored/fly/infos/bounds' number of nodes is incorrect
const double nLeftFly
- = getXPath(pDump, "/root/page[1]/footer/txt/anchored/fly/infos/bounds", "left").toDouble();
+ = getXPath(pDump, "/root/page[1]/footer/txt/anchored/fly/infos/bounds"_ostr, "left"_ostr)
+ .toDouble();
const double nRightFly
- = getXPath(pDump, "/root/page[1]/footer/txt/anchored/fly/infos/bounds", "right").toDouble();
+ = getXPath(pDump, "/root/page[1]/footer/txt/anchored/fly/infos/bounds"_ostr, "right"_ostr)
+ .toDouble();
const double nTopFly
- = getXPath(pDump, "/root/page[1]/footer/txt/anchored/fly/infos/bounds", "top").toDouble();
+ = getXPath(pDump, "/root/page[1]/footer/txt/anchored/fly/infos/bounds"_ostr, "top"_ostr)
+ .toDouble();
const double nBottomFly
- = getXPath(pDump, "/root/page[1]/footer/txt/anchored/fly/infos/bounds", "bottom")
+ = getXPath(pDump, "/root/page[1]/footer/txt/anchored/fly/infos/bounds"_ostr, "bottom"_ostr)
.toDouble();
CPPUNIT_ASSERT_EQUAL(nLeftFooter, nLeftFly);
diff --git a/sw/qa/extras/rtfexport/rtfexport6.cxx b/sw/qa/extras/rtfexport/rtfexport6.cxx
index 5b9ee2650878..f87990e0a15f 100644
--- a/sw/qa/extras/rtfexport/rtfexport6.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport6.cxx
@@ -100,11 +100,11 @@ DECLARE_RTFEXPORT_TEST(testTdf88811, "tdf88811.rtf")
DECLARE_RTFEXPORT_TEST(testFdo49893_2, "fdo49893-2.rtf")
{
// Ensure that header text exists on each page (especially on second page)
- CPPUNIT_ASSERT_EQUAL(OUString("HEADER"), parseDump("/root/page[1]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("HEADER"), parseDump("/root/page[2]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("HEADER"), parseDump("/root/page[3]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("HEADER"), parseDump("/root/page[4]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("HEADER"), parseDump("/root/page[5]/header/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("HEADER"), parseDump("/root/page[1]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("HEADER"), parseDump("/root/page[2]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("HEADER"), parseDump("/root/page[3]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("HEADER"), parseDump("/root/page[4]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("HEADER"), parseDump("/root/page[5]/header/txt/text()"_ostr));
CPPUNIT_ASSERT_EQUAL(5, getPages()); // Word has 5
}
@@ -555,13 +555,13 @@ DECLARE_RTFEXPORT_TEST(testTdf133437, "tdf133437.rtf")
xmlDocUniquePtr pDump = parseLayoutDump();
// Count shapes on first page
- assertXPath(pDump, "/root/page[1]/body/txt[1]/anchored/SwAnchoredDrawObject", 79);
+ assertXPath(pDump, "/root/page[1]/body/txt[1]/anchored/SwAnchoredDrawObject"_ostr, 79);
// Second page
- assertXPath(pDump, "/root/page[2]/body/txt[2]/anchored/SwAnchoredDrawObject", 120);
+ assertXPath(pDump, "/root/page[2]/body/txt[2]/anchored/SwAnchoredDrawObject"_ostr, 120);
// Third page
- assertXPath(pDump, "/root/page[3]/body/txt[2]/anchored/SwAnchoredDrawObject", 86);
+ assertXPath(pDump, "/root/page[3]/body/txt[2]/anchored/SwAnchoredDrawObject"_ostr, 86);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf128320)
@@ -681,8 +681,9 @@ DECLARE_RTFEXPORT_TEST(testTdf118047, "tdf118047.rtf")
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(getParagraph(1), "ParaBottomMargin"));
// Same for header, it should not derive props from "Normal" style
- CPPUNIT_ASSERT_EQUAL(OUString("Header"), parseDump("/root/page[1]/header/txt/text()"));
- sal_Int32 nHeight = parseDump("/root/page[1]/header/infos/bounds", "height").toInt32();
+ CPPUNIT_ASSERT_EQUAL(OUString("Header"), parseDump("/root/page[1]/header/txt/text()"_ostr));
+ sal_Int32 nHeight
+ = parseDump("/root/page[1]/header/infos/bounds"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT_MESSAGE("Header is too large", 1000 > nHeight);
}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index d561969f8989..a0a75c1559d1 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -396,8 +396,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf112211_2)
// Spacing between the bullet and the actual text was too large.
// This is now around 269, large old value was 629.
int nWidth = parseDump("/root/page/body/txt[2]/SwParaPortion/SwLineLayout/"
- "child::*[@type='PortionType::TabLeft']",
- "width")
+ "child::*[@type='PortionType::TabLeft']"_ostr,
+ "width"_ostr)
.toInt32();
CPPUNIT_ASSERT_LESS(300, nWidth);
}
@@ -439,7 +439,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo52052)
createSwDoc("fdo52052.rtf");
// Make sure the textframe containing the text "third" appears on the 3rd page.
CPPUNIT_ASSERT_EQUAL(OUString("third"),
- parseDump("/root/page[3]/body/txt/anchored/fly/txt/text()"));
+ parseDump("/root/page[3]/body/txt/anchored/fly/txt/text()"_ostr));
}
CPPUNIT_TEST_FIXTURE(Test, testInk)
@@ -741,7 +741,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf116265)
const auto& pLayout = parseLayoutDump();
// Ensure that there is a tabstop in the pseudo-numbering (numbering::NONE followed by tabstop)
- assertXPath(pLayout, "//SwFixPortion", 1);
+ assertXPath(pLayout, "//SwFixPortion"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testFdo66565)
@@ -1479,7 +1479,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf78506)
const auto& pLayout = parseLayoutDump();
// Ensure that there is a tabstop in the pseudo-numbering (numbering::NONE followed by tabstop)
- assertXPath(pLayout, "//SwFixPortion", 1);
+ assertXPath(pLayout, "//SwFixPortion"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf117403)
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 4ed5f3af6cdb..271e30e47a93 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -262,7 +262,7 @@ void SwTiledRenderingTest::callbackImpl(int nType, const char* pPayload)
break;
case LOK_CALLBACK_STATE_CHANGED:
{
- OString aTrackedChangeIndexPrefix(".uno:TrackedChangeIndex=");
+ OString aTrackedChangeIndexPrefix(".uno:TrackedChangeIndex="_ostr);
if (aPayload.startsWith(aTrackedChangeIndexPrefix))
{
OString sIndex = aPayload.copy(aTrackedChangeIndexPrefix.getLength());
@@ -381,7 +381,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testGetTextSelection)
{
SwXTextDocument* pXTextDocument = createDoc("shape-with-text.fodt");
// No crash, just empty output for unexpected mime type.
- CPPUNIT_ASSERT_EQUAL(OString(), apitest::helper::transferable::getTextSelection(pXTextDocument->getSelection(), "foo/bar"));
+ CPPUNIT_ASSERT_EQUAL(OString(), apitest::helper::transferable::getTextSelection(pXTextDocument->getSelection(), "foo/bar"_ostr));
SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell();
// Move the cursor into the first word.
@@ -390,10 +390,10 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testGetTextSelection)
pWrtShell->SelWrd();
// Make sure that we selected text from the body text.
- CPPUNIT_ASSERT_EQUAL(OString("Hello"), apitest::helper::transferable::getTextSelection(pXTextDocument->getSelection(), "text/plain;charset=utf-8"));
+ CPPUNIT_ASSERT_EQUAL("Hello"_ostr, apitest::helper::transferable::getTextSelection(pXTextDocument->getSelection(), "text/plain;charset=utf-8"_ostr));
// Make sure we produce something for HTML.
- CPPUNIT_ASSERT(!apitest::helper::transferable::getTextSelection(pXTextDocument->getSelection(), "text/html").isEmpty());
+ CPPUNIT_ASSERT(!apitest::helper::transferable::getTextSelection(pXTextDocument->getSelection(), "text/html"_ostr).isEmpty());
// Now select some shape text and check again.
SdrPage* pPage = pWrtShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
@@ -404,7 +404,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testGetTextSelection)
EditView& rEditView = pView->GetTextEditOutlinerView()->GetEditView();
ESelection aWordSelection(0, 0, 0, 5);
rEditView.SetSelection(aWordSelection);
- CPPUNIT_ASSERT_EQUAL(OString("Shape"), apitest::helper::transferable::getTextSelection(pXTextDocument->getSelection(), "text/plain;charset=utf-8"));
+ CPPUNIT_ASSERT_EQUAL("Shape"_ostr, apitest::helper::transferable::getTextSelection(pXTextDocument->getSelection(), "text/plain;charset=utf-8"_ostr));
}
CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testGetTextSelectionLineLimit)
@@ -420,11 +420,11 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testGetTextSelectionLineLimit)
// Create a selection.
pWrtShell->SelAll();
- OString sPlainText = apitest::helper::transferable::getTextSelection(pXTextDocument->getSelection(), "text/plain;charset=utf-8");
+ OString sPlainText = apitest::helper::transferable::getTextSelection(pXTextDocument->getSelection(), "text/plain;charset=utf-8"_ostr);
CPPUNIT_ASSERT_EQUAL(OString(sOriginalText), sPlainText.trim());
- OString sHtmlText = apitest::helper::transferable::getTextSelection(pXTextDocument->getSelection(), "text/html");
+ OString sHtmlText = apitest::helper::transferable::getTextSelection(pXTextDocument->getSelection(), "text/html"_ostr);
int nStart = sHtmlText.indexOf(u8"Estonian");
@@ -460,11 +460,11 @@ Heading on second page");
// Create a selection.
pWrtShell->SelAll();
- OString sPlainText = apitest::helper::transferable::getTextSelection(pXTextDocument->getSelection(), "text/plain;charset=utf-8");
+ OString sPlainText = apitest::helper::transferable::getTextSelection(pXTextDocument->getSelection(), "text/plain;charset=utf-8"_ostr);
CPPUNIT_ASSERT_EQUAL(OString(sOriginalText), sPlainText.trim());
- OString sHtmlText = apitest::helper::transferable::getTextSelection(pXTextDocument->getSelection(), "text/html");
+ OString sHtmlText = apitest::helper::transferable::getTextSelection(pXTextDocument->getSelection(), "text/html"_ostr);
int nStart = sHtmlText.indexOf(u8"Heading");
@@ -1688,7 +1688,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testGetViewRenderState)
aViewOptions.SetOnlineSpell(true);
pXTextDocument->GetDocShell()->GetWrtShell()->ApplyViewOptions(aViewOptions);
}
- CPPUNIT_ASSERT_EQUAL(OString("PS;Default"), pXTextDocument->getViewRenderState());
+ CPPUNIT_ASSERT_EQUAL("PS;Default"_ostr, pXTextDocument->getViewRenderState());
// Create a second view
SfxLokHelper::createView();
@@ -1701,11 +1701,11 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testGetViewRenderState)
aViewOptions.SetOnlineSpell(true);
pXTextDocument->GetDocShell()->GetWrtShell()->ApplyViewOptions(aViewOptions);
}
- CPPUNIT_ASSERT_EQUAL(OString("S;Default"), pXTextDocument->getViewRenderState());
+ CPPUNIT_ASSERT_EQUAL("S;Default"_ostr, pXTextDocument->getViewRenderState());
// Switch back to the first view, and check that the options string is the same
SfxLokHelper::setView(nFirstViewId);
- CPPUNIT_ASSERT_EQUAL(OString("PS;Default"), pXTextDocument->getViewRenderState());
+ CPPUNIT_ASSERT_EQUAL("PS;Default"_ostr, pXTextDocument->getViewRenderState());
// Switch back to the second view, and change to dark mode
SfxLokHelper::setView(nSecondViewId);
@@ -1720,10 +1720,10 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testGetViewRenderState)
);
comphelper::dispatchCommand(".uno:ChangeTheme", xFrame, aPropertyValues);
}
- CPPUNIT_ASSERT_EQUAL(OString("S;Dark"), pXTextDocument->getViewRenderState());
+ CPPUNIT_ASSERT_EQUAL("S;Dark"_ostr, pXTextDocument->getViewRenderState());
// Switch back to the first view, and check that the options string is the same
SfxLokHelper::setView(nFirstViewId);
- CPPUNIT_ASSERT_EQUAL(OString("PS;Default"), pXTextDocument->getViewRenderState());
+ CPPUNIT_ASSERT_EQUAL("PS;Default"_ostr, pXTextDocument->getViewRenderState());
}
// Helper function to get a tile to a bitmap and check the pixel color
@@ -1984,7 +1984,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testCommentInsert)
// - Expected: 1418, 1418, 0, 0
// - Actual : 1418, 1418, 1024, 1024
// i.e. the anchor position was a non-empty rectangle.
- CPPUNIT_ASSERT_EQUAL(OString("1418, 1418, 0, 0"), aAnchorPos);
+ CPPUNIT_ASSERT_EQUAL("1418, 1418, 0, 0"_ostr, aAnchorPos);
comphelper::LibreOfficeKit::setTiledAnnotations(true);
}
@@ -2417,7 +2417,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testIMESupport)
SwWrtShell* pWrtShell = pView->GetWrtShellPtr();
// sequence of chinese IME compositions when 'nihao' is typed in an IME
- const std::vector<OString> aUtf8Inputs{ "年", "你", "你好", "你哈", "你好", "你好" };
+ const std::vector<OString> aUtf8Inputs{ "年"_ostr, "你"_ostr, "你好"_ostr, "你哈"_ostr, "你好"_ostr, "你好"_ostr };
std::vector<OUString> aInputs;
std::transform(aUtf8Inputs.begin(), aUtf8Inputs.end(),
std::back_inserter(aInputs), [](OString aInput) {
@@ -3193,8 +3193,8 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testHyperlink)
MOUSE_LEFT, 0);
Scheduler::ProcessEventsToIdle();
- CPPUNIT_ASSERT_EQUAL(OString("hyperlink"), m_sHyperlinkText);
- CPPUNIT_ASSERT_EQUAL(OString("http://example.com/"), m_sHyperlinkLink);
+ CPPUNIT_ASSERT_EQUAL("hyperlink"_ostr, m_sHyperlinkText);
+ CPPUNIT_ASSERT_EQUAL("http://example.com/"_ostr, m_sHyperlinkLink);
}
CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testFieldmark)
@@ -3233,13 +3233,13 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDropDownFormFieldButton)
boost::property_tree::read_json(aStream, aTree);
OString sAction( aTree.get_child("action").get_value<std::string>() );
- CPPUNIT_ASSERT_EQUAL(OString("show"), sAction);
+ CPPUNIT_ASSERT_EQUAL("show"_ostr, sAction);
OString sType( aTree.get_child("type").get_value<std::string>() );
- CPPUNIT_ASSERT_EQUAL(OString("drop-down"), sType);
+ CPPUNIT_ASSERT_EQUAL("drop-down"_ostr, sType);
OString sTextArea( aTree.get_child("textArea").get_value<std::string>() );
- CPPUNIT_ASSERT_EQUAL(OString("1538, 1418, 1026, 275"), sTextArea);
+ CPPUNIT_ASSERT_EQUAL("1538, 1418, 1026, 275"_ostr, sTextArea);
boost::property_tree::ptree aItems = aTree.get_child("params").get_child("items");
CPPUNIT_ASSERT_EQUAL(size_t(6), aItems.size());
@@ -3250,13 +3250,13 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDropDownFormFieldButton)
aItemList.append(item.second.get_value<std::string>().c_str()
+ OString::Concat(";"));
}
- CPPUNIT_ASSERT_EQUAL(OString("2019/2020;2020/2021;2021/2022;2022/2023;2023/2024;2024/2025;"), aItemList.toString());
+ CPPUNIT_ASSERT_EQUAL("2019/2020;2020/2021;2021/2022;2022/2023;2023/2024;2024/2025;"_ostr, aItemList.toString());
OString sSelected( aTree.get_child("params").get_child("selected").get_value<std::string>() );
- CPPUNIT_ASSERT_EQUAL(OString("1"), sSelected);
+ CPPUNIT_ASSERT_EQUAL("1"_ostr, sSelected);
OString sPlaceholder( aTree.get_child("params").get_child("placeholderText").get_value<std::string>() );
- CPPUNIT_ASSERT_EQUAL(OString("No Item specified"), sPlaceholder);
+ CPPUNIT_ASSERT_EQUAL("No Item specified"_ostr, sPlaceholder);
}
// Move the cursor back so the button becomes hidden.
@@ -3269,10 +3269,10 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDropDownFormFieldButton)
boost::property_tree::read_json(aStream, aTree);
OString sAction( aTree.get_child("action").get_value<std::string>() );
- CPPUNIT_ASSERT_EQUAL(OString("hide"), sAction);
+ CPPUNIT_ASSERT_EQUAL("hide"_ostr, sAction);
OString sType( aTree.get_child("type").get_value<std::string>() );
- CPPUNIT_ASSERT_EQUAL(OString("drop-down"), sType);
+ CPPUNIT_ASSERT_EQUAL("drop-down"_ostr, sType);
}
}
@@ -3307,7 +3307,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDropDownFormFieldButtonEditing)
boost::property_tree::read_json(aStream, aTree);
OString sSelected( aTree.get_child("params").get_child("selected").get_value<std::string>() );
- CPPUNIT_ASSERT_EQUAL(OString("1"), sSelected);
+ CPPUNIT_ASSERT_EQUAL("1"_ostr, sSelected);
}
m_aFormFieldButton = "";
@@ -3329,7 +3329,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDropDownFormFieldButtonEditing)
boost::property_tree::read_json(aStream, aTree);
OString sSelected( aTree.get_child("params").get_child("selected").get_value<std::string>() );
- CPPUNIT_ASSERT_EQUAL(OString("3"), sSelected);
+ CPPUNIT_ASSERT_EQUAL("3"_ostr, sSelected);
}
}
@@ -3364,7 +3364,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDropDownFormFieldButtonNoSelectio
boost::property_tree::read_json(aStream, aTree);
OString sSelected( aTree.get_child("params").get_child("selected").get_value<std::string>() );
- CPPUNIT_ASSERT_EQUAL(OString("-1"), sSelected);
+ CPPUNIT_ASSERT_EQUAL("-1"_ostr, sSelected);
}
}
@@ -3453,7 +3453,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDropDownFormFieldButtonNoItem)
CPPUNIT_ASSERT_EQUAL(size_t(0), aItems.size());
OString sSelected( aTree.get_child("params").get_child("selected").get_value<std::string>() );
- CPPUNIT_ASSERT_EQUAL(OString("-1"), sSelected);
+ CPPUNIT_ASSERT_EQUAL("-1"_ostr, sSelected);
}
}
@@ -3508,7 +3508,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testTableCommentRemoveCallback)
//check for comment remove callback
OString sAction(aView.m_aComment.get_child("action").get_value<std::string>());
- CPPUNIT_ASSERT_EQUAL(OString("Remove"), sAction);
+ CPPUNIT_ASSERT_EQUAL("Remove"_ostr, sAction);
}
CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testSpellOnlineRenderParameter)
@@ -3730,14 +3730,14 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testRedlinePortions)
// Then make sure that the portion list is updated, so "bar" can be marked as deleted without
// marking " after" as well:
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion[1]", "portion", "foo");
- assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion[2]", "portion", "ins");
+ assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion[1]"_ostr, "portion"_ostr, "foo");
+ assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion[2]"_ostr, "portion"_ostr, "ins");
// Without the accompanying fix in place, this test would have failed width:
// - Expected: bar
// - Actual : bar after
// i.e. the portion list was outdated, even " after" was marked as deleted.
- assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion[3]", "portion", "bar");
- assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion[4]", "portion", " after");
+ assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion[3]"_ostr, "portion"_ostr, "bar");
+ assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion[4]"_ostr, "portion"_ostr, " after");
}
CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testContentControl)
@@ -3770,14 +3770,14 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testContentControl)
boost::property_tree::ptree aTree;
boost::property_tree::read_json(aStream, aTree);
OString sAction( aTree.get_child("action").get_value<std::string>() );
- CPPUNIT_ASSERT_EQUAL(OString("show"), sAction);
+ CPPUNIT_ASSERT_EQUAL("show"_ostr, sAction);
OString sRectangles( aTree.get_child("rectangles").get_value<std::string>() );
CPPUNIT_ASSERT(!sRectangles.isEmpty());
// Without the accompanying fix in place, this test would have failed width:
// uncaught exception of type std::exception (or derived).
// - No such node (alias)
OString sAlias( aTree.get_child("alias").get_value<std::string>() );
- CPPUNIT_ASSERT_EQUAL(OString("my alias"), sAlias);
+ CPPUNIT_ASSERT_EQUAL("my alias"_ostr, sAlias);
}
// And when leaving that content control:
@@ -3788,7 +3788,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testContentControl)
boost::property_tree::ptree aTree;
boost::property_tree::read_json(aStream, aTree);
OString sAction( aTree.get_child("action").get_value<std::string>() );
- CPPUNIT_ASSERT_EQUAL(OString("hide"), sAction);
+ CPPUNIT_ASSERT_EQUAL("hide"_ostr, sAction);
}
CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDropDownContentControl)
@@ -3838,7 +3838,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDropDownContentControl)
boost::property_tree::ptree aTree;
boost::property_tree::read_json(aStream, aTree);
OString sAction( aTree.get_child("action").get_value<std::string>() );
- CPPUNIT_ASSERT_EQUAL(OString("show"), sAction);
+ CPPUNIT_ASSERT_EQUAL("show"_ostr, sAction);
OString sRectangles( aTree.get_child("rectangles").get_value<std::string>() );
CPPUNIT_ASSERT(!sRectangles.isEmpty());
boost::optional<boost::property_tree::ptree&> oItems = aTree.get_child_optional("items");
@@ -3913,7 +3913,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testPictureContentControl)
boost::property_tree::ptree aTree;
boost::property_tree::read_json(aStream, aTree);
OString sAction( aTree.get_child("action").get_value<std::string>() );
- CPPUNIT_ASSERT_EQUAL(OString("change-picture"), sAction);
+ CPPUNIT_ASSERT_EQUAL("change-picture"_ostr, sAction);
// And when replacing the image:
std::map<OUString, OUString> aArguments;
@@ -3965,7 +3965,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDateContentControl)
boost::property_tree::ptree aTree;
boost::property_tree::read_json(aStream, aTree);
OString sAction( aTree.get_child("action").get_value<std::string>() );
- CPPUNIT_ASSERT_EQUAL(OString("show"), sAction);
+ CPPUNIT_ASSERT_EQUAL("show"_ostr, sAction);
OString sRectangles( aTree.get_child("rectangles").get_value<std::string>() );
CPPUNIT_ASSERT(!sRectangles.isEmpty());
boost::optional<boost::property_tree::ptree&> oDate = aTree.get_child_optional("date");
@@ -4023,7 +4023,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testAuthorField)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion[1]/SwLineLayout[1]/SwFieldPortion[1]", "expand", sAuthor);
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion[1]/SwLineLayout[1]/SwFieldPortion[1]"_ostr, "expand"_ostr, sAuthor);
}
CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testSavedAuthorField)
@@ -4039,7 +4039,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testSavedAuthorField)
Scheduler::ProcessEventsToIdle();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion[1]/SwLineLayout[1]/SwFieldPortion[1]", "expand", sAuthor);
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion[1]/SwLineLayout[1]/SwFieldPortion[1]"_ostr, "expand"_ostr, sAuthor);
}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/txtexport/txtexport.cxx b/sw/qa/extras/txtexport/txtexport.cxx
index 673e29ef62df..3d3154f34c91 100644
--- a/sw/qa/extras/txtexport/txtexport.cxx
+++ b/sw/qa/extras/txtexport/txtexport.cxx
@@ -82,7 +82,7 @@ DECLARE_TXTEXPORT_TEST(testTdf120574_utf8bom, "UTF8BOMCRLF.txt")
{
std::vector<char> aMemStream = readMemoryStream<char>();
OString aData(std::string_view(aMemStream.data(), aMemStream.size()));
- CPPUNIT_ASSERT_EQUAL(OString(u8"\uFEFFフー\r\nバー\r\n"), aData);
+ CPPUNIT_ASSERT_EQUAL(u8"\uFEFFフー\r\nバー\r\n"_ostr, aData);
}
DECLARE_TXTEXPORT_TEST(testTdf120574_utf16lebom, "UTF16LEBOMCRLF.txt")
@@ -96,7 +96,7 @@ DECLARE_TXTEXPORT_TEST(testTdf142669_utf8, "UTF8CRLF.txt")
{
std::vector<char> aMemStream = readMemoryStream<char>();
OString aData(std::string_view(aMemStream.data(), aMemStream.size()));
- CPPUNIT_ASSERT_EQUAL(OString(u8"フー\r\nバー\r\n"), aData);
+ CPPUNIT_ASSERT_EQUAL(u8"フー\r\nバー\r\n"_ostr, aData);
}
DECLARE_TXTEXPORT_TEST(testTdf142669_utf16le, "UTF16LECRLF.txt")
@@ -136,7 +136,7 @@ CPPUNIT_TEST_FIXTURE(TxtExportTest, testClearingBreakExport)
// - Expected: foo\nbar
// - Actual : foobar
// i.e. the clearing break was not downgraded to a plain line break.
- CPPUNIT_ASSERT_EQUAL(OString("foo\nbar" SAL_NEWLINE_STRING), aActual);
+ CPPUNIT_ASSERT_EQUAL("foo\nbar" SAL_NEWLINE_STRING ""_ostr, aActual);
}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/txtimport/txtimport.cxx b/sw/qa/extras/txtimport/txtimport.cxx
index 87bf86274b53..bf9c45de2d35 100644
--- a/sw/qa/extras/txtimport/txtimport.cxx
+++ b/sw/qa/extras/txtimport/txtimport.cxx
@@ -62,7 +62,7 @@ CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf112191)
bool bSuccess = sw::XTextRangeToSwPaM(aPaM, xPara);
CPPUNIT_ASSERT(bSuccess);
- assertExportedRange("First bullet", aPaM);
+ assertExportedRange("First bullet"_ostr, aPaM);
// but when we extend to the next paragraph - now there are bullets
xPara = getParagraph(6);
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 37aa15838773..a58853ec7a65 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -749,7 +749,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testImportRTF)
pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 3, /*bBasicCall=*/false);
// Insert the RTF at the cursor position.
- OString aData = "{\\rtf1 Hello world!\\par}";
+ OString aData = "{\\rtf1 Hello world!\\par}"_ostr;
SvMemoryStream aStream(const_cast<char*>(aData.getStr()), aData.getLength(), StreamMode::READ);
SwReader aReader(aStream, OUString(), OUString(), *pWrtShell->GetCursor());
Reader* pRTFReader = SwReaderWriter::GetRtfReader();
@@ -1589,10 +1589,10 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testFdo87448)
// The first polyline in the document has a number of points to draw arcs,
// the last one jumps back to the start, so we call "end" the last but one.
- sal_Int32 nFirstEnd = getXPath(pXmlDoc, "(//polyline)[1]/point[last()-1]", "x").toInt32();
+ sal_Int32 nFirstEnd = getXPath(pXmlDoc, "(//polyline)[1]/point[last()-1]"_ostr, "x"_ostr).toInt32();
// The second polyline has a different start point, but the arc it draws
// should end at the ~same position as the first polyline.
- sal_Int32 nSecondEnd = getXPath(pXmlDoc, "(//polyline)[2]/point[last()]", "x").toInt32();
+ sal_Int32 nSecondEnd = getXPath(pXmlDoc, "(//polyline)[2]/point[last()]"_ostr, "x"_ostr).toInt32();
// nFirstEnd was 6023 and nSecondEnd was 6648, now they should be much closer, e.g. nFirstEnd = 6550, nSecondEnd = 6548
OString aMsg = "nFirstEnd is " + OString::number(nFirstEnd) + ", nSecondEnd is " + OString::number(nSecondEnd);
@@ -1652,7 +1652,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testCp1000115)
// This was 1: the long paragraph in the B1 cell did flow over to the
// second page, so there was only one paragraph in the second cell of the
// second page.
- assertXPath(pXmlDoc, "/root/page[2]/body/tab/row/cell[2]/txt", 2);
+ assertXPath(pXmlDoc, "/root/page[2]/body/tab/row/cell[2]/txt"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf63214)
@@ -1690,7 +1690,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf90003)
CPPUNIT_ASSERT(pXmlDoc);
// This was 1: an unexpected fly portion was created, resulting in too
// large x position for the empty paragraph marker.
- assertXPath(pXmlDoc, "//SwFixPortion[@type='PortionType::Fly']", 0);
+ assertXPath(pXmlDoc, "//SwFixPortion[@type='PortionType::Fly']"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf51741)
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx
index a32890dffcf0..af519544877e 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -102,18 +102,20 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdfChangeNumberingListAutoFormat)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// Check that we actually test the line we need
- assertXPathContent(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]", "GHI GHI GHI GHI");
- assertXPath(pXmlDoc,
- "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion",
- "type", "PortionType::Number");
- assertXPath(pXmlDoc,
- "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion",
- "expand", "2.");
+ assertXPathContent(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]"_ostr, "GHI GHI GHI GHI");
+ assertXPath(
+ pXmlDoc,
+ "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr,
+ "type"_ostr, "PortionType::Number");
+ assertXPath(
+ pXmlDoc,
+ "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr,
+ "expand"_ostr, "2.");
// The numbering height was 960 in DOC format.
assertXPath(
pXmlDoc,
- "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont",
- "height", "220");
+ "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont"_ostr,
+ "height"_ostr, "220");
// tdf#127606: now it's possible to change formatting of numbering
// increase font size (220 -> 260)
@@ -124,8 +126,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdfChangeNumberingListAutoFormat)
pXmlDoc = parseLayoutDump();
assertXPath(
pXmlDoc,
- "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont",
- "height", "260");
+ "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont"_ostr,
+ "height"_ostr, "260");
// save it to DOCX
saveAndReload("Office Open XML Text");
@@ -138,8 +140,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdfChangeNumberingListAutoFormat)
// this was 220
assertXPath(
pXmlDoc,
- "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont",
- "height", "260");
+ "/root/page/body/tab/row/cell/txt[3]/SwParaPortion/SwLineLayout/SwFieldPortion/SwFont"_ostr,
+ "height"_ostr, "260");
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf101534)
@@ -346,56 +348,58 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf137318)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt", 3);
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion", 0);
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion", 0);
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 3);
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion"_ostr, 0);
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion"_ostr, 0);
// not sure why there's an empty text portion here, but it's not a problem
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwParaPortion", 1);
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwParaPortion",
- "type", "PortionType::Para");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwParaPortion",
- "portion", "");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "type"_ostr, "PortionType::Para");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "portion"_ostr, "");
pWrtShell->Undo();
// the problem was that here the "A" showed up again
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt", 2);
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion", 0);
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion", 1);
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion",
- "type", "PortionType::Para");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion",
- "portion", "");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 2);
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion"_ostr, 0);
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion"_ostr, 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "type"_ostr, "PortionType::Para");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "portion"_ostr, "");
pWrtShell->Undo();
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt", 1);
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion", 1);
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion",
- "type", "PortionType::Para");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion",
- "portion", "");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion"_ostr, 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "type"_ostr, "PortionType::Para");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "portion"_ostr, "");
pWrtShell->Undo();
// now the "A" is no longer deleted
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt", 1);
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion", 1);
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion",
- "type", "PortionType::Para");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion"_ostr, 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "type"_ostr, "PortionType::Para");
assertXPath(pXmlDoc,
- "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[@portion]", 1);
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion",
- "length", "1");
+ "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[@portion]"_ostr,
+ 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "length"_ostr, "1");
- assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion",
- "portion", "A");
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion"_ostr,
+ "portion"_ostr, "A");
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf136704)
@@ -683,9 +687,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf136453)
// check that every node has 1 frame
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt", 3);
- assertXPath(pXmlDoc, "/root/page[1]/body/section", 1);
- assertXPath(pXmlDoc, "/root/page[1]/body/section/txt", 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 3);
+ assertXPath(pXmlDoc, "/root/page[1]/body/section"_ostr, 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/section/txt"_ostr, 1);
pWrtShell->Redo();
@@ -694,8 +698,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf136453)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt", 3);
- assertXPath(pXmlDoc, "/root/page[1]/body/section", 0);
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 3);
+ assertXPath(pXmlDoc, "/root/page[1]/body/section"_ostr, 0);
pWrtShell->Undo();
@@ -703,9 +707,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf136453)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/txt", 3);
- assertXPath(pXmlDoc, "/root/page[1]/body/section", 1);
- assertXPath(pXmlDoc, "/root/page[1]/body/section/txt", 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 3);
+ assertXPath(pXmlDoc, "/root/page[1]/body/section"_ostr, 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/section/txt"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf137245)
@@ -805,9 +809,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf132236)
// check that the text frames exist inside their sections
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt", 1);
- assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt", 2);
- assertXPath(pXmlDoc, "/root/page[1]/body/txt", 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt"_ostr, 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt"_ostr, 2);
+ assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf131912)
@@ -1812,7 +1816,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf147310)
{
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page/body/tab", 0);
+ assertXPath(pXmlDoc, "/root/page/body/tab"_ostr, 0);
discardDumpedLayout();
}
pWrtShell->Undo();
@@ -1821,14 +1825,14 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf147310)
{
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// there are 2 tables
- assertXPath(pXmlDoc, "/root/page/body/tab", 2);
+ assertXPath(pXmlDoc, "/root/page/body/tab"_ostr, 2);
discardDumpedLayout();
}
pWrtShell->Redo();
pWrtShell->Redo();
{
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page/body/tab", 0);
+ assertXPath(pXmlDoc, "/root/page/body/tab"_ostr, 0);
discardDumpedLayout();
}
pWrtShell->Undo();
@@ -1836,7 +1840,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf147310)
{
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// there are 2 tables
- assertXPath(pXmlDoc, "/root/page/body/tab", 2);
+ assertXPath(pXmlDoc, "/root/page/body/tab"_ostr, 2);
}
}
@@ -2446,9 +2450,10 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf123102)
dispatchCommand(mxComponent, ".uno:InsertRowsAfter", {});
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// This was "3." - caused by the hidden numbered paragraph of the new merged cell
- assertXPath(pXmlDoc,
- "/root/page/body/tab/row[6]/cell[1]/txt/SwParaPortion/SwLineLayout/SwFieldPortion",
- "expand", "2.");
+ assertXPath(
+ pXmlDoc,
+ "/root/page/body/tab/row[6]/cell[1]/txt/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr,
+ "expand"_ostr, "2.");
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testUnfloatButtonSmallTable)
@@ -2947,11 +2952,11 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf137771)
CPPUNIT_ASSERT(pXmlDoc);
// This would be 5 without the new vertical redline mark
- assertXPath(pXmlDoc, "/metafile/push/push/push/line", 6);
+ assertXPath(pXmlDoc, "/metafile/push/push/push/line"_ostr, 6);
// This was the content of the next <text> (missing deletion on margin)
// or only the first character of the deleted character sequence
- assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[9]/text", " saved.");
+ assertXPathContent(pXmlDoc, "/metafile/push/push/push/textarray[9]/text"_ostr, " saved.");
// this would crash due to bad redline range
for (int i = 0; i < 6; ++i)
@@ -2989,12 +2994,12 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf142130)
// This was 6 (bad crossing out of the first, not deleted image)
// (4 lines = 2 lines for crossing out of the second image + 2 lines =
// vertical "changed line" indicator before the two paragraph lines)
- assertXPath(pXmlDoc, "/metafile/push/push/push/line", 4);
+ assertXPath(pXmlDoc, "/metafile/push/push/push/line"_ostr, 4);
// check line color
- assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/linecolor", 5);
+ assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/linecolor"_ostr, 5);
// tdf#142128 This was 3 (NON_PRINTING_CHARACTER_COLOR = #268bd2)
- assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/linecolor[@color='#268bd2']", 0);
+ assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/linecolor[@color='#268bd2']"_ostr, 0);
// reject deletion of the second image
IDocumentRedlineAccess& rIDRA(pDoc->getIDocumentRedlineAccess());
@@ -3003,7 +3008,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf142130)
xMetaFile = pShell->GetPreviewMetaFile();
xmlDocUniquePtr pXmlDoc2 = dumpAndParse(dumper, *xMetaFile);
// no crossing out and vertical redlines
- assertXPath(pXmlDoc2, "/metafile/push/push/push/line", 0);
+ assertXPath(pXmlDoc2, "/metafile/push/push/push/line"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf142196)
@@ -3031,14 +3036,16 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf142196)
// This was 1 (missing crossing out of the deleted image)
// (2 lines = crossing out of the deleted image + 1 line for the
// vertical "changed line" indicator before the paragraph line)
- assertXPath(pXmlDoc, "//line", 3);
+ assertXPath(pXmlDoc, "//line"_ostr, 3);
// check line color
- assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/linecolor", 1);
+ assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/linecolor"_ostr,
+ 1);
// tdf#142128 This was NON_PRINTING_CHARACTER_COLOR (#268bd2)
assertXPath(
pXmlDoc,
- "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/linecolor[@color='#268bd2']", 0);
+ "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/linecolor[@color='#268bd2']"_ostr,
+ 0);
// reject deletion of the image
IDocumentRedlineAccess& rIDRA(pDoc->getIDocumentRedlineAccess());
@@ -3048,7 +3055,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf142196)
xmlDocUniquePtr pXmlDoc2 = dumpAndParse(dumper, *xMetaFile);
// no crossing out and vertical "changed line" indicator
- assertXPath(pXmlDoc2, "//line", 0);
+ assertXPath(pXmlDoc2, "//line"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf142700)
@@ -3075,14 +3082,16 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf142700)
// (2 lines = crossing out of the deleted image + 1 line for the
// vertical "changed line" indicator before the paragraph line)
- assertXPath(pXmlDoc, "//line", 3);
+ assertXPath(pXmlDoc, "//line"_ostr, 3);
// check line color
- assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/linecolor", 1);
+ assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/linecolor"_ostr,
+ 1);
// tdf#142128 This was NON_PRINTING_CHARACTER_COLOR (#268bd2)
assertXPath(
pXmlDoc,
- "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/linecolor[@color='#268bd2']", 0);
+ "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/linecolor[@color='#268bd2']"_ostr,
+ 0);
// reject deletion of the image
IDocumentRedlineAccess& rIDRA(pDoc->getIDocumentRedlineAccess());
@@ -3093,7 +3102,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf142700)
// no crossing out and vertical "changed line" indicator
// This was 2 (not removed strikethrough)
- assertXPath(pXmlDoc2, "//line", 0);
+ assertXPath(pXmlDoc2, "//line"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf139120)
@@ -3142,7 +3151,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf139120)
CPPUNIT_ASSERT(pXmlDoc);
// This was the 3, containing the text "$2" instead of nothing
- assertXPath(pXmlDoc, "/metafile/push/push/push/textarray", 2);
+ assertXPath(pXmlDoc, "/metafile/push/push/push/textarray"_ostr, 2);
// switch off "Show changes in margin" mode
dispatchCommand(mxComponent, ".uno:ShowChangesInMargin", {});
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index d62a46aa3671..3027c65855ed 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -356,80 +356,90 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testVariableFieldTableRowSplitHeader)
// the fields in cell are: variable-get variable-set variable-get
assertXPath(
pXmlDoc,
- "/root/page[1]/body/tab/row[1]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion",
+ "/root/page[1]/body/tab/row[1]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr,
3);
assertXPath(
pXmlDoc,
- "/root/page[1]/body/tab/row[1]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "0");
+ "/root/page[1]/body/tab/row[1]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "0");
assertXPath(
pXmlDoc,
- "/root/page[1]/body/tab/row[1]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]",
- "expand", "1");
+ "/root/page[1]/body/tab/row[1]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr,
+ "expand"_ostr, "1");
assertXPath(
pXmlDoc,
- "/root/page[1]/body/tab/row[1]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[3]",
- "expand", "1");
- assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "0");
- assertXPath(pXmlDoc, "/root/page[1]/footer/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "1");
+ "/root/page[1]/body/tab/row[1]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[3]"_ostr,
+ "expand"_ostr, "1");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "0");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/footer/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "1");
// here the header had shown the wrong value
assertXPath(
pXmlDoc,
- "/root/page[2]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "1");
+ "/root/page[2]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "1");
assertXPath(
pXmlDoc,
- "/root/page[2]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]",
- "expand", "2");
+ "/root/page[2]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr,
+ "expand"_ostr, "2");
assertXPath(
pXmlDoc,
- "/root/page[2]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[3]",
- "expand", "2");
- assertXPath(pXmlDoc, "/root/page[2]/header/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "1");
- assertXPath(pXmlDoc, "/root/page[2]/footer/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "2");
+ "/root/page[2]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[3]"_ostr,
+ "expand"_ostr, "2");
+ assertXPath(pXmlDoc,
+ "/root/page[2]/header/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "1");
+ assertXPath(pXmlDoc,
+ "/root/page[2]/footer/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "2");
assertXPath(
pXmlDoc,
- "/root/page[3]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "2");
+ "/root/page[3]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "2");
assertXPath(
pXmlDoc,
- "/root/page[3]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]",
- "expand", "3");
+ "/root/page[3]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr,
+ "expand"_ostr, "3");
assertXPath(
pXmlDoc,
- "/root/page[3]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[3]",
- "expand", "3");
- assertXPath(pXmlDoc, "/root/page[3]/header/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "2");
- assertXPath(pXmlDoc, "/root/page[3]/footer/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "3");
+ "/root/page[3]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[3]"_ostr,
+ "expand"_ostr, "3");
+ assertXPath(pXmlDoc,
+ "/root/page[3]/header/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "2");
+ assertXPath(pXmlDoc,
+ "/root/page[3]/footer/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "3");
assertXPath(
pXmlDoc,
- "/root/page[4]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "3");
+ "/root/page[4]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "3");
assertXPath(
pXmlDoc,
- "/root/page[4]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]",
- "expand", "4");
+ "/root/page[4]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr,
+ "expand"_ostr, "4");
assertXPath(
pXmlDoc,
- "/root/page[4]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[3]",
- "expand", "4");
- assertXPath(pXmlDoc, "/root/page[4]/header/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "3");
- assertXPath(pXmlDoc, "/root/page[4]/footer/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "4");
-
- assertXPath(pXmlDoc, "/root/page[5]/header/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "4");
- assertXPath(pXmlDoc, "/root/page[5]/footer/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "4");
+ "/root/page[4]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[3]"_ostr,
+ "expand"_ostr, "4");
+ assertXPath(pXmlDoc,
+ "/root/page[4]/header/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "3");
+ assertXPath(pXmlDoc,
+ "/root/page[4]/footer/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "4");
+
+ assertXPath(pXmlDoc,
+ "/root/page[5]/header/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "4");
+ assertXPath(pXmlDoc,
+ "/root/page[5]/footer/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "4");
discardDumpedLayout();
// update and check again
@@ -440,80 +450,90 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testVariableFieldTableRowSplitHeader)
// the fields in cell are: variable-get variable-set variable-get
assertXPath(
pXmlDoc,
- "/root/page[1]/body/tab/row[1]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion",
+ "/root/page[1]/body/tab/row[1]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr,
3);
assertXPath(
pXmlDoc,
- "/root/page[1]/body/tab/row[1]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "0");
+ "/root/page[1]/body/tab/row[1]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "0");
assertXPath(
pXmlDoc,
- "/root/page[1]/body/tab/row[1]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]",
- "expand", "1");
+ "/root/page[1]/body/tab/row[1]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr,
+ "expand"_ostr, "1");
assertXPath(
pXmlDoc,
- "/root/page[1]/body/tab/row[1]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[3]",
- "expand", "1");
- assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "0");
- assertXPath(pXmlDoc, "/root/page[1]/footer/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "1");
+ "/root/page[1]/body/tab/row[1]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[3]"_ostr,
+ "expand"_ostr, "1");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/header/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "0");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/footer/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "1");
// here the header had shown the wrong value
assertXPath(
pXmlDoc,
- "/root/page[2]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "1");
+ "/root/page[2]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "1");
assertXPath(
pXmlDoc,
- "/root/page[2]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]",
- "expand", "2");
+ "/root/page[2]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr,
+ "expand"_ostr, "2");
assertXPath(
pXmlDoc,
- "/root/page[2]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[3]",
- "expand", "2");
- assertXPath(pXmlDoc, "/root/page[2]/header/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "1");
- assertXPath(pXmlDoc, "/root/page[2]/footer/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "2");
+ "/root/page[2]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[3]"_ostr,
+ "expand"_ostr, "2");
+ assertXPath(pXmlDoc,
+ "/root/page[2]/header/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "1");
+ assertXPath(pXmlDoc,
+ "/root/page[2]/footer/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "2");
assertXPath(
pXmlDoc,
- "/root/page[3]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "2");
+ "/root/page[3]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "2");
assertXPath(
pXmlDoc,
- "/root/page[3]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]",
- "expand", "3");
+ "/root/page[3]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr,
+ "expand"_ostr, "3");
assertXPath(
pXmlDoc,
- "/root/page[3]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[3]",
- "expand", "3");
- assertXPath(pXmlDoc, "/root/page[3]/header/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "2");
- assertXPath(pXmlDoc, "/root/page[3]/footer/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "3");
+ "/root/page[3]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[3]"_ostr,
+ "expand"_ostr, "3");
+ assertXPath(pXmlDoc,
+ "/root/page[3]/header/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "2");
+ assertXPath(pXmlDoc,
+ "/root/page[3]/footer/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "3");
assertXPath(
pXmlDoc,
- "/root/page[4]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "3");
+ "/root/page[4]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "3");
assertXPath(
pXmlDoc,
- "/root/page[4]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]",
- "expand", "4");
+ "/root/page[4]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr,
+ "expand"_ostr, "4");
assertXPath(
pXmlDoc,
- "/root/page[4]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[3]",
- "expand", "4");
- assertXPath(pXmlDoc, "/root/page[4]/header/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "3");
- assertXPath(pXmlDoc, "/root/page[4]/footer/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "4");
-
- assertXPath(pXmlDoc, "/root/page[5]/header/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "4");
- assertXPath(pXmlDoc, "/root/page[5]/footer/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]",
- "expand", "4");
+ "/root/page[4]/body/tab/row[2]/cell[2]/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[3]"_ostr,
+ "expand"_ostr, "4");
+ assertXPath(pXmlDoc,
+ "/root/page[4]/header/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "3");
+ assertXPath(pXmlDoc,
+ "/root/page[4]/footer/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "4");
+
+ assertXPath(pXmlDoc,
+ "/root/page[5]/header/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "4");
+ assertXPath(pXmlDoc,
+ "/root/page[5]/footer/txt[1]/SwParaPortion/SwLineLayout/SwFieldPortion[1]"_ostr,
+ "expand"_ostr, "4");
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf147126)
@@ -530,29 +550,29 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf147126)
const auto nFlyLeft = getXPath(pLayoutXML1,
"/root/page/body/txt[2]/anchored/fly["
+ OString::number(nFly) + "]/infos/bounds",
- "left")
+ "left"_ostr)
.toInt64();
const auto nFlyRight = getXPath(pLayoutXML1,
"/root/page/body/txt[2]/anchored/fly["
+ OString::number(nFly) + "]/infos/bounds",
- "width")
+ "width"_ostr)
.toInt64();
const auto nFlyTop = getXPath(pLayoutXML1,
"/root/page/body/txt[2]/anchored/fly[" + OString::number(nFly)
+ "]/infos/bounds",
- "top")
+ "top"_ostr)
.toInt64();
const auto nFlyBottom = getXPath(pLayoutXML1,
"/root/page/body/txt[2]/anchored/fly["
+ OString::number(nFly) + "]/infos/bounds",
- "height")
+ "height"_ostr)
.toInt64();
const auto sDrawRect = getXPath(
pLayoutXML1,
"/root/page/body/txt[2]/anchored/SwAnchoredDrawObject/SdrObjGroup/SdrObjList/SdrObject["
+ OString::number(nFly) + "]",
- "aOutRect");
+ "aOutRect"_ostr);
const auto nComaPos1 = sDrawRect.indexOf(',', 0);
const auto nComaPos2 = sDrawRect.indexOf(',', nComaPos1 + 1);
@@ -589,29 +609,29 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf147126)
const auto nFlyLeft = getXPath(pLayoutXML2,
"/root/page/body/txt[6]/anchored/fly["
+ OString::number(nFly) + "]/infos/bounds",
- "left")
+ "left"_ostr)
.toInt64();
const auto nFlyRight = getXPath(pLayoutXML2,
"/root/page/body/txt[6]/anchored/fly["
+ OString::number(nFly) + "]/infos/bounds",
- "width")
+ "width"_ostr)
.toInt64();
const auto nFlyTop = getXPath(pLayoutXML2,
"/root/page/body/txt[6]/anchored/fly[" + OString::number(nFly)
+ "]/infos/bounds",
- "top")
+ "top"_ostr)
.toInt64();
const auto nFlyBottom = getXPath(pLayoutXML2,
"/root/page/body/txt[6]/anchored/fly["
+ OString::number(nFly) + "]/infos/bounds",
- "height")
+ "height"_ostr)
.toInt64();
const auto sDrawRect = getXPath(
pLayoutXML2,
"/root/page/body/txt[6]/anchored/SwAnchoredDrawObject/SdrObjGroup/SdrObjList/SdrObject["
+ OString::number(nFly) + "]",
- "aOutRect");
+ "aOutRect"_ostr);
const auto nComaPos1 = sDrawRect.indexOf(',', 0);
const auto nComaPos2 = sDrawRect.indexOf(',', nComaPos1 + 1);
@@ -1865,30 +1885,35 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, TestAsCharTextBox)
// Check if the texbox fallen apart due to the tabs
const double nLeftSideOfShape1
- = getXPath(pExportDump, "/root/page/body/txt/anchored/SwAnchoredDrawObject/bounds", "left")
+ = getXPath(pExportDump, "/root/page/body/txt/anchored/SwAnchoredDrawObject/bounds"_ostr,
+ "left"_ostr)
.toDouble();
const double nLeftSideOfTxBx1
- = getXPath(pExportDump, "/root/page/body/txt/anchored/fly/infos/bounds", "left").toDouble();
+ = getXPath(pExportDump, "/root/page/body/txt/anchored/fly/infos/bounds"_ostr, "left"_ostr)
+ .toDouble();
CPPUNIT_ASSERT(nLeftSideOfShape1 < nLeftSideOfTxBx1);
// Another test is for the tdf#138598: Check footer textbox
const double nLeftSideOfShape2
- = getXPath(pExportDump, "/root/page[2]/footer/txt/anchored/SwAnchoredDrawObject/bounds",
- "left")
+ = getXPath(pExportDump,
+ "/root/page[2]/footer/txt/anchored/SwAnchoredDrawObject/bounds"_ostr,
+ "left"_ostr)
.toDouble();
const double nLeftSideOfTxBx2
- = getXPath(pExportDump, "/root/page[2]/footer/txt/anchored/fly/infos/bounds", "left")
+ = getXPath(pExportDump, "/root/page[2]/footer/txt/anchored/fly/infos/bounds"_ostr,
+ "left"_ostr)
.toDouble();
CPPUNIT_ASSERT(nLeftSideOfShape2 < nLeftSideOfTxBx2);
const double nTopSideOfShape2
- = getXPath(pExportDump, "/root/page[2]/footer/txt/anchored/SwAnchoredDrawObject/bounds",
- "top")
+ = getXPath(pExportDump,
+ "/root/page[2]/footer/txt/anchored/SwAnchoredDrawObject/bounds"_ostr, "top"_ostr)
.toDouble();
const double nTopSideOfTxBx2
- = getXPath(pExportDump, "/root/page[2]/footer/txt/anchored/fly/infos/bounds", "top")
+ = getXPath(pExportDump, "/root/page[2]/footer/txt/anchored/fly/infos/bounds"_ostr,
+ "top"_ostr)
.toDouble();
CPPUNIT_ASSERT(nTopSideOfShape2 < nTopSideOfTxBx2);
@@ -1948,11 +1973,11 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf140975)
CPPUNIT_ASSERT(pExportDump);
const sal_Int32 nShpTop
- = getXPath(pExportDump, "/root/page/body/txt[4]/anchored/SwAnchoredDrawObject/bounds",
- "top")
+ = getXPath(pExportDump, "/root/page/body/txt[4]/anchored/SwAnchoredDrawObject/bounds"_ostr,
+ "top"_ostr)
.toInt32();
const sal_Int32 nFrmTop
- = getXPath(pExportDump, "/root/page/body/txt[4]/anchored/fly/infos/bounds", "top")
+ = getXPath(pExportDump, "/root/page/body/txt[4]/anchored/fly/infos/bounds"_ostr, "top"_ostr)
.toInt32();
// Without the fix in place, the frame has less value for Top than
diff --git a/sw/qa/extras/uiwriter/uiwriter4.cxx b/sw/qa/extras/uiwriter/uiwriter4.cxx
index 2865378fa998..58b4e020ae21 100644
--- a/sw/qa/extras/uiwriter/uiwriter4.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter4.cxx
@@ -513,7 +513,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf96536)
pWrtShell->InsertPageBreak();
pWrtShell->SttEndDoc(/*bStt=*/true);
calcLayout();
- sal_Int32 nSingleParaPageHeight = parseDump("/root/page[1]/infos/bounds", "height").toInt32();
+ sal_Int32 nSingleParaPageHeight
+ = parseDump("/root/page[1]/infos/bounds"_ostr, "height"_ostr).toInt32();
discardDumpedLayout();
// Insert a 2nd paragraph at the end of the first page, so the page height grows at least twice...
@@ -523,7 +524,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf96536)
const uno::Reference<text::XTextRange> xInsertPos = getRun(getParagraph(1), 1);
xParagraphAppend->finishParagraphInsert(uno::Sequence<beans::PropertyValue>(), xInsertPos);
calcLayout();
- CPPUNIT_ASSERT(parseDump("/root/page[1]/infos/bounds", "height").toInt32()
+ CPPUNIT_ASSERT(parseDump("/root/page[1]/infos/bounds"_ostr, "height"_ostr).toInt32()
>= 2 * nSingleParaPageHeight);
discardDumpedLayout();
@@ -532,7 +533,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf96536)
xParagraph->dispose();
calcLayout();
CPPUNIT_ASSERT_EQUAL(nSingleParaPageHeight,
- parseDump("/root/page[1]/infos/bounds", "height").toInt32());
+ parseDump("/root/page[1]/infos/bounds"_ostr, "height"_ostr).toInt32());
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf96479)
@@ -930,8 +931,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf96961)
calcLayout();
// Assert that the height of the last page is larger than the height of other pages.
- sal_Int32 nOther = parseDump("/root/page[1]/infos/bounds", "height").toInt32();
- sal_Int32 nLast = parseDump("/root/page[2]/infos/bounds", "height").toInt32();
+ sal_Int32 nOther = parseDump("/root/page[1]/infos/bounds"_ostr, "height"_ostr).toInt32();
+ sal_Int32 nLast = parseDump("/root/page[2]/infos/bounds"_ostr, "height"_ostr).toInt32();
CPPUNIT_ASSERT(nLast > nOther);
}
@@ -942,7 +943,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf88453)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// This was 0: the table does not fit the first page, but it wasn't split
// to continue on the second page.
- assertXPath(pXmlDoc, "/root/page[2]/body/tab", 1);
+ assertXPath(pXmlDoc, "/root/page[2]/body/tab"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf88453Table)
@@ -1018,22 +1019,25 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf98987)
createSwDoc("tdf98987.docx");
calcLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[2]/SdrObject", "name",
- "Rectangle 1");
+ assertXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[2]/SdrObject"_ostr,
+ "name"_ostr, "Rectangle 1");
sal_Int32 nRectangle1
- = getXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[2]/bounds", "top")
+ = getXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[2]/bounds"_ostr,
+ "top"_ostr)
.toInt32();
- assertXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[1]/SdrObject", "name",
- "Rectangle 2");
+ assertXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[1]/SdrObject"_ostr,
+ "name"_ostr, "Rectangle 2");
sal_Int32 nRectangle2
- = getXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[1]/bounds", "top")
+ = getXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[1]/bounds"_ostr,
+ "top"_ostr)
.toInt32();
CPPUNIT_ASSERT_GREATER(nRectangle1, nRectangle2);
- assertXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[3]/SdrObject", "name",
- "Rectangle 3");
+ assertXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[3]/SdrObject"_ostr,
+ "name"_ostr, "Rectangle 3");
sal_Int32 nRectangle3
- = getXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[3]/bounds", "top")
+ = getXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[3]/bounds"_ostr,
+ "top"_ostr)
.toInt32();
// This failed: the 3rd rectangle had a smaller "top" value than the 2nd one, it even overlapped with the 1st one.
CPPUNIT_ASSERT_GREATER(nRectangle2, nRectangle3);
@@ -1045,15 +1049,18 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf99004)
calcLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
sal_Int32 nTextbox1Top
- = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds", "top").toInt32();
+ = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds"_ostr, "top"_ostr)
+ .toInt32();
sal_Int32 nTextBox1Height
- = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds", "height").toInt32();
+ = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds"_ostr, "height"_ostr)
+ .toInt32();
sal_Int32 nTextBox1Bottom = nTextbox1Top + nTextBox1Height;
- assertXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[1]/SdrObject", "name",
- "Rectangle 2");
+ assertXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[1]/SdrObject"_ostr,
+ "name"_ostr, "Rectangle 2");
sal_Int32 nRectangle2Top
- = getXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[1]/bounds", "top")
+ = getXPath(pXmlDoc, "/root/page/body/txt/anchored/SwAnchoredDrawObject[1]/bounds"_ostr,
+ "top"_ostr)
.toInt32();
// This was 3291 and 2531, should be now around 2472 and 2531, i.e. the two rectangles should not overlap anymore.
CPPUNIT_ASSERT(nTextBox1Bottom < nRectangle2Top);
@@ -1603,7 +1610,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf104440)
// This was 0: both Text Frames in the document were anchored to a
// paragraph on page 1, while we expect that the second Text Frame is
// anchored to a paragraph on page 2.
- assertXPath(pXmlDoc, "//page[2]/body/txt/anchored");
+ assertXPath(pXmlDoc, "//page[2]/body/txt/anchored"_ostr);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf104425)
@@ -1613,13 +1620,13 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf104425)
// The document contains one top-level 1-cell table with minimum row height set to 70 cm,
// and the cell contents does not exceed the minimum row height.
// It should span over 3 pages.
- assertXPath(pXmlDoc, "//page", 3);
+ assertXPath(pXmlDoc, "//page"_ostr, 3);
sal_Int32 nHeight1
- = getXPath(pXmlDoc, "//page[1]/body/tab/row/infos/bounds", "height").toInt32();
+ = getXPath(pXmlDoc, "//page[1]/body/tab/row/infos/bounds"_ostr, "height"_ostr).toInt32();
sal_Int32 nHeight2
- = getXPath(pXmlDoc, "//page[2]/body/tab/row/infos/bounds", "height").toInt32();
+ = getXPath(pXmlDoc, "//page[2]/body/tab/row/infos/bounds"_ostr, "height"_ostr).toInt32();
sal_Int32 nHeight3
- = getXPath(pXmlDoc, "//page[3]/body/tab/row/infos/bounds", "height").toInt32();
+ = getXPath(pXmlDoc, "//page[3]/body/tab/row/infos/bounds"_ostr, "height"_ostr).toInt32();
double fSumHeight_mm = o3tl::convert<double>(nHeight1 + nHeight2 + nHeight3, o3tl::Length::twip,
o3tl::Length::mm);
CPPUNIT_ASSERT_DOUBLES_EQUAL(700.0, fSumHeight_mm, 0.05);
@@ -1671,7 +1678,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTableRemoveHasTextChangesOnly)
// 4 rows in Show Changes mode
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row", 4);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row"_ostr, 4);
// Accepting tracked deletions results 3 rows
IDocumentRedlineAccess& rIDRA(pDoc->getIDocumentRedlineAccess());
@@ -1679,26 +1686,26 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTableRemoveHasTextChangesOnly)
Scheduler::ProcessEventsToIdle();
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row", 3);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row"_ostr, 3);
// Undo: 4 rows again
pDoc->GetIDocumentUndoRedo().Undo();
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row", 4);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row"_ostr, 4);
// Accepting again: 3 rows (Undo of HasTextChangesOnly is correct)
rIDRA.AcceptAllRedline(/*bAccept=*/true);
Scheduler::ProcessEventsToIdle();
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row", 3);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row"_ostr, 3);
// Undo: 4 rows again
pDoc->GetIDocumentUndoRedo().Undo();
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row", 4);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row"_ostr, 4);
// Move the cursor after the redline, and insert some text without change tracking
pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false);
@@ -1709,7 +1716,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTableRemoveHasTextChangesOnly)
Scheduler::ProcessEventsToIdle();
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row", 4);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row"_ostr, 4);
// delete the extra text with change tracking:
// this resulted tracked row deletion again, because of missing
@@ -1726,7 +1733,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTableRemoveHasTextChangesOnly)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
// This was 3
- assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row", 4);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row"_ostr, 4);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTableRemoveHasTextChangesOnly2)
@@ -1748,7 +1755,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTableRemoveHasTextChangesOnly2)
// 4 rows in Show Changes mode
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row", 4);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row"_ostr, 4);
// Move the cursor to the tracked insertion, after the first redline to activate the
// acception of the whole table row insertion with a single "Accept Change"
@@ -1761,14 +1768,14 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTableRemoveHasTextChangesOnly2)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
// Accepting tracked insertion results still 4 rows, but less redlines
- assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row", 4);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row"_ostr, 4);
CPPUNIT_ASSERT_EQUAL(static_cast<SwRedlineTable::size_type>(11), pEditShell->GetRedlineCount());
// Undo: 4 rows again
pDoc->GetIDocumentUndoRedo().Undo();
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row", 4);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row"_ostr, 4);
CPPUNIT_ASSERT_EQUAL(static_cast<SwRedlineTable::size_type>(14), pEditShell->GetRedlineCount());
// To check Undo of HasTextChangesOnly reject the same row results 3 rows
@@ -1777,13 +1784,13 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTableRemoveHasTextChangesOnly2)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
// This was 4 (lost HasTextChangesOnly)
- assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row", 3);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row"_ostr, 3);
// Undo: 4 rows again
pDoc->GetIDocumentUndoRedo().Undo();
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row", 4);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row"_ostr, 4);
CPPUNIT_ASSERT_EQUAL(static_cast<SwRedlineTable::size_type>(14), pEditShell->GetRedlineCount());
}
@@ -1801,7 +1808,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf147182_AcceptAllChangesInTableSelec
// 4 rows in Show Changes mode
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row", 4);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row"_ostr, 4);
// Select the first table to get a table selection
dispatchCommand(mxComponent, ".uno:SelectAll", {});
@@ -1811,14 +1818,14 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf147182_AcceptAllChangesInTableSelec
pXmlDoc = parseLayoutDump();
// Accepting tracked changes in the selected table results 3 rows
// This was 4 (only text changes of the first selected cell were accepted)
- assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row", 3);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row"_ostr, 3);
CPPUNIT_ASSERT_EQUAL(static_cast<SwRedlineTable::size_type>(8), pEditShell->GetRedlineCount());
// Undo: 4 rows again
pDoc->GetIDocumentUndoRedo().Undo();
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row", 4);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row"_ostr, 4);
CPPUNIT_ASSERT_EQUAL(static_cast<SwRedlineTable::size_type>(14), pEditShell->GetRedlineCount());
// To check Undo of HasTextChangesOnly reject the same row results 3 rows
@@ -1829,13 +1836,13 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf147182_AcceptAllChangesInTableSelec
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
// This was 4 (only text changes of the first selected cell were rejected)
- assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row", 3);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row"_ostr, 3);
// Undo: 4 rows again
pDoc->GetIDocumentUndoRedo().Undo();
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row", 4);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row"_ostr, 4);
CPPUNIT_ASSERT_EQUAL(static_cast<SwRedlineTable::size_type>(14), pEditShell->GetRedlineCount());
}
@@ -1881,20 +1888,24 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf35021_tabOverMarginDemo)
calcLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// Tabs should go past the margin @ ~3381
- sal_Int32 nMargin = getXPath(pXmlDoc, "//body/txt[1]/infos/prtBounds", "width").toInt32();
+ sal_Int32 nMargin
+ = getXPath(pXmlDoc, "//body/txt[1]/infos/prtBounds"_ostr, "width"_ostr).toInt32();
// left tab was 3381 because it got its own full line
sal_Int32 nWidth
- = getXPath(pXmlDoc, "//SwFixPortion[@type='PortionType::TabLeft']", "width").toInt32();
+ = getXPath(pXmlDoc, "//SwFixPortion[@type='PortionType::TabLeft']"_ostr, "width"_ostr)
+ .toInt32();
CPPUNIT_ASSERT_MESSAGE("Left Tab width is ~4479", nMargin < nWidth);
// center tab was 842
- nWidth = getXPath(pXmlDoc, "//SwFixPortion[@type='PortionType::TabCenter']", "width").toInt32();
+ nWidth = getXPath(pXmlDoc, "//SwFixPortion[@type='PortionType::TabCenter']"_ostr, "width"_ostr)
+ .toInt32();
CPPUNIT_ASSERT_MESSAGE("Center Tab width is ~3521", nMargin < nWidth);
// right tab was probably the same as center tab.
- nWidth = getXPath(pXmlDoc, "//SwFixPortion[@type='PortionType::TabRight']", "width").toInt32();
+ nWidth = getXPath(pXmlDoc, "//SwFixPortion[@type='PortionType::TabRight']"_ostr, "width"_ostr)
+ .toInt32();
CPPUNIT_ASSERT_MESSAGE("Right Tab width is ~2907", sal_Int32(2500) < nWidth);
// decimal tab was 266
- nWidth
- = getXPath(pXmlDoc, "//SwFixPortion[@type='PortionType::TabDecimal']", "width").toInt32();
+ nWidth = getXPath(pXmlDoc, "//SwFixPortion[@type='PortionType::TabDecimal']"_ostr, "width"_ostr)
+ .toInt32();
CPPUNIT_ASSERT_MESSAGE("Decimal Tab width is ~4096", nMargin < nWidth);
#endif
}
@@ -1905,10 +1916,12 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf106701_tabOverMarginAutotab)
calcLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// The right margin is ~3378
- sal_Int32 nRightMargin = getXPath(pXmlDoc, "//body/txt[1]/infos/prtBounds", "width").toInt32();
+ sal_Int32 nRightMargin
+ = getXPath(pXmlDoc, "//body/txt[1]/infos/prtBounds"_ostr, "width"_ostr).toInt32();
// Automatic tabstops should never be affected by tabOverMargin compatibility
// The 1st line's width previously was ~9506
- sal_Int32 nWidth = getXPath(pXmlDoc, "//SwParaPortion/SwLineLayout[1]", "width").toInt32();
+ sal_Int32 nWidth
+ = getXPath(pXmlDoc, "//SwParaPortion/SwLineLayout[1]"_ostr, "width"_ostr).toInt32();
CPPUNIT_ASSERT_MESSAGE("1st line's width is less than the right margin", nWidth < nRightMargin);
}
@@ -1917,7 +1930,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf104492)
createSwDoc("tdf104492.docx");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// The document should split table over 3 pages.
- assertXPath(pXmlDoc, "//page", 3);
+ assertXPath(pXmlDoc, "//page"_ostr, 3);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf107025)
@@ -1930,18 +1943,18 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf107025)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// Verify the number of characters in each line.
CPPUNIT_ASSERT_EQUAL(sal_Int32(1),
- getXPath(pXmlDoc, "(//SwLinePortion)[1]", "length").toInt32());
+ getXPath(pXmlDoc, "(//SwLinePortion)[1]"_ostr, "length"_ostr).toInt32());
CPPUNIT_ASSERT_EQUAL(sal_Int32(9),
- getXPath(pXmlDoc, "(//SwLinePortion)[2]", "length").toInt32());
+ getXPath(pXmlDoc, "(//SwLinePortion)[2]"_ostr, "length"_ostr).toInt32());
// Do the subsequent test only if the first line can be displayed,
// in case that the required font does not exist.
- sal_Int32 nWidth1 = getXPath(pXmlDoc, "(//SwLinePortion)[1]", "width").toInt32();
+ sal_Int32 nWidth1 = getXPath(pXmlDoc, "(//SwLinePortion)[1]"_ostr, "width"_ostr).toInt32();
if (!nWidth1)
return;
- CPPUNIT_ASSERT(!parseDump("(//SwLinePortion)[2]", "width").isEmpty());
- sal_Int32 nWidth2 = getXPath(pXmlDoc, "(//SwLinePortion)[2]", "width").toInt32();
+ CPPUNIT_ASSERT(!parseDump("(//SwLinePortion)[2]"_ostr, "width"_ostr).isEmpty());
+ sal_Int32 nWidth2 = getXPath(pXmlDoc, "(//SwLinePortion)[2]"_ostr, "width"_ostr).toInt32();
sal_Int32 nRatio = nWidth2 / nWidth1;
CPPUNIT_ASSERT(nRatio >= 9); // Occupy at least 9 cells.
@@ -1953,18 +1966,22 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf107362)
createSwDoc("tdf107362.odt");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
sal_Int32 nHeight
- = getXPath(pXmlDoc, "(//SwParaPortion/SwLineLayout/child::*[@type='PortionType::Text'])[1]",
- "height")
+ = getXPath(pXmlDoc,
+ "(//SwParaPortion/SwLineLayout/child::*[@type='PortionType::Text'])[1]"_ostr,
+ "height"_ostr)
.toInt32();
sal_Int32 nWidth1
- = getXPath(pXmlDoc, "(//SwParaPortion/SwLineLayout/child::*[@type='PortionType::Text'])[1]",
- "width")
+ = getXPath(pXmlDoc,
+ "(//SwParaPortion/SwLineLayout/child::*[@type='PortionType::Text'])[1]"_ostr,
+ "width"_ostr)
.toInt32();
sal_Int32 nWidth2
- = getXPath(pXmlDoc, "(//SwParaPortion/SwLineLayout/child::*[@type='PortionType::Text'])[2]",
- "width")
+ = getXPath(pXmlDoc,
+ "(//SwParaPortion/SwLineLayout/child::*[@type='PortionType::Text'])[2]"_ostr,
+ "width"_ostr)
.toInt32();
- sal_Int32 nLineWidth = getXPath(pXmlDoc, "//SwParaPortion/SwLineLayout", "width").toInt32();
+ sal_Int32 nLineWidth
+ = getXPath(pXmlDoc, "//SwParaPortion/SwLineLayout"_ostr, "width"_ostr).toInt32();
sal_Int32 nKernWidth = nLineWidth - nWidth1 - nWidth2;
// Test only if fonts are available
if (nWidth1 > 500 && nWidth2 > 200)
@@ -2076,8 +2093,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf106736)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
sal_Int32 nWidth
= getXPath(pXmlDoc,
- "(//SwParaPortion/SwLineLayout/child::*[@type='PortionType::TabLeft'])[1]",
- "width")
+ "(//SwParaPortion/SwLineLayout/child::*[@type='PortionType::TabLeft'])[1]"_ostr,
+ "width"_ostr)
.toInt32();
// In tdf106736, width of tab overflow so that it got
// width value around 9200, expected value is around 103
@@ -2096,16 +2113,20 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testMsWordCompTrailingBlanks)
CPPUNIT_ASSERT_EQUAL(
OUString("0"),
- parseDump("/root/page/body/txt[2]/SwParaPortion/SwLineLayout/child::*[4]", "width"));
+ parseDump("/root/page/body/txt[2]/SwParaPortion/SwLineLayout/child::*[4]"_ostr,
+ "width"_ostr));
CPPUNIT_ASSERT_EQUAL(
OUString("0"),
- parseDump("/root/page/body/txt[2]/SwParaPortion/SwLineLayout/child::*[5]", "width"));
+ parseDump("/root/page/body/txt[2]/SwParaPortion/SwLineLayout/child::*[5]"_ostr,
+ "width"_ostr));
CPPUNIT_ASSERT_EQUAL(
OUString("0"),
- parseDump("/root/page/body/txt[3]/SwParaPortion/SwLineLayout/child::*[4]", "width"));
+ parseDump("/root/page/body/txt[3]/SwParaPortion/SwLineLayout/child::*[4]"_ostr,
+ "width"_ostr));
CPPUNIT_ASSERT_EQUAL(
OUString("0"),
- parseDump("/root/page/body/txt[3]/SwParaPortion/SwLineLayout/child::*[5]", "width"));
+ parseDump("/root/page/body/txt[3]/SwParaPortion/SwLineLayout/child::*[5]"_ostr,
+ "width"_ostr));
// The option is false in settings.xml
createSwDoc("MsWordCompTrailingBlanksFalse.odt");
@@ -2114,14 +2135,18 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testMsWordCompTrailingBlanks)
DocumentSettingId::MS_WORD_COMP_TRAILING_BLANKS));
calcLayout();
// Check that trailing spaces spans have width if option is disabled
- CPPUNIT_ASSERT(
- parseDump("/root/page/body/txt[2]/SwParaPortion/SwLineLayout/child::*[4]", "width") != "0");
- CPPUNIT_ASSERT(
- parseDump("/root/page/body/txt[2]/SwParaPortion/SwLineLayout/child::*[5]", "width") != "0");
- CPPUNIT_ASSERT(
- parseDump("/root/page/body/txt[3]/SwParaPortion/SwLineLayout/child::*[4]", "width") != "0");
- CPPUNIT_ASSERT(
- parseDump("/root/page/body/txt[3]/SwParaPortion/SwLineLayout/child::*[5]", "width") != "0");
+ CPPUNIT_ASSERT(parseDump("/root/page/body/txt[2]/SwParaPortion/SwLineLayout/child::*[4]"_ostr,
+ "width"_ostr)
+ != "0");
+ CPPUNIT_ASSERT(parseDump("/root/page/body/txt[2]/SwParaPortion/SwLineLayout/child::*[5]"_ostr,
+ "width"_ostr)
+ != "0");
+ CPPUNIT_ASSERT(parseDump("/root/page/body/txt[3]/SwParaPortion/SwLineLayout/child::*[4]"_ostr,
+ "width"_ostr)
+ != "0");
+ CPPUNIT_ASSERT(parseDump("/root/page/body/txt[3]/SwParaPortion/SwLineLayout/child::*[5]"_ostr,
+ "width"_ostr)
+ != "0");
// MsWordCompTrailingBlanks option should be false by default in new documents
createSwDoc();
@@ -2238,8 +2263,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf114306)
// A part of paragraph 2 should flow over to the second page but
// *not* the whole paragraph. There should be 2 paragraphs on
// page 1 and 1 paragraph on page 2.
- assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row[1]/cell[1]/txt", 2);
- assertXPath(pXmlDoc, "/root/page[2]/body/tab[1]/row[1]/cell[1]/txt", 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row[1]/cell[1]/txt"_ostr, 2);
+ assertXPath(pXmlDoc, "/root/page[2]/body/tab[1]/row[1]/cell[1]/txt"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf114306_2)
diff --git a/sw/qa/extras/uiwriter/uiwriter5.cxx b/sw/qa/extras/uiwriter/uiwriter5.cxx
index 4b6130683f05..31aefb112837 100644
--- a/sw/qa/extras/uiwriter/uiwriter5.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter5.cxx
@@ -1741,7 +1741,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf118311)
dispatchCommand(mxComponent, ".uno:Cut", {});
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// .uno:SelectAll selects the whole table, and UNO command Cut cuts it
dispatchCommand(mxComponent, ".uno:SelectAll", {});
@@ -1749,7 +1749,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf118311)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab", 0);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletion)
@@ -1771,7 +1771,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletion)
// check table
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// delete table row with enabled change tracking
// (HasTextChangesOnly property of the row will be false)
@@ -1780,7 +1780,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletion)
// This was deleted without change tracking
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// accept the deletion of the content of the first cell
SwEditShell* const pEditShell(pDoc->GetEditShell());
@@ -1790,7 +1790,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletion)
// table row was still not deleted
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// accept last redline
pEditShell->AcceptRedline(0);
@@ -1798,7 +1798,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletion)
// table row (and the 1-row table) was deleted finally
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab", 0);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr, 0);
// Undo, and repeat the previous test, but only with deletion of the text content of the cells
// (HasTextChangesOnly property will be removed by Undo)
@@ -1810,7 +1810,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletion)
// table exists again
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// delete table row with enabled change tracking
dispatchCommand(mxComponent, ".uno:SelectRow", {});
@@ -1819,7 +1819,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletion)
// Table row still exists
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// accept the deletion of the content of the first cell
CPPUNIT_ASSERT_EQUAL(static_cast<SwRedlineTable::size_type>(2), pEditShell->GetRedlineCount());
@@ -1828,7 +1828,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletion)
// table row was still not deleted
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// accept last redline
pEditShell->AcceptRedline(0);
@@ -1837,7 +1837,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletion)
// (HasTextChangesOnly property wasn't set for table row deletion)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// Undo, and delete the row without change tracking
@@ -1848,7 +1848,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletion)
// table exists again
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// disable change tracking
pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::ShowDelete
@@ -1863,7 +1863,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletion)
// the table (row) was deleted
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab", 0);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf150976)
@@ -1883,16 +1883,16 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf150976)
// check table
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// nested table in the last cell
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell[2]/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell[2]/tab"_ostr);
// delete table row with enabled change tracking
dispatchCommand(mxComponent, ".uno:DeleteRows", {});
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// deleted text content
SwEditShell* const pEditShell(pDoc->GetEditShell());
@@ -1917,7 +1917,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf150976)
pXmlDoc = parseLayoutDump();
// tdf#151658 This was 1: not deleted table row (and table)
- assertXPath(pXmlDoc, "//page[1]//body/tab", 0);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf151657)
@@ -1936,16 +1936,16 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf151657)
// check table
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// nested table in the last cell
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell[2]/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell[2]/tab"_ostr);
// delete table row with enabled change tracking
dispatchCommand(mxComponent, ".uno:DeleteRows", {});
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// deleted text content
SwEditShell* const pEditShell(pDoc->GetEditShell());
@@ -1970,7 +1970,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf151657)
pXmlDoc = parseLayoutDump();
// tdf#151658 This was 1: not deleted table row (and table)
- assertXPath(pXmlDoc, "//page[1]//body/tab", 0);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testSelectRowWithNestedTable)
@@ -1980,9 +1980,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testSelectRowWithNestedTable)
// check table
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// nested table in the last cell
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell[2]/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell[2]/tab"_ostr);
// select table row
dispatchCommand(mxComponent, ".uno:EntireRow", {});
@@ -1991,11 +1991,13 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testSelectRowWithNestedTable)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPathContent(pXmlDoc, "//page[1]//body/tab/row/cell[2]/tab/row/cell[1]/txt", "NESTED-A1");
+ assertXPathContent(pXmlDoc, "//page[1]//body/tab/row/cell[2]/tab/row/cell[1]/txt"_ostr,
+ "NESTED-A1");
// This was "a1" (bad selection of the table row)
- assertXPathContent(pXmlDoc, "//page[1]//body/tab/row/cell[1]/txt[1]", "A1");
+ assertXPathContent(pXmlDoc, "//page[1]//body/tab/row/cell[1]/txt[1]"_ostr, "A1");
// This was "nested-b1" (bad selection of the table row)
- assertXPathContent(pXmlDoc, "//page[1]//body/tab/row/cell[2]/tab/row/cell[2]/txt", "NESTED-B1");
+ assertXPathContent(pXmlDoc, "//page[1]//body/tab/row/cell[2]/tab/row/cell[2]/txt"_ostr,
+ "NESTED-B1");
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf47979_row)
@@ -2021,14 +2023,14 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf47979_row)
dispatchCommand(mxComponent, ".uno:ChangeCaseToUpper", {});
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPathContent(pXmlDoc, "//page[1]//body/tab/row[1]/cell[1]/txt[1]", "a1");
- assertXPathContent(pXmlDoc, "//page[1]//body/tab/row[1]/cell[2]/txt[1]", "b1");
- assertXPathContent(pXmlDoc, "//page[1]//body/tab/row[2]/cell[2]/tab/row/cell[1]/txt",
+ assertXPathContent(pXmlDoc, "//page[1]//body/tab/row[1]/cell[1]/txt[1]"_ostr, "a1");
+ assertXPathContent(pXmlDoc, "//page[1]//body/tab/row[1]/cell[2]/txt[1]"_ostr, "b1");
+ assertXPathContent(pXmlDoc, "//page[1]//body/tab/row[2]/cell[2]/tab/row/cell[1]/txt"_ostr,
"NESTED-A1");
// This was "a2" (bad selection of the table row)
- assertXPathContent(pXmlDoc, "//page[1]//body/tab/row[2]/cell[1]/txt[1]", "A2");
+ assertXPathContent(pXmlDoc, "//page[1]//body/tab/row[2]/cell[1]/txt[1]"_ostr, "A2");
// This was "nested-b1" (bad selection of the table row)
- assertXPathContent(pXmlDoc, "//page[1]//body/tab/row[2]/cell[2]/tab/row/cell[2]/txt",
+ assertXPathContent(pXmlDoc, "//page[1]//body/tab/row[2]/cell[2]/tab/row/cell[2]/txt"_ostr,
"NESTED-B1");
}
@@ -2058,14 +2060,14 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf47979_column)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPathContent(pXmlDoc, "//page[1]//body/tab/row[1]/cell[1]/txt[1]", "a1");
- assertXPathContent(pXmlDoc, "//page[1]//body/tab/row[2]/cell[1]/txt[1]", "a2");
- assertXPathContent(pXmlDoc, "//page[1]//body/tab/row[2]/cell[2]/tab/row/cell[1]/txt",
+ assertXPathContent(pXmlDoc, "//page[1]//body/tab/row[1]/cell[1]/txt[1]"_ostr, "a1");
+ assertXPathContent(pXmlDoc, "//page[1]//body/tab/row[2]/cell[1]/txt[1]"_ostr, "a2");
+ assertXPathContent(pXmlDoc, "//page[1]//body/tab/row[2]/cell[2]/tab/row/cell[1]/txt"_ostr,
"NESTED-A1");
- assertXPathContent(pXmlDoc, "//page[1]//body/tab/row[2]/cell[2]/tab/row/cell[2]/txt",
+ assertXPathContent(pXmlDoc, "//page[1]//body/tab/row[2]/cell[2]/tab/row/cell[2]/txt"_ostr,
"NESTED-B1");
// This was "b1" (bad selection of the table column)
- assertXPathContent(pXmlDoc, "//page[1]//body/tab/row[1]/cell[2]/txt[1]", "B1");
+ assertXPathContent(pXmlDoc, "//page[1]//body/tab/row[1]/cell[2]/txt[1]"_ostr, "B1");
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletionWithExport)
@@ -2087,7 +2089,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletionWithExport)
// check table
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// delete table row with enabled change tracking
// (HasTextChangesOnly property of the row will be false)
@@ -2097,7 +2099,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletionWithExport)
// but not table deletion
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// Save it and load it back.
saveAndReload("writer8");
@@ -2110,7 +2112,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletionWithExport)
// table row was still not deleted
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// accept last redline
pEditShell->AcceptRedline(0);
@@ -2119,7 +2121,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletionWithExport)
// (working export/import of HasTextChangesOnly)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab", 0);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletionWithDOCXExport)
@@ -2141,7 +2143,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletionWithDOCXExport)
// check table
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// delete table row with enabled change tracking
// (HasTextChangesOnly property of the row will be false)
@@ -2151,7 +2153,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletionWithDOCXExport)
// but not table deletion
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// Save it to a DOCX and load it back.
// Exporting change tracking of the row wasn't supported.
@@ -2166,7 +2168,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletionWithDOCXExport)
// table row was still not deleted
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// accept last redline
pEditShell->AcceptRedline(0);
@@ -2175,7 +2177,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletionWithDOCXExport)
// (working export/import of HasTextChangesOnly)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab", 0);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineDOCXTableInsertion)
@@ -2670,8 +2672,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableColumnDeletion)
// check table
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 2);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell"_ostr, 2);
// delete table column with enabled change tracking
// (HasTextChangesOnly property of the cell will be false)
@@ -2679,9 +2681,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableColumnDeletion)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// This was 1 (deleted cell without change tracking)
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 2);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell"_ostr, 2);
// accept the deletion
SwEditShell* const pEditShell(pDoc->GetEditShell());
@@ -2690,9 +2692,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableColumnDeletion)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// deleted column
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 1);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell"_ostr, 1);
// Undo, and repeat the previous test, but only with deletion of the text content of the cells
// (HasTextChangesOnly property will be removed by Undo)
@@ -2703,8 +2705,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableColumnDeletion)
// first column exists again
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 2);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell"_ostr, 2);
// delete table column with enabled change tracking
dispatchCommand(mxComponent, ".uno:SelectColumn", {});
@@ -2713,8 +2715,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableColumnDeletion)
// Table column still exists
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 2);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell"_ostr, 2);
// accept the deletion of the content of the first cell
CPPUNIT_ASSERT_EQUAL(static_cast<SwRedlineTable::size_type>(1), pEditShell->GetRedlineCount());
@@ -2723,8 +2725,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableColumnDeletion)
// table column was still not deleted
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 2);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell"_ostr, 2);
// Undo, and delete the column without change tracking
@@ -2734,8 +2736,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableColumnDeletion)
// table exists again
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 2);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell"_ostr, 2);
// disable change tracking
pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::ShowDelete
@@ -2750,8 +2752,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableColumnDeletion)
// the table column was deleted
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 1);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf156474)
@@ -2825,10 +2827,10 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, tdf156475)
// check table
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row", 2);
- assertXPath(pXmlDoc, "//page[1]//body/tab/row[1]/cell", 2);
- assertXPath(pXmlDoc, "//page[1]//body/tab/row[2]/cell", 2);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row"_ostr, 2);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row[1]/cell"_ostr, 2);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row[2]/cell"_ostr, 2);
// turn on red-lining
pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete
@@ -2849,10 +2851,10 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, tdf156475)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row", 2);
- assertXPath(pXmlDoc, "//page[1]//body/tab/row[1]/cell", 1);
- assertXPath(pXmlDoc, "//page[1]//body/tab/row[2]/cell", 1);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row"_ostr, 2);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row[1]/cell"_ostr, 1);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row[2]/cell"_ostr, 1);
// test Undo/Redo
for (sal_Int32 i = 0; i < 4; ++i)
@@ -2895,8 +2897,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf155747)
// check removed column
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 1);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf156544)
@@ -2922,9 +2924,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf156544)
// check table
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row", 1);
- assertXPath(pXmlDoc, "//page[1]//body/tab/row[1]/cell", 3);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row"_ostr, 1);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row[1]/cell"_ostr, 3);
// turn on red-lining
pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete
@@ -2942,37 +2944,37 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf156544)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row", 1);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row"_ostr, 1);
// This was 2 (deleted column)
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 3);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell"_ostr, 3);
// accept the deletion of the empty column
dispatchCommand(mxComponent, ".uno:AcceptTrackedChange", {});
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row", 1);
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 2);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row"_ostr, 1);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell"_ostr, 2);
// test Undo/Redo
dispatchCommand(mxComponent, ".uno:Undo", {});
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row", 1);
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 3);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row"_ostr, 1);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell"_ostr, 3);
dispatchCommand(mxComponent, ".uno:Redo", {});
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row", 1);
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 2);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row"_ostr, 1);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf156487)
@@ -3002,7 +3004,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf156487)
CPPUNIT_ASSERT(pXmlDoc);
// This would be 2 without hiding the first cell
- assertXPath(pXmlDoc, "/metafile/push/push/push/textarray/text", 1);
+ assertXPath(pXmlDoc, "/metafile/push/push/push/textarray/text"_ostr, 1);
}
#ifndef DBG_UTIL
@@ -3042,7 +3044,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf150673_RedlineTableColumnDeletionWi
// check table
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// delete table column with enabled change tracking
// (HasTextChangesOnly property of the cell will be false)
@@ -3052,8 +3054,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf150673_RedlineTableColumnDeletionWi
// but not table deletion
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 2);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell"_ostr, 2);
// Save it and load it back.
saveAndReload("writer8");
@@ -3068,8 +3070,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf150673_RedlineTableColumnDeletionWi
// (working export/import of HasTextChangesOnly)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 1);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell"_ostr, 1);
// check removing HasTextChangesOnly at acceptance of the deletion
@@ -3079,8 +3081,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf150673_RedlineTableColumnDeletionWi
// table column exists again
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 2);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell"_ostr, 2);
// reject deletion, setting HasTextChangesOnly to TRUE
CPPUNIT_ASSERT_EQUAL(static_cast<SwRedlineTable::size_type>(1), pEditShell->GetRedlineCount());
@@ -3094,8 +3096,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf150673_RedlineTableColumnDeletionWi
// Table column still exists
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 2);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell"_ostr, 2);
// reject the deletion of the content of the first cell
CPPUNIT_ASSERT_EQUAL(static_cast<SwRedlineTable::size_type>(1), pEditShell->GetRedlineCount());
@@ -3104,8 +3106,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf150673_RedlineTableColumnDeletionWi
// table column is still not deleted
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 2);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableColumnDeletionWithDOCXExport)
@@ -3125,8 +3127,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableColumnDeletionWithDOCXExpo
// check table
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 2);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell"_ostr, 2);
// delete first table column with enabled change tracking
// (HasTextChangesOnly property of the cell will be false)
@@ -3136,8 +3138,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableColumnDeletionWithDOCXExpo
// but not table deletion
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 2);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell"_ostr, 2);
// Save it to a DOCX and load it back.
// Exporting change tracking of the cell wasn't supported.
@@ -3154,8 +3156,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableColumnDeletionWithDOCXExpo
// (working export/import of HasTextChangesOnly of table cells)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 1);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf155341_RedlineTableColumnInsertionWithExport)
@@ -3175,7 +3177,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf155341_RedlineTableColumnInsertionW
// check table
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// insert table column with enabled change tracking
// (HasTextChangesOnly property of the cell will be false)
@@ -3184,8 +3186,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf155341_RedlineTableColumnInsertionW
// text content with change tracking (dummy redline)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 3);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell"_ostr, 3);
// Save it and load it back.
saveAndReload("writer8");
@@ -3200,8 +3202,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf155341_RedlineTableColumnInsertionW
// (working export/import of HasTextChangesOnly)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 2);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf128335)
@@ -3253,7 +3255,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletionWithReject)
// check table
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// delete table row with enabled change tracking
// (HasTextChangesOnly property of the row will be false)
@@ -3263,7 +3265,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletionWithReject)
// but not table deletion
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// Save it and load it back.
saveAndReload("writer8");
@@ -3281,7 +3283,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletionWithReject)
// table row was still not deleted
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// accept all redlines
while (pEditShell->GetRedlineCount())
@@ -3291,7 +3293,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletionWithReject)
// (HasTextChangesOnly was false)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// restore HasTextChangesOnly = false
dispatchCommand(mxComponent, ".uno:Undo", {});
@@ -3307,7 +3309,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowDeletionWithReject)
// table row (and the 1-row table) was deleted finally
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab", 0);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowInsertionWithReject)
@@ -3327,8 +3329,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowInsertionWithReject)
// check table and its single row
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row", 1);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row"_ostr, 1);
// insert rows before and after with enabled change tracking
// (HasTextChangesOnly property of the row will be false, and
@@ -3342,8 +3344,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowInsertionWithReject)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row", 3);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row"_ostr, 3);
// reject redlines
pEditShell->RejectRedline(0);
@@ -3351,9 +3353,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testRedlineTableRowInsertionWithReject)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// This was 3 (not rejected row insertion)
- assertXPath(pXmlDoc, "//page[1]//body/tab/row", 1);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf145089_RedlineTableRowInsertionDOCX)
@@ -3373,8 +3375,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf145089_RedlineTableRowInsertionDOCX
// check table and its single row
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row", 1);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row"_ostr, 1);
// insert rows before and after with enabled change tracking
// (HasTextChangesOnly property of the row will be false, and
@@ -3391,8 +3393,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf145089_RedlineTableRowInsertionDOCX
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row", 3);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row"_ostr, 3);
// reject redlines
SwDoc* pDOCXDoc(pTextDoc->GetDocShell()->GetDoc());
@@ -3404,10 +3406,10 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf145089_RedlineTableRowInsertionDOCX
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
// This was 3 (not rejected row insertion)
- assertXPath(pXmlDoc, "//page[1]//body/tab/row", 1);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testPasteTrackedTableRow)
@@ -3579,8 +3581,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf145091)
discardDumpedLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row", 3);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row"_ostr, 3);
// accept all redlines
dispatchCommand(mxComponent, ".uno:AcceptAllTrackedChanges", {});
@@ -3589,8 +3591,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf145091)
pXmlDoc = parseLayoutDump();
// This was false (deleted table with accepting deletions)
- assertXPath(pXmlDoc, "//page[1]//body/tab");
- assertXPath(pXmlDoc, "//page[1]//body/tab/row", 3);
+ assertXPath(pXmlDoc, "//page[1]//body/tab"_ostr);
+ assertXPath(pXmlDoc, "//page[1]//body/tab/row"_ostr, 3);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf128603)
@@ -3758,7 +3760,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf129655)
{
createSwDoc("tdf129655-vtextbox.odt");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//anchored/fly/txt[@WritingMode='Vertical']", 1);
+ assertXPath(pXmlDoc, "//anchored/fly/txt[@WritingMode='Vertical']"_ostr, 1);
}
static uno::Reference<text::XTextRange> getAssociatedTextRange(uno::Any object)
diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx b/sw/qa/extras/uiwriter/uiwriter6.cxx
index 30c449a597ac..5b4140e02967 100644
--- a/sw/qa/extras/uiwriter/uiwriter6.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter6.cxx
@@ -143,12 +143,12 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf108524)
createSwDoc("tdf108524.odt");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// In total we expect two cells containing a section.
- assertXPath(pXmlDoc, "/root/page/body/tab/row/cell/section", 2);
+ assertXPath(pXmlDoc, "/root/page/body/tab/row/cell/section"_ostr, 2);
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row/cell/section", 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row/cell/section"_ostr, 1);
// This was 0, section wasn't split, instead it was only on the first page
// and it was cut off.
- assertXPath(pXmlDoc, "/root/page[2]/body/tab/row/cell/section", 1);
+ assertXPath(pXmlDoc, "/root/page[2]/body/tab/row/cell/section"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testLinesInSectionInTable)
@@ -159,12 +159,12 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testLinesInSectionInTable)
createSwDoc("lines-in-section-in-table.odt");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// In total we expect two cells containing a section.
- assertXPath(pXmlDoc, "/root/page/body/tab/row/cell/section", 2);
+ assertXPath(pXmlDoc, "/root/page/body/tab/row/cell/section"_ostr, 2);
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row/cell/section", 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row/cell/section"_ostr, 1);
// This was 0, section wasn't split, instead it was only on the first page
// and it was cut off.
- assertXPath(pXmlDoc, "/root/page[2]/body/tab/row/cell/section", 1);
+ assertXPath(pXmlDoc, "/root/page[2]/body/tab/row/cell/section"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testLinesMoveBackwardsInSectionInTable)
@@ -174,14 +174,16 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testLinesMoveBackwardsInSectionInTable)
createSwDoc("lines-in-section-in-table.odt");
SwDoc* pDoc = getSwDoc();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page", 2);
- SwNodeOffset nPara4Node(
- getXPath(pXmlDoc, "/root/page[1]/body/tab/row/cell[1]/section/txt[last()]", "txtNodeIndex")
- .toUInt32());
+ assertXPath(pXmlDoc, "/root/page"_ostr, 2);
+ SwNodeOffset nPara4Node(getXPath(pXmlDoc,
+ "/root/page[1]/body/tab/row/cell[1]/section/txt[last()]"_ostr,
+ "txtNodeIndex"_ostr)
+ .toUInt32());
CPPUNIT_ASSERT_EQUAL(OUString("4"), pDoc->GetNodes()[nPara4Node]->GetTextNode()->GetText());
- SwNodeOffset nPara5Node(
- getXPath(pXmlDoc, "/root/page[2]/body/tab/row/cell[1]/section/txt[1]", "txtNodeIndex")
- .toUInt32());
+ SwNodeOffset nPara5Node(getXPath(pXmlDoc,
+ "/root/page[2]/body/tab/row/cell[1]/section/txt[1]"_ostr,
+ "txtNodeIndex"_ostr)
+ .toUInt32());
CPPUNIT_ASSERT_EQUAL(OUString("5"), pDoc->GetNodes()[nPara5Node]->GetTextNode()->GetText());
// Remove paragraph "4".
@@ -196,7 +198,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testLinesMoveBackwardsInSectionInTable)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
SwNodeOffset nPage1LastNode(
- getXPath(pXmlDoc, "/root/page[1]/body/tab/row/cell[1]/section/txt[last()]", "txtNodeIndex")
+ getXPath(pXmlDoc, "/root/page[1]/body/tab/row/cell[1]/section/txt[last()]"_ostr,
+ "txtNodeIndex"_ostr)
.toUInt32());
// This was "3", paragraph "4" was deleted, but "5" was not moved backwards from page 2.
CPPUNIT_ASSERT_EQUAL(OUString("5"), pDoc->GetNodes()[nPage1LastNode]->GetTextNode()->GetText());
@@ -210,11 +213,11 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTableInSection)
createSwDoc("table-in-sect.odt");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// In total we expect 4 cells.
- assertXPath(pXmlDoc, "/root/page/body/section/tab/row/cell", 4);
+ assertXPath(pXmlDoc, "/root/page/body/section/tab/row/cell"_ostr, 4);
// Assert that on both pages the section contains 2 cells.
- assertXPath(pXmlDoc, "/root/page[1]/body/section/tab/row/cell", 2);
- assertXPath(pXmlDoc, "/root/page[2]/body/section/tab/row/cell", 2);
+ assertXPath(pXmlDoc, "/root/page[1]/body/section/tab/row/cell"_ostr, 2);
+ assertXPath(pXmlDoc, "/root/page[2]/body/section/tab/row/cell"_ostr, 2);
#endif
}
@@ -226,8 +229,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTableInNestedSection)
createSwDoc("rhbz739252-3.odt");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// Make sure the table is inside a section and spans over 2 pages.
- assertXPath(pXmlDoc, "//page[1]//section/tab", 1);
- assertXPath(pXmlDoc, "//page[2]//section/tab", 1);
+ assertXPath(pXmlDoc, "//page[1]//section/tab"_ostr, 1);
+ assertXPath(pXmlDoc, "//page[2]//section/tab"_ostr, 1);
#endif
}
@@ -237,12 +240,12 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf112741)
createSwDoc("tdf112741.fodt");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// This was 5 pages.
- assertXPath(pXmlDoc, "//page", 4);
- assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell/section", 1);
- assertXPath(pXmlDoc, "//page[2]/body/tab/row/cell/tab/row/cell/section", 1);
+ assertXPath(pXmlDoc, "//page"_ostr, 4);
+ assertXPath(pXmlDoc, "//page[1]/body/tab/row/cell/tab/row/cell/section"_ostr, 1);
+ assertXPath(pXmlDoc, "//page[2]/body/tab/row/cell/tab/row/cell/section"_ostr, 1);
// This failed, 3rd page contained no sections.
- assertXPath(pXmlDoc, "//page[3]/body/tab/row/cell/tab/row/cell/section", 1);
- assertXPath(pXmlDoc, "//page[4]/body/tab/row/cell/tab/row/cell/section", 1);
+ assertXPath(pXmlDoc, "//page[3]/body/tab/row/cell/tab/row/cell/section"_ostr, 1);
+ assertXPath(pXmlDoc, "//page[4]/body/tab/row/cell/tab/row/cell/section"_ostr, 1);
#endif
}
@@ -261,11 +264,12 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf113287)
#if HAVE_MORE_FONTS
createSwDoc("tdf113287.fodt");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page", 2);
+ assertXPath(pXmlDoc, "//page"_ostr, 2);
sal_uInt32 nCellTop
- = getXPath(pXmlDoc, "//page[2]/body/tab/row/cell[1]/infos/bounds", "top").toUInt32();
+ = getXPath(pXmlDoc, "//page[2]/body/tab/row/cell[1]/infos/bounds"_ostr, "top"_ostr)
+ .toUInt32();
sal_uInt32 nSectionTop
- = getXPath(pXmlDoc, "//page[2]/body/tab/row/cell[1]/section/infos/bounds", "top")
+ = getXPath(pXmlDoc, "//page[2]/body/tab/row/cell[1]/section/infos/bounds"_ostr, "top"_ostr)
.toUInt32();
// Make sure section frame is inside the cell frame.
// Expected greater than 4593, was only 3714.
@@ -285,9 +289,11 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf113445)
calcLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "//page", 2);
- sal_uInt32 nPage1Left = getXPath(pXmlDoc, "//page[1]/infos/bounds", "left").toUInt32();
- sal_uInt32 nPage2Left = getXPath(pXmlDoc, "//page[2]/infos/bounds", "left").toUInt32();
+ assertXPath(pXmlDoc, "//page"_ostr, 2);
+ sal_uInt32 nPage1Left
+ = getXPath(pXmlDoc, "//page[1]/infos/bounds"_ostr, "left"_ostr).toUInt32();
+ sal_uInt32 nPage2Left
+ = getXPath(pXmlDoc, "//page[2]/infos/bounds"_ostr, "left"_ostr).toUInt32();
// Make sure that page 2 is on the right hand side of page 1, not below it.
CPPUNIT_ASSERT_GREATER(nPage1Left, nPage2Left);
@@ -300,19 +306,23 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf113445)
// Make sure that Table2:C5 and Table2:D5 has its section frame inside the cell frame.
sal_uInt32 nCell3Top
- = getXPath(pXmlDoc, "//page[2]/body/tab/row/cell/tab/row[4]/cell[3]/infos/bounds", "top")
+ = getXPath(pXmlDoc, "//page[2]/body/tab/row/cell/tab/row[4]/cell[3]/infos/bounds"_ostr,
+ "top"_ostr)
.toUInt32();
sal_uInt32 nSection3Top
- = getXPath(pXmlDoc, "//page[2]/body/tab/row/cell/tab/row[4]/cell[3]/section/infos/bounds",
- "top")
+ = getXPath(pXmlDoc,
+ "//page[2]/body/tab/row/cell/tab/row[4]/cell[3]/section/infos/bounds"_ostr,
+ "top"_ostr)
.toUInt32();
CPPUNIT_ASSERT_GREATER(nCell3Top, nSection3Top);
sal_uInt32 nCell4Top
- = getXPath(pXmlDoc, "//page[2]/body/tab/row/cell/tab/row[4]/cell[4]/infos/bounds", "top")
+ = getXPath(pXmlDoc, "//page[2]/body/tab/row/cell/tab/row[4]/cell[4]/infos/bounds"_ostr,
+ "top"_ostr)
.toUInt32();
sal_uInt32 nSection4Top
- = getXPath(pXmlDoc, "//page[2]/body/tab/row/cell/tab/row[4]/cell[4]/section/infos/bounds",
- "top")
+ = getXPath(pXmlDoc,
+ "//page[2]/body/tab/row/cell/tab/row[4]/cell[4]/section/infos/bounds"_ostr,
+ "top"_ostr)
.toUInt32();
CPPUNIT_ASSERT_GREATER(nCell4Top, nSection4Top);
// Also check if the two cells in the same row have the same top position.
@@ -327,16 +337,17 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf113686)
createSwDoc("tdf113686.fodt");
SwDoc* pDoc = getSwDoc();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page", 2);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 2);
SwNodeOffset nPage1LastNode(
- getXPath(pXmlDoc, "/root/page[1]/body/tab/row/cell[1]/tab/row/cell[1]/txt[last()]",
- "txtNodeIndex")
+ getXPath(pXmlDoc, "/root/page[1]/body/tab/row/cell[1]/tab/row/cell[1]/txt[last()]"_ostr,
+ "txtNodeIndex"_ostr)
.toUInt32());
CPPUNIT_ASSERT_EQUAL(OUString("Table2:A1-P10"),
pDoc->GetNodes()[nPage1LastNode]->GetTextNode()->GetText());
- SwNodeOffset nPage2FirstNode(
- getXPath(pXmlDoc, "/root/page[2]/body/tab/row/cell[1]/section/txt[1]", "txtNodeIndex")
- .toUInt32());
+ SwNodeOffset nPage2FirstNode(getXPath(pXmlDoc,
+ "/root/page[2]/body/tab/row/cell[1]/section/txt[1]"_ostr,
+ "txtNodeIndex"_ostr)
+ .toUInt32());
CPPUNIT_ASSERT_EQUAL(OUString("Table1:A1"),
pDoc->GetNodes()[nPage2FirstNode]->GetTextNode()->GetText());
@@ -353,7 +364,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf113686)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
// This was still 2, content from 2nd page was not moved.
- assertXPath(pXmlDoc, "/root/page", 1);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 1);
#endif
}
@@ -383,15 +394,18 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testSectionInTableInTable2)
createSwDoc("split-section-in-nested-table.fodt");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
sal_uInt32 nSection1
- = getXPath(pXmlDoc, "//page[1]//body/tab/row/cell/tab/row/cell/section", "id").toUInt32();
+ = getXPath(pXmlDoc, "//page[1]//body/tab/row/cell/tab/row/cell/section"_ostr, "id"_ostr)
+ .toUInt32();
sal_uInt32 nSection1Follow
- = getXPath(pXmlDoc, "//page[1]//body/tab/row/cell/tab/row/cell/section", "follow")
+ = getXPath(pXmlDoc, "//page[1]//body/tab/row/cell/tab/row/cell/section"_ostr, "follow"_ostr)
.toUInt32();
// This failed, the section wasn't split inside a nested table.
sal_uInt32 nSection2
- = getXPath(pXmlDoc, "//page[2]//body/tab/row/cell/tab/row/cell/section", "id").toUInt32();
+ = getXPath(pXmlDoc, "//page[2]//body/tab/row/cell/tab/row/cell/section"_ostr, "id"_ostr)
+ .toUInt32();
sal_uInt32 nSection2Precede
- = getXPath(pXmlDoc, "//page[2]//body/tab/row/cell/tab/row/cell/section", "precede")
+ = getXPath(pXmlDoc, "//page[2]//body/tab/row/cell/tab/row/cell/section"_ostr,
+ "precede"_ostr)
.toUInt32();
// Make sure that the first's follow and the second's precede is correct.
@@ -419,13 +433,17 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testSectionInTableInTable3)
calcLayout();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- sal_uInt32 nTable1 = getXPath(pXmlDoc, "//page[1]//body/tab", "id").toUInt32();
- sal_uInt32 nTable1Follow = getXPath(pXmlDoc, "//page[1]//body/tab", "follow").toUInt32();
- sal_uInt32 nTable2 = getXPath(pXmlDoc, "//page[2]//body/tab", "id").toUInt32();
- sal_uInt32 nTable2Precede = getXPath(pXmlDoc, "//page[2]//body/tab", "precede").toUInt32();
- sal_uInt32 nTable2Follow = getXPath(pXmlDoc, "//page[2]//body/tab", "follow").toUInt32();
- sal_uInt32 nTable3 = getXPath(pXmlDoc, "//page[3]//body/tab", "id").toUInt32();
- sal_uInt32 nTable3Precede = getXPath(pXmlDoc, "//page[3]//body/tab", "precede").toUInt32();
+ sal_uInt32 nTable1 = getXPath(pXmlDoc, "//page[1]//body/tab"_ostr, "id"_ostr).toUInt32();
+ sal_uInt32 nTable1Follow
+ = getXPath(pXmlDoc, "//page[1]//body/tab"_ostr, "follow"_ostr).toUInt32();
+ sal_uInt32 nTable2 = getXPath(pXmlDoc, "//page[2]//body/tab"_ostr, "id"_ostr).toUInt32();
+ sal_uInt32 nTable2Precede
+ = getXPath(pXmlDoc, "//page[2]//body/tab"_ostr, "precede"_ostr).toUInt32();
+ sal_uInt32 nTable2Follow
+ = getXPath(pXmlDoc, "//page[2]//body/tab"_ostr, "follow"_ostr).toUInt32();
+ sal_uInt32 nTable3 = getXPath(pXmlDoc, "//page[3]//body/tab"_ostr, "id"_ostr).toUInt32();
+ sal_uInt32 nTable3Precede
+ = getXPath(pXmlDoc, "//page[3]//body/tab"_ostr, "precede"_ostr).toUInt32();
// Make sure the outer table frames are linked together properly.
CPPUNIT_ASSERT_EQUAL(nTable2, nTable1Follow);
@@ -441,16 +459,17 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testSectionInTableInTable4)
createSwDoc("tdf113520.fodt");
SwDoc* pDoc = getSwDoc();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page", 3);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 3);
SwNodeOffset nPage1LastNode(
- getXPath(pXmlDoc, "/root/page[1]/body/tab/row/cell[1]/tab/row/cell[1]/section/txt[last()]",
- "txtNodeIndex")
+ getXPath(pXmlDoc,
+ "/root/page[1]/body/tab/row/cell[1]/tab/row/cell[1]/section/txt[last()]"_ostr,
+ "txtNodeIndex"_ostr)
.toUInt32());
CPPUNIT_ASSERT_EQUAL(OUString("Section1:P10"),
pDoc->GetNodes()[nPage1LastNode]->GetTextNode()->GetText());
SwNodeOffset nPage3FirstNode(
- getXPath(pXmlDoc, "/root/page[3]/body/tab/row/cell[1]/tab/row/cell[1]/section/txt[1]",
- "txtNodeIndex")
+ getXPath(pXmlDoc, "/root/page[3]/body/tab/row/cell[1]/tab/row/cell[1]/section/txt[1]"_ostr,
+ "txtNodeIndex"_ostr)
.toUInt32());
CPPUNIT_ASSERT_EQUAL(OUString("Section1:P23"),
pDoc->GetNodes()[nPage3FirstNode]->GetTextNode()->GetText());
@@ -469,13 +488,15 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testSectionInTableInTable4)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
// This was 3, page 2 was emptied, but it wasn't removed.
- assertXPath(pXmlDoc, "/root/page", 2);
+ assertXPath(pXmlDoc, "/root/page"_ostr, 2);
// Make sure the outer table frames are linked together properly.
- sal_uInt32 nTable1 = getXPath(pXmlDoc, "//page[1]//body/tab", "id").toUInt32();
- sal_uInt32 nTable1Follow = getXPath(pXmlDoc, "//page[1]//body/tab", "follow").toUInt32();
- sal_uInt32 nTable2 = getXPath(pXmlDoc, "//page[2]//body/tab", "id").toUInt32();
- sal_uInt32 nTable2Precede = getXPath(pXmlDoc, "//page[2]//body/tab", "precede").toUInt32();
+ sal_uInt32 nTable1 = getXPath(pXmlDoc, "//page[1]//body/tab"_ostr, "id"_ostr).toUInt32();
+ sal_uInt32 nTable1Follow
+ = getXPath(pXmlDoc, "//page[1]//body/tab"_ostr, "follow"_ostr).toUInt32();
+ sal_uInt32 nTable2 = getXPath(pXmlDoc, "//page[2]//body/tab"_ostr, "id"_ostr).toUInt32();
+ sal_uInt32 nTable2Precede
+ = getXPath(pXmlDoc, "//page[2]//body/tab"_ostr, "precede"_ostr).toUInt32();
CPPUNIT_ASSERT_EQUAL(nTable2, nTable1Follow);
CPPUNIT_ASSERT_EQUAL(nTable1, nTable2Precede);
#endif
@@ -488,10 +509,10 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf112160)
createSwDoc("tdf112160.fodt");
SwDoc* pDoc = getSwDoc();
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- SwNodeOffset nA2CellNode(getXPath(pXmlDoc,
- "/root/page[1]/body/tab/row[2]/cell[1]/section/txt[last()]",
- "txtNodeIndex")
- .toUInt32());
+ SwNodeOffset nA2CellNode(
+ getXPath(pXmlDoc, "/root/page[1]/body/tab/row[2]/cell[1]/section/txt[last()]"_ostr,
+ "txtNodeIndex"_ostr)
+ .toUInt32());
CPPUNIT_ASSERT_EQUAL(OUString("Table1.A2"),
pDoc->GetNodes()[nA2CellNode]->GetTextNode()->GetText());
@@ -506,8 +527,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf112160)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
sal_uInt32 nD2CellNode
- = getXPath(pXmlDoc, "/root/page[1]/body/tab/row[2]/cell[last()]/section/txt[last()]",
- "txtNodeIndex")
+ = getXPath(pXmlDoc, "/root/page[1]/body/tab/row[2]/cell[last()]/section/txt[last()]"_ostr,
+ "txtNodeIndex"_ostr)
.toUInt32();
// This was Table1.C2, Table1.D2 was moved to the next page, unexpected.
CPPUNIT_ASSERT_EQUAL(OUString("Table1.D2"),
@@ -636,7 +657,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf112448)
// check actual number of line breaks in the paragraph
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout", 2);
+ assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf113790)
@@ -1159,9 +1180,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf157492_TrackedMovingRow)
xCellC1->setString("C1");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPathContent(pXmlDoc, "/root/page/body/tab/row[1]/cell[1]/txt", "A1");
- assertXPathContent(pXmlDoc, "/root/page/body/tab/row[1]/cell[2]/txt", "B1");
- assertXPathContent(pXmlDoc, "/root/page/body/tab/row[1]/cell[3]/txt", "C1");
+ assertXPathContent(pXmlDoc, "/root/page/body/tab/row[1]/cell[1]/txt"_ostr, "A1");
+ assertXPathContent(pXmlDoc, "/root/page/body/tab/row[1]/cell[2]/txt"_ostr, "B1");
+ assertXPathContent(pXmlDoc, "/root/page/body/tab/row[1]/cell[3]/txt"_ostr, "C1");
// enable redlining
dispatchCommand(mxComponent, ".uno:TrackChanges", {});
@@ -1289,10 +1310,10 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf155846_MovingColumn)
xCellA4->setString("A4");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPathContent(pXmlDoc, "/root/page/body/tab/row[1]/cell[1]/txt", "A1");
- assertXPathContent(pXmlDoc, "/root/page/body/tab/row[2]/cell[1]/txt", "A2");
- assertXPathContent(pXmlDoc, "/root/page/body/tab/row[3]/cell[1]/txt", "A3");
- assertXPathContent(pXmlDoc, "/root/page/body/tab/row[4]/cell[1]/txt", "A4");
+ assertXPathContent(pXmlDoc, "/root/page/body/tab/row[1]/cell[1]/txt"_ostr, "A1");
+ assertXPathContent(pXmlDoc, "/root/page/body/tab/row[2]/cell[1]/txt"_ostr, "A2");
+ assertXPathContent(pXmlDoc, "/root/page/body/tab/row[3]/cell[1]/txt"_ostr, "A3");
+ assertXPathContent(pXmlDoc, "/root/page/body/tab/row[4]/cell[1]/txt"_ostr, "A4");
// enable redlining
dispatchCommand(mxComponent, ".uno:TrackChanges", {});
@@ -1511,7 +1532,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testHtmlCopyImages)
CPPUNIT_ASSERT(pHtmlDoc);
// This failed, image was lost during HTML copy.
- OUString aImage = getXPath(pHtmlDoc, "/html/body/p/img", "src");
+ OUString aImage = getXPath(pHtmlDoc, "/html/body/p/img"_ostr, "src"_ostr);
// Also make sure that the image is not embedded (e.g. Word doesn't handle
// embedded images).
CPPUNIT_ASSERT(aImage.startsWith("file:///"));
@@ -1567,8 +1588,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testFontEmbedding)
#if HAVE_MORE_FONTS && !defined(MACOSX)
createSwDoc("testFontEmbedding.odt");
- OString aContentBaseXpath("/office:document-content/office:font-face-decls");
- OString aSettingsBaseXpath("/office:document-settings/office:settings/config:config-item-set");
+ OString aContentBaseXpath("/office:document-content/office:font-face-decls"_ostr);
+ OString aSettingsBaseXpath(
+ "/office:document-settings/office:settings/config:config-item-set"_ostr);
xmlDocUniquePtr pXmlDoc;
@@ -2037,7 +2059,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf65535)
sCommentText = OString(rComment.get<std::string>("text"));
}
// This was false (lost comment with spelling replacement)
- CPPUNIT_ASSERT_EQUAL(OString("with comment"), sCommentText);
+ CPPUNIT_ASSERT_EQUAL("with comment"_ostr, sCommentText);
}
#endif
@@ -2812,7 +2834,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testNestedGroupTextBoxCopyCrash)
auto pLayout = parseLayoutDump();
// There must be 2 textboxes!
- assertXPath(pLayout, "/root/page/body/txt/anchored/fly[2]");
+ assertXPath(pLayout, "/root/page/body/txt/anchored/fly[2]"_ostr);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testCrashOnExit)
diff --git a/sw/qa/extras/uiwriter/uiwriter7.cxx b/sw/qa/extras/uiwriter/uiwriter7.cxx
index 5ef7dc664765..16afe5f205c0 100644
--- a/sw/qa/extras/uiwriter/uiwriter7.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter7.cxx
@@ -1313,9 +1313,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf74230)
CPPUNIT_ASSERT(pXmlDoc);
//asserting XPath in loaded XML DOM
assertXPath(pXmlDoc, "//office:styles/style:default-style[@style:family='graphic']/"
- "style:graphic-properties[@svg:stroke-color='#3465a4']");
+ "style:graphic-properties[@svg:stroke-color='#3465a4']"_ostr);
assertXPath(pXmlDoc, "//office:styles/style:default-style[@style:family='graphic']/"
- "style:graphic-properties[@draw:fill-color='#729fcf']");
+ "style:graphic-properties[@draw:fill-color='#729fcf']"_ostr);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf80663)
@@ -2353,9 +2353,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf34957)
// regardless of whether it was already kept with the previous paragraph,
// or whether the following paragraph actually fit on the same page (MAB 3.6 - 5.0)
CPPUNIT_ASSERT_EQUAL(OUString("Row 1"),
- parseDump("/root/page[2]/body/tab[1]/row[2]/cell[1]/txt"));
+ parseDump("/root/page[2]/body/tab[1]/row[2]/cell[1]/txt"_ostr));
CPPUNIT_ASSERT_EQUAL(OUString("Row 1"),
- parseDump("/root/page[4]/body/tab[1]/row[2]/cell[1]/txt"));
+ parseDump("/root/page[4]/body/tab[1]/row[2]/cell[1]/txt"_ostr));
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf89954)
@@ -2780,17 +2780,17 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf149089)
{
createSwDoc("tdf149089.odt");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- sal_Int32 nPorLen1 = getXPath(pXmlDoc, "(//SwLinePortion)[1]", "length").toInt32();
- sal_Int32 nPorLen2 = getXPath(pXmlDoc, "(//SwLinePortion)[2]", "length").toInt32();
- sal_Int32 nPorLen3 = getXPath(pXmlDoc, "(//SwLinePortion)[3]", "length").toInt32();
+ sal_Int32 nPorLen1 = getXPath(pXmlDoc, "(//SwLinePortion)[1]"_ostr, "length"_ostr).toInt32();
+ sal_Int32 nPorLen2 = getXPath(pXmlDoc, "(//SwLinePortion)[2]"_ostr, "length"_ostr).toInt32();
+ sal_Int32 nPorLen3 = getXPath(pXmlDoc, "(//SwLinePortion)[3]"_ostr, "length"_ostr).toInt32();
// Two SwTextPortion and one SwKernPortion
CPPUNIT_ASSERT_EQUAL(sal_Int32(3), nPorLen1); // SwTextPortion "&#x4E00;&#x4E00; "
CPPUNIT_ASSERT_EQUAL(sal_Int32(12), nPorLen2); // SwTextPortion "BUG 11111111"
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nPorLen3); // SwKernPortion
- sal_Int32 nPorWidth1 = getXPath(pXmlDoc, "(//SwLinePortion)[1]", "width").toInt32();
- sal_Int32 nPorWidth2 = getXPath(pXmlDoc, "(//SwLinePortion)[2]", "width").toInt32();
- sal_Int32 nPorWidth3 = getXPath(pXmlDoc, "(//SwLinePortion)[3]", "width").toInt32();
+ sal_Int32 nPorWidth1 = getXPath(pXmlDoc, "(//SwLinePortion)[1]"_ostr, "width"_ostr).toInt32();
+ sal_Int32 nPorWidth2 = getXPath(pXmlDoc, "(//SwLinePortion)[2]"_ostr, "width"_ostr).toInt32();
+ sal_Int32 nPorWidth3 = getXPath(pXmlDoc, "(//SwLinePortion)[3]"_ostr, "width"_ostr).toInt32();
sal_Int32 nGridWidth1 = nPorWidth1 / 3;
sal_Int32 nGridWidth2 = (nPorWidth2 + nPorWidth3) / 7;
CPPUNIT_ASSERT_EQUAL(nGridWidth1, nGridWidth2);
diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx b/sw/qa/extras/uiwriter/uiwriter8.cxx
index 7cef16f032bf..41be9a196dfb 100644
--- a/sw/qa/extras/uiwriter/uiwriter8.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter8.cxx
@@ -79,10 +79,13 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf131684)
// check that the text frame has the correct upper
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- OUString const sectionId = getXPath(pXmlDoc, "/root/page[1]/body/section[7]", "id");
- OUString const sectionLower = getXPath(pXmlDoc, "/root/page[1]/body/section[7]", "lower");
- OUString const textId = getXPath(pXmlDoc, "/root/page[1]/body/section[7]/txt[1]", "id");
- OUString const textUpper = getXPath(pXmlDoc, "/root/page[1]/body/section[7]/txt[1]", "upper");
+ OUString const sectionId = getXPath(pXmlDoc, "/root/page[1]/body/section[7]"_ostr, "id"_ostr);
+ OUString const sectionLower
+ = getXPath(pXmlDoc, "/root/page[1]/body/section[7]"_ostr, "lower"_ostr);
+ OUString const textId
+ = getXPath(pXmlDoc, "/root/page[1]/body/section[7]/txt[1]"_ostr, "id"_ostr);
+ OUString const textUpper
+ = getXPath(pXmlDoc, "/root/page[1]/body/section[7]/txt[1]"_ostr, "upper"_ostr);
CPPUNIT_ASSERT_EQUAL(textId, sectionLower);
CPPUNIT_ASSERT_EQUAL(sectionId, textUpper);
}
@@ -205,7 +208,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf146962)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// This was 2
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row"_ostr, 1);
// check it in Show Changes mode
@@ -215,7 +218,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf146962)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
// 2 rows are visible now
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 2);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row"_ostr, 2);
// check it in Hide Changes mode again
@@ -225,7 +228,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf146962)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
// only a single row is visible again
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row"_ostr, 1);
// tdf#148227 check Undo of tracked table row deletion
@@ -233,7 +236,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf146962)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
// This was 1
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 2);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf147347)
@@ -259,7 +262,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf147347)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// This was 1
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 0);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row"_ostr, 0);
// check it in Show Changes mode
@@ -269,7 +272,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf147347)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
// 2 rows are visible now
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 2);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row"_ostr, 2);
// check it in Hide Changes mode again
@@ -279,7 +282,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf147347)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
// no visible row again
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 0);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row"_ostr, 0);
// tdf#148228 check Undo of tracked table deletion
@@ -287,7 +290,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf147347)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
// This was 0
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 2);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf153819)
@@ -336,7 +339,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf148345)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// This was 2
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row"_ostr, 1);
// check it in Show Changes mode
@@ -346,7 +349,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf148345)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
// 2 rows are visible now
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 2);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row"_ostr, 2);
// check it in Hide Changes mode again
@@ -356,7 +359,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf148345)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
// only a single row is visible again
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row"_ostr, 1);
// tdf#148227 check Reject All of tracked table row deletion
@@ -364,7 +367,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf148345)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
// This was 1
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 2);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf141391)
@@ -390,9 +393,10 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf141391)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// 3-row, overwriting cells of the second row and inserting a new row
// with the 2-row clipboard table content
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 3);
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[2]/cell[1]/txt/SwParaPortion/SwLineLayout",
- "portion", "hello");
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row"_ostr, 3);
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/tab/row[2]/cell[1]/txt/SwParaPortion/SwLineLayout"_ostr,
+ "portion"_ostr, "hello");
// Undo
@@ -400,8 +404,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf141391)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
// 2 rows again, no copied text content
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 2);
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[2]/cell[1]/SwParaPortion", 0);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row"_ostr, 2);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[2]/cell[1]/SwParaPortion"_ostr, 0);
// insert the 2-row table into the second paragraph of cell "A2" as a nested table
// For this it's enough to positionate the text cursor not in the first paragraph
@@ -412,20 +416,21 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf141391)
Scheduler::ProcessEventsToIdle();
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 2);
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[2]/cell[1]/txt", 2);
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[2]/cell[1]/txt[1]/SwParaPortion/SwLineLayout",
- "portion", "Some text...");
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row"_ostr, 2);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[2]/cell[1]/txt"_ostr, 2);
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/tab/row[2]/cell[1]/txt[1]/SwParaPortion/SwLineLayout"_ostr,
+ "portion"_ostr, "Some text...");
// the empty paragraph in A2
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[2]/cell[1]/txt[2]/SwParaPortion", 0);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[2]/cell[1]/txt[2]/SwParaPortion"_ostr, 0);
// insert the table, as a nested one in cell "A2"
dispatchCommand(mxComponent, ".uno:Paste", {});
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 2);
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[2]/cell[1]/tab", 1);
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[2]/cell[1]/tab/row", 2);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row"_ostr, 2);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[2]/cell[1]/tab"_ostr, 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[2]/cell[1]/tab/row"_ostr, 2);
// Undo
@@ -433,9 +438,10 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf141391)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
// 2 rows again, no copied text content
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 2);
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[2]/cell[1]/txt[1]/SwParaPortion/SwLineLayout",
- "portion", "Some text...");
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row"_ostr, 2);
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/tab/row[2]/cell[1]/txt[1]/SwParaPortion/SwLineLayout"_ostr,
+ "portion"_ostr, "Some text...");
// copy the 2-row table into the fist paragraph of cell "A2",
// but not at paragraph start (changed behaviour)
@@ -451,10 +457,11 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf141391)
// with the 2-row clipboard table content
// This was 2 (nested table)
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 3);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row"_ostr, 3);
// This was "Some text..." with a nested table
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[2]/cell[1]/txt/SwParaPortion/SwLineLayout",
- "portion", "hello");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/tab/row[2]/cell[1]/txt/SwParaPortion/SwLineLayout"_ostr,
+ "portion"_ostr, "hello");
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf148791)
@@ -479,11 +486,13 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf148791)
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
// Paste as Rows Above results 4-row table with default table alignment
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 4);
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[1]/cell[1]/txt/SwParaPortion/SwLineLayout",
- "portion", "hello");
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[3]/cell[1]/txt/SwParaPortion/SwLineLayout",
- "portion", "hello");
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row"_ostr, 4);
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/tab/row[1]/cell[1]/txt/SwParaPortion/SwLineLayout"_ostr,
+ "portion"_ostr, "hello");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/tab/row[3]/cell[1]/txt/SwParaPortion/SwLineLayout"_ostr,
+ "portion"_ostr, "hello");
// set table alignment to center, select and copy the table again
uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
@@ -518,15 +527,19 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf148791)
pXmlDoc = parseLayoutDump();
// This was 5 (inserting only a single row for the 4-row clipboard content, and
// overwriting 3 existing rows)
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 8);
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[1]/cell[1]/txt/SwParaPortion/SwLineLayout",
- "portion", "hello");
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[3]/cell[1]/txt/SwParaPortion/SwLineLayout",
- "portion", "hello");
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[5]/cell[1]/txt/SwParaPortion/SwLineLayout",
- "portion", "hello");
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row[7]/cell[1]/txt/SwParaPortion/SwLineLayout",
- "portion", "hello");
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row"_ostr, 8);
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/tab/row[1]/cell[1]/txt/SwParaPortion/SwLineLayout"_ostr,
+ "portion"_ostr, "hello");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/tab/row[3]/cell[1]/txt/SwParaPortion/SwLineLayout"_ostr,
+ "portion"_ostr, "hello");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/tab/row[5]/cell[1]/txt/SwParaPortion/SwLineLayout"_ostr,
+ "portion"_ostr, "hello");
+ assertXPath(pXmlDoc,
+ "/root/page[1]/body/tab/row[7]/cell[1]/txt/SwParaPortion/SwLineLayout"_ostr,
+ "portion"_ostr, "hello");
// tdf#64902 add a test case for nested tables
@@ -544,9 +557,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf148791)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
// rows of the nested table doesn't effect row number of the main table
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 16);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row"_ostr, 16);
// there are two nested tables after the paste
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row/cell/tab", 2);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row/cell/tab"_ostr, 2);
// tdf#64902 add a test case for repeated table headings
@@ -568,9 +581,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf148791)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
// repeating table header (and its thead/tbody indentation) doesn't effect row number
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 32);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row"_ostr, 32);
// there are two nested tables after the paste
- assertXPath(pXmlDoc, "/root/page[1]/body/tab/row/cell/tab", 4);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab/row/cell/tab"_ostr, 4);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf135014)
@@ -594,7 +607,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf135014)
saveAndReload("Office Open XML Text");
xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
- assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='NewNumberingStyle']/w:qFormat", 1);
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='NewNumberingStyle']/w:qFormat"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf130629)
@@ -900,7 +913,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf107427)
dispatchCommand(mxComponent, ".uno:InsertTable", aArgs);
xmlDocUniquePtr pLayout = parseLayoutDump();
- assertXPath(pLayout, "/root/page[1]/header/tab/row", 2);
+ assertXPath(pLayout, "/root/page[1]/header/tab/row"_ostr, 2);
SwDoc* pDoc = getSwDoc();
SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
@@ -909,13 +922,13 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf107427)
discardDumpedLayout();
pLayout = parseLayoutDump();
- assertXPath(pLayout, "/root/page[1]/header", 0);
+ assertXPath(pLayout, "/root/page[1]/header"_ostr, 0);
dispatchCommand(mxComponent, ".uno:Undo", {});
discardDumpedLayout();
pLayout = parseLayoutDump();
- assertXPath(pLayout, "/root/page[1]/header/tab/row", 2);
+ assertXPath(pLayout, "/root/page[1]/header/tab/row"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf141613)
@@ -1170,7 +1183,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf121031)
// Without the fix in place, the table would be hidden
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- assertXPath(pXmlDoc, "/root/page[1]/body/tab", 1);
+ assertXPath(pXmlDoc, "/root/page[1]/body/tab"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, TestTextBoxCrashAfterLineDel)
@@ -1769,7 +1782,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf132603)
const boost::property_tree::ptree& rComment = rValue.second;
OString aText(rComment.get<std::string>("text"));
- CPPUNIT_ASSERT_EQUAL(OString("Comment"), aText);
+ CPPUNIT_ASSERT_EQUAL("Comment"_ostr, aText);
}
}
@@ -2538,21 +2551,21 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf103612)
xmlDocUniquePtr pLayout = parseLayoutDump();
- assertXPath(pLayout, "/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout[1]",
- "portion", "Text before section");
+ assertXPath(pLayout, "/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr,
+ "portion"_ostr, "Text before section");
// the inner section and its content was hidden
- assertXPath(pLayout, "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout[1]",
- "portion", "Text inside section before ToC");
- assertXPath(pLayout, "/root/page[1]/body/section[3]/txt[1]/SwParaPortion/SwLineLayout[1]",
- "portion", "Table of Contents");
- assertXPath(pLayout, "/root/page[1]/body/section[4]/txt[1]/SwParaPortion/SwLineLayout[1]",
- "portion", "First header*1");
- assertXPath(pLayout, "/root/page[1]/body/section[4]/txt[2]/SwParaPortion/SwLineLayout[1]",
- "portion", "Second header*1");
- assertXPath(pLayout, "/root/page[1]/body/section[5]/txt[2]/SwParaPortion/SwLineLayout[1]",
- "portion", "Text inside section after ToC");
- assertXPath(pLayout, "/root/page[1]/body/section[6]/txt[1]/SwParaPortion/SwLineLayout[1]",
- "portion", "Text after section");
+ assertXPath(pLayout, "/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr,
+ "portion"_ostr, "Text inside section before ToC");
+ assertXPath(pLayout, "/root/page[1]/body/section[3]/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr,
+ "portion"_ostr, "Table of Contents");
+ assertXPath(pLayout, "/root/page[1]/body/section[4]/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr,
+ "portion"_ostr, "First header*1");
+ assertXPath(pLayout, "/root/page[1]/body/section[4]/txt[2]/SwParaPortion/SwLineLayout[1]"_ostr,
+ "portion"_ostr, "Second header*1");
+ assertXPath(pLayout, "/root/page[1]/body/section[5]/txt[2]/SwParaPortion/SwLineLayout[1]"_ostr,
+ "portion"_ostr, "Text inside section after ToC");
+ assertXPath(pLayout, "/root/page[1]/body/section[6]/txt[1]/SwParaPortion/SwLineLayout[1]"_ostr,
+ "portion"_ostr, "Text after section");
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf97899)
@@ -2606,7 +2619,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf40142)
// Without the fix in place, this test would have failed with
// - Expected: 2
// - Actual : 4
- assertXPath(pLayout, "/root/page[1]/body/section[2]/txt", 2);
+ assertXPath(pLayout, "/root/page[1]/body/section[2]/txt"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf151462)
@@ -2618,30 +2631,30 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf151462)
// Without the fix in place, there would be just the first index entry
assertXPath(pLayout,
"/root/page[1]/body/txt[2]/anchored/fly/section/txt[1]/SwParaPortion/"
- "SwLineLayout[1]/SwLinePortion[1]",
- "portion", "sub one");
+ "SwLineLayout[1]/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "sub one");
assertXPath(pLayout,
"/root/page[1]/body/txt[2]/anchored/fly/section/txt[2]/SwParaPortion/"
- "SwLineLayout[1]/SwLinePortion[1]",
- "portion", "sub two");
+ "SwLineLayout[1]/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "sub two");
assertXPath(pLayout,
"/root/page[1]/body/txt[2]/anchored/fly/section/txt[3]/SwParaPortion/"
- "SwLineLayout[1]/SwLinePortion[1]",
- "portion", "sub three");
+ "SwLineLayout[1]/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "sub three");
// Without the fix in place, there would be just the first index entry
assertXPath(pLayout,
"/root/page[1]/body/txt[6]/anchored/fly/section/txt[1]/SwParaPortion/"
- "SwLineLayout[1]/SwLinePortion[1]",
- "portion", "another sub one");
+ "SwLineLayout[1]/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "another sub one");
assertXPath(pLayout,
"/root/page[1]/body/txt[6]/anchored/fly/section/txt[2]/SwParaPortion/"
- "SwLineLayout[1]/SwLinePortion[1]",
- "portion", "another sub two");
+ "SwLineLayout[1]/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "another sub two");
assertXPath(pLayout,
"/root/page[1]/body/txt[6]/anchored/fly/section/txt[3]/SwParaPortion/"
- "SwLineLayout[1]/SwLinePortion[1]",
- "portion", "another sub three");
+ "SwLineLayout[1]/SwLinePortion[1]"_ostr,
+ "portion"_ostr, "another sub three");
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf151801)
@@ -2738,18 +2751,18 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf73483)
xmlDocUniquePtr pXml = parseExport("content.xml");
CPPUNIT_ASSERT(pXml);
- OUString para_style_name
- = getXPath(pXml, "/office:document-content/office:body/office:text/text:p", "style-name");
+ OUString para_style_name = getXPath(
+ pXml, "/office:document-content/office:body/office:text/text:p"_ostr, "style-name"_ostr);
// Without the fix in place, this would fail
CPPUNIT_ASSERT(!para_style_name.equalsIgnoreAsciiCase("Standard"));
OString para_style_path
= "/office:document-content/office:automatic-styles/style:style[@style:name='"
+ para_style_name.toUtf8() + "']";
- assertXPath(pXml, para_style_path, "family", "paragraph");
+ assertXPath(pXml, para_style_path, "family"_ostr, "paragraph");
// Without the fix in place, the autostyle had no parent
- assertXPath(pXml, para_style_path, "parent-style-name", "Standard");
- assertXPath(pXml, para_style_path, "master-page-name", "Right_20_Page");
+ assertXPath(pXml, para_style_path, "parent-style-name"_ostr, "Standard");
+ assertXPath(pXml, para_style_path, "master-page-name"_ostr, "Right_20_Page");
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf62032ApplyStyle)
diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx
index f767d51bbe96..28af67bfbac1 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -195,12 +195,12 @@ xray ThisComponent.DrawPage.getByIndex(0).BoundRect
DECLARE_WW8EXPORT_TEST(testTdf75539_relativeWidth, "tdf75539_relativeWidth.doc")
{
//divide everything by 10 to give a margin of error for rounding etc.
- sal_Int32 pageWidth = parseDump("/root/page[1]/body/infos/bounds", "width").toInt32()/10;
+ sal_Int32 pageWidth = parseDump("/root/page[1]/body/infos/bounds"_ostr, "width"_ostr).toInt32()/10;
CPPUNIT_ASSERT_EQUAL_MESSAGE("Page width", sal_Int32(9354/10), pageWidth);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("100% width line", pageWidth, parseDump("/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion", "width").toInt32()/10);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("50% width line", pageWidth/2, parseDump("/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion", "width").toInt32()/10);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("25% width line", pageWidth/4, parseDump("/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion", "width").toInt32()/10);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("10% width line", pageWidth/10, parseDump("/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion", "width").toInt32()/10);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("100% width line", pageWidth, parseDump("/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion"_ostr, "width"_ostr).toInt32()/10);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("50% width line", pageWidth/2, parseDump("/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion"_ostr, "width"_ostr).toInt32()/10);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("25% width line", pageWidth/4, parseDump("/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion"_ostr, "width"_ostr).toInt32()/10);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("10% width line", pageWidth/10, parseDump("/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion"_ostr, "width"_ostr).toInt32()/10);
}
DECLARE_WW8EXPORT_TEST(testN757905, "n757905.doc")
@@ -210,7 +210,7 @@ DECLARE_WW8EXPORT_TEST(testN757905, "n757905.doc")
// paragraph height. When in Word-compat mode, we should take the max of
// the two, not just the height of the fly.
- OUString aHeight = parseDump("/root/page/body/txt/infos/bounds", "height");
+ OUString aHeight = parseDump("/root/page/body/txt/infos/bounds"_ostr, "height"_ostr);
CPPUNIT_ASSERT(sal_Int32(31) < aHeight.toInt32());
}
@@ -259,7 +259,7 @@ DECLARE_WW8EXPORT_TEST(testN823651, "n823651.doc")
DECLARE_WW8EXPORT_TEST(testFdo36868, "fdo36868.doc")
{
- OUString aText = parseDump("/root/page/body/txt[3]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']", "expand");
+ OUString aText = parseDump("/root/page/body/txt[3]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']"_ostr, "expand"_ostr);
// This was 1.1.
CPPUNIT_ASSERT_EQUAL(OUString("2.1"), aText);
}
@@ -267,7 +267,7 @@ DECLARE_WW8EXPORT_TEST(testFdo36868, "fdo36868.doc")
DECLARE_WW8EXPORT_TEST(testListNolevel, "list-nolevel.doc")
{
// Similar to fdo#36868, numbering portions had wrong values.
- OUString aText = parseDump("/root/page/body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']", "expand");
+ OUString aText = parseDump("/root/page/body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']"_ostr, "expand"_ostr);
// PortionType::Number was completely missing.
CPPUNIT_ASSERT_EQUAL(OUString("1."), aText);
}
@@ -543,7 +543,7 @@ DECLARE_WW8EXPORT_TEST(testBnc787942, "bnc787942.doc")
{
// The frame ended up on the second page instead of first.
// this is on page 1 in Word
- parseDump("/root/page[1]/body/txt[4]/anchored");
+ parseDump("/root/page[1]/body/txt[4]/anchored"_ostr);
CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_PARALLEL, getProperty<text::WrapTextMode>(getShape(1), "Surround"));
CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(getShape(1), "HoriOrientRelation"));
@@ -568,10 +568,10 @@ DECLARE_WW8EXPORT_TEST(testLayoutHanging, "fdo68967.doc")
DECLARE_WW8EXPORT_TEST(testfdo68963, "fdo68963.doc")
{
// The problem was that the text was not displayed.
- CPPUNIT_ASSERT ( !parseDump("/root/page/body/tab/row[2]/cell[1]/txt/SwParaPortion/SwLineLayout/SwFieldPortion", "expand").isEmpty() );
- CPPUNIT_ASSERT_EQUAL( OUString("Topic 1"), parseDump("/root/page/body/tab/row[2]/cell[1]/txt/SwParaPortion/SwLineLayout/SwFieldPortion", "expand") );
+ CPPUNIT_ASSERT ( !parseDump("/root/page/body/tab/row[2]/cell[1]/txt/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr).isEmpty() );
+ CPPUNIT_ASSERT_EQUAL( OUString("Topic 1"), parseDump("/root/page/body/tab/row[2]/cell[1]/txt/SwParaPortion/SwLineLayout/SwFieldPortion"_ostr, "expand"_ostr) );
// all crossreference bookmarks should have a target. Shouldn't be any "Reference source not found" in the xml
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-1), parseDump("/root/page/body/txt[24]/SwParaPortion/SwLineLayout/SwFieldPortion[2]","expand").indexOf("Reference source not found"));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-1), parseDump("/root/page/body/txt[24]/SwParaPortion/SwLineLayout/SwFieldPortion[2]"_ostr,"expand"_ostr).indexOf("Reference source not found"));
}
#endif
@@ -683,8 +683,8 @@ DECLARE_WW8EXPORT_TEST(testTdf112535, "tdf112535.doc")
DECLARE_WW8EXPORT_TEST(testTdf106291, "tdf106291.doc")
{
// Table cell was merged vertically instead of horizontally -> had incorrect dimensions
- OUString cellWidth = parseDump("/root/page[1]/body/tab/row/cell[1]/infos/bounds", "width");
- OUString cellHeight = parseDump("/root/page[1]/body/tab/row/cell[1]/infos/bounds", "height");
+ OUString cellWidth = parseDump("/root/page[1]/body/tab/row/cell[1]/infos/bounds"_ostr, "width"_ostr);
+ OUString cellHeight = parseDump("/root/page[1]/body/tab/row/cell[1]/infos/bounds"_ostr, "height"_ostr);
CPPUNIT_ASSERT_EQUAL(sal_Int32(8650), cellWidth.toInt32());
CPPUNIT_ASSERT(cellHeight.toInt32() > 200); // height might depend on font size
}
@@ -894,18 +894,18 @@ DECLARE_WW8EXPORT_TEST(testFirstHeaderFooter, "first-header-footer.doc")
// The document has 6 pages. Note that we don't test if 4 or just 2 page
// styles are created, the point is that layout should be correct.
- CPPUNIT_ASSERT_EQUAL(OUString("First page header"), parseDump("/root/page[1]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("First page footer"), parseDump("/root/page[1]/footer/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Even page header"), parseDump("/root/page[2]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Even page footer"), parseDump("/root/page[2]/footer/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Odd page header"), parseDump("/root/page[3]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Odd page footer"), parseDump("/root/page[3]/footer/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("First page header2"), parseDump("/root/page[4]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("First page footer 2"), parseDump("/root/page[4]/footer/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Odd page header 2"), parseDump("/root/page[5]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Odd page footer 2"), parseDump("/root/page[5]/footer/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Even page header 2"), parseDump("/root/page[6]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Even page footer 2"), parseDump("/root/page[6]/footer/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("First page header"), parseDump("/root/page[1]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("First page footer"), parseDump("/root/page[1]/footer/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Even page header"), parseDump("/root/page[2]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Even page footer"), parseDump("/root/page[2]/footer/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Odd page header"), parseDump("/root/page[3]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Odd page footer"), parseDump("/root/page[3]/footer/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("First page header2"), parseDump("/root/page[4]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("First page footer 2"), parseDump("/root/page[4]/footer/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Odd page header 2"), parseDump("/root/page[5]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Odd page footer 2"), parseDump("/root/page[5]/footer/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Even page header 2"), parseDump("/root/page[6]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Even page footer 2"), parseDump("/root/page[6]/footer/txt/text()"_ostr));
}
DECLARE_WW8EXPORT_TEST(testZoom, "zoom.doc")
@@ -930,16 +930,16 @@ DECLARE_WW8EXPORT_TEST(testZoomType, "zoomtype.doc")
DECLARE_WW8EXPORT_TEST(test56513, "fdo56513.doc")
{
- CPPUNIT_ASSERT_EQUAL(OUString("This is the header of the first section"), parseDump("/root/page[1]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("This is the first page header of the second section"), parseDump("/root/page[2]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("This is the non-first-page header of the second section"), parseDump("/root/page[3]/header/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("This is the header of the first section"), parseDump("/root/page[1]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("This is the first page header of the second section"), parseDump("/root/page[2]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("This is the non-first-page header of the second section"), parseDump("/root/page[3]/header/txt/text()"_ostr));
}
DECLARE_WW8EXPORT_TEST(testNewPageStylesTable, "new-page-styles.doc")
{
- CPPUNIT_ASSERT_EQUAL(OUString("Sigma Space Performance Goals and Results (Page 1)*"), parseDump("/root/page[1]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Sigma Space Performance Assessment (Page 2)****"), parseDump("/root/page[2]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Sigma Space Performance Goals: Next Year (Page 3)*******"), parseDump("/root/page[3]/header/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Sigma Space Performance Goals and Results (Page 1)*"), parseDump("/root/page[1]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Sigma Space Performance Assessment (Page 2)****"), parseDump("/root/page[2]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Sigma Space Performance Goals: Next Year (Page 3)*******"), parseDump("/root/page[3]/header/txt/text()"_ostr));
}
CPPUNIT_TEST_FIXTURE(Test, testFdo42144)
@@ -1448,8 +1448,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTableKeep)
loadAndReload("tdf91083.odt");
CPPUNIT_ASSERT_EQUAL(7, getPages());
//emulate table "keep with next" -do not split table
- CPPUNIT_ASSERT_EQUAL( OUString("Row 1"), parseDump("/root/page[3]/body/tab[1]/row[2]/cell[1]/txt[1]") );
- CPPUNIT_ASSERT_EQUAL( OUString("Row 1"), parseDump("/root/page[6]/body/tab[1]/row[2]/cell[1]/txt[1]") );
+ CPPUNIT_ASSERT_EQUAL( OUString("Row 1"), parseDump("/root/page[3]/body/tab[1]/row[2]/cell[1]/txt[1]"_ostr) );
+ CPPUNIT_ASSERT_EQUAL( OUString("Row 1"), parseDump("/root/page[6]/body/tab[1]/row[2]/cell[1]/txt[1]"_ostr) );
}
#endif
@@ -1458,13 +1458,13 @@ CPPUNIT_TEST_FIXTURE(Test, tesTdf91083_tableKeep2)
loadAndReload("tdf91083_tableKeep2.odt");
//emulate table "keep with next" - split large row in order to keep with previous paragraph
CPPUNIT_ASSERT_EQUAL_MESSAGE("Table doesn't split, so it starts on page 2",
- OUString("0"), parseDump("count(//page[1]//tab)") );
+ OUString("0"), parseDump("count(//page[1]//tab)"_ostr) );
CPPUNIT_ASSERT_EQUAL_MESSAGE("Page 2 starts with a paragraph/title, not a table",
- OUString("KeepWithNext"), parseDump("//page[2]/body/txt[1]") );
+ OUString("KeepWithNext"), parseDump("//page[2]/body/txt[1]"_ostr) );
CPPUNIT_ASSERT_EQUAL_MESSAGE("Table sticks with previous paragraph, so it starts on page 2",
- OUString("1"), parseDump("count(//page[2]//tab)") );
+ OUString("1"), parseDump("count(//page[2]//tab)"_ostr) );
CPPUNIT_ASSERT_MESSAGE("Row itself splits, not the table at a row boundary",
- "Cell 2" != parseDump("//page[3]//tab//row[2]/cell[1]/txt[1]") );
+ "Cell 2" != parseDump("//page[3]//tab//row[2]/cell[1]/txt[1]"_ostr) );
}
CPPUNIT_TEST_FIXTURE(Test, tesTdf91083_tableKeep3)
@@ -1473,15 +1473,15 @@ CPPUNIT_TEST_FIXTURE(Test, tesTdf91083_tableKeep3)
CPPUNIT_ASSERT_EQUAL(3, getPages());
//emulate table "keep with next" - split single row table in order to keep with previous paragraph
CPPUNIT_ASSERT_EQUAL_MESSAGE("Table doesn't split, so it starts on page 2",
- OUString("0"), parseDump("count(//page[1]//tab)") );
+ OUString("0"), parseDump("count(//page[1]//tab)"_ostr) );
CPPUNIT_ASSERT_EQUAL_MESSAGE("Table sticks with previous paragraph, so it starts on page 2",
- OUString("1"), parseDump("count(//page[2]//tab)") );
+ OUString("1"), parseDump("count(//page[2]//tab)"_ostr) );
}
DECLARE_WW8EXPORT_TEST(testTdf76349_textboxMargins, "tdf76349_textboxMargins.doc")
{
// textboxes without borders were losing their spacing items in round-tripping
- CPPUNIT_ASSERT( 0 < parseDump("/root/page/body/txt/anchored/fly/infos/prtBounds", "left").toInt32() );
+ CPPUNIT_ASSERT( 0 < parseDump("/root/page/body/txt/anchored/fly/infos/prtBounds"_ostr, "left"_ostr).toInt32() );
uno::Reference<drawing::XShape> xShape = getShape(1);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Textbox background color", Color(0xD8, 0xD8, 0xD8), getProperty<Color>(xShape, "BackColor"));
diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx
index ef2142114872..0a8693489344 100644
--- a/sw/qa/extras/ww8export/ww8export2.cxx
+++ b/sw/qa/extras/ww8export/ww8export2.cxx
@@ -50,11 +50,11 @@ public:
DECLARE_WW8EXPORT_TEST(testTdf99120, "tdf99120.doc")
{
- CPPUNIT_ASSERT_EQUAL(OUString("Section 1, odd."), parseDump("/root/page[1]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Section 1, even."), parseDump("/root/page[2]/header/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Section 1, odd."), parseDump("/root/page[1]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Section 1, even."), parseDump("/root/page[2]/header/txt/text()"_ostr));
// This failed: the header was empty on the 3rd page, as the first page header was shown.
- CPPUNIT_ASSERT_EQUAL(OUString("Section 2, odd."), parseDump("/root/page[3]/header/txt/text()"));
- CPPUNIT_ASSERT_EQUAL(OUString("Section 2, even."), parseDump("/root/page[4]/header/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Section 2, odd."), parseDump("/root/page[3]/header/txt/text()"_ostr));
+ CPPUNIT_ASSERT_EQUAL(OUString("Section 2, even."), parseDump("/root/page[4]/header/txt/text()"_ostr));
}
CPPUNIT_TEST_FIXTURE(Test, testTdf41542_borderlessPadding)
@@ -129,15 +129,15 @@ DECLARE_WW8EXPORT_TEST(testTdf37153, "tdf37153_considerWrapOnObjPos.doc")
//For MSO compatibility, the image should be at the top of the cell, not at the bottom - despite VertOrientation::BOTTOM
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- sal_Int32 nFlyTop = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt/anchored/fly/infos/bounds", "top").toInt32();
+ sal_Int32 nFlyTop = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[1]/txt/anchored/fly/infos/bounds"_ostr, "top"_ostr).toInt32();
CPPUNIT_ASSERT_MESSAGE("FlyTop should be 3820, not 6623", nFlyTop < 4000);
- sal_Int32 nTextTop = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[2]/txt[1]/infos/bounds", "top").toInt32();
+ sal_Int32 nTextTop = getXPath(pXmlDoc, "/root/page/body/tab/row/cell[2]/txt[1]/infos/bounds"_ostr, "top"_ostr).toInt32();
CPPUNIT_ASSERT_MESSAGE("TextTop should be 5388", nTextTop > 4000);
}
DECLARE_WW8EXPORT_TEST(testTdf49102_mergedCellNumbering, "tdf49102_mergedCellNumbering.doc")
{
- CPPUNIT_ASSERT_EQUAL( OUString("2."), parseDump("/root/page/body/tab/row[4]/cell/txt/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']", "expand") );
+ CPPUNIT_ASSERT_EQUAL( OUString("2."), parseDump("/root/page/body/tab/row[4]/cell/txt/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']"_ostr, "expand"_ostr) );
}
CPPUNIT_TEST_FIXTURE(Test, testTdf55427_footnote2endnote)
@@ -1099,12 +1099,12 @@ DECLARE_WW8EXPORT_TEST(testTdf117885, "tdf117885.doc")
/* Get the vertical position of the paragraph containing the text "Start" */
sal_Int32 nParaA_Top = getXPath(pXmlDoc,
- "/root/page/body/column[1]/body/txt[text()='Start']/infos/bounds", "top"
+ "/root/page/body/column[1]/body/txt[text()='Start']/infos/bounds"_ostr, "top"_ostr
).toInt32();
/* Get the vertical position of the paragraph containing the text "Top B" */
sal_Int32 nParaB_Top = getXPath(pXmlDoc,
- "/root/page/body/column[2]/body/txt[text()='Top B']/infos/bounds", "top"
+ "/root/page/body/column[2]/body/txt[text()='Top B']/infos/bounds"_ostr, "top"_ostr
).toInt32();
/* These two paragraphs are supposed to be at the top of the left
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx
index 749297cf3049..97ea979d01e8 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -169,7 +169,7 @@ DECLARE_WW8EXPORT_TEST(testTdf104596_wrapInHeaderTable, "tdf104596_wrapInHeaderT
{
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
- sal_Int32 nRowHeight = getXPath(pXmlDoc, "//header/tab/row[1]/infos/bounds", "height").toInt32();
+ sal_Int32 nRowHeight = getXPath(pXmlDoc, "//header/tab/row[1]/infos/bounds"_ostr, "height"_ostr).toInt32();
// The fly is supposed to be no-wrap, so the text should come underneath it, not wrap-through,
// thus making the row much higher. Before, height was 706. Now it is 1067.
CPPUNIT_ASSERT_MESSAGE("Text must wrap under green box", nRowHeight > 1000);
@@ -679,9 +679,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf94009_zeroPgMargin)
DECLARE_WW8EXPORT_TEST(testTdf108518_CRnumformatting, "tdf108518_CRnumformatting.doc")
{
- CPPUNIT_ASSERT_EQUAL(OUString("6.2.3."), parseDump("//body/txt[4]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']", "expand"));
+ CPPUNIT_ASSERT_EQUAL(OUString("6.2.3."), parseDump("//body/txt[4]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']"_ostr, "expand"_ostr));
//Without this fix in place, it would become 200 (and non-bold).
- CPPUNIT_ASSERT_EQUAL(OUString("220"), parseDump("//body/txt[4]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']/SwFont", "height"));
+ CPPUNIT_ASSERT_EQUAL(OUString("220"), parseDump("//body/txt[4]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']/SwFont"_ostr, "height"_ostr));
}
DECLARE_WW8EXPORT_TEST(testTdf120711_joinedParagraphWithChangeTracking, "tdf120711.doc")
@@ -856,7 +856,7 @@ DECLARE_WW8EXPORT_TEST(testPresetDash, "tdf127166_prstDash_Word97.doc")
const auto& pLayout = parseLayoutDump();
// Ensure that there is no tabstop in the first paragraph (despite chapter numbering's setting)
// This is a pre-emptive test to ensure something visibly correct is not broken.
- assertXPath(pLayout, "//body/txt[1]//SwFixPortion", 0);
+ assertXPath(pLayout, "//body/txt[1]//SwFixPortion"_ostr, 0);
}
CPPUNIT_TEST_FIXTURE(Test, testRtlGutter)
diff --git a/sw/qa/extras/ww8export/ww8export4.cxx b/sw/qa/extras/ww8export/ww8export4.cxx
index 837f65c2e5ae..d47c934d9dd6 100644
--- a/sw/qa/extras/ww8export/ww8export4.cxx
+++ b/sw/qa/extras/ww8export/ww8export4.cxx
@@ -59,9 +59,9 @@ DECLARE_WW8EXPORT_TEST(testTdf150197_anlv2ListFormat, "tdf150197_anlv2ListFormat
DECLARE_WW8EXPORT_TEST(testTdf117994_CRnumformatting, "tdf117994_CRnumformatting.doc")
{
- CPPUNIT_ASSERT_EQUAL(OUString("1."), parseDump("//body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']", "expand"));
+ CPPUNIT_ASSERT_EQUAL(OUString("1."), parseDump("//body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']"_ostr, "expand"_ostr));
//Without this fix in place, it would become 200 (and non-bold).
- CPPUNIT_ASSERT_EQUAL(OUString("160"), parseDump("//body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']/SwFont", "height"));
+ CPPUNIT_ASSERT_EQUAL(OUString("160"), parseDump("//body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']/SwFont"_ostr, "height"_ostr));
}
DECLARE_WW8EXPORT_TEST(testTdf151548_formFieldMacros, "tdf151548_formFieldMacros.doc")
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index 47a9e41f5352..58c2bcfbf138 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -59,7 +59,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBnc875715)
CPPUNIT_TEST_FIXTURE(Test, testFloatingTableSectionColumns)
{
createSwDoc("floating-table-section-columns.doc");
- OUString tableWidth = parseDump("/root/page[1]/body/section/column[2]/body/txt/anchored/fly/tab/infos/bounds", "width");
+ OUString tableWidth = parseDump("/root/page[1]/body/section/column[2]/body/txt/anchored/fly/tab/infos/bounds"_ostr, "width"_ostr);
// table width was restricted by a column
CPPUNIT_ASSERT( tableWidth.toInt32() > 10000 );
}
@@ -117,9 +117,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf106799)
for (sal_Int32 nCell : { 0, 1, 2, 3 })
{
OString cellXPath("/root/page/body/tab/row/cell/tab/row[" + OString::number(nRow+1) + "]/cell[" + OString::number(nCell+1) + "]/");
- CPPUNIT_ASSERT_EQUAL_MESSAGE(cellXPath.getStr(), nCellWidths[nRow][nCell], parseDump(cellXPath + "infos/bounds", "width").toInt32());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(cellXPath.getStr(), nCellWidths[nRow][nCell], parseDump(cellXPath + "infos/bounds", "width"_ostr).toInt32());
if (nCellTxtLns[nRow][nCell] != 0)
- CPPUNIT_ASSERT_EQUAL_MESSAGE(cellXPath.getStr(), nCellTxtLns[nRow][nCell], parseDump(cellXPath + "txt/SwParaPortion/SwLineLayout", "length").toInt32());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(cellXPath.getStr(), nCellTxtLns[nRow][nCell], parseDump(cellXPath + "txt/SwParaPortion/SwLineLayout", "length"_ostr).toInt32());
}
}
diff --git a/sw/qa/filter/html/html.cxx b/sw/qa/filter/html/html.cxx
index 91f322137ef1..4923cd605468 100644
--- a/sw/qa/filter/html/html.cxx
+++ b/sw/qa/filter/html/html.cxx
@@ -126,7 +126,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSvmImageExport)
// - Actual : 2
// - XPath '//reqif-xhtml:object' number of nodes is incorrect
// i.e. we wrote both GIF and PNG, not just PNG for SVM images.
- assertXPath(pXmlDoc, "//reqif-xhtml:object", "type", "image/png");
+ assertXPath(pXmlDoc, "//reqif-xhtml:object"_ostr, "type"_ostr, "image/png");
}
CPPUNIT_TEST_FIXTURE(Test, testTableCellFloatValueType)
@@ -156,8 +156,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTableCellFloatValueType)
// Without the accompanying fix in place, this test would have failed with:
// - XPath '//reqif-xhtml:td' unexpected 'sdval' attribute
// i.e. sdval was written in XHTML mode.
- assertXPathNoAttribute(pXmlDoc, "//reqif-xhtml:td", "sdval");
- assertXPathNoAttribute(pXmlDoc, "//reqif-xhtml:td", "sdnum");
+ assertXPathNoAttribute(pXmlDoc, "//reqif-xhtml:td"_ostr, "sdval"_ostr);
+ assertXPathNoAttribute(pXmlDoc, "//reqif-xhtml:td"_ostr, "sdnum"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testTableRowSpanInAllCells)
@@ -189,8 +189,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTableRowSpanInAllCells)
// Without the accompanying fix in place, this test would have failed with:
// - XPath '//tr[1]/td[1]' unexpected 'rowspan' attribute
// i.e. a combination of rowspan + empty <tr> was emitted.
- assertXPathNoAttribute(pHtmlDoc, "//tr[1]/td[1]", "rowspan");
- assertXPath(pHtmlDoc, "//tr", 1);
+ assertXPathNoAttribute(pHtmlDoc, "//tr[1]/td[1]"_ostr, "rowspan"_ostr);
+ assertXPath(pHtmlDoc, "//tr"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testCenteredTableCSSExport)
@@ -217,8 +217,9 @@ CPPUNIT_TEST_FIXTURE(Test, testCenteredTableCSSExport)
// - Expected: 0
// - Actual : 1
// i.e <center> was used to position the table, not CSS.
- assertXPath(pXmlDoc, "//reqif-xhtml:center", 0);
- assertXPath(pXmlDoc, "//reqif-xhtml:table", "style", "margin-left: auto; margin-right: auto");
+ assertXPath(pXmlDoc, "//reqif-xhtml:center"_ostr, 0);
+ assertXPath(pXmlDoc, "//reqif-xhtml:table"_ostr, "style"_ostr,
+ "margin-left: auto; margin-right: auto");
}
CPPUNIT_TEST_FIXTURE(Test, testCenteredTableCSSImport)
diff --git a/sw/qa/filter/ww8/ww8.cxx b/sw/qa/filter/ww8/ww8.cxx
index 1d863545578e..af19051a03e5 100644
--- a/sw/qa/filter/ww8/ww8.cxx
+++ b/sw/qa/filter/ww8/ww8.cxx
@@ -101,7 +101,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPlainTextContentControlExport)
// - Actual : 0
// - XPath '//w:sdt/w:sdtPr/w:text' number of nodes is incorrect
// i.e. the plain text content control was turned into a rich text one on export.
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:text", 1);
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:text"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testDocxComboBoxContentControlExport)
@@ -122,7 +122,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDocxComboBoxContentControlExport)
// - Actual : 0
// - XPath '//w:sdt/w:sdtPr/w:comboBox' number of nodes is incorrect
// i.e. the combo box content control was turned into a drop-down one on export.
- assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:comboBox", 1);
+ assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:comboBox"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testDocxHyperlinkShape)
@@ -172,7 +172,8 @@ CPPUNIT_TEST_FIXTURE(Test, testDocxContentControlDropdownEmptyDisplayText)
// Without the accompanying fix in place, this test would have failed with:
// - XPath '//w:sdt/w:sdtPr/w:dropDownList/w:listItem' unexpected 'displayText' attribute
// i.e. we wrote an empty attribute instead of omitting it.
- assertXPathNoAttribute(pXmlDoc, "//w:sdt/w:sdtPr/w:dropDownList/w:listItem", "displayText");
+ assertXPathNoAttribute(pXmlDoc, "//w:sdt/w:sdtPr/w:dropDownList/w:listItem"_ostr,
+ "displayText"_ostr);
}
CPPUNIT_TEST_FIXTURE(Test, testDocxSymbolFontExport)
@@ -198,9 +199,9 @@ CPPUNIT_TEST_FIXTURE(Test, testDocxSymbolFontExport)
// Then make sure the expected markup is used:
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- assertXPath(pXmlDoc, "//w:p/w:r/w:sym", 1);
- assertXPath(pXmlDoc, "//w:p/w:r/w:sym[1]", "font", "Wingdings");
- assertXPath(pXmlDoc, "//w:p/w:r/w:sym[1]", "char", "f0e0");
+ assertXPath(pXmlDoc, "//w:p/w:r/w:sym"_ostr, 1);
+ assertXPath(pXmlDoc, "//w:p/w:r/w:sym[1]"_ostr, "font"_ostr, "Wingdings");
+ assertXPath(pXmlDoc, "//w:p/w:r/w:sym[1]"_ostr, "char"_ostr, "f0e0");
}
CPPUNIT_TEST_FIXTURE(Test, testDocxFloatingTableExport)
@@ -235,7 +236,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDocxFloatingTableExport)
// Without the accompanying fix in place, this test would have failed with:
// - XPath '//w:tbl/w:tblPr/w:tblpPr' number of nodes is incorrect
// i.e. no floating table was exported.
- assertXPath(pXmlDoc, "//w:tbl/w:tblPr/w:tblpPr", 1);
+ assertXPath(pXmlDoc, "//w:tbl/w:tblPr/w:tblpPr"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testDocFloatingTableImport)
@@ -282,7 +283,7 @@ CPPUNIT_TEST_FIXTURE(Test, testWrapThroughLayoutInCell)
// - Actual : 0
// - attribute 'layoutInCell' of '//wp:anchor' incorrect value.
// i.e. layoutInCell was disabled, leading to bad layout in Word.
- assertXPath(pXmlDoc, "//wp:anchor", "layoutInCell", "1");
+ assertXPath(pXmlDoc, "//wp:anchor"_ostr, "layoutInCell"_ostr, "1");
}
CPPUNIT_TEST_FIXTURE(Test, test3Endnotes)
@@ -329,7 +330,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDoNotBreakWrappedTables)
// - Actual : 0
// - XPath '/w:settings/w:compat/w:doNotBreakWrappedTables' number of nodes is incorrect
// i.e. <w:doNotBreakWrappedTables> was not written.
- assertXPath(pXmlDoc, "/w:settings/w:compat/w:doNotBreakWrappedTables", 1);
+ assertXPath(pXmlDoc, "/w:settings/w:compat/w:doNotBreakWrappedTables"_ostr, 1);
}
CPPUNIT_TEST_FIXTURE(Test, testAllowTextAfterFloatingTableBreak)
@@ -350,9 +351,10 @@ CPPUNIT_TEST_FIXTURE(Test, testAllowTextAfterFloatingTableBreak)
// - Actual : 0
// - XPath '/w:settings/w:compat/w:compatSetting[@w:name='allowTextAfterFloatingTableBreak']' number of nodes is incorrect
// i.e. the compat flag was lost on export.
- assertXPath(pXmlDoc,
- "/w:settings/w:compat/w:compatSetting[@w:name='allowTextAfterFloatingTableBreak']",
- "val", "1");
+ assertXPath(
+ pXmlDoc,
+ "/w:settings/w:compat/w:compatSetting[@w:name='allowTextAfterFloatingTableBreak']"_ostr,
+ "val"_ostr, "1");
}
CPPUNIT_TEST_FIXTURE(Test, testDOCfDontBreakWrappedTables)
@@ -383,7 +385,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDOCFloatingTableHiddenAnchor)
// - Expected: 2
// - Actual : 1
// i.e. the floating table was lost.
- assertXPath(pLayout, "//tab", 2);
+ assertXPath(pLayout, "//tab"_ostr, 2);
}
CPPUNIT_TEST_FIXTURE(Test, testDOCVerticalFlyOffset)
@@ -478,7 +480,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFloattableOverlapNeverDOCXExport)
// - Actual : 0
// - XPath '//w:tblPr/w:tblOverlap' number of nodes is incorrect
// i.e. <w:tblOverlap> was not written.
- assertXPath(pXmlDoc, "//w:tblPr/w:tblOverlap", "val", "never");
+ assertXPath(pXmlDoc, "//w:tblPr/w:tblOverlap"_ostr, "val"_ostr, "never");
}
CPPUNIT_TEST_FIXTURE(Test, testFloattableOverlapNeverDOCImport)
diff --git a/sw/qa/uibase/shells/shells.cxx b/sw/qa/uibase/shells/shells.cxx
index 8551ef685e1f..2111cedf2502 100644
--- a/sw/qa/uibase/shells/shells.cxx
+++ b/sw/qa/uibase/shells/shells.cxx
@@ -537,7 +537,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testUpdateBookmarks)
]
}
}
-)json");
+)json"_ostr);
uno::Sequence<beans::PropertyValue> aArgs = comphelper::containerToSequence(aArgsVec);
dispatchCommand(mxComponent, ".uno:UpdateBookmarks", aArgs);
@@ -637,7 +637,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testUpdateRefmarks)
]
}
}
-)json");
+)json"_ostr);
aArgs = comphelper::containerToSequence(aArgsVec);
dispatchCommand(mxComponent, ".uno:UpdateFields", aArgs);
@@ -695,7 +695,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testUpdateFieldmark)
}
}
}
-)json");
+)json"_ostr);
aArgs = comphelper::containerToSequence(aArgsVec);
dispatchCommand(mxComponent, ".uno:UpdateTextFormField", aArgs);
@@ -746,7 +746,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testUpdateSections)
]
}
}
-)json");
+)json"_ostr);
aArgs = comphelper::containerToSequence(aArgsVec);
dispatchCommand(mxComponent, ".uno:UpdateSections", aArgs);
@@ -843,7 +843,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testUpdateBookmark)
}
}
}
-)json");
+)json"_ostr);
uno::Sequence<beans::PropertyValue> aArgs = comphelper::containerToSequence(aArgsVec);
dispatchCommand(mxComponent, ".uno:UpdateBookmark", aArgs);
@@ -897,7 +897,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testUpdateRefmark)
}
}
}
-)json");
+)json"_ostr);
aArgs = comphelper::containerToSequence(aArgsVec);
dispatchCommand(mxComponent, ".uno:UpdateField", aArgs);
@@ -935,7 +935,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testDeleteBookmarks)
"value": "ZOTERO_BREF_"
}
}
-)json");
+)json"_ostr);
uno::Sequence<beans::PropertyValue> aArgs = comphelper::containerToSequence(aArgsVec);
dispatchCommand(mxComponent, ".uno:DeleteBookmarks", aArgs);
@@ -972,7 +972,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testDeleteFields)
"value": "ZOTERO_ITEM CSL_CITATION"
}
}
-)json");
+)json"_ostr);
aArgs = comphelper::containerToSequence(aArgsVec);
dispatchCommand(mxComponent, ".uno:DeleteFields", aArgs);
diff --git a/sw/qa/uibase/shells/textsh.cxx b/sw/qa/uibase/shells/textsh.cxx
index f4c63ad5e8d8..ca72a710df3f 100644
--- a/sw/qa/uibase/shells/textsh.cxx
+++ b/sw/qa/uibase/shells/textsh.cxx
@@ -56,7 +56,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDeleteSections)
"value": "ZOTERO_BIBL"
}
}
-)json");
+)json"_ostr);
aArgs = comphelper::containerToSequence(aArgsVec);
dispatchCommand(mxComponent, ".uno:DeleteSections", aArgs);
diff --git a/sw/qa/uibase/uiview/uiview.cxx b/sw/qa/uibase/uiview/uiview.cxx
index 5a0f1db584e2..27231d28e8d6 100644
--- a/sw/qa/uibase/uiview/uiview.cxx
+++ b/sw/qa/uibase/uiview/uiview.cxx
@@ -136,7 +136,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, testKeepRatio)
// Then export as well:
save("writer8");
xmlDocUniquePtr pXmlDoc = parseExport("settings.xml");
- assertXPathContent(pXmlDoc, "//config:config-item[@config:name='KeepRatio']", "true");
+ assertXPathContent(pXmlDoc, "//config:config-item[@config:name='KeepRatio']"_ostr, "true");
}
namespace
diff --git a/sw/source/core/crsr/bookmark.cxx b/sw/source/core/crsr/bookmark.cxx
index 5b27a5b558ec..24114b141b56 100644
--- a/sw/source/core/crsr/bookmark.cxx
+++ b/sw/source/core/crsr/bookmark.cxx
@@ -1030,7 +1030,7 @@ namespace sw::mark
void DropDownFieldmark::SendLOKHideMessage(const SfxViewShell* pViewShell)
{
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_FORM_FIELD_BUTTON,
- "{\"action\": \"hide\", \"type\": \"drop-down\"}");
+ "{\"action\": \"hide\", \"type\": \"drop-down\"}"_ostr);
}
DateFieldmark::DateFieldmark(const SwPaM& rPaM)
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 17923c83d255..9a18e7934c03 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -1235,7 +1235,7 @@ void SwFEShell::EndTextEdit()
pView->SdrEndTextEdit();
if (comphelper::LibreOfficeKit::isActive())
- SfxLokHelper::notifyOtherViews(GetSfxViewShell(), LOK_CALLBACK_VIEW_LOCK, "rectangle", "EMPTY");
+ SfxLokHelper::notifyOtherViews(GetSfxViewShell(), LOK_CALLBACK_VIEW_LOCK, "rectangle", "EMPTY"_ostr);
EndAllAction();
}
diff --git a/sw/source/core/inc/swfntcch.hxx b/sw/source/core/inc/swfntcch.hxx
index 7e25d4d096ff..a895ee85502c 100644
--- a/sw/source/core/inc/swfntcch.hxx
+++ b/sw/source/core/inc/swfntcch.hxx
@@ -33,7 +33,7 @@ public:
SwFontCache() : SwCache(50
#ifdef DBG_UTIL
- , "Global AttributeSet/Font-Cache pSwFontCache"
+ , "Global AttributeSet/Font-Cache pSwFontCache"_ostr
#endif
) {}
diff --git a/sw/source/core/layout/dbg_lay.cxx b/sw/source/core/layout/dbg_lay.cxx
index 256038d24c6d..7fa2a7cb5c75 100644
--- a/sw/source/core/layout/dbg_lay.cxx
+++ b/sw/source/core/layout/dbg_lay.cxx
@@ -528,12 +528,12 @@ static OString lcl_RowInfo(const SwRowFrame* pFrame)
{
// dummy, needs actual functionality...
if (pFrame == nullptr)
- return "";
+ return ""_ostr;
const SwTableLine* pTabLine = pFrame->GetTabLine();
if (pTabLine == nullptr)
- return "";
+ return ""_ostr;
- return "RowInfo";
+ return "RowInfo"_ostr;
}
static OUString lcl_CellText(const SwCellFrame* pFrame)
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index f68b24ef72e6..8965441cc068 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -298,7 +298,7 @@ void FrameInit()
SwRootFrame::s_pVout = new SwLayVout();
SwCache *pNew = new SwCache( 100
#ifdef DBG_UTIL
- , "static SwBorderAttrs::pCache"
+ , "static SwBorderAttrs::pCache"_ostr
#endif
);
SwFrame::SetCache( pNew );
diff --git a/sw/source/core/model/SearchResultLocator.cxx b/sw/source/core/model/SearchResultLocator.cxx
index c3c4a83460b5..fafc284e910c 100644
--- a/sw/source/core/model/SearchResultLocator.cxx
+++ b/sw/source/core/model/SearchResultLocator.cxx
@@ -158,9 +158,9 @@ bool SearchResultLocator::tryParseXML(const char* pPayload,
{
if (aWalker.name() == "paragraph")
{
- OString sType = aWalker.attribute("node_type");
- OString sIndex = aWalker.attribute("index");
- OString sObjectName = aWalker.attribute("object_name");
+ OString sType = aWalker.attribute("node_type"_ostr);
+ OString sIndex = aWalker.attribute("index"_ostr);
+ OString sObjectName = aWalker.attribute("object_name"_ostr);
if (!sType.isEmpty() && !sIndex.isEmpty())
{
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index f043530de702..88f79aff22e5 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -800,7 +800,7 @@ void SwTextFrame::dumpAsXmlAttributes(xmlTextWriterPtr writer) const
const SwTextNode *pTextNode = GetTextNodeFirst();
(void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "txtNodeIndex" ), "%" SAL_PRIdINT32, sal_Int32(pTextNode->GetIndex()) );
- OString aMode = "Horizontal";
+ OString aMode = "Horizontal"_ostr;
if (IsVertLRBT())
{
aMode = "VertBTLR";
diff --git a/sw/source/core/text/txtinit.cxx b/sw/source/core/text/txtinit.cxx
index b8a6540f6318..2b8bb2e95d21 100644
--- a/sw/source/core/text/txtinit.cxx
+++ b/sw/source/core/text/txtinit.cxx
@@ -40,7 +40,7 @@ void TextInit_()
pSwFontCache = new SwFontCache; // Cache for SwTextFormatColl -> SwFontObj = { SwFont aSwFont, SfxPoolItem* pDefaultArray }
SwCache *pTextCache = new SwCache( 250 // Cache for SwTextFrame -> SwTextLine = { SwParaPortion* pLine }
#ifdef DBG_UTIL
- , "static SwTextFrame::s_pTextCache"
+ , "static SwTextFrame::s_pTextCache"_ostr
#endif
);
SwTextFrame::SetTextCache( pTextCache );
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index b98ba5cf73d1..deaaa5ea8a66 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -623,22 +623,22 @@ sal_uInt16 SwHTMLWriter::GetCSS1Selector( const SwFormat *pFormat, OString& rTok
if (!bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_blockquote)
{
rRefPoolId = RES_POOLCOLL_HTML_BLOCKQUOTE;
- rToken = OString(OOO_STRING_SVTOOLS_HTML_blockquote);
+ rToken = OOO_STRING_SVTOOLS_HTML_blockquote ""_ostr;
}
else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_citation)
{
rRefPoolId = RES_POOLCHR_HTML_CITATION;
- rToken = OString(OOO_STRING_SVTOOLS_HTML_citation);
+ rToken = OOO_STRING_SVTOOLS_HTML_citation ""_ostr;
}
else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_code)
{
rRefPoolId = RES_POOLCHR_HTML_CODE;
- rToken = OString(OOO_STRING_SVTOOLS_HTML_code);
+ rToken = OOO_STRING_SVTOOLS_HTML_code ""_ostr;
}
else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_definstance)
{
rRefPoolId = RES_POOLCHR_HTML_DEFINSTANCE;
- rToken = OString(OOO_STRING_SVTOOLS_HTML_definstance);
+ rToken = OOO_STRING_SVTOOLS_HTML_definstance ""_ostr;
}
else if (!bChrFormat && (aNm == OOO_STRING_SVTOOLS_HTML_dd ||
aNm == OOO_STRING_SVTOOLS_HTML_dt))
@@ -656,19 +656,19 @@ sal_uInt16 SwHTMLWriter::GetCSS1Selector( const SwFormat *pFormat, OString& rTok
else if (nDefListLvl & HTML_DLCOLL_DD)
{
rRefPoolId = RES_POOLCOLL_HTML_DD;
- rToken = OString(OOO_STRING_SVTOOLS_HTML_dd);
+ rToken = OOO_STRING_SVTOOLS_HTML_dd ""_ostr;
}
else
{
rRefPoolId = RES_POOLCOLL_HTML_DT;
- rToken = OString(OOO_STRING_SVTOOLS_HTML_dt);
+ rToken = OOO_STRING_SVTOOLS_HTML_dt ""_ostr;
}
}
}
else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_emphasis)
{
rRefPoolId = RES_POOLCHR_HTML_EMPHASIS;
- rToken = OString(OOO_STRING_SVTOOLS_HTML_emphasis);
+ rToken = OOO_STRING_SVTOOLS_HTML_emphasis ""_ostr;
}
else if (!bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_horzrule)
{
@@ -678,44 +678,44 @@ sal_uInt16 SwHTMLWriter::GetCSS1Selector( const SwFormat *pFormat, OString& rTok
else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_keyboard)
{
rRefPoolId = RES_POOLCHR_HTML_KEYBOARD;
- rToken = OString(OOO_STRING_SVTOOLS_HTML_keyboard);
+ rToken = OOO_STRING_SVTOOLS_HTML_keyboard ""_ostr;
}
else if (!bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_listing)
{
// Export Listings as PRE or PRE-derived template
- rToken = OString(OOO_STRING_SVTOOLS_HTML_preformtxt);
+ rToken = OOO_STRING_SVTOOLS_HTML_preformtxt ""_ostr;
rRefPoolId = RES_POOLCOLL_HTML_PRE;
nDeep = CSS1_FMT_CMPREF;
}
else if (!bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_preformtxt)
{
rRefPoolId = RES_POOLCOLL_HTML_PRE;
- rToken = OString(OOO_STRING_SVTOOLS_HTML_preformtxt);
+ rToken = OOO_STRING_SVTOOLS_HTML_preformtxt ""_ostr;
}
else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_sample)
{
rRefPoolId = RES_POOLCHR_HTML_SAMPLE;
- rToken = OString(OOO_STRING_SVTOOLS_HTML_sample);
+ rToken = OOO_STRING_SVTOOLS_HTML_sample ""_ostr;
}
else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_strong)
{
rRefPoolId = RES_POOLCHR_HTML_STRONG;
- rToken = OString(OOO_STRING_SVTOOLS_HTML_strong);
+ rToken = OOO_STRING_SVTOOLS_HTML_strong ""_ostr;
}
else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_teletype)
{
rRefPoolId = RES_POOLCHR_HTML_TELETYPE;
- rToken = OString(OOO_STRING_SVTOOLS_HTML_teletype);
+ rToken = OOO_STRING_SVTOOLS_HTML_teletype ""_ostr;
}
else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_variable)
{
rRefPoolId = RES_POOLCHR_HTML_VARIABLE;
- rToken = OString(OOO_STRING_SVTOOLS_HTML_variable);
+ rToken = OOO_STRING_SVTOOLS_HTML_variable ""_ostr;
}
else if (!bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_xmp)
{
// export XMP as PRE (but not the template as Style)
- rToken = OString(OOO_STRING_SVTOOLS_HTML_preformtxt);
+ rToken = OOO_STRING_SVTOOLS_HTML_preformtxt ""_ostr;
rRefPoolId = RES_POOLCOLL_HTML_PRE;
nDeep = CSS1_FMT_CMPREF;
}
@@ -736,41 +736,41 @@ sal_uInt16 SwHTMLWriter::GetCSS1Selector( const SwFormat *pFormat, OString& rTok
bStop = (nDeep==0);
break;
case RES_POOLCOLL_TEXT:
- rToken = OString(OOO_STRING_SVTOOLS_HTML_parabreak);
+ rToken = OOO_STRING_SVTOOLS_HTML_parabreak ""_ostr;
break;
case RES_POOLCOLL_HEADLINE1:
- rToken = OString(OOO_STRING_SVTOOLS_HTML_head1);
+ rToken = OOO_STRING_SVTOOLS_HTML_head1 ""_ostr;
break;
case RES_POOLCOLL_HEADLINE2:
- rToken = OString(OOO_STRING_SVTOOLS_HTML_head2);
+ rToken = OOO_STRING_SVTOOLS_HTML_head2 ""_ostr;
break;
case RES_POOLCOLL_HEADLINE3:
- rToken = OString(OOO_STRING_SVTOOLS_HTML_head3);
+ rToken = OOO_STRING_SVTOOLS_HTML_head3 ""_ostr;
break;
case RES_POOLCOLL_HEADLINE4:
- rToken = OString(OOO_STRING_SVTOOLS_HTML_head4);
+ rToken = OOO_STRING_SVTOOLS_HTML_head4 ""_ostr;
break;
case RES_POOLCOLL_HEADLINE5:
- rToken = OString(OOO_STRING_SVTOOLS_HTML_head5);
+ rToken = OOO_STRING_SVTOOLS_HTML_head5 ""_ostr;
break;
case RES_POOLCOLL_HEADLINE6:
- rToken = OString(OOO_STRING_SVTOOLS_HTML_head6);
+ rToken = OOO_STRING_SVTOOLS_HTML_head6 ""_ostr;
break;
case RES_POOLCOLL_SEND_ADDRESS:
- rToken = OString(OOO_STRING_SVTOOLS_HTML_address);
+ rToken = OOO_STRING_SVTOOLS_HTML_address ""_ostr;
break;
case RES_POOLCOLL_HTML_BLOCKQUOTE:
- rToken = OString(OOO_STRING_SVTOOLS_HTML_blockquote);
+ rToken = OOO_STRING_SVTOOLS_HTML_blockquote ""_ostr;
break;
case RES_POOLCOLL_HTML_PRE:
- rToken = OString(OOO_STRING_SVTOOLS_HTML_preformtxt);
+ rToken = OOO_STRING_SVTOOLS_HTML_preformtxt ""_ostr;
break;
case RES_POOLCOLL_HTML_DD:
- rToken = OString(OOO_STRING_SVTOOLS_HTML_dd);
+ rToken = OOO_STRING_SVTOOLS_HTML_dd ""_ostr;
break;
case RES_POOLCOLL_HTML_DT:
- rToken = OString(OOO_STRING_SVTOOLS_HTML_dt);
+ rToken = OOO_STRING_SVTOOLS_HTML_dt ""_ostr;
break;
case RES_POOLCOLL_TABLE:
@@ -789,7 +789,7 @@ sal_uInt16 SwHTMLWriter::GetCSS1Selector( const SwFormat *pFormat, OString& rTok
OOO_STRING_SVTOOLS_HTML_parabreak;
}
else
- rToken = OString(OOO_STRING_SVTOOLS_HTML_parabreak);
+ rToken = OOO_STRING_SVTOOLS_HTML_parabreak ""_ostr;
break;
case RES_POOLCOLL_HTML_HR:
// do not export HR !
@@ -798,7 +798,7 @@ sal_uInt16 SwHTMLWriter::GetCSS1Selector( const SwFormat *pFormat, OString& rTok
case RES_POOLCOLL_FOOTNOTE:
if( !nDeep )
{
- rToken = OString(OOO_STRING_SVTOOLS_HTML_parabreak);
+ rToken = OOO_STRING_SVTOOLS_HTML_parabreak ""_ostr;
rClass = OOO_STRING_SVTOOLS_HTML_sdfootnote;
rRefPoolId = RES_POOLCOLL_TEXT;
nDeep = CSS1_FMT_CMPREF;
@@ -807,7 +807,7 @@ sal_uInt16 SwHTMLWriter::GetCSS1Selector( const SwFormat *pFormat, OString& rTok
case RES_POOLCOLL_ENDNOTE:
if( !nDeep )
{
- rToken = OString(OOO_STRING_SVTOOLS_HTML_parabreak);
+ rToken = OOO_STRING_SVTOOLS_HTML_parabreak ""_ostr;
rClass = OOO_STRING_SVTOOLS_HTML_sdendnote;
rRefPoolId = RES_POOLCOLL_TEXT;
nDeep = CSS1_FMT_CMPREF;
@@ -816,44 +816,44 @@ sal_uInt16 SwHTMLWriter::GetCSS1Selector( const SwFormat *pFormat, OString& rTok
// character templates
case RES_POOLCHR_HTML_EMPHASIS:
- rToken = OString(OOO_STRING_SVTOOLS_HTML_emphasis);
+ rToken = OOO_STRING_SVTOOLS_HTML_emphasis ""_ostr;
break;
case RES_POOLCHR_HTML_CITATION:
- rToken = OString(OOO_STRING_SVTOOLS_HTML_citation);
+ rToken = OOO_STRING_SVTOOLS_HTML_citation ""_ostr;
break;
case RES_POOLCHR_HTML_STRONG:
- rToken = OString(OOO_STRING_SVTOOLS_HTML_strong);
+ rToken = OOO_STRING_SVTOOLS_HTML_strong ""_ostr;
break;
case RES_POOLCHR_HTML_CODE:
- rToken = OString(OOO_STRING_SVTOOLS_HTML_code);
+ rToken = OOO_STRING_SVTOOLS_HTML_code ""_ostr;
break;
case RES_POOLCHR_HTML_SAMPLE:
- rToken = OString(OOO_STRING_SVTOOLS_HTML_sample);
+ rToken = OOO_STRING_SVTOOLS_HTML_sample ""_ostr;
break;
case RES_POOLCHR_HTML_KEYBOARD:
- rToken = OString(OOO_STRING_SVTOOLS_HTML_keyboard);
+ rToken = OOO_STRING_SVTOOLS_HTML_keyboard ""_ostr;
break;
case RES_POOLCHR_HTML_VARIABLE:
- rToken = OString(OOO_STRING_SVTOOLS_HTML_variable);
+ rToken = OOO_STRING_SVTOOLS_HTML_variable ""_ostr;
break;
case RES_POOLCHR_HTML_DEFINSTANCE:
- rToken = OString(OOO_STRING_SVTOOLS_HTML_definstance);
+ rToken = OOO_STRING_SVTOOLS_HTML_definstance ""_ostr;
break;
case RES_POOLCHR_HTML_TELETYPE:
- rToken = OString(OOO_STRING_SVTOOLS_HTML_teletype);
+ rToken = OOO_STRING_SVTOOLS_HTML_teletype ""_ostr;
break;
case RES_POOLCHR_INET_NORMAL:
if( pPseudo )
{
- rToken = OString(OOO_STRING_SVTOOLS_HTML_anchor);
+ rToken = OOO_STRING_SVTOOLS_HTML_anchor ""_ostr;
*pPseudo = OStringToOUString( sCSS1_link, RTL_TEXTENCODING_ASCII_US );
}
break;
case RES_POOLCHR_INET_VISIT:
if( pPseudo )
{
- rToken = OString(OOO_STRING_SVTOOLS_HTML_anchor);
+ rToken = OOO_STRING_SVTOOLS_HTML_anchor ""_ostr;
*pPseudo = OStringToOUString( sCSS1_visited, RTL_TEXTENCODING_ASCII_US );
}
break;
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index 17ee6135ab98..48a3e0e4cb14 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -773,7 +773,7 @@ static void OutHTML_SwFormat( SwHTMLWriter& rWrt, const SwFormat& rFormat,
{
HtmlWriter html(rWrt.Strm(), rWrt.maNamespace);
html.prettyPrint(rWrt.m_bPrettyPrint);
- html.start(OOO_STRING_SVTOOLS_HTML_li);
+ html.start(OOO_STRING_SVTOOLS_HTML_li ""_ostr);
if (!bNumbered)
{
// Handles list headers (<text:list-header> ODF element)
@@ -2068,7 +2068,7 @@ SwHTMLWriter& OutHTML_SwTextNode( SwHTMLWriter& rWrt, const SwContentNode& rNode
HtmlWriter aHtml(rWrt.Strm(), rWrt.maNamespace);
aHtml.prettyPrint(rWrt.m_bPrettyPrint);
- aHtml.start(OOO_STRING_SVTOOLS_HTML_horzrule);
+ aHtml.start(OOO_STRING_SVTOOLS_HTML_horzrule ""_ostr);
const SfxItemSet* pItemSet = pNd->GetpSwAttrSet();
if( !pItemSet )
@@ -2521,7 +2521,7 @@ SwHTMLWriter& OutHTML_SwTextNode( SwHTMLWriter& rWrt, const SwContentNode& rNode
HTMLOutFuncs::FlushToAscii( rWrt.Strm() );
HtmlWriter aHtml(rWrt.Strm(), rWrt.maNamespace);
aHtml.prettyPrint(rWrt.m_bPrettyPrint);
- aHtml.single(OOO_STRING_SVTOOLS_HTML_linebreak);
+ aHtml.single(OOO_STRING_SVTOOLS_HTML_linebreak ""_ostr);
}
else if (c == CH_TXT_ATR_FORMELEMENT)
{
@@ -2600,11 +2600,11 @@ SwHTMLWriter& OutHTML_SwTextNode( SwHTMLWriter& rWrt, const SwContentNode& rNode
{
HtmlWriter aHtml(rWrt.Strm(), rWrt.maNamespace);
aHtml.prettyPrint(rWrt.m_bPrettyPrint);
- aHtml.single(OOO_STRING_SVTOOLS_HTML_linebreak);
+ aHtml.single(OOO_STRING_SVTOOLS_HTML_linebreak ""_ostr);
const SvxULSpaceItem& rULSpace = pNd->GetSwAttrSet().Get(RES_UL_SPACE);
if (rULSpace.GetLower() > 0 && !bEndOfCell)
{
- aHtml.single(OOO_STRING_SVTOOLS_HTML_linebreak);
+ aHtml.single(OOO_STRING_SVTOOLS_HTML_linebreak ""_ostr);
}
rWrt.SetLFPossible(true);
}
@@ -2627,7 +2627,7 @@ SwHTMLWriter& OutHTML_SwTextNode( SwHTMLWriter& rWrt, const SwContentNode& rNode
HtmlWriter aHtml(rWrt.Strm(), rWrt.maNamespace);
aHtml.prettyPrint(rWrt.m_bPrettyPrint);
- aHtml.start(OOO_STRING_SVTOOLS_HTML_linebreak);
+ aHtml.start(OOO_STRING_SVTOOLS_HTML_linebreak ""_ostr);
aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_clear, pString);
aHtml.end();
diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx
index 1f19eb77a6c7..3303cabee0f6 100644
--- a/sw/source/filter/html/htmlflywriter.cxx
+++ b/sw/source/filter/html/htmlflywriter.cxx
@@ -1059,7 +1059,7 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma
if (!pSurroundString.empty())
{
- aHtml.start(OOO_STRING_SVTOOLS_HTML_linebreak);
+ aHtml.start(OOO_STRING_SVTOOLS_HTML_linebreak ""_ostr);
aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_clear, pSurroundString);
aHtml.end();
}
@@ -1282,7 +1282,7 @@ SwHTMLWriter& OutHTML_ImageStart( HtmlWriter& rHtml, SwHTMLWriter& rWrt, const S
if( !aMapURL.isEmpty() || !aName.isEmpty() || !aTarget.isEmpty() || bEvents )
{
- rHtml.start(OOO_STRING_SVTOOLS_HTML_anchor);
+ rHtml.start(OOO_STRING_SVTOOLS_HTML_anchor ""_ostr);
// Output "href" element if a link or macro exists
if( !aMapURL.isEmpty() || bEvents )
@@ -1364,12 +1364,12 @@ SwHTMLWriter& OutHTML_ImageStart( HtmlWriter& rHtml, SwHTMLWriter& rWrt, const S
if( pColBorderLine )
{
- rHtml.start(OOO_STRING_SVTOOLS_HTML_font);
+ rHtml.start(OOO_STRING_SVTOOLS_HTML_font ""_ostr);
HtmlWriterHelper::applyColor(rHtml, OOO_STRING_SVTOOLS_HTML_O_color, pColBorderLine->GetColor());
}
}
- OString aTag(OOO_STRING_SVTOOLS_HTML_image);
+ OString aTag(OOO_STRING_SVTOOLS_HTML_image ""_ostr);
if (bReplacement)
// Write replacement graphic of OLE object as <object>.
aTag = OOO_STRING_SVTOOLS_HTML_object;
@@ -1391,7 +1391,7 @@ SwHTMLWriter& OutHTML_ImageStart( HtmlWriter& rHtml, SwHTMLWriter& rWrt, const S
else
{
OString sBuffer(OUStringToOString(aGraphicURL, RTL_TEXTENCODING_UTF8));
- OString aAttribute(OOO_STRING_SVTOOLS_HTML_O_src);
+ OString aAttribute(OOO_STRING_SVTOOLS_HTML_O_src ""_ostr);
if (bReplacement)
aAttribute = OOO_STRING_SVTOOLS_HTML_O_data;
rHtml.attribute(aAttribute, sBuffer);
diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx
index e5a1efa8af1e..d7ae5c28acde 100644
--- a/sw/source/filter/html/htmlforw.cxx
+++ b/sw/source/filter/html/htmlforw.cxx
@@ -163,7 +163,7 @@ static void lcl_html_outEvents( SvStream& rStrm,
}
}
- OString sOut = " ";
+ OString sOut = " "_ostr;
if( pOpt && (EXTENDED_STYPE != eScriptType ||
rDesc.AddListenerParam.isEmpty()) )
sOut += pOpt;
diff --git a/sw/source/filter/html/htmlftn.cxx b/sw/source/filter/html/htmlftn.cxx
index ed222e4e457d..db24a32bb750 100644
--- a/sw/source/filter/html/htmlftn.cxx
+++ b/sw/source/filter/html/htmlftn.cxx
@@ -250,7 +250,7 @@ SwHTMLWriter& OutHTML_SwFormatLineBreak(SwHTMLWriter& rWrt, const SfxPoolItem& r
const auto& rLineBreak = static_cast<const SwFormatLineBreak&>(rHt);
HtmlWriter aWriter(rWrt.Strm(), rWrt.maNamespace);
- aWriter.start(OOO_STRING_SVTOOLS_HTML_linebreak);
+ aWriter.start(OOO_STRING_SVTOOLS_HTML_linebreak ""_ostr);
switch (rLineBreak.GetValue())
{
case SwLineBreakClear::NONE:
diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx
index 31f16f6d28d6..8b2ff71cd3f9 100644
--- a/sw/source/filter/html/htmlplug.cxx
+++ b/sw/source/filter/html/htmlplug.cxx
@@ -580,7 +580,7 @@ bool SwHTMLParser::InsertEmbed()
auto it = m_aAllowedRTFOLEMimeTypes.find(aType);
if (m_aAllowedRTFOLEMimeTypes.empty() || it != m_aAllowedRTFOLEMimeTypes.end())
{
- OString aMagic("{\\object");
+ OString aMagic("{\\object"_ostr);
OString aHeader(read_uInt8s_ToOString(aFileStream, aMagic.getLength()));
aFileStream.Seek(0);
if (aHeader == aMagic)
diff --git a/sw/source/filter/html/htmlreqifreader.cxx b/sw/source/filter/html/htmlreqifreader.cxx
index f42c87e3e176..0290ce5abde7 100644
--- a/sw/source/filter/html/htmlreqifreader.cxx
+++ b/sw/source/filter/html/htmlreqifreader.cxx
@@ -240,7 +240,7 @@ OString InsertOLE1HeaderFromOle10NativeStream(const tools::SvRef<SotStorage>& xS
// FormatID: constant means the ClassName field is present.
rOle1.WriteUInt32(0x00000005);
// ClassName: null terminated pascal string.
- OString aPresentationClassName("METAFILEPICT");
+ OString aPresentationClassName("METAFILEPICT"_ostr);
rOle1.WriteUInt32(aPresentationClassName.getLength() + 1);
rOle1.WriteOString(aPresentationClassName);
rOle1.WriteChar(0);
@@ -319,7 +319,7 @@ OString InsertOLE1Header(SvStream& rOle2, SvStream& rOle1, sal_uInt32& nWidth, s
// FormatID: constant means the ClassName field is present.
rOle1.WriteUInt32(0x00000005);
// ClassName: null terminated pascal string.
- OString aPresentationClassName("METAFILEPICT");
+ OString aPresentationClassName("METAFILEPICT"_ostr);
rOle1.WriteUInt32(aPresentationClassName.getLength() + 1);
rOle1.WriteOString(aPresentationClassName);
rOle1.WriteChar(0);
@@ -514,7 +514,7 @@ bool WrapGraphicInRtf(const Graphic& rGraphic, const SwFrameFormat& rFormat, SvS
// Start objclass.
rRtf.WriteOString("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_OBJCLASS " ");
- OString aClassName("PBrush");
+ OString aClassName("PBrush"_ostr);
rRtf.WriteOString(aClassName);
// End objclass.
rRtf.WriteOString("}");
@@ -587,7 +587,7 @@ bool WrapGraphicInRtf(const Graphic& rGraphic, const SwFrameFormat& rFormat, SvS
// FormatID: constant means the ClassName field is present.
aOle1.WriteUInt32(0x00000005);
// ClassName: null terminated pascal string.
- OString aPresentationClassName("METAFILEPICT");
+ OString aPresentationClassName("METAFILEPICT"_ostr);
aOle1.WriteUInt32(aPresentationClassName.getLength() + 1);
aOle1.WriteOString(aPresentationClassName);
aOle1.WriteChar(0);
diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx
index 89fc247b8b7c..b1ef282396a0 100644
--- a/sw/source/filter/html/htmltabw.cxx
+++ b/sw/source/filter/html/htmltabw.cxx
@@ -740,7 +740,7 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
HtmlWriter html(rWrt.Strm(), rWrt.maNamespace);
html.prettyPrint(false); // We add newlines ourself
- html.start(OOO_STRING_SVTOOLS_HTML_col);
+ html.start(OOO_STRING_SVTOOLS_HTML_col ""_ostr);
sal_uInt32 nWidth;
bool bRel;
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index 951b682ee218..3c9a1d2a168b 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -1326,7 +1326,7 @@ void SwHTMLWriter::OutPointFieldmarks( const SwPosition& rPos )
OOO_STRING_SVTOOLS_HTML_O_type
"=\""
OOO_STRING_SVTOOLS_HTML_IT_checkbox
- "\"");
+ "\""_ostr);
if (pCheckBox->IsChecked())
{
diff --git a/sw/source/filter/indexing/IndexingExport.cxx b/sw/source/filter/indexing/IndexingExport.cxx
index 13da0b722cf1..acd7aba45b9c 100644
--- a/sw/source/filter/indexing/IndexingExport.cxx
+++ b/sw/source/filter/indexing/IndexingExport.cxx
@@ -71,7 +71,7 @@ public:
m_rXmlWriter.startElement("object");
m_rXmlWriter.attribute("alt", pOleNode->GetTitle());
m_rXmlWriter.attribute("name", pFrameFormat->GetName());
- m_rXmlWriter.attribute("object_type", "ole");
+ m_rXmlWriter.attribute("object_type", "ole"_ostr);
m_rXmlWriter.endElement();
}
@@ -81,7 +81,7 @@ public:
m_rXmlWriter.startElement("object");
m_rXmlWriter.attribute("alt", pGraphicNode->GetTitle());
m_rXmlWriter.attribute("name", pFrameFormat->GetName());
- m_rXmlWriter.attribute("object_type", "graphic");
+ m_rXmlWriter.attribute("object_type", "graphic"_ostr);
m_rXmlWriter.endElement();
}
@@ -98,7 +98,7 @@ public:
return;
m_rXmlWriter.startElement("paragraph");
m_rXmlWriter.attribute("index", sal_Int32(pTextNode->GetIndex()));
- m_rXmlWriter.attribute("node_type", "writer");
+ m_rXmlWriter.attribute("node_type", "writer"_ostr);
if (nParentIndex >= SwNodeOffset(0))
m_rXmlWriter.attribute("parent_index", sal_Int32(nParentIndex));
m_rXmlWriter.content(rString);
@@ -113,7 +113,7 @@ public:
m_rXmlWriter.startElement("object");
m_rXmlWriter.attribute("name", pObject->GetName());
m_rXmlWriter.attribute("alt", pObject->GetTitle());
- m_rXmlWriter.attribute("object_type", "shape");
+ m_rXmlWriter.attribute("object_type", "shape"_ostr);
m_rXmlWriter.attribute("description", pObject->GetDescription());
m_rXmlWriter.endElement();
@@ -133,7 +133,7 @@ public:
m_rXmlWriter.startElement("paragraph");
m_rXmlWriter.attribute("index", nParagraph);
- m_rXmlWriter.attribute("node_type", "common");
+ m_rXmlWriter.attribute("node_type", "common"_ostr);
m_rXmlWriter.attribute("object_name", pObject->GetName());
m_rXmlWriter.content(sText);
m_rXmlWriter.endElement();
@@ -148,7 +148,7 @@ public:
m_rXmlWriter.startElement("object");
m_rXmlWriter.attribute("index", sal_Int32(pTableNode->GetIndex()));
m_rXmlWriter.attribute("name", sName);
- m_rXmlWriter.attribute("object_type", "table");
+ m_rXmlWriter.attribute("object_type", "table"_ostr);
m_rXmlWriter.endElement();
maNodeStack.push_back(pTableNode);
@@ -159,7 +159,7 @@ public:
m_rXmlWriter.startElement("object");
m_rXmlWriter.attribute("index", sal_Int32(pSectionNode->GetIndex()));
m_rXmlWriter.attribute("name", pSectionNode->GetSection().GetSectionName());
- m_rXmlWriter.attribute("object_type", "section");
+ m_rXmlWriter.attribute("object_type", "section"_ostr);
m_rXmlWriter.endElement();
maNodeStack.push_back(pSectionNode);
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index ee514c8eea29..40217903d958 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -619,15 +619,15 @@ OString DocxAttributeOutput::convertToOOXMLVertOrient(sal_Int16 nOrient)
{
case text::VertOrientation::CENTER:
case text::VertOrientation::LINE_CENTER:
- return "center";
+ return "center"_ostr;
case text::VertOrientation::BOTTOM:
- return "bottom";
+ return "bottom"_ostr;
case text::VertOrientation::LINE_BOTTOM:
- return "outside";
+ return "outside"_ostr;
case text::VertOrientation::TOP:
- return "top";
+ return "top"_ostr;
case text::VertOrientation::LINE_TOP:
- return "inside";
+ return "inside"_ostr;
default:
return OString();
}
@@ -640,14 +640,14 @@ OString DocxAttributeOutput::convertToOOXMLHoriOrient(sal_Int16 nOrient, bool bI
case text::HoriOrientation::LEFT:
return bIsPosToggle ? "inside" : "left";
case text::HoriOrientation::INSIDE:
- return "inside";
+ return "inside"_ostr;
case text::HoriOrientation::RIGHT:
return bIsPosToggle ? "outside" : "right";
case text::HoriOrientation::OUTSIDE:
- return "outside";
+ return "outside"_ostr;
case text::HoriOrientation::CENTER:
case text::HoriOrientation::FULL:
- return "center";
+ return "center"_ostr;
default:
return OString();
}
@@ -658,13 +658,13 @@ OString DocxAttributeOutput::convertToOOXMLVertOrientRel(sal_Int16 nOrientRel)
switch (nOrientRel)
{
case text::RelOrientation::PAGE_PRINT_AREA:
- return "margin";
+ return "margin"_ostr;
case text::RelOrientation::PAGE_FRAME:
- return "page";
+ return "page"_ostr;
case text::RelOrientation::FRAME:
case text::RelOrientation::TEXT_LINE:
default:
- return "text";
+ return "text"_ostr;
}
}
@@ -673,14 +673,14 @@ OString DocxAttributeOutput::convertToOOXMLHoriOrientRel(sal_Int16 nOrientRel)
switch (nOrientRel)
{
case text::RelOrientation::PAGE_PRINT_AREA:
- return "margin";
+ return "margin"_ostr;
case text::RelOrientation::PAGE_FRAME:
- return "page";
+ return "page"_ostr;
case text::RelOrientation::CHAR:
case text::RelOrientation::PAGE_RIGHT:
case text::RelOrientation::FRAME:
default:
- return "text";
+ return "text"_ostr;
}
}
@@ -5694,7 +5694,7 @@ void DocxAttributeOutput::WriteActiveXControl(const SdrObject* pObject, const Sw
// VML shape definition
m_rExport.VMLExporter().SetSkipwzName(true);
m_rExport.VMLExporter().SetHashMarkForType(true);
- m_rExport.VMLExporter().OverrideShapeIDGen(true, "control_shape_");
+ m_rExport.VMLExporter().OverrideShapeIDGen(true, "control_shape_"_ostr);
OString sShapeId;
if(bAnchoredInline)
{
@@ -5922,68 +5922,68 @@ void DocxAttributeOutput::WriteOLEShape(const SwFlyFrameFormat& rFrameFormat, co
switch (rBox.GetLeft()->GetBorderLineStyle())
{
case SvxBorderLineStyle::SOLID:
- sLineType = OString("Single");
- sDashType = OString("Solid");
+ sLineType = "Single"_ostr;
+ sDashType = "Solid"_ostr;
break;
case SvxBorderLineStyle::DASHED:
- sLineType = OString("Single");
- sDashType = OString("Dash");
+ sLineType = "Single"_ostr;
+ sDashType = "Dash"_ostr;
break;
case SvxBorderLineStyle::DASH_DOT:
- sLineType = OString("Single");
- sDashType = OString("DashDot");
+ sLineType = "Single"_ostr;
+ sDashType = "DashDot"_ostr;
break;
case SvxBorderLineStyle::DASH_DOT_DOT:
- sLineType = OString("Single");
- sDashType = OString("ShortDashDotDot");
+ sLineType = "Single"_ostr;
+ sDashType = "ShortDashDotDot"_ostr;
break;
case SvxBorderLineStyle::DOTTED:
- sLineType = OString("Single");
- sDashType = OString("Dot");
+ sLineType = "Single"_ostr;
+ sDashType = "Dot"_ostr;
break;
case SvxBorderLineStyle::DOUBLE:
- sLineType = OString("ThinThin");
- sDashType = OString("Solid");
+ sLineType = "ThinThin"_ostr;
+ sDashType = "Solid"_ostr;
break;
case SvxBorderLineStyle::DOUBLE_THIN:
- sLineType = OString("ThinThin");
- sDashType = OString("Solid");
+ sLineType = "ThinThin"_ostr;
+ sDashType = "Solid"_ostr;
break;
case SvxBorderLineStyle::EMBOSSED:
- sLineType = OString("Single");
- sDashType = OString("Solid");
+ sLineType = "Single"_ostr;
+ sDashType = "Solid"_ostr;
break;
case SvxBorderLineStyle::ENGRAVED:
- sLineType = OString("Single");
- sDashType = OString("Solid");
+ sLineType = "Single"_ostr;
+ sDashType = "Solid"_ostr;
break;
case SvxBorderLineStyle::FINE_DASHED:
- sLineType = OString("Single");
- sDashType = OString("Dot");
+ sLineType = "Single"_ostr;
+ sDashType = "Dot"_ostr;
break;
case SvxBorderLineStyle::INSET:
- sLineType = OString("Single");
- sDashType = OString("Solid");
+ sLineType = "Single"_ostr;
+ sDashType = "Solid"_ostr;
break;
case SvxBorderLineStyle::OUTSET:
- sLineType = OString("Single");
- sDashType = OString("Solid");
+ sLineType = "Single"_ostr;
+ sDashType = "Solid"_ostr;
break;
case SvxBorderLineStyle::THICKTHIN_LARGEGAP:
case SvxBorderLineStyle::THICKTHIN_MEDIUMGAP:
case SvxBorderLineStyle::THICKTHIN_SMALLGAP:
- sLineType = OString("ThickThin");
- sDashType = OString("Solid");
+ sLineType = "ThickThin"_ostr;
+ sDashType = "Solid"_ostr;
break;
case SvxBorderLineStyle::THINTHICK_LARGEGAP:
case SvxBorderLineStyle::THINTHICK_MEDIUMGAP:
case SvxBorderLineStyle::THINTHICK_SMALLGAP:
- sLineType = OString("ThinThick");
- sDashType = OString("Solid");
+ sLineType = "ThinThick"_ostr;
+ sDashType = "Solid"_ostr;
break;
case SvxBorderLineStyle::NONE:
- sLineType = OString("");
- sDashType = OString("");
+ sLineType = ""_ostr;
+ sDashType = ""_ostr;
break;
default:
SAL_WARN("sw.ww8", "Unknown line type on OOXML ELE export!");
@@ -6066,7 +6066,7 @@ OString DocxAttributeOutput::GetOLEStyle(const SwFlyFrameFormat& rFormat, const
//Get the relative horizontal positions for the anchors
OString aHAnch
= bIsPageAnchor
- ? OString("page")
+ ? "page"_ostr
: convertToOOXMLHoriOrientRel(rFormat.GetHoriOrient().GetRelationOrient());
//Get the relative vertical positions for the anchors
OString aVAnch = convertToOOXMLVertOrientRel(rFormat.GetVertOrient().GetRelationOrient());
@@ -6122,22 +6122,22 @@ void DocxAttributeOutput::ExportOLESurround(const SwFormatSurround& rWrap)
switch (rWrap.GetSurround())
{
case text::WrapTextMode::WrapTextMode_NONE:
- sSurround = OString("topAndBottom");
+ sSurround = "topAndBottom"_ostr;
break;
case text::WrapTextMode::WrapTextMode_PARALLEL:
- sSurround = bIsContour ? OString("tight") : OString("square");
+ sSurround = bIsContour ? "tight"_ostr : "square"_ostr;
break;
case text::WrapTextMode::WrapTextMode_DYNAMIC:
- sSide = OString("largest");
- sSurround = bIsContour ? OString("tight") : OString("square");
+ sSide = "largest"_ostr;
+ sSurround = bIsContour ? "tight"_ostr : "square"_ostr;
break;
case text::WrapTextMode::WrapTextMode_LEFT:
- sSide = OString("left");
- sSurround = bIsContour ? OString("tight") : OString("square");
+ sSide = "left"_ostr;
+ sSurround = bIsContour ? "tight"_ostr : "square"_ostr;
break;
case text::WrapTextMode::WrapTextMode_RIGHT:
- sSide = OString("right");
- sSurround = bIsContour ? OString("tight") : OString("square");
+ sSide = "right"_ostr;
+ sSurround = bIsContour ? "tight"_ostr : "square"_ostr;
break;
default:
SAL_WARN("sw.ww8", "Unknown surround type on OOXML export!");
@@ -7106,7 +7106,7 @@ void DocxAttributeOutput::SectionBiDi( bool bBiDi )
}
// Converting Numbering Format Code to string
-static OString lcl_ConvertNumberingType(sal_Int16 nNumberingType, const SfxItemSet* pOutSet, OString& rFormat, const OString& sDefault = "" )
+static OString lcl_ConvertNumberingType(sal_Int16 nNumberingType, const SfxItemSet* pOutSet, OString& rFormat, const OString& sDefault = ""_ostr )
{
OString aType = sDefault;
@@ -7433,23 +7433,23 @@ OString DocxAttributeOutput::TransHighlightColor( sal_uInt8 nIco )
{
switch (nIco)
{
- case 0: return "none"; break;
- case 1: return "black"; break;
- case 2: return "blue"; break;
- case 3: return "cyan"; break;
- case 4: return "green"; break;
- case 5: return "magenta"; break;
- case 6: return "red"; break;
- case 7: return "yellow"; break;
- case 8: return "white"; break;
- case 9: return "darkBlue"; break;
- case 10: return "darkCyan"; break;
- case 11: return "darkGreen"; break;
- case 12: return "darkMagenta"; break;
- case 13: return "darkRed"; break;
- case 14: return "darkYellow"; break;
- case 15: return "darkGray"; break;
- case 16: return "lightGray"; break;
+ case 0: return "none"_ostr; break;
+ case 1: return "black"_ostr; break;
+ case 2: return "blue"_ostr; break;
+ case 3: return "cyan"_ostr; break;
+ case 4: return "green"_ostr; break;
+ case 5: return "magenta"_ostr; break;
+ case 6: return "red"_ostr; break;
+ case 7: return "yellow"_ostr; break;
+ case 8: return "white"_ostr; break;
+ case 9: return "darkBlue"_ostr; break;
+ case 10: return "darkCyan"_ostr; break;
+ case 11: return "darkGreen"_ostr; break;
+ case 12: return "darkMagenta"_ostr; break;
+ case 13: return "darkRed"_ostr; break;
+ case 14: return "darkYellow"_ostr; break;
+ case 15: return "darkGray"_ostr; break;
+ case 16: return "lightGray"_ostr; break;
default: return OString(); break;
}
}
@@ -7613,7 +7613,7 @@ void DocxAttributeOutput::NumberingLevel( sal_uInt8 nLevel,
// format
OString aCustomFormat;
- OString aFormat(lcl_ConvertNumberingType(nNumberingType, pOutSet, aCustomFormat, "decimal"));
+ OString aFormat(lcl_ConvertNumberingType(nNumberingType, pOutSet, aCustomFormat, "decimal"_ostr));
{
if (aCustomFormat.isEmpty())
@@ -7837,16 +7837,16 @@ void DocxAttributeOutput::CharEscapement( const SvxEscapementItem& rEscapement )
if ( !nEsc )
{
- sIss = OString( "baseline" );
+ sIss = "baseline"_ostr;
nEsc = 0;
nProp = 100;
}
else if ( DFLT_ESC_PROP == nProp || nProp < 1 || nProp > 100 )
{
if ( DFLT_ESC_SUB == nEsc || DFLT_ESC_AUTO_SUB == nEsc )
- sIss = OString( "subscript" );
+ sIss = "subscript"_ostr;
else if ( DFLT_ESC_SUPER == nEsc || DFLT_ESC_AUTO_SUPER == nEsc )
- sIss = OString( "superscript" );
+ sIss = "superscript"_ostr;
}
else if ( DFLT_ESC_AUTO_SUPER == nEsc )
{
@@ -9909,23 +9909,23 @@ void DocxAttributeOutput::FormatFrameDirection( const SvxFrameDirectionItem& rDi
{
default:
case SvxFrameDirection::Horizontal_LR_TB:
- sTextFlow = OString( "lrTb" );
+ sTextFlow = "lrTb"_ostr;
break;
case SvxFrameDirection::Horizontal_RL_TB:
- sTextFlow = OString( "lrTb" );
+ sTextFlow = "lrTb"_ostr;
bBiDi = true;
break;
case SvxFrameDirection::Vertical_LR_TB: // ~ vert="mongolianVert"
- sTextFlow = OString("tbLrV");
+ sTextFlow = "tbLrV"_ostr;
break;
case SvxFrameDirection::Vertical_RL_TB: // ~ vert="eaVert"
- sTextFlow = OString( "tbRl" );
+ sTextFlow = "tbRl"_ostr;
break;
case SvxFrameDirection::Vertical_LR_BT: // ~ vert="vert270"
- sTextFlow = OString("btLr");
+ sTextFlow = "btLr"_ostr;
break;
case SvxFrameDirection::Vertical_RL_TB90: // ~ vert="vert"
- sTextFlow = OString("tbRlV");
+ sTextFlow = "tbRlV"_ostr;
break;
}
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index baefd752e1c0..776fe61ab89c 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -1964,12 +1964,12 @@ void lcl_TextFrameShadow(std::vector<std::pair<OString, OString>>& rFlyPropertie
if (aShadowItem.GetLocation() == SvxShadowLocation::NONE)
return;
- rFlyProperties.push_back(std::make_pair<OString, OString>("fShadow", OString::number(1)));
+ rFlyProperties.push_back(std::make_pair<OString, OString>("fShadow"_ostr, OString::number(1)));
const Color& rColor = aShadowItem.GetColor();
// We in fact need RGB to BGR, but the transformation is symmetric.
rFlyProperties.push_back(std::make_pair<OString, OString>(
- "shadowColor", OString::number(wwUtility::RGBToBGR(rColor))));
+ "shadowColor"_ostr, OString::number(wwUtility::RGBToBGR(rColor))));
// Twips -> points -> EMUs -- hacky, the intermediate step hides rounding errors on roundtrip.
OString aShadowWidth = OString::number(sal_Int32(aShadowItem.GetWidth() / 20) * 12700);
@@ -2013,7 +2013,7 @@ void lcl_TextFrameRelativeSize(std::vector<std::pair<OString, OString>>& rFlyPro
if (nWidthPercent && nWidthPercent != SwFormatFrameSize::SYNCED)
{
rFlyProperties.push_back(
- std::make_pair<OString, OString>("pctHoriz", OString::number(nWidthPercent * 10)));
+ std::make_pair<OString, OString>("pctHoriz"_ostr, OString::number(nWidthPercent * 10)));
OString aRelation;
switch (rSize.GetWidthPercentRelation())
@@ -2032,7 +2032,7 @@ void lcl_TextFrameRelativeSize(std::vector<std::pair<OString, OString>>& rFlyPro
return;
rFlyProperties.push_back(
- std::make_pair<OString, OString>("pctVert", OString::number(nHeightPercent * 10)));
+ std::make_pair<OString, OString>("pctVert"_ostr, OString::number(nHeightPercent * 10)));
OString aRelation;
switch (rSize.GetHeightPercentRelation())
@@ -2190,7 +2190,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl(const ww8::Frame& rFrame, const Poi
// Shape properties.
m_aFlyProperties.push_back(std::make_pair<OString, OString>(
- "shapeType", OString::number(ESCHER_ShpInst_TextBox)));
+ "shapeType"_ostr, OString::number(ESCHER_ShpInst_TextBox)));
// When a frame has some low height, but automatically expanded due
// to lots of contents, this size contains the real size.
@@ -3410,11 +3410,13 @@ void RtfAttributeOutput::FormatLRSpace(const SvxLRSpaceItem& rLRSpace)
{
// Wrap: top and bottom spacing, convert from twips to EMUs.
m_aFlyProperties.push_back(std::make_pair<OString, OString>(
- "dxWrapDistLeft", OString::number(o3tl::convert(rLRSpace.GetLeft(), o3tl::Length::twip,
- o3tl::Length::emu))));
+ "dxWrapDistLeft"_ostr,
+ OString::number(
+ o3tl::convert(rLRSpace.GetLeft(), o3tl::Length::twip, o3tl::Length::emu))));
m_aFlyProperties.push_back(std::make_pair<OString, OString>(
- "dxWrapDistRight", OString::number(o3tl::convert(
- rLRSpace.GetRight(), o3tl::Length::twip, o3tl::Length::emu))));
+ "dxWrapDistRight"_ostr,
+ OString::number(
+ o3tl::convert(rLRSpace.GetRight(), o3tl::Length::twip, o3tl::Length::emu))));
}
}
@@ -3509,11 +3511,13 @@ void RtfAttributeOutput::FormatULSpace(const SvxULSpaceItem& rULSpace)
{
// Wrap: top and bottom spacing, convert from twips to EMUs.
m_aFlyProperties.push_back(std::make_pair<OString, OString>(
- "dyWrapDistTop", OString::number(o3tl::convert(rULSpace.GetUpper(), o3tl::Length::twip,
- o3tl::Length::emu))));
+ "dyWrapDistTop"_ostr,
+ OString::number(
+ o3tl::convert(rULSpace.GetUpper(), o3tl::Length::twip, o3tl::Length::emu))));
m_aFlyProperties.push_back(std::make_pair<OString, OString>(
- "dyWrapDistBottom", OString::number(o3tl::convert(
- rULSpace.GetLower(), o3tl::Length::twip, o3tl::Length::emu))));
+ "dyWrapDistBottom"_ostr,
+ OString::number(
+ o3tl::convert(rULSpace.GetLower(), o3tl::Length::twip, o3tl::Length::emu))));
}
}
@@ -3575,11 +3579,11 @@ void RtfAttributeOutput::FormatVertOrientation(const SwFormatVertOrient& rFlyVer
{
case text::RelOrientation::PAGE_FRAME:
m_aFlyProperties.push_back(
- std::make_pair<OString, OString>("posrelv", OString::number(1)));
+ std::make_pair<OString, OString>("posrelv"_ostr, OString::number(1)));
break;
default:
m_aFlyProperties.push_back(
- std::make_pair<OString, OString>("posrelv", OString::number(2)));
+ std::make_pair<OString, OString>("posrelv"_ostr, OString::number(2)));
m_rExport.Strm()
.WriteOString(OOO_STRING_SVTOOLS_RTF_SHPBYPARA)
.WriteOString(OOO_STRING_SVTOOLS_RTF_SHPBYIGNORE);
@@ -3591,17 +3595,17 @@ void RtfAttributeOutput::FormatVertOrientation(const SwFormatVertOrient& rFlyVer
case text::VertOrientation::TOP:
case text::VertOrientation::LINE_TOP:
m_aFlyProperties.push_back(
- std::make_pair<OString, OString>("posv", OString::number(1)));
+ std::make_pair<OString, OString>("posv"_ostr, OString::number(1)));
break;
case text::VertOrientation::BOTTOM:
case text::VertOrientation::LINE_BOTTOM:
m_aFlyProperties.push_back(
- std::make_pair<OString, OString>("posv", OString::number(3)));
+ std::make_pair<OString, OString>("posv"_ostr, OString::number(3)));
break;
case text::VertOrientation::CENTER:
case text::VertOrientation::LINE_CENTER:
m_aFlyProperties.push_back(
- std::make_pair<OString, OString>("posv", OString::number(2)));
+ std::make_pair<OString, OString>("posv"_ostr, OString::number(2)));
break;
default:
break;
@@ -3625,11 +3629,11 @@ void RtfAttributeOutput::FormatHorizOrientation(const SwFormatHoriOrient& rFlyHo
{
case text::RelOrientation::PAGE_FRAME:
m_aFlyProperties.push_back(
- std::make_pair<OString, OString>("posrelh", OString::number(1)));
+ std::make_pair<OString, OString>("posrelh"_ostr, OString::number(1)));
break;
default:
m_aFlyProperties.push_back(
- std::make_pair<OString, OString>("posrelh", OString::number(2)));
+ std::make_pair<OString, OString>("posrelh"_ostr, OString::number(2)));
m_rExport.Strm()
.WriteOString(OOO_STRING_SVTOOLS_RTF_SHPBXCOLUMN)
.WriteOString(OOO_STRING_SVTOOLS_RTF_SHPBXIGNORE);
@@ -3640,15 +3644,15 @@ void RtfAttributeOutput::FormatHorizOrientation(const SwFormatHoriOrient& rFlyHo
{
case text::HoriOrientation::LEFT:
m_aFlyProperties.push_back(
- std::make_pair<OString, OString>("posh", OString::number(1)));
+ std::make_pair<OString, OString>("posh"_ostr, OString::number(1)));
break;
case text::HoriOrientation::CENTER:
m_aFlyProperties.push_back(
- std::make_pair<OString, OString>("posh", OString::number(2)));
+ std::make_pair<OString, OString>("posh"_ostr, OString::number(2)));
break;
case text::HoriOrientation::RIGHT:
m_aFlyProperties.push_back(
- std::make_pair<OString, OString>("posh", OString::number(3)));
+ std::make_pair<OString, OString>("posh"_ostr, OString::number(3)));
break;
default:
break;
@@ -3693,7 +3697,7 @@ void RtfAttributeOutput::FormatBackground(const SvxBrushItem& rBrush)
const Color& rColor = rBrush.GetColor();
// We in fact need RGB to BGR, but the transformation is symmetric.
m_aFlyProperties.push_back(std::make_pair<OString, OString>(
- "fillColor", OString::number(wwUtility::RGBToBGR(rColor))));
+ "fillColor"_ostr, OString::number(wwUtility::RGBToBGR(rColor))));
}
else if (!rBrush.GetColor().IsTransparent())
{
@@ -3713,7 +3717,7 @@ void RtfAttributeOutput::FormatFillGradient(const XFillGradientItem& rFillGradie
return;
m_aFlyProperties.push_back(std::make_pair<OString, OString>(
- "fillType", OString::number(7))); // Shade using the fillAngle
+ "fillType"_ostr, OString::number(7))); // Shade using the fillAngle
const basegfx::BGradient& rGradient(rFillGradient.GetGradientValue());
const basegfx::BColorStops& rColorStops(rGradient.GetColorStops());
@@ -3729,14 +3733,14 @@ void RtfAttributeOutput::FormatFillGradient(const XFillGradientItem& rFillGradie
// exchanged here fillColor/fillBackColor to get the correct order
const Color aStartColor(rColorStops.front().getStopColor());
m_aFlyProperties.push_back(std::make_pair<OString, OString>(
- "fillColor", OString::number(wwUtility::RGBToBGR(aStartColor))));
+ "fillColor"_ostr, OString::number(wwUtility::RGBToBGR(aStartColor))));
if (rColorStops.size() < 3)
{
// two-color version, use back as 2nd color
const Color aEndColor(rColorStops.back().getStopColor());
m_aFlyProperties.push_back(std::make_pair<OString, OString>(
- "fillBackColor", OString::number(wwUtility::RGBToBGR(aEndColor))));
+ "fillBackColor"_ostr, OString::number(wwUtility::RGBToBGR(aEndColor))));
}
else
{
@@ -3745,9 +3749,9 @@ void RtfAttributeOutput::FormatFillGradient(const XFillGradientItem& rFillGradie
// The 2nd color is the in-between color, use it
const Color aEndColor(rColorStops[1].getStopColor());
m_aFlyProperties.push_back(std::make_pair<OString, OString>(
- "fillBackColor", OString::number(wwUtility::RGBToBGR(aEndColor))));
+ "fillBackColor"_ostr, OString::number(wwUtility::RGBToBGR(aEndColor))));
m_aFlyProperties.push_back(
- std::make_pair<OString, OString>("fillFocus", OString::number(50)));
+ std::make_pair<OString, OString>("fillFocus"_ostr, OString::number(50)));
}
}
@@ -3765,17 +3769,21 @@ void RtfAttributeOutput::FormatBox(const SvxBoxItem& rBox)
{
// Borders: spacing to contents, convert from twips to EMUs.
m_aFlyProperties.push_back(std::make_pair<OString, OString>(
- "dxTextLeft", OString::number(o3tl::convert(rBox.GetDistance(SvxBoxItemLine::LEFT),
- o3tl::Length::twip, o3tl::Length::emu))));
+ "dxTextLeft"_ostr,
+ OString::number(o3tl::convert(rBox.GetDistance(SvxBoxItemLine::LEFT),
+ o3tl::Length::twip, o3tl::Length::emu))));
m_aFlyProperties.push_back(std::make_pair<OString, OString>(
- "dyTextTop", OString::number(o3tl::convert(rBox.GetDistance(SvxBoxItemLine::TOP),
- o3tl::Length::twip, o3tl::Length::emu))));
+ "dyTextTop"_ostr,
+ OString::number(o3tl::convert(rBox.GetDistance(SvxBoxItemLine::TOP), o3tl::Length::twip,
+ o3tl::Length::emu))));
m_aFlyProperties.push_back(std::make_pair<OString, OString>(
- "dxTextRight", OString::number(o3tl::convert(rBox.GetDistance(SvxBoxItemLine::RIGHT),
- o3tl::Length::twip, o3tl::Length::emu))));
+ "dxTextRight"_ostr,
+ OString::number(o3tl::convert(rBox.GetDistance(SvxBoxItemLine::RIGHT),
+ o3tl::Length::twip, o3tl::Length::emu))));
m_aFlyProperties.push_back(std::make_pair<OString, OString>(
- "dyTextBottom", OString::number(o3tl::convert(rBox.GetDistance(SvxBoxItemLine::BOTTOM),
- o3tl::Length::twip, o3tl::Length::emu))));
+ "dyTextBottom"_ostr,
+ OString::number(o3tl::convert(rBox.GetDistance(SvxBoxItemLine::BOTTOM),
+ o3tl::Length::twip, o3tl::Length::emu))));
const editeng::SvxBorderLine* pLeft = rBox.GetLine(SvxBoxItemLine::LEFT);
const editeng::SvxBorderLine* pRight = rBox.GetLine(SvxBoxItemLine::RIGHT);
@@ -3785,7 +3793,7 @@ void RtfAttributeOutput::FormatBox(const SvxBoxItem& rBox)
if (!pLeft && !pRight && !pBottom && !pTop)
{
// fLine has default 'true', so need to write it out in case of no border.
- m_aFlyProperties.push_back(std::make_pair<OString, OString>("fLine", "0"));
+ m_aFlyProperties.push_back(std::make_pair<OString, OString>("fLine"_ostr, "0"_ostr));
return;
}
@@ -3805,20 +3813,20 @@ void RtfAttributeOutput::FormatBox(const SvxBoxItem& rBox)
if (!pBorder)
{
- m_aFlyProperties.push_back(std::make_pair<OString, OString>("fLine", "0"));
+ m_aFlyProperties.push_back(std::make_pair<OString, OString>("fLine"_ostr, "0"_ostr));
return;
}
const Color& rColor = pBorder->GetColor();
// We in fact need RGB to BGR, but the transformation is symmetric.
m_aFlyProperties.push_back(std::make_pair<OString, OString>(
- "lineColor", OString::number(wwUtility::RGBToBGR(rColor))));
+ "lineColor"_ostr, OString::number(wwUtility::RGBToBGR(rColor))));
double const fConverted(
editeng::ConvertBorderWidthToWord(pBorder->GetBorderLineStyle(), pBorder->GetWidth()));
sal_Int32 nWidth = o3tl::convert(fConverted, o3tl::Length::twip, o3tl::Length::emu);
m_aFlyProperties.push_back(
- std::make_pair<OString, OString>("lineWidth", OString::number(nWidth)));
+ std::make_pair<OString, OString>("lineWidth"_ostr, OString::number(nWidth)));
return;
}
@@ -3932,12 +3940,14 @@ void RtfAttributeOutput::FormatFrameDirection(const SvxFrameDirectionItem& rDire
if (nDir == SvxFrameDirection::Vertical_RL_TB)
{
// Top to bottom non-ASCII font
- m_aFlyProperties.push_back(std::make_pair<OString, OString>("txflTextFlow", "3"));
+ m_aFlyProperties.push_back(
+ std::make_pair<OString, OString>("txflTextFlow"_ostr, "3"_ostr));
}
else if (rDirection.GetValue() == SvxFrameDirection::Vertical_LR_BT)
{
// Bottom to top non-ASCII font
- m_aFlyProperties.push_back(std::make_pair<OString, OString>("txflTextFlow", "2"));
+ m_aFlyProperties.push_back(
+ std::make_pair<OString, OString>("txflTextFlow"_ostr, "2"_ostr));
}
return;
}
@@ -4501,7 +4511,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat
aVerticies.append(";(" + OString::number(aPoly[i].X()) + ","
+ OString::number(aPoly[i].Y()) + ")");
aFlyProperties.push_back(std::make_pair<OString, OString>(
- "pWrapPolygonVertices",
+ "pWrapPolygonVertices"_ostr,
"8;" + OString::number(aPoly.GetSize()) + aVerticies));
}
}
@@ -4509,7 +4519,8 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat
// Below text, behind document, opaque: they all refer to the same thing.
if (!pFlyFrameFormat->GetOpaque().GetValue())
- aFlyProperties.push_back(std::make_pair<OString, OString>("fBehindDocument", "1"));
+ aFlyProperties.push_back(
+ std::make_pair<OString, OString>("fBehindDocument"_ostr, "1"_ostr));
if (pAttrSet)
{
diff --git a/sw/source/ui/misc/translatelangselect.cxx b/sw/source/ui/misc/translatelangselect.cxx
index 4de844e04343..f03d64c7559a 100644
--- a/sw/source/ui/misc/translatelangselect.cxx
+++ b/sw/source/ui/misc/translatelangselect.cxx
@@ -42,34 +42,34 @@
static const std::vector<SwLanguageListItem>& getLanguageVec()
{
static const std::vector<SwLanguageListItem> gLanguageVec{
- SwLanguageListItem("BG", "Bulgarian"),
- SwLanguageListItem("CS", "Czech"),
- SwLanguageListItem("DA", "Danish"),
- SwLanguageListItem("DE", "German"),
- SwLanguageListItem("EL", "Greek"),
- SwLanguageListItem("EN-GB", "English (British)"),
- SwLanguageListItem("EN-US", "English (American)"),
- SwLanguageListItem("ES", "Spanish"),
- SwLanguageListItem("ET", "Estonian"),
- SwLanguageListItem("FI", "Finnish"),
- SwLanguageListItem("FR", "French"),
- SwLanguageListItem("HU", "Hungarian"),
- SwLanguageListItem("ID", "Indonesian"),
- SwLanguageListItem("IT", "Italian"),
- SwLanguageListItem("JA", "Japanese"),
- SwLanguageListItem("LT", "Lithuanian"),
- SwLanguageListItem("LV", "Latvian"),
- SwLanguageListItem("NL", "Dutch"),
- SwLanguageListItem("PL", "Polish"),
- SwLanguageListItem("PT-BR", "Portuguese (Brazilian)"),
- SwLanguageListItem("PT-PT", "Portuguese (European)"),
- SwLanguageListItem("RO", "Romanian"),
- SwLanguageListItem("RU", "Russian"),
- SwLanguageListItem("SK", "Slovak"),
- SwLanguageListItem("SL", "Slovenian"),
- SwLanguageListItem("SV", "Swedish"),
- SwLanguageListItem("TR", "Turkish"),
- SwLanguageListItem("ZH", "Chinese (simplified)")
+ SwLanguageListItem("BG"_ostr, "Bulgarian"_ostr),
+ SwLanguageListItem("CS"_ostr, "Czech"_ostr),
+ SwLanguageListItem("DA"_ostr, "Danish"_ostr),
+ SwLanguageListItem("DE"_ostr, "German"_ostr),
+ SwLanguageListItem("EL"_ostr, "Greek"_ostr),
+ SwLanguageListItem("EN-GB"_ostr, "English (British)"_ostr),
+ SwLanguageListItem("EN-US"_ostr, "English (American)"_ostr),
+ SwLanguageListItem("ES"_ostr, "Spanish"_ostr),
+ SwLanguageListItem("ET"_ostr, "Estonian"_ostr),
+ SwLanguageListItem("FI"_ostr, "Finnish"_ostr),
+ SwLanguageListItem("FR"_ostr, "French"_ostr),
+ SwLanguageListItem("HU"_ostr, "Hungarian"_ostr),
+ SwLanguageListItem("ID"_ostr, "Indonesian"_ostr),
+ SwLanguageListItem("IT"_ostr, "Italian"_ostr),
+ SwLanguageListItem("JA"_ostr, "Japanese"_ostr),
+ SwLanguageListItem("LT"_ostr, "Lithuanian"_ostr),
+ SwLanguageListItem("LV"_ostr, "Latvian"_ostr),
+ SwLanguageListItem("NL"_ostr, "Dutch"_ostr),
+ SwLanguageListItem("PL"_ostr, "Polish"_ostr),
+ SwLanguageListItem("PT-BR"_ostr, "Portuguese (Brazilian)"_ostr),
+ SwLanguageListItem("PT-PT"_ostr, "Portuguese (European)"_ostr),
+ SwLanguageListItem("RO"_ostr, "Romanian"_ostr),
+ SwLanguageListItem("RU"_ostr, "Russian"_ostr),
+ SwLanguageListItem("SK"_ostr, "Slovak"_ostr),
+ SwLanguageListItem("SL"_ostr, "Slovenian"_ostr),
+ SwLanguageListItem("SV"_ostr, "Swedish"_ostr),
+ SwLanguageListItem("TR"_ostr, "Turkish"_ostr),
+ SwLanguageListItem("ZH"_ostr, "Chinese (simplified)"_ostr)
};
return gLanguageVec;
}
diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx
index d1318baac4c7..e7a97f4b8c25 100644
--- a/sw/source/uibase/app/swmodule.cxx
+++ b/sw/source/uibase/app/swmodule.cxx
@@ -128,7 +128,7 @@ using namespace ::com::sun::star::uno;
SwModule::SwModule( SfxObjectFactory* pWebFact,
SfxObjectFactory* pFact,
SfxObjectFactory* pGlobalFact )
- : SfxModule("sw", {pWebFact, pFact, pGlobalFact}),
+ : SfxModule("sw"_ostr, {pWebFact, pFact, pGlobalFact}),
m_pView(nullptr),
m_bAuthorInitialised(false),
m_bEmbeddedLoadSave( false ),
diff --git a/sw/source/uibase/shells/translatehelper.cxx b/sw/source/uibase/shells/translatehelper.cxx
index 64cd27e1fe1d..a3d03542ba5a 100644
--- a/sw/source/uibase/shells/translatehelper.cxx
+++ b/sw/source/uibase/shells/translatehelper.cxx
@@ -62,15 +62,15 @@ OString ExportPaMToHTML(SwPaM* pCursor)
}
aResult
= OString(static_cast<const char*>(aMemoryStream.GetData()), aMemoryStream.GetSize());
- aResult = aResult.replaceAll("<p", "<span");
- aResult = aResult.replaceAll("</p>", "</span>");
+ aResult = aResult.replaceAll("<p"_ostr, "<span"_ostr);
+ aResult = aResult.replaceAll("</p>"_ostr, "</span>"_ostr);
// HTML has for that <br> and <p> also does new line
- aResult = aResult.replaceAll("<ul>", "");
- aResult = aResult.replaceAll("</ul>", "");
- aResult = aResult.replaceAll("<ol>", "");
- aResult = aResult.replaceAll("</ol>", "");
- aResult = aResult.replaceAll("\n", "").trim();
+ aResult = aResult.replaceAll("<ul>"_ostr, ""_ostr);
+ aResult = aResult.replaceAll("</ul>"_ostr, ""_ostr);
+ aResult = aResult.replaceAll("<ol>"_ostr, ""_ostr);
+ aResult = aResult.replaceAll("</ol>"_ostr, ""_ostr);
+ aResult = aResult.replaceAll("\n"_ostr, ""_ostr).trim();
return aResult;
}
return {};
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index a59bd9b5389d..51c6ab24d0f6 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -1143,9 +1143,9 @@ SwViewGlueDocShell::~SwViewGlueDocShell()
SwView::~SwView()
{
// Notify other LOK views that we are going away.
- SfxLokHelper::notifyOtherViews(this, LOK_CALLBACK_VIEW_CURSOR_VISIBLE, "visible", "false");
- SfxLokHelper::notifyOtherViews(this, LOK_CALLBACK_TEXT_VIEW_SELECTION, "selection", "");
- SfxLokHelper::notifyOtherViews(this, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", "EMPTY");
+ SfxLokHelper::notifyOtherViews(this, LOK_CALLBACK_VIEW_CURSOR_VISIBLE, "visible", "false"_ostr);
+ SfxLokHelper::notifyOtherViews(this, LOK_CALLBACK_TEXT_VIEW_SELECTION, "selection", ""_ostr);
+ SfxLokHelper::notifyOtherViews(this, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", "EMPTY"_ostr);
// Need to remove activated field's button before disposing EditWin.
GetWrtShell().getIDocumentMarkAccess()->ClearFieldActivation();
diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx
index a272fae32ee8..5fc92d517b1b 100644
--- a/sw/source/uibase/uiview/viewsrch.cxx
+++ b/sw/source/uibase/uiview/viewsrch.cxx
@@ -114,7 +114,7 @@ static void lcl_emitSearchResultCallbacks(SvxSearchItem const * pSearchItem, SwW
boost::property_tree::ptree aTree;
aTree.put("searchString", pSearchItem->GetSearchString().toUtf8().getStr());
aTree.put("highlightAll", bHighlightAll);
- lcl_addContainerToJson(aTree, "searchResultSelection", aMatches);
+ lcl_addContainerToJson(aTree, "searchResultSelection"_ostr, aMatches);
std::stringstream aStream;
boost::property_tree::write_json(aStream, aTree);
diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx
index 9f44aa214996..5be5651dc9d8 100644
--- a/sw/source/uibase/uiview/viewstat.cxx
+++ b/sw/source/uibase/uiview/viewstat.cxx
@@ -228,7 +228,7 @@ void SwView::GetState(SfxItemSet &rSet)
if (nWhich == SID_ATTR_PAGE_ORIENTATION && comphelper::LibreOfficeKit::isActive())
{
- OString aPayload = ".uno:Orientation=";
+ OString aPayload = ".uno:Orientation="_ostr;
if (rDesc.GetLandscape())
{
aPayload += "IsLandscape";
@@ -441,7 +441,7 @@ void SwView::GetState(SfxItemSet &rSet)
rSet.DisableItem(nWhich);
if (comphelper::LibreOfficeKit::isActive())
{
- OString aPayload(".uno:TrackedChangeIndex=");
+ OString aPayload(".uno:TrackedChangeIndex="_ostr);
SwRedlineTable::size_type nRedline = 0;
if (pDoc->getIDocumentRedlineAccess().GetRedline(*pCursor->Start(), &nRedline))
aPayload += OString::number(nRedline);