summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2018-03-13 23:55:26 -0400
committerJan Holesovsky <kendy@collabora.com>2018-06-01 08:59:10 +0200
commit52a0b46bfdc32e5c37b3d7343a42c6388f3d569d (patch)
treee4939d36f57dfe06aad329350630b5e960ebb5ea /sfx2
parent32817f930580b6b378dd470ccbdf967c06540db2 (diff)
sd: import PDFs as images using Pdfium new SdPdfFilter
LOK now opens PDFs as images using Pdfium, which has a superior accuracy and support to poppler, the default pdf reader. (cherry picked from commit 0e8f4f45b44935c7c8002d606b97a48e60e37b23) Change-Id: Ifbbecf7f048f001836fb98886705cba47e6bed4e
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/objstor.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 21fd5cd69649..79e41343f61f 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -101,6 +101,8 @@
#include <basic/modsizeexceeded.hxx>
#include <officecfg/Office/Common.hxx>
#include <osl/file.hxx>
+#include <comphelper/scopeguard.hxx>
+#include <comphelper/lok.hxx>
#include <sfx2/signaturestate.hxx>
#include <sfx2/app.hxx>
@@ -746,9 +748,13 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
if ( GetError() == ERRCODE_NONE )
{
+ // Experimental PDF importing using PDFium. This is currently enabled for LOK only and
+ // we handle it not via XmlFilterAdaptor but a new SdPdfFiler.
+ const bool bPdfiumImport = comphelper::LibreOfficeKit::isActive() && pMedium->GetFilter() &&
+ (pMedium->GetFilter()->GetFilterName() == "draw_pdf_import");
pImpl->nLoadedFlags = SfxLoadedFlags::NONE;
pImpl->bModelInitialized = false;
- if ( pMedium->GetFilter() && ( pMedium->GetFilter()->GetFilterFlags() & SfxFilterFlags::STARONEFILTER ) )
+ if ( pMedium->GetFilter() && ( pMedium->GetFilter()->GetFilterFlags() & SfxFilterFlags::STARONEFILTER ) && !bPdfiumImport )
{
uno::Reference < beans::XPropertySet > xSet( GetModel(), uno::UNO_QUERY );
const OUString sLockUpdates("LockUpdates");