From 3b3266f2d7621992cbb48ad72f98afece7cb98d1 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Tue, 7 Apr 2015 18:46:09 +0000 Subject: Scriver: - Minor fixes! git-svn-id: http://svn.miranda-ng.org/main/trunk@12659 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Scriver/src/msgdialog.cpp | 2 +- plugins/Scriver/src/msglog.cpp | 14 ++------------ plugins/Scriver/src/msgwindow.cpp | 2 +- plugins/Scriver/src/utils.cpp | 2 +- 4 files changed, 5 insertions(+), 15 deletions(-) (limited to 'plugins/Scriver/src') diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 564bf3b468..8f02a4e35c 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -1062,7 +1062,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP mir_snprintf(buf, SIZEOF(buf), Translate("User menu - %s"), idbuf); SendDlgItemMessage(hwndDlg, IDC_USERMENU, BUTTONADDTOOLTIP, (WPARAM)buf, 0); - if (!cws || (!strcmp(cws->szModule, dat->szProto) && !strcmp(cws->szSetting, "Status"))) + if (cws && !strcmp(cws->szModule, dat->szProto) && !strcmp(cws->szSetting, "Status")) dat->wStatus = cws->value.wVal; SetStatusIcon(dat); diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index c5d48279bb..2afc1f3577 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -567,18 +567,8 @@ static char* CreateRTFFromEvent(SrmmWindowData *dat, EventData *evt, GlobalMessa if (!streamData->isFirst && isGroupBreak && (gdat->flags & SMF_DRAWLINES)) AppendToBuffer(buffer, bufferEnd, bufferAlloced, "\\sl-1\\slmult0\\highlight%d\\cf%d\\fs1 \\par\\sl0", fontOptionsListSize + 4, fontOptionsListSize + 4); - if (streamData->isFirst) { - if (evt->dwFlags & IEEDF_RTL) - AppendToBuffer(buffer, bufferEnd, bufferAlloced, "\\rtlpar"); - else - AppendToBuffer(buffer, bufferEnd, bufferAlloced, "\\ltrpar"); - } - else { - if (evt->dwFlags & IEEDF_RTL) - AppendToBuffer(buffer, bufferEnd, bufferAlloced, "\\rtlpar"); - else - AppendToBuffer(buffer, bufferEnd, bufferAlloced, "\\ltrpar"); - } + AppendToBuffer(buffer, bufferEnd, bufferAlloced, (evt->dwFlags & IEEDF_RTL) ? "\\rtlpar" : "\\ltrpar"); + if (evt->eventType == EVENTTYPE_MESSAGE) highlight = fontOptionsListSize + 2 + ((evt->dwFlags & IEEDF_SENT) ? 1 : 0); else diff --git a/plugins/Scriver/src/msgwindow.cpp b/plugins/Scriver/src/msgwindow.cpp index 542525c96b..71874509a9 100644 --- a/plugins/Scriver/src/msgwindow.cpp +++ b/plugins/Scriver/src/msgwindow.cpp @@ -47,7 +47,7 @@ TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto) if (hContact && szProto) { tokens[0] = GetNickname(hContact, szProto); tokenLen[0] = mir_tstrlen(tokens[0]); - tokens[1] = mir_tstrdup(pcli->pfnGetStatusModeDescription(szProto ? db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE) : ID_STATUS_OFFLINE, 0)); + tokens[1] = mir_tstrdup(pcli->pfnGetStatusModeDescription(db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), 0)); tokenLen[1] = mir_tstrlen(tokens[1]); tokens[2] = db_get_tsa(hContact, "CList", "StatusMsg"); if (tokens[2] != NULL) { diff --git a/plugins/Scriver/src/utils.cpp b/plugins/Scriver/src/utils.cpp index ec5c25b5e3..7fc1faa605 100644 --- a/plugins/Scriver/src/utils.cpp +++ b/plugins/Scriver/src/utils.cpp @@ -188,7 +188,7 @@ void rtrimText(TCHAR *text) { static TCHAR szTrimString[] = _T(":;,.!?\'\"><()[]- \r\n"); size_t iLen = mir_tstrlen(text) - 1; - while (iLen >= 0 && _tcschr(szTrimString, text[iLen])) { + while (_tcschr(szTrimString, text[iLen])) { text[iLen] = _T('\0'); iLen--; } -- cgit v1.2.3