summaryrefslogtreecommitdiff
path: root/sfx2/source/sidebar/SidebarController.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-05-14 14:56:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-07-25 13:29:11 +0200
commit1bbcc3fdf312971ffb681b332f47369739d95dde (patch)
tree649e44c2e46b2c16973333300103cd152b9523ac /sfx2/source/sidebar/SidebarController.cxx
parentb84ef4d67eaf9f9fd7fd700ca05339cb0cdff742 (diff)
O[U]String overloads that return view for rest parameter
Add new overloads to OUString methods that have a "OUString* rest" style parameter. Instead return a view, which does not require allocation. To avoid overload ambiguity, split the methods into different variants that do not use default parameters. Change-Id: I1aa366115750f1f7ea4fe665804195f59f7c4b69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167632 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
Diffstat (limited to 'sfx2/source/sidebar/SidebarController.cxx')
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index bdca4a89055c..e421e957f960 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -53,6 +53,7 @@
#include <sal/log.hxx>
#include <officecfg/Office/UI/Sidebar.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+#include <o3tl/string_view.hxx>
#include <com/sun/star/awt/XWindowPeer.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
@@ -1154,11 +1155,11 @@ IMPL_LINK(SidebarController, OnMenuItemSelected, const OUString&, rCurItemId, vo
{
try
{
- OUString sNumber;
+ std::u16string_view sNumber;
if (rCurItemId.startsWith("select", &sNumber))
{
RequestOpenDeck();
- SwitchToDeck(mpTabBar->GetDeckIdForIndex(sNumber.toInt32()));
+ SwitchToDeck(mpTabBar->GetDeckIdForIndex(o3tl::toInt32(sNumber)));
}
mpParentWindow->GrabFocusToDocument();
}
@@ -1176,10 +1177,10 @@ IMPL_LINK(SidebarController, OnSubMenuItemSelected, const OUString&, rCurItemId,
{
try
{
- OUString sNumber;
+ std::u16string_view sNumber;
if (rCurItemId.startsWith("customize", &sNumber))
{
- mpTabBar->ToggleHideFlag(sNumber.toInt32());
+ mpTabBar->ToggleHideFlag(o3tl::toInt32(sNumber));
// Find the set of decks that could be displayed for the new context.
ResourceManager::DeckContextDescriptorContainer aDecks;