summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 += "/";