diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-11-04 17:31:55 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-11-08 11:54:22 +0100 |
commit | 248be1fe7d31499fe7e237bb15ec67b55962c1a7 (patch) | |
tree | d2a3693af5d555f5c6cca31b625a9001af21e869 /sd/qa/unit/SdrPdfImportTest.cxx | |
parent | 444bf8710d5da7b584fbcb94693e4ed8d2e29297 (diff) |
UnoApiTest: simplify code by using tempfile member
SwModelTestBase does the same. this will help to make
SwModelTestBase inherit from UnoApiTest
Change-Id: If1c824cf92f0e8b70253e4d5fdeddcaa521d4632
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142287
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sd/qa/unit/SdrPdfImportTest.cxx')
-rw-r--r-- | sd/qa/unit/SdrPdfImportTest.cxx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sd/qa/unit/SdrPdfImportTest.cxx b/sd/qa/unit/SdrPdfImportTest.cxx index 372ccf13f534..4f45d5f300f3 100644 --- a/sd/qa/unit/SdrPdfImportTest.cxx +++ b/sd/qa/unit/SdrPdfImportTest.cxx @@ -213,19 +213,16 @@ CPPUNIT_TEST_FIXTURE(SdrPdfImportTest, testAnnotationsImportExport) } { // save as PDF and check annotations - utl::TempFileNamed aTempFile; - aTempFile.EnableKillingFile(); - uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); uno::Sequence<beans::PropertyValue> aFilterData( comphelper::InitPropertySequence({ { "ExportBookmarks", uno::Any(true) } })); aMediaDescriptor["FilterData"] <<= aFilterData; - xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); + xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); mxComponent->dispose(); - SvFileStream aFile(aTempFile.GetURL(), StreamMode::READ); + SvFileStream aFile(maTempFile.GetURL(), StreamMode::READ); SvMemoryStream aMemory; aMemory.WriteStream(aFile); @@ -249,7 +246,7 @@ CPPUNIT_TEST_FIXTURE(SdrPdfImportTest, testAnnotationsImportExport) pPDFAnnotation2->getSubType()); // Pop-up annotation // Load document again - mxComponent = loadFromDesktop(aTempFile.GetURL()); + mxComponent = loadFromDesktop(maTempFile.GetURL()); auto pNewImpressDocument = dynamic_cast<SdXImpressDocument*>(mxComponent.get()); sd::ViewShell* pNewViewShell = pNewImpressDocument->GetDocShell()->GetViewShell(); CPPUNIT_ASSERT(pNewViewShell); |