[poppler] poppler/TextOutputDev.cc

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Tue May 11 03:38:13 PDT 2010


 poppler/TextOutputDev.cc |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 9e9b5e0d87a7450bd2223538673321ecec720c36
Author: Marek Kasik <mkasik at redhat.com>
Date:   Tue May 11 12:06:17 2010 +0200

    Better check of overlapping of table cells when selecting text
    
    Add check for overlapping of upper right cell with lower left cell
    of assumed table (related to #3188).

diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc
index ef9c486..87f6f08 100644
--- a/poppler/TextOutputDev.cc
+++ b/poppler/TextOutputDev.cc
@@ -3077,13 +3077,16 @@ void TextPage::coalesce(GBool physLayout, GBool doHTML) {
     }
 
     /*  fblk4 can not overlap with fblk3 in x and with fblk2 in y
+     *  fblk2 can not overlap with fblk3 in x and y
      *  fblk4 has to overlap with fblk3 in y and with fblk2 in x
      */
     if (fblk2 != NULL &&
         fblk3 != NULL &&
         fblk4 != NULL) {
       if (((fblk3->xMin <= fblk4->xMax && fblk3->xMax >= fblk4->xMin) ||
-           (fblk2->yMin <= fblk4->yMax && fblk2->yMax >= fblk4->yMin)) ||
+           (fblk2->yMin <= fblk4->yMax && fblk2->yMax >= fblk4->yMin) ||
+           (fblk2->xMin <= fblk3->xMax && fblk2->xMax >= fblk3->xMin) ||
+           (fblk2->yMin <= fblk3->yMax && fblk2->yMax >= fblk3->yMin)) ||
           !(fblk4->xMin <= fblk2->xMax && fblk4->xMax >= fblk2->xMin &&
             fblk4->yMin <= fblk3->yMax && fblk4->yMax >= fblk3->yMin)) {
         fblk2 = NULL;


More information about the poppler mailing list