parent
aabab097f5
commit
3ef09f4ec5
2
.gitignore
vendored
2
.gitignore
vendored
@ -7,3 +7,5 @@
|
|||||||
/poppler-test-2018-12-18-45f55f1e03b9bf3fbd334c31776b6f5e472889ec.tar.xz
|
/poppler-test-2018-12-18-45f55f1e03b9bf3fbd334c31776b6f5e472889ec.tar.xz
|
||||||
/poppler-0.84.0.tar.xz
|
/poppler-0.84.0.tar.xz
|
||||||
/poppler-0.90.0.tar.xz
|
/poppler-0.90.0.tar.xz
|
||||||
|
/poppler-test-2021-01-11-03a4b9eb854a06a83c465e82de601796c458bbe9.tar.xz
|
||||||
|
/poppler-21.01.0.tar.xz
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -17,8 +17,8 @@ index 7c2ca78..e93908c 100644
|
|||||||
--- a/poppler/TextOutputDev.cc
|
--- a/poppler/TextOutputDev.cc
|
||||||
+++ b/poppler/TextOutputDev.cc
|
+++ b/poppler/TextOutputDev.cc
|
||||||
@@ -178,6 +178,12 @@
|
@@ -178,6 +178,12 @@
|
||||||
// (Or 1/tan(angle) for 90/270 degrees.)
|
// to read the underlying image. Issue #157
|
||||||
#define diagonalThreshold 0.1
|
#define glyphlessSelectionOpacity 0.4
|
||||||
|
|
||||||
+// Returns whether x is between a and b or equal to a or b.
|
+// Returns whether x is between a and b or equal to a or b.
|
||||||
+// a and b don't need to be sorted.
|
+// a and b don't need to be sorted.
|
||||||
@ -28,258 +28,252 @@ index 7c2ca78..e93908c 100644
|
|||||||
+
|
+
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
inline bool isAscii7 (Unicode uchar) {
|
inline bool isAscii7(Unicode uchar)
|
||||||
@@ -4411,11 +4417,37 @@ void TextSelectionSizer::visitLine (TextLine *line,
|
@@ -4411,11 +4417,37 @@ void TextSelectionSizer::visitLine (TextLine *line,
|
||||||
PDFRectangle *rect;
|
PDFRectangle *rect;
|
||||||
double x1, y1, x2, y2, margin;
|
double x1, y1, x2, y2, margin;
|
||||||
|
|
||||||
- margin = (line->yMax - line->yMin) / 8;
|
- margin = (line->yMax - line->yMin) / 8;
|
||||||
- x1 = line->edge[edge_begin];
|
- x1 = line->edge[edge_begin];
|
||||||
- y1 = line->yMin - margin;
|
- y1 = line->yMin - margin;
|
||||||
- x2 = line->edge[edge_end];
|
- x2 = line->edge[edge_end];
|
||||||
- y2 = line->yMax + margin;
|
- y2 = line->yMax + margin;
|
||||||
+ switch (line->rot) {
|
+ switch (line->rot) {
|
||||||
+ default:
|
+ default:
|
||||||
+ case 0:
|
+ case 0:
|
||||||
+ margin = (line->yMax - line->yMin) / 8;
|
+ margin = (line->yMax - line->yMin) / 8;
|
||||||
+ x1 = line->edge[edge_begin];
|
+ x1 = line->edge[edge_begin];
|
||||||
+ x2 = line->edge[edge_end];
|
+ x2 = line->edge[edge_end];
|
||||||
+ y1 = line->yMin - margin;
|
+ y1 = line->yMin - margin;
|
||||||
+ y2 = line->yMax + margin;
|
+ y2 = line->yMax + margin;
|
||||||
+ break;
|
+ break;
|
||||||
+ case 1:
|
+ case 1:
|
||||||
+ margin = (line->xMax - line->xMin) / 8;
|
+ margin = (line->xMax - line->xMin) / 8;
|
||||||
+ x1 = line->xMin - margin;
|
+ x1 = line->xMin - margin;
|
||||||
+ x2 = line->xMax + margin;
|
+ x2 = line->xMax + margin;
|
||||||
+ y1 = line->edge[edge_begin];
|
+ y1 = line->edge[edge_begin];
|
||||||
+ y2 = line->edge[edge_end];
|
+ y2 = line->edge[edge_end];
|
||||||
+ break;
|
+ break;
|
||||||
+ case 2:
|
+ case 2:
|
||||||
+ margin = (line->yMax - line->yMin) / 8;
|
+ margin = (line->yMax - line->yMin) / 8;
|
||||||
+ x1 = line->edge[edge_end];
|
+ x1 = line->edge[edge_end];
|
||||||
+ x2 = line->edge[edge_begin];
|
+ x2 = line->edge[edge_begin];
|
||||||
+ y1 = line->yMin - margin;
|
+ y1 = line->yMin - margin;
|
||||||
+ y2 = line->yMax + margin;
|
+ y2 = line->yMax + margin;
|
||||||
+ break;
|
+ break;
|
||||||
+ case 3:
|
+ case 3:
|
||||||
+ margin = (line->xMax - line->xMin) / 8;
|
+ margin = (line->xMax - line->xMin) / 8;
|
||||||
+ x1 = line->xMin - margin;
|
+ x1 = line->xMin - margin;
|
||||||
+ x2 = line->xMax + margin;
|
+ x2 = line->xMax + margin;
|
||||||
+ y1 = line->edge[edge_end];
|
+ y1 = line->edge[edge_end];
|
||||||
+ y2 = line->edge[edge_begin];
|
+ y2 = line->edge[edge_begin];
|
||||||
+ break;
|
+ break;
|
||||||
+ }
|
+ }
|
||||||
|
|
||||||
rect = new PDFRectangle (floor (x1 * scale),
|
rect = new PDFRectangle(floor(x1 * scale), floor(y1 * scale), ceil(x2 * scale), ceil(y2 * scale));
|
||||||
floor (y1 * scale),
|
list->push_back(rect);
|
||||||
@@ -4499,19 +4531,56 @@ void TextSelectionPainter::visitLine (TextLine *line,
|
@@ -4499,19 +4531,56 @@ void TextSelectionPainter::visitLine (TextLine *line,
|
||||||
{
|
{
|
||||||
double x1, y1, x2, y2, margin;
|
double x1, y1, x2, y2, margin;
|
||||||
|
|
||||||
- margin = (line->yMax - line->yMin) / 8;
|
- margin = (line->yMax - line->yMin) / 8;
|
||||||
- x1 = floor (line->edge[edge_begin]);
|
- x1 = floor(line->edge[edge_begin]);
|
||||||
- y1 = floor (line->yMin - margin);
|
- y1 = floor(line->yMin - margin);
|
||||||
- x2 = ceil (line->edge[edge_end]);
|
- x2 = ceil(line->edge[edge_end]);
|
||||||
- y2 = ceil (line->yMax + margin);
|
- y2 = ceil(line->yMax + margin);
|
||||||
+ switch (line->rot) {
|
+ switch (line->rot) {
|
||||||
+ default:
|
+ default:
|
||||||
+ case 0:
|
+ case 0:
|
||||||
+ margin = (line->yMax - line->yMin) / 8;
|
+ margin = (line->yMax - line->yMin) / 8;
|
||||||
+ x1 = line->edge[edge_begin];
|
+ x1 = line->edge[edge_begin];
|
||||||
+ x2 = line->edge[edge_end];
|
+ x2 = line->edge[edge_end];
|
||||||
+ y1 = line->yMin - margin;
|
+ y1 = line->yMin - margin;
|
||||||
+ y2 = line->yMax + margin;
|
+ y2 = line->yMax + margin;
|
||||||
+ break;
|
+ break;
|
||||||
+ case 1:
|
+ case 1:
|
||||||
+ margin = (line->xMax - line->xMin) / 8;
|
+ margin = (line->xMax - line->xMin) / 8;
|
||||||
+ x1 = line->xMin - margin;
|
+ x1 = line->xMin - margin;
|
||||||
+ x2 = line->xMax + margin;
|
+ x2 = line->xMax + margin;
|
||||||
+ y1 = line->edge[edge_begin];
|
+ y1 = line->edge[edge_begin];
|
||||||
+ y2 = line->edge[edge_end];
|
+ y2 = line->edge[edge_end];
|
||||||
+ break;
|
+ break;
|
||||||
+ case 2:
|
+ case 2:
|
||||||
+ margin = (line->yMax - line->yMin) / 8;
|
+ margin = (line->yMax - line->yMin) / 8;
|
||||||
+ x1 = line->edge[edge_end];
|
+ x1 = line->edge[edge_end];
|
||||||
+ x2 = line->edge[edge_begin];
|
+ x2 = line->edge[edge_begin];
|
||||||
+ y1 = line->yMin - margin;
|
+ y1 = line->yMin - margin;
|
||||||
+ y2 = line->yMax + margin;
|
+ y2 = line->yMax + margin;
|
||||||
+ break;
|
+ break;
|
||||||
+ case 3:
|
+ case 3:
|
||||||
+ margin = (line->xMax - line->xMin) / 8;
|
+ margin = (line->xMax - line->xMin) / 8;
|
||||||
+ x1 = line->xMin - margin;
|
+ x1 = line->xMin - margin;
|
||||||
+ x2 = line->xMax + margin;
|
+ x2 = line->xMax + margin;
|
||||||
+ y1 = line->edge[edge_end];
|
+ y1 = line->edge[edge_end];
|
||||||
+ y2 = line->edge[edge_begin];
|
+ y2 = line->edge[edge_begin];
|
||||||
+ break;
|
+ break;
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ ctm.transform(x1, y1, &x1, &y1);
|
|
||||||
+ ctm.transform(x2, y2, &x2, &y2);
|
|
||||||
|
|
||||||
- ctm.transform(line->edge[edge_begin], line->yMin - margin, &x1, &y1);
|
|
||||||
- ctm.transform(line->edge[edge_end], line->yMax + margin, &x2, &y2);
|
|
||||||
+ if (x1 < x2) {
|
|
||||||
+ x1 = floor (x1);
|
|
||||||
+ x2 = ceil (x2);
|
|
||||||
+ } else {
|
|
||||||
+ x1 = ceil (x1);
|
|
||||||
+ x2 = floor (x2);
|
|
||||||
+ }
|
|
||||||
|
|
||||||
- x1 = floor (x1);
|
|
||||||
- y1 = floor (y1);
|
|
||||||
- x2 = ceil (x2);
|
|
||||||
- y2 = ceil (y2);
|
|
||||||
+ if (y1 < y2) {
|
|
||||||
+ y1 = floor (y1);
|
|
||||||
+ y2 = ceil (y2);
|
|
||||||
+ } else {
|
|
||||||
+ y1 = ceil (y1);
|
|
||||||
+ y2 = floor (y2);
|
|
||||||
+ }
|
|
||||||
|
|
||||||
ictm.transform(x1, y1, &x1, &y1);
|
|
||||||
ictm.transform(x2, y2, &x2, &y2);
|
|
||||||
@@ -4589,17 +4658,27 @@ void TextWord::visitSelection(TextSelectionVisitor *visitor,
|
|
||||||
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. */
|
|
||||||
@@ -4615,30 +4694,41 @@ void TextLine::visitSelection(TextSelectionVisitor *visitor,
|
|
||||||
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 = nullptr;
|
|
||||||
end = nullptr;
|
|
||||||
current = nullptr;
|
|
||||||
for (p = words; p != nullptr; 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) {
|
+ ctm.transform(x1, y1, &x1, &y1);
|
||||||
- if ((selection->x1 < p->xMax) ||
|
+ ctm.transform(x2, y2, &x2, &y2);
|
||||||
- (selection->x2 < p->xMax))
|
|
||||||
- if (begin == nullptr)
|
|
||||||
- begin = p;
|
|
||||||
+ if (((s1 < p_max) || (s2 < p_max)) && begin == nullptr)
|
|
||||||
+ begin = p;
|
|
||||||
|
|
||||||
- if (((selection->x1 > p->xMin) ||
|
- ctm.transform(line->edge[edge_begin], line->yMin - margin, &x1, &y1);
|
||||||
- (selection->x2 > p->xMin)) && (begin != nullptr)) {
|
- ctm.transform(line->edge[edge_end], line->yMax + margin, &x2, &y2);
|
||||||
+ if (((s1 > p_min) || (s2 > p_min)) && begin != nullptr) {
|
+ if (x1 < x2) {
|
||||||
end = p->next;
|
+ x1 = floor(x1);
|
||||||
current = p;
|
+ x2 = ceil(x2);
|
||||||
}
|
+ } else {
|
||||||
} else {
|
+ x1 = ceil(x1);
|
||||||
- if ((selection->x1 > p->xMin) ||
|
+ x2 = floor(x2);
|
||||||
- (selection->x2 > p->xMin))
|
+ }
|
||||||
- if (begin == nullptr)
|
|
||||||
- begin = p;
|
|
||||||
+ if (((s1 > p_min) || (s2 > p_min)) && begin == nullptr)
|
|
||||||
+ begin = p;
|
|
||||||
|
|
||||||
- if (((selection->x1 < p->xMax) ||
|
- x1 = floor(x1);
|
||||||
- (selection->x2 < p->xMax)) && (begin != nullptr)) {
|
- y1 = floor(y1);
|
||||||
+ if (((s1 < p_max) || (s2 < p_max)) && begin != nullptr) {
|
- x2 = ceil(x2);
|
||||||
end = p->next;
|
- y2 = ceil(y2);
|
||||||
current = p;
|
+ if (y1 < y2) {
|
||||||
}
|
+ y1 = floor(y1);
|
||||||
@@ -4650,23 +4740,42 @@ void TextLine::visitSelection(TextSelectionVisitor *visitor,
|
+ y2 = ceil(y2);
|
||||||
|
+ } else {
|
||||||
|
+ y1 = ceil(y1);
|
||||||
|
+ y2 = floor(y2);
|
||||||
|
+ }
|
||||||
|
|
||||||
child_selection = *selection;
|
ictm.transform(x1, y1, &x1, &y1);
|
||||||
if (style == selectionStyleWord) {
|
ictm.transform(x2, y2, &x2, &y2);
|
||||||
- child_selection.x1 = begin ? begin->xMin : xMin;
|
@@ -4589,17 +4658,26 @@ void TextWord::visitSelection(TextSelectionVisitor *visitor,
|
||||||
- if (end && end->xMax != -1) {
|
void TextWord::visitSelection(TextSelectionVisitor *visitor, const PDFRectangle *selection, SelectionStyle style)
|
||||||
- child_selection.x2 = current->xMax;
|
{
|
||||||
|
int i, begin, end;
|
||||||
|
- double mid;
|
||||||
|
+ double mid, s1, s2;
|
||||||
|
+
|
||||||
+ if (rot == 0 || rot == 2) {
|
+ if (rot == 0 || rot == 2) {
|
||||||
+ child_selection.x1 = begin ? begin->xMin : xMin;
|
+ s1 = selection->x1;
|
||||||
+ if (end && end->xMax != -1) {
|
+ s2 = selection->x2;
|
||||||
+ child_selection.x2 = current->xMax;
|
+ } else {
|
||||||
+ } else {
|
+ s1 = selection->y1;
|
||||||
+ child_selection.x2 = xMax;
|
+ s2 = selection->y2;
|
||||||
+ }
|
+ }
|
||||||
} else {
|
|
||||||
- child_selection.x2 = xMax;
|
begin = len;
|
||||||
+ child_selection.y1 = begin ? begin->yMin : yMin;
|
end = 0;
|
||||||
+ if (end && end->yMax != -1) {
|
for (i = 0; i < len; i++) {
|
||||||
+ child_selection.y2 = current->yMax;
|
mid = (edge[i] + edge[i + 1]) / 2;
|
||||||
+ } else {
|
- if (selection->x1 < mid || selection->x2 < mid)
|
||||||
+ child_selection.y2 = yMax;
|
- 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;
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
+ if (rot == 0 || rot == 2) {
|
/* Skip empty selection. */
|
||||||
+ s1 = child_selection.x1;
|
@@ -4615,26 +4694,41 @@ void TextLine::visitSelection(TextSelectionVisitor *visitor,
|
||||||
+ s2 = child_selection.x2;
|
TextWord *p, *begin, *end, *current;
|
||||||
+ } else {
|
int i, edge_begin, edge_end;
|
||||||
+ s1 = child_selection.y1;
|
PDFRectangle child_selection;
|
||||||
+ s2 = child_selection.y2;
|
+ double s1, s2, p_min, p_max;
|
||||||
+ }
|
|
||||||
+
|
+
|
||||||
edge_begin = len;
|
+ if (rot == 0 || rot == 2) {
|
||||||
edge_end = 0;
|
+ s1 = selection->x1;
|
||||||
for (i = 0; i < len; i++) {
|
+ s2 = selection->x2;
|
||||||
double mid = (edge[i] + edge[i + 1]) / 2;
|
+ } else {
|
||||||
- if (child_selection.x1 < mid || child_selection.x2 < mid)
|
+ s1 = selection->y1;
|
||||||
- if (i < edge_begin)
|
+ s2 = selection->y2;
|
||||||
- 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. */
|
begin = nullptr;
|
||||||
|
end = nullptr;
|
||||||
|
current = nullptr;
|
||||||
|
for (p = words; p != nullptr; 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 == nullptr)
|
||||||
|
- begin = p;
|
||||||
|
+ if (((s1 < p_max) || (s2 < p_max)) && begin == nullptr)
|
||||||
|
+ begin = p;
|
||||||
|
|
||||||
|
- if (((selection->x1 > p->xMin) || (selection->x2 > p->xMin)) && (begin != nullptr)) {
|
||||||
|
+ if (((s1 > p_min) || (s2 > p_min)) && begin != nullptr) {
|
||||||
|
end = p->next;
|
||||||
|
current = p;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
- if ((selection->x1 > p->xMin) || (selection->x2 > p->xMin))
|
||||||
|
- if (begin == nullptr)
|
||||||
|
- begin = p;
|
||||||
|
+ if (((s1 > p_min) || (s2 > p_min)) && begin == nullptr)
|
||||||
|
+ begin = p;
|
||||||
|
|
||||||
|
- if (((selection->x1 < p->xMax) || (selection->x2 < p->xMax)) && (begin != nullptr)) {
|
||||||
|
+ if (((s1 < p_max) || (s2 < p_max)) && begin != nullptr) {
|
||||||
|
end = p->next;
|
||||||
|
current = p;
|
||||||
|
}
|
||||||
|
@@ -4650,23 +4740,41 @@ void TextLine::visitSelection(TextSelectionVisitor *visitor,
|
||||||
|
|
||||||
|
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. */
|
||||||
--
|
--
|
||||||
1.8.4.2
|
1.8.4.2
|
||||||
|
|
||||||
|
@ -1,150 +0,0 @@
|
|||||||
--- poppler-0.67.0/qt4/src/poppler-document.cc.orig 2018-08-08 10:13:17.130028069 +0200
|
|
||||||
+++ poppler-0.67.0/qt4/src/poppler-document.cc 2018-08-08 11:14:58.301690615 +0200
|
|
||||||
@@ -799,7 +799,7 @@ namespace Poppler {
|
|
||||||
return Document::NoForm; // make gcc happy
|
|
||||||
}
|
|
||||||
|
|
||||||
- QDateTime convertDate( char *dateString )
|
|
||||||
+ QDateTime convertDate( const char *dateString )
|
|
||||||
{
|
|
||||||
int year, mon, day, hour, min, sec, tzHours, tzMins;
|
|
||||||
char tz;
|
|
||||||
@@ -830,6 +830,12 @@ namespace Poppler {
|
|
||||||
return QDateTime();
|
|
||||||
}
|
|
||||||
|
|
||||||
+ QDateTime convertDate( char *dateString )
|
|
||||||
+ {
|
|
||||||
+ return convertDate( (const char *) dateString );
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+
|
|
||||||
bool isCmsAvailable()
|
|
||||||
{
|
|
||||||
#if defined(USE_CMS)
|
|
||||||
--- poppler-0.67.0/qt4/src/poppler-embeddedfile.cc.orig 2018-08-08 10:13:17.130028069 +0200
|
|
||||||
+++ poppler-0.67.0/qt4/src/poppler-embeddedfile.cc 2018-08-08 10:50:42.645723179 +0200
|
|
||||||
@@ -68,13 +68,13 @@ EmbeddedFile::~EmbeddedFile()
|
|
||||||
|
|
||||||
QString EmbeddedFile::name() const
|
|
||||||
{
|
|
||||||
- GooString *goo = m_embeddedFile->filespec->getFileName();
|
|
||||||
+ const GooString *goo = m_embeddedFile->filespec->getFileName();
|
|
||||||
return goo ? UnicodeParsedString(goo) : QString();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString EmbeddedFile::description() const
|
|
||||||
{
|
|
||||||
- GooString *goo = m_embeddedFile->filespec->getDescription();
|
|
||||||
+ const GooString *goo = m_embeddedFile->filespec->getDescription();
|
|
||||||
return goo ? UnicodeParsedString(goo) : QString();
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -85,25 +85,25 @@ int EmbeddedFile::size() const
|
|
||||||
|
|
||||||
QDateTime EmbeddedFile::modDate() const
|
|
||||||
{
|
|
||||||
- GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->modDate() : NULL;
|
|
||||||
+ const GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->modDate() : NULL;
|
|
||||||
return goo ? convertDate(goo->c_str()) : QDateTime();
|
|
||||||
}
|
|
||||||
|
|
||||||
QDateTime EmbeddedFile::createDate() const
|
|
||||||
{
|
|
||||||
- GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->createDate() : NULL;
|
|
||||||
+ const GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->createDate() : NULL;
|
|
||||||
return goo ? convertDate(goo->c_str()) : QDateTime();
|
|
||||||
}
|
|
||||||
|
|
||||||
QByteArray EmbeddedFile::checksum() const
|
|
||||||
{
|
|
||||||
- GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->checksum() : NULL;
|
|
||||||
+ const GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->checksum() : NULL;
|
|
||||||
return goo ? QByteArray::fromRawData(goo->c_str(), goo->getLength()) : QByteArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString EmbeddedFile::mimeType() const
|
|
||||||
{
|
|
||||||
- GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->mimeType() : NULL;
|
|
||||||
+ const GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->mimeType() : NULL;
|
|
||||||
return goo ? QString(goo->c_str()) : QString();
|
|
||||||
}
|
|
||||||
|
|
||||||
--- poppler-0.67.0/qt4/src/poppler-movie.cc.orig 2018-08-08 10:13:17.131028077 +0200
|
|
||||||
+++ poppler-0.67.0/qt4/src/poppler-movie.cc 2018-08-08 10:52:41.284914743 +0200
|
|
||||||
@@ -57,7 +57,7 @@ MovieObject::MovieObject( AnnotMovie *an
|
|
||||||
m_movieData->m_movieObj = ann->getMovie()->copy();
|
|
||||||
//TODO: copy poster image
|
|
||||||
|
|
||||||
- MovieActivationParameters *mp = m_movieData->m_movieObj->getActivationParameters();
|
|
||||||
+ const MovieActivationParameters *mp = m_movieData->m_movieObj->getActivationParameters();
|
|
||||||
int width, height;
|
|
||||||
m_movieData->m_movieObj->getFloatingWindowSize(&width, &height);
|
|
||||||
m_movieData->m_size = QSize(width, height);
|
|
||||||
@@ -73,7 +73,7 @@ MovieObject::~MovieObject()
|
|
||||||
|
|
||||||
QString MovieObject::url() const
|
|
||||||
{
|
|
||||||
- GooString * goo = m_movieData->m_movieObj->getFileName();
|
|
||||||
+ const GooString * goo = m_movieData->m_movieObj->getFileName();
|
|
||||||
return goo ? QString( goo->c_str() ) : QString();
|
|
||||||
}
|
|
||||||
|
|
||||||
--- poppler-0.67.0/qt4/src/poppler-private.h.orig 2018-08-08 10:13:17.132028085 +0200
|
|
||||||
+++ poppler-0.67.0/qt4/src/poppler-private.h 2018-08-08 11:00:30.836672893 +0200
|
|
||||||
@@ -54,9 +54,9 @@ class FormWidget;
|
|
||||||
namespace Poppler {
|
|
||||||
|
|
||||||
/* borrowed from kpdf */
|
|
||||||
- QString unicodeToQString(Unicode* u, int len);
|
|
||||||
+ QString unicodeToQString(const Unicode* u, int len);
|
|
||||||
|
|
||||||
- QString UnicodeParsedString(GooString *s1);
|
|
||||||
+ QString UnicodeParsedString(const GooString *s1);
|
|
||||||
|
|
||||||
GooString *QStringToUnicodeGooString(const QString &s);
|
|
||||||
|
|
||||||
@@ -69,13 +69,13 @@ namespace Poppler {
|
|
||||||
class LinkDestinationData
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
- LinkDestinationData( LinkDest *l, GooString *nd, Poppler::DocumentData *pdfdoc, bool external )
|
|
||||||
+ LinkDestinationData( const LinkDest *l, const GooString *nd, Poppler::DocumentData *pdfdoc, bool external )
|
|
||||||
: ld(l), namedDest(nd), doc(pdfdoc), externalDest(external)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
- LinkDest *ld;
|
|
||||||
- GooString *namedDest;
|
|
||||||
+ const LinkDest *ld;
|
|
||||||
+ const GooString *namedDest;
|
|
||||||
Poppler::DocumentData *doc;
|
|
||||||
bool externalDest;
|
|
||||||
};
|
|
||||||
--- poppler-0.67.0/qt4/src/poppler-qt4.h.orig 2018-08-08 10:13:17.133028093 +0200
|
|
||||||
+++ poppler-0.67.0/qt4/src/poppler-qt4.h 2018-08-08 10:29:23.807858790 +0200
|
|
||||||
@@ -1816,7 +1816,12 @@ height = dummy.height();
|
|
||||||
/**
|
|
||||||
Conversion from PDF date string format to QDateTime
|
|
||||||
*/
|
|
||||||
- POPPLER_QT4_EXPORT QDateTime convertDate( char *dateString );
|
|
||||||
+ POPPLER_QT4_EXPORT Q_DECL_DEPRECATED QDateTime convertDate( char *dateString );
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ Conversion from PDF date string format to QDateTime
|
|
||||||
+ */
|
|
||||||
+ POPPLER_QT4_EXPORT QDateTime convertDate( const char *dateString );
|
|
||||||
|
|
||||||
/**
|
|
||||||
Whether the color management functions are available.
|
|
||||||
--- poppler-0.67.0/qt4/src/poppler-sound.cc.orig 2018-08-08 10:13:17.133028093 +0200
|
|
||||||
+++ poppler-0.67.0/qt4/src/poppler-sound.cc 2018-08-08 11:10:31.644004477 +0200
|
|
||||||
@@ -75,7 +75,7 @@ QString SoundObject::url() const
|
|
||||||
if ( m_soundData->m_type != SoundObject::External )
|
|
||||||
return QString();
|
|
||||||
|
|
||||||
- GooString * goo = m_soundData->m_soundObj->getFileName();
|
|
||||||
+ const GooString * goo = m_soundData->m_soundObj->getFileName();
|
|
||||||
return goo ? QString( goo->c_str() ) : QString();
|
|
||||||
}
|
|
||||||
|
|
@ -1,289 +0,0 @@
|
|||||||
From 9bcc9d0a164dbd1f24aae8f900c28feafd0cb3f2 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Marek Kasik <mkasik@redhat.com>
|
|
||||||
Date: Tue, 30 Apr 2019 18:47:44 +0200
|
|
||||||
Subject: [PATCH] PSOutputDev: Don't read outside of image buffer
|
|
||||||
|
|
||||||
Check whether input image is RGB or BGR to not treat
|
|
||||||
it as CMYK in those cases in PSOutputDev::checkPageSlice().
|
|
||||||
|
|
||||||
Fixes #751
|
|
||||||
---
|
|
||||||
poppler/PSOutputDev.cc | 248 ++++++++++++++++++++++++++++++++---------
|
|
||||||
1 file changed, 196 insertions(+), 52 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/poppler/PSOutputDev.cc b/poppler/PSOutputDev.cc
|
|
||||||
index 0d201835..155a8cbe 100644
|
|
||||||
--- a/poppler/PSOutputDev.cc
|
|
||||||
+++ b/poppler/PSOutputDev.cc
|
|
||||||
@@ -3374,6 +3374,14 @@ bool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/,
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case psLevel1Sep:
|
|
||||||
+ GfxColor inputColor;
|
|
||||||
+ GfxCMYK cmyk;
|
|
||||||
+ unsigned char cmykColor[4];
|
|
||||||
+ GfxDeviceRGBColorSpace *rgbCS;
|
|
||||||
+ SplashColorMode colorMode;
|
|
||||||
+
|
|
||||||
+ colorMode = bitmap->getMode();
|
|
||||||
+
|
|
||||||
p = bitmap->getDataPtr();
|
|
||||||
// Check for an all gray image
|
|
||||||
if (getOptimizeColorSpace()) {
|
|
||||||
@@ -3448,65 +3456,201 @@ bool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/,
|
|
||||||
}
|
|
||||||
} else if (((psProcessCyan | psProcessMagenta | psProcessYellow | psProcessBlack) & ~processColors) != 0) {
|
|
||||||
// Color image, need to check color flags for each dot
|
|
||||||
- for (y = 0; y < h; ++y) {
|
|
||||||
- for (comp = 0; comp < 4; ++comp) {
|
|
||||||
- if (useBinary) {
|
|
||||||
- // Binary color image
|
|
||||||
- for (x = 0; x < w; ++x) {
|
|
||||||
- col[comp] |= p[4*x + comp];
|
|
||||||
- hexBuf[i++] = p[4*x + comp];
|
|
||||||
- if (i >= 64) {
|
|
||||||
- writePSBuf(hexBuf, i);
|
|
||||||
- i = 0;
|
|
||||||
+ switch (colorMode) {
|
|
||||||
+ case splashModeRGB8:
|
|
||||||
+ case splashModeBGR8:
|
|
||||||
+ rgbCS = new GfxDeviceRGBColorSpace();
|
|
||||||
+ for (y = 0; y < h; ++y) {
|
|
||||||
+ for (comp = 0; comp < 4; ++comp) {
|
|
||||||
+ if (useBinary) {
|
|
||||||
+ // Binary color image
|
|
||||||
+ for (x = 0; x < w; ++x) {
|
|
||||||
+ if (likely(colorMode == splashModeRGB8)) {
|
|
||||||
+ inputColor.c[0] = byteToCol(p[3*x + 0]);
|
|
||||||
+ inputColor.c[1] = byteToCol(p[3*x + 1]);
|
|
||||||
+ inputColor.c[2] = byteToCol(p[3*x + 2]);
|
|
||||||
+ } else {
|
|
||||||
+ inputColor.c[0] = byteToCol(p[3*x + 2]);
|
|
||||||
+ inputColor.c[1] = byteToCol(p[3*x + 1]);
|
|
||||||
+ inputColor.c[2] = byteToCol(p[3*x + 0]);
|
|
||||||
+ }
|
|
||||||
+ rgbCS->getCMYK(&inputColor, &cmyk);
|
|
||||||
+ cmykColor[0] = colToByte(cmyk.c);
|
|
||||||
+ cmykColor[1] = colToByte(cmyk.m);
|
|
||||||
+ cmykColor[2] = colToByte(cmyk.y);
|
|
||||||
+ cmykColor[3] = colToByte(cmyk.k);
|
|
||||||
+
|
|
||||||
+ col[comp] |= cmykColor[comp];
|
|
||||||
+ hexBuf[i++] = cmykColor[comp];
|
|
||||||
+ if (i >= 64) {
|
|
||||||
+ writePSBuf(hexBuf, i);
|
|
||||||
+ i = 0;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ } else {
|
|
||||||
+ // Gray color image
|
|
||||||
+ for (x = 0; x < w; ++x) {
|
|
||||||
+ if (likely(colorMode == splashModeRGB8)) {
|
|
||||||
+ inputColor.c[0] = byteToCol(p[3*x + 0]);
|
|
||||||
+ inputColor.c[1] = byteToCol(p[3*x + 1]);
|
|
||||||
+ inputColor.c[2] = byteToCol(p[3*x + 2]);
|
|
||||||
+ } else {
|
|
||||||
+ inputColor.c[0] = byteToCol(p[3*x + 2]);
|
|
||||||
+ inputColor.c[1] = byteToCol(p[3*x + 1]);
|
|
||||||
+ inputColor.c[2] = byteToCol(p[3*x + 0]);
|
|
||||||
+ }
|
|
||||||
+ rgbCS->getCMYK(&inputColor, &cmyk);
|
|
||||||
+ cmykColor[0] = colToByte(cmyk.c);
|
|
||||||
+ cmykColor[1] = colToByte(cmyk.m);
|
|
||||||
+ cmykColor[2] = colToByte(cmyk.y);
|
|
||||||
+ cmykColor[3] = colToByte(cmyk.k);
|
|
||||||
+
|
|
||||||
+ col[comp] |= cmykColor[comp];
|
|
||||||
+ digit = cmykColor[comp] / 16;
|
|
||||||
+ hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0');
|
|
||||||
+ digit = cmykColor[comp] % 16;
|
|
||||||
+ hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0');
|
|
||||||
+ if (i >= 64) {
|
|
||||||
+ hexBuf[i++] = '\n';
|
|
||||||
+ writePSBuf(hexBuf, i);
|
|
||||||
+ i = 0;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
- }
|
|
||||||
- } else {
|
|
||||||
- // Gray color image
|
|
||||||
- for (x = 0; x < w; ++x) {
|
|
||||||
- col[comp] |= p[4*x + comp];
|
|
||||||
- digit = p[4*x + comp] / 16;
|
|
||||||
- hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0');
|
|
||||||
- digit = p[4*x + comp] % 16;
|
|
||||||
- hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0');
|
|
||||||
- if (i >= 64) {
|
|
||||||
- hexBuf[i++] = '\n';
|
|
||||||
- writePSBuf(hexBuf, i);
|
|
||||||
- i = 0;
|
|
||||||
+ }
|
|
||||||
+ p -= bitmap->getRowSize();
|
|
||||||
+ }
|
|
||||||
+ delete rgbCS;
|
|
||||||
+ break;
|
|
||||||
+ default:
|
|
||||||
+ for (y = 0; y < h; ++y) {
|
|
||||||
+ for (comp = 0; comp < 4; ++comp) {
|
|
||||||
+ if (useBinary) {
|
|
||||||
+ // Binary color image
|
|
||||||
+ for (x = 0; x < w; ++x) {
|
|
||||||
+ col[comp] |= p[4*x + comp];
|
|
||||||
+ hexBuf[i++] = p[4*x + comp];
|
|
||||||
+ if (i >= 64) {
|
|
||||||
+ writePSBuf(hexBuf, i);
|
|
||||||
+ i = 0;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ } else {
|
|
||||||
+ // Gray color image
|
|
||||||
+ for (x = 0; x < w; ++x) {
|
|
||||||
+ col[comp] |= p[4*x + comp];
|
|
||||||
+ digit = p[4*x + comp] / 16;
|
|
||||||
+ hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0');
|
|
||||||
+ digit = p[4*x + comp] % 16;
|
|
||||||
+ hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0');
|
|
||||||
+ if (i >= 64) {
|
|
||||||
+ hexBuf[i++] = '\n';
|
|
||||||
+ writePSBuf(hexBuf, i);
|
|
||||||
+ i = 0;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
- p -= bitmap->getRowSize();
|
|
||||||
+ }
|
|
||||||
+ p -= bitmap->getRowSize();
|
|
||||||
+ }
|
|
||||||
+ break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// Color image, do not need to check color flags
|
|
||||||
- for (y = 0; y < h; ++y) {
|
|
||||||
- for (comp = 0; comp < 4; ++comp) {
|
|
||||||
- if (useBinary) {
|
|
||||||
- // Binary color image
|
|
||||||
- for (x = 0; x < w; ++x) {
|
|
||||||
- hexBuf[i++] = p[4*x + comp];
|
|
||||||
- if (i >= 64) {
|
|
||||||
- writePSBuf(hexBuf, i);
|
|
||||||
- i = 0;
|
|
||||||
+ switch (colorMode) {
|
|
||||||
+ case splashModeRGB8:
|
|
||||||
+ case splashModeBGR8:
|
|
||||||
+ rgbCS = new GfxDeviceRGBColorSpace();
|
|
||||||
+ for (y = 0; y < h; ++y) {
|
|
||||||
+ for (comp = 0; comp < 4; ++comp) {
|
|
||||||
+ if (useBinary) {
|
|
||||||
+ // Binary color image
|
|
||||||
+ for (x = 0; x < w; ++x) {
|
|
||||||
+ if (likely(colorMode == splashModeRGB8)) {
|
|
||||||
+ inputColor.c[0] = byteToCol(p[3*x + 0]);
|
|
||||||
+ inputColor.c[1] = byteToCol(p[3*x + 1]);
|
|
||||||
+ inputColor.c[2] = byteToCol(p[3*x + 2]);
|
|
||||||
+ } else {
|
|
||||||
+ inputColor.c[0] = byteToCol(p[3*x + 2]);
|
|
||||||
+ inputColor.c[1] = byteToCol(p[3*x + 1]);
|
|
||||||
+ inputColor.c[2] = byteToCol(p[3*x + 0]);
|
|
||||||
+ }
|
|
||||||
+ rgbCS->getCMYK(&inputColor, &cmyk);
|
|
||||||
+ cmykColor[0] = colToByte(cmyk.c);
|
|
||||||
+ cmykColor[1] = colToByte(cmyk.m);
|
|
||||||
+ cmykColor[2] = colToByte(cmyk.y);
|
|
||||||
+ cmykColor[3] = colToByte(cmyk.k);
|
|
||||||
+
|
|
||||||
+ hexBuf[i++] = cmykColor[comp];
|
|
||||||
+ if (i >= 64) {
|
|
||||||
+ writePSBuf(hexBuf, i);
|
|
||||||
+ i = 0;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ } else {
|
|
||||||
+ // Hex color image
|
|
||||||
+ for (x = 0; x < w; ++x) {
|
|
||||||
+ if (likely(colorMode == splashModeRGB8)) {
|
|
||||||
+ inputColor.c[0] = byteToCol(p[3*x + 0]);
|
|
||||||
+ inputColor.c[1] = byteToCol(p[3*x + 1]);
|
|
||||||
+ inputColor.c[2] = byteToCol(p[3*x + 2]);
|
|
||||||
+ } else {
|
|
||||||
+ inputColor.c[0] = byteToCol(p[3*x + 2]);
|
|
||||||
+ inputColor.c[1] = byteToCol(p[3*x + 1]);
|
|
||||||
+ inputColor.c[2] = byteToCol(p[3*x + 0]);
|
|
||||||
+ }
|
|
||||||
+ rgbCS->getCMYK(&inputColor, &cmyk);
|
|
||||||
+ cmykColor[0] = colToByte(cmyk.c);
|
|
||||||
+ cmykColor[1] = colToByte(cmyk.m);
|
|
||||||
+ cmykColor[2] = colToByte(cmyk.y);
|
|
||||||
+ cmykColor[3] = colToByte(cmyk.k);
|
|
||||||
+
|
|
||||||
+ digit = cmykColor[comp] / 16;
|
|
||||||
+ hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0');
|
|
||||||
+ digit = cmykColor[comp] % 16;
|
|
||||||
+ hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0');
|
|
||||||
+ if (i >= 64) {
|
|
||||||
+ hexBuf[i++] = '\n';
|
|
||||||
+ writePSBuf(hexBuf, i);
|
|
||||||
+ i = 0;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
- }
|
|
||||||
- } else {
|
|
||||||
- // Hex color image
|
|
||||||
- for (x = 0; x < w; ++x) {
|
|
||||||
- digit = p[4*x + comp] / 16;
|
|
||||||
- hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0');
|
|
||||||
- digit = p[4*x + comp] % 16;
|
|
||||||
- hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0');
|
|
||||||
- if (i >= 64) {
|
|
||||||
- hexBuf[i++] = '\n';
|
|
||||||
- writePSBuf(hexBuf, i);
|
|
||||||
- i = 0;
|
|
||||||
+ }
|
|
||||||
+ p -= bitmap->getRowSize();
|
|
||||||
+ }
|
|
||||||
+ delete rgbCS;
|
|
||||||
+ break;
|
|
||||||
+ default:
|
|
||||||
+ for (y = 0; y < h; ++y) {
|
|
||||||
+ for (comp = 0; comp < 4; ++comp) {
|
|
||||||
+ if (useBinary) {
|
|
||||||
+ // Binary color image
|
|
||||||
+ for (x = 0; x < w; ++x) {
|
|
||||||
+ hexBuf[i++] = p[4*x + comp];
|
|
||||||
+ if (i >= 64) {
|
|
||||||
+ writePSBuf(hexBuf, i);
|
|
||||||
+ i = 0;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ } else {
|
|
||||||
+ // Hex color image
|
|
||||||
+ for (x = 0; x < w; ++x) {
|
|
||||||
+ digit = p[4*x + comp] / 16;
|
|
||||||
+ hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0');
|
|
||||||
+ digit = p[4*x + comp] % 16;
|
|
||||||
+ hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0');
|
|
||||||
+ if (i >= 64) {
|
|
||||||
+ hexBuf[i++] = '\n';
|
|
||||||
+ writePSBuf(hexBuf, i);
|
|
||||||
+ i = 0;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
- p -= bitmap->getRowSize();
|
|
||||||
+ }
|
|
||||||
+ p -= bitmap->getRowSize();
|
|
||||||
+ }
|
|
||||||
+ break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (i != 0) {
|
|
||||||
--
|
|
||||||
2.21.0
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
|||||||
From 25feab2736d35ca707bde173b4a7d548da342211 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Marek Kasik <mkasik@redhat.com>
|
|
||||||
Date: Thu, 2 Jan 2020 13:40:40 +0100
|
|
||||||
Subject: [PATCH] Revert Remove unused MacroPushRequiredVars.cmake
|
|
||||||
|
|
||||||
This is needed by the QT4 removal revert.
|
|
||||||
---
|
|
||||||
cmake/modules/MacroPushRequiredVars.cmake | 46 +++++++++++++++++++++++
|
|
||||||
1 file changed, 46 insertions(+)
|
|
||||||
create mode 100644 cmake/modules/MacroPushRequiredVars.cmake
|
|
||||||
|
|
||||||
diff --git a/cmake/modules/MacroPushRequiredVars.cmake b/cmake/modules/MacroPushRequiredVars.cmake
|
|
||||||
new file mode 100644
|
|
||||||
index 00000000..35a6df5e
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/cmake/modules/MacroPushRequiredVars.cmake
|
|
||||||
@@ -0,0 +1,46 @@
|
|
||||||
+# this module defines two macros:
|
|
||||||
+# MACRO_PUSH_REQUIRED_VARS()
|
|
||||||
+# and
|
|
||||||
+# MACRO_POP_REQUIRED_VARS()
|
|
||||||
+# use these if you call cmake macros which use
|
|
||||||
+# any of the CMAKE_REQUIRED_XXX variables
|
|
||||||
+#
|
|
||||||
+# Usage:
|
|
||||||
+# MACRO_PUSH_REQUIRED_VARS()
|
|
||||||
+# SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -DSOME_MORE_DEF)
|
|
||||||
+# CHECK_FUNCTION_EXISTS(...)
|
|
||||||
+# MACRO_POP_REQUIRED_VARS()
|
|
||||||
+
|
|
||||||
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
|
|
||||||
+#
|
|
||||||
+# Redistribution and use is allowed according to the terms of the BSD license.
|
|
||||||
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
||||||
+
|
|
||||||
+MACRO(MACRO_PUSH_REQUIRED_VARS)
|
|
||||||
+
|
|
||||||
+ IF(NOT DEFINED _PUSH_REQUIRED_VARS_COUNTER)
|
|
||||||
+ SET(_PUSH_REQUIRED_VARS_COUNTER 0)
|
|
||||||
+ ENDIF(NOT DEFINED _PUSH_REQUIRED_VARS_COUNTER)
|
|
||||||
+
|
|
||||||
+ MATH(EXPR _PUSH_REQUIRED_VARS_COUNTER "${_PUSH_REQUIRED_VARS_COUNTER}+1")
|
|
||||||
+
|
|
||||||
+ SET(_CMAKE_REQUIRED_INCLUDES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER} ${CMAKE_REQUIRED_INCLUDES})
|
|
||||||
+ SET(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS})
|
|
||||||
+ SET(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER} ${CMAKE_REQUIRED_LIBRARIES})
|
|
||||||
+ SET(_CMAKE_REQUIRED_FLAGS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER} ${CMAKE_REQUIRED_FLAGS})
|
|
||||||
+ENDMACRO(MACRO_PUSH_REQUIRED_VARS)
|
|
||||||
+
|
|
||||||
+MACRO(MACRO_POP_REQUIRED_VARS)
|
|
||||||
+
|
|
||||||
+# don't pop more than we pushed
|
|
||||||
+ IF("${_PUSH_REQUIRED_VARS_COUNTER}" GREATER "0")
|
|
||||||
+
|
|
||||||
+ SET(CMAKE_REQUIRED_INCLUDES ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}})
|
|
||||||
+ SET(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}})
|
|
||||||
+ SET(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}})
|
|
||||||
+ SET(CMAKE_REQUIRED_FLAGS ${_CMAKE_REQUIRED_FLAGS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}})
|
|
||||||
+
|
|
||||||
+ MATH(EXPR _PUSH_REQUIRED_VARS_COUNTER "${_PUSH_REQUIRED_VARS_COUNTER}-1")
|
|
||||||
+ ENDIF("${_PUSH_REQUIRED_VARS_COUNTER}" GREATER "0")
|
|
||||||
+
|
|
||||||
+ENDMACRO(MACRO_POP_REQUIRED_VARS)
|
|
||||||
--
|
|
||||||
2.24.1
|
|
||||||
|
|
@ -1,383 +0,0 @@
|
|||||||
--- poppler-0.90.0/qt4/src/poppler-annotation.cc
|
|
||||||
+++ poppler-0.90.0/qt4/src/poppler-annotation.cc
|
|
||||||
@@ -789,7 +789,7 @@ Link* AnnotationPrivate::additionalActio
|
|
||||||
case Annotation::PageInvisibleAction: actionType = Annot::actionPageInvisible; break;
|
|
||||||
}
|
|
||||||
|
|
||||||
- ::LinkAction *linkAction = nullptr;
|
|
||||||
+ std::unique_ptr<::LinkAction> linkAction = nullptr;
|
|
||||||
if ( pdfAnnot->getType() == Annot::typeScreen )
|
|
||||||
linkAction = static_cast<AnnotScreen*>( pdfAnnot )->getAdditionalAction( actionType );
|
|
||||||
else
|
|
||||||
@@ -798,7 +798,7 @@ Link* AnnotationPrivate::additionalActio
|
|
||||||
Link *link = nullptr;
|
|
||||||
|
|
||||||
if ( linkAction )
|
|
||||||
- link = PageData::convertLinkActionToLink( linkAction, parentDoc, QRectF() );
|
|
||||||
+ link = PageData::convertLinkActionToLink( linkAction.get(), parentDoc, QRectF() );
|
|
||||||
|
|
||||||
return link;
|
|
||||||
}
|
|
||||||
--- poppler-0.90.0/qt4/src/poppler-document.cc
|
|
||||||
+++ poppler-0.90.0/qt4/src/poppler-document.cc
|
|
||||||
@@ -57,8 +57,6 @@
|
|
||||||
|
|
||||||
namespace Poppler {
|
|
||||||
|
|
||||||
- int DocumentData::count = 0;
|
|
||||||
-
|
|
||||||
Document *Document::load(const QString &filePath, const QByteArray &ownerPassword,
|
|
||||||
const QByteArray &userPassword)
|
|
||||||
{
|
|
||||||
@@ -633,7 +631,16 @@ namespace Poppler {
|
|
||||||
void Document::setColorDisplayProfile(void* outputProfileA)
|
|
||||||
{
|
|
||||||
#if defined(USE_CMS)
|
|
||||||
- GfxColorSpace::setDisplayProfile((cmsHPROFILE)outputProfileA);
|
|
||||||
+ if (m_doc->m_sRGBProfile && m_doc->m_sRGBProfile.get() == outputProfileA) {
|
|
||||||
+ // Catch the special case that the user passes the sRGB profile
|
|
||||||
+ m_doc->m_displayProfile = m_doc->m_sRGBProfile;
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ if (m_doc->m_displayProfile && m_doc->m_displayProfile.get() == outputProfileA) {
|
|
||||||
+ // Catch the special case that the user passes the display profile
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ m_doc->m_displayProfile = make_GfxLCMSProfilePtr(outputProfileA);
|
|
||||||
#else
|
|
||||||
Q_UNUSED(outputProfileA);
|
|
||||||
#endif
|
|
||||||
@@ -642,9 +649,8 @@ namespace Poppler {
|
|
||||||
void Document::setColorDisplayProfileName(const QString &name)
|
|
||||||
{
|
|
||||||
#if defined(USE_CMS)
|
|
||||||
- GooString *profileName = QStringToGooString( name );
|
|
||||||
- GfxColorSpace::setDisplayProfileName(profileName);
|
|
||||||
- delete profileName;
|
|
||||||
+ void* rawprofile = cmsOpenProfileFromFile(name.toLocal8Bit().constData(),"r");
|
|
||||||
+ m_doc->m_displayProfile = make_GfxLCMSProfilePtr(rawprofile);
|
|
||||||
#else
|
|
||||||
Q_UNUSED(name);
|
|
||||||
#endif
|
|
||||||
@@ -653,7 +659,10 @@ namespace Poppler {
|
|
||||||
void* Document::colorRgbProfile() const
|
|
||||||
{
|
|
||||||
#if defined(USE_CMS)
|
|
||||||
- return (void*)GfxColorSpace::getRGBProfile();
|
|
||||||
+ if (!m_doc->m_sRGBProfile) {
|
|
||||||
+ m_doc->m_sRGBProfile = make_GfxLCMSProfilePtr(cmsCreate_sRGBProfile());
|
|
||||||
+ }
|
|
||||||
+ return m_doc->m_sRGBProfile.get();
|
|
||||||
#else
|
|
||||||
return NULL;
|
|
||||||
#endif
|
|
||||||
@@ -662,7 +671,7 @@ namespace Poppler {
|
|
||||||
void* Document::colorDisplayProfile() const
|
|
||||||
{
|
|
||||||
#if defined(USE_CMS)
|
|
||||||
- return (void*)GfxColorSpace::getDisplayProfile();
|
|
||||||
+ return m_doc->m_displayProfile.get();
|
|
||||||
#else
|
|
||||||
return NULL;
|
|
||||||
#endif
|
|
||||||
--- poppler-0.90.0/qt4/src/poppler-link.cc
|
|
||||||
+++ poppler-0.90.0/qt4/src/poppler-link.cc
|
|
||||||
@@ -232,7 +232,7 @@ class LinkMoviePrivate : public LinkPriv
|
|
||||||
if ( data.namedDest && !ld && !data.externalDest )
|
|
||||||
{
|
|
||||||
deleteDest = true;
|
|
||||||
- ld = data.doc->doc->findDest( data.namedDest );
|
|
||||||
+ ld = data.doc->doc->findDest( data.namedDest ).release();
|
|
||||||
}
|
|
||||||
// in case this destination was named one, and it was not resolved
|
|
||||||
if ( data.namedDest && !ld )
|
|
||||||
--- poppler-0.90.0/qt4/src/poppler-page.cc
|
|
||||||
+++ poppler-0.90.0/qt4/src/poppler-page.cc
|
|
||||||
@@ -110,30 +110,30 @@ Link* PageData::convertLinkActionToLink(
|
|
||||||
|
|
||||||
case actionNamed:
|
|
||||||
{
|
|
||||||
- const char * name = ((LinkNamed *)a)->getName()->c_str();
|
|
||||||
- if ( !strcmp( name, "NextPage" ) )
|
|
||||||
+ const std::string& name = ((LinkNamed *)a)->getName();
|
|
||||||
+ if ( name == "NextPage" )
|
|
||||||
popplerLink = new LinkAction( linkArea, LinkAction::PageNext );
|
|
||||||
- else if ( !strcmp( name, "PrevPage" ) )
|
|
||||||
+ else if ( name == "PrevPage" )
|
|
||||||
popplerLink = new LinkAction( linkArea, LinkAction::PagePrev );
|
|
||||||
- else if ( !strcmp( name, "FirstPage" ) )
|
|
||||||
+ else if ( name == "FirstPage" )
|
|
||||||
popplerLink = new LinkAction( linkArea, LinkAction::PageFirst );
|
|
||||||
- else if ( !strcmp( name, "LastPage" ) )
|
|
||||||
+ else if ( name == "LastPage" )
|
|
||||||
popplerLink = new LinkAction( linkArea, LinkAction::PageLast );
|
|
||||||
- else if ( !strcmp( name, "GoBack" ) )
|
|
||||||
+ else if ( name == "GoBack" )
|
|
||||||
popplerLink = new LinkAction( linkArea, LinkAction::HistoryBack );
|
|
||||||
- else if ( !strcmp( name, "GoForward" ) )
|
|
||||||
+ else if ( name == "GoForward" )
|
|
||||||
popplerLink = new LinkAction( linkArea, LinkAction::HistoryForward );
|
|
||||||
- else if ( !strcmp( name, "Quit" ) )
|
|
||||||
+ else if ( name == "Quit" )
|
|
||||||
popplerLink = new LinkAction( linkArea, LinkAction::Quit );
|
|
||||||
- else if ( !strcmp( name, "GoToPage" ) )
|
|
||||||
+ else if ( name == "GoToPage" )
|
|
||||||
popplerLink = new LinkAction( linkArea, LinkAction::GoToPage );
|
|
||||||
- else if ( !strcmp( name, "Find" ) )
|
|
||||||
+ else if ( name == "Find" )
|
|
||||||
popplerLink = new LinkAction( linkArea, LinkAction::Find );
|
|
||||||
- else if ( !strcmp( name, "FullScreen" ) )
|
|
||||||
+ else if ( name == "FullScreen" )
|
|
||||||
popplerLink = new LinkAction( linkArea, LinkAction::Presentation );
|
|
||||||
- else if ( !strcmp( name, "Print" ) )
|
|
||||||
+ else if ( name == "Print" )
|
|
||||||
popplerLink = new LinkAction( linkArea, LinkAction::Print );
|
|
||||||
- else if ( !strcmp( name, "Close" ) )
|
|
||||||
+ else if ( name == "Close" )
|
|
||||||
{
|
|
||||||
// acroread closes the document always, doesnt care whether
|
|
||||||
// its presentation mode or not
|
|
||||||
@@ -149,7 +149,7 @@ Link* PageData::convertLinkActionToLink(
|
|
||||||
|
|
||||||
case actionURI:
|
|
||||||
{
|
|
||||||
- popplerLink = new LinkBrowse( linkArea, ((LinkURI *)a)->getURI()->c_str() );
|
|
||||||
+ popplerLink = new LinkBrowse( linkArea, ((LinkURI *)a)->getURI().c_str() );
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
@@ -362,6 +362,10 @@ QImage Page::renderToImage(double xres,
|
|
||||||
splash_output.setFreeTypeHinting(m_page->parentDoc->m_hints & Document::TextHinting ? true : false,
|
|
||||||
m_page->parentDoc->m_hints & Document::TextSlightHinting ? true : false);
|
|
||||||
|
|
||||||
+#ifdef USE_CMS
|
|
||||||
+ splash_output.setDisplayProfile(m_page->parentDoc->m_displayProfile);
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
splash_output.startDoc(m_page->parentDoc->doc);
|
|
||||||
|
|
||||||
m_page->parentDoc->doc->displayPageSlice(&splash_output, m_page->index + 1, xres, yres,
|
|
||||||
@@ -442,6 +447,11 @@ bool Page::renderToPainter(QPainter* pai
|
|
||||||
painter->translate(x == -1 ? 0 : -x, y == -1 ? 0 : -y);
|
|
||||||
ArthurOutputDev arthur_output(painter);
|
|
||||||
arthur_output.startDoc(m_page->parentDoc->doc->getXRef());
|
|
||||||
+
|
|
||||||
+#ifdef USE_CMS
|
|
||||||
+ arthur_output.setDisplayProfile(m_page->parentDoc->m_displayProfile);
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
m_page->parentDoc->doc->displayPageSlice(&arthur_output,
|
|
||||||
m_page->index + 1,
|
|
||||||
xres,
|
|
||||||
@@ -671,12 +681,11 @@ Link *Page::action( PageAction act ) con
|
|
||||||
Dict *dict = o.getDict();
|
|
||||||
const char *key = act == Page::Opening ? "O" : "C";
|
|
||||||
Object o2 = dict->lookup((char*)key);
|
|
||||||
- ::LinkAction *lact = ::LinkAction::parseAction(&o2, m_page->parentDoc->doc->getCatalog()->getBaseURI() );
|
|
||||||
+ std::unique_ptr<::LinkAction> lact = ::LinkAction::parseAction(&o2, m_page->parentDoc->doc->getCatalog()->getBaseURI() );
|
|
||||||
Link *popplerLink = NULL;
|
|
||||||
if (lact != NULL)
|
|
||||||
{
|
|
||||||
- popplerLink = m_page->convertLinkActionToLink(lact, QRectF());
|
|
||||||
- delete lact;
|
|
||||||
+ popplerLink = m_page->convertLinkActionToLink(lact.get(), QRectF());
|
|
||||||
}
|
|
||||||
return popplerLink;
|
|
||||||
}
|
|
||||||
--- poppler-0.90.0/qt4/src/poppler-private.cc
|
|
||||||
+++ poppler-0.90.0/qt4/src/poppler-private.cc
|
|
||||||
@@ -49,15 +49,13 @@ namespace Debug {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
- static UnicodeMap *utf8Map = 0;
|
|
||||||
-
|
|
||||||
void setDebugErrorFunction(PopplerDebugFunc function, const QVariant &closure)
|
|
||||||
{
|
|
||||||
Debug::debugFunction = function ? function : Debug::qDebugDebugFunction;
|
|
||||||
Debug::debugClosure = closure;
|
|
||||||
}
|
|
||||||
|
|
||||||
- static void qt4ErrorFunction(void * /*data*/, ErrorCategory /*category*/, Goffset pos, const char *msg)
|
|
||||||
+ void qt4ErrorFunction(ErrorCategory /*category*/, Goffset pos, const char *msg)
|
|
||||||
{
|
|
||||||
QString emsg;
|
|
||||||
|
|
||||||
@@ -74,12 +72,7 @@ namespace Debug {
|
|
||||||
}
|
|
||||||
|
|
||||||
QString unicodeToQString(const Unicode* u, int len) {
|
|
||||||
- if (!utf8Map)
|
|
||||||
- {
|
|
||||||
- GooString enc("UTF-8");
|
|
||||||
- utf8Map = globalParams->getUnicodeMap(&enc);
|
|
||||||
- utf8Map->incRefCnt();
|
|
||||||
- }
|
|
||||||
+ const UnicodeMap *utf8Map = globalParams->getUtf8Map();
|
|
||||||
|
|
||||||
// ignore the last character if it is 0x0
|
|
||||||
if ((len > 0) && (u[len - 1] == 0))
|
|
||||||
@@ -99,34 +92,25 @@ namespace Debug {
|
|
||||||
}
|
|
||||||
|
|
||||||
QString UnicodeParsedString(const GooString *s1) {
|
|
||||||
- if ( !s1 || s1->getLength() == 0 )
|
|
||||||
+ return (s1) ? UnicodeParsedString(s1->toStr()) : QString();
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ QString UnicodeParsedString(const std::string& s1) {
|
|
||||||
+ if ( s1.empty() )
|
|
||||||
return QString();
|
|
||||||
|
|
||||||
- const char *cString;
|
|
||||||
- int stringLength;
|
|
||||||
- bool deleteCString;
|
|
||||||
- if ( ( s1->getChar(0) & 0xff ) == 0xfe && ( s1->getLength() > 1 && ( s1->getChar(1) & 0xff ) == 0xff ) )
|
|
||||||
- {
|
|
||||||
- cString = s1->c_str();
|
|
||||||
- stringLength = s1->getLength();
|
|
||||||
- deleteCString = false;
|
|
||||||
- }
|
|
||||||
- else
|
|
||||||
+ if ( GooString::hasUnicodeMarker(s1) || GooString::hasUnicodeMarkerLE(s1) )
|
|
||||||
{
|
|
||||||
- cString = pdfDocEncodingToUTF16(s1, &stringLength);
|
|
||||||
- deleteCString = true;
|
|
||||||
+ return QString::fromUtf16(reinterpret_cast<const ushort *>(s1.c_str()), s1.size() / 2);
|
|
||||||
}
|
|
||||||
-
|
|
||||||
- QString result;
|
|
||||||
- // i = 2 to skip the unicode marker
|
|
||||||
- for ( int i = 2; i < stringLength; i += 2 )
|
|
||||||
+ else
|
|
||||||
{
|
|
||||||
- const Unicode u = ( ( cString[i] & 0xff ) << 8 ) | ( cString[i+1] & 0xff );
|
|
||||||
- result += QChar( u );
|
|
||||||
- }
|
|
||||||
- if (deleteCString)
|
|
||||||
+ int stringLength;
|
|
||||||
+ const char *cString = pdfDocEncodingToUTF16(s1, &stringLength);
|
|
||||||
+ auto result = QString::fromUtf16(reinterpret_cast<const ushort *>(cString), stringLength / 2);
|
|
||||||
delete[] cString;
|
|
||||||
- return result;
|
|
||||||
+ return result;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
GooString *QStringToUnicodeGooString(const QString &s) {
|
|
||||||
@@ -221,7 +205,7 @@ namespace Debug {
|
|
||||||
case actionURI:
|
|
||||||
{
|
|
||||||
const LinkURI * u = static_cast< const LinkURI * >( a );
|
|
||||||
- e->setAttribute( "DestinationURI", u->getURI()->c_str() );
|
|
||||||
+ e->setAttribute( "DestinationURI", u->getURI().c_str() );
|
|
||||||
}
|
|
||||||
default: ;
|
|
||||||
}
|
|
||||||
@@ -233,13 +217,6 @@ namespace Debug {
|
|
||||||
delete (OptContentModel *)m_optContentModel;
|
|
||||||
delete doc;
|
|
||||||
delete m_fontInfoIterator;
|
|
||||||
-
|
|
||||||
- count --;
|
|
||||||
- if ( count == 0 )
|
|
||||||
- {
|
|
||||||
- utf8Map = nullptr;
|
|
||||||
- globalParams.reset();
|
|
||||||
- }
|
|
||||||
}
|
|
||||||
|
|
||||||
void DocumentData::init()
|
|
||||||
@@ -249,14 +226,6 @@ namespace Debug {
|
|
||||||
paperColor = Qt::white;
|
|
||||||
m_hints = 0;
|
|
||||||
m_optContentModel = 0;
|
|
||||||
-
|
|
||||||
- if ( count == 0 )
|
|
||||||
- {
|
|
||||||
- utf8Map = nullptr;
|
|
||||||
- globalParams = std::make_unique<GlobalParams>();
|
|
||||||
- setErrorCallback(qt4ErrorFunction, nullptr);
|
|
||||||
- }
|
|
||||||
- count ++;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
--- poppler-0.90.0/qt4/src/poppler-private.h
|
|
||||||
+++ poppler-0.90.0/qt4/src/poppler-private.h
|
|
||||||
@@ -55,6 +55,8 @@ class FormWidget;
|
|
||||||
QString unicodeToQString(const Unicode* u, int len);
|
|
||||||
|
|
||||||
QString UnicodeParsedString(const GooString *s1);
|
|
||||||
+
|
|
||||||
+ QString UnicodeParsedString(const std::string& s1);
|
|
||||||
|
|
||||||
GooString *QStringToUnicodeGooString(const QString &s);
|
|
||||||
|
|
||||||
@@ -65,7 +67,7 @@ namespace Poppler {
|
|
||||||
|
|
||||||
GooString *QDateTimeToUnicodeGooString(const QDateTime &dt);
|
|
||||||
|
|
||||||
- void qt4ErrorFunction(int pos, char *msg, va_list args);
|
|
||||||
+ void qt4ErrorFunction(ErrorCategory /*category*/, Goffset pos, const char *msg);
|
|
||||||
|
|
||||||
class LinkDestinationData
|
|
||||||
{
|
|
||||||
@@ -65,9 +67,10 @@ namespace Poppler {
|
|
||||||
bool externalDest;
|
|
||||||
};
|
|
||||||
|
|
||||||
- class DocumentData {
|
|
||||||
+ class DocumentData : private GlobalParamsIniter {
|
|
||||||
public:
|
|
||||||
- DocumentData(const QString &filePath, GooString *ownerPassword, GooString *userPassword)
|
|
||||||
+ DocumentData(const QString &filePath, GooString *ownerPassword, GooString *userPassword) :
|
|
||||||
+ GlobalParamsIniter(qt4ErrorFunction)
|
|
||||||
{
|
|
||||||
init();
|
|
||||||
m_filePath = filePath;
|
|
||||||
@@ -102,7 +105,8 @@ namespace Poppler {
|
|
||||||
delete userPassword;
|
|
||||||
}
|
|
||||||
|
|
||||||
- DocumentData(const QByteArray &data, GooString *ownerPassword, GooString *userPassword)
|
|
||||||
+ DocumentData(const QByteArray &data, GooString *ownerPassword, GooString *userPassword) :
|
|
||||||
+ GlobalParamsIniter(qt4ErrorFunction)
|
|
||||||
{
|
|
||||||
fileContents = data;
|
|
||||||
MemStream *str = new MemStream((char*)fileContents.data(), 0, fileContents.length(), Object(objNull));
|
|
||||||
@@ -148,7 +152,10 @@ namespace Poppler {
|
|
||||||
QPointer<OptContentModel> m_optContentModel;
|
|
||||||
QColor paperColor;
|
|
||||||
int m_hints;
|
|
||||||
- static int count;
|
|
||||||
+#ifdef USE_CMS
|
|
||||||
+ GfxLCMSProfilePtr m_sRGBProfile;
|
|
||||||
+ GfxLCMSProfilePtr m_displayProfile;
|
|
||||||
+#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
class FontInfoData
|
|
||||||
--- poppler-0.90.0/qt4/src/poppler-ps-converter.cc
|
|
||||||
+++ poppler-0.90.0/qt4/src/poppler-ps-converter.cc
|
|
||||||
@@ -235,7 +235,7 @@ bool PSConverter::convert()
|
|
||||||
d->marginBottom,
|
|
||||||
d->paperWidth - d->marginRight,
|
|
||||||
d->paperHeight - d->marginTop,
|
|
||||||
- (d->opts & ForceRasterization));
|
|
||||||
+ (d->opts & ForceRasterization) ? psAlwaysRasterize : psRasterizeWhenNeeded);
|
|
||||||
|
|
||||||
if (d->opts & StrictMargins)
|
|
||||||
{
|
|
||||||
--- poppler-0.90.0/qt4/src/poppler-sound.cc
|
|
||||||
+++ poppler-0.90.0/qt4/src/poppler-sound.cc
|
|
||||||
@@ -75,8 +75,7 @@ QString SoundObject::url() const
|
|
||||||
if ( m_soundData->m_type != SoundObject::External )
|
|
||||||
return QString();
|
|
||||||
|
|
||||||
- const GooString * goo = m_soundData->m_soundObj->getFileName();
|
|
||||||
- return goo ? QString( goo->c_str() ) : QString();
|
|
||||||
+ return QString( m_soundData->m_soundObj->getFileName().c_str() );
|
|
||||||
}
|
|
||||||
|
|
||||||
QByteArray SoundObject::data() const
|
|
@ -11,16 +11,17 @@ index 26a51b4..27be2b9 100644
|
|||||||
|
|
||||||
if (g_once_init_enter (&g_define_type_id__volatile)) {
|
if (g_once_init_enter (&g_define_type_id__volatile)) {
|
||||||
static const G@Type@Value values[] = {
|
static const G@Type@Value values[] = {
|
||||||
|
|
||||||
diff --git a/glib/poppler-private.h b/glib/poppler-private.h
|
diff --git a/glib/poppler-private.h b/glib/poppler-private.h
|
||||||
index 7726ec7..436bca5 100644
|
index 7726ec7..436bca5 100644
|
||||||
--- a/glib/poppler-private.h
|
--- a/glib/poppler-private.h
|
||||||
+++ b/glib/poppler-private.h
|
+++ b/glib/poppler-private.h
|
||||||
@@ -167,7 +167,7 @@ gboolean _poppler_convert_pdf_date_to_gtime (const GooString *date,
|
@@ -167,7 +167,7 @@ gboolean _poppler_convert_pdf_date_to_gtime (const GooString *date,
|
||||||
GType \
|
#define POPPLER_DEFINE_BOXED_TYPE(TypeName, type_name, copy_func, free_func) \
|
||||||
type_name##_get_type (void) \
|
GType type_name##_get_type(void) \
|
||||||
{ \
|
{ \
|
||||||
- static volatile gsize g_define_type_id__volatile = 0; \
|
- static volatile gsize g_define_type_id__volatile = 0; \
|
||||||
+ static gsize g_define_type_id__volatile = 0; \
|
+ static gsize g_define_type_id__volatile = 0; \
|
||||||
if (g_once_init_enter (&g_define_type_id__volatile)) { \
|
if (g_once_init_enter(&g_define_type_id__volatile)) { \
|
||||||
GType g_define_type_id = \
|
GType g_define_type_id = g_boxed_type_register_static(g_intern_static_string(#TypeName), (GBoxedCopyFunc)copy_func, (GBoxedFreeFunc)free_func); \
|
||||||
g_boxed_type_register_static (g_intern_static_string (#TypeName), \
|
g_once_init_leave(&g_define_type_id__volatile, g_define_type_id); \
|
||||||
|
85
poppler.spec
85
poppler.spec
@ -1,10 +1,10 @@
|
|||||||
%global test_sha 45f55f1e03b9bf3fbd334c31776b6f5e472889ec
|
%global test_sha 03a4b9eb854a06a83c465e82de601796c458bbe9
|
||||||
%global test_date 2018-12-18
|
%global test_date 2021-01-11
|
||||||
|
|
||||||
Summary: PDF rendering library
|
Summary: PDF rendering library
|
||||||
Name: poppler
|
Name: poppler
|
||||||
Version: 0.90.0
|
Version: 21.01.0
|
||||||
Release: 8%{?dist}
|
Release: 1%{?dist}
|
||||||
License: (GPLv2 or GPLv3) and GPLv2+ and LGPLv2+ and MIT
|
License: (GPLv2 or GPLv3) and GPLv2+ and LGPLv2+ and MIT
|
||||||
URL: http://poppler.freedesktop.org/
|
URL: http://poppler.freedesktop.org/
|
||||||
Source0: http://poppler.freedesktop.org/poppler-%{version}.tar.xz
|
Source0: http://poppler.freedesktop.org/poppler-%{version}.tar.xz
|
||||||
@ -14,26 +14,10 @@ Source1: %{name}-test-%{test_date}-%{test_sha}.tar.xz
|
|||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1185007
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1185007
|
||||||
Patch0: poppler-0.30.0-rotated-words-selection.patch
|
Patch0: poppler-0.30.0-rotated-words-selection.patch
|
||||||
|
|
||||||
%if 0%{?fedora}
|
Patch1: poppler-0.90.0-position-independent-code.patch
|
||||||
Patch1: 0001-Revert-Remove-the-Qt4-frontend.patch
|
|
||||||
|
|
||||||
Patch3: poppler-0.67.0-qt4-const.patch
|
|
||||||
%endif
|
|
||||||
|
|
||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1696636
|
|
||||||
Patch4: poppler-0.73.0-PSOutputDev-buffer-read.patch
|
|
||||||
|
|
||||||
Patch5: poppler-0.84.0-MacroPushRequiredVars.patch
|
|
||||||
|
|
||||||
%if 0%{?fedora}
|
|
||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1673727
|
|
||||||
Patch6: poppler-0.90.0-qt4-update.patch
|
|
||||||
%endif
|
|
||||||
|
|
||||||
Patch7: poppler-0.90.0-position-independent-code.patch
|
|
||||||
|
|
||||||
# Bogus volatiles detected by gcc-11
|
# Bogus volatiles detected by gcc-11
|
||||||
Patch8: %{name}-gcc11.patch
|
Patch2: %{name}-gcc11.patch
|
||||||
|
|
||||||
BuildRequires: make
|
BuildRequires: make
|
||||||
BuildRequires: cmake
|
BuildRequires: cmake
|
||||||
@ -64,12 +48,6 @@ BuildRequires: pkgconfig(Qt5Gui)
|
|||||||
BuildRequires: pkgconfig(Qt5Test)
|
BuildRequires: pkgconfig(Qt5Test)
|
||||||
BuildRequires: pkgconfig(Qt5Widgets)
|
BuildRequires: pkgconfig(Qt5Widgets)
|
||||||
BuildRequires: pkgconfig(Qt5Xml)
|
BuildRequires: pkgconfig(Qt5Xml)
|
||||||
%if 0%{?fedora}
|
|
||||||
BuildRequires: pkgconfig(QtCore)
|
|
||||||
BuildRequires: pkgconfig(QtGui)
|
|
||||||
BuildRequires: pkgconfig(QtTest)
|
|
||||||
BuildRequires: pkgconfig(QtXml)
|
|
||||||
%endif
|
|
||||||
|
|
||||||
Requires: poppler-data
|
Requires: poppler-data
|
||||||
|
|
||||||
@ -109,27 +87,6 @@ BuildArch: noarch
|
|||||||
%description glib-doc
|
%description glib-doc
|
||||||
%{summary}.
|
%{summary}.
|
||||||
|
|
||||||
%if 0%{?fedora}
|
|
||||||
%package qt
|
|
||||||
Summary: Qt4 wrapper for poppler
|
|
||||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
||||||
%{?_qt4:Requires: qt4%{?_isa} >= %{_qt4_version}}
|
|
||||||
Obsoletes: poppler-qt4 < 0.16.0-3
|
|
||||||
Provides: poppler-qt4 = %{version}-%{release}
|
|
||||||
%description qt
|
|
||||||
%{summary}.
|
|
||||||
|
|
||||||
%package qt-devel
|
|
||||||
Summary: Development files for Qt4 wrapper
|
|
||||||
Requires: %{name}-qt%{?_isa} = %{version}-%{release}
|
|
||||||
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
|
|
||||||
Obsoletes: poppler-qt4-devel < 0.16.0-3
|
|
||||||
Provides: poppler-qt4-devel = %{version}-%{release}
|
|
||||||
Requires: qt4-devel
|
|
||||||
%description qt-devel
|
|
||||||
%{summary}.
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%package qt5
|
%package qt5
|
||||||
Summary: Qt5 wrapper for poppler
|
Summary: Qt5 wrapper for poppler
|
||||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||||
@ -169,6 +126,8 @@ other formats.
|
|||||||
%prep
|
%prep
|
||||||
%autosetup -p1 -b 1
|
%autosetup -p1 -b 1
|
||||||
|
|
||||||
|
chmod -x poppler/CairoFontEngine.cc
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%cmake \
|
%cmake \
|
||||||
-DENABLE_CMS=lcms2 \
|
-DENABLE_CMS=lcms2 \
|
||||||
@ -189,23 +148,14 @@ other formats.
|
|||||||
# verify pkg-config sanity/version
|
# verify pkg-config sanity/version
|
||||||
export PKG_CONFIG_PATH=%{buildroot}%{_datadir}/pkgconfig:%{buildroot}%{_libdir}/pkgconfig
|
export PKG_CONFIG_PATH=%{buildroot}%{_datadir}/pkgconfig:%{buildroot}%{_libdir}/pkgconfig
|
||||||
test "$(pkg-config --modversion poppler)" = "%{version}"
|
test "$(pkg-config --modversion poppler)" = "%{version}"
|
||||||
test "$(pkg-config --modversion poppler-cairo)" = "%{version}"
|
|
||||||
test "$(pkg-config --modversion poppler-cpp)" = "%{version}"
|
test "$(pkg-config --modversion poppler-cpp)" = "%{version}"
|
||||||
test "$(pkg-config --modversion poppler-glib)" = "%{version}"
|
test "$(pkg-config --modversion poppler-glib)" = "%{version}"
|
||||||
%if 0%{?fedora}
|
|
||||||
test "$(pkg-config --modversion poppler-qt4)" = "%{version}"
|
|
||||||
%endif
|
|
||||||
test "$(pkg-config --modversion poppler-qt5)" = "%{version}"
|
test "$(pkg-config --modversion poppler-qt5)" = "%{version}"
|
||||||
test "$(pkg-config --modversion poppler-splash)" = "%{version}"
|
|
||||||
|
|
||||||
%ldconfig_scriptlets
|
%ldconfig_scriptlets
|
||||||
|
|
||||||
%ldconfig_scriptlets glib
|
%ldconfig_scriptlets glib
|
||||||
|
|
||||||
%if 0%{?fedora}
|
|
||||||
%ldconfig_scriptlets qt
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%ldconfig_scriptlets qt5
|
%ldconfig_scriptlets qt5
|
||||||
|
|
||||||
%ldconfig_scriptlets cpp
|
%ldconfig_scriptlets cpp
|
||||||
@ -213,11 +163,10 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}"
|
|||||||
%files
|
%files
|
||||||
%doc README.md
|
%doc README.md
|
||||||
%license COPYING
|
%license COPYING
|
||||||
%{_libdir}/libpoppler.so.101*
|
%{_libdir}/libpoppler.so.106*
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%{_libdir}/pkgconfig/poppler.pc
|
%{_libdir}/pkgconfig/poppler.pc
|
||||||
%{_libdir}/pkgconfig/poppler-splash.pc
|
|
||||||
%{_libdir}/libpoppler.so
|
%{_libdir}/libpoppler.so
|
||||||
%dir %{_includedir}/poppler/
|
%dir %{_includedir}/poppler/
|
||||||
# xpdf headers
|
# xpdf headers
|
||||||
@ -232,7 +181,6 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}"
|
|||||||
|
|
||||||
%files glib-devel
|
%files glib-devel
|
||||||
%{_libdir}/pkgconfig/poppler-glib.pc
|
%{_libdir}/pkgconfig/poppler-glib.pc
|
||||||
%{_libdir}/pkgconfig/poppler-cairo.pc
|
|
||||||
%{_libdir}/libpoppler-glib.so
|
%{_libdir}/libpoppler-glib.so
|
||||||
%{_datadir}/gir-1.0/Poppler-0.18.gir
|
%{_datadir}/gir-1.0/Poppler-0.18.gir
|
||||||
%{_includedir}/poppler/glib/
|
%{_includedir}/poppler/glib/
|
||||||
@ -241,16 +189,6 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}"
|
|||||||
%license COPYING
|
%license COPYING
|
||||||
%{_datadir}/gtk-doc/
|
%{_datadir}/gtk-doc/
|
||||||
|
|
||||||
%if 0%{?fedora}
|
|
||||||
%files qt
|
|
||||||
%{_libdir}/libpoppler-qt4.so.4*
|
|
||||||
|
|
||||||
%files qt-devel
|
|
||||||
%{_libdir}/libpoppler-qt4.so
|
|
||||||
%{_libdir}/pkgconfig/poppler-qt4.pc
|
|
||||||
%{_includedir}/poppler/qt4/
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%files qt5
|
%files qt5
|
||||||
%{_libdir}/libpoppler-qt5.so.1*
|
%{_libdir}/libpoppler-qt5.so.1*
|
||||||
|
|
||||||
@ -272,6 +210,11 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}"
|
|||||||
%{_mandir}/man1/*
|
%{_mandir}/man1/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Jan 11 2021 Marek Kasik <mkasik@redhat.com> - 21.01.0-1
|
||||||
|
- Update to 21.01.0
|
||||||
|
- Remove the Qt4 frontend
|
||||||
|
- Resolves: #1673727
|
||||||
|
|
||||||
* Mon Dec 07 2020 Marek Kasik <mkasik@redhat.com> - 0.90.0-8
|
* Mon Dec 07 2020 Marek Kasik <mkasik@redhat.com> - 0.90.0-8
|
||||||
- Build Qt4 frontend on Fedora only
|
- Build Qt4 frontend on Fedora only
|
||||||
|
|
||||||
|
4
sources
4
sources
@ -1,2 +1,2 @@
|
|||||||
SHA512 (poppler-0.90.0.tar.xz) = 3b2a45c7fcdc41b0dad80b6454cd8bb50a6625537edbc537898790ef4b6425bb62e1934fd2aaa8565be9c045ab1ac40a8de2e939c5b5abf0254d8e6c833b4450
|
SHA512 (poppler-test-2021-01-11-03a4b9eb854a06a83c465e82de601796c458bbe9.tar.xz) = 257133b261b07076d3207456e3edad324e29911a45a960d4953eb84813ac175bc65be713a10454b52b96711870fcbeee533fd0fd7de8550a87390e833b1af8c5
|
||||||
SHA512 (poppler-test-2018-12-18-45f55f1e03b9bf3fbd334c31776b6f5e472889ec.tar.xz) = fa1d8c92ca5bc9ebd7453dfb78f34fb44d014621fe698aa4a3fa9bd17bd0d302ca6ba36f4dd46a1ef030c0b7a30729d4bacb6d01c5c67d429c897e4f5ab331e8
|
SHA512 (poppler-21.01.0.tar.xz) = aec130446df73a2fc66851a563a14cb40299212a2de4a0d03668b0fecb28312fffa70d0a82431c774d0c0e3f7293788bd2bdf28c8136aa09ad80edbca4cf0ddd
|
||||||
|
Loading…
Reference in New Issue
Block a user