]> git.lyx.org Git - features.git/commitdiff
* inlineCompletionVPos is only used locally. So define it there.
authorStefan Schimanski <sts@lyx.org>
Fri, 22 Feb 2008 21:57:33 +0000 (21:57 +0000)
committerStefan Schimanski <sts@lyx.org>
Fri, 22 Feb 2008 21:57:33 +0000 (21:57 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23144 a592a061-630c-0410-9148-cb99ea01b6c8

src/rowpainter.cpp
src/rowpainter.h

index 40af9b99d7278e813bc123da317c380a6045bb1d..7801d6b023dbfd2d40519b7b69c16e20444a1a9a 100644 (file)
@@ -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);
        }
 
index 76ac59116e513f19097c3fbecb388071312b77e7..542573e1b2f0410d97265fb90327de6c6aef518a 100644 (file)
@@ -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