summaryrefslogtreecommitdiff
path: root/sfx2/source/control/emojiview.cxx
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2018-02-06 19:25:01 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-02-07 06:30:31 +0100
commit9751a273747a2a6ba80c8b2e6012d788eee7c461 (patch)
tree8c22066aea5baffa7427e6374f447a6f5dd0421a /sfx2/source/control/emojiview.cxx
parentf0c171a1dd2698f5bec14f5cf00136477032c202 (diff)
Use for-range loops in sfx2 (part1)
Change-Id: I1a06e105ca9f1151afca236c83e3e0c9d2679c6f Reviewed-on: https://gerrit.libreoffice.org/49318 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/control/emojiview.cxx')
-rw-r--r--sfx2/source/control/emojiview.cxx16
1 files changed, 7 insertions, 9 deletions
diff --git a/sfx2/source/control/emojiview.cxx b/sfx2/source/control/emojiview.cxx
index 0a572449c61d..a5e002a608e1 100644
--- a/sfx2/source/control/emojiview.cxx
+++ b/sfx2/source/control/emojiview.cxx
@@ -117,9 +117,8 @@ void EmojiView::Populate()
node root = aEmojiInfo.get_document_root();
std::vector<orcus::pstring> keys = root.keys();
- for (auto it = keys.begin(), ite = keys.end(); it != ite; ++it)
+ for (auto const& key : keys)
{
- orcus::pstring key = *it;
node value = root.child(key);
if(value.type() == orcus::json::node_t::object)
@@ -129,25 +128,24 @@ void EmojiView::Populate()
OUString sTitle, sCategory, sName;
bool bDuplicate = false;
- for (auto paramIter = aEmojiParams.begin(); paramIter != aEmojiParams.end(); ++paramIter)
+ for (auto const& emojiParam : aEmojiParams)
{
- orcus::pstring paramVal = *paramIter;
- node prop = value.child(paramVal);
+ node prop = value.child(emojiParam);
// get values of parameters in AppendItem() function
- if(paramVal == "unicode")
+ if(emojiParam == "unicode")
{
sTitle = rtl::OStringToOUString(OString( prop.string_value().get(), prop.string_value().size() ), RTL_TEXTENCODING_UTF8);
}
- else if(paramVal == "category")
+ else if(emojiParam == "category")
{
sCategory = rtl::OStringToOUString(OString( prop.string_value().get(), prop.string_value().size() ), RTL_TEXTENCODING_UTF8);
}
- else if(paramVal == "name")
+ else if(emojiParam == "name")
{
sName = rtl::OStringToOUString(OString( prop.string_value().get(), prop.string_value().size() ), RTL_TEXTENCODING_UTF8);
}
- else if(paramVal == "duplicate")
+ else if(emojiParam == "duplicate")
{
bDuplicate = true;
}