[Libreoffice-commits] core.git: sd/qa

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Tue Dec 17 18:41:50 UTC 2019


 sd/qa/unit/import-tests.cxx |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 78761f9b0177b0ae8ccfc5323a530fe4404b9637
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon Dec 16 18:57:04 2019 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Tue Dec 17 19:40:26 2019 +0100

    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 at redhat.com>
    Tested-by: Stephan Bergmann <sbergman at redhat.com>

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();


More information about the Libreoffice-commits mailing list