summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-09-01 14:35:09 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-09-01 19:51:22 +0200
commitbb7747f627fe7e909fca7264fd42fe6cb7aef0b5 (patch)
tree620e1dbbcb0e04cba904197b75ea27d0743e5d30 /sc/source
parent153b51da381ba21d46a3d42c939080272818797c (diff)
tdf#150712 use more string_view
Change-Id: I3a9022a7f99653ca8ecc00908558b14ac5ff278c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139209 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/docshell/impex.cxx18
-rw-r--r--sc/source/ui/inc/impex.hxx2
2 files changed, 10 insertions, 10 deletions
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index e26af9455929..6f2444e7ba05 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -471,7 +471,7 @@ bool ScImportExport::ExportStream( SvStream& rStrm, const OUString& rBaseURL, So
WriteUnicodeOrByteString( rStrm, aAppName, true );
WriteUnicodeOrByteString( rStrm, aDocName, true );
WriteUnicodeOrByteString( rStrm, aRefName, true );
- WriteUnicodeOrByteString( rStrm, "calc:extref", true );
+ WriteUnicodeOrByteString( rStrm, u"calc:extref", true );
if ( rStrm.GetStreamCharSet() == RTL_TEXTENCODING_UNICODE )
rStrm.WriteUInt16( 0 );
else
@@ -493,17 +493,17 @@ bool ScImportExport::ExportStream( SvStream& rStrm, const OUString& rBaseURL, So
return false;
}
-void ScImportExport::WriteUnicodeOrByteString( SvStream& rStrm, const OUString& rString, bool bZero )
+void ScImportExport::WriteUnicodeOrByteString( SvStream& rStrm, std::u16string_view rString, bool bZero )
{
rtl_TextEncoding eEnc = rStrm.GetStreamCharSet();
if ( eEnc == RTL_TEXTENCODING_UNICODE )
{
if ( !lcl_IsEndianSwap( rStrm ) )
- rStrm.WriteBytes(rString.getStr(), rString.getLength() * sizeof(sal_Unicode));
+ rStrm.WriteBytes(rString.data(), rString.size() * sizeof(sal_Unicode));
else
{
- const sal_Unicode* p = rString.getStr();
- const sal_Unicode* const pStop = p + rString.getLength();
+ const sal_Unicode* p = rString.data();
+ const sal_Unicode* const pStop = p + rString.size();
while ( p < pStop )
{
rStrm.WriteUInt16( *p );
@@ -910,7 +910,7 @@ static void lcl_WriteString( SvStream& rStrm, OUString& rString, sal_Unicode cQu
ScImportExport::WriteUnicodeOrByteString( rStrm, rString );
}
-static void lcl_WriteSimpleString( SvStream& rStrm, const OUString& rString )
+static void lcl_WriteSimpleString( SvStream& rStrm, std::u16string_view rString )
{
ScImportExport::WriteUnicodeOrByteString( rStrm, rString );
}
@@ -2011,7 +2011,7 @@ bool ScImportExport::Doc2Text( SvStream& rStrm )
}
}
if( nCol < nEndCol )
- lcl_WriteSimpleString( rStrm, OUString(cSep) );
+ lcl_WriteSimpleString( rStrm, rtl::OUStringChar(cSep) );
}
// Do not append a line feed for one single cell.
// NOTE: this Doc2Text() is only called for clipboard via
@@ -2369,7 +2369,7 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm )
SCROW nEndRow = aRange.aEnd.Row();
OUString aCellStr;
OUString aValStr;
- lcl_WriteSimpleString( rStrm, "ID;PCALCOOO32" );
+ lcl_WriteSimpleString( rStrm, u"ID;PCALCOOO32" );
WriteUnicodeOrByteEndl( rStrm );
for (nRow = nStartRow; nRow <= nEndRow; nRow++)
@@ -2493,7 +2493,7 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm )
}
}
}
- lcl_WriteSimpleString( rStrm, OUString( 'E' ) );
+ lcl_WriteSimpleString( rStrm, rtl::OUStringChar( 'E' ) );
WriteUnicodeOrByteEndl( rStrm );
return rStrm.GetError() == ERRCODE_NONE;
}
diff --git a/sc/source/ui/inc/impex.hxx b/sc/source/ui/inc/impex.hxx
index aafeb00c9a0c..e11b5d510d61 100644
--- a/sc/source/ui/inc/impex.hxx
+++ b/sc/source/ui/inc/impex.hxx
@@ -108,7 +108,7 @@ public:
static const sal_Unicode* ScanNextFieldFromString( const sal_Unicode* p,
OUString& rField, sal_Unicode cStr, const sal_Unicode* pSeps,
bool bMergeSeps, bool& rbIsQuoted, bool& rbOverflowCell, bool bRemoveSpace );
- static void WriteUnicodeOrByteString( SvStream& rStrm, const OUString& rString, bool bZero = false );
+ static void WriteUnicodeOrByteString( SvStream& rStrm, std::u16string_view rString, bool bZero = false );
static void WriteUnicodeOrByteEndl( SvStream& rStrm );
/** ScImportExport::CountVisualWidth