summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-04-06 12:17:23 +0200
committerTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-04-08 13:15:55 +0200
commit7f63706ad64ed781f8c3cdeeb28a44a3c31f432c (patch)
tree2171ad9d811a50dd7c2f58c3b896aa3508b5cf57 /desktop
parente50699e6b85781a6dfdede703bb6012466fc4b93 (diff)
liblo: extend doc_saveAs with filterOptions
Change-Id: I720f2819955b6f26ea7161493cccb07f873f2a51
Diffstat (limited to 'desktop')
-rw-r--r--desktop/inc/liblibreoffice.h3
-rw-r--r--desktop/inc/liblibreoffice.hxx4
-rw-r--r--desktop/source/lib/init.cxx7
3 files changed, 9 insertions, 5 deletions
diff --git a/desktop/inc/liblibreoffice.h b/desktop/inc/liblibreoffice.h
index 37920ceb8ddc..e9df56602083 100644
--- a/desktop/inc/liblibreoffice.h
+++ b/desktop/inc/liblibreoffice.h
@@ -35,7 +35,8 @@ struct _LibreOfficeDocument
void (*destroy) (LibreOfficeDocument* pThis);
int (*saveAs) (LibreOfficeDocument* pThis,
const char *pUrl,
- const char *pFormat);
+ const char *pFormat,
+ const char *pFilterOptions);
};
LibreOffice* lo_init (const char* pInstallPath);
diff --git a/desktop/inc/liblibreoffice.hxx b/desktop/inc/liblibreoffice.hxx
index 9076992da073..ef01cb31620b 100644
--- a/desktop/inc/liblibreoffice.hxx
+++ b/desktop/inc/liblibreoffice.hxx
@@ -35,9 +35,9 @@ public:
}
// Save as the given format, if format is NULL sniff from ext'n
- inline bool saveAs(const char* pUrl, const char* pFormat = NULL)
+ inline bool saveAs(const char* pUrl, const char* pFormat = NULL, const char* pFilterOptions = NULL)
{
- return mpDoc->saveAs(mpDoc, pUrl, pFormat);
+ return mpDoc->saveAs(mpDoc, pUrl, pFormat, pFilterOptions);
}
};
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 2b49673c425d..9703699f4451 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -129,7 +129,7 @@ extern "C"
SAL_DLLPUBLIC_EXPORT LibreOffice *liblibreoffice_hook(void);
static void doc_destroy(LibreOfficeDocument* pThis);
-static int doc_saveAs(LibreOfficeDocument* pThis, const char* pUrl, const char* pFormat);
+static int doc_saveAs(LibreOfficeDocument* pThis, const char* pUrl, const char* pFormat, const char* pFilterOptions);
struct LibLODocument_Impl : public _LibreOfficeDocument
{
@@ -207,7 +207,7 @@ static LibreOfficeDocument* lo_documentLoad(LibreOffice* pThis, const char* pURL
return NULL;
}
-static int doc_saveAs(LibreOfficeDocument* pThis, const char* sUrl, const char* pFormat)
+static int doc_saveAs(LibreOfficeDocument* pThis, const char* sUrl, const char* pFormat, const char* pFilterOptions)
{
LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
@@ -268,9 +268,12 @@ static int doc_saveAs(LibreOfficeDocument* pThis, const char* sUrl, const char*
return false;
}
+ OUString aFilterOptions = getUString(pFilterOptions);
+
MediaDescriptor aSaveMediaDescriptor;
aSaveMediaDescriptor["Overwrite"] <<= sal_True;
aSaveMediaDescriptor["FilterName"] <<= aFilterName;
+ aSaveMediaDescriptor[MediaDescriptor::PROP_FILTEROPTIONS()] <<= aFilterOptions;
uno::Reference<frame::XStorable> xStorable(pDocument->mxComponent, uno::UNO_QUERY_THROW);
xStorable->storeToURL(aURL, aSaveMediaDescriptor.getAsConstPropertyValueList());