summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@novell.com>2010-11-18 18:14:38 +0200
committerTor Lillqvist <tml@hemulen.(none)>2010-11-18 18:18:03 +0200
commit9d2e343f36f80852bd4c7452f67db4068f366b71 (patch)
tree20ebda06631ec07383b4f5cbab9e8d741227e950 /sc/source
parent5f35a43d8405ef3bff6b841ccdaf5a256f6f554a (diff)
Add workaround to avoid pasting data from OOo Calc as an OLE object
Help for fdo#31077.
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/view/viewfun3.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index d19401efcab9..a3096463d544 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -680,6 +680,10 @@ void ScViewFunc::PasteFromSystem()
{
// If it's a Writer object, insert RTF instead of OLE
+ // Else, if the class id is all-zero, and SYLK is available,
+ // it probably is spreadsheet cells that have been put
+ // on the clipboard by OOo, so use the SYLK. (fdo#31077)
+
BOOL bDoRtf = FALSE;
TransferableObjectDescriptor aObjDesc;
if( aDataHelper.GetTransferableObjectDescriptor( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR, aObjDesc ) )
@@ -690,6 +694,9 @@ void ScViewFunc::PasteFromSystem()
}
if ( bDoRtf )
PasteFromSystem( FORMAT_RTF );
+ else if ( aObjDesc.maClassName == SvGlobalName( 0,0,0,0,0,0,0,0,0,0,0 )
+ && aDataHelper.HasFormat( SOT_FORMATSTR_ID_SYLK ))
+ PasteFromSystem( SOT_FORMATSTR_ID_SYLK );
else
PasteFromSystem( SOT_FORMATSTR_ID_EMBED_SOURCE );
}