Hi,

any chance to get an ok for calligra (and inkscape)? (Diffs for both
quoted below)

They are the last remaining blockers for a poppler update.

Ciao,
        Kili

On Wed, Nov 06, 2019 at 07:10:53PM +0100, Matthias Kilian wrote:
> unbreak the build with poppler-0.82.0.
> 
> This can go in *after* the poppler update (because I'm too lazy add
> #ifdefs).
> 
> ok?
> 
> Ciao,
>       Kili
> 
> Index: patches/patch-filters_karbon_pdf_SvgOutputDev_cpp
> ===================================================================
> RCS file: 
> /cvs/ports/editors/calligra/patches/patch-filters_karbon_pdf_SvgOutputDev_cpp,v
> retrieving revision 1.1
> diff -u -p -r1.1 patch-filters_karbon_pdf_SvgOutputDev_cpp
> --- patches/patch-filters_karbon_pdf_SvgOutputDev_cpp 17 Feb 2019 20:38:20 
> -0000      1.1
> +++ patches/patch-filters_karbon_pdf_SvgOutputDev_cpp 6 Nov 2019 18:08:04 
> -0000
> @@ -7,6 +7,8 @@ https://cgit.kde.org/calligra.git/commit
>  https://cgit.kde.org/calligra.git/commit/?id=05a65f9
>  https://cgit.kde.org/calligra.git/commit/?id=3a65c7f
>  
> +and with poppler-0.82
> +
>  Index: filters/karbon/pdf/SvgOutputDev.cpp
>  --- filters/karbon/pdf/SvgOutputDev.cpp.orig
>  +++ filters/karbon/pdf/SvgOutputDev.cpp
> @@ -78,7 +80,16 @@ Index: filters/karbon/pdf/SvgOutputDev.c
>   {
>       return QString("matrix(%1 %2 %3 %4 %5 %6)")
>              .arg(matrix[0]).arg(matrix[1])
> -@@ -402,7 +402,7 @@ void SvgOutputDev::drawString(GfxState * state, GooStr
> +@@ -387,7 +387,7 @@ QString SvgOutputDev::printStroke()
> +     return stroke;
> + }
> + 
> +-void SvgOutputDev::drawString(GfxState * state, GooString * s)
> ++void SvgOutputDev::drawString(GfxState * state, const GooString * s)
> + {
> +     int render = state->getRender();
> +     // check for invisible text -- this is used by Acrobat Capture
> +@@ -402,10 +402,10 @@ void SvgOutputDev::drawString(GfxState * state, GooStr
>   
>       QString str;
>   
> @@ -86,7 +97,11 @@ Index: filters/karbon/pdf/SvgOutputDev.c
>  +    const char * p = s->c_str();
>       int len = s->getLength();
>       CharCode code;
> -     Unicode *u = nullptr;
> +-    Unicode *u = nullptr;
> ++    const Unicode *u = nullptr;
> +     int uLen;
> +     double dx, dy, originX, originY;
> +     while (len > 0) {
>  @@ -429,7 +429,7 @@ void SvgOutputDev::drawString(GfxState * state, GooStr
>       double x = state->getCurX();
>       double y = state->getCurY();
> @@ -117,7 +132,7 @@ Index: filters/karbon/pdf/SvgOutputDev.c
>   void SvgOutputDev::drawImage(GfxState *state, Object */*ref*/, Stream *str,
>                                int width, int height, GfxImageColorMap 
> *colorMap,
>  -                             int *maskColors, GBool /*inlineImg*/)
> -+                             int *maskColors, bool /*inlineImg*/)
> ++                             const int *maskColors, bool /*inlineImg*/)
>   {
>       ImageStream * imgStr = new ImageStream(str, width, 
> colorMap->getNumPixelComps(), colorMap->getBits());
>       imgStr->reset();
> @@ -153,7 +168,7 @@ Index: filters/karbon/pdf/SvgOutputDev.c
>   void SvgOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
>                                int width, int height, GfxImageColorMap 
> *colorMap,
>  -                             GBool /*interpolate*/, int *maskColors, GBool 
> inlineImg)
> -+                             bool /*interpolate*/, int *maskColors, bool 
> inlineImg)
> ++                             bool /*interpolate*/, const int *maskColors, 
> bool inlineImg)
>   {
>       drawImage(state, ref, str, width, height, colorMap, maskColors, 
> inlineImg);
>   }
> Index: patches/patch-filters_karbon_pdf_SvgOutputDev_h
> ===================================================================
> RCS file: 
> /cvs/ports/editors/calligra/patches/patch-filters_karbon_pdf_SvgOutputDev_h,v
> retrieving revision 1.1
> diff -u -p -r1.1 patch-filters_karbon_pdf_SvgOutputDev_h
> --- patches/patch-filters_karbon_pdf_SvgOutputDev_h   17 Feb 2019 20:38:20 
> -0000      1.1
> +++ patches/patch-filters_karbon_pdf_SvgOutputDev_h   6 Nov 2019 18:08:04 
> -0000
> @@ -4,6 +4,8 @@ Fix build with poppler 0.73
>  https://cgit.kde.org/calligra.git/commit/?id=a615718
>  https://cgit.kde.org/calligra.git/commit/?id=ab9cb33
>  
> +and with poppler-0.82
> +
>  Index: filters/karbon/pdf/SvgOutputDev.h
>  --- filters/karbon/pdf/SvgOutputDev.h.orig
>  +++ filters/karbon/pdf/SvgOutputDev.h
> @@ -23,16 +25,22 @@ Index: filters/karbon/pdf/SvgOutputDev.h
>       virtual void startPage(int pageNum, GfxState *state, XRef *xref);
>       virtual void endPage();
>   
> -@@ -63,10 +63,10 @@ class SvgOutputDev : public OutputDev (public)
> +@@ -58,15 +58,15 @@ class SvgOutputDev : public OutputDev (public)
> +     virtual void eoFill(GfxState *state);
> + 
> +     // text
> +-    virtual void drawString(GfxState * state, GooString * s);
> ++    virtual void drawString(GfxState * state, const GooString * s);
> + 
>       // images
>       virtual void drawImage(GfxState *state, Object *ref, Stream *str,
>                              int width, int height, GfxImageColorMap 
> *colorMap,
>  -                           int *maskColors, GBool inlineImg);
> -+                           int *maskColors, bool inlineImg);
> ++                           const int *maskColors, bool inlineImg);
>       virtual void drawImage(GfxState *state, Object *ref, Stream *str,
>                              int width, int height, GfxImageColorMap 
> *colorMap,
>  -                           GBool interpolate, int *maskColors, GBool 
> inlineImg);
> -+                           bool interpolate, int *maskColors, bool 
> inlineImg);
> ++                           bool interpolate, const int *maskColors, bool 
> inlineImg);
>   
>       // styles
>       virtual void updateAll(GfxState *state);

On Thu, Nov 07, 2019 at 11:55:52PM +0100, Matthias Kilian wrote:
> sprinkle some consts to let inkscape build with poppler-0.82.0
> 
> To be committed after the poppler update. (It *should* be fine with
> older poppler versions, but i'm still unfamilar with C++)
> 
> ok?
> 
> Ciao,
>       Kili
> 
> Index: patches/patch-src_extension_internal_pdfinput_pdf-parser_cpp
> ===================================================================
> RCS file: 
> /cvs/ports/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_pdf-parser_cpp,v
> retrieving revision 1.15
> diff -u -p -r1.15 patch-src_extension_internal_pdfinput_pdf-parser_cpp
> --- patches/patch-src_extension_internal_pdfinput_pdf-parser_cpp      6 May 
> 2019 21:22:16 -0000       1.15
> +++ patches/patch-src_extension_internal_pdfinput_pdf-parser_cpp      7 Nov 
> 2019 22:41:05 -0000
> @@ -2,6 +2,8 @@ $OpenBSD: patch-src_extension_internal_p
>  
>  Fix build with poppler-0.76. From archlinux.
>  
> +And with poppler-0.82.0.
> +
>  Index: src/extension/internal/pdfinput/pdf-parser.cpp
>  --- src/extension/internal/pdfinput/pdf-parser.cpp.orig
>  +++ src/extension/internal/pdfinput/pdf-parser.cpp
> @@ -14,3 +16,12 @@ Index: src/extension/internal/pdfinput/p
>     go(topLevel);
>     delete parser;
>     parser = NULL;
> +@@ -2414,7 +2414,7 @@ void PdfParser::doShowText(GooString *s) {
> +   int wMode;
> +   double riseX, riseY;
> +   CharCode code;
> +-  Unicode *u = NULL;
> ++  const Unicode *u = NULL;
> +   double x, y, dx, dy, tdx, tdy;
> +   double originX, originY, tOriginX, tOriginY;
> +   double oldCTM[6], newCTM[6];
> Index: patches/patch-src_extension_internal_pdfinput_svg-builder_cpp
> ===================================================================
> RCS file: patches/patch-src_extension_internal_pdfinput_svg-builder_cpp
> diff -N patches/patch-src_extension_internal_pdfinput_svg-builder_cpp
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-src_extension_internal_pdfinput_svg-builder_cpp     7 Nov 
> 2019 22:41:05 -0000
> @@ -0,0 +1,16 @@
> +$OpenBSD$
> +
> +Fix build against poppler-0.82.0.
> +
> +Index: src/extension/internal/pdfinput/svg-builder.cpp
> +--- src/extension/internal/pdfinput/svg-builder.cpp.orig
> ++++ src/extension/internal/pdfinput/svg-builder.cpp
> +@@ -1379,7 +1379,7 @@ void SvgBuilder::beginString(GfxState *state) {
> + void SvgBuilder::addChar(GfxState *state, double x, double y,
> +                          double dx, double dy,
> +                          double originX, double originY,
> +-                         CharCode /*code*/, int /*nBytes*/, Unicode *u, int 
> uLen) {
> ++                         CharCode /*code*/, int /*nBytes*/, const Unicode 
> *u, int uLen) {
> + 
> + 
> +     bool is_space = ( uLen == 1 && u[0] == 32 );
> Index: patches/patch-src_extension_internal_pdfinput_svg-builder_h
> ===================================================================
> RCS file: patches/patch-src_extension_internal_pdfinput_svg-builder_h
> diff -N patches/patch-src_extension_internal_pdfinput_svg-builder_h
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-src_extension_internal_pdfinput_svg-builder_h       7 Nov 
> 2019 22:41:05 -0000
> @@ -0,0 +1,16 @@
> +$OpenBSD$
> +
> +Fix build against poppler-0.82.0.
> +
> +Index: src/extension/internal/pdfinput/svg-builder.h
> +--- src/extension/internal/pdfinput/svg-builder.h.orig
> ++++ src/extension/internal/pdfinput/svg-builder.h
> +@@ -141,7 +141,7 @@ class SvgBuilder { (public)
> +     void addChar(GfxState *state, double x, double y,
> +                  double dx, double dy,
> +                  double originX, double originY,
> +-                 CharCode code, int nBytes, Unicode *u, int uLen);
> ++                 CharCode code, int nBytes, const Unicode *u, int uLen);
> +     void beginTextObject(GfxState *state);
> +     void endTextObject(GfxState *state);
> + 

Reply via email to