diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-11-08 13:08:05 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-11-08 14:58:42 +0100 |
commit | 8953fe0aaebcc5e6aea8eafcf7612f49b4479911 (patch) | |
tree | b74da3b03c3c3a5b71ae8a462aeb48209eda0231 /sw/qa/extras/odfexport/odfexport.cxx | |
parent | 000a05339b4d7d25aea063a16b7a01ca9080978f (diff) |
SwModelTestBase: make clear parseExport only works when exporting
Change-Id: I04d8b170b68479fb5c48e1cdd078baffaee604ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142432
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa/extras/odfexport/odfexport.cxx')
-rw-r--r-- | sw/qa/extras/odfexport/odfexport.cxx | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index b1df8b80f0e5..43188e5718f9 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -467,8 +467,9 @@ DECLARE_ODFEXPORT_TEST(testFramebackgrounds, "framebackgrounds.odt") aGradientxTextFrame = getProperty<awt::Gradient>(xTextFrame, "FillTransparenceGradient"); CPPUNIT_ASSERT_EQUAL(css::awt::GradientStyle_LINEAR, aGradientxTextFrame.Style); - if (xmlDocUniquePtr pXmlDoc = parseExport("content.xml")) + if (isExported()) { + xmlDocUniquePtr pXmlDoc = parseExport("content.xml"); // check that there are 3 background-image elements assertXPath(pXmlDoc, "//style:style[@style:parent-style-name='Frame' and @style:family='graphic']/style:graphic-properties[@draw:fill='bitmap']/style:background-image[@style:repeat='stretch']", 3); // tdf#90640: check that one of them is 55% opaque @@ -665,8 +666,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf92379) // CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(xFrameStyle2, "FillColor")); // CPPUNIT_ASSERT_EQUAL(sal_Int16(100), getProperty<sal_Int16>(xFrameStyle2, "FillTransparence")); - if (xmlDocUniquePtr pXmlDoc = parseExport("styles.xml")) + if (isExported()) { + xmlDocUniquePtr pXmlDoc = parseExport("styles.xml"); // check that fo:background-color attribute is exported properly assertXPath(pXmlDoc, "//style:style[@style:family='graphic' and @style:name='encarts']/style:graphic-properties[@fo:background-color='#ffcc99']", 1); assertXPath(pXmlDoc, "//style:style[@style:family='graphic' and @style:name='Untitled1']/style:graphic-properties[@fo:background-color='transparent']", 1); @@ -713,8 +715,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf92379) // CPPUNIT_ASSERT_EQUAL(sal_Int16(100), getProperty<sal_Int16>(xStyle32, "FillTransparence")); CPPUNIT_ASSERT_EQUAL(Color(0x461900), getProperty<Color>(xStyle32, "CharColor")); - if (xmlDocUniquePtr pXmlDoc = parseExport("styles.xml")) + if (isExported()) { + xmlDocUniquePtr pXmlDoc = parseExport("styles.xml"); // check that fo:background-color attribute is exported properly assertXPath(pXmlDoc, "//style:style[@style:family='paragraph' and @style:display-name='Titre Avis expert']/style:paragraph-properties[@fo:background-color='#661900']", 1); assertXPath(pXmlDoc, "//style:style[@style:family='paragraph' and @style:display-name='Avis expert questions']/style:paragraph-properties[@fo:background-color='transparent']", 1); @@ -1190,8 +1193,9 @@ CPPUNIT_TEST_FIXTURE(Test, testProtectionKey) // we can't assume that the user entered the password; check that we // round-trip the password as-is - if (xmlDocUniquePtr pXmlDoc = parseExport("content.xml")) + if (isExported()) { + xmlDocUniquePtr pXmlDoc = parseExport("content.xml"); assertXPath(pXmlDoc, "//text:section[@text:name='Section0' and @text:protected='true' and @text:protection-key='vbnhxyBKtPHCA1wB21zG1Oha8ZA=']"); assertXPath(pXmlDoc, "//text:section[@text:name='Section1' and @text:protected='true' and @text:protection-key='nLHas0RIwepGDaH4c2hpyIUvIS8=']"); assertXPath(pXmlDoc, "//text:section[@text:name='Section2' and @text:protected='true' and @text:protection-key-digest-algorithm='http://www.w3.org/2000/09/xmldsig#sha256' and @text:protection-key='1tnJohagR2T0yF/v69hLPuumSTsj32CumW97nkKGuSQ=']"); @@ -1404,9 +1408,12 @@ DECLARE_ODFEXPORT_TEST(testTextboxRoundedCorners, "textbox-rounded-corners.odt") CPPUNIT_ASSERT_EQUAL(OUString("a"), xCell->getString()); // Table inside a textbox should be in the extension namespace. - if (xmlDocUniquePtr pXmlDoc = parseExport("content.xml")) + if (isExported()) + { + xmlDocUniquePtr pXmlDoc = parseExport("content.xml"); // This failed, as draw:custom-shape had a table:table child. assertXPath(pXmlDoc, "//draw:custom-shape/loext:table", "name", "Table1"); + } } // test that import whitespace collapsing is compatible with old docs |