[Libreoffice-commits] core.git: Branch 'feature/cib_contract561' - 2 commits - desktop/source include/LibreOfficeKit
Miklos Vajna
vmiklos at collabora.co.uk
Wed Sep 13 14:58:24 UTC 2017
desktop/source/lib/init.cxx | 2 +-
include/LibreOfficeKit/LibreOfficeKit.h | 7 ++++---
include/LibreOfficeKit/LibreOfficeKit.hxx | 12 +++++-------
3 files changed, 10 insertions(+), 11 deletions(-)
New commits:
commit 9a702a3e31db38d83c12c7da3868b8a606fd9b20
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Jan 21 09:10:29 2016 +0100
Clean up lok::Office::freeError()
- let it take a non-const pointer, just like free() or g_free() does
- remove lok::Document::freeError(), which was declared, but not
implemented
- move the declaration at the end of the stable API, but before the
unstable section
Change-Id: I5a8ced61fc87641dc2fa0ea3615a350361fae3a1
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index ff156399926f..7a49c0b962d2 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -300,7 +300,7 @@ static int lo_initialize (LibreOfficeKit* pThis, const ch
static LibreOfficeKitDocument* lo_documentLoad (LibreOfficeKit* pThis, const char* pURL);
static bool lo_runMacro (LibreOfficeKit* pThis, const char* pURL);
static char * lo_getError (LibreOfficeKit* pThis);
-static void lo_freeError (const char *pfree);
+static void lo_freeError (char* pFree);
static LibreOfficeKitDocument* lo_documentLoadWithOptions (LibreOfficeKit* pThis,
const char* pURL,
const char* pOptions);
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index ad453ef37ab3..85b37d3e6f25 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -50,14 +50,15 @@ struct _LibreOfficeKitClass
LibreOfficeKitDocument* (*documentLoadWithOptions) (LibreOfficeKit* pThis,
const char* pURL,
const char* pOptions);
-#ifdef LOK_USE_UNSTABLE_API
+ void (*freeError) (char* pFree);
+
+#if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
void (*registerCallback) (LibreOfficeKit* pThis,
LibreOfficeKitCallback pCallback,
void* pData);
bool (*runMacro) (LibreOfficeKit *pThis, const char* pURL);
#endif
- void (*freeError) (const char *pfree);
};
@@ -78,7 +79,6 @@ struct _LibreOfficeKitDocumentClass
const char* pUrl,
const char* pFormat,
const char* pFilterOptions);
- void (*freeError) (const char *pfree);
#ifdef LOK_USE_UNSTABLE_API
/// @see lok::Document::getDocumentType().
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 060158d08800..f70bfea3beac 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -247,10 +247,6 @@ public:
mpDoc->pClass->resetSelection(mpDoc);
}
#endif // LOK_USE_UNSTABLE_API
- inline void freeError(const char *pfree)
- {
- mpDoc->pClass->freeError(pfree);
- }
};
/// The lok::Office class represents one started LibreOfficeKit instance.
@@ -296,12 +292,14 @@ public:
{
return mpThis->pClass->getError(mpThis);
}
- inline void freeError(const char *pfree)
+
+ /// Frees the memory pointed to by pFree.
+ inline void freeError(char* pFree)
{
- mpThis->pClass->freeError(pfree);
+ mpThis->pClass->freeError(pFree);
}
-#ifdef LOK_USE_UNSTABLE_API
+#if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
/**
* Run a macro.
*
commit 912fd5046410f1f32f7273155d9ce17450a2df6d
Author: Oliver Specht <oliver.specht at cib.de>
Date: Wed Jan 20 07:52:51 2016 +0100
freeError function moved to the end of the list
Change-Id: I4aed102b25ddcd5f2e8fa03395e2ffd89c858bb9
Reviewed-on: https://gerrit.libreoffice.org/21619
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Oliver Specht <oliver.specht at cib.de>
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index 3e0797417243..ad453ef37ab3 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -46,7 +46,6 @@ struct _LibreOfficeKitClass
const char* pURL);
char* (*getError) (LibreOfficeKit* pThis);
- void (*freeError) (const char *pfree);
LibreOfficeKitDocument* (*documentLoadWithOptions) (LibreOfficeKit* pThis,
const char* pURL,
@@ -58,6 +57,8 @@ struct _LibreOfficeKitClass
bool (*runMacro) (LibreOfficeKit *pThis, const char* pURL);
#endif
+ void (*freeError) (const char *pfree);
+
};
#define LIBREOFFICEKIT_DOCUMENT_HAS(pDoc,member) LIBREOFFICEKIT_HAS_MEMBER(LibreOfficeKitDocumentClass,member,(pDoc)->pClass->nSize)
More information about the Libreoffice-commits
mailing list