summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-05-24 04:53:17 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-05-24 04:53:17 +0200
commitb25344b5e5f6f9f12f232964706a017bd21f139e (patch)
tree96dd79d892731e4f1e4295f576b35eabe2450c9c /sc
parent6a82984f00fb2688fa82754017fc9b9e6c22bda9 (diff)
fix minor problems
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/document.hxx2
-rw-r--r--sc/source/core/data/document.cxx2
2 files changed, 2 insertions, 2 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 46b10385b8ca..13ecdcbdb692 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -472,7 +472,7 @@ public:
SC_DLLPUBLIC ScRangeName* GetRangeName() const;
void SetRangeName(SCTAB nTab, ScRangeName* pNew);
void SetRangeName( ScRangeName* pNewRangeName );
- SCTAB GetMaxTableNumber() { return static_cast<SCTAB>(pTab.size()); }
+ SCTAB GetMaxTableNumber() { return static_cast<SCTAB>(pTab.size()) - 1; }
void SetMaxTableNumber(SCTAB nNumber) { nMaxTableNumber = nNumber; }
ScRangePairList* GetColNameRanges() { return &xColNameRanges; }
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 882c874ddcad..69d1c3d45d3e 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -1681,7 +1681,7 @@ void ScDocument::CopyToClip4VBA(const ScClipParam& rClipParam, ScDocument* pClip
pClipDoc->ResetClip( this, nTab );
CopyRangeNamesToClip( pClipDoc, aClipRange, nTab );
- if ( nTab < static_cast<SCTAB>(pTab.size()) && nTab < static_cast<SCTAB>(pCipDoc->pTab.size()) )
+ if ( nTab < static_cast<SCTAB>(pTab.size()) && nTab < static_cast<SCTAB>(pClipDoc->pTab.size()) )
if ( pTab[nTab] && pClipDoc->pTab[nTab] )
{
pTab[nTab]->CopyToClip( rClipParam.maRanges, pClipDoc->pTab[nTab], bKeepScenarioFlags, bCloneNoteCaptions );