From 24762a4ffa51b4a392fa5aebe979df675b06335c Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Thu, 14 Jun 2012 21:27:22 +0000 Subject: NewsAggregator: code cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@419 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/NewsAggregator/Src/Utils.cpp | 60 ++++++++++++++++------------------ 1 file changed, 29 insertions(+), 31 deletions(-) (limited to 'protocols/NewsAggregator/Src/Utils.cpp') diff --git a/protocols/NewsAggregator/Src/Utils.cpp b/protocols/NewsAggregator/Src/Utils.cpp index f76e680774..9f84e9983a 100644 --- a/protocols/NewsAggregator/Src/Utils.cpp +++ b/protocols/NewsAggregator/Src/Utils.cpp @@ -420,7 +420,7 @@ time_t __stdcall DateToUnixTime(TCHAR* stamp, BOOL FeedType) return ( time_t ) 0; } -TCHAR* StrReplace (TCHAR* Search, TCHAR* Replace, TCHAR* Resource) +VOID StrReplace(TCHAR* Search, TCHAR* Replace, TCHAR*& Resource) { int i = 0; int SearchLen = (int)_tcslen(Search); @@ -450,8 +450,6 @@ TCHAR* StrReplace (TCHAR* Search, TCHAR* Replace, TCHAR* Resource) Pointer = _tcsstr(Resource + (ResourceLen - PointerLen + ReplaceLen), Search); } mir_free(Work); - - return Resource; } BOOL DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal) @@ -1014,33 +1012,33 @@ VOID CheckCurrentFeed(HANDLE hContact) message = mir_tstrdup(dbMsg.ptszVal); DBFreeVariant(&dbMsg); if (!title) - message = StrReplace(_T("##"), TranslateT("empty"), message); + StrReplace(_T("#<title>#"), TranslateT("empty"), message); else - message = StrReplace(_T("#<title>#"), title, message); + StrReplace(_T("#<title>#"), title, message); if (!link) - message = StrReplace(_T("#<link>#"), TranslateT("empty"), message); + StrReplace(_T("#<link>#"), TranslateT("empty"), message); else - message = StrReplace(_T("#<link>#"), link, message); + StrReplace(_T("#<link>#"), link, message); if (!descr) - message = StrReplace(_T("#<description>#"), TranslateT("empty"), message); + StrReplace(_T("#<description>#"), TranslateT("empty"), message); else - message = StrReplace(_T("#<description>#"), descr, message); + StrReplace(_T("#<description>#"), descr, message); if (!author) - message = StrReplace(_T("#<author>#"), TranslateT("empty"), message); + StrReplace(_T("#<author>#"), TranslateT("empty"), message); else - message = StrReplace(_T("#<author>#"), author, message); + StrReplace(_T("#<author>#"), author, message); if (!comments) - message = StrReplace(_T("#<comments>#"), TranslateT("empty"), message); + StrReplace(_T("#<comments>#"), TranslateT("empty"), message); else - message = StrReplace(_T("#<comments>#"), comments, message); + StrReplace(_T("#<comments>#"), comments, message); if (!guid) - message = StrReplace(_T("#<guid>#"), TranslateT("empty"), message); + StrReplace(_T("#<guid>#"), TranslateT("empty"), message); else - message = StrReplace(_T("#<guid>#"), guid, message); + StrReplace(_T("#<guid>#"), guid, message); if (!category) - message = StrReplace(_T("#<category>#"), TranslateT("empty"), message); + StrReplace(_T("#<category>#"), TranslateT("empty"), message); else - message = StrReplace(_T("#<category>#"), category, message); + StrReplace(_T("#<category>#"), category, message); ClearText(message); char* pszUtf; @@ -1348,46 +1346,46 @@ VOID CheckCurrentFeed(HANDLE hContact) DBFreeVariant(&dbMsg); if (!title) - message = StrReplace(_T("#<title>#"), TranslateT("empty"), message); + StrReplace(_T("#<title>#"), TranslateT("empty"), message); else { - message = StrReplace(_T("#<title>#"), title, message); + StrReplace(_T("#<title>#"), title, message); mir_free(title); } if (!link) - message = StrReplace(_T("#<link>#"), TranslateT("empty"), message); + StrReplace(_T("#<link>#"), TranslateT("empty"), message); else - message = StrReplace(_T("#<link>#"), link, message); + StrReplace(_T("#<link>#"), link, message); if (!descr) - message = StrReplace(_T("#<description>#"), TranslateT("empty"), message); + StrReplace(_T("#<description>#"), TranslateT("empty"), message); else { - message = StrReplace(_T("#<description>#"), descr, message); + StrReplace(_T("#<description>#"), descr, message); mir_free(descr); } if (!author) - message = StrReplace(_T("#<author>#"), TranslateT("empty"), message); + StrReplace(_T("#<author>#"), TranslateT("empty"), message); else { - message = StrReplace(_T("#<author>#"), author, message); + StrReplace(_T("#<author>#"), author, message); mir_free(author); } if (!comments) - message = StrReplace(_T("#<comments>#"), TranslateT("empty"), message); + StrReplace(_T("#<comments>#"), TranslateT("empty"), message); else { - message = StrReplace(_T("#<comments>#"), comments, message); + StrReplace(_T("#<comments>#"), comments, message); mir_free(comments); } if (!guid) - message = StrReplace(_T("#<guid>#"), TranslateT("empty"), message); + StrReplace(_T("#<guid>#"), TranslateT("empty"), message); else - message = StrReplace(_T("#<guid>#"), guid, message); + StrReplace(_T("#<guid>#"), guid, message); if (!category) - message = StrReplace(_T("#<category>#"), TranslateT("empty"), message); + StrReplace(_T("#<category>#"), TranslateT("empty"), message); else { - message = StrReplace(_T("#<category>#"), category, message); + StrReplace(_T("#<category>#"), category, message); mir_free(category); } -- cgit v1.2.3