diff options
-rw-r--r-- | desktop/source/lib/init.cxx | 7 | ||||
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.h | 4 | ||||
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.hxx | 11 |
3 files changed, 10 insertions, 12 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 6b8f36984dc1..f2f90346a737 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -430,7 +430,7 @@ static void lo_destroy (LibreOfficeKit* pThis); static int lo_initialize (LibreOfficeKit* pThis, const char* pInstallPath, const char* pUserProfilePath); static LibreOfficeKitDocument* lo_documentLoad (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); @@ -1574,9 +1574,10 @@ static char* lo_getError (LibreOfficeKit *pThis) strcpy(pMemory, aString.getStr()); return pMemory; } -static void lo_freeError(const char *pfree) + +static void lo_freeError(char* pFree) { - free(const_cast<char *>(pfree)); + free(pFree); } static char* lo_getFilterTypes(LibreOfficeKit* pThis) diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index 80f8451633ac..663f62034945 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -55,6 +55,8 @@ struct _LibreOfficeKitClass LibreOfficeKitDocument* (*documentLoadWithOptions) (LibreOfficeKit* pThis, const char* pURL, const char* pOptions); + void (*freeError) (char* pFree); + #if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY void (*registerCallback) (LibreOfficeKit* pThis, LibreOfficeKitCallback pCallback, @@ -63,7 +65,6 @@ struct _LibreOfficeKitClass /// @see lok::Office::getFilterTypes(). char* (*getFilterTypes) (LibreOfficeKit* pThis); #endif - void (*freeError) (const char *pfree); }; @@ -84,7 +85,6 @@ struct _LibreOfficeKitDocumentClass const char* pUrl, const char* pFormat, const char* pFilterOptions); - void (*freeError) (const char *pfree); #if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY /// @see lok::Document::getDocumentType(). diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index 5623fad8c0e2..ee2b27e92aff 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -56,10 +56,6 @@ public: /// Gives access to the underlying C pointer. inline LibreOfficeKitDocument *get() { return mpDoc; } - inline void freeError(const char *pfree) - { - mpDoc->pClass->freeError(pfree); - } #if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY /** @@ -438,12 +434,13 @@ 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); } - #if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY /** * Returns details of filter types. |