From 4ad5767f652e0ffd3ebf7df8d8f62a682277faa1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 20 Jul 2013 18:37:03 +0000 Subject: - numerous fixes for ineffective xmlGetText() calls; - common picture type detection code extracted to the separate function; - code cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@5431 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber_search.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'protocols/JabberG/src/jabber_search.cpp') diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp index 0366291a25..342e761c2b 100644 --- a/protocols/JabberG/src/jabber_search.cpp +++ b/protocols/JabberG/src/jabber_search.cpp @@ -189,7 +189,7 @@ void CJabberProto::OnIqResultGetSearchFields(HXML iqNode) HXML errorNode = xmlGetChild(iqNode, "error"); if (errorNode) { code = xmlGetAttrValue(errorNode, _T("code")); - description=xmlGetText(errorNode); + description = xmlGetText(errorNode); } _sntprintf(buff,SIZEOF(buff),TranslateT("Error %s %s\r\nPlease select other server"),code ? code : _T(""),description?description:_T("")); SetDlgItemText(searchHandleDlg,IDC_INSTRUCTIONS,buff); @@ -214,7 +214,7 @@ void CJabberProto::SearchReturnResults(HANDLE id, void * pvUsersInfo, U_TCHAR_M U_TCHAR_MAP* pmUserData = (U_TCHAR_MAP*)plUsersInfo->operator [](i); int nUserFields = pmUserData->getCount(); for (int j=0; j < nUserFields; j++) { - TCHAR* var = pmUserData->getKeyName(j); + TCHAR *var = pmUserData->getKeyName(j); if (var && ListOfNonEmptyFields.getIndex(var) < 0) ListOfNonEmptyFields.insert(var); } } @@ -238,7 +238,7 @@ void CJabberProto::SearchReturnResults(HANDLE id, void * pvUsersInfo, U_TCHAR_M /* Sending Columns Titles */ for (i=0; i < nFieldCount; i++) { - TCHAR* var = ListOfFields[i]; + TCHAR *var = ListOfFields[i]; if (var) Results.pszFields[i] = pmAllFields->operator [](var); } @@ -319,8 +319,8 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode) while (HXML fieldNode = xmlGetNthChild(reportNode, _T("field"), i++)) { TCHAR *var = (TCHAR*)xmlGetAttrValue(fieldNode, _T("var")); if (var) { - TCHAR* Label = (TCHAR*)xmlGetAttrValue(fieldNode, _T("label")); - mColumnsNames.insert(var, (Label!=NULL) ? Label : var); + TCHAR *Label = (TCHAR*)xmlGetAttrValue(fieldNode, _T("label")); + mColumnsNames.insert(var, (Label != NULL) ? Label : var); } } } int i=1; @@ -346,7 +346,7 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode) U_TCHAR_MAP *pUserColumn=new U_TCHAR_MAP(10); TCHAR *jid = (TCHAR*)xmlGetAttrValue(itemNode, _T("jid")); - TCHAR* keyReturned; + TCHAR *keyReturned; mColumnsNames.insertCopyKey(_T("jid"),_T("jid"),&keyReturned, CopyKey, DestroyKey); mColumnsNames.insert(_T("jid"), keyReturned); pUserColumn->insertCopyKey(_T("jid"), jid, NULL, CopyKey, DestroyKey); @@ -358,10 +358,11 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode) const TCHAR *szColumnName = xmlGetName(child); if (szColumnName) { - if (xmlGetText(child) && xmlGetText(child)[0] != _T('\0')) { + LPCTSTR ptszChild = xmlGetText(child); + if (ptszChild && *ptszChild) { mColumnsNames.insertCopyKey((TCHAR*)szColumnName,_T(""),&keyReturned, CopyKey, DestroyKey); mColumnsNames.insert((TCHAR*)szColumnName,keyReturned); - pUserColumn->insertCopyKey((TCHAR*)szColumnName, (TCHAR*)xmlGetText(child),NULL, CopyKey, DestroyKey); + pUserColumn->insertCopyKey((TCHAR*)szColumnName, (TCHAR*)ptszChild, NULL, CopyKey, DestroyKey); } } } SearchResults.insert((void*)pUserColumn); -- cgit v1.2.3