diff options
-rw-r--r-- | include/tools/XmlWalker.hxx | 6 | ||||
-rw-r--r-- | tools/qa/cppunit/test_xmlwalker.cxx | 6 | ||||
-rw-r--r-- | tools/source/xml/XmlWalker.cxx | 9 | ||||
-rw-r--r-- | vcl/qa/cppunit/pdfexport/pdfexport2.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/WidgetDefinitionReader.cxx | 8 |
5 files changed, 17 insertions, 14 deletions
diff --git a/include/tools/XmlWalker.hxx b/include/tools/XmlWalker.hxx index ba9d18e856a6..653d04d0a4ff 100644 --- a/include/tools/XmlWalker.hxx +++ b/include/tools/XmlWalker.hxx @@ -40,9 +40,9 @@ public: bool open(SvStream* pStream); - OString name(); - OString namespaceHref(); - OString namespacePrefix(); + std::string_view name(); + std::string_view namespaceHref(); + std::string_view namespacePrefix(); OString content(); void children(); diff --git a/tools/qa/cppunit/test_xmlwalker.cxx b/tools/qa/cppunit/test_xmlwalker.cxx index 6df278c21e2e..d18f3f5db487 100644 --- a/tools/qa/cppunit/test_xmlwalker.cxx +++ b/tools/qa/cppunit/test_xmlwalker.cxx @@ -41,7 +41,7 @@ void XmlWalkerTest::testReadXML() tools::XmlWalker aWalker; SvFileStream aFileStream(aXmlFilePath, StreamMode::READ); CPPUNIT_ASSERT(aWalker.open(&aFileStream)); - CPPUNIT_ASSERT_EQUAL("root"_ostr, aWalker.name()); + CPPUNIT_ASSERT_EQUAL(std::string_view("root"), aWalker.name()); CPPUNIT_ASSERT_EQUAL("Hello World"_ostr, aWalker.attribute("root-attr"_ostr)); int nNumberOfChildNodes = 0; @@ -76,8 +76,8 @@ void XmlWalkerTest::testReadXML() } else if (aWalker.name() == "with-namespace") { - CPPUNIT_ASSERT_EQUAL("adobe:ns:meta/"_ostr, aWalker.namespaceHref()); - CPPUNIT_ASSERT_EQUAL("xx"_ostr, aWalker.namespacePrefix()); + CPPUNIT_ASSERT_EQUAL(std::string_view("adobe:ns:meta/"), aWalker.namespaceHref()); + CPPUNIT_ASSERT_EQUAL(std::string_view("xx"), aWalker.namespacePrefix()); } aWalker.next(); } diff --git a/tools/source/xml/XmlWalker.cxx b/tools/source/xml/XmlWalker.cxx index c0e8a2abef48..f486cef36b34 100644 --- a/tools/source/xml/XmlWalker.cxx +++ b/tools/source/xml/XmlWalker.cxx @@ -59,14 +59,17 @@ bool XmlWalker::open(SvStream* pStream) return true; } -OString XmlWalker::name() { return reinterpret_cast<const char*>(mpImpl->mpCurrent->name); } +std::string_view XmlWalker::name() +{ + return reinterpret_cast<const char*>(mpImpl->mpCurrent->name); +} -OString XmlWalker::namespaceHref() +std::string_view XmlWalker::namespaceHref() { return reinterpret_cast<const char*>(mpImpl->mpCurrent->ns->href); } -OString XmlWalker::namespacePrefix() +std::string_view XmlWalker::namespacePrefix() { return reinterpret_cast<const char*>(mpImpl->mpCurrent->ns->prefix); } 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 }, |