[Libreoffice-commits] core.git: desktop/source include/LibreOfficeKit smoketest/libtest.cxx
Andrzej Hunt
andrzej.hunt at collabora.com
Mon Jun 23 04:24:35 PDT 2014
desktop/source/lib/init.cxx | 11 ++---------
include/LibreOfficeKit/LibreOfficeKit.h | 7 ++-----
include/LibreOfficeKit/LibreOfficeKit.hxx | 10 ++--------
smoketest/libtest.cxx | 10 ----------
4 files changed, 6 insertions(+), 32 deletions(-)
New commits:
commit 707a648eb3d8b8c216d4ee1d1f738552c6ac50a0
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date: Tue Jun 17 19:33:34 2014 +0100
LOK: kill saveAsWithOptions.
The saveAsWithOptions/saveAs split existed for reasons of historical
API compatibility. Since we're breaking the API currently we can
now get a clean start, and get rid of the redundant saveAs, and
make saveAsWithOptions the standard saveAs function.
Change-Id: Ia3e2294a8604cab08e95b07544c9d10d42dd1152
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index eed7831..710b474 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -153,8 +153,7 @@ extern "C"
{
static void doc_destroy(LibreOfficeKitDocument* pThis);
-static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* pUrl, const char* pFormat);
-static int doc_saveAsWithOptions(LibreOfficeKitDocument* pThis, const char* pUrl, const char* pFormat, const char* pFilterOptions);
+static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* pUrl, const char* pFormat, const char* pFilterOptions);
struct LibLODocument_Impl : public _LibreOfficeKitDocument
{
@@ -172,7 +171,6 @@ struct LibLODocument_Impl : public _LibreOfficeKitDocument
m_pDocumentClass->destroy = doc_destroy;
m_pDocumentClass->saveAs = doc_saveAs;
- m_pDocumentClass->saveAsWithOptions = doc_saveAsWithOptions;
gDocumentClass = m_pDocumentClass;
}
@@ -254,12 +252,7 @@ static LibreOfficeKitDocument* lo_documentLoad(LibreOfficeKit* pThis, const char
return NULL;
}
-static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const char* pFormat)
-{
- return doc_saveAsWithOptions(pThis, sUrl, pFormat, NULL);
-}
-
-static int doc_saveAsWithOptions(LibreOfficeKitDocument* pThis, const char* sUrl, const char* pFormat, const char* pFilterOptions)
+static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const char* pFormat, const char* pFilterOptions)
{
LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index 63c2c22..33b5872 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -58,11 +58,8 @@ struct _LibreOfficeKitDocumentClass
void (*destroy) (LibreOfficeKitDocument* pThis);
int (*saveAs) (LibreOfficeKitDocument* pThis,
const char *pUrl,
- const char *pFormat);
- int (*saveAsWithOptions) (LibreOfficeKitDocument* pThis,
- const char *pUrl,
- const char *pFormat,
- const char *pFilterOptions);
+ const char *pFormat,
+ const char *pFilterOptions);
};
LibreOfficeKit* lok_init (const char* pInstallPath);
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx
index f1db388..51a8578 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -36,15 +36,9 @@ public:
mpDoc->pClass->destroy(mpDoc);
}
- // 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->pClass->saveAs(mpDoc, pUrl, pFormat);
- }
-
- inline bool saveAsWithOptions(const char* pUrl, const char* pFormat = NULL, const char* pFilterOptions = NULL)
- {
- return mpDoc->pClass->saveAsWithOptions(mpDoc, pUrl, pFormat, pFilterOptions);
+ return mpDoc->pClass->saveAs(mpDoc, pUrl, pFormat, pFilterOptions);
}
inline LibreOfficeKitDocument *get() { return mpDoc; }
};
diff --git a/smoketest/libtest.cxx b/smoketest/libtest.cxx
index 211d056..8a0b724 100644
--- a/smoketest/libtest.cxx
+++ b/smoketest/libtest.cxx
@@ -69,16 +69,6 @@ int main (int argc, char **argv)
return -1;
}
- if (!LIBREOFFICEKIT_DOCUMENT_HAS(pDocument->get(), saveAsWithOptions))
- {
- fprintf( stderr, "using obsolete LibreOffice %" SAL_PRI_SIZET "d + %" SAL_PRI_SIZET "d vs. %" SAL_PRI_SIZET "d\n",
- (size_t)((unsigned char *)&((LibreOfficeKitDocumentClass *) 0)->saveAsWithOptions),
- sizeof ((LibreOfficeKitDocumentClass *) 0)->saveAsWithOptions,
- pDocument->get()->pClass->nSize );
- return -1;
- }
-
-
end = getTimeMS();
fprintf( stderr, "load time: %ld ms\n", (end-start) );
start = end;
More information about the Libreoffice-commits
mailing list