summaryrefslogtreecommitdiff
path: root/sfx2/source/control/emojiview.cxx
diff options
context:
space:
mode:
authorAkshay Deep <akshaydeepiitr@gmail.com>2016-12-20 19:10:29 +0530
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2017-03-07 07:05:29 +0000
commit76db789dc777a4888b95d9f6665ce45bd667b957 (patch)
treed9b1ec75c45dfacd9dce3e8d981411381459a221 /sfx2/source/control/emojiview.cxx
parent4f12babf52750bd07ef1a7345a428123cfd0bae5 (diff)
Add Tooltips for emoji toolbar control
Change-Id: I93d9fb1af42d83c7f7f518a1441f4666fd7ee30a Reviewed-on: https://gerrit.libreoffice.org/32231 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sfx2/source/control/emojiview.cxx')
-rw-r--r--sfx2/source/control/emojiview.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/sfx2/source/control/emojiview.cxx b/sfx2/source/control/emojiview.cxx
index ee4eefb04d50..b3e69007debb 100644
--- a/sfx2/source/control/emojiview.cxx
+++ b/sfx2/source/control/emojiview.cxx
@@ -103,7 +103,7 @@ void EmojiView::Populate()
return;
}
- // TODO::populate view using the orcus json parser
+ // Populate view using the orcus json parser
using node = orcus::json_document_tree::node;
// default json config
@@ -126,7 +126,7 @@ void EmojiView::Populate()
{
// iterate each element to get the keys
std::vector<orcus::pstring> aEmojiParams = value.keys();
- OUString sTitle, sCategory;
+ OUString sTitle, sCategory, sName;
bool bDuplicate = false;
for (auto paramIter = aEmojiParams.begin(); paramIter != aEmojiParams.end(); ++paramIter)
@@ -143,18 +143,20 @@ void EmojiView::Populate()
{
sCategory = rtl::OStringToOUString(OString( prop.string_value().get(), prop.string_value().size() ), RTL_TEXTENCODING_UTF8);
}
+ else if(paramVal == "name")
+ {
+ sName = rtl::OStringToOUString(OString( prop.string_value().get(), prop.string_value().size() ), RTL_TEXTENCODING_UTF8);
+ }
else if(paramVal == "duplicate")
{
bDuplicate = true;
}
}
- // TODO: Check whether the glyph is present in the font file
- // If the glyph is present, Call EmojiView::AppendItem() to populate each template as it is parsed
// Don't append if a duplicate emoji
if(!bDuplicate)
{
- AppendItem(sTitle, sCategory);
+ AppendItem(sTitle, sCategory, sName);
}
}
}
@@ -209,12 +211,13 @@ void EmojiView::setInsertEmojiHdl(const Link<ThumbnailViewItem*, void> &rLink)
maInsertEmojiHdl = rLink;
}
-void EmojiView::AppendItem(const OUString &rTitle, const OUString &rCategory)
+void EmojiView::AppendItem(const OUString &rTitle, const OUString &rCategory, const OUString &rName)
{
EmojiViewItem *pItem = new EmojiViewItem(*this, getNextItemId());
pItem->maTitle = rTitle;
pItem->setCategory(rCategory);
+ pItem->setHelpText(rName);
ThumbnailView::AppendItem(pItem);