[ooo-build-commit] patches/emf+
Tor Lillqvist
tml at kemper.freedesktop.org
Tue Dec 22 07:18:56 PST 2009
patches/emf+/emf+-driver-string.diff | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
New commits:
commit ef40092687f3b9dbf59b791915b44e16d1cd5bf7
Author: Tor Lillqvist <tml at hemulen.(none)>
Date: Tue Dec 22 17:12:07 2009 +0200
Make it compile with MSVC, avoid potential huge stack allocations
* patches/emf+/emf+-driver-string.diff:
diff --git a/patches/emf+/emf+-driver-string.diff b/patches/emf+/emf+-driver-string.diff
index 295ab75..e2d362f 100644
--- a/patches/emf+/emf+-driver-string.diff
+++ b/patches/emf+/emf+-driver-string.diff
@@ -2,11 +2,12 @@ diff --git build/ooo310-m16/cppcanvas/source/mtfrenderer/emfplus.cxx build/ooo31
index a35dbef..3194009 100644
--- cppcanvas/source/mtfrenderer/emfplus.cxx
+++ cppcanvas/source/mtfrenderer/emfplus.cxx
-@@ -12,6 +12,7 @@
+@@ -12,6 +12,8 @@
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <vcl/canvastools.hxx>
+#include <rtl/ustring.hxx>
++#include <sal/alloca.h>
#include <com/sun/star/rendering/XCanvas.hpp>
#include <com/sun/star/rendering/TexturingMode.hpp>
@@ -44,7 +45,7 @@ index a35dbef..3194009 100644
+ EMFP_DEBUG (printf ("EMF+\tflags: 0x%08x reserved: 0x%08x length: 0x%08x\n", fontFlags, reserved, length));
+
+ if( length > 0 && length < 0x4000 ) {
-+ sal_Unicode chars[ length ];
++ sal_Unicode *chars = (sal_Unicode *) alloca( sizeof( sal_Unicode ) * length );
+
+ for( int i = 0; i < length; i++ )
+ s >> chars[ i ];
@@ -114,7 +115,7 @@ index a35dbef..3194009 100644
default:
EMFP_DEBUG (printf ("EMF+\tObject unhandled flags: 0x%04x\n", flags & 0xff00));
break;
-@@ -1411,10 +1460,89 @@ namespace cppcanvas
+@@ -1411,10 +1460,93 @@ namespace cppcanvas
EMFP_DEBUG (printf ("EMF+\tTODO\n"));
break;
}
@@ -135,9 +136,9 @@ index a35dbef..3194009 100644
+ EMFP_DEBUG (printf ("EMF+\tglyphs: %d\n", glyphsCount));
+
+ if( ( optionFlags & 1 ) && glyphsCount > 0 ) {
-+ sal_uInt16 chars[ glyphsCount ];
-+ float charsPosX[ glyphsCount ];
-+ float charsPosY[ glyphsCount ];
++ sal_uInt16 *chars = new sal_uInt16[glyphsCount];
++ float *charsPosX = new float[glyphsCount];
++ float *charsPosY = new float[glyphsCount];
+
+ for( int i=0; i<glyphsCount; i++) {
+ rMF >> chars[i];
@@ -197,6 +198,10 @@ index a35dbef..3194009 100644
+
+ rFactoryParms.mrCurrActionIndex += pTextAction->getActionCount()-1;
+ }
++
++ delete[] chars;
++ delete[] charsPosX;
++ delete[] charsPosY;
+ } else {
+ EMFP_DEBUG (printf ("EMF+\tTODO: fonts (non-unicode glyphs chars)\n"));
+ }
More information about the ooo-build-commit
mailing list