]> git.lyx.org Git - lyx.git/blobdiff - src/text.C
another pesky \#warning snuck in
[lyx.git] / src / text.C
index e9e71b9e85ca656b17593afc2f0c6557da646c94..0997ed241e06991a9c2f0843ee07a61b7de2a2ce 100644 (file)
@@ -13,9 +13,9 @@
 #include <cctype>
 #include <algorithm>
 
+#include "lyxtext.h"
 #include "layout.h"
 #include "lyxparagraph.h"
-#include "lyxtext.h"
 #include "support/textutils.h"
 #include "insets/insetbib.h"
 #include "insets/insettext.h"
 #include "gettext.h"
 #include "bufferparams.h"
 #include "buffer.h"
-#include "minibuffer.h"
 #include "debug.h"
 #include "lyxrc.h"
 #include "LyXView.h"
-#include "lyxrow.h"
 #include "Painter.h"
 #include "tracer.h"
 #include "font.h"
 #include "encoding.h"
 #include "lyxscreen.h"
 #include "bufferview_funcs.h"
+#include "language.h"
+#include "lyxfunc.h"
 
 using std::max;
 using std::min;
@@ -1158,7 +1158,7 @@ LyXText::NextBreakPoint(BufferView * bview, Row const * row, int width) const
 int LyXText::Fill(BufferView * bview, Row * row, int paper_width) const
 {
        if (paper_width < 0)
-               return 0;
+               return 20;
 
        int w;
        // get the pure distance
@@ -1203,6 +1203,8 @@ int LyXText::Fill(BufferView * bview, Row * row, int paper_width) const
        }
        
        int const fill = paper_width - w - RightMargin(bview->buffer(), row);
+       if (fill < 0)
+               return 0;
        return fill;
 }
 
@@ -1413,7 +1415,7 @@ void LyXText::SetHeightOfRow(BufferView * bview, Row * row_ptr) const
                   tmpfont = GetFont(bview->buffer(), row_ptr->par(), pos);
                   tmpinset = row_ptr->par()->GetInset(pos);
                   if (tmpinset) {
-                          tmpinset->update(bview, tmpfont);
+//                        tmpinset->update(bview, tmpfont);
                           asc = tmpinset->ascent(bview, tmpfont);
                           desc = tmpinset->descent(bview, tmpfont);
                           maxwidth += tmpinset->width(bview, tmpfont);
@@ -2107,9 +2109,13 @@ void LyXText::InsertChar(BufferView * bview, char c)
 #endif
                            )) {
                        if (cursor.pos() == 0 )
-                               bview->owner()->getMiniBuffer()->Set(_("You cannot insert a space at the beginning of a paragraph.  Please read the Tutorial."));
+                               bview->owner()->getLyXFunc()
+                                       ->Dispatch(LFUN_MESSAGE,
+                                                  _("You cannot insert a space at the beginning of a paragraph.  Please read the Tutorial."));
                        else
-                               bview->owner()->getMiniBuffer()->Set(_("You cannot type two spaces this way.  Please read the Tutorial."));
+                               bview->owner()->getLyXFunc()
+                                       ->Dispatch(LFUN_MESSAGE,
+                                                  _("You cannot type two spaces this way.  Please read the Tutorial."));
                        charInserted();
                        return;
                }