From 9b119cadd74e1343cad493e8b366e69743a620d0 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sun, 21 Dec 2014 09:49:05 +0000 Subject: Quotes: changed warning level to w4 git-svn-id: http://svn.miranda-ng.org/main/trunk@11552 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Quotes/src/HTMLParserMS.cpp | 102 ++++++++++++++++++------------------ 1 file changed, 51 insertions(+), 51 deletions(-) (limited to 'plugins/Quotes/src/HTMLParserMS.cpp') diff --git a/plugins/Quotes/src/HTMLParserMS.cpp b/plugins/Quotes/src/HTMLParserMS.cpp index 86b9c7d933..bdc6316ab6 100644 --- a/plugins/Quotes/src/HTMLParserMS.cpp +++ b/plugins/Quotes/src/HTMLParserMS.cpp @@ -14,19 +14,19 @@ namespace typedef CComPtr TElementCollectionPtr; public: - CHTMLNode(const TComPtr& pElement,const TDocumentPtr& pDocument) - : m_pElement(pElement),m_pDocument(pDocument){} + CHTMLNode(const TComPtr& pElement, const TDocumentPtr& pDocument) + : m_pElement(pElement), m_pDocument(pDocument){} virtual THTMLNodePtr GetElementByID(const tstring& rsID)const { - if(m_pDocument) + if (m_pDocument) { CComPtr pElement; - if(SUCCEEDED(m_pDocument->getElementById(bstr_t(rsID.c_str()),&pElement)) + if (SUCCEEDED(m_pDocument->getElementById(bstr_t(rsID.c_str()), &pElement)) && pElement) { TComPtr p(pElement); - return THTMLNodePtr(new CHTMLNode(p,m_pDocument)); + return THTMLNodePtr(new CHTMLNode(p, m_pDocument)); } } @@ -36,15 +36,15 @@ namespace virtual size_t GetChildCount()const { TElementCollectionPtr pColl = GetElementCollectionPtr(); - if(pColl) + if (pColl) { LONG celem = 0; HRESULT hr = pColl->get_length(&celem); - if(S_OK == hr) + if (S_OK == hr) { return celem; } - } + } return 0; } @@ -52,7 +52,7 @@ namespace virtual THTMLNodePtr GetChildPtr(size_t nIndex) { TElementCollectionPtr pColl = GetElementCollectionPtr(); - if(pColl) + if (pColl) { VARIANT varIndex; varIndex.vt = VT_UINT; @@ -60,10 +60,10 @@ namespace VARIANT var2; VariantInit(&var2); TComPtr pDisp; - HRESULT hr = pColl->item(varIndex,var2,&pDisp); - if(S_OK == hr && pDisp) + HRESULT hr = pColl->item(varIndex, var2, &pDisp); + if (S_OK == hr && pDisp) { - return THTMLNodePtr(new CHTMLNode(pDisp,m_pDocument)); + return THTMLNodePtr(new CHTMLNode(pDisp, m_pDocument)); } } @@ -72,23 +72,23 @@ namespace virtual bool Is(EType nType)const { - switch(nType) + switch (nType) { case Table: - { - CComPtr pTable; - return (SUCCEEDED(m_pElement->QueryInterface(IID_IHTMLTable,reinterpret_cast(&pTable))) && (pTable)); - } + { + CComPtr pTable; + return (SUCCEEDED(m_pElement->QueryInterface(IID_IHTMLTable, reinterpret_cast(&pTable))) && (pTable)); + } case TableRow: - { - CComPtr pRow; - return (SUCCEEDED(m_pElement->QueryInterface(IID_IHTMLTableRow,reinterpret_cast(&pRow))) && (pRow)); - } + { + CComPtr pRow; + return (SUCCEEDED(m_pElement->QueryInterface(IID_IHTMLTableRow, reinterpret_cast(&pRow))) && (pRow)); + } case TableColumn: - { - CComPtr pCol; - return (SUCCEEDED(m_pElement->QueryInterface(IID_IHTMLTableCol,reinterpret_cast(&pCol))) && (pCol)); - } + { + CComPtr pCol; + return (SUCCEEDED(m_pElement->QueryInterface(IID_IHTMLTableCol, reinterpret_cast(&pCol))) && (pCol)); + } } return false; @@ -100,23 +100,23 @@ namespace tstring sAttr; CComPtr pElement; - if(SUCCEEDED(m_pElement->QueryInterface(IID_IHTMLElement,reinterpret_cast(&pElement))) && pElement) + if (SUCCEEDED(m_pElement->QueryInterface(IID_IHTMLElement, reinterpret_cast(&pElement))) && pElement) { _variant_t vAttribute; BSTR pbstrAttrName = T2BSTR(rsAttrName.c_str()); - if(SUCCEEDED(pElement->getAttribute(pbstrAttrName,1,&vAttribute)) + if (SUCCEEDED(pElement->getAttribute(pbstrAttrName, 1, &vAttribute)) && VT_NULL != vAttribute.vt && VT_EMPTY != vAttribute.vt) { try { _bstr_t b(vAttribute); LPCTSTR psz = b; - if(psz) + if (psz) { sAttr = psz; } } - catch(_com_error&) + catch (_com_error&) { } } @@ -127,20 +127,20 @@ namespace virtual tstring GetText()const { -// USES_CONVERSION; + // USES_CONVERSION; tstring sText; CComPtr pElement; - if(SUCCEEDED(m_pElement->QueryInterface(IID_IHTMLElement,reinterpret_cast(&pElement))) && pElement) + if (SUCCEEDED(m_pElement->QueryInterface(IID_IHTMLElement, reinterpret_cast(&pElement))) && pElement) { BSTR bstrText; - if(SUCCEEDED(pElement->get_innerText(&bstrText)) && bstrText) + if (SUCCEEDED(pElement->get_innerText(&bstrText)) && bstrText) { try { sText = _bstr_t(bstrText); } - catch(_com_error&) + catch (_com_error&) { } @@ -155,16 +155,16 @@ namespace virtual TElementCollectionPtr GetElementCollectionPtr()const { TElementCollectionPtr pColl; - HRESULT hr = m_pElement->QueryInterface(IID_IHTMLElementCollection,reinterpret_cast(&pColl)); - if(FAILED(hr)) + HRESULT hr = m_pElement->QueryInterface(IID_IHTMLElementCollection, reinterpret_cast(&pColl)); + if (FAILED(hr)) { CComPtr pElement; - if(SUCCEEDED(m_pElement->QueryInterface(IID_IHTMLElement,reinterpret_cast(&pElement))) && pElement) + if (SUCCEEDED(m_pElement->QueryInterface(IID_IHTMLElement, reinterpret_cast(&pElement))) && pElement) { CComPtr pDisp; - if(SUCCEEDED(pElement->get_children(&pDisp)) && pDisp) + if (SUCCEEDED(pElement->get_children(&pDisp)) && pDisp) { - hr = pDisp->QueryInterface(IID_IHTMLElementCollection,reinterpret_cast(&pColl)); + hr = pDisp->QueryInterface(IID_IHTMLElementCollection, reinterpret_cast(&pColl)); } } } @@ -203,22 +203,22 @@ CHTMLParserMS::CHTMLParserMS() : m_bCallUninit(false) _com_util::CheckError(m_pDoc->QueryInterface(IID_IMarkupServices, (LPVOID*)&m_pMS)); - if(m_pMS) + if (m_pMS) { _com_util::CheckError(m_pMS->CreateMarkupPointer(&m_pMkStart)); _com_util::CheckError(m_pMS->CreateMarkupPointer(&m_pMkFinish)); } } - catch(_com_error&/* e*/) + catch (_com_error&/* e*/) { -// show_com_error_msg(e); + // show_com_error_msg(e); } } CHTMLParserMS::~CHTMLParserMS() { - if(true == m_bCallUninit) + if (true == m_bCallUninit) { ::CoUninitialize(); } @@ -234,31 +234,31 @@ CHTMLParserMS::THTMLNodePtr CHTMLParserMS::ParseString(const tstring& rsHTML) OLECHAR* p = T2OLE(const_cast(rsHTML.c_str())); CComPtr pMC; - _com_util::CheckError(m_pMS->ParseString(p,0,&pMC,m_pMkStart,m_pMkFinish)); + _com_util::CheckError(m_pMS->ParseString(p, 0, &pMC, m_pMkStart, m_pMkFinish)); - if(pMC) + if (pMC) { CComPtr pNewDoc; _com_util::CheckError(pMC->QueryInterface(IID_IHTMLDocument, (LPVOID*)&pNewDoc)); - if(pNewDoc) + if (pNewDoc) { CComPtr pColl; _com_util::CheckError(pNewDoc->get_all(&pColl)); CHTMLNode::TDocumentPtr pDoc; - pMC->QueryInterface(IID_IHTMLDocument3,(LPVOID*)&pDoc); + pMC->QueryInterface(IID_IHTMLDocument3, (LPVOID*)&pDoc); - return THTMLNodePtr(new CHTMLNode(CHTMLNode::TComPtr(pColl),pDoc)); + return THTMLNodePtr(new CHTMLNode(CHTMLNode::TComPtr(pColl), pDoc)); } } } - catch(_com_error&/* e*/) + catch (_com_error&/* e*/) { -// show_com_error_msg(e); + // show_com_error_msg(e); } return THTMLNodePtr(); @@ -283,12 +283,12 @@ bool CHTMLParserMS::IsInstalled() reinterpret_cast(&pDoc)) ); } - catch(_com_error&/* e*/) + catch (_com_error&/* e*/) { bResult = false; } - if(bCallUninit) + if (bCallUninit) { ::CoUninitialize(); } -- cgit v1.2.3