summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2016-01-23 16:28:19 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2016-01-23 16:28:19 +0000
commit5e10673c45a91e474680a1a998cd6934f9627faa (patch)
treec9d5154187226f0003613cfdcbb76345402161e6
parentdee551f9874195814e7357c94045aa0c2e77cc4f (diff)
this is bad idea
git-svn-id: http://svn.miranda-ng.org/main/trunk@16148 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/IEView/src/IEView.cpp66
-rw-r--r--plugins/IEView/src/IEView.h6
-rw-r--r--plugins/IEView/src/external_funcs.cpp12
-rw-r--r--plugins/IEView/src/external_funcs.h4
4 files changed, 31 insertions, 57 deletions
diff --git a/plugins/IEView/src/IEView.cpp b/plugins/IEView/src/IEView.cpp
index 2be1e2eacf..3a0ed4bafd 100644
--- a/plugins/IEView/src/IEView.cpp
+++ b/plugins/IEView/src/IEView.cpp
@@ -436,8 +436,6 @@ STDMETHODIMP IEView::GetIDsOfNames(REFIID /*riid*/, LPOLESTR *rgszNames, UINT cN
else if (!wcscmp(L"win32_CopyToClipboard", rgszNames[i]))
rgDispId[i] = DISPID_EXTERNAL_WIN32_COPY_TO_CLIPBOARD;
- else if (!wcscmp(L"IEView_SetContextMenuHandler", rgszNames[i]))
- rgDispId[i] = DISPID_EXTERNAL_SET_CONTEXTMENUHANDLER;
else if (!wcscmp(L"IEView_GetCurrentContact", rgszNames[i]))
rgDispId[i] = DISPID_EXTERNAL_GET_CURRENTCONTACT;
@@ -480,8 +478,6 @@ STDMETHODIMP IEView::Invoke(DISPID dispIdMember,
case DISPID_EXTERNAL_GET_CURRENTCONTACT:
return External::IEView_GetCurrentContact(this, pDispParams, pVarResult);
- case DISPID_EXTERNAL_SET_CONTEXTMENUHANDLER:
- return External::IEView_SetContextMenuHandler(this, pDispParams, pVarResult);
}
return DISP_E_MEMBERNOTFOUND;
@@ -620,41 +616,35 @@ STDMETHODIMP IEView::ShowContextMenu(DWORD dwID, POINT *ppt, IUnknown *pcmdTarge
*/
}
#else
- if (wszContextMenuHandler != nullptr)
- {
- CallJScript(wszContextMenuHandler, 1, CMStringW(FORMAT, L"%d", dwID));
- }
- else
- {
- CComPtr<IOleCommandTarget> pOleCommandTarget;
- if (SUCCEEDED(pcmdTarget->QueryInterface(IID_IOleCommandTarget, (void**)&pOleCommandTarget))) {
- CComPtr<IOleWindow> pOleWindow;
- if (SUCCEEDED(pOleCommandTarget.QueryInterface(&pOleWindow))) {
- HWND hSPWnd;
- pOleWindow->GetWindow(&hSPWnd);
-
- HMENU hMenu = GetSubMenu(LoadMenu(hInstance, MAKEINTRESOURCE(IDR_CONTEXTMENU)), 0);
- TranslateMenu(hMenu);
- if (dwID == 5) // anchor
- EnableMenuItem(hMenu, ID_MENU_COPYLINK, MF_BYCOMMAND | MF_ENABLED);
- else if (dwID == 4) // text select
- EnableMenuItem(hMenu, ID_MENU_COPY, MF_BYCOMMAND | MF_ENABLED);
- else if (dwID == 1) // control (image)
- EnableMenuItem(hMenu, ID_MENU_SAVEIMAGE, MF_BYCOMMAND | MF_ENABLED);
- int iSelection = TrackPopupMenu(hMenu,
- TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD,
- ppt->x,
- ppt->y,
- 0,
- hwnd,
- (RECT*)NULL);
- DestroyMenu(hMenu);
- if (iSelection == ID_MENU_CLEARLOG)
- clear(NULL);
- else
- SendMessage(hSPWnd, WM_COMMAND, iSelection, (LPARAM)NULL);
- }
+ CComPtr<IOleCommandTarget> pOleCommandTarget;
+ if (SUCCEEDED(pcmdTarget->QueryInterface(IID_IOleCommandTarget, (void**)&pOleCommandTarget))) {
+ CComPtr<IOleWindow> pOleWindow;
+ if (SUCCEEDED(pOleCommandTarget.QueryInterface(&pOleWindow))) {
+ HWND hSPWnd;
+ pOleWindow->GetWindow(&hSPWnd);
+
+ HMENU hMenu = GetSubMenu(LoadMenu(hInstance, MAKEINTRESOURCE(IDR_CONTEXTMENU)), 0);
+ TranslateMenu(hMenu);
+ if (dwID == 5) // anchor
+ EnableMenuItem(hMenu, ID_MENU_COPYLINK, MF_BYCOMMAND | MF_ENABLED);
+ else if (dwID == 4) // text select
+ EnableMenuItem(hMenu, ID_MENU_COPY, MF_BYCOMMAND | MF_ENABLED);
+ else if (dwID == 1) // control (image)
+ EnableMenuItem(hMenu, ID_MENU_SAVEIMAGE, MF_BYCOMMAND | MF_ENABLED);
+
+ int iSelection = TrackPopupMenu(hMenu,
+ TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD,
+ ppt->x,
+ ppt->y,
+ 0,
+ hwnd,
+ (RECT*)NULL);
+ DestroyMenu(hMenu);
+ if (iSelection == ID_MENU_CLEARLOG)
+ clear(NULL);
+ else
+ SendMessage(hSPWnd, WM_COMMAND, iSelection, (LPARAM)NULL);
}
}
#endif
diff --git a/plugins/IEView/src/IEView.h b/plugins/IEView/src/IEView.h
index f43d26b3aa..7e43886922 100644
--- a/plugins/IEView/src/IEView.h
+++ b/plugins/IEView/src/IEView.h
@@ -443,7 +443,6 @@ private:
WCHAR* selectedText;
bool isContactSet;
MCONTACT hContact;
- wchar_t *wszContextMenuHandler;
// IUnknown
STDMETHODIMP QueryInterface(REFIID riid, PVOID *ppv);
@@ -561,11 +560,6 @@ public:
static void release();
static void setOptions();
- inline void Set_ContextMenuHandler(const wchar_t* handler)
- {
- replaceStrW(wszContextMenuHandler, handler);
- }
-
inline MCONTACT Get_CurrentContact()
{
return hContact;
diff --git a/plugins/IEView/src/external_funcs.cpp b/plugins/IEView/src/external_funcs.cpp
index b7150ff3c9..d01e114458 100644
--- a/plugins/IEView/src/external_funcs.cpp
+++ b/plugins/IEView/src/external_funcs.cpp
@@ -46,15 +46,7 @@ namespace External
return S_OK;
}
- HRESULT IEView_SetContextMenuHandler(IEView *self, DISPPARAMS *pDispParams, VARIANT *pVarResult)
- {
- if (pDispParams == nullptr || pDispParams->cArgs < 1)
- return E_INVALIDARG;
- self->Set_ContextMenuHandler(mir_wstrdup(pDispParams->rgvarg[0].bstrVal));
- return S_OK;
- }
-
- HRESULT IEView_GetCurrentContact(IEView *self, DISPPARAMS *pDispParams, VARIANT *pVarResult)
+ HRESULT IEView_GetCurrentContact(IEView *self, DISPPARAMS*, VARIANT *pVarResult)
{
if (pVarResult != nullptr)
{
@@ -173,7 +165,7 @@ namespace External
return S_OK;
}
- HRESULT win32_CopyToClipboard(DISPPARAMS *pDispParams, VARIANT *pVarResult)
+ HRESULT win32_CopyToClipboard(DISPPARAMS *pDispParams, VARIANT*)
{
if (pDispParams == nullptr || pDispParams->cArgs < 1)
return E_INVALIDARG;
diff --git a/plugins/IEView/src/external_funcs.h b/plugins/IEView/src/external_funcs.h
index 0312c5929e..ede3ec1333 100644
--- a/plugins/IEView/src/external_funcs.h
+++ b/plugins/IEView/src/external_funcs.h
@@ -2,8 +2,7 @@ enum EXTERNAL_FUNCTIONS
{
DISPID_EXTERNAL_CALLSERVICE = 600,
- DISPID_EXTERNAL_SET_CONTEXTMENUHANDLER = 630,
- DISPID_EXTERNAL_GET_CURRENTCONTACT,
+ DISPID_EXTERNAL_GET_CURRENTCONTACT = 630,
DISPID_EXTERNAL_DB_GET = 652,
DISPID_EXTERNAL_DB_SET,
@@ -16,7 +15,6 @@ namespace External
{
HRESULT mir_CallService(DISPPARAMS *pDispParams, VARIANT *pVarResult);
- HRESULT IEView_SetContextMenuHandler(IEView *self, DISPPARAMS *pDispParams, VARIANT *pVarResult);
HRESULT IEView_GetCurrentContact(IEView *self, DISPPARAMS *pDispParams, VARIANT *pVarResult);
HRESULT db_get(DISPPARAMS *pDispParams, VARIANT *pVarResult);