[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/kate/buffer
From: Christoph Cullmann <cullmann () kde ! org>
Date: 2010-11-06 18:33:09
Message-ID: 20101106183309.8053EAC89B () svn ! kde ! org
[Download RAW message or body]
SVN commit 1193676 by cullmann:
mwolff:
provide fast TextCursor::setPosition(const TextCursor& position), esp. for TextRange::checkValidity()
CCBUG: 215200
M +13 -0 katetextcursor.cpp
M +7 -0 katetextcursor.h
--- trunk/KDE/kdelibs/kate/buffer/katetextcursor.cpp #1193675:1193676
@@ -61,6 +61,19 @@
m_buffer.m_invalidCursors.remove (this);
}
+void TextCursor::setPosition( const TextCursor& position )
+{
+ if (m_block && m_block != position.m_block)
+ m_block->m_cursors.remove(this);
+
+ m_line = position.m_line;
+ m_column = position.m_column;
+
+ m_block = position.m_block;
+ if (m_block)
+ m_block->m_cursors.insert(this);
+}
+
void TextCursor::setPosition(const KTextEditor::Cursor& position, bool init)
{
// any change or init? else do nothing
--- trunk/KDE/kdelibs/kate/buffer/katetextcursor.h #1193675:1193676
@@ -90,6 +90,13 @@
KTextEditor::Document *document () const;
/**
+ * Fast way to set the current cursor position to \e position.
+ *
+ * \param position new cursor position
+ */
+ void setPosition (const TextCursor& position);
+
+ /**
* Set the current cursor position to \e position.
*
* \param position new cursor position
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic