summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-01-28 12:38:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-01-28 17:32:18 +0100
commit943060836339f9640c612e9724f20e79db616e6e (patch)
tree3dc6e7748aef3ef0f2fca86979792162daa443fc /desktop
parentd249bd5a3dfe13052ce9aa91bad94ec7d60604d4 (diff)
simplify code, use more subView()
Change-Id: I569c7f34acbdf8451cd5c9acf1abd334637072d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110051 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/deployment/misc/dp_misc.cxx2
-rw-r--r--desktop/source/deployment/misc/dp_ucb.cxx12
2 files changed, 7 insertions, 7 deletions
diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx
index 81785e536a40..aafa45e239e0 100644
--- a/desktop/source/deployment/misc/dp_misc.cxx
+++ b/desktop/source/deployment/misc/dp_misc.cxx
@@ -252,7 +252,7 @@ OUString makeURL( OUString const & baseURL, OUString const & relPath_ )
{
OUStringBuffer buf(128);
if (baseURL.getLength() > 1 && baseURL[ baseURL.getLength() - 1 ] == '/')
- buf.append( std::u16string_view(baseURL).substr(0, baseURL.getLength() - 1) );
+ buf.append( baseURL.subView(0, baseURL.getLength() - 1) );
else
buf.append( baseURL );
OUString relPath(relPath_);
diff --git a/desktop/source/deployment/misc/dp_ucb.cxx b/desktop/source/deployment/misc/dp_ucb.cxx
index 71e7d18a1c9c..3da815f15fa4 100644
--- a/desktop/source/deployment/misc/dp_ucb.cxx
+++ b/desktop/source/deployment/misc/dp_ucb.cxx
@@ -218,18 +218,18 @@ bool readLine( OUString * res, OUString const & startingWith,
{
pos = file.indexOf( LF, pos );
if (pos < 0) { // EOF
- buf.append( std::u16string_view(file).substr(start) );
+ buf.append( file.subView(start) );
}
else
{
if (pos > 0 && file[ pos - 1 ] == CR)
{
// consume extra CR
- buf.append( std::u16string_view(file).substr(start, pos - start - 1) );
+ buf.append( file.subView(start, pos - start - 1) );
++pos;
}
else
- buf.append( std::u16string_view(file).substr(start, pos - start) );
+ buf.append( file.subView(start, pos - start) );
++pos; // consume LF
// check next line:
if (pos < file.getLength() &&
@@ -273,16 +273,16 @@ bool readProperties( std::vector< std::pair< OUString, OUString> > & out_result,
bool bEOF = false;
pos = file.indexOf( LF, pos );
if (pos < 0) { // EOF
- buf.append( std::u16string_view(file).substr(start) );
+ buf.append( file.subView(start) );
bEOF = true;
}
else
{
if (pos > 0 && file[ pos - 1 ] == CR)
// consume extra CR
- buf.append( std::u16string_view(file).substr(start, pos - start - 1) );
+ buf.append( file.subView(start, pos - start - 1) );
else
- buf.append( std::u16string_view(file).substr(start, pos - start) );
+ buf.append( file.subView(start, pos - start) );
pos++;
}
OUString aLine = buf.makeStringAndClear();