summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-04-08 17:39:10 +0200
committerJan Holesovsky <kendy@collabora.com>2014-04-08 18:11:34 +0200
commit55e39c72d6ac462b201dc0ae0ab0c610a0f13056 (patch)
tree1bf004c8e418b1e6dd626264ab3dd5f5cde2cdfc /desktop
parent98668cd581f9f8dc272d42580c3989ee5dee0b53 (diff)
liblo: new saveAsWithOptions function
To not break API compatibility of libLO, add a new saveAsWithOptions function and revert the old saveAs to initial state. Change-Id: If245c0261a932b6ed5d65e20cb1b6d8bd1c50ce6
Diffstat (limited to 'desktop')
-rw-r--r--desktop/inc/liblibreoffice.h9
-rw-r--r--desktop/inc/liblibreoffice.hxx9
-rw-r--r--desktop/source/lib/init.cxx11
3 files changed, 22 insertions, 7 deletions
diff --git a/desktop/inc/liblibreoffice.h b/desktop/inc/liblibreoffice.h
index e9df56602083..87111c43bc67 100644
--- a/desktop/inc/liblibreoffice.h
+++ b/desktop/inc/liblibreoffice.h
@@ -35,14 +35,17 @@ struct _LibreOfficeDocument
void (*destroy) (LibreOfficeDocument* pThis);
int (*saveAs) (LibreOfficeDocument* pThis,
const char *pUrl,
- const char *pFormat,
- const char *pFilterOptions);
+ const char *pFormat);
+ int (*saveAsWithOptions) (LibreOfficeDocument* pThis,
+ const char *pUrl,
+ const char *pFormat,
+ const char *pFilterOptions);
};
LibreOffice* lo_init (const char* pInstallPath);
#ifdef __cplusplus
- }
+}
#endif
#endif
diff --git a/desktop/inc/liblibreoffice.hxx b/desktop/inc/liblibreoffice.hxx
index ef01cb31620b..29d3f7222373 100644
--- a/desktop/inc/liblibreoffice.hxx
+++ b/desktop/inc/liblibreoffice.hxx
@@ -35,9 +35,14 @@ public:
}
// Save as the given format, if format is NULL sniff from ext'n
- inline bool saveAs(const char* pUrl, const char* pFormat = NULL, const char* pFilterOptions = NULL)
+ inline bool saveAs(const char* pUrl, const char* pFormat = NULL)
{
- return mpDoc->saveAs(mpDoc, pUrl, pFormat, pFilterOptions);
+ return mpDoc->saveAs(mpDoc, pUrl, pFormat);
+ }
+
+ inline bool saveAsWithOptions(const char* pUrl, const char* pFormat = NULL, const char* pFilterOptions = NULL)
+ {
+ return mpDoc->saveAsWithOptions(mpDoc, pUrl, pFormat, pFilterOptions);
}
};
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 7629988f2beb..183a555eae7a 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -129,7 +129,8 @@ 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, const char* pFilterOptions);
+static int doc_saveAs(LibreOfficeDocument* pThis, const char* pUrl, const char* pFormat);
+static int doc_saveAsWithOptions(LibreOfficeDocument* pThis, const char* pUrl, const char* pFormat, const char* pFilterOptions);
struct LibLODocument_Impl : public _LibreOfficeDocument
{
@@ -142,6 +143,7 @@ struct LibLODocument_Impl : public _LibreOfficeDocument
destroy = doc_destroy;
saveAs = doc_saveAs;
+ saveAsWithOptions = doc_saveAsWithOptions;
}
};
@@ -207,7 +209,12 @@ static LibreOfficeDocument* lo_documentLoad(LibreOffice* pThis, const char* pURL
return NULL;
}
-static int doc_saveAs(LibreOfficeDocument* pThis, const char* sUrl, const char* pFormat, const char* pFilterOptions)
+static int doc_saveAs(LibreOfficeDocument* pThis, const char* sUrl, const char* pFormat)
+{
+ return doc_saveAsWithOptions(pThis, sUrl, pFormat, NULL);
+}
+
+static int doc_saveAsWithOptions(LibreOfficeDocument* pThis, const char* sUrl, const char* pFormat, const char* pFilterOptions)
{
LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);