From 30fa7c6549fa7fa5195f3348f7d9197fb8fe928d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 6 Apr 2013 19:43:42 +0000 Subject: same problem in another place git-svn-id: http://svn.miranda-ng.org/main/trunk@4349 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/IEView/src/HTMLBuilder.cpp | 5 +---- plugins/IEView/src/HistoryHTMLBuilder.cpp | 24 +++++++++++------------- 2 files changed, 12 insertions(+), 17 deletions(-) (limited to 'plugins/IEView/src') diff --git a/plugins/IEView/src/HTMLBuilder.cpp b/plugins/IEView/src/HTMLBuilder.cpp index 435c4cecf5..0007feb8ab 100644 --- a/plugins/IEView/src/HTMLBuilder.cpp +++ b/plugins/IEView/src/HTMLBuilder.cpp @@ -477,10 +477,7 @@ ProtocolSettings* HTMLBuilder::getChatProtocolSettings(const char *protocolName) ProtocolSettings* HTMLBuilder::getChatProtocolSettings(HANDLE hContact) { - char *szRealProto = getRealProto(hContact); - ProtocolSettings *protoSettings = getChatProtocolSettings(szRealProto); - delete szRealProto; - return protoSettings; + return getChatProtocolSettings( mir_ptr(getRealProto(hContact))); } void HTMLBuilder::setLastIEViewEvent(IEVIEWEVENT *event) diff --git a/plugins/IEView/src/HistoryHTMLBuilder.cpp b/plugins/IEView/src/HistoryHTMLBuilder.cpp index bb75c2434f..4b5fae0478 100644 --- a/plugins/IEView/src/HistoryHTMLBuilder.cpp +++ b/plugins/IEView/src/HistoryHTMLBuilder.cpp @@ -220,15 +220,14 @@ void HistoryHTMLBuilder::buildHead(IEView *view, IEVIEWEVENT *event) { setLastEventType(-1); } -void HistoryHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event) { - +void HistoryHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event) +{ DWORD dwFlags = db_get_b(NULL, HPPMOD, SRMSGSET_SHOWICONS, 0) ? SMF_LOG_SHOWICONS : 0; - char *szRealProto = getRealProto(event->hContact); + mir_ptr szRealProto( getRealProto(event->hContact)); IEVIEWEVENTDATA* eventData = event->eventData; for (int eventIdx = 0; eventData!=NULL && (eventIdx < event->count || event->count==-1); eventData = eventData->next, eventIdx++) { int outputSize; - char *output; - output = NULL; + char *output = NULL; int isSent = eventData->dwFlags & IEEDF_SENT; int isRTL = eventData->dwFlags & IEEDF_RTL; if (eventData->iType == IEED_EVENT_MESSAGE || eventData->iType == IEED_EVENT_STATUSCHANGE @@ -264,20 +263,20 @@ void HistoryHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event iconFile = "message.gif"; Utils::appendText(&output, &outputSize, "
", isSent ? "divMessageOut" : "divMessageIn"); } - if (dwFlags & SMF_LOG_SHOWICONS && iconFile != NULL) { + if (dwFlags & SMF_LOG_SHOWICONS && iconFile != NULL) Utils::appendIcon(&output, &outputSize, iconFile); - } else { + else Utils::appendText(&output, &outputSize, " "); - } + Utils::appendText(&output, &outputSize, "%s:", isSent ? "nameOut" : "nameIn", szName); Utils::appendText(&output, &outputSize, "%s
", isSent ? "timeOut" : "timeIn", timestampToString(dwFlags, eventData->time)); - if (eventData->iType == IEED_EVENT_FILE) { + if (eventData->iType == IEED_EVENT_FILE) Utils::appendText(&output, &outputSize, "%s:
%s", isSent ? Translate("Outgoing File Transfer") : Translate("Incoming File Transfer"), szText); - } else if (eventData->iType == IEED_EVENT_URL) { + else if (eventData->iType == IEED_EVENT_URL) Utils::appendText(&output, &outputSize, "%s:
%s", isSent ? Translate("URL sent") : Translate("URL received"), szText); - } else { + else Utils::appendText(&output, &outputSize, "%s", szText); - } + Utils::appendText(&output, &outputSize, "
\n"); setLastEventType(MAKELONG(eventData->dwFlags, eventData->iType)); setLastEventTime(eventData->time); @@ -289,7 +288,6 @@ void HistoryHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event free(output); } } - if (szRealProto!=NULL) delete szRealProto; view->documentClose(); } -- cgit v1.2.3