summaryrefslogtreecommitdiff
path: root/src/gui/fonts/textchunklist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/fonts/textchunklist.cpp')
-rw-r--r--src/gui/fonts/textchunklist.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gui/fonts/textchunklist.cpp b/src/gui/fonts/textchunklist.cpp
index bb5cc646f..023727282 100644
--- a/src/gui/fonts/textchunklist.cpp
+++ b/src/gui/fonts/textchunklist.cpp
@@ -70,6 +70,28 @@ void TextChunkList::moveToFirst(TextChunk *const item)
start = item;
}
+void TextChunkList::remove(TextChunk *const item)
+{
+ if (!item)
+ return;
+
+ TextChunk *const oldPrev = item->prev;
+ TextChunk *const oldNext = item->next;
+ if (oldPrev)
+ oldPrev->next = item->next;
+ else
+ start = oldNext;
+ if (oldNext)
+ oldNext->prev = item->prev;
+ else
+ end = oldPrev;
+
+ search.erase(TextChunkSmall(item->text,
+ item->color, item->color2));
+ searchWidth.erase(item->text);
+ size --;
+}
+
void TextChunkList::removeBack()
{
TextChunk *oldEnd = end;