]> git.lyx.org Git - features.git/commitdiff
Rename anchor() to normalAnchor() as the anchor() function was already returning...
authorVincent van Ravesteijn <vfr@lyx.org>
Thu, 15 Apr 2010 17:49:15 +0000 (17:49 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Thu, 15 Apr 2010 17:49:15 +0000 (17:49 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34145 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.cpp
src/Cursor.cpp
src/Cursor.h
src/TextMetrics.cpp
src/lyxfind.cpp
src/rowpainter.cpp

index 4afcda8158f0951f12ab1adf1572e52593a432d1..9a922f997febadca3a0f3e024287725fc775bdbc 100644 (file)
@@ -2258,7 +2258,7 @@ bool BufferView::mouseSetCursor(Cursor & cur, bool select)
                d->cursor_.fixIfBroken();
 
        // FIXME: shift-mouse selection doesn't work well across insets.
-       bool do_selection = select && &d->cursor_.anchor().inset() == &cur.inset();
+       bool do_selection = select && &d->cursor_.normalAnchor().inset() == &cur.inset();
 
        // do the dEPM magic if needed
        // FIXME: (1) move this to InsetText::notifyCursorLeaves?
index a28eded33b20d4cd13dfdb52513c56ba8959cca8..185d8669506f765711728866265333f0ec3f762e 100644 (file)
@@ -980,7 +980,7 @@ void Cursor::posVisToRowExtremity(bool left)
 }
 
 
-CursorSlice Cursor::anchor() const
+CursorSlice Cursor::normalAnchor() const
 {
        if (!selection())
                return top();
@@ -998,7 +998,7 @@ CursorSlice Cursor::selBegin() const
 {
        if (!selection())
                return top();
-       return anchor() < top() ? anchor() : top();
+       return normalAnchor() < top() ? normalAnchor() : top();
 }
 
 
@@ -1006,7 +1006,7 @@ CursorSlice Cursor::selEnd() const
 {
        if (!selection())
                return top();
-       return anchor() > top() ? anchor() : top();
+       return normalAnchor() > top() ? normalAnchor() : top();
 }
 
 
@@ -1018,10 +1018,10 @@ DocIterator Cursor::selectionBegin() const
        DocIterator di;
        // FIXME: This is a work-around for the problem that
        // CursorSlice doesn't keep track of the boundary.
-       if (anchor() == top())
+       if (normalAnchor() == top())
                di = anchor_.boundary() > boundary() ? anchor_ : *this;
        else
-               di = anchor() < top() ? anchor_ : *this;
+               di = normalAnchor() < top() ? anchor_ : *this;
        di.resize(depth());
        return di;
 }
@@ -1035,10 +1035,10 @@ DocIterator Cursor::selectionEnd() const
        DocIterator di;
        // FIXME: This is a work-around for the problem that
        // CursorSlice doesn't keep track of the boundary.
-       if (anchor() == top())
+       if (normalAnchor() == top())
                di = anchor_.boundary() < boundary() ? anchor_ : *this;
        else
-               di = anchor() > top() ? anchor_ : *this;
+               di = normalAnchor() > top() ? anchor_ : *this;
 
        if (di.depth() > depth()) {
                di.resize(depth());
@@ -1053,9 +1053,9 @@ void Cursor::setSelection()
        setSelection(true);
        // A selection with no contents is not a selection
        // FIXME: doesnt look ok
-       if (idx() == anchor().idx() && 
-           pit() == anchor().pit() && 
-           pos() == anchor().pos())
+       if (idx() == normalAnchor().idx() && 
+           pit() == normalAnchor().pit() && 
+           pos() == normalAnchor().pos())
                setSelection(false);
 }
 
index 134c95cd916596c90c6f005dc776b8d5d950610f..5747d31ce4313199a8e2f78ff832005e50b294fb 100644 (file)
@@ -201,7 +201,7 @@ public:
        int textTargetOffset() const;
 
        /// access to normalized selection anchor
-       CursorSlice anchor() const;
+       CursorSlice normalAnchor() const;
        /// sets anchor to cursor position
        void resetAnchor();
        /// access to owning BufferView
index 1aef414b7c7f983a9b77f101626522cf1c88c252..482b2a13bfafb80db3b9ec2acfb2fee647fd3a4f 100644 (file)
@@ -2078,7 +2078,7 @@ void TextMetrics::drawParagraph(PainterInfo & pi, pit_type pit, int x, int y) co
                // This is our text.
                && cur.text() == text_
                // if the anchor is outside, this is not our selection
-               && cur.anchor().text() == text_
+               && cur.normalAnchor().text() == text_
                && pit >= sel_beg.pit() && pit <= sel_end.pit();
 
        // We store the begin and end pos of the selection relative to this par
index 5e44691ad5d062a66e4452d964ea9513e8363189..fd44187104fdb9a6d80ed04f18cb54c0875f562b 100644 (file)
@@ -371,7 +371,7 @@ bool findChange(BufferView * bv, bool next)
        if (bv->cursor().selection()) {
                // set the cursor at the beginning or at the end of the selection
                // before searching. Otherwise, the current change will be found.
-               if (next != (bv->cursor().top() > bv->cursor().anchor()))
+               if (next != (bv->cursor().top() > bv->cursor().normalAnchor()))
                        bv->cursor().setCursorToAnchor();
        }
 
index ef81e683aed532eb86d148b4bfcad49feb79c652..bfc3ea9c839f5b35ac21cfa2242667cfd0797fc3 100644 (file)
@@ -716,7 +716,7 @@ void RowPainter::paintOnlyInsets()
                bool const pi_selected = pi_.selected;
                Cursor const & cur = pi_.base.bv->cursor();
                if (cur.selection() && cur.text() == &text_ 
-                         && cur.anchor().text() == &text_)
+                         && cur.normalAnchor().text() == &text_)
                        pi_.selected = row_.sel_beg <= pos && row_.sel_end > pos; 
                paintInset(inset, pos);
                pi_.selected = pi_selected;
@@ -858,7 +858,7 @@ void RowPainter::paintText()
                        bool const pi_selected = pi_.selected;
                        Cursor const & cur = pi_.base.bv->cursor();
                        if (cur.selection() && cur.text() == &text_ 
-                                 && cur.anchor().text() == &text_)
+                                 && cur.normalAnchor().text() == &text_)
                                pi_.selected = row_.sel_beg <= pos && row_.sel_end > pos; 
                        paintInset(inset, pos);
                        pi_.selected = pi_selected;