summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-14 13:46:06 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-14 19:26:04 +0200
commitaf4407649d2c8a2ea59487d5fc1f8cc742ddd0b2 (patch)
tree5a32427d7def31ad749a8c5f3890135079c3e2ff /unotools
parent2a5b28eaaaf8ff56778fcdfb28f0a660592c7866 (diff)
use more string_view in unotools
Change-Id: I5fc3753475c3c6a45f86910eeb49055f96a2e925 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133013 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/config/bootstrap.cxx6
-rw-r--r--unotools/source/ucbhelper/tempfile.cxx8
2 files changed, 7 insertions, 7 deletions
diff --git a/unotools/source/config/bootstrap.cxx b/unotools/source/config/bootstrap.cxx
index 09c52157024b..ef7ba57000c1 100644
--- a/unotools/source/config/bootstrap.cxx
+++ b/unotools/source/config/bootstrap.cxx
@@ -413,12 +413,12 @@ char const IS_MISSING[] = "is missing";
char const IS_INVALID[] = "is corrupt";
char const PERIOD[] = ". ";
-static void addFileError(OUStringBuffer& _rBuf, OUString const& _aPath, AsciiString _sWhat)
+static void addFileError(OUStringBuffer& _rBuf, std::u16string_view _aPath, AsciiString _sWhat)
{
- OUString sSimpleFileName = _aPath.copy(1 +_aPath.lastIndexOf(cURLSeparator));
+ std::u16string_view sSimpleFileName = _aPath.substr(1 +_aPath.rfind(cURLSeparator));
_rBuf.append("The configuration file");
- _rBuf.append(" '" + sSimpleFileName + "' ");
+ _rBuf.append(OUString::Concat(" '") + sSimpleFileName + "' ");
_rBuf.appendAscii(_sWhat).append(PERIOD);
}
diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx
index 4fac0bacd782..e912c609337b 100644
--- a/unotools/source/ucbhelper/tempfile.cxx
+++ b/unotools/source/ucbhelper/tempfile.cxx
@@ -47,14 +47,14 @@ namespace
namespace utl
{
-static OUString getParentName( const OUString& aFileName )
+static OUString getParentName( std::u16string_view aFileName )
{
- sal_Int32 lastIndex = aFileName.lastIndexOf( '/' );
+ size_t lastIndex = aFileName.rfind( '/' );
OUString aParent;
- if (lastIndex > -1)
+ if (lastIndex != std::u16string_view::npos)
{
- aParent = aFileName.copy(0, lastIndex);
+ aParent = aFileName.substr(0, lastIndex);
if (aParent.endsWith(":") && aParent.getLength() == 6)
aParent += "/";