[poppler] [PATCH] Poppler: Fix line selection, dont check y for Line selection

Sam Liao phyomh at gmail.com
Sun Jan 23 03:43:28 PST 2011


As attached.

Thanks.
-Sam

On Sun, Jan 23, 2011 at 7:32 PM, Carlos Garcia Campos
<carlosgc at gnome.org> wrote:
> Excerpts from Sam Liao's message of lun ene 17 10:26:30 +0100 2011:
>> When a line is selected while the Y values of selection is
>> not in the y range of words, the render will render the
>> line with reverse color while the words does not show up.
>>
>> This fix neglect the Y vaules to make sure that the words
>> also displayed when line is selected.
>
> Could send the patch again as an attachment, please?
>
>> ---
>> poppler/TextOutputDev.cc |   16 ++++++++--------
>> 1 files changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc
>> index 576bcc9..71b946e 100644
>> --- a/poppler/TextOutputDev.cc
>> +++ b/poppler/TextOutputDev.cc
>> @@ -4249,24 +4249,24 @@ void
>> TextLine::visitSelection(TextSelectionVisitor *visitor,
>>   current = NULL;
>>   for (p = words; p != NULL; p = p->next) {
>>     if (blk->page->primaryLR) {
>> -      if ((selection->x1 < p->xMax && selection->y1 < p->yMax) ||
>> -  (selection->x2 < p->xMax && selection->y2 < p->yMax))
>> +      if ((selection->x1 < p->xMax) ||
>> +  (selection->x2 < p->xMax))
>>         if (begin == NULL)
>>  begin = p;
>>
>> -      if (((selection->x1 > p->xMin && selection->y1 > p->yMin) ||
>> -   (selection->x2 > p->xMin && selection->y2 > p->yMin)) && (begin != NULL)) {
>> +      if (((selection->x1 > p->xMin) ||
>> +   (selection->x2 > p->xMin)) && (begin != NULL)) {
>>         end = p->next;
>>         current = p;
>>       }
>>     } else {
>> -      if ((selection->x1 > p->xMin && selection->y1 < p->yMax) ||
>> -  (selection->x2 > p->xMin && selection->y2 < p->yMax))
>> +      if ((selection->x1 > p->xMin) ||
>> +  (selection->x2 > p->xMin))
>>         if (begin == NULL)
>>  begin = p;
>>
>> -      if (((selection->x1 < p->xMax && selection->y1 > p->yMin) ||
>> -   (selection->x2 < p->xMax && selection->y2 > p->yMin)) && (begin != NULL)) {
>> +      if (((selection->x1 < p->xMax) ||
>> +   (selection->x2 < p->xMax)) && (begin != NULL)) {
>>         end = p->next;
>>         current = p;
>>       }
> --
> Carlos Garcia Campos
> PGP key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x523E6462
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Poppler-Fix-line-selection-dont-check-y-for-Line-sel.patch
Type: text/x-patch
Size: 2042 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20110123/1351013c/attachment.bin>


More information about the poppler mailing list