]> git.lyx.org Git - features.git/commitdiff
Fix one-by-some bug in tabular selection drawing by appropriately
authorAlfredo Braunstein <abraunst@lyx.org>
Mon, 25 Jun 2007 08:19:15 +0000 (08:19 +0000)
committerAlfredo Braunstein <abraunst@lyx.org>
Mon, 25 Jun 2007 08:19:15 +0000 (08:19 +0000)
calling InsetText::drawSelection instead of Text:drawSelection

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18881 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetTabular.cpp

index 05a1801d246b439bbca5594928cfa0a3210e0f57..31c008eea0e8d40292f8e43bcae8aa60f488e734 100644 (file)
@@ -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;
 }