summaryrefslogtreecommitdiff
path: root/svtools/source/misc/embedtransfer.cxx
diff options
context:
space:
mode:
authorpanoskorovesis <panoskorovesis@outlook.com>2021-08-05 17:37:13 +0300
committerTomaž Vajngerl <quikee@gmail.com>2021-08-17 04:40:46 +0200
commite7b6205bcf127d8afab8dfd015fef7573b296a22 (patch)
treec73551370ada11d7e208afe550bd4a922377d889 /svtools/source/misc/embedtransfer.cxx
parentdd3ab0fd737ff84657ff34eebafe2628f489e5a1 (diff)
Replace GDIMetaFile::Write and WriteGDIMetaFile with SvmWriter::Write
Use the new write functionality. This change also sets SvmWriter::Write second argument as const, as it's value does not change Change-Id: I1620756542a0bc54b5f8fc7ce3f57d0243a2ee55 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120408 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'svtools/source/misc/embedtransfer.cxx')
-rw-r--r--svtools/source/misc/embedtransfer.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/svtools/source/misc/embedtransfer.cxx b/svtools/source/misc/embedtransfer.cxx
index ac18b8cdead9..388a9f0f87a9 100644
--- a/svtools/source/misc/embedtransfer.cxx
+++ b/svtools/source/misc/embedtransfer.cxx
@@ -27,6 +27,7 @@
#include <svtools/embedtransfer.hxx>
#include <tools/mapunit.hxx>
#include <vcl/outdev.hxx>
+#include <vcl/filter/SvmWriter.hxx>
#include <vcl/gdimtf.hxx>
#include <comphelper/fileformat.h>
#include <comphelper/propertysequence.hxx>
@@ -156,7 +157,8 @@ bool SvEmbedTransferHelper::GetData( const css::datatransfer::DataFlavor& rFlavo
aMemStm.SetVersion( SOFFICE_FILEFORMAT_CURRENT );
const GDIMetaFile& aMetaFile = m_pGraphic->GetGDIMetaFile();
- const_cast<GDIMetaFile*>(&aMetaFile)->Write( aMemStm );
+ SvmWriter aWriter( aMemStm );
+ aWriter.Write( aMetaFile );
uno::Any aAny;
aAny <<= uno::Sequence< sal_Int8 >( static_cast< const sal_Int8* >( aMemStm.GetData() ),
aMemStm.TellEnd() );