[Libreoffice-commits] core.git: Branch 'feature/formula-core-rework' - sc/inc sc/source

Kohei Yoshida kohei.yoshida at gmail.com
Wed May 15 11:16:21 PDT 2013


 sc/inc/clipcontext.hxx                 |    1 +
 sc/inc/column.hxx                      |   24 ++----------------------
 sc/inc/columniterator.hxx              |   10 +++-------
 sc/inc/mtvelements.hxx                 |   24 +++++++++++++++++++++++-
 sc/source/core/data/column2.cxx        |    6 +++---
 sc/source/core/data/documentimport.cxx |    2 +-
 6 files changed, 33 insertions(+), 34 deletions(-)

New commits:
commit edca13ef1bf0aabf0caa92b5c553250ba6cbb4f7
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Wed May 15 14:17:39 2013 -0400

    Move the column element block definitions out of ScColumn.
    
    so that I can reference it in another class.
    
    Change-Id: I035cc1d37ec219c3e3da2e180a0337fb3c6fba8a

diff --git a/sc/inc/clipcontext.hxx b/sc/inc/clipcontext.hxx
index ca6760f..ffe66b0 100644
--- a/sc/inc/clipcontext.hxx
+++ b/sc/inc/clipcontext.hxx
@@ -11,6 +11,7 @@
 #define SC_CLIPCONTEXT_HXX
 
 #include "address.hxx"
+#include "mtvelements.hxx"
 
 class ScDocument;
 
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index cf171ae..60f766d 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -33,18 +33,6 @@
 
 #include <boost/intrusive_ptr.hpp>
 
-#define DEBUG_COLUMN_STORAGE 0
-
-#if DEBUG_COLUMN_STORAGE
-#ifdef NDEBUG
-#undef NDEBUG
-#endif
-#define MDDS_MULTI_TYPE_VECTOR_DEBUG 1
-#endif
-
-#include <mdds/multi_type_vector.hpp>
-#include <mdds/multi_type_vector_custom_func1.hpp>
-
 namespace editeng { class SvxBorderLine; }
 
 namespace sc {
@@ -121,22 +109,14 @@ struct ColDoubleEntry
 
 class ScColumn
 {
-    // Broadcaster storage container
-    typedef mdds::mtv::custom_block_func1<sc::element_type_broadcaster, sc::custom_broadcaster_block> BCBlkFunc;
-    typedef mdds::multi_type_vector<BCBlkFunc> BCStoreType;
-
-    // Cell text attribute container.
-    typedef mdds::mtv::custom_block_func1<sc::element_type_celltextattr, sc::custom_celltextattr_block> CTAttrFunc;
-    typedef mdds::multi_type_vector<CTAttrFunc> CTAttrStoreType;
-
     // Empty values correspond with empty cells. All non-empty cell positions
     // must have non-empty elements. For text width, the value should be
     // either the real text width, or TEXTWIDTH_DIRTY in case it hasn't been
     // calculated yet. For script type, it should be either the real script
     // type value or SC_SCRIPTTYPE_UNKNOWN.
-    CTAttrStoreType maCellTextAttrs;
+    sc::CellTextAttrStoreType maCellTextAttrs;
 
-    BCStoreType maBroadcasters;
+    sc::BroadcasterStoreType maBroadcasters;
 
     SCCOL           nCol;
     SCTAB           nTab;
diff --git a/sc/inc/columniterator.hxx b/sc/inc/columniterator.hxx
index 676f675..69929aa 100644
--- a/sc/inc/columniterator.hxx
+++ b/sc/inc/columniterator.hxx
@@ -14,17 +14,13 @@
 
 #include "column.hxx"
 
-class ScColumn;
-
 class ScColumnTextWidthIterator : boost::noncopyable
 {
-    typedef ScColumn::CTAttrStoreType CTAttrStoreType;
-
-    CTAttrStoreType& mrCellTextAttrs;
+    sc::CellTextAttrStoreType& mrCellTextAttrs;
     const size_t mnEnd;
     size_t mnCurPos;
-    CTAttrStoreType::iterator miBlockCur;
-    CTAttrStoreType::iterator miBlockEnd;
+    sc::CellTextAttrStoreType::iterator miBlockCur;
+    sc::CellTextAttrStoreType::iterator miBlockEnd;
     sc::custom_celltextattr_block::iterator miDataCur;
     sc::custom_celltextattr_block::iterator miDataEnd;
 
diff --git a/sc/inc/mtvelements.hxx b/sc/inc/mtvelements.hxx
index 9fc5947..16113d5 100644
--- a/sc/inc/mtvelements.hxx
+++ b/sc/inc/mtvelements.hxx
@@ -12,8 +12,18 @@
 
 #include "svl/broadcast.hxx"
 
+#define DEBUG_COLUMN_STORAGE 0
+
+#if DEBUG_COLUMN_STORAGE
+#ifdef NDEBUG
+#undef NDEBUG
+#endif
+#define MDDS_MULTI_TYPE_VECTOR_DEBUG 1
+#endif
+
 #include <mdds/multi_type_vector_macro.hpp>
-#include <mdds/multi_type_vector_types.hpp>
+#include <mdds/multi_type_vector.hpp>
+#include <mdds/multi_type_vector_custom_func1.hpp>
 
 namespace sc {
 
@@ -45,6 +55,18 @@ MDDS_MTV_DEFINE_ELEMENT_CALLBACKS(CellTextAttr, element_type_celltextattr, CellT
 // This needs to be in global namespace just like SvtBroacaster is.
 MDDS_MTV_DEFINE_ELEMENT_CALLBACKS_PTR(SvtBroadcaster, sc::element_type_broadcaster, NULL, sc::custom_broadcaster_block)
 
+namespace sc {
+
+// Broadcaster storage container
+typedef mdds::mtv::custom_block_func1<sc::element_type_broadcaster, sc::custom_broadcaster_block> BCBlkFunc;
+typedef mdds::multi_type_vector<BCBlkFunc> BroadcasterStoreType;
+
+// Cell text attribute container.
+typedef mdds::mtv::custom_block_func1<sc::element_type_celltextattr, sc::custom_celltextattr_block> CTAttrFunc;
+typedef mdds::multi_type_vector<CTAttrFunc> CellTextAttrStoreType;
+
+}
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index f6eb29a..12b98aa 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1415,7 +1415,7 @@ void ScColumn::CopyCellTextAttrsToDocument(SCROW nRow1, SCROW nRow2, ScColumn& r
 {
     rDestCol.maCellTextAttrs.set_empty(nRow1, nRow2); // Empty the destination range first.
 
-    CTAttrStoreType::const_iterator itBlk = maCellTextAttrs.begin(), itBlkEnd = maCellTextAttrs.end();
+    sc::CellTextAttrStoreType::const_iterator itBlk = maCellTextAttrs.begin(), itBlkEnd = maCellTextAttrs.end();
 
     // Locate the top row position.
     size_t nOffsetInBlock = 0;
@@ -1864,8 +1864,8 @@ void ScColumn::FindUsed( SCROW nStartRow, SCROW nEndRow, bool* pUsed ) const
 
 void ScColumn::StartListening( SvtListener& rLst, SCROW nRow )
 {
-    std::pair<BCStoreType::iterator,size_t> aPos = maBroadcasters.position(nRow);
-    BCStoreType::iterator it = aPos.first; // block position.
+    std::pair<sc::BroadcasterStoreType::iterator,size_t> aPos = maBroadcasters.position(nRow);
+    sc::BroadcasterStoreType::iterator it = aPos.first; // block position.
     size_t nElemPos = aPos.second; // element position within the block.
     switch (it->type)
     {
diff --git a/sc/source/core/data/documentimport.cxx b/sc/source/core/data/documentimport.cxx
index 0b68fed..c92688f 100644
--- a/sc/source/core/data/documentimport.cxx
+++ b/sc/source/core/data/documentimport.cxx
@@ -109,7 +109,7 @@ void ScDocumentImport::finalize()
                 // Column has no cells. Skip it.
                 continue;
 
-            ScColumn::CTAttrStoreType::iterator itCTAPos = rCol.maCellTextAttrs.begin();
+            sc::CellTextAttrStoreType::iterator itCTAPos = rCol.maCellTextAttrs.begin();
             std::vector<ColEntry>::iterator itCell = rCol.maItems.begin(), itCellEnd = rCol.maItems.end();
             for (; itCell != itCellEnd; ++itCell)
                 itCTAPos = rCol.maCellTextAttrs.set<sc::CellTextAttr>(itCTAPos, itCell->nRow, sc::CellTextAttr());


More information about the Libreoffice-commits mailing list