diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-06-14 21:27:22 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-06-14 21:27:22 +0000 |
commit | 24762a4ffa51b4a392fa5aebe979df675b06335c (patch) | |
tree | a0c6c15091f0c27129b675fadd3f8a252ff4eaef | |
parent | 017bb0233c3495eb6b441f5adbfb864f8ac93dce (diff) |
NewsAggregator:
code cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@419 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | protocols/NewsAggregator/Src/Utils.cpp | 60 |
1 files changed, 29 insertions, 31 deletions
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("#<title>#"), 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);
}
|