diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2018-03-13 23:55:26 -0400 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-06-07 10:45:18 +0200 |
commit | 7939efc7136987fad348baca2cd686a00aee73cd (patch) | |
tree | c142fd2770bb97d83fa91b971e370cf3b4acc73c /sfx2 | |
parent | 9b11fdd36ec80f9d1ae0a05455745361e0ce9ced (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.
Change-Id: Ifbbecf7f048f001836fb98886705cba47e6bed4e
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 61ab2371eb24..7eb2824636c7 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -101,6 +101,7 @@ #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 +747,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"); |