summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-02-06 12:49:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-02-06 17:08:27 +0100
commit8f5368185661eefcd5e6e6696ac429022e0a983c (patch)
treeab85b7c7abcf132361612541fb81b8bfd739832e /vcl
parent0a5d4dc25c5521de221f63dbc47c6ba79a51f8fb (diff)
return string_view from some XmlWalker methods
elides some OString temporaries Change-Id: Ic07f18eb3c71637593e64128605c1ebfa8e68474 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163044 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qa/cppunit/pdfexport/pdfexport2.cxx2
-rw-r--r--vcl/source/gdi/WidgetDefinitionReader.cxx8
2 files changed, 5 insertions, 5 deletions
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx
index 130d77be8ef3..5942ece0b95e 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx
@@ -1178,7 +1178,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testPdfUaMetadata)
tools::XmlWalker aWalker;
CPPUNIT_ASSERT(aWalker.open(&rStream));
- CPPUNIT_ASSERT_EQUAL("xmpmeta"_ostr, aWalker.name());
+ CPPUNIT_ASSERT_EQUAL(std::string_view("xmpmeta"), aWalker.name());
bool bPdfUaMarkerFound = false;
OString aPdfUaPart;
diff --git a/vcl/source/gdi/WidgetDefinitionReader.cxx b/vcl/source/gdi/WidgetDefinitionReader.cxx
index f5373b035cdd..66a6976622b5 100644
--- a/vcl/source/gdi/WidgetDefinitionReader.cxx
+++ b/vcl/source/gdi/WidgetDefinitionReader.cxx
@@ -146,9 +146,9 @@ ControlPart xmlStringToControlPart(std::string_view sPart)
return ControlPart::NONE;
}
-bool getControlTypeForXmlString(OString const& rString, ControlType& reType)
+bool getControlTypeForXmlString(std::string_view rString, ControlType& reType)
{
- static std::unordered_map<OString, ControlType> aPartMap = {
+ static std::unordered_map<std::string_view, ControlType> aPartMap = {
{ "pushbutton", ControlType::Pushbutton },
{ "radiobutton", ControlType::Radiobutton },
{ "checkbox", ControlType::Checkbox },
@@ -366,7 +366,7 @@ bool WidgetDefinitionReader::read(WidgetDefinition& rWidgetDefinition)
auto pStyle = std::make_shared<WidgetDefinitionStyle>();
- std::unordered_map<OString, Color*> aStyleColorMap = {
+ std::unordered_map<std::string_view, Color*> aStyleColorMap = {
{ "faceColor", &pStyle->maFaceColor },
{ "checkedColor", &pStyle->maCheckedColor },
{ "lightColor", &pStyle->maLightColor },
@@ -425,7 +425,7 @@ bool WidgetDefinitionReader::read(WidgetDefinition& rWidgetDefinition)
auto pSettings = std::make_shared<WidgetDefinitionSettings>();
- std::unordered_map<OString, OString*> aSettingMap = {
+ std::unordered_map<std::string_view, OString*> aSettingMap = {
{ "noActiveTabTextRaise", &pSettings->msNoActiveTabTextRaise },
{ "centeredTabs", &pSettings->msCenteredTabs },
{ "listBoxEntryMargin", &pSettings->msListBoxEntryMargin },