From a5fa770b36aad94d9f56f57212642f634c589138 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 30 Apr 2020 11:42:35 +0300 Subject: minor code cleaning --- plugins/NewStory/src/history_control.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/NewStory/src') diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index 312f2296f8..e33d901ba3 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -335,7 +335,9 @@ static int LayoutItem(HWND hwnd, HistoryArray *items, int index) static int PaintItem(HDC hdc, HistoryArray *items, int index, int top, int width) { - if (!items) return 0; + if (!items) + return 0; + ItemData *item = items->get(index, ItemData::ELM_DATA); // LOGFONT lfText; @@ -400,9 +402,7 @@ static int PaintItem(HDC hdc, HistoryArray *items, int index, int top, int width } if (!item->data) { - wchar_t *buf = TplFormatString(tpl, item->hContact, item); - item->data = MTextCreateW(htuLog, buf); - mir_free(buf); + item->data = MTextCreateW(htuLog, ptrW(TplFormatString(tpl, item->hContact, item))); if (!item->data) return 0; } -- cgit v1.2.3