diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-05-10 08:26:22 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-05-10 09:51:34 +0200 |
commit | 239ceb315521d9e88fb8290ba391c70a53095af4 (patch) | |
tree | 89d2c12874823ae5eea38385e5f89d5cc902b707 /oox/qa/unit | |
parent | 58a9c936bb065384d50e122ee2ac9037dd60cc32 (diff) |
loplugin:ostr in oox
Change-Id: I08124ce2da1facbe2e84aa4a7a8e25fec24fa962
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167428
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox/qa/unit')
-rw-r--r-- | oox/qa/unit/CryptoTest.cxx | 52 | ||||
-rw-r--r-- | oox/qa/unit/drawingml.cxx | 101 | ||||
-rw-r--r-- | oox/qa/unit/export.cxx | 661 | ||||
-rw-r--r-- | oox/qa/unit/mathml.cxx | 2 | ||||
-rw-r--r-- | oox/qa/unit/mcgr.cxx | 68 | ||||
-rw-r--r-- | oox/qa/unit/shape.cxx | 34 | ||||
-rw-r--r-- | oox/qa/unit/testscene3d.cxx | 22 | ||||
-rw-r--r-- | oox/qa/unit/vba_compression.cxx | 2 | ||||
-rw-r--r-- | oox/qa/unit/vba_encryption.cxx | 3 | ||||
-rw-r--r-- | oox/qa/unit/vml.cxx | 26 | ||||
-rw-r--r-- | oox/qa/unit/wpc_drawing_canvas.cxx | 14 |
11 files changed, 503 insertions, 482 deletions
diff --git a/oox/qa/unit/CryptoTest.cxx b/oox/qa/unit/CryptoTest.cxx index be04c928045e..60938962fa72 100644 --- a/oox/qa/unit/CryptoTest.cxx +++ b/oox/qa/unit/CryptoTest.cxx @@ -130,7 +130,7 @@ void CryptoTest::testStandard2007() { oox::crypto::Standard2007Engine aEngine; { - aEngine.setupEncryption("Password"); + aEngine.setupEncryption(u"Password"_ustr); SvMemoryStream aEncryptionInfo; oox::BinaryXOutputStream aBinaryEncryptionInfoOutputStream( @@ -197,33 +197,33 @@ void CryptoTest::testAgileEncryptionVerifier() { oox::crypto::AgileEngine aEngine; - OUString aPassword("Password"); + OUString aPassword(u"Password"_ustr); - aEngine.setupEncryptionParameters({ 100000, 16, 128, 20, 16, OUString("AES"), - OUString("ChainingModeCBC"), OUString("SHA1") }); + aEngine.setupEncryptionParameters( + { 100000, 16, 128, 20, 16, u"AES"_ustr, u"ChainingModeCBC"_ustr, u"SHA1"_ustr }); CPPUNIT_ASSERT_EQUAL(true, aEngine.generateAndEncryptVerifierHash(aPassword)); - CPPUNIT_ASSERT_EQUAL(false, aEngine.decryptAndCheckVerifierHash("Wrong")); + CPPUNIT_ASSERT_EQUAL(false, aEngine.decryptAndCheckVerifierHash(u"Wrong"_ustr)); CPPUNIT_ASSERT_EQUAL(true, aEngine.decryptAndCheckVerifierHash(aPassword)); - aEngine.setupEncryptionParameters({ 100000, 16, 128, 48, 16, OUString("AES"), - OUString("ChainingModeCBC"), OUString("SHA384") }); + aEngine.setupEncryptionParameters( + { 100000, 16, 128, 48, 16, u"AES"_ustr, u"ChainingModeCBC"_ustr, u"SHA384"_ustr }); CPPUNIT_ASSERT_EQUAL(true, aEngine.generateAndEncryptVerifierHash(aPassword)); - CPPUNIT_ASSERT_EQUAL(false, aEngine.decryptAndCheckVerifierHash("Wrong")); + CPPUNIT_ASSERT_EQUAL(false, aEngine.decryptAndCheckVerifierHash(u"Wrong"_ustr)); CPPUNIT_ASSERT_EQUAL(true, aEngine.decryptAndCheckVerifierHash(aPassword)); - aEngine.setupEncryptionParameters({ 100000, 16, 256, 64, 16, OUString("AES"), - OUString("ChainingModeCBC"), OUString("SHA512") }); + aEngine.setupEncryptionParameters( + { 100000, 16, 256, 64, 16, u"AES"_ustr, u"ChainingModeCBC"_ustr, u"SHA512"_ustr }); CPPUNIT_ASSERT_EQUAL(true, aEngine.generateAndEncryptVerifierHash(aPassword)); - CPPUNIT_ASSERT_EQUAL(false, aEngine.decryptAndCheckVerifierHash("Wrong")); + CPPUNIT_ASSERT_EQUAL(false, aEngine.decryptAndCheckVerifierHash(u"Wrong"_ustr)); CPPUNIT_ASSERT_EQUAL(true, aEngine.decryptAndCheckVerifierHash(aPassword)); } void CryptoTest::testAgileEncryptionInfoWritingAndParsing() { - OUString aPassword("Password"); + OUString aPassword(u"Password"_ustr); std::vector<sal_uInt8> aKeyDataSalt; { // Preset AES128 - SHA1 @@ -262,12 +262,12 @@ void CryptoTest::testAgileEncryptionInfoWritingAndParsing() CPPUNIT_ASSERT_EQUAL(sal_Int32(128), rInfo.keyBits); CPPUNIT_ASSERT_EQUAL(sal_Int32(20), rInfo.hashSize); CPPUNIT_ASSERT_EQUAL(sal_Int32(16), rInfo.blockSize); - CPPUNIT_ASSERT_EQUAL(OUString("AES"), rInfo.cipherAlgorithm); - CPPUNIT_ASSERT_EQUAL(OUString("ChainingModeCBC"), rInfo.cipherChaining); - CPPUNIT_ASSERT_EQUAL(OUString("SHA1"), rInfo.hashAlgorithm); + CPPUNIT_ASSERT_EQUAL(u"AES"_ustr, rInfo.cipherAlgorithm); + CPPUNIT_ASSERT_EQUAL(u"ChainingModeCBC"_ustr, rInfo.cipherChaining); + CPPUNIT_ASSERT_EQUAL(u"SHA1"_ustr, rInfo.hashAlgorithm); CPPUNIT_ASSERT_EQUAL(toString(aKeyDataSalt), toString(rInfo.keyDataSalt)); - CPPUNIT_ASSERT_EQUAL(false, aEngine.decryptAndCheckVerifierHash("Wrong")); + CPPUNIT_ASSERT_EQUAL(false, aEngine.decryptAndCheckVerifierHash(u"Wrong"_ustr)); CPPUNIT_ASSERT_EQUAL(true, aEngine.decryptAndCheckVerifierHash(aPassword)); } } @@ -308,12 +308,12 @@ void CryptoTest::testAgileEncryptionInfoWritingAndParsing() CPPUNIT_ASSERT_EQUAL(sal_Int32(128), rInfo.keyBits); CPPUNIT_ASSERT_EQUAL(sal_Int32(48), rInfo.hashSize); CPPUNIT_ASSERT_EQUAL(sal_Int32(16), rInfo.blockSize); - CPPUNIT_ASSERT_EQUAL(OUString("AES"), rInfo.cipherAlgorithm); - CPPUNIT_ASSERT_EQUAL(OUString("ChainingModeCBC"), rInfo.cipherChaining); - CPPUNIT_ASSERT_EQUAL(OUString("SHA384"), rInfo.hashAlgorithm); + CPPUNIT_ASSERT_EQUAL(u"AES"_ustr, rInfo.cipherAlgorithm); + CPPUNIT_ASSERT_EQUAL(u"ChainingModeCBC"_ustr, rInfo.cipherChaining); + CPPUNIT_ASSERT_EQUAL(u"SHA384"_ustr, rInfo.hashAlgorithm); CPPUNIT_ASSERT_EQUAL(toString(aKeyDataSalt), toString(rInfo.keyDataSalt)); - CPPUNIT_ASSERT_EQUAL(false, aEngine.decryptAndCheckVerifierHash("Wrong")); + CPPUNIT_ASSERT_EQUAL(false, aEngine.decryptAndCheckVerifierHash(u"Wrong"_ustr)); CPPUNIT_ASSERT_EQUAL(true, aEngine.decryptAndCheckVerifierHash(aPassword)); } } @@ -354,12 +354,12 @@ void CryptoTest::testAgileEncryptionInfoWritingAndParsing() CPPUNIT_ASSERT_EQUAL(sal_Int32(256), rInfo.keyBits); CPPUNIT_ASSERT_EQUAL(sal_Int32(64), rInfo.hashSize); CPPUNIT_ASSERT_EQUAL(sal_Int32(16), rInfo.blockSize); - CPPUNIT_ASSERT_EQUAL(OUString("AES"), rInfo.cipherAlgorithm); - CPPUNIT_ASSERT_EQUAL(OUString("ChainingModeCBC"), rInfo.cipherChaining); - CPPUNIT_ASSERT_EQUAL(OUString("SHA512"), rInfo.hashAlgorithm); + CPPUNIT_ASSERT_EQUAL(u"AES"_ustr, rInfo.cipherAlgorithm); + CPPUNIT_ASSERT_EQUAL(u"ChainingModeCBC"_ustr, rInfo.cipherChaining); + CPPUNIT_ASSERT_EQUAL(u"SHA512"_ustr, rInfo.hashAlgorithm); CPPUNIT_ASSERT_EQUAL(toString(aKeyDataSalt), toString(rInfo.keyDataSalt)); - CPPUNIT_ASSERT_EQUAL(false, aEngine.decryptAndCheckVerifierHash("Wrong")); + CPPUNIT_ASSERT_EQUAL(false, aEngine.decryptAndCheckVerifierHash(u"Wrong"_ustr)); CPPUNIT_ASSERT_EQUAL(true, aEngine.decryptAndCheckVerifierHash(aPassword)); } } @@ -367,7 +367,7 @@ void CryptoTest::testAgileEncryptionInfoWritingAndParsing() void CryptoTest::testAgileDataIntegrityHmacKey() { - OUString aPassword("Password"); + OUString aPassword(u"Password"_ustr); std::vector<sal_uInt8> aKeyDataSalt; @@ -413,7 +413,7 @@ void CryptoTest::testAgileDataIntegrityHmacKey() void CryptoTest::testAgileEncryptingAndDecrypting() { - OUString aPassword("Password"); + OUString aPassword(u"Password"_ustr); SvMemoryStream aEncryptionInfo; SvMemoryStream aEncryptedStream; diff --git a/oox/qa/unit/drawingml.cxx b/oox/qa/unit/drawingml.cxx index 2a41416e5484..923758ee28a7 100644 --- a/oox/qa/unit/drawingml.cxx +++ b/oox/qa/unit/drawingml.cxx @@ -63,7 +63,7 @@ class OoxDrawingmlTest : public UnoApiTest { public: OoxDrawingmlTest() - : UnoApiTest("/oox/qa/unit/data/") + : UnoApiTest(u"/oox/qa/unit/data/"_ustr) { } }; @@ -71,7 +71,7 @@ public: CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTransparentText) { loadFromFile(u"transparent-text.pptx"); - saveAndReload("Impress Office Open XML"); + saveAndReload(u"Impress Office Open XML"_ustr); uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<drawing::XDrawPage> xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), @@ -83,7 +83,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTransparentText) uno::UNO_QUERY); sal_Int16 nTransparency = 0; - xPortion->getPropertyValue("CharTransparence") >>= nTransparency; + xPortion->getPropertyValue(u"CharTransparence"_ustr) >>= nTransparency; // Without the accompanying fix in place, this test would have failed with: // - Expected: 75 @@ -95,7 +95,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTransparentText) CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTdf131082) { loadFromFile(u"tdf131082.pptx"); - saveAndReload("Impress Office Open XML"); + saveAndReload(u"Impress Office Open XML"_ustr); uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<drawing::XDrawPage> xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), @@ -106,7 +106,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTdf131082) uno::UNO_QUERY); drawing::FillStyle eFillStyle = drawing::FillStyle_NONE; - XPropSet->getPropertyValue("FillStyle") >>= eFillStyle; + XPropSet->getPropertyValue(u"FillStyle"_ustr) >>= eFillStyle; // Without the accompanying fix in place, this test would have failed with: // with drawing::FillStyle_NONE - 0 @@ -123,10 +123,10 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testPresetAdjustValue) uno::Reference<drawing::XShape> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY); uno::Sequence<beans::PropertyValue> aGeoPropSeq; - xShapeProps->getPropertyValue("CustomShapeGeometry") >>= aGeoPropSeq; + xShapeProps->getPropertyValue(u"CustomShapeGeometry"_ustr) >>= aGeoPropSeq; comphelper::SequenceAsHashMap aGeoPropMap(aGeoPropSeq); uno::Sequence<drawing::EnhancedCustomShapeAdjustmentValue> aAdjustmentSeq; - aGeoPropMap.getValue("AdjustmentValues") >>= aAdjustmentSeq; + aGeoPropMap.getValue(u"AdjustmentValues"_ustr) >>= aAdjustmentSeq; CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), aAdjustmentSeq.getLength()); // Without the accompanying fix in place, this test would have failed with: // - Expected: 11587 @@ -143,7 +143,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testChartDataLabelCharColor) uno::Reference<drawing::XDrawPage> xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); - uno::Reference<chart2::XChartDocument> xModel(xShape->getPropertyValue("Model"), + uno::Reference<chart2::XChartDocument> xModel(xShape->getPropertyValue(u"Model"_ustr), uno::UNO_QUERY); uno::Reference<chart2::XCoordinateSystemContainer> xDiagram(xModel->getFirstDiagram(), uno::UNO_QUERY); @@ -159,11 +159,11 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testChartDataLabelCharColor) uno::Reference<beans::XPropertySet> xDataPoint = xDataSeries->getDataPointByIndex(0); uno::Sequence<uno::Reference<chart2::XDataPointCustomLabelField>> aLabels; - xDataPoint->getPropertyValue("CustomLabelFields") >>= aLabels; + xDataPoint->getPropertyValue(u"CustomLabelFields"_ustr) >>= aLabels; uno::Reference<beans::XPropertySet> xLabel = aLabels[0]; Color nCharColor; - xLabel->getPropertyValue("CharColor") >>= nCharColor; + xLabel->getPropertyValue(u"CharColor"_ustr) >>= nCharColor; // Without the accompanying fix in place, this test would have failed with: // - Expected: 16777215 // - Actual : -1 @@ -181,10 +181,10 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testGradientMultiStepTransparency) uno::Reference<drawing::XDrawPage> xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), uno::UNO_QUERY); uno::Reference<container::XNamed> xShape(xDrawPage->getByIndex(1), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("Rectangle 4"), xShape->getName()); + CPPUNIT_ASSERT_EQUAL(u"Rectangle 4"_ustr, xShape->getName()); uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY); awt::Gradient2 aTransparence; - xShapeProps->getPropertyValue("FillTransparenceGradient") >>= aTransparence; + xShapeProps->getPropertyValue(u"FillTransparenceGradient"_ustr) >>= aTransparence; // Without the accompanying fix in place, this test would have failed with: // - Expected: 16777215 (COL_WHITE) @@ -217,7 +217,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testShapeTextAlignment) uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); sal_Int16 nParaAdjust = -1; - CPPUNIT_ASSERT(xShape->getPropertyValue("ParaAdjust") >>= nParaAdjust); + CPPUNIT_ASSERT(xShape->getPropertyValue(u"ParaAdjust"_ustr) >>= nParaAdjust); // Without the accompanying fix in place, this test would have failed with: // - Expected: 0 // - Actual : 3 @@ -239,7 +239,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testShapeTextAdjustLeft) // - Expected: 3 (center) // - Actual : 1 (block) // i.e. text was center-adjusted, not default-adjusted (~left). - CPPUNIT_ASSERT(xShape->getPropertyValue("TextHorizontalAdjust") >>= eAdjust); + CPPUNIT_ASSERT(xShape->getPropertyValue(u"TextHorizontalAdjust"_ustr) >>= eAdjust); CPPUNIT_ASSERT_EQUAL(drawing::TextHorizontalAdjust_BLOCK, eAdjust); } @@ -256,8 +256,8 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testCameraRotationRevolution) uno::Reference<beans::XPropertySet> xShapeProps1(xShape1, uno::UNO_QUERY); sal_Int32 nRotateAngle0; sal_Int32 nRotateAngle1; - xShapeProps0->getPropertyValue("RotateAngle") >>= nRotateAngle0; - xShapeProps1->getPropertyValue("RotateAngle") >>= nRotateAngle1; + xShapeProps0->getPropertyValue(u"RotateAngle"_ustr) >>= nRotateAngle0; + xShapeProps1->getPropertyValue(u"RotateAngle"_ustr) >>= nRotateAngle1; // Without the accompanying fix in place, this test would have failed with: // - Expected: 8000 @@ -280,8 +280,8 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTdf146534_CameraRotationRevolutionNon uno::Reference<beans::XPropertySet> xShapeProps1(xShape1, uno::UNO_QUERY); sal_Int32 nRotateAngle0; sal_Int32 nRotateAngle1; - xShapeProps0->getPropertyValue("RotateAngle") >>= nRotateAngle0; - xShapeProps1->getPropertyValue("RotateAngle") >>= nRotateAngle1; + xShapeProps0->getPropertyValue(u"RotateAngle"_ustr) >>= nRotateAngle0; + xShapeProps1->getPropertyValue(u"RotateAngle"_ustr) >>= nRotateAngle1; // Without the accompanying fix in place, this test would have failed with: // - Expected: 9000 @@ -299,11 +299,11 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTableShadow) xDrawPagesSupplier->getDrawPages()->getByIndex(0), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); bool bShadow = false; - CPPUNIT_ASSERT(xShape->getPropertyValue("Shadow") >>= bShadow); + CPPUNIT_ASSERT(xShape->getPropertyValue(u"Shadow"_ustr) >>= bShadow); CPPUNIT_ASSERT(bShadow); Color nColor; - CPPUNIT_ASSERT(xShape->getPropertyValue("ShadowColor") >>= nColor); + CPPUNIT_ASSERT(xShape->getPropertyValue(u"ShadowColor"_ustr) >>= nColor); CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, nColor); }; loadFromFile(u"table-shadow.pptx"); @@ -311,7 +311,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTableShadow) // was lost on import. verify(mxComponent); - saveAndReload("Impress Office Open XML"); + saveAndReload(u"Impress Office Open XML"_ustr); // Without the accompanying fix in place, this test would have failed, because shadow on a table // was lost on export. @@ -340,7 +340,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTdf142605_CurveSize) // rectangle of the shape. Error was, that the export uses a path size which included the // control points. loadFromFile(u"tdf142605_CurveSize.odp"); - saveAndReload("Impress Office Open XML"); + saveAndReload(u"Impress Office Open XML"_ustr); uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); auto xPage = xDrawPagesSupplier->getDrawPages()->getByIndex(0); @@ -354,7 +354,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTdf142605_CurveSize) CPPUNIT_ASSERT_EQUAL(u"Bézier curve 1"_ustr, xShapeNamed->getName()); css::awt::Rectangle aBoundRect; - xShapeProps->getPropertyValue("BoundRect") >>= aBoundRect; + xShapeProps->getPropertyValue(u"BoundRect"_ustr) >>= aBoundRect; // Without fix, size was 6262 x 3509, and position was 10037|6790. CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(8601), aBoundRect.Width, 1); CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(4601), aBoundRect.Height, 1); @@ -379,7 +379,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testChartThemeOverride) uno::Reference<beans::XPropertySet> xPortion(xPara->createEnumeration()->nextElement(), uno::UNO_QUERY); Color nActual{ 0 }; - xPortion->getPropertyValue("CharColor") >>= nActual; + xPortion->getPropertyValue(u"CharColor"_ustr) >>= nActual; // Without the accompanying fix in place, this test would have failed with: // - Expected: 4485828 (0x4472c4) // - Actual : 16711680 (0xff0000) @@ -400,7 +400,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testPptxTheme) uno::Reference<beans::XPropertySet> xMasterpage(xDrawPage->getMasterPage(), uno::UNO_QUERY); uno::Reference<util::XTheme> xTheme; - xMasterpage->getPropertyValue("Theme") >>= xTheme; + xMasterpage->getPropertyValue(u"Theme"_ustr) >>= xTheme; // We expect the theme to be set on the master page CPPUNIT_ASSERT(xTheme.is()); @@ -408,8 +408,8 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testPptxTheme) CPPUNIT_ASSERT(pUnoTheme); auto pTheme = pUnoTheme->getTheme(); - CPPUNIT_ASSERT_EQUAL(OUString("Office Theme"), pTheme->GetName()); - CPPUNIT_ASSERT_EQUAL(OUString("Office"), pTheme->getColorSet()->getName()); + CPPUNIT_ASSERT_EQUAL(u"Office Theme"_ustr, pTheme->GetName()); + CPPUNIT_ASSERT_EQUAL(u"Office"_ustr, pTheme->getColorSet()->getName()); CPPUNIT_ASSERT_EQUAL(Color(0x954F72), pTheme->getColorSet()->getColor(model::ThemeColorType::FollowedHyperlink)); @@ -426,7 +426,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testPptxTheme) // Check the theme colors are as expected { uno::Reference<util::XComplexColor> xComplexColor; - CPPUNIT_ASSERT(xPortion->getPropertyValue("CharComplexColor") >>= xComplexColor); + CPPUNIT_ASSERT(xPortion->getPropertyValue(u"CharComplexColor"_ustr) >>= xComplexColor); CPPUNIT_ASSERT(xComplexColor.is()); auto aComplexColor = model::color::getFromXComplexColor(xComplexColor); CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aComplexColor.getThemeColorType()); @@ -450,19 +450,16 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTdf132557_footerCustomShapes) // Test if we were able to import the footer shapes with CustomShape service. uno::Reference<drawing::XShape> xShapeDateTime(xDrawPage->getByIndex(0), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.CustomShape"), - xShapeDateTime->getShapeType()); + CPPUNIT_ASSERT_EQUAL(u"com.sun.star.drawing.CustomShape"_ustr, xShapeDateTime->getShapeType()); // Without the accompanying fix in place, this test would have failed with: // An uncaught exception of type com.sun.star.lang.IndexOutOfBoundsException // i.e. the shape wasn't on the slide there since it was imported as a property, not a shape. uno::Reference<drawing::XShape> xShapeFooter(xDrawPage->getByIndex(1), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.CustomShape"), - xShapeFooter->getShapeType()); + CPPUNIT_ASSERT_EQUAL(u"com.sun.star.drawing.CustomShape"_ustr, xShapeFooter->getShapeType()); uno::Reference<drawing::XShape> xShapeSlideNum(xDrawPage->getByIndex(2), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.CustomShape"), - xShapeSlideNum->getShapeType()); + CPPUNIT_ASSERT_EQUAL(u"com.sun.star.drawing.CustomShape"_ustr, xShapeSlideNum->getShapeType()); } CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testThemeColorTint_Table) @@ -475,13 +472,13 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testThemeColorTint_Table) uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); uno::Reference<table::XCellRange> xTable; - CPPUNIT_ASSERT(xShape->getPropertyValue("Model") >>= xTable); + CPPUNIT_ASSERT(xShape->getPropertyValue(u"Model"_ustr) >>= xTable); uno::Reference<beans::XPropertySet> xA1(xTable->getCellByPosition(0, 0), uno::UNO_QUERY); // check theme color { uno::Reference<util::XComplexColor> xComplexColor; - CPPUNIT_ASSERT(xA1->getPropertyValue("FillComplexColor") >>= xComplexColor); + CPPUNIT_ASSERT(xA1->getPropertyValue(u"FillComplexColor"_ustr) >>= xComplexColor); CPPUNIT_ASSERT(xComplexColor.is()); auto aComplexColor = model::color::getFromXComplexColor(xComplexColor); CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aComplexColor.getThemeColorType()); @@ -494,7 +491,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testThemeColorTint_Table) { uno::Reference<beans::XPropertySet> xA2(xTable->getCellByPosition(0, 1), uno::UNO_QUERY); uno::Reference<util::XComplexColor> xComplexColor; - CPPUNIT_ASSERT(xA2->getPropertyValue("FillComplexColor") >>= xComplexColor); + CPPUNIT_ASSERT(xA2->getPropertyValue(u"FillComplexColor"_ustr) >>= xComplexColor); CPPUNIT_ASSERT(xComplexColor.is()); auto aComplexColor = model::color::getFromXComplexColor(xComplexColor); CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aComplexColor.getThemeColorType()); @@ -522,7 +519,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testThemeColor_Shape) { uno::Reference<beans::XPropertySet> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); uno::Reference<util::XComplexColor> xComplexColor; - CPPUNIT_ASSERT(xShape->getPropertyValue("FillComplexColor") >>= xComplexColor); + CPPUNIT_ASSERT(xShape->getPropertyValue(u"FillComplexColor"_ustr) >>= xComplexColor); CPPUNIT_ASSERT(xComplexColor.is()); { auto aComplexColor = model::color::getFromXComplexColor(xComplexColor); @@ -536,7 +533,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testThemeColor_Shape) CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), rTrans[1].mnValue); } - CPPUNIT_ASSERT(xShape->getPropertyValue("LineComplexColor") >>= xComplexColor); + CPPUNIT_ASSERT(xShape->getPropertyValue(u"LineComplexColor"_ustr) >>= xComplexColor); CPPUNIT_ASSERT(xComplexColor.is()); { auto aComplexColor = model::color::getFromXComplexColor(xComplexColor); @@ -552,7 +549,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testThemeColor_Shape) { uno::Reference<util::XComplexColor> xComplexColor; uno::Reference<beans::XPropertySet> xShape(xDrawPage->getByIndex(1), uno::UNO_QUERY); - CPPUNIT_ASSERT(xShape->getPropertyValue("FillComplexColor") >>= xComplexColor); + CPPUNIT_ASSERT(xShape->getPropertyValue(u"FillComplexColor"_ustr) >>= xComplexColor); CPPUNIT_ASSERT(xComplexColor.is()); { auto aComplexColor = model::color::getFromXComplexColor(xComplexColor); @@ -562,7 +559,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testThemeColor_Shape) CPPUNIT_ASSERT_EQUAL(size_t(0), rTrans.size()); } - CPPUNIT_ASSERT(xShape->getPropertyValue("LineComplexColor") >>= xComplexColor); + CPPUNIT_ASSERT(xShape->getPropertyValue(u"LineComplexColor"_ustr) >>= xComplexColor); CPPUNIT_ASSERT(xComplexColor.is()); { auto aComplexColor = model::color::getFromXComplexColor(xComplexColor); @@ -589,11 +586,11 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testVert270AndTextRot) uno::Reference<drawing::XShape> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY); uno::Sequence<beans::PropertyValue> aGeoPropSeq; - xShapeProps->getPropertyValue("CustomShapeGeometry") >>= aGeoPropSeq; + xShapeProps->getPropertyValue(u"CustomShapeGeometry"_ustr) >>= aGeoPropSeq; comphelper::SequenceAsHashMap aGeoPropMap(aGeoPropSeq); // Without the fix the property "TextRotateAngle" does not exist. - comphelper::SequenceAsHashMap::iterator it = aGeoPropMap.find("TextRotateAngle"); + comphelper::SequenceAsHashMap::iterator it = aGeoPropMap.find(u"TextRotateAngle"_ustr); CPPUNIT_ASSERT(it != aGeoPropMap.end()); sal_Int32 nAngle; // MS 720000 clockwise -> ODF -12deg counter-clockwise @@ -614,11 +611,11 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTextRot) uno::Reference<drawing::XShape> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY); uno::Sequence<beans::PropertyValue> aGeoPropSeq; - xShapeProps->getPropertyValue("CustomShapeGeometry") >>= aGeoPropSeq; + xShapeProps->getPropertyValue(u"CustomShapeGeometry"_ustr) >>= aGeoPropSeq; comphelper::SequenceAsHashMap aGeoPropMap(aGeoPropSeq); // Without the fix the property "TextRotateAngle" does not exist. - comphelper::SequenceAsHashMap::iterator it = aGeoPropMap.find("TextRotateAngle"); + comphelper::SequenceAsHashMap::iterator it = aGeoPropMap.find(u"TextRotateAngle"_ustr); CPPUNIT_ASSERT(it != aGeoPropMap.end()); sal_Int32 nAngle; // MS 720000 clockwise -> ODF -12deg counter-clockwise @@ -627,7 +624,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTextRot) // Because writing mode is LR_TB, the property "TextPreRotateAngle" may missing, or in case it // exists, its value must be 0. Without fix it had value -12. - it = aGeoPropMap.find("TextPreRotateAngle"); + it = aGeoPropMap.find(u"TextPreRotateAngle"_ustr); if (it != aGeoPropMap.end()) { it->second >>= nAngle; @@ -646,11 +643,11 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTdf113187ConstantArcTo) uno::Reference<drawing::XShape> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY); uno::Sequence<beans::PropertyValue> aGeoPropSeq; - xShapeProps->getPropertyValue("CustomShapeGeometry") >>= aGeoPropSeq; + xShapeProps->getPropertyValue(u"CustomShapeGeometry"_ustr) >>= aGeoPropSeq; comphelper::SequenceAsHashMap aGeoPropMap(aGeoPropSeq); // Without the fix width and height of the ViewBox were 0 and thus the shape was not shown. - auto aViewBox = aGeoPropMap["ViewBox"].get<css::awt::Rectangle>(); + auto aViewBox = aGeoPropMap[u"ViewBox"_ustr].get<css::awt::Rectangle>(); CPPUNIT_ASSERT_EQUAL(sal_Int32(3600000), aViewBox.Width); CPPUNIT_ASSERT_EQUAL(sal_Int32(3600000), aViewBox.Height); } @@ -670,10 +667,10 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTdf125085WordArtFontTheme) // Make sure shape has correct font and local. // Without the fix some application defaults were used. OUString sFontName; - xShapeProps->getPropertyValue("CharFontNameComplex") >>= sFontName; + xShapeProps->getPropertyValue(u"CharFontNameComplex"_ustr) >>= sFontName; CPPUNIT_ASSERT_EQUAL(u"Noto Serif Hebrew"_ustr, sFontName); css::lang::Locale aLocal; - xShapeProps->getPropertyValue("CharLocaleComplex") >>= aLocal; + xShapeProps->getPropertyValue(u"CharLocaleComplex"_ustr) >>= aLocal; CPPUNIT_ASSERT_EQUAL(u"IL"_ustr, aLocal.Country); CPPUNIT_ASSERT_EQUAL(u"he"_ustr, aLocal.Language); } @@ -693,10 +690,10 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTdf125085WordArtFontText) // Make sure shape has correct font and local. // Without the fix some application defaults were used. OUString sFontName; - xShapeProps->getPropertyValue("CharFontNameComplex") >>= sFontName; + xShapeProps->getPropertyValue(u"CharFontNameComplex"_ustr) >>= sFontName; CPPUNIT_ASSERT_EQUAL(u"Noto Serif Hebrew"_ustr, sFontName); css::lang::Locale aLocal; - xShapeProps->getPropertyValue("CharLocaleComplex") >>= aLocal; + xShapeProps->getPropertyValue(u"CharLocaleComplex"_ustr) >>= aLocal; CPPUNIT_ASSERT_EQUAL(u"IL"_ustr, aLocal.Country); CPPUNIT_ASSERT_EQUAL(u"he"_ustr, aLocal.Language); } diff --git a/oox/qa/unit/export.cxx b/oox/qa/unit/export.cxx index bfee2e7ef8b3..36ab2a4acfa5 100644 --- a/oox/qa/unit/export.cxx +++ b/oox/qa/unit/export.cxx @@ -21,7 +21,7 @@ class Test : public UnoApiXmlTest { public: Test() - : UnoApiXmlTest("/oox/qa/unit/data/") + : UnoApiXmlTest(u"/oox/qa/unit/data/"_ustr) { } }; @@ -31,23 +31,25 @@ CPPUNIT_TEST_FIXTURE(Test, testPolylineConnectorPosition) // Given a document with a group shape and therein a polyline and a connector. loadFromFile(u"tdf141786_PolylineConnectorInGroup.odt"); // When saving that to DOCX: - save("Office Open XML Text"); + save(u"Office Open XML Text"_ustr); // Then make sure polyline and connector have the correct position. - xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // For child elements of groups in Writer the position has to be adapted to be relative // to group instead of being relative to anchor. That was missing for polyline and // connector. // Polyline: Without fix it would have failed with expected: 0, actual: 1800360 - assertXPath(pXmlDoc, "//wpg:wgp/wps:wsp[1]/wps:spPr/a:xfrm/a:off"_ostr, "x"_ostr, "0"); + assertXPath(pXmlDoc, "//wpg:wgp/wps:wsp[1]/wps:spPr/a:xfrm/a:off"_ostr, "x"_ostr, u"0"_ustr); // ... failed with expected: 509400, actual: 1229400 - assertXPath(pXmlDoc, "//wpg:wgp/wps:wsp[1]/wps:spPr/a:xfrm/a:off"_ostr, "y"_ostr, "509400"); + assertXPath(pXmlDoc, "//wpg:wgp/wps:wsp[1]/wps:spPr/a:xfrm/a:off"_ostr, "y"_ostr, + u"509400"_ustr); // Connector: Without fix it would have failed with expected: 763200, actual: 2563560 - assertXPath(pXmlDoc, "//wpg:wgp/wps:wsp[3]/wps:spPr/a:xfrm/a:off"_ostr, "x"_ostr, "763200"); + assertXPath(pXmlDoc, "//wpg:wgp/wps:wsp[3]/wps:spPr/a:xfrm/a:off"_ostr, "x"_ostr, + u"763200"_ustr); // ... failed with expected: 0, actual: 720000 - assertXPath(pXmlDoc, "//wpg:wgp/wps:wsp[3]/wps:spPr/a:xfrm/a:off"_ostr, "y"_ostr, "0"); + assertXPath(pXmlDoc, "//wpg:wgp/wps:wsp[3]/wps:spPr/a:xfrm/a:off"_ostr, "y"_ostr, u"0"_ustr); // Polyline and connector were shifted 1800360EMU right, 720000EMU down. } @@ -60,27 +62,28 @@ CPPUNIT_TEST_FIXTURE(Test, testRotatedShapePosition) skipValidation(); // When saving that to DOCX: - save("Office Open XML Text"); + save(u"Office Open XML Text"_ustr); // Then make sure the rotated child shape has the correct position. - xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // For a group itself and for shapes outside of groups, the position calculation is done in // DocxSdrExport. For child elements of groups it has to be done in // DrawingML::WriteShapeTransformation(), but was missing. // Without fix it would have failed with expected: 469440, actual: 92160 // The shape was about 1cm shifted up and partly outside its group. - assertXPath(pXmlDoc, "//wpg:wgp/wps:wsp[1]/wps:spPr/a:xfrm/a:off"_ostr, "y"_ostr, "469440"); + assertXPath(pXmlDoc, "//wpg:wgp/wps:wsp[1]/wps:spPr/a:xfrm/a:off"_ostr, "y"_ostr, + u"469440"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testInsertCheckboxContentControlOdt) { loadFromFile(u"tdf141786_RotatedShapeInGroup.odt"); - dispatchCommand(mxComponent, ".uno:TrackChanges", {}); - dispatchCommand(mxComponent, ".uno:InsertCheckboxContentControl", {}); + dispatchCommand(mxComponent, u".uno:TrackChanges"_ustr, {}); + dispatchCommand(mxComponent, u".uno:InsertCheckboxContentControl"_ustr, {}); - save("Office Open XML Text"); + save(u"Office Open XML Text"_ustr); // validate(maTempFile.GetFileName(), test::OOXML); // Enable when unrelated errors are fixed. } @@ -91,9 +94,9 @@ CPPUNIT_TEST_FIXTURE(Test, testInsertCheckboxContentControlDocx) // Without TrackChanges, inserting the Checkbox works just fine // when exporting to docx. - dispatchCommand(mxComponent, ".uno:InsertCheckboxContentControl", {}); + dispatchCommand(mxComponent, u".uno:InsertCheckboxContentControl"_ustr, {}); - save("Office Open XML Text"); + save(u"Office Open XML Text"_ustr); // validate(maTempFile.GetFileName(), test::OOXML); // Enable when unrelated errors are fixed. } @@ -108,22 +111,22 @@ CPPUNIT_TEST_FIXTURE(Test, testInsertCheckboxContentControlDocx) // in void sax_fastparser::FastSaxSerializer::endFastElement(sal_Int32). // Element == maMarkStack.top()->m_DebugStartedElements.back() // sax/source/tools/fastserializer.cxx#402 - dispatchCommand(mxComponent, ".uno:TrackChanges", {}); + dispatchCommand(mxComponent, u".uno:TrackChanges"_ustr, {}); xText->insertControlCharacter(xCursor, text::ControlCharacter::PARAGRAPH_BREAK, false); - dispatchCommand(mxComponent, ".uno:InsertCheckboxContentControl", {}); + dispatchCommand(mxComponent, u".uno:InsertCheckboxContentControl"_ustr, {}); // Loading should not show the "corrupted" dialog, which would assert. - saveAndReload("Office Open XML Text"); + saveAndReload(u"Office Open XML Text"_ustr); // Now that we loaded it successfully, delete the controls, // still with change-tracking enabled, and save. - dispatchCommand(mxComponent, ".uno:SelectAll", {}); - dispatchCommand(mxComponent, ".uno:Delete", {}); + dispatchCommand(mxComponent, u".uno:SelectAll"_ustr, {}); + dispatchCommand(mxComponent, u".uno:Delete"_ustr, {}); // Loading should not show the "corrupted" dialog, which would assert. - saveAndReload("Office Open XML Text"); + saveAndReload(u"Office Open XML Text"_ustr); // validate(maTempFile.GetFileName(), test::OOXML); // Enable when unrelated errors are fixed. } } @@ -137,16 +140,16 @@ CPPUNIT_TEST_FIXTURE(Test, testDmlGroupshapePolygon) skipValidation(); // When saving that to DOCX: - save("Office Open XML Text"); + save(u"Office Open XML Text"_ustr); // Then make sure that the group shape, the group shape's child size and the child shape's size // match: - xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); - assertXPath(pXmlDoc, "//wpg:grpSpPr/a:xfrm/a:ext"_ostr, "cx"_ostr, "5328360"); + xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); + assertXPath(pXmlDoc, "//wpg:grpSpPr/a:xfrm/a:ext"_ostr, "cx"_ostr, u"5328360"_ustr); // Without the accompanying fix in place, this test would have failed, the <a:chExt> element was // not written. - assertXPath(pXmlDoc, "//wpg:grpSpPr/a:xfrm/a:chExt"_ostr, "cx"_ostr, "5328360"); - assertXPath(pXmlDoc, "//wps:spPr/a:xfrm/a:ext"_ostr, "cx"_ostr, "5328360"); + assertXPath(pXmlDoc, "//wpg:grpSpPr/a:xfrm/a:chExt"_ostr, "cx"_ostr, u"5328360"_ustr); + assertXPath(pXmlDoc, "//wps:spPr/a:xfrm/a:ext"_ostr, "cx"_ostr, u"5328360"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testCustomShapeArrowExport) @@ -158,10 +161,10 @@ CPPUNIT_TEST_FIXTURE(Test, testCustomShapeArrowExport) skipValidation(); // When saving that to DOCX: - save("Office Open XML Text"); + save(u"Office Open XML Text"_ustr); // Then the shapes should retain their correct control values. - xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Without the fix the output OOXML would have no <a:prstGeom> tags in it. @@ -169,173 +172,173 @@ CPPUNIT_TEST_FIXTURE(Test, testCustomShapeArrowExport) assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom"_ostr, - "prst"_ostr, "rightArrow"); + "prst"_ostr, u"rightArrow"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[1]"_ostr, - "fmla"_ostr, "val 50000"); + "fmla"_ostr, u"val 50000"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[2]"_ostr, - "fmla"_ostr, "val 46321"); + "fmla"_ostr, u"val 46321"_ustr); // Left arrow assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom"_ostr, - "prst"_ostr, "leftArrow"); + "prst"_ostr, u"leftArrow"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[1]"_ostr, - "fmla"_ostr, "val 50000"); + "fmla"_ostr, u"val 50000"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[2]"_ostr, - "fmla"_ostr, "val 52939"); + "fmla"_ostr, u"val 52939"_ustr); // Down arrow assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom"_ostr, - "prst"_ostr, "downArrow"); + "prst"_ostr, u"downArrow"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[1]"_ostr, - "fmla"_ostr, "val 50000"); + "fmla"_ostr, u"val 50000"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[2]"_ostr, - "fmla"_ostr, "val 59399"); + "fmla"_ostr, u"val 59399"_ustr); // Up arrow assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[4]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom"_ostr, - "prst"_ostr, "upArrow"); + "prst"_ostr, u"upArrow"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[4]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[1]"_ostr, - "fmla"_ostr, "val 50000"); + "fmla"_ostr, u"val 50000"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[4]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[2]"_ostr, - "fmla"_ostr, "val 63885"); + "fmla"_ostr, u"val 63885"_ustr); // Left-right arrow assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[5]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom"_ostr, - "prst"_ostr, "leftRightArrow"); + "prst"_ostr, u"leftRightArrow"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[5]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[1]"_ostr, - "fmla"_ostr, "val 50000"); + "fmla"_ostr, u"val 50000"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[5]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[2]"_ostr, - "fmla"_ostr, "val 53522"); + "fmla"_ostr, u"val 53522"_ustr); // Up-down arrow assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[6]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom"_ostr, - "prst"_ostr, "upDownArrow"); + "prst"_ostr, u"upDownArrow"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[6]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[1]"_ostr, - "fmla"_ostr, "val 50000"); + "fmla"_ostr, u"val 50000"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[6]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[2]"_ostr, - "fmla"_ostr, "val 62743"); + "fmla"_ostr, u"val 62743"_ustr); // Right arrow callout assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[7]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom"_ostr, - "prst"_ostr, "rightArrowCallout"); + "prst"_ostr, u"rightArrowCallout"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[7]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[1]"_ostr, - "fmla"_ostr, "val 25002"); + "fmla"_ostr, u"val 25002"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[7]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[2]"_ostr, - "fmla"_ostr, "val 25000"); + "fmla"_ostr, u"val 25000"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[7]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[3]"_ostr, - "fmla"_ostr, "val 25052"); + "fmla"_ostr, u"val 25052"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[7]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[4]"_ostr, - "fmla"_ostr, "val 66667"); + "fmla"_ostr, u"val 66667"_ustr); // Left arrow callout assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[8]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom"_ostr, - "prst"_ostr, "leftArrowCallout"); + "prst"_ostr, u"leftArrowCallout"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[8]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[1]"_ostr, - "fmla"_ostr, "val 25002"); + "fmla"_ostr, u"val 25002"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[8]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[2]"_ostr, - "fmla"_ostr, "val 25000"); + "fmla"_ostr, u"val 25000"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[8]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[3]"_ostr, - "fmla"_ostr, "val 25057"); + "fmla"_ostr, u"val 25057"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[8]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[4]"_ostr, - "fmla"_ostr, "val 66673"); + "fmla"_ostr, u"val 66673"_ustr); // Down arrow callout assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[9]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom"_ostr, - "prst"_ostr, "downArrowCallout"); + "prst"_ostr, u"downArrowCallout"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[9]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[1]"_ostr, - "fmla"_ostr, "val 29415"); + "fmla"_ostr, u"val 29415"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[9]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[2]"_ostr, - "fmla"_ostr, "val 29413"); + "fmla"_ostr, u"val 29413"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[9]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[3]"_ostr, - "fmla"_ostr, "val 16667"); + "fmla"_ostr, u"val 16667"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[9]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[4]"_ostr, - "fmla"_ostr, "val 66667"); + "fmla"_ostr, u"val 66667"_ustr); // Up arrow callout assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[10]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom"_ostr, - "prst"_ostr, "upArrowCallout"); + "prst"_ostr, u"upArrowCallout"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[10]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[1]"_ostr, - "fmla"_ostr, "val 31033"); + "fmla"_ostr, u"val 31033"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[10]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[2]"_ostr, - "fmla"_ostr, "val 31030"); + "fmla"_ostr, u"val 31030"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[10]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[3]"_ostr, - "fmla"_ostr, "val 16667"); + "fmla"_ostr, u"val 16667"_ustr); assertXPath(pXmlDoc, "//w:r/mc:AlternateContent[10]/mc:Choice/w:drawing/wp:anchor/a:graphic/" "a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[4]"_ostr, - "fmla"_ostr, "val 66660"); + "fmla"_ostr, u"val 66660"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testCameraRevolutionGrabBag) @@ -344,15 +347,17 @@ CPPUNIT_TEST_FIXTURE(Test, testCameraRevolutionGrabBag) loadFromFile(u"camera-rotation-revolution-nonwps.pptx"); // When saving that document: - save("Impress Office Open XML"); + save(u"Impress Office Open XML"_ustr); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // Then make sure the revolution is exported without a problem: // First shape textbox: - assertXPath(pXmlDoc, "//p:sp[1]/p:spPr/a:scene3d/a:camera/a:rot"_ostr, "rev"_ostr, "5400000"); + assertXPath(pXmlDoc, "//p:sp[1]/p:spPr/a:scene3d/a:camera/a:rot"_ostr, "rev"_ostr, + u"5400000"_ustr); // Second shape rectangle: - assertXPath(pXmlDoc, "//p:sp[2]/p:spPr/a:scene3d/a:camera/a:rot"_ostr, "rev"_ostr, "18300000"); + assertXPath(pXmlDoc, "//p:sp[2]/p:spPr/a:scene3d/a:camera/a:rot"_ostr, "rev"_ostr, + u"18300000"_ustr); // Make sure Shape3DProperties don't leak under txBody // Without the accompanying fix in place, this test would have failed with: @@ -369,9 +374,9 @@ CPPUNIT_TEST_FIXTURE(Test, testReferToTheme) loadFromFile(u"refer-to-theme.pptx"); // When saving that document: - save("Impress Office Open XML"); + save(u"Impress Office Open XML"_ustr); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // Then make sure the shape text color is a scheme color: // Without the accompanying fix in place, this test would have failed with: // - Expected: 1 @@ -379,7 +384,7 @@ CPPUNIT_TEST_FIXTURE(Test, testReferToTheme) // - XPath '//p:sp/p:txBody/a:p/a:r/a:rPr/a:solidFill/a:schemeClr' number of nodes is incorrect // i.e. the <a:schemeClr> element was not written. assertXPath(pXmlDoc, "//p:sp[1]/p:txBody/a:p/a:r/a:rPr/a:solidFill/a:schemeClr"_ostr, - "val"_ostr, "accent1"); + "val"_ostr, u"accent1"_ustr); assertXPath(pXmlDoc, "//p:sp[1]/p:txBody/a:p/a:r/a:rPr/a:solidFill/a:schemeClr/a:lumMod"_ostr, 0); assertXPath(pXmlDoc, "//p:sp[1]/p:txBody/a:p/a:r/a:rPr/a:solidFill/a:schemeClr/a:lumOff"_ostr, @@ -392,17 +397,17 @@ CPPUNIT_TEST_FIXTURE(Test, testReferToTheme) // - XPath '//p:sp[2]/p:txBody/a:p/a:r/a:rPr/a:solidFill/a:schemeClr' number of nodes is incorrect // i.e. the effects case did not write scheme colors. assertXPath(pXmlDoc, "//p:sp[2]/p:txBody/a:p/a:r/a:rPr/a:solidFill/a:schemeClr"_ostr, - "val"_ostr, "accent1"); + "val"_ostr, u"accent1"_ustr); assertXPath(pXmlDoc, "//p:sp[2]/p:txBody/a:p/a:r/a:rPr/a:solidFill/a:schemeClr/a:lumMod"_ostr, - "val"_ostr, "40000"); + "val"_ostr, u"40000"_ustr); assertXPath(pXmlDoc, "//p:sp[2]/p:txBody/a:p/a:r/a:rPr/a:solidFill/a:schemeClr/a:lumOff"_ostr, - "val"_ostr, "60000"); + "val"_ostr, u"60000"_ustr); // Third shape, darker color: assertXPath(pXmlDoc, "//p:sp[3]/p:txBody/a:p/a:r/a:rPr/a:solidFill/a:schemeClr"_ostr, - "val"_ostr, "accent1"); + "val"_ostr, u"accent1"_ustr); assertXPath(pXmlDoc, "//p:sp[3]/p:txBody/a:p/a:r/a:rPr/a:solidFill/a:schemeClr/a:lumMod"_ostr, - "val"_ostr, "75000"); + "val"_ostr, u"75000"_ustr); assertXPath(pXmlDoc, "//p:sp[3]/p:txBody/a:p/a:r/a:rPr/a:solidFill/a:schemeClr/a:lumOff"_ostr, 0); } @@ -413,15 +418,16 @@ CPPUNIT_TEST_FIXTURE(Test, testThemeColor_ShapeFill) loadFromFile(u"ReferenceShapeFill.fodp"); // When saving that document: - save("Impress Office Open XML"); + save(u"Impress Office Open XML"_ustr); // Then make sure the shape fill color is a scheme color. // Note that this was already working from PPTX files via grab-bags, //so this test intentionally uses an ODP file as input. - xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc, "//p:sp[1]/p:spPr/a:solidFill/a:schemeClr"_ostr, "val"_ostr, "accent6"); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); + assertXPath(pXmlDoc, "//p:sp[1]/p:spPr/a:solidFill/a:schemeClr"_ostr, "val"_ostr, + u"accent6"_ustr); assertXPath(pXmlDoc, "//p:sp[1]/p:spPr/a:solidFill/a:schemeClr/a:lumMod"_ostr, "val"_ostr, - "75000"); + u"75000"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testTdf146690_endParagraphRunPropertiesNewLinesTextSize) @@ -430,17 +436,17 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf146690_endParagraphRunPropertiesNewLinesTextSi loadFromFile(u"endParaRPr-newline-textsize.pptx"); // When saving that document: - save("Impress Office Open XML"); + save(u"Impress Office Open XML"_ustr); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // Make sure the text size is exported correctly: // Without the accompanying fix in place, this test would have failed with: // - Expected: 500 // - Actual : 1800 // i.e. the endParaRPr 'size' wasn't exported correctly - assertXPath(pXmlDoc, "//p:sp[1]/p:txBody/a:p[1]/a:endParaRPr"_ostr, "sz"_ostr, "500"); - assertXPath(pXmlDoc, "//p:sp[1]/p:txBody/a:p[2]/a:endParaRPr"_ostr, "sz"_ostr, "500"); - assertXPath(pXmlDoc, "//p:sp[1]/p:txBody/a:p[3]/a:endParaRPr"_ostr, "sz"_ostr, "500"); + assertXPath(pXmlDoc, "//p:sp[1]/p:txBody/a:p[1]/a:endParaRPr"_ostr, "sz"_ostr, u"500"_ustr); + assertXPath(pXmlDoc, "//p:sp[1]/p:txBody/a:p[2]/a:endParaRPr"_ostr, "sz"_ostr, u"500"_ustr); + assertXPath(pXmlDoc, "//p:sp[1]/p:txBody/a:p[3]/a:endParaRPr"_ostr, "sz"_ostr, u"500"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testTdf147978_endsubpath) @@ -449,15 +455,15 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf147978_endsubpath) loadFromFile(u"tdf147978_endsubpath.odp"); // When saving that document: - save("Impress Office Open XML"); + save(u"Impress Office Open XML"_ustr); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // Then make sure the pathLst has two child elements, // Without the accompanying fix in place, only one element a:path was exported. assertXPathChildren(pXmlDoc, "//a:pathLst"_ostr, 2); // and make sure first path with no stroke, second with no fill - assertXPath(pXmlDoc, "//a:pathLst/a:path[1]"_ostr, "stroke"_ostr, "0"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[2]"_ostr, "fill"_ostr, "none"); + assertXPath(pXmlDoc, "//a:pathLst/a:path[1]"_ostr, "stroke"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[2]"_ostr, "fill"_ostr, u"none"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testTdf147978_commandA) @@ -466,19 +472,19 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf147978_commandA) loadFromFile(u"tdf147978_enhancedPath_commandA.odp"); // When saving that document: - save("Impress Office Open XML"); + save(u"Impress Office Open XML"_ustr); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // Then make sure the path has a child element arcTo. Prior to the fix that part of the curve was // not exported at all. In odp it is a command A. Such does not exist in OOXML and is therefore // exported as a:lnTo followed by a:arcTo assertXPath(pXmlDoc, "//a:pathLst/a:path/a:lnTo"_ostr, 2); assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo"_ostr, 1); // And assert its attribute values - assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo"_ostr, "wR"_ostr, "7200"); - assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo"_ostr, "hR"_ostr, "5400"); - assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo"_ostr, "stAng"_ostr, "7719588"); - assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo"_ostr, "swAng"_ostr, "-5799266"); + assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo"_ostr, "wR"_ostr, u"7200"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo"_ostr, "hR"_ostr, u"5400"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo"_ostr, "stAng"_ostr, u"7719588"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo"_ostr, "swAng"_ostr, u"-5799266"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testTdf147978_commandT) @@ -487,27 +493,27 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf147978_commandT) loadFromFile(u"tdf147978_enhancedPath_commandT.odp"); // Export to pptx had only exported the command M and has used a wrong path size - save("Impress Office Open XML"); + save(u"Impress Office Open XML"_ustr); // Verify the markup: - xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // File has draw:viewBox="0 0 216 216" - assertXPath(pXmlDoc, "//a:pathLst/a:path"_ostr, "w"_ostr, "216"); - assertXPath(pXmlDoc, "//a:pathLst/a:path"_ostr, "h"_ostr, "216"); + assertXPath(pXmlDoc, "//a:pathLst/a:path"_ostr, "w"_ostr, u"216"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path"_ostr, "h"_ostr, u"216"_ustr); // Command T is exported as lnTo followed by arcTo. assertXPath(pXmlDoc, "//a:pathLst/a:path/a:moveTo"_ostr, 1); assertXPath(pXmlDoc, "//a:pathLst/a:path/a:lnTo"_ostr, 1); assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo"_ostr, 1); assertXPath(pXmlDoc, "//a:pathLst/a:path/a:close"_ostr, 1); // And assert its values - assertXPath(pXmlDoc, "//a:pathLst/a:path/a:moveTo/a:pt"_ostr, "x"_ostr, "108"); - assertXPath(pXmlDoc, "//a:pathLst/a:path/a:moveTo/a:pt"_ostr, "y"_ostr, "162"); - assertXPath(pXmlDoc, "//a:pathLst/a:path/a:lnTo/a:pt"_ostr, "x"_ostr, "138"); - assertXPath(pXmlDoc, "//a:pathLst/a:path/a:lnTo/a:pt"_ostr, "y"_ostr, "110"); - assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo"_ostr, "wR"_ostr, "108"); - assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo"_ostr, "hR"_ostr, "54"); - assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo"_ostr, "stAng"_ostr, "18000000"); - assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo"_ostr, "swAng"_ostr, "18000000"); + assertXPath(pXmlDoc, "//a:pathLst/a:path/a:moveTo/a:pt"_ostr, "x"_ostr, u"108"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path/a:moveTo/a:pt"_ostr, "y"_ostr, u"162"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path/a:lnTo/a:pt"_ostr, "x"_ostr, u"138"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path/a:lnTo/a:pt"_ostr, "y"_ostr, u"110"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo"_ostr, "wR"_ostr, u"108"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo"_ostr, "hR"_ostr, u"54"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo"_ostr, "stAng"_ostr, u"18000000"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo"_ostr, "swAng"_ostr, u"18000000"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testTdf147978_commandXY) @@ -516,32 +522,32 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf147978_commandXY) loadFromFile(u"tdf147978_enhancedPath_commandXY.odp"); // Export to pptx had dropped commands X and Y. - save("Impress Office Open XML"); + save(u"Impress Office Open XML"_ustr); // Verify the markup: - xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // File has draw:viewBox="0 0 10 10" - assertXPath(pXmlDoc, "//a:pathLst/a:path[1]"_ostr, "w"_ostr, "10"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[1]"_ostr, "h"_ostr, "10"); + assertXPath(pXmlDoc, "//a:pathLst/a:path[1]"_ostr, "w"_ostr, u"10"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[1]"_ostr, "h"_ostr, u"10"_ustr); // Shape has M 0 5 Y 5 0 10 5 5 10 F Y 0 5 N M 10 10 X 0 0 - assertXPath(pXmlDoc, "//a:pathLst/a:path[1]/a:moveTo/a:pt"_ostr, "x"_ostr, "0"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[1]/a:moveTo/a:pt"_ostr, "y"_ostr, "5"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[1]/a:arcTo[1]"_ostr, "wR"_ostr, "5"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[1]/a:arcTo[1]"_ostr, "hR"_ostr, "5"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[1]/a:arcTo[1]"_ostr, "stAng"_ostr, "10800000"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[1]/a:arcTo[1]"_ostr, "swAng"_ostr, "5400000"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[1]/a:arcTo[2]"_ostr, "stAng"_ostr, "16200000"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[1]/a:arcTo[2]"_ostr, "swAng"_ostr, "5400000"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[1]/a:arcTo[3]"_ostr, "stAng"_ostr, "0"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[1]/a:arcTo[3]"_ostr, "swAng"_ostr, "5400000"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[1]/a:arcTo[4]"_ostr, "stAng"_ostr, "0"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[1]/a:arcTo[4]"_ostr, "swAng"_ostr, "-5400000"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[2]/a:moveTo/a:pt"_ostr, "x"_ostr, "10"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[2]/a:moveTo/a:pt"_ostr, "y"_ostr, "10"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[2]/a:arcTo"_ostr, "wR"_ostr, "10"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[2]/a:arcTo"_ostr, "hR"_ostr, "10"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[2]/a:arcTo"_ostr, "stAng"_ostr, "5400000"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[2]/a:arcTo"_ostr, "swAng"_ostr, "5400000"); + assertXPath(pXmlDoc, "//a:pathLst/a:path[1]/a:moveTo/a:pt"_ostr, "x"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[1]/a:moveTo/a:pt"_ostr, "y"_ostr, u"5"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[1]/a:arcTo[1]"_ostr, "wR"_ostr, u"5"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[1]/a:arcTo[1]"_ostr, "hR"_ostr, u"5"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[1]/a:arcTo[1]"_ostr, "stAng"_ostr, u"10800000"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[1]/a:arcTo[1]"_ostr, "swAng"_ostr, u"5400000"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[1]/a:arcTo[2]"_ostr, "stAng"_ostr, u"16200000"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[1]/a:arcTo[2]"_ostr, "swAng"_ostr, u"5400000"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[1]/a:arcTo[3]"_ostr, "stAng"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[1]/a:arcTo[3]"_ostr, "swAng"_ostr, u"5400000"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[1]/a:arcTo[4]"_ostr, "stAng"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[1]/a:arcTo[4]"_ostr, "swAng"_ostr, u"-5400000"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[2]/a:moveTo/a:pt"_ostr, "x"_ostr, u"10"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[2]/a:moveTo/a:pt"_ostr, "y"_ostr, u"10"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[2]/a:arcTo"_ostr, "wR"_ostr, u"10"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[2]/a:arcTo"_ostr, "hR"_ostr, u"10"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[2]/a:arcTo"_ostr, "stAng"_ostr, u"5400000"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[2]/a:arcTo"_ostr, "swAng"_ostr, u"5400000"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testTdf147978_commandHIJK) @@ -550,20 +556,20 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf147978_commandHIJK) loadFromFile(u"tdf147978_enhancedPath_commandHIJK.odp"); // Export to pptx had dropped commands X and Y. - save("Impress Office Open XML"); + save(u"Impress Office Open XML"_ustr); // Verify the markup: - xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // File has draw:viewBox="0 0 80 80" - assertXPath(pXmlDoc, "//a:pathLst/a:path[1]"_ostr, "w"_ostr, "80"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[1]"_ostr, "h"_ostr, "80"); + assertXPath(pXmlDoc, "//a:pathLst/a:path[1]"_ostr, "w"_ostr, u"80"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[1]"_ostr, "h"_ostr, u"80"_ustr); // File uses from back to front J (lighten), I (lightenLess), normal fill, K (darkenLess), // H (darken). New feature, old versions did not export these at all. - assertXPath(pXmlDoc, "//a:pathLst/a:path[1]"_ostr, "fill"_ostr, "lighten"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[2]"_ostr, "fill"_ostr, "lightenLess"); + assertXPath(pXmlDoc, "//a:pathLst/a:path[1]"_ostr, "fill"_ostr, u"lighten"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[2]"_ostr, "fill"_ostr, u"lightenLess"_ustr); assertXPathNoAttribute(pXmlDoc, "//a:pathLst/a:path[3]"_ostr, "fill"_ostr); - assertXPath(pXmlDoc, "//a:pathLst/a:path[4]"_ostr, "fill"_ostr, "darkenLess"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[5]"_ostr, "fill"_ostr, "darken"); + assertXPath(pXmlDoc, "//a:pathLst/a:path[4]"_ostr, "fill"_ostr, u"darkenLess"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[5]"_ostr, "fill"_ostr, u"darken"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testTdf147978_subpath) @@ -572,19 +578,19 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf147978_subpath) loadFromFile(u"tdf147978_enhancedPath_subpath.pptx"); // Export to pptx had dropped the subpaths. - save("Impress Office Open XML"); + save(u"Impress Office Open XML"_ustr); // Verify the markup: - xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // File should have four subpaths with increasing path size - assertXPath(pXmlDoc, "//a:pathLst/a:path[1]"_ostr, "w"_ostr, "10"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[1]"_ostr, "h"_ostr, "10"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[2]"_ostr, "w"_ostr, "20"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[2]"_ostr, "h"_ostr, "20"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[3]"_ostr, "w"_ostr, "40"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[3]"_ostr, "h"_ostr, "40"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[4]"_ostr, "w"_ostr, "80"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[4]"_ostr, "h"_ostr, "80"); + assertXPath(pXmlDoc, "//a:pathLst/a:path[1]"_ostr, "w"_ostr, u"10"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[1]"_ostr, "h"_ostr, u"10"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[2]"_ostr, "w"_ostr, u"20"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[2]"_ostr, "h"_ostr, u"20"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[3]"_ostr, "w"_ostr, u"40"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[3]"_ostr, "h"_ostr, u"40"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[4]"_ostr, "w"_ostr, u"80"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[4]"_ostr, "h"_ostr, u"80"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testTdf100391TextAreaRect) @@ -592,17 +598,18 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf100391TextAreaRect) // The document has a custom shape of type "non-primitive" to trigger the custGeom export loadFromFile(u"tdf100391_TextAreaRect.odp"); // When saving to PPTX the textarea rect was set to default instead of using the actual area - save("Impress Office Open XML"); + save(u"Impress Office Open XML"_ustr); // Verify the markup. Without fix the values were l="l", t="t", r="r", b="b" - xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc, "//a:custGeom/a:rect"_ostr, "l"_ostr, "textAreaLeft"); - assertXPath(pXmlDoc, "//a:custGeom/a:rect"_ostr, "t"_ostr, "textAreaTop"); - assertXPath(pXmlDoc, "//a:custGeom/a:rect"_ostr, "r"_ostr, "textAreaRight"); - assertXPath(pXmlDoc, "//a:custGeom/a:rect"_ostr, "b"_ostr, "textAreaBottom"); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); + assertXPath(pXmlDoc, "//a:custGeom/a:rect"_ostr, "l"_ostr, u"textAreaLeft"_ustr); + assertXPath(pXmlDoc, "//a:custGeom/a:rect"_ostr, "t"_ostr, u"textAreaTop"_ustr); + assertXPath(pXmlDoc, "//a:custGeom/a:rect"_ostr, "r"_ostr, u"textAreaRight"_ustr); + assertXPath(pXmlDoc, "//a:custGeom/a:rect"_ostr, "b"_ostr, u"textAreaBottom"_ustr); // The values are calculated in guides, for example - assertXPath(pXmlDoc, "//a:custGeom/a:gdLst/a:gd[1]"_ostr, "name"_ostr, "textAreaLeft"); - assertXPath(pXmlDoc, "//a:custGeom/a:gdLst/a:gd[1]"_ostr, "fmla"_ostr, "*/ 1440000 w 2880000"); + assertXPath(pXmlDoc, "//a:custGeom/a:gdLst/a:gd[1]"_ostr, "name"_ostr, u"textAreaLeft"_ustr); + assertXPath(pXmlDoc, "//a:custGeom/a:gdLst/a:gd[1]"_ostr, "fmla"_ostr, + u"*/ 1440000 w 2880000"_ustr); // The test reflects the state of Apr 2022. It needs to be adapted when export of handles and // guides is implemented. } @@ -617,17 +624,17 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf109169_OctagonBevel) skipValidation(); // Export to docx had not written a:fill or a:stroke attributes at all. - save("Office Open XML Text"); + save(u"Office Open XML Text"_ustr); // Verify the markup: - xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // File should have six subpaths, one with stroke and five with fill - assertXPath(pXmlDoc, "//a:pathLst/a:path[1]"_ostr, "stroke"_ostr, "0"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[2]"_ostr, "fill"_ostr, "darkenLess"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[3]"_ostr, "fill"_ostr, "darken"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[4]"_ostr, "fill"_ostr, "darken"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[5]"_ostr, "fill"_ostr, "lightenLess"); - assertXPath(pXmlDoc, "//a:pathLst/a:path[6]"_ostr, "fill"_ostr, "lighten"); + assertXPath(pXmlDoc, "//a:pathLst/a:path[1]"_ostr, "stroke"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[2]"_ostr, "fill"_ostr, u"darkenLess"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[3]"_ostr, "fill"_ostr, u"darken"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[4]"_ostr, "fill"_ostr, u"darken"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[5]"_ostr, "fill"_ostr, u"lightenLess"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path[6]"_ostr, "fill"_ostr, u"lighten"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testFaultyPathCommandsAWT) @@ -638,10 +645,10 @@ CPPUNIT_TEST_FIXTURE(Test, testFaultyPathCommandsAWT) // instead of the normally used lnTo. If a lnTo is written, MS Office shows nothing of the shape. loadFromFile(u"FaultyPathStart.odp"); - save("Impress Office Open XML"); + save(u"Impress Office Open XML"_ustr); // Verify the markup: - xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // First child of a:path should be a moveTo in all four shapes. assertXPath(pXmlDoc, "//p:spTree/p:sp[1]/p:spPr/a:custGeom/a:pathLst/a:path/a:moveTo"_ostr); assertXPath(pXmlDoc, "//p:spTree/p:sp[2]/p:spPr/a:custGeom/a:pathLst/a:path/a:moveTo"_ostr); @@ -656,10 +663,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148784StretchXY) // When saving to PPTX the attributes stretchpoint-x and stretchpoint-y were not considered. The // line at right and bottom edge were positioned inside as if the shape had a square size. loadFromFile(u"tdf148784_StretchXY.odp"); - save("Impress Office Open XML"); + save(u"Impress Office Open XML"_ustr); // Verify the markup. - xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // x-position of last segment should be same as path width. It was 21600 without fix. sal_Int32 nWidth @@ -694,10 +701,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148784StretchCommandQ) // When saving to PPTX the attributes stretchpoint-x and stretchpoint-y were not considered. // That results in wrong arcs on the right or bottom side of the shape. loadFromFile(u"tdf148784_StretchCommandQ.odp"); - save("Impress Office Open XML"); + save(u"Impress Office Open XML"_ustr); // Verify the markup. - xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // x-position of second quadBezTo control should be same as path width. It was 21600 without fix. sal_Int32 nWidth @@ -733,10 +740,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148784StretchCommandVW) // When saving to PPTX the attributes stretchpoint-x and stretchpoint-y were not considered. // That results in circles instead of ellipses. loadFromFile(u"tdf148784_StretchCommandVW.odp"); - save("Impress Office Open XML"); + save(u"Impress Office Open XML"_ustr); // Verify the markup. - xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // wR of first ArcTo in first shape should be same as path width/2. It was 10800 without fix. sal_Int32 nHalfWidth @@ -767,17 +774,17 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149551VertPadding) // has paddings lIns="720000"=2cm, tIns="360000"=1cm, rIns="0" and bIns="0". // After load and save the paddings were rotated and a 90deg text rotation was added. loadFromFile(u"tdf149551_vert_and_padding.pptx"); - save("Impress Office Open XML"); + save(u"Impress Office Open XML"_ustr); // Verify the markup. The values must be the same as in the original file. - xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); for (sal_Int32 i = 1; i <= 2; i++) { OString sElement = "//p:spTree/p:sp[" + OString::number(i) + "]/p:txBody/a:bodyPr"; - assertXPath(pXmlDoc, sElement, "lIns"_ostr, "720000"); - assertXPath(pXmlDoc, sElement, "tIns"_ostr, "360000"); - assertXPath(pXmlDoc, sElement, "rIns"_ostr, "0"); - assertXPath(pXmlDoc, sElement, "bIns"_ostr, "0"); + assertXPath(pXmlDoc, sElement, "lIns"_ostr, u"720000"_ustr); + assertXPath(pXmlDoc, sElement, "tIns"_ostr, u"360000"_ustr); + assertXPath(pXmlDoc, sElement, "rIns"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, sElement, "bIns"_ostr, u"0"_ustr); assertXPathNoAttribute(pXmlDoc, sElement, "rot"_ostr); } } @@ -789,41 +796,41 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149538upright) // attribute but no 'rot' attribute. Without the fix the 'rot' attribute with values from // the emulation was written out. loadFromFile(u"tdf149538_upright.pptx"); - save("Impress Office Open XML"); + save(u"Impress Office Open XML"_ustr); // Verify the markup. The values must be the same as in the original file. - xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc, "//p:spTree/p:sp/p:txBody/a:bodyPr"_ostr, "upright"_ostr, "1"); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); + assertXPath(pXmlDoc, "//p:spTree/p:sp/p:txBody/a:bodyPr"_ostr, "upright"_ostr, u"1"_ustr); assertXPathNoAttribute(pXmlDoc, "//p:spTree/p:sp/p:txBody/a:bodyPr"_ostr, "rot"_ostr); } CPPUNIT_TEST_FIXTURE(Test, testTdf151008VertAnchor) { loadFromFile(u"tdf151008_eaVertAnchor.pptx"); - save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); + save(u"Impress Office Open XML"_ustr); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // The order of the shapes in the file is by name "Right", "Center", "Left", "RightMiddle", // "CenterMiddle" and "LeftMiddle". I access the shapes here by index, because the XPath is // easier then. // As of Sep 2022 LibreOffice does not write the default anchorCtr="0" // Right - assertXPath(pXmlDoc, "//p:spTree/p:sp[1]/p:txBody/a:bodyPr"_ostr, "anchor"_ostr, "t"); + assertXPath(pXmlDoc, "//p:spTree/p:sp[1]/p:txBody/a:bodyPr"_ostr, "anchor"_ostr, u"t"_ustr); assertXPathNoAttribute(pXmlDoc, "//p:spTree/p:sp[1]/p:txBody/a:bodyPr"_ostr, "anchorCtr"_ostr); // Center - assertXPath(pXmlDoc, "//p:spTree/p:sp[2]/p:txBody/a:bodyPr"_ostr, "anchor"_ostr, "ctr"); + assertXPath(pXmlDoc, "//p:spTree/p:sp[2]/p:txBody/a:bodyPr"_ostr, "anchor"_ostr, u"ctr"_ustr); assertXPathNoAttribute(pXmlDoc, "//p:spTree/p:sp[2]/p:txBody/a:bodyPr"_ostr, "anchorCtr"_ostr); // Left - assertXPath(pXmlDoc, "//p:spTree/p:sp[3]/p:txBody/a:bodyPr"_ostr, "anchor"_ostr, "b"); + assertXPath(pXmlDoc, "//p:spTree/p:sp[3]/p:txBody/a:bodyPr"_ostr, "anchor"_ostr, u"b"_ustr); assertXPathNoAttribute(pXmlDoc, "//p:spTree/p:sp[3]/p:txBody/a:bodyPr"_ostr, "anchorCtr"_ostr); // RightMiddle - assertXPath(pXmlDoc, "//p:spTree/p:sp[4]/p:txBody/a:bodyPr"_ostr, "anchor"_ostr, "t"); - assertXPath(pXmlDoc, "//p:spTree/p:sp[4]/p:txBody/a:bodyPr"_ostr, "anchorCtr"_ostr, "1"); + assertXPath(pXmlDoc, "//p:spTree/p:sp[4]/p:txBody/a:bodyPr"_ostr, "anchor"_ostr, u"t"_ustr); + assertXPath(pXmlDoc, "//p:spTree/p:sp[4]/p:txBody/a:bodyPr"_ostr, "anchorCtr"_ostr, u"1"_ustr); // CenterMiddle - assertXPath(pXmlDoc, "//p:spTree/p:sp[5]/p:txBody/a:bodyPr"_ostr, "anchor"_ostr, "ctr"); - assertXPath(pXmlDoc, "//p:spTree/p:sp[5]/p:txBody/a:bodyPr"_ostr, "anchorCtr"_ostr, "1"); + assertXPath(pXmlDoc, "//p:spTree/p:sp[5]/p:txBody/a:bodyPr"_ostr, "anchor"_ostr, u"ctr"_ustr); + assertXPath(pXmlDoc, "//p:spTree/p:sp[5]/p:txBody/a:bodyPr"_ostr, "anchorCtr"_ostr, u"1"_ustr); // LeftMiddle - assertXPath(pXmlDoc, "//p:spTree/p:sp[6]/p:txBody/a:bodyPr"_ostr, "anchor"_ostr, "b"); - assertXPath(pXmlDoc, "//p:spTree/p:sp[6]/p:txBody/a:bodyPr"_ostr, "anchorCtr"_ostr, "1"); + assertXPath(pXmlDoc, "//p:spTree/p:sp[6]/p:txBody/a:bodyPr"_ostr, "anchor"_ostr, u"b"_ustr); + assertXPath(pXmlDoc, "//p:spTree/p:sp[6]/p:txBody/a:bodyPr"_ostr, "anchorCtr"_ostr, u"1"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testFontworkBitmapFill) @@ -836,11 +843,11 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkBitmapFill) skipValidation(); // Saving that to DOCX: - save("Office Open XML Text"); + save(u"Office Open XML Text"_ustr); // Make sure it is exported to VML and has no txbxContent but a textpath element. Without fix it // was exported as DML 'abc transform', but that is not able to use bitmap fill in Word. - xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "//mc:alternateContent"_ostr, 0); assertXPath(pXmlDoc, "//v:shape/v:textbox/v:txbxContent"_ostr, 0); assertXPath(pXmlDoc, "//v:shape/v:textpath"_ostr, 1); @@ -853,7 +860,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkBitmapFill) // The fill is set to 'stretched' in LO, that is type="frame" in VML. That was not implemented // in VML export. - assertXPath(pXmlDoc, "//v:shape/v:fill"_ostr, "type"_ostr, "frame"); + assertXPath(pXmlDoc, "//v:shape/v:fill"_ostr, "type"_ostr, u"frame"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testFontworkFontProperties) @@ -867,11 +874,11 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkFontProperties) skipValidation(); // Save to DOCX: - save("Office Open XML Text"); + save(u"Office Open XML Text"_ustr); // Make sure the style attribute of the textpath element has the needed items. Without fix only // font-family and font-size were written. - xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); OUString sStyle; // bold sStyle = getXPath(pXmlDoc, "(//v:shape)[1]/v:textpath"_ostr, "style"_ostr); @@ -903,11 +910,11 @@ CPPUNIT_TEST_FIXTURE(Test, testVMLFontworkSlantUp) skipValidation(); // Save to DOCX: - save("Office Open XML Text"); + save(u"Office Open XML Text"_ustr); // Examine the saved markup. I could identify the following two problems to hinder Word from // accepting the markup. There might exist more problems. - xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Make sure a <v:path> element exists and has an o:connecttype attribute assertXPath(pXmlDoc, "//v:shapetype/v:path"_ostr, 1); @@ -916,7 +923,7 @@ CPPUNIT_TEST_FIXTURE(Test, testVMLFontworkSlantUp) // Make sure the handle position is written without reference to a formula OUString sPosition = getXPath(pXmlDoc, "//v:h"_ostr, "position"_ostr); CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), sPosition.indexOf("@")); - CPPUNIT_ASSERT_EQUAL(OUString("topLeft,#0"), sPosition); + CPPUNIT_ASSERT_EQUAL(u"topLeft,#0"_ustr, sPosition); } CPPUNIT_TEST_FIXTURE(Test, testVMLFontworkArchUp) @@ -930,10 +937,10 @@ CPPUNIT_TEST_FIXTURE(Test, testVMLFontworkArchUp) skipValidation(); // Save to DOCX: - save("Office Open XML Text"); + save(u"Office Open XML Text"_ustr); // Examine the saved markup. - xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Make sure there is no <v:rect> element assertXPath(pXmlDoc, "//v:rect"_ostr, 0); @@ -952,10 +959,10 @@ CPPUNIT_TEST_FIXTURE(Test, testVMLAdjustmentExport) skipValidation(); // Save to DOCX: - save("Office Open XML Text"); + save(u"Office Open XML Text"_ustr); // Examine the saved markup. - xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // Make sure an "adj" attribute exists assertXPath(pXmlDoc, "//v:shape[@adj]"_ostr, 1); @@ -980,28 +987,29 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkDirectColor) skipValidation(); // Save to DOCX: - save("Office Open XML Text"); + save(u"Office Open XML Text"_ustr); // Examine the saved markup. - xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); static constexpr OString sElement = "//w:txbxContent/w:p/w:r/w:rPr/"_ostr; // Make sure the fallback in <w:color> has correct value. - assertXPath(pXmlDoc, sElement + "w:color", "val"_ostr, "2E8B57"); + assertXPath(pXmlDoc, sElement + "w:color", "val"_ostr, u"2E8B57"_ustr); // ... and <w14:textOutline> exists and has correct values. assertXPath(pXmlDoc, sElement + "w14:textOutline", 1); assertXPath(pXmlDoc, sElement + "w14:textOutline/w14:solidFill/w14:srgbClr", "val"_ostr, - "ff7f50"); + u"ff7f50"_ustr); assertXPath(pXmlDoc, sElement + "w14:textOutline/w14:solidFill/w14:srgbClr/w14:alpha", - "val"_ostr, "20000"); + "val"_ostr, u"20000"_ustr); assertXPath(pXmlDoc, sElement + "w14:textOutline/w14:round", 1); // ... and w14:textFill exists and has correct values. assertXPath(pXmlDoc, sElement + "w14:textFill", 1); - assertXPath(pXmlDoc, sElement + "w14:textFill/w14:solidFill/w14:srgbClr", "val"_ostr, "2e8b57"); + assertXPath(pXmlDoc, sElement + "w14:textFill/w14:solidFill/w14:srgbClr", "val"_ostr, + u"2e8b57"_ustr); assertXPath(pXmlDoc, sElement + "w14:textFill/w14:solidFill/w14:srgbClr/w14:alpha", "val"_ostr, - "60000"); + u"60000"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testFontworkThemeColor) @@ -1016,10 +1024,10 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkThemeColor) skipValidation(); // Save to DOCX: - save("Office Open XML Text"); + save(u"Office Open XML Text"_ustr); // Examine the saved markup. - xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // shape with 'darker' OString sElement = "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/" @@ -1027,30 +1035,32 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkThemeColor) "w:rPr/"_ostr; // Make sure the fallback in <w:color> has correct values - assertXPath(pXmlDoc, sElement + "w:color", "val"_ostr, "948A54"); - assertXPath(pXmlDoc, sElement + "w:color", "themeColor"_ostr, "light2"); - assertXPath(pXmlDoc, sElement + "w:color", "themeShade"_ostr, "80"); + assertXPath(pXmlDoc, sElement + "w:color", "val"_ostr, u"948A54"_ustr); + assertXPath(pXmlDoc, sElement + "w:color", "themeColor"_ostr, u"light2"_ustr); + assertXPath(pXmlDoc, sElement + "w:color", "themeShade"_ostr, u"80"_ustr); // ... and w14:textFill exists and has correct values. - assertXPath(pXmlDoc, sElement + "w14:textFill/w14:solidFill/w14:schemeClr", "val"_ostr, "bg2"); + assertXPath(pXmlDoc, sElement + "w14:textFill/w14:solidFill/w14:schemeClr", "val"_ostr, + u"bg2"_ustr); assertXPath(pXmlDoc, sElement + "w14:textFill/w14:solidFill/w14:schemeClr/w14:lumMod", - "val"_ostr, "50000"); + "val"_ostr, u"50000"_ustr); // shape with 'lighter' sElement = "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/" "a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/"_ostr; // Make sure the fallback in <w:color> has correct values - assertXPath(pXmlDoc, sElement + "w:color", "val"_ostr, "558ED5"); - assertXPath(pXmlDoc, sElement + "w:color", "themeColor"_ostr, "dark2"); - assertXPath(pXmlDoc, sElement + "w:color", "themeTint"_ostr, "99"); + assertXPath(pXmlDoc, sElement + "w:color", "val"_ostr, u"558ED5"_ustr); + assertXPath(pXmlDoc, sElement + "w:color", "themeColor"_ostr, u"dark2"_ustr); + assertXPath(pXmlDoc, sElement + "w:color", "themeTint"_ostr, u"99"_ustr); // ... and w14:textFill exists and has correct values. - assertXPath(pXmlDoc, sElement + "w14:textFill/w14:solidFill/w14:schemeClr", "val"_ostr, "tx2"); + assertXPath(pXmlDoc, sElement + "w14:textFill/w14:solidFill/w14:schemeClr", "val"_ostr, + u"tx2"_ustr); assertXPath(pXmlDoc, sElement + "w14:textFill/w14:solidFill/w14:schemeClr/w14:lumMod", - "val"_ostr, "60000"); + "val"_ostr, u"60000"_ustr); assertXPath(pXmlDoc, sElement + "w14:textFill/w14:solidFill/w14:schemeClr/w14:lumOff", - "val"_ostr, "40000"); + "val"_ostr, u"40000"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testFontworkDistance) @@ -1064,10 +1074,10 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkDistance) skipValidation(); // Save to DOCX: - save("Office Open XML Text"); + save(u"Office Open XML Text"_ustr); // Examine the saved markup. - xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPathAttrs(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, @@ -1087,10 +1097,10 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkLinGradientRGBColor) skipValidation(); // Save to DOCX: - save("Office Open XML Text"); + save(u"Office Open XML Text"_ustr); // Examine the saved markup. - xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // path to shape text run properties OString sElement = "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/" @@ -1101,24 +1111,25 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkLinGradientRGBColor) assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:gsLst", 1); assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:gsLst/w14:gs", 3); // 330deg gradient rotation = 120deg color transition direction - assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:lin", "ang"_ostr, "7200000"); - assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:lin", "scaled"_ostr, "0"); + assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:lin", "ang"_ostr, + u"7200000"_ustr); + assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:lin", "scaled"_ostr, u"0"_ustr); // Make sure the color stops have correct position and color // The 'intensity' property in the UI has a different algorithm than the 'lumMod' attribute in // OOXML. Therefore it cannot be exported as 'lumMod' but need to be incorporated into the color. sElement += "w14:textFill/w14:gradFill/w14:gsLst/"; - assertXPath(pXmlDoc, sElement + "w14:gs[1]", "pos"_ostr, "0"); - assertXPath(pXmlDoc, sElement + "w14:gs[1]/w14:srgbClr", "val"_ostr, "cccc00"); - assertXPath(pXmlDoc, sElement + "w14:gs[1]/w14:srgbClr/w14:alpha", "val"_ostr, "30000"); + assertXPath(pXmlDoc, sElement + "w14:gs[1]", "pos"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[1]/w14:srgbClr", "val"_ostr, u"cccc00"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[1]/w14:srgbClr/w14:alpha", "val"_ostr, u"30000"_ustr); - assertXPath(pXmlDoc, sElement + "w14:gs[2]", "pos"_ostr, "25000"); - assertXPath(pXmlDoc, sElement + "w14:gs[2]/w14:srgbClr", "val"_ostr, "cccc00"); - assertXPath(pXmlDoc, sElement + "w14:gs[2]/w14:srgbClr/w14:alpha", "val"_ostr, "30000"); + assertXPath(pXmlDoc, sElement + "w14:gs[2]", "pos"_ostr, u"25000"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[2]/w14:srgbClr", "val"_ostr, u"cccc00"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[2]/w14:srgbClr/w14:alpha", "val"_ostr, u"30000"_ustr); - assertXPath(pXmlDoc, sElement + "w14:gs[3]", "pos"_ostr, "100000"); - assertXPath(pXmlDoc, sElement + "w14:gs[3]/w14:srgbClr", "val"_ostr, "4682b4"); - assertXPath(pXmlDoc, sElement + "w14:gs[3]/w14:srgbClr/w14:alpha", "val"_ostr, "30000"); + assertXPath(pXmlDoc, sElement + "w14:gs[3]", "pos"_ostr, u"100000"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[3]/w14:srgbClr", "val"_ostr, u"4682b4"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[3]/w14:srgbClr/w14:alpha", "val"_ostr, u"30000"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testFontworkAxialGradientTransparency) @@ -1134,10 +1145,10 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkAxialGradientTransparency) skipValidation(); // Save to DOCX: - save("Office Open XML Text"); + save(u"Office Open XML Text"_ustr); // Examine the saved markup. - xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // path to shape text run properties OString sElement = "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/" @@ -1148,8 +1159,9 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkAxialGradientTransparency) assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:gsLst", 1); assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:gsLst/w14:gs", 3); // 160deg gradient rotation = 290deg (360deg-160deg+90deg) color transition direction - assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:lin", "ang"_ostr, "17400000"); - assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:lin", "scaled"_ostr, "0"); + assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:lin", "ang"_ostr, + u"17400000"_ustr); + assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:lin", "scaled"_ostr, u"0"_ustr); // Make sure the color stops have correct position and color sElement += "w14:textFill/w14:gradFill/w14:gsLst/"; @@ -1157,18 +1169,18 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkAxialGradientTransparency) for (char ch = '1'; ch <= '3'; ++ch) { assertXPath(pXmlDoc, sElement + "w14:gs[" + OStringChar(ch) + "]/w14:schemeClr", "val"_ostr, - "accent3"); + u"accent3"_ustr); assertXPath(pXmlDoc, sElement + "w14:gs[" + OStringChar(ch) + "]/w14:schemeClr/w14:lumMod", - "val"_ostr, "75000"); + "val"_ostr, u"75000"_ustr); } // transparency values are not exactly like in UI because converting through rgb-color. // border 40% in UI means 20% on each side. - assertXPath(pXmlDoc, sElement + "w14:gs[1]", "pos"_ostr, "20000"); - assertXPath(pXmlDoc, sElement + "w14:gs[1]/w14:schemeClr/w14:alpha", "val"_ostr, "89800"); - assertXPath(pXmlDoc, sElement + "w14:gs[2]", "pos"_ostr, "50000"); - assertXPath(pXmlDoc, sElement + "w14:gs[2]/w14:schemeClr/w14:alpha", "val"_ostr, "4710"); - assertXPath(pXmlDoc, sElement + "w14:gs[3]", "pos"_ostr, "80000"); - assertXPath(pXmlDoc, sElement + "w14:gs[3]/w14:schemeClr/w14:alpha", "val"_ostr, "89800"); + assertXPath(pXmlDoc, sElement + "w14:gs[1]", "pos"_ostr, u"20000"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[1]/w14:schemeClr/w14:alpha", "val"_ostr, u"89800"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[2]", "pos"_ostr, u"50000"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[2]/w14:schemeClr/w14:alpha", "val"_ostr, u"4710"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[3]", "pos"_ostr, u"80000"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[3]/w14:schemeClr/w14:alpha", "val"_ostr, u"89800"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testFontworkRadialGradient) @@ -1184,10 +1196,10 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkRadialGradient) skipValidation(); // Save to DOCX: - save("Office Open XML Text"); + save(u"Office Open XML Text"_ustr); // Examine the saved markup. - xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // path to shape text run properties OString sElement = "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/" @@ -1197,19 +1209,20 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkRadialGradient) // Make sure w14:textFill and w14:gradFill elements exist with child elements assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:gsLst", 1); assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:gsLst/w14:gs", 3); - assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:path", "path"_ostr, "circle"); + assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:path", "path"_ostr, + u"circle"_ustr); assertXPathAttrs(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:path/w14:fillToRect", { { "l", "75000" }, { "t", "20000" }, { "r", "25000" }, { "b", "80000" } }); // Make sure the color stops have correct position and color // The first stop is duplicated to force Word to render the gradient same as LO. sElement += "w14:textFill/w14:gradFill/w14:gsLst/"; - assertXPath(pXmlDoc, sElement + "w14:gs[1]", "pos"_ostr, "0"); - assertXPath(pXmlDoc, sElement + "w14:gs[1]/w14:srgbClr", "val"_ostr, "ff0000"); - assertXPath(pXmlDoc, sElement + "w14:gs[2]", "pos"_ostr, "0"); - assertXPath(pXmlDoc, sElement + "w14:gs[2]/w14:srgbClr", "val"_ostr, "ff0000"); - assertXPath(pXmlDoc, sElement + "w14:gs[3]", "pos"_ostr, "90000"); - assertXPath(pXmlDoc, sElement + "w14:gs[3]/w14:srgbClr", "val"_ostr, "40e0d0"); + assertXPath(pXmlDoc, sElement + "w14:gs[1]", "pos"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[1]/w14:srgbClr", "val"_ostr, u"ff0000"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[2]", "pos"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[2]/w14:srgbClr", "val"_ostr, u"ff0000"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[3]", "pos"_ostr, u"90000"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[3]/w14:srgbClr", "val"_ostr, u"40e0d0"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testFontworkEllipticalGradient) @@ -1225,10 +1238,10 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkEllipticalGradient) skipValidation(); // Save to DOCX: - save("Office Open XML Text"); + save(u"Office Open XML Text"_ustr); // Examine the saved markup. - xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // path to shape text run properties OString sElement = "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/" @@ -1238,21 +1251,22 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkEllipticalGradient) // Make sure w14:textFill and w14:gradFill elements exist with child elements assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:gsLst", 1); assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:gsLst/w14:gs", 3); - assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:path", "path"_ostr, "circle"); + assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:path", "path"_ostr, + u"circle"_ustr); assertXPathAttrs(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:path/w14:fillToRect", { { "l", "50000" }, { "t", "50000" }, { "r", "50000" }, { "b", "50000" } }); // Make sure the color stops have correct position and color // transparency values are not exactly like in UI because converting through rgb-color. sElement += "w14:textFill/w14:gradFill/w14:gsLst/"; - assertXPath(pXmlDoc, sElement + "w14:gs[1]", "pos"_ostr, "0"); - assertXPath(pXmlDoc, sElement + "w14:gs[1]/w14:srgbClr", "val"_ostr, "00008b"); + assertXPath(pXmlDoc, sElement + "w14:gs[1]", "pos"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[1]/w14:srgbClr", "val"_ostr, u"00008b"_ustr); // stop is duplicated to force Word to same rendering as LO does. - assertXPath(pXmlDoc, sElement + "w14:gs[2]", "pos"_ostr, "0"); - assertXPath(pXmlDoc, sElement + "w14:gs[2]/w14:srgbClr", "val"_ostr, "00008b"); - assertXPath(pXmlDoc, sElement + "w14:gs[3]", "pos"_ostr, "50000"); - assertXPath(pXmlDoc, sElement + "w14:gs[3]/w14:srgbClr", "val"_ostr, "00008b"); - assertXPath(pXmlDoc, sElement + "w14:gs[3]/w14:srgbClr/w14:alpha", "val"_ostr, "69800"); + assertXPath(pXmlDoc, sElement + "w14:gs[2]", "pos"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[2]/w14:srgbClr", "val"_ostr, u"00008b"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[3]", "pos"_ostr, u"50000"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[3]/w14:srgbClr", "val"_ostr, u"00008b"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[3]/w14:srgbClr/w14:alpha", "val"_ostr, u"69800"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testFontworkSquareGradient) @@ -1268,10 +1282,10 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkSquareGradient) skipValidation(); // Save to DOCX: - save("Office Open XML Text"); + save(u"Office Open XML Text"_ustr); // Examine the saved markup. - xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // path to shape text run properties OString sElement = "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/" @@ -1281,7 +1295,8 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkSquareGradient) // Make sure w14:textFill and w14:gradFill elements exist with child elements assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:gsLst", 1); assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:gsLst/w14:gs", 3); - assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:path", "path"_ostr, "rect"); + assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:path", "path"_ostr, + u"rect"_ustr); assertXPathAttrs(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:path/w14:fillToRect", { { "l", "100000" }, { "t", "50000" }, { "r", "0" }, { "b", "50000" } }); @@ -1289,12 +1304,12 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkSquareGradient) // The 'intensity' property in the UI has a different algorithm than the 'lumMod' attribute in // OOXML. Therefore it cannot be exported as 'lumMod' but need to be incorporated into the color. sElement += "w14:textFill/w14:gradFill/w14:gsLst/"; - assertXPath(pXmlDoc, sElement + "w14:gs[1]", "pos"_ostr, "0"); - assertXPath(pXmlDoc, sElement + "w14:gs[1]/w14:srgbClr", "val"_ostr, "e6e663"); - assertXPath(pXmlDoc, sElement + "w14:gs[2]", "pos"_ostr, "0"); - assertXPath(pXmlDoc, sElement + "w14:gs[2]/w14:srgbClr", "val"_ostr, "e6e663"); - assertXPath(pXmlDoc, sElement + "w14:gs[3]", "pos"_ostr, "100000"); - assertXPath(pXmlDoc, sElement + "w14:gs[3]/w14:srgbClr", "val"_ostr, "1d4860"); + assertXPath(pXmlDoc, sElement + "w14:gs[1]", "pos"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[1]/w14:srgbClr", "val"_ostr, u"e6e663"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[2]", "pos"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[2]/w14:srgbClr", "val"_ostr, u"e6e663"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[3]", "pos"_ostr, u"100000"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[3]/w14:srgbClr", "val"_ostr, u"1d4860"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testFontworkRectGradient) @@ -1310,10 +1325,10 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkRectGradient) skipValidation(); // Save to DOCX: - save("Office Open XML Text"); + save(u"Office Open XML Text"_ustr); // Examine the saved markup. - xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // path to shape text run properties OString sElement = "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/" @@ -1323,29 +1338,36 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkRectGradient) // Make sure w14:textFill and w14:gradFill elements exist with child elements assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:gsLst", 1); assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:gsLst/w14:gs", 3); - assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:path", "path"_ostr, "rect"); + assertXPath(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:path", "path"_ostr, + u"rect"_ustr); assertXPathAttrs(pXmlDoc, sElement + "w14:textFill/w14:gradFill/w14:path/w14:fillToRect", { { "l", "50000" }, { "t", "50000" }, { "r", "50000" }, { "b", "50000" } }); // Make sure the color stops have correct position and color // transparency values are not exactly like in UI because converting through rgb-color. sElement += "w14:textFill/w14:gradFill/w14:gsLst/"; - assertXPath(pXmlDoc, sElement + "w14:gs[1]", "pos"_ostr, "0"); - assertXPath(pXmlDoc, sElement + "w14:gs[1]/w14:schemeClr", "val"_ostr, "accent4"); - assertXPath(pXmlDoc, sElement + "w14:gs[1]/w14:schemeClr/w14:lumMod", "val"_ostr, "40000"); - assertXPath(pXmlDoc, sElement + "w14:gs[1]/w14:schemeClr/w14:lumOff", "val"_ostr, "60000"); - assertXPath(pXmlDoc, sElement + "w14:gs[1]/w14:schemeClr/w14:alpha", "val"_ostr, "4710"); + assertXPath(pXmlDoc, sElement + "w14:gs[1]", "pos"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[1]/w14:schemeClr", "val"_ostr, u"accent4"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[1]/w14:schemeClr/w14:lumMod", "val"_ostr, + u"40000"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[1]/w14:schemeClr/w14:lumOff", "val"_ostr, + u"60000"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[1]/w14:schemeClr/w14:alpha", "val"_ostr, u"4710"_ustr); // The first stop is duplicated to force Word to render the gradient same as LO. - assertXPath(pXmlDoc, sElement + "w14:gs[2]", "pos"_ostr, "0"); - assertXPath(pXmlDoc, sElement + "w14:gs[2]/w14:schemeClr", "val"_ostr, "accent4"); - assertXPath(pXmlDoc, sElement + "w14:gs[2]/w14:schemeClr/w14:lumMod", "val"_ostr, "40000"); - assertXPath(pXmlDoc, sElement + "w14:gs[2]/w14:schemeClr/w14:lumOff", "val"_ostr, "60000"); - assertXPath(pXmlDoc, sElement + "w14:gs[2]/w14:schemeClr/w14:alpha", "val"_ostr, "4710"); - assertXPath(pXmlDoc, sElement + "w14:gs[3]", "pos"_ostr, "90000"); - assertXPath(pXmlDoc, sElement + "w14:gs[3]/w14:schemeClr", "val"_ostr, "accent4"); - assertXPath(pXmlDoc, sElement + "w14:gs[3]/w14:schemeClr/w14:lumMod", "val"_ostr, "40000"); - assertXPath(pXmlDoc, sElement + "w14:gs[3]/w14:schemeClr/w14:lumOff", "val"_ostr, "60000"); - assertXPath(pXmlDoc, sElement + "w14:gs[3]/w14:schemeClr/w14:alpha", "val"_ostr, "69800"); + assertXPath(pXmlDoc, sElement + "w14:gs[2]", "pos"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[2]/w14:schemeClr", "val"_ostr, u"accent4"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[2]/w14:schemeClr/w14:lumMod", "val"_ostr, + u"40000"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[2]/w14:schemeClr/w14:lumOff", "val"_ostr, + u"60000"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[2]/w14:schemeClr/w14:alpha", "val"_ostr, u"4710"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[3]", "pos"_ostr, u"90000"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[3]/w14:schemeClr", "val"_ostr, u"accent4"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[3]/w14:schemeClr/w14:lumMod", "val"_ostr, + u"40000"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[3]/w14:schemeClr/w14:lumOff", "val"_ostr, + u"60000"_ustr); + assertXPath(pXmlDoc, sElement + "w14:gs[3]/w14:schemeClr/w14:alpha", "val"_ostr, u"69800"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testThemeColorTransparency) @@ -1355,23 +1377,24 @@ CPPUNIT_TEST_FIXTURE(Test, testThemeColorTransparency) // Without fix the transparency was not written to file. loadFromFile(u"tdf139618_ThemeColorTransparency.pptx"); - save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); + save(u"Impress Office Open XML"_ustr); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // Make sure a:alpha is written for line color and for fill color. // Make sure fill color is a schemeClr. OString sElement = "/p:sld/p:cSld/p:spTree/p:sp[1]/p:txBody/a:p/a:r/a:rPr/"_ostr; - assertXPath(pXmlDoc, sElement + "a:ln/a:solidFill/a:srgbClr/a:alpha", "val"_ostr, "25000"); - assertXPath(pXmlDoc, sElement + "a:solidFill/a:schemeClr", "val"_ostr, "accent1"); - assertXPath(pXmlDoc, sElement + "a:solidFill/a:schemeClr/a:lumMod", "val"_ostr, "60000"); - assertXPath(pXmlDoc, sElement + "a:solidFill/a:schemeClr/a:lumOff", "val"_ostr, "40000"); - assertXPath(pXmlDoc, sElement + "a:solidFill/a:schemeClr/a:alpha", "val"_ostr, "35000"); + assertXPath(pXmlDoc, sElement + "a:ln/a:solidFill/a:srgbClr/a:alpha", "val"_ostr, + u"25000"_ustr); + assertXPath(pXmlDoc, sElement + "a:solidFill/a:schemeClr", "val"_ostr, u"accent1"_ustr); + assertXPath(pXmlDoc, sElement + "a:solidFill/a:schemeClr/a:lumMod", "val"_ostr, u"60000"_ustr); + assertXPath(pXmlDoc, sElement + "a:solidFill/a:schemeClr/a:lumOff", "val"_ostr, u"40000"_ustr); + assertXPath(pXmlDoc, sElement + "a:solidFill/a:schemeClr/a:alpha", "val"_ostr, u"35000"_ustr); // Make sure a:alpha is written for characters and fill color is a schemeClr. sElement = "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p/a:r/a:rPr/"_ostr; - assertXPath(pXmlDoc, sElement + "a:solidFill/a:schemeClr", "val"_ostr, "accent4"); - assertXPath(pXmlDoc, sElement + "a:solidFill/a:schemeClr/a:lumMod", "val"_ostr, "75000"); - assertXPath(pXmlDoc, sElement + "a:solidFill/a:schemeClr/a:alpha", "val"_ostr, "20000"); + assertXPath(pXmlDoc, sElement + "a:solidFill/a:schemeClr", "val"_ostr, u"accent4"_ustr); + assertXPath(pXmlDoc, sElement + "a:solidFill/a:schemeClr/a:lumMod", "val"_ostr, u"75000"_ustr); + assertXPath(pXmlDoc, sElement + "a:solidFill/a:schemeClr/a:alpha", "val"_ostr, u"20000"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testThemeFontTypeface) @@ -1381,13 +1404,13 @@ CPPUNIT_TEST_FIXTURE(Test, testThemeFontTypeface) loadFromFile(u"tdf155412_typeface.pptx"); - save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/theme/theme1.xml"); + save(u"Impress Office Open XML"_ustr); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/theme/theme1.xml"_ustr); // Make sure typeface is written. OString sElement = "/a:theme/a:themeElements/a:fontScheme/"_ostr; - assertXPath(pXmlDoc, sElement + "a:majorFont/a:ea", "typeface"_ostr, ""); - assertXPath(pXmlDoc, sElement + "a:minorFont/a:ea", "typeface"_ostr, ""); + assertXPath(pXmlDoc, sElement + "a:majorFont/a:ea", "typeface"_ostr, u""_ustr); + assertXPath(pXmlDoc, sElement + "a:minorFont/a:ea", "typeface"_ostr, u""_ustr); } CPPUNIT_TEST_FIXTURE(Test, testTdf157289CircularArrowExport) @@ -1396,12 +1419,12 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf157289CircularArrowExport) // the ellipse bounding box is defined by bottom-right vertex first and then top-left vertex. // When saving to PPTX this had resulted in negative radii for the ellipse. loadFromFile(u"tdf157289_circularArrow_export.fodp"); - save("Impress Office Open XML"); + save(u"Impress Office Open XML"_ustr); // Verify the markup. Both wR and hR must be positive. - xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo[1]"_ostr, "wR"_ostr, "6750"); - assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo[1]"_ostr, "hR"_ostr, "6750"); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo[1]"_ostr, "wR"_ostr, u"6750"_ustr); + assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo[1]"_ostr, "hR"_ostr, u"6750"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testTdf134401_ExportAutoGrowToTextWordWrap) @@ -1410,15 +1433,15 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf134401_ExportAutoGrowToTextWordWrap) // which is similar. If autoGrowWidth and autoGrowHeight are set in the document, // then they are exported to pptx as TextWordWrap = "none". loadFromFile(u"tdf134401_ExportAutoGrowToTextWordWrap.odp"); - save("Impress Office Open XML"); + save(u"Impress Office Open XML"_ustr); // There are 2 shapes in the test file. // The 1. shape is without autoGrowWidth/Height. // The 2. shape is with autoGrowWidth/Height. // Check if wrap="none" is exported for shape 2, but no wrap is exported for shape 1. - xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); assertXPathNoAttribute(pXmlDoc, "//p:sp[1]/p:txBody/a:bodyPr"_ostr, "wrap"_ostr); - assertXPath(pXmlDoc, "//p:sp[2]/p:txBody/a:bodyPr"_ostr, "wrap"_ostr, "none"); + assertXPath(pXmlDoc, "//p:sp[2]/p:txBody/a:bodyPr"_ostr, "wrap"_ostr, u"none"_ustr); } } diff --git a/oox/qa/unit/mathml.cxx b/oox/qa/unit/mathml.cxx index 3e1b8c55b8ce..aeb68a7d4841 100644 --- a/oox/qa/unit/mathml.cxx +++ b/oox/qa/unit/mathml.cxx @@ -18,7 +18,7 @@ class OoxMathmlTest : public UnoApiTest { public: OoxMathmlTest() - : UnoApiTest("/oox/qa/unit/data/") + : UnoApiTest(u"/oox/qa/unit/data/"_ustr) { } }; diff --git a/oox/qa/unit/mcgr.cxx b/oox/qa/unit/mcgr.cxx index edb9b9bf76eb..6f950be723df 100644 --- a/oox/qa/unit/mcgr.cxx +++ b/oox/qa/unit/mcgr.cxx @@ -18,7 +18,7 @@ class TestMCGR : public UnoApiXmlTest { public: TestMCGR() - : UnoApiXmlTest("/oox/qa/unit/data/") + : UnoApiXmlTest(u"/oox/qa/unit/data/"_ustr) { } }; @@ -28,20 +28,20 @@ CPPUNIT_TEST_FIXTURE(TestMCGR, testFontworkColorGradient) // Given a document with three-color gradient on a Fontwork. loadFromFile(u"MCGR_FontworkColorGradient.fodp"); // Save it to PPTX - save("Impress Office Open XML"); + save(u"Impress Office Open XML"_ustr); // And make sure a multi-color gradient fill is exported. - xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // linear gradient with 30deg angle - assertXPath(pXmlDoc, "//a:r/a:rPr/a:gradFill/a:lin"_ostr, "ang"_ostr, "3600000"); + assertXPath(pXmlDoc, "//a:r/a:rPr/a:gradFill/a:lin"_ostr, "ang"_ostr, u"3600000"_ustr); // three color stops, no transparency static constexpr OString sPath = "//a:r/a:rPr/a:gradFill/a:gsLst/"_ostr; assertXPath(pXmlDoc, sPath + "a:gs", 3); - assertXPath(pXmlDoc, sPath + "a:gs[1]", "pos"_ostr, "0"); - assertXPath(pXmlDoc, sPath + "a:gs[1]/a:srgbClr", "val"_ostr, "ff1493"); - assertXPath(pXmlDoc, sPath + "a:gs[2]", "pos"_ostr, "30000"); - assertXPath(pXmlDoc, sPath + "a:gs[2]/a:srgbClr", "val"_ostr, "ffff00"); - assertXPath(pXmlDoc, sPath + "a:gs[3]", "pos"_ostr, "100000"); - assertXPath(pXmlDoc, sPath + "a:gs[3]/a:srgbClr", "val"_ostr, "00ffff"); + assertXPath(pXmlDoc, sPath + "a:gs[1]", "pos"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, sPath + "a:gs[1]/a:srgbClr", "val"_ostr, u"ff1493"_ustr); + assertXPath(pXmlDoc, sPath + "a:gs[2]", "pos"_ostr, u"30000"_ustr); + assertXPath(pXmlDoc, sPath + "a:gs[2]/a:srgbClr", "val"_ostr, u"ffff00"_ustr); + assertXPath(pXmlDoc, sPath + "a:gs[3]", "pos"_ostr, u"100000"_ustr); + assertXPath(pXmlDoc, sPath + "a:gs[3]/a:srgbClr", "val"_ostr, u"00ffff"_ustr); } CPPUNIT_TEST_FIXTURE(TestMCGR, testFontworkColorGradientWord) @@ -51,20 +51,20 @@ CPPUNIT_TEST_FIXTURE(TestMCGR, testFontworkColorGradientWord) // Given a document with three-color gradient on a Fontwork. loadFromFile(u"MCGR_FontworkColorGradient.fodt"); // Save it to DOCX - save("Office Open XML Text"); + save(u"Office Open XML Text"_ustr); // And make sure a multi-color gradient fill is exported. - xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); // linear gradient with 30deg angle - assertXPath(pXmlDoc, "//w14:lin"_ostr, "ang"_ostr, "3600000"); + assertXPath(pXmlDoc, "//w14:lin"_ostr, "ang"_ostr, u"3600000"_ustr); // three color stops, no transparency static constexpr OString sPath = "//w14:gradFill/w14:gsLst/"_ostr; assertXPath(pXmlDoc, sPath + "w14:gs", 3); - assertXPath(pXmlDoc, sPath + "w14:gs[1]", "pos"_ostr, "0"); - assertXPath(pXmlDoc, sPath + "w14:gs[1]/w14:srgbClr", "val"_ostr, "ff1493"); - assertXPath(pXmlDoc, sPath + "w14:gs[2]", "pos"_ostr, "30000"); - assertXPath(pXmlDoc, sPath + "w14:gs[2]/w14:srgbClr", "val"_ostr, "ffff00"); - assertXPath(pXmlDoc, sPath + "w14:gs[3]", "pos"_ostr, "100000"); - assertXPath(pXmlDoc, sPath + "w14:gs[3]/w14:srgbClr", "val"_ostr, "00ffff"); + assertXPath(pXmlDoc, sPath + "w14:gs[1]", "pos"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, sPath + "w14:gs[1]/w14:srgbClr", "val"_ostr, u"ff1493"_ustr); + assertXPath(pXmlDoc, sPath + "w14:gs[2]", "pos"_ostr, u"30000"_ustr); + assertXPath(pXmlDoc, sPath + "w14:gs[2]/w14:srgbClr", "val"_ostr, u"ffff00"_ustr); + assertXPath(pXmlDoc, sPath + "w14:gs[3]", "pos"_ostr, u"100000"_ustr); + assertXPath(pXmlDoc, sPath + "w14:gs[3]/w14:srgbClr", "val"_ostr, u"00ffff"_ustr); } CPPUNIT_TEST_FIXTURE(TestMCGR, testTdf155825_SourcOffsetRangeDifferent) @@ -74,7 +74,7 @@ CPPUNIT_TEST_FIXTURE(TestMCGR, testTdf155825_SourcOffsetRangeDifferent) // Save it to PPTX // Without fix, a debug-build would have crashed in oox/source/export/drawingml.cxx from // assert(false && "oox::WriteGradientFill: non-synchronized gradients (!)"); - save("Impress Office Open XML"); + save(u"Impress Office Open XML"_ustr); } CPPUNIT_TEST_FIXTURE(TestMCGR, testStepCount) @@ -82,8 +82,8 @@ CPPUNIT_TEST_FIXTURE(TestMCGR, testStepCount) // Given a document with two-color gradient with StepCount 4. loadFromFile(u"tdf155852_MCGR_StepCount4.fodp"); // Save it to PPTX - save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); + save(u"Impress Office Open XML"_ustr); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); // Without the fix the colors in the sections were wrong. And when opening a file with StepCount // and saving it immediately to pptx, a continuous gradient might be produced. @@ -97,9 +97,9 @@ CPPUNIT_TEST_FIXTURE(TestMCGR, testStepCount) assertXPath(pXmlDoc, sPath + "a:gs[@pos='50000']", 2); assertXPath(pXmlDoc, sPath + "a:gs[@pos='75000']", 2); // Without fix the color was 808080. - assertXPath(pXmlDoc, sPath + "a:gs[@pos='75000'][1]/a:srgbClr", "val"_ostr, "55aaaa"); + assertXPath(pXmlDoc, sPath + "a:gs[@pos='75000'][1]/a:srgbClr", "val"_ostr, u"55aaaa"_ustr); // Without fix the color was 40bfbf, producing a gradient in the last segment. - assertXPath(pXmlDoc, sPath + "a:gs[@pos='75000'][2]/a:srgbClr", "val"_ostr, "00ffff"); + assertXPath(pXmlDoc, sPath + "a:gs[@pos='75000'][2]/a:srgbClr", "val"_ostr, u"00ffff"_ustr); } CPPUNIT_TEST_FIXTURE(TestMCGR, testAxialColorLinearTrans) @@ -108,23 +108,23 @@ CPPUNIT_TEST_FIXTURE(TestMCGR, testAxialColorLinearTrans) // two-stop linear transparency gradient from start 80% to end 0%. loadFromFile(u"tdf155827_MCGR_AxialColorLinearTrans.fodp"); // Save it to PPTX - save("Impress Office Open XML"); + save(u"Impress Office Open XML"_ustr); // OOXML has transparency together with color. Transparency is stored as opacity. // Expected: pos 0 #00ffff 20000, pos 50000 #ff0000 60000, pos 100000 #00ffff 100000. // Because of conversion through gray color the opacity values are not exact. If rounding // method will be changed, the test needs to be adjusted. - xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); static constexpr OString sPath = "//a:gradFill/a:gsLst/"_ostr; assertXPath(pXmlDoc, sPath + "a:gs", 3); - assertXPath(pXmlDoc, sPath + "a:gs[1]", "pos"_ostr, "0"); - assertXPath(pXmlDoc, sPath + "a:gs[1]/a:srgbClr", "val"_ostr, "00ffff"); - assertXPath(pXmlDoc, sPath + "a:gs[1]/a:srgbClr/a:alpha", "val"_ostr, "20000"); - assertXPath(pXmlDoc, sPath + "a:gs[2]", "pos"_ostr, "50000"); - assertXPath(pXmlDoc, sPath + "a:gs[2]/a:srgbClr", "val"_ostr, "ff0000"); - assertXPath(pXmlDoc, sPath + "a:gs[2]/a:srgbClr/a:alpha", "val"_ostr, "60396"); - assertXPath(pXmlDoc, sPath + "a:gs[3]", "pos"_ostr, "100000"); - assertXPath(pXmlDoc, sPath + "a:gs[3]/a:srgbClr", "val"_ostr, "00ffff"); + assertXPath(pXmlDoc, sPath + "a:gs[1]", "pos"_ostr, u"0"_ustr); + assertXPath(pXmlDoc, sPath + "a:gs[1]/a:srgbClr", "val"_ostr, u"00ffff"_ustr); + assertXPath(pXmlDoc, sPath + "a:gs[1]/a:srgbClr/a:alpha", "val"_ostr, u"20000"_ustr); + assertXPath(pXmlDoc, sPath + "a:gs[2]", "pos"_ostr, u"50000"_ustr); + assertXPath(pXmlDoc, sPath + "a:gs[2]/a:srgbClr", "val"_ostr, u"ff0000"_ustr); + assertXPath(pXmlDoc, sPath + "a:gs[2]/a:srgbClr/a:alpha", "val"_ostr, u"60396"_ustr); + assertXPath(pXmlDoc, sPath + "a:gs[3]", "pos"_ostr, u"100000"_ustr); + assertXPath(pXmlDoc, sPath + "a:gs[3]/a:srgbClr", "val"_ostr, u"00ffff"_ustr); // no <a:alpha> element for default val="100000" assertXPath(pXmlDoc, sPath + "a:gs[3]/a:srgbClr/a:alpha", 0); } diff --git a/oox/qa/unit/shape.cxx b/oox/qa/unit/shape.cxx index d0089a556904..ed2cd7965a78 100644 --- a/oox/qa/unit/shape.cxx +++ b/oox/qa/unit/shape.cxx @@ -65,7 +65,7 @@ class OoxShapeTest : public UnoApiTest { public: OoxShapeTest() - : UnoApiTest("/oox/qa/unit/data/") + : UnoApiTest(u"/oox/qa/unit/data/"_ustr) { } uno::Reference<drawing::XShape> getShapeByName(std::u16string_view aName); @@ -104,13 +104,13 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testGroupTransform) // Without the accompanying fix in place, this test would have failed in several properties. sal_Int32 nAngle; - xPropSet->getPropertyValue("ShearAngle") >>= nAngle; + xPropSet->getPropertyValue(u"ShearAngle"_ustr) >>= nAngle; // Failed with - Expected: 0 // - Actual : -810 // i.e. the shape was sheared although shearing does not exist in oox CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nAngle); - xPropSet->getPropertyValue("RotateAngle") >>= nAngle; + xPropSet->getPropertyValue(u"RotateAngle"_ustr) >>= nAngle; // Failed with - Expected: 26000 (is in 1/100deg) // - Actual : 26481 (is in 1/100deg) // 100deg in PowerPoint UI = 360deg - 100deg in LO. @@ -150,7 +150,7 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testCustomshapePosition) uno::Reference<beans::XPropertySet> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); sal_Int32 nY{}; - xShape->getPropertyValue("VertOrientPosition") >>= nY; + xShape->getPropertyValue(u"VertOrientPosition"_ustr) >>= nY; // <wp:posOffset>581025</wp:posOffset> in the document. sal_Int32 nExpected = rtl::math::round(581025.0 / 360); // Without the accompanying fix in place, this test would have failed with: @@ -184,7 +184,7 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testTdf125582_TextOnCircle) } drawing::TextVerticalAdjust eAdjust; - xPropSet->getPropertyValue("TextVerticalAdjust") >>= eAdjust; + xPropSet->getPropertyValue(u"TextVerticalAdjust"_ustr) >>= eAdjust; CPPUNIT_ASSERT_EQUAL_MESSAGE("TextVerticalAdjust", drawing::TextVerticalAdjust_BOTTOM, eAdjust); } @@ -218,9 +218,9 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testTdf151008VertAnchor) uno::Reference<beans::XPropertySet> xShape(getShapeByName(aExpected[i].sShapeName), uno::UNO_QUERY); drawing::TextHorizontalAdjust eHori; - CPPUNIT_ASSERT(xShape->getPropertyValue("TextHorizontalAdjust") >>= eHori); + CPPUNIT_ASSERT(xShape->getPropertyValue(u"TextHorizontalAdjust"_ustr) >>= eHori); drawing::TextVerticalAdjust eVert; - CPPUNIT_ASSERT(xShape->getPropertyValue("TextVerticalAdjust") >>= eVert); + CPPUNIT_ASSERT(xShape->getPropertyValue(u"TextVerticalAdjust"_ustr) >>= eVert); CPPUNIT_ASSERT_EQUAL(aExpected[i].eAnchorHori, eHori); CPPUNIT_ASSERT_EQUAL(aExpected[i].eAnchorVert, eVert); } @@ -263,8 +263,8 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testTdf151518VertAnchor) xDiagramShape->getByIndex(aExpected[i].nSubShapeIndex), uno::UNO_QUERY); sal_Int32 nLower; sal_Int32 nUpper; - CPPUNIT_ASSERT(xShapeProps->getPropertyValue("TextLowerDistance") >>= nLower); - CPPUNIT_ASSERT(xShapeProps->getPropertyValue("TextUpperDistance") >>= nUpper); + CPPUNIT_ASSERT(xShapeProps->getPropertyValue(u"TextLowerDistance"_ustr) >>= nLower); + CPPUNIT_ASSERT(xShapeProps->getPropertyValue(u"TextUpperDistance"_ustr) >>= nUpper); CPPUNIT_ASSERT_EQUAL(aExpected[i].nLowerDistance, nLower); CPPUNIT_ASSERT_EQUAL(aExpected[i].nUpperDistance, nUpper); } @@ -310,7 +310,7 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testTdf54095_SmartArtThemeTextColor) uno::Reference<beans::XPropertySet> xPortion(xPara->createEnumeration()->nextElement(), uno::UNO_QUERY); Color nActualColor{ 0 }; - xPortion->getPropertyValue("CharColor") >>= nActualColor; + xPortion->getPropertyValue(u"CharColor"_ustr) >>= nActualColor; // Without fix the test would have failed with: // - Expected: rgba[1f497dff] // - Actual : rgba[ffffffff], that is text was white @@ -320,7 +320,7 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testTdf54095_SmartArtThemeTextColor) // oox::drawingml::Color::getSchemeColorIndex() // Without fix the color scheme was "lt1" (1) but should be "dk2" (2). uno::Reference<util::XComplexColor> xComplexColor; - xPortion->getPropertyValue("CharComplexColor") >>= xComplexColor; + xPortion->getPropertyValue(u"CharComplexColor"_ustr) >>= xComplexColor; CPPUNIT_ASSERT(xComplexColor.is()); auto aComplexColor = model::color::getFromXComplexColor(xComplexColor); CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Dark2, aComplexColor.getThemeColorType()); @@ -398,12 +398,12 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testWriterFontwork) xShapeProps->getPropertyValue(u"CharFontName"_ustr)); CPPUNIT_ASSERT_EQUAL(uno::Any(float(awt::FontWeight::BOLD)), - xShapeProps->getPropertyValue("CharWeight")); + xShapeProps->getPropertyValue(u"CharWeight"_ustr)); lang::Locale aCharLocale; xShapeProps->getPropertyValue(u"CharLocale"_ustr) >>= aCharLocale; - CPPUNIT_ASSERT_EQUAL(OUString("en"), aCharLocale.Language); - CPPUNIT_ASSERT_EQUAL(OUString("US"), aCharLocale.Country); + CPPUNIT_ASSERT_EQUAL(u"en"_ustr, aCharLocale.Language); + CPPUNIT_ASSERT_EQUAL(u"US"_ustr, aCharLocale.Country); CPPUNIT_ASSERT_EQUAL(uno::Any(drawing::TextHorizontalAdjust_RIGHT), xShapeProps->getPropertyValue(u"TextHorizontalAdjust"_ustr)); @@ -790,10 +790,10 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testWordArtBitmapFill) xGraphic.set(xBitmap, uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xGraphicDescriptor(xGraphic, uno::UNO_QUERY_THROW); OUString sMimeType; - CPPUNIT_ASSERT(xGraphicDescriptor->getPropertyValue("MimeType") >>= sMimeType); - CPPUNIT_ASSERT_EQUAL(OUString("image/jpeg"), sMimeType); + CPPUNIT_ASSERT(xGraphicDescriptor->getPropertyValue(u"MimeType"_ustr) >>= sMimeType); + CPPUNIT_ASSERT_EQUAL(u"image/jpeg"_ustr, sMimeType); awt::Size aSize100thMM; - CPPUNIT_ASSERT(xGraphicDescriptor->getPropertyValue("Size100thMM") >>= aSize100thMM); + CPPUNIT_ASSERT(xGraphicDescriptor->getPropertyValue(u"Size100thMM"_ustr) >>= aSize100thMM); CPPUNIT_ASSERT_EQUAL(sal_Int32(1592), aSize100thMM.Width); CPPUNIT_ASSERT_EQUAL(sal_Int32(1592), aSize100thMM.Height); } diff --git a/oox/qa/unit/testscene3d.cxx b/oox/qa/unit/testscene3d.cxx index fdad25be2cea..d43209a0a2c4 100644 --- a/oox/qa/unit/testscene3d.cxx +++ b/oox/qa/unit/testscene3d.cxx @@ -34,7 +34,7 @@ class TestScene3d : public UnoApiXmlTest { public: TestScene3d() - : UnoApiXmlTest("/oox/qa/unit/data/") + : UnoApiXmlTest(u"/oox/qa/unit/data/"_ustr) { } @@ -69,7 +69,7 @@ void TestScene3d::getShapeAsBitmap(BitmapEx& rBMP, sal_uInt8 nShapeIndex) uno::Reference<drawing::XShape> xShape3D(getShape(nShapeIndex, 0)); SdrObject* pSdrShape(SdrObject::getSdrObjectFromXShape(xShape3D)); pSdrView->MarkObj(pSdrShape, pSdrView->GetSdrPageView()); - dispatchCommand(mxComponent, ".uno:ConvertIntoBitmap", {}); + dispatchCommand(mxComponent, u".uno:ConvertIntoBitmap"_ustr, {}); pSdrView->UnmarkAll(); // Get graphic @@ -534,25 +534,25 @@ CPPUNIT_TEST_FIXTURE(TestScene3d, test_material_wireframe) uno::Reference<drawing::XShape> xShape(getShape(0, 0)); // Make sure the export to ODF has the corresponding attributes. - save("impress8"); - xmlDocUniquePtr pXmlDoc = parseExport("content.xml"); + save(u"impress8"_ustr); + xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); assertXPath(pXmlDoc, "/office:document-content/office:body/office:presentation/draw:page/" "draw:custom-shape/draw:enhanced-geometry"_ostr, - "extrusion-origin"_ostr, "-0.5 -0.5"); + "extrusion-origin"_ostr, u"-0.5 -0.5"_ustr); assertXPath(pXmlDoc, "/office:document-content/office:body/office:presentation/draw:page/" "draw:custom-shape/draw:enhanced-geometry"_ostr, - "extrusion-skew"_ostr, "30 -45"); + "extrusion-skew"_ostr, u"30 -45"_ustr); assertXPath(pXmlDoc, "/office:document-content/office:body/office:presentation/draw:page/" "draw:custom-shape/draw:enhanced-geometry"_ostr, - "projection"_ostr, "parallel"); + "projection"_ostr, u"parallel"_ustr); assertXPath(pXmlDoc, "/office:document-content/office:body/office:presentation/draw:page/" "draw:custom-shape/draw:enhanced-geometry"_ostr, - "shade-mode"_ostr, "draft"); + "shade-mode"_ostr, u"draft"_ustr); } CPPUNIT_TEST_FIXTURE(TestScene3d, test_cropped_image) @@ -630,9 +630,9 @@ CPPUNIT_TEST_FIXTURE(TestScene3d, test_shape_rotation) uno::Reference<drawing::XShape> xShape(getShape(0, 0)); // Make sure that the immediate export to pptx has the same shape rotation - save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc, "//p:spPr/a:xfrm"_ostr, "rot"_ostr, "300000"); + save(u"Impress Office Open XML"_ustr); + xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr); + assertXPath(pXmlDoc, "//p:spPr/a:xfrm"_ostr, "rot"_ostr, u"300000"_ustr); } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/oox/qa/unit/vba_compression.cxx b/oox/qa/unit/vba_compression.cxx index 906e30bfc688..c5876106b3bf 100644 --- a/oox/qa/unit/vba_compression.cxx +++ b/oox/qa/unit/vba_compression.cxx @@ -54,7 +54,7 @@ public: private: static OUString const & getDebugDirUrl() { struct DebugDirUrl { - DebugDirUrl() : url("$UserInstallation/debug/") { + DebugDirUrl() : url(u"$UserInstallation/debug/"_ustr) { rtl::Bootstrap::expandMacros(url); //TODO: provide an OUString -> OUString expansion function, and which throws on // failure diff --git a/oox/qa/unit/vba_encryption.cxx b/oox/qa/unit/vba_encryption.cxx index 023cc197bafb..edffd8dd6a3d 100644 --- a/oox/qa/unit/vba_encryption.cxx +++ b/oox/qa/unit/vba_encryption.cxx @@ -71,7 +71,8 @@ void TestVbaEncryption::testSimple2() void TestVbaEncryption::testProjKey1() { - sal_uInt8 nProjKey = VBAEncryption::calculateProjKey("{917DED54-440B-4FD1-A5C1-74ACF261E600}"); + sal_uInt8 nProjKey + = VBAEncryption::calculateProjKey(u"{917DED54-440B-4FD1-A5C1-74ACF261E600}"_ustr); CPPUNIT_ASSERT_EQUAL(int(0xdf), static_cast<int>(nProjKey)); } diff --git a/oox/qa/unit/vml.cxx b/oox/qa/unit/vml.cxx index c0918b2682c9..01847301a1d8 100644 --- a/oox/qa/unit/vml.cxx +++ b/oox/qa/unit/vml.cxx @@ -29,7 +29,7 @@ class OoxVmlTest : public UnoApiTest { public: OoxVmlTest() - : UnoApiTest("/oox/qa/unit/data/") + : UnoApiTest(u"/oox/qa/unit/data/"_ustr) { } }; @@ -48,7 +48,7 @@ CPPUNIT_TEST_FIXTURE(OoxVmlTest, tdf112450_vml_polyline) uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY); // Without fix in place, Geometry had 2 points, both 0|0. drawing::PointSequenceSequence aGeometry; - xShapeProps->getPropertyValue("Geometry") >>= aGeometry; + xShapeProps->getPropertyValue(u"Geometry"_ustr) >>= aGeometry; drawing::PointSequence aPolygon = aGeometry[0]; CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(6879), aPolygon[3].X, 1); CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(487), aPolygon[3].Y, 1); @@ -57,7 +57,7 @@ CPPUNIT_TEST_FIXTURE(OoxVmlTest, tdf112450_vml_polyline) CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(1926), xShape->getSize().Height, 1); // After the fix the shape has still to be PolygonKind_PLIN drawing::PolygonKind ePolygonKind; - xShapeProps->getPropertyValue("PolygonKind") >>= ePolygonKind; + xShapeProps->getPropertyValue(u"PolygonKind"_ustr) >>= ePolygonKind; CPPUNIT_ASSERT_EQUAL(drawing::PolygonKind_PLIN, ePolygonKind); } { @@ -65,7 +65,7 @@ CPPUNIT_TEST_FIXTURE(OoxVmlTest, tdf112450_vml_polyline) uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY); // Without fix in place, Geometry had 2 points, both 0|0. drawing::PointSequenceSequence aGeometry; - xShapeProps->getPropertyValue("Geometry") >>= aGeometry; + xShapeProps->getPropertyValue(u"Geometry"_ustr) >>= aGeometry; drawing::PointSequence aPolygon = aGeometry[0]; CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(5062), aPolygon[2].X, 1); CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(2247), aPolygon[2].Y, 1); @@ -74,7 +74,7 @@ CPPUNIT_TEST_FIXTURE(OoxVmlTest, tdf112450_vml_polyline) CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(2247), xShape->getSize().Height, 1); // Without fix in place the shape was not closed, it had PolygonKind_PLIN drawing::PolygonKind ePolygonKind; - xShapeProps->getPropertyValue("PolygonKind") >>= ePolygonKind; + xShapeProps->getPropertyValue(u"PolygonKind"_ustr) >>= ePolygonKind; CPPUNIT_ASSERT_EQUAL(drawing::PolygonKind_POLY, ePolygonKind); } { @@ -83,7 +83,7 @@ CPPUNIT_TEST_FIXTURE(OoxVmlTest, tdf112450_vml_polyline) uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY); // Without fix in place, Geometry had 2 points, both 0|0. drawing::PointSequenceSequence aGeometry; - xShapeProps->getPropertyValue("Geometry") >>= aGeometry; + xShapeProps->getPropertyValue(u"Geometry"_ustr) >>= aGeometry; drawing::PointSequence aPolygon = aGeometry[0]; CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(2095), aPolygon[3].X, 1); CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(608), aPolygon[3].Y, 1); @@ -92,7 +92,7 @@ CPPUNIT_TEST_FIXTURE(OoxVmlTest, tdf112450_vml_polyline) CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(2485), xShape->getSize().Height, 1); // Without fix in place the shape was not closed, it had PolygonKind_PLIN drawing::PolygonKind ePolygonKind; - xShapeProps->getPropertyValue("PolygonKind") >>= ePolygonKind; + xShapeProps->getPropertyValue(u"PolygonKind"_ustr) >>= ePolygonKind; CPPUNIT_ASSERT_EQUAL(drawing::PolygonKind_POLY, ePolygonKind); } } @@ -109,7 +109,7 @@ CPPUNIT_TEST_FIXTURE(OoxVmlTest, tdf137314_vml_rotation_unit_fd) uno::Reference<drawing::XShape> xShape(xGroup->getByIndex(1), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY); drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords; - xShapeProps->getPropertyValue("PolyPolygonBezier") >>= aPolyPolygonBezierCoords; + xShapeProps->getPropertyValue(u"PolyPolygonBezier"_ustr) >>= aPolyPolygonBezierCoords; drawing::PointSequence aPolygon = aPolyPolygonBezierCoords.Coordinates[1]; // Without fix in place, the vector was -1441|1490. // [1] and [2] are Bezier-curve control points. @@ -135,7 +135,7 @@ CPPUNIT_TEST_FIXTURE(OoxVmlTest, testSpt202ShapeType) // - Actual : com.sun.star.drawing.CustomShape // and then the size of the group shape was incorrect, e.g. its right edge was outside the page // boundaries. - CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.TextShape"), xShape->getShapeType()); + CPPUNIT_ASSERT_EQUAL(u"com.sun.star.drawing.TextShape"_ustr, xShape->getShapeType()); } CPPUNIT_TEST_FIXTURE(OoxVmlTest, testShapeNonAutosizeWithText) @@ -167,13 +167,13 @@ CPPUNIT_TEST_FIXTURE(OoxVmlTest, testGraphicStroke) uno::Reference<beans::XPropertySet> xShape; uno::Reference<lang::XServiceInfo> xInfo(xDrawPage->getByIndex(0), uno::UNO_QUERY); - if (xInfo->supportsService("com.sun.star.drawing.OLE2Shape")) + if (xInfo->supportsService(u"com.sun.star.drawing.OLE2Shape"_ustr)) xShape.set(xInfo, uno::UNO_QUERY); CPPUNIT_ASSERT(xShape.is()); drawing::LineStyle eLineStyle{}; - xShape->getPropertyValue("LineStyle") >>= eLineStyle; + xShape->getPropertyValue(u"LineStyle"_ustr) >>= eLineStyle; // Without the accompanying fix in place, this test would have failed with: // - Expected: 1 // - Actual : 0 @@ -194,7 +194,7 @@ CPPUNIT_TEST_FIXTURE(OoxVmlTest, testWatermark) uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); drawing::ColorMode eMode{}; - xShape->getPropertyValue("GraphicColorMode") >>= eMode; + xShape->getPropertyValue(u"GraphicColorMode"_ustr) >>= eMode; // Without the accompanying fix in place, this test would have failed with: // - Expected: 3 // - Actual : 0 @@ -212,7 +212,7 @@ CPPUNIT_TEST_FIXTURE(OoxVmlTest, testWriterFontworkTrimTrue) // FIXME: tdf#153183 validation error in OOXML export: Errors: 1 // Attribute 'ID' is not allowed to appear in element 'v:shape'. skipValidation(); - saveAndReload("Office Open XML Text"); + saveAndReload(u"Office Open XML Text"_ustr); uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<drawing::XShape> xShape(xDrawPageSupplier->getDrawPage()->getByIndex(0), diff --git a/oox/qa/unit/wpc_drawing_canvas.cxx b/oox/qa/unit/wpc_drawing_canvas.cxx index 6c087c473b34..677ad43066f1 100644 --- a/oox/qa/unit/wpc_drawing_canvas.cxx +++ b/oox/qa/unit/wpc_drawing_canvas.cxx @@ -39,7 +39,7 @@ class TestWPC : public UnoApiXmlTest { public: TestWPC() - : UnoApiXmlTest("/oox/qa/unit/data/") + : UnoApiXmlTest(u"/oox/qa/unit/data/"_ustr) { } }; @@ -146,7 +146,7 @@ CPPUNIT_TEST_FIXTURE(TestWPC, WPC_BentConnector) uno::UNO_QUERY); uno::Reference<drawing::XShapes> xGroup(xDrawPage->getByIndex(0), uno::UNO_QUERY); uno::Reference<lang::XServiceInfo> xInfo(xGroup->getByIndex(2), uno::UNO_QUERY); - CPPUNIT_ASSERT(xInfo->supportsService("com.sun.star.drawing.ConnectorShape")); + CPPUNIT_ASSERT(xInfo->supportsService(u"com.sun.star.drawing.ConnectorShape"_ustr)); uno::Reference<beans::XPropertySet> xShapeProps(xGroup->getByIndex(2), uno::UNO_QUERY); com::sun::star::drawing::ConnectorType eEdgeKind; @@ -227,7 +227,7 @@ CPPUNIT_TEST_FIXTURE(TestWPC, WPC_tdf104671_Cloud) uno::UNO_QUERY); uno::Reference<drawing::XShapes> xGroup(xDrawPage->getByIndex(0), uno::UNO_QUERY); uno::Reference<lang::XServiceInfo> xInfo(xGroup->getByIndex(1), uno::UNO_QUERY); - CPPUNIT_ASSERT(xInfo->supportsService("com.sun.star.drawing.CustomShape")); + CPPUNIT_ASSERT(xInfo->supportsService(u"com.sun.star.drawing.CustomShape"_ustr)); } CPPUNIT_TEST_FIXTURE(TestWPC, WPC_Shadow) @@ -277,7 +277,7 @@ CPPUNIT_TEST_FIXTURE(TestWPC, WPC_tdf158339_shape_text_in_group) uno::Reference<css::text::XTextFrame> xTextFrame; xShapeProps->getPropertyValue(u"TextBoxContent"_ustr) >>= xTextFrame; CPPUNIT_ASSERT(xTextFrame.is()); - CPPUNIT_ASSERT_EQUAL(OUString("Group"), xTextFrame->getText()->getString()); + CPPUNIT_ASSERT_EQUAL(u"Group"_ustr, xTextFrame->getText()->getString()); } CPPUNIT_TEST_FIXTURE(TestWPC, WPC_tdf158348_shape_text_in_table_cell) @@ -303,7 +303,7 @@ CPPUNIT_TEST_FIXTURE(TestWPC, WPC_tdf158348_shape_text_in_table_cell) uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<text::XTextTable> xTextTable( xTablesSupplier->getTextTables()->getByName(u"Table1"_ustr), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xCellA1(xTextTable->getCellByName("A1"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCellA1(xTextTable->getCellByName(u"A1"_ustr), uno::UNO_QUERY); // The string had started with "Inside shape" without fix. CPPUNIT_ASSERT(xCellA1->getString().startsWith("Inside table")); } @@ -321,7 +321,7 @@ CPPUNIT_TEST_FIXTURE(TestWPC, WPC_CurvedConnector2) uno::UNO_QUERY); uno::Reference<drawing::XShapes> xGroup(xDrawPage->getByIndex(0), uno::UNO_QUERY); uno::Reference<lang::XServiceInfo> xInfo(xGroup->getByIndex(3), uno::UNO_QUERY); - CPPUNIT_ASSERT(xInfo->supportsService("com.sun.star.drawing.ConnectorShape")); + CPPUNIT_ASSERT(xInfo->supportsService(u"com.sun.star.drawing.ConnectorShape"_ustr)); uno::Reference<beans::XPropertySet> xShapeProps(xGroup->getByIndex(3), uno::UNO_QUERY); com::sun::star::drawing::ConnectorType eEdgeKind; @@ -330,7 +330,7 @@ CPPUNIT_TEST_FIXTURE(TestWPC, WPC_CurvedConnector2) // Make sure the path is OOXML compatible drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords; - xShapeProps->getPropertyValue("PolyPolygonBezier") >>= aPolyPolygonBezierCoords; + xShapeProps->getPropertyValue(u"PolyPolygonBezier"_ustr) >>= aPolyPolygonBezierCoords; drawing::PointSequence aPolygon = aPolyPolygonBezierCoords.Coordinates[0]; // First control point. LO routing would generate point (4372|5584). CPPUNIT_ASSERT_EQUAL(sal_Int32(5149), aPolygon[1].Y); |