summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMuthu Subramanian <muthu.subramanian.karunanidhi@ericsson.com>2014-10-10 22:58:00 +0530
committerAndras Timar <andras.timar@collabora.com>2014-11-23 14:32:30 +0100
commit07d8549c7b076d095cd1fc31e403a2ae327b00e3 (patch)
treececeffe949d6b31cb4a0f80fe34267f354c3c7e8 /sw
parent359c4268d05a45a7afe6c97ef60ead6dc316d2bd (diff)
Enable copy-paste of charts/ole as bitmaps.
Cherry-picked from 6296c64fb0ed8bce61eb6303920f952eda65de71 Change-Id: I0e074da34ff1a11c223994dcf373bf60af7cd271 Reviewed-on: https://gerrit.libreoffice.org/11911 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/uibase/dochdl/swdtflvr.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/sw/source/core/uibase/dochdl/swdtflvr.cxx b/sw/source/core/uibase/dochdl/swdtflvr.cxx
index 3cdd21abb165..3db9338f5085 100644
--- a/sw/source/core/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/core/uibase/dochdl/swdtflvr.cxx
@@ -495,6 +495,7 @@ bool SwTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDo
// the following solution will be used in the case when the object can not generate the image
// TODO/LATER: in future the transferhelper must probably be created based on object and the replacement stream
+ // TODO: Block not required now, SvEmbedTransferHelper should be able to handle GDIMetaFile format
if ( nFormat == SOT_FORMAT_GDIMETAFILE )
{
pOLEGraph = FindOLEReplacementGraphic();
@@ -828,6 +829,23 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR );
AddFormat( FORMAT_GDIMETAFILE );
+
+ // Fetch the formats supported via embedtransferhelper as well
+ sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
+ uno::Reference < embed::XEmbeddedObject > xObj = FindOLEObj( nAspect );
+ const Graphic* pOLEGraph = FindOLEReplacementGraphic();
+ if( xObj.is() )
+ {
+ TransferableDataHelper aD( new SvEmbedTransferHelper( xObj, pOLEGraph, nAspect ) );
+ if ( aD.GetTransferable().is() )
+ {
+ DataFlavorExVector aVector( aD.GetDataFlavorExVector() );
+ DataFlavorExVector::iterator aIter( aVector.begin() ), aEnd( aVector.end() );
+
+ while( aIter != aEnd )
+ AddFormat( *aIter++ );
+ }
+ }
eBufferType = TRNSFR_OLE;
}
// Is there anything to provide anyway?