summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svtools/embedtransfer.hxx3
-rw-r--r--svtools/source/misc/embedtransfer.cxx7
2 files changed, 3 insertions, 7 deletions
diff --git a/include/svtools/embedtransfer.hxx b/include/svtools/embedtransfer.hxx
index 35a45987607f..6cd0a407093d 100644
--- a/include/svtools/embedtransfer.hxx
+++ b/include/svtools/embedtransfer.hxx
@@ -23,6 +23,7 @@
#include <svtools/svtdllapi.h>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <svtools/transfer.hxx>
+#include <memory>
class Graphic;
class SVT_DLLPUBLIC SvEmbedTransferHelper : public TransferableHelper
@@ -30,7 +31,7 @@ class SVT_DLLPUBLIC SvEmbedTransferHelper : public TransferableHelper
private:
css::uno::Reference< css::embed::XEmbeddedObject > m_xObj;
- Graphic* m_pGraphic;
+ std::unique_ptr<Graphic> m_pGraphic;
sal_Int64 m_nAspect;
OUString maParentShellID;
diff --git a/svtools/source/misc/embedtransfer.cxx b/svtools/source/misc/embedtransfer.cxx
index dc168ce5dfed..5d642c7a513f 100644
--- a/svtools/source/misc/embedtransfer.cxx
+++ b/svtools/source/misc/embedtransfer.cxx
@@ -59,11 +59,6 @@ SvEmbedTransferHelper::SvEmbedTransferHelper( const uno::Reference< embed::XEmbe
SvEmbedTransferHelper::~SvEmbedTransferHelper()
{
- if ( m_pGraphic )
- {
- delete m_pGraphic;
- m_pGraphic = nullptr;
- }
}
void SvEmbedTransferHelper::SetParentShellID( const OUString& rShellID )
@@ -95,7 +90,7 @@ bool SvEmbedTransferHelper::GetData( const css::datatransfer::DataFlavor& rFlavo
if( nFormat == SotClipboardFormatId::OBJECTDESCRIPTOR )
{
TransferableObjectDescriptor aDesc;
- FillTransferableObjectDescriptor( aDesc, m_xObj, m_pGraphic, m_nAspect );
+ FillTransferableObjectDescriptor( aDesc, m_xObj, m_pGraphic.get(), m_nAspect );
bRet = SetTransferableObjectDescriptor( aDesc );
}
else if( nFormat == SotClipboardFormatId::EMBED_SOURCE )