diff options
author | George Hazan <george.hazan@gmail.com> | 2013-12-20 22:55:34 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-12-20 22:55:34 +0000 |
commit | 8307d69d0dbc7090956ea044eee19b4644104363 (patch) | |
tree | e777f19024a5fd3c8bb76a5959a1489418ba56d4 /plugins | |
parent | 615d143c46745ad1401516f37f1dec347c761695 (diff) |
- mathMod support removed;
- Unicode message log window procedure;
- Unicode urls
git-svn-id: http://svn.miranda-ng.org/main/trunk@7309 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/TabSRMM/res/msgwindow.rc | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat/chat.h | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat/log.cpp | 70 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat/options.cpp | 1 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat/services.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat/window.cpp | 29 | ||||
-rw-r--r-- | plugins/TabSRMM/src/commonheaders.h | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/container.cpp | 67 | ||||
-rw-r--r-- | plugins/TabSRMM/src/generic_msghandlers.cpp | 4 | ||||
-rw-r--r-- | plugins/TabSRMM/src/globals.cpp | 12 | ||||
-rw-r--r-- | plugins/TabSRMM/src/globals.h | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdialog.cpp | 94 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdlgutils.cpp | 38 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdlgutils.h | 3 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msglog.cpp | 55 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgs.cpp | 8 | ||||
-rw-r--r-- | plugins/TabSRMM/src/templates.cpp | 4 | ||||
-rw-r--r-- | plugins/TabSRMM/src/themes.cpp | 4 | ||||
-rw-r--r-- | plugins/TabSRMM/src/utils.cpp | 267 | ||||
-rw-r--r-- | plugins/TabSRMM/src/version.h | 24 |
20 files changed, 229 insertions, 461 deletions
diff --git a/plugins/TabSRMM/res/msgwindow.rc b/plugins/TabSRMM/res/msgwindow.rc index 498c18d71f..c7a2b02293 100644 --- a/plugins/TabSRMM/res/msgwindow.rc +++ b/plugins/TabSRMM/res/msgwindow.rc @@ -46,7 +46,7 @@ BEGIN CONTROL "&Send",IDC_MSGSENDLATER,"MButtonClass",WS_TABSTOP,146,10,55,12,0x18000000L
CONTROL "",IDC_STATICTEXT,"Static",SS_OWNERDRAW | WS_GROUP,27,0,160,9
CONTROL "",IDC_STATICERRORICON,"Static",SS_OWNERDRAW,4,3,20,20
- CONTROL "",IDC_LOG,"RichEdit20A",ES_MULTILINE | ES_AUTOVSCROLL | ES_NOHIDESEL | ES_READONLY | WS_VSCROLL | WS_TABSTOP,0,0,188,30,WS_EX_STATICEDGE
+ CONTROL "",IDC_LOG,"RichEdit20W",ES_MULTILINE | ES_AUTOVSCROLL | ES_NOHIDESEL | ES_READONLY | WS_VSCROLL | WS_TABSTOP,0,0,188,30,WS_EX_STATICEDGE
CONTROL "&Add",IDC_ADD,"MButtonClass",WS_TABSTOP,155,64,16,14,0x18000000L
CONTROL "&Remove",IDC_CANCELADD,"MButtonClass",WS_TABSTOP,171,64,16,14,0x18000000L
CONTROL "",IDC_LOGFROZENTEXT,"Static",SS_OWNERDRAW | WS_GROUP,10,3,188,18
diff --git a/plugins/TabSRMM/src/chat/chat.h b/plugins/TabSRMM/src/chat/chat.h index ad371a10f0..5ca2414e07 100644 --- a/plugins/TabSRMM/src/chat/chat.h +++ b/plugins/TabSRMM/src/chat/chat.h @@ -274,7 +274,7 @@ struct TMUCSettings bool bLogClassicIndicators, bAlternativeSorting, bAnnoyingHighlight, bCreateWindowOnHighlight;
bool bLogSymbols, bClassicIndicators, bClickableNicks, bColorizeNicks, bColorizeNicksInLog;
- bool bScaleIcons, bUseDividers, bDividersUsePopupConfig, bMathMod;
+ bool bScaleIcons, bUseDividers, bDividersUsePopupConfig;
HANDLE hGroup;
CMUCHighlight* Highlight;
diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp index 14b9236cd0..0c8906516e 100644 --- a/plugins/TabSRMM/src/chat/log.cpp +++ b/plugins/TabSRMM/src/chat/log.cpp @@ -954,20 +954,16 @@ static DWORD CALLBACK Log_StreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedraw, bool bPhaseTwo)
{
- EDITSTREAM stream;
- LOGSTREAMDATA streamData;
CHARRANGE oldsel, sel, newsel;
POINT point = {0};
- SCROLLINFO scroll;
- WPARAM wp;
- HWND hwndRich;
- TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
if (hwndDlg == 0 || lin == 0 || si == 0 || dat == 0)
return;
- hwndRich = GetDlgItem(hwndDlg, IDC_CHAT_LOG);
- ZeroMemory(&streamData, sizeof(LOGSTREAMDATA));
+ HWND hwndRich = GetDlgItem(hwndDlg, IDC_CHAT_LOG);
+
+ LOGSTREAMDATA streamData = { 0 };
streamData.hwnd = hwndRich;
streamData.si = si;
streamData.lin = lin;
@@ -979,9 +975,11 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedr if (bRedraw || si->iType != GCW_CHATROOM || !si->bFilterEnabled || (si->iLogFilterFlags&lin->iType) != 0) {
bool bFlag = false, fDoReplace;
- ZeroMemory(&stream, sizeof(stream));
+ EDITSTREAM stream = { 0 };
stream.pfnCallback = Log_StreamCallback;
stream.dwCookie = (DWORD_PTR) & streamData;
+
+ SCROLLINFO scroll = { 0 };
scroll.cbSize = sizeof(SCROLLINFO);
scroll.fMask = SIF_RANGE | SIF_POS | SIF_PAGE;
GetScrollInfo(GetDlgItem(hwndDlg, IDC_CHAT_LOG), SB_VERT, &scroll);
@@ -1001,7 +999,7 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedr bRedraw = TRUE;
// should the event(s) be appended to the current log
- wp = bRedraw ? SF_RTF : SFF_SELECTION | SF_RTF;
+ WPARAM wp = bRedraw ? SF_RTF : SFF_SELECTION | SF_RTF;
//get the number of pixels per logical inch
if (bRedraw) {
@@ -1023,54 +1021,27 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedr //SendMessage(hwndRich, EM_EXGETSEL, 0, (LPARAM)&newsel);
/*
- * for new added events, only replace in message or action events.
- * no need to replace smileys or math formulas elsewhere
- */
-
+ * for new added events, only replace in message or action events.
+ * no need to replace smileys or math formulas elsewhere
+ */
fDoReplace = (bRedraw || (lin->ptszText
&& (lin->iType == GC_EVENT_MESSAGE || lin->iType == GC_EVENT_ACTION)));
-
- /*
- * use mathmod to replace formulas
- */
- if (g_Settings.bMathMod && fDoReplace) {
- TMathRicheditInfo mathReplaceInfo;
- CHARRANGE mathNewSel;
- mathNewSel.cpMin = sel.cpMin;
-
- if (mathNewSel.cpMin < 0)
- mathNewSel.cpMin = 0;
-
- mathNewSel.cpMax = -1;
-
- mathReplaceInfo.hwndRichEditControl = hwndRich;
-
- if (!bRedraw)
- mathReplaceInfo.sel = &mathNewSel;
- else
- mathReplaceInfo.sel = 0;
-
- mathReplaceInfo.disableredraw = TRUE;
- CallService(MATH_RTF_REPLACE_FORMULAE, 0, (LPARAM)&mathReplaceInfo);
- bFlag = TRUE;
- }
-
/*
* replace marked nicknames with hyperlinks to make the nicks
* clickable
*/
-
if (g_Settings.bClickableNicks) {
- CHARFORMAT2 cf2;
FINDTEXTEX fi, fi2;
+ CHARFORMAT2 cf2;
ZeroMemory(&cf2, sizeof(CHARFORMAT2));
+ cf2.cbSize = sizeof(cf2);
+
fi2.lpstrText = _T("#++~~");
fi.chrg.cpMin = bRedraw ? 0 : sel.cpMin;
fi.chrg.cpMax = -1;
fi.lpstrText = _T("~~++#");
- cf2.cbSize = sizeof(cf2);
while (SendMessage(hwndRich, EM_FINDTEXTEX, FR_DOWN, (LPARAM)&fi) > -1) {
fi2.chrg.cpMin = fi.chrgText.cpMin;
@@ -1097,10 +1068,9 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedr SendMessage(hwndRich, EM_SETSEL, -1, -1);
}
-
/*
- * run smileyadd
- */
+ * run smileyadd
+ */
if (PluginConfig.g_SmileyAddAvail && fDoReplace) {
newsel.cpMax = -1;
newsel.cpMin = sel.cpMin;
@@ -1117,11 +1087,9 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedr }
/*
- * trim the message log to the number of most recent events
- * this uses hidden marks in the rich text to find the events which should be deleted
- */
-
-
+ * trim the message log to the number of most recent events
+ * this uses hidden marks in the rich text to find the events which should be deleted
+ */
if (si->wasTrimmed) {
TCHAR szPattern[50];
FINDTEXTEX fi;
diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp index 7648b6fa63..e1122a9483 100644 --- a/plugins/TabSRMM/src/chat/options.cpp +++ b/plugins/TabSRMM/src/chat/options.cpp @@ -1257,7 +1257,6 @@ void LoadGlobalSettings(void) g_Settings.bScaleIcons = M.GetBool("Chat", "ScaleIcons", true);
g_Settings.bUseDividers = M.GetBool("Chat", "UseDividers", true);
g_Settings.bDividersUsePopupConfig = M.GetBool("Chat", "DividersUsePopupConfig", true);
- g_Settings.bMathMod = ServiceExists(MATH_RTF_REPLACE_FORMULAE) && M.GetBool("Chat", "MathModSupport", false);
g_Settings.bDoubleClick4Privat = M.GetBool("Chat", "DoubleClick4Privat", false);
g_Settings.bShowContactStatus = M.GetBool("Chat", "ShowContactStatus", true);
diff --git a/plugins/TabSRMM/src/chat/services.cpp b/plugins/TabSRMM/src/chat/services.cpp index 5ce0ab9f9e..23914251de 100644 --- a/plugins/TabSRMM/src/chat/services.cpp +++ b/plugins/TabSRMM/src/chat/services.cpp @@ -62,8 +62,6 @@ int Chat_ModulesLoaded(WPARAM wParam, LPARAM lParam) hLeaveMenuItem = Menu_AddContactMenuItem(&mi);
CList_SetAllOffline(TRUE, NULL);
-
- g_Settings.bMathMod = ServiceExists(MATH_RTF_REPLACE_FORMULAE) && M.GetByte("Chat", "MathModSupport", 0);
return 0;
}
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index 1ac9ed8ecc..86c725e219 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -206,7 +206,7 @@ static BOOL CheckCustomLink(HWND hwndDlg, POINT* ptClient, UINT uMsg, WPARAM wPa return bIsCustomLink;
}
-static bool IsStringValidLink(TCHAR* pszText)
+bool IsStringValidLink(TCHAR* pszText)
{
if (pszText == NULL)
return false;
@@ -312,11 +312,6 @@ static void Chat_UpdateWindowState(TWindowData *dat, UINT msg) UpdateTrayMenuState(dat, FALSE);
DM_SetDBButtonStates(hwndDlg, dat);
- if (g_Settings.bMathMod) {
- CallService(MTH_Set_ToolboxEditHwnd, 0, (LPARAM)GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
- MTH_updateMathWindow(dat);
- }
-
if (dat->dwFlagsEx & MWF_EX_DELAYEDSPLITTER) {
dat->dwFlagsEx &= ~MWF_EX_DELAYEDSPLITTER;
ShowWindow(dat->pContainer->hwnd, SW_RESTORE);
@@ -735,24 +730,9 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, BOOL isShift, isAlt, isCtrl;
KbdState(mwdat, isShift, isCtrl, isAlt);
- if (PluginConfig.g_bSoundOnTyping && !isAlt &&!isCtrl&&!(mwdat->pContainer->dwFlags&CNT_NOSOUND)&&wParam!=VK_ESCAPE&&!(wParam==VK_TAB&&PluginConfig.m_AllowTab))
+ if (PluginConfig.g_bSoundOnTyping && !isAlt &&!isCtrl&&!(mwdat->pContainer->dwFlags&CNT_NOSOUND) && wParam != VK_ESCAPE&&!(wParam == VK_TAB&&PluginConfig.m_AllowTab))
SkinPlaySound("SoundOnTyping");
- if (wParam == 0x0d && isCtrl && PluginConfig.m_MathModAvail) {
- TCHAR toInsert[100];
- BYTE keyState[256];
- size_t i;
- size_t iLen = lstrlen(PluginConfig.m_MathModStartDelimiter);
- ZeroMemory(keyState, 256);
- _tcsncpy(toInsert, PluginConfig.m_MathModStartDelimiter, 30);
- _tcsncat(toInsert, PluginConfig.m_MathModStartDelimiter, 30);
- SendMessage(hwnd, EM_REPLACESEL, TRUE, (LPARAM)toInsert);
- SetKeyboardState(keyState);
- for (i=0; i < iLen; i++)
- SendMessage(hwnd, WM_KEYDOWN, mwdat->dwFlags & MWF_LOG_RTL ? VK_RIGHT : VK_LEFT, 0);
- return 0;
- }
-
if (isCtrl && !isAlt && !isShift) {
MODULEINFO *mi = MM_FindModule(Parentsi->pszModule);
@@ -2886,7 +2866,7 @@ LABEL_SHOWWINDOW: tr2.chrg.cpMax = chr.cpMax + 1;
/* if there is no space after selection,
or there is nothing after selection at all... */
- if (! SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_GETTEXTRANGE, 0, (LPARAM)&tr2) || ! _istspace(*tr2.lpstrText)) {
+ if (!SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_GETTEXTRANGE, 0, (LPARAM)&tr2) || !_istspace(*tr2.lpstrText)) {
tszAppeal[st++] = _T(' ');
tszAppeal[st++] = _T('\0');
}
@@ -3044,9 +3024,6 @@ LABEL_SHOWWINDOW: break;
case IDC_CHAT_MESSAGE:
- if (g_Settings.bMathMod)
- MTH_updateMathWindow(dat);
-
if (HIWORD(wParam) == EN_CHANGE) {
if (dat->pContainer->hwndActive == hwndDlg)
UpdateReadChars(dat);
diff --git a/plugins/TabSRMM/src/commonheaders.h b/plugins/TabSRMM/src/commonheaders.h index 403bde5359..3e44201cf7 100644 --- a/plugins/TabSRMM/src/commonheaders.h +++ b/plugins/TabSRMM/src/commonheaders.h @@ -96,7 +96,6 @@ #include <m_folders.h>
#include <m_msg_buttonsbar.h>
#include <m_flash.h>
-#include <m_mathmodule.h>
#include <m_smileyadd.h>
#define TSAPI __stdcall
@@ -278,7 +277,6 @@ extern INT_PTR CALLBACK DlgProcSetupStatusModes(HWND hwndDlg, UINT msg, WPARAM w extern HIMAGELIST CreateStateImageList();
extern INT_PTR SendMessageCommand(WPARAM wParam, LPARAM lParam);
extern INT_PTR SendMessageCommand_W(WPARAM wParam, LPARAM lParam);
-extern void ReleaseRichEditOle(IRichEditOle *ole);
extern void ImageDataInsertBitmap(IRichEditOle *ole, HBITMAP hBm);
extern int CacheIconToBMP(TLogIcon *theIcon, HICON hIcon, COLORREF backgroundColor, int sizeX, int sizeY);
extern void DeleteCachedIcon(TLogIcon *theIcon);
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index ae938972e7..29375654f0 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -841,17 +841,6 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, if (pContainer->hwndStatus)
InvalidateRect(pContainer->hwndStatus, NULL, FALSE);
- if (PluginConfig.m_MathModAvail) {
- TMathWindowInfo mathWndInfo;
-
- RECT windRect;
- GetWindowRect(hwndDlg, &windRect);
- mathWndInfo.top = windRect.top;
- mathWndInfo.left = windRect.left;
- mathWndInfo.right = windRect.right;
- mathWndInfo.bottom = windRect.bottom;
- CallService(MTH_RESIZE, 0, (LPARAM)&mathWndInfo);
- }
if ((CSkin::m_bClipBorder != 0 || CSkin::m_bRoundedCorner) && CSkin::m_frameSkins) {
HRGN rgn;
RECT rcWindow;
@@ -931,7 +920,7 @@ panel_found: switch (((LPNMHDR)lParam)->code) {
case TCN_SELCHANGE:
- ZeroMemory((void*)&item, sizeof(item));
+ ZeroMemory(&item, sizeof(item));
iItem = TabCtrl_GetCurSel(hwndTab);
item.mask = TCIF_PARAM;
if (TabCtrl_GetItem(hwndTab, iItem, &item)) {
@@ -1028,7 +1017,7 @@ panel_found: case ID_TABMENU_ATTACHTOCONTAINER:
if ((iItem = GetTabItemFromMouse(hwndTab, &pt1)) == -1)
break;
- ZeroMemory((void*)&item, sizeof(item));
+ ZeroMemory(&item, sizeof(item));
item.mask = TCIF_PARAM;
TabCtrl_GetItem(hwndTab, iItem, &item);
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_SELECTCONTAINER), hwndDlg, SelectContainerDlgProc, (LPARAM)item.lParam);
@@ -1209,32 +1198,10 @@ panel_found: */
if (mmi->ptMinTrackSize.y < 50 || mmi->ptMinTrackSize.y > rcDesktop.bottom)
mmi->ptMinTrackSize.y = 130;
-
- if (PluginConfig.m_MathModAvail) {
- if (CallService(MTH_GET_PREVIEW_SHOWN, 0, 0)) {
- RECT rc;
- HWND hwndMath = FindWindowA("TfrmPreview", "Preview");
- GetWindowRect(hwndMath, &rc);
- mmi->ptMaxSize.y -= (rc.bottom - rc.top);
- }
- }
}
}
return 0;
- case WM_MOVE:
- if (PluginConfig.m_MathModAvail) {
- TMathWindowInfo mathWndInfo;
- RECT windRect;
- GetWindowRect(hwndDlg, &windRect);
- mathWndInfo.top = windRect.top;
- mathWndInfo.left = windRect.left;
- mathWndInfo.right = windRect.right;
- mathWndInfo.bottom = windRect.bottom;
- CallService(MTH_RESIZE, 0, (LPARAM)&mathWndInfo);
- }
- break;
-
case DM_UPDATETITLE:
{
HANDLE hContact = 0;
@@ -1374,7 +1341,7 @@ panel_found: if (iNewTab != iCurrent) {
TabControlData *tabdat = (TabControlData *)GetWindowLongPtr(hwndTab, GWLP_USERDATA);
- ZeroMemory((void*)&item, sizeof(item));
+ ZeroMemory(&item, sizeof(item));
item.mask = TCIF_PARAM;
if (TabCtrl_GetItem(hwndTab, iNewTab, &item)) {
TabCtrl_SetCurSel(hwndTab, iNewTab);
@@ -1412,11 +1379,8 @@ panel_found: if (pContainer == NULL)
break;
- if (LOWORD(wParam == WA_INACTIVE)) {
+ if (LOWORD(wParam == WA_INACTIVE))
BroadCastContainer(pContainer, DM_CHECKINFOTIP, wParam, lParam);
- if (PluginConfig.m_MathModAvail)
- CallService(MTH_HIDE, 0, 0);
- }
if (LOWORD(wParam == WA_INACTIVE) && (HWND)lParam != PluginConfig.g_hwndHotkeyHandler && GetParent((HWND)lParam) != hwndDlg) {
BOOL fTransAllowed = !bSkinned || PluginConfig.m_bIsVista;
@@ -1442,14 +1406,10 @@ panel_found: pContainer->dwFlashingStarted = 0;
pLastActiveContainer = pContainer;
if (pContainer->dwFlags & CNT_DEFERREDTABSELECT) {
- NMHDR nmhdr;
-
pContainer->dwFlags &= ~CNT_DEFERREDTABSELECT;
SendMessage(hwndDlg, WM_SYSCOMMAND, SC_RESTORE, 0);
- ZeroMemory((void*)&nmhdr, sizeof(nmhdr));
- nmhdr.code = TCN_SELCHANGE;
- nmhdr.hwndFrom = hwndTab;
- nmhdr.idFrom = IDC_MSGTABS;
+
+ NMHDR nmhdr = { hwndTab, IDC_MSGTABS, TCN_SELCHANGE };
SendMessage(hwndDlg, WM_NOTIFY, 0, (LPARAM)&nmhdr); // do it via a WM_NOTIFY / TCN_SELCHANGE to simulate user-activation
}
if (pContainer->dwFlags & CNT_DEFERREDSIZEREQUEST) {
@@ -1470,7 +1430,7 @@ panel_found: SendMessage(hwndDlg, DM_UPDATETITLE, (WPARAM)hContact, 0);
}
}
- ZeroMemory((void*)&item, sizeof(item));
+ ZeroMemory(&item, sizeof(item));
item.mask = TCIF_PARAM;
if ((curItem = TabCtrl_GetCurSel(hwndTab)) >= 0)
TabCtrl_GetItem(hwndTab, curItem, &item);
@@ -1883,7 +1843,7 @@ panel_found: fa.cProto = dat ? dat->szProto : NULL;
CallService(MS_FAVATAR_DESTROY, (WPARAM)&fa, 0);
}
- ZeroMemory((void*)&item, sizeof(item));
+ ZeroMemory(&item, sizeof(item));
pContainer->hwnd = 0;
pContainer->hwndActive = 0;
pContainer->hMenuContext = 0;
@@ -1902,8 +1862,6 @@ panel_found: if (pContainer->hwndTip)
DestroyWindow(pContainer->hwndTip);
RemoveContainerFromList(pContainer);
- if (PluginConfig.m_MathModAvail)
- CallService(MTH_HIDE, 0, 0);
SM_RemoveContainer(pContainer);
if (pContainer->cachedDC) {
SelectObject(pContainer->cachedDC, pContainer->oldHBM);
@@ -1934,7 +1892,6 @@ panel_found: pContainer->fHidden = true;
}
else {
- WINDOWPLACEMENT wp;
char szCName[40];
char *szSetting = "CNTW_";
@@ -1970,7 +1927,7 @@ panel_found: }
}
- ZeroMemory((void*)&wp, sizeof(wp));
+ WINDOWPLACEMENT wp = { 0 };
wp.length = sizeof(wp);
/*
* save geometry information to the database...
@@ -2070,7 +2027,7 @@ int TSAPI GetTabIndexFromHWND(HWND hwndTab, HWND hwnd) iItems = TabCtrl_GetItemCount(hwndTab);
- ZeroMemory((void*)&item, sizeof(item));
+ ZeroMemory(&item, sizeof(item));
item.mask = TCIF_PARAM;
for (i=0; i < iItems; i++) {
@@ -2104,7 +2061,7 @@ HWND TSAPI GetHWNDFromTabIndex(HWND hwndTab, int idx) iItems = TabCtrl_GetItemCount(hwndTab);
- ZeroMemory((void*)&item, sizeof(item));
+ ZeroMemory(&item, sizeof(item));
item.mask = TCIF_PARAM;
for (i=0; i < iItems; i++)
@@ -2465,7 +2422,7 @@ HMENU TSAPI BuildContainerMenu() db_free(&dbv);
i++;
}
- while (TRUE);
+ while (true);
InsertMenu(PluginConfig.g_hMenuContext, ID_TABMENU_ATTACHTOCONTAINER, MF_BYCOMMAND | MF_POPUP, (UINT_PTR) hMenu, TranslateT("Attach to"));
PluginConfig.g_hMenuContainer = hMenu;
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index c874422d08..cf99dc2b80 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -135,7 +135,7 @@ void TSAPI DM_InitTip(TWindowData *dat) dat->hwndTip = CreateWindowEx(0, TOOLTIPS_CLASS, NULL, WS_POPUP | TTS_NOPREFIX | TTS_BALLOON, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, dat->hwnd, NULL, g_hInst, (LPVOID) NULL);
- ZeroMemory((void*)&dat->ti, sizeof(dat->ti));
+ ZeroMemory(&dat->ti, sizeof(dat->ti));
dat->ti.cbSize = sizeof(dat->ti);
dat->ti.lpszText = PluginConfig.m_szNoStatus;
dat->ti.hinst = g_hInst;
@@ -1775,7 +1775,7 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM wParam, LPARAM lParam) HWND hwndContainer = dat->pContainer->hwnd;
TContainerData* m_pContainer = dat->pContainer;
- ZeroMemory((void*)newcontactname, sizeof(newcontactname));
+ ZeroMemory(newcontactname, sizeof(newcontactname));
dat->szStatus[0] = 0;
pszNewTitleEnd = _T("Message Session");
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index 3d28031054..58c58f38e7 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -114,8 +114,6 @@ void CGlobals::reloadSystemStartup() */
void CGlobals::reloadSystemModulesChanged()
{
- m_MathModAvail = ServiceExists(MATH_RTF_REPLACE_FORMULAE);
-
/*
* smiley add
*/
@@ -127,7 +125,6 @@ void CGlobals::reloadSystemModulesChanged() /*
* Flashavatars
*/
-
g_FlashAvatarAvail = (ServiceExists(MS_FAVATAR_GETINFO) ? 1 : 0);
/*
@@ -146,15 +143,6 @@ void CGlobals::reloadSystemModulesChanged() g_iButtonsBarGap = M.GetByte("ButtonsBarGap", 1);
m_hwndClist = (HWND)CallService(MS_CLUI_GETHWND, 0, 0);
- m_MathModAvail = (ServiceExists(MATH_RTF_REPLACE_FORMULAE) ? 1 : 0);
- if (m_MathModAvail) {
- char *szDelim = (char *)CallService(MATH_GET_STARTDELIMITER, 0, 0);
- if (szDelim) {
- MultiByteToWideChar(CP_ACP, 0, szDelim, -1, PluginConfig.m_MathModStartDelimiter, SIZEOF(PluginConfig.m_MathModStartDelimiter));
- CallService(MTH_FREE_MATH_BUFFER, 0, (LPARAM)szDelim);
- }
- }
- else PluginConfig.m_MathModStartDelimiter[0] = 0;
g_MetaContactsAvail = (ServiceExists(MS_MC_GETDEFAULTCONTACT) ? 1 : 0);
diff --git a/plugins/TabSRMM/src/globals.h b/plugins/TabSRMM/src/globals.h index 1b5e592a66..37657f275a 100644 --- a/plugins/TabSRMM/src/globals.h +++ b/plugins/TabSRMM/src/globals.h @@ -103,8 +103,6 @@ public: int m_SendFormat;
int m_FormatWholeWordsOnly;
int m_RTLDefault;
- int m_MathModAvail;
- TCHAR m_MathModStartDelimiter[40];
int m_UnreadInTray;
int m_TrayFlashes;
int m_TrayFlashState;
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index d23357339c..a0142b5a9d 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -31,6 +31,8 @@ #define MS_HTTPSERVER_ADDFILENAME "HTTPServer/AddFileName"
+bool IsStringValidLink(TCHAR* pszText);
+
const TCHAR *pszIDCSAVE_close = 0, *pszIDCSAVE_save = 0;
static const UINT sendControls[] = { IDC_MESSAGE, IDC_LOG };
@@ -69,26 +71,6 @@ static void _clrMsgFilter(LPARAM lParam) m->wParam = 0;
}
-static BOOL IsStringValidLinkA(char* pszText)
-{
- char *p = pszText;
-
- if (pszText == NULL)
- return FALSE;
- if (lstrlenA(pszText) < 5)
- return FALSE;
-
- while (*p) {
- if (*p == '"')
- return FALSE;
- p++;
- }
- if (tolower(pszText[0]) == 'w' && tolower(pszText[1]) == 'w' && tolower(pszText[2]) == 'w' && pszText[3] == '.' && isalnum(pszText[4]))
- return TRUE;
-
- return(strstr(pszText, "://") == NULL ? FALSE : TRUE);
-}
-
BOOL TSAPI IsUtfSendAvailable(HANDLE hContact)
{
char *szProto = GetContactProto(hContact);
@@ -384,10 +366,6 @@ static void MsgWindowUpdateState(TWindowData *dat, UINT msg) dat->pContainer->MenuBar->configureMenu();
UpdateTrayMenuState(dat, FALSE);
- if (PluginConfig.m_MathModAvail) {
- CallService(MTH_Set_ToolboxEditHwnd, 0, (LPARAM)GetDlgItem(hwndDlg, IDC_MESSAGE));
- MTH_updateMathWindow(dat);
- }
if (dat->pContainer->hwndActive == hwndDlg)
PostMessage(hwndDlg, DM_REMOVEPOPUPS, PU_REMOVE_ON_FOCUS, 0);
@@ -631,20 +609,6 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar if (PluginConfig.g_bSoundOnTyping && !isAlt && !isCtrl && !(mwdat->pContainer->dwFlags & CNT_NOSOUND) && wParam != VK_ESCAPE && !(wParam == VK_TAB && PluginConfig.m_AllowTab))
SkinPlaySound("SoundOnTyping");
//MAD
- if (wParam == 0x0d && isCtrl && PluginConfig.m_MathModAvail) {
- TCHAR toInsert[100];
- BYTE keyState[256];
- size_t i;
- size_t iLen = lstrlen(PluginConfig.m_MathModStartDelimiter);
- ZeroMemory(keyState, 256);
- _tcsncpy(toInsert, PluginConfig.m_MathModStartDelimiter, 30);
- _tcsncat(toInsert, PluginConfig.m_MathModStartDelimiter, 30);
- SendMessage(hwnd, EM_REPLACESEL, TRUE, (LPARAM)toInsert);
- SetKeyboardState(keyState);
- for (i=0; i < iLen; i++)
- SendMessage(hwnd, WM_KEYDOWN, mwdat->dwFlags & MWF_LOG_RTL ? VK_RIGHT : VK_LEFT, 0);
- return 0;
- }
if (isCtrl && !isAlt) {
switch (wParam) {
case 0x02: // bold
@@ -1543,10 +1507,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SendMessage(hwndContainer, DM_QUERYCLIENTAREA, 0, (LPARAM)&rc);
{
- WNDCLASSA wndClass;
-
- ZeroMemory(&wndClass, sizeof(wndClass));
- GetClassInfoA(g_hInst, "RichEdit20A", &wndClass);
+ WNDCLASS wndClass = { 0 };
+ GetClassInfo(g_hInst, _T("RichEdit20W"), &wndClass);
mir_subclassWindowFull( GetDlgItem(hwndDlg, IDC_LOG), MessageLogSubclassProc, wndClass.lpfnWndProc);
}
SetWindowPos(hwndDlg, 0, rc.left, rc.top, (rc.right - rc.left), (rc.bottom - rc.top), newData->iActivate ? 0 : SWP_NOZORDER | SWP_NOACTIVATE);
@@ -2240,57 +2202,54 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case WM_RBUTTONDOWN:
case WM_LBUTTONUP:
{
- TEXTRANGEA tr;
CHARRANGE sel;
-
SendDlgItemMessage(hwndDlg, IDC_LOG, EM_EXGETSEL, 0, (LPARAM)&sel);
if (sel.cpMin != sel.cpMax)
break;
- tr.chrg = ((ENLINK *) lParam)->chrg;
- tr.lpstrText = (char *)mir_alloc(tr.chrg.cpMax - tr.chrg.cpMin + 8);
- SendDlgItemMessageA(hwndDlg, IDC_LOG, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
- if (strchr(tr.lpstrText, '@') != NULL && strchr(tr.lpstrText, ':') == NULL && strchr(tr.lpstrText, '/') == NULL) {
+
+ TEXTRANGEW tr;
+ tr.chrg = ((ENLINK*)lParam)->chrg;
+ tr.lpstrText = (TCHAR*)_alloca(sizeof(TCHAR)*(tr.chrg.cpMax - tr.chrg.cpMin + 8));
+ SendDlgItemMessage(hwndDlg, IDC_LOG, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
+ if (_tcschr(tr.lpstrText, '@') != NULL && _tcschr(tr.lpstrText, ':') == NULL && _tcschr(tr.lpstrText, '/') == NULL) {
MoveMemory(tr.lpstrText + 7, tr.lpstrText, tr.chrg.cpMax - tr.chrg.cpMin + 1);
CopyMemory(tr.lpstrText, _T("mailto:"), 7);
}
- if (IsStringValidLinkA(tr.lpstrText)) {
- if (((ENLINK *) lParam)->msg == WM_RBUTTONDOWN) {
+ if (IsStringValidLink(tr.lpstrText)) {
+ if (((ENLINK*) lParam)->msg == WM_RBUTTONDOWN) {
HMENU hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_CONTEXT));
HMENU hSubMenu = GetSubMenu(hMenu, 1);
TranslateMenu(hSubMenu);
- pt.x = (short) LOWORD(((ENLINK *) lParam)->lParam);
- pt.y = (short) HIWORD(((ENLINK *) lParam)->lParam);
- ClientToScreen(((NMHDR *) lParam)->hwndFrom, &pt);
+ pt.x = (short)LOWORD(((ENLINK*)lParam)->lParam);
+ pt.y = (short)HIWORD(((ENLINK*)lParam)->lParam);
+ ClientToScreen(((NMHDR*) lParam)->hwndFrom, &pt);
switch (TrackPopupMenu(hSubMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL)) {
case IDM_OPENNEW:
- CallService(MS_UTILS_OPENURL, 1, (LPARAM)tr.lpstrText);
+ CallService(MS_UTILS_OPENURL, 1 + OUF_TCHAR, (LPARAM)tr.lpstrText);
break;
case IDM_OPENEXISTING:
- CallService(MS_UTILS_OPENURL, 0, (LPARAM)tr.lpstrText);
+ CallService(MS_UTILS_OPENURL, OUF_TCHAR, (LPARAM)tr.lpstrText);
break;
- case IDM_COPYLINK: {
+ case IDM_COPYLINK:
HGLOBAL hData;
if (!OpenClipboard(hwndDlg))
break;
EmptyClipboard();
- hData = GlobalAlloc(GMEM_MOVEABLE, lstrlenA(tr.lpstrText) + 1);
- lstrcpyA((char *)GlobalLock(hData), tr.lpstrText);
+ hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(lstrlen(tr.lpstrText)+1));
+ lstrcpy((TCHAR*)GlobalLock(hData), tr.lpstrText);
GlobalUnlock(hData);
SetClipboardData(CF_TEXT, hData);
CloseClipboard();
break;
- }
}
- mir_free(tr.lpstrText);
DestroyMenu(hMenu);
SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, TRUE);
return TRUE;
- } else {
- CallService(MS_UTILS_OPENURL, 1, (LPARAM)tr.lpstrText);
- SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE));
}
+
+ CallService(MS_UTILS_OPENURL, OUF_TCHAR, (LPARAM)tr.lpstrText);
+ SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE));
}
- mir_free(tr.lpstrText);
break;
}
}
@@ -3002,12 +2961,12 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (dat->sendMode & SMODE_CONTAINER && m_pContainer->hwndActive == hwndDlg && GetForegroundWindow() == hwndContainer) {
HWND contacthwnd;
- TCITEM tci;
int tabCount = TabCtrl_GetItemCount(hwndTab), i;
char *szFromStream = NULL;
szFromStream = Message_GetFromStream(GetDlgItem(hwndDlg, IDC_MESSAGE), dat, dat->SendFormat ? 0 : (CP_UTF8 << 16) | (SF_TEXT | SF_USECODEPAGE));
- ZeroMemory((void*)&tci, sizeof(tci));
+
+ TCITEM tci = { 0 };
tci.mask = TCIF_PARAM;
for (i=0; i < tabCount; i++) {
@@ -3166,9 +3125,6 @@ quote_from_last: break;
case IDC_MESSAGE:
- if (PluginConfig.m_MathModAvail && HIWORD(wParam) == EN_CHANGE)
- MTH_updateMathWindow(dat);
-
if (HIWORD(wParam) == EN_CHANGE) {
if (m_pContainer->hwndActive == hwndDlg)
UpdateReadChars(dat);
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 43a7f24694..feb3292d8c 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -213,9 +213,7 @@ static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic) void TSAPI FlashTab(TWindowData *dat, HWND hwndTab, int iTabindex, BOOL *bState, BOOL mode, HICON origImage)
{
- TCITEM item;
-
- ZeroMemory((void*)&item, sizeof(item));
+ TCITEM item = { 0 };
item.mask = TCIF_IMAGE;
if (mode)
@@ -2229,40 +2227,6 @@ HICON TSAPI MY_GetContactIcon(const TWindowData *dat) //return(LoadSkinnedProtoIcon(dat->cache->getActiveProto(), dat->cache->getStatus()));
}
-static void TSAPI MTH_updatePreview(const TWindowData *dat)
-{
- TMathWindowInfo mathWndInfo;
- HWND hwndEdit = GetDlgItem(dat->hwnd, dat->bType == SESSIONTYPE_IM ? IDC_MESSAGE : IDC_CHAT_MESSAGE);
- int len = GetWindowTextLengthA(hwndEdit);
- RECT windRect;
- char * thestr = (char *)mir_alloc(len + 5);
-
- GetWindowTextA(hwndEdit, thestr, len + 1);
- GetWindowRect(dat->pContainer->hwnd, &windRect);
- mathWndInfo.top = windRect.top;
- mathWndInfo.left = windRect.left;
- mathWndInfo.right = windRect.right;
- mathWndInfo.bottom = windRect.bottom;
-
- CallService(MTH_SETFORMULA, 0, (LPARAM)thestr);
- CallService(MTH_RESIZE, 0, (LPARAM)&mathWndInfo);
- mir_free(thestr);
-}
-
-void TSAPI MTH_updateMathWindow(const TWindowData *dat)
-{
- WINDOWPLACEMENT cWinPlace;
-
- if (!PluginConfig.m_MathModAvail)
- return;
-
- MTH_updatePreview(dat);
- CallService(MTH_SHOW, 0, 0);
- cWinPlace.length = sizeof(WINDOWPLACEMENT);
- GetWindowPlacement(dat->pContainer->hwnd, &cWinPlace);
- return;
-}
-
/**
* read keyboard state and return the state of the modifier keys
*/
diff --git a/plugins/TabSRMM/src/msgdlgutils.h b/plugins/TabSRMM/src/msgdlgutils.h index ac544d60d2..37589fa1d4 100644 --- a/plugins/TabSRMM/src/msgdlgutils.h +++ b/plugins/TabSRMM/src/msgdlgutils.h @@ -86,9 +86,6 @@ void TSAPI ClearLog (TWindowData *dat); bool TSAPI IsAutoSplitEnabled (const TWindowData *dat);
LONG TSAPI GetDefaultMinimumInputHeight (const TWindowData *dat);
void TSAPI DetermineMinHeight (TWindowData *dat);
-// mathmod
-
-void TSAPI MTH_updateMathWindow (const TWindowData *dat);
void TSAPI CleanTempFiles ();
void TSAPI SendHBitmapAsFile (const TWindowData *dat, HBITMAP hbmp);
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index 0b32eab640..d851c6c87c 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -134,7 +134,7 @@ void TSAPI CacheLogFonts() logPixelSY = GetDeviceCaps(hdc, LOGPIXELSY);
ReleaseDC(NULL, hdc);
- ZeroMemory((void*)logfonts, sizeof(LOGFONTA) * MSGDLGFONTCOUNT + 2);
+ ZeroMemory(logfonts, sizeof(LOGFONTA) * MSGDLGFONTCOUNT + 2);
for (i=0; i < MSGDLGFONTCOUNT; i++) {
LoadLogfont(i, &logfonts[i], &fontcolors[i], FONTMODULE);
mir_snprintf(rtfFontsGlobal[i], SIZEOF(rtfFontsGlobal[i]), "\\f%u\\cf%u\\b%d\\i%d\\ul%d\\fs%u", i, i, logfonts[i].lfWeight >= FW_BOLD ? 1 : 0, logfonts[i].lfItalic,logfonts[i].lfUnderline, 2 * abs(logfonts[i].lfHeight) * 74 / logPixelSY);
@@ -1403,40 +1403,40 @@ void TSAPI StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAp static void ReplaceIcons(HWND hwndDlg, TWindowData *dat, LONG startAt, int fAppend, BOOL isSent)
{
- FINDTEXTEXA fi;
- CHARFORMAT2 cf2;
- HWND hwndrtf;
- IRichEditOle *ole;
- TEXTRANGEA tr;
COLORREF crDefault;
TLogIcon theIcon;
- char trbuffer[40];
DWORD dwScale = M.GetDword("iconscale", 0);
+
+ TCHAR trbuffer[40];
+ TEXTRANGE tr;
tr.lpstrText = trbuffer;
- hwndrtf = GetDlgItem(hwndDlg, IDC_LOG);
+ HWND hwndrtf = GetDlgItem(hwndDlg, IDC_LOG);
+
+ FINDTEXTEX fi;
fi.chrg.cpMin = startAt;
if (dat->clr_added) {
unsigned int length;
int index;
CHARRANGE cr;
- fi.lpstrText = "##col##";
+ fi.lpstrText = _T("##col##");
fi.chrg.cpMax = -1;
- ZeroMemory((void*)&cf2, sizeof(cf2));
+ CHARFORMAT2 cf2;
+ ZeroMemory(&cf2, sizeof(cf2));
cf2.cbSize = sizeof(cf2);
cf2.dwMask = CFM_COLOR;
- while (SendMessageA(hwndrtf, EM_FINDTEXTEX, FR_DOWN, (LPARAM)&fi) > -1) {
+ while (SendMessage(hwndrtf, EM_FINDTEXTEX, FR_DOWN, (LPARAM)&fi) > -1) {
tr.chrg.cpMin = fi.chrgText.cpMin;
tr.chrg.cpMax = tr.chrg.cpMin + 18;
trbuffer[0] = 0;
- SendMessageA(hwndrtf, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
+ SendMessage(hwndrtf, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
trbuffer[18] = 0;
cr.cpMin = fi.chrgText.cpMin;
cr.cpMax = cr.cpMin + 18;
SendMessage(hwndrtf, EM_EXSETSEL, 0, (LPARAM)&cr);
- SendMessageA(hwndrtf, EM_REPLACESEL, FALSE, (LPARAM)"");
- length = (unsigned int)atol(&trbuffer[7]);
- index = atol(&trbuffer[14]);
+ SendMessage(hwndrtf, EM_REPLACESEL, FALSE, (LPARAM)_T(""));
+ length = (unsigned int)_ttol(&trbuffer[7]);
+ index = _ttol(&trbuffer[14]);
if (length > 0 && length < 20000 && index >= RTF_CTABLE_DEFSIZE && index < Utils::rtf_ctable_size) {
cf2.crTextColor = Utils::rtf_ctable[index].clr;
cr.cpMin = fi.chrgText.cpMin;
@@ -1450,22 +1450,25 @@ static void ReplaceIcons(HWND hwndDlg, TWindowData *dat, LONG startAt, int fAppe if (dat->dwFlags & MWF_LOG_SHOWICONS) {
BYTE bIconIndex = 0;
char bDirection = 0;
- CHARRANGE cr;
- fi.lpstrText = "#~#";
+ fi.lpstrText = _T("#~#");
fi.chrg.cpMax = -1;
- ZeroMemory((void*)&cf2, sizeof(cf2));
+
+ CHARFORMAT2 cf2;
+ ZeroMemory(&cf2, sizeof(cf2));
cf2.cbSize = sizeof(cf2);
cf2.dwMask = CFM_BACKCOLOR;
+ IRichEditOle *ole;
SendMessage(hwndrtf, EM_GETOLEINTERFACE, 0, (LPARAM)&ole);
while (SendMessageA(hwndrtf, EM_FINDTEXTEX, FR_DOWN, (LPARAM)&fi) > -1) {
+ CHARRANGE cr;
cr.cpMin = fi.chrgText.cpMin;
cr.cpMax = fi.chrgText.cpMax + 2;
SendMessage(hwndrtf, EM_EXSETSEL, 0, (LPARAM)&cr);
tr.chrg.cpMin = fi.chrgText.cpMin + 3;
tr.chrg.cpMax = fi.chrgText.cpMin + 5;
- SendMessageA(hwndrtf, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
+ SendMessage(hwndrtf, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
bIconIndex = ((BYTE)trbuffer[0] - (BYTE)'0');
if (bIconIndex >= NR_LOGICONS) {
fi.chrg.cpMin = fi.chrgText.cpMax + 6;
@@ -1480,7 +1483,7 @@ static void ReplaceIcons(HWND hwndDlg, TWindowData *dat, LONG startAt, int fAppe DeleteCachedIcon(&theIcon);
fi.chrg.cpMin = cr.cpMax + 6;
}
- ReleaseRichEditOle(ole);
+ ole->Release();
}
/*
* do smiley replacing, using the service
@@ -1510,18 +1513,6 @@ static void ReplaceIcons(HWND hwndDlg, TWindowData *dat, LONG startAt, int fAppe CallService(MS_SMILEYADD_REPLACESMILEYS, TABSRMM_SMILEYADD_BKGCOLORMODE, (LPARAM)&smadd);
}
- if (PluginConfig.m_MathModAvail) {
- TMathRicheditInfo mathReplaceInfo;
- CHARRANGE mathNewSel;
- mathNewSel.cpMin = startAt;
- mathNewSel.cpMax = -1;
- mathReplaceInfo.hwndRichEditControl = GetDlgItem(hwndDlg, IDC_LOG);
- if (startAt > 0) mathReplaceInfo.sel = & mathNewSel;
- else mathReplaceInfo.sel = 0;
- mathReplaceInfo.disableredraw = TRUE;
- CallService(MATH_RTF_REPLACE_FORMULAE, 0, (LPARAM)&mathReplaceInfo);
- }
-
if (dat->hHistoryEvents && dat->curHistory == dat->maxHistory) {
char szPattern[50];
FINDTEXTEXA fi;
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index ec52e24758..d4c3cab951 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -425,7 +425,7 @@ int SplitmsgShutdown(void) DestroyCursor(PluginConfig.hCurSplitNS);
DestroyCursor(PluginConfig.hCurHyperlinkHand);
DestroyCursor(PluginConfig.hCurSplitWE);
- FreeLibrary(GetModuleHandleA("riched20"));
+ FreeLibrary(GetModuleHandleA("Msftedit.dll"));
if (g_hIconDLL) {
FreeLibrary(g_hIconDLL);
g_hIconDLL = NULL;
@@ -563,14 +563,14 @@ int LoadSendRecvMessageModule(void) icex.dwICC = ICC_COOL_CLASSES | ICC_BAR_CLASSES | ICC_LISTVIEW_CLASSES;
InitCommonControlsEx(&icex);
- Utils::loadSystemLibrary(L"\\riched20.dll");
+ Utils::loadSystemLibrary(L"\\Msftedit.dll");
OleInitialize(NULL);
mREOLECallback = new REOLECallback;
Win7Taskbar = new CTaskbarInteract;
Win7Taskbar->updateMetrics();
- ZeroMemory((void*)&nen_options, sizeof(nen_options));
+ ZeroMemory(&nen_options, sizeof(nen_options));
M.m_hMessageWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
PluginConfig.hUserPrefsWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
sendQueue = new SendQueue;
@@ -691,7 +691,7 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, HANDLE hContact, i newData.szInitialText = pszInitialText;
char *szProto = GetContactProto(newData.hContact);
- ZeroMemory((void*)&newData.item, sizeof(newData.item));
+ ZeroMemory(&newData.item, sizeof(newData.item));
// obtain various status information about the contact
TCHAR *contactName = pcli->pfnGetContactDisplayName(newData.hContact, 0);
diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp index 9e0e62cd46..6c2d2c3dcb 100644 --- a/plugins/TabSRMM/src/templates.cpp +++ b/plugins/TabSRMM/src/templates.cpp @@ -141,9 +141,9 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP COLORREF url_unvisited = RGB(0, 0, 255);
dat = (TWindowData*)mir_calloc( sizeof(TWindowData));
dat->pContainer = (TContainerData *)mir_alloc(sizeof(TContainerData));
- ZeroMemory((void*)dat->pContainer, sizeof(TContainerData));
+ ZeroMemory(dat->pContainer, sizeof(TContainerData));
teInfo = (TemplateEditorInfo *)dat->pContainer;
- ZeroMemory((void*)teInfo, sizeof(TemplateEditorInfo));
+ ZeroMemory(teInfo, sizeof(TemplateEditorInfo));
teInfo->hContact = teNew->hContact;
teInfo->rtl = teNew->rtl;
teInfo->hwndParent = teNew->hwndParent;
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp index 647d3d4caf..68358ec09e 100644 --- a/plugins/TabSRMM/src/themes.cpp +++ b/plugins/TabSRMM/src/themes.cpp @@ -706,7 +706,7 @@ void __fastcall CImageItem::Render(const HDC hdc, const RECT *rc, bool fIgnoreGl GdiAlphaBlend(hdc, rc->left, top, width, rc->bottom - top, hdcSrc, srcOrigX, srcOrigY, m_width, rc->bottom - top, m_bf);
break;
}
- } while (TRUE);
+ } while (true);
break;
}
case IMAGE_STRETCH_V:
@@ -722,7 +722,7 @@ void __fastcall CImageItem::Render(const HDC hdc, const RECT *rc, bool fIgnoreGl GdiAlphaBlend(hdc, left, rc->top, rc->right - left, height, hdcSrc, srcOrigX, srcOrigY, rc->right - left, m_height, m_bf);
break;
}
- } while (TRUE);
+ } while (true);
break;
}
case IMAGE_STRETCH_B:
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index 8ca53bd9bf..ba7c6d6391 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -107,31 +107,30 @@ TCHAR* Utils::FilterEventMarkers(TCHAR *wszText) tstring text(wszText);
INT_PTR beginmark = 0, endmark = 0;
- while (TRUE) {
+ while (true) {
if ((beginmark = text.find(_T("~-+"))) != text.npos) {
endmark = text.find(_T("+-~"), beginmark);
if (endmark != text.npos && (endmark - beginmark) > 5) {
text.erase(beginmark, (endmark - beginmark) + 3);
continue;
- } else
- break;
- } else
+ }
break;
+ }
+ break;
}
//mad
- while (TRUE) {
+ while (true) {
if ((beginmark = text.find( _T("\xAA"))) != text.npos) {
endmark = beginmark+2;
if (endmark != text.npos && (endmark - beginmark) > 1) {
text.erase(beginmark, endmark - beginmark);
continue;
- } else
- break;
- } else
+ }
break;
+ }
+ break;
}
- //
lstrcpy(wszText, text.c_str());
return wszText;
@@ -151,32 +150,17 @@ const TCHAR* Utils::FormatRaw(TWindowData *dat, const TCHAR *msg, int flags, BOO TCHAR endmarker;
DWORD dwFlags = dat->dwFlags;
message.assign(msg);
- int haveMathMod = PluginConfig.m_MathModAvail;
- TCHAR* mathModDelimiter = PluginConfig.m_MathModStartDelimiter;
-
-
- if (haveMathMod && mathModDelimiter[0] && message.find(mathModDelimiter) != message.npos)
- return(message.c_str());
if (dwFlags & MWF_LOG_BBCODE) {
- if (haveMathMod && mathModDelimiter[0]) {
- INT_PTR mark = 0;
- int nrDelims = 0;
- while ((mark = message.find(mathModDelimiter, mark)) != message.npos) {
- nrDelims++;
- mark += lstrlen(mathModDelimiter);
- }
- if (nrDelims > 0 && (nrDelims % 2) != 0)
- message.append(mathModDelimiter);
- }
beginmark = 0;
- while (TRUE) {
+ while (true) {
for (i=0; i < NR_CODES; i++) {
if ((tempmark = message.find(w_bbcodes_begin[i], 0)) != message.npos)
break;
}
if (i >= NR_CODES)
break;
+
beginmark = tempmark;
endindex = i;
endmark = message.find(w_bbcodes_end[i], beginmark);
@@ -187,58 +171,59 @@ const TCHAR* Utils::FormatRaw(TWindowData *dat, const TCHAR *msg, int flags, BOO if (closing == message.npos) { // must be an invalid [color=] tag w/o closing bracket
message[beginmark] = ' ';
continue;
- } else {
- tstring colorname = message.substr(beginmark + 7, 8);
+ }
+
+ tstring colorname = message.substr(beginmark + 7, 8);
search_again:
- bool clr_found = false;
- int ii = 0;
- TCHAR szTemp[5];
- for (ii = 0; ii < rtf_ctable_size; ii++) {
- if (!_tcsnicmp((TCHAR*)colorname.c_str(), rtf_ctable[ii].szName, lstrlen(rtf_ctable[ii].szName))) {
- closing = beginmark + 7 + lstrlen(rtf_ctable[ii].szName);
- if (endmark != message.npos) {
- message.erase(endmark, 4);
- message.replace(endmark, 4, _T("c0 "));
- }
- message.erase(beginmark, (closing - beginmark));
- message.insert(beginmark, _T("cxxx "));
- mir_sntprintf(szTemp, 4, _T("%02d"), MSGDLGFONTCOUNT + 13 + ii);
- message[beginmark + 3] = szTemp[0];
- message[beginmark + 4] = szTemp[1];
- clr_found = true;
- if (was_added) {
- TCHAR wszTemp[100];
- mir_sntprintf(wszTemp, 100, _T("##col##%06u:%04u"), endmark - closing, ii);
- wszTemp[99] = 0;
- message.insert(beginmark, wszTemp);
- }
- break;
+ bool clr_found = false;
+ for (int ii = 0; ii < rtf_ctable_size; ii++) {
+ if (!_tcsnicmp((TCHAR*)colorname.c_str(), rtf_ctable[ii].szName, lstrlen(rtf_ctable[ii].szName))) {
+ closing = beginmark + 7 + lstrlen(rtf_ctable[ii].szName);
+ if (endmark != message.npos) {
+ message.erase(endmark, 4);
+ message.replace(endmark, 4, _T("c0 "));
}
+ message.erase(beginmark, (closing - beginmark));
+
+ TCHAR szTemp[5];
+ message.insert(beginmark, _T("cxxx "));
+ mir_sntprintf(szTemp, 4, _T("%02d"), MSGDLGFONTCOUNT + 13 + ii);
+ message[beginmark + 3] = szTemp[0];
+ message[beginmark + 4] = szTemp[1];
+ clr_found = true;
+ if (was_added) {
+ TCHAR wszTemp[100];
+ mir_sntprintf(wszTemp, 100, _T("##col##%06u:%04u"), endmark - closing, ii);
+ wszTemp[99] = 0;
+ message.insert(beginmark, wszTemp);
+ }
+ break;
}
- if (!clr_found) {
- size_t c_closing = colorname.find_first_of(_T("]"), 0);
- if (c_closing == colorname.npos)
- c_closing = colorname.length();
- const TCHAR *wszColname = colorname.c_str();
- if (endmark != message.npos && c_closing > 2 && c_closing <= 6 && iswalnum(colorname[0]) && iswalnum(colorname[c_closing -1])) {
- RTF_ColorAdd(wszColname, c_closing);
- if (!was_added) {
- clr_was_added = was_added = true;
- goto search_again;
- } else
- goto invalid_code;
- } else {
-invalid_code:
- if (endmark != message.npos)
- message.erase(endmark, 8);
- if (closing != message.npos && closing < (size_t)endmark)
- message.erase(beginmark, (closing - beginmark) + 1);
- else
- message[beginmark] = ' ';
+ }
+ if (!clr_found) {
+ size_t c_closing = colorname.find_first_of(_T("]"), 0);
+ if (c_closing == colorname.npos)
+ c_closing = colorname.length();
+ const TCHAR *wszColname = colorname.c_str();
+ if (endmark != message.npos && c_closing > 2 && c_closing <= 6 && iswalnum(colorname[0]) && iswalnum(colorname[c_closing -1])) {
+ RTF_ColorAdd(wszColname, c_closing);
+ if (!was_added) {
+ clr_was_added = was_added = true;
+ goto search_again;
}
+ else goto invalid_code;
+ }
+ else {
+invalid_code:
+ if (endmark != message.npos)
+ message.erase(endmark, 8);
+ if (closing != message.npos && closing < (size_t)endmark)
+ message.erase(beginmark, (closing - beginmark) + 1);
+ else
+ message[beginmark] = ' ';
}
- continue;
}
+ continue;
}
if (endmark != message.npos)
message.replace(endmark, 4, formatting_strings_end[i]);
@@ -268,7 +253,8 @@ invalid_code: tempmark = endmark + 1;
}
break;
- } else {
+ }
+ else {
if ((endmark = message.find(endmarker, beginmark + 1)) == message.npos)
break;
}
@@ -279,15 +265,15 @@ ok: }
index = 0;
switch (endmarker) {
- case '*':
- index = 0;
- break;
- case '/':
- index = 1;
- break;
- case '_':
- index = 2;
- break;
+ case '*':
+ index = 0;
+ break;
+ case '/':
+ index = 1;
+ break;
+ case '_':
+ index = 2;
+ break;
}
/*
@@ -356,7 +342,7 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat title.erase(tempmark, 2);
curpos = tempmark + lstrlen(tszNick);
break;
- }
+ }
case 'p':
case 'a': {
const TCHAR *szAcc = dat->cache->getRealAccount();
@@ -365,14 +351,14 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat title.erase(tempmark, 2);
curpos = tempmark + lstrlen(szAcc);
break;
- }
+ }
case 's': {
if (dat->szStatus && dat->szStatus[0])
title.insert(tempmark + 2, dat->szStatus);
title.erase(tempmark, 2);
curpos = tempmark + lstrlen(dat->szStatus);
break;
- }
+ }
case 'u': {
const TCHAR *szUIN = dat->cache->getUIN();
if (szUIN[0])
@@ -380,14 +366,14 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat title.erase(tempmark, 2);
curpos = tempmark + lstrlen(szUIN);
break;
- }
+ }
case 'c': {
TCHAR *c = (!_tcscmp(dat->pContainer->szName, _T("default")) ? TranslateT("Default container") : dat->pContainer->szName);
title.insert(tempmark + 2, c);
title.erase(tempmark, 2);
curpos = tempmark + lstrlen(c);
break;
- }
+ }
case 'o': {
const TCHAR* szProto = dat->cache->getActiveProtoT();
if (szProto)
@@ -395,7 +381,7 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat title.erase(tempmark, 2);
curpos = tempmark + (szProto ? lstrlen(szProto) : 0);
break;
- }
+ }
case 'x': {
TCHAR *szFinalStatus = NULL;
BYTE xStatus = dat->cache->getXStatusId();
@@ -417,7 +403,7 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat }
title.erase(tempmark, 2);
break;
- }
+ }
case 'm': {
TCHAR *szFinalStatus = NULL;
BYTE xStatus = dat->cache->getXStatusId();
@@ -430,10 +416,10 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat szTemp[500] = 0;
db_free(&dbv);
title.insert(tempmark + 2, szTemp);
- } else
- szFinalStatus = xStatusDescr[xStatus - 1];
- } else
- szFinalStatus = (TCHAR*)(dat->szStatus && dat->szStatus[0] ? dat->szStatus : _T("(undef)"));
+ }
+ else szFinalStatus = xStatusDescr[xStatus - 1];
+ }
+ else szFinalStatus = (TCHAR*)(dat->szStatus && dat->szStatus[0] ? dat->szStatus : _T("(undef)"));
if (szFinalStatus) {
title.insert(tempmark + 2, szFinalStatus);
@@ -442,15 +428,14 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat title.erase(tempmark, 2);
break;
- }
- /*
- * status message (%T will skip the "No status message" for empty
- * messages)
- */
+ }
+ /*
+ * status message (%T will skip the "No status message" for empty
+ * messages)
+ */
case 't':
case 'T': {
TCHAR *tszStatusMsg = dat->cache->getNormalizedStatusMsg(dat->cache->getStatusMsg(), true);
-
if (tszStatusMsg) {
title.insert(tempmark + 2, tszStatusMsg);
curpos = tempmark + lstrlen(tszStatusMsg);
@@ -464,7 +449,7 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat if (tszStatusMsg)
mir_free(tszStatusMsg);
break;
- }
+ }
default:
title.erase(tempmark, 1);
break;
@@ -485,28 +470,28 @@ char* Utils::FilterEventMarkers(char *szText) std::string text(szText);
INT_PTR beginmark = 0, endmark = 0;
- while (TRUE) {
+ while (true) {
if ((beginmark = text.find("~-+")) != text.npos) {
endmark = text.find("+-~", beginmark);
if (endmark != text.npos && (endmark - beginmark) > 5) {
text.erase(beginmark, (endmark - beginmark) + 3);
continue;
- } else
- break;
- } else
+ }
break;
+ }
+ break;
}
//mad
- while (TRUE) {
+ while (true) {
if ((beginmark = text.find( "\xAA")) != text.npos) {
endmark = beginmark+2;
if (endmark != text.npos && (endmark - beginmark) > 1) {
text.erase(beginmark, endmark - beginmark);
continue;
- } else
- break;
- } else
+ }
break;
+ }
+ break;
}
//
lstrcpyA(szText, text.c_str());
@@ -519,14 +504,14 @@ const TCHAR* Utils::DoubleAmpersands(TCHAR *pszText) INT_PTR textPos = 0;
- while (TRUE) {
+ while (true) {
if ((textPos = text.find(_T("&"),textPos)) != text.npos) {
text.insert(textPos,_T("%"));
text.replace(textPos, 2, _T("&&"));
textPos+=2;
continue;
- } else
- break;
+ }
+ break;
}
_tcscpy(pszText, text.c_str());
return pszText;
@@ -566,7 +551,7 @@ TCHAR* Utils::GetPreviewWithEllipsis(TCHAR *szText, size_t iMaxLen) if (p)
*p = cSaved;
- return(szResult);
+ return szResult;
}
/*
@@ -591,8 +576,8 @@ int Utils::FindRTLLocale(TWindowData *dat) result = 1;
}
dat->iHaveRTLLang = (result ? 1 : -1);
- } else
- result = dat->iHaveRTLLang == 1 ? 1 : 0;
+ }
+ else result = dat->iHaveRTLLang == 1 ? 1 : 0;
return result;
}
@@ -618,11 +603,10 @@ void Utils::RTF_CTableInit() void Utils::RTF_ColorAdd(const TCHAR *tszColname, size_t length)
{
TCHAR *stopped;
- COLORREF clr;
rtf_ctable_size++;
rtf_ctable = (TRTFColorTable *)mir_realloc(rtf_ctable, sizeof(TRTFColorTable) * rtf_ctable_size);
- clr = _tcstol(tszColname, &stopped, 16);
+ COLORREF clr = _tcstol(tszColname, &stopped, 16);
mir_sntprintf(rtf_ctable[rtf_ctable_size - 1].szName, length + 1, _T("%06x"), clr);
rtf_ctable[rtf_ctable_size - 1].menuid = rtf_ctable[rtf_ctable_size - 1].index = 0;
@@ -632,28 +616,24 @@ void Utils::RTF_ColorAdd(const TCHAR *tszColname, size_t length) void Utils::CreateColorMap(TCHAR *Text)
{
- TCHAR * pszText = Text;
- TCHAR * p1;
- TCHAR * p2;
- TCHAR * pEnd;
+ TCHAR *pszText = Text;
int iIndex = 1, i = 0;
- COLORREF default_color;
static const TCHAR *lpszFmt = _T("\\red%[^ \x5b\\]\\green%[^ \x5b\\]\\blue%[^ \x5b;];");
TCHAR szRed[10], szGreen[10], szBlue[10];
- p1 = _tcsstr(pszText, _T("\\colortbl"));
+ TCHAR *p1 = _tcsstr(pszText, _T("\\colortbl"));
if (!p1)
return;
- pEnd = _tcschr(p1, '}');
+ TCHAR *pEnd = _tcschr(p1, '}');
- p2 = _tcsstr(p1, _T("\\red"));
+ TCHAR *p2 = _tcsstr(p1, _T("\\red"));
for (i=0; i < RTF_CTABLE_DEFSIZE; i++)
rtf_ctable[i].index = 0;
- default_color = (COLORREF)M.GetDword(FONTMODULE, "Font16Col", 0);
+ COLORREF default_color = (COLORREF)M.GetDword(FONTMODULE, "Font16Col", 0);
while (p2 && p2 < pEnd) {
if (_stscanf(p2, lpszFmt, &szRed, &szGreen, &szBlue) > 0) {
@@ -674,11 +654,10 @@ void Utils::CreateColorMap(TCHAR *Text) int Utils::RTFColorToIndex(int iCol)
{
- int i=0;
- for (i=0; i < RTF_CTABLE_DEFSIZE; i++) {
+ for (int i=0; i < RTF_CTABLE_DEFSIZE; i++)
if (rtf_ctable[i].index == iCol)
return i + 1;
- }
+
return 0;
}
@@ -714,10 +693,9 @@ INT_PTR CALLBACK Utils::PopupDlgProcError(HWND hWnd, UINT message, WPARAM wParam */
int Utils::ReadContainerSettingsFromDB(const HANDLE hContact, TContainerSettings *cs, const char *szKey)
{
- DBVARIANT dbv = {0};
-
CopyMemory(cs, &PluginConfig.globalContainerSettings, sizeof(TContainerSettings));
+ DBVARIANT dbv = { 0 };
if (0 == db_get(hContact, SRMSGMOD_T, szKey ? szKey : CNT_KEYNAME, &dbv)) {
if (dbv.type == DBVT_BLOB && dbv.cpbVal > 0 && dbv.cpbVal <= sizeof(TContainerSettings)) {
::CopyMemory((void*)cs, (void*)dbv.pbVal, dbv.cpbVal);
@@ -730,10 +708,9 @@ int Utils::ReadContainerSettingsFromDB(const HANDLE hContact, TContainerSettings db_free(&dbv);
return 1;
}
- else {
- cs->fPrivate = false;
- return 1;
- }
+
+ cs->fPrivate = false;
+ return 1;
}
int Utils::WriteContainerSettingsToDB(const HANDLE hContact, TContainerSettings *cs, const char *szKey)
@@ -744,18 +721,18 @@ int Utils::WriteContainerSettingsToDB(const HANDLE hContact, TContainerSettings void Utils::SettingsToContainer(TContainerData *pContainer)
{
- pContainer->dwFlags = pContainer->settings->dwFlags;
- pContainer->dwFlagsEx = pContainer->settings->dwFlagsEx;
- pContainer->avatarMode = pContainer->settings->avatarMode;
- pContainer->ownAvatarMode = pContainer->settings->ownAvatarMode;
+ pContainer->dwFlags = pContainer->settings->dwFlags;
+ pContainer->dwFlagsEx = pContainer->settings->dwFlagsEx;
+ pContainer->avatarMode = pContainer->settings->avatarMode;
+ pContainer->ownAvatarMode = pContainer->settings->ownAvatarMode;
}
void Utils::ContainerToSettings(TContainerData *pContainer)
{
- pContainer->settings->dwFlags = pContainer->dwFlags;
- pContainer->settings->dwFlagsEx = pContainer->dwFlagsEx;
- pContainer->settings->avatarMode = pContainer->avatarMode;
- pContainer->settings->ownAvatarMode = pContainer->ownAvatarMode;
+ pContainer->settings->dwFlags = pContainer->dwFlags;
+ pContainer->settings->dwFlagsEx = pContainer->dwFlagsEx;
+ pContainer->settings->avatarMode = pContainer->avatarMode;
+ pContainer->settings->ownAvatarMode = pContainer->ownAvatarMode;
}
/**
@@ -777,8 +754,7 @@ void Utils::ReadPrivateContainerSettings(TContainerData *pContainer, bool fForce CopyMemory((void*)pContainer->settings, (void*)&csTemp, sizeof(TContainerSettings));
pContainer->settings->fPrivate = true;
}
- else
- pContainer->settings = &PluginConfig.globalContainerSettings;
+ else pContainer->settings = &PluginConfig.globalContainerSettings;
}
void Utils::SaveContainerSettings(TContainerData *pContainer, const char *szSetting)
@@ -824,7 +800,8 @@ void Utils::scaleAvatarHeightLimited(const HBITMAP hBm, double& dNewWidth, doubl dAspect = 1.0;
dNewWidth = (double)bm.bmWidth * dAspect;
dNewHeight = (double)maxHeight;
- } else {
+ }
+ else {
if (bm.bmWidth > 0)
dAspect = (double)(maxHeight) / (double)bm.bmWidth;
else
diff --git a/plugins/TabSRMM/src/version.h b/plugins/TabSRMM/src/version.h index 21cd62ef1b..f95ae955ae 100644 --- a/plugins/TabSRMM/src/version.h +++ b/plugins/TabSRMM/src/version.h @@ -1,14 +1,14 @@ -#define __MAJOR_VERSION 3
-#define __MINOR_VERSION 1
-#define __RELEASE_NUM 99
-#define __BUILD_NUM 8
+#define __MAJOR_VERSION 3
+#define __MINOR_VERSION 2
+#define __RELEASE_NUM 0
+#define __BUILD_NUM 0
-#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
+#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
-#define __PLUGIN_NAME "TabSRMM"
-#define __FILENAME "TabSRMM.dll"
-#define __DESCRIPTION "IM and group chat module for Miranda NG."
-#define __AUTHOR "The Miranda developers team and contributors"
-#define __AUTHOREMAIL "silvercircle@gmail.com"
-#define __AUTHORWEB "http://miranda-ng.org/p/TabSRMM/"
-#define __COPYRIGHT "© 2000-2010 Miranda Project and contributors. See readme.txt for more."
+#define __PLUGIN_NAME "TabSRMM"
+#define __FILENAME "TabSRMM.dll"
+#define __DESCRIPTION "IM and group chat module for Miranda NG."
+#define __AUTHOR "The Miranda developers team and contributors"
+#define __AUTHOREMAIL "silvercircle@gmail.com"
+#define __AUTHORWEB "http://miranda-ng.org/p/TabSRMM/"
+#define __COPYRIGHT "© 2000-2010 Miranda Project and contributors. See readme.txt for more."
|