summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMihai <mihai.varga@collabora.com>2015-02-13 12:56:11 +0200
committerCaolán McNamara <caolanm@redhat.com>2015-02-17 13:31:29 +0000
commit98b27ea907517d585f5d951895ae733653a442d2 (patch)
tree34972139f7f63cbd51a7b917e4a9dc0d77a5c89c /desktop
parent61e9e6d08f79a5b75674b94bccc05880256671e8 (diff)
SkipImages option for PDF import
This option allows images and drawings to be skipped while importing a PDF, the main reason was performance improvement where images were not needed. Change-Id: Ibca342ff6e7005bedf7b16869473832ce2576fb2 Reviewed-on: https://gerrit.libreoffice.org/14470 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index d7ca1438709b..3be8a2002eaa 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -262,6 +262,9 @@ static void lo_destroy (LibreOfficeKit* pThis);
static int lo_initialize (LibreOfficeKit* pThis, const char* pInstallPath);
static LibreOfficeKitDocument* lo_documentLoad (LibreOfficeKit* pThis, const char* pURL);
static char * lo_getError (LibreOfficeKit* pThis);
+static LibreOfficeKitDocument* lo_documentLoadWithOptions (LibreOfficeKit* pThis,
+ const char* pURL,
+ const char* pOptions);
static void lo_postKeyEvent (LibreOfficeKit* pThis, int nType, int nCode);
@@ -281,6 +284,7 @@ struct LibLibreOffice_Impl : public _LibreOfficeKit
m_pOfficeClass->destroy = lo_destroy;
m_pOfficeClass->documentLoad = lo_documentLoad;
m_pOfficeClass->getError = lo_getError;
+ m_pOfficeClass->documentLoadWithOptions = lo_documentLoadWithOptions;
m_pOfficeClass->postKeyEvent = lo_postKeyEvent;
gOfficeClass = m_pOfficeClass;
@@ -308,6 +312,11 @@ static uno::Reference<css::lang::XMultiComponentFactory> xFactory;
static LibreOfficeKitDocument* lo_documentLoad(LibreOfficeKit* pThis, const char* pURL)
{
+ return lo_documentLoadWithOptions(pThis, pURL, NULL);
+}
+
+static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis, const char* pURL, const char* pOptions)
+{
LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis);
SolarMutexGuard aGuard;
@@ -334,10 +343,15 @@ static LibreOfficeKitDocument* lo_documentLoad(LibreOfficeKit* pThis, const char
try
{
+ uno::Sequence<css::beans::PropertyValue> aFilterOptions(1);
+ aFilterOptions[0] = css::beans::PropertyValue( OUString("FilterOptions"),
+ 0,
+ uno::makeAny(OUString::createFromAscii(pOptions)),
+ beans::PropertyState_DIRECT_VALUE);
uno::Reference<lang::XComponent> xComponent;
xComponent = xComponentLoader->loadComponentFromURL(
aURL, OUString("_blank"), 0,
- uno::Sequence<css::beans::PropertyValue>());
+ aFilterOptions);
if (!xComponent.is())
{
@@ -357,7 +371,6 @@ static LibreOfficeKitDocument* lo_documentLoad(LibreOfficeKit* pThis, const char
return NULL;
}
-
static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const char* pFormat, const char* pFilterOptions)
{
LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);