diff --git a/src/frontends/screen.C b/src/frontends/screen.C index f6ed96a7ad..4dfc611bde 100644 --- a/src/frontends/screen.C +++ b/src/frontends/screen.C @@ -26,8 +26,8 @@ #include "debug.h" #include "rowpainter.h" #include "insets/updatableinset.h" -#include "mathed/formulabase.h" #include "lyx_gui.h" +#include "metricsinfo.h" // Splash screen-specific stuff #include "lyxfont.h" @@ -147,8 +147,8 @@ void LyXScreen::showCursor(BufferView & bv) Cursor_Shape shape = BAR_SHAPE; LyXText const & text = *bv.getLyXText(); - LyXFont const & realfont(text.real_current_font); - BufferParams const & bp(bv.buffer()->params); + LyXFont const & realfont = text.real_current_font; + BufferParams const & bp = bv.buffer()->params; bool const samelang = realfont.language() == bp.language; bool const isrtl = realfont.isVisibleRightToLeft(); @@ -453,6 +453,16 @@ void LyXScreen::drawFromTo(LyXText * text, BufferView * bv, hideCursor(); +#if 0 + // some day it should look like that: + // redo metrics + Dimension dim; + LyXFont font; + MetricsInfo mi(bv, font, workarea().workWidth()); + text->metrics(mi, dim); +#endif + + // draw it RowList::iterator const rend = text->rows().end(); while (rit != rend && y < y2) { paintRows(*bv, *text, rit, y + yo, xo, y + topy); diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 8e70342cce..d56d1d0406 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -1950,6 +1950,8 @@ void InsetText::resizeLyXText(BufferView * bv, bool force) const text_.init(bv); restoreLyXTextState(); + // seems to be unneeded +#if 1 if (the_locking_inset) { inset_x = cix(bv) - top_x + drawTextXOffset; inset_y = ciy() + drawTextYOffset; @@ -1963,6 +1965,7 @@ void InsetText::resizeLyXText(BufferView * bv, bool force) const } else { need_update |= FULL; } +#endif } diff --git a/src/lyxrow.h b/src/lyxrow.h index 7a81db1b2f..e7c1183958 100644 --- a/src/lyxrow.h +++ b/src/lyxrow.h @@ -24,7 +24,7 @@ public: /// Row(); /// - Row(ParagraphList::iterator pit, lyx::pos_type po); + Row(ParagraphList::iterator pit, lyx::pos_type pos); /// void par(ParagraphList::iterator pit); /// @@ -70,7 +70,7 @@ private: ParagraphList::iterator pit_; /// lyx::pos_type pos_; - /** what is missing to a full row can be negative. + /** what is missing to a full row. Can be negative. Needed for hfills, flushright, block etc. */ mutable int fill_; /// diff --git a/src/lyxtext.h b/src/lyxtext.h index bde466f798..53fa682415 100644 --- a/src/lyxtext.h +++ b/src/lyxtext.h @@ -475,7 +475,7 @@ public: int singleWidth(ParagraphList::iterator pit, lyx::pos_type pos, char c) const; /// rebuild row cache - void rebuildRows(); + void rebuildRows(ParagraphList::iterator pit); /// return the color of the canvas LColor::color backgroundColor() const; diff --git a/src/rowpainter.C b/src/rowpainter.C index c95b9f7d07..996c15feb7 100644 --- a/src/rowpainter.C +++ b/src/rowpainter.C @@ -306,8 +306,8 @@ void RowPainter::paintChars(pos_type & vpos, bool hebrew, bool arabic) } // Draw text and set the new x position - lyxerr << "paint row: yo_ " << yo_ << " baseline: " << row_->baseline() - << "\n"; + //lyxerr << "paint row: yo_ " << yo_ << " baseline: " << row_->baseline() + // << "\n"; pain_.text(int(x_), yo_ + row_->baseline(), str, orig_font); x_ += font_metrics::width(str, orig_font); } diff --git a/src/text2.C b/src/text2.C index d9d356eb00..0a3f6c0c93 100644 --- a/src/text2.C +++ b/src/text2.C @@ -697,7 +697,7 @@ void LyXText::fullRebreak() void LyXText::metrics(MetricsInfo & mi, Dimension & dim) { - lyxerr << "LyXText::metrics: width: " << mi.base.textwidth << "\n"; + //lyxerr << "LyXText::metrics: width: " << mi.base.textwidth << "\n"; // rebuild row cache rowlist_.clear();