X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FTextMetrics.cpp;h=ea8e07fae67ddf732c4f377f918455cf4a3e6a67;hb=8b7584846c4e1a9c87a004fab479722fee7e3013;hp=566617b4b5d5123294fbcccf305f55ba8496ad5a;hpb=863e1eb35b02774280665df1755f4520253bcb55;p=lyx.git diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 566617b4b5..ea8e07fae6 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -27,7 +27,6 @@ #include "CoordCache.h" #include "Cursor.h" #include "CutAndPaste.h" -#include "FuncRequest.h" #include "HSpace.h" #include "InsetList.h" #include "Layout.h" @@ -134,8 +133,6 @@ TextMetrics::TextMetrics(BufferView * bv, Text * text) dim_.wid = max_width_; dim_.asc = 10; dim_.des = 10; - - //text_->updateBuffer(bv->buffer()); } @@ -401,6 +398,9 @@ bool TextMetrics::redoParagraph(pit_type const pit) LYXERR(Debug::INFO, "MacroContext not initialised!" << " Going through the buffer again and hope" << " the context is better then."); + // FIXME audit updateBuffer calls + // This should not be here, but it is not clear yet where else it + // should be. bv_->buffer().updateBuffer(); parPos = text_->macrocontextPosition(); LASSERT(!parPos.empty(), /**/); @@ -1219,10 +1219,18 @@ pos_type TextMetrics::getColumnNearX(pit_type const pit, return 0; } - // if the first character is a separator, we are in RTL - // text. This character will not be painted on screen + // This (rtl_support test) is not needed, but gives + // some speedup if rtl_support == false + bool const lastrow = lyxrc.rtl_support && row.endpos() == par.size(); + + // If lastrow is false, we don't need to compute + // the value of rtl. + bool const rtl = lastrow ? text_->isRTL(par) : false; + + // if the first character is a separator, and we are in RTL + // text, this character will not be painted on screen // and thus we should not count it and skip to the next. - if (par.isSeparator(bidi.vis2log(vc))) + if (rtl && par.isSeparator(bidi.vis2log(vc))) ++vc; while (vc < end && tmpx <= x) { @@ -1250,13 +1258,7 @@ pos_type TextMetrics::getColumnNearX(pit_type const pit, LASSERT(vc <= end, /**/); // This shouldn't happen. boundary = false; - // This (rtl_support test) is not needed, but gives - // some speedup if rtl_support == false - bool const lastrow = lyxrc.rtl_support && row.endpos() == par.size(); - // If lastrow is false, we don't need to compute - // the value of rtl. - bool const rtl = lastrow ? text_->isRTL(par) : false; if (lastrow && ((rtl && left_side && vc == row.pos() && x < tmpx - 5) || (!rtl && !left_side && vc == end && x > tmpx + 5))) { @@ -2130,15 +2132,7 @@ void TextMetrics::drawParagraph(PainterInfo & pi, pit_type pit, int x, int y) co // Take this opportunity to spellcheck the row contents. if (row_has_changed && lyxrc.spellcheck_continuously) { - WordLangTuple wl; - // dummy variable, not used. - static docstring_list suggestions; - pos_type from = row.pos(); - pos_type to = row.endpos(); - while (from < row.endpos()) { - text_->getPar(pit).spellCheck(from, to, wl, suggestions, false); - from = to + 1; - } + text_->getPar(pit).spellCheck(); } // Don't paint the row if a full repaint has not been requested