summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-12-16 18:57:04 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-12-17 19:40:26 +0100
commit78761f9b0177b0ae8ccfc5323a530fe4404b9637 (patch)
treebe0ab98fa302bc46a0142b8d4fd21cbd48417765 /sd
parent0082db9dd134e16d59a8000368976de42154d2a3 (diff)
Make disabled PDF import tests compile again
...if they were enabled, see the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2019-December/084003.html> "sd: disable pdf import tests" Change-Id: Ic52972e60ea411baab0f7b0ed0ec6b6057a95e06 Reviewed-on: https://gerrit.libreoffice.org/85238 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/import-tests.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 91840ee1b0cd..773e86cdc5a7 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -11,7 +11,9 @@
#include <config_features.h>
#include <config_poppler.h>
+#include <memory>
#include <ostream>
+#include <utility>
#include <sdpage.hxx>
#include "sdmodeltestbase.hxx"
@@ -26,6 +28,8 @@
#include <editeng/colritem.hxx>
#include <editeng/numitem.hxx>
#include <editeng/unoprnms.hxx>
+#include <sfx2/app.hxx>
+#include <sfx2/sfxsids.hrc>
#include <svl/style.hxx>
#include <svx/svdotext.hxx>
@@ -1290,7 +1294,7 @@ void SdImportTest::testPDFImport()
CPPUNIT_ASSERT_EQUAL_MESSAGE( "no exactly two shapes", static_cast<sal_Int32>(2), xPage->getCount() );
uno::Reference< beans::XPropertySet > xShape( getShape( 0, xPage ) );
- uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY)->getText();
+ uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY_THROW)->getText();
CPPUNIT_ASSERT_MESSAGE( "not a text shape", xText.is() );
xDocShRef->DoClose();
@@ -1298,10 +1302,10 @@ void SdImportTest::testPDFImport()
void SdImportTest::testPDFImportSkipImages()
{
- SfxAllItemSet *pParams = new SfxAllItemSet( SfxGetpApp()->GetPool() );
+ auto pParams = std::make_unique<SfxAllItemSet>( SfxGetpApp()->GetPool() );
pParams->Put( SfxStringItem ( SID_FILE_FILTEROPTIONS, "SkipImages" ) );
- sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pdf/txtpic.pdf"), PDF, pParams);
+ sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pdf/txtpic.pdf"), PDF, std::move(pParams));
SdDrawDocument *pDoc = xDocShRef->GetDoc();
CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != nullptr );
uno::Reference< drawing::XDrawPagesSupplier > xDoc(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW );
@@ -1309,7 +1313,7 @@ void SdImportTest::testPDFImportSkipImages()
CPPUNIT_ASSERT_EQUAL_MESSAGE( "no exactly one shape", static_cast<sal_Int32>(1), xPage->getCount() );
uno::Reference< drawing::XShape > xShape(xPage->getByIndex(0), uno::UNO_QUERY_THROW );
- uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY)->getText();
+ uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY_THROW)->getText();
CPPUNIT_ASSERT_MESSAGE( "not a text shape", xText.is() );
xDocShRef->DoClose();