tdf#143257 like graphics defer creating transfer data for drawings until needed
don't create when a drawing is selected, wait until its actually dropped
into something (I experimented with dropping into gimp)
Change-Id: I3edaf79537d5723565adf8c45d6f7408026a93e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118770
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index ff7ee5e..f4f5632 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -487,7 +487,7 @@ bool SwTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDo
const bool bPending(m_pWrtShell->ActionPend());
// SEL_GRF is from ContentType of editsh
if(bPending || ((SelectionType::Graphic | SelectionType::DbForm) & nSelectionType))
if(bPending || ((SelectionType::Graphic | SelectionType::DrawObject | SelectionType::DbForm) & nSelectionType))
{
m_pClpGraphic.reset(new Graphic);
if( !m_pWrtShell->GetDrawObjGraphic( SotClipboardFormatId::GDIMETAFILE, *m_pClpGraphic ))
@@ -3605,13 +3605,6 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos )
}
m_eBufferType = TransferBufferType::Graphic | m_eBufferType;
m_pClpGraphic.reset(new Graphic);
if( !m_pWrtShell->GetDrawObjGraphic( SotClipboardFormatId::GDIMETAFILE, *m_pClpGraphic ))
m_pOrigGraphic = m_pClpGraphic.get();
m_pClpBitmap.reset(new Graphic);
if( !m_pWrtShell->GetDrawObjGraphic( SotClipboardFormatId::BITMAP, *m_pClpBitmap ))
m_pOrigGraphic = m_pClpBitmap.get();
// is it a URL-Button ?
OUString sURL;
OUString sDesc;