summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-02-13 17:05:19 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-03-14 12:05:13 +0100
commit5fdeb30cc78817ce85cb568053145752ff7ec215 (patch)
tree7d4f84c18f8a943e4bfa45f29ac9d87219be90e3 /svtools
parent08f0a54644c52a2c3da3b900ecf916639129e914 (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. Reviewed-on: https://gerrit.libreoffice.org/34217 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 6657d52417295265367cf3ffe5832b60e3c38011) Conflicts: config_host/config_features.h.in vcl/Library_vcl.mk vcl/source/gdi/impgraph.cxx Change-Id: I72c25642ec84cc831df362e02b1520c6e6d9adcf
Diffstat (limited to 'svtools')
-rw-r--r--svtools/qa/unit/GraphicObjectTest.cxx2
-rw-r--r--svtools/source/graphic/grfcache.cxx8
2 files changed, 5 insertions, 5 deletions
diff --git a/svtools/qa/unit/GraphicObjectTest.cxx b/svtools/qa/unit/GraphicObjectTest.cxx
index 43cf3b7d491f..d8339fa25b28 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 6e637d4ac708..9a55f55cbef5 100644
--- a/svtools/source/graphic/grfcache.cxx
+++ b/svtools/source/graphic/grfcache.cxx
@@ -243,6 +243,8 @@ bool GraphicCacheEntry::ImplInit( const GraphicObject& rObj )
else
{
mpBmpEx = new BitmapEx( rGraphic.GetBitmapEx() );
+ if (rGraphic.getPdfData().hasElements())
+ maPdfData = rGraphic.getPdfData();
}
}
break;
@@ -250,8 +252,6 @@ bool GraphicCacheEntry::ImplInit( const GraphicObject& rObj )
case GraphicType::GdiMetafile:
{
mpMtf = new GDIMetaFile( rGraphic.GetGDIMetaFile() );
- if (rGraphic.getPdfData().hasElements())
- maPdfData = rGraphic.getPdfData();
}
break;
@@ -290,6 +290,8 @@ void GraphicCacheEntry::ImplFillSubstitute( Graphic& rSubstitute )
else if( mpBmpEx )
{
rSubstitute = *mpBmpEx;
+ if (maPdfData.hasElements())
+ rSubstitute.setPdfData(maPdfData);
}
else if( mpAnimation )
{
@@ -298,8 +300,6 @@ void GraphicCacheEntry::ImplFillSubstitute( Graphic& rSubstitute )
else if( mpMtf )
{
rSubstitute = *mpMtf;
- if (maPdfData.hasElements())
- rSubstitute.setPdfData(maPdfData);
}
else
{