summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-12-04 09:05:16 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-12-04 09:05:38 +0100
commitee633ec61fd56f83dd217ebe66dd9e12ff0089c9 (patch)
treef0a820b020d13d7462a9467614b0f53b748e81a2 /writerfilter
parent6bceec845fe0053026fb248d4c0de72d3a97300f (diff)
TableData is only used with PropertiesPointer=TablePropertyMapPtr
Change-Id: I613addb6cd8b57fce90659209503f633ee438a58
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/TableData.hxx28
-rw-r--r--writerfilter/source/dmapper/TableManager.cxx18
-rw-r--r--writerfilter/source/dmapper/TableManager.hxx2
3 files changed, 20 insertions, 28 deletions
diff --git a/writerfilter/source/dmapper/TableData.hxx b/writerfilter/source/dmapper/TableData.hxx
index 7f8b406d3630..69c9f5cf0f7b 100644
--- a/writerfilter/source/dmapper/TableData.hxx
+++ b/writerfilter/source/dmapper/TableData.hxx
@@ -264,19 +264,19 @@ public:
}
};
-template <typename T, typename PropertiesPointer>
+template <typename T>
/**
Class that holds the data of a table.
*/
class TableData
{
- typedef typename RowData<T, PropertiesPointer>::Pointer_t RowPointer_t;
+ typedef typename RowData<T, TablePropertyMapPtr>::Pointer_t RowPointer_t;
typedef ::std::vector<RowPointer_t> Rows;
/**
the table properties
*/
- PropertiesPointer mpTableProps;
+ TablePropertyMapPtr mpTableProps;
/**
the data of the rows of the table
@@ -296,10 +296,10 @@ class TableData
/**
initialize mpRow
*/
- void newRow() { mpRow = RowPointer_t(new RowData<T, PropertiesPointer>()); }
+ void newRow() { mpRow = RowPointer_t(new RowData<T, TablePropertyMapPtr>()); }
public:
- typedef boost::shared_ptr<TableData <T, PropertiesPointer> > Pointer_t;
+ typedef boost::shared_ptr<TableData <T> > Pointer_t;
TableData(unsigned int nDepth) : mnDepth(nDepth) { newRow(); }
~TableData() {}
@@ -312,7 +312,7 @@ public:
@param pProperties properties of the row to be ended
*/
- void endRow(PropertiesPointer pProperties)
+ void endRow(TablePropertyMapPtr pProperties)
{
mpRow->insertProperties(pProperties);
mRows.push_back(mpRow);
@@ -326,7 +326,7 @@ public:
@param end end handle of the cell
@param pProps properties of the cell
*/
- void addCell(const T & start, PropertiesPointer pProps)
+ void addCell(const T & start, TablePropertyMapPtr pProps)
{
mpRow->addCell(start, pProps);
}
@@ -354,7 +354,7 @@ public:
@param pProps the properties to add
*/
- void insertCellProperties(PropertiesPointer pProps)
+ void insertCellProperties(TablePropertyMapPtr pProps)
{
mpRow->insertCellProperties(pProps);
}
@@ -365,23 +365,15 @@ public:
@param i index of the cell
@param pProps properties to add
*/
- void insertCellProperties(unsigned int i, PropertiesPointer pProps)
+ void insertCellProperties(unsigned int i, TablePropertyMapPtr pProps)
{
mpRow->insertCellProperties(i, pProps);
}
- void insertTableProperties( PropertiesPointer pProps )
- {
- if ( mpTableProps.get( ) )
- mpTableProps->insert( pProps );
- else
- mpTableProps = pProps;
- }
-
/**
Return the table properties.
*/
- PropertiesPointer getTableProperties( )
+ TablePropertyMapPtr getTableProperties( )
{
return mpTableProps;
}
diff --git a/writerfilter/source/dmapper/TableManager.cxx b/writerfilter/source/dmapper/TableManager.cxx
index a2de7ceccd52..7c2b55833e1e 100644
--- a/writerfilter/source/dmapper/TableManager.cxx
+++ b/writerfilter/source/dmapper/TableManager.cxx
@@ -38,7 +38,7 @@ void TableManager::openCell(const css::uno::Reference<css::text::XTextRange>& rH
if (mTableDataStack.size() > 0)
{
- TableData<css::uno::Reference<css::text::XTextRange>, TablePropertyMapPtr>::Pointer_t pTableData = mTableDataStack.top();
+ TableData< css::uno::Reference<css::text::XTextRange> >::Pointer_t pTableData = mTableDataStack.top();
pTableData->addCell(rHandle, pProps);
}
@@ -211,7 +211,7 @@ void TableManager::closeCell(const css::uno::Reference<css::text::XTextRange>& r
if (mTableDataStack.size() > 0)
{
- TableData<css::uno::Reference<css::text::XTextRange>, TablePropertyMapPtr>::Pointer_t pTableData = mTableDataStack.top();
+ TableData< css::uno::Reference<css::text::XTextRange> >::Pointer_t pTableData = mTableDataStack.top();
pTableData->endCell(rHandle);
}
@@ -225,7 +225,7 @@ void TableManager::ensureOpenCell(TablePropertyMapPtr pProps)
if (mTableDataStack.size() > 0)
{
- TableData<css::uno::Reference<css::text::XTextRange>, TablePropertyMapPtr>::Pointer_t pTableData = mTableDataStack.top();
+ TableData< css::uno::Reference<css::text::XTextRange> >::Pointer_t pTableData = mTableDataStack.top();
if (pTableData.get() != nullptr)
{
@@ -264,7 +264,7 @@ void TableManager::endParagraphGroup()
if (mnTableDepth > 0)
{
- TableData<css::uno::Reference<css::text::XTextRange>, TablePropertyMapPtr>::Pointer_t pTableData = mTableDataStack.top();
+ TableData< css::uno::Reference<css::text::XTextRange> >::Pointer_t pTableData = mTableDataStack.top();
if (isRowEnd())
{
@@ -304,7 +304,7 @@ void TableManager::resolveCurrentTable()
{
try
{
- TableData<css::uno::Reference<css::text::XTextRange>, TablePropertyMapPtr>::Pointer_t pTableData = mTableDataStack.top();
+ TableData< css::uno::Reference<css::text::XTextRange> >::Pointer_t pTableData = mTableDataStack.top();
unsigned int nRows = pTableData->getRowCount();
@@ -358,7 +358,7 @@ void TableManager::endLevel()
#ifdef DEBUG_WRITERFILTER
if (mpTableLogger != nullptr)
{
- TableData<css::uno::Reference<css::text::XTextRange>, TablePropertyMapPtr>::Pointer_t pTableData;
+ TableData< css::uno::Reference<css::text::XTextRange> >::Pointer_t pTableData;
if (mTableDataStack.size() > 0)
pTableData = mTableDataStack.top();
@@ -379,7 +379,7 @@ void TableManager::startLevel()
#ifdef DEBUG_WRITERFILTER
if (mpTableLogger != nullptr)
{
- TableData<css::uno::Reference<css::text::XTextRange>, TablePropertyMapPtr>::Pointer_t pTableData;
+ TableData< css::uno::Reference<css::text::XTextRange> >::Pointer_t pTableData;
if (mTableDataStack.size() > 0)
pTableData = mTableDataStack.top();
@@ -394,8 +394,8 @@ void TableManager::startLevel()
}
#endif
- TableData<css::uno::Reference<css::text::XTextRange>, TablePropertyMapPtr>::Pointer_t
- pTableData(new TableData<css::uno::Reference<css::text::XTextRange>, TablePropertyMapPtr>(mTableDataStack.size()));
+ TableData< css::uno::Reference<css::text::XTextRange> >::Pointer_t
+ pTableData(new TableData<css::uno::Reference<css::text::XTextRange> >(mTableDataStack.size()));
// If we have an unfinished row stored here, then push it to the new TableData
if (mpUnfinishedRow)
diff --git a/writerfilter/source/dmapper/TableManager.hxx b/writerfilter/source/dmapper/TableManager.hxx
index b7fed59f03d6..54fcf4de105e 100644
--- a/writerfilter/source/dmapper/TableManager.hxx
+++ b/writerfilter/source/dmapper/TableManager.hxx
@@ -404,7 +404,7 @@ private:
for each level of nested tables there is one frame in the stack
*/
- std::stack<typename TableData<css::uno::Reference<css::text::XTextRange>, TablePropertyMapPtr>::Pointer_t > mTableDataStack;
+ std::stack<typename TableData< css::uno::Reference<css::text::XTextRange> >::Pointer_t > mTableDataStack;
RowData<css::uno::Reference<css::text::XTextRange>, TablePropertyMapPtr>::Pointer_t mpUnfinishedRow;
bool mbKeepUnfinishedRow;