summaryrefslogtreecommitdiff
path: root/plugins/SmileyAdd
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-02-14 19:49:00 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-02-14 19:49:00 +0300
commita1e08d59a3a7c4b4831216afa755c4e0579b2ed7 (patch)
tree0de8c7596fb27e0c7856011412beef9383ac87c2 /plugins/SmileyAdd
parent4fd7e4b563949b0f82d4e5fc81727af2de38da31 (diff)
added operator[] for XMLConstHandle & XMLHandle, making Xpath much shorter
Diffstat (limited to 'plugins/SmileyAdd')
-rw-r--r--plugins/SmileyAdd/src/smileys.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp
index 56e0c144b7..b661ce2f0c 100644
--- a/plugins/SmileyAdd/src/smileys.cpp
+++ b/plugins/SmileyAdd/src/smileys.cpp
@@ -438,11 +438,7 @@ bool SmileyPackType::LoadSmileyFileXEP(const CMStringW &fileName, bool onlyInfo)
}
if (!onlyInfo) {
- auto *pDataRoot = doc.FirstChildElement("dataroot");
- if (pDataRoot == nullptr)
- return false;
-
- auto *pImages = tinyxml2::XMLConstHandle(&doc).FirstChildElement("lists").FirstChildElement("images").ToElement();
+ auto *pImages = TiXmlConst(&doc)["lists"]["images"].ToElement();
if (pImages) {
IStream *pStream = DecodeBase64Data(pImages->GetText());
if (pStream) {
@@ -453,7 +449,7 @@ bool SmileyPackType::LoadSmileyFileXEP(const CMStringW &fileName, bool onlyInfo)
}
}
- for (auto *nRec : TiXmlFilter(pDataRoot, "record")) {
+ for (auto *nRec : TiXmlFilter(doc.FirstChildElement("dataroot"), "record")) {
int idx = nRec->IntAttribute("ImageIndex", -1);
if (idx == -1)
continue;