[Libreoffice-commits] core.git: compilerplugins/clang ucb/source vcl/source
Stephan Bergmann (via logerrit)
logerrit at kemper.freedesktop.org
Sun Nov 15 16:17:44 UTC 2020
compilerplugins/clang/stringviewparam.cxx | 2 +-
ucb/source/ucp/file/filglob.cxx | 4 ++--
ucb/source/ucp/file/filglob.hxx | 6 +++++-
vcl/source/image/ImplImageTree.cxx | 5 +++--
4 files changed, 11 insertions(+), 6 deletions(-)
New commits:
commit 87b4bf1ea44235ca64ec7b2b2ba41b91da6ed384
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu Nov 12 23:31:49 2020 +0100
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Sun Nov 15 17:16:59 2020 +0100
Extend loplugin:stringviewparen: subView
Change-Id: Iee4833b148a5e17e09f84bdfbc8692aa5a956618
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105777
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/compilerplugins/clang/stringviewparam.cxx b/compilerplugins/clang/stringviewparam.cxx
index a8df3c5f128d..c0c720f06df5 100644
--- a/compilerplugins/clang/stringviewparam.cxx
+++ b/compilerplugins/clang/stringviewparam.cxx
@@ -131,7 +131,7 @@ DeclRefExpr const* relevantCXXMemberCallExpr(CXXMemberCallExpr const* expr)
else if (auto const i = d->getIdentifier())
{
auto const n = i->getName();
- if (n == "isEmpty")
+ if (n == "isEmpty" || n == "subView")
{
good = true;
}
diff --git a/ucb/source/ucp/file/filglob.cxx b/ucb/source/ucp/file/filglob.cxx
index 4c5ea1249e87..2ff92af3acb8 100644
--- a/ucb/source/ucp/file/filglob.cxx
+++ b/ucb/source/ucp/file/filglob.cxx
@@ -174,11 +174,11 @@ namespace fileaccess {
OUString newName(
const OUString& aNewPrefix,
const OUString& aOldPrefix,
- const OUString& old_Name )
+ std::u16string_view old_Name )
{
sal_Int32 srcL = aOldPrefix.getLength();
- return aNewPrefix + old_Name.subView( srcL );
+ return aNewPrefix + old_Name.substr( srcL );
}
diff --git a/ucb/source/ucp/file/filglob.hxx b/ucb/source/ucp/file/filglob.hxx
index d1e9a4a01fac..ce3a32fea9f5 100644
--- a/ucb/source/ucp/file/filglob.hxx
+++ b/ucb/source/ucp/file/filglob.hxx
@@ -19,6 +19,10 @@
#ifndef INCLUDED_UCB_SOURCE_UCP_FILE_FILGLOB_HXX
#define INCLUDED_UCB_SOURCE_UCP_FILE_FILGLOB_HXX
+#include <sal/config.h>
+
+#include <string_view>
+
#include <rtl/ustring.hxx>
#include <osl/file.hxx>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
@@ -44,7 +48,7 @@ namespace fileaccess {
// Changes the prefix in name
extern OUString newName( const OUString& aNewPrefix,
const OUString& aOldPrefix,
- const OUString& old_Name );
+ std::u16string_view old_Name );
// returns the last part of the given url as title
extern OUString getTitle( const OUString& aPath );
diff --git a/vcl/source/image/ImplImageTree.cxx b/vcl/source/image/ImplImageTree.cxx
index 4d2906d9b779..7dc365baf4b7 100644
--- a/vcl/source/image/ImplImageTree.cxx
+++ b/vcl/source/image/ImplImageTree.cxx
@@ -23,6 +23,7 @@
#include <sal/log.hxx>
#include <deque>
+#include <string_view>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/io/XInputStream.hpp>
@@ -98,9 +99,9 @@ OUString convertLcTo32Path(OUString const & rPath)
return aResult;
}
-OUString createPath(OUString const & name, sal_Int32 pos, OUString const & locale)
+OUString createPath(std::u16string_view name, sal_Int32 pos, OUString const & locale)
{
- return name.subView(0, pos + 1) + locale + name.subView(pos);
+ return name.substr(0, pos + 1) + locale + name.substr(pos);
}
OUString getIconCacheUrl(OUString const & sVariant, ImageRequestParameters const & rParameters)
More information about the Libreoffice-commits
mailing list