diff options
-rw-r--r-- | sc/inc/clipcontext.hxx | 1 | ||||
-rw-r--r-- | sc/inc/column.hxx | 24 | ||||
-rw-r--r-- | sc/inc/columniterator.hxx | 10 | ||||
-rw-r--r-- | sc/inc/mtvelements.hxx | 24 | ||||
-rw-r--r-- | sc/source/core/data/column2.cxx | 6 | ||||
-rw-r--r-- | sc/source/core/data/documentimport.cxx | 2 |
6 files changed, 33 insertions, 34 deletions
diff --git a/sc/inc/clipcontext.hxx b/sc/inc/clipcontext.hxx index ca6760fbccf9..ffe66b0f4951 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 cf171ae319bd..60f766d1d3d3 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 676f67585cf7..69929aaf5a25 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 9fc5947ea2e1..16113d5bfe61 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 c0e0bfff37f9..4269774d7516 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 0b68fedf71c7..c92688f1ada2 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()); |