summaryrefslogtreecommitdiff
path: root/editors/abiword/patches
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2011-02-01 10:48:14 +0000
committerwiz <wiz@pkgsrc.org>2011-02-01 10:48:14 +0000
commitda66250d83187396f6892c9ae735aad0bdaebda0 (patch)
tree87c19945ed1f9194f26c23698b9f9ce8ae6b7cf8 /editors/abiword/patches
parentd21feee9e38967a6c80a67fede0e610083179e42 (diff)
downloadpkgsrc-da66250d83187396f6892c9ae735aad0bdaebda0.tar.gz
Fix build of abiword-plugins with png-1.5.
Diffstat (limited to 'editors/abiword/patches')
-rw-r--r--editors/abiword/patches/patch-plugins_bmp_xp_ie__impGraphic__BMP.cpp45
-rw-r--r--editors/abiword/patches/patch-plugins_garble_xp_abiword-garble-png.cpp15
2 files changed, 60 insertions, 0 deletions
diff --git a/editors/abiword/patches/patch-plugins_bmp_xp_ie__impGraphic__BMP.cpp b/editors/abiword/patches/patch-plugins_bmp_xp_ie__impGraphic__BMP.cpp
new file mode 100644
index 00000000000..0efb05dc4f5
--- /dev/null
+++ b/editors/abiword/patches/patch-plugins_bmp_xp_ie__impGraphic__BMP.cpp
@@ -0,0 +1,45 @@
+$NetBSD: patch-plugins_bmp_xp_ie__impGraphic__BMP.cpp,v 1.1 2011/02/01 10:48:15 wiz Exp $
+
+Fix build with png-1.5.
+
+--- plugins/bmp/xp/ie_impGraphic_BMP.cpp.orig 2009-06-25 04:02:06.000000000 +0000
++++ plugins/bmp/xp/ie_impGraphic_BMP.cpp
+@@ -191,7 +191,10 @@ UT_Error IE_ImpGraphic_BMP::_convertGrap
+
+ /* Clean Up Memory Used */
+
+- FREEP(m_pPNGInfo->palette);
++ png_colorp palette;
++ int num_palette;
++ png_get_PLTE( m_pPNG, m_pPNGInfo, &palette, &num_palette );
++ FREEP(palette);
+ DELETEP(pBB);
+ png_destroy_write_struct(&m_pPNG, &m_pPNGInfo);
+
+@@ -313,7 +316,7 @@ UT_Error IE_ImpGraphic_BMP::Initialize_P
+ * the normal method of doing things with libpng). REQUIRED unless you
+ * set up your own error handlers in the png_create_read_struct() earlier.
+ */
+- if (setjmp(m_pPNG->jmpbuf))
++ if (setjmp(png_jmpbuf(m_pPNG)))
+ {
+ /* Free all of the memory associated with the png_ptr and info_ptr */
+ png_destroy_write_struct(&m_pPNG, &m_pPNGInfo);
+@@ -332,7 +335,7 @@ UT_Error IE_ImpGraphic_BMP::Initialize_P
+ UT_Error IE_ImpGraphic_BMP::Convert_BMP_Pallet(UT_ByteBuf* pBB)
+ {
+ /* Reset error handling for libpng */
+- if (setjmp(m_pPNG->jmpbuf))
++ if (setjmp(png_jmpbuf(m_pPNG)))
+ {
+ png_destroy_write_struct(&m_pPNG, &m_pPNGInfo);
+ return UT_ERROR;
+@@ -372,7 +375,7 @@ UT_Error IE_ImpGraphic_BMP::Initialize_P
+ UT_Error IE_ImpGraphic_BMP::Convert_BMP(UT_ByteBuf* pBB)
+ {
+ /* Reset error handling for libpng */
+- if (setjmp(m_pPNG->jmpbuf))
++ if (setjmp(png_jmpbuf(m_pPNG)))
+ {
+ png_destroy_write_struct(&m_pPNG, &m_pPNGInfo);
+ return UT_ERROR;
diff --git a/editors/abiword/patches/patch-plugins_garble_xp_abiword-garble-png.cpp b/editors/abiword/patches/patch-plugins_garble_xp_abiword-garble-png.cpp
new file mode 100644
index 00000000000..fcaa801b8a9
--- /dev/null
+++ b/editors/abiword/patches/patch-plugins_garble_xp_abiword-garble-png.cpp
@@ -0,0 +1,15 @@
+$NetBSD: patch-plugins_garble_xp_abiword-garble-png.cpp,v 1.1 2011/02/01 10:48:15 wiz Exp $
+
+Fix build with png-1.5.
+
+--- plugins/garble/xp/abiword-garble-png.cpp.orig 2009-09-05 15:34:44.000000000 +0000
++++ plugins/garble/xp/abiword-garble-png.cpp
+@@ -79,7 +79,7 @@ bool abiword_document::garble_png( void*
+ png_set_strip_alpha( png_ptr );
+ png_set_interlace_handling( png_ptr );
+ png_set_bgr( png_ptr );
+- rowbytes = info_ptr->rowbytes;
++ rowbytes = png_get_rowbytes( png_ptr, info_ptr );
+ png_destroy_read_struct( &png_ptr, &info_ptr, NULL );
+ }
+