From f2a8a5be02e9c1d252813df41e0045fd974665d1 Mon Sep 17 00:00:00 2001 From: Jason Crain Date: Sat, 25 Feb 2012 03:15:54 -0600 Subject: [PATCH] Fixed display for selected glyph in ActualText span When text is selected in a pdf containing a ActualText span, glyphs are not visible because the CharCode is 0. This sets the correct CharCode. --- poppler/TextOutputDev.cc | 3 ++- poppler/TextOutputDev.h | 1 + 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc index 531617d..db10d09 100644 --- a/poppler/TextOutputDev.cc +++ b/poppler/TextOutputDev.cc @@ -5222,6 +5222,7 @@ void ActualText::addChar(GfxState *state, double x, double y, if (!actualTextNBytes) { actualTextX0 = x; actualTextY0 = y; + charcode = c; } actualTextX1 = x + dx; actualTextY1 = y + dy; @@ -5270,7 +5271,7 @@ void ActualText::end(GfxState *state) { // text->addChar() text->addChar(state, actualTextX0, actualTextY0, actualTextX1 - actualTextX0, actualTextY1 - actualTextY0, - 0, actualTextNBytes, uni, length); + charcode, actualTextNBytes, uni, length); delete [] uni; if (!actualText->hasUnicodeMarker()) diff --git a/poppler/TextOutputDev.h b/poppler/TextOutputDev.h index e31876b..bf0389a 100644 --- a/poppler/TextOutputDev.h +++ b/poppler/TextOutputDev.h @@ -661,6 +661,7 @@ private: double actualTextX1; double actualTextY1; int actualTextNBytes; + CharCode charcode; }; -- 1.7.5.4