summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 be5d96c68218..dc05c142c02d 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -681,8 +681,24 @@ bool ScViewFunc::PasteFromSystem( sal_uLong nFormatId, bool bApi )
if ( !aDataHelper.GetTransferable().is() )
return false;
+ SCCOL nPosX = 0;
+ SCROW nPosY = 0;
+
+ ScViewData* pViewData = GetViewData();
+ ScRange aRange;
+ if ( pViewData->GetSimpleArea( aRange ) == SC_MARK_SIMPLE )
+ {
+ nPosX = aRange.aStart.Col();
+ nPosY = aRange.aStart.Row();
+ }
+ else
+ {
+ nPosX = pViewData->GetCurX();
+ nPosY = pViewData->GetCurY();
+ }
+
bRet = PasteDataFormat( nFormatId, aDataHelper.GetTransferable(),
- GetViewData()->GetCurX(), GetViewData()->GetCurY(),
+ nPosX, nPosY,
NULL, false, !bApi ); // allow warning dialog
if ( !bRet && !bApi )