summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2021-09-04 22:00:51 +0200
committerJulien Nabet <serval2412@yahoo.fr>2021-09-05 08:05:04 +0200
commit37357e3cae749c54f1b9645c6670240baf860bc4 (patch)
treed4d2154252cd9c31e80f980a01c3f0dcb82cc212
parentc76e58ddb62c37a4091b37444939c471f9bab66f (diff)
tdf#105689: fix path management to retrieve Emoji toolbar button
On Windows console logs show: warn:sfx:7060:6444:sfx2/source/control/emojiview.cxx:105: Emoji config data is empty Change-Id: I85baf2fedc20ff855183147e9a178bb048ac75ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121653 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
-rw-r--r--sfx2/source/control/emojiview.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/sfx2/source/control/emojiview.cxx b/sfx2/source/control/emojiview.cxx
index e5bebe9f8f3b..7475263044e2 100644
--- a/sfx2/source/control/emojiview.cxx
+++ b/sfx2/source/control/emojiview.cxx
@@ -7,6 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include <osl/file.hxx>
#include <emojiview.hxx>
#include <emojiviewitem.hxx>
#include <rtl/bootstrap.hxx>
@@ -66,9 +67,12 @@ EmojiView::EmojiView(std::unique_ptr<weld::ScrolledWindow> xWindow)
: ThumbnailView(std::move(xWindow), nullptr)
{
// locate json data file
- OUString sPath("$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER "/emojiconfig/emoji.json");
- rtl::Bootstrap::expandMacros(sPath);
- std::string strPath = OUStringToOString(sPath.subView(strlen("file://")), RTL_TEXTENCODING_UTF8).getStr();
+ OUString aURL("$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER "/emojiconfig/emoji.json");
+ rtl::Bootstrap::expandMacros(aURL);
+
+ OUString aPath;
+ osl::FileBase::getSystemPathFromFileURL(aURL, aPath);
+ std::string strPath = OUStringToOString(aPath, RTL_TEXTENCODING_UTF8).getStr();
std::ifstream file(strPath);
if(!file.is_open())