From 46c5de832868d2812448b2caace3eeaa9237b9f6 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 17 Dec 2020 22:02:06 +0200 Subject: make *String(string_view) constructors explicit to make it more obvious when we are constructing heap OUStrings code and potentially inadvertently throwing away performance. And fix a handful of places so revealed. Change-Id: I0cf390f78026f8a670aaab53424cd31510633051 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107923 Tested-by: Jenkins Reviewed-by: Noel Grandin --- basctl/source/basicide/baside2b.cxx | 2 +- basctl/source/basicide/bastype3.cxx | 2 +- basctl/source/basicide/moduldl2.cxx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'basctl') diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index 5ebca907749e..3bb09f3bb140 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -1419,7 +1419,7 @@ void BreakPointWindow::ShowMarker(vcl::RenderContext& rRenderContext) Size const aOutSz = GetOutputSize(); tools::Long const nLineHeight = GetTextHeight(); - Image aMarker = GetImage(bErrorMarker ? std::u16string_view(u"" RID_BMP_ERRORMARKER) : std::u16string_view(u"" RID_BMP_STEPMARKER)); + Image aMarker = GetImage(OUString(bErrorMarker ? std::u16string_view(u"" RID_BMP_ERRORMARKER) : std::u16string_view(u"" RID_BMP_STEPMARKER))); Size aMarkerSz(aMarker.GetSizePixel()); aMarkerSz = rRenderContext.PixelToLogic(aMarkerSz); diff --git a/basctl/source/basicide/bastype3.cxx b/basctl/source/basicide/bastype3.cxx index aedc8ee307f8..4318ad803306 100644 --- a/basctl/source/basicide/bastype3.cxx +++ b/basctl/source/basicide/bastype3.cxx @@ -102,7 +102,7 @@ IMPL_LINK(SbTreeListBox, RequestingChildrenHdl, const weld::TreeIter&, rEntry, b // exchange image const bool bDlgMode = (nMode & BrowseMode::Dialogs) && !(nMode & BrowseMode::Modules); auto const aImage(bDlgMode ? std::u16string_view(u"" RID_BMP_DLGLIB) : std::u16string_view(u"" RID_BMP_MODLIB)); - SetEntryBitmaps(rEntry, aImage); + SetEntryBitmaps(rEntry, OUString(aImage)); } else { diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index 5b78745613da..e04558a42e7f 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -1351,7 +1351,7 @@ void createLibImpl(weld::Window* pWin, const ScriptDocument& rDocument, BrowseMode nMode = pBasicBox->GetMode(); bool bDlgMode = ( nMode & BrowseMode::Dialogs ) && !( nMode & BrowseMode::Modules ); const auto sId = bDlgMode ? std::u16string_view(u"" RID_BMP_DLGLIB) : std::u16string_view(u"" RID_BMP_MODLIB); - pBasicBox->AddEntry(aLibName, sId, xRootEntry.get(), false, std::make_unique(OBJ_TYPE_LIBRARY)); + pBasicBox->AddEntry(aLibName, OUString(sId), xRootEntry.get(), false, std::make_unique(OBJ_TYPE_LIBRARY)); pBasicBox->AddEntry(aModName, RID_BMP_MODULE, xRootEntry.get(), false, std::make_unique(OBJ_TYPE_MODULE)); pBasicBox->set_cursor(*xRootEntry); pBasicBox->select(*xRootEntry); -- cgit