From 5ac2aa25acb855e31d1369c63a1adaf5e4687ae4 Mon Sep 17 00:00:00 2001 From: CentOS Buildsys Date: Feb 14 2014 16:13:51 +0000 Subject: import poppler-0.22.5-6.el7.src.rpm --- diff --git a/SOURCES/poppler-0.22.5-rotated-words-selection.patch b/SOURCES/poppler-0.22.5-rotated-words-selection.patch new file mode 100644 index 0000000..c4961b6 --- /dev/null +++ b/SOURCES/poppler-0.22.5-rotated-words-selection.patch @@ -0,0 +1,271 @@ +--- poppler-0.22.5/poppler/TextOutputDev.cc ++++ poppler-0.22.5/poppler/TextOutputDev.cc +@@ -171,6 +171,12 @@ + // Max distance between edge of text and edge of link border + #define hyperlinkSlack 2 + ++// Returns whether x is between a and b or equal to a or b. ++// a and b don't need to be sorted. ++#define XBetweenAB(x,a,b) (!(((x) > (a) && (x) > (b)) || \ ++ ((x) < (a) && (x) < (b))) ? \ ++ gTrue : gFalse) ++ + //------------------------------------------------------------------------ + // TextUnderline + //------------------------------------------------------------------------ +@@ -4220,11 +4226,37 @@ void TextSelectionSizer::visitLine (Text + PDFRectangle *rect; + double x1, y1, x2, y2, margin; + +- margin = (line->yMax - line->yMin) / 8; +- x1 = line->edge[edge_begin]; +- y1 = line->yMin - margin; +- x2 = line->edge[edge_end]; +- y2 = line->yMax + margin; ++ switch (line->rot) { ++ default: ++ case 0: ++ margin = (line->yMax - line->yMin) / 8; ++ x1 = line->edge[edge_begin]; ++ x2 = line->edge[edge_end]; ++ y1 = line->yMin - margin; ++ y2 = line->yMax + margin; ++ break; ++ case 1: ++ margin = (line->xMax - line->xMin) / 8; ++ x1 = line->xMin - margin; ++ x2 = line->xMax + margin; ++ y1 = line->edge[edge_begin]; ++ y2 = line->edge[edge_end]; ++ break; ++ case 2: ++ margin = (line->yMax - line->yMin) / 8; ++ x1 = line->edge[edge_end]; ++ x2 = line->edge[edge_begin]; ++ y1 = line->yMin - margin; ++ y2 = line->yMax + margin; ++ break; ++ case 3: ++ margin = (line->xMax - line->xMin) / 8; ++ x1 = line->xMin - margin; ++ x2 = line->xMax + margin; ++ y1 = line->edge[edge_end]; ++ y2 = line->edge[edge_begin]; ++ break; ++ } + + rect = new PDFRectangle (floor (x1 * scale), + floor (y1 * scale), +@@ -4304,22 +4336,59 @@ void TextSelectionPainter::visitLine (Te + state->setFillColor(box_color); + out->updateFillColor(state); + +- margin = (line->yMax - line->yMin) / 8; +- x1 = floor (line->edge[edge_begin]); +- y1 = floor (line->yMin - margin); +- x2 = ceil (line->edge[edge_end]); +- y2 = ceil (line->yMax + margin); +- + state->getCTM (&ctm); +- ctm.transform(line->edge[edge_begin], line->yMin - margin, &x1, &y1); +- ctm.transform(line->edge[edge_end], line->yMax + margin, &x2, &y2); ++ ctm.invertTo (&ictm); + +- x1 = floor (x1); +- y1 = floor (y1); +- x2 = ceil (x2); +- y2 = ceil (y2); ++ switch (line->rot) { ++ case 0: ++ margin = (line->yMax - line->yMin) / 8; ++ x1 = line->edge[edge_begin]; ++ x2 = line->edge[edge_end]; ++ y1 = line->yMin - margin; ++ y2 = line->yMax + margin; ++ break; ++ case 1: ++ margin = (line->xMax - line->xMin) / 8; ++ x1 = line->xMin - margin; ++ x2 = line->xMax + margin; ++ y1 = line->edge[edge_begin]; ++ y2 = line->edge[edge_end]; ++ break; ++ case 2: ++ margin = (line->yMax - line->yMin) / 8; ++ x1 = line->edge[edge_end]; ++ x2 = line->edge[edge_begin]; ++ y1 = line->yMin - margin; ++ y2 = line->yMax + margin; ++ break; ++ case 3: ++ margin = (line->xMax - line->xMin) / 8; ++ x1 = line->xMin - margin; ++ x2 = line->xMax + margin; ++ y1 = line->edge[edge_end]; ++ y2 = line->edge[edge_begin]; ++ break; ++ } ++ ++ ctm.transform(x1, y1, &x1, &y1); ++ ctm.transform(x2, y2, &x2, &y2); ++ ++ if (x1 < x2) { ++ x1 = floor (x1); ++ x2 = ceil (x2); ++ } else { ++ x1 = ceil (x1); ++ x2 = floor (x2); ++ } ++ ++ if (y1 < y2) { ++ y1 = floor (y1); ++ y2 = ceil (y2); ++ } else { ++ y1 = ceil (y1); ++ y2 = floor (y2); ++ } + +- ctm.invertTo (&ictm); + ictm.transform(x1, y1, &x1, &y1); + ictm.transform(x2, y2, &x2, &y2); + +@@ -4376,17 +4445,27 @@ void TextWord::visitSelection(TextSelect + SelectionStyle style) + { + int i, begin, end; +- double mid; ++ double mid, s1, s2; ++ ++ if (rot == 0 || rot == 2) { ++ s1 = selection->x1; ++ s2 = selection->x2; ++ } else { ++ s1 = selection->y1; ++ s2 = selection->y2; ++ } + + begin = len; + end = 0; + for (i = 0; i < len; i++) { + mid = (edge[i] + edge[i + 1]) / 2; +- if (selection->x1 < mid || selection->x2 < mid) +- if (i < begin) +- begin = i; +- if (mid < selection->x1 || mid < selection->x2) +- end = i + 1; ++ if (XBetweenAB (mid, s1, s2)) ++ { ++ if (i < begin) ++ begin = i; ++ ++ end = i + 1; ++ } + } + + /* Skip empty selection. */ +@@ -4402,30 +4481,41 @@ void TextLine::visitSelection(TextSelect + TextWord *p, *begin, *end, *current; + int i, edge_begin, edge_end; + PDFRectangle child_selection; ++ double s1, s2, p_min, p_max; ++ ++ if (rot == 0 || rot == 2) { ++ s1 = selection->x1; ++ s2 = selection->x2; ++ } else { ++ s1 = selection->y1; ++ s2 = selection->y2; ++ } + + begin = NULL; + end = NULL; + current = NULL; + for (p = words; p != NULL; p = p->next) { ++ if (rot == 0 || rot == 2) { ++ p_min = p->xMin; ++ p_max = p->xMax; ++ } else { ++ p_min = p->yMin; ++ p_max = p->yMax; ++ } ++ + if (blk->page->primaryLR) { +- if ((selection->x1 < p->xMax) || +- (selection->x2 < p->xMax)) +- if (begin == NULL) +- begin = p; ++ if (((s1 < p_max) || (s2 < p_max)) && begin == NULL) ++ begin = p; + +- if (((selection->x1 > p->xMin) || +- (selection->x2 > p->xMin)) && (begin != NULL)) { ++ if (((s1 > p_min) || (s2 > p_min)) && begin != NULL) { + end = p->next; + current = p; + } + } else { +- if ((selection->x1 > p->xMin) || +- (selection->x2 > p->xMin)) +- if (begin == NULL) +- begin = p; ++ if (((s1 > p_min) || (s2 > p_min)) && begin == NULL) ++ begin = p; + +- if (((selection->x1 < p->xMax) || +- (selection->x2 < p->xMax)) && (begin != NULL)) { ++ if (((s1 < p_max) || (s2 < p_max)) && begin != NULL) { + end = p->next; + current = p; + } +@@ -4437,23 +4527,42 @@ void TextLine::visitSelection(TextSelect + + child_selection = *selection; + if (style == selectionStyleWord) { +- child_selection.x1 = begin ? begin->xMin : xMin; +- if (end && end->xMax != -1) { +- child_selection.x2 = current->xMax; ++ if (rot == 0 || rot == 2) { ++ child_selection.x1 = begin ? begin->xMin : xMin; ++ if (end && end->xMax != -1) { ++ child_selection.x2 = current->xMax; ++ } else { ++ child_selection.x2 = xMax; ++ } + } else { +- child_selection.x2 = xMax; ++ child_selection.y1 = begin ? begin->yMin : yMin; ++ if (end && end->yMax != -1) { ++ child_selection.y2 = current->yMax; ++ } else { ++ child_selection.y2 = yMax; ++ } + } + } + ++ if (rot == 0 || rot == 2) { ++ s1 = child_selection.x1; ++ s2 = child_selection.x2; ++ } else { ++ s1 = child_selection.y1; ++ s2 = child_selection.y2; ++ } ++ + edge_begin = len; + edge_end = 0; + for (i = 0; i < len; i++) { + double mid = (edge[i] + edge[i + 1]) / 2; +- if (child_selection.x1 < mid || child_selection.x2 < mid) +- if (i < edge_begin) +- edge_begin = i; +- if (mid < child_selection.x2 || mid < child_selection.x1) +- edge_end = i + 1; ++ if (XBetweenAB (mid, s1, s2)) ++ { ++ if (i < edge_begin) ++ edge_begin = i; ++ ++ edge_end = i + 1; ++ } + } + + /* Skip empty selection. */ diff --git a/SPECS/poppler.spec b/SPECS/poppler.spec index 6b7fb15..8a40899 100644 --- a/SPECS/poppler.spec +++ b/SPECS/poppler.spec @@ -1,7 +1,7 @@ Summary: PDF rendering library Name: poppler Version: 0.22.5 -Release: 2%{?dist} +Release: 6%{?dist} License: (GPLv2 or GPLv3) and GPLv2+ and LGPLv2+ and MIT Group: Development/Libraries URL: http://poppler.freedesktop.org/ @@ -13,6 +13,9 @@ Patch0: poppler-0.22.5-CVE-2013-4473.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1024762 Patch1: poppler-0.22.5-CVE-2013-4474.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1053616 +Patch2: poppler-0.22.5-rotated-words-selection.patch + Requires: poppler-data >= 0.4.0 BuildRequires: automake libtool BuildRequires: gettext-devel @@ -121,6 +124,7 @@ converting PDF files to a number of other formats. Summary: Demos for poppler Group: Applications/Text Requires: %{name}-glib%{?_isa} = %{version}-%{release} +Requires: %{name}%{?_isa} = %{version}-%{release} %description demos %{summary}. @@ -129,6 +133,7 @@ Requires: %{name}-glib%{?_isa} = %{version}-%{release} %setup -q %patch0 -p1 -b .CVE-2013-4473 %patch1 -p1 -b .CVE-2013-4474 +%patch2 -p1 -b .rotated-word-selection iconv -f iso-8859-1 -t utf-8 < "utils/pdftohtml.1" > "utils/pdftohtml.1.utf8" mv "utils/pdftohtml.1.utf8" "utils/pdftohtml.1" @@ -251,6 +256,20 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}" %changelog +* Fri Feb 14 2014 Marek Kasik - 0.22.5-6 +- Add explicit requirement of poppler to poppler-demos (RPMDiff) +- Related: #1053616 + +* Fri Feb 14 2014 Marek Kasik - 0.22.5-5 +- Fix selection of words rotated by multiples of 90 degrees +- Resolves: #1053616 + +* Fri Jan 24 2014 Daniel Mach - 0.22.5-4 +- Mass rebuild 2014-01-24 + +* Fri Dec 27 2013 Daniel Mach - 0.22.5-3 +- Mass rebuild 2013-12-27 + * Thu Oct 31 2013 Marek Kasik 0.22.5-2 - Add poppler-0.22.5-CVE-2013-4473.patch (Limit length of output to pathName buffer)