summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-08-16 23:03:43 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-08-16 23:03:43 +0200
commitd7791df329a6bcf315506bb2ec4e6cc0f07309b9 (patch)
tree68e3830e8354f501888544e4cced64b6f306b41c /sc
parent5c5282bc5ce047279b942779eafea8568b2e1c21 (diff)
GetLastSelected returns a table number and not a 1-based index
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/document.cxx2
-rw-r--r--sc/source/ui/view/viewfun3.cxx5
2 files changed, 2 insertions, 5 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 551331367938..0f53226f47c1 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -1661,7 +1661,7 @@ void ScDocument::InitUndoSelected( ScDocument* pSrcDoc, const ScMarkData& rTabSe
xPoolHelper = pSrcDoc->xPoolHelper;
String aString;
- for (SCTAB nTab = 0; nTab < rTabSelection.GetLastSelected(); nTab++)
+ for (SCTAB nTab = 0; nTab <= rTabSelection.GetLastSelected(); nTab++)
if ( rTabSelection.GetTableSelect( nTab ) )
{
ScTable* pTable = new ScTable(this, nTab, aString, bColInfo, bRowInfo);
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 03481f6418bf..a3c1ab317eb9 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -1551,10 +1551,7 @@ bool ScViewFunc::PasteMultiRangesFromClip(
// Determine the first and last selected sheet numbers.
SCTAB nTab1 = aMark.GetFirstSelected();
- SCTAB nTab2 = nTab1;
- for (SCTAB i = nTab1+1; i < aMark.GetLastSelected(); ++i)
- if (aMark.GetTableSelect(i))
- nTab2 = i;
+ SCTAB nTab2 = aMark.GetLastSelected();
ScDocShellModificator aModificator(*pDocSh);