diff --git a/3rdparty/poppler/git/CairoFontEngine.cc b/3rdparty/poppler/git/CairoFontEngine.cc index 45ef764..3a479e4 100644 --- a/3rdparty/poppler/git/CairoFontEngine.cc +++ b/3rdparty/poppler/git/CairoFontEngine.cc @@ -17,7 +17,7 @@ // Copyright (C) 2005-2007 Jeff Muizelaar // Copyright (C) 2005, 2006 Kristian Høgsberg // Copyright (C) 2005 Martin Kretzschmar -// Copyright (C) 2005, 2009, 2012, 2013, 2015, 2017, 2018 Albert Astals Cid +// Copyright (C) 2005, 2009, 2012, 2013, 2015, 2017-2019 Albert Astals Cid // Copyright (C) 2006, 2007, 2010, 2011 Carlos Garcia Campos // Copyright (C) 2007 Koji Otani // Copyright (C) 2008, 2009 Chris Wilson @@ -80,7 +80,7 @@ CairoFont::~CairoFont() { bool CairoFont::matches(Ref &other, bool printingA) { - return (other.num == ref.num && other.gen == ref.gen); + return (other == ref); } cairo_font_face_t * @@ -783,7 +783,7 @@ CairoType3Font::~CairoType3Font() { } bool CairoType3Font::matches(Ref &other, bool printingA) { - return (other.num == ref.num && other.gen == ref.gen && printing == printingA); + return (other == ref && printing == printingA); } diff --git a/3rdparty/poppler/git/CairoRescaleBox.cc b/3rdparty/poppler/git/CairoRescaleBox.cc index 9755438..2c0e1ed 100644 --- a/3rdparty/poppler/git/CairoRescaleBox.cc +++ b/3rdparty/poppler/git/CairoRescaleBox.cc @@ -34,6 +34,7 @@ // Copyright (C) 2012, 2017 Adrian Johnson // Copyright (C) 2018 Adam Reichold // Copyright (C) 2019 Albert Astals Cid +// Copyright (C) 2019 Marek Kasik // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git @@ -61,7 +62,7 @@ static void downsample_row_box_filter ( int start, int width, - uint32_t *src, uint32_t *dest, + uint32_t *src, uint32_t *src_limit, uint32_t *dest, int coverage[], int pixel_coverage) { /* we need an array of the pixel contribution of each destination pixel on the boundaries. @@ -89,13 +90,13 @@ static void downsample_row_box_filter ( /* skip to start */ /* XXX: it might be possible to do this directly instead of iteratively, however * the iterative solution is simple */ - while (x < start) + while (x < start && src < src_limit) { int box = 1 << FIXED_SHIFT; int start_coverage = coverage[x]; box -= start_coverage; src++; - while (box >= pixel_coverage) + while (box >= pixel_coverage && src < src_limit) { src++; box -= pixel_coverage; @@ -103,7 +104,7 @@ static void downsample_row_box_filter ( x++; } - while (x < start + width) + while (x < start + width && src < src_limit) { uint32_t a = 0; uint32_t r = 0; @@ -120,7 +121,7 @@ static void downsample_row_box_filter ( x++; box -= start_coverage; - while (box >= pixel_coverage) + while (box >= pixel_coverage && src < src_limit) { a += ((*src >> 24) & 0xff) * pixel_coverage; r += ((*src >> 16) & 0xff) * pixel_coverage; @@ -134,7 +135,7 @@ static void downsample_row_box_filter ( /* multiply by whatever is leftover * this ensures that we don't bias down. * i.e. start_coverage + n*pixel_coverage + box == 1 << 24 */ - if (box > 0) + if (box > 0 && src < src_limit) { a += ((*src >> 24) & 0xff) * box; r += ((*src >> 16) & 0xff) * box; @@ -226,10 +227,10 @@ static int compute_coverage (int coverage[], int src_length, int dest_length) /* I have a proof of this, which this margin is too narrow to contain */ for (i=0; i= pixel_coverage_y) { getRow(src_y, scanline); - downsample_row_box_filter (start_column, width, scanline, temp_buf + width * columns, x_coverage, pixel_coverage_x); + downsample_row_box_filter (start_column, width, scanline, scanline + orig_width, temp_buf + width * columns, x_coverage, pixel_coverage_x); columns++; src_y++; box -= pixel_coverage_y; @@ -354,7 +355,7 @@ bool CairoRescaleBox::downScaleImage(unsigned orig_width, unsigned orig_height, if (box > 0) { getRow(src_y, scanline); - downsample_row_box_filter (start_column, width, scanline, temp_buf + width * columns, x_coverage, pixel_coverage_x); + downsample_row_box_filter (start_column, width, scanline, scanline + orig_width, temp_buf + width * columns, x_coverage, pixel_coverage_x); columns++; } diff --git a/src/HTMLRenderer/HTMLRenderer.h b/src/HTMLRenderer/HTMLRenderer.h index 329f868..a1195e8 100644 --- a/src/HTMLRenderer/HTMLRenderer.h +++ b/src/HTMLRenderer/HTMLRenderer.h @@ -16,6 +16,7 @@ #include #include #include +#include /************ from goo/gtypes.h ***************/ // #include @@ -197,7 +198,7 @@ protected: void post_process(void); void process_outline(void); - void process_outline_items(const GooList * items); + void process_outline_items(const std::vector * items); void process_form(std::ofstream & out); diff --git a/src/HTMLRenderer/link.cc b/src/HTMLRenderer/link.cc index 9f3a62d..842b6de 100644 --- a/src/HTMLRenderer/link.cc +++ b/src/HTMLRenderer/link.cc @@ -40,7 +40,7 @@ static string get_linkdest_detail_str(LinkDest * dest, Catalog * catalog, int & if(dest->isPageRef()) { auto pageref = dest->getPageRef(); - pageno = catalog->findPage(pageref.num, pageref.gen); + pageno = catalog->findPage(pageref); } else { diff --git a/src/HTMLRenderer/outline.cc b/src/HTMLRenderer/outline.cc index 205eac7..2dac02c 100644 --- a/src/HTMLRenderer/outline.cc +++ b/src/HTMLRenderer/outline.cc @@ -9,9 +9,6 @@ #include -#include -#include - #include "HTMLRenderer.h" #include "util/namespace.h" #include "util/encoding.h" @@ -21,16 +18,16 @@ namespace pdf2htmlEX { using std::ostream; -void HTMLRenderer::process_outline_items(const GooList * items) +void HTMLRenderer::process_outline_items(const std::vector * items) { - if((!items) || (items->getLength() == 0)) + if((!items) || (items->size() == 0)) return; f_outline.fs << "
    "; - for(int i = 0; i < items->getLength(); ++i) + for(std::size_t i = 0; i < items->size(); ++i) { - OutlineItem * item = (OutlineItem*)(items->get(i)); + OutlineItem * item = items->at(i); string detail; string dest = get_linkaction_str(item->getAction(), detail);