[Libreoffice-commits] core.git: writerfilter/source

Miklos Vajna vmiklos at collabora.co.uk
Thu Dec 4 12:40:36 PST 2014


 writerfilter/source/dmapper/TableData.hxx    |   13 ++++++-------
 writerfilter/source/dmapper/TableManager.cxx |   17 ++++++++---------
 writerfilter/source/dmapper/TableManager.hxx |    2 +-
 3 files changed, 15 insertions(+), 17 deletions(-)

New commits:
commit 3c232768cff2f981f6bcd2a1df978e53eefd964e
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Dec 4 21:32:13 2014 +0100

    No need to have TableData as a template
    
    Change-Id: I136f844c3823443a8a42eb7a6e41d3805b085bd1

diff --git a/writerfilter/source/dmapper/TableData.hxx b/writerfilter/source/dmapper/TableData.hxx
index 69c9f5c..73bc7e7 100644
--- a/writerfilter/source/dmapper/TableData.hxx
+++ b/writerfilter/source/dmapper/TableData.hxx
@@ -264,13 +264,12 @@ public:
     }
 };
 
-template <typename T>
 /**
    Class that holds the data of a table.
  */
 class TableData
 {
-    typedef typename RowData<T, TablePropertyMapPtr>::Pointer_t RowPointer_t;
+    typedef RowData<css::uno::Reference<css::text::XTextRange>, TablePropertyMapPtr>::Pointer_t RowPointer_t;
     typedef ::std::vector<RowPointer_t> Rows;
 
     /**
@@ -296,10 +295,10 @@ class TableData
     /**
        initialize mpRow
      */
-    void newRow() { mpRow = RowPointer_t(new RowData<T, TablePropertyMapPtr>()); }
+    void newRow() { mpRow = RowPointer_t(new RowData<css::uno::Reference<css::text::XTextRange>, TablePropertyMapPtr>()); }
 
 public:
-    typedef boost::shared_ptr<TableData <T> > Pointer_t;
+    typedef boost::shared_ptr<TableData> Pointer_t;
 
     TableData(unsigned int nDepth) : mnDepth(nDepth) { newRow(); }
     ~TableData() {}
@@ -326,7 +325,7 @@ public:
        @param end     end handle of the cell
        @param pProps  properties of the cell
      */
-    void addCell(const T & start, TablePropertyMapPtr pProps)
+    void addCell(const css::uno::Reference<css::text::XTextRange>& start, TablePropertyMapPtr pProps)
     {
         mpRow->addCell(start, pProps);
     }
@@ -336,7 +335,7 @@ public:
 
         @parm end    end handle of the cell
      */
-    void endCell(const T & end)
+    void endCell(const css::uno::Reference<css::text::XTextRange>& end)
     {
         mpRow->endCell(end);
     }
@@ -373,7 +372,7 @@ public:
     /**
       Return the table properties.
      */
-    TablePropertyMapPtr getTableProperties( )
+    TablePropertyMapPtr getTableProperties()
     {
         return mpTableProps;
     }
diff --git a/writerfilter/source/dmapper/TableManager.cxx b/writerfilter/source/dmapper/TableManager.cxx
index 7c2b558..cf6e318 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> >::Pointer_t pTableData = mTableDataStack.top();
+        TableData::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> >::Pointer_t pTableData = mTableDataStack.top();
+        TableData::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> >::Pointer_t pTableData = mTableDataStack.top();
+        TableData::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> >::Pointer_t pTableData = mTableDataStack.top();
+        TableData::Pointer_t pTableData = mTableDataStack.top();
 
         if (isRowEnd())
         {
@@ -304,7 +304,7 @@ void TableManager::resolveCurrentTable()
     {
         try
         {
-            TableData< css::uno::Reference<css::text::XTextRange> >::Pointer_t pTableData = mTableDataStack.top();
+            TableData::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> >::Pointer_t pTableData;
+        TableData::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> >::Pointer_t pTableData;
+        TableData::Pointer_t pTableData;
 
         if (mTableDataStack.size() > 0)
             pTableData = mTableDataStack.top();
@@ -394,8 +394,7 @@ void TableManager::startLevel()
     }
 #endif
 
-    TableData< css::uno::Reference<css::text::XTextRange> >::Pointer_t
-    pTableData(new TableData<css::uno::Reference<css::text::XTextRange> >(mTableDataStack.size()));
+    TableData::Pointer_t pTableData(new TableData(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 54fcf4d..604010c 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> >::Pointer_t > mTableDataStack;
+    std::stack<TableData::Pointer_t> mTableDataStack;
     RowData<css::uno::Reference<css::text::XTextRange>, TablePropertyMapPtr>::Pointer_t mpUnfinishedRow;
     bool mbKeepUnfinishedRow;
 


More information about the Libreoffice-commits mailing list