summaryrefslogtreecommitdiff
path: root/poppler
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2005-12-03 23:23:53 +0000
committerKristian Høgsberg <krh@redhat.com>2005-12-03 23:23:53 +0000
commit58de0458e17b1639ce0bcae45a4b09b2c0a56618 (patch)
tree48248c39558ec655dfd4311bcbf6874e9b3b94cb /poppler
parentdf45483f1437d8a96519e1428d1f4b3ffc08c2cd (diff)
2005-12-03 Kristian Høgsberg <krh@redhat.com>
* qt/Makefile.am (noinst_PROGRAMS): Only build qt test program if splash is enabled. * poppler/CairoOutputDev.cc: Remove unused grid snapping code, sidestepping #4507. * glib/poppler-document.h (PopplerPermissions): Breaking enum definition over multiple lines confuses glib-mkenums (#4600). * poppler/Makefile.am (libpoppler_la_LIBADD): Add FREETYPE_LIBS (#4515). * poppler/TextOutputDev.cc: * qt/poppler-qt.h: GCC-4.1 fixes (#5031).
Diffstat (limited to 'poppler')
-rw-r--r--poppler/CairoOutputDev.cc35
-rw-r--r--poppler/CairoOutputDev.h2
-rw-r--r--poppler/Makefile.am3
-rw-r--r--poppler/TextOutputDev.cc2
4 files changed, 13 insertions, 29 deletions
diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc
index 4a73edab..9203ed16 100644
--- a/poppler/CairoOutputDev.cc
+++ b/poppler/CairoOutputDev.cc
@@ -33,8 +33,6 @@
//------------------------------------------------------------------------
-#define soutRound(x) ((int)(x + 0.5))
-
// #define LOG_CAIRO
#ifdef LOG_CAIRO
@@ -276,8 +274,7 @@ void CairoOutputDev::updateFont(GfxState *state) {
cairo_set_font_matrix (cairo, &matrix);
}
-void CairoOutputDev::doPath(GfxState *state, GfxPath *path,
- GBool snapToGrid) {
+void CairoOutputDev::doPath(GfxState *state, GfxPath *path) {
GfxSubpath *subpath;
double x1, y1, x2, y2, x3, y3;
int i, j;
@@ -286,9 +283,6 @@ void CairoOutputDev::doPath(GfxState *state, GfxPath *path,
subpath = path->getSubpath(i);
if (subpath->getNumPoints() > 0) {
state->transform(subpath->getX(0), subpath->getY(0), &x1, &y1);
- if (snapToGrid) {
- x1 = round (x1); y1 = round (y1);
- }
cairo_move_to (cairo, x1, y1);
LOG (printf ("move_to %f, %f\n", x1, y1));
j = 1;
@@ -297,11 +291,6 @@ void CairoOutputDev::doPath(GfxState *state, GfxPath *path,
state->transform(subpath->getX(j), subpath->getY(j), &x1, &y1);
state->transform(subpath->getX(j+1), subpath->getY(j+1), &x2, &y2);
state->transform(subpath->getX(j+2), subpath->getY(j+2), &x3, &y3);
- if (snapToGrid) {
- x1 = round (x1); y1 = round (y1);
- x2 = round (x2); y2 = round (y2);
- x3 = round (x3); y3 = round (y3);
- }
cairo_curve_to (cairo,
x1, y1,
x2, y2,
@@ -310,9 +299,6 @@ void CairoOutputDev::doPath(GfxState *state, GfxPath *path,
j += 3;
} else {
state->transform(subpath->getX(j), subpath->getY(j), &x1, &y1);
- if (snapToGrid) {
- x1 = round (x1); y1 = round (y1);
- }
cairo_line_to (cairo, x1, y1);
LOG(printf ("line_to %f, %f\n", x1, y1));
++j;
@@ -327,14 +313,14 @@ void CairoOutputDev::doPath(GfxState *state, GfxPath *path,
}
void CairoOutputDev::stroke(GfxState *state) {
- doPath (state, state->getPath(), gFalse);
+ doPath (state, state->getPath());
cairo_set_source (cairo, stroke_pattern);
LOG(printf ("stroke\n"));
cairo_stroke (cairo);
}
void CairoOutputDev::fill(GfxState *state) {
- doPath (state, state->getPath(), gFalse);
+ doPath (state, state->getPath());
cairo_set_fill_rule (cairo, CAIRO_FILL_RULE_WINDING);
cairo_set_source (cairo, fill_pattern);
LOG(printf ("fill\n"));
@@ -342,7 +328,7 @@ void CairoOutputDev::fill(GfxState *state) {
}
void CairoOutputDev::eoFill(GfxState *state) {
- doPath (state, state->getPath(), gFalse);
+ doPath (state, state->getPath());
cairo_set_fill_rule (cairo, CAIRO_FILL_RULE_EVEN_ODD);
cairo_set_source (cairo, fill_pattern);
LOG(printf ("fill-eo\n"));
@@ -350,14 +336,14 @@ void CairoOutputDev::eoFill(GfxState *state) {
}
void CairoOutputDev::clip(GfxState *state) {
- doPath (state, state->getPath(), gFalse);
+ doPath (state, state->getPath());
cairo_set_fill_rule (cairo, CAIRO_FILL_RULE_WINDING);
cairo_clip (cairo);
LOG (printf ("clip\n"));
}
void CairoOutputDev::eoClip(GfxState *state) {
- doPath (state, state->getPath(), gFalse);
+ doPath (state, state->getPath());
cairo_set_fill_rule (cairo, CAIRO_FILL_RULE_EVEN_ODD);
cairo_clip (cairo);
LOG (printf ("clip-eo\n"));
@@ -395,13 +381,10 @@ void CairoOutputDev::endString(GfxState *state)
if (!currentFont)
return;
- // check for invisible text -- this is used by Acrobat Capture
+ // ignore empty strings and invisible text -- this is used by
+ // Acrobat Capture
render = state->getRender();
- if (render == 3)
- return;
-
- // ignore empty strings
- if (glyphCount == 0) {
+ if (render == 3 || glyphCount == 0) {
gfree(glyphs);
glyphs = NULL;
return;
diff --git a/poppler/CairoOutputDev.h b/poppler/CairoOutputDev.h
index 80bc2fd4..ab790469 100644
--- a/poppler/CairoOutputDev.h
+++ b/poppler/CairoOutputDev.h
@@ -133,7 +133,7 @@ public:
void setSurface (cairo_surface_t *surface);
protected:
- void doPath(GfxState *state, GfxPath *path, GBool snapToGrid);
+ void doPath(GfxState *state, GfxPath *path);
GfxRGB fill_color, stroke_color;
cairo_pattern_t *fill_pattern, *stroke_pattern;
diff --git a/poppler/Makefile.am b/poppler/Makefile.am
index 796bb57c..1fa10f7b 100644
--- a/poppler/Makefile.am
+++ b/poppler/Makefile.am
@@ -90,7 +90,8 @@ libpoppler_la_LIBADD = \
$(cairo_libs) \
$(arthur_libs) \
$(libjpeg_libs) \
- $(zlib_libs)
+ $(zlib_libs) \
+ $(FREETYPE_LIBS)
poppler_includedir = $(includedir)/poppler
poppler_include_HEADERS = \
diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc
index d540ac3b..e8908183 100644
--- a/poppler/TextOutputDev.cc
+++ b/poppler/TextOutputDev.cc
@@ -3086,7 +3086,7 @@ public:
virtual void visitWord (TextWord *word, int begin, int end,
PDFRectangle *selection) { };
- GooString *TextSelectionDumper::getText(void);
+ GooString *getText(void);
private:
TextLineFrag *frags;