From: Alfredo Braunstein Date: Mon, 25 Jun 2007 08:19:15 +0000 (+0000) Subject: Fix one-by-some bug in tabular selection drawing by appropriately X-Git-Tag: 1.6.10~9289 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=c1852732b7ae3d41b6d0e9c3e4a14250c50d0102;p=features.git Fix one-by-some bug in tabular selection drawing by appropriately calling InsetText::drawSelection instead of Text:drawSelection git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18881 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 05a1801d24..31c008eea0 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -3096,7 +3096,9 @@ void InsetTabular::drawSelection(PainterInfo & pi, int x, int y) const } } else { - cur.text()->drawSelection(pi, x + getCellXPos(cur.idx()) + tabular.getBeginningOfTextInCell(cur.idx()), 0 /*this value is ignored */); + x += getCellXPos(cur.idx()); + x += tabular.getBeginningOfTextInCell(cur.idx()); + cell(cur.idx())->drawSelection(pi, x, 0 /* ignored */); } } @@ -3969,11 +3971,11 @@ int InsetTabular::getCellXPos(idx_type const cell) const for (; !tabular.isFirstCellInRow(c); --c) ; - int lx = tabular.getWidthOfColumn(cell); + int lx = 0; for (; c < cell; ++c) lx += tabular.getWidthOfColumn(c); - return lx - tabular.getWidthOfColumn(cell); + return lx; }