diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-12-06 11:43:37 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-12-06 11:43:37 +0100 |
commit | 1e29007cc5867dcd594c1219f625587d0adcb021 (patch) | |
tree | 5b71d45ddbd99b43655e7382798aca193d4bdcfc /writerfilter | |
parent | 95d27f465f67b12953a158f6f534e6f5aa3105a7 (diff) |
No need to have RowData as a template
Change-Id: Id93b97b69d1f9d44e5e5314698e7a3a0790e51e3
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/TableData.hxx | 37 | ||||
-rw-r--r-- | writerfilter/source/dmapper/TableManager.cxx | 2 | ||||
-rw-r--r-- | writerfilter/source/dmapper/TableManager.hxx | 2 |
3 files changed, 19 insertions, 22 deletions
diff --git a/writerfilter/source/dmapper/TableData.hxx b/writerfilter/source/dmapper/TableData.hxx index 73bc7e72f3db..7ac3eafceaf1 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 cf6e318f9459..a7b727517afa 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 604010c10974..b635a254efb8 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; |