[Libreoffice-commits] core.git: 2 commits - desktop/source include/LibreOfficeKit writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Thu Jan 21 00:12:54 PST 2016
desktop/source/lib/init.cxx | 7 ++++---
include/LibreOfficeKit/LibreOfficeKit.h | 4 ++--
include/LibreOfficeKit/LibreOfficeKit.hxx | 11 ++++-------
writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 11 +++++------
writerfilter/source/dmapper/DomainMapperTableHandler.hxx | 3 +--
5 files changed, 16 insertions(+), 20 deletions(-)
New commits:
commit 2112d171224a0ae8676afa30292623461065d5b7
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Jan 21 09:12:02 2016 +0100
writerfilter: can use a plain instance for the cell sequence here
Change-Id: I47fee680b6022cc2402341bf523243c526bc8890
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 0264f1f..95168fa 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -71,7 +71,7 @@ void DomainMapperTableHandler::startTable(unsigned int nRows,
TablePropertyMapPtr pProps)
{
m_aTableProperties = pProps;
- m_aTableSeq.realloc(nRows);
+ m_aTableSeq = TableSequence_t(nRows);
m_nRowIndex = 0;
#ifdef DEBUG_WRITERFILTER
@@ -629,7 +629,6 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
PropertyMapVector2::const_iterator aLastRowIterator = m_aCellProperties.end() - 1;
sal_Int32 nRow = 0;
- //it's a uno::Sequence< beans::PropertyValues >*
css::uno::Sequence<css::beans::PropertyValues>* pCellProperties = aCellProperties.getArray();
PropertyMapVector1::const_iterator aRowIter = m_aRowProperties.begin();
while( aRowOfCellsIterator != aRowOfCellsIteratorEnd )
@@ -1189,10 +1188,10 @@ void DomainMapperTableHandler::startCell(const css::uno::Reference< css::text::X
#endif
//add a new 'row' of properties
- m_pCellSeq = CellSequencePointer_t(new CellSequence_t(2));
+ m_aCellSeq = CellSequence_t(2);
if (!start.get())
return;
- (*m_pCellSeq)[0] = start->getStart();
+ m_aCellSeq[0] = start->getStart();
}
void DomainMapperTableHandler::endCell(const css::uno::Reference< css::text::XTextRange > & end)
@@ -1206,8 +1205,8 @@ void DomainMapperTableHandler::endCell(const css::uno::Reference< css::text::XTe
if (!end.get())
return;
- (*m_pCellSeq)[1] = end->getEnd();
- m_aRowSeq[m_nCellIndex] = *m_pCellSeq;
+ m_aCellSeq[1] = end->getEnd();
+ m_aRowSeq[m_nCellIndex] = m_aCellSeq;
++m_nCellIndex;
}
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.hxx b/writerfilter/source/dmapper/DomainMapperTableHandler.hxx
index 2d9a41e..669ea30ef 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.hxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.hxx
@@ -29,7 +29,6 @@ namespace writerfilter {
namespace dmapper {
typedef css::uno::Sequence< css::uno::Reference< css::text::XTextRange > > CellSequence_t;
-typedef std::shared_ptr<CellSequence_t> CellSequencePointer_t;
typedef css::uno::Sequence<CellSequence_t> RowSequence_t;
typedef css::uno::Sequence<RowSequence_t> TableSequence_t;
@@ -63,7 +62,7 @@ class DomainMapperTableHandler
{
css::uno::Reference<css::text::XTextAppendAndConvert> m_xText;
DomainMapper_Impl& m_rDMapper_Impl;
- CellSequencePointer_t m_pCellSeq;
+ CellSequence_t m_aCellSeq;
RowSequence_t m_aRowSeq;
TableSequence_t m_aTableSeq;
commit 8e0c4694f89dd66314faf5cfd411f58f2f8e1bca
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 6b8f369..f2f9034 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 80f8451..663f620 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 5623fad..ee2b27e 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.
More information about the Libreoffice-commits
mailing list