summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-12-28 17:56:40 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-12-29 16:42:33 +0100
commit042033f1e6da22616cb76c8d950c20c9efecbad5 (patch)
tree26b3f1f42d067506f44550b410f3fb9640616a5b /extensions
parentccfd8e9d09f9ac0a0ea92d0f378391006faaf934 (diff)
loplugin:stringviewparam: operator +
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'extensions')
-rw-r--r--extensions/qa/update/test_update.cxx14
-rw-r--r--extensions/source/propctrlr/eformshelper.cxx6
-rw-r--r--extensions/source/propctrlr/eventhandler.cxx3
-rw-r--r--extensions/source/update/check/updateprotocol.cxx8
-rw-r--r--extensions/source/update/check/updateprotocol.hxx10
-rw-r--r--extensions/source/update/feed/updatefeed.cxx14
6 files changed, 33 insertions, 22 deletions
diff --git a/extensions/qa/update/test_update.cxx b/extensions/qa/update/test_update.cxx
index fe6316245cc4..f99855dc6198 100644
--- a/extensions/qa/update/test_update.cxx
+++ b/extensions/qa/update/test_update.cxx
@@ -38,7 +38,7 @@ public:
// repositories that we will be checking
m_aRepositoryList.realloc( 1 );
- m_aRepositoryList[0] = m_directories.getURLFromSrc( "/extensions/qa/update/simple.xml" );
+ m_aRepositoryList[0] = m_directories.getURLFromSrc( u"/extensions/qa/update/simple.xml" );
}
virtual void tearDown() override
@@ -102,10 +102,10 @@ protected:
rtl::Reference< UpdateCheck > aController( UpdateCheck::get() );
if ( checkForUpdates( aInfo, m_xContext, aController->getInteractionHandler(), m_xProvider,
- "Linux",
- "x86",
+ u"Linux",
+ u"x86",
m_aRepositoryList,
- "111111-222222-333333-444444",
+ u"111111-222222-333333-444444",
"InstallSetID" ) )
{
CPPUNIT_ASSERT_EQUAL( std::size_t(1), aInfo.Sources.size() );
@@ -122,10 +122,10 @@ protected:
rtl::Reference< UpdateCheck > aController( UpdateCheck::get() );
if ( checkForUpdates( aInfo, m_xContext, aController->getInteractionHandler(), m_xProvider,
- "Linux",
- "x86",
+ u"Linux",
+ u"x86",
m_aRepositoryList,
- "123456-abcdef-1a2b3c-4d5e6f",
+ u"123456-abcdef-1a2b3c-4d5e6f",
"InstallSetID" ) )
{
CPPUNIT_ASSERT( aInfo.Sources.empty() );
diff --git a/extensions/source/propctrlr/eformshelper.cxx b/extensions/source/propctrlr/eformshelper.cxx
index 196bce45ddf7..94f8e7a4b969 100644
--- a/extensions/source/propctrlr/eformshelper.cxx
+++ b/extensions/source/propctrlr/eformshelper.cxx
@@ -18,6 +18,8 @@
*/
#include <memory>
+#include <string_view>
+
#include "eformshelper.hxx"
#include "formstrings.hxx"
#include <strings.hrc>
@@ -54,9 +56,9 @@ namespace pcr
namespace
{
- OUString composeModelElementUIName( const OUString& _rModelName, const OUString& _rElementName )
+ OUString composeModelElementUIName( std::u16string_view _rModelName, std::u16string_view _rElementName )
{
- OUString a = "["
+ OUString a = OUString::Concat("[")
+ _rModelName + "] "
+ _rElementName;
return a;
diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx
index 45a27113aff5..4ec979682aea 100644
--- a/extensions/source/propctrlr/eventhandler.cxx
+++ b/extensions/source/propctrlr/eventhandler.cxx
@@ -63,6 +63,7 @@
#include <map>
#include <algorithm>
#include <iterator>
+#include <string_view>
namespace pcr
{
@@ -195,7 +196,7 @@ namespace pcr
return true;
}
- OUString lcl_getEventPropertyName( const OUString& _rListenerClassName, const OUString& _rMethodName )
+ OUString lcl_getEventPropertyName( std::u16string_view _rListenerClassName, std::u16string_view _rMethodName )
{
return _rListenerClassName + OUStringChar(';') + _rMethodName;
}
diff --git a/extensions/source/update/check/updateprotocol.cxx b/extensions/source/update/check/updateprotocol.cxx
index 369489fed399..4417565c4752 100644
--- a/extensions/source/update/check/updateprotocol.cxx
+++ b/extensions/source/update/check/updateprotocol.cxx
@@ -101,10 +101,10 @@ checkForUpdates(
const uno::Reference< uno::XComponentContext > & rxContext,
const uno::Reference< task::XInteractionHandler > & rxInteractionHandler,
const uno::Reference< deployment::XUpdateInformationProvider >& rUpdateInfoProvider,
- const OUString &rOS,
- const OUString &rArch,
+ std::u16string_view rOS,
+ std::u16string_view rArch,
const uno::Sequence< OUString > &rRepositoryList,
- const OUString &rGitID,
+ std::u16string_view rGitID,
const OUString &rInstallSetID )
{
if( !rxContext.is() )
@@ -129,7 +129,7 @@ checkForUpdates(
return false; // something went wrong ..
OUString aXPathExpression =
- "/child::inst:description[inst:os=\'"+
+ OUString::Concat("/child::inst:description[inst:os=\'")+
rOS +
"\' and inst:arch=\'"+
rArch +
diff --git a/extensions/source/update/check/updateprotocol.hxx b/extensions/source/update/check/updateprotocol.hxx
index 5b6422a02e1b..248fe2b2a389 100644
--- a/extensions/source/update/check/updateprotocol.hxx
+++ b/extensions/source/update/check/updateprotocol.hxx
@@ -20,6 +20,10 @@
#ifndef INCLUDED_EXTENSIONS_SOURCE_UPDATE_CHECK_UPDATEPROTOCOL_HXX
#define INCLUDED_EXTENSIONS_SOURCE_UPDATE_CHECK_UPDATEPROTOCOL_HXX
+#include <sal/config.h>
+
+#include <string_view>
+
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
#include <com/sun/star/deployment/XUpdateInformationProvider.hpp>
@@ -41,10 +45,10 @@ checkForUpdates(
const css::uno::Reference< css::uno::XComponentContext > & rxContext,
const css::uno::Reference< css::task::XInteractionHandler > & rxInteractionHandler,
const css::uno::Reference< css::deployment::XUpdateInformationProvider >& rUpdateInfoProvider,
- const OUString &rOS,
- const OUString &rArch,
+ std::u16string_view rOS,
+ std::u16string_view rArch,
const css::uno::Sequence< OUString > &rRepositoryList,
- const OUString &rGitID,
+ std::u16string_view rGitID,
const OUString &rInstallID
);
diff --git a/extensions/source/update/feed/updatefeed.cxx b/extensions/source/update/feed/updatefeed.cxx
index 0e00bcd18848..153233bbb67c 100644
--- a/extensions/source/update/feed/updatefeed.cxx
+++ b/extensions/source/update/feed/updatefeed.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <string_view>
+
#include <config_folders.h>
#include <cppuhelper/exc_hlp.hxx>
@@ -120,7 +124,7 @@ class UpdateInformationProvider :
bool isUserAgentExtended() const;
public:
uno::Reference< xml::dom::XElement > getDocumentRoot(const uno::Reference< xml::dom::XNode >& rxNode);
- uno::Reference< xml::dom::XNode > getChildNode(const uno::Reference< xml::dom::XNode >& rxNode, const OUString& rName);
+ uno::Reference< xml::dom::XNode > getChildNode(const uno::Reference< xml::dom::XNode >& rxNode, std::u16string_view rName);
// XUpdateInformationService
@@ -220,14 +224,14 @@ public:
uno::Reference< xml::dom::XNode > xAtomEntryNode( m_xNodeList->item(m_nCount++) );
uno::Reference< xml::dom::XNode > xSummaryNode(
- m_xUpdateInformationProvider->getChildNode( xAtomEntryNode, "summary/text()" )
+ m_xUpdateInformationProvider->getChildNode( xAtomEntryNode, u"summary/text()" )
);
if( xSummaryNode.is() )
aEntry.Description = xSummaryNode->getNodeValue();
uno::Reference< xml::dom::XNode > xContentNode(
- m_xUpdateInformationProvider->getChildNode( xAtomEntryNode, "content" ) );
+ m_xUpdateInformationProvider->getChildNode( xAtomEntryNode, u"content" ) );
if( xContentNode.is() )
aEntry.UpdateDocument = m_xUpdateInformationProvider->getDocumentRoot(xContentNode);
@@ -532,11 +536,11 @@ UpdateInformationProvider::getDocumentRoot(const uno::Reference< xml::dom::XNode
uno::Reference< xml::dom::XNode >
UpdateInformationProvider::getChildNode(const uno::Reference< xml::dom::XNode >& rxNode,
- const OUString& rName)
+ std::u16string_view rName)
{
OSL_ASSERT(m_xXPathAPI.is());
try {
- return m_xXPathAPI->selectSingleNode(rxNode, "./atom:" + rName);
+ return m_xXPathAPI->selectSingleNode(rxNode, OUString::Concat("./atom:") + rName);
} catch (const xml::xpath::XPathException &) {
// ignore
return nullptr;