[Libreoffice-commits] core.git: 4 commits - writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Sat Dec 6 04:51:09 PST 2014
writerfilter/source/dmapper/DomainMapperTableHandler.hxx | 5 -
writerfilter/source/dmapper/DomainMapper_Impl.hxx | 3
writerfilter/source/dmapper/GraphicHelpers.cxx | 1
writerfilter/source/dmapper/GraphicHelpers.hxx | 4
writerfilter/source/dmapper/TableData.hxx | 65 ++++++---------
writerfilter/source/dmapper/TableManager.cxx | 4
writerfilter/source/dmapper/TableManager.hxx | 19 +---
7 files changed, 45 insertions(+), 56 deletions(-)
New commits:
commit 29ef1b0aa20a5d1354b071884d830d0eec224053
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sat Dec 6 11:44:36 2014 +0100
writerfilter: unneeded include in GraphicHelpers.hxx
Change-Id: I720db5fd2fb1a5c1e89e7d375541af035ebbd97f
diff --git a/writerfilter/source/dmapper/GraphicHelpers.cxx b/writerfilter/source/dmapper/GraphicHelpers.cxx
index 237421e..aca4c1f 100644
--- a/writerfilter/source/dmapper/GraphicHelpers.cxx
+++ b/writerfilter/source/dmapper/GraphicHelpers.cxx
@@ -18,6 +18,7 @@
*/
#include "ConversionHelper.hxx"
#include "GraphicHelpers.hxx"
+#include "PropertyIds.hxx"
#include <ooxml/resourceids.hxx>
diff --git a/writerfilter/source/dmapper/GraphicHelpers.hxx b/writerfilter/source/dmapper/GraphicHelpers.hxx
index 53c2b6f..946c37f 100644
--- a/writerfilter/source/dmapper/GraphicHelpers.hxx
+++ b/writerfilter/source/dmapper/GraphicHelpers.hxx
@@ -20,12 +20,12 @@
#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_GRAPHICHELPERS_HXX
#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_GRAPHICHELPERS_HXX
-#include "PropertyMap.hxx"
-
#include <resourcemodel/LoggedResources.hxx>
#include <boost/shared_ptr.hpp>
+#include <map>
+
namespace writerfilter {
namespace dmapper
{
commit 5123bb6194f6c3b94abc2494768dd676de38ad3e
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sat Dec 6 11:44:13 2014 +0100
No need to have TableDataHandler as a template
Change-Id: If19feb011db4027bae6f0c59b48967657c36b7a8
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.hxx b/writerfilter/source/dmapper/DomainMapperTableHandler.hxx
index bd71674..f02ec96 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.hxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.hxx
@@ -28,8 +28,7 @@
namespace writerfilter {
namespace dmapper {
-typedef ::com::sun::star::text::XTextRange TextRange_t;
-typedef ::com::sun::star::uno::Reference< TextRange_t > Handle_t;
+typedef css::uno::Reference< css::text::XTextRange > Handle_t;
typedef ::com::sun::star::uno::Sequence< Handle_t> CellSequence_t;
typedef boost::shared_ptr<CellSequence_t> CellSequencePointer_t;
typedef ::com::sun::star::uno::Sequence< CellSequence_t > RowSequence_t;
@@ -66,7 +65,7 @@ struct HorizontallyMergedCell
}
};
-class DomainMapperTableHandler : public TableDataHandler<Handle_t , TablePropertyMapPtr >
+class DomainMapperTableHandler : public TableDataHandler
{
TextReference_t m_xText;
DomainMapper_Impl& m_rDMapper_Impl;
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index 01e7577..11e58cd 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -309,7 +309,6 @@ class DomainMapper;
class DomainMapper_Impl
{
public:
- typedef TableDataHandler< ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >, TablePropertyMapPtr > TableDataHandler_t;
typedef std::map < OUString, BookmarkInsertPosition > BookmarkMap_t;
private:
@@ -359,7 +358,7 @@ private:
// TableManagers are stacked: one for each stream to avoid any confusion
std::stack< boost::shared_ptr< DomainMapperTableManager > > m_aTableManagers;
- TableDataHandler_t::Pointer_t m_pTableHandler;
+ TableDataHandler::Pointer_t m_pTableHandler;
//each context needs a stack of currently used attributes
PropertyStack m_aPropertyStacks[NUMBER_OF_CONTEXTS];
diff --git a/writerfilter/source/dmapper/TableManager.cxx b/writerfilter/source/dmapper/TableManager.cxx
index a7b7275..dff29f8 100644
--- a/writerfilter/source/dmapper/TableManager.cxx
+++ b/writerfilter/source/dmapper/TableManager.cxx
@@ -433,7 +433,7 @@ void TableManager::handle(const css::uno::Reference<css::text::XTextRange>& rHan
setHandle(rHandle);
}
-void TableManager::setHandler(TableDataHandler<css::uno::Reference<css::text::XTextRange>, TablePropertyMapPtr>::Pointer_t pTableDataHandler)
+void TableManager::setHandler(TableDataHandler::Pointer_t pTableDataHandler)
{
mpTableDataHandler = pTableDataHandler;
}
diff --git a/writerfilter/source/dmapper/TableManager.hxx b/writerfilter/source/dmapper/TableManager.hxx
index b635a25..59f2d7b 100644
--- a/writerfilter/source/dmapper/TableManager.hxx
+++ b/writerfilter/source/dmapper/TableManager.hxx
@@ -41,7 +41,6 @@ namespace dmapper
/**
Class to handle events generated by TableManager::resolveCurrentTable
*/
-template <typename T, typename PropertiesPointer>
class TableDataHandler
{
public:
@@ -54,8 +53,7 @@ public:
@param nDepth depth of the table in surrounding table hierarchy
@param pProps properties of the table
*/
- virtual void startTable(unsigned int nRows, unsigned int nDepth,
- PropertiesPointer pProps) = 0;
+ virtual void startTable(unsigned int nRows, unsigned int nDepth, TablePropertyMapPtr pProps) = 0;
/**
Handle end of table.
@@ -68,8 +66,7 @@ public:
@param nCols number of columns in the table
@param pProps properties of the row
*/
- virtual void startRow(unsigned int nCols,
- PropertiesPointer pProps) = 0;
+ virtual void startRow(unsigned int nCols, TablePropertyMapPtr pProps) = 0;
/**
Handle end of row.
@@ -82,14 +79,14 @@ public:
@param rT start handle of the cell
@param pProps properties of the cell
*/
- virtual void startCell(const T & rT, PropertiesPointer pProps) = 0;
+ virtual void startCell(const css::uno::Reference<css::text::XTextRange>& xTextRange, TablePropertyMapPtr pProps) = 0;
/**
Handle end of cell.
@param rT end handle of cell
*/
- virtual void endCell(const T & rT) = 0;
+ virtual void endCell(const css::uno::Reference<css::text::XTextRange>& xTextRange) = 0;
protected:
~TableDataHandler() {}
@@ -408,12 +405,10 @@ private:
RowData::Pointer_t mpUnfinishedRow;
bool mbKeepUnfinishedRow;
- typedef TableDataHandler<css::uno::Reference<css::text::XTextRange>, TablePropertyMapPtr>::Pointer_t TableDataHandlerPointer_t;
-
/**
handler for resolveCurrentTable
*/
- TableDataHandlerPointer_t mpTableDataHandler;
+ TableDataHandler::Pointer_t mpTableDataHandler;
/**
Set flag which indicates the current handle is in a cell.
@@ -503,7 +498,7 @@ public:
@param pTableDataHandler the handler
*/
- void setHandler(TableDataHandlerPointer_t pTableDataHandler);
+ void setHandler(TableDataHandler::Pointer_t pTableDataHandler);
/**
Set the current handle.
commit 1903912d21e713d42f1343be00f70df810a427ee
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sat Dec 6 11:43:53 2014 +0100
No need to have CellData as a template
Change-Id: I700b817b446cc11b2475800fb5b1f4c8f8c8b003
diff --git a/writerfilter/source/dmapper/TableData.hxx b/writerfilter/source/dmapper/TableData.hxx
index 7ac3eaf..631a755 100644
--- a/writerfilter/source/dmapper/TableData.hxx
+++ b/writerfilter/source/dmapper/TableData.hxx
@@ -17,8 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_RESOURCEMODEL_TABLEDATA_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_RESOURCEMODEL_TABLEDATA_HXX
+#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TABLEDATA_HXX
+#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TABLEDATA_HXX
#include <resourcemodel/WW8ResourceModel.hxx>
@@ -30,7 +30,6 @@ namespace writerfilter
namespace dmapper
{
-template <typename T, typename PropertiesPointer>
/**
Class containing the data to describe a table cell.
*/
@@ -39,24 +38,24 @@ class CellData
/**
Handle to start of cell.
*/
- T mStart;
+ css::uno::Reference<css::text::XTextRange> mStart;
/**
Handle to end of cell.
*/
- T mEnd;
+ css::uno::Reference<css::text::XTextRange> mEnd;
/**
Pointer to properties of cell.
*/
- PropertiesPointer mpProps;
+ TablePropertyMapPtr mpProps;
bool mbOpen;
public:
typedef boost::shared_ptr<CellData> Pointer_t;
- CellData(T start, PropertiesPointer pProps)
+ CellData(css::uno::Reference<css::text::XTextRange> start, TablePropertyMapPtr pProps)
: mStart(start), mEnd(start), mpProps(pProps), mbOpen(true)
{
}
@@ -68,28 +67,28 @@ public:
@param start the start handle of the cell
*/
- void setStart(T start) { mStart = start; }
+ void setStart(css::uno::Reference<css::text::XTextRange> start) { mStart = start; }
/**
Set the end handle of a cell.
@param end the end handle of the cell
*/
- void setEnd(T end) { mEnd = end; mbOpen = false; }
+ void setEnd(css::uno::Reference<css::text::XTextRange> end) { mEnd = end; mbOpen = false; }
/**
Set the properties of the cell.
@param pProps the properties of the cell
*/
- void setProperties(PropertiesPointer pProps) { mpProps = pProps; }
+ void setProperties(TablePropertyMapPtr pProps) { mpProps = pProps; }
/**
Adds properties to the cell.
@param pProps the properties to add
*/
- void insertProperties(PropertiesPointer pProps)
+ void insertProperties(TablePropertyMapPtr pProps)
{
if( mpProps.get() )
mpProps->InsertProps(pProps);
@@ -100,17 +99,17 @@ public:
/**
Return start handle of the cell.
*/
- const T & getStart() { return mStart; }
+ const css::uno::Reference<css::text::XTextRange>& getStart() { return mStart; }
/**
Return end handle of the cell.
*/
- const T & getEnd() { return mEnd; }
+ const css::uno::Reference<css::text::XTextRange>& getEnd() { return mEnd; }
/**
Return properties of the cell.
*/
- PropertiesPointer getProperties() { return mpProps; }
+ TablePropertyMapPtr getProperties() { return mpProps; }
bool isOpen() const { return mbOpen; }
};
@@ -120,8 +119,7 @@ public:
*/
class RowData
{
- typedef CellData<css::uno::Reference<css::text::XTextRange>, TablePropertyMapPtr>::Pointer_t CellDataPointer_t;
- typedef ::std::vector<CellDataPointer_t> Cells;
+ typedef ::std::vector<CellData::Pointer_t> Cells;
/**
the cell data of the row
@@ -154,7 +152,7 @@ public:
*/
void addCell(const css::uno::Reference<css::text::XTextRange>& start, TablePropertyMapPtr pProps)
{
- CellDataPointer_t pCellData(new CellData<css::uno::Reference<css::text::XTextRange>, TablePropertyMapPtr>(start, pProps));
+ CellData::Pointer_t pCellData(new CellData(start, pProps));
mCells.push_back(pCellData);
}
commit 1e29007cc5867dcd594c1219f625587d0adcb021
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sat Dec 6 11:43:37 2014 +0100
No need to have RowData as a template
Change-Id: Id93b97b69d1f9d44e5e5314698e7a3a0790e51e3
diff --git a/writerfilter/source/dmapper/TableData.hxx b/writerfilter/source/dmapper/TableData.hxx
index 73bc7e7..7ac3eaf 100644
--- a/writerfilter/source/dmapper/TableData.hxx
+++ b/writerfilter/source/dmapper/TableData.hxx
@@ -115,14 +115,12 @@ public:
bool isOpen() const { return mbOpen; }
};
-template <typename T, typename PropertiesPointer>
/**
Class to handle data of a table row.
*/
class RowData
{
- typedef typename CellData<T, PropertiesPointer>::Pointer_t
- CellDataPointer_t;
+ typedef CellData<css::uno::Reference<css::text::XTextRange>, TablePropertyMapPtr>::Pointer_t CellDataPointer_t;
typedef ::std::vector<CellDataPointer_t> Cells;
/**
@@ -133,14 +131,14 @@ class RowData
/**
the properties of the row
*/
- mutable PropertiesPointer mpProperties;
+ mutable TablePropertyMapPtr mpProperties;
public:
- typedef boost::shared_ptr<RowData <T, PropertiesPointer> > Pointer_t;
+ typedef boost::shared_ptr<RowData> Pointer_t;
RowData() {}
- RowData(const RowData<T, PropertiesPointer> & rRowData)
+ RowData(const RowData& rRowData)
: mCells(rRowData.mCells), mpProperties(rRowData.mpProperties)
{
}
@@ -154,14 +152,13 @@ public:
@param end the end handle of the cell
@param pProps the properties of the cell
*/
- void addCell(const T & start, PropertiesPointer pProps)
+ void addCell(const css::uno::Reference<css::text::XTextRange>& start, TablePropertyMapPtr pProps)
{
- CellDataPointer_t pCellData
- (new CellData<T, PropertiesPointer>(start, pProps));
+ CellDataPointer_t pCellData(new CellData<css::uno::Reference<css::text::XTextRange>, TablePropertyMapPtr>(start, pProps));
mCells.push_back(pCellData);
}
- void endCell(const T & end)
+ void endCell(const css::uno::Reference<css::text::XTextRange>& end)
{
if (mCells.size() > 0)
mCells.back()->setEnd(end);
@@ -177,7 +174,7 @@ public:
@param pProperties the properties to set
*/
- void insertProperties(PropertiesPointer pProperties)
+ void insertProperties(TablePropertyMapPtr pProperties)
{
if( pProperties.get() )
{
@@ -194,7 +191,7 @@ public:
@param i index of the cell
@param pProps the properties to add
*/
- void insertCellProperties(unsigned int i, PropertiesPointer pProps)
+ void insertCellProperties(unsigned int i, TablePropertyMapPtr pProps)
{
mCells[i]->insertProperties(pProps);
}
@@ -202,9 +199,9 @@ public:
/**
Add properties to the last cell of the row.
*/
- void insertCellProperties(PropertiesPointer pProps)
+ void insertCellProperties(TablePropertyMapPtr pProps)
{
- if (! mCells.empty())
+ if (!mCells.empty())
mCells.back()->insertProperties(pProps);
}
@@ -221,7 +218,7 @@ public:
@param i index of the cell
*/
- const T & getCellStart(unsigned int i) const
+ const css::uno::Reference<css::text::XTextRange>& getCellStart(unsigned int i) const
{
return mCells[i]->getStart();
}
@@ -231,7 +228,7 @@ public:
@param i index of the cell
*/
- const T & getCellEnd(unsigned int i) const
+ const css::uno::Reference<css::text::XTextRange>& getCellEnd(unsigned int i) const
{
return mCells[i]->getEnd();
}
@@ -241,7 +238,7 @@ public:
@param i index of the cell
*/
- PropertiesPointer getCellProperties(unsigned int i) const
+ TablePropertyMapPtr getCellProperties(unsigned int i) const
{
return mCells[i]->getProperties();
}
@@ -249,7 +246,7 @@ public:
/**
Return properties of the row.
*/
- PropertiesPointer getProperties()
+ TablePropertyMapPtr getProperties()
{
return mpProperties;
}
@@ -269,7 +266,7 @@ public:
*/
class TableData
{
- typedef RowData<css::uno::Reference<css::text::XTextRange>, TablePropertyMapPtr>::Pointer_t RowPointer_t;
+ typedef RowData::Pointer_t RowPointer_t;
typedef ::std::vector<RowPointer_t> Rows;
/**
@@ -295,7 +292,7 @@ class TableData
/**
initialize mpRow
*/
- void newRow() { mpRow = RowPointer_t(new RowData<css::uno::Reference<css::text::XTextRange>, TablePropertyMapPtr>()); }
+ void newRow() { mpRow = RowPointer_t(new RowData()); }
public:
typedef boost::shared_ptr<TableData> Pointer_t;
diff --git a/writerfilter/source/dmapper/TableManager.cxx b/writerfilter/source/dmapper/TableManager.cxx
index cf6e318..a7b7275 100644
--- a/writerfilter/source/dmapper/TableManager.cxx
+++ b/writerfilter/source/dmapper/TableManager.cxx
@@ -312,7 +312,7 @@ void TableManager::resolveCurrentTable()
for (unsigned int nRow = 0; nRow < nRows; ++nRow)
{
- RowData<css::uno::Reference<css::text::XTextRange>, TablePropertyMapPtr>::Pointer_t pRowData = pTableData->getRow(nRow);
+ RowData::Pointer_t pRowData = pTableData->getRow(nRow);
unsigned int nCells = pRowData->getCellCount();
diff --git a/writerfilter/source/dmapper/TableManager.hxx b/writerfilter/source/dmapper/TableManager.hxx
index 604010c..b635a25 100644
--- a/writerfilter/source/dmapper/TableManager.hxx
+++ b/writerfilter/source/dmapper/TableManager.hxx
@@ -405,7 +405,7 @@ private:
for each level of nested tables there is one frame in the stack
*/
std::stack<TableData::Pointer_t> mTableDataStack;
- RowData<css::uno::Reference<css::text::XTextRange>, TablePropertyMapPtr>::Pointer_t mpUnfinishedRow;
+ RowData::Pointer_t mpUnfinishedRow;
bool mbKeepUnfinishedRow;
typedef TableDataHandler<css::uno::Reference<css::text::XTextRange>, TablePropertyMapPtr>::Pointer_t TableDataHandlerPointer_t;
More information about the Libreoffice-commits
mailing list