From 5b21c91fecb2be729152908841474a3d980b45f0 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Fri, 26 Jun 2015 12:55:29 +0000 Subject: SkypeWeb: unused code removed. git-svn-id: http://svn.miranda-ng.org/main/trunk@14396 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_utils.cpp | 98 ---------------------------------- 1 file changed, 98 deletions(-) (limited to 'protocols/SkypeWeb/src/skype_utils.cpp') diff --git a/protocols/SkypeWeb/src/skype_utils.cpp b/protocols/SkypeWeb/src/skype_utils.cpp index 62370071af..1647d57682 100644 --- a/protocols/SkypeWeb/src/skype_utils.cpp +++ b/protocols/SkypeWeb/src/skype_utils.cpp @@ -667,104 +667,6 @@ INT_PTR CSkypeProto::GlobalParseSkypeUriService(WPARAM wParam, LPARAM lParam) return 1; } -LPCTSTR CSkypeProto::ClearText(CMString &result, const TCHAR *message) -{ - BSTR bstrHtml = SysAllocString(message), bstrRes = SysAllocString(_T("")); - HRESULT hr = TestMarkupServices(bstrHtml, &TestDocumentText, bstrRes); - if (SUCCEEDED(hr)) - result = bstrRes; - else - result = message; - SysFreeString(bstrHtml); - SysFreeString(bstrRes); - - return result; -} - -HRESULT TestDocumentText(IHTMLDocument3 *pHtmlDoc, BSTR &message) -{ - IHTMLDocument2 *pDoc = NULL; - IHTMLElement *pElem = NULL; - BSTR bstrId = SysAllocString(L"test"); - - HRESULT hr = pHtmlDoc->QueryInterface(IID_PPV_ARGS(&pDoc)); - if (SUCCEEDED(hr) && pDoc) { - hr = pDoc->get_body(&pElem); - if (SUCCEEDED(hr) && pElem) { - BSTR bstrText = NULL; - pElem->get_innerText(&bstrText); - message = SysAllocString(bstrText); - SysFreeString(bstrText); - pElem->Release(); - } - - pDoc->Release(); - } - - SysFreeString(bstrId); - return hr; -} - - - -HRESULT TestMarkupServices(BSTR bstrHtml, MarkupCallback *pCallback, BSTR &message) -{ - IHTMLDocument3 *pHtmlDocRoot = NULL; - - // Create the root document -- a "workspace" for parsing. - HRESULT hr = CoCreateInstance(CLSID_HTMLDocument, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pHtmlDocRoot)); - if (SUCCEEDED(hr) && pHtmlDocRoot) { - IPersistStreamInit *pPersistStreamInit = NULL; - - HRESULT hr = pHtmlDocRoot->QueryInterface(IID_PPV_ARGS(&pPersistStreamInit)); - if (SUCCEEDED(hr)) { - // Initialize the root document to a default state -- ready for parsing. - pPersistStreamInit->InitNew(); - - IMarkupServices *pMarkupServices = NULL; - hr = pHtmlDocRoot->QueryInterface(IID_PPV_ARGS(&pMarkupServices)); - if (SUCCEEDED(hr)) { - IMarkupPointer *pMarkupBegin = NULL; - IMarkupPointer *pMarkupEnd = NULL; - - // These markup pointers indicate the insertion point. - hr = pMarkupServices->CreateMarkupPointer(&pMarkupBegin); - if (SUCCEEDED(hr)) - hr = pMarkupServices->CreateMarkupPointer(&pMarkupEnd); - - if (SUCCEEDED(hr) && pMarkupBegin && pMarkupEnd) { - IMarkupContainer *pMarkupContainer = NULL; - - // Parse the string -- the markup container contains the parsed HTML. - // Markup pointers are updated to point to begining and end of new container. - hr = pMarkupServices->ParseString(bstrHtml, 0, &pMarkupContainer, pMarkupBegin, pMarkupEnd); - if (SUCCEEDED(hr) && pMarkupContainer) { - IHTMLDocument3 *pHtmlDoc = NULL; - - // Retrieve the document interface to the markup container. - hr = pMarkupContainer->QueryInterface(IID_PPV_ARGS(&pHtmlDoc)); - if (SUCCEEDED(hr) && pHtmlDoc) { - // Invoke the user-defined action for this new fragment. - hr = pCallback(pHtmlDoc, message); - - // Clean up. - pHtmlDoc->Release(); - } - pMarkupContainer->Release(); - } - pMarkupEnd->Release(); - } - if (pMarkupBegin) - pMarkupBegin->Release(); - pMarkupServices->Release(); - } - pPersistStreamInit->Release(); - } - pHtmlDocRoot->Release(); - } - return hr; -} - void CSkypeProto::ProcessTimer() { if (IsOnline()) -- cgit v1.2.3