chart2/qa/extras/charttest.hxx | 4 cppcanvas/CppunitTest_cppcanvas_emfplus.mk | 1 embeddedobj/qa/cppunit/msole.cxx | 6 include/test/unoapi_test.hxx | 8 include/test/unoapixml_test.hxx | 2 lotuswordpro/CppunitTest_lotuswordpro_import_test.mk | 1 oox/CppunitTest_oox_mathml.mk | 1 oox/qa/unit/export.cxx | 92 +++--- sc/CppunitTest_sc_functionlistobj.mk | 1 sc/qa/extras/htmlexporttest.cxx | 8 sc/qa/extras/macros-test.cxx | 6 sc/qa/unit/SparklineImportExportTest.cxx | 8 sc/qa/unit/jumbosheets-test.cxx | 8 sc/qa/unit/uicalc/uicalc.cxx | 32 +- sd/qa/filter/eppt/eppt.cxx | 8 sd/qa/unit/HtmlExportTest.cxx | 4 sd/qa/unit/PNGExportTests.cxx | 56 +-- sd/qa/unit/SVGExportTests.cxx | 34 +- sd/qa/unit/SdrPdfImportTest.cxx | 9 sd/qa/unit/ShapeImportExportTest.cxx | 8 sd/qa/unit/export-tests-ooxml1.cxx | 193 ++++++------- sd/qa/unit/export-tests-ooxml2.cxx | 212 ++++++-------- sd/qa/unit/export-tests-ooxml3.cxx | 282 +++++++++---------- sd/qa/unit/export-tests.cxx | 70 ++-- sd/qa/unit/misc-tests.cxx | 32 +- sfx2/CppunitTest_sfx2_classification.mk | 1 sfx2/CppunitTest_sfx2_view.mk | 1 sfx2/qa/cppunit/test_misc.cxx | 29 - svx/CppunitTest_svx_styles.mk | 1 svx/qa/unit/core.cxx | 5 svx/qa/unit/customshapes.cxx | 24 - svx/qa/unit/svdraw.cxx | 4 svx/qa/unit/unodraw.cxx | 4 svx/qa/unit/xoutdev.cxx | 12 test/source/unoapi_test.cxx | 45 +-- test/source/unoapixml_test.cxx | 4 vcl/CppunitTest_vcl_gen.mk | 1 writerfilter/CppunitTest_writerfilter_dmapper.mk | 1 writerfilter/CppunitTest_writerfilter_rtftok.mk | 1 xmloff/qa/unit/draw.cxx | 34 +- xmloff/qa/unit/style.cxx | 28 - xmloff/qa/unit/text.cxx | 56 +-- 42 files changed, 640 insertions(+), 697 deletions(-)
New commits: commit 248be1fe7d31499fe7e237bb15ec67b55962c1a7 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Fri Nov 4 17:31:55 2022 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Tue Nov 8 11:54:22 2022 +0100 UnoApiTest: simplify code by using tempfile member SwModelTestBase does the same. this will help to make SwModelTestBase inherit from UnoApiTest Change-Id: If1c824cf92f0e8b70253e4d5fdeddcaa521d4632 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142287 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx index 2cacd4e43243..a685c6537bf5 100644 --- a/chart2/qa/extras/charttest.hxx +++ b/chart2/qa/extras/charttest.hxx @@ -632,10 +632,10 @@ getShapeByName(const uno::Reference<drawing::XShapes>& rShapes, const OUString& xmlDocUniquePtr ChartTest::parseExport(const OUString& rDir, const OUString& rFilterFormat) { - utl::TempFileNamed aTempFile = save(rFilterFormat); + save(rFilterFormat); // Read the XML stream we're interested in. - uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), aTempFile.GetURL()); + uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); uno::Reference<io::XInputStream> xInputStream(xNameAccess->getByName(findChartFile(rDir, xNameAccess)), uno::UNO_QUERY); CPPUNIT_ASSERT(xInputStream.is()); std::unique_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream(xInputStream, true)); diff --git a/cppcanvas/CppunitTest_cppcanvas_emfplus.mk b/cppcanvas/CppunitTest_cppcanvas_emfplus.mk index ee47d8af0a18..7e692bdd53e0 100644 --- a/cppcanvas/CppunitTest_cppcanvas_emfplus.mk +++ b/cppcanvas/CppunitTest_cppcanvas_emfplus.mk @@ -25,6 +25,7 @@ $(eval $(call gb_CppunitTest_use_libraries,cppcanvas_emfplus, \ test \ tl \ unotest \ + utl \ vcl \ )) diff --git a/embeddedobj/qa/cppunit/msole.cxx b/embeddedobj/qa/cppunit/msole.cxx index ee76dfb3984c..ef2027d958dc 100644 --- a/embeddedobj/qa/cppunit/msole.cxx +++ b/embeddedobj/qa/cppunit/msole.cxx @@ -94,9 +94,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSaveOnThread) mxComponent = loadFromDesktop(aURL, "com.sun.star.text.TextDocument", aLoadProperties); // When saving that document on a thread: - utl::TempFileNamed aTempFile; - aTempFile.EnableKillingFile(); - OdtExportThread aThread(mxComponent, aTempFile.GetURL()); + OdtExportThread aThread(mxComponent, maTempFile.GetURL()); aThread.create(); { SolarMutexReleaser r; @@ -108,7 +106,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSaveOnThread) } // Then make sure its visible area's width is correct. - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "content.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("content.xml"); // 16 pixels, assuming 96 DPI. // Without the accompanying fix in place, this test would have failed with: // - Expected: 0.1665in diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx index 2b29e50a5bfd..90fc65ef6d08 100644 --- a/include/test/unoapi_test.hxx +++ b/include/test/unoapi_test.hxx @@ -36,9 +36,9 @@ public: css::uno::Any executeMacro(const OUString& rScriptURL, const css::uno::Sequence<css::uno::Any>& rParams = {}); - utl::TempFileNamed save(const OUString& rFilter); - utl::TempFileNamed saveAndClose(const OUString& rFilter); - utl::TempFileNamed saveAndReload(const OUString& rFilter); + void save(const OUString& rFilter); + void saveAndClose(const OUString& rFilter); + void saveAndReload(const OUString& rFilter); void skipValidation() { mbSkipValidation = true; } void setFilterOptions(const OUString& rFilterOptions) { maFilterOptions = rFilterOptions; } @@ -47,6 +47,8 @@ protected: // reference to document component that we are testing css::uno::Reference<css::lang::XComponent> mxComponent; + utl::TempFileNamed maTempFile; + private: bool mbSkipValidation; OUString m_aBaseString; diff --git a/include/test/unoapixml_test.hxx b/include/test/unoapixml_test.hxx index 36fb334a75cd..660fda6c2050 100644 --- a/include/test/unoapixml_test.hxx +++ b/include/test/unoapixml_test.hxx @@ -22,7 +22,7 @@ class OOO_DLLPUBLIC_TEST UnoApiXmlTest : public UnoApiTest, public XmlTestTools public: UnoApiXmlTest(OUString path); - xmlDocUniquePtr parseExport(OUString const& rTempFile, OUString const& rStreamName); + xmlDocUniquePtr parseExport(OUString const& rStreamName); }; #endif // INCLUDED_TEST_UNOAPIXML_TEST_HXX diff --git a/lotuswordpro/CppunitTest_lotuswordpro_import_test.mk b/lotuswordpro/CppunitTest_lotuswordpro_import_test.mk index 31492dd6cd57..6cd6c619bc66 100644 --- a/lotuswordpro/CppunitTest_lotuswordpro_import_test.mk +++ b/lotuswordpro/CppunitTest_lotuswordpro_import_test.mk @@ -24,6 +24,7 @@ $(eval $(call gb_CppunitTest_use_libraries,lotuswordpro_import_test, \ test \ tl \ unotest \ + utl \ vcl \ )) diff --git a/oox/CppunitTest_oox_mathml.mk b/oox/CppunitTest_oox_mathml.mk index 7021eccc5279..4022c762aebc 100644 --- a/oox/CppunitTest_oox_mathml.mk +++ b/oox/CppunitTest_oox_mathml.mk @@ -27,6 +27,7 @@ $(eval $(call gb_CppunitTest_use_libraries,oox_mathml, \ subsequenttest \ test \ unotest \ + utl \ )) $(eval $(call gb_CppunitTest_use_sdk_api,oox_mathml)) diff --git a/oox/qa/unit/export.cxx b/oox/qa/unit/export.cxx index 157e8cd60e87..4ea35c527e67 100644 --- a/oox/qa/unit/export.cxx +++ b/oox/qa/unit/export.cxx @@ -41,10 +41,10 @@ CPPUNIT_TEST_FIXTURE(Test, testPolylineConnectorPosition) // Given a document with a group shape and therein a polyline and a connector. loadFromURL(u"tdf141786_PolylineConnectorInGroup.odt"); // When saving that to DOCX: - utl::TempFileNamed aTempFile = save("Office Open XML Text"); + save("Office Open XML Text"); // Then make sure polyline and connector have the correct position. - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // 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 @@ -70,10 +70,10 @@ CPPUNIT_TEST_FIXTURE(Test, testRotatedShapePosition) skipValidation(); // When saving that to DOCX: - utl::TempFileNamed aTempFile = save("Office Open XML Text"); + save("Office Open XML Text"); // Then make sure the rotated child shape has the correct position. - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // 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 @@ -92,11 +92,11 @@ CPPUNIT_TEST_FIXTURE(Test, testDmlGroupshapePolygon) skipValidation(); // When saving that to DOCX: - utl::TempFileNamed aTempFile = save("Office Open XML Text"); + save("Office Open XML Text"); // Then make sure that the group shape, the group shape's child size and the child shape's size // match: - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); assertXPath(pXmlDoc, "//wpg:grpSpPr/a:xfrm/a:ext", "cx", "5328360"); // Without the accompanying fix in place, this test would have failed, the <a:chExt> element was // not written. @@ -113,10 +113,10 @@ CPPUNIT_TEST_FIXTURE(Test, testCustomShapeArrowExport) skipValidation(); // When saving that to DOCX: - utl::TempFileNamed aTempFile = save("Office Open XML Text"); + save("Office Open XML Text"); // Then the shapes should retain their correct control values. - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Without the fix the output OOXML would have no <a:prstGeom> tags in it. @@ -299,9 +299,9 @@ CPPUNIT_TEST_FIXTURE(Test, testCameraRevolutionGrabBag) loadFromURL(u"camera-rotation-revolution-nonwps.pptx"); // When saving that document: - utl::TempFileNamed aTempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); // 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", "rev", "5400000"); @@ -324,9 +324,9 @@ CPPUNIT_TEST_FIXTURE(Test, testReferToTheme) loadFromURL(u"refer-to-theme.pptx"); // When saving that document: - utl::TempFileNamed aTempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); // 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 @@ -365,7 +365,7 @@ CPPUNIT_TEST_FIXTURE(Test, testReferToThemeShapeFill) loadFromURL(u"refer-to-theme-shape-fill.odp"); // When saving that document: - utl::TempFileNamed aTempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // Then make sure the shape fill color is a scheme color: // Without the accompanying fix in place, this test would have failed with: @@ -373,7 +373,7 @@ CPPUNIT_TEST_FIXTURE(Test, testReferToThemeShapeFill) // - Actual : 0 // i.e. the <a:schemeClr> element was not written. 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(aTempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDoc, "//p:sp[1]/p:spPr/a:solidFill/a:schemeClr", "val", "accent1"); // Without the accompanying fix in place, this test would have failed with: // - XPath '//p:sp[1]/p:spPr/a:solidFill/a:schemeClr/a:lumMod' number of nodes is incorrect @@ -388,9 +388,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf146690_endParagraphRunPropertiesNewLinesTextSi loadFromURL(u"endParaRPr-newline-textsize.pptx"); // When saving that document: - utl::TempFileNamed aTempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); // Make sure the text size is exported correctly: // Without the accompanying fix in place, this test would have failed with: // - Expected: 500 @@ -407,9 +407,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf147978_endsubpath) loadFromURL(u"tdf147978_endsubpath.odp"); // When saving that document: - utl::TempFileNamed aTempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); // 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", 2); @@ -424,9 +424,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf147978_commandA) loadFromURL(u"tdf147978_enhancedPath_commandA.odp"); // When saving that document: - utl::TempFileNamed aTempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); // 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 @@ -445,10 +445,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf147978_commandT) loadFromURL(u"tdf147978_enhancedPath_commandT.odp"); // Export to pptx had only exported the command M and has used a wrong path size - utl::TempFileNamed aTempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // Verify the markup: - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); // File has draw:viewBox="0 0 216 216" assertXPath(pXmlDoc, "//a:pathLst/a:path", "w", "216"); assertXPath(pXmlDoc, "//a:pathLst/a:path", "h", "216"); @@ -474,10 +474,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf147978_commandXY) loadFromURL(u"tdf147978_enhancedPath_commandXY.odp"); // Export to pptx had dropped commands X and Y. - utl::TempFileNamed aTempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // Verify the markup: - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); // File has draw:viewBox="0 0 10 10" assertXPath(pXmlDoc, "//a:pathLst/a:path[1]", "w", "10"); assertXPath(pXmlDoc, "//a:pathLst/a:path[1]", "h", "10"); @@ -508,10 +508,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf147978_commandHIJK) loadFromURL(u"tdf147978_enhancedPath_commandHIJK.odp"); // Export to pptx had dropped commands X and Y. - utl::TempFileNamed aTempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // Verify the markup: - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); // File has draw:viewBox="0 0 80 80" assertXPath(pXmlDoc, "//a:pathLst/a:path[1]", "w", "80"); assertXPath(pXmlDoc, "//a:pathLst/a:path[1]", "h", "80"); @@ -530,10 +530,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf147978_subpath) loadFromURL(u"tdf147978_enhancedPath_subpath.pptx"); // Export to pptx had dropped the subpaths. - utl::TempFileNamed aTempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // Verify the markup: - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); // File should have four subpaths with increasing path size assertXPath(pXmlDoc, "//a:pathLst/a:path[1]", "w", "10"); assertXPath(pXmlDoc, "//a:pathLst/a:path[1]", "h", "10"); @@ -550,10 +550,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf100391TextAreaRect) // The document has a custom shape of type "non-primitive" to trigger the custGeom export loadFromURL(u"tdf100391_TextAreaRect.odp"); // When saving to PPTX the textarea rect was set to default instead of using the actual area - utl::TempFileNamed aTempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // Verify the markup. Without fix the values were l="l", t="t", r="r", b="b" - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDoc, "//a:custGeom/a:rect", "l", "textAreaLeft"); assertXPath(pXmlDoc, "//a:custGeom/a:rect", "t", "textAreaTop"); assertXPath(pXmlDoc, "//a:custGeom/a:rect", "r", "textAreaRight"); @@ -575,10 +575,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf109169_OctagonBevel) skipValidation(); // Export to docx had not written a:fill or a:stroke attributes at all. - utl::TempFileNamed aTempFile = save("Office Open XML Text"); + save("Office Open XML Text"); // Verify the markup: - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "word/document.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // File should have six subpaths, one with stroke and five with fill assertXPath(pXmlDoc, "//a:pathLst/a:path[1]", "stroke", "0"); assertXPath(pXmlDoc, "//a:pathLst/a:path[2]", "fill", "darkenLess"); @@ -596,10 +596,10 @@ CPPUNIT_TEST_FIXTURE(Test, testFaultyPathCommandsAWT) // instead of the normally used lnTo. If a lnTo is written, MS Office shows nothing of the shape. loadFromURL(u"FaultyPathStart.odp"); - utl::TempFileNamed aTempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // Verify the markup: - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); // 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"); assertXPath(pXmlDoc, "//p:spTree/p:sp[2]/p:spPr/a:custGeom/a:pathLst/a:path/a:moveTo"); @@ -614,10 +614,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. loadFromURL(u"tdf148784_StretchXY.odp"); - utl::TempFileNamed aTempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // Verify the markup. - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); // x-position of last segment should be same as path width. It was 21600 without fix. sal_Int32 nWidth @@ -650,10 +650,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. loadFromURL(u"tdf148784_StretchCommandQ.odp"); - utl::TempFileNamed aTempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // Verify the markup. - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); // x-position of second quadBezTo control should be same as path width. It was 21600 without fix. sal_Int32 nWidth @@ -689,10 +689,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. loadFromURL(u"tdf148784_StretchCommandVW.odp"); - utl::TempFileNamed aTempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // Verify the markup. - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); // wR of first ArcTo in first shape should be same as path width/2. It was 10800 without fix. sal_Int32 nHalfWidth @@ -723,10 +723,10 @@ 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. loadFromURL(u"tdf149551_vert_and_padding.pptx"); - utl::TempFileNamed aTempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // Verify the markup. The values must be the same as in the original file. - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); for (sal_Int32 i = 1; i <= 2; i++) { OString sElement = "//p:spTree/p:sp[" + OString::number(i) + "]/p:txBody/a:bodyPr"; @@ -745,10 +745,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149538upright) // attribute but no 'rot' attribute. Without the fix the 'rot' attribute with values from // the emulation was written out. loadFromURL(u"tdf149538_upright.pptx"); - utl::TempFileNamed aTempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // Verify the markup. The values must be the same as in the original file. - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDoc, "//p:spTree/p:sp/p:txBody/a:bodyPr", "upright", "1"); assertXPathNoAttribute(pXmlDoc, "//p:spTree/p:sp/p:txBody/a:bodyPr", "rot"); } @@ -756,8 +756,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149538upright) CPPUNIT_TEST_FIXTURE(Test, testTdf151008VertAnchor) { loadFromURL(u"tdf151008_eaVertAnchor.pptx"); - utl::TempFileNamed aTempFile = save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "ppt/slides/slide1.xml"); + save("Impress Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); // 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. diff --git a/sc/CppunitTest_sc_functionlistobj.mk b/sc/CppunitTest_sc_functionlistobj.mk index 5e00fae0d2e2..b09aac6e2a11 100644 --- a/sc/CppunitTest_sc_functionlistobj.mk +++ b/sc/CppunitTest_sc_functionlistobj.mk @@ -25,6 +25,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sc_functionlistobj, \ subsequenttest \ test \ unotest \ + utl \ )) $(eval $(call gb_CppunitTest_set_include,sc_functionlistobj,\ diff --git a/sc/qa/extras/htmlexporttest.cxx b/sc/qa/extras/htmlexporttest.cxx index f7dc9c115f74..f65e027ae62e 100644 --- a/sc/qa/extras/htmlexporttest.cxx +++ b/sc/qa/extras/htmlexporttest.cxx @@ -34,17 +34,17 @@ public: void testHtmlSkipImage() { loadFromURL(u"BaseForHTMLExport.ods"); - utl::TempFileNamed aTempFile = save("HTML (StarCalc)"); - htmlDocUniquePtr pDoc = parseHtml(aTempFile); + save("HTML (StarCalc)"); + htmlDocUniquePtr pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT (pDoc); assertXPath(pDoc, "/html/body", 1); assertXPath(pDoc, "/html/body/table/tr/td/img", 1); setFilterOptions("SkipImages"); - utl::TempFileNamed aTempFile2 = save("HTML (StarCalc)"); + save("HTML (StarCalc)"); - pDoc = parseHtml(aTempFile2); + pDoc = parseHtml(maTempFile); CPPUNIT_ASSERT (pDoc); assertXPath(pDoc, "/html/body", 1); assertXPath(pDoc, "/html/body/table/tr/td/img", 0); diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx index 6c9d179db336..f53389f40459 100644 --- a/sc/qa/extras/macros-test.cxx +++ b/sc/qa/extras/macros-test.cxx @@ -228,10 +228,10 @@ void ScMacrosTest::testMacroButtonFormControlXlsxExport() loadFromURL(u"macro-button-form-control.xlsm"); // When exporting to XLSM: - utl::TempFileNamed tempFile = save("Calc MS Excel 2007 VBA XML"); + save("Calc MS Excel 2007 VBA XML"); // Then make sure that the macro is associated with the control: - xmlDocUniquePtr pSheetDoc = parseExport(tempFile.GetURL(), "xl/worksheets/sheet1.xml"); + xmlDocUniquePtr pSheetDoc = parseExport("xl/worksheets/sheet1.xml"); CPPUNIT_ASSERT(pSheetDoc); // Without the fix in place, this test would have failed with: // - XPath '//x:controlPr' no attribute 'macro' exist @@ -240,7 +240,7 @@ void ScMacrosTest::testMacroButtonFormControlXlsxExport() // Then also make sure that there is no defined name for the macro, which is only needed for // XLS: - xmlDocUniquePtr pWorkbookDoc = parseExport(tempFile.GetURL(), "xl/workbook.xml"); + xmlDocUniquePtr pWorkbookDoc = parseExport("xl/workbook.xml"); CPPUNIT_ASSERT(pWorkbookDoc); assertXPath(pWorkbookDoc, "//x:workbook/definedNames", 0); } diff --git a/sc/qa/unit/SparklineImportExportTest.cxx b/sc/qa/unit/SparklineImportExportTest.cxx index e659a5af217a..993303e00a4e 100644 --- a/sc/qa/unit/SparklineImportExportTest.cxx +++ b/sc/qa/unit/SparklineImportExportTest.cxx @@ -167,8 +167,8 @@ void SparklineImportExportTest::testSparklinesExportODS() loadFromURL(u"xlsx/Sparklines.xlsx"); // Save as ODS and check content.xml with XPath - utl::TempFileNamed tempFile = save("calc8"); - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "content.xml"); + save("calc8"); + xmlDocUniquePtr pXmlDoc = parseExport("content.xml"); // We have 3 sparkline groups = 3 tables that contain sparklines assertXPath(pXmlDoc, "//table:table/calcext:sparkline-groups", 3); @@ -233,8 +233,8 @@ void SparklineImportExportTest::testNoSparklinesInDocumentXLSX() // Load the document containing NO sparklines loadFromURL(u"xlsx/empty.xlsx"); - utl::TempFileNamed tempFile = save("Calc Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "xl/worksheets/sheet1.xml"); + save("Calc Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/worksheets/sheet1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/x:worksheet", 1); diff --git a/sc/qa/unit/jumbosheets-test.cxx b/sc/qa/unit/jumbosheets-test.cxx index d6470f3ebe1d..05b2c2248650 100644 --- a/sc/qa/unit/jumbosheets-test.cxx +++ b/sc/qa/unit/jumbosheets-test.cxx @@ -129,7 +129,7 @@ void ScJumboSheetsTest::testRoundtripColumnRangeOds() CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C:C)"), pDoc->GetFormula(1, 0, 0)); } - utl::TempFileNamed tempFile = saveAndReload("calc8"); + saveAndReload("calc8"); { ScModelObj* pModelObj = dynamic_cast<ScModelObj*>(mxComponent.get()); CPPUNIT_ASSERT(pModelObj); @@ -137,7 +137,7 @@ void ScJumboSheetsTest::testRoundtripColumnRangeOds() ScDocument* pDoc = pModelObj->GetDocument(); CPPUNIT_ASSERT_EQUAL(OUString("=SUM(2:2)"), pDoc->GetFormula(0, 0, 0)); CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C:C)"), pDoc->GetFormula(1, 0, 0)); - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "content.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("content.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/office:document-content/office:body/office:spreadsheet/table:table/" @@ -153,7 +153,7 @@ void ScJumboSheetsTest::testRoundtripColumnRangeOds() void ScJumboSheetsTest::testRoundtripColumnRangeXlsx() { loadFromURL(u"ods/sum-whole-column-row.ods"); - utl::TempFileNamed tempFile = saveAndReload("Calc Office Open XML"); + saveAndReload("Calc Office Open XML"); { ScModelObj* pModelObj = dynamic_cast<ScModelObj*>(mxComponent.get()); CPPUNIT_ASSERT(pModelObj); @@ -161,7 +161,7 @@ void ScJumboSheetsTest::testRoundtripColumnRangeXlsx() ScDocument* pDoc = pModelObj->GetDocument(); CPPUNIT_ASSERT_EQUAL(OUString("=SUM(2:2)"), pDoc->GetFormula(0, 0, 0)); CPPUNIT_ASSERT_EQUAL(OUString("=SUM(C:C)"), pDoc->GetFormula(1, 0, 0)); - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "xl/worksheets/sheet1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/worksheets/sheet1.xml"); CPPUNIT_ASSERT(pXmlDoc); assertXPathContent(pXmlDoc, "/x:worksheet/x:sheetData/x:row[1]/x:c[1]/x:f", "SUM(2:2)"); assertXPathContent(pXmlDoc, "/x:worksheet/x:sheetData/x:row[1]/x:c[2]/x:f", "SUM(C:C)"); diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index 052a3a2922d6..3dd1d13c4b69 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -204,7 +204,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testExternalReferences) insertStringToCell(*pModelObj, "D3", u"FISHY"); // Save the document - utl::TempFileNamed aTempFile = saveAndClose("calc8"); + saveAndClose("calc8"); // Open a new document mxComponent = loadFromDesktop("private:factory/scalc"); @@ -216,8 +216,8 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testExternalReferences) // Insert the references to the external document { // tdf#115162 - OUString aFormula = "=SUMIFS('" + aTempFile.GetURL() + "'#$Sheet1.C1:C3,'" - + aTempFile.GetURL() + "'#$Sheet1.B1:B3,1,'" + aTempFile.GetURL() + OUString aFormula = "=SUMIFS('" + maTempFile.GetURL() + "'#$Sheet1.C1:C3,'" + + maTempFile.GetURL() + "'#$Sheet1.B1:B3,1,'" + maTempFile.GetURL() + "'#$Sheet1.A1:A3,2015)"; insertStringToCell(*pModelObj, "A1", aFormula); @@ -229,8 +229,8 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testExternalReferences) { // tdf#114820 - OUString aFormula = "=VLOOKUP('" + aTempFile.GetURL() + "'#$Sheet1.A1;'" - + aTempFile.GetURL() + "'#$Sheet1.A1:B3,2,0)"; + OUString aFormula = "=VLOOKUP('" + maTempFile.GetURL() + "'#$Sheet1.A1;'" + + maTempFile.GetURL() + "'#$Sheet1.A1:B3,2,0)"; insertStringToCell(*pModelObj, "A1", aFormula); // Without the fix in place, this test would have failed with @@ -241,7 +241,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testExternalReferences) { // tdf#116149 - OUString aFormula = "=VAR('" + aTempFile.GetURL() + "'#$Sheet1.C1;'" + aTempFile.GetURL() + OUString aFormula = "=VAR('" + maTempFile.GetURL() + "'#$Sheet1.C1;'" + maTempFile.GetURL() + "'#$Sheet1.C2)"; insertStringToCell(*pModelObj, "A1", aFormula); @@ -254,13 +254,13 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testExternalReferences) { // tdf#100847 // Use an empty cell - OUString aFormula = "=+'" + aTempFile.GetURL() + "'#$Sheet1.A1000"; + OUString aFormula = "=+'" + maTempFile.GetURL() + "'#$Sheet1.A1000"; insertStringToCell(*pModelObj, "A1", aFormula); - aFormula = "=+'" + aTempFile.GetURL() + "'#$Sheet1.A1000*1"; + aFormula = "=+'" + maTempFile.GetURL() + "'#$Sheet1.A1000*1"; insertStringToCell(*pModelObj, "B1", aFormula); - aFormula = "=+N('" + aTempFile.GetURL() + "'#$Sheet1.A1000)*1"; + aFormula = "=+N('" + maTempFile.GetURL() + "'#$Sheet1.A1000)*1"; insertStringToCell(*pModelObj, "C1", aFormula); CPPUNIT_ASSERT_EQUAL(OUString("0"), pDoc->GetString(ScAddress(0, 0, 0))); @@ -274,10 +274,10 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testExternalReferences) { //tdf#36387 - OUString aAndFormula = "=AND('" + aTempFile.GetURL() + "'#$Sheet1.A1:C1)"; + OUString aAndFormula = "=AND('" + maTempFile.GetURL() + "'#$Sheet1.A1:C1)"; insertStringToCell(*pModelObj, "A1", aAndFormula); - OUString aOrFormula = "=OR('" + aTempFile.GetURL() + "'#$Sheet1.A1:C1)"; + OUString aOrFormula = "=OR('" + maTempFile.GetURL() + "'#$Sheet1.A1:C1)"; insertStringToCell(*pModelObj, "B1", aOrFormula); // Without the fix in place, this test would have failed with @@ -289,7 +289,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testExternalReferences) { //tdf#113898 - OUString aAndFormula = "=SUMPRODUCT(NOT(ISERROR(FIND(\"FISH\";'" + aTempFile.GetURL() + OUString aAndFormula = "=SUMPRODUCT(NOT(ISERROR(FIND(\"FISH\";'" + maTempFile.GetURL() + "'#$Sheet1.D1:D3))))"; insertStringToCell(*pModelObj, "A1", aAndFormula); @@ -310,7 +310,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf103994) insertStringToCell(*pModelObj, "B1", u"2"); // Save the document - utl::TempFileNamed aTempFile = saveAndClose("calc8"); + saveAndClose("calc8"); // Open a new document mxComponent = loadFromDesktop("private:factory/scalc"); @@ -320,7 +320,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf103994) CPPUNIT_ASSERT(pDoc); // Insert the reference to the external document - OUString aFormula = "='" + aTempFile.GetURL() + "'#$Sheet1.A1"; + OUString aFormula = "='" + maTempFile.GetURL() + "'#$Sheet1.A1"; insertStringToCell(*pModelObj, "A1", aFormula); CPPUNIT_ASSERT_EQUAL(aFormula, pDoc->GetFormula(0, 0, 0)); @@ -352,7 +352,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf113541) insertStringToCell(*pModelObj, "A1", u"50"); // Save the document - utl::TempFileNamed aTempFile = saveAndClose("calc8"); + saveAndClose("calc8"); // Open a new document mxComponent = loadFromDesktop("private:factory/scalc"); @@ -365,7 +365,7 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf113541) pDoc->SetGrammar(formula::FormulaGrammar::GRAM_ENGLISH_XL_A1); // Insert the reference to the external document - OUString aFormula = "=['" + aTempFile.GetURL() + "']Sheet1!A1"; + OUString aFormula = "=['" + maTempFile.GetURL() + "']Sheet1!A1"; insertStringToCell(*pModelObj, "A1", aFormula); // Without the fix in place, this test would have failed with diff --git a/sd/qa/filter/eppt/eppt.cxx b/sd/qa/filter/eppt/eppt.cxx index a47edcf5f1c4..bc90509618dd 100644 --- a/sd/qa/filter/eppt/eppt.cxx +++ b/sd/qa/filter/eppt/eppt.cxx @@ -79,10 +79,10 @@ CPPUNIT_TEST_FIXTURE(Test, testThemeExport) xMasterPage->setPropertyValue("Theme", aTheme); // When exporting to PPTX: - utl::TempFileNamed aTempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // Then verify that this color is not lost: - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "ppt/theme/theme1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/theme/theme1.xml"); assertXPath(pXmlDoc, "//a:clrScheme/a:lt1/a:srgbClr", "val", "000002"); // Without the fix in place, this test would have failed with: // - Expected: 1 @@ -97,10 +97,10 @@ CPPUNIT_TEST_FIXTURE(Test, testLoopingFromAnimation) loadFromURL(u"video-loop.pptx"); // When exporting that to PPTX: - utl::TempFileNamed aTempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // Then make sure that the "infinite" repeat count is written: - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); // Without the fix in place, this test would have failed with: // - Expected: 1 // - Actual : 0 diff --git a/sd/qa/unit/HtmlExportTest.cxx b/sd/qa/unit/HtmlExportTest.cxx index 9a680bdba1c9..812757bc1761 100644 --- a/sd/qa/unit/HtmlExportTest.cxx +++ b/sd/qa/unit/HtmlExportTest.cxx @@ -23,8 +23,8 @@ public: void testHTMLExport() { loadFromURL(u"HtmlExportTestDocument.odp"); - utl::TempFileNamed aTempFile = save("impress_html_Export"); - htmlDocUniquePtr htmlDoc = parseHtml(aTempFile); + save("impress_html_Export"); + htmlDocUniquePtr htmlDoc = parseHtml(maTempFile); assertXPath(htmlDoc, "/html", 1); assertXPath(htmlDoc, "/html/body", 1); diff --git a/sd/qa/unit/PNGExportTests.cxx b/sd/qa/unit/PNGExportTests.cxx index 857548869fb0..2c77bd9bbfed 100644 --- a/sd/qa/unit/PNGExportTests.cxx +++ b/sd/qa/unit/PNGExportTests.cxx @@ -48,11 +48,8 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf105998) uno::Reference<drawing::XGraphicExportFilter> xGraphicExporter = drawing::GraphicExportFilter::create(xContext); - utl::TempFileNamed aTempFile; - aTempFile.EnableKillingFile(); - uno::Sequence<beans::PropertyValue> aDescriptor{ - comphelper::makePropertyValue("URL", aTempFile.GetURL()), + comphelper::makePropertyValue("URL", maTempFile.GetURL()), comphelper::makePropertyValue("FilterName", OUString("PNG")) }; @@ -63,7 +60,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf105998) xGraphicExporter->setSourceDocument(xShape); xGraphicExporter->filter(aDescriptor); - SvFileStream aFileStream(aTempFile.GetURL(), StreamMode::READ); + SvFileStream aFileStream(maTempFile.GetURL(), StreamMode::READ); vcl::PngImageReader aPNGReader(aFileStream); BitmapEx aBMPEx = aPNGReader.read(); @@ -112,11 +109,8 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf126319) uno::Reference<drawing::XGraphicExportFilter> xGraphicExporter = drawing::GraphicExportFilter::create(xContext); - utl::TempFileNamed aTempFile; - aTempFile.EnableKillingFile(); - uno::Sequence<beans::PropertyValue> aDescriptor{ - comphelper::makePropertyValue("URL", aTempFile.GetURL()), + comphelper::makePropertyValue("URL", maTempFile.GetURL()), comphelper::makePropertyValue("FilterName", OUString("PNG")) }; @@ -127,7 +121,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf126319) xGraphicExporter->setSourceDocument(xShape); xGraphicExporter->filter(aDescriptor); - SvFileStream aFileStream(aTempFile.GetURL(), StreamMode::READ); + SvFileStream aFileStream(maTempFile.GetURL(), StreamMode::READ); vcl::PngImageReader aPNGReader(aFileStream); BitmapEx aBMPEx = aPNGReader.read(); @@ -185,11 +179,8 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf136632) uno::Sequence<beans::PropertyValue> aFilterData{ comphelper::makePropertyValue("Translucent", sal_Int32(0)) }; - utl::TempFileNamed aTempFile; - aTempFile.EnableKillingFile(); - uno::Sequence<beans::PropertyValue> aDescriptor{ - comphelper::makePropertyValue("URL", aTempFile.GetURL()), + comphelper::makePropertyValue("URL", maTempFile.GetURL()), comphelper::makePropertyValue("FilterName", OUString("PNG")), comphelper::makePropertyValue("FilterData", aFilterData) }; @@ -201,7 +192,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf136632) xGraphicExporter->setSourceDocument(xShape); xGraphicExporter->filter(aDescriptor); - SvFileStream aFileStream(aTempFile.GetURL(), StreamMode::READ); + SvFileStream aFileStream(maTempFile.GetURL(), StreamMode::READ); vcl::PngImageReader aPNGReader(aFileStream); BitmapEx aBMPEx = aPNGReader.read(); AlphaMask aAlpha = aBMPEx.GetAlpha(); @@ -224,11 +215,8 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf113163) comphelper::makePropertyValue("PixelHeight", sal_Int32(100)) }; - utl::TempFileNamed aTempFile; - aTempFile.EnableKillingFile(); - uno::Sequence<beans::PropertyValue> aDescriptor{ - comphelper::makePropertyValue("URL", aTempFile.GetURL()), + comphelper::makePropertyValue("URL", maTempFile.GetURL()), comphelper::makePropertyValue("FilterName", OUString("PNG")), comphelper::makePropertyValue("FilterData", aFilterData) }; @@ -239,7 +227,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf113163) xGraphicExporter->setSourceDocument(xPage); xGraphicExporter->filter(aDescriptor); - SvFileStream aFileStream(aTempFile.GetURL(), StreamMode::READ); + SvFileStream aFileStream(maTempFile.GetURL(), StreamMode::READ); vcl::PngImageReader aPNGReader(aFileStream); BitmapEx aBMPEx = aPNGReader.read(); @@ -278,11 +266,8 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf147119) comphelper::makePropertyValue("Translucent", sal_Int32(1)), }; - utl::TempFileNamed aTempFile; - aTempFile.EnableKillingFile(); - uno::Sequence<beans::PropertyValue> aDescriptor{ - comphelper::makePropertyValue("URL", aTempFile.GetURL()), + comphelper::makePropertyValue("URL", maTempFile.GetURL()), comphelper::makePropertyValue("FilterName", OUString("PNG")), comphelper::makePropertyValue("FilterData", aFilterData) }; @@ -293,7 +278,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf147119) xGraphicExporter->setSourceDocument(xPage); xGraphicExporter->filter(aDescriptor); - SvFileStream aFileStream(aTempFile.GetURL(), StreamMode::READ); + SvFileStream aFileStream(maTempFile.GetURL(), StreamMode::READ); vcl::PngImageReader aPNGReader(aFileStream); BitmapEx aBMPEx = aPNGReader.read(); @@ -329,11 +314,8 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf113197) comphelper::makePropertyValue("PixelHeight", sal_Int32(100)), }; - utl::TempFileNamed aTempFile; - aTempFile.EnableKillingFile(); - uno::Sequence<beans::PropertyValue> aDescriptor{ - comphelper::makePropertyValue("URL", aTempFile.GetURL()), + comphelper::makePropertyValue("URL", maTempFile.GetURL()), comphelper::makePropertyValue("FilterName", OUString("PNG")), comphelper::makePropertyValue("FilterData", aFilterData) }; @@ -344,7 +326,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf113197) xGraphicExporter->setSourceDocument(xPage); xGraphicExporter->filter(aDescriptor); - SvFileStream aFileStream(aTempFile.GetURL(), StreamMode::READ); + SvFileStream aFileStream(maTempFile.GetURL(), StreamMode::READ); vcl::PngImageReader aPNGReader(aFileStream); BitmapEx aBMPEx = aPNGReader.read(); @@ -383,11 +365,8 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf93124) comphelper::makePropertyValue("PixelHeight", sal_Int32(180)) }; - utl::TempFileNamed aTempFile; - aTempFile.EnableKillingFile(); - uno::Sequence<beans::PropertyValue> aDescriptor{ - comphelper::makePropertyValue("URL", aTempFile.GetURL()), + comphelper::makePropertyValue("URL", maTempFile.GetURL()), comphelper::makePropertyValue("FilterName", OUString("PNG")), comphelper::makePropertyValue("FilterData", aFilterData) }; @@ -398,7 +377,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf93124) xGraphicExporter->setSourceDocument(xPage); xGraphicExporter->filter(aDescriptor); - SvFileStream aFileStream(aTempFile.GetURL(), StreamMode::READ); + SvFileStream aFileStream(maTempFile.GetURL(), StreamMode::READ); vcl::PngImageReader aPNGReader(aFileStream); BitmapEx aBMPEx = aPNGReader.read(); @@ -444,11 +423,8 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf99729) comphelper::makePropertyValue("PixelHeight", sal_Int32(240)) }; - utl::TempFileNamed aTempFile; - aTempFile.EnableKillingFile(); - uno::Sequence<beans::PropertyValue> aDescriptor{ - comphelper::makePropertyValue("URL", aTempFile.GetURL()), + comphelper::makePropertyValue("URL", maTempFile.GetURL()), comphelper::makePropertyValue("FilterName", OUString("PNG")), comphelper::makePropertyValue("FilterData", aFilterData) }; @@ -460,7 +436,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf99729) xGraphicExporter->setSourceDocument(xPage); xGraphicExporter->filter(aDescriptor); - SvFileStream aFileStream(aTempFile.GetURL(), StreamMode::READ); + SvFileStream aFileStream(maTempFile.GetURL(), StreamMode::READ); vcl::PngImageReader aPNGReader(aFileStream); BitmapEx aBMPEx = aPNGReader.read(); Bitmap aBMP = aBMPEx.GetBitmap(); diff --git a/sd/qa/unit/SVGExportTests.cxx b/sd/qa/unit/SVGExportTests.cxx index 1f973645142a..220d1eb0f5f9 100644 --- a/sd/qa/unit/SVGExportTests.cxx +++ b/sd/qa/unit/SVGExportTests.cxx @@ -104,12 +104,12 @@ public: void testSVGExportTextDecorations() { loadFromURL(u"svg-export-text-decorations.odp"); - utl::TempFileNamed aTempFile = save("impress_svg_Export"); + save("impress_svg_Export"); - xmlDocUniquePtr svgDoc = parseXml(aTempFile); + xmlDocUniquePtr svgDoc = parseXml(maTempFile); CPPUNIT_ASSERT(svgDoc); - svgDoc->name = reinterpret_cast<char *>(xmlStrdup(reinterpret_cast<xmlChar const *>(OUStringToOString(aTempFile.GetURL(), RTL_TEXTENCODING_UTF8).getStr()))); + svgDoc->name = reinterpret_cast<char *>(xmlStrdup(reinterpret_cast<xmlChar const *>(OUStringToOString(maTempFile.GetURL(), RTL_TEXTENCODING_UTF8).getStr()))); assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG ), 1); assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2] ), "class", "SlideGroup"); @@ -127,9 +127,9 @@ public: void testSVGExportJavascriptURL() { loadFromURL(u"textbox-link-javascript.odp"); - utl::TempFileNamed aTempFile = save("impress_svg_Export"); + save("impress_svg_Export"); - xmlDocUniquePtr svgDoc = parseXml(aTempFile); + xmlDocUniquePtr svgDoc = parseXml(maTempFile); CPPUNIT_ASSERT(svgDoc); // There should be only one child (no link to javascript url) @@ -142,9 +142,9 @@ public: void testSVGExportSlideCustomBackground() { loadFromURL(u"slide-custom-background.odp"); - utl::TempFileNamed aTempFile = save("impress_svg_Export"); + save("impress_svg_Export"); - xmlDocUniquePtr svgDoc = parseXml(aTempFile); + xmlDocUniquePtr svgDoc = parseXml(maTempFile); CPPUNIT_ASSERT(svgDoc); assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_DEFS ), "class", "SlideBackground"); @@ -153,9 +153,9 @@ public: void testSVGExportTextFieldsInMasterPage() { loadFromURL(u"text-fields.odp"); - utl::TempFileNamed aTempFile = save("impress_svg_Export"); + save("impress_svg_Export"); - xmlDocUniquePtr svgDoc = parseXml(aTempFile); + xmlDocUniquePtr svgDoc = parseXml(maTempFile); CPPUNIT_ASSERT(svgDoc); assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2] ), "class", "Master_Slide"); @@ -181,9 +181,9 @@ public: void testSVGExportEmbeddedVideo() { loadFromURL(u"slide-video-thumbnail.odp"); - utl::TempFileNamed aTempFile = save("impress_svg_Export"); + save("impress_svg_Export"); - xmlDocUniquePtr svgDoc = parseXml(aTempFile); + xmlDocUniquePtr svgDoc = parseXml(maTempFile); CPPUNIT_ASSERT(svgDoc); assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG ), 1); @@ -212,9 +212,9 @@ public: void testSVGExportSlideBitmapBackground() { loadFromURL(u"slide-bitmap-background.odp"); - utl::TempFileNamed aTempFile = save("impress_svg_Export"); + save("impress_svg_Export"); - xmlDocUniquePtr svgDoc = parseXml(aTempFile); + xmlDocUniquePtr svgDoc = parseXml(maTempFile); CPPUNIT_ASSERT(svgDoc); assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9] ), "class", "BackgroundBitmaps"); @@ -241,9 +241,9 @@ public: void testSVGExportSlideTileBitmapBackground() { loadFromURL(u"slide-tile-background.odp"); - utl::TempFileNamed aTempFile = save("impress_svg_Export"); + save("impress_svg_Export"); - xmlDocUniquePtr svgDoc = parseXml(aTempFile); + xmlDocUniquePtr svgDoc = parseXml(maTempFile); CPPUNIT_ASSERT(svgDoc); // check the bitmap @@ -306,9 +306,9 @@ public: Application::SetSettings(aSettings); loadFromURL(u"text-fields.odp"); - utl::TempFileNamed aTempFile = save("impress_svg_Export"); + save("impress_svg_Export"); - xmlDocUniquePtr svgDoc = parseXml(aTempFile); + xmlDocUniquePtr svgDoc = parseXml(maTempFile); CPPUNIT_ASSERT(svgDoc); assertXPath(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2] ), "class", "Master_Slide"); diff --git a/sd/qa/unit/SdrPdfImportTest.cxx b/sd/qa/unit/SdrPdfImportTest.cxx index 372ccf13f534..4f45d5f300f3 100644 --- a/sd/qa/unit/SdrPdfImportTest.cxx +++ b/sd/qa/unit/SdrPdfImportTest.cxx @@ -213,19 +213,16 @@ CPPUNIT_TEST_FIXTURE(SdrPdfImportTest, testAnnotationsImportExport) } { // save as PDF and check annotations - utl::TempFileNamed aTempFile; - aTempFile.EnableKillingFile(); - uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); uno::Sequence<beans::PropertyValue> aFilterData( comphelper::InitPropertySequence({ { "ExportBookmarks", uno::Any(true) } })); aMediaDescriptor["FilterData"] <<= aFilterData; - xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); + xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); mxComponent->dispose(); - SvFileStream aFile(aTempFile.GetURL(), StreamMode::READ); + SvFileStream aFile(maTempFile.GetURL(), StreamMode::READ); SvMemoryStream aMemory; aMemory.WriteStream(aFile); @@ -249,7 +246,7 @@ CPPUNIT_TEST_FIXTURE(SdrPdfImportTest, testAnnotationsImportExport) pPDFAnnotation2->getSubType()); // Pop-up annotation // Load document again - mxComponent = loadFromDesktop(aTempFile.GetURL()); + mxComponent = loadFromDesktop(maTempFile.GetURL()); auto pNewImpressDocument = dynamic_cast<SdXImpressDocument*>(mxComponent.get()); sd::ViewShell* pNewViewShell = pNewImpressDocument->GetDocShell()->GetViewShell(); CPPUNIT_ASSERT(pNewViewShell); diff --git a/sd/qa/unit/ShapeImportExportTest.cxx b/sd/qa/unit/ShapeImportExportTest.cxx index 7210eb82496c..fa18a184f384 100644 --- a/sd/qa/unit/ShapeImportExportTest.cxx +++ b/sd/qa/unit/ShapeImportExportTest.cxx @@ -262,8 +262,8 @@ void ShapeImportExportTest::testTextDistancesOOXML_Export() { loadFromURL(u"TextDistancesInsets3.pptx"); - utl::TempFileNamed aTempFile = save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "ppt/slides/slide1.xml"); + save("Impress Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); CPPUNIT_ASSERT(pXmlDoc); //Check shape Top/Bottom - 0cm, 4cm @@ -374,8 +374,8 @@ void ShapeImportExportTest::testTextDistancesOOXML_Export() void ShapeImportExportTest::testTextDistancesODP_OOXML_Export() { loadFromURL(u"odp/tdf150966_hugeInset.odp"); - utl::TempFileNamed aTempFile = save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "ppt/slides/slide1.xml"); + save("Impress Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); CPPUNIT_ASSERT(pXmlDoc); // The text ends 5cm below the top edge of the shape. diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx index 937a59e58347..97d2b80902c8 100644 --- a/sd/qa/unit/export-tests-ooxml1.cxx +++ b/sd/qa/unit/export-tests-ooxml1.cxx @@ -228,9 +228,9 @@ void checkFontAttributes(const SdrTextObj* pObj, ItemValue nVal, sal_uInt32 nId) void SdOOXMLExportTest1::testTdf149311() { loadFromURL(u"odp/tdf149311.odp"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pRelsDoc = parseExport(tempFile.GetURL(), "ppt/slides/_rels/slide1.xml.rels"); + xmlDocUniquePtr pRelsDoc = parseExport("ppt/slides/_rels/slide1.xml.rels"); assertXPath(pRelsDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target", "slide2.xml"); @@ -239,9 +239,9 @@ void SdOOXMLExportTest1::testTdf149311() void SdOOXMLExportTest1::testTdf149128() { loadFromURL(u"odp/tdf149128.odp"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", "id", "42"); assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", "idx", @@ -255,9 +255,9 @@ void SdOOXMLExportTest1::testTdf149128() void SdOOXMLExportTest1::testTdf66228() { loadFromURL(u"odp/tdf66228.odp"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:spPr/a:prstGeom", "prst", "bentConnector3"); } @@ -265,9 +265,9 @@ void SdOOXMLExportTest1::testTdf66228() void SdOOXMLExportTest1::testTdf147919() { loadFromURL(u"odp/tdf147919.odp"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp[1]/p:spPr/a:prstGeom", "prst", "bentConnector2"); @@ -334,22 +334,22 @@ void SdOOXMLExportTest1::testTdf147919() void SdOOXMLExportTest1::testTdf130165() { loadFromURL(u"pptx/tdf146223.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDoc, "/p:sld", "showMasterSp", "0"); } void SdOOXMLExportTest1::testTdf124781() { loadFromURL(u"odp/tdf124781.odp"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc1 = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc1 = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p[1]/a:r[2]/a:rPr", "baseline", "33000"); - xmlDocUniquePtr pXmlDoc2 = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc2 = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDoc2, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p[2]/a:r[2]/a:rPr", "baseline", "-8000"); } @@ -357,39 +357,39 @@ void SdOOXMLExportTest1::testTdf124781() void SdOOXMLExportTest1::testTdf144914() { loadFromURL(u"pptx/tdf144616.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc1 = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc1 = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:nvSpPr/p:cNvPr/a:hlinkClick", "action", "ppaction://hlinkshowjump?jump=firstslide"); - xmlDocUniquePtr pXmlDoc2 = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc2 = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDoc2, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:nvSpPr/p:cNvPr/a:hlinkClick", "action", "ppaction://hlinkshowjump?jump=lastslide"); - xmlDocUniquePtr pXmlDoc3 = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc3 = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDoc3, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:nvSpPr/p:cNvPr/a:hlinkClick", "action", "ppaction://hlinkshowjump?jump=nextslide"); - xmlDocUniquePtr pXmlDoc4 = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc4 = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDoc4, "/p:sld/p:cSld/p:spTree/p:sp[4]/p:nvSpPr/p:cNvPr/a:hlinkClick", "action", "ppaction://hlinkshowjump?jump=previousslide"); - xmlDocUniquePtr pXmlDoc5 = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc5 = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDoc5, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:nvSpPr/p:cNvPr/a:hlinkClick", "action", "ppaction://hlinksldjump"); - xmlDocUniquePtr pRelsDoc5 = parseExport(tempFile.GetURL(), "ppt/slides/_rels/slide1.xml.rels"); + xmlDocUniquePtr pRelsDoc5 = parseExport("ppt/slides/_rels/slide1.xml.rels"); assertXPath(pRelsDoc5, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target", "slide2.xml"); - xmlDocUniquePtr pXmlDoc6 = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc6 = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDoc6, "/p:sld/p:cSld/p:spTree/p:sp[6]/p:nvSpPr/p:cNvPr/a:hlinkClick", "action", "ppaction://hlinkshowjump?jump=endshow"); - xmlDocUniquePtr pXmlDoc7 = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc7 = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDoc7, "/p:sld/p:cSld/p:spTree/p:sp[7]/p:nvSpPr/p:cNvPr/a:hlinkClick", "id", "rId2"); - xmlDocUniquePtr pRelsDoc7 = parseExport(tempFile.GetURL(), "ppt/slides/_rels/slide1.xml.rels"); + xmlDocUniquePtr pRelsDoc7 = parseExport("ppt/slides/_rels/slide1.xml.rels"); assertXPath(pRelsDoc7, "/rels:Relationships/rels:Relationship[@Id='rId2']", "Target", "http://www.example.com/"); } @@ -397,39 +397,39 @@ void SdOOXMLExportTest1::testTdf144914() void SdOOXMLExportTest1::testTdf124232() { loadFromURL(u"pptx/tdf141704.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc1 = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc1 = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "action", "ppaction://hlinkshowjump?jump=lastslide"); - xmlDocUniquePtr pXmlDoc2 = parseExport(tempFile.GetURL(), "ppt/slides/slide2.xml"); + xmlDocUniquePtr pXmlDoc2 = parseExport("ppt/slides/slide2.xml"); assertXPath(pXmlDoc2, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "action", "ppaction://hlinkshowjump?jump=nextslide"); - xmlDocUniquePtr pXmlDoc3 = parseExport(tempFile.GetURL(), "ppt/slides/slide3.xml"); + xmlDocUniquePtr pXmlDoc3 = parseExport("ppt/slides/slide3.xml"); assertXPath(pXmlDoc3, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "action", "ppaction://hlinkshowjump?jump=previousslide"); - xmlDocUniquePtr pXmlDoc4 = parseExport(tempFile.GetURL(), "ppt/slides/slide4.xml"); + xmlDocUniquePtr pXmlDoc4 = parseExport("ppt/slides/slide4.xml"); assertXPath(pXmlDoc4, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "id", "rId1"); - xmlDocUniquePtr pRelsDoc4 = parseExport(tempFile.GetURL(), "ppt/slides/_rels/slide4.xml.rels"); + xmlDocUniquePtr pRelsDoc4 = parseExport("ppt/slides/_rels/slide4.xml.rels"); assertXPath(pRelsDoc4, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target", "http://www.example.com/"); - xmlDocUniquePtr pXmlDoc5 = parseExport(tempFile.GetURL(), "ppt/slides/slide5.xml"); + xmlDocUniquePtr pXmlDoc5 = parseExport("ppt/slides/slide5.xml"); assertXPath(pXmlDoc5, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "action", "ppaction://hlinksldjump"); - xmlDocUniquePtr pRelsDoc5 = parseExport(tempFile.GetURL(), "ppt/slides/_rels/slide5.xml.rels"); + xmlDocUniquePtr pRelsDoc5 = parseExport("ppt/slides/_rels/slide5.xml.rels"); assertXPath(pRelsDoc5, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target", "slide6.xml"); - xmlDocUniquePtr pXmlDoc6 = parseExport(tempFile.GetURL(), "ppt/slides/slide6.xml"); + xmlDocUniquePtr pXmlDoc6 = parseExport("ppt/slides/slide6.xml"); assertXPath(pXmlDoc6, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "action", "ppaction://hlinkshowjump?jump=endshow"); - xmlDocUniquePtr pXmlDoc7 = parseExport(tempFile.GetURL(), "ppt/slides/slide7.xml"); + xmlDocUniquePtr pXmlDoc7 = parseExport("ppt/slides/slide7.xml"); assertXPath(pXmlDoc7, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick", "action", "ppaction://hlinkshowjump?jump=firstslide"); } @@ -437,9 +437,9 @@ void SdOOXMLExportTest1::testTdf124232() void SdOOXMLExportTest1::testTdf143624() { loadFromURL(u"pptx/tdf143624.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/presProps.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/presProps.xml"); assertXPath(pXmlDoc, "/p:presentationPr/p:showPr", "useTimings", "0"); @@ -457,9 +457,9 @@ void SdOOXMLExportTest1::testTdf142648() uno::Reference<container::XNamed> xNamed(xDrawPage, uno::UNO_QUERY_THROW); xNamed->setName("#Slide 1"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pRelsDoc = parseExport(tempFile.GetURL(), "ppt/slides/_rels/slide2.xml.rels"); + xmlDocUniquePtr pRelsDoc = parseExport("ppt/slides/_rels/slide2.xml.rels"); assertXPath(pRelsDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target", "slide1.xml"); @@ -468,9 +468,9 @@ void SdOOXMLExportTest1::testTdf142648() void SdOOXMLExportTest1::testTdf47365() { loadFromURL(u"pptx/loopNoPause.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/presProps.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/presProps.xml"); assertXPath(pXmlDoc, "/p:presentationPr/p:showPr", "loop", "1"); @@ -480,9 +480,9 @@ void SdOOXMLExportTest1::testTdf47365() void SdOOXMLExportTest1::testTdf125071() { loadFromURL(u"pptx/tdf125071.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/presentation.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/presentation.xml"); assertXPath(pXmlDoc, "/p:presentation/p:custShowLst/p:custShow[1]", "name", "Custom1"); assertXPath(pXmlDoc, "/p:presentation/p:custShowLst/p:custShow[2]", "name", "Custom2"); @@ -491,10 +491,10 @@ void SdOOXMLExportTest1::testTdf125071() void SdOOXMLExportTest1::testTdf54037() { loadFromURL(u"pptx/tdf54037.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); - xmlDocUniquePtr pRelsDoc = parseExport(tempFile.GetURL(), "ppt/slides/_rels/slide1.xml.rels"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); + xmlDocUniquePtr pRelsDoc = parseExport("ppt/slides/_rels/slide1.xml.rels"); assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p[1]/a:r/a:rPr/a:hlinkClick", "action", "ppaction://hlinksldjump"); @@ -1240,10 +1240,10 @@ void SdOOXMLExportTest1::testTdf112633() { // Load document and export it to a temporary file loadFromURL(u"pptx/tdf112633.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); - xmlDocUniquePtr pRelsDoc = parseExport(tempFile.GetURL(), "ppt/slides/_rels/slide1.xml.rels"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); + xmlDocUniquePtr pRelsDoc = parseExport("ppt/slides/_rels/slide1.xml.rels"); // Check image with artistic effect exists in the slide assertXPath(pXmlDoc, @@ -1263,16 +1263,16 @@ void SdOOXMLExportTest1::testTdf112633() // Check the .wdp file exists uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), - tempFile.GetURL()); + maTempFile.GetURL()); CPPUNIT_ASSERT_EQUAL(true, bool(xNameAccess->hasByName("ppt/media/hdphoto1.wdp"))); } void SdOOXMLExportTest1::testTdf128952() { loadFromURL(u"pptx/tdf128952.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:xfrm/a:off", "x", "360"); assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:xfrm/a:off", "y", "-360"); @@ -1283,9 +1283,9 @@ void SdOOXMLExportTest1::testTdf128952() void SdOOXMLExportTest1::testTdf127090() { loadFromURL(u"pptx/tdf127090.odp"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:bodyPr", "rot", "-5400000"); } @@ -1294,11 +1294,11 @@ void SdOOXMLExportTest1::testCustomXml() { // Load document and export it to a temporary file loadFromURL(u"pptx/customxml.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "customXml/item1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("customXml/item1.xml"); CPPUNIT_ASSERT(pXmlDoc); - xmlDocUniquePtr pRelsDoc = parseExport(tempFile.GetURL(), "customXml/_rels/item1.xml.rels"); + xmlDocUniquePtr pRelsDoc = parseExport("customXml/_rels/item1.xml.rels"); CPPUNIT_ASSERT(pRelsDoc); // Check there is a relation to itemProps1.xml. @@ -1306,7 +1306,7 @@ void SdOOXMLExportTest1::testCustomXml() assertXPath(pRelsDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target", "itemProps1.xml"); - std::unique_ptr<SvStream> pStream = parseExportStream(tempFile.GetURL(), "ddp/ddpfile.xen"); + std::unique_ptr<SvStream> pStream = parseExportStream(maTempFile.GetURL(), "ddp/ddpfile.xen"); CPPUNIT_ASSERT(pStream); } @@ -1314,7 +1314,7 @@ void SdOOXMLExportTest1::testTdf94238() { // Load document and export it to a temporary file. loadFromURL(u"pptx/tdf94238.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); uno::Reference<drawing::XDrawPagesSupplier> xDoc(mxComponent, uno::UNO_QUERY); CPPUNIT_ASSERT(xDoc.is()); @@ -1347,7 +1347,7 @@ void SdOOXMLExportTest1::testPictureTransparency() { // Load document and export it to a temporary file. loadFromURL(u"odp/image_transparency.odp"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); uno::Reference<drawing::XDrawPagesSupplier> xDoc(mxComponent, uno::UNO_QUERY); CPPUNIT_ASSERT(xDoc.is()); @@ -1394,7 +1394,7 @@ void SdOOXMLExportTest1::testRoundtripOwnLineStyles() } // Save to pptx, reload and compare the LineDash values - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); uno::Reference<drawing::XDrawPagesSupplier> xDocpptx(mxComponent, uno::UNO_QUERY); CPPUNIT_ASSERT(xDocpptx.is()); uno::Reference<drawing::XDrawPage> xPagepptx(xDocpptx->getDrawPages()->getByIndex(0), @@ -1421,12 +1421,12 @@ void SdOOXMLExportTest1::testRoundtripPrstDash() { // load and save document, compare prstDash values in saved document with original. loadFromURL(u"pptx/presetDashDot.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); const OUString sOriginal[] = { "dash", "dashDot", "dot", "lgDash", "lgDashDot", "lgDashDotDot", "sysDash", "sysDashDot", "sysDashDotDot", "sysDot" }; - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); const OString sStart = "/p:sld/p:cSld/p:spTree/p:sp["; const OString sEnd = "]/p:spPr/a:ln/a:prstDash"; for (sal_uInt16 i = 0; i < 10; i++) @@ -1458,16 +1458,15 @@ void SdOOXMLExportTest1::testDashOnHairline() { // load and save document, make sure the custDash has 11 child elements. loadFromURL(u"odp/tdf127267DashOnHairline.odp"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:ln/a:custDash/a:ds", 11); } void SdOOXMLExportTest1::testNarrationNonMediaShape() { loadFromURL(u"pptx/narration-non-media-shape.pptx"); - utl::TempFileNamed aTempFile; // Without the accompanying fix in place, this test would have failed, // beans::UnknownPropertyException was thrown. saveAndReload("Impress Office Open XML"); @@ -1476,9 +1475,9 @@ void SdOOXMLExportTest1::testNarrationNonMediaShape() void SdOOXMLExportTest1::testCustomshapeBitmapfillSrcrect() { loadFromURL(u"pptx/customshape-bitmapfill-srcrect.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); // tdf#132680 // We are preventing the side effect of DOCX improvement to PPTX case. @@ -1507,11 +1506,11 @@ void SdOOXMLExportTest1::testCustomshapeBitmapfillSrcrect() void SdOOXMLExportTest1::testTdf100348FontworkBitmapFill() { loadFromURL(u"odp/tdf100348_FontworkBitmapFill.odp"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // Make sure the fontwork shape has a blip bitmap fill and a colored outline. // Without the patch, fill and outline were black. - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); const OString sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr"); assertXPath(pXmlDoc, sPathStart + "/a:blipFill/a:blip", 1); assertXPath(pXmlDoc, sPathStart + "/a:ln/a:solidFill/a:srgbClr", "val", "ffbf00"); @@ -1520,11 +1519,11 @@ void SdOOXMLExportTest1::testTdf100348FontworkBitmapFill() void SdOOXMLExportTest1::testTdf100348FontworkGradientGlow() { loadFromURL(u"odp/tdf100348_FontworkGradientGlow.odp"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // Make sure the fontwork shape has a gradient fill and a colored glow. // Without the patch, fill was black and no glow applied. - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); const OString sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr"); assertXPath(pXmlDoc, sPathStart + "/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr", "val", "8d281e"); assertXPath(pXmlDoc, sPathStart + "/a:effectLst/a:glow", "rad", "63360"); @@ -1534,20 +1533,20 @@ void SdOOXMLExportTest1::testTdf100348FontworkGradientGlow() void SdOOXMLExportTest1::testTdf128345FullTransparentGradient() { loadFromURL(u"odp/tdf128345_FullTransparentGradient.odp"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // Make sure the shape has no fill. Without the patch, fill was solid red. - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDoc, "//p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:noFill"); } void SdOOXMLExportTest1::testTdf128345GradientLinear() { loadFromURL(u"odp/tdf128345_GradientLinear.odp"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // Make sure the shape has a lin fill. Without the patch, fill was solid red. - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); const OString sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:gradFill"); assertXPath(pXmlDoc, sPathStart + "/a:lin", "ang", "3600000"); assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs", 2); @@ -1562,11 +1561,11 @@ void SdOOXMLExportTest1::testTdf128345GradientLinear() void SdOOXMLExportTest1::testTdf128345GradientRadial() { loadFromURL(u"odp/tdf128345_GradientRadial.odp"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // Make sure the shape has transparency. In OOXML alpha means 'opacity' with default // 100000 for full opak, so only the full transparency with val 0 should be written. - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); const OString sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:gradFill"); assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs", 2); assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr", "val", "ff0000"); @@ -1593,10 +1592,10 @@ void SdOOXMLExportTest1::testTdf128345GradientAxial() void SdOOXMLExportTest1::testTdf134969TransparencyOnColorGradient() { loadFromURL(u"odp/tdf134969_TransparencyOnColorGradient.odp"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // Make sure the shape has a transparency in gradient stops. - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); const OString sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:gradFill"); assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs", 2); assertXPath(pXmlDoc, sPathStart + "/a:gsLst/a:gs[1]/a:srgbClr/a:alpha", "val", "60000"); @@ -1606,9 +1605,9 @@ void SdOOXMLExportTest1::testTdf134969TransparencyOnColorGradient() void SdOOXMLExportTest1::testArcTo() { loadFromURL(u"pptx/arc-validiert.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); const OString sPath("//a:custGeom/a:pathLst/a:path/a:arcTo"); assertXPath(pXmlDoc, sPath, "wR", "3"); assertXPath(pXmlDoc, sPath, "hR", "3"); @@ -1619,8 +1618,8 @@ void SdOOXMLExportTest1::testArcTo() void SdOOXMLExportTest1::testNarrationMimeType() { loadFromURL(u"pptx/narration.pptx"); - utl::TempFileNamed aTempFile = save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "[Content_Types].xml"); + save("Impress Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); // Without the accompanying fix in place, this test would have failed with: // - Expected: audio/mp4 // - Actual : application/vnd.sun.star.media @@ -1630,10 +1629,10 @@ void SdOOXMLExportTest1::testNarrationMimeType() "ContentType", "audio/mp4"); // Check if the bitmap of the media shape is exported correctly. - xmlDocUniquePtr pSlideDoc = parseExport(aTempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pSlideDoc = parseExport("ppt/slides/slide1.xml"); OUString aImageId = getXPath(pSlideDoc, "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:blip", "embed"); - xmlDocUniquePtr pRelsDoc = parseExport(aTempFile.GetURL(), "ppt/slides/_rels/slide1.xml.rels"); + xmlDocUniquePtr pRelsDoc = parseExport("ppt/slides/_rels/slide1.xml.rels"); OUString aImagePath = "/rels:Relationships/rels:Relationship[@Id='" + aImageId + "']"; // Something like ../media/image2.png. OUString aImageStreamName = getXPath(pRelsDoc, aImagePath.toUtf8(), "Target"); @@ -1641,7 +1640,7 @@ void SdOOXMLExportTest1::testNarrationMimeType() // Something like ppt/media/image2.png. OUString aImageRelName; CPPUNIT_ASSERT(aImageAbsName.startsWith("file:///", &aImageRelName)); - std::unique_ptr<SvStream> pImageStream = parseExportStream(aTempFile.GetURL(), aImageRelName); + std::unique_ptr<SvStream> pImageStream = parseExportStream(maTempFile.GetURL(), aImageRelName); vcl::PngImageReader aReader(*pImageStream); BitmapEx aBitmapEx = aReader.read(); // Without the accompanying fix in place, this test would have failed with: @@ -1681,8 +1680,8 @@ void SdOOXMLExportTest1::testNarrationMimeType() void SdOOXMLExportTest1::testTdf140865Wordart3D() { loadFromURL(u"pptx/tdf140865Wordart3D.pptx"); - utl::TempFileNamed aTempFile = save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(aTempFile.GetURL(), "ppt/slides/slide1.xml"); + save("Impress Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); // without the fix in place a:sp3d was lost on round trip, and so extrusion was lost. constexpr OStringLiteral sPathStart("//p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:bodyPr"); @@ -1699,9 +1698,9 @@ void SdOOXMLExportTest1::testTdf140865Wordart3D() void SdOOXMLExportTest1::testTdf124457() { loadFromURL(u"pptx/tdf124457.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDoc, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/" @@ -1717,9 +1716,9 @@ void SdOOXMLExportTest1::testTdf124457() void SdOOXMLExportTest1::testTdf143126() { loadFromURL(u"pptx/tdf143126.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/presProps.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/presProps.xml"); assertXPath(pXmlDoc, "/p:presentationPr/p:showPr", "showNarration", "1"); assertXPath(pXmlDoc, "/p:presentationPr/p:showPr/p:sldRg", "st", "2"); @@ -1729,9 +1728,9 @@ void SdOOXMLExportTest1::testTdf143126() void SdOOXMLExportTest1::testTdf143129() { loadFromURL(u"pptx/tdf143129.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/presProps.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/presProps.xml"); assertXPath(pXmlDoc, "/p:presentationPr/p:showPr", "showNarration", "1"); assertXPath(pXmlDoc, "/p:presentationPr/p:showPr/p:custShow", "id", "0"); @@ -1740,9 +1739,9 @@ void SdOOXMLExportTest1::testTdf143129() void SdOOXMLExportTest1::testTdf118045() { loadFromURL(u"odp/tdf118045.odp"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc1 = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc1 = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:pPr/a:lnSpc/a:spcPct", "val", "110000"); } @@ -1750,9 +1749,9 @@ void SdOOXMLExportTest1::testTdf118045() void SdOOXMLExportTest1::testTdf137675() { loadFromURL(u"pptx/tdf137675.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:custGeom/a:pathLst/a:path", "fill", "none"); } diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index 5ddbcdb4fae9..f7866c70a154 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -225,9 +225,9 @@ public: void SdOOXMLExportTest2::testTdf151492() { loadFromURL(u"odp/tdf151492.odp"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDocContent = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", "idx", "0"); } @@ -235,9 +235,9 @@ void SdOOXMLExportTest2::testTdf151492() void SdOOXMLExportTest2::testTdf149697() { loadFromURL(u"pptx/tdf149697.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDocContent = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:cxnSp[1]/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", "idx", "5"); assertXPath(pXmlDocContent, @@ -253,9 +253,9 @@ void SdOOXMLExportTest2::testTdf149697() void SdOOXMLExportTest2::testTdf149126() { loadFromURL(u"odp/tdf149126.odp"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDocContent = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:prstGeom", "prst", "triangle"); } @@ -263,9 +263,9 @@ void SdOOXMLExportTest2::testTdf149126() void SdOOXMLExportTest2::testTdf131905() { loadFromURL(u"pptx/tdf131905.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDocContent = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml"); assertXPath( pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/a:tbl/a:tr[1]/a:tc/a:tcPr", @@ -296,24 +296,23 @@ void SdOOXMLExportTest2::testBnc822341() { // Check import / export of embedded text document loadFromURL(u"odp/bnc822341.odp"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // Export an LO specific ole object (imported from an ODP document) { - xmlDocUniquePtr pXmlDocCT = parseExport(tempFile.GetURL(), "[Content_Types].xml"); + xmlDocUniquePtr pXmlDocCT = parseExport("[Content_Types].xml"); assertXPath(pXmlDocCT, "/ContentType:Types/ContentType:Override[@ContentType='application/" "vnd.openxmlformats-officedocument.wordprocessingml.document']", "PartName", "/ppt/embeddings/oleObject1.docx"); - xmlDocUniquePtr pXmlDocRels - = parseExport(tempFile.GetURL(), "ppt/slides/_rels/slide1.xml.rels"); + xmlDocUniquePtr pXmlDocRels = parseExport("ppt/slides/_rels/slide1.xml.rels"); assertXPath( pXmlDocRels, "/rels:Relationships/rels:Relationship[@Target='../embeddings/oleObject1.docx']", "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); - xmlDocUniquePtr pXmlDocContent = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/p:oleObj", "progId", "Word.Document.12"); @@ -325,24 +324,23 @@ void SdOOXMLExportTest2::testBnc822341() CPPUNIT_ASSERT_EQUAL(SdrObjKind::OLE2, pObj->GetObjIdentifier()); } - utl::TempFileNamed tempFile2 = save("Impress Office Open XML"); + save("Impress Office Open XML"); // Export an MS specific ole object (imported from a PPTX document) { - xmlDocUniquePtr pXmlDocCT = parseExport(tempFile2.GetURL(), "[Content_Types].xml"); + xmlDocUniquePtr pXmlDocCT = parseExport("[Content_Types].xml"); assertXPath(pXmlDocCT, "/ContentType:Types/ContentType:Override[@ContentType='application/" "vnd.openxmlformats-officedocument.wordprocessingml.document']", "PartName", "/ppt/embeddings/oleObject1.docx"); - xmlDocUniquePtr pXmlDocRels - = parseExport(tempFile.GetURL(), "ppt/slides/_rels/slide1.xml.rels"); + xmlDocUniquePtr pXmlDocRels = parseExport("ppt/slides/_rels/slide1.xml.rels"); assertXPath( pXmlDocRels, "/rels:Relationships/rels:Relationship[@Target='../embeddings/oleObject1.docx']", "Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); - xmlDocUniquePtr pXmlDocContent = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/p:oleObj", "progId", "Word.Document.12"); @@ -359,11 +357,11 @@ void SdOOXMLExportTest2::testMathObject() { // Check import / export of math object loadFromURL(u"odp/math.odp"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // Export an LO specific ole object (imported from an ODP document) { - xmlDocUniquePtr pXmlDocContent = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/mc:AlternateContent/mc:Choice", "Requires", "a14"); assertXPathContent(pXmlDocContent, @@ -377,11 +375,11 @@ void SdOOXMLExportTest2::testMathObject() CPPUNIT_ASSERT_EQUAL(SdrObjKind::OLE2, pObj->GetObjIdentifier()); } - utl::TempFileNamed tempFile2 = save("Impress Office Open XML"); + save("Impress Office Open XML"); // Export an MS specific ole object (imported from a PPTX document) { - xmlDocUniquePtr pXmlDocContent = parseExport(tempFile2.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/mc:AlternateContent/mc:Choice", "Requires", "a14"); assertXPathContent(pXmlDocContent, @@ -400,11 +398,11 @@ void SdOOXMLExportTest2::testMathObjectPPT2010() { // Check import / export of math object loadFromURL(u"pptx/Math.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // Export an MS specific ole object (imported from a PPTX document) { - xmlDocUniquePtr pXmlDocContent = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/mc:AlternateContent/mc:Choice", "Requires", "a14"); assertXPathContent(pXmlDocContent, @@ -763,9 +761,9 @@ void SdOOXMLExportTest2::testPresetShapesExport() "val 3770", }; - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDocCT = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDocCT = parseExport("ppt/slides/slide1.xml"); const OString sPattern( "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:prstGeom[@prst='_T_']/a:avLst/a:gd[_N_]"); const OString sT("_T_"); @@ -1009,16 +1007,16 @@ void SdOOXMLExportTest2::testTdf92076() void SdOOXMLExportTest2::testTdf59046() { loadFromURL(u"odp/tdf59046.odp"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDocRels = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + save("Impress Office Open XML"); + xmlDocUniquePtr pXmlDocRels = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDocRels, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:custGeom/a:pathLst/a:path", 1); } void SdOOXMLExportTest2::testTdf133502() { loadFromURL(u"odp/tdf133502.odp"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDocRels = parseExport(tempFile.GetURL(), "ppt/comments/comment1.xml"); + save("Impress Office Open XML"); + xmlDocUniquePtr pXmlDocRels = parseExport("ppt/comments/comment1.xml"); assertXPathContent(pXmlDocRels, "/p:cmLst/p:cm/p:text", "Test for creator-initials"); @@ -1031,7 +1029,7 @@ void SdOOXMLExportTest2::testTdf105739() { // Gradient was lost during saving to ODP loadFromURL(u"pptx/tdf105739.pptx"); - utl::TempFileNamed tempFile = save("impress8"); + save("impress8"); uno::Reference<drawing::XDrawPage> xPage = getPage(0); uno::Reference<beans::XPropertySet> xPropSet(xPage, uno::UNO_QUERY); uno::Any aAny = xPropSet->getPropertyValue("Background"); @@ -1082,10 +1080,10 @@ void SdOOXMLExportTest2::testPageBitmapWithTransparency() void SdOOXMLExportTest2::testPptmContentType() { loadFromURL(u"pptm/macro.pptm"); - utl::TempFileNamed tempFile = save("Impress MS PowerPoint 2007 XML VBA"); + save("Impress MS PowerPoint 2007 XML VBA"); // Assert that the content type is the one of PPTM - xmlDocUniquePtr pXmlContentType = parseExport(tempFile.GetURL(), "[Content_Types].xml"); + xmlDocUniquePtr pXmlContentType = parseExport("[Content_Types].xml"); assertXPath(pXmlContentType, "/ContentType:Types/ContentType:Override[@PartName='/ppt/presentation.xml']", "ContentType", "application/vnd.ms-powerpoint.presentation.macroEnabled.main+xml"); @@ -1094,8 +1092,8 @@ void SdOOXMLExportTest2::testPptmContentType() void SdOOXMLExportTest2::testTdf111798() { loadFromURL(u"odp/tdf111798.odp"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDoc = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + save("Impress Office Open XML"); + xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); const OUString data[][11] = { { "2700000", "2458080", "2414880", "1439640", "1440000", "gd[1]", "adj1", "val 50000", "gd[2]", "adj2", "val 25000" }, @@ -1130,11 +1128,11 @@ void SdOOXMLExportTest2::testTdf111798() void SdOOXMLExportTest2::testPptmVBAStream() { loadFromURL(u"pptm/macro.pptm"); - utl::TempFileNamed tempFile = save("Impress MS PowerPoint 2007 XML VBA"); + save("Impress MS PowerPoint 2007 XML VBA"); uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), - tempFile.GetURL()); + maTempFile.GetURL()); // This failed: VBA stream was not roundtripped CPPUNIT_ASSERT(xNameAccess->hasByName("ppt/vbaProject.bin")); } @@ -1142,10 +1140,10 @@ void SdOOXMLExportTest2::testPptmVBAStream() void SdOOXMLExportTest2::testTdf111863() { loadFromURL(u"pptx/tdf111863.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // check that transition attribute didn't change from 'out' to 'in' - xmlDocUniquePtr pXmlDocContent = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/" "p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:animEffect", @@ -1155,9 +1153,9 @@ void SdOOXMLExportTest2::testTdf111863() void SdOOXMLExportTest2::testTdf111518() { loadFromURL(u"pptx/tdf111518.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDocRels = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDocRels = parseExport("ppt/slides/slide1.xml"); OUString sActual = getXPath(pXmlDocRels, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/" "p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/" @@ -1169,8 +1167,8 @@ void SdOOXMLExportTest2::testTdf111518() void SdOOXMLExportTest2::testTdf100387() { loadFromURL(u"odp/tdf100387.odp"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDocContent = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + save("Impress Office Open XML"); + xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn", "dur", "indefinite"); @@ -1221,8 +1219,8 @@ void SdOOXMLExportTest2::testTdf100387() void SdOOXMLExportTest2::testClosingShapesAndLineCaps() { loadFromURL(u"odp/closed-shapes.odp"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDocContent = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + save("Impress Office Open XML"); + xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:custGeom/a:pathLst/a:path/a:moveTo/a:pt", 1); @@ -1268,8 +1266,8 @@ void SdOOXMLExportTest2::testClosingShapesAndLineCaps() void SdOOXMLExportTest2::testRotateFlip() { loadFromURL(u"odp/rotate_flip.odp"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDocContent = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + save("Impress Office Open XML"); + xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml"); const OUString data[][4] = { // flipH flipV x y { "0", "1", "1170000", "1035720" }, @@ -1315,7 +1313,7 @@ void SdOOXMLExportTest2::testRotateFlip() void SdOOXMLExportTest2::testTdf106867() { loadFromURL(u"pptx/tdf106867.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); const SdrPage* pPage = GetPage(1); @@ -1328,12 +1326,12 @@ void SdOOXMLExportTest2::testTdf106867() // additional checks of the output file uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), - tempFile.GetURL()); + maTempFile.GetURL()); // check that the document contains the video stream CPPUNIT_ASSERT(xNameAccess->hasByName("ppt/media/media1.avi")); // both the ooxml and the extended markup - xmlDocUniquePtr pXmlDocContent = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:nvPr/a:videoFile"); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:nvPr/p:extLst/p:ext/p14:media"); @@ -1349,10 +1347,10 @@ void SdOOXMLExportTest2::testTdf106867() void SdOOXMLExportTest2::testTdf112280() { loadFromURL(u"pptx/tdf112280.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // check the animRot value - xmlDocUniquePtr pXmlDocContent = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml"); assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/" "p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:animRot", @@ -1362,10 +1360,10 @@ void SdOOXMLExportTest2::testTdf112280() void SdOOXMLExportTest2::testTdf112088() { loadFromURL(u"pptx/tdf112088.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); // check gradient stops - xmlDocUniquePtr pXmlDocContent = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml"); assertXPathChildren(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:gradFill/a:gsLst", 2); } @@ -1373,9 +1371,9 @@ void SdOOXMLExportTest2::testTdf112088() void SdOOXMLExportTest2::testTdf112333() { loadFromURL(u"pptx/tdf112333.pptx"); - utl::TempFileNamed tempFile = save("Impress Office Open XML"); + save("Impress Office Open XML"); - xmlDocUniquePtr pXmlDocContent = parseExport(tempFile.GetURL(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDocContent = parseExport("ppt/slides/slide1.xml"); OUString sTo = getXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/" ... etc. - the rest is truncated