]> git.lyx.org Git - features.git/commitdiff
A really small fix for alignment in tabular cells of multirow text-insets.
authorJürgen Vigna <jug@sad.it>
Fri, 28 Jul 2000 14:59:26 +0000 (14:59 +0000)
committerJürgen Vigna <jug@sad.it>
Fri, 28 Jul 2000 14:59:26 +0000 (14:59 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@937 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/insettabular.C
src/insets/insettext.C

index 1c179ca8339285c801ef76f9986129c2bf87dd95..832b8b119d2429a05da1914cf7ef5bf026a63177 100644 (file)
@@ -1546,8 +1546,8 @@ int InsetTabular::getMaxWidth(Painter & pain,
        return -1;
     int w = GetMaxWidthOfCell(pain, cell);
     if (w > 0)
-       // because the inset then subtracts it's top_x
-       w += inset->x();
+       // because the inset then subtracts it's top_x and owner->x()
+       w += (inset->x() - top_x);
     return w;
 }
 
index 2d69f911a384b41cfe706844e0f7634bb03163da..c17982140e26ee48316c4bd8af4196cffb84aa7e 100644 (file)
@@ -233,15 +233,7 @@ int InsetText::width(BufferView * bv, LyXFont const &) const
 int InsetText::textWidth(Painter & pain) const
 {
     int w = getMaxWidth(pain, this);
-    if (w < 0) {
-       return w;
-    }
-    if (owner()) {
-       w = w - top_x + owner()->x();
-       return w;
-    }
-    w -= (2 * TEXT_TO_INSET_OFFSET);
-    return w - top_x;
+    return w;
 }
 
 
@@ -1207,9 +1199,16 @@ bool InsetText::checkAndActivateInset(BufferView * bv, int x, int y,
 int InsetText::getMaxWidth(Painter & pain, UpdatableInset const * inset) const
 {
     int w = UpdatableInset::getMaxWidth(pain, inset);
-    if (w < 0)
+    if (w < 0) {
+       return w;
+    }
+    if (owner()) {
+       w = w - top_x + owner()->x();
        return w;
-    return  w - (2*TEXT_TO_INSET_OFFSET);
+    }
+    w -= (2 * TEXT_TO_INSET_OFFSET);
+    return w - top_x;
+//    return  w - (2*TEXT_TO_INSET_OFFSET);
 }