svtools/source/filter/wmf/enhwmf.cxx | 5 ----- svtools/source/filter/wmf/winmtf.cxx | 4 ++++ vcl/win/source/gdi/salbmp.cxx | 17 ++++++++++++++++- 3 files changed, 20 insertions(+), 6 deletions(-)
New commits: commit 7564b2c1092eeb7969577769b82a4c537e37206f Author: Radek Doulik <r...@novell.com> Date: Thu Mar 29 14:33:00 2012 +0200 emf+ on win: implement bitmap creation from bitmapcanvas diff --git a/vcl/win/source/gdi/salbmp.cxx b/vcl/win/source/gdi/salbmp.cxx index 0cc5bb0..ab42393 100644 --- a/vcl/win/source/gdi/salbmp.cxx +++ b/vcl/win/source/gdi/salbmp.cxx @@ -31,6 +31,7 @@ #include <vcl/bitmap.hxx> // for BitmapSystemData #include <vcl/salbtype.hxx> +#include <com/sun/star/beans/XFastPropertySet.hpp> #include <win/wincomp.hxx> #include <win/salgdi.h> @@ -267,8 +268,22 @@ bool WinSalBitmap::Create( const SalBitmap& rSSalBmp, sal_uInt16 nNewBitCount ) // ------------------------------------------------------------------ -bool WinSalBitmap::Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > /*xBitmapCanvas*/, Size& /*rSize*/, bool /*bMask*/ ) +bool WinSalBitmap::Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas, Size& /*rSize*/, bool bMask ) { + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XFastPropertySet > + xFastPropertySet( xBitmapCanvas, ::com::sun::star::uno::UNO_QUERY ); + + if( xFastPropertySet.get() ) { + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > args; + + if( xFastPropertySet->getFastPropertyValue(bMask ? 2 : 1) >>= args ) { + sal_Int64 aHBmp64; + + if( args[0] >>= aHBmp64 ) { + return Create( HBITMAP(aHBmp64), false, false ); + } + } + } return false; } commit e0a43983faff4982ddfd151b0ae4c28623edf894 Author: Radek Doulik <r...@novell.com> Date: Thu Mar 29 14:31:14 2012 +0200 emf+ on win: flush the header stream, so that it doesn't look like empty diff --git a/svtools/source/filter/wmf/winmtf.cxx b/svtools/source/filter/wmf/winmtf.cxx index d9597ff..6abf445 100644 --- a/svtools/source/filter/wmf/winmtf.cxx +++ b/svtools/source/filter/wmf/winmtf.cxx @@ -2228,6 +2228,10 @@ void WinMtfOutput::PassEMFPlusHeaderInfo() // rotate and scale operations mem << one << zero << zero << one << zero << zero; + // need to flush the stream, otherwise GetEndOfData will return 0 + // on windows where the function parameters are probably resolved in reverse order + mem.Flush(); + mpGDIMetaFile->AddAction( new MetaCommentAction( "EMF_PLUS_HEADER_INFO", 0, (const sal_uInt8*) mem.GetData(), mem.GetEndOfData() ) ); mpGDIMetaFile->UseCanvas( sal_True ); } commit 48f0a248cf8313f0341e2e6171f518d01d83478d Author: Radek Doulik <r...@novell.com> Date: Thu Mar 29 14:30:45 2012 +0200 emf+ on win: enable emf+ parsing diff --git a/svtools/source/filter/wmf/enhwmf.cxx b/svtools/source/filter/wmf/enhwmf.cxx index 9664b09..b81d973 100644 --- a/svtools/source/filter/wmf/enhwmf.cxx +++ b/svtools/source/filter/wmf/enhwmf.cxx @@ -440,12 +440,7 @@ sal_Bool EnhWMFReader::ReadEnhWMF() sal_Bool bFlag(sal_False), bStatus = ReadHeader(); sal_Bool bHaveDC = false; -#ifdef UNX static sal_Bool bEnableEMFPlus = ( getenv( "EMF_PLUS_DISABLE" ) == NULL ); -#else - // TODO: make it possible to disable emf+ on windows - static sal_Bool bEnableEMFPlus = sal_False; -#endif while( bStatus && nRecordCount-- && pWMF->good()) { _______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits