[Libreoffice-commits] core.git: sc/source

Eike Rathke erack at redhat.com
Mon May 30 15:10:49 UTC 2016


 sc/source/core/data/table2.cxx |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 0002249b15d0d3aa89b7eafe0791921c0427abea
Author: Eike Rathke <erack at redhat.com>
Date:   Mon May 30 17:00:46 2016 +0200

    remove unnecessary temporary ScRangeList copy
    
    Change-Id: I46b9992f34820d21e4d0aa39a77cf6477648721a

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 479c17a..e6ab697 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -541,12 +541,11 @@ void ScTable::CopyToClip(
 void ScTable::CopyToClip(
     sc::CopyToClipContext& rCxt, const ScRangeList& rRanges, ScTable* pTable )
 {
-    ScRangeList aRanges(rRanges);
-    for ( size_t i = 0, nListSize = aRanges.size(); i < nListSize; ++i )
+    for ( size_t i = 0, nListSize = rRanges.size(); i < nListSize; ++i )
     {
-        ScRange* p = aRanges[ i ];
-        CopyToClip(
-            rCxt, p->aStart.Col(), p->aStart.Row(), p->aEnd.Col(), p->aEnd.Row(), pTable);
+        const ScRange* p = rRanges[ i ];
+        if (p)
+            CopyToClip( rCxt, p->aStart.Col(), p->aStart.Row(), p->aEnd.Col(), p->aEnd.Row(), pTable);
     }
 }
 


More information about the Libreoffice-commits mailing list