summaryrefslogtreecommitdiff
path: root/plugins/UserInfoEx/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/UserInfoEx/src')
-rw-r--r--plugins/UserInfoEx/src/ctrl_annivedit.cpp1
-rw-r--r--plugins/UserInfoEx/src/ctrl_annivedit.h4
-rw-r--r--plugins/UserInfoEx/src/ctrl_base.h8
-rw-r--r--plugins/UserInfoEx/src/ctrl_combo.h4
-rw-r--r--plugins/UserInfoEx/src/ctrl_edit.h14
-rw-r--r--plugins/UserInfoEx/src/ctrl_tzcombo.h4
-rw-r--r--plugins/UserInfoEx/src/dlg_msgbox.cpp2
-rw-r--r--plugins/UserInfoEx/src/mir_db.cpp2
-rw-r--r--plugins/UserInfoEx/src/mir_db.h24
-rw-r--r--plugins/UserInfoEx/src/psp_base.cpp68
-rw-r--r--plugins/UserInfoEx/src/psp_base.h8
-rw-r--r--plugins/UserInfoEx/src/psp_contact.cpp26
-rw-r--r--plugins/UserInfoEx/src/psp_general.cpp13
-rw-r--r--plugins/UserInfoEx/src/psp_options.cpp8
-rw-r--r--plugins/UserInfoEx/src/psp_origin.cpp10
-rw-r--r--plugins/UserInfoEx/src/psp_profile.cpp29
-rw-r--r--plugins/UserInfoEx/src/stdafx.h6
-rw-r--r--plugins/UserInfoEx/src/svc_constants.cpp2
18 files changed, 125 insertions, 108 deletions
diff --git a/plugins/UserInfoEx/src/ctrl_annivedit.cpp b/plugins/UserInfoEx/src/ctrl_annivedit.cpp
index c8d43f11db..65df0c7dac 100644
--- a/plugins/UserInfoEx/src/ctrl_annivedit.cpp
+++ b/plugins/UserInfoEx/src/ctrl_annivedit.cpp
@@ -141,7 +141,6 @@ void CAnnivEditCtrl::EnableCurrentItem()
if (pCurrent) {
MCONTACT hContact;
-
PSGetContact(_hwndDlg, hContact);
const uint8_t bEnabled
diff --git a/plugins/UserInfoEx/src/ctrl_annivedit.h b/plugins/UserInfoEx/src/ctrl_annivedit.h
index bccfa3e134..cd204f2d6c 100644
--- a/plugins/UserInfoEx/src/ctrl_annivedit.h
+++ b/plugins/UserInfoEx/src/ctrl_annivedit.h
@@ -79,9 +79,9 @@ public:
/**
* CBaseCtrl interface:
**/
- static FORCEINLINE CAnnivEditCtrl* GetObj(HWND hCtrl)
+ static __forceinline CAnnivEditCtrl* GetObj(HWND hCtrl)
{ return (CAnnivEditCtrl*) GetUserData(hCtrl); }
- static FORCEINLINE CAnnivEditCtrl* GetObj(HWND hDlg, uint16_t idCtrl)
+ static __forceinline CAnnivEditCtrl* GetObj(HWND hDlg, uint16_t idCtrl)
{ return GetObj(GetDlgItem(hDlg, idCtrl)); }
static CBaseCtrl* CreateObj(HWND hDlg, uint16_t idCtrl, LPCSTR pszSetting);
diff --git a/plugins/UserInfoEx/src/ctrl_base.h b/plugins/UserInfoEx/src/ctrl_base.h
index d98ffb1be2..9c049b647d 100644
--- a/plugins/UserInfoEx/src/ctrl_base.h
+++ b/plugins/UserInfoEx/src/ctrl_base.h
@@ -113,21 +113,21 @@ public:
*
*
**/
- static FORCEINLINE CBaseCtrl* GetObj(HWND hCtrl)
+ static __forceinline CBaseCtrl* GetObj(HWND hCtrl)
{ return (CBaseCtrl*) GetUserData(hCtrl); }
/**
*
*
**/
- static FORCEINLINE CBaseCtrl* GetObj(HWND hDlg, uint16_t idCtrl)
+ static __forceinline CBaseCtrl* GetObj(HWND hDlg, uint16_t idCtrl)
{ return GetObj(GetDlgItem(hDlg, idCtrl)); }
/**
*
*
**/
- FORCEINLINE CCtrlFlags Flags() const { return _Flags; }
+ __forceinline CCtrlFlags Flags() const { return _Flags; }
/**
* This is a pure virtual method, which is the common interface
@@ -202,7 +202,7 @@ public:
static CCtrlList* CreateObj(HWND hOwnerDlg);
- static FORCEINLINE CCtrlList* GetObj(HWND hDlg)
+ static __forceinline CCtrlList* GetObj(HWND hDlg)
{ return (CCtrlList*)GetUserData(hDlg); }
void Release();
diff --git a/plugins/UserInfoEx/src/ctrl_combo.h b/plugins/UserInfoEx/src/ctrl_combo.h
index 618a5441fa..fccd1b9e64 100644
--- a/plugins/UserInfoEx/src/ctrl_combo.h
+++ b/plugins/UserInfoEx/src/ctrl_combo.h
@@ -53,9 +53,9 @@ public:
*
*
**/
- static FORCEINLINE CCombo* GetObj(HWND hCtrl)
+ static __forceinline CCombo* GetObj(HWND hCtrl)
{ return (CCombo*) GetUserData(hCtrl); }
- static FORCEINLINE CCombo* GetObj(HWND hDlg, uint16_t idCtrl)
+ static __forceinline CCombo* GetObj(HWND hDlg, uint16_t idCtrl)
{ return GetObj(GetDlgItem(hDlg, idCtrl)); }
static CBaseCtrl* CreateObj(HWND hDlg, uint16_t idCtrl, LPCSTR pszSetting, uint8_t bDBDataType, LPIDSTRLIST pList, int nListCount);
diff --git a/plugins/UserInfoEx/src/ctrl_edit.h b/plugins/UserInfoEx/src/ctrl_edit.h
index 773f5e1efc..89daafc727 100644
--- a/plugins/UserInfoEx/src/ctrl_edit.h
+++ b/plugins/UserInfoEx/src/ctrl_edit.h
@@ -47,19 +47,19 @@ public:
*
*
**/
- static FORCEINLINE CEditCtrl* GetObj(HWND hCtrl)
+ static __forceinline CEditCtrl* GetObj(HWND hCtrl)
{ return (CEditCtrl*) GetUserData(hCtrl); }
- static FORCEINLINE CEditCtrl* GetObj(HWND hDlg, uint16_t idCtrl)
+ static __forceinline CEditCtrl* GetObj(HWND hDlg, uint16_t idCtrl)
{ return GetObj(GetDlgItem(hDlg, idCtrl)); }
static CBaseCtrl* CreateObj(HWND hDlg, uint16_t idCtrl, LPCSTR pszSetting, uint8_t dbType);
static CBaseCtrl* CreateObj(HWND hDlg, uint16_t idCtrl, LPCSTR pszModule, LPCSTR pszSetting, uint8_t dbType);
- virtual void Release();
- virtual void OnReset();
- virtual BOOL OnInfoChanged(MCONTACT hContact, LPCSTR pszProto);
- virtual void OnApply(MCONTACT hContact, LPCSTR pszProto);
- virtual void OnChangedByUser(uint16_t wChangedMsg);
+ virtual void Release();
+ virtual void OnReset();
+ virtual BOOL OnInfoChanged(MCONTACT hContact, LPCSTR pszProto);
+ virtual void OnApply(MCONTACT hContact, LPCSTR pszProto);
+ virtual void OnChangedByUser(uint16_t wChangedMsg);
void OpenUrl();
LRESULT LinkNotificationHandler(ENLINK* lnk);
diff --git a/plugins/UserInfoEx/src/ctrl_tzcombo.h b/plugins/UserInfoEx/src/ctrl_tzcombo.h
index 4eba24f871..af29fa142a 100644
--- a/plugins/UserInfoEx/src/ctrl_tzcombo.h
+++ b/plugins/UserInfoEx/src/ctrl_tzcombo.h
@@ -36,9 +36,9 @@ class CTzCombo : public CBaseCtrl
public:
- static FORCEINLINE CTzCombo* GetObj(HWND hCtrl)
+ static __forceinline CTzCombo* GetObj(HWND hCtrl)
{ return (CTzCombo*) GetUserData(hCtrl); }
- static FORCEINLINE CTzCombo* GetObj(HWND hDlg, uint16_t idCtrl)
+ static __forceinline CTzCombo* GetObj(HWND hDlg, uint16_t idCtrl)
{ return GetObj(GetDlgItem(hDlg, idCtrl)); }
static CBaseCtrl* CreateObj(HWND hDlg, uint16_t idCtrl, LPCSTR pszSetting);
diff --git a/plugins/UserInfoEx/src/dlg_msgbox.cpp b/plugins/UserInfoEx/src/dlg_msgbox.cpp
index 66625441cc..77d9c860e7 100644
--- a/plugins/UserInfoEx/src/dlg_msgbox.cpp
+++ b/plugins/UserInfoEx/src/dlg_msgbox.cpp
@@ -42,7 +42,7 @@ typedef struct _MSGPOPUPDATA
*
* @return nothing
**/
-static FORCEINLINE void MoveCtrl(HWND hDlg, int idCtrl, int dx, int dy, int dw, int dh)
+void __forceinline MoveCtrl(HWND hDlg, int idCtrl, int dx, int dy, int dw, int dh)
{
RECT ws;
HWND hCtrl = GetDlgItem(hDlg, idCtrl);
diff --git a/plugins/UserInfoEx/src/mir_db.cpp b/plugins/UserInfoEx/src/mir_db.cpp
index ad76d4b4c5..ba5c612a45 100644
--- a/plugins/UserInfoEx/src/mir_db.cpp
+++ b/plugins/UserInfoEx/src/mir_db.cpp
@@ -550,7 +550,7 @@ uint32_t TimeOf(MEVENT hEvent)
* @retval FALSE - The two structure's events differ from each other.
**/
-static FORCEINLINE bool IsEqual(const DBEVENTINFO *d1, const DBEVENTINFO *d2, bool Data)
+bool __forceinline IsEqual(const DBEVENTINFO *d1, const DBEVENTINFO *d2, bool Data)
{
bool res = d1 && d2 &&
(d1->timestamp == d2->timestamp) &&
diff --git a/plugins/UserInfoEx/src/mir_db.h b/plugins/UserInfoEx/src/mir_db.h
index bfb3faf468..517c156687 100644
--- a/plugins/UserInfoEx/src/mir_db.h
+++ b/plugins/UserInfoEx/src/mir_db.h
@@ -44,37 +44,37 @@ namespace Module {
namespace Setting {
uint8_t Get(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv, const uint8_t nType);
- static FORCEINLINE uint8_t GetAsIs(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
+ uint8_t __forceinline GetAsIs(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
{ return Get(hContact, pszModule, pszSetting, dbv, 0); }
- static FORCEINLINE uint8_t GetAString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
+ uint8_t __forceinline GetAString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
{ return Get(hContact, pszModule, pszSetting, dbv, DBVT_ASCIIZ); }
LPSTR GetAString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting);
- static FORCEINLINE uint8_t GetWString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
+ uint8_t __forceinline GetWString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
{ return Get(hContact, pszModule, pszSetting, dbv, DBVT_WCHAR); }
LPWSTR GetWString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting);
- static FORCEINLINE uint8_t GetUString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
+ uint8_t __forceinline GetUString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
{ return Get(hContact, pszModule, pszSetting, dbv, DBVT_UTF8); }
uint8_t GetEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv, const uint8_t nType);
- static FORCEINLINE uint8_t GetAsIsEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
+ uint8_t __forceinline GetAsIsEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
{ return GetEx(hContact, pszModule, szProto, pszSetting, dbv, 0); }
- static FORCEINLINE LPSTR GetAStringEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting)
+ LPSTR __forceinline GetAStringEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting)
{ DBVARIANT dbv; return (!GetEx(hContact, pszModule, szProto, pszSetting, &dbv, DBVT_ASCIIZ) && dbv.type == DBVT_ASCIIZ) ? dbv.pszVal : nullptr; }
- static FORCEINLINE LPWSTR GetWStringEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting)
+ LPWSTR __forceinline GetWStringEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting)
{ DBVARIANT dbv; return (!GetEx(hContact, pszModule, szProto, pszSetting, &dbv, DBVT_WCHAR) && dbv.type == DBVT_WCHAR) ? dbv.pwszVal : nullptr; }
- static FORCEINLINE LPSTR GetUStringEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting)
+ LPSTR __forceinline GetUStringEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting)
{ DBVARIANT dbv; return (!GetEx(hContact, pszModule, szProto, pszSetting, &dbv, DBVT_UTF8) && dbv.type == DBVT_UTF8) ? dbv.pszVal : nullptr; }
uint16_t GetCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv, const uint8_t nType);
- static FORCEINLINE uint16_t GetAsIsCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
+ uint16_t __forceinline GetAsIsCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
{ return GetCtrl(hContact, pszModule, szSubModule, szProto, pszSetting, dbv, 0); }
- static FORCEINLINE uint16_t GetAStringCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
+ uint16_t __forceinline GetAStringCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
{ return GetCtrl(hContact, pszModule, szSubModule, szProto, pszSetting, dbv, DBVT_ASCIIZ); }
- static FORCEINLINE uint16_t GetWStringCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
+ uint16_t __forceinline GetWStringCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
{ return GetCtrl(hContact, pszModule, szSubModule, szProto, pszSetting, dbv, DBVT_WCHAR); }
- static FORCEINLINE uint16_t GetUStringCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
+ uint16_t __forceinline GetUStringCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
{ return GetCtrl(hContact, pszModule, szSubModule, szProto, pszSetting, dbv, DBVT_UTF8); }
/**
diff --git a/plugins/UserInfoEx/src/psp_base.cpp b/plugins/UserInfoEx/src/psp_base.cpp
index d827660e07..91a07e4957 100644
--- a/plugins/UserInfoEx/src/psp_base.cpp
+++ b/plugins/UserInfoEx/src/psp_base.cpp
@@ -40,12 +40,30 @@ bool PSPBaseDlg::OnInitDialog()
{
m_ctrlList = CCtrlList::CreateObj(m_hwnd);
- HFONT hBoldFont;
- PSGetBoldFont(m_hwnd, hBoldFont);
- SendDlgItemMessage(m_hwnd, IDC_PAGETITLE, WM_SETFONT, (WPARAM)hBoldFont, 0);
+ SendDlgItemMessage(m_hwnd, IDC_PAGETITLE, WM_SETFONT, (WPARAM)GetBoldFont(), 0);
return true;
}
+bool PSPBaseDlg::OnRefresh()
+{
+ if (auto *pszProto = GetBaseProto())
+ return (GetWindowLongPtr(m_hwnd, DWLP_MSGRESULT) & PSP_CHANGED) | m_ctrlList->OnInfoChanged(m_hContact, pszProto);
+
+ return false;
+}
+
+bool PSPBaseDlg::OnApply()
+{
+ if (auto *pszProto = GetBaseProto())
+ m_ctrlList->OnApply(m_hContact, pszProto);
+ return true;
+}
+
+void PSPBaseDlg::OnReset()
+{
+ m_ctrlList->OnReset();
+}
+
void PSPBaseDlg::OnDestroy()
{
m_ctrlList->Release();
@@ -68,32 +86,6 @@ INT_PTR PSPBaseDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
return m_ctrlList->OnSetTextColour((HWND)lParam, (HDC)wParam);
break;
- case WM_NOTIFY:
- switch (((LPNMHDR)lParam)->idFrom) {
- case 0:
- LPSTR pszProto;
-
- switch (((LPNMHDR)lParam)->code) {
- case PSN_RESET:
- m_ctrlList->OnReset();
- break;
-
- case PSN_INFOCHANGED:
- if (PSGetBaseProto(m_hwnd, pszProto) && *pszProto) {
- BOOL bChanged = (GetWindowLongPtr(m_hwnd, DWLP_MSGRESULT)&PSP_CHANGED) | m_ctrlList->OnInfoChanged(m_hContact, pszProto);
- SetWindowLongPtr(m_hwnd, DWLP_MSGRESULT, bChanged ? PSP_CHANGED : 0);
- }
- break;
-
- case PSN_APPLY:
- if (PSGetBaseProto(m_hwnd, pszProto) && *pszProto)
- m_ctrlList->OnApply(m_hContact, pszProto);
- break;
- }
- break;
- }
- break;
-
case WM_COMMAND:
if (m_ctrlList && !PspIsLocked(m_hwnd))
m_ctrlList->OnChangedByUser(LOWORD(wParam), HIWORD(wParam));
@@ -102,3 +94,21 @@ INT_PTR PSPBaseDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
return CUserInfoPageDlg::DlgProc(uMsg, wParam, lParam);
}
+
+HFONT PSPBaseDlg::GetBoldFont() const
+{
+ HFONT res = nullptr;
+ return SendMessage(m_hwndParent, PSM_GETBOLDFONT, INDEX_CURPAGE, LPARAM(&res)) ? res : nullptr;
+}
+
+MCONTACT PSPBaseDlg::GetContact() const
+{
+ MCONTACT res = 0;
+ return SendMessage(m_hwndParent, PSM_GETCONTACT, INDEX_CURPAGE, LPARAM(&res)) ? res : 0;
+}
+
+const char *PSPBaseDlg::GetBaseProto() const
+{
+ const char *res = "";
+ return (SendMessage(m_hwndParent, PSM_GETBASEPROTO, INDEX_CURPAGE, LPARAM(&res)) && *res) ? res : nullptr;
+}
diff --git a/plugins/UserInfoEx/src/psp_base.h b/plugins/UserInfoEx/src/psp_base.h
index 55c4529120..109b751c6e 100644
--- a/plugins/UserInfoEx/src/psp_base.h
+++ b/plugins/UserInfoEx/src/psp_base.h
@@ -35,11 +35,17 @@ protected:
PSPBaseDlg(int idDialog);
virtual void OnIconsChanged() {}
-
bool OnInitDialog() override;
+ bool OnApply() override;
+ bool OnRefresh() override;
+ void OnReset() override;
void OnDestroy() override;
INT_PTR DlgProc(UINT uMsg, WPARAM, LPARAM) override;
+
+ HFONT GetBoldFont() const;
+ MCONTACT GetContact() const;
+ const char* GetBaseProto() const;
};
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/UserInfoEx/src/psp_contact.cpp b/plugins/UserInfoEx/src/psp_contact.cpp
index 5088972e12..6ab73aaf49 100644
--- a/plugins/UserInfoEx/src/psp_contact.cpp
+++ b/plugins/UserInfoEx/src/psp_contact.cpp
@@ -55,8 +55,8 @@ struct PSPContactHomeDlg : public PSPBaseDlg
bool OnRefresh() override
{
- LPCSTR pszProto;
- if (!PSGetBaseProto(m_hwnd, pszProto) || *pszProto == 0)
+ auto *pszProto = GetBaseProto();
+ if (!pszProto)
return false;
uint8_t bChanged = 0;
@@ -76,13 +76,15 @@ struct PSPContactHomeDlg : public PSPBaseDlg
bChanged |= CtrlContactAddItemFromDB(hCtrl, IDI_BTN_EMAIL, TranslateT("Tertiary e-mail"), m_hContact, USERINFO, pszProto, SET_CONTACT_EMAIL1);
bChanged |= CtrlContactAddMyItemsFromDB(hCtrl, IDI_BTN_EMAIL, 0, m_hContact, USERINFO, pszProto, SET_CONTACT_MYEMAIL_CAT, SET_CONTACT_MYEMAIL_VAL);
SendMessage(hCtrl, CBEXM_SETCURSEL, (WPARAM)-1, TRUE);
+
+ PSPBaseDlg::OnRefresh();
return bChanged != 0;
}
bool OnApply() override
{
- LPCSTR pszProto;
- if (!PSGetBaseProto(m_hwnd, pszProto) || *pszProto == 0)
+ auto *pszProto = GetBaseProto();
+ if (!pszProto)
return false;
HWND hCtrl = GetDlgItem(m_hwnd, EDIT_PHONE);
@@ -98,7 +100,8 @@ struct PSPContactHomeDlg : public PSPBaseDlg
CtrlContactWriteItemToDB(hCtrl, m_hContact, USERINFO, pszProto, SET_CONTACT_EMAIL1);
CtrlContactWriteMyItemsToDB(hCtrl, 3, m_hContact, USERINFO, pszProto, SET_CONTACT_MYEMAIL_CAT, SET_CONTACT_MYEMAIL_VAL);
SendMessage(hCtrl, CBEXM_RESETCHANGED, NULL, NULL);
- return true;
+
+ return PSPBaseDlg::OnApply();
}
void OnIconsChanged() override
@@ -175,8 +178,8 @@ struct PSPContactWorkDlg : public PSPBaseDlg
bool OnApply() override
{
- LPCSTR pszProto;
- if (!PSGetBaseProto(m_hwnd, pszProto) || *pszProto == 0)
+ auto *pszProto = GetBaseProto();
+ if (!pszProto)
return false;
HWND hCtrl = GetDlgItem(m_hwnd, EDIT_PHONE);
@@ -192,13 +195,14 @@ struct PSPContactWorkDlg : public PSPBaseDlg
CtrlContactWriteItemToDB(hCtrl, m_hContact, USERINFO, pszProto, SET_CONTACT_COMPANY_EMAIL1);
CtrlContactWriteMyItemsToDB(hCtrl, 3, m_hContact, USERINFO, pszProto, SET_CONTACT_COMPANY_MYEMAIL_CAT, SET_CONTACT_COMPANY_MYEMAIL_VAL);
SendMessage(hCtrl, CBEXM_RESETCHANGED, NULL, NULL);
- return true;
+
+ return PSPBaseDlg::OnApply();
}
bool OnRefresh() override
{
- LPCSTR pszProto;
- if (!PSGetBaseProto(m_hwnd, pszProto) || *pszProto == 0)
+ auto *pszProto = GetBaseProto();
+ if (!pszProto)
return false;
uint8_t bChanged = 0;
@@ -218,6 +222,8 @@ struct PSPContactWorkDlg : public PSPBaseDlg
bChanged |= CtrlContactAddItemFromDB(hCtrl, IDI_BTN_EMAIL, TranslateT("Tertiary e-mail"), m_hContact, USERINFO, pszProto, SET_CONTACT_COMPANY_EMAIL1);
bChanged |= CtrlContactAddMyItemsFromDB(hCtrl, IDI_BTN_EMAIL, 0, m_hContact, USERINFO, pszProto, SET_CONTACT_COMPANY_MYEMAIL_CAT, SET_CONTACT_COMPANY_MYEMAIL_VAL);
SendMessage(hCtrl, CBEXM_SETCURSEL, (WPARAM)-1, TRUE);
+
+ PSPBaseDlg::OnRefresh();
return bChanged != 0;
}
diff --git a/plugins/UserInfoEx/src/psp_general.cpp b/plugins/UserInfoEx/src/psp_general.cpp
index 44c8576d85..81c3017219 100644
--- a/plugins/UserInfoEx/src/psp_general.cpp
+++ b/plugins/UserInfoEx/src/psp_general.cpp
@@ -58,8 +58,7 @@ struct PSPGeneralDlg : public PSPBaseDlg
bool OnRefresh() override
{
- char *pszProto;
- if (PSGetBaseProto(m_hwnd, pszProto) && *pszProto) {
+ if (auto *pszProto = GetBaseProto()) {
DBVARIANT dbv;
CCtrlFlags Flags;
Flags.W = DB::Setting::GetWStringCtrl(m_hContact, USERINFO, USERINFO, pszProto, SET_CONTACT_GENDER, &dbv);
@@ -75,13 +74,14 @@ struct PSPGeneralDlg : public PSPBaseDlg
else db_free(&dbv);
}
}
- return false;
+
+ return PSPBaseDlg::OnRefresh();
}
bool OnApply() override
{
- char *pszProto;
- if (!PSGetBaseProto(m_hwnd, pszProto) || *pszProto == 0)
+ auto *pszProto = GetBaseProto();
+ if (!pszProto)
return false;
// gender
@@ -92,7 +92,8 @@ struct PSPGeneralDlg : public PSPBaseDlg
db_set_b(m_hContact, m_hContact ? USERINFO : pszProto, SET_CONTACT_GENDER, gender);
else
db_unset(m_hContact, m_hContact ? USERINFO : pszProto, SET_CONTACT_GENDER);
- return true;
+
+ return PSPBaseDlg::OnApply();
}
void OnIconsChanged() override
diff --git a/plugins/UserInfoEx/src/psp_options.cpp b/plugins/UserInfoEx/src/psp_options.cpp
index 26838261ec..f3c0b500c7 100644
--- a/plugins/UserInfoEx/src/psp_options.cpp
+++ b/plugins/UserInfoEx/src/psp_options.cpp
@@ -31,24 +31,24 @@ static MenuOptionsList ctrl_Menu[] = {
{ SET_MI_ACCOUNT, CHECK_OPT_MI_ACCOUNT, RADIO_OPT_MI_ACCOUNT_NONE, RADIO_OPT_MI_ACCOUNT_ALL, RADIO_OPT_MI_ACCOUNT_EXIMPORT },
};
-static FORCEINLINE void NotifyParentOfChange(HWND hDlg)
+void __forceinline NotifyParentOfChange(HWND hDlg)
{
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
}
-static int FORCEINLINE ComboBox_FindByItemDataPtr(HWND hCombo, LPARAM pData)
+int __forceinline ComboBox_FindByItemDataPtr(HWND hCombo, LPARAM pData)
{
int nItemIndex;
for (nItemIndex = ComboBox_GetCount(hCombo); (nItemIndex >= 0) && (ComboBox_GetItemData(hCombo, nItemIndex) != pData); nItemIndex--);
return nItemIndex;
}
-static void FORCEINLINE ComboBox_SetCurSelByItemDataPtr(HWND hCombo, LPARAM pData)
+void __forceinline ComboBox_SetCurSelByItemDataPtr(HWND hCombo, LPARAM pData)
{
ComboBox_SetCurSel(hCombo, ComboBox_FindByItemDataPtr(hCombo, pData));
}
-static void FORCEINLINE ComboBox_AddItemWithData(HWND hCombo, LPTSTR ptszText, LPARAM pData)
+void __forceinline ComboBox_AddItemWithData(HWND hCombo, LPTSTR ptszText, LPARAM pData)
{
ComboBox_SetItemData(hCombo, ComboBox_AddString(hCombo, TranslateW(ptszText)), pData);
}
diff --git a/plugins/UserInfoEx/src/psp_origin.cpp b/plugins/UserInfoEx/src/psp_origin.cpp
index 78b85cc707..e9558e058e 100644
--- a/plugins/UserInfoEx/src/psp_origin.cpp
+++ b/plugins/UserInfoEx/src/psp_origin.cpp
@@ -55,11 +55,8 @@ public:
bool OnRefresh() override
{
- LPCSTR pszProto;
- if (!PSGetBaseProto(m_hwnd, pszProto) || *pszProto == 0)
- return false;
-
- if (!m_hContact)
+ auto *pszProto = GetBaseProto();
+ if (!pszProto || !m_hContact)
return false;
MTime mt;
@@ -82,7 +79,8 @@ public:
mt.TimeFormat(ptr, _countof(szTime) - (ptr - szTime));
SetDlgItemText(m_hwnd, TXT_DATEADDED, szTime);
}
- return false;
+
+ return PSPBaseDlg::OnRefresh();
}
void OnIconsChanged() override
diff --git a/plugins/UserInfoEx/src/psp_profile.cpp b/plugins/UserInfoEx/src/psp_profile.cpp
index 78acc56f4d..1479d3a15a 100644
--- a/plugins/UserInfoEx/src/psp_profile.cpp
+++ b/plugins/UserInfoEx/src/psp_profile.cpp
@@ -986,6 +986,8 @@ public:
bool OnInitDialog() override
{
+ PSPBaseDlg::OnInitDialog();
+
Ctrl_InitTextColours();
// init info structure
@@ -1004,10 +1006,6 @@ public:
// insert columns into the listboxes
m_list.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT);
- HFONT hFont;
- PSGetBoldFont(m_hwnd, hFont);
- SendDlgItemMessage(m_hwnd, IDC_PAGETITLE, WM_SETFONT, (WPARAM)hFont, 0);
-
// set listfont
pList->hFont = (HFONT)m_list.SendMsg(WM_GETFONT, 0, 0);
pList->wFlags |= LVF_EDITLABEL;
@@ -1015,7 +1013,7 @@ public:
LOGFONT lf;
GetObject(pList->hFont, sizeof(lf), &lf);
lf.lfHeight -= 6;
- hFont = CreateFontIndirect(&lf);
+ HFONT hFont = CreateFontIndirect(&lf);
m_list.SendMsg(WM_SETFONT, (WPARAM)hFont, 0);
RECT rc;
@@ -1058,10 +1056,10 @@ public:
CHAR pszSetting[MAXSETTING];
LPLCITEM pItem;
int iItem;
- LPSTR pszModule = USERINFO;
+ const char *pszModule = USERINFO;
if (!m_hContact)
- PSGetBaseProto(m_hwnd, pszModule);
+ pszModule = GetBaseProto();
*szGroup = 0;
@@ -1121,15 +1119,16 @@ public:
pList->wFlags &= ~CTRLF_CHANGED;
}
- return true;
+
+ return PSPBaseDlg::OnApply();
}
bool OnRefresh() override
{
int iItem = 0, iGrp = 0, numProtoItems, numUserItems;
- LPCSTR pszProto;
- if (!(pList->wFlags & CTRLF_CHANGED) && PSGetBaseProto(m_hwnd, pszProto) && *pszProto != 0) {
+ auto *pszProto = GetBaseProto();
+ if (!(pList->wFlags & CTRLF_CHANGED) && pszProto) {
ProfileList_Clear(m_list.GetHwnd());
// insert the past information
@@ -1173,7 +1172,7 @@ public:
}
}
}
- return false;
+ return PSPBaseDlg::OnRefresh();
}
INT_PTR DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) override
@@ -1275,12 +1274,10 @@ public:
case CDDS_ITEMPREPAINT:
ListView_GetItemRect(cd->nmcd.hdr.hwndFrom, cd->nmcd.dwItemSpec, &rc, LVIR_BOUNDS);
if (!PtrIsValid(pItem)) {
- HFONT hBold, hFont;
- wchar_t szText[MAX_PATH];
-
- PSGetBoldFont(m_hwnd, hBold);
- hFont = (HFONT)SelectObject(cd->nmcd.hdc, hBold);
+ HFONT hFont = (HFONT)SelectObject(cd->nmcd.hdc, GetBoldFont());
SetTextColor(cd->nmcd.hdc, GetSysColor(COLOR_3DSHADOW));
+
+ wchar_t szText[MAX_PATH];
ProfileList_GetItemText(cd->nmcd.hdr.hwndFrom, cd->nmcd.dwItemSpec, 0, szText, MAX_PATH);
rc.left += 6;
DrawText(cd->nmcd.hdc, TranslateW(szText), -1, &rc, DT_NOCLIP | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
diff --git a/plugins/UserInfoEx/src/stdafx.h b/plugins/UserInfoEx/src/stdafx.h
index 9acf9e3f0a..9568ee19c9 100644
--- a/plugins/UserInfoEx/src/stdafx.h
+++ b/plugins/UserInfoEx/src/stdafx.h
@@ -201,19 +201,19 @@ extern struct CountryListEntry *countries;
* UserInfoEx common used functions
***********************************************************************************************************/
-static FORCEINLINE BOOL IsProtoOnline(LPSTR pszProto)
+bool __forceinline IsProtoOnline(LPSTR pszProto)
{
return pszProto && pszProto[0] && Proto_GetStatus(pszProto) >= ID_STATUS_ONLINE;
}
-static FORCEINLINE BOOL IsProtoAccountEnabled(PROTOACCOUNT *pAcc)
+bool __forceinline IsProtoAccountEnabled(PROTOACCOUNT *pAcc)
{
return (pAcc->bIsEnabled && Proto_GetAccount(pAcc->szModuleName));
}
typedef HRESULT (STDAPICALLTYPE *pfnDwmIsCompositionEnabled)(BOOL *);
extern pfnDwmIsCompositionEnabled dwmIsCompositionEnabled;
-static FORCEINLINE uint8_t IsAeroMode()
+bool __forceinline IsAeroMode()
{
BOOL result;
return myGlobals.WantAeroAdaption && dwmIsCompositionEnabled && (dwmIsCompositionEnabled(&result) == S_OK) && result;
diff --git a/plugins/UserInfoEx/src/svc_constants.cpp b/plugins/UserInfoEx/src/svc_constants.cpp
index f91faadd8e..7a2caa562d 100644
--- a/plugins/UserInfoEx/src/svc_constants.cpp
+++ b/plugins/UserInfoEx/src/svc_constants.cpp
@@ -398,7 +398,7 @@ void SvcConstantsLoadModule(void)
GetNamePrefixList(&nListSize, &pList);
}
-static void FORCEINLINE SvcConstantsClearList(UINT pnListSize, LPIDSTRLIST pList)
+static void __forceinline SvcConstantsClearList(UINT pnListSize, LPIDSTRLIST pList)
{
if (pList)
for (UINT i = 0; i < pnListSize; i++)