]> git.lyx.org Git - lyx.git/blobdiff - src/text.C
Fix bugs #32 and #52.
[lyx.git] / src / text.C
index 2d7197b7708110983235eb87f4f934d2f44f443e..543971669a02ca1da4f87921a22fa0071b9fae8a 100644 (file)
@@ -1034,7 +1034,6 @@ LyXText::nextBreakPoint(BufferView * bview, Row const * row, int width) const
        if (main_body && last_separator < main_body)
                last_separator = main_body - 1;
        
-       lyxerr << last_separator << ":" << pos << endl;
        return last_separator;
 }
 
@@ -1549,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));
@@ -2080,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)
@@ -2107,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;