summaryrefslogtreecommitdiff
path: root/plugins/NewStory
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-12-14 19:24:52 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-12-14 19:24:52 +0300
commitc903fe01f85d8bbd7b5fe670d2314a6c92bfe688 (patch)
treef8d86207531ed378fa17719d4322da7a4ba6519e /plugins/NewStory
parent1c9faebef10ee8a8de06b31ba1cf0049be8ee6dc (diff)
libTextControl: patch for more effective icon caching (if we need it sometimes)
Diffstat (limited to 'plugins/NewStory')
-rw-r--r--plugins/NewStory/src/history_array.cpp8
-rw-r--r--plugins/NewStory/src/history_array.h1
2 files changed, 8 insertions, 1 deletions
diff --git a/plugins/NewStory/src/history_array.cpp b/plugins/NewStory/src/history_array.cpp
index 3eb986cd88..cbffbb1f1d 100644
--- a/plugins/NewStory/src/history_array.cpp
+++ b/plugins/NewStory/src/history_array.cpp
@@ -190,7 +190,7 @@ ItemData* ItemData::checkPrevGC(ItemData *pPrev)
void ItemData::checkCreate(HWND hwnd)
{
if (data == nullptr) {
- setText();
+ setTextAndHwnd(hwnd);
MTextSetParent(data, hwnd);
MTextActivate(data, true);
}
@@ -479,6 +479,12 @@ void ItemData::setText()
savedHeight = -1;
}
+void ItemData::setTextAndHwnd(HWND hwnd)
+{
+ data = MTextCreateEx2(hwnd, htuLog, formatRtf().GetBuffer(), MTEXT_FLG_RTF);
+ savedHeight = -1;
+}
+
// Array
HistoryArray::HistoryArray() :
pages(50),
diff --git a/plugins/NewStory/src/history_array.h b/plugins/NewStory/src/history_array.h
index 81ca3df4af..a893a634da 100644
--- a/plugins/NewStory/src/history_array.h
+++ b/plugins/NewStory/src/history_array.h
@@ -37,6 +37,7 @@ struct ItemData
void checkCreate(HWND hwnd);
void markRead();
void setText();
+ void setTextAndHwnd(HWND hwnd);
bool fetch(void);
void fill(int tmpl);