diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-15 09:39:14 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-15 13:54:53 +0200 |
commit | 46ce0d28b4c765076c7871358375c4e85e44534b (patch) | |
tree | b17378d5258a51185001eac455a764897e6dda11 /vbahelper | |
parent | 00f7309fb786efcc0bbca04fb29de80f275a16ba (diff) |
loplugin:stringliteralvar look for assignments
to O[U]String from char array literals, we can convert the char literals
to O[U]StringLiteral and avoid a runtime allocation
Change-Id: I15d8dddb2cd428b90740e39f20daf98e0941aa6d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114125
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vbahelper')
-rw-r--r-- | vbahelper/source/vbahelper/vbacommandbarhelper.hxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.hxx b/vbahelper/source/vbahelper/vbacommandbarhelper.hxx index cdd44c6ca09c..8eda1dbafc3e 100644 --- a/vbahelper/source/vbahelper/vbacommandbarhelper.hxx +++ b/vbahelper/source/vbahelper/vbacommandbarhelper.hxx @@ -27,17 +27,17 @@ #include <com/sun/star/frame/XLayoutManager.hpp> #include <memory> -const char ITEM_DESCRIPTOR_COMMANDURL[] = "CommandURL"; -const char ITEM_DESCRIPTOR_HELPURL[] = "HelpURL"; +inline constexpr OUStringLiteral ITEM_DESCRIPTOR_COMMANDURL = u"CommandURL"; +inline constexpr OUStringLiteral ITEM_DESCRIPTOR_HELPURL = u"HelpURL"; inline constexpr OUStringLiteral ITEM_DESCRIPTOR_CONTAINER = u"ItemDescriptorContainer"; inline constexpr OUStringLiteral ITEM_DESCRIPTOR_LABEL = u"Label"; -const char ITEM_DESCRIPTOR_TYPE[] = "Type"; -const char ITEM_DESCRIPTOR_STYLE[] = "Style"; +inline constexpr OUStringLiteral ITEM_DESCRIPTOR_TYPE = u"Type"; +inline constexpr OUStringLiteral ITEM_DESCRIPTOR_STYLE = u"Style"; inline constexpr OUStringLiteral ITEM_DESCRIPTOR_ISVISIBLE = u"IsVisible"; inline constexpr OUStringLiteral ITEM_DESCRIPTOR_UINAME = u"UIName"; inline constexpr OUStringLiteral ITEM_DESCRIPTOR_ENABLED = u"Enabled"; -const char ITEM_MENUBAR_URL[] = "private:resource/menubar/menubar"; +inline constexpr OUStringLiteral ITEM_MENUBAR_URL = u"private:resource/menubar/menubar"; constexpr char16_t ITEM_TOOLBAR_URL[] = u"private:resource/toolbar/"; const char CUSTOM_TOOLBAR_STR[] = "custom_toolbar_"; |