From d6cccfb8d814d89c51c9e65563be2e475f46212b Mon Sep 17 00:00:00 2001 From: Nelson Benítez León Date: Mon, 8 Feb 2021 14:06:15 -0400 Subject: TextSelectionDumper: Fix getText() for space after word Fix TextSelectionDumper::getText() (which is currently only used by the glib frontend) to not default to add a space after word in the case the word is explicitly set to not carry that space by means of the 'spaceAfter' TextWord field. Fixes issue #1042 --- poppler/TextOutputDev.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc index 451b4cb6..10a3b5f3 100644 --- a/poppler/TextOutputDev.cc +++ b/poppler/TextOutputDev.cc @@ -4420,7 +4420,7 @@ GooString *TextSelectionDumper::getText() TextWordSelection *sel = (*lineWords)[j]; page->dumpFragment(sel->word->text + sel->begin, sel->end - sel->begin, uMap, text); - if (j < lineWords->size() - 1) + if (j < lineWords->size() - 1 && sel->word->spaceAfter) text->append(space, spaceLen); } if (i < nLines - 1) -- cgit v1.2.3