summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKris De Gussem <kris.degussem@gmail.com>2012-04-20 19:11:42 +0000
committerKris <Kris.De.Gussem@hotmail.com>2012-04-20 19:11:42 +0000
commit319be62b08d35174e72ac2b3bd7a53a99ee69102 (patch)
treedc709cb0710aa80336faba3f201892a4debeccdd /src
parentDocumentation. zh_TW translations update, and new K&M reference translation. (diff)
downloadinkscape-319be62b08d35174e72ac2b3bd7a53a99ee69102.tar.gz
inkscape-319be62b08d35174e72ac2b3bd7a53a99ee69102.zip
Memory leak fix. (Bug #986271) Code supplied by David Mathog.
(bzr r11268)
Diffstat (limited to 'src')
-rw-r--r--src/extension/internal/emf-win32-print.cpp21
-rw-r--r--src/extension/internal/emf-win32-print.h8
2 files changed, 23 insertions, 6 deletions
diff --git a/src/extension/internal/emf-win32-print.cpp b/src/extension/internal/emf-win32-print.cpp
index d5e44e702..a0ef960ac 100644
--- a/src/extension/internal/emf-win32-print.cpp
+++ b/src/extension/internal/emf-win32-print.cpp
@@ -543,7 +543,7 @@ bool PrintEmfWin32::print_simple_shape(Geom::PathVector const &pathv, const Geom
/**
* For all Subpaths in the <path>
- */
+ */
for (Geom::PathVector::const_iterator pit = pv.begin(); pit != pv.end(); ++pit)
{
using Geom::X;
@@ -553,7 +553,7 @@ bool PrintEmfWin32::print_simple_shape(Geom::PathVector const &pathv, const Geom
p0[X] = (p0[X] * IN_PER_PX * dwDPI);
p0[Y] = (p0[Y] * IN_PER_PX * dwDPI);
-
+
LONG const x0 = (LONG) round(p0[X]);
LONG const y0 = (LONG) round(rc.bottom-p0[Y]);
@@ -715,7 +715,7 @@ unsigned int PrintEmfWin32::print_pathv(Geom::PathVector const &pathv, const Geo
/**
* For all Subpaths in the <path>
- */
+ */
for (Geom::PathVector::const_iterator pit = pv.begin(); pit != pv.end(); ++pit)
{
using Geom::X;
@@ -725,7 +725,7 @@ unsigned int PrintEmfWin32::print_pathv(Geom::PathVector const &pathv, const Geo
p0[X] = (p0[X] * IN_PER_PX * dwDPI);
p0[Y] = (p0[Y] * IN_PER_PX * dwDPI);
-
+
LONG const x0 = (LONG) round(p0[X]);
LONG const y0 = (LONG) round(rc.bottom-p0[Y]);
@@ -818,7 +818,7 @@ unsigned int PrintEmfWin32::text(Inkscape::Extension::Print * /*mod*/, char cons
HFONT hfont = NULL;
Geom::Affine tf = m_tr_stack.top();
- double rot = 1800.0*std::atan2(tf[1], tf[0])/M_PI; // 0.1 degree rotation
+ double rot = 1800.0*std::atan2(tf[1], tf[0])/M_PI; // 0.1 degree rotation
#ifdef USE_PANGO_WIN32
/*
@@ -920,6 +920,17 @@ void PrintEmfWin32::init (void)
return;
}
+unsigned int PrintEmfWin32::image(Inkscape::Extension::Print * /* module */, /** not used */
+ unsigned char *px, /** array of pixel values, Gdk::Pixbuf bitmap format */
+ unsigned int /*w*/, /** width of bitmap */
+ unsigned int /*h*/, /** height of bitmap */
+ unsigned int /*rs*/, /** row stride (normally w*4) */
+ Geom::Affine const & /*tf_ignore*/, /** WRONG affine transform, use the one from m_tr_stack */
+ SPStyle const * /*style*/) /** provides indirect link to image object */
+{
+ free(px);
+ return 0;
+}
} /* namespace Internal */
} /* namespace Extension */
diff --git a/src/extension/internal/emf-win32-print.h b/src/extension/internal/emf-win32-print.h
index 71ce5d6d0..e7bd08477 100644
--- a/src/extension/internal/emf-win32-print.h
+++ b/src/extension/internal/emf-win32-print.h
@@ -50,6 +50,13 @@ class PrintEmfWin32 : public Inkscape::Extension::Implementation::Implementation
unsigned int print_pathv (Geom::PathVector const &pathv, const Geom::Affine &transform);
bool print_simple_shape (Geom::PathVector const &pathv, const Geom::Affine &transform);
+ unsigned int image(Inkscape::Extension::Print * /* module */, /** not used */
+ unsigned char *px, /** array of pixel values, Gdk::Pixbuf bitmap format */
+ unsigned int w, /** width of bitmap */
+ unsigned int h, /** height of bitmap */
+ unsigned int rs, /** row stride (normally w*4) */
+ Geom::Affine const &tf_ignore, /** WRONG affine transform, use the one from m_tr_stack */
+ SPStyle const *style); /** provides indirect link to image object */
public:
PrintEmfWin32 (void);
@@ -80,7 +87,6 @@ public:
bool textToPath (Inkscape::Extension::Print * ext);
static void init (void);
-
protected:
int create_brush(SPStyle const *style);