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

Markus Mohrhard markus.mohrhard at googlemail.com
Mon Jan 27 03:02:06 PST 2014


 sc/source/core/tool/token.cxx |   35 +++++++++++++++++------------------
 1 file changed, 17 insertions(+), 18 deletions(-)

New commits:
commit b04bbd5c1423e2c8aa2be8a3a4dd3a68dc1315f1
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Jan 27 11:55:23 2014 +0100

    only put bounds in vector if range is outside of copy range, fdo#74041
    
    There are 4 cases of which only two need an entry in the vector. If the
    start is before the copy range and if the end is past the end of the
    copy range.
    
    Change-Id: Ia88f6891e03257c3321dbfb271be559378e39625

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index ed17a49..7d12e22 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -3162,36 +3162,35 @@ void checkBounds(
         // No intersections.
         return;
 
-    if (aAbs.aEnd.Row() <= rCxt.maRange.aEnd.Row())
+    if (aAbs.aStart.Row() <= rCxt.maRange.aStart.Row())
     {
         //    +-+ <---- top
         //    | |
         // +--+-+--+ <---- boundary row position
         // |  | |  |
-        // |  +-+  |
+        // |       |
         // +-------+
 
         // Add offset from the reference top to the cell position.
         SCROW nOffset = rCxt.maRange.aStart.Row() - aAbs.aStart.Row();
         rBounds.push_back(rPos.Row()+nOffset);
-        return;
     }
 
-    //    +-+ <---- top
-    //    | |
-    // +--+-+--+ <---- boundary row position
-    // |  | |  |
-    // |  | |  |
-    // +--+-+--+ <---- boundary row position
-    //    | |
-    //    +-+
-
-    // Add offset from the reference top to the cell position.
-    SCROW nOffset = rCxt.maRange.aStart.Row() - aAbs.aStart.Row();
-    rBounds.push_back(rPos.Row()+nOffset);
-    // Ditto.
-    nOffset = rCxt.maRange.aEnd.Row() + 1 - aAbs.aStart.Row();
-    rBounds.push_back(rPos.Row()+nOffset);
+    if (aAbs.aEnd.Row() >= rCxt.maRange.aEnd.Row())
+    {
+        // only check for end range
+
+        // +-------+
+        // |       |
+        // |  | |  |
+        // +--+-+--+ <---- boundary row position
+        //    | |
+        //    +-+
+
+        // Ditto.
+        SCROW nOffset = rCxt.maRange.aEnd.Row() + 1 - aAbs.aStart.Row();
+        rBounds.push_back(rPos.Row()+nOffset);
+    }
 }
 
 }


More information about the Libreoffice-commits mailing list