From a38a22c7e55bf076f96589492e8f42f6c2f7639c Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Mon, 28 Oct 2024 14:36:38 +0100 Subject: [PATCH] UnoApiTest: rename load to loadFromURL and use it everywhere Change-Id: Ie67eebec74f783fa0c29acfb23bb83bc582812b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175724 Reviewed-by: Xisco Fauli Tested-by: Jenkins --- chart2/qa/extras/PivotChartTest.cxx | 10 +++--- chart2/qa/extras/uichart.cxx | 10 +++--- dbaccess/qa/extras/dialog-save.cxx | 2 +- dbaccess/qa/extras/empty-stdlib-save.cxx | 2 +- dbaccess/qa/extras/nolib-save.cxx | 2 +- dbaccess/qa/extras/rowsetclones.cxx | 2 +- dbaccess/qa/unit/dbtest_base.cxx | 4 +-- embeddedobj/qa/cppunit/general.cxx | 9 ++--- embeddedobj/qa/cppunit/msole.cxx | 2 +- filter/qa/pdf.cxx | 20 ++++------- filter/qa/unit/svg.cxx | 6 ++-- filter/qa/unit/textfilterdetect.cxx | 6 ++-- framework/qa/cppunit/dispatchtest.cxx | 3 +- include/test/unoapi_test.hxx | 2 +- sc/qa/extras/scannotationshapeobj.cxx | 2 +- sc/qa/extras/scarealinkobj.cxx | 2 +- sc/qa/extras/scarealinksobj.cxx | 2 +- sc/qa/extras/scautoformatobj.cxx | 2 +- sc/qa/extras/scautoformatsobj.cxx | 2 +- sc/qa/extras/sccellfieldsobj.cxx | 2 +- sc/qa/extras/sccellformatsenumeration.cxx | 2 +- sc/qa/extras/sccellformatsobj.cxx | 2 +- sc/qa/extras/sccellobj.cxx | 2 +- sc/qa/extras/sccellrangesobj.cxx | 2 +- sc/qa/extras/sccellsearchobj.cxx | 2 +- sc/qa/extras/sccellsenumeration.cxx | 2 +- sc/qa/extras/sccellsobj.cxx | 2 +- sc/qa/extras/scchartobj.cxx | 2 +- sc/qa/extras/scchartsobj.cxx | 2 +- sc/qa/extras/sccheck_data_pilot_field.cxx | 2 +- sc/qa/extras/sccheck_data_pilot_table.cxx | 2 +- sc/qa/extras/sccheck_xcell_ranges_query.cxx | 2 +- sc/qa/extras/scconsolidationdescriptorobj.cxx | 2 +- sc/qa/extras/scdatabaserangesobj.cxx | 2 +- sc/qa/extras/scdatapilotfieldgroupitemobj.cxx | 2 +- sc/qa/extras/scdatapilotfieldgroupobj.cxx | 2 +- sc/qa/extras/scdatapilotfieldgroupsobj.cxx | 2 +- sc/qa/extras/scdatapilotfieldsobj.cxx | 2 +- sc/qa/extras/scdatapilotitemobj.cxx | 2 +- sc/qa/extras/scdatapilotitemsobj.cxx | 2 +- sc/qa/extras/scdatapilottablesobj.cxx | 2 +- sc/qa/extras/scddelinkobj.cxx | 2 +- sc/qa/extras/scddelinksobj.cxx | 2 +- sc/qa/extras/scdocumentconfigurationobj.cxx | 2 +- sc/qa/extras/scdrawpageobj.cxx | 2 +- sc/qa/extras/scdrawpagesobj.cxx | 2 +- sc/qa/extras/sceditfieldobj_cell.cxx | 2 +- sc/qa/extras/sceditfieldobj_header.cxx | 2 +- sc/qa/extras/scfilterdescriptorbase.cxx | 2 +- sc/qa/extras/scfunctiondescriptionobj.cxx | 2 +- sc/qa/extras/scfunctionlistobj.cxx | 2 +- sc/qa/extras/scheaderfieldsobj.cxx | 2 +- sc/qa/extras/scheaderfootercontentobj.cxx | 2 +- sc/qa/extras/scimportdescriptorbaseobj.cxx | 2 +- ...enumeration_cellannotationsenumeration.cxx | 2 +- ...exenumeration_cellarealinksenumeration.cxx | 2 +- ...xenumeration_databaserangesenumeration.cxx | 2 +- ...enumeration_datapilotfieldsenumeration.cxx | 2 +- ...xenumeration_datapilotitemsenumeration.cxx | 2 +- ...enumeration_datapilottablesenumeration.cxx | 2 +- ...scindexenumeration_ddelinksenumeration.cxx | 2 +- ...eration_functiondescriptionenumeration.cxx | 2 +- ...ndexenumeration_labelrangesenumeration.cxx | 2 +- ...ndexenumeration_namedrangesenumeration.cxx | 2 +- ...cindexenumeration_scenariosenumeration.cxx | 2 +- ...enumeration_sheetcellrangesenumeration.cxx | 2 +- ...indexenumeration_sheetlinksenumeration.cxx | 2 +- ...dexenumeration_spreadsheetsenumeration.cxx | 2 +- ...ration_spreadsheetviewpanesenumeration.cxx | 2 +- ...xenumeration_subtotalfieldsenumeration.cxx | 2 +- ...enumeration_tableautoformatenumeration.cxx | 2 +- ...ndexenumeration_tablechartsenumeration.cxx | 2 +- ...dexenumeration_tablecolumnsenumeration.cxx | 2 +- ...ation_tableconditionalentryenumeration.cxx | 2 +- ...cindexenumeration_tablerowsenumeration.cxx | 2 +- ...cindexenumeration_textfieldenumeration.cxx | 2 +- sc/qa/extras/sclabelrangeobj.cxx | 2 +- sc/qa/extras/sclabelrangesobj.cxx | 2 +- sc/qa/extras/scpdfexport.cxx | 6 ++-- sc/qa/extras/screcentfunctionsobj.cxx | 2 +- sc/qa/extras/screcordchanges.cxx | 2 +- sc/qa/extras/scscenariosobj.cxx | 2 +- sc/qa/extras/scshapeobj.cxx | 2 +- sc/qa/extras/scsheetlinkobj.cxx | 2 +- sc/qa/extras/scsheetlinksobj.cxx | 2 +- sc/qa/extras/scsortdescriptorbaseobj.cxx | 2 +- sc/qa/extras/scspreadsheetsettings.cxx | 2 +- sc/qa/extras/scspreadsheetsettingsobj.cxx | 2 +- sc/qa/extras/scstylefamiliesobj.cxx | 2 +- sc/qa/extras/scstylefamilyobj.cxx | 2 +- sc/qa/extras/scstyleobj.cxx | 2 +- sc/qa/extras/scsubtotaldescriptorbase.cxx | 2 +- sc/qa/extras/scsubtotalfieldobj.cxx | 2 +- sc/qa/extras/sctablecolumnobj.cxx | 2 +- sc/qa/extras/sctablecolumnsobj.cxx | 2 +- sc/qa/extras/sctableconditionalentryobj.cxx | 2 +- sc/qa/extras/sctableconditionalformat.cxx | 2 +- sc/qa/extras/sctablerowobj.cxx | 2 +- sc/qa/extras/sctablerowsobj.cxx | 2 +- sc/qa/extras/sctablevalidationobj.cxx | 2 +- sc/qa/extras/sctabviewobj.cxx | 2 +- .../extras/scuniquecellformatsenumeration.cxx | 2 +- sc/qa/extras/scuniquecellformatsobj.cxx | 2 +- sc/qa/extras/scviewpaneobj.cxx | 2 +- sc/qa/extras/vba-macro-test.cxx | 18 +++++----- sc/qa/unit/ThemeImportExportTest.cxx | 2 +- sc/qa/unit/anchor.cxx | 2 +- sc/qa/unit/helper/qahelper.cxx | 2 +- sd/qa/filter/eppt/eppt.cxx | 2 +- sd/qa/unit/SdrPdfImportTest.cxx | 2 +- sd/qa/unit/sdmodeltestbase.hxx | 4 +-- sfx2/qa/cppunit/doc.cxx | 9 +++-- sfx2/qa/cppunit/test_classification.cxx | 6 ++-- sfx2/qa/cppunit/test_misc.cxx | 7 ++-- starmath/qa/extras/mmlexport-test.cxx | 10 +++--- svx/qa/unit/svdraw.cxx | 6 ++-- svx/qa/unit/table.cxx | 3 +- svx/qa/unit/unodraw.cxx | 9 ++--- svx/qa/unit/xoutdev.cxx | 3 +- sw/qa/api/SwXBodyText.cxx | 3 +- sw/qa/api/SwXBookmark.cxx | 3 +- sw/qa/api/SwXBookmarks.cxx | 3 +- sw/qa/api/SwXChapterNumbering.cxx | 3 +- sw/qa/api/SwXDocumentIndex.cxx | 3 +- sw/qa/api/SwXDocumentIndexMark.cxx | 3 +- sw/qa/api/SwXDocumentIndexes.cxx | 3 +- sw/qa/api/SwXDocumentSettings.cxx | 3 +- sw/qa/api/SwXFieldEnumeration.cxx | 3 +- sw/qa/api/SwXFootnote.cxx | 3 +- sw/qa/api/SwXFootnoteProperties.cxx | 3 +- sw/qa/api/SwXFootnoteText.cxx | 3 +- sw/qa/api/SwXFootnotes.cxx | 3 +- sw/qa/api/SwXFrames.cxx | 3 +- sw/qa/api/SwXHeadFootText.cxx | 3 +- sw/qa/api/SwXNumberingRules.cxx | 3 +- sw/qa/api/SwXParagraphEnumeration.cxx | 3 +- sw/qa/api/SwXReferenceMark.cxx | 3 +- sw/qa/api/SwXReferenceMarks.cxx | 3 +- sw/qa/api/SwXStyleFamilies.cxx | 3 +- sw/qa/api/SwXTableCellText.cxx | 3 +- sw/qa/api/SwXTextEmbeddedObjects.cxx | 3 +- sw/qa/api/SwXTextField.cxx | 3 +- sw/qa/api/SwXTextFieldMasters.cxx | 3 +- sw/qa/api/SwXTextFieldTypes.cxx | 3 +- sw/qa/api/SwXTextFrame.cxx | 3 +- sw/qa/api/SwXTextSections.cxx | 3 +- sw/qa/api/SwXTextTable.cxx | 3 +- sw/qa/api/SwXTextTables.cxx | 3 +- sw/qa/core/macros-test.cxx | 5 ++- .../accessibility/accessible_relation_set.cxx | 3 +- sw/qa/extras/globalfilter/globalfilter.cxx | 3 +- sw/qa/extras/htmlexport/htmlexport.cxx | 8 ++--- sw/qa/extras/layout/layout2.cxx | 5 ++- sw/qa/extras/mailmerge/mailmergetestbase.cxx | 5 +-- sw/qa/extras/odfimport/odfimport.cxx | 5 ++- sw/qa/extras/pdf/HybridPdfTest.cxx | 3 +- sw/qa/extras/uiwriter/uiwriter.cxx | 17 ++++------ sw/qa/extras/uiwriter/uiwriter7.cxx | 4 +-- sw/qa/extras/uiwriter/uiwriter8.cxx | 2 ++ sw/qa/uibase/uiview/uiview.cxx | 3 +- sw/qa/unit/swmodeltestbase.cxx | 2 +- sw/qa/writerfilter/dmapper/DomainMapper.cxx | 3 +- .../dmapper/DomainMapper_Impl.cxx | 3 +- .../writerfilter/dmapper/NumberingManager.cxx | 3 +- sw/qa/writerfilter/dmapper/PropertyMap.cxx | 3 +- test/source/unoapi_test.cxx | 7 ++-- unoxml/qa/unit/rdftest.cxx | 4 +-- vcl/qa/cppunit/filter/ipdf/ipdf.cxx | 3 +- vcl/qa/cppunit/pdfexport/pdfexport2.cxx | 14 ++++---- xmloff/qa/unit/draw.cxx | 6 ++-- xmloff/qa/unit/style.cxx | 2 +- xmloff/qa/unit/text.cxx | 34 +++++++++---------- xmloff/qa/unit/text/txtprmap.cxx | 2 +- xmlsecurity/qa/unit/signing/signing.cxx | 26 +++++++------- xmlsecurity/qa/unit/signing/signing2.cxx | 4 +-- xmlsecurity/qa/xmlsec/xmlsec.cxx | 2 +- 176 files changed, 274 insertions(+), 343 deletions(-) diff --git a/chart2/qa/extras/PivotChartTest.cxx b/chart2/qa/extras/PivotChartTest.cxx index 51210bc5a693..30cd8c656526 100644 --- a/chart2/qa/extras/PivotChartTest.cxx +++ b/chart2/qa/extras/PivotChartTest.cxx @@ -540,7 +540,7 @@ void PivotChartTest::testPivotChartWithOneColumnField() // SETUP DATA and PIVOT TABLE - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); uno::Reference xSheetDoc(mxComponent, uno::UNO_QUERY_THROW); @@ -624,7 +624,7 @@ void PivotChartTest::testPivotChartWithOneRowField() // SETUP DATA and PIVOT TABLE - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); uno::Reference xSheetDoc(mxComponent, uno::UNO_QUERY_THROW); @@ -684,7 +684,7 @@ void PivotChartTest::testPivotTableDataProvider_PivotTableFields() { // SETUP DATA and PIVOT TABLE - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); uno::Reference xSheetDoc(mxComponent, uno::UNO_QUERY_THROW); @@ -791,7 +791,7 @@ void PivotChartTest::testPivotChartRowFieldInOutlineMode() { // SETUP DATA and PIVOT TABLE - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); uno::Reference xSheetDoc(mxComponent, uno::UNO_QUERY_THROW); @@ -923,7 +923,7 @@ void PivotChartTest::testPivotChartWithDateRowField() { // SETUP DATA and PIVOT TABLE - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); uno::Reference xSheetDoc(mxComponent, uno::UNO_QUERY_THROW); diff --git a/chart2/qa/extras/uichart.cxx b/chart2/qa/extras/uichart.cxx index 78de20f09955..fe0c53a73bcf 100644 --- a/chart2/qa/extras/uichart.cxx +++ b/chart2/qa/extras/uichart.cxx @@ -50,7 +50,7 @@ void Chart2UiChartTest::testCopyPasteToNewSheet(uno::Reference xDocStorable(mxComponent, UNO_QUERY_THROW); uno::Reference< document::XEmbeddedScripts > xDocScr(mxComponent, UNO_QUERY_THROW); uno::Reference< script::XStorageBasedLibraryContainer > xStorBasLib(xDocScr->getBasicLibraries()); diff --git a/dbaccess/qa/extras/empty-stdlib-save.cxx b/dbaccess/qa/extras/empty-stdlib-save.cxx index 67550492c258..708ce86c9eed 100644 --- a/dbaccess/qa/extras/empty-stdlib-save.cxx +++ b/dbaccess/qa/extras/empty-stdlib-save.cxx @@ -42,7 +42,7 @@ void DialogSaveTest::test() { createTempCopy(u"testDialogSave.odb"); { - mxComponent = loadFromDesktop(maTempFile.GetURL()); + loadFromURL(maTempFile.GetURL()); uno::Reference< frame::XStorable > xDocStorable(mxComponent, UNO_QUERY_THROW); uno::Reference< document::XEmbeddedScripts > xDocScr(mxComponent, UNO_QUERY_THROW); uno::Reference< script::XStorageBasedLibraryContainer > xStorBasLib(xDocScr->getBasicLibraries()); diff --git a/dbaccess/qa/extras/nolib-save.cxx b/dbaccess/qa/extras/nolib-save.cxx index 89dc9f036dff..2ad68714528e 100644 --- a/dbaccess/qa/extras/nolib-save.cxx +++ b/dbaccess/qa/extras/nolib-save.cxx @@ -42,7 +42,7 @@ void DialogSaveTest::test() { createTempCopy(u"testDialogSave.odb"); { - mxComponent = loadFromDesktop(maTempFile.GetURL()); + loadFromURL(maTempFile.GetURL()); uno::Reference< frame::XStorable > xDocStorable(mxComponent, UNO_QUERY_THROW); uno::Reference< document::XEmbeddedScripts > xDocScr(mxComponent, UNO_QUERY_THROW); uno::Reference< script::XStorageBasedLibraryContainer > xStorBasLib(xDocScr->getBasicLibraries()); diff --git a/dbaccess/qa/extras/rowsetclones.cxx b/dbaccess/qa/extras/rowsetclones.cxx index 053b58199a78..8ffaeea202b2 100644 --- a/dbaccess/qa/extras/rowsetclones.cxx +++ b/dbaccess/qa/extras/rowsetclones.cxx @@ -47,7 +47,7 @@ RowSetClones::RowSetClones() void RowSetClones::test() { createTempCopy(u"RowSetClones.odb"); - mxComponent = loadFromDesktop(maTempFile.GetURL()); + loadFromURL(maTempFile.GetURL()); uno::Reference< XOfficeDatabaseDocument > xDocument(mxComponent, UNO_QUERY_THROW); diff --git a/dbaccess/qa/unit/dbtest_base.cxx b/dbaccess/qa/unit/dbtest_base.cxx index 0208649906ad..86197b89cfb4 100644 --- a/dbaccess/qa/unit/dbtest_base.cxx +++ b/dbaccess/qa/unit/dbtest_base.cxx @@ -51,7 +51,7 @@ public: }; uno::Reference DBTestBase::getDocumentForUrl(OUString const & url) { - mxComponent = loadFromDesktop(url); + loadFromURL(url); uno::Reference< XOfficeDatabaseDocument > xDocument(mxComponent, UNO_QUERY_THROW); return xDocument; } @@ -81,7 +81,7 @@ void DBTestBase::createDBDocument(const OUString& rDriverURL) xStorable->storeAsURL(maTempFile.GetURL(), uno::Sequence< beans::PropertyValue >()); - mxComponent = loadFromDesktop(maTempFile.GetURL()); + loadFromURL(maTempFile.GetURL()); CPPUNIT_ASSERT(mxComponent); } diff --git a/embeddedobj/qa/cppunit/general.cxx b/embeddedobj/qa/cppunit/general.cxx index 82bd2844388c..1c681b3137a9 100644 --- a/embeddedobj/qa/cppunit/general.cxx +++ b/embeddedobj/qa/cppunit/general.cxx @@ -46,8 +46,7 @@ CPPUNIT_TEST_FIXTURE(Test, testInsertFileConfig) pBatchReset); pBatchReset->commit(); }); - mxComponent.set( - loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr)); + loadFromURL(u"private:factory/swriter"_ustr); // Insert a file as an embedded object. uno::Reference xStorage = comphelper::OStorageHelper::GetTemporaryStorage(); @@ -79,8 +78,7 @@ CPPUNIT_TEST_FIXTURE(Test, testInsertFileConfigVsdx) officecfg::Office::Common::Filter::Microsoft::Import::VisioToDraw::set(true, pBatchReset); pBatchReset->commit(); }); - mxComponent.set( - loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr)); + loadFromURL(u"private:factory/swriter"_ustr); // Insert a file as an embedded object. uno::Reference xStorage = comphelper::OStorageHelper::GetTemporaryStorage(); @@ -112,8 +110,7 @@ CPPUNIT_TEST_FIXTURE(Test, testInsertFileConfigPdf) officecfg::Office::Common::Filter::Adobe::Import::PDFToDraw::set(true, pBatchReset); pBatchReset->commit(); }); - mxComponent.set( - loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr)); + loadFromURL(u"private:factory/swriter"_ustr); // Insert a PDF file as an embedded object. uno::Reference xStorage = comphelper::OStorageHelper::GetTemporaryStorage(); diff --git a/embeddedobj/qa/cppunit/msole.cxx b/embeddedobj/qa/cppunit/msole.cxx index 187472b0a79a..2aacb1ad2ffd 100644 --- a/embeddedobj/qa/cppunit/msole.cxx +++ b/embeddedobj/qa/cppunit/msole.cxx @@ -105,7 +105,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSaveOnThread) comphelper::makePropertyValue("FilterName", OUString("HTML (StarWriter)")), comphelper::makePropertyValue("FilterOptions", OUString("xhtmlns=reqif-xhtml")), }; - mxComponent = loadFromDesktop(aURL, "com.sun.star.text.TextDocument", aLoadProperties); + loadWithParams(aURL, aLoadProperties); // When saving that document on a thread: OdtExportThread aThread(mxComponent, maTempFile.GetURL()); diff --git a/filter/qa/pdf.cxx b/filter/qa/pdf.cxx index 293d79a46368..1fdd75baf886 100644 --- a/filter/qa/pdf.cxx +++ b/filter/qa/pdf.cxx @@ -71,8 +71,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSignCertificateSubjectName) } // Given an empty document: - mxComponent.set( - loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr)); + loadFromURL(u"private:factory/swriter"_ustr); // When exporting to PDF, and referring to a certificate using a subject name: uno::Reference xFactory = getMultiServiceFactory(); @@ -106,8 +105,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPdfDecompositionSize) return; // Given an empty Writer document: - mxComponent.set( - loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr)); + loadFromURL(u"private:factory/swriter"_ustr); // When inserting a 267 points wide PDF image into the document: uno::Sequence aArgs = { @@ -189,8 +187,7 @@ CPPUNIT_TEST_FIXTURE(Test, testWatermarkColor) std::shared_ptr pPDFium = vcl::pdf::PDFiumLibrary::get(); if (!pPDFium) return; - mxComponent.set( - loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr)); + loadFromURL(u"private:factory/swriter"_ustr); // When exporting that as PDF with a red watermark: uno::Reference xFactory = getMultiServiceFactory(); @@ -234,8 +231,7 @@ CPPUNIT_TEST_FIXTURE(Test, testWatermarkFontHeight) std::shared_ptr pPDFium = vcl::pdf::PDFiumLibrary::get(); if (!pPDFium) return; - mxComponent.set( - loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr)); + loadFromURL(u"private:factory/swriter"_ustr); // When exporting that as PDF with a 100pt-sized watermark: uno::Reference xFactory = getMultiServiceFactory(); @@ -280,8 +276,7 @@ CPPUNIT_TEST_FIXTURE(Test, testWatermarkFontName) std::shared_ptr pPDFium = vcl::pdf::PDFiumLibrary::get(); if (!pPDFium) return; - mxComponent.set( - loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr)); + loadFromURL(u"private:factory/swriter"_ustr); // When exporting that as PDF with a serif watermark: uno::Reference xFactory = getMultiServiceFactory(); @@ -326,8 +321,7 @@ CPPUNIT_TEST_FIXTURE(Test, testWatermarkRotateAngle) std::shared_ptr pPDFium = vcl::pdf::PDFiumLibrary::get(); if (!pPDFium) return; - mxComponent.set( - loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr)); + loadFromURL(u"private:factory/swriter"_ustr); // When exporting that as PDF with a rotated watermark: uno::Reference xFactory = getMultiServiceFactory(); @@ -405,7 +399,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSignCertificatePEM) comphelper::makePropertyValue("SignCertificateKeyPem", aKeyPem), comphelper::makePropertyValue("aSignCertificateCaPem", aCaPem), }; - mxComponent.set(loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument")); + loadFromURL(u"private:factory/swriter"_ustr); // When exporting to PDF, and referring to a certificate using a cert/key/ca PEM, which is not // in the NSS database: diff --git a/filter/qa/unit/svg.cxx b/filter/qa/unit/svg.cxx index f8bbe04fe92b..61372d1442f6 100644 --- a/filter/qa/unit/svg.cxx +++ b/filter/qa/unit/svg.cxx @@ -149,8 +149,7 @@ CPPUNIT_TEST_FIXTURE(SvgFilterTest, testSemiTransparentText) CPPUNIT_TEST_FIXTURE(SvgFilterTest, testSemiTransparentMultiParaText) { // Given a shape with semi-transparent, multi-paragraph text: - mxComponent = loadFromDesktop(u"private:factory/simpress"_ustr, - u"com.sun.star.drawing.DrawingDocument"_ustr); + loadFromURL(u"private:factory/simpress"_ustr); uno::Reference xFactory(mxComponent, uno::UNO_QUERY); uno::Reference xShape( xFactory->createInstance(u"com.sun.star.drawing.TextShape"_ustr), uno::UNO_QUERY); @@ -266,8 +265,7 @@ CPPUNIT_TEST_FIXTURE(SvgFilterTest, attributeRedefinedTest) CPPUNIT_TEST_FIXTURE(SvgFilterTest, testTab) { // Given a shape with "A\tB" text: - mxComponent = loadFromDesktop(u"private:factory/simpress"_ustr, - u"com.sun.star.presentation.PresentationDocument"_ustr); + loadFromURL(u"private:factory/simpress"_ustr); uno::Reference xFactory(mxComponent, uno::UNO_QUERY); uno::Reference xShape( xFactory->createInstance(u"com.sun.star.drawing.TextShape"_ustr), uno::UNO_QUERY); diff --git a/filter/qa/unit/textfilterdetect.cxx b/filter/qa/unit/textfilterdetect.cxx index 2a5af96f47de..8c13da5461fd 100644 --- a/filter/qa/unit/textfilterdetect.cxx +++ b/filter/qa/unit/textfilterdetect.cxx @@ -204,7 +204,7 @@ CPPUNIT_TEST_FIXTURE(TextFilterDetectTest, testHybridPDFFile) CPPUNIT_ASSERT_EQUAL( osl::FileBase::E_None, osl::File::copy(createFileURL(u"hybrid_writer.pdf"), nonAsciiName.GetURL())); - load(nonAsciiName.GetURL()); + loadFromURL(nonAsciiName.GetURL()); // Make sure it opens in Writer. // Without the accompanying fix in place, this test would have failed on Windows, as it was // opened in Draw instead. @@ -218,7 +218,7 @@ CPPUNIT_TEST_FIXTURE(TextFilterDetectTest, testHybridPDFFile) CPPUNIT_ASSERT_EQUAL( osl::FileBase::E_None, osl::File::copy(createFileURL(u"hybrid_calc.pdf"), nonAsciiName.GetURL())); - load(nonAsciiName.GetURL()); + loadFromURL(nonAsciiName.GetURL()); // Make sure it opens in Calc. CPPUNIT_ASSERT(supportsService(mxComponent, "com.sun.star.sheet.SpreadsheetDocument")); } @@ -230,7 +230,7 @@ CPPUNIT_TEST_FIXTURE(TextFilterDetectTest, testHybridPDFFile) CPPUNIT_ASSERT_EQUAL( osl::FileBase::E_None, osl::File::copy(createFileURL(u"hybrid_impress.pdf"), nonAsciiName.GetURL())); - load(nonAsciiName.GetURL()); + loadFromURL(nonAsciiName.GetURL()); // Make sure it opens in Impress. CPPUNIT_ASSERT( supportsService(mxComponent, "com.sun.star.presentation.PresentationDocument")); diff --git a/framework/qa/cppunit/dispatchtest.cxx b/framework/qa/cppunit/dispatchtest.cxx index a6c7ccd20a69..3e9710910970 100644 --- a/framework/qa/cppunit/dispatchtest.cxx +++ b/framework/qa/cppunit/dispatchtest.cxx @@ -151,8 +151,7 @@ public: CPPUNIT_TEST_FIXTURE(DispatchTest, testInterception) { - mxComponent - = loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xModel(mxComponent, uno::UNO_QUERY); CPPUNIT_ASSERT(xModel.is()); diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx index a28784543c9f..f09499bf2c5a 100644 --- a/include/test/unoapi_test.hxx +++ b/include/test/unoapi_test.hxx @@ -35,7 +35,7 @@ public: OUString createFileURL(std::u16string_view aFileBase); OUString createFilePath(std::u16string_view aFileBase); - void load(const OUString& rURL, const char* pPassword = nullptr); + void loadFromURL(const OUString& rURL, const char* pPassword = nullptr); void loadWithParams(const OUString& rURL, const css::uno::Sequence& rParams); OUString loadFromFile(std::u16string_view aFileBase, const char* pPassword = nullptr); diff --git a/sc/qa/extras/scannotationshapeobj.cxx b/sc/qa/extras/scannotationshapeobj.cxx index 2346c47b9107..bee2158e82d0 100644 --- a/sc/qa/extras/scannotationshapeobj.cxx +++ b/sc/qa/extras/scannotationshapeobj.cxx @@ -100,7 +100,7 @@ ScAnnotationShapeObj::ScAnnotationShapeObj() void ScAnnotationShapeObj::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } void ScAnnotationShapeObj::tearDown() diff --git a/sc/qa/extras/scarealinkobj.cxx b/sc/qa/extras/scarealinkobj.cxx index 03e9ec37977b..d79a5f831cb1 100644 --- a/sc/qa/extras/scarealinkobj.cxx +++ b/sc/qa/extras/scarealinkobj.cxx @@ -92,7 +92,7 @@ uno::Reference ScAreaLinkObj::init() void ScAreaLinkObj::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScAreaLinkObj); diff --git a/sc/qa/extras/scarealinksobj.cxx b/sc/qa/extras/scarealinksobj.cxx index cf371347d60d..0464b0a13e46 100644 --- a/sc/qa/extras/scarealinksobj.cxx +++ b/sc/qa/extras/scarealinksobj.cxx @@ -86,7 +86,7 @@ uno::Reference ScAreaLinksObj::init() void ScAreaLinksObj::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScAreaLinksObj); diff --git a/sc/qa/extras/scautoformatobj.cxx b/sc/qa/extras/scautoformatobj.cxx index d3fa6ecc008e..57f9fcb3b875 100644 --- a/sc/qa/extras/scautoformatobj.cxx +++ b/sc/qa/extras/scautoformatobj.cxx @@ -104,7 +104,7 @@ uno::Reference ScAutoFormatObj::init() void ScAutoFormatObj::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScAutoFormatObj); diff --git a/sc/qa/extras/scautoformatsobj.cxx b/sc/qa/extras/scautoformatsobj.cxx index 84fd31f397f4..d000ee4a51ab 100644 --- a/sc/qa/extras/scautoformatsobj.cxx +++ b/sc/qa/extras/scautoformatsobj.cxx @@ -119,7 +119,7 @@ void ScAutoFormatsObj::setUp() { UnoApiTest::setUp(); // create calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScAutoFormatsObj); diff --git a/sc/qa/extras/sccellfieldsobj.cxx b/sc/qa/extras/sccellfieldsobj.cxx index 5cde219c0dd7..3eafa094ea39 100644 --- a/sc/qa/extras/sccellfieldsobj.cxx +++ b/sc/qa/extras/sccellfieldsobj.cxx @@ -89,7 +89,7 @@ uno::Reference ScCellFieldsObj::init() void ScCellFieldsObj::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScCellFieldsObj); diff --git a/sc/qa/extras/sccellformatsenumeration.cxx b/sc/qa/extras/sccellformatsenumeration.cxx index 9e887571e8bf..a1b6d4944c83 100644 --- a/sc/qa/extras/sccellformatsenumeration.cxx +++ b/sc/qa/extras/sccellformatsenumeration.cxx @@ -67,7 +67,7 @@ uno::Reference ScCellFormatsEnumeration::init() void ScCellFormatsEnumeration::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScCellFormatsEnumeration); diff --git a/sc/qa/extras/sccellformatsobj.cxx b/sc/qa/extras/sccellformatsobj.cxx index 160d63b082de..92ce9b6671c6 100644 --- a/sc/qa/extras/sccellformatsobj.cxx +++ b/sc/qa/extras/sccellformatsobj.cxx @@ -80,7 +80,7 @@ uno::Reference ScCellFormatsObj::init() void ScCellFormatsObj::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScCellFormatsObj); diff --git a/sc/qa/extras/sccellobj.cxx b/sc/qa/extras/sccellobj.cxx index 922acd55328d..9a0c74888508 100644 --- a/sc/qa/extras/sccellobj.cxx +++ b/sc/qa/extras/sccellobj.cxx @@ -129,7 +129,7 @@ uno::Reference ScCellObj::getXSpreadsheet() void ScCellObj::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScCellObj); diff --git a/sc/qa/extras/sccellrangesobj.cxx b/sc/qa/extras/sccellrangesobj.cxx index 0c32b1edc609..337796095134 100644 --- a/sc/qa/extras/sccellrangesobj.cxx +++ b/sc/qa/extras/sccellrangesobj.cxx @@ -134,7 +134,7 @@ void ScCellRangesObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScCellRangesObj); diff --git a/sc/qa/extras/sccellsearchobj.cxx b/sc/qa/extras/sccellsearchobj.cxx index 1493a461d9a3..53ddcd3271a8 100644 --- a/sc/qa/extras/sccellsearchobj.cxx +++ b/sc/qa/extras/sccellsearchobj.cxx @@ -88,7 +88,7 @@ void ScCellSearchObj::setUp() { UnoApiTest::setUp(); // create calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScCellSearchObj); diff --git a/sc/qa/extras/sccellsenumeration.cxx b/sc/qa/extras/sccellsenumeration.cxx index e3cee9bb4589..bea5a9b129a8 100644 --- a/sc/qa/extras/sccellsenumeration.cxx +++ b/sc/qa/extras/sccellsenumeration.cxx @@ -80,7 +80,7 @@ uno::Reference ScCellsEnumeration::init() void ScCellsEnumeration::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScCellsEnumeration); diff --git a/sc/qa/extras/sccellsobj.cxx b/sc/qa/extras/sccellsobj.cxx index be2ff14a37d9..ba00d3a5420a 100644 --- a/sc/qa/extras/sccellsobj.cxx +++ b/sc/qa/extras/sccellsobj.cxx @@ -87,7 +87,7 @@ uno::Reference ScCellsObj::init() void ScCellsObj::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScCellsObj); diff --git a/sc/qa/extras/scchartobj.cxx b/sc/qa/extras/scchartobj.cxx index 450362024b6b..9bae55ee6aef 100644 --- a/sc/qa/extras/scchartobj.cxx +++ b/sc/qa/extras/scchartobj.cxx @@ -169,7 +169,7 @@ void ScChartObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScChartObj); diff --git a/sc/qa/extras/scchartsobj.cxx b/sc/qa/extras/scchartsobj.cxx index 27f74dbeae4e..378fd325c19a 100644 --- a/sc/qa/extras/scchartsobj.cxx +++ b/sc/qa/extras/scchartsobj.cxx @@ -171,7 +171,7 @@ void ScChartsObj::setUp() { UnoApiTest::setUp(); // create calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScChartsObj); diff --git a/sc/qa/extras/sccheck_data_pilot_field.cxx b/sc/qa/extras/sccheck_data_pilot_field.cxx index 343d702d398b..a6094a9b26e8 100644 --- a/sc/qa/extras/sccheck_data_pilot_field.cxx +++ b/sc/qa/extras/sccheck_data_pilot_field.cxx @@ -75,7 +75,7 @@ uno::Reference CheckDataPilotField::init() // create a calc document if (!mxComponent.is()) // Load an empty document. - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); else return mxObject; diff --git a/sc/qa/extras/sccheck_data_pilot_table.cxx b/sc/qa/extras/sccheck_data_pilot_table.cxx index e864de6e0d02..9a7b02000ace 100644 --- a/sc/qa/extras/sccheck_data_pilot_table.cxx +++ b/sc/qa/extras/sccheck_data_pilot_table.cxx @@ -79,7 +79,7 @@ uno::Reference CheckDataPilotTable::init() // create a calc document if (!mxComponent.is()) // Load an empty document. - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); else return mxObject; diff --git a/sc/qa/extras/sccheck_xcell_ranges_query.cxx b/sc/qa/extras/sccheck_xcell_ranges_query.cxx index 82b4d5555e45..03079bf5f999 100644 --- a/sc/qa/extras/sccheck_xcell_ranges_query.cxx +++ b/sc/qa/extras/sccheck_xcell_ranges_query.cxx @@ -55,7 +55,7 @@ uno::Reference CheckXCellRangesQuery::init() // create a calc document if (!mxComponent.is()) // Load an empty document. - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); uno::Reference xSheetDoc(mxComponent, uno::UNO_QUERY_THROW); diff --git a/sc/qa/extras/scconsolidationdescriptorobj.cxx b/sc/qa/extras/scconsolidationdescriptorobj.cxx index 96bd1e45bff7..99a008d2698d 100644 --- a/sc/qa/extras/scconsolidationdescriptorobj.cxx +++ b/sc/qa/extras/scconsolidationdescriptorobj.cxx @@ -66,7 +66,7 @@ void ScConsolidationDescriptorObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScConsolidationDescriptorObj); diff --git a/sc/qa/extras/scdatabaserangesobj.cxx b/sc/qa/extras/scdatabaserangesobj.cxx index bd7953fb3c42..ae0df82889ed 100644 --- a/sc/qa/extras/scdatabaserangesobj.cxx +++ b/sc/qa/extras/scdatabaserangesobj.cxx @@ -102,7 +102,7 @@ void ScDatabaseRangesObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScDatabaseRangesObj); diff --git a/sc/qa/extras/scdatapilotfieldgroupitemobj.cxx b/sc/qa/extras/scdatapilotfieldgroupitemobj.cxx index 8ad6b575696f..c461d6e7b563 100644 --- a/sc/qa/extras/scdatapilotfieldgroupitemobj.cxx +++ b/sc/qa/extras/scdatapilotfieldgroupitemobj.cxx @@ -174,7 +174,7 @@ void ScDataPilotFieldGroupItemObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScDataPilotFieldGroupItemObj); diff --git a/sc/qa/extras/scdatapilotfieldgroupobj.cxx b/sc/qa/extras/scdatapilotfieldgroupobj.cxx index 78282f2717b1..e80da20f14a3 100644 --- a/sc/qa/extras/scdatapilotfieldgroupobj.cxx +++ b/sc/qa/extras/scdatapilotfieldgroupobj.cxx @@ -198,7 +198,7 @@ void ScDataPilotFieldGroupObj::setUp() { UnoApiTest::setUp(); // create calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScDataPilotFieldGroupObj); diff --git a/sc/qa/extras/scdatapilotfieldgroupsobj.cxx b/sc/qa/extras/scdatapilotfieldgroupsobj.cxx index b068f3a1c5ea..d221ab9fd3ee 100644 --- a/sc/qa/extras/scdatapilotfieldgroupsobj.cxx +++ b/sc/qa/extras/scdatapilotfieldgroupsobj.cxx @@ -204,7 +204,7 @@ void ScDataPilotFieldGroupsObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScDataPilotFieldGroupsObj); diff --git a/sc/qa/extras/scdatapilotfieldsobj.cxx b/sc/qa/extras/scdatapilotfieldsobj.cxx index f473f0344dd4..80eafb625914 100644 --- a/sc/qa/extras/scdatapilotfieldsobj.cxx +++ b/sc/qa/extras/scdatapilotfieldsobj.cxx @@ -116,7 +116,7 @@ void ScDataPilotFieldsObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScDataPilotFieldsObj); diff --git a/sc/qa/extras/scdatapilotitemobj.cxx b/sc/qa/extras/scdatapilotitemobj.cxx index b0bda678f4b6..c8ed93f3ff02 100644 --- a/sc/qa/extras/scdatapilotitemobj.cxx +++ b/sc/qa/extras/scdatapilotitemobj.cxx @@ -118,7 +118,7 @@ void ScDataPilotItemObj::setUp() { UnoApiTest::setUp(); // create calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScDataPilotItemObj); diff --git a/sc/qa/extras/scdatapilotitemsobj.cxx b/sc/qa/extras/scdatapilotitemsobj.cxx index ad0f81a93597..419e33f0da60 100644 --- a/sc/qa/extras/scdatapilotitemsobj.cxx +++ b/sc/qa/extras/scdatapilotitemsobj.cxx @@ -144,7 +144,7 @@ void ScDataPilotItemsObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScDataPilotItemsObj); diff --git a/sc/qa/extras/scdatapilottablesobj.cxx b/sc/qa/extras/scdatapilottablesobj.cxx index 725e98dc3b1d..79c662e3613d 100644 --- a/sc/qa/extras/scdatapilottablesobj.cxx +++ b/sc/qa/extras/scdatapilottablesobj.cxx @@ -129,7 +129,7 @@ void ScDataPilotTablesObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScDataPilotTablesObj); diff --git a/sc/qa/extras/scddelinkobj.cxx b/sc/qa/extras/scddelinkobj.cxx index 5ee38298638e..3132e3ba8efd 100644 --- a/sc/qa/extras/scddelinkobj.cxx +++ b/sc/qa/extras/scddelinkobj.cxx @@ -95,7 +95,7 @@ void ScDDELinkObj::setUp() Application::SetAppName(u"soffice"_ustr); // Enable DDE UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); createTempCopy(u"ScDDELinksObj.ods"); } diff --git a/sc/qa/extras/scddelinksobj.cxx b/sc/qa/extras/scddelinksobj.cxx index 7b6d25e39da7..b57ecc2dacf5 100644 --- a/sc/qa/extras/scddelinksobj.cxx +++ b/sc/qa/extras/scddelinksobj.cxx @@ -117,7 +117,7 @@ void ScDDELinksObj::setUp() Application::SetAppName(u"soffice"_ustr); // Enable DDE UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScDDELinksObj); diff --git a/sc/qa/extras/scdocumentconfigurationobj.cxx b/sc/qa/extras/scdocumentconfigurationobj.cxx index 136b6c05bceb..8161daee6e86 100644 --- a/sc/qa/extras/scdocumentconfigurationobj.cxx +++ b/sc/qa/extras/scdocumentconfigurationobj.cxx @@ -55,7 +55,7 @@ void ScDocumentConfigurationObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScDocumentConfigurationObj); diff --git a/sc/qa/extras/scdrawpageobj.cxx b/sc/qa/extras/scdrawpageobj.cxx index 95345434cff5..dedc726e9007 100644 --- a/sc/qa/extras/scdrawpageobj.cxx +++ b/sc/qa/extras/scdrawpageobj.cxx @@ -107,7 +107,7 @@ void ScDrawPageObj::setUp() { UnoApiTest::setUp(); // create calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScDrawPageObj); diff --git a/sc/qa/extras/scdrawpagesobj.cxx b/sc/qa/extras/scdrawpagesobj.cxx index 009372140492..6119bf2b08c8 100644 --- a/sc/qa/extras/scdrawpagesobj.cxx +++ b/sc/qa/extras/scdrawpagesobj.cxx @@ -87,7 +87,7 @@ void ScDrawPagesObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScDrawPagesObj); diff --git a/sc/qa/extras/sceditfieldobj_cell.cxx b/sc/qa/extras/sceditfieldobj_cell.cxx index da7f66a701d3..4c13bdc4db8d 100644 --- a/sc/qa/extras/sceditfieldobj_cell.cxx +++ b/sc/qa/extras/sceditfieldobj_cell.cxx @@ -101,7 +101,7 @@ void ScEditFieldObj_Cell::setUp() { UnoApiTest::setUp(); // Load an empty document. - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } void ScEditFieldObj_Cell::tearDown() diff --git a/sc/qa/extras/sceditfieldobj_header.cxx b/sc/qa/extras/sceditfieldobj_header.cxx index 4e60441134ab..6d744f236e56 100644 --- a/sc/qa/extras/sceditfieldobj_header.cxx +++ b/sc/qa/extras/sceditfieldobj_header.cxx @@ -98,7 +98,7 @@ void ScEditFieldObj_Header::setUp() { UnoApiTest::setUp(); // Load an empty document. - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } void ScEditFieldObj_Header::tearDown() diff --git a/sc/qa/extras/scfilterdescriptorbase.cxx b/sc/qa/extras/scfilterdescriptorbase.cxx index 47d3d46e9dfb..a86d1f9d95c1 100644 --- a/sc/qa/extras/scfilterdescriptorbase.cxx +++ b/sc/qa/extras/scfilterdescriptorbase.cxx @@ -99,7 +99,7 @@ void ScFilterDescriptorBase::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScFilterDescriptorBase); diff --git a/sc/qa/extras/scfunctiondescriptionobj.cxx b/sc/qa/extras/scfunctiondescriptionobj.cxx index 47777320cd0a..b58aaee1bb06 100644 --- a/sc/qa/extras/scfunctiondescriptionobj.cxx +++ b/sc/qa/extras/scfunctiondescriptionobj.cxx @@ -67,7 +67,7 @@ void ScFunctionDescriptionObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScFunctionDescriptionObj); diff --git a/sc/qa/extras/scfunctionlistobj.cxx b/sc/qa/extras/scfunctionlistobj.cxx index f5260744a220..43ffd0dada67 100644 --- a/sc/qa/extras/scfunctionlistobj.cxx +++ b/sc/qa/extras/scfunctionlistobj.cxx @@ -95,7 +95,7 @@ void ScFunctionListObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScFunctionListObj); diff --git a/sc/qa/extras/scheaderfieldsobj.cxx b/sc/qa/extras/scheaderfieldsobj.cxx index fa9f1c936d96..afbaf826136a 100644 --- a/sc/qa/extras/scheaderfieldsobj.cxx +++ b/sc/qa/extras/scheaderfieldsobj.cxx @@ -101,7 +101,7 @@ void ScHeaderFieldsObj::setUp() { UnoApiTest::setUp(); // create calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } void ScHeaderFieldsObj::tearDown() diff --git a/sc/qa/extras/scheaderfootercontentobj.cxx b/sc/qa/extras/scheaderfootercontentobj.cxx index 908a68e29e9c..d70cebb43054 100644 --- a/sc/qa/extras/scheaderfootercontentobj.cxx +++ b/sc/qa/extras/scheaderfootercontentobj.cxx @@ -81,7 +81,7 @@ void ScHeaderFooterContentObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScHeaderFooterContentObj); diff --git a/sc/qa/extras/scimportdescriptorbaseobj.cxx b/sc/qa/extras/scimportdescriptorbaseobj.cxx index 43a22f2396d1..4abf5c5fe628 100644 --- a/sc/qa/extras/scimportdescriptorbaseobj.cxx +++ b/sc/qa/extras/scimportdescriptorbaseobj.cxx @@ -75,7 +75,7 @@ void ScImportDescriptorBaseObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScImportDescriptorBaseObj); diff --git a/sc/qa/extras/scindexenumeration_cellannotationsenumeration.cxx b/sc/qa/extras/scindexenumeration_cellannotationsenumeration.cxx index c479e03e1e5e..5f12835d667b 100644 --- a/sc/qa/extras/scindexenumeration_cellannotationsenumeration.cxx +++ b/sc/qa/extras/scindexenumeration_cellannotationsenumeration.cxx @@ -73,7 +73,7 @@ uno::Reference ScIndexEnumeration_CellAnnotationsEnumeration::i void ScIndexEnumeration_CellAnnotationsEnumeration::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScIndexEnumeration_CellAnnotationsEnumeration); diff --git a/sc/qa/extras/scindexenumeration_cellarealinksenumeration.cxx b/sc/qa/extras/scindexenumeration_cellarealinksenumeration.cxx index a11a77efd87d..a5775d28d353 100644 --- a/sc/qa/extras/scindexenumeration_cellarealinksenumeration.cxx +++ b/sc/qa/extras/scindexenumeration_cellarealinksenumeration.cxx @@ -66,7 +66,7 @@ uno::Reference ScIndexEnumeration_CellAreaLinksEnumeration::ini void ScIndexEnumeration_CellAreaLinksEnumeration::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScIndexEnumeration_CellAreaLinksEnumeration); diff --git a/sc/qa/extras/scindexenumeration_databaserangesenumeration.cxx b/sc/qa/extras/scindexenumeration_databaserangesenumeration.cxx index 0281e83b0ad1..9b18ecd75392 100644 --- a/sc/qa/extras/scindexenumeration_databaserangesenumeration.cxx +++ b/sc/qa/extras/scindexenumeration_databaserangesenumeration.cxx @@ -64,7 +64,7 @@ uno::Reference ScIndexEnumeration_DatabaseRangesEnumeration::in void ScIndexEnumeration_DatabaseRangesEnumeration::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScIndexEnumeration_DatabaseRangesEnumeration); diff --git a/sc/qa/extras/scindexenumeration_datapilotfieldsenumeration.cxx b/sc/qa/extras/scindexenumeration_datapilotfieldsenumeration.cxx index f07179cc0cfa..3b9fb09c6a90 100644 --- a/sc/qa/extras/scindexenumeration_datapilotfieldsenumeration.cxx +++ b/sc/qa/extras/scindexenumeration_datapilotfieldsenumeration.cxx @@ -87,7 +87,7 @@ uno::Reference ScIndexEnumeration_DataPilotFieldsEnumeration::i void ScIndexEnumeration_DataPilotFieldsEnumeration::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScIndexEnumeration_DataPilotFieldsEnumeration); diff --git a/sc/qa/extras/scindexenumeration_datapilotitemsenumeration.cxx b/sc/qa/extras/scindexenumeration_datapilotitemsenumeration.cxx index a7ec46bc828c..b6b6b387fc6d 100644 --- a/sc/qa/extras/scindexenumeration_datapilotitemsenumeration.cxx +++ b/sc/qa/extras/scindexenumeration_datapilotitemsenumeration.cxx @@ -120,7 +120,7 @@ void ScIndexEnumeration_DataPilotItemsEnumeration::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScIndexEnumeration_DataPilotItemsEnumeration); diff --git a/sc/qa/extras/scindexenumeration_datapilottablesenumeration.cxx b/sc/qa/extras/scindexenumeration_datapilottablesenumeration.cxx index 021a58c9f2e7..3dc3199ad256 100644 --- a/sc/qa/extras/scindexenumeration_datapilottablesenumeration.cxx +++ b/sc/qa/extras/scindexenumeration_datapilottablesenumeration.cxx @@ -86,7 +86,7 @@ uno::Reference ScIndexEnumeration_DataPilotTablesEnumeration::i void ScIndexEnumeration_DataPilotTablesEnumeration::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScIndexEnumeration_DataPilotTablesEnumeration); diff --git a/sc/qa/extras/scindexenumeration_ddelinksenumeration.cxx b/sc/qa/extras/scindexenumeration_ddelinksenumeration.cxx index 90aad1959f96..ae42513aaff0 100644 --- a/sc/qa/extras/scindexenumeration_ddelinksenumeration.cxx +++ b/sc/qa/extras/scindexenumeration_ddelinksenumeration.cxx @@ -75,7 +75,7 @@ uno::Reference ScIndexEnumeration_DDELinksEnumeration::init() void ScIndexEnumeration_DDELinksEnumeration::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScIndexEnumeration_DDELinksEnumeration); diff --git a/sc/qa/extras/scindexenumeration_functiondescriptionenumeration.cxx b/sc/qa/extras/scindexenumeration_functiondescriptionenumeration.cxx index f6049742d803..ee3cb8d21065 100644 --- a/sc/qa/extras/scindexenumeration_functiondescriptionenumeration.cxx +++ b/sc/qa/extras/scindexenumeration_functiondescriptionenumeration.cxx @@ -62,7 +62,7 @@ uno::Reference ScIndexEnumeration_FunctionDescriptionEnumeratio void ScIndexEnumeration_FunctionDescriptionEnumeration::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScIndexEnumeration_FunctionDescriptionEnumeration); diff --git a/sc/qa/extras/scindexenumeration_labelrangesenumeration.cxx b/sc/qa/extras/scindexenumeration_labelrangesenumeration.cxx index d38234251aab..223ef3db0f29 100644 --- a/sc/qa/extras/scindexenumeration_labelrangesenumeration.cxx +++ b/sc/qa/extras/scindexenumeration_labelrangesenumeration.cxx @@ -66,7 +66,7 @@ uno::Reference ScIndexEnumeration_LabelRangesEnumeration::init( void ScIndexEnumeration_LabelRangesEnumeration::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScIndexEnumeration_LabelRangesEnumeration); diff --git a/sc/qa/extras/scindexenumeration_namedrangesenumeration.cxx b/sc/qa/extras/scindexenumeration_namedrangesenumeration.cxx index 18257e74810e..d072bbdb0adf 100644 --- a/sc/qa/extras/scindexenumeration_namedrangesenumeration.cxx +++ b/sc/qa/extras/scindexenumeration_namedrangesenumeration.cxx @@ -71,7 +71,7 @@ uno::Reference ScIndexEnumeration_NamedRangesEnumeration::init( void ScIndexEnumeration_NamedRangesEnumeration::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScIndexEnumeration_NamedRangesEnumeration); diff --git a/sc/qa/extras/scindexenumeration_scenariosenumeration.cxx b/sc/qa/extras/scindexenumeration_scenariosenumeration.cxx index 487d903b7783..e22ef5333150 100644 --- a/sc/qa/extras/scindexenumeration_scenariosenumeration.cxx +++ b/sc/qa/extras/scindexenumeration_scenariosenumeration.cxx @@ -80,7 +80,7 @@ uno::Reference ScIndexEnumeration_ScenariosEnumeration::init() void ScIndexEnumeration_ScenariosEnumeration::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScIndexEnumeration_ScenariosEnumeration); diff --git a/sc/qa/extras/scindexenumeration_sheetcellrangesenumeration.cxx b/sc/qa/extras/scindexenumeration_sheetcellrangesenumeration.cxx index dccef6edca68..9e799d032574 100644 --- a/sc/qa/extras/scindexenumeration_sheetcellrangesenumeration.cxx +++ b/sc/qa/extras/scindexenumeration_sheetcellrangesenumeration.cxx @@ -98,7 +98,7 @@ uno::Reference ScIndexEnumeration_SheetCellRangesEnumeration::i void ScIndexEnumeration_SheetCellRangesEnumeration::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScIndexEnumeration_SheetCellRangesEnumeration); diff --git a/sc/qa/extras/scindexenumeration_sheetlinksenumeration.cxx b/sc/qa/extras/scindexenumeration_sheetlinksenumeration.cxx index c87e7d1c8be4..e39ca0bc4c01 100644 --- a/sc/qa/extras/scindexenumeration_sheetlinksenumeration.cxx +++ b/sc/qa/extras/scindexenumeration_sheetlinksenumeration.cxx @@ -76,7 +76,7 @@ uno::Reference ScIndexEnumeration_SheetLinksEnumeration::init() void ScIndexEnumeration_SheetLinksEnumeration::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScIndexEnumeration_SheetLinksEnumeration); diff --git a/sc/qa/extras/scindexenumeration_spreadsheetsenumeration.cxx b/sc/qa/extras/scindexenumeration_spreadsheetsenumeration.cxx index b14172f1f465..d85d0e190a83 100644 --- a/sc/qa/extras/scindexenumeration_spreadsheetsenumeration.cxx +++ b/sc/qa/extras/scindexenumeration_spreadsheetsenumeration.cxx @@ -58,7 +58,7 @@ uno::Reference ScIndexEnumeration_SpreadsheetsEnumeration::init void ScIndexEnumeration_SpreadsheetsEnumeration::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScIndexEnumeration_SpreadsheetsEnumeration); diff --git a/sc/qa/extras/scindexenumeration_spreadsheetviewpanesenumeration.cxx b/sc/qa/extras/scindexenumeration_spreadsheetviewpanesenumeration.cxx index 27a9bdd4e115..b89f477d575b 100644 --- a/sc/qa/extras/scindexenumeration_spreadsheetviewpanesenumeration.cxx +++ b/sc/qa/extras/scindexenumeration_spreadsheetviewpanesenumeration.cxx @@ -67,7 +67,7 @@ uno::Reference ScIndexEnumeration_SpreadsheetViewPanesEnumerati void ScIndexEnumeration_SpreadsheetViewPanesEnumeration::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScIndexEnumeration_SpreadsheetViewPanesEnumeration); diff --git a/sc/qa/extras/scindexenumeration_subtotalfieldsenumeration.cxx b/sc/qa/extras/scindexenumeration_subtotalfieldsenumeration.cxx index de19501a727d..e44399384df0 100644 --- a/sc/qa/extras/scindexenumeration_subtotalfieldsenumeration.cxx +++ b/sc/qa/extras/scindexenumeration_subtotalfieldsenumeration.cxx @@ -74,7 +74,7 @@ uno::Reference ScIndexEnumeration_SubTotalFieldsEnumeration::in void ScIndexEnumeration_SubTotalFieldsEnumeration::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScIndexEnumeration_SubTotalFieldsEnumeration); diff --git a/sc/qa/extras/scindexenumeration_tableautoformatenumeration.cxx b/sc/qa/extras/scindexenumeration_tableautoformatenumeration.cxx index f4e641ada011..2253a7172962 100644 --- a/sc/qa/extras/scindexenumeration_tableautoformatenumeration.cxx +++ b/sc/qa/extras/scindexenumeration_tableautoformatenumeration.cxx @@ -60,7 +60,7 @@ uno::Reference ScIndexEnumeration_TableAutoFormatEnumeration::i void ScIndexEnumeration_TableAutoFormatEnumeration::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScIndexEnumeration_TableAutoFormatEnumeration); diff --git a/sc/qa/extras/scindexenumeration_tablechartsenumeration.cxx b/sc/qa/extras/scindexenumeration_tablechartsenumeration.cxx index 15b6d1b8abc8..2e6ab305db5c 100644 --- a/sc/qa/extras/scindexenumeration_tablechartsenumeration.cxx +++ b/sc/qa/extras/scindexenumeration_tablechartsenumeration.cxx @@ -138,7 +138,7 @@ uno::Reference ScIndexEnumeration_TableChartsEnumeration::init( void ScIndexEnumeration_TableChartsEnumeration::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScIndexEnumeration_TableChartsEnumeration); diff --git a/sc/qa/extras/scindexenumeration_tablecolumnsenumeration.cxx b/sc/qa/extras/scindexenumeration_tablecolumnsenumeration.cxx index 3f91b411f148..7b8c8914ee06 100644 --- a/sc/qa/extras/scindexenumeration_tablecolumnsenumeration.cxx +++ b/sc/qa/extras/scindexenumeration_tablecolumnsenumeration.cxx @@ -69,7 +69,7 @@ uno::Reference ScIndexEnumeration_TableColumnsEnumeration::init void ScIndexEnumeration_TableColumnsEnumeration::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScIndexEnumeration_TableColumnsEnumeration); diff --git a/sc/qa/extras/scindexenumeration_tableconditionalentryenumeration.cxx b/sc/qa/extras/scindexenumeration_tableconditionalentryenumeration.cxx index 2d32aee2a4da..606b4fa015e3 100644 --- a/sc/qa/extras/scindexenumeration_tableconditionalentryenumeration.cxx +++ b/sc/qa/extras/scindexenumeration_tableconditionalentryenumeration.cxx @@ -95,7 +95,7 @@ uno::Reference ScIndexEnumeration_TableConditionalEntryEnumerat void ScIndexEnumeration_TableConditionalEntryEnumeration::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScIndexEnumeration_TableConditionalEntryEnumeration); diff --git a/sc/qa/extras/scindexenumeration_tablerowsenumeration.cxx b/sc/qa/extras/scindexenumeration_tablerowsenumeration.cxx index 4411604f2d85..702d59bc98c8 100644 --- a/sc/qa/extras/scindexenumeration_tablerowsenumeration.cxx +++ b/sc/qa/extras/scindexenumeration_tablerowsenumeration.cxx @@ -73,7 +73,7 @@ uno::Reference ScIndexEnumeration_TableRowsEnumeration::init() void ScIndexEnumeration_TableRowsEnumeration::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScIndexEnumeration_TableRowsEnumeration); diff --git a/sc/qa/extras/scindexenumeration_textfieldenumeration.cxx b/sc/qa/extras/scindexenumeration_textfieldenumeration.cxx index 1011b9433046..1ae8033be217 100644 --- a/sc/qa/extras/scindexenumeration_textfieldenumeration.cxx +++ b/sc/qa/extras/scindexenumeration_textfieldenumeration.cxx @@ -78,7 +78,7 @@ uno::Reference ScIndexEnumeration_TextFieldEnumeration::init() void ScIndexEnumeration_TextFieldEnumeration::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScIndexEnumeration_TextFieldEnumeration); diff --git a/sc/qa/extras/sclabelrangeobj.cxx b/sc/qa/extras/sclabelrangeobj.cxx index 5a540fbeaddc..76d8b38c40d3 100644 --- a/sc/qa/extras/sclabelrangeobj.cxx +++ b/sc/qa/extras/sclabelrangeobj.cxx @@ -68,7 +68,7 @@ void ScLabelRangeObj::setUp() { UnoApiTest::setUp(); // create calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScLabelRangeObj); diff --git a/sc/qa/extras/sclabelrangesobj.cxx b/sc/qa/extras/sclabelrangesobj.cxx index b17af2e324ad..616204db51de 100644 --- a/sc/qa/extras/sclabelrangesobj.cxx +++ b/sc/qa/extras/sclabelrangesobj.cxx @@ -88,7 +88,7 @@ void ScLabelRangesObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScLabelRangesObj); diff --git a/sc/qa/extras/scpdfexport.cxx b/sc/qa/extras/scpdfexport.cxx index ec763d59b289..a0037a36341e 100644 --- a/sc/qa/extras/scpdfexport.cxx +++ b/sc/qa/extras/scpdfexport.cxx @@ -259,7 +259,7 @@ void ScPDFExportTest::testPopupRectangleSize_Tdf162955() void ScPDFExportTest::testExportRange_Tdf120161() { // create test document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); uno::Reference xModel(mxComponent, uno::UNO_QUERY); uno::Reference xDoc(xModel, uno::UNO_QUERY_THROW); uno::Reference xSheets(xDoc->getSheets(), UNO_SET_THROW); @@ -319,7 +319,7 @@ void ScPDFExportTest::testExportRange_Tdf120161() void ScPDFExportTest::testExportFitToPage_Tdf103516() { // create test document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); uno::Reference xModel(mxComponent, uno::UNO_QUERY); uno::Reference xDoc(xModel, uno::UNO_QUERY_THROW); uno::Reference xSheets(xDoc->getSheets(), UNO_SET_THROW); @@ -775,7 +775,7 @@ void ScPDFExportTest::testTdf120190() return; } - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); uno::Reference xModel(mxComponent, uno::UNO_QUERY); uno::Reference xDoc(mxComponent, uno::UNO_QUERY_THROW); diff --git a/sc/qa/extras/screcentfunctionsobj.cxx b/sc/qa/extras/screcentfunctionsobj.cxx index 0cb20b1be0d4..290f400529d0 100644 --- a/sc/qa/extras/screcentfunctionsobj.cxx +++ b/sc/qa/extras/screcentfunctionsobj.cxx @@ -56,7 +56,7 @@ void ScRecentFunctionsObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScRecentFunctionsObj); diff --git a/sc/qa/extras/screcordchanges.cxx b/sc/qa/extras/screcordchanges.cxx index 6dadf2215866..683265798198 100644 --- a/sc/qa/extras/screcordchanges.cxx +++ b/sc/qa/extras/screcordchanges.cxx @@ -35,7 +35,7 @@ public: void ScRecordChangesTest::testSetRecordChanges() { - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); uno::Reference xDocSettingsPropSet(xDoc, UNO_QUERY_THROW); diff --git a/sc/qa/extras/scscenariosobj.cxx b/sc/qa/extras/scscenariosobj.cxx index b0befc49a0b3..ac9da8d0b529 100644 --- a/sc/qa/extras/scscenariosobj.cxx +++ b/sc/qa/extras/scscenariosobj.cxx @@ -115,7 +115,7 @@ void ScScenariosObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScScenariosObj); diff --git a/sc/qa/extras/scshapeobj.cxx b/sc/qa/extras/scshapeobj.cxx index 0b02aae22468..d9a5d9e48159 100644 --- a/sc/qa/extras/scshapeobj.cxx +++ b/sc/qa/extras/scshapeobj.cxx @@ -112,7 +112,7 @@ void ScShapeObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScShapeObj); diff --git a/sc/qa/extras/scsheetlinkobj.cxx b/sc/qa/extras/scsheetlinkobj.cxx index 1a8139d3d4df..1606ab462aae 100644 --- a/sc/qa/extras/scsheetlinkobj.cxx +++ b/sc/qa/extras/scsheetlinkobj.cxx @@ -88,7 +88,7 @@ void ScSheetLinkObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScSheetLinkObj); diff --git a/sc/qa/extras/scsheetlinksobj.cxx b/sc/qa/extras/scsheetlinksobj.cxx index 4490a2051762..4964e2a7a6ee 100644 --- a/sc/qa/extras/scsheetlinksobj.cxx +++ b/sc/qa/extras/scsheetlinksobj.cxx @@ -101,7 +101,7 @@ void ScSheetLinksObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScSheetLinksObj); diff --git a/sc/qa/extras/scsortdescriptorbaseobj.cxx b/sc/qa/extras/scsortdescriptorbaseobj.cxx index 3e39468027ec..65216bb840fe 100644 --- a/sc/qa/extras/scsortdescriptorbaseobj.cxx +++ b/sc/qa/extras/scsortdescriptorbaseobj.cxx @@ -61,7 +61,7 @@ void ScSortDescriptorBaseObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScSortDescriptorBaseObj); diff --git a/sc/qa/extras/scspreadsheetsettings.cxx b/sc/qa/extras/scspreadsheetsettings.cxx index f8e950d8a122..3b5c52d85362 100644 --- a/sc/qa/extras/scspreadsheetsettings.cxx +++ b/sc/qa/extras/scspreadsheetsettings.cxx @@ -74,7 +74,7 @@ void ScSpreadsheetSettings::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScSpreadsheetSettings); diff --git a/sc/qa/extras/scspreadsheetsettingsobj.cxx b/sc/qa/extras/scspreadsheetsettingsobj.cxx index 611d44927f55..64712bc58a44 100644 --- a/sc/qa/extras/scspreadsheetsettingsobj.cxx +++ b/sc/qa/extras/scspreadsheetsettingsobj.cxx @@ -65,7 +65,7 @@ void ScSpreadsheetSettingsObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScSpreadsheetSettingsObj); diff --git a/sc/qa/extras/scstylefamiliesobj.cxx b/sc/qa/extras/scstylefamiliesobj.cxx index c5955c5a64a8..9c2634949538 100644 --- a/sc/qa/extras/scstylefamiliesobj.cxx +++ b/sc/qa/extras/scstylefamiliesobj.cxx @@ -118,7 +118,7 @@ void ScStyleFamiliesObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); m_xSrcComponent = loadFromDesktop(getTestURL()); } diff --git a/sc/qa/extras/scstylefamilyobj.cxx b/sc/qa/extras/scstylefamilyobj.cxx index c6d1ff1a300c..fce3eb6a619e 100644 --- a/sc/qa/extras/scstylefamilyobj.cxx +++ b/sc/qa/extras/scstylefamilyobj.cxx @@ -121,7 +121,7 @@ void ScStyleFamilyObj::setUp() { UnoApiTest::setUp(); // create calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScStyleFamilyObj); diff --git a/sc/qa/extras/scstyleobj.cxx b/sc/qa/extras/scstyleobj.cxx index 7ba9721a9ba2..b8a220126673 100644 --- a/sc/qa/extras/scstyleobj.cxx +++ b/sc/qa/extras/scstyleobj.cxx @@ -126,7 +126,7 @@ void ScStyleObj::setUp() { UnoApiTest::setUp(); // create calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScStyleObj); diff --git a/sc/qa/extras/scsubtotaldescriptorbase.cxx b/sc/qa/extras/scsubtotaldescriptorbase.cxx index 70a3f7949225..b888e5241f8a 100644 --- a/sc/qa/extras/scsubtotaldescriptorbase.cxx +++ b/sc/qa/extras/scsubtotaldescriptorbase.cxx @@ -113,7 +113,7 @@ void ScSubTotalDescriptorBase::setUp() { UnoApiTest::setUp(); // create calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScSubTotalDescriptorBase); diff --git a/sc/qa/extras/scsubtotalfieldobj.cxx b/sc/qa/extras/scsubtotalfieldobj.cxx index 98c2e25e7eae..15e907cc7b6f 100644 --- a/sc/qa/extras/scsubtotalfieldobj.cxx +++ b/sc/qa/extras/scsubtotalfieldobj.cxx @@ -76,7 +76,7 @@ void ScSubTotalFieldObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScSubTotalFieldObj); diff --git a/sc/qa/extras/sctablecolumnobj.cxx b/sc/qa/extras/sctablecolumnobj.cxx index f82a205571ff..c68f3fa6fd6e 100644 --- a/sc/qa/extras/sctablecolumnobj.cxx +++ b/sc/qa/extras/sctablecolumnobj.cxx @@ -138,7 +138,7 @@ void ScTableColumnObj::setUp() { UnoApiTest::setUp(); // create calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScTableColumnObj); diff --git a/sc/qa/extras/sctablecolumnsobj.cxx b/sc/qa/extras/sctablecolumnsobj.cxx index 7a1f5beca8f9..8dcf7a0cf4bf 100644 --- a/sc/qa/extras/sctablecolumnsobj.cxx +++ b/sc/qa/extras/sctablecolumnsobj.cxx @@ -126,7 +126,7 @@ void ScTableColumnsObj::setUp() { UnoApiTest::setUp(); // create calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScTableColumnsObj); diff --git a/sc/qa/extras/sctableconditionalentryobj.cxx b/sc/qa/extras/sctableconditionalentryobj.cxx index 87890fbfc0cc..e8e540565ea7 100644 --- a/sc/qa/extras/sctableconditionalentryobj.cxx +++ b/sc/qa/extras/sctableconditionalentryobj.cxx @@ -98,7 +98,7 @@ void ScTableConditionalEntryObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScTableConditionalEntryObj); diff --git a/sc/qa/extras/sctableconditionalformat.cxx b/sc/qa/extras/sctableconditionalformat.cxx index cca582242d6d..34ee81dbdd64 100644 --- a/sc/qa/extras/sctableconditionalformat.cxx +++ b/sc/qa/extras/sctableconditionalformat.cxx @@ -135,7 +135,7 @@ void ScTableConditionalFormat::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScTableConditionalFormat); diff --git a/sc/qa/extras/sctablerowobj.cxx b/sc/qa/extras/sctablerowobj.cxx index 5cb76f631708..2a57224c9eec 100644 --- a/sc/qa/extras/sctablerowobj.cxx +++ b/sc/qa/extras/sctablerowobj.cxx @@ -127,7 +127,7 @@ void ScTableRowObj::setUp() { UnoApiTest::setUp(); // create calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScTableRowObj); diff --git a/sc/qa/extras/sctablerowsobj.cxx b/sc/qa/extras/sctablerowsobj.cxx index 57fb39f3944c..ffc9766f7ae0 100644 --- a/sc/qa/extras/sctablerowsobj.cxx +++ b/sc/qa/extras/sctablerowsobj.cxx @@ -114,7 +114,7 @@ uno::Reference ScTableRowsObj::getXCellRange() void ScTableRowsObj::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScTableRowsObj); diff --git a/sc/qa/extras/sctablevalidationobj.cxx b/sc/qa/extras/sctablevalidationobj.cxx index 14cb1ee60832..ab1de153f275 100644 --- a/sc/qa/extras/sctablevalidationobj.cxx +++ b/sc/qa/extras/sctablevalidationobj.cxx @@ -101,7 +101,7 @@ void ScTableValidationObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScTableValidationObj); diff --git a/sc/qa/extras/sctabviewobj.cxx b/sc/qa/extras/sctabviewobj.cxx index a7f3c5cb2879..c9b8e4c7986a 100644 --- a/sc/qa/extras/sctabviewobj.cxx +++ b/sc/qa/extras/sctabviewobj.cxx @@ -120,7 +120,7 @@ uno::Reference ScTabViewObj::getXSpreadsheet(const sal_Int16 nN void ScTabViewObj::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScTabViewObj); diff --git a/sc/qa/extras/scuniquecellformatsenumeration.cxx b/sc/qa/extras/scuniquecellformatsenumeration.cxx index 241f68d3bd6c..5cce6c5222f4 100644 --- a/sc/qa/extras/scuniquecellformatsenumeration.cxx +++ b/sc/qa/extras/scuniquecellformatsenumeration.cxx @@ -100,7 +100,7 @@ uno::Reference ScUniqueCellFormatsEnumeration::init() void ScUniqueCellFormatsEnumeration::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } void ScUniqueCellFormatsEnumeration::changeColor(const uno::Reference& xSheet, diff --git a/sc/qa/extras/scuniquecellformatsobj.cxx b/sc/qa/extras/scuniquecellformatsobj.cxx index fdb47f751ce5..3486968e366d 100644 --- a/sc/qa/extras/scuniquecellformatsobj.cxx +++ b/sc/qa/extras/scuniquecellformatsobj.cxx @@ -79,7 +79,7 @@ uno::Reference ScUniqueCellFormatsObj::init() void ScUniqueCellFormatsObj::setUp() { UnoApiTest::setUp(); - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScUniqueCellFormatsObj); diff --git a/sc/qa/extras/scviewpaneobj.cxx b/sc/qa/extras/scviewpaneobj.cxx index c1d062d9a5b6..09fea1844d2b 100644 --- a/sc/qa/extras/scviewpaneobj.cxx +++ b/sc/qa/extras/scviewpaneobj.cxx @@ -117,7 +117,7 @@ void ScViewPaneObj::setUp() { UnoApiTest::setUp(); // create a calc document - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScViewPaneObj); diff --git a/sc/qa/extras/vba-macro-test.cxx b/sc/qa/extras/vba-macro-test.cxx index d6816dc72ac1..4dc1f0fe93c4 100644 --- a/sc/qa/extras/vba-macro-test.cxx +++ b/sc/qa/extras/vba-macro-test.cxx @@ -445,7 +445,7 @@ CPPUNIT_TEST_FIXTURE(VBAMacroTest, testVba) CPPUNIT_TEST_FIXTURE(VBAMacroTest, testTdf149579) { - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); css::uno::Reference xDocScr(mxComponent, uno::UNO_QUERY_THROW); auto xLibs = xDocScr->getBasicLibraries(); @@ -478,7 +478,7 @@ CPPUNIT_TEST_FIXTURE(VBAMacroTest, testTdf149579) CPPUNIT_TEST_FIXTURE(VBAMacroTest, testVbaRangeSort) { - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); css::uno::Reference xDocScr(mxComponent, uno::UNO_QUERY_THROW); auto xLibs = xDocScr->getBasicLibraries(); @@ -688,10 +688,10 @@ CPPUNIT_TEST_FIXTURE(VBAMacroTest, testTdf118247) CPPUNIT_TEST_FIXTURE(VBAMacroTest, testTdf126457) { - auto xComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); // Save a copy of the file to get its URL - uno::Reference xDocStorable(xComponent, uno::UNO_QUERY); + uno::Reference xDocStorable(mxComponent, uno::UNO_QUERY); utl::TempFileNamed aTempFile(u"testWindowsActivate", true, u".ods"); aTempFile.EnableKillingFile(); uno::Sequence descSaveAs( @@ -699,7 +699,7 @@ CPPUNIT_TEST_FIXTURE(VBAMacroTest, testTdf126457) xDocStorable->storeAsURL(aTempFile.GetURL(), descSaveAs); // Insert initial library - css::uno::Reference xDocScr(xComponent, uno::UNO_QUERY_THROW); + css::uno::Reference xDocScr(mxComponent, uno::UNO_QUERY_THROW); auto xLibs = xDocScr->getBasicLibraries(); auto xLibrary = xLibs->createLibrary(u"TestLibrary"_ustr); xLibrary->insertByName( @@ -729,12 +729,12 @@ CPPUNIT_TEST_FIXTURE(VBAMacroTest, testTdf126457) uno::Sequence aOutParamIndex; uno::Sequence aOutParam; - SfxObjectShell* pFoundShell = SfxObjectShell::GetShellFromComponent(xComponent); + SfxObjectShell* pFoundShell = SfxObjectShell::GetShellFromComponent(mxComponent); ScDocShell* pDocSh = static_cast(pFoundShell); CPPUNIT_ASSERT(pDocSh); ErrCode result - = SfxObjectShell::CallXScript(xComponent, + = SfxObjectShell::CallXScript(mxComponent, u"vnd.sun.Star.script:TestLibrary.TestModule." "TestWindowsActivate?language=Basic&location=document"_ustr, {}, aRet, aOutParamIndex, aOutParam); @@ -744,13 +744,11 @@ CPPUNIT_TEST_FIXTURE(VBAMacroTest, testTdf126457) sal_Int16 nReturnValue; aRet >>= nReturnValue; CPPUNIT_ASSERT_EQUAL(sal_Int16(0), nReturnValue); - - pDocSh->DoClose(); } CPPUNIT_TEST_FIXTURE(VBAMacroTest, testVbaPDFExport) { - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); // Save a copy of the file to get its URL uno::Reference xDocStorable(mxComponent, uno::UNO_QUERY); diff --git a/sc/qa/unit/ThemeImportExportTest.cxx b/sc/qa/unit/ThemeImportExportTest.cxx index db1069bceea0..f2c7e8b0639a 100644 --- a/sc/qa/unit/ThemeImportExportTest.cxx +++ b/sc/qa/unit/ThemeImportExportTest.cxx @@ -34,7 +34,7 @@ public: CPPUNIT_TEST_FIXTURE(ThemeImportExportTest, testThemeExportAndImport) { - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); { uno::Reference xPropertySet(mxComponent, uno::UNO_QUERY_THROW); diff --git a/sc/qa/unit/anchor.cxx b/sc/qa/unit/anchor.cxx index d5f5975f5e45..6c4cf87a3921 100644 --- a/sc/qa/unit/anchor.cxx +++ b/sc/qa/unit/anchor.cxx @@ -159,7 +159,7 @@ void ScAnchorTest::testUndoAnchor() void ScAnchorTest::testTdf76183() { - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); SfxObjectShell* pFoundShell = SfxObjectShell::GetShellFromComponent(mxComponent); ScDocShell* pDocSh = dynamic_cast(pFoundShell); ScDocument& rDoc = pDocSh->GetDocument(); diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx index bde09d28b14a..b24072714cb5 100644 --- a/sc/qa/unit/helper/qahelper.cxx +++ b/sc/qa/unit/helper/qahelper.cxx @@ -572,7 +572,7 @@ void ScUcalcTestBase::tearDown() void ScModelTestBase::createScDoc(const char* pName, const char* pPassword, bool bCheckWarningError) { if (!pName) - load(u"private:factory/scalc"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); else loadFromFile(OUString::createFromAscii(pName), pPassword); diff --git a/sd/qa/filter/eppt/eppt.cxx b/sd/qa/filter/eppt/eppt.cxx index ef84dfc46cb1..0d3c554e4b76 100644 --- a/sd/qa/filter/eppt/eppt.cxx +++ b/sd/qa/filter/eppt/eppt.cxx @@ -56,7 +56,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOOXMLCustomShapeBitmapFill) CPPUNIT_TEST_FIXTURE(Test, testThemeExport) { // Given a document with a master slide and a theme, lt1 is set to 0x000002: - mxComponent = loadFromDesktop(u"private:factory/simpress"_ustr); + loadFromURL(u"private:factory/simpress"_ustr); { uno::Reference xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xDrawPage( diff --git a/sd/qa/unit/SdrPdfImportTest.cxx b/sd/qa/unit/SdrPdfImportTest.cxx index b6ee1b41c3d8..da4298d5fe7c 100644 --- a/sd/qa/unit/SdrPdfImportTest.cxx +++ b/sd/qa/unit/SdrPdfImportTest.cxx @@ -238,7 +238,7 @@ CPPUNIT_TEST_FIXTURE(SdrPdfImportTest, testAnnotationsImportExport) pPDFAnnotation2->getSubType()); // Pop-up annotation // Load document again - mxComponent = loadFromDesktop(maTempFile.GetURL()); + loadFromURL(maTempFile.GetURL()); auto pNewImpressDocument = dynamic_cast(mxComponent.get()); sd::ViewShell* pNewViewShell = pNewImpressDocument->GetDocShell()->GetViewShell(); CPPUNIT_ASSERT(pNewViewShell); diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx index 18b1488ec340..000e5992fa6d 100644 --- a/sd/qa/unit/sdmodeltestbase.hxx +++ b/sd/qa/unit/sdmodeltestbase.hxx @@ -49,7 +49,7 @@ public: void createSdImpressDoc(const char* pName = nullptr, const char* pPassword = nullptr) { if (!pName) - load(u"private:factory/simpress"_ustr); + loadFromURL(u"private:factory/simpress"_ustr); else loadFromFile(OUString::createFromAscii(pName), pPassword); @@ -63,7 +63,7 @@ public: void createSdDrawDoc(const char* pName = nullptr, const char* pPassword = nullptr) { if (!pName) - load(u"private:factory/sdraw"_ustr); + loadFromURL(u"private:factory/sdraw"_ustr); else loadFromFile(OUString::createFromAscii(pName), pPassword); diff --git a/sfx2/qa/cppunit/doc.cxx b/sfx2/qa/cppunit/doc.cxx index 92bfadd363e9..b16c078ef412 100644 --- a/sfx2/qa/cppunit/doc.cxx +++ b/sfx2/qa/cppunit/doc.cxx @@ -41,7 +41,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNoGrabBagShape) // Load a document and select the first shape. css::uno::Sequence aArgs{ comphelper::makePropertyValue( u"ReadOnly"_ustr, true) }; - mxComponent = loadFromDesktop(u"private:factory/simpress"_ustr, u""_ustr, aArgs); + loadWithParams(u"private:factory/simpress"_ustr, aArgs); uno::Reference xModel(mxComponent, uno::UNO_QUERY); uno::Reference xDrawPagesSupplier(xModel, uno::UNO_QUERY); uno::Reference xDrawPage( @@ -65,7 +65,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNoGrabBagShape) CPPUNIT_TEST_FIXTURE(Test, testTempFilePath) { // Create a test file in a directory that contains the URL-encoded "testÿ" string. - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); auto pBaseModel = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pBaseModel); OUString aTargetDir @@ -75,10 +75,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTempFilePath) css::uno::Sequence aArgs{ comphelper::makePropertyValue( u"FilterName"_ustr, u"writer8"_ustr) }; pBaseModel->storeAsURL(aTargetFile, aArgs); - mxComponent->dispose(); // Load it and export to PDF. - mxComponent = loadFromDesktop(aTargetFile); + loadFromURL(aTargetFile); pBaseModel = dynamic_cast(mxComponent.get()); OUString aPdfTarget = aTargetDir + "/test.pdf"; css::uno::Sequence aPdfArgs{ comphelper::makePropertyValue( @@ -93,7 +92,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTempFilePath) CPPUNIT_TEST_FIXTURE(Test, testSetDocumentPropertiesUpdate) { // Given a document with 3 custom props, 2 Zotero ones and one other: - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); auto pBaseModel = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pBaseModel); uno::Reference xDP = pBaseModel->getDocumentProperties(); diff --git a/sfx2/qa/cppunit/test_classification.cxx b/sfx2/qa/cppunit/test_classification.cxx index d94d52ef5eb1..d2adb072ad03 100644 --- a/sfx2/qa/cppunit/test_classification.cxx +++ b/sfx2/qa/cppunit/test_classification.cxx @@ -82,7 +82,7 @@ void ClassificationTest::testClassification() void ClassificationTest::testWriter() { // Test SID_CLASSIFICATION_APPLY handling in SwDocShell::Execute(). - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); // This resulted in a beans::UnknownPropertyException when the request wasn't handled. testClassification(); } @@ -90,7 +90,7 @@ void ClassificationTest::testWriter() void ClassificationTest::testCalc() { // Test SID_CLASSIFICATION_APPLY handling in ScFormatShell::ExecuteStyle(). - mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr, u"com.sun.star.sheet.SpreadsheetDocument"_ustr); + loadFromURL(u"private:factory/scalc"_ustr); // This resulted in a beans::UnknownPropertyException when the request wasn't handled. testClassification(); } @@ -98,7 +98,7 @@ void ClassificationTest::testCalc() void ClassificationTest::testImpress() { // Test SID_CLASSIFICATION_APPLY handling in sd::DrawViewShell::FuTemporary(). - mxComponent = loadFromDesktop(u"private:factory/simpress"_ustr, u"com.sun.star.presentation.PresentationDocument"_ustr); + loadFromURL(u"private:factory/simpress"_ustr); // This resulted in a beans::UnknownPropertyException when the request wasn't handled. testClassification(); } diff --git a/sfx2/qa/cppunit/test_misc.cxx b/sfx2/qa/cppunit/test_misc.cxx index 019490d2c352..f8fc88722aa7 100644 --- a/sfx2/qa/cppunit/test_misc.cxx +++ b/sfx2/qa/cppunit/test_misc.cxx @@ -545,7 +545,7 @@ CPPUNIT_TEST_FIXTURE(MiscTest, testHardLinks) int nRet = link(aOld.getStr(), aNew.getStr()); CPPUNIT_ASSERT_EQUAL(0, nRet); - mxComponent = loadFromDesktop(aURL, u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(aURL); uno::Reference xStorable(mxComponent, uno::UNO_QUERY); xStorable->store(); @@ -580,7 +580,7 @@ CPPUNIT_TEST_FIXTURE(MiscTest, testtestOverwriteReadOnly) aFile.open(osl_File_OpenFlag_Create); aFile.close(); osl::File::setAttributes(aURL, osl_File_Attribute_OwnRead); - mxComponent = loadFromDesktop(aURL, u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(aURL); uno::Reference xStorable(mxComponent, uno::UNO_QUERY); bool bFail = false; @@ -604,8 +604,7 @@ CPPUNIT_TEST_FIXTURE(MiscTest, testtestOverwriteReadOnly) CPPUNIT_TEST_FIXTURE(MiscTest, testOverwrite) { // tdf#60237 - try to overwrite an existing file using the different settings of the Overwrite option - mxComponent - = loadFromDesktop(maTempFile.GetURL(), u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(maTempFile.GetURL()); uno::Reference xStorable(mxComponent, uno::UNO_QUERY); CPPUNIT_ASSERT(xStorable.is()); diff --git a/starmath/qa/extras/mmlexport-test.cxx b/starmath/qa/extras/mmlexport-test.cxx index ff9bbd121c38..c0b34afa3f76 100644 --- a/starmath/qa/extras/mmlexport-test.cxx +++ b/starmath/qa/extras/mmlexport-test.cxx @@ -55,7 +55,7 @@ void MathMLExportTest::registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) void MathMLExportTest::testBlank() { - mxComponent = loadFromDesktop(u"private:factory/smath"_ustr); + loadFromURL(u"private:factory/smath"_ustr); SfxBaseModel* pModel = dynamic_cast(mxComponent.get()); SmDocShell* pDocShell = static_cast(pModel->GetObjectShell()); pDocShell->SetText(u"x`y~~z"_ustr); @@ -68,7 +68,7 @@ void MathMLExportTest::testBlank() void MathMLExportTest::testTdf97049() { - mxComponent = loadFromDesktop(u"private:factory/smath"_ustr); + loadFromURL(u"private:factory/smath"_ustr); SfxBaseModel* pModel = dynamic_cast(mxComponent.get()); SmDocShell* pDocShell = static_cast(pModel->GetObjectShell()); pDocShell->SetText(u"intd {{1 over x} dx}"_ustr); @@ -107,7 +107,7 @@ void MathMLExportTest::checkMathVariant(SmDocShell& rDocShell, bool bCapital, bo void MathMLExportTest::testTdf101022() { - mxComponent = loadFromDesktop(u"private:factory/smath"_ustr); + loadFromURL(u"private:factory/smath"_ustr); SfxBaseModel* pModel = dynamic_cast(mxComponent.get()); SmDocShell* pDocShell = static_cast(pModel->GetObjectShell()); @@ -122,7 +122,7 @@ void MathMLExportTest::testTdf101022() void MathMLExportTest::testMaj() { - mxComponent = loadFromDesktop(u"private:factory/smath"_ustr); + loadFromURL(u"private:factory/smath"_ustr); SfxBaseModel* pModel = dynamic_cast(mxComponent.get()); SmDocShell* pDocShell = static_cast(pModel->GetObjectShell()); pDocShell->SetText( @@ -136,7 +136,7 @@ void MathMLExportTest::testMaj() void MathMLExportTest::testHadd() { - mxComponent = loadFromDesktop(u"private:factory/smath"_ustr); + loadFromURL(u"private:factory/smath"_ustr); SfxBaseModel* pModel = dynamic_cast(mxComponent.get()); SmDocShell* pDocShell = static_cast(pModel->GetObjectShell()); pDocShell->SetText(u"hadd to { \U0001EE4E } from { \U0001EE4E } \U0001EE4E"_ustr); diff --git a/svx/qa/unit/svdraw.cxx b/svx/qa/unit/svdraw.cxx index 38953cea741b..12cdd6093f20 100644 --- a/svx/qa/unit/svdraw.cxx +++ b/svx/qa/unit/svdraw.cxx @@ -89,7 +89,7 @@ xmlDocUniquePtr lcl_dumpAndParseFirstObjectWithAssert(SdrPage* pSdrPage) CPPUNIT_TEST_FIXTURE(SvdrawTest, testSemiTransparentText) { // Create a new Draw document with a rectangle. - mxComponent = loadFromDesktop(u"private:factory/sdraw"_ustr); + loadFromURL(u"private:factory/sdraw"_ustr); uno::Reference xFactory(mxComponent, uno::UNO_QUERY); uno::Reference xShape( xFactory->createInstance(u"com.sun.star.drawing.RectangleShape"_ustr), uno::UNO_QUERY); @@ -130,7 +130,7 @@ CPPUNIT_TEST_FIXTURE(SvdrawTest, testSemiTransparentText) CPPUNIT_TEST_FIXTURE(SvdrawTest, testHandlePathObjScale) { // Given a path object: - mxComponent = loadFromDesktop(u"private:factory/sdraw"_ustr); + loadFromURL(u"private:factory/sdraw"_ustr); uno::Reference xFactory(mxComponent, uno::UNO_QUERY); uno::Reference xShape( xFactory->createInstance(u"com.sun.star.drawing.ClosedBezierShape"_ustr), uno::UNO_QUERY); @@ -208,7 +208,7 @@ CPPUNIT_TEST_FIXTURE(SvdrawTest, testHandlePathObjScale) CPPUNIT_TEST_FIXTURE(SvdrawTest, testTextEditEmptyGrabBag) { // Given a document with a groupshape, which has 2 children. - mxComponent = loadFromDesktop(u"private:factory/sdraw"_ustr); + loadFromURL(u"private:factory/sdraw"_ustr); uno::Reference xFactory(mxComponent, uno::UNO_QUERY); uno::Reference xRect1( xFactory->createInstance(u"com.sun.star.drawing.RectangleShape"_ustr), uno::UNO_QUERY); diff --git a/svx/qa/unit/table.cxx b/svx/qa/unit/table.cxx index 23bebef0a315..8a1349f3e02c 100644 --- a/svx/qa/unit/table.cxx +++ b/svx/qa/unit/table.cxx @@ -105,8 +105,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableShadowBlur) CPPUNIT_TEST_FIXTURE(Test, testSvxTableControllerSetAttrToSelectedShape) { // Given a document with a table shape, editing cell text: - mxComponent = loadFromDesktop(u"private:factory/simpress"_ustr, - u"com.sun.star.presentation.PresentationDocument"_ustr); + loadFromURL(u"private:factory/simpress"_ustr); uno::Sequence aArgs = { comphelper::makePropertyValue(u"Rows"_ustr, sal_Int32(2)), comphelper::makePropertyValue(u"Columns"_ustr, sal_Int32(2)) }; diff --git a/svx/qa/unit/unodraw.cxx b/svx/qa/unit/unodraw.cxx index f18f51e29094..4bf5c6bf29a2 100644 --- a/svx/qa/unit/unodraw.cxx +++ b/svx/qa/unit/unodraw.cxx @@ -103,8 +103,7 @@ CPPUNIT_TEST_FIXTURE(UnodrawTest, testTdf93998) CPPUNIT_TEST_FIXTURE(UnodrawTest, testTableShadowDirect) { // Create an Impress document an insert a table shape. - mxComponent = loadFromDesktop(u"private:factory/simpress"_ustr, - u"com.sun.star.presentation.PresentationDocument"_ustr); + loadFromURL(u"private:factory/simpress"_ustr); uno::Reference xFactory(mxComponent, uno::UNO_QUERY); uno::Reference xShape( xFactory->createInstance(u"com.sun.star.drawing.TableShape"_ustr), uno::UNO_QUERY); @@ -160,8 +159,7 @@ CPPUNIT_TEST_FIXTURE(UnodrawTest, testTableShadowDirect) CPPUNIT_TEST_FIXTURE(UnodrawTest, testTitleShapeBullets) { // Create a title shape with 2 paragraphs in it. - mxComponent = loadFromDesktop(u"private:factory/simpress"_ustr, - u"com.sun.star.presentation.PresentationDocument"_ustr); + loadFromURL(u"private:factory/simpress"_ustr); uno::Reference xSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xDrawPages = xSupplier->getDrawPages(); uno::Reference xDrawPage(xDrawPages->getByIndex(0), uno::UNO_QUERY); @@ -193,8 +191,7 @@ CPPUNIT_TEST_FIXTURE(UnodrawTest, testTitleShapeBullets) CPPUNIT_TEST_FIXTURE(UnodrawTest, testPngExport) { // Given an empty Impress document: - mxComponent = loadFromDesktop(u"private:factory/simpress"_ustr, - u"com.sun.star.presentation.PresentationDocument"_ustr); + loadFromURL(u"private:factory/simpress"_ustr); // When exporting that document to PNG with a JSON size: uno::Reference xStorable(mxComponent, uno::UNO_QUERY_THROW); diff --git a/svx/qa/unit/xoutdev.cxx b/svx/qa/unit/xoutdev.cxx index 781835069985..a5412ae8d490 100644 --- a/svx/qa/unit/xoutdev.cxx +++ b/svx/qa/unit/xoutdev.cxx @@ -93,8 +93,7 @@ CPPUNIT_TEST_FIXTURE(XOutdevTest, testTdf60684) CPPUNIT_TEST_FIXTURE(XOutdevTest, testFillColorThemeUnoApi) { // Given an empty Impress document with a (title) shape: - mxComponent = loadFromDesktop(u"private:factory/simpress"_ustr, - u"com.sun.star.presentation.PresentationDocument"_ustr); + loadFromURL(u"private:factory/simpress"_ustr); // When setting the theme index of the shape's fill color: uno::Reference xPagesSupplier(mxComponent, uno::UNO_QUERY); diff --git a/sw/qa/api/SwXBodyText.cxx b/sw/qa/api/SwXBodyText.cxx index 7dd479c43eac..3d727d9910ad 100644 --- a/sw/qa/api/SwXBodyText.cxx +++ b/sw/qa/api/SwXBodyText.cxx @@ -68,8 +68,7 @@ SwXBodyText::SwXBodyText() Reference SwXBodyText::init() { - mxComponent - = loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXBookmark.cxx b/sw/qa/api/SwXBookmark.cxx index a92528d6f201..d2233c9b9ace 100644 --- a/sw/qa/api/SwXBookmark.cxx +++ b/sw/qa/api/SwXBookmark.cxx @@ -41,8 +41,7 @@ public: Reference init() override { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, - u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXBookmarks.cxx b/sw/qa/api/SwXBookmarks.cxx index c2f37bcc676b..25ef2a0e29e3 100644 --- a/sw/qa/api/SwXBookmarks.cxx +++ b/sw/qa/api/SwXBookmarks.cxx @@ -44,8 +44,7 @@ public: Reference init() override { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, - u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXChapterNumbering.cxx b/sw/qa/api/SwXChapterNumbering.cxx index c6e302362ddb..f2ba5d0fd09c 100644 --- a/sw/qa/api/SwXChapterNumbering.cxx +++ b/sw/qa/api/SwXChapterNumbering.cxx @@ -43,8 +43,7 @@ public: Reference init() override { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, - u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xCNSupplier(xTextDocument, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXDocumentIndex.cxx b/sw/qa/api/SwXDocumentIndex.cxx index 7e1e5f9d673e..548acfb18470 100644 --- a/sw/qa/api/SwXDocumentIndex.cxx +++ b/sw/qa/api/SwXDocumentIndex.cxx @@ -57,8 +57,7 @@ public: Reference init() override { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, - u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); mxTextDocument = Reference(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxTextDocument, UNO_QUERY_THROW); Reference xDocumentIndex( diff --git a/sw/qa/api/SwXDocumentIndexMark.cxx b/sw/qa/api/SwXDocumentIndexMark.cxx index 1d0e28a9e737..fa764c7ff527 100644 --- a/sw/qa/api/SwXDocumentIndexMark.cxx +++ b/sw/qa/api/SwXDocumentIndexMark.cxx @@ -68,8 +68,7 @@ SwXDocumentIndexMark::SwXDocumentIndexMark() Reference SwXDocumentIndexMark::init() { - mxComponent - = loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXDocumentIndexes.cxx b/sw/qa/api/SwXDocumentIndexes.cxx index 7ba73bba26ff..a94eae58ddc2 100644 --- a/sw/qa/api/SwXDocumentIndexes.cxx +++ b/sw/qa/api/SwXDocumentIndexes.cxx @@ -45,8 +45,7 @@ public: Reference init() override { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, - u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXDocumentSettings.cxx b/sw/qa/api/SwXDocumentSettings.cxx index f88b6a1e60a9..83fd9ee9dc49 100644 --- a/sw/qa/api/SwXDocumentSettings.cxx +++ b/sw/qa/api/SwXDocumentSettings.cxx @@ -52,8 +52,7 @@ public: uno::Reference SwXDocumentSettings::init() { - mxComponent - = loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY_THROW); uno::Reference xFactory(xTextDocument, uno::UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXFieldEnumeration.cxx b/sw/qa/api/SwXFieldEnumeration.cxx index cb9998a4e094..8f1a379b646e 100644 --- a/sw/qa/api/SwXFieldEnumeration.cxx +++ b/sw/qa/api/SwXFieldEnumeration.cxx @@ -40,8 +40,7 @@ public: Reference init() override { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, - u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXFootnote.cxx b/sw/qa/api/SwXFootnote.cxx index 686494312ddc..d98dfce0b77a 100644 --- a/sw/qa/api/SwXFootnote.cxx +++ b/sw/qa/api/SwXFootnote.cxx @@ -83,8 +83,7 @@ SwXFootnote::SwXFootnote() Reference SwXFootnote::init() { - mxComponent - = loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); Reference xFootnote(xMSF->createInstance(u"com.sun.star.text.Footnote"_ustr), diff --git a/sw/qa/api/SwXFootnoteProperties.cxx b/sw/qa/api/SwXFootnoteProperties.cxx index a7572fa573ab..b616a5c5ba99 100644 --- a/sw/qa/api/SwXFootnoteProperties.cxx +++ b/sw/qa/api/SwXFootnoteProperties.cxx @@ -52,8 +52,7 @@ SwXFootnoteProperties::SwXFootnoteProperties() Reference SwXFootnoteProperties::init() { - mxComponent - = loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXFootnoteText.cxx b/sw/qa/api/SwXFootnoteText.cxx index d552aa386ba3..6e359af7733b 100644 --- a/sw/qa/api/SwXFootnoteText.cxx +++ b/sw/qa/api/SwXFootnoteText.cxx @@ -77,8 +77,7 @@ SwXFootnoteText::SwXFootnoteText() Reference SwXFootnoteText::init() { - mxComponent - = loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXFootnotes.cxx b/sw/qa/api/SwXFootnotes.cxx index fae9d6938587..36ff83966da3 100644 --- a/sw/qa/api/SwXFootnotes.cxx +++ b/sw/qa/api/SwXFootnotes.cxx @@ -44,8 +44,7 @@ public: Reference init() override { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, - u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXFrames.cxx b/sw/qa/api/SwXFrames.cxx index b9745d9af20a..80cfe1840c96 100644 --- a/sw/qa/api/SwXFrames.cxx +++ b/sw/qa/api/SwXFrames.cxx @@ -45,8 +45,7 @@ public: Reference init() override { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, - u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXHeadFootText.cxx b/sw/qa/api/SwXHeadFootText.cxx index 3059af980b33..4d19bfdcd9cc 100644 --- a/sw/qa/api/SwXHeadFootText.cxx +++ b/sw/qa/api/SwXHeadFootText.cxx @@ -79,8 +79,7 @@ SwXHeadFootText::SwXHeadFootText() Reference SwXHeadFootText::init() { - mxComponent - = loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXNumberingRules.cxx b/sw/qa/api/SwXNumberingRules.cxx index aecc71c9022f..983341953efb 100644 --- a/sw/qa/api/SwXNumberingRules.cxx +++ b/sw/qa/api/SwXNumberingRules.cxx @@ -51,8 +51,7 @@ public: Reference init() override { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, - u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xIndexAccess; diff --git a/sw/qa/api/SwXParagraphEnumeration.cxx b/sw/qa/api/SwXParagraphEnumeration.cxx index e3a2b3d45e92..f579ae414daf 100644 --- a/sw/qa/api/SwXParagraphEnumeration.cxx +++ b/sw/qa/api/SwXParagraphEnumeration.cxx @@ -41,8 +41,7 @@ public: Reference init() override { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, - u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXReferenceMark.cxx b/sw/qa/api/SwXReferenceMark.cxx index 0f56a07c29ee..92e547c8ab98 100644 --- a/sw/qa/api/SwXReferenceMark.cxx +++ b/sw/qa/api/SwXReferenceMark.cxx @@ -43,8 +43,7 @@ public: Reference init() override { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, - u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXReferenceMarks.cxx b/sw/qa/api/SwXReferenceMarks.cxx index d359f7cdddf3..57ebda368c31 100644 --- a/sw/qa/api/SwXReferenceMarks.cxx +++ b/sw/qa/api/SwXReferenceMarks.cxx @@ -47,8 +47,7 @@ public: Reference init() override { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, - u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(xTextDocument, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXStyleFamilies.cxx b/sw/qa/api/SwXStyleFamilies.cxx index 6928896a430b..7b48a4318a53 100644 --- a/sw/qa/api/SwXStyleFamilies.cxx +++ b/sw/qa/api/SwXStyleFamilies.cxx @@ -47,8 +47,7 @@ public: Reference init() override { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, - u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXTableCellText.cxx b/sw/qa/api/SwXTableCellText.cxx index 6ac75ab2ac70..c6820f975e04 100644 --- a/sw/qa/api/SwXTableCellText.cxx +++ b/sw/qa/api/SwXTableCellText.cxx @@ -48,8 +48,7 @@ public: Reference init() override { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, - u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXTextEmbeddedObjects.cxx b/sw/qa/api/SwXTextEmbeddedObjects.cxx index 27ee002c4a72..e3165493134e 100644 --- a/sw/qa/api/SwXTextEmbeddedObjects.cxx +++ b/sw/qa/api/SwXTextEmbeddedObjects.cxx @@ -50,8 +50,7 @@ public: Reference init() override { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, - u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXTextField.cxx b/sw/qa/api/SwXTextField.cxx index c02de9f134cb..fc3882ef7c00 100644 --- a/sw/qa/api/SwXTextField.cxx +++ b/sw/qa/api/SwXTextField.cxx @@ -53,8 +53,7 @@ struct SwXTextField final : public UnoApiTest, Reference init() override { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, - u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXTextFieldMasters.cxx b/sw/qa/api/SwXTextFieldMasters.cxx index fb07a53933e3..50d88404af62 100644 --- a/sw/qa/api/SwXTextFieldMasters.cxx +++ b/sw/qa/api/SwXTextFieldMasters.cxx @@ -44,8 +44,7 @@ public: Reference init() override { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, - u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xTFS; diff --git a/sw/qa/api/SwXTextFieldTypes.cxx b/sw/qa/api/SwXTextFieldTypes.cxx index 6ac1cad4749a..eaf44ca2df67 100644 --- a/sw/qa/api/SwXTextFieldTypes.cxx +++ b/sw/qa/api/SwXTextFieldTypes.cxx @@ -44,8 +44,7 @@ public: Reference init() override { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, - u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xTFS; diff --git a/sw/qa/api/SwXTextFrame.cxx b/sw/qa/api/SwXTextFrame.cxx index 970011d64aef..4b11138cba8c 100644 --- a/sw/qa/api/SwXTextFrame.cxx +++ b/sw/qa/api/SwXTextFrame.cxx @@ -38,8 +38,7 @@ public: uno::Reference init() override { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, - u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xMSF(mxComponent, uno::UNO_QUERY_THROW); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY_THROW); uno::Reference xTextFrame( diff --git a/sw/qa/api/SwXTextSections.cxx b/sw/qa/api/SwXTextSections.cxx index 60502dfcc801..c870a619cad1 100644 --- a/sw/qa/api/SwXTextSections.cxx +++ b/sw/qa/api/SwXTextSections.cxx @@ -48,8 +48,7 @@ public: Reference init() override { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, - u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXTextTable.cxx b/sw/qa/api/SwXTextTable.cxx index c0bd7226de56..83971f2c3eaf 100644 --- a/sw/qa/api/SwXTextTable.cxx +++ b/sw/qa/api/SwXTextTable.cxx @@ -50,8 +50,7 @@ void SwXTextTable::triggerDesktopTerminate() { mxDesktop->terminate(); } Reference SwXTextTable::init() { - mxComponent - = loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); Reference xText = xTextDocument->getText(); diff --git a/sw/qa/api/SwXTextTables.cxx b/sw/qa/api/SwXTextTables.cxx index d89546805170..b16e36adf2f8 100644 --- a/sw/qa/api/SwXTextTables.cxx +++ b/sw/qa/api/SwXTextTables.cxx @@ -45,8 +45,7 @@ public: Reference init() override { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, - u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx index e34a94a7f101..22d8126fa039 100644 --- a/sw/qa/core/macros-test.cxx +++ b/sw/qa/core/macros-test.cxx @@ -424,7 +424,7 @@ void SwMacrosTest::testFdo68983() void SwMacrosTest::testFdo87530() { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); { // insert initial password protected library @@ -481,8 +481,7 @@ void SwMacrosTest::testFdo87530() void SwMacrosTest::testFindReplace() { // we need a full document with view and layout etc. because ::GetNode() - mxComponent = - loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); SwXTextDocument *const pTextDoc = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); diff --git a/sw/qa/extras/accessibility/accessible_relation_set.cxx b/sw/qa/extras/accessibility/accessible_relation_set.cxx index 020c9256b92a..29f6961859ab 100644 --- a/sw/qa/extras/accessibility/accessible_relation_set.cxx +++ b/sw/qa/extras/accessibility/accessible_relation_set.cxx @@ -62,8 +62,7 @@ void AccessibleRelationSet::init(uno::Reference uno::Reference& para2, uno::Reference& para3) { - mxComponent - = loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xTextDoc(mxComponent, uno::UNO_QUERY); css::uno::Reference oText(xTextDoc->getText(), uno::UNO_SET_THROW); diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx b/sw/qa/extras/globalfilter/globalfilter.cxx index fa60bf574f66..19ffaaee929c 100644 --- a/sw/qa/extras/globalfilter/globalfilter.cxx +++ b/sw/qa/extras/globalfilter/globalfilter.cxx @@ -1019,8 +1019,7 @@ void Test::testODF13() assertXPath(pStylesXml, "/office:document-styles/office:master-styles/style:master-page/style:footer-first", 0); // reload - mxComponent->dispose(); - mxComponent = loadFromDesktop(maTempFile.GetURL(), u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(maTempFile.GetURL()); // check model verifyText13("1.2 Extended reload"); diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx index 8a820edc950f..b1f11a2c4bca 100644 --- a/sw/qa/extras/htmlexport/htmlexport.cxx +++ b/sw/qa/extras/htmlexport/htmlexport.cxx @@ -2769,7 +2769,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testHTML_PreserveSpaces) // Test import setImportFilterName(u"HTML (StarWriter)"_ustr); - load(maTempFile.GetURL()); + loadFromURL(maTempFile.GetURL()); CPPUNIT_ASSERT_EQUAL(paraText, getParagraph(1)->getString()); } @@ -2798,7 +2798,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIF_PreserveSpaces) setImportFilterOptions(u"xhtmlns=reqif-xhtml"_ustr); setImportFilterName(u"HTML (StarWriter)"_ustr); - load(maTempFile.GetURL()); + loadFromURL(maTempFile.GetURL()); CPPUNIT_ASSERT_EQUAL(paraText, getParagraph(1)->getString()); } @@ -2863,7 +2863,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testHTML_NoPreserveSpaces) // Test import setImportFilterName(u"HTML (StarWriter)"_ustr); - load(maTempFile.GetURL()); + loadFromURL(maTempFile.GetURL()); CPPUNIT_ASSERT_EQUAL(u"No special spaces"_ustr, getParagraph(1)->getString()); CPPUNIT_ASSERT_EQUAL(u" Leading space"_ustr, getParagraph(2)->getString()); @@ -2928,7 +2928,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIF_NoPreserveSpaces) setImportFilterOptions(u"xhtmlns=reqif-xhtml"_ustr); setImportFilterName(u"HTML (StarWriter)"_ustr); - load(maTempFile.GetURL()); + loadFromURL(maTempFile.GetURL()); CPPUNIT_ASSERT_EQUAL(u"No special spaces"_ustr, getParagraph(1)->getString()); CPPUNIT_ASSERT_EQUAL(u" Leading space"_ustr, getParagraph(2)->getString()); diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx index 3e6609931c0b..5b5e066e1ad5 100644 --- a/sw/qa/extras/layout/layout2.cxx +++ b/sw/qa/extras/layout/layout2.cxx @@ -2495,12 +2495,11 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf121509) aNewAnch.SetAnchor(aCursor.Start()); CPPUNIT_ASSERT(pTriangleShapeFormat->SetFormatAttr(aNewAnch)); - // Reload (docx) - // FIXME: if we use 'reload' here, it fails with - // Assertion `!m_pFirst && !m_pLast && "There are still indices registered"' failed. save(u"Office Open XML Text"_ustr); // The second part: check if the reloaded doc has flys inside a fly + // FIXME: if we use 'saveAndReload' or 'loadFromURL' here, it fails with + // Assertion `!m_pFirst && !m_pLast && "There are still indices registered"' failed. loadFromDesktop(maTempFile.GetURL(), u"com.sun.star.text.TextDocument"_ustr); auto pSecondDoc = getSwDoc(); auto pSecondFormats = pSecondDoc->GetSpzFrameFormats(); diff --git a/sw/qa/extras/mailmerge/mailmergetestbase.cxx b/sw/qa/extras/mailmerge/mailmergetestbase.cxx index fc6e084ac21a..72e3ddfdb588 100644 --- a/sw/qa/extras/mailmerge/mailmergetestbase.cxx +++ b/sw/qa/extras/mailmerge/mailmergetestbase.cxx @@ -261,12 +261,9 @@ public: void loadMailMergeDocument(const OUString& filename) { assert(mnCurOutputType == text::MailMergeType::FILE); - if (mxComponent.is()) - mxComponent->dispose(); // Output name early, so in the case of a hang, the name of the hanging input file is visible. std::cout << filename << ","; - mxComponent = loadFromDesktop(msMailMergeOutputURL + "/" + filename, - u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(msMailMergeOutputURL + "/" + filename); calcLayout(); } diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index 9c824c92b985..fb8a065eba29 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -1541,10 +1541,9 @@ CPPUNIT_TEST_FIXTURE(Test, testBrokenPackage_Tdf159474) // Given an invalid ODF having a stream not referenced in manifest.xml const OUString url = createFileURL(u"unreferenced_stream.odt"); // It expectedly fails to load normally: - CPPUNIT_ASSERT_ASSERTION_FAIL(loadFromDesktop(url, {}, {})); + CPPUNIT_ASSERT_ASSERTION_FAIL(loadFromURL(url)); // importing it must succeed with RepairPackage set to true. - mxComponent - = loadFromDesktop(url, {}, { comphelper::makePropertyValue(u"RepairPackage"_ustr, true) }); + loadWithParams(url, { comphelper::makePropertyValue(u"RepairPackage"_ustr, true) }); // The document imports in repair mode; the original broken package is used as a template, // and the loaded document has no URL: CPPUNIT_ASSERT(mxComponent.queryThrow()->getURL().isEmpty()); diff --git a/sw/qa/extras/pdf/HybridPdfTest.cxx b/sw/qa/extras/pdf/HybridPdfTest.cxx index 840de3298474..0ec4e7ae385b 100644 --- a/sw/qa/extras/pdf/HybridPdfTest.cxx +++ b/sw/qa/extras/pdf/HybridPdfTest.cxx @@ -35,8 +35,7 @@ public: void HybridPdfTest::testNoHybridDataInPDF() { // Load PDF document without attached ODT document - UnoApiXmlTest::load(createFileURL(u"PDFOnly.pdf"), nullptr); - CPPUNIT_ASSERT(mxComponent.is()); + loadFromFile(u"PDFOnly.pdf"); uno::Reference xServiceInfo(mxComponent, uno::UNO_QUERY_THROW); // Draw document is expected in this case - default when importing PDF CPPUNIT_ASSERT(xServiceInfo->supportsService(u"com.sun.star.drawing.DrawingDocument"_ustr)); diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 2e3904450545..b706ac813440 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -376,22 +376,17 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testPasteTableAtFlyAnchor) CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testCopyPastePageBreak) { - { - createSwDoc("pagebreak-source.fodt"); + createSwDoc("pagebreak-source.fodt"); - SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); - CPPUNIT_ASSERT_EQUAL(tools::Long(5669), pWrtShell->GetLayout()->GetLower()->getFramePrintArea().Top()); + SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); + CPPUNIT_ASSERT_EQUAL(tools::Long(5669), pWrtShell->GetLayout()->GetLower()->getFramePrintArea().Top()); - pWrtShell->SelAll(); - dispatchCommand(mxComponent, u".uno:Copy"_ustr, {}); - - mxComponent->dispose(); - mxComponent.clear(); - } + pWrtShell->SelAll(); + dispatchCommand(mxComponent, u".uno:Copy"_ustr, {}); createSwDoc("pagebreak-target.fodt"); SwDoc* pDoc = getSwDoc(); - SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); + pWrtShell = getSwDocShell()->GetWrtShell(); CPPUNIT_ASSERT_EQUAL(1, getParagraphs()); CPPUNIT_ASSERT_EQUAL(u"WithMargin"_ustr, getProperty(getParagraph(1), u"PageDescName"_ustr)); diff --git a/sw/qa/extras/uiwriter/uiwriter7.cxx b/sw/qa/extras/uiwriter/uiwriter7.cxx index ad6e69661717..429fe7ce931d 100644 --- a/sw/qa/extras/uiwriter/uiwriter7.cxx +++ b/sw/qa/extras/uiwriter/uiwriter7.cxx @@ -2199,7 +2199,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testEmbeddedDataSource) CPPUNIT_ASSERT(!xDatabaseContext->hasByName(u"calc-data-source"_ustr)); // Now open again the saved result, and instead of 'save as', just 'save'. - mxComponent = loadFromDesktop(maTempFile.GetURL(), u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(maTempFile.GetURL()); uno::Reference xStorable(mxComponent, uno::UNO_QUERY); xStorable->store(); } @@ -2807,7 +2807,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf117225) OUString aTargetFile = aTargetDirectory + "tdf117225.odt"; OUString aSourceFile = createFileURL(u"tdf117225.odt"); osl::File::copy(aSourceFile, aTargetFile); - mxComponent = loadFromDesktop(aTargetFile); + loadFromURL(aTargetFile); uno::Reference xStorable(mxComponent, uno::UNO_QUERY); int nExpected = CountFilesInDirectory(aTargetDirectory); xStorable->store(); diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx b/sw/qa/extras/uiwriter/uiwriter8.cxx index 58052fcf8146..5c9414792920 100644 --- a/sw/qa/extras/uiwriter/uiwriter8.cxx +++ b/sw/qa/extras/uiwriter/uiwriter8.cxx @@ -2719,6 +2719,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf128106) = comphelper::InitPropertySequence({ { "FileName", css::uno::Any(maTempFile.GetURL()) } }); dispatchCommand(mxComponent, u".uno:NewGlobalDoc"_ustr, aPropertyValues); + // Use loadFromDesktop instead of loadFromURL to avoid calling mxComponent->dispose() + // Otherwise it fails with 'DeInitVCL: some top Windows are still alive' mxComponent = loadFromDesktop(maTempFile.GetURL()); SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); diff --git a/sw/qa/uibase/uiview/uiview.cxx b/sw/qa/uibase/uiview/uiview.cxx index fe4540e64e81..331795649a0f 100644 --- a/sw/qa/uibase/uiview/uiview.cxx +++ b/sw/qa/uibase/uiview/uiview.cxx @@ -96,8 +96,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, testUpdateReplacementNosetting) // Load a copy of the document in hidden mode. OUString aSourceURL = createFileURL(u"update-replacement-nosetting.odt"); CPPUNIT_ASSERT_EQUAL(osl::FileBase::E_None, osl::File::copy(aSourceURL, maTempFile.GetURL())); - mxComponent = loadFromDesktop(maTempFile.GetURL(), u"com.sun.star.text.TextDocument"_ustr, - { comphelper::makePropertyValue(u"Hidden"_ustr, true) }); + loadWithParams(maTempFile.GetURL(), { comphelper::makePropertyValue(u"Hidden"_ustr, true) }); // Update "everything" (including object replacements) and save it. dispatchCommand(mxComponent, u".uno:UpdateAll"_ustr, {}); diff --git a/sw/qa/unit/swmodeltestbase.cxx b/sw/qa/unit/swmodeltestbase.cxx index 91aace9350f9..72fedf58f4a4 100644 --- a/sw/qa/unit/swmodeltestbase.cxx +++ b/sw/qa/unit/swmodeltestbase.cxx @@ -381,7 +381,7 @@ void SwModelTestBase::loadURL(OUString const& rURL, const char* pPassword) // Output name at load time, so in the case of a hang, the name of the hanging input file is visible. std::cout << rURL << ":\n"; - UnoApiXmlTest::load(rURL, pPassword); + loadFromURL(rURL, pPassword); CPPUNIT_ASSERT(!getSwDocShell()->GetMedium()->GetWarningError()); diff --git a/sw/qa/writerfilter/dmapper/DomainMapper.cxx b/sw/qa/writerfilter/dmapper/DomainMapper.cxx index 05e6029c8c21..c9a44648d660 100644 --- a/sw/qa/writerfilter/dmapper/DomainMapper.cxx +++ b/sw/qa/writerfilter/dmapper/DomainMapper.cxx @@ -194,8 +194,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableStyleParaBorder) CPPUNIT_TEST_FIXTURE(Test, testRTFStylePaste) { // Given an empty Writer document: - mxComponent - = loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); // When pasting RTF that has unreferenced paragraph styles: uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); diff --git a/sw/qa/writerfilter/dmapper/DomainMapper_Impl.cxx b/sw/qa/writerfilter/dmapper/DomainMapper_Impl.cxx index 82224635543a..8bbf6035a40b 100644 --- a/sw/qa/writerfilter/dmapper/DomainMapper_Impl.cxx +++ b/sw/qa/writerfilter/dmapper/DomainMapper_Impl.cxx @@ -233,8 +233,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPTab) CPPUNIT_TEST_FIXTURE(Test, testPasteOle) { // Given an empty document: - mxComponent - = loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); // When pasting RTF into that document: uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); diff --git a/sw/qa/writerfilter/dmapper/NumberingManager.cxx b/sw/qa/writerfilter/dmapper/NumberingManager.cxx index 8c60033a74d7..481e34acf273 100644 --- a/sw/qa/writerfilter/dmapper/NumberingManager.cxx +++ b/sw/qa/writerfilter/dmapper/NumberingManager.cxx @@ -35,8 +35,7 @@ public: CPPUNIT_TEST_FIXTURE(Test, testPasteBulletListStyleName) { // Given a document with a WWNum1 list style: - mxComponent - = loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xStyleFamiliesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xStyleFamilies diff --git a/sw/qa/writerfilter/dmapper/PropertyMap.cxx b/sw/qa/writerfilter/dmapper/PropertyMap.cxx index 83a3b660c3c9..be80c9d398bb 100644 --- a/sw/qa/writerfilter/dmapper/PropertyMap.cxx +++ b/sw/qa/writerfilter/dmapper/PropertyMap.cxx @@ -148,8 +148,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNegativePageBorderNoMargin) CPPUNIT_TEST_FIXTURE(Test, testPasteHeaderDisable) { // Given an empty document with a turned on header: - mxComponent - = loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xStyleFamiliesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xStyleFamilies diff --git a/test/source/unoapi_test.cxx b/test/source/unoapi_test.cxx index af6506c525f3..3a7f6e2d16f0 100644 --- a/test/source/unoapi_test.cxx +++ b/test/source/unoapi_test.cxx @@ -80,7 +80,7 @@ void UnoApiTest::setTestInteractionHandler(const char* pPassword, rPropertyValue.Value <<= xInteraction; } -void UnoApiTest::load(OUString const& rURL, const char* pPassword) +void UnoApiTest::loadFromURL(OUString const& rURL, const char* pPassword) { std::vector aFilterOptions; @@ -129,7 +129,7 @@ void UnoApiTest::loadWithParams(OUString const& rURL, OUString UnoApiTest::loadFromFile(std::u16string_view aFileBase, const char* pPassword) { OUString aFileName = createFileURL(aFileBase); - load(aFileName, pPassword); + loadFromURL(aFileName, pPassword); return aFileName; } @@ -216,8 +216,7 @@ void UnoApiTest::saveWithParams(const uno::Sequence& rPara void UnoApiTest::saveAndReload(const OUString& rFilter, const char* pPassword) { save(rFilter, pPassword); - - load(maTempFile.GetURL(), pPassword); + loadFromURL(maTempFile.GetURL(), pPassword); } std::unique_ptr UnoApiTest::parsePDFExport(const OString& rPassword) diff --git a/unoxml/qa/unit/rdftest.cxx b/unoxml/qa/unit/rdftest.cxx index 198a42bf92a8..3b6de1d02006 100644 --- a/unoxml/qa/unit/rdftest.cxx +++ b/unoxml/qa/unit/rdftest.cxx @@ -91,7 +91,7 @@ CPPUNIT_TEST_FIXTURE(RDFStreamTest, testCVE_2012_0037) CPPUNIT_TEST_FIXTURE(RDFStreamTest, testRDFa) { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); @@ -962,7 +962,7 @@ CPPUNIT_TEST_FIXTURE(RDFStreamTest, testTdf123293) CPPUNIT_TEST_FIXTURE(RDFStreamTest, testDocumentMetadataAccess) { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xDocumentMetadataAccess(mxComponent, uno::UNO_QUERY); diff --git a/vcl/qa/cppunit/filter/ipdf/ipdf.cxx b/vcl/qa/cppunit/filter/ipdf/ipdf.cxx index b2594058dd36..606d9ae64a79 100644 --- a/vcl/qa/cppunit/filter/ipdf/ipdf.cxx +++ b/vcl/qa/cppunit/filter/ipdf/ipdf.cxx @@ -67,8 +67,7 @@ CPPUNIT_TEST_FIXTURE(VclFilterIpdfTest, testPDFAddVisibleSignatureLastPage) // Open it. uno::Sequence aArgs = { comphelper::makePropertyValue(u"ReadOnly"_ustr, true) }; - mxComponent - = loadFromDesktop(maTempFile.GetURL(), u"com.sun.star.drawing.DrawingDocument"_ustr, aArgs); + loadWithParams(maTempFile.GetURL(), aArgs); SfxBaseModel* pBaseModel = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pBaseModel); SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell(); diff --git a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx index f9dbb0500934..9a1a314ad3e7 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx @@ -637,7 +637,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testLargePage) CPPUNIT_TEST_FIXTURE(PdfExportTest2, testPdfImageResourceInlineXObjectRef) { // Create an empty document. - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText = xTextDocument->getText(); uno::Reference xCursor = xText->createTextCursor(); @@ -701,7 +701,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testPdfImageResourceInlineXObjectRef) CPPUNIT_TEST_FIXTURE(PdfExportTest2, testDefaultVersion) { // Create an empty document. - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); // Save as PDF. aMediaDescriptor[u"FilterName"_ustr] <<= u"writer_pdf_Export"_ustr; @@ -716,7 +716,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testDefaultVersion) CPPUNIT_TEST_FIXTURE(PdfExportTest2, testVersion15) { // Create an empty document. - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); // Save as PDF. uno::Sequence aFilterData(comphelper::InitPropertySequence( @@ -1555,7 +1555,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf152235) { "WatermarkFontName", uno::Any(u"Liberation Sans"_ustr) }, { "SelectPdfVersion", uno::Any(sal_Int32(17)) } })); aMediaDescriptor[u"FilterData"_ustr] <<= aFilterData; - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); saveWithParams(aMediaDescriptor.getAsConstPropertyValueList()); vcl::filter::PDFDocument aDocument; @@ -4003,7 +4003,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf142129) CPPUNIT_TEST_FIXTURE(PdfExportTest2, testPdfImageRotate180) { // Create an empty document. - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText = xTextDocument->getText(); uno::Reference xCursor = xText->createTextCursor(); @@ -4238,7 +4238,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testURIs) // Create an empty document. // Note: The test harness gets very upset if we try and create multiple // documents, or recreate it; so reuse one instance for all the links - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText = xTextDocument->getText(); uno::Reference xCursor = xText->createTextCursor(); @@ -4330,7 +4330,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testPdfImageAnnots) CPPUNIT_TEST_FIXTURE(PdfExportTest2, testPdfImageEncryption) { // Given an empty document, with an inserted PDF image: - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText = xTextDocument->getText(); uno::Reference xCursor = xText->createTextCursor(); diff --git a/xmloff/qa/unit/draw.cxx b/xmloff/qa/unit/draw.cxx index 3644945efb7d..0d0db156b86b 100644 --- a/xmloff/qa/unit/draw.cxx +++ b/xmloff/qa/unit/draw.cxx @@ -122,7 +122,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testTdf141301_Extrusion_Angle) CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testThemeExport) { // Create an Impress document which has a master page which has a theme associated with it. - mxComponent = loadFromDesktop(u"private:factory/simpress"_ustr); + loadFromURL(u"private:factory/simpress"_ustr); uno::Reference xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xDrawPage( xDrawPagesSupplier->getDrawPages()->getByIndex(0), uno::UNO_QUERY); @@ -279,7 +279,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testFillAndLineThemeColorExportImport) save(u"impress8"_ustr); - load(maTempFile.GetURL()); + loadFromURL(maTempFile.GetURL()); checkFillAndLineComplexColors(getShape(0)); } @@ -734,7 +734,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testTdf156975_ThemeExport) // Without fix for tdf#156975 it was not written at all. // The test needs to be adapted, when themes are available in ODF. - mxComponent = loadFromDesktop(u"private:factory/sdraw"_ustr); + loadFromURL(u"private:factory/sdraw"_ustr); // generate a theme to be sure we have got one and know the values uno::Reference xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xDrawPage( diff --git a/xmloff/qa/unit/style.cxx b/xmloff/qa/unit/style.cxx index 4961989aeb2a..486dd7bb8bc1 100644 --- a/xmloff/qa/unit/style.cxx +++ b/xmloff/qa/unit/style.cxx @@ -90,7 +90,7 @@ Color asColor(com::sun::star::rendering::RGBColor const& rRGBColor) CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testFontSorting) { // Given an empty document with default fonts (Liberation Sans, Lucida Sans, etc): - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); // When saving that document to ODT: save(u"writer8"_ustr); diff --git a/xmloff/qa/unit/text.cxx b/xmloff/qa/unit/text.cxx index 6a1d7eb9af50..2ef9e2673360 100644 --- a/xmloff/qa/unit/text.cxx +++ b/xmloff/qa/unit/text.cxx @@ -52,7 +52,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testMailMergeInEditeng) CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testCommentProperty) { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Sequence aCommentProps = comphelper::InitPropertySequence({ { "Text", uno::Any(u"comment"_ustr) }, }); @@ -92,7 +92,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testCommentProperty) CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testBibliographyLocalUrl) { // Given a document with a biblio field, with non-empty LocalURL: - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xFactory(mxComponent, uno::UNO_QUERY); uno::Reference xField( xFactory->createInstance(u"com.sun.star.text.TextField.Bibliography"_ustr), uno::UNO_QUERY); @@ -134,7 +134,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testBibliographyLocalUrl) CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testBibliographyTargetURL1) { // Given a document with a biblio field, with non-empty LocalURL: - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xFactory(mxComponent, uno::UNO_QUERY); uno::Reference xField( xFactory->createInstance(u"com.sun.star.text.TextField.Bibliography"_ustr), uno::UNO_QUERY); @@ -326,7 +326,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testListIdState) { // tdf#149668: given a document with 3 paragraphs: an outer numbering on para 1 & 3, an inner // numbering on para 2: - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); auto xTextDocument(mxComponent.queryThrow()); auto xText(xTextDocument->getText()); xText->insertControlCharacter(xText->getEnd(), css::text::ControlCharacter::PARAGRAPH_BREAK, @@ -420,7 +420,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testListIdOnRestart) CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testClearingBreakExport) { // Given a document with a clearing break: - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xMSF(mxComponent, uno::UNO_QUERY); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xLineBreak( @@ -480,7 +480,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testClearingBreakImport) CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testRelativeWidth) { // Given a document with an 50% wide text frame: - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xStyleFamiliesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xStyleFamilies @@ -518,7 +518,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testScaleWidthAndHeight) { // Given a broken document where both IsSyncHeightToWidth and IsSyncWidthToHeight are set to // true: - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xMSF(mxComponent, uno::UNO_QUERY); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xTextFrame( @@ -547,7 +547,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testScaleWidthAndHeight) CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testContentControlExport) { // Given a document with a content control around one or more text portions: - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xMSF(mxComponent, uno::UNO_QUERY); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText = xTextDocument->getText(); @@ -606,7 +606,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testContentControlImport) CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testCheckboxContentControlExport) { // Given a document with a checkbox content control around a text portion: - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xMSF(mxComponent, uno::UNO_QUERY); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText = xTextDocument->getText(); @@ -679,7 +679,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testCheckboxContentControlImport) CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testDropdownContentControlExport) { // Given a document with a dropdown content control around a text portion: - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xMSF(mxComponent, uno::UNO_QUERY); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText = xTextDocument->getText(); @@ -776,7 +776,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testDropdownContentControlImport) CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testPictureContentControlExport) { // Given a document with a picture content control around an as-char image: - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xMSF(mxComponent, uno::UNO_QUERY); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText = xTextDocument->getText(); @@ -835,7 +835,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testPictureContentControlImport) CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testDateContentControlExport) { // Given a document with a date content control around a text portion: - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xMSF(mxComponent, uno::UNO_QUERY); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText = xTextDocument->getText(); @@ -905,7 +905,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testDateContentControlImport) CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testPlainTextContentControlExport) { // Given a document with a plain text content control around a text portion: - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xMSF(mxComponent, uno::UNO_QUERY); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText = xTextDocument->getText(); @@ -960,7 +960,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testPlainTextContentControlImport) CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testComboBoxContentControlExport) { // Given a document with a combo box content control around a text portion: - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xMSF(mxComponent, uno::UNO_QUERY); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText = xTextDocument->getText(); @@ -988,7 +988,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testComboBoxContentControlExport) CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testAliasContentControlExport) { // Given a document with a content control and its alias around a text portion: - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xMSF(mxComponent, uno::UNO_QUERY); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText = xTextDocument->getText(); @@ -1130,7 +1130,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testScaleWidthRedline) CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testThemeExport) { - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); @@ -1173,7 +1173,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testThemeExport) CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testFloatingTableExport) { // Given a document with a floating table: - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); // Insert a table: uno::Sequence aArgs = { comphelper::makePropertyValue(u"Rows"_ustr, static_cast(1)), diff --git a/xmloff/qa/unit/text/txtprmap.cxx b/xmloff/qa/unit/text/txtprmap.cxx index 1896ec4e4fda..e650ff649bad 100644 --- a/xmloff/qa/unit/text/txtprmap.cxx +++ b/xmloff/qa/unit/text/txtprmap.cxx @@ -34,7 +34,7 @@ Test::Test() CPPUNIT_TEST_FIXTURE(Test, testFloatingTableWrapTextAtFlyStartExport) { // Given a document with a floating table: - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); // Insert a table: uno::Sequence aArgs = { comphelper::makePropertyValue(u"Rows"_ustr, static_cast(1)), diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx index e4498f449150..11197a9bf6fa 100644 --- a/xmlsecurity/qa/unit/signing/signing.cxx +++ b/xmlsecurity/qa/unit/signing/signing.cxx @@ -138,7 +138,7 @@ SigningTest::getCertificate(DocumentSignatureManager& rSignatureManager, CPPUNIT_TEST_FIXTURE(SigningTest, testDescription) { // Create an empty document and store it to a tempfile, finally load it as a storage. - load(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); save(u"writer8"_ustr); @@ -170,7 +170,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testDescription) CPPUNIT_TEST_FIXTURE(SigningTest, testECDSA) { // Create an empty document and store it to a tempfile, finally load it as a storage. - load(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); save(u"writer8"_ustr); @@ -204,7 +204,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testECDSA) CPPUNIT_TEST_FIXTURE(SigningTest, testECDSAOOXML) { // Create an empty document and store it to a tempfile, finally load it as a storage. - load(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); save(u"MS Word 2007 XML"_ustr); @@ -240,7 +240,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testECDSAPDF) { // Create an empty document and store it to a tempfile, finally load it as // a stream. - load(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); save(u"writer_pdf_Export"_ustr); @@ -280,7 +280,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testECDSAPDF) CPPUNIT_TEST_FIXTURE(SigningTest, testOOXMLDescription) { // Create an empty document and store it to a tempfile, finally load it as a storage. - load(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); save(u"MS Word 2007 XML"_ustr); @@ -893,7 +893,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testXAdESNotype) CPPUNIT_TEST_FIXTURE(SigningTest, testXAdES) { // Create an empty document, store it to a tempfile and load it as a storage. - load(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); save(u"writer8"_ustr); @@ -946,7 +946,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testXAdES) CPPUNIT_TEST_FIXTURE(SigningTest, testSigningMultipleTimes_ODT) { - load(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); save(u"writer8"_ustr); { @@ -1008,7 +1008,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testSigningMultipleTimes_ODT) Scheduler::ProcessEventsToIdle(); - load(maTempFile.GetURL()); + loadFromURL(maTempFile.GetURL()); SfxBaseModel* pBaseModel = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pBaseModel); @@ -1019,7 +1019,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testSigningMultipleTimes_ODT) CPPUNIT_TEST_FIXTURE(SigningTest, testSigningMultipleTimes_OOXML) { - load(u"private:factory/swriter"_ustr); + loadFromURL(u"private:factory/swriter"_ustr); save(u"MS Word 2007 XML"_ustr); { @@ -1079,7 +1079,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testSigningMultipleTimes_OOXML) Scheduler::ProcessEventsToIdle(); - load(maTempFile.GetURL()); + loadFromURL(maTempFile.GetURL()); SfxBaseModel* pBaseModel = dynamic_cast(mxComponent.get()); CPPUNIT_ASSERT(pBaseModel); @@ -1373,7 +1373,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testPreserveMacroTemplateSignature12_ODF) SignatureState::OK, ODFVER_012_TEXT); // create new document from template - load(aURL); + loadFromURL(aURL); CPPUNIT_ASSERT_MESSAGE(OUStringToOString(sLoadMessage, RTL_TEXTENCODING_UTF8).getStr(), mxComponent.is()); @@ -1428,7 +1428,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testDropMacroTemplateSignature) SignatureState::NOTVALIDATED, OUString()); // create new document from template - load(aURL); + loadFromURL(aURL); CPPUNIT_ASSERT_MESSAGE(OUStringToOString(sLoadMessage, RTL_TEXTENCODING_UTF8).getStr(), mxComponent.is()); @@ -1485,7 +1485,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testPreserveMacroTemplateSignature10) SignatureState::NOTVALIDATED, OUString()); // create new document from template - load(aURL); + loadFromURL(aURL); CPPUNIT_ASSERT_MESSAGE(OUStringToOString(sLoadMessage, RTL_TEXTENCODING_UTF8).getStr(), mxComponent.is()); diff --git a/xmlsecurity/qa/unit/signing/signing2.cxx b/xmlsecurity/qa/unit/signing/signing2.cxx index e7f0dad50658..1854c9e013a0 100644 --- a/xmlsecurity/qa/unit/signing/signing2.cxx +++ b/xmlsecurity/qa/unit/signing/signing2.cxx @@ -106,7 +106,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest2, testPreserveMacroSignatureODB) CPPUNIT_TEST_FIXTURE(SigningTest2, testPasswordPreserveMacroSignatureODF13) { // load ODF 1.3 encrypted document - load(createFileURL(u"encrypted_scriptsig_odf13.odt"), "password"); + loadFromFile(u"encrypted_scriptsig_odf13.odt", "password"); { uno::Reference xTextDoc(mxComponent, uno::UNO_QUERY_THROW); CPPUNIT_ASSERT_EQUAL(u"secret"_ustr, xTextDoc->getText()->getString()); @@ -229,7 +229,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest2, testPasswordPreserveMacroSignatureODF13) CPPUNIT_TEST_FIXTURE(SigningTest2, testPasswordPreserveMacroSignatureODFWholesomeLO242) { // load wholesome ODF (extended) encrypted document - load(createFileURL(u"encrypted_scriptsig_lo242.odt"), "password"); + loadFromFile(u"encrypted_scriptsig_lo242.odt", "password"); { uno::Reference xTextDoc(mxComponent, uno::UNO_QUERY_THROW); CPPUNIT_ASSERT_EQUAL(u"secret"_ustr, xTextDoc->getText()->getString()); diff --git a/xmlsecurity/qa/xmlsec/xmlsec.cxx b/xmlsecurity/qa/xmlsec/xmlsec.cxx index a078ec912d39..d36bce860e0e 100644 --- a/xmlsecurity/qa/xmlsec/xmlsec.cxx +++ b/xmlsecurity/qa/xmlsec/xmlsec.cxx @@ -50,7 +50,7 @@ CPPUNIT_TEST_FIXTURE(Test, testInsertPrivateKey) = xml::crypto::SEInitializer::create(getComponentContext()); uno::Reference xSecurityContext = mxSEInitializer->createSecurityContext(OUString()); - load("private:factory/swriter"); + loadFromURL("private:factory/swriter"); save("writer8"); DocumentSignatureManager aManager(getComponentContext(), DocumentSignatureMode::Content); CPPUNIT_ASSERT(aManager.init());