diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-02-13 17:05:19 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-02-13 16:54:04 +0000 |
commit | 6657d52417295265367cf3ffe5832b60e3c38011 (patch) | |
tree | a664018f1eb611c88d8d73fd3b0241090ec36f8d /svtools | |
parent | 7c9c6a4425b679596acae6f67ee8ac5f3d98bd6e (diff) |
vcl pdf import: use pdfium instead of draw_pdf_import
Replace creating a full Draw component with direct pdfium library calls.
This also means that the result is now a bitmap, not a metafile for now.
Also decouple HAVE_FEATURE_PDFIMPORT and HAVE_FEATURE_PDFIUM, the first
is the "import PDF into Draw" feature, the second is the "insert PDF as
image" feature.
Change-Id: I72c25642ec84cc831df362e02b1520c6e6d9adcf
Reviewed-on: https://gerrit.libreoffice.org/34217
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/qa/unit/GraphicObjectTest.cxx | 2 | ||||
-rw-r--r-- | svtools/source/graphic/grfcache.cxx | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/svtools/qa/unit/GraphicObjectTest.cxx b/svtools/qa/unit/GraphicObjectTest.cxx index 7d938746a76b..031a3eab6d58 100644 --- a/svtools/qa/unit/GraphicObjectTest.cxx +++ b/svtools/qa/unit/GraphicObjectTest.cxx @@ -311,7 +311,7 @@ void GraphicObjectTest::testTdf88935() void GraphicObjectTest::testPdf() { -#if HAVE_FEATURE_PDFIMPORT +#if HAVE_FEATURE_PDFIUM uno::Reference<lang::XComponent> xComponent = loadFromDesktop(m_directories.getURLFromSrc("svtools/qa/unit/data/pdf.odt"), "com.sun.star.text.TextDocument"); SwXTextDocument* pTxtDoc = dynamic_cast<SwXTextDocument*>(xComponent.get()); CPPUNIT_ASSERT(pTxtDoc); diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx index 273afffaeedc..2b158698548b 100644 --- a/svtools/source/graphic/grfcache.cxx +++ b/svtools/source/graphic/grfcache.cxx @@ -240,6 +240,8 @@ bool GraphicCacheEntry::ImplInit( const GraphicObject& rObj ) else { mpBmpEx = new BitmapEx( rGraphic.GetBitmapEx() ); + if (rGraphic.getPdfData().hasElements()) + maPdfData = rGraphic.getPdfData(); } } break; @@ -247,8 +249,6 @@ bool GraphicCacheEntry::ImplInit( const GraphicObject& rObj ) case GraphicType::GdiMetafile: { mpMtf = new GDIMetaFile( rGraphic.GetGDIMetaFile() ); - if (rGraphic.getPdfData().hasElements()) - maPdfData = rGraphic.getPdfData(); } break; @@ -287,6 +287,8 @@ void GraphicCacheEntry::ImplFillSubstitute( Graphic& rSubstitute ) else if( mpBmpEx ) { rSubstitute = *mpBmpEx; + if (maPdfData.hasElements()) + rSubstitute.setPdfData(maPdfData); } else if( mpAnimation ) { @@ -295,8 +297,6 @@ void GraphicCacheEntry::ImplFillSubstitute( Graphic& rSubstitute ) else if( mpMtf ) { rSubstitute = *mpMtf; - if (maPdfData.hasElements()) - rSubstitute.setPdfData(maPdfData); } else { |