summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-09-16 21:34:51 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-09-16 21:34:51 +0300
commit25059c00c1f498207a913039848070cb48e3b4f0 (patch)
tree43e0a2cf9260509c0d19db53b95adfd416b39335
parentcee72905099ee7be2bc7327907e09a28f2220d15 (diff)
crash fix for setting unused OLE properties
-rw-r--r--include/m_button_int.h2
-rw-r--r--src/mir_app/src/button.cpp23
2 files changed, 0 insertions, 25 deletions
diff --git a/include/m_button_int.h b/include/m_button_int.h
index 53dca679f7..7323c83ecd 100644
--- a/include/m_button_int.h
+++ b/include/m_button_int.h
@@ -54,8 +54,6 @@ struct MButtonCtrl
bSendOnDown; // sends BN_CLICKED on WM_LBUTTONDOWN
pfnPainterFunc fnPainter; // custom button painter
-
- IAccPropServices* pAccPropServices;
};
#endif // M_BUTTON_INT_H__
diff --git a/src/mir_app/src/button.cpp b/src/mir_app/src/button.cpp
index 7a9ecc1e7f..9fc30de9a5 100644
--- a/src/mir_app/src/button.cpp
+++ b/src/mir_app/src/button.cpp
@@ -64,15 +64,6 @@ static void LoadTheme(MButtonCtrl *ctl)
ctl->bIsThemed = true;
}
-static void SetHwndPropInt(MButtonCtrl* bct, DWORD idObject, DWORD idChild, MSAAPROPID idProp, int val)
-{
- if (bct->pAccPropServices == nullptr) return;
- VARIANT var;
- var.vt = VT_I4;
- var.lVal = val;
- bct->pAccPropServices->SetHwndProp(bct->hwnd, idObject, idChild, idProp, var);
-}
-
static int TBStateConvert2Flat(int state)
{
switch(state) {
@@ -253,12 +244,6 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
bct->hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
LoadTheme(bct);
- // Annotating the Role of this object to be PushButton
- if (SUCCEEDED(CoCreateInstance(CLSID_AccPropServices, nullptr, CLSCTX_SERVER, IID_IAccPropServices, (void**)&bct->pAccPropServices)))
- SetHwndPropInt(bct, OBJID_CLIENT, CHILDID_SELF, PROPID_ACC_ROLE, ROLE_SYSTEM_PUSHBUTTON);
- else
- bct->pAccPropServices = nullptr;
-
SetWindowLongPtr(hwnd, 0, (LONG_PTR)bct);
if (((CREATESTRUCT *)lParam)->lpszName)
SetWindowText(hwnd, ((CREATESTRUCT*)lParam)->lpszName);
@@ -266,10 +251,6 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
case WM_DESTROY:
if (bct) {
- if (bct->pAccPropServices) {
- bct->pAccPropServices->Release();
- bct->pAccPropServices = nullptr;
- }
if (bct->hwndToolTips) {
TOOLINFO ti = {0};
ti.cbSize = sizeof(ti);
@@ -486,10 +467,6 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
ti.lpszText = mir_wstrdup(TranslateW((WCHAR*)wParam));
else
ti.lpszText = Langpack_PcharToTchar((char*)wParam);
-
- if (bct->pAccPropServices)
- bct->pAccPropServices->SetHwndPropStr(bct->hwnd, OBJID_CLIENT, CHILDID_SELF, PROPID_ACC_DESCRIPTION, ti.lpszText);
-
SendMessage(bct->hwndToolTips, TTM_ADDTOOL, 0, (LPARAM)&ti);
mir_free(ti.lpszText);
}