summaryrefslogtreecommitdiff
path: root/plugins/IEView/src
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2016-06-29 09:18:52 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2016-06-29 09:18:52 +0000
commit9c9afbb56c8f5ac3e302d0073222e95162513004 (patch)
tree7d1e870eacec1f49d1f8abb7eb707aa105e31407 /plugins/IEView/src
parenta743c7d531c07c1fc2a778d7e15189f124aa6e48 (diff)
IEView: fix(?) avatar path, code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@17042 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/IEView/src')
-rw-r--r--plugins/IEView/src/HTMLBuilder.cpp4
-rw-r--r--plugins/IEView/src/IEView.cpp39
-rw-r--r--plugins/IEView/src/IEView.h2
-rw-r--r--plugins/IEView/src/TemplateHTMLBuilder.cpp6
4 files changed, 5 insertions, 46 deletions
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<IDispatch> 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<IHTMLElement> 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)