summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dbaccess/qa/unit/dbtest_base.cxx16
-rw-r--r--dbaccess/qa/unit/firebird.cxx4
-rw-r--r--dbaccess/qa/unit/hsql_binary_import.cxx5
-rw-r--r--dbaccess/qa/unit/hsqldb.cxx4
-rw-r--r--dbaccess/qa/unit/tdf119625.cxx5
-rw-r--r--dbaccess/qa/unit/tdf126268.cxx5
-rw-r--r--include/test/unoapi_test.hxx2
-rw-r--r--sc/qa/extras/scddelinkobj.cxx35
-rw-r--r--sc/qa/extras/scddelinksobj.cxx9
-rw-r--r--sc/qa/extras/testdocuments/ScDDELinksObj.ods (renamed from sc/qa/unoapi/testdocuments/ScDDELinksObj.ods)bin7812 -> 7812 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx15
-rw-r--r--sw/qa/uibase/uiview/uiview.cxx12
-rw-r--r--test/source/unoapi_test.cxx7
-rw-r--r--vcl/qa/cppunit/filter/ipdf/ipdf.cxx19
-rw-r--r--xmlsecurity/qa/unit/signing/signing.cxx36
15 files changed, 57 insertions, 117 deletions
diff --git a/dbaccess/qa/unit/dbtest_base.cxx b/dbaccess/qa/unit/dbtest_base.cxx
index 8e7d2ab433c9..88da4b469742 100644
--- a/dbaccess/qa/unit/dbtest_base.cxx
+++ b/dbaccess/qa/unit/dbtest_base.cxx
@@ -30,8 +30,6 @@ class DBTestBase
public:
DBTestBase() : UnoApiTest("dbaccess/qa/unit/data") {};
- utl::TempFileNamed createTempCopy(std::u16string_view pathname);
-
uno::Reference<XOfficeDatabaseDocument> getDocumentForUrl(OUString const & url);
uno::Reference< XConnection >
@@ -39,20 +37,6 @@ public:
uno::Reference< XOfficeDatabaseDocument > const & xDocument);
};
-utl::TempFileNamed DBTestBase::createTempCopy(std::u16string_view pathname) {
- OUString url = createFileURL(pathname);
- utl::TempFileNamed tmp;
- tmp.EnableKillingFile();
- auto const e = osl::File::copy(url, tmp.GetURL());
- CPPUNIT_ASSERT_EQUAL_MESSAGE(
- (OString(
- "<" + OUStringToOString(url, RTL_TEXTENCODING_UTF8) + "> -> <"
- + OUStringToOString(tmp.GetURL(), RTL_TEXTENCODING_UTF8) + ">")
- .getStr()),
- osl::FileBase::E_None, e);
- return tmp;
-}
-
uno::Reference<XOfficeDatabaseDocument> DBTestBase::getDocumentForUrl(OUString const & url) {
mxComponent = loadFromDesktop(url);
uno::Reference< XOfficeDatabaseDocument > xDocument(mxComponent, UNO_QUERY_THROW);
diff --git a/dbaccess/qa/unit/firebird.cxx b/dbaccess/qa/unit/firebird.cxx
index 076144e1b054..8eaf39430e96 100644
--- a/dbaccess/qa/unit/firebird.cxx
+++ b/dbaccess/qa/unit/firebird.cxx
@@ -43,9 +43,9 @@ public:
*/
void FirebirdTest::testEmptyDBConnection()
{
- auto const tmp = createTempCopy(u"firebird_empty.odb");
+ createTempCopy(u"firebird_empty.odb");
uno::Reference< XOfficeDatabaseDocument > xDocument =
- getDocumentForUrl(tmp.GetURL());
+ getDocumentForUrl(maTempFile.GetURL());
getConnectionForDocument(xDocument);
diff --git a/dbaccess/qa/unit/hsql_binary_import.cxx b/dbaccess/qa/unit/hsql_binary_import.cxx
index fb9185a82b4c..569463e7e4ef 100644
--- a/dbaccess/qa/unit/hsql_binary_import.cxx
+++ b/dbaccess/qa/unit/hsql_binary_import.cxx
@@ -46,8 +46,9 @@ void HsqlBinaryImportTest::testBinaryImport()
}
// the migration requires the file to be writable
- utl::TempFileNamed const temp(createTempCopy(u"hsqldb_migration_test.odb"));
- uno::Reference<XOfficeDatabaseDocument> const xDocument = getDocumentForUrl(temp.GetURL());
+ createTempCopy(u"hsqldb_migration_test.odb");
+ uno::Reference<XOfficeDatabaseDocument> const xDocument
+ = getDocumentForUrl(maTempFile.GetURL());
uno::Reference<XConnection> xConnection = getConnectionForDocument(xDocument);
// at this point migration is already done
diff --git a/dbaccess/qa/unit/hsqldb.cxx b/dbaccess/qa/unit/hsqldb.cxx
index 7d792b3c26a8..eb553eac756e 100644
--- a/dbaccess/qa/unit/hsqldb.cxx
+++ b/dbaccess/qa/unit/hsqldb.cxx
@@ -32,8 +32,8 @@ public:
*/
void HSQLDBTest::testEmptyDBConnection()
{
- auto const file = createTempCopy(u"hsqldb_empty.odb");
- uno::Reference<XOfficeDatabaseDocument> xDocument = getDocumentForUrl(file.GetURL());
+ createTempCopy(u"hsqldb_empty.odb");
+ uno::Reference<XOfficeDatabaseDocument> xDocument = getDocumentForUrl(maTempFile.GetURL());
getConnectionForDocument(xDocument);
}
diff --git a/dbaccess/qa/unit/tdf119625.cxx b/dbaccess/qa/unit/tdf119625.cxx
index 7486f9f44fe2..ba0c7b2ce345 100644
--- a/dbaccess/qa/unit/tdf119625.cxx
+++ b/dbaccess/qa/unit/tdf119625.cxx
@@ -66,8 +66,9 @@ void Tdf119625Test::testTime()
}
// the migration requires the file to be writable
- utl::TempFileNamed const temp(createTempCopy(u"tdf119625.odb"));
- uno::Reference<XOfficeDatabaseDocument> const xDocument = getDocumentForUrl(temp.GetURL());
+ createTempCopy(u"tdf119625.odb");
+ uno::Reference<XOfficeDatabaseDocument> const xDocument
+ = getDocumentForUrl(maTempFile.GetURL());
uno::Reference<XConnection> xConnection = getConnectionForDocument(xDocument);
// at this point migration is already done
diff --git a/dbaccess/qa/unit/tdf126268.cxx b/dbaccess/qa/unit/tdf126268.cxx
index c565648b6150..c06fdead79c7 100644
--- a/dbaccess/qa/unit/tdf126268.cxx
+++ b/dbaccess/qa/unit/tdf126268.cxx
@@ -60,8 +60,9 @@ void Tdf126268Test::testNumbers()
}
// the migration requires the file to be writable
- utl::TempFileNamed const temp(createTempCopy(u"tdf126268.odb"));
- uno::Reference<XOfficeDatabaseDocument> const xDocument = getDocumentForUrl(temp.GetURL());
+ createTempCopy(u"tdf126268.odb");
+ uno::Reference<XOfficeDatabaseDocument> const xDocument
+ = getDocumentForUrl(maTempFile.GetURL());
uno::Reference<XConnection> xConnection = getConnectionForDocument(xDocument);
diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx
index 1f14f6a21f77..f228f70e21ca 100644
--- a/include/test/unoapi_test.hxx
+++ b/include/test/unoapi_test.hxx
@@ -46,6 +46,8 @@ public:
std::unique_ptr<vcl::pdf::PDFiumDocument> parsePDFExport(const OString& rPassword = OString());
+ void createTempCopy(std::u16string_view fileName);
+
void skipValidation() { mbSkipValidation = true; }
void setFilterOptions(const OUString& rFilterOptions) { maFilterOptions = rFilterOptions; }
diff --git a/sc/qa/extras/scddelinkobj.cxx b/sc/qa/extras/scddelinkobj.cxx
index 9be1a660d867..8f798beedd98 100644
--- a/sc/qa/extras/scddelinkobj.cxx
+++ b/sc/qa/extras/scddelinkobj.cxx
@@ -33,33 +33,7 @@ using namespace com::sun::star;
namespace sc_apitest
{
-static utl::TempFileNamed createTempCopy(OUString const& url)
-{
- utl::TempFileNamed tmp;
- tmp.EnableKillingFile();
- auto const e = osl::File::copy(url, tmp.GetURL());
- CPPUNIT_ASSERT_EQUAL_MESSAGE(
- (OString("<" + OUStringToOString(url, RTL_TEXTENCODING_UTF8) + "> -> <"
- + OUStringToOString(tmp.GetURL(), RTL_TEXTENCODING_UTF8) + ">")
- .getStr()),
- osl::FileBase::E_None, e);
- return tmp;
-}
-
-namespace
-{
-struct TempFileBase
-{
- utl::TempFileNamed m_TempFile;
- explicit TempFileBase(OUString const& url)
- : m_TempFile(createTempCopy(url))
- {
- }
-};
-}
-
class ScDDELinkObj : public UnoApiTest,
- public TempFileBase,
public apitest::XDDELink,
public apitest::XNamed,
public apitest::XRefreshable
@@ -89,9 +63,8 @@ public:
ScDDELinkObj::ScDDELinkObj()
: UnoApiTest("/sc/qa/extras/testdocuments")
- , TempFileBase(m_directories.getURLFromSrc(u"/sc/qa/unoapi/testdocuments/ScDDELinksObj.ods"))
- , XDDELink(m_TempFile.GetURL())
- , XNamed("soffice|" + m_TempFile.GetURL() + "!Sheet1.A1")
+ , XDDELink(maTempFile.GetURL())
+ , XNamed("soffice|" + maTempFile.GetURL() + "!Sheet1.A1")
{
}
@@ -103,7 +76,7 @@ uno::Reference<uno::XInterface> ScDDELinkObj::init()
uno::Reference<container::XIndexAccess> xIA(xSheets, UNO_QUERY_THROW);
uno::Reference<sheet::XSpreadsheet> xSheet(xIA->getByIndex(0), UNO_QUERY_THROW);
- const OUString testdoc = m_TempFile.GetURL();
+ const OUString testdoc = maTempFile.GetURL();
xSheet->getCellByPosition(5, 5)->setFormula("=DDE(\"soffice\";\"" + testdoc
+ "\";\"Sheet1.A1\")");
@@ -124,6 +97,8 @@ void ScDDELinkObj::setUp()
UnoApiTest::setUp();
// create a calc document
mxComponent = loadFromDesktop("private:factory/scalc");
+
+ createTempCopy(u"ScDDELinksObj.ods");
}
CPPUNIT_TEST_SUITE_REGISTRATION(ScDDELinkObj);
diff --git a/sc/qa/extras/scddelinksobj.cxx b/sc/qa/extras/scddelinksobj.cxx
index bb92a5a5151a..6a3a843ca9a1 100644
--- a/sc/qa/extras/scddelinksobj.cxx
+++ b/sc/qa/extras/scddelinksobj.cxx
@@ -81,12 +81,10 @@ public:
ScDDELinksObj::ScDDELinksObj()
: UnoApiTest("/sc/qa/extras/testdocuments")
- , XDDELinks(m_directories.getURLFromSrc(u"/sc/qa/unoapi/testdocuments/ScDDELinksObj.ods"))
+ , XDDELinks(createFileURL(u"ScDDELinksObj.ods"))
, XElementAccess(cppu::UnoType<sheet::XDDELink>::get())
, XIndexAccess(1)
- , XNameAccess("soffice|"
- + m_directories.getURLFromSrc(u"/sc/qa/unoapi/testdocuments/ScDDELinksObj.ods")
- + "!Sheet1.A1")
+ , XNameAccess("soffice|" + createFileURL(u"ScDDELinksObj.ods") + "!Sheet1.A1")
, XServiceInfo("ScDDELinksObj", "com.sun.star.sheet.DDELinks")
{
}
@@ -99,8 +97,7 @@ uno::Reference<uno::XInterface> ScDDELinksObj::init()
uno::Reference<container::XIndexAccess> xIA(xSheets, uno::UNO_QUERY_THROW);
uno::Reference<sheet::XSpreadsheet> xSheet(xIA->getByIndex(0), uno::UNO_QUERY_THROW);
- const OUString testdoc
- = m_directories.getURLFromSrc(u"/sc/qa/unoapi/testdocuments/ScDDELinksObj.ods");
+ const OUString testdoc = createFileURL(u"ScDDELinksObj.ods");
xSheet->getCellByPosition(5, 5)->setFormula("=DDE(\"soffice\";\"" + testdoc
+ "\";\"Sheet1.A1\")");
diff --git a/sc/qa/unoapi/testdocuments/ScDDELinksObj.ods b/sc/qa/extras/testdocuments/ScDDELinksObj.ods
index 01c11e339a68..01c11e339a68 100644
--- a/sc/qa/unoapi/testdocuments/ScDDELinksObj.ods
+++ b/sc/qa/extras/testdocuments/ScDDELinksObj.ods
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 4d930f7bca21..c6a56fe84daa 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -85,20 +85,15 @@ public:
std::unique_ptr<SwTextBlocks> SwUiWriterTest::readDOCXAutotext(std::u16string_view sFileName, bool bEmpty)
{
- utl::TempFileNamed tmp;
- tmp.EnableKillingFile();
- OUString rURL = tmp.GetURL();
- CPPUNIT_ASSERT_EQUAL(
- osl::FileBase::E_None,
- osl::File::copy(createFileURL(sFileName), rURL));
-
- SfxMedium aSrcMed(rURL, StreamMode::STD_READ);
+ createTempCopy(sFileName);
+
+ SfxMedium aSrcMed(maTempFile.GetURL(), StreamMode::STD_READ);
createSwDoc();
SwDoc* pDoc = getSwDoc();
- SwReader aReader(aSrcMed, rURL, pDoc);
+ SwReader aReader(aSrcMed, maTempFile.GetURL(), pDoc);
Reader* pDOCXReader = SwReaderWriter::GetDOCXReader();
- auto pGlossary = std::make_unique<SwTextBlocks>(rURL);
+ auto pGlossary = std::make_unique<SwTextBlocks>(maTempFile.GetURL());
CPPUNIT_ASSERT(pDOCXReader != nullptr);
CPPUNIT_ASSERT_EQUAL(!bEmpty, aReader.ReadGlossaries(*pDOCXReader, *pGlossary, false));
diff --git a/sw/qa/uibase/uiview/uiview.cxx b/sw/qa/uibase/uiview/uiview.cxx
index 348574b13f85..10b5eaa6eeee 100644
--- a/sw/qa/uibase/uiview/uiview.cxx
+++ b/sw/qa/uibase/uiview/uiview.cxx
@@ -42,12 +42,7 @@ public:
CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, testUpdateAllObjectReplacements)
{
// Make a temporary copy of the test document
- utl::TempFileNamed tmp;
- tmp.EnableKillingFile();
- OUString sTempCopy = tmp.GetURL();
- CPPUNIT_ASSERT_EQUAL(
- osl::FileBase::E_None,
- osl::File::copy(createFileURL(u"updateall-objectreplacements.odt"), sTempCopy));
+ createTempCopy(u"updateall-objectreplacements.odt");
/* BASIC code that exhibits the problem:
@@ -71,7 +66,8 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, testUpdateAllObjectReplacements)
= xFactory->createInstance("com.sun.star.frame.Desktop");
uno::Reference<frame::XComponentLoader> xComponentLoader(xInterface, uno::UNO_QUERY);
uno::Sequence<beans::PropertyValue> aLoadArgs{ comphelper::makePropertyValue("Hidden", true) };
- mxComponent = xComponentLoader->loadComponentFromURL(sTempCopy, "_default", 0, aLoadArgs);
+ mxComponent
+ = xComponentLoader->loadComponentFromURL(maTempFile.GetURL(), "_default", 0, aLoadArgs);
// Perform the .uno:UpdateAll call and save
xInterface = xFactory->createInstance("com.sun.star.frame.DispatchHelper");
@@ -87,7 +83,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, testUpdateAllObjectReplacements)
// Check the contents of the updated copy and verify that ObjectReplacements are there
uno::Reference<packages::zip::XZipFileAccess2> xNameAccess
= packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(xFactory),
- sTempCopy);
+ maTempFile.GetURL());
CPPUNIT_ASSERT(xNameAccess->hasByName("ObjectReplacements/Components"));
CPPUNIT_ASSERT(xNameAccess->hasByName("ObjectReplacements/Components_1"));
diff --git a/test/source/unoapi_test.cxx b/test/source/unoapi_test.cxx
index ff566c8ffa10..10ee4f01c06b 100644
--- a/test/source/unoapi_test.cxx
+++ b/test/source/unoapi_test.cxx
@@ -218,4 +218,11 @@ std::unique_ptr<vcl::pdf::PDFiumDocument> UnoApiTest::parsePDFExport(const OStri
return pPdfDocument;
}
+void UnoApiTest::createTempCopy(std::u16string_view fileName)
+{
+ OUString url = createFileURL(fileName);
+ auto const e = osl::File::copy(url, maTempFile.GetURL());
+ CPPUNIT_ASSERT_EQUAL(osl::FileBase::E_None, e);
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/qa/cppunit/filter/ipdf/ipdf.cxx b/vcl/qa/cppunit/filter/ipdf/ipdf.cxx
index cdb09b7e858b..1c143a1b8319 100644
--- a/vcl/qa/cppunit/filter/ipdf/ipdf.cxx
+++ b/vcl/qa/cppunit/filter/ipdf/ipdf.cxx
@@ -72,16 +72,12 @@ CPPUNIT_TEST_FIXTURE(VclFilterIpdfTest, testPDFAddVisibleSignatureLastPage)
if (!IsDefaultDPI())
return;
// Given: copy the test document to a temporary file, as it'll be modified.
- utl::TempFileNamed aTempFile;
- aTempFile.EnableKillingFile();
- OUString aSourceURL = createFileURL(u"add-visible-signature-last-page.pdf");
- OUString aURL = aTempFile.GetURL();
- osl::File::RC eRet = osl::File::copy(aSourceURL, aURL);
- CPPUNIT_ASSERT_EQUAL(osl::File::RC::E_None, eRet);
+ createTempCopy(u"add-visible-signature-last-page.pdf");
// Open it.
uno::Sequence<beans::PropertyValue> aArgs = { comphelper::makePropertyValue("ReadOnly", true) };
- mxComponent = loadFromDesktop(aURL, "com.sun.star.drawing.DrawingDocument", aArgs);
+ mxComponent
+ = loadFromDesktop(maTempFile.GetURL(), "com.sun.star.drawing.DrawingDocument", aArgs);
SfxBaseModel* pBaseModel = dynamic_cast<SfxBaseModel*>(mxComponent.get());
CPPUNIT_ASSERT(pBaseModel);
SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell();
@@ -120,15 +116,10 @@ CPPUNIT_TEST_FIXTURE(VclFilterIpdfTest, testPDFAddVisibleSignatureLastPage)
pObjectShell->SignDocumentContentUsingCertificate(xCert);
// Then: count the # of shapes on the signature widget/annotation.
- std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get();
- if (!pPDFium)
+ std::unique_ptr<vcl::pdf::PDFiumDocument> pPdfDocument = parsePDFExport();
+ if (!pPdfDocument)
return;
- SvFileStream aFile(aTempFile.GetURL(), StreamMode::READ);
- SvMemoryStream aMemory;
- aMemory.WriteStream(aFile);
// Last page.
- std::unique_ptr<vcl::pdf::PDFiumDocument> pPdfDocument
- = pPDFium->openDocument(aMemory.GetData(), aMemory.GetSize(), OString());
std::unique_ptr<vcl::pdf::PDFiumPage> pPdfPage = pPdfDocument->openPage(/*nIndex=*/1);
// Without the accompanying fix in place, this test would have failed with:
// - Expected: 1
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx
index a5dde0c55998..d8518ece0f9b 100644
--- a/xmlsecurity/qa/unit/signing/signing.cxx
+++ b/xmlsecurity/qa/unit/signing/signing.cxx
@@ -314,15 +314,13 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testOOXMLDescription)
CPPUNIT_TEST_FIXTURE(SigningTest, testOOXMLAppend)
{
// Copy the test document to a temporary file, as it'll be modified.
- OUString aURL = maTempFile.GetURL();
- CPPUNIT_ASSERT_EQUAL(osl::File::RC::E_None,
- osl::File::copy(createFileURL(u"partial.docx"), aURL));
+ createTempCopy(u"partial.docx");
// Load the test document as a storage and read its single signature.
DocumentSignatureManager aManager(mxComponentContext, DocumentSignatureMode::Content);
CPPUNIT_ASSERT(aManager.init());
uno::Reference<embed::XStorage> xStorage
- = comphelper::OStorageHelper::GetStorageOfFormatFromURL(ZIP_STORAGE_FORMAT_STRING, aURL,
- embed::ElementModes::READWRITE);
+ = comphelper::OStorageHelper::GetStorageOfFormatFromURL(
+ ZIP_STORAGE_FORMAT_STRING, maTempFile.GetURL(), embed::ElementModes::READWRITE);
CPPUNIT_ASSERT(xStorage.is());
aManager.setStore(xStorage);
aManager.getSignatureHelper().SetStorage(xStorage, u"1.2");
@@ -350,12 +348,10 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testOOXMLRemove)
// Load the test document as a storage and read its signatures: purpose1 and purpose2.
DocumentSignatureManager aManager(mxComponentContext, DocumentSignatureMode::Content);
CPPUNIT_ASSERT(aManager.init());
- OUString aURL = maTempFile.GetURL();
- CPPUNIT_ASSERT_EQUAL(osl::File::RC::E_None,
- osl::File::copy(createFileURL(u"multi.docx"), aURL));
+ createTempCopy(u"multi.docx");
uno::Reference<embed::XStorage> xStorage
- = comphelper::OStorageHelper::GetStorageOfFormatFromURL(ZIP_STORAGE_FORMAT_STRING, aURL,
- embed::ElementModes::READWRITE);
+ = comphelper::OStorageHelper::GetStorageOfFormatFromURL(
+ ZIP_STORAGE_FORMAT_STRING, maTempFile.GetURL(), embed::ElementModes::READWRITE);
CPPUNIT_ASSERT(xStorage.is());
aManager.setStore(xStorage);
aManager.getSignatureHelper().SetStorage(xStorage, u"1.2");
@@ -380,15 +376,13 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testOOXMLRemove)
CPPUNIT_TEST_FIXTURE(SigningTest, testOOXMLRemoveAll)
{
// Copy the test document to a temporary file, as it'll be modified.
- OUString aURL = maTempFile.GetURL();
- CPPUNIT_ASSERT_EQUAL(osl::File::RC::E_None,
- osl::File::copy(createFileURL(u"partial.docx"), aURL));
+ createTempCopy(u"partial.docx");
// Load the test document as a storage and read its single signature.
DocumentSignatureManager aManager(mxComponentContext, DocumentSignatureMode::Content);
CPPUNIT_ASSERT(aManager.init());
uno::Reference<embed::XStorage> xStorage
- = comphelper::OStorageHelper::GetStorageOfFormatFromURL(ZIP_STORAGE_FORMAT_STRING, aURL,
- embed::ElementModes::READWRITE);
+ = comphelper::OStorageHelper::GetStorageOfFormatFromURL(
+ ZIP_STORAGE_FORMAT_STRING, maTempFile.GetURL(), embed::ElementModes::READWRITE);
CPPUNIT_ASSERT(xStorage.is());
aManager.setStore(xStorage);
aManager.getSignatureHelper().SetStorage(xStorage, u"1.2");
@@ -728,14 +722,12 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testPDFAddVisibleSignature)
if (!IsDefaultDPI())
return;
// Given: copy the test document to a temporary file, as it'll be modified.
- OUString aSourceURL = createFileURL(u"add-visible-signature.pdf");
- OUString aURL = maTempFile.GetURL();
- osl::File::RC eRet = osl::File::copy(aSourceURL, aURL);
- CPPUNIT_ASSERT_EQUAL(osl::File::RC::E_None, eRet);
+ createTempCopy(u"add-visible-signature.pdf");
// Open it.
uno::Sequence<beans::PropertyValue> aArgs = { comphelper::makePropertyValue("ReadOnly", true) };
- mxComponent = loadFromDesktop(aURL, "com.sun.star.drawing.DrawingDocument", aArgs);
+ mxComponent
+ = loadFromDesktop(maTempFile.GetURL(), "com.sun.star.drawing.DrawingDocument", aArgs);
SfxBaseModel* pBaseModel = dynamic_cast<SfxBaseModel*>(mxComponent.get());
CPPUNIT_ASSERT(pBaseModel);
SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell();
@@ -841,9 +833,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, test96097Doc)
CPPUNIT_TEST_FIXTURE(SigningTest, testXAdESNotype)
{
// Create a working copy.
- OUString aURL = maTempFile.GetURL();
- CPPUNIT_ASSERT_EQUAL(osl::File::RC::E_None,
- osl::File::copy(createFileURL(u"notype-xades.odt"), aURL));
+ createTempCopy(u"notype-xades.odt");
// Read existing signature.
DocumentSignatureManager aManager(mxComponentContext, DocumentSignatureMode::Content);