summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2012-03-15 09:43:26 +0100
committerDavid Tardon <dtardon@redhat.com>2012-03-15 09:43:26 +0100
commit32dc82b9d456ed92ba946611239349ab0e424e2a (patch)
treee801ac0dfe2e6967783ae185c6b760ead7ed6baf /sc/source
parente4fb449706b5847311ed14475d3babd6398973c7 (diff)
fdo#47311 don't crash when pasting into more than 1 sheet
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/document.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 2a5c751fbe4f..60ba8189ff73 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2277,7 +2277,7 @@ void ScDocument::CopyBlockFromClip( SCCOL nCol1, SCROW nRow1,
while ( i + nFollow < nTabEnd
&& rMark.GetTableSelect( i + nFollow + 1 )
&& nClipTab + nFollow < MAXTAB
- && rClipTabs[nClipTab + nFollow + 1] )
+ && rClipTabs[(nClipTab + nFollow + 1) % static_cast<SCTAB>(rClipTabs.size())] )
++nFollow;
if ( pCBFCP->pClipDoc->GetClipParam().mbCutMode )