diff options
author | George Hazan <george.hazan@gmail.com> | 2015-04-19 21:12:24 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-04-19 21:12:24 +0000 |
commit | 23da585729242bc135e7a6da0dc5bf699e6c9b54 (patch) | |
tree | d9588a9288ed88c36979d4d92538f3641796e2af /plugins/IEView/src/Template.cpp | |
parent | 26ec77c0e1b49ac1dc002acc4da767d9de8e9703 (diff) |
- all strings operations were rewritten using CMString instead of ugly self-made buffers;
- CComPtr<> introduced to simplify COM calls processing;
- version bump.
git-svn-id: http://svn.miranda-ng.org/main/trunk@12946 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/IEView/src/Template.cpp')
-rw-r--r-- | plugins/IEView/src/Template.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/plugins/IEView/src/Template.cpp b/plugins/IEView/src/Template.cpp index 8c9d8e7acb..fbf87fc871 100644 --- a/plugins/IEView/src/Template.cpp +++ b/plugins/IEView/src/Template.cpp @@ -354,8 +354,7 @@ TemplateMap* TemplateMap::loadTemplateFile(const char *id, const char *filename, char store[4096];
bool wasTemplate = false;
- char *templateText = NULL;
- int templateTextSize = 0;
+ CMStringA templateText;
while (fgets(store, sizeof(store), fh) != NULL) {
if (sscanf(store, "%s", tmp2) == EOF) continue;
//template start
@@ -370,19 +369,16 @@ TemplateMap* TemplateMap::loadTemplateFile(const char *id, const char *filename, if (wasTemplate)
tmap->addTemplate(lastTemplate, templateText);
- if (templateText)
- free(templateText), templateText = NULL;
- templateTextSize = 0;
+ templateText.Empty();
wasTemplate = true;
sscanf(store, "<!--%[^-]", lastTemplate);
}
else if (wasTemplate)
- Utils::appendText(&templateText, &templateTextSize, "%s", store);
+ templateText.Append(store);
}
if (wasTemplate)
tmap->addTemplate(lastTemplate, templateText);
- if (templateText)
- free(templateText), templateText = NULL;
+ templateText.Empty();
fclose(fh);
static const char *groupTemplates[] = { "MessageInGroupStart", "MessageInGroupInner",
|