writerfilter/source/dmapper/DomainMapperTableHandler.hxx | 42 ++++++++-- writerfilter/source/dmapper/TableManager.cxx | 3 writerfilter/source/dmapper/TableManager.hxx | 58 --------------- 3 files changed, 39 insertions(+), 64 deletions(-)
New commits: commit af4121416c8f4c88385765ec16a7569104ed2714 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Wed Jul 8 07:55:09 2015 +0200 writerfilter: remove not needed TableDataHandler interface Only DomainMapperTableHandler implemented it, and all clients can use that directly, no need for this abstraction here. Change-Id: I800b9eddcfddee643c725c29d9f15db3c9aab02c diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.hxx b/writerfilter/source/dmapper/DomainMapperTableHandler.hxx index bec48a3..6fe306e 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.hxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.hxx @@ -60,7 +60,8 @@ struct HorizontallyMergedCell } }; -class DomainMapperTableHandler : public TableDataHandler +/// Class to handle events generated by TableManager::resolveCurrentTable(). +class DomainMapperTableHandler { css::uno::Reference<css::text::XTextAppendAndConvert> m_xText; DomainMapper_Impl& m_rDMapper_Impl; @@ -92,13 +93,38 @@ public: DomainMapper_Impl& rDMapper_Impl); virtual ~DomainMapperTableHandler(); - virtual void startTable(unsigned int nRows, unsigned int nDepth, - TablePropertyMapPtr pProps) SAL_OVERRIDE; - virtual void endTable(unsigned int nestedTableLevel) SAL_OVERRIDE; - virtual void startRow(unsigned int nCells, TablePropertyMapPtr pProps) SAL_OVERRIDE; - virtual void endRow() SAL_OVERRIDE; - virtual void startCell(const css::uno::Reference< css::text::XTextRange > & start, TablePropertyMapPtr pProps) SAL_OVERRIDE; - virtual void endCell(const css::uno::Reference< css::text::XTextRange > & end) SAL_OVERRIDE; + /** + Handle start of table. + + @param nRows number of rows in the table + @param nDepth depth of the table in surrounding table hierarchy + @param pProps properties of the table + */ + void startTable(unsigned int nRows, unsigned int nDepth, TablePropertyMapPtr pProps); + /// Handle end of table. + void endTable(unsigned int nestedTableLevel); + /** + Handle start of row. + + @param nCols number of columns in the table + @param pProps properties of the row + */ + void startRow(unsigned int nCells, TablePropertyMapPtr pProps); + /// Handle end of row. + void endRow(); + /** + Handle start of cell. + + @param rT start handle of the cell + @param pProps properties of the cell + */ + void startCell(const css::uno::Reference< css::text::XTextRange > & start, TablePropertyMapPtr pProps); + /** + Handle end of cell. + + @param rT end handle of cell + */ + void endCell(const css::uno::Reference< css::text::XTextRange > & end); css::uno::Reference< css::text::XTextRange >& getTable() { return m_xTableRange; }; void setHadFootOrEndnote(bool bHadFootOrEndnote); diff --git a/writerfilter/source/dmapper/TableManager.cxx b/writerfilter/source/dmapper/TableManager.cxx index 4f8595a..be5a618 100644 --- a/writerfilter/source/dmapper/TableManager.cxx +++ b/writerfilter/source/dmapper/TableManager.cxx @@ -18,6 +18,7 @@ */ #include <TableManager.hxx> +#include <DomainMapperTableHandler.hxx> #include <util.hxx> namespace writerfilter @@ -408,7 +409,7 @@ void TableManager::handle(const css::uno::Reference<css::text::XTextRange>& rHan setHandle(rHandle); } -void TableManager::setHandler(TableDataHandler::Pointer_t pTableDataHandler) +void TableManager::setHandler(std::shared_ptr<DomainMapperTableHandler> pTableDataHandler) { mpTableDataHandler = pTableDataHandler; } diff --git a/writerfilter/source/dmapper/TableManager.hxx b/writerfilter/source/dmapper/TableManager.hxx index 3d44e24..0f203a1 100644 --- a/writerfilter/source/dmapper/TableManager.hxx +++ b/writerfilter/source/dmapper/TableManager.hxx @@ -37,59 +37,7 @@ namespace writerfilter namespace dmapper { -/** - Class to handle events generated by TableManager::resolveCurrentTable - */ -class TableDataHandler -{ -public: - typedef std::shared_ptr<TableDataHandler> Pointer_t; - - /** - Handle start of table. - - @param nRows number of rows in the table - @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, TablePropertyMapPtr pProps) = 0; - - /** - Handle end of table. - */ - virtual void endTable(unsigned int nestedTableLevel) = 0; - - /** - Handle start of row. - - @param nCols number of columns in the table - @param pProps properties of the row - */ - virtual void startRow(unsigned int nCols, TablePropertyMapPtr pProps) = 0; - - /** - Handle end of row. - */ - virtual void endRow() = 0; - - /** - Handle start of cell. - - @param rT start handle of the cell - @param pProps properties of the cell - */ - 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 css::uno::Reference<css::text::XTextRange>& xTextRange) = 0; - -protected: - ~TableDataHandler() {} -}; +class DomainMapperTableHandler; /** The table manager. @@ -403,7 +351,7 @@ private: /** handler for resolveCurrentTable */ - TableDataHandler::Pointer_t mpTableDataHandler; + std::shared_ptr<DomainMapperTableHandler> mpTableDataHandler; /** Set flag which indicates the current handle is in a cell. @@ -493,7 +441,7 @@ public: @param pTableDataHandler the handler */ - void setHandler(TableDataHandler::Pointer_t pTableDataHandler); + void setHandler(std::shared_ptr<DomainMapperTableHandler> pTableDataHandler); /** Set the current handle. _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits