From f89630b374367f8ba60970ed2782bec17210a197 Mon Sep 17 00:00:00 2001 From: Brian Ewins Date: Mon, 13 Apr 2009 11:45:15 +0100 Subject: [PATCH 2/2] Fix bug 3188, do not re-sort selected text With the application of the previous patch to iterate over the selection in reading order, we no longer need to sort the selected text vertically. This patch simply bypasses the sorts, and gives the desired result - pasted text is in reading order. However, the output is not as clean as TextPage::dump yet, and the two mechanisms should share code. --- poppler/TextOutputDev.cc | 14 +++----------- 1 files changed, 3 insertions(+), 11 deletions(-) diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc index cd99de3..dd571da 100755 --- a/poppler/TextOutputDev.cc +++ b/poppler/TextOutputDev.cc @@ -3543,17 +3543,9 @@ GooString *TextSelectionDumper::getText (void) for (i = 0; i < nFrags; ++i) { frags[i].computeCoords(oneRot); } - page->assignColumns(frags, nFrags, oneRot); - - // if all lines in the region have the same rotation, use it; - // otherwise, use the page's primary rotation - if (oneRot) { - qsort(frags, nFrags, sizeof(TextLineFrag), - &TextLineFrag::cmpYXLineRot); - } else { - qsort(frags, nFrags, sizeof(TextLineFrag), - &TextLineFrag::cmpYXPrimaryRot); - } + // ignore rotation, since text is already + // in reading order. + page->assignColumns(frags, nFrags, 0); col = 0; multiLine = gFalse; -- 1.6.2.2