X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftext.C;h=0997ed241e06991a9c2f0843ee07a61b7de2a2ce;hb=664eb7ff45dbb4fabc22ec0b56798031a82335b1;hp=e9e71b9e85ca656b17593afc2f0c6557da646c94;hpb=104424a34cd4c125c59bd25b1fc6cccb41a655ec;p=lyx.git diff --git a/src/text.C b/src/text.C index e9e71b9e85..0997ed241e 100644 --- a/src/text.C +++ b/src/text.C @@ -13,9 +13,9 @@ #include #include +#include "lyxtext.h" #include "layout.h" #include "lyxparagraph.h" -#include "lyxtext.h" #include "support/textutils.h" #include "insets/insetbib.h" #include "insets/insettext.h" @@ -23,17 +23,17 @@ #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; }