[Libreoffice-commits] .: sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Wed Aug 10 08:19:54 PDT 2011


 sc/source/core/data/document.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 47ce01c9e5a9db3f86beb711aa4e0318aa901695
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Wed Aug 10 11:20:10 2011 -0400

    Fixed an infinite loop when the paste destination has only one sheet.

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index ec5cd52..ff6dd1f 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,
     {
         if (maTabs[i] && rMark.GetTableSelect(i) )
         {
-            while (!ppClipTab[nClipTab]) nClipTab = (nClipTab+1) % (static_cast<SCTAB>(maTabs.size()));
+            while (!ppClipTab[nClipTab]) nClipTab = (nClipTab+1) % (static_cast<SCTAB>(ppClipTab.size()));
 
             maTabs[i]->CopyFromClip( nCol1, nRow1, nCol2, nRow2, nDx, nDy,
                 pCBFCP->nInsFlag, pCBFCP->bAsLink, pCBFCP->bSkipAttrForEmpty, ppClipTab[nClipTab] );
@@ -2303,7 +2303,7 @@ void ScDocument::CopyBlockFromClip( SCCOL nCol1, SCROW nRow1,
                 }
             }
 
-            nClipTab = (nClipTab+1) % (static_cast<SCTAB>(maTabs.size()));
+            nClipTab = (nClipTab+1) % (static_cast<SCTAB>(ppClipTab.size()));
         }
     }
     if ( pCBFCP->nInsFlag & IDF_CONTENTS )
@@ -2313,7 +2313,7 @@ void ScDocument::CopyBlockFromClip( SCCOL nCol1, SCROW nRow1,
         {
             if (maTabs[i] && rMark.GetTableSelect(i) )
             {
-                while (!ppClipTab[nClipTab]) nClipTab = (nClipTab+1) % (static_cast<SCTAB>(maTabs.size()));
+                while (!ppClipTab[nClipTab]) nClipTab = (nClipTab+1) % (static_cast<SCTAB>(ppClipTab.size()));
                 SCsTAB nDz = ((SCsTAB)i) - nClipTab;
 
                 //  ranges of consecutive selected tables (in clipboard and dest. doc)
@@ -2339,7 +2339,7 @@ void ScDocument::CopyBlockFromClip( SCCOL nCol1, SCROW nRow1,
                         nCol1, nRow1, i, nCol2, nRow2, i+nFollow,
                         nDx, nDy, nDz, pCBFCP->pRefUndoDoc, false );
 
-                nClipTab = (nClipTab+nFollow+1) % (static_cast<SCTAB>(maTabs.size()));
+                nClipTab = (nClipTab+nFollow+1) % (static_cast<SCTAB>(ppClipTab.size()));
                 i = sal::static_int_cast<SCTAB>( i + nFollow );
             }
         }


More information about the Libreoffice-commits mailing list