summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-01-27 11:55:23 +0100
committerEike Rathke <erack@redhat.com>2014-01-27 12:50:02 +0000
commitc16eef21687f5d1f9b2bd789b1cf8b953bf2cd33 (patch)
treef57d80859707c22abb607a5afe15657fef420748 /sc
parent5aa2c17ae7411c2bfe762e11e6514ce88f2bd053 (diff)
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 Reviewed-on: https://gerrit.libreoffice.org/7683 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/token.cxx35
1 files changed, 17 insertions, 18 deletions
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index e23659c9055e..ff456eb4a12d 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);
+ }
}
}