ooo-build r13241 - in trunk: . patches/dev300 patches/emf+



Author: thorstenb
Date: Wed Jul 16 08:42:02 2008
New Revision: 13241
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13241&view=rev

Log:
	* patches/dev300/apply:
	* patches/dev300/emf+-vcl-renderer.diff:
	* patches/dev300/emf+-vcl-renderer-m21.diff: Split patch,
	XCanvas::queryBitmapCanvas() is gone since m22.



Added:
   trunk/patches/emf+/emf+-vcl-renderer-m21.diff
Modified:
   trunk/ChangeLog
   trunk/patches/dev300/apply
   trunk/patches/emf+/emf+-vcl-renderer.diff

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Wed Jul 16 08:42:02 2008
@@ -2265,7 +2265,14 @@
 emf+-cppcanvas-emfplus.diff
 emf+-offapi-renderer.diff
 emf+-vcl-bitmap.diff
+
+[ EMFPlus < dev300-m22 >= beb300-m1 ]
+emf+-vcl-renderer-m21.diff
+
+[ EMFPlus >= dev300-m22 ]
 emf+-vcl-renderer.diff
+
+[ EMFPlus ]
 emf+-svtools.diff
 emf+-scp2-renderer.diff
 emf+-crash-fix.diff, n#361534, rodo

Added: trunk/patches/emf+/emf+-vcl-renderer-m21.diff
==============================================================================
--- (empty file)
+++ trunk/patches/emf+/emf+-vcl-renderer-m21.diff	Wed Jul 16 08:42:02 2008
@@ -0,0 +1,184 @@
+diff -rup vcl-orig/inc/vcl/gdimtf.hxx vcl/inc/vcl/gdimtf.hxx
+--- vcl-orig/inc/vcl/gdimtf.hxx	2007-11-09 16:53:41.000000000 +0100
++++ vcl/inc/vcl/gdimtf.hxx	2007-11-07 18:06:27.000000000 +0100
+@@ -156,6 +156,7 @@ private:
+                                                       const OutputDevice&   rMapDev,
+                                                       const PolyPolygon&    rPolyPoly,
+                                                       const Gradient&	  	rGrad 		);
++	SAL_DLLPRIVATE bool			   ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, Size rDestSize );
+ 
+ //#endif // __PRIVATE
+ 
+diff -rup vcl-orig/source/gdi/gdimtf.cxx vcl/source/gdi/gdimtf.cxx
+--- vcl-orig/source/gdi/gdimtf.cxx	2007-11-09 16:53:43.000000000 +0100
++++ vcl/source/gdi/gdimtf.cxx	2007-11-09 17:09:31.000000000 +0100
+@@ -66,12 +66,24 @@
+ #include <vcl/salbtype.hxx>
+ #include <vcl/outdev.hxx>
+ #include <vcl/window.hxx>
+-#ifndef _SV_CVTSVM_HXX
+ #include <vcl/cvtsvm.hxx>
+-#endif
+ #include <vcl/virdev.hxx>
++#include <vcl/salbmp.hxx>
++#include <vcl/svapp.hxx>
++#include <vcl/svdata.hxx>
++#include <vcl/salinst.hxx>
+ #include <vcl/gdimtf.hxx>
+ #include <vcl/graphictools.hxx>
++#include <vcl/canvastools.hxx>
++#include <vcl/unohelp.hxx>
++
++#include <com/sun/star/beans/XFastPropertySet.hpp>
++#include <com/sun/star/rendering/XCanvas.hpp>
++#include <com/sun/star/rendering/MtfRenderer.hpp>
++#include <comphelper/processfactory.hxx>
++#include <com/sun/star/lang/XMultiServiceFactory.hpp>
++
++using namespace com::sun::star;
+ 
+ // -----------
+ // - Defines -
+@@ -502,6 +541,76 @@ void GDIMetaFile::Play( OutputDevice* pO
+ 
+ // ------------------------------------------------------------------------
+ 
++bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, Size rDestSize )
++{
++    const Window* win = dynamic_cast <Window*> ( pOut );
++
++    if (!win)
++        win = Application::GetActiveTopWindow();
++    if (!win)
++        win = Application::GetFirstTopLevelWindow();
++
++    if (win) {
++        const uno::Reference<rendering::XCanvas>& xCanvas = win->GetCanvas ();
++        Size aSize (rDestSize.Width () + 1, rDestSize.Height () + 1);
++        const uno::Reference<rendering::XBitmap>& xBitmap = xCanvas->getDevice ()->createCompatibleAlphaBitmap (vcl::unotools::integerSize2DFromSize( aSize));
++        uno::Reference< lang::XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory();
++        if( xFactory.is() && xBitmap.is () ) {
++            uno::Reference< rendering::XMtfRenderer > xMtfRenderer;
++            uno::Sequence< uno::Any > args (1);
++            uno::Reference< rendering::XBitmapCanvas > xBitmapCanvas( xBitmap->queryBitmapCanvas() );
++            if( xBitmapCanvas.is() ) {
++                args[0] = uno::Any( xBitmapCanvas );
++                xMtfRenderer.set( xFactory->createInstanceWithArguments( ::rtl::OUString::createFromAscii( "com.sun.star.rendering.MtfRenderer" ),
++                                                                         args ), uno::UNO_QUERY );
++                
++                if( xMtfRenderer.is() ) {
++                    xBitmapCanvas->clear();
++                    uno::Reference< beans::XFastPropertySet > xMtfFastPropertySet( xMtfRenderer, uno::UNO_QUERY );
++                    if( xMtfFastPropertySet.is() )
++                        // set this metafile to the renderer to
++                        // speedup things (instead of copying data to
++                        // sequence of bytes passed to renderer)
++                        xMtfFastPropertySet->setFastPropertyValue( 0, uno::Any( reinterpret_cast<sal_Int64>( this ) ) );
++
++                    xMtfRenderer->draw( rDestSize.Width(), rDestSize.Height() );
++
++                    uno::Reference< beans::XFastPropertySet > xFastPropertySet( xBitmapCanvas, uno::UNO_QUERY );
++                    if( xFastPropertySet.get() ) {
++                        // 0 means get BitmapEx
++                        uno::Any aAny = xFastPropertySet->getFastPropertyValue( 0 );
++                        BitmapEx* pBitmapEx = (BitmapEx*) *reinterpret_cast<const sal_Int64*>(aAny.getValue()); 
++                        if( pBitmapEx ) {
++                            pOut->DrawBitmapEx( rPos, *pBitmapEx );
++                            delete pBitmapEx;
++                            return true;
++                        }
++                    }
++                    
++                    SalBitmap* pSalBmp = ImplGetSVData()->mpDefInst->CreateSalBitmap();
++                    SalBitmap* pSalMask = ImplGetSVData()->mpDefInst->CreateSalBitmap();
++
++                    if( pSalBmp->Create( xBitmapCanvas, aSize ) && pSalMask->Create( xBitmapCanvas, aSize, true ) ) {
++                        Bitmap aBitmap( pSalBmp );
++                        Bitmap aMask( pSalMask );
++                        AlphaMask aAlphaMask( aMask );
++                        BitmapEx aBitmapEx( aBitmap, aAlphaMask );
++                        pOut->DrawBitmapEx( rPos, aBitmapEx );
++                        return true;
++                    }
++
++                    delete pSalBmp;
++                    delete pSalMask;
++                }
++            }
++        }
++    }
++
++    return false;
++}
++
++// ------------------------------------------------------------------------
++
+ void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos,
+ 						const Size& rSize, ULONG nPos )
+ {
+@@ -511,8 +619,12 @@ void GDIMetaFile::Play( OutputDevice* pO
+ 
+ 	if( aDestSize.Width() && aDestSize.Height() )
+ 	{
+-		Size			aTmpPrefSize( pOut->LogicToPixel( GetPrefSize(), aDrawMap ) );
+-		GDIMetaFile*	pMtf = pOut->GetConnectMetaFile();
++        GDIMetaFile*	pMtf = pOut->GetConnectMetaFile();
++
++        if( !pMtf && ImplPlayWithRenderer( pOut, rPos, aDestSize ) )
++            return;
++
++        Size aTmpPrefSize( pOut->LogicToPixel( GetPrefSize(), aDrawMap ) );
+ 
+ 		if( !aTmpPrefSize.Width() )
+ 			aTmpPrefSize.Width() = aDestSize.Width();
+diff -rup vcl-orig/source/gdi/makefile.mk vcl/source/gdi/makefile.mk
+--- vcl-orig/source/gdi/makefile.mk	2007-11-09 16:53:43.000000000 +0100
++++ vcl/source/gdi/makefile.mk	2007-11-07 11:06:41.000000000 +0100
+@@ -125,6 +126,7 @@ SLOFILES=	$(SLO)$/salmisc.obj 	\
+ 
+ EXCEPTIONSFILES=	$(SLO)$/outdev.obj		\
+ 					$(SLO)$/outdev3.obj 	\
++					$(SLO)$/gdimtf.obj 	\
+ 					$(SLO)$/gfxlink.obj		\
+ 					$(SLO)$/print.obj		\
+                     $(SLO)$/print2.obj		\
+diff -rup vcl-orig/source/gdi/metaact.cxx vcl/source/gdi/metaact.cxx
+--- vcl-orig/source/gdi/metaact.cxx	2007-11-09 16:53:43.000000000 +0100
++++ vcl/source/gdi/metaact.cxx	2007-11-10 13:44:40.000000000 +0100
+@@ -4041,8 +4047,34 @@ void MetaCommentAction::Scale( double fX
+ 				}
+ 				delete[] mpData;
+ 				ImplInitDynamicData( static_cast<const BYTE*>( aDest.GetData() ), aDest.Tell() );
+-			}
+-		}
++            } else if( maComment.Equals( "EMF_PLUS_HEADER_INFO" ) ) {
++				SvMemoryStream	aMemStm( (void*)mpData, mnDataSize, STREAM_READ );
++				SvMemoryStream	aDest;
++
++                sal_Int32 nLeft, nRight, nTop, nBottom;
++                sal_Int32 nPixX, nPixY, nMillX, nMillY;
++                float m11, m12, m21, m22, mdx, mdy;
++
++                // read data
++                aMemStm >> nLeft >> nTop >> nRight >> nBottom;
++                aMemStm >> nPixX >> nPixY >> nMillX >> nMillY;
++                aMemStm >> m11 >> m12 >> m21 >> m22 >> mdx >> mdy;
++
++                // add scale to the transformation
++                m11 *= fXScale;
++                m12 *= fXScale;
++                m22 *= fYScale;
++                m21 *= fYScale;
++
++                // prepare new data
++                aDest << nLeft << nTop << nRight << nBottom;
++                aDest << nPixX << nPixY << nMillX << nMillY;
++                aDest << m11 << m12 << m21 << m22 << mdx << mdy;
++
++                // save them
++				ImplInitDynamicData( static_cast<const BYTE*>( aDest.GetData() ), aDest.Tell() );
++            }
++        }
+ 	}
+ }
+ 

Modified: trunk/patches/emf+/emf+-vcl-renderer.diff
==============================================================================
--- trunk/patches/emf+/emf+-vcl-renderer.diff	(original)
+++ trunk/patches/emf+/emf+-vcl-renderer.diff	Wed Jul 16 08:42:02 2008
@@ -60,7 +60,7 @@
 +        if( xFactory.is() && xBitmap.is () ) {
 +            uno::Reference< rendering::XMtfRenderer > xMtfRenderer;
 +            uno::Sequence< uno::Any > args (1);
-+            uno::Reference< rendering::XBitmapCanvas > xBitmapCanvas( xBitmap->queryBitmapCanvas() );
++            uno::Reference< rendering::XBitmapCanvas > xBitmapCanvas( xBitmap, uno::UNO_QUERY );
 +            if( xBitmapCanvas.is() ) {
 +                args[0] = uno::Any( xBitmapCanvas );
 +                xMtfRenderer.set( xFactory->createInstanceWithArguments( ::rtl::OUString::createFromAscii( "com.sun.star.rendering.MtfRenderer" ),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]