From 789e21438e7959a211f48fddd1c20ad2762d8ac4 Mon Sep 17 00:00:00 2001 From: Marek Kasik Date: Tue, 11 May 2010 12:06:17 +0200 Subject: [PATCH] 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). --- poppler/TextOutputDev.cc | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) 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; -- 1.6.5.2