[Libreoffice-commits] core.git: include/sfx2 sfx2/source
Akshay Deep
akshaydeepiitr at gmail.com
Tue Mar 7 07:06:08 UTC 2017
include/sfx2/emojiview.hxx | 2 +-
sfx2/source/control/emojicontrol.cxx | 1 +
sfx2/source/control/emojiview.cxx | 15 +++++++++------
3 files changed, 11 insertions(+), 7 deletions(-)
New commits:
commit 76db789dc777a4888b95d9f6665ce45bd667b957
Author: Akshay Deep <akshaydeepiitr at gmail.com>
Date: Tue Dec 20 19:10:29 2016 +0530
Add Tooltips for emoji toolbar control
Change-Id: I93d9fb1af42d83c7f7f518a1441f4666fd7ee30a
Reviewed-on: https://gerrit.libreoffice.org/32231
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
diff --git a/include/sfx2/emojiview.hxx b/include/sfx2/emojiview.hxx
index 1b0d0ac..1085d4d 100644
--- a/include/sfx2/emojiview.hxx
+++ b/include/sfx2/emojiview.hxx
@@ -64,7 +64,7 @@ public:
void setInsertEmojiHdl (const Link<ThumbnailViewItem*, void> &rLink);
- void AppendItem(const OUString &rTitle, const OUString &rCategory );
+ void AppendItem(const OUString &rTitle, const OUString &rCategory, const OUString &rName );
protected:
virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
diff --git a/sfx2/source/control/emojicontrol.cxx b/sfx2/source/control/emojicontrol.cxx
index be6e570..316a37f 100644
--- a/sfx2/source/control/emojicontrol.cxx
+++ b/sfx2/source/control/emojicontrol.cxx
@@ -100,6 +100,7 @@ SfxEmojiControl::SfxEmojiControl(sal_uInt16 nId, const css::uno::Reference< css:
mpEmojiView->setInsertEmojiHdl(LINK(this, SfxEmojiControl, InsertHdl));
mpEmojiView->Show();
+ mpEmojiView->ShowTooltips(true);
mpTabControl->SetActivatePageHdl(LINK(this, SfxEmojiControl, ActivatePageHdl));
}
diff --git a/sfx2/source/control/emojiview.cxx b/sfx2/source/control/emojiview.cxx
index ee4eefb..b3e6900 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);
More information about the Libreoffice-commits
mailing list