From 9c9afbb56c8f5ac3e302d0073222e95162513004 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Wed, 29 Jun 2016 09:18:52 +0000 Subject: IEView: fix(?) avatar path, code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@17042 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/IEView/src/HTMLBuilder.cpp | 4 +-- plugins/IEView/src/IEView.cpp | 39 ------------------------------ plugins/IEView/src/IEView.h | 2 -- plugins/IEView/src/TemplateHTMLBuilder.cpp | 6 ++--- 4 files changed, 5 insertions(+), 46 deletions(-) (limited to 'plugins') diff --git a/plugins/IEView/src/HTMLBuilder.cpp b/plugins/IEView/src/HTMLBuilder.cpp index c80d259648..2833d432de 100644 --- a/plugins/IEView/src/HTMLBuilder.cpp +++ b/plugins/IEView/src/HTMLBuilder.cpp @@ -185,10 +185,10 @@ void HTMLBuilder::getUINs(MCONTACT hContact, char *&uinIn, char *&uinOut) hContact = getRealContact(hContact); ptrT id(Contact_GetInfo(CNF_UNIQUEID, hContact)); - uinIn = mir_utf8encodeT((id != NULL) ? id : _T("")); + uinIn = mir_utf8encodeT(id ? id.get() : _T("")); id = Contact_GetInfo(CNF_UNIQUEID, NULL); - uinOut = mir_utf8encodeT((id != NULL) ? id : _T("")); + uinOut = mir_utf8encodeT(id ? id.get() : _T("")); } wchar_t* HTMLBuilder::getContactName(MCONTACT hContact, const char *szProto) diff --git a/plugins/IEView/src/IEView.cpp b/plugins/IEView/src/IEView.cpp index a2752826f9..d57f9c8582 100644 --- a/plugins/IEView/src/IEView.cpp +++ b/plugins/IEView/src/IEView.cpp @@ -1140,43 +1140,4 @@ void IEView::navigate(IEVIEWNAVIGATE *nav) navigate(nav->urlW); else navigate(nav->url); -} - -VARIANT IEView::CallJScript(const CMString strFunc, size_t nPCount, const CMString strArgs, ...) -{ - VARIANT vaResult = { 0 }; - CComPtr spScript; - if (FAILED(getDocument()->get_Script(&spScript))) return vaResult; - - BSTR bstrMember(SysAllocString(strFunc)); - DISPID dispid = NULL; - - HRESULT hr = spScript->GetIDsOfNames(IID_NULL, &bstrMember, 1, LOCALE_SYSTEM_DEFAULT, &dispid); - if (FAILED(hr)) return vaResult; - - va_list(args); - va_start(args, strArgs); - - DISPPARAMS dispparams; - memset(&dispparams, 0, sizeof dispparams); - dispparams.cArgs = (UINT)nPCount; - dispparams.rgvarg = new VARIANT[dispparams.cArgs]; - dispparams.cNamedArgs = 0; - - for (size_t i = 0; i < nPCount; i++) - { - dispparams.rgvarg[i].bstrVal = SysAllocString(va_arg(args, CMString)); - dispparams.rgvarg[i].vt = VT_BSTR; - } - - EXCEPINFO excepInfo = { 0 }; - - UINT nArgErr = (UINT)-1; - - hr = spScript->Invoke(dispid, IID_NULL, 0, DISPATCH_METHOD, &dispparams, &vaResult, &excepInfo, &nArgErr); - - for (size_t i = 0; i < nPCount; i++) SysFreeString(dispparams.rgvarg[i].bstrVal); - - delete[] dispparams.rgvarg; - return vaResult; } \ No newline at end of file diff --git a/plugins/IEView/src/IEView.h b/plugins/IEView/src/IEView.h index f57dff663b..85bb5cf297 100644 --- a/plugins/IEView/src/IEView.h +++ b/plugins/IEView/src/IEView.h @@ -508,8 +508,6 @@ private: STDMETHOD(SetZoneMapping)(DWORD dwZone, LPCWSTR lpszPattern, DWORD dwFlags); STDMETHOD(GetZoneMappings)(DWORD dwZone, IEnumString **ppenumString, DWORD dwFlags); - VARIANT CallJScript(const CMString strFunc, size_t nPCount, const CMString strArgs, ...); - IHTMLDocument2 *getDocument(); WCHAR* getHrefFromAnchor(CComPtr element); WCHAR* getSelection(); diff --git a/plugins/IEView/src/TemplateHTMLBuilder.cpp b/plugins/IEView/src/TemplateHTMLBuilder.cpp index 4ace2ae70b..9be18d0f3e 100644 --- a/plugins/IEView/src/TemplateHTMLBuilder.cpp +++ b/plugins/IEView/src/TemplateHTMLBuilder.cpp @@ -301,9 +301,9 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, char* pathrun = nullptr; if (pathrun = strrchr(tempBase, '\\')) - ++pathrun = '\0'; + *(++pathrun) = '\0'; else if (pathrun = strrchr(tempBase, '/')) - ++pathrun = '\0'; + *(++pathrun) = '\0'; isGrouping = tmpm->isGrouping(); } @@ -404,7 +404,7 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, else szFileDesc = encodeUTF8(event->hContact, szRealProto, eventData->pszText2, event->codepage, 0, isSent); - if ((eventData->iType == IEED_EVENT_MESSAGE)) { + if (eventData->iType == IEED_EVENT_MESSAGE) { if (!isRTL) { if (isGrouping && (getFlags(protoSettings) & Options::LOG_GROUP_MESSAGES)) { if (isGroupBreak) -- cgit v1.2.3