summaryrefslogtreecommitdiff
path: root/sc/source/ui/vba/excelvbahelper.cxx
diff options
context:
space:
mode:
authorNiklas Nebel <nn@openoffice.org>2010-09-15 18:01:02 +0200
committerNiklas Nebel <nn@openoffice.org>2010-09-15 18:01:02 +0200
commitafea0155c26d0864a9a629b2453afff3490e9bed (patch)
treea4d8e9556d7430fbfa33f2c1e4ead18c0fb10221 /sc/source/ui/vba/excelvbahelper.cxx
parentbbf445b0244ec56dd37c9230b3c734f2ec843933 (diff)
mib19: #163641# use clipboard content in ScVbaRange::Insert only if it was copied by implnCut/implnCopy
Diffstat (limited to 'sc/source/ui/vba/excelvbahelper.cxx')
-rw-r--r--sc/source/ui/vba/excelvbahelper.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/sc/source/ui/vba/excelvbahelper.cxx b/sc/source/ui/vba/excelvbahelper.cxx
index 2c39d7154b4b..2813d928eba8 100644
--- a/sc/source/ui/vba/excelvbahelper.cxx
+++ b/sc/source/ui/vba/excelvbahelper.cxx
@@ -150,7 +150,14 @@ implnCopy( const uno::Reference< frame::XModel>& xModel )
{
ScTabViewShell* pViewShell = getBestViewShell( xModel );
if ( pViewShell )
+ {
pViewShell->CopyToClip(NULL,false,false,true);
+
+ // mark the copied transfer object so it is used in ScVbaRange::Insert
+ ScTransferObj* pClipObj = ScTransferObj::GetOwnClipboard( NULL );
+ if (pClipObj)
+ pClipObj->SetUseInApi( true );
+ }
}
void
@@ -158,7 +165,14 @@ implnCut( const uno::Reference< frame::XModel>& xModel )
{
ScTabViewShell* pViewShell = getBestViewShell( xModel );
if ( pViewShell )
+ {
pViewShell->CutToClip( NULL, TRUE );
+
+ // mark the copied transfer object so it is used in ScVbaRange::Insert
+ ScTransferObj* pClipObj = ScTransferObj::GetOwnClipboard( NULL );
+ if (pClipObj)
+ pClipObj->SetUseInApi( true );
+ }
}
void implnPasteSpecial( const uno::Reference< frame::XModel>& xModel, USHORT nFlags,USHORT nFunction,sal_Bool bSkipEmpty, sal_Bool bTranspose)
@@ -181,7 +195,10 @@ void implnPasteSpecial( const uno::Reference< frame::XModel>& xModel, USHORT nFl
ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin );
ScDocument* pDoc = NULL;
if ( pOwnClip )
+ {
pDoc = pOwnClip->GetDocument();
+ pOwnClip->SetUseInApi( false ); // don't use in Insert after it was pasted once
+ }
pTabViewShell->PasteFromClip( nFlags, pDoc,
nFunction, bSkipEmpty, bTranspose, bAsLink,
eMoveMode, IDF_NONE, TRUE );