diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/extension/internal/emf-win32-print.cpp | 12 | ||||
| -rw-r--r-- | src/extension/internal/emf-win32-print.h | 7 | ||||
| -rw-r--r-- | src/preferences-test.h | 32 | ||||
| -rw-r--r-- | src/sp-image.cpp | 1 |
4 files changed, 17 insertions, 35 deletions
diff --git a/src/extension/internal/emf-win32-print.cpp b/src/extension/internal/emf-win32-print.cpp index 621954f68..92f564078 100644 --- a/src/extension/internal/emf-win32-print.cpp +++ b/src/extension/internal/emf-win32-print.cpp @@ -910,18 +910,6 @@ 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 */ } /* namespace Inkscape */ diff --git a/src/extension/internal/emf-win32-print.h b/src/extension/internal/emf-win32-print.h index e7bd08477..bbeeeb051 100644 --- a/src/extension/internal/emf-win32-print.h +++ b/src/extension/internal/emf-win32-print.h @@ -50,13 +50,6 @@ 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); diff --git a/src/preferences-test.h b/src/preferences-test.h index 8e8ddb65b..92cb14247 100644 --- a/src/preferences-test.h +++ b/src/preferences-test.h @@ -18,7 +18,7 @@ public: TestObserver(Glib::ustring const &path) : Inkscape::Preferences::Observer(path), value(0) {} - + virtual void notify(Inkscape::Preferences::Entry const &val) { value = val.getInt(); @@ -35,29 +35,29 @@ public: prefs = NULL; Inkscape::Preferences::unload(); } - + void testStartingState() { - TS_ASSERT(prefs != NULL); - TS_ASSERT_EQUALS(prefs->isWritable(), false); + TS_ASSERT_DIFFERS(prefs, static_cast<void*>(0)); + TS_ASSERT_EQUALS(prefs->isWritable(), true); } - + void testOverwrite() { prefs->setInt("/test/intvalue", 123); prefs->setInt("/test/intvalue", 321); TS_ASSERT_EQUALS(prefs->getInt("/test/intvalue"), 321); } - + void testDefaultReturn() { TS_ASSERT_EQUALS(prefs->getInt("/this/path/does/not/exist", 123), 123); } - + void testLimitedReturn() { prefs->setInt("/test/intvalue", 1000); - + // simple case TS_ASSERT_EQUALS(prefs->getIntLimited("/test/intvalue", 123, 0, 500), 123); // the below may seem quirky but this behaviour is intended @@ -66,7 +66,7 @@ public: TS_ASSERT_EQUALS(prefs->getIntLimited("/test/intvalue", 123, 0, 1000), 1000); TS_ASSERT_EQUALS(prefs->getIntLimited("/test/intvalue", 123, 1000, 5000), 1000); } - + void testKeyObserverNotification() { Glib::ustring const path = "/some/random/path"; @@ -74,18 +74,18 @@ public: obs.value = 1; prefs->setInt(path, 5); TS_ASSERT_EQUALS(obs.value, 1); // no notifications sent before adding - + prefs->addObserver(obs); prefs->setInt(path, 10); TS_ASSERT_EQUALS(obs.value, 10); prefs->setInt("/some/other/random/path", 10); TS_ASSERT_EQUALS(obs.value, 10); // value should not change - + prefs->removeObserver(obs); prefs->setInt(path, 15); TS_ASSERT_EQUALS(obs.value, 10); // no notifications sent after removal } - + void testEntryObserverNotification() { Glib::ustring const path = "/some/random/path"; @@ -93,11 +93,11 @@ public: obs.value = 1; prefs->setInt(path, 5); TS_ASSERT_EQUALS(obs.value, 1); // no notifications sent before adding - + prefs->addObserver(obs); prefs->setInt(path, 10); TS_ASSERT_EQUALS(obs.value, 10); - + // test that filtering works properly prefs->setInt("/some/random/value", 1234); TS_ASSERT_EQUALS(obs.value, 10); @@ -105,12 +105,12 @@ public: TS_ASSERT_EQUALS(obs.value, 10); prefs->setInt("/some/random/path2", 1234); TS_ASSERT_EQUALS(obs.value, 10); - + prefs->removeObserver(obs); prefs->setInt(path, 15); TS_ASSERT_EQUALS(obs.value, 10); // no notifications sent after removal } - + void testPreferencesEntryMethods() { prefs->setInt("/test/prefentry", 100); diff --git a/src/sp-image.cpp b/src/sp-image.cpp index d60fbc181..10d294d5c 100644 --- a/src/sp-image.cpp +++ b/src/sp-image.cpp @@ -1056,6 +1056,7 @@ static void sp_image_print( SPItem *item, SPPrintContext *ctx ) t = ti * t; sp_print_image_R8G8B8A8_N(ctx, px + trimx*pixskip + trimy*rs, trimwidth, trimheight, rs, t, item->style); } + free(px); // else big memory leak on each image print! } } |
