diff options
-rw-r--r-- | dtrans/source/win32/dtobj/FmtFilter.cxx | 4 | ||||
-rw-r--r-- | svtools/source/misc/transfer.cxx | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/dtrans/source/win32/dtobj/FmtFilter.cxx b/dtrans/source/win32/dtobj/FmtFilter.cxx index d452ac051f7f..a3e9357109ea 100644 --- a/dtrans/source/win32/dtobj/FmtFilter.cxx +++ b/dtrans/source/win32/dtobj/FmtFilter.cxx @@ -167,10 +167,8 @@ Sequence< sal_Int8 > SAL_CALL WinENHMFPictToOOMFPict( HENHMETAFILE hEnhMetaFile HMETAFILEPICT SAL_CALL OOMFPictToWinMFPict( Sequence< sal_Int8 >& aOOMetaFilePict ) { - OSL_ASSERT( aOOMetaFilePict.getLength() > 22 ); - HMETAFILEPICT hPict = NULL; - HMETAFILE hMtf = SetMetaFileBitsEx( aOOMetaFilePict.getLength() - 22, (sal_uChar*) aOOMetaFilePict.getConstArray() + 22 ); + HMETAFILE hMtf = SetMetaFileBitsEx( aOOMetaFilePict.getLength(), (sal_uChar*) aOOMetaFilePict.getConstArray() ); if( hMtf ) { diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx index 0d688befddd8..7e882dac35ff 100644 --- a/svtools/source/misc/transfer.cxx +++ b/svtools/source/misc/transfer.cxx @@ -78,6 +78,7 @@ #include "urlbmk.hxx" #include "inetimg.hxx" +#include <svtools/wmf.hxx> #include <svtools/imap.hxx> #include <svtools/transfer.hxx> @@ -286,10 +287,10 @@ Any SAL_CALL TransferableHelper::getTransferData( const DataFlavor& rFlavor ) th *pSrcStm >> aMtf; delete pSrcStm; - Graphic aGraphic( aMtf ); SvMemoryStream aDstStm( 65535, 65535 ); - if( GraphicConverter::Export( aDstStm, aGraphic, CVT_WMF ) == ERRCODE_NONE ) + // taking wmf without file header + if ( ConvertGDIMetaFileToWMF( aMtf, aDstStm, NULL, FALSE ) ) { maAny <<= ( aSeq = Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( aDstStm.GetData() ), aDstStm.Seek( STREAM_SEEK_TO_END ) ) ); |