diff options
Diffstat (limited to 'plugins')
36 files changed, 101 insertions, 108 deletions
diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp index cdaea88e47..cb9afa6e86 100644 --- a/plugins/Clist_modern/src/modern_cachefuncs.cpp +++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp @@ -404,7 +404,7 @@ LBL_Status: ptrW tszXStatusMsg(db_get_wsa(pdnce->hContact, pdnce->szProto, "XStatusMsg")); if (tszXStatusMsg != nullptr && tszXStatusMsg[0] != 0) { wchar_t *tmp = NEWWSTR_ALLOCA(text); - mir_snwprintf(text, text_size, L"%s: %s", tmp, tszXStatusMsg); + mir_snwprintf(text, text_size, L"%s: %s", tmp, tszXStatusMsg.get()); CopySkipUnprintableChars(text, text, text_size - 1); } } @@ -426,7 +426,7 @@ LBL_Status: ptrW tszXStatusName(db_get_wsa(pdnce->hContact, pdnce->szProto, "XStatusName")); if (tszXStatusName != nullptr && tszXStatusName[0] != 0) { wchar_t *tmp = NEWWSTR_ALLOCA(text); - mir_snwprintf(text, text_size, L"%s: %s", tszXStatusName, tmp); + mir_snwprintf(text, text_size, L"%s: %s", tszXStatusName.get(), tmp); CopySkipUnprintableChars(text, text, text_size - 1); } } diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index ff6ee9fa94..fb968fb775 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -246,7 +246,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) p->bIsDimmed = 0;
if (g_CluiData.bFilterEffective & CLVM_FILTER_PROTOS) {
char szTemp[2048];
- mir_snprintf(szTemp, "%s|", p->szAccountName);
+ mir_snprintf(szTemp, "%s|", p->szAccountName.get());
p->bIsDimmed = strstr(g_CluiData.protoFilter, szTemp) ? 0 : 1;
}
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index ef58779033..b0877304fa 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -500,23 +500,23 @@ static void UpdateFilters() mir_snwprintf(szTemp, TranslateT("Configuring view mode: %s"), szTempBuf);
SetDlgItemText(clvmHwnd, IDC_CURVIEWMODE2, szTemp);
}
- mir_snprintf(szSetting, "%c%s_PF", 246, szBuf);
+ mir_snprintf(szSetting, "%c%s_PF", 246, szBuf.get());
ptrA szPF(db_get_sa(0, CLVM_MODULE, szSetting));
if (szPF == nullptr)
return;
- mir_snprintf(szSetting, "%c%s_GF", 246, szBuf);
+ mir_snprintf(szSetting, "%c%s_GF", 246, szBuf.get());
ptrW szGF(db_get_wsa(0, CLVM_MODULE, szSetting));
if (szGF == nullptr)
return;
- mir_snprintf(szSetting, "%c%s_OPT", 246, szBuf);
+ mir_snprintf(szSetting, "%c%s_OPT", 246, szBuf.get());
if ((opt = db_get_dw(0, CLVM_MODULE, szSetting, -1)) != -1)
SendDlgItemMessage(clvmHwnd, IDC_AUTOCLEARSPIN, UDM_SETPOS, 0, MAKELONG(LOWORD(opt), 0));
- mir_snprintf(szSetting, "%c%s_SM", 246, szBuf);
+ mir_snprintf(szSetting, "%c%s_SM", 246, szBuf.get());
DWORD statusMask = db_get_dw(0, CLVM_MODULE, szSetting, 0);
- mir_snprintf(szSetting, "%c%s_SSM", 246, szBuf);
+ mir_snprintf(szSetting, "%c%s_SSM", 246, szBuf.get());
stickyStatusMask = db_get_dw(0, CLVM_MODULE, szSetting, -1);
dwFlags = db_get_dw(0, CLVM_MODULE, szBuf, 0);
{
@@ -589,7 +589,7 @@ static void UpdateFilters() EnableWindow(GetDlgItem(clvmHwnd, IDC_LASTMSGVALUE), useLastMsg);
EnableWindow(GetDlgItem(clvmHwnd, IDC_LASTMESSAGEUNIT), useLastMsg);
- mir_snprintf(szSetting, "%c%s_LM", 246, szBuf);
+ mir_snprintf(szSetting, "%c%s_LM", 246, szBuf.get());
DWORD lmdat = db_get_dw(0, CLVM_MODULE, szSetting, 0);
SetDlgItemInt(clvmHwnd, IDC_LASTMSGVALUE, LOWORD(lmdat), FALSE);
diff --git a/plugins/Db3x_mmap/src/dbcrypt.cpp b/plugins/Db3x_mmap/src/dbcrypt.cpp index 230c717ccb..21798eae69 100644 --- a/plugins/Db3x_mmap/src/dbcrypt.cpp +++ b/plugins/Db3x_mmap/src/dbcrypt.cpp @@ -43,12 +43,14 @@ struct VarDescr {
VarDescr(LPCSTR var, LPCSTR value) :
szVar(mir_strdup(var)),
- szValue(mir_strdup(value))
+ szValue(mir_strdup(value)),
+ iLen(0)
{}
VarDescr(LPCSTR var, LPSTR value) :
szVar(mir_strdup(var)),
- szValue(value)
+ szValue(value),
+ iLen(0)
{}
VarDescr(LPCSTR var, PBYTE value, int len) :
@@ -58,7 +60,7 @@ struct VarDescr {}
ptrA szVar, szValue;
- int iLen;
+ int iLen;
};
struct SettingUgraderParam
diff --git a/plugins/Db3x_mmap/src/ui.cpp b/plugins/Db3x_mmap/src/ui.cpp index 610d378321..d1374638bd 100644 --- a/plugins/Db3x_mmap/src/ui.cpp +++ b/plugins/Db3x_mmap/src/ui.cpp @@ -333,7 +333,7 @@ static int OnModulesLoaded(PVOID obj, WPARAM, LPARAM) SET_UID(mi, 0x50321866, 0xba1, 0x46dd, 0xb3, 0xa6, 0xc3, 0xcc, 0x55, 0xf2, 0x42, 0x9e);
mi.flags = CMIF_UNICODE;
- mi.hIcolibItem = iconList[1].hIcolib;
+ mi.hIcolibItem = iconList[0].hIcolib;
mi.name.w = db->GetMenuTitle();
mi.pszService = MS_DB_CHANGEPASSWORD;
hSetPwdMenu = Menu_AddMainMenuItem(&mi);
diff --git a/plugins/DbEditorPP/src/copymodule.cpp b/plugins/DbEditorPP/src/copymodule.cpp index e0adfe2812..00fe3d5ef7 100644 --- a/plugins/DbEditorPP/src/copymodule.cpp +++ b/plugins/DbEditorPP/src/copymodule.cpp @@ -28,7 +28,7 @@ INT_PTR CALLBACK copyModDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPar mac = (ModuleAndContact *)lParam;
wchar_t name[NAME_SIZE], msg[MSG_SIZE];
- mir_snwprintf(msg, TranslateT("Copy module \"%s\""), _A2T(mac->module));
+ mir_snwprintf(msg, TranslateT("Copy module \"%s\""), _A2T(mac->module).get());
SetWindowText(hwnd, msg);
for (auto &hContact : Contacts()) {
diff --git a/plugins/DbEditorPP/src/deletemodule.cpp b/plugins/DbEditorPP/src/deletemodule.cpp index 343aa625da..fadb491816 100644 --- a/plugins/DbEditorPP/src/deletemodule.cpp +++ b/plugins/DbEditorPP/src/deletemodule.cpp @@ -10,7 +10,7 @@ int deleteModule(MCONTACT hContact, const char *module, int confirm) if (confirm && g_plugin.getByte("WarnOnDelete", 1)) {
wchar_t text[MSG_SIZE];
- mir_snwprintf(text, TranslateT("Are you sure you want to delete module \"%s\"?"), _A2T(module));
+ mir_snwprintf(text, TranslateT("Are you sure you want to delete module \"%s\"?"), _A2T(module).get());
if (dlg(text, MB_YESNO | MB_ICONEXCLAMATION) == IDNO)
return 0;
}
diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp index 939a1b554d..af14893ded 100644 --- a/plugins/DbEditorPP/src/main.cpp +++ b/plugins/DbEditorPP/src/main.cpp @@ -478,9 +478,9 @@ int GetContactName(MCONTACT hContact, const char *proto, wchar_t *value, int max if (szProto && szProto[0]) {
if (g_Order)
- mir_snwprintf(value, maxlen, L"(%s) %s", _A2T(szProto), name);
+ mir_snwprintf(value, maxlen, L"(%S) %s", szProto, name);
else
- mir_snwprintf(value, maxlen, L"%s (%s)", name, _A2T(szProto));
+ mir_snwprintf(value, maxlen, L"%s (%S)", name, szProto);
}
else mir_wstrncpy(value, name, maxlen);
diff --git a/plugins/DbEditorPP/src/watchedvars.cpp b/plugins/DbEditorPP/src/watchedvars.cpp index 7cd8ef85b5..c1c10266e5 100644 --- a/plugins/DbEditorPP/src/watchedvars.cpp +++ b/plugins/DbEditorPP/src/watchedvars.cpp @@ -351,7 +351,8 @@ void popupWatchedVar(MCONTACT hContact, const char *module, const char *setting) // 2nd line
int type = GetValue(hContact, module, setting, value, _countof(value));
- mir_snwprintf(text, TranslateT("Database Setting Changed: \nModule: \"%s\", Setting: \"%s\"\nNew Value (%s): \"%s\""), _A2T(module), _A2T(setting), DBVType(type), value);
+ mir_snwprintf(text, TranslateT("Database Setting Changed: \nModule: \"%s\", Setting: \"%s\"\nNew Value (%s): \"%s\""),
+ _A2T(module).get(), _A2T(setting).get(), DBVType(type), value);
POPUPDATAW ppd;
ppd.lchContact = (MCONTACT)hContact;
diff --git a/plugins/IEView/src/ChatHTMLBuilder.cpp b/plugins/IEView/src/ChatHTMLBuilder.cpp index 0c95589461..9e8b8cc5a7 100644 --- a/plugins/IEView/src/ChatHTMLBuilder.cpp +++ b/plugins/IEView/src/ChatHTMLBuilder.cpp @@ -239,7 +239,7 @@ void ChatHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event) str.AppendFormat("<span class=\"timestamp\">%s </span>", timestampToString(eventData->time));
if ((dwData & IEEDD_GC_SHOW_NICK) && eventData->iType == IEED_GC_EVENT_MESSAGE)
- str.AppendFormat("<span class=\"%s\">%s: </span>", isSent ? "nameOut" : "nameIn", szName);
+ str.AppendFormat("<span class=\"%s\">%s: </span>", isSent ? "nameOut" : "nameIn", szName.get());
if (dwData & IEEDD_GC_MSG_ON_NEW_LINE)
str.Append("<br>");
diff --git a/plugins/IEView/src/HistoryHTMLBuilder.cpp b/plugins/IEView/src/HistoryHTMLBuilder.cpp index 11725edb12..e119e4c84a 100644 --- a/plugins/IEView/src/HistoryHTMLBuilder.cpp +++ b/plugins/IEView/src/HistoryHTMLBuilder.cpp @@ -258,12 +258,12 @@ void HistoryHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event else
str.Append(" ");
- str.AppendFormat("<span class=\"%s\">%s:</span>", isSent ? "nameOut" : "nameIn", szName);
+ str.AppendFormat("<span class=\"%s\">%s:</span>", isSent ? "nameOut" : "nameIn", szName.get());
str.AppendFormat("<span class=\"%s\">%s</span><br>", isSent ? "timeOut" : "timeIn", timestampToString(eventData->time));
if (eventData->iType == IEED_EVENT_FILE)
- str.AppendFormat("%s:<br> %s", isSent ? Translate("Outgoing File Transfer") : Translate("Incoming File Transfer"), szText);
+ str.AppendFormat("%s:<br> %s", isSent ? Translate("Outgoing File Transfer") : Translate("Incoming File Transfer"), szText.get());
else
- str.AppendFormat("%s", szText);
+ str.Append(szText);
str.Append("</div>\n");
setLastEventType(MAKELONG(eventData->dwFlags, eventData->iType));
diff --git a/plugins/IEView/src/MUCCHTMLBuilder.cpp b/plugins/IEView/src/MUCCHTMLBuilder.cpp index c59be8a15d..f7885430c1 100644 --- a/plugins/IEView/src/MUCCHTMLBuilder.cpp +++ b/plugins/IEView/src/MUCCHTMLBuilder.cpp @@ -202,7 +202,7 @@ void MUCCHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event) str.AppendFormat("<span class=\"%s\">%s </span>", isSent ? "timestamp" : "timestamp", timestampToString(dwData, eventData->time));
if (dwData & IEEDD_MUCC_SHOW_NICK)
- str.AppendFormat("<span class=\"%s\">%s: </span>", isSent ? "nameOut" : "nameIn", szName);
+ str.AppendFormat("<span class=\"%s\">%s: </span>", isSent ? "nameOut" : "nameIn", szName.get());
if (dwData & IEEDD_MUCC_MSG_ON_NEW_LINE)
str.Append("<br>");
@@ -222,7 +222,7 @@ void MUCCHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event) style.AppendFormat("font-style: %s;", eventData->fontStyle & IE_FONT_ITALIC ? "italic" : "normal");
style.AppendFormat("text-decoration: %s;", eventData->fontStyle & IE_FONT_UNDERLINE ? "underline" : "none");
}
- str.AppendFormat("<span class=\"%s\"><span style=\"%s\">%s</span></span>", className, style.c_str(), szText);
+ str.AppendFormat("<span class=\"%s\"><span style=\"%s\">%s</span></span>", className, style.c_str(), szText.get());
str.Append("</div>\n");
}
else if (eventData->iType == IEED_MUCC_EVENT_JOINED || eventData->iType == IEED_MUCC_EVENT_LEFT || eventData->iType == IEED_MUCC_EVENT_TOPIC) {
@@ -250,7 +250,7 @@ void MUCCHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event) str.AppendFormat("<span class=\"%s\">%s </span>", "timestamp", timestampToString(dwData, eventData->time));
str.AppendFormat("<span class=\"%s\">", className);
- str.AppendFormat(Translate(eventText), szText);
+ str.AppendFormat(Translate(eventText), szText.get());
str.Append("</span>");
str.Append("</div>\n");
}
@@ -258,7 +258,7 @@ void MUCCHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event) const char *className = "error";
szText = encodeUTF8(NULL, event->pszProto, eventData->pszText, ENF_NONE, isSent);
str.AppendFormat("<div class=\"%s\">", "divError");
- str.AppendFormat("<span class=\"%s\"> %s: %s</span>", className, Translate("Error"), szText);
+ str.AppendFormat("<span class=\"%s\"> %s: %s</span>", className, Translate("Error"), szText.get());
str.Append("</div>\n");
}
diff --git a/plugins/IEView/src/ScriverHTMLBuilder.cpp b/plugins/IEView/src/ScriverHTMLBuilder.cpp index 8157734247..bcb7096ba5 100644 --- a/plugins/IEView/src/ScriverHTMLBuilder.cpp +++ b/plugins/IEView/src/ScriverHTMLBuilder.cpp @@ -354,9 +354,9 @@ void ScriverHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event if ((dwFlags & SMF_LOG_SHOWNICK && eventData->iType == IEED_EVENT_MESSAGE && isGroupBreak) || eventData->iType == IEED_EVENT_STATUSCHANGE) {
if (eventData->iType == IEED_EVENT_MESSAGE) {
if (showColon)
- str.AppendFormat("<span class=\"%s\"> %s</span>", isSent ? "nameOut" : "nameIn", szName);
+ str.AppendFormat("<span class=\"%s\"> %s</span>", isSent ? "nameOut" : "nameIn", szName.get());
else
- str.AppendFormat("<span class=\"%s\">%s</span>", isSent ? "nameOut" : "nameIn", szName);
+ str.AppendFormat("<span class=\"%s\">%s</span>", isSent ? "nameOut" : "nameIn", szName.get());
showColon = true;
if (dwFlags & SMF_LOG_GROUPMESSAGES) {
@@ -364,7 +364,7 @@ void ScriverHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event showColon = false;
}
}
- else str.AppendFormat("<span class=\"notices\">%s </span>", szName);
+ else str.AppendFormat("<span class=\"notices\">%s </span>", szName.get());
}
if (dwFlags & SMF_LOG_SHOWTIME && dwFlags & SMF_LOG_GROUPMESSAGES && dwFlags & SMF_LOG_MARKFOLLOWUPS
&& eventData->iType == IEED_EVENT_MESSAGE && isGroupBreak) {
@@ -384,9 +384,9 @@ void ScriverHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event if (eventData->iType == IEED_EVENT_FILE) {
str.AppendFormat("<span class=\"%s\">%s: %s</span>", className,
- (isSent) ? Translate("File sent") : Translate("File received"), szText);
+ (isSent) ? Translate("File sent") : Translate("File received"), szText.get());
}
- else str.AppendFormat("<span class=\"%s\">%s</span>", className, szText);
+ else str.AppendFormat("<span class=\"%s\">%s</span>", className, szText.get());
str.Append("</div>\n");
setLastEventType(MAKELONG(eventData->dwFlags, eventData->iType));
diff --git a/plugins/IEView/src/TabSRMMHTMLBuilder.cpp b/plugins/IEView/src/TabSRMMHTMLBuilder.cpp index d4910a93c9..1b51148521 100644 --- a/plugins/IEView/src/TabSRMMHTMLBuilder.cpp +++ b/plugins/IEView/src/TabSRMMHTMLBuilder.cpp @@ -352,9 +352,9 @@ void TabSRMMHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event else
className = isSent ? "hNameOut" : "hNameIn";
if (dwFlags & MWF_LOG_UNDERLINE)
- str.AppendFormat("<span class=\"%s\"><u>%s%s</span>", className, szName, (dwFlags & MWF_LOG_SHOWTIME) ? " </u>" : "</u>: ");
+ str.AppendFormat("<span class=\"%s\"><u>%s%s</span>", className, szName.get(), (dwFlags & MWF_LOG_SHOWTIME) ? " </u>" : "</u>: ");
else
- str.AppendFormat("<span class=\"%s\">%s%s</span>", className, szName, (dwFlags & MWF_LOG_SHOWTIME) ? " " : ": ");
+ str.AppendFormat("<span class=\"%s\">%s%s</span>", className, szName.get(), (dwFlags & MWF_LOG_SHOWTIME) ? " " : ": ");
}
if (dwFlags & MWF_LOG_SHOWTIME && (isGroupBreak || dwFlags2 & MWF_SHOW_MARKFOLLOWUPTS)) {
const char *className;
@@ -371,7 +371,7 @@ void TabSRMMHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event }
if ((eventData->iType == IEED_EVENT_STATUSCHANGE) || ((dwFlags & MWF_LOG_SHOWNICK) && !(dwFlags & MWF_LOG_SWAPNICK) && isGroupBreak)) {
if (eventData->iType == IEED_EVENT_STATUSCHANGE)
- str.AppendFormat("<span class=\"statusChange\">%s </span>", szName);
+ str.AppendFormat("<span class=\"statusChange\">%s </span>", szName.get());
else {
const char *className = "";
if (!isHistory)
@@ -379,9 +379,9 @@ void TabSRMMHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event else
className = isSent ? "hNameOut" : "hNameIn";
if (dwFlags & MWF_LOG_UNDERLINE)
- str.AppendFormat("<span class=\"%s\"><u>%s</u>: </span>", className, szName);
+ str.AppendFormat("<span class=\"%s\"><u>%s</u>: </span>", className, szName.get());
else
- str.AppendFormat("<span class=\"%s\">%s: </span>", className, szName);
+ str.AppendFormat("<span class=\"%s\">%s: </span>", className, szName.get());
}
}
if (dwFlags & MWF_LOG_NEWLINE && eventData->iType != IEED_EVENT_STATUSCHANGE && eventData->iType != IEED_EVENT_ERRMSG && isGroupBreak)
@@ -397,7 +397,7 @@ void TabSRMMHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event else if (eventData->iType == IEED_EVENT_STATUSCHANGE)
className = "statusChange";
- str.AppendFormat("<span class=\"%s\">%s</span>", className, szText);
+ str.AppendFormat("<span class=\"%s\">%s</span>", className, szText.get());
str.Append("</div>\n");
setLastEventType(MAKELONG(eventData->dwFlags, eventData->iType));
setLastEventTime(eventData->time);
diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index 5b6c728eed..b0edaa5298 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -674,7 +674,7 @@ void CImportBatch::ImportMeta(DBCachedContact *ccSrc) if (tszNick && *tszNick) {
db_set_ws(hDest, "CList", "MyHandle", tszNick);
- AddMessage(LPGENW("Added metacontact '%s'"), tszNick);
+ AddMessage(LPGENW("Added metacontact '%s'"), tszNick.get());
}
else AddMessage(LPGENW("Added metacontact"));
}
@@ -803,7 +803,7 @@ MCONTACT CImportBatch::ImportContact(MCONTACT hSrc) if (tszNick && *tszNick) {
db_set_ws(hDst, "CList", "MyHandle", tszNick);
- AddMessage(LPGENW("Added %S contact %s, '%s'"), szDstModuleName, pszUniqueID, tszNick);
+ AddMessage(LPGENW("Added %S contact %s, '%s'"), szDstModuleName, pszUniqueID, tszNick.get());
}
else AddMessage(LPGENW("Added %S contact %s"), szDstModuleName, pszUniqueID);
diff --git a/plugins/MirLua/src/script_loader.cpp b/plugins/MirLua/src/script_loader.cpp index 32ff9346f8..f480c261e1 100644 --- a/plugins/MirLua/src/script_loader.cpp +++ b/plugins/MirLua/src/script_loader.cpp @@ -17,12 +17,12 @@ void CMLuaScriptLoader::SetPaths() FoldersGetCustomPathW(g_hCLibsFolder, path, _countof(path), VARSW(MIRLUA_PATHT));
pathA = mir_utf8encodeW(path);
- lua_pushfstring(L, "%s\\?.%s", pathA, _T2A(LUACLIBSCRIPTEXT));
+ lua_pushfstring(L, "%s\\?.%s", pathA.get(), _T2A(LUACLIBSCRIPTEXT).get());
lua_setfield(L, -2, "cpath");
FoldersGetCustomPathW(g_hScriptsFolder, path, _countof(path), VARSW(MIRLUA_PATHT));
pathA = mir_utf8encodeW(path);
- lua_pushfstring(L, "%s\\?.%s;%s\\?.%s", pathA, _T2A(LUATEXTSCRIPTEXT), pathA, _T2A(LUAPRECSCRIPTEXT));
+ lua_pushfstring(L, "%s\\?.%s;%s\\?.%s", pathA.get(), _T2A(LUATEXTSCRIPTEXT).get(), pathA.get(), _T2A(LUAPRECSCRIPTEXT).get());
lua_setfield(L, -2, "path");
lua_pop(L, 1);
diff --git a/plugins/PluginUpdater/src/Utils.cpp b/plugins/PluginUpdater/src/Utils.cpp index 321ce1bd71..335a85b5f6 100644 --- a/plugins/PluginUpdater/src/Utils.cpp +++ b/plugins/PluginUpdater/src/Utils.cpp @@ -143,7 +143,7 @@ bool ParseHashes(const wchar_t *ptszUrl, ptrW &baseUrl, SERVLIST &arHashes) // Download version info
FILEURL pFileUrl;
- mir_snwprintf(pFileUrl.tszDownloadURL, L"%s/hashes.zip", baseUrl);
+ mir_snwprintf(pFileUrl.tszDownloadURL, L"%s/hashes.zip", baseUrl.get());
mir_snwprintf(pFileUrl.tszDiskPath, L"%s\\hashes.zip", g_tszTempPath);
pFileUrl.CRCsum = 0;
@@ -152,19 +152,19 @@ bool ParseHashes(const wchar_t *ptszUrl, ptrW &baseUrl, SERVLIST &arHashes) Netlib_CloseHandle(nlc);
if (!ret) {
- Netlib_LogfW(hNetlibUser,L"Downloading list of available updates from %s failed",baseUrl);
+ Netlib_LogfW(hNetlibUser, L"Downloading list of available updates from %s failed", baseUrl.get());
ShowPopup(TranslateT("Plugin Updater"), TranslateT("An error occurred while checking for new updates."), POPUP_TYPE_ERROR);
Skin_PlaySound("updatefailed");
return false;
}
- if(!unzip(pFileUrl.tszDiskPath, g_tszTempPath, nullptr,true)) {
- Netlib_LogfW(hNetlibUser,L"Unzipping list of available updates from %s failed",baseUrl);
+ if (!unzip(pFileUrl.tszDiskPath, g_tszTempPath, nullptr, true)) {
+ Netlib_LogfW(hNetlibUser, L"Unzipping list of available updates from %s failed", baseUrl.get());
ShowPopup(TranslateT("Plugin Updater"), TranslateT("An error occurred while checking for new updates."), POPUP_TYPE_ERROR);
Skin_PlaySound("updatefailed");
return false;
}
-
+
DeleteFile(pFileUrl.tszDiskPath);
wchar_t tszTmpIni[MAX_PATH] = {0};
diff --git a/plugins/Scriver/src/infobar.cpp b/plugins/Scriver/src/infobar.cpp index f043c0a554..6cd62573ff 100644 --- a/plugins/Scriver/src/infobar.cpp +++ b/plugins/Scriver/src/infobar.cpp @@ -83,7 +83,7 @@ void CSrmmWindow::RefreshInfobar() wchar_t szText[2048];
SETTEXTEX st;
if (szXStatusMsg && *szXStatusMsg)
- mir_snwprintf(szText, L"%s (%s)", TranslateW(szXStatusName), szXStatusMsg);
+ mir_snwprintf(szText, L"%s (%s)", TranslateW(szXStatusName), szXStatusMsg.get());
else if (szXStatusName && *szXStatusName)
wcsncpy_s(szText, TranslateW(szXStatusName), _TRUNCATE);
else
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index ddc1f27bda..25147078a3 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -960,7 +960,7 @@ LRESULT CSrmmWindow::WndProc_Log(UINT msg, WPARAM wParam, LPARAM lParam) ptrW pszWord(GetRichTextWord(m_log.GetHwnd(), &ptl));
if (pszWord && pszWord[0]) {
wchar_t szMenuText[4096];
- mir_snwprintf(szMenuText, TranslateT("Look up '%s':"), pszWord);
+ mir_snwprintf(szMenuText, TranslateT("Look up '%s':"), pszWord.get());
ModifyMenu(hSubMenu, 5, MF_STRING | MF_BYPOSITION, 5, szMenuText);
SetSearchEngineIcons(hMenu, g_dat.hSearchEngineIconList);
}
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp index 100d695ddb..4a8a033588 100644 --- a/plugins/SmileyAdd/src/smileys.cpp +++ b/plugins/SmileyAdd/src/smileys.cpp @@ -237,7 +237,7 @@ void SmileyType::CallSmileyService(MCONTACT hContact) } char str[MAXMODULELABELLENGTH]; - mir_snprintf(str, "%s%s", proto, _T2A(name.c_str())); + mir_snprintf(str, "%s%S", proto, name.c_str()); CallService(str, ConvertServiceParam(hContact, par1.c_str()), ConvertServiceParam(hContact, par2.c_str())); diff --git a/plugins/TabSRMM/src/chat_tools.cpp b/plugins/TabSRMM/src/chat_tools.cpp index ca0c7955d4..c693595013 100644 --- a/plugins/TabSRMM/src/chat_tools.cpp +++ b/plugins/TabSRMM/src/chat_tools.cpp @@ -105,7 +105,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa pd.lchIcon = LoadIconEx("window");
PROTOACCOUNT *pa = Proto_GetAccount(pszProtoName);
- mir_snwprintf(pd.lpwzContactName, L"%s - %s", (pa == nullptr) ? _A2T(pszProtoName) : pa->tszAccountName, Clist_GetContactDisplayName(hContact));
+ mir_snwprintf(pd.lpwzContactName, L"%s - %s", (pa == nullptr) ? _A2T(pszProtoName).get() : pa->tszAccountName, Clist_GetContactDisplayName(hContact));
wcsncpy_s(pd.lpwzText, TranslateW(szBuf), _TRUNCATE);
pd.iSeconds = g_Settings.iPopupTimeout;
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index 0f0890098c..0ce8f1b1c9 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -283,13 +283,13 @@ static wchar_t* GetPreviewT(WORD eventType, DBEVENTINFO *dbe) if (szDescr && Utils::safe_strlen(szDescr, dbe->cbBlob - sizeof(DWORD) - namelength - 1) > 0) {
ptrW tszDescr(DbEvent_GetString(dbe, szDescr));
if (tszFileName && tszDescr) {
- mir_snwprintf(buf, L"%s: %s (%s)", TranslateT("Incoming file"), tszFileName, tszDescr);
+ mir_snwprintf(buf, L"%s: %s (%s)", TranslateT("Incoming file"), tszFileName.get(), tszDescr.get());
return mir_wstrdup(buf);
}
}
if (tszFileName) {
- mir_snwprintf(buf, L"%s: %s (%s)", TranslateT("Incoming file"), tszFileName, TranslateT("No description given"));
+ mir_snwprintf(buf, L"%s: %s (%s)", TranslateT("Incoming file"), tszFileName.get(), TranslateT("No description given"));
return mir_wstrdup(buf);
}
}
@@ -441,13 +441,8 @@ static int PopupShowT(NEN_OPTIONS *pluginOptions, MCONTACT hContact, MEVENT hEve pdata->eventData[0].tszText[MAX_SECONDLINE - 1] = 0;
pdata->nrEventsAlloced = NR_MERGED;
pdata->nrMerged = 1;
-
- // fix for broken popups -- process failures
- if (PUAddPopupW(&pud) < 0) {
- mir_free(pdata->eventData);
- mir_free(pdata);
- }
- else arPopupList.insert(pdata);
+ PUAddPopupW(&pud);
+ arPopupList.insert(pdata);
if (dbe.pBlob)
mir_free(dbe.pBlob);
diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp index cbef09d56a..aea8159720 100644 --- a/plugins/TabSRMM/src/hotkeyhandler.cpp +++ b/plugins/TabSRMM/src/hotkeyhandler.cpp @@ -277,7 +277,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP CheckMenuItem(submenu, ID_TRAYCONTEXT_DISABLEALLPOPUPS, MF_BYCOMMAND | (nen_options.iDisable ? MF_CHECKED : MF_UNCHECKED));
CheckMenuItem(submenu, ID_TRAYCONTEXT_DON40223, MF_BYCOMMAND | (nen_options.iNoSounds ? MF_CHECKED : MF_UNCHECKED));
CheckMenuItem(submenu, ID_TRAYCONTEXT_DON, MF_BYCOMMAND | (nen_options.iNoAutoPopup ? MF_CHECKED : MF_UNCHECKED));
- EnableMenuItem(submenu, ID_TRAYCONTEXT_HIDEALLMESSAGECONTAINERS, MF_BYCOMMAND | (nen_options.bTraySupport) ? MF_ENABLED : MF_GRAYED);
+ EnableMenuItem(submenu, ID_TRAYCONTEXT_HIDEALLMESSAGECONTAINERS, MF_BYCOMMAND | (nen_options.bTraySupport ? MF_ENABLED : MF_GRAYED));
CheckMenuItem(submenu, ID_TRAYCONTEXT_SHOWTHETRAYICON, MF_BYCOMMAND | (nen_options.bTraySupport ? MF_CHECKED : MF_UNCHECKED));
BOOL iSelection = TrackPopupMenu(submenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, nullptr);
if (iSelection) {
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp index 33dd5f359a..3c3684dc8b 100644 --- a/plugins/TabSRMM/src/infopanel.cpp +++ b/plugins/TabSRMM/src/infopanel.cpp @@ -497,7 +497,7 @@ void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem) wchar_t temp[256];
ptrW szVersion(db_get_wsa(m_dat->m_cache->getActiveContact(), m_dat->m_cache->getActiveProto(), "MirVer"));
if (szVersion)
- mir_snwprintf(temp, TranslateT(" Client: %s"), szVersion);
+ mir_snwprintf(temp, TranslateT(" Client: %s"), szVersion.get());
else
mir_snwprintf(temp, TranslateT(" Client not cached yet"));
wcscat_s(szBuf, 256, temp);
diff --git a/plugins/TabSRMM/src/modplus.cpp b/plugins/TabSRMM/src/modplus.cpp index 10cf7aaab3..8d7215bddf 100644 --- a/plugins/TabSRMM/src/modplus.cpp +++ b/plugins/TabSRMM/src/modplus.cpp @@ -100,7 +100,7 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam) int res = TrackPopupMenu(hMenu, TPM_RETURNCMD, cbcd->pt.x, cbcd->pt.y, 0, cbcd->hwndFrom, nullptr);
if (res != 0) {
bufSize = textlenght + mir_wstrlen(arMenuLines[res-1]) + 2;
- pwszFormatedText.Format(arMenuLines[res-1], pszText);
+ pwszFormatedText.Format(arMenuLines[res-1], pszText.get());
}
for (auto &it : arMenuLines)
@@ -110,7 +110,7 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam) else if (textlenght) {
SendDlgItemMessage(cbcd->hwndFrom, IDC_SRMM_MESSAGE, EM_GETSELTEXT, 0, (LPARAM)pszText);
- pwszFormatedText.Format(L"[img]%s[/img]", pszText);
+ pwszFormatedText.Format(L"[img]%s[/img]", pszText.get());
bbd.pwszTooltip = nullptr;
bbd.hIcon = nullptr;
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp index 892a4c1910..456f10b32e 100644 --- a/plugins/TabSRMM/src/sendlater.cpp +++ b/plugins/TabSRMM/src/sendlater.cpp @@ -294,14 +294,13 @@ int CSendLater::addJob(const char *szSetting, void *lParam) else
return 0;
}
- else if (szSetting[0] == 'M') {
+ else {
char *szSep = strchr(const_cast<char *>(szSetting), '|');
if (!szSep)
return 0;
*szSep = 0;
szOrig_Utf = szSep + 1;
}
- else return 0;
CSendLaterJob *job = new CSendLaterJob;
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index ea6daa21ea..b43c0b1c8a 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -583,21 +583,21 @@ int SendQueue::doSendLater(int iJobIndex, CTabBaseDlg *dat, MCONTACT hContact, b time_t now = time(0); wchar_t tszTimestamp[30]; wcsftime(tszTimestamp, _countof(tszTimestamp), L"%Y.%m.%d - %H:%M", _localtime32((__time32_t *)&now)); - mir_snprintf(szKeyName, "S%d", now); + mir_snprintf(szKeyName, "S%d", (int)now); mir_snwprintf(tszHeader, TranslateT("\n(Sent delayed. Original timestamp %s)"), tszTimestamp); } - else mir_snwprintf(tszHeader, L"M%d|", time(0)); + else mir_snwprintf(tszHeader, L"M%d|", (int)time(0)); T2Utf utf_header(tszHeader); size_t required = mir_strlen(utf_header) + mir_strlen(job->szSendBuffer) + 10; char *tszMsg = reinterpret_cast<char *>(mir_alloc(required)); if (fIsSendLater) { - mir_snprintf(tszMsg, required, "%s%s", job->szSendBuffer, utf_header); + mir_snprintf(tszMsg, required, "%s%s", job->szSendBuffer, utf_header.get()); db_set_s(hContact ? hContact : job->hContact, "SendLater", szKeyName, tszMsg); } else { - mir_snprintf(tszMsg, required, "%s%s", utf_header, job->szSendBuffer); + mir_snprintf(tszMsg, required, "%s%s", utf_header.get(), job->szSendBuffer); sendLater->addJob(tszMsg, (void*)hContact); } mir_free(tszMsg); diff --git a/plugins/TabSRMM/src/sidebar.cpp b/plugins/TabSRMM/src/sidebar.cpp index ade164bd21..5f43e104c4 100644 --- a/plugins/TabSRMM/src/sidebar.cpp +++ b/plugins/TabSRMM/src/sidebar.cpp @@ -691,18 +691,16 @@ const CSideBarButton* CSideBar::setActiveItem(const CTabBaseDlg *dat) * Layout() with the parameter set to false is required to perform the
* position update.
*/
-void CSideBar::Layout(const RECT *rc, bool fOnlyCalc)
+void CSideBar::Layout()
{
if (!m_isVisible)
return;
- RECT rcWnd;
-
- rc = &rcWnd;
+ RECT rcWnd;
::GetClientRect(m_hwndScrollWnd, &rcWnd);
if (m_currentLayout->pfnLayout) {
- m_currentLayout->pfnLayout(this, const_cast<RECT *>(rc));
+ m_currentLayout->pfnLayout(this, &rcWnd);
return;
}
@@ -711,8 +709,8 @@ void CSideBar::Layout(const RECT *rc, bool fOnlyCalc) BOOL topEnabled = FALSE, bottomEnabled = FALSE;
HWND hwnd;
LONG spaceUsed = 0;
- DWORD dwFlags = SWP_NOZORDER | SWP_NOACTIVATE;
- LONG iSpaceAvail = rc->bottom;
+ DWORD dwFlags = SWP_NOZORDER | SWP_NOACTIVATE;
+ LONG iSpaceAvail = rcWnd.bottom;
m_firstVisibleOffset = max(0, m_firstVisibleOffset);
@@ -734,14 +732,14 @@ void CSideBar::Layout(const RECT *rc, bool fOnlyCalc) if (p->isTopAligned()) {
if (m_totalItemHeight <= m_firstVisibleOffset) { // partially visible
- if (!fOnlyCalc && nullptr != hwnd) /* Wine fix. */
+ if (nullptr != hwnd) /* Wine fix. */
hdwp = ::DeferWindowPos(hdwp, hwnd, nullptr, 2, -(m_firstVisibleOffset - m_totalItemHeight),
m_elementWidth, height, SWP_SHOWWINDOW | dwFlags);
spaceUsed += ((height + 1) - (m_firstVisibleOffset - m_totalItemHeight));
m_totalItemHeight += (height + 1);
}
else {
- if (!fOnlyCalc && nullptr != hwnd) /* Wine fix. */
+ if (nullptr != hwnd) /* Wine fix. */
hdwp = ::DeferWindowPos(hdwp, hwnd, nullptr, 2, spaceUsed, m_elementWidth, height, SWP_SHOWWINDOW | dwFlags);
spaceUsed += (height + 1);
m_totalItemHeight += (height + 1);
@@ -749,30 +747,28 @@ void CSideBar::Layout(const RECT *rc, bool fOnlyCalc) }
}
topEnabled = m_firstVisibleOffset > 0;
- bottomEnabled = (m_totalItemHeight - m_firstVisibleOffset > rc->bottom);
+ bottomEnabled = (m_totalItemHeight - m_firstVisibleOffset > rcWnd.bottom);
::EndDeferWindowPos(hdwp);
- if (!fOnlyCalc) {
- RECT rcContainer;
- ::GetClientRect(m_pContainer->m_hwnd, &rcContainer);
-
- LONG dx = m_dwFlags & SIDEBARORIENTATION_LEFT ? m_pContainer->m_tBorder_outer_left :
- rcContainer.right - m_pContainer->m_tBorder_outer_right - (m_elementWidth + 4);
-
- ::SetWindowPos(m_up->getHwnd(), nullptr, dx, m_pContainer->m_tBorder_outer_top + m_pContainer->m_pMenuBar->getHeight(),
- m_elementWidth + 4, 14, dwFlags | SWP_SHOWWINDOW);
- ::SetWindowPos(m_down->getHwnd(), nullptr, dx, (rcContainer.bottom - 14 - m_pContainer->m_statusBarHeight - 1),
- m_elementWidth + 4, 14, dwFlags | SWP_SHOWWINDOW);
- ::EnableWindow(m_up->getHwnd(), topEnabled);
- ::EnableWindow(m_down->getHwnd(), bottomEnabled);
- ::InvalidateRect(m_up->getHwnd(), nullptr, FALSE);
- ::InvalidateRect(m_down->getHwnd(), nullptr, FALSE);
- }
+ RECT rcContainer;
+ ::GetClientRect(m_pContainer->m_hwnd, &rcContainer);
+
+ LONG dx = m_dwFlags & SIDEBARORIENTATION_LEFT ? m_pContainer->m_tBorder_outer_left :
+ rcContainer.right - m_pContainer->m_tBorder_outer_right - (m_elementWidth + 4);
+
+ ::SetWindowPos(m_up->getHwnd(), nullptr, dx, m_pContainer->m_tBorder_outer_top + m_pContainer->m_pMenuBar->getHeight(),
+ m_elementWidth + 4, 14, dwFlags | SWP_SHOWWINDOW);
+ ::SetWindowPos(m_down->getHwnd(), nullptr, dx, (rcContainer.bottom - 14 - m_pContainer->m_statusBarHeight - 1),
+ m_elementWidth + 4, 14, dwFlags | SWP_SHOWWINDOW);
+ ::EnableWindow(m_up->getHwnd(), topEnabled);
+ ::EnableWindow(m_down->getHwnd(), bottomEnabled);
+ ::InvalidateRect(m_up->getHwnd(), nullptr, FALSE);
+ ::InvalidateRect(m_down->getHwnd(), nullptr, FALSE);
}
inline void CSideBar::Invalidate()
{
- Layout(nullptr);
+ Layout();
}
void CSideBar::showAll(int showCmd)
@@ -836,7 +832,7 @@ void CSideBar::processScrollerButtons(UINT commandID) else if (commandID == IDC_SIDEBARUP && ::IsWindowEnabled(m_up->getHwnd()))
m_firstVisibleOffset = max(0, m_firstVisibleOffset - 10);
- Layout(nullptr);
+ Layout();
}
void CSideBar::resizeScrollWnd(LONG x, LONG y, LONG, LONG height) const
diff --git a/plugins/TabSRMM/src/sidebar.h b/plugins/TabSRMM/src/sidebar.h index 41a99fe912..424cfd0269 100644 --- a/plugins/TabSRMM/src/sidebar.h +++ b/plugins/TabSRMM/src/sidebar.h @@ -135,7 +135,7 @@ public: void updateSession(CTabBaseDlg *dat);
void processScrollerButtons(UINT cmd);
- void Layout(const RECT *rc = nullptr, bool fOnlyCalc = false);
+ void Layout();
void setVisible(bool fNewVisibility);
void showAll(int showCmd);
diff --git a/plugins/TabSRMM/src/utils.h b/plugins/TabSRMM/src/utils.h index 96729013d1..261cebca55 100644 --- a/plugins/TabSRMM/src/utils.h +++ b/plugins/TabSRMM/src/utils.h @@ -160,7 +160,7 @@ private: UINT m_uId;
HFONT m_hFontCaption;
DWORD m_dwFlags;
- HWND m_hwnd;
+ HWND m_hwnd = nullptr;
bool m_fIsModal;
INT_PTR CALLBACK dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index 666dbf5235..ae3378cfff 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -120,7 +120,7 @@ private: // check if icq is online
if (!IsProtoOnline((*_pPd)->szModuleName))
MsgBox(_pPs->hDlg, MB_ICON_WARNING, TranslateT("Upload details"),
- CMStringW(FORMAT, TranslateT("Protocol '%s' is offline"), _A2T((*_pPd)->szModuleName)),
+ CMStringW(FORMAT, TranslateT("Protocol '%s' is offline"), _A2T((*_pPd)->szModuleName).get()),
TranslateT("You are not currently connected to the ICQ network.\nYou must be online in order to update your information on the server.\n\nYour changes will be saved to database only."));
// start uploading process
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp index 36896aa558..19dc88f493 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp @@ -294,9 +294,9 @@ void CExImContactBase::toIni(FILE* file, int modCount) ptrW pszCI(Contact_GetInfo(CNF_DISPLAY, _hContact, _pszProto)); ptrA pszUID(uid2String(FALSE)); if (_pszUIDKey && pszUID) - mir_snprintf(name, "%S *(%s)*<%s>*{%s}*", pszCI, _pszProto, _pszUIDKey, pszUID); + mir_snprintf(name, "%S *(%s)*<%s>*{%s}*", pszCI.get(), _pszProto, _pszUIDKey, pszUID.get()); else - mir_snprintf(name, "%S (%s)", pszCI, _pszProto); + mir_snprintf(name, "%S (%s)", pszCI.get(), _pszProto); } // it is not the best solution (but still works if only basic modules export) - need rework diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp index 82cefe4a85..499878340a 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp @@ -673,7 +673,7 @@ int CExImContactXML::Import(BYTE keepMetaSubContact) do {
// update progressbar and abort if user clicked cancel
int result = _pXmlFile->_progress.UpdateContact(L"Sub Contact: %s (%S)",
- ptrW(mir_utf8decodeW(xContact->Attribute("nick"))), xContact->Attribute("proto"));
+ ptrW(mir_utf8decodeW(xContact->Attribute("nick"))).get(), xContact->Attribute("proto"));
// user clicked abort button
if (!result)
diff --git a/plugins/Variables/src/contact.cpp b/plugins/Variables/src/contact.cpp index 8c8144a665..b397164a29 100644 --- a/plugins/Variables/src/contact.cpp +++ b/plugins/Variables/src/contact.cpp @@ -210,7 +210,7 @@ MCONTACT getContactFromString(const wchar_t *tszContact, DWORD dwFlags, int nMat if ((dwFlags & CI_PROTOID) && !bMatch) {
ptrW cInfo(getContactInfoT(CNF_UNIQUEID, hContact));
if (cInfo) {
- tmp.Format(L"<%S:%s>", szProto, cInfo);
+ tmp.Format(L"<%S:%s>", szProto, cInfo.get());
if (tmp == tszContact)
bMatch = true;
}
diff --git a/plugins/Variables/src/parse_metacontacts.cpp b/plugins/Variables/src/parse_metacontacts.cpp index 0d06cafffc..7a4d6df88c 100644 --- a/plugins/Variables/src/parse_metacontacts.cpp +++ b/plugins/Variables/src/parse_metacontacts.cpp @@ -44,7 +44,7 @@ static wchar_t* parseGetParent(ARGUMENTSINFO *ai) szUniqueID = mir_wstrdup(tszID);
}
- return CMStringW(FORMAT, L"<%S:%s>", szProto, szUniqueID).Detach();
+ return CMStringW(FORMAT, L"<%S:%s>", szProto, szUniqueID.get()).Detach();
}
static wchar_t* parseGetDefault(ARGUMENTSINFO *ai)
@@ -72,7 +72,7 @@ static wchar_t* parseGetDefault(ARGUMENTSINFO *ai) szUniqueID = mir_wstrdup(tszID);
}
- return CMStringW(FORMAT, L"<%S:%s>", szProto, szUniqueID).Detach();
+ return CMStringW(FORMAT, L"<%S:%s>", szProto, szUniqueID.get()).Detach();
}
static wchar_t* parseGetMostOnline(ARGUMENTSINFO *ai)
@@ -100,7 +100,7 @@ static wchar_t* parseGetMostOnline(ARGUMENTSINFO *ai) szUniqueID = mir_wstrdup(tszID);
}
- return CMStringW(FORMAT, L"<%S:%s>", szProto, szUniqueID).Detach();
+ return CMStringW(FORMAT, L"<%S:%s>", szProto, szUniqueID.get()).Detach();
}
void registerMetaContactsTokens()
diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp index e093fce35c..3d51668705 100644 --- a/plugins/Variables/src/parse_miranda.cpp +++ b/plugins/Variables/src/parse_miranda.cpp @@ -393,7 +393,7 @@ static wchar_t* parseSpecialContact(ARGUMENTSINFO *ai) if (szUniqueID == NULL)
return nullptr;
- return CMStringW(FORMAT, L"<%S:%s>", szProto, szUniqueID).Detach();
+ return CMStringW(FORMAT, L"<%S:%s>", szProto, szUniqueID.get()).Detach();
}
static BOOL isValidDbEvent(DBEVENTINFO *dbe, int flags)
|