From 0d7ca9cdc3917e9a8ef6415aaa47e24488d30968 Mon Sep 17 00:00:00 2001 From: Stefan Schimanski Date: Fri, 22 Feb 2008 21:57:33 +0000 Subject: [PATCH] * inlineCompletionVPos is only used locally. So define it there. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23144 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/rowpainter.cpp | 31 +++++++++++++++---------------- src/rowpainter.h | 3 --- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/rowpainter.cpp b/src/rowpainter.cpp index 40af9b99d7..7801d6b023 100644 --- a/src/rowpainter.cpp +++ b/src/rowpainter.cpp @@ -71,17 +71,6 @@ RowPainter::RowPainter(PainterInfo & pi, BOOST_ASSERT(pit >= 0); BOOST_ASSERT(pit < int(text.paragraphs().size())); - - // check for possible inline completion - DocIterator const & inlineCompletionPos = pi_.base.bv->inlineCompletionPos(); - inlineCompletionVPos_ = -1; - if (inlineCompletionPos.inTexted() - && inlineCompletionPos.text() == &text_ - && inlineCompletionPos.pit() == pit_) { - // draw visually behind the previous character - // FIXME: probably special RTL handling needed here - inlineCompletionVPos_ = bidi_.log2vis(inlineCompletionPos.pos() - 1); - } } @@ -691,6 +680,16 @@ void RowPainter::paintText() bool is_struckout = false; int last_strikeout_x = 0; + // check for possible inline completion + DocIterator const & inlineCompletionPos = pi_.base.bv->inlineCompletionPos(); + pos_type inlineCompletionVPos = -1; + if (inlineCompletionPos.inTexted() + && inlineCompletionPos.text() == &text_ + && inlineCompletionPos.pit() == pit_) { + // draw visually behind the previous character + inlineCompletionVPos = bidi_.log2vis(inlineCompletionPos.pos() - 1); + } + // Use font span to speed things up, see below FontSpan font_span; Font font; @@ -723,9 +722,9 @@ void RowPainter::paintText() font = text_metrics_.getDisplayFont(pit_, vpos); // split font span if inline completion is inside - if (font_span.first <= inlineCompletionVPos_ - && font_span.last > inlineCompletionVPos_) - font_span.last = inlineCompletionVPos_; + if (font_span.first <= inlineCompletionVPos + && font_span.last > inlineCompletionVPos) + font_span.last = inlineCompletionVPos; } const int width_pos = pm_.singleWidth(pos, font); @@ -767,7 +766,7 @@ void RowPainter::paintText() } // Is the inline completion in front of character? - if (font.isRightToLeft() && vpos == inlineCompletionVPos_) + if (font.isRightToLeft() && vpos == inlineCompletionVPos) paintInlineCompletion(font); if (par_.isSeparator(pos)) { @@ -791,7 +790,7 @@ void RowPainter::paintText() } // Is the inline completion after character? - if (!font.isRightToLeft() && vpos - 1 == inlineCompletionVPos_) + if (!font.isRightToLeft() && vpos - 1 == inlineCompletionVPos) paintInlineCompletion(font); } diff --git a/src/rowpainter.h b/src/rowpainter.h index 76ac59116e..542573e1b2 100644 --- a/src/rowpainter.h +++ b/src/rowpainter.h @@ -100,9 +100,6 @@ private: int const yo_; // current baseline double x_; int width_; - - // -1 if the inline completion is not in this paragraph. - pos_type inlineCompletionVPos_; }; } // namespace lyx -- 2.39.2