summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-03 21:28:08 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-04 13:48:11 +0200
commit5de24375515bc2932d299047e9cb8c9c9bf3ee1d (patch)
tree81c451b7ccbf90d6d3e219f26b62e98993fff7df /sw
parentc2e8a96a8107a37901e475c65a8e61211fc3b132 (diff)
use string_view in comphelper::string::split
Change-Id: I4afe8aee85905ee35ba195b00b454aefa0ba38af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132486 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/shellio.hxx14
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx2
-rw-r--r--sw/source/core/doc/swserv.cxx4
-rw-r--r--sw/source/core/swg/SwXMLTextBlocks.cxx2
-rw-r--r--sw/source/filter/ascii/wrtasc.cxx15
-rw-r--r--sw/source/filter/ascii/wrtasc.hxx2
-rw-r--r--sw/source/filter/basflt/fltini.cxx12
-rw-r--r--sw/source/filter/html/wrthtml.cxx14
-rw-r--r--sw/source/filter/html/wrthtml.hxx4
-rw-r--r--sw/source/filter/inc/fltini.hxx2
-rw-r--r--sw/source/filter/ww8/rtfexport.cxx4
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx4
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx2
-rw-r--r--sw/source/filter/xml/wrtxml.cxx2
-rw-r--r--sw/source/uibase/app/docsh.cxx6
-rw-r--r--sw/source/uibase/app/docsh2.cxx4
-rw-r--r--sw/source/uibase/dochdl/swdtflvr.cxx4
-rw-r--r--sw/source/uibase/uiview/srcview.cxx2
18 files changed, 51 insertions, 48 deletions
diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx
index 1c82db956315..388dffb7ac90 100644
--- a/sw/inc/shellio.hxx
+++ b/sw/inc/shellio.hxx
@@ -527,7 +527,7 @@ public:
};
typedef Reader* (*FnGetReader)();
-typedef void (*FnGetWriter)(const OUString&, const OUString& rBaseURL, WriterRef&);
+typedef void (*FnGetWriter)(std::u16string_view, const OUString& rBaseURL, WriterRef&);
ErrCode SaveOrDelMSVBAStorage( SfxObjectShell&, SotStorage&, bool, const OUString& );
ErrCode GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocS );
@@ -546,7 +546,7 @@ struct SwReaderWriterEntry
Reader* GetReader();
/// Get access to the writer.
- void GetWriter( const OUString& rNm, const OUString& rBaseURL, WriterRef& xWrt ) const;
+ void GetWriter( std::u16string_view rNm, const OUString& rBaseURL, WriterRef& xWrt ) const;
};
namespace SwReaderWriter
@@ -558,13 +558,13 @@ namespace SwReaderWriter
Reader* GetReader( const OUString& rFltName );
/// Return writer based on the name.
- SW_DLLPUBLIC void GetWriter( const OUString& rFltName, const OUString& rBaseURL, WriterRef& xWrt );
+ SW_DLLPUBLIC void GetWriter( std::u16string_view rFltName, const OUString& rBaseURL, WriterRef& xWrt );
}
-void GetRTFWriter( const OUString&, const OUString&, WriterRef& );
-void GetASCWriter(const OUString&, const OUString&, WriterRef&);
-void GetHTMLWriter( const OUString&, const OUString&, WriterRef& );
-void GetXMLWriter( const OUString&, const OUString&, WriterRef& );
+void GetRTFWriter( std::u16string_view, const OUString&, WriterRef& );
+void GetASCWriter( std::u16string_view, const OUString&, WriterRef&);
+void GetHTMLWriter( std::u16string_view, const OUString&, WriterRef& );
+void GetXMLWriter( std::u16string_view, const OUString&, WriterRef& );
#endif
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 8c59dfdc5935..53fbb24fbf22 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -486,7 +486,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testExportRTF)
// And finally export it as RTF.
WriterRef xWrt;
- SwReaderWriter::GetWriter("RTF", OUString(), xWrt);
+ SwReaderWriter::GetWriter(u"RTF", OUString(), xWrt);
SvMemoryStream aStream;
SwWriter aWrt(aStream, *xClpDoc);
aWrt.Write(xWrt);
diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx
index 37389e750c5c..83ea7affe60c 100644
--- a/sw/source/core/doc/swserv.cxx
+++ b/sw/source/core/doc/swserv.cxx
@@ -45,13 +45,13 @@ bool SwServerObject::GetData( uno::Any & rData,
switch( SotExchange::GetFormatIdFromMimeType( rMimeType ) )
{
case SotClipboardFormatId::STRING:
- ::GetASCWriter( OUString(), OUString(), xWrt );
+ ::GetASCWriter( std::u16string_view(), OUString(), xWrt );
break;
case SotClipboardFormatId::RTF:
case SotClipboardFormatId::RICHTEXT:
// mba: no BaseURL for data exchange
- ::GetRTFWriter( OUString(), OUString(), xWrt );
+ ::GetRTFWriter( std::u16string_view(), OUString(), xWrt );
break;
default: break;
}
diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx
index a3b79e275535..b6f4467981c7 100644
--- a/sw/source/core/swg/SwXMLTextBlocks.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks.cxx
@@ -267,7 +267,7 @@ ErrCode SwXMLTextBlocks::PutBlock()
SwXmlFlags nCommitFlags = m_nFlags;
WriterRef xWrt;
- ::GetXMLWriter ( OUString(), GetBaseURL(), xWrt);
+ ::GetXMLWriter ( std::u16string_view(), GetBaseURL(), xWrt);
SwWriter aWriter (m_xRoot, *m_xDoc );
xWrt->m_bBlock = true;
diff --git a/sw/source/filter/ascii/wrtasc.cxx b/sw/source/filter/ascii/wrtasc.cxx
index db256e667663..1f4153293bc3 100644
--- a/sw/source/filter/ascii/wrtasc.cxx
+++ b/sw/source/filter/ascii/wrtasc.cxx
@@ -32,17 +32,19 @@
#include <strings.hrc>
-SwASCWriter::SwASCWriter( const OUString& rFltNm )
+SwASCWriter::SwASCWriter( std::u16string_view rFltNm )
{
SwAsciiOptions aNewOpts;
- switch( 5 <= rFltNm.getLength() ? rFltNm[4] : 0 )
+ switch( 5 <= rFltNm.size() ? rFltNm[4] : 0 )
{
case 'D':
aNewOpts.SetCharSet( RTL_TEXTENCODING_IBM_850 );
aNewOpts.SetParaFlags( LINEEND_CRLF );
- if( 5 < rFltNm.getLength() )
- switch( rFltNm.copy( 5 ).toInt32() )
+ if( 5 < rFltNm.size() )
+ {
+ std::u16string_view aFilterNum = rFltNm.substr( 5 );
+ switch( rtl_ustr_toInt64_WithLength(aFilterNum.data(), 10, aFilterNum.size()) )
{
case 437: aNewOpts.SetCharSet( RTL_TEXTENCODING_IBM_437 ); break;
case 850: aNewOpts.SetCharSet( RTL_TEXTENCODING_IBM_850 ); break;
@@ -51,6 +53,7 @@ SwASCWriter::SwASCWriter( const OUString& rFltNm )
case 863: aNewOpts.SetCharSet( RTL_TEXTENCODING_IBM_863 ); break;
case 865: aNewOpts.SetCharSet( RTL_TEXTENCODING_IBM_865 ); break;
}
+ }
break;
case 'A':
@@ -73,7 +76,7 @@ SwASCWriter::SwASCWriter( const OUString& rFltNm )
break;
default:
- if( rFltNm.getLength() >= 4 && rFltNm.subView( 4 )==u"_DLG" )
+ if( rFltNm.size() >= 4 && rFltNm.substr( 4 )==u"_DLG" )
{
// use the options
aNewOpts = GetAsciiOptions();
@@ -222,7 +225,7 @@ void SwASCWriter::SetupFilterOptions(SfxMedium& rMedium)
}
void GetASCWriter(
- const OUString& rFltNm, [[maybe_unused]] const OUString& /*rBaseURL*/, WriterRef& xRet )
+ std::u16string_view rFltNm, [[maybe_unused]] const OUString& /*rBaseURL*/, WriterRef& xRet )
{
xRet = new SwASCWriter( rFltNm );
}
diff --git a/sw/source/filter/ascii/wrtasc.hxx b/sw/source/filter/ascii/wrtasc.hxx
index b2a91c589599..c2e3dfa9a2d4 100644
--- a/sw/source/filter/ascii/wrtasc.hxx
+++ b/sw/source/filter/ascii/wrtasc.hxx
@@ -33,7 +33,7 @@ class SwASCWriter : public Writer
virtual ErrCode WriteStream() override;
public:
- SwASCWriter(const OUString& rFilterName);
+ SwASCWriter(std::u16string_view rFilterName);
virtual ~SwASCWriter() override;
void SetupFilterOptions(SfxMedium& rMedium) override;
diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx
index 7948fa0782c6..f42ee3d5761f 100644
--- a/sw/source/filter/basflt/fltini.cxx
+++ b/sw/source/filter/basflt/fltini.cxx
@@ -78,7 +78,7 @@ Reader* SwReaderWriterEntry::GetReader()
return nullptr;
}
-void SwReaderWriterEntry::GetWriter( const OUString& rNm, const OUString& rBaseURL, WriterRef& xWrt ) const
+void SwReaderWriterEntry::GetWriter( std::u16string_view rNm, const OUString& rBaseURL, WriterRef& xWrt ) const
{
if ( fnGetWriter )
(*fnGetWriter)( rNm, rBaseURL, xWrt );
@@ -156,7 +156,7 @@ Reader* GetDOCXReader()
return aReaderWriter[READER_WRITER_DOCX].GetReader();
}
-void GetWriter( const OUString& rFltName, const OUString& rBaseURL, WriterRef& xRet )
+void GetWriter( std::u16string_view rFltName, const OUString& rBaseURL, WriterRef& xRet )
{
for( int n = 0; n < MAXFILTER; ++n )
if ( aFilterDetect[n].IsFilter( rFltName ) )
@@ -627,9 +627,9 @@ void SwAsciiOptions::WriteUserData(OUString& rStr) const
extern "C" {
Reader *ImportRTF();
- void ExportRTF( const OUString&, const OUString& rBaseURL, WriterRef& );
+ void ExportRTF( std::u16string_view, const OUString& rBaseURL, WriterRef& );
Reader *ImportDOC();
- void ExportDOC( const OUString&, const OUString& rBaseURL, WriterRef& );
+ void ExportDOC( std::u16string_view, const OUString& rBaseURL, WriterRef& );
Reader *ImportDOCX();
sal_uInt32 SaveOrDelMSVBAStorage_ww8( SfxObjectShell&, SotStorage&, sal_Bool, const OUString& );
sal_uInt32 GetSaveWarningOfMSVBAStorage_ww8( SfxObjectShell& );
@@ -653,7 +653,7 @@ Reader* GetRTFReader()
}
-void GetRTFWriter( const OUString& rFltName, const OUString& rBaseURL, WriterRef& xRet )
+void GetRTFWriter( std::u16string_view rFltName, const OUString& rBaseURL, WriterRef& xRet )
{
#ifndef DISABLE_DYNLOADING
FnGetWriter pFunction = reinterpret_cast<FnGetWriter>( SwGlobals::getFilters().GetMswordLibSymbol( "ExportRTF" ) );
@@ -681,7 +681,7 @@ Reader* GetWW8Reader()
#endif
}
-void GetWW8Writer( const OUString& rFltName, const OUString& rBaseURL, WriterRef& xRet )
+void GetWW8Writer( std::u16string_view rFltName, const OUString& rBaseURL, WriterRef& xRet )
{
#ifndef DISABLE_DYNLOADING
FnGetWriter pFunction = reinterpret_cast<FnGetWriter>( SwGlobals::getFilters().GetMswordLibSymbol( "ExportDOC" ) );
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index 487fe7e36009..9ac3f2519660 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -93,7 +93,7 @@ using namespace css;
static char sIndentTabs[MAX_INDENT_LEVEL+2] =
"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
-SwHTMLWriter::SwHTMLWriter( const OUString& rBaseURL, const OUString& rFilterOptions )
+SwHTMLWriter::SwHTMLWriter( const OUString& rBaseURL, std::u16string_view rFilterOptions )
: m_pNumRuleInfo(new SwHTMLNumRuleInfo)
, m_nHTMLMode(0)
, m_eCSS1Unit(FieldUnit::NONE)
@@ -206,24 +206,24 @@ void SwHTMLWriter::SetupFilterOptions(SfxMedium& rMedium)
SetupFilterFromPropertyValues(aArgs);
}
-void SwHTMLWriter::SetupFilterOptions(const OUString& rFilterOptions)
+void SwHTMLWriter::SetupFilterOptions(std::u16string_view rFilterOptions)
{
comphelper::SequenceAsHashMap aStoreMap;
- if (rFilterOptions.indexOf("SkipImages") >= 0)
+ if (rFilterOptions.find(u"SkipImages") != std::u16string_view::npos)
{
aStoreMap["SkipImages"] <<= true;
}
- else if (rFilterOptions.indexOf("SkipHeaderFooter") >= 0)
+ else if (rFilterOptions.find(u"SkipHeaderFooter") != std::u16string_view::npos)
{
aStoreMap["SkipHeaderFooter"] <<= true;
}
- else if (rFilterOptions.indexOf("EmbedImages") >= 0)
+ else if (rFilterOptions.find(u"EmbedImages") != std::u16string_view::npos)
{
aStoreMap["EmbedImages"] <<= true;
}
// this option can be "on" together with any of above
- if (rFilterOptions.indexOf("NoLineLimit") >= 0)
+ if (rFilterOptions.find(u"NoLineLimit") != std::u16string_view::npos)
{
aStoreMap["NoLineLimit"] <<= true;
}
@@ -1652,7 +1652,7 @@ HTMLSaveData::~HTMLSaveData()
}
}
-void GetHTMLWriter( const OUString& rFilterOptions, const OUString& rBaseURL, WriterRef& xRet )
+void GetHTMLWriter( std::u16string_view rFilterOptions, const OUString& rBaseURL, WriterRef& xRet )
{
xRet = new SwHTMLWriter( rBaseURL, rFilterOptions );
}
diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx
index 3f6860a6d160..674b86d27ab1 100644
--- a/sw/source/filter/html/wrthtml.hxx
+++ b/sw/source/filter/html/wrthtml.hxx
@@ -271,7 +271,7 @@ class SW_DLLPUBLIC SwHTMLWriter : public Writer
void AddLinkTarget( const OUString& rURL );
void CollectLinkTargets();
- void SetupFilterOptions(const OUString& rFilterOptions);
+ void SetupFilterOptions(std::u16string_view rFilterOptions);
protected:
ErrCode WriteStream() override;
@@ -422,7 +422,7 @@ public:
/// Construct an instance of SwHTMLWriter and optionally give it
/// the filter options directly, which can also be set via SetupFilterOptions().
- explicit SwHTMLWriter( const OUString& rBaseURL, const OUString& rFilterOptions = "" );
+ explicit SwHTMLWriter( const OUString& rBaseURL, std::u16string_view rFilterOptions = std::u16string_view() );
virtual ~SwHTMLWriter() override;
void Out_SwDoc( SwPaM* ); // write the marked range
diff --git a/sw/source/filter/inc/fltini.hxx b/sw/source/filter/inc/fltini.hxx
index 500247cdb29a..8106e7ba9e2b 100644
--- a/sw/source/filter/inc/fltini.hxx
+++ b/sw/source/filter/inc/fltini.hxx
@@ -62,7 +62,7 @@ public:
// the special writers
-void GetWW8Writer(const OUString&, const OUString&, WriterRef&);
+void GetWW8Writer(std::u16string_view, const OUString&, WriterRef&);
// Get size of fly (if 'automatic' in WW) and check if not too small
SW_DLLPUBLIC void CalculateFlySize(SfxItemSet& rFlySet, const SwNodeIndex& rAnchor,
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index acfca6354c43..6c8880aca65d 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -1468,8 +1468,8 @@ ErrCode SwRTFWriter::WriteStream()
return ERRCODE_NONE;
}
-extern "C" SAL_DLLPUBLIC_EXPORT void ExportRTF(const OUString& rFltName, const OUString& rBaseURL,
- WriterRef& xRet)
+extern "C" SAL_DLLPUBLIC_EXPORT void ExportRTF(std::u16string_view rFltName,
+ const OUString& rBaseURL, WriterRef& xRet)
{
xRet = new SwRTFWriter(rFltName, rBaseURL);
}
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 4550a88ef7e9..44196f0207d9 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -3942,7 +3942,7 @@ MSWordSections& WW8Export::Sections() const
return *m_pSepx;
}
-SwWW8Writer::SwWW8Writer(const OUString& rFltName, const OUString& rBaseURL)
+SwWW8Writer::SwWW8Writer(std::u16string_view rFltName, const OUString& rBaseURL)
: m_pExport( nullptr ),
mpMedium( nullptr )
{
@@ -3961,7 +3961,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT sal_uInt32 SaveOrDelMSVBAStorage_ww8( SfxObjectS
return sal_uInt32(aTmp.SaveOrDelMSVBAStorage( bSaveInto, rStorageName ));
}
-extern "C" SAL_DLLPUBLIC_EXPORT void ExportDOC( const OUString& rFltName, const OUString& rBaseURL, WriterRef& xRet )
+extern "C" SAL_DLLPUBLIC_EXPORT void ExportDOC( std::u16string_view rFltName, const OUString& rBaseURL, WriterRef& xRet )
{
xRet = new SwWW8Writer( rFltName, rBaseURL );
}
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index ef5eea2d0c13..fc2e6e07a467 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -943,7 +943,7 @@ friend void WW8_WrtRedlineAuthor::Write(Writer &rWrt);
SfxMedium *mpMedium;
public:
- SwWW8Writer(const OUString& rFltName, const OUString& rBaseURL);
+ SwWW8Writer(std::u16string_view rFltName, const OUString& rBaseURL);
virtual ~SwWW8Writer() override;
virtual ErrCode WriteStorage() override;
diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx
index 830d989c8b5e..bd9a4c4c8be5 100644
--- a/sw/source/filter/xml/wrtxml.cxx
+++ b/sw/source/filter/xml/wrtxml.cxx
@@ -579,7 +579,7 @@ bool SwXMLWriter::WriteThroughComponent(
}
void GetXMLWriter(
- [[maybe_unused]] const OUString& /*rName*/, const OUString& rBaseURL, WriterRef& xRet )
+ [[maybe_unused]] std::u16string_view /*rName*/, const OUString& rBaseURL, WriterRef& xRet )
{
xRet = new SwXMLWriter( rBaseURL );
}
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index caa360f50fbd..db389061771e 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -291,7 +291,7 @@ bool SwDocShell::Save()
case SfxObjectCreateMode::ORGANIZER:
{
WriterRef xWrt;
- ::GetXMLWriter(OUString(), GetMedium()->GetBaseURL(true), xWrt);
+ ::GetXMLWriter(std::u16string_view(), GetMedium()->GetBaseURL(true), xWrt);
xWrt->SetOrganizerMode( true );
SwWriter aWrt( *GetMedium(), *m_xDoc );
nErr = aWrt.Write( xWrt );
@@ -319,7 +319,7 @@ bool SwDocShell::Save()
m_pWrtShell->EndAllTableBoxEdit();
WriterRef xWrt;
- ::GetXMLWriter(OUString(), GetMedium()->GetBaseURL(true), xWrt);
+ ::GetXMLWriter(std::u16string_view(), GetMedium()->GetBaseURL(true), xWrt);
bool bLockedView(false);
if (m_pWrtShell)
@@ -533,7 +533,7 @@ bool SwDocShell::SaveAs( SfxMedium& rMedium )
SfxObjectCreateMode::EMBEDDED == GetCreateMode() );
WriterRef xWrt;
- ::GetXMLWriter(OUString(), rMedium.GetBaseURL(true), xWrt);
+ ::GetXMLWriter(std::u16string_view(), rMedium.GetBaseURL(true), xWrt);
bool bLockedView(false);
if (m_pWrtShell)
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index 4ae4b02ac42a..a443e1574c78 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -760,7 +760,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
{
WriterRef xWrt;
// mba: looks as if relative URLs don't make sense here
- ::GetRTFWriter(OUString(), OUString(), xWrt);
+ ::GetRTFWriter(std::u16string_view(), OUString(), xWrt);
SvMemoryStream *pStrm = new SvMemoryStream();
pStrm->SetBufferSize( 16348 );
SwWriter aWrt( *pStrm, *pSmryDoc );
@@ -818,7 +818,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
EnableSetModified( false );
WriterRef xWrt;
// mba: looks as if relative URLs don't make sense here
- ::GetRTFWriter( OUString('O'), OUString(), xWrt );
+ ::GetRTFWriter( u"O", OUString(), xWrt );
std::unique_ptr<SvMemoryStream> pStrm (new SvMemoryStream());
pStrm->SetBufferSize( 16348 );
SwWriter aWrt( *pStrm, *GetDoc() );
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index 004e57c24b3e..7eccec3e1196 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -793,11 +793,11 @@ bool SwTransferable::WriteObject( tools::SvRef<SotTempStream>& xStream,
case SWTRANSFER_OBJECTTYPE_RTF:
case SWTRANSFER_OBJECTTYPE_RICHTEXT:
- GetRTFWriter(OUString(), OUString(), xWrt);
+ GetRTFWriter(std::u16string_view(), OUString(), xWrt);
break;
case SWTRANSFER_OBJECTTYPE_STRING:
- GetASCWriter(OUString(), OUString(), xWrt);
+ GetASCWriter(std::u16string_view(), OUString(), xWrt);
if( xWrt.is() )
{
SwAsciiOptions aAOpt;
diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx
index e4a1e0891e82..a3e4ca436131 100644
--- a/sw/source/uibase/uiview/srcview.cxx
+++ b/sw/source/uibase/uiview/srcview.cxx
@@ -806,7 +806,7 @@ void SwSrcView::Load(SwDocShell* pDocShell)
SfxMedium aMedium( sFileURL,StreamMode::READWRITE );
SwWriter aWriter( aMedium, *pDocShell->GetDoc() );
WriterRef xWriter;
- ::GetHTMLWriter(OUString(), aMedium.GetBaseURL( true ), xWriter);
+ ::GetHTMLWriter(std::u16string_view(), aMedium.GetBaseURL( true ), xWriter);
const OUString sWriteName = pDocShell->HasName()
? pMedium->GetName()
: sFileURL;