diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-09-13 11:01:42 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-09-13 11:01:42 +0200 |
commit | 8edb362d96ed740cf5f387649d760c17c7c17d31 (patch) | |
tree | 5b7eac591419d848be483b50854fded3091fb532 /framework/src | |
parent | e87ecb949e77211eb21e30a97a65426f87231414 (diff) | |
download | kube-8edb362d96ed740cf5f387649d760c17c7c17d31.tar.gz kube-8edb362d96ed740cf5f387649d760c17c7c17d31.zip |
Keep TextEditor as our html editor
Diffstat (limited to 'framework/src')
-rw-r--r-- | framework/src/domain/documenthandler.cpp | 16 | ||||
-rw-r--r-- | framework/src/domain/documenthandler.h | 3 |
2 files changed, 10 insertions, 9 deletions
diff --git a/framework/src/domain/documenthandler.cpp b/framework/src/domain/documenthandler.cpp index 266f4a27..0f949da8 100644 --- a/framework/src/domain/documenthandler.cpp +++ b/framework/src/domain/documenthandler.cpp | |||
@@ -94,16 +94,20 @@ void DocumentHandler::setCursorPosition(int position) | |||
94 | //Skip over invisible char | 94 | //Skip over invisible char |
95 | if (m_cursorPosition < position) { | 95 | if (m_cursorPosition < position) { |
96 | auto cursor = textCursor(); | 96 | auto cursor = textCursor(); |
97 | cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor); | 97 | if (!cursor.atEnd()) { |
98 | if (cursor.selectedText() == "\u2063") { | 98 | cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor); |
99 | position++; | 99 | if (cursor.selectedText() == "\u2063") { |
100 | position++; | ||
101 | } | ||
100 | } | 102 | } |
101 | } | 103 | } |
102 | if (m_cursorPosition > position) { | 104 | if (m_cursorPosition > position) { |
103 | auto cursor = textCursor(); | 105 | auto cursor = textCursor(); |
104 | cursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor); | 106 | if (!cursor.atStart()) { |
105 | if (cursor.selectedText() == "\u2063") { | 107 | cursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor); |
106 | position--; | 108 | if (cursor.selectedText() == "\u2063") { |
109 | position--; | ||
110 | } | ||
107 | } | 111 | } |
108 | } | 112 | } |
109 | m_cursorPosition = position; | 113 | m_cursorPosition = position; |
diff --git a/framework/src/domain/documenthandler.h b/framework/src/domain/documenthandler.h index 74b7c4f9..24b3b35f 100644 --- a/framework/src/domain/documenthandler.h +++ b/framework/src/domain/documenthandler.h | |||
@@ -145,9 +145,6 @@ private: | |||
145 | int m_cursorPosition; | 145 | int m_cursorPosition; |
146 | int m_selectionStart; | 146 | int m_selectionStart; |
147 | int m_selectionEnd; | 147 | int m_selectionEnd; |
148 | |||
149 | QFont m_font; | ||
150 | int m_fontSize; | ||
151 | }; | 148 | }; |
152 | 149 | ||
153 | #endif // DOCUMENTHANDLER_H | 150 | #endif // DOCUMENTHANDLER_H |