summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--comphelper/qa/string/test_string.cxx2
-rw-r--r--comphelper/source/misc/string.cxx55
-rw-r--r--dbaccess/source/filter/hsqldb/createparser.cxx4
-rw-r--r--dbaccess/source/filter/hsqldb/createparser.hxx2
-rw-r--r--include/comphelper/string.hxx4
-rw-r--r--sd/qa/unit/tiledrendering/CallbackRecorder.hxx2
-rw-r--r--sd/qa/unit/tiledrendering/tiledrendering.cxx2
-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
-rw-r--r--vcl/source/uitest/uiobject.cxx2
-rw-r--r--writerfilter/source/dmapper/SdtHelper.cxx2
27 files changed, 112 insertions, 62 deletions
diff --git a/comphelper/qa/string/test_string.cxx b/comphelper/qa/string/test_string.cxx
index 0619b873e0fb..5d3132756ad5 100644
--- a/comphelper/qa/string/test_string.cxx
+++ b/comphelper/qa/string/test_string.cxx
@@ -373,7 +373,7 @@ void TestString::testReverseString()
void TestString::testSplit()
{
- std::vector<OUString> aRet = ::comphelper::string::split("CTRL+ALT+F1", '+');
+ std::vector<OUString> aRet = ::comphelper::string::split(u"CTRL+ALT+F1", '+');
CPPUNIT_ASSERT_EQUAL(size_t(3), aRet.size());
CPPUNIT_ASSERT_EQUAL(OUString("CTRL"), aRet[0]);
CPPUNIT_ASSERT_EQUAL(OUString("ALT"), aRet[1]);
diff --git a/comphelper/source/misc/string.cxx b/comphelper/source/misc/string.cxx
index a3ee9bc58521..acdb6c88adcb 100644
--- a/comphelper/source/misc/string.cxx
+++ b/comphelper/source/misc/string.cxx
@@ -261,15 +261,62 @@ OUString convertCommaSeparated(
return buf.makeStringAndClear();
}
+/* copy of getToken from sal/, modified to take a string_view */
+static sal_Int32 getToken( OUString& ppThis,
+ std::u16string_view pStr,
+ sal_Int32 nToken,
+ sal_Unicode cTok,
+ sal_Int32 nIndex )
+{
+ assert(nIndex <= static_cast<sal_Int32>(pStr.size()));
+
+ // Set ppThis to an empty string and return -1 if either nToken or nIndex is
+ // negative:
+ if (nIndex >= 0 && nToken >= 0)
+ {
+ const auto* pOrgCharStr = pStr.data();
+ const auto* pCharStr = pOrgCharStr + nIndex;
+ sal_Int32 nLen = pStr.size() - nIndex;
+ sal_Int32 nTokCount = 0;
+ const auto* pCharStrStart = pCharStr;
+ while (nLen > 0)
+ {
+ if (*pCharStr == cTok)
+ {
+ nTokCount++;
+
+ if (nTokCount > nToken)
+ break;
+ if (nTokCount == nToken)
+ pCharStrStart = pCharStr + 1;
+ }
+
+ pCharStr++;
+ nLen--;
+ }
+ if (nTokCount >= nToken)
+ {
+ ppThis = OUString(pCharStrStart, pCharStr - pCharStrStart);
+ if (nLen > 0)
+ return pCharStr - pOrgCharStr + 1;
+ else
+ return -1;
+ }
+ }
+
+ ppThis.clear();
+ return -1;
+}
+
std::vector<OUString>
- split(const OUString& rStr, sal_Unicode cSeparator)
+ split(std::u16string_view rStr, sal_Unicode cSeparator)
{
std::vector< OUString > vec;
sal_Int32 idx = 0;
do
{
- OUString kw =
- rStr.getToken(0, cSeparator, idx);
+ OUString kw;
+ idx = getToken(kw, rStr, 0, cSeparator, idx);
kw = kw.trim();
if (!kw.isEmpty())
{
@@ -282,7 +329,7 @@ std::vector<OUString>
}
uno::Sequence< OUString >
- convertCommaSeparated( OUString const& i_rString )
+ convertCommaSeparated( std::u16string_view i_rString )
{
std::vector< OUString > vec = split(i_rString, ',');
return comphelper::containerToSequence(vec);
diff --git a/dbaccess/source/filter/hsqldb/createparser.cxx b/dbaccess/source/filter/hsqldb/createparser.cxx
index 9dfe2b2c53d7..67607ac8aae2 100644
--- a/dbaccess/source/filter/hsqldb/createparser.cxx
+++ b/dbaccess/source/filter/hsqldb/createparser.cxx
@@ -47,7 +47,7 @@ OUString lcl_getColumnPart(const OUString& sSql)
///
/// @param sColumnPart part of the create statement inside the parenthesis
/// containing the column definitions
-std::vector<OUString> lcl_splitColumnPart(const OUString& sColumnPart)
+std::vector<OUString> lcl_splitColumnPart(std::u16string_view sColumnPart)
{
std::vector<OUString> sParts = string::split(sColumnPart, sal_Unicode(u','));
std::vector<OUString> sReturn;
@@ -214,7 +214,7 @@ void CreateStmtParser::parsePrimaryKeys(const OUString& sPrimaryPart)
}
}
-void CreateStmtParser::parseColumnPart(const OUString& sColumnPart)
+void CreateStmtParser::parseColumnPart(std::u16string_view sColumnPart)
{
auto sColumns = lcl_splitColumnPart(sColumnPart);
for (const OUString& sColumn : sColumns)
diff --git a/dbaccess/source/filter/hsqldb/createparser.hxx b/dbaccess/source/filter/hsqldb/createparser.hxx
index 909b4063ac58..85610ebfd3f3 100644
--- a/dbaccess/source/filter/hsqldb/createparser.hxx
+++ b/dbaccess/source/filter/hsqldb/createparser.hxx
@@ -23,7 +23,7 @@ private:
OUString m_sTableName;
protected:
- void parseColumnPart(const OUString& sColumnPart);
+ void parseColumnPart(std::u16string_view sColumnPart);
void parsePrimaryKeys(const OUString& sPrimaryPart);
public:
diff --git a/include/comphelper/string.hxx b/include/comphelper/string.hxx
index 5e5c4c4a28ab..6ada67a6a381 100644
--- a/include/comphelper/string.hxx
+++ b/include/comphelper/string.hxx
@@ -289,7 +289,7 @@ COMPHELPER_DLLPUBLIC sal_uInt32 decimalStringToNumber(
OUString const & str );
COMPHELPER_DLLPUBLIC std::vector<OUString>
- split(const OUString& rString, const sal_Unicode cSeparator);
+ split(std::u16string_view rString, const sal_Unicode cSeparator);
/** Convert a single comma separated string to a sequence of strings.
@@ -301,7 +301,7 @@ COMPHELPER_DLLPUBLIC std::vector<OUString>
string at ',' tokens and stripping whitespace.
*/
COMPHELPER_DLLPUBLIC css::uno::Sequence< OUString >
- convertCommaSeparated( OUString const & i_rString );
+ convertCommaSeparated( std::u16string_view i_rString );
/**
Compares two strings using natural order.
diff --git a/sd/qa/unit/tiledrendering/CallbackRecorder.hxx b/sd/qa/unit/tiledrendering/CallbackRecorder.hxx
index c37ec57d9495..93b58cd04ead 100644
--- a/sd/qa/unit/tiledrendering/CallbackRecorder.hxx
+++ b/sd/qa/unit/tiledrendering/CallbackRecorder.hxx
@@ -38,7 +38,7 @@ std::vector<OUString> lcl_convertSeparated(const OUString& rString, sal_Unicode
return aRet;
}
-void lcl_convertRectangle(const OUString& rString, tools::Rectangle& rRectangle)
+void lcl_convertRectangle(std::u16string_view rString, tools::Rectangle& rRectangle)
{
uno::Sequence<OUString> aSeq = comphelper::string::convertCommaSeparated(rString);
CPPUNIT_ASSERT(aSeq.getLength() == 4 || aSeq.getLength() == 5);
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index ebab87741847..306cdbcf6b69 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -299,7 +299,7 @@ std::vector<OUString> lcl_convertSeparated(const OUString& rString, sal_Unicode
return aRet;
}
-void lcl_convertRectangle(const OUString& rString, ::tools::Rectangle& rRectangle)
+void lcl_convertRectangle(std::u16string_view rString, ::tools::Rectangle& rRectangle)
{
uno::Sequence<OUString> aSeq = comphelper::string::convertCommaSeparated(rString);
CPPUNIT_ASSERT(aSeq.getLength() == 4 || aSeq.getLength() == 5);
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;
diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx
index d44134cb7996..fa5c95346323 100644
--- a/vcl/source/uitest/uiobject.cxx
+++ b/vcl/source/uitest/uiobject.cxx
@@ -189,7 +189,7 @@ bool isFunctionKey(const OUString& rStr, sal_uInt16& rKeyCode)
return true;
}
-std::vector<KeyEvent> generate_key_events_from_keycode(const OUString& rStr)
+std::vector<KeyEvent> generate_key_events_from_keycode(std::u16string_view rStr)
{
std::vector<KeyEvent> aEvents;
diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx
index f05d1c68b049..6d02a044dae6 100644
--- a/writerfilter/source/dmapper/SdtHelper.cxx
+++ b/writerfilter/source/dmapper/SdtHelper.cxx
@@ -144,7 +144,7 @@ void SdtHelper::loadPropertiesXMLs()
m_bPropertiesXMLsLoaded = true;
}
-static void lcl_registerNamespaces(const OUString& sNamespaceString,
+static void lcl_registerNamespaces(std::u16string_view sNamespaceString,
const uno::Reference<XXPathAPI>& xXPathAPI)
{
// Split namespaces and register it in XPathAPI