ooo-build r12758 - in branches/sled-10-sp1-ooo-build-2-4: . patches/emf+ patches/src680



Author: rodo
Date: Tue Jun  3 10:49:22 2008
New Revision: 12758
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12758&view=rev

Log:
2008-06-03  Radek Doulik  <rodo novell com>

	* patches/emf+/emf+-embedded-mf-image-and-roundcorners-fix.diff:
	added new patch with changes below, also enabled it in apply

	* cppcanvas/source/mtfrenderer/implrenderer.cxx: fixed round
	corners rectangle drawing (basegfx tools use portion of width and
	height to specify the corners width and height)

	* cppcanvas/source/mtfrenderer/emfplus.cxx: implemented reading of
	metafile images in Image object record



Added:
   branches/sled-10-sp1-ooo-build-2-4/patches/emf+/emf+-embedded-mf-image-and-roundcorners-fix.diff
Modified:
   branches/sled-10-sp1-ooo-build-2-4/ChangeLog
   branches/sled-10-sp1-ooo-build-2-4/patches/src680/apply

Added: branches/sled-10-sp1-ooo-build-2-4/patches/emf+/emf+-embedded-mf-image-and-roundcorners-fix.diff
==============================================================================
--- (empty file)
+++ branches/sled-10-sp1-ooo-build-2-4/patches/emf+/emf+-embedded-mf-image-and-roundcorners-fix.diff	Tue Jun  3 10:49:22 2008
@@ -0,0 +1,73 @@
+diff -rup cppcanvas-orig-mp/source/mtfrenderer/emfplus.cxx cppcanvas/source/mtfrenderer/emfplus.cxx
+--- cppcanvas-orig-mp/source/mtfrenderer/emfplus.cxx	2008-06-03 12:26:31.000000000 +0200
++++ cppcanvas/source/mtfrenderer/emfplus.cxx	2008-06-03 12:26:44.000000000 +0200
+@@ -632,12 +632,10 @@ namespace cppcanvas
+             Graphic graphic;
+     
+ 
+-            void Read (SvStream &s)
++            void Read (SvMemoryStream &s)
+             {
+                 sal_uInt32 header, unknown;
+ 
+-                EMFP_DEBUG (dumpWords(s, 16));
+-
+                 s >> header >> type;
+ 
+                 EMFP_DEBUG (printf ("EMF+\timage\nEMF+\theader: 0x%08x type: 0x%08x\n", header, type));
+@@ -652,6 +650,24 @@ namespace cppcanvas
+                         EMFP_DEBUG (printf ("EMF+\tbitmap width: %d height: %d\n", graphic.GetBitmap ().GetSizePixel ().Width (), graphic.GetBitmap ().GetSizePixel ().Height ()));
+                     }
+ 
++                } else if (type == 2) {
++                    sal_Int32 mfType, mfSize;
++
++                    s >> mfType >> mfSize;
++                    EMFP_DEBUG (printf ("EMF+\tmetafile type: %d dataSize: %d\n", mfType, mfSize));
++
++                    GraphicFilter filter;
++                    SvMemoryStream mfStream (((char *)s.GetData()) + s.Tell(), mfSize, STREAM_READ);
++
++                    filter.ImportGraphic (graphic, String (), mfStream);
++
++                    // debug code - write the stream to debug file /tmp/emf-stream.emf
++                    EMFP_DEBUG(mfStream.Seek(0);
++                               SvFileStream file( UniString::CreateFromAscii( "/tmp/emf-embedded-stream.emf" ), STREAM_WRITE | STREAM_TRUNC );
++
++                               mfStream >> file;
++                               file.Flush();
++                               file.Close());
+                 }
+             }
+         };
+@@ -1040,7 +1056,7 @@ namespace cppcanvas
+                         mMFlags = flags;
+                         mMStream.Seek(0);
+                     }
+-                    EMFP_DEBUG (dumpWords(rMF, 16));
++
+                     // 1st 4 bytes are unknown
+                     mMStream.Write (((const char *)rMF.GetData()) + rMF.Tell() + 4, dataSize - 4);
+                     EMFP_DEBUG (printf ("EMF+ read next object part size: %d type: %04hx flags: %04hx data size: %d\n", size, type, flags, dataSize));
+diff -rup cppcanvas-orig-mp/source/mtfrenderer/implrenderer.cxx cppcanvas/source/mtfrenderer/implrenderer.cxx
+--- cppcanvas-orig-mp/source/mtfrenderer/implrenderer.cxx	2008-06-03 12:26:31.000000000 +0200
++++ cppcanvas/source/mtfrenderer/implrenderer.cxx	2008-06-03 12:26:44.000000000 +0200
+@@ -1845,6 +1845,7 @@ namespace cppcanvas
+                                 char *env;
+                                 if (env = getenv ("EMF_PLUS_LIMIT")) {
+                                     limit = atoi (env);
++                                    EMFP_DEBUG (printf ("EMF+ records limit: %d\n", limit));
+                                 }
+                             }
+                             EMFP_DEBUG (printf ("EMF+ passed to canvas mtf renderer, size: %d\n", pAct->GetDataSize ()));
+@@ -2039,8 +2040,8 @@ namespace cppcanvas
+                                     ::vcl::unotools::b2DPointFromPoint( rRect.TopLeft() ),
+                                     ::vcl::unotools::b2DPointFromPoint( rRect.BottomRight() ) +
+                                     ::basegfx::B2DPoint(1,1) ),
+-                                static_cast<MetaRoundRectAction*>(pCurrAct)->GetHorzRound(),
+-                                static_cast<MetaRoundRectAction*>(pCurrAct)->GetVertRound() ));
++                                ( (double) static_cast<MetaRoundRectAction*>(pCurrAct)->GetHorzRound() ) / rRect.GetWidth(),
++                                ( (double) static_cast<MetaRoundRectAction*>(pCurrAct)->GetVertRound() ) / rRect.GetHeight() ) );
+                         aPoly.transform( getState( rStates ).mapModeTransform );
+ 
+                         createFillAndStroke( aPoly,

Modified: branches/sled-10-sp1-ooo-build-2-4/patches/src680/apply
==============================================================================
--- branches/sled-10-sp1-ooo-build-2-4/patches/src680/apply	(original)
+++ branches/sled-10-sp1-ooo-build-2-4/patches/src680/apply	Tue Jun  3 10:49:22 2008
@@ -2070,6 +2070,7 @@
 vcl-grey-alpha-unix-sal-bitmap.diff, rodo
 cairocanvas-alpha-pixmap-rewrite.diff, rodo
 emf+-multipart-objects.diff, rodo
+emf+-embedded-mf-image-and-roundcorners-fix.diff, rodo
 
 [ OxygenOfficeDefaultSettings ]
 # Always enable extended tips



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