summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-05-16 22:50:24 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-05-16 22:50:24 +0200
commitca8a159af4fb1e15a4c0f78d4d6577d1a6db025d (patch)
tree24a9ca5497a62684a5d866575323bd29314aea6c /sc
parentdca0391318ca9a88ef89ce89da7588732a47f43b (diff)
change table container from c-array to std::vector
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/document.hxx4
-rw-r--r--sc/source/core/data/documen2.cxx13
-rw-r--r--sc/source/core/data/document.cxx4
3 files changed, 9 insertions, 12 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 524280b8af95..8d58e786653e 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -49,6 +49,7 @@
#include <map>
#include <set>
#include <list>
+#include <vector>
#include <boost/ptr_container/ptr_vector.hpp>
namespace editeng { class SvxBorderLine; }
@@ -185,6 +186,7 @@ namespace com { namespace sun { namespace star {
#define SC_ASIANCOMPRESSION_INVALID 0xff
#define SC_ASIANKERNING_INVALID 0xff
+typedef ::std::vector<ScTable*>::iterator ScTableIterator;
enum ScDocumentMode
{
@@ -239,7 +241,7 @@ private:
ScConditionalFormatList* pCondFormList; // conditional formats
ScValidationDataList* pValidationList; // validity
SvNumberFormatterIndexTable* pFormatExchangeList; // for application of number formats
- ScTable* pTab[MAXTABCOUNT];
+ ::std::vector<ScTable*> pTab;
mutable ScRangeName* pRangeName;
ScDBCollection* pDBCollection;
ScDPCollection* pDPCollection;
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 32c383e4be2d..f3ca9796e5d1 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -139,6 +139,7 @@ ScDocument::ScDocument( ScDocumentMode eMode,
pCondFormList( NULL ),
pValidationList( NULL ),
pFormatExchangeList( NULL ),
+ pTab( 10 ),
pRangeName(NULL),
pDPCollection( NULL ),
pLinkManager( NULL ),
@@ -235,22 +236,16 @@ ScDocument::ScDocument( ScDocumentMode eMode,
xPoolHelper = new ScPoolHelper( this );
- pTab[0] = NULL;
pBASM = new ScBroadcastAreaSlotMachine( this );
pChartListenerCollection = new ScChartListenerCollection( this );
pRefreshTimerControl = new ScRefreshTimerControl;
}
else
{
- pTab[0] = NULL;
pBASM = NULL;
pChartListenerCollection = NULL;
pRefreshTimerControl = NULL;
}
-
- for (SCTAB i=1; i<=MAXTAB; i++)
- pTab[i] = NULL;
-
pDBCollection = new ScDBCollection(this);
pSelectionAttr = NULL;
pChartCollection = new ScChartCollection;
@@ -556,14 +551,14 @@ ScNoteEditEngine& ScDocument::GetNoteEngine()
}
-void ScDocument::ResetClip( ScDocument* pSourceDoc, const ScMarkData* pMarks )
+void ScDocument::ResetClip( ScDocument* pSourceDoc, const ScMarkData* pMarks )//TODO:FIXME
{
if (bIsClip)
{
InitClipPtrs(pSourceDoc);
- for (SCTAB i = 0; i <= MAXTAB; i++)
- if (pSourceDoc->pTab[i])
+ for (ScTableIterator it = pTab.begin(); it != pTab.end(); ++it)
+ if (pSourceDoc->pTab[i] )//TODO:FIXME
if (!pMarks || pMarks->GetTableSelect(i))
{
String aString;
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 3734b806a41d..80e79289f0e9 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2014,7 +2014,7 @@ void ScDocument::CopyBlockFromClip( SCCOL nCol1, SCROW nRow1,
SCsCOL nDx, SCsROW nDy,
const ScCopyBlockFromClipParams* pCBFCP )
{
- ScTable** ppClipTab = pCBFCP->pClipDoc->pTab;
+ ::std::vector<ScTable*>& ppClipTab = pCBFCP->pClipDoc->pTab;
SCTAB nTabEnd = pCBFCP->nTabEnd;
SCTAB nClipTab = 0;
for (SCTAB i = pCBFCP->nTabStart; i <= nTabEnd; i++)
@@ -2103,7 +2103,7 @@ void ScDocument::CopyNonFilteredFromClip( SCCOL nCol1, SCROW nRow1,
// filtered state is taken from first used table in clipboard (as in GetClipArea)
SCTAB nFlagTab = 0;
- ScTable** ppClipTab = pCBFCP->pClipDoc->pTab;
+ std::vector<ScTable*>& ppClipTab = pCBFCP->pClipDoc->pTab;
while ( nFlagTab < MAXTAB && !ppClipTab[nFlagTab] )
++nFlagTab;