From 54ecbb3cf0ddb2576292d0b1714f56cd765ea292 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Mon, 15 Dec 2014 16:34:37 +0000 Subject: IEView: changed warning lavel to w4 git-svn-id: http://svn.miranda-ng.org/main/trunk@11438 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/IEView/src/MUCCHTMLBuilder.cpp | 79 ++++++++++++++++++---------------- 1 file changed, 43 insertions(+), 36 deletions(-) (limited to 'plugins/IEView/src/MUCCHTMLBuilder.cpp') diff --git a/plugins/IEView/src/MUCCHTMLBuilder.cpp b/plugins/IEView/src/MUCCHTMLBuilder.cpp index 0728738aac..de4e90fb00 100644 --- a/plugins/IEView/src/MUCCHTMLBuilder.cpp +++ b/plugins/IEView/src/MUCCHTMLBuilder.cpp @@ -51,7 +51,7 @@ void MUCCHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour) } if (lf) { mir_snprintf(str, SIZEOF(str), "Font%dSize", i); - lf->lfHeight = (char) db_get_b(NULL, MUCCMOD, str, 10); + lf->lfHeight = (char)db_get_b(NULL, MUCCMOD, str, 10); lf->lfHeight = abs(lf->lfHeight); lf->lfWidth = 0; lf->lfEscapement = 0; @@ -99,17 +99,21 @@ char *MUCCHTMLBuilder::timestampToString(DWORD dwData, time_t check) if (dwData&IEEDD_MUCC_SHOW_DATE && dwData&IEEDD_MUCC_SHOW_TIME) { if (dwData&IEEDD_MUCC_LONG_DATE) { dbtts.szFormat = dwData&IEEDD_MUCC_SECONDS ? (char *)"D s" : (char *)"D t"; - } else { + } + else { dbtts.szFormat = dwData&IEEDD_MUCC_SECONDS ? (char *)"d s" : (char *)"d t"; } - } else if (dwData&IEEDD_MUCC_SHOW_DATE) { + } + else if (dwData&IEEDD_MUCC_SHOW_DATE) { dbtts.szFormat = dwData&IEEDD_MUCC_LONG_DATE ? (char *)"D" : (char *)"d"; - } else if (dwData&IEEDD_MUCC_SHOW_TIME) { + } + else if (dwData&IEEDD_MUCC_SHOW_TIME) { dbtts.szFormat = dwData&IEEDD_MUCC_SECONDS ? (char *)"s" : (char *)"t"; - } else { + } + else { dbtts.szFormat = (char *)""; } - CallService(MS_DB_TIME_TIMESTAMPTOSTRING, check, (LPARAM) & dbtts); + CallService(MS_DB_TIME_TIMESTAMPTOSTRING, check, (LPARAM)& dbtts); strncat(szResult, str, 500); mir_strncpy(szResult, ptrA(mir_utf8encode(szResult)), 500); return szResult; @@ -125,14 +129,15 @@ void MUCCHTMLBuilder::buildHead(IEView *view, IEVIEWEVENT *event) if (protoSettings == NULL) { return; } - if (protoSettings->getChatMode() == Options::MODE_TEMPLATE) { -// buildHeadTemplate(view, event); + if (protoSettings->getChatMode() == Options::MODE_TEMPLATE) { + // buildHeadTemplate(view, event); return; } - if (protoSettings->getChatMode() == Options::MODE_CSS) { - const char *externalCSS = protoSettings->getChatCssFilename(); + if (protoSettings->getChatMode() == Options::MODE_CSS) { + const char *externalCSS = protoSettings->getChatCssFilename(); Utils::appendText(&output, &outputSize, "\n", externalCSS); - } else { + } + else { HDC hdc = GetDC(NULL); int logPixelSY = GetDeviceCaps(hdc, LOGPIXELSY); ReleaseDC(NULL, hdc); @@ -140,14 +145,15 @@ void MUCCHTMLBuilder::buildHead(IEView *view, IEVIEWEVENT *event) Utils::appendText(&output, &outputSize, "\n"); } @@ -186,7 +193,7 @@ void MUCCHTMLBuilder::buildHead(IEView *view, IEVIEWEVENT *event) void MUCCHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event) { IEVIEWEVENTDATA* eventData = event->eventData; - for (int eventIdx = 0; eventData!=NULL && (eventIdx < event->count || event->count==-1); eventData = eventData->next, eventIdx++) { + for (int eventIdx = 0; eventData != NULL && (eventIdx < event->count || event->count == -1); eventData = eventData->next, eventIdx++) { DWORD dwData = eventData->dwData; char *style = NULL; int styleSize; @@ -208,11 +215,11 @@ void MUCCHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event) Utils::appendText(&output, &outputSize, "
", isSent ? "divOut" : "divIn"); if (dwData & IEEDD_MUCC_SHOW_TIME || dwData & IEEDD_MUCC_SHOW_DATE) Utils::appendText(&output, &outputSize, "%s ", - isSent ? "timestamp" : "timestamp", timestampToString(dwData, eventData->time)); + isSent ? "timestamp" : "timestamp", timestampToString(dwData, eventData->time)); if (dwData & IEEDD_MUCC_SHOW_NICK) Utils::appendText(&output, &outputSize, "%s: ", - isSent ? "nameOut" : "nameIn", szName); + isSent ? "nameOut" : "nameIn", szName); if (dwData & IEEDD_MUCC_MSG_ON_NEW_LINE) Utils::appendText(&output, &outputSize, "
"); @@ -221,9 +228,9 @@ void MUCCHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event) if (eventData->dwFlags & IEEDF_FORMAT_SIZE && eventData->fontSize > 0) Utils::appendText(&style, &styleSize, "font-size:%dpt;", eventData->fontSize); - if (eventData->dwFlags & IEEDF_FORMAT_COLOR && eventData->color!=0xFFFFFFFF) + if (eventData->dwFlags & IEEDF_FORMAT_COLOR && eventData->color != 0xFFFFFFFF) Utils::appendText(&style, &styleSize, "color:#%06X;", ((eventData->color & 0xFF) << 16) | (eventData->color & 0xFF00) | ((eventData->color & 0xFF0000) >> 16)); - + if (eventData->dwFlags & IEEDF_FORMAT_FONT) Utils::appendText(&style, &styleSize, "font-family:%s;", eventData->fontName); @@ -232,7 +239,7 @@ void MUCCHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event) Utils::appendText(&style, &styleSize, "font-style: %s;", eventData->fontStyle & IE_FONT_ITALIC ? "italic" : "normal"); Utils::appendText(&style, &styleSize, "text-decoration: %s;", eventData->fontStyle & IE_FONT_UNDERLINE ? "underline" : "none"); } - Utils::appendText(&output, &outputSize, "%s", className, style!=NULL ? style : "", szText); + Utils::appendText(&output, &outputSize, "%s", className, style != NULL ? style : "", szText); Utils::appendText(&output, &outputSize, "
\n"); if (style != NULL) free(style); @@ -260,7 +267,7 @@ void MUCCHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event) Utils::appendText(&output, &outputSize, "
", divName); if (dwData & IEEDD_MUCC_SHOW_TIME || dwData & IEEDD_MUCC_SHOW_DATE) Utils::appendText(&output, &outputSize, "%s ", - isSent ? "timestamp" : "timestamp", timestampToString(dwData, eventData->time)); + isSent ? "timestamp" : "timestamp", timestampToString(dwData, eventData->time)); Utils::appendText(&output, &outputSize, "", className); Utils::appendText(&output, &outputSize, Translate(eventText), szText); @@ -289,7 +296,7 @@ void MUCCHTMLBuilder::appendEvent(IEView *view, IEVIEWEVENT *event) appendEventNonTemplate(view, event); } -bool MUCCHTMLBuilder::isDbEventShown(DBEVENTINFO *dbei) +bool MUCCHTMLBuilder::isDbEventShown(DBEVENTINFO *) { return true; } -- cgit v1.2.3