From 943060836339f9640c612e9724f20e79db616e6e Mon Sep 17 00:00:00 2001 From: Noel Date: Thu, 28 Jan 2021 12:38:01 +0200 Subject: simplify code, use more subView() Change-Id: I569c7f34acbdf8451cd5c9acf1abd334637072d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110051 Tested-by: Jenkins Reviewed-by: Noel Grandin --- desktop/source/deployment/misc/dp_misc.cxx | 2 +- desktop/source/deployment/misc/dp_ucb.cxx | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'desktop') 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(); -- cgit