summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-05-16 23:21:30 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-05-16 23:21:30 +0200
commit0141fe850626ee99129f5c871e0c87e2e9bec381 (patch)
treeb9c88be8180c28bf183af1d2ef38ad20ac83633a /sc
parent18767cccea159d405710fd068b1bc67d90b287d9 (diff)
use typedef not at iterator but at container type
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/document.hxx2
-rw-r--r--sc/source/core/data/documen2.cxx8
2 files changed, 5 insertions, 5 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 8d58e786653e..e3039dd83896 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -186,7 +186,7 @@ namespace com { namespace sun { namespace star {
#define SC_ASIANCOMPRESSION_INVALID 0xff
#define SC_ASIANKERNING_INVALID 0xff
-typedef ::std::vector<ScTable*>::iterator ScTableIterator;
+typedef ::std::vector<ScTable*> TableContainer;
enum ScDocumentMode
{
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 194a7ef83d1a..2eb059b872c1 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -846,7 +846,7 @@ sal_Bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pO
SetAutoCalc( false ); // Mehrfachberechnungen vermeiden
if (bValid)
{
- if (nNewPos == pTab.size())
+ if (nNewPos >= pTab.size())
{
pTab.push_back( new ScTable(this, nMaxTableNumber, aName) );
}
@@ -873,7 +873,7 @@ sal_Bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pO
pUnoBroadcaster->Broadcast( ScUpdateRefHint( URM_INSDEL, aRange, 0,0,1 ) );
SCTAB i;
- for (ScTableIterator it = pTab.begin(); it != pTab.end(); ++it)
+ for (TableContainer::iterator it = pTab.begin(); it != pTab.end(); ++it)
if (*it && it != (pTab.begin() + nOldPos))
(*it)->UpdateInsertTab(nNewPos);
for (i = pTab.size(); i > nNewPos; i--)
@@ -882,11 +882,11 @@ sal_Bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pO
nOldPos++;
pTab[nNewPos] = new ScTable(this, nNewPos, aName);
bValid = sal_True;
- for (ScTableIterator it = pTab.begin(); it != pTab.end(); ++it)
+ for (TableContainer::iterator it = pTab.begin(); it != pTab.end(); ++it)
if (*it && it != pTab.begin()+nOldPos && it != pTab.begin() + nNewPos)
(*it)->UpdateCompile();
SetNoListening( false );
- for (ScTableIterator it = pTab.begin(); it != pTab.end(); ++it)
+ for (TableContainer::iterator it = pTab.begin(); it != pTab.end(); ++it)
if (*it && it != pTab.begin()+nOldPos && it != pTab.begin()+nNewPos)
(*it)->StartAllListeners();