]> git.lyx.org Git - features.git/commitdiff
Fixes for smaller insets with not leftaligned paragraps and large insets
authorJürgen Vigna <jug@sad.it>
Mon, 7 Jan 2002 16:15:11 +0000 (16:15 +0000)
committerJürgen Vigna <jug@sad.it>
Mon, 7 Jan 2002 16:15:11 +0000 (16:15 +0000)
inside them (typically an minipage with a large tabular ;)

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

src/ChangeLog
src/text.C
src/text2.C

index 75a681f1982ffb48232c7b7dab6e9682f82947ad..1a94addef6d41e943d517bcd45e36d24f06f6b45 100644 (file)
@@ -1,3 +1,9 @@
+2002-01-07  Juergen Vigna  <jug@sad.it>
+
+       * text.C (setHeightOfRow): small fix
+       (prepareToPrint): don't look at alignment if we don't have the place
+       for doing it.
+
 2002-01-07  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * box.C: New file. Move the Box methods and functions out of box.h,
index e546e323162056e38d1ab286eb4f915d08c041e9..543971669a02ca1da4f87921a22fa0071b9fae8a 100644 (file)
@@ -1548,6 +1548,8 @@ void LyXText::setHeightOfRow(BufferView * bview, Row * row_ptr) const
        float x = 0;
        if (layout.margintype != MARGIN_RIGHT_ADDRESS_BOX) {
                float dummy;
+               // this IS needed
+               row_ptr->width(maxwidth);
                prepareToPrint(bview, row_ptr, x, dummy, dummy, dummy, false);
        }
        row_ptr->width(int(maxwidth + x));
@@ -2079,7 +2081,7 @@ void LyXText::prepareToPrint(BufferView * bview,
        fill_separator = 0;
        fill_label_hfill = 0;
 
-        bool const is_rtl =
+       bool const is_rtl =
                row->par()->isRightToLeftPar(bview->buffer()->params);
        if (is_rtl) {
                x = (workWidth(bview) > 0)
@@ -2106,7 +2108,10 @@ void LyXText::prepareToPrint(BufferView * bview,
        if (nh) {
                if (w > 0)
                        fill_hfill = w / nh;
-       } else  {
+       // we don't have to look at the alignment if it is ALIGN_LEFT and
+       // if the row is already larger then the permitted width as then
+       // we force the LEFT_ALIGN'edness!
+       } else if (static_cast<int>(row->width()) < workWidth(bview)) {
                // is it block, flushleft or flushright? 
                // set x how you need it
                int align;
index 19ad0bdc1d4517f45c1b2bef7c94a0bc73ffeeb1..2437cf1570a22fa39762af7389e922135b6ff5d3 100644 (file)
@@ -2124,7 +2124,7 @@ void LyXText::setCursor(BufferView * bview, LyXCursor & cur, Paragraph * par,
        float fill_hfill;
        float fill_label_hfill;
        prepareToPrint(bview, row, x, fill_separator, fill_hfill,
-                      fill_label_hfill);
+                      fill_label_hfill);
        pos_type cursor_vpos = 0;
        pos_type last = rowLastPrintable(row);