summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/viewfun3.cxx18
1 files changed, 17 insertions, 1 deletions
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 8244e605ccc8..562135a0d5e0 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -676,8 +676,24 @@ bool ScViewFunc::PasteFromSystem( sal_uLong nFormatId, bool bApi )
if ( !aDataHelper.GetTransferable().is() )
return false;
+ SCCOL nPosX = 0;
+ SCROW nPosY = 0;
+
+ ScViewData& rViewData = GetViewData();
+ ScRange aRange;
+ if ( rViewData.GetSimpleArea( aRange ) == SC_MARK_SIMPLE )
+ {
+ nPosX = aRange.aStart.Col();
+ nPosY = aRange.aStart.Row();
+ }
+ else
+ {
+ nPosX = rViewData.GetCurX();
+ nPosY = rViewData.GetCurY();
+ }
+
bRet = PasteDataFormat( nFormatId, aDataHelper.GetTransferable(),
- GetViewData().GetCurX(), GetViewData().GetCurY(),
+ nPosX, nPosY,
NULL, false, !bApi ); // allow warning dialog
if ( !bRet && !bApi )