summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2011-09-10 00:30:53 -0400
committerKohei Yoshida <kohei.yoshida@suse.com>2011-09-12 13:22:07 -0400
commit463b1b56868474808eed087da1d1e542f2fed067 (patch)
tree857063a4f5e207250486f91897ec200563f1089a /sc
parentf7d29b4494824a8560f062a704502e6d960bed4f (diff)
Allow paste when the dest range is a multiple of the source range.
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/viewfun3.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 2d0e78e9c134..e839a7089181 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -1753,11 +1753,14 @@ bool ScViewFunc::PasteFromClipToMultiRanges(
}
}
+ // Destination range must be an exact multiple of the source range.
SCROW nRows = aTest.aEnd.Row() - aTest.aStart.Row() + 1;
SCCOL nCols = aTest.aEnd.Col() - aTest.aStart.Col() + 1;
- if (nRows != nRowSize || nCols != nColSize)
+ SCROW nRowTest = (nRows / nRowSize) * nRowSize;
+ SCCOL nColTest = (nCols / nColSize) * nColSize;
+ if (nRows != nRowTest || nCols != nColTest)
{
- // Source and destination sizes don't match. Bail out.
+ // Destination range is not a multiple of the source range. Bail out.
ErrorMessage(STR_MSSG_PASTEFROMCLIP_0);
return false;
}