summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-04-26 14:03:48 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-04-27 20:31:14 +0200
commit48e279c6748bf023fba12fdc3f4cee402f611c6e (patch)
tree2e1b3a20ccd71f47a66938f882c1fe9d5e947bb4 /sw/source
parentf3665d2a42b39814764f3eb9e20498b8a4be1d00 (diff)
use string_view in INetURLObject::decode
Change-Id: I10e04970ceac33c9c3fbfd0182dd2140e06cb80b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114658 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/doc/DocumentLinksAdministrationManager.cxx2
-rw-r--r--sw/source/core/inc/DocumentLinksAdministrationManager.hxx3
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx2
-rw-r--r--sw/source/filter/ww8/docxexport.cxx36
-rw-r--r--sw/source/filter/ww8/docxexport.hxx2
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx4
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx18
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx2
-rw-r--r--sw/source/filter/ww8/ww8par.hxx4
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx2
-rw-r--r--sw/source/ui/dialog/uiregionsw.cxx16
-rw-r--r--sw/source/uibase/docvw/edtwin3.cxx2
-rw-r--r--sw/source/uibase/uiview/view2.cxx4
13 files changed, 49 insertions, 48 deletions
diff --git a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
index 85a4d3a12856..6b4687aa8982 100644
--- a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
+++ b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
@@ -442,7 +442,7 @@ DocumentLinksAdministrationManager::~DocumentLinksAdministrationManager()
{
}
-bool DocumentLinksAdministrationManager::SelectServerObj( const OUString& rStr, SwPaM*& rpPam, std::unique_ptr<SwNodeRange>& rpRange ) const
+bool DocumentLinksAdministrationManager::SelectServerObj( std::u16string_view rStr, SwPaM*& rpPam, std::unique_ptr<SwNodeRange>& rpRange ) const
{
// Do we actually have the Item?
rpPam = nullptr;
diff --git a/sw/source/core/inc/DocumentLinksAdministrationManager.hxx b/sw/source/core/inc/DocumentLinksAdministrationManager.hxx
index 7afae81ca880..e03d969d211b 100644
--- a/sw/source/core/inc/DocumentLinksAdministrationManager.hxx
+++ b/sw/source/core/inc/DocumentLinksAdministrationManager.hxx
@@ -23,6 +23,7 @@
#include <IDocumentLinksAdministration.hxx>
#include <memory>
+#include <string_view>
namespace sfx2 { class LinkManager; }
class SwDoc;
@@ -61,7 +62,7 @@ public:
bool LinksUpdated() const override;
//Non-Interface method
- bool SelectServerObj( const OUString& rStr, SwPaM*& rpPam, std::unique_ptr<SwNodeRange>& rpRange ) const;
+ bool SelectServerObj( std::u16string_view rStr, SwPaM*& rpPam, std::unique_ptr<SwNodeRange>& rpRange ) const;
virtual ~DocumentLinksAdministrationManager() override;
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 48f1e1512f79..c7f672ae4f58 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -7131,7 +7131,7 @@ void DocxAttributeOutput::EmbedFontStyle( std::u16string_view name, int tag, Fon
xOutStream->closeOutput();
OString relId = OUStringToOString( GetExport().GetFilter().addRelation( m_pSerializer->getOutputStream(),
oox::getRelationship(Relationship::FONT),
- "fonts/font" + OUString::number( m_nextFontId ) + ".odttf" ), RTL_TEXTENCODING_UTF8 );
+ OUString("fonts/font" + OUString::number( m_nextFontId ) + ".odttf") ), RTL_TEXTENCODING_UTF8 );
EmbeddedFontRef ref;
ref.relId = relId;
ref.fontKey = fontKeyStr;
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index c3e5adc49331..429ae90f7775 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -216,7 +216,7 @@ void DocxExport::ExportGrfBullet(const SwTextNode&)
CollectGrfsOfBullets();
}
-OString DocxExport::AddRelation( const OUString& rType, const OUString& rTarget )
+OString DocxExport::AddRelation( const OUString& rType, std::u16string_view rTarget )
{
OUString sId = m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
rType, rTarget, true );
@@ -474,7 +474,7 @@ std::pair<OString, OString> DocxExport::WriteActiveXObject(const uno::Reference<
const OUString sBinaryId = m_rFilter.addRelation( pActiveXFS->getOutputStream(),
oox::getRelationship(Relationship::ACTIVEXCONTROLBINARY),
- sBinaryFileName.copy(sBinaryFileName.lastIndexOf("/") + 1) );
+ sBinaryFileName.subView(sBinaryFileName.lastIndexOf("/") + 1) );
pActiveXFS->singleElementNS(XML_ax, XML_ocx,
FSNS(XML_xmlns, XML_ax), m_rFilter.getNamespaceURL(OOX_NS(ax)),
@@ -485,7 +485,7 @@ std::pair<OString, OString> DocxExport::WriteActiveXObject(const uno::Reference<
OString sXMLId = OUStringToOString(m_rFilter.addRelation(m_pDocumentFS->getOutputStream(),
oox::getRelationship(Relationship::CONTROL),
- sXMLFileName.copy(sBinaryFileName.indexOf("/") + 1)),
+ sXMLFileName.subView(sBinaryFileName.indexOf("/") + 1)),
RTL_TEXTENCODING_UTF8);
return std::pair<OString, OString>(sXMLId, sName);
@@ -648,7 +648,7 @@ void DocxExport::InitStyles()
// setup word/styles.xml and the relations + content type
m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
oox::getRelationship(Relationship::STYLES),
- "styles.xml" );
+ u"styles.xml" );
::sax_fastparser::FSHelperPtr pStylesFS =
m_rFilter.openFragmentStreamWithSerializer( "word/styles.xml",
@@ -671,7 +671,7 @@ void DocxExport::WriteFootnotesEndnotes()
// setup word/styles.xml and the relations + content type
m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
oox::getRelationship(Relationship::FOOTNOTES),
- "footnotes.xml" );
+ u"footnotes.xml" );
::sax_fastparser::FSHelperPtr pFootnotesFS =
m_rFilter.openFragmentStreamWithSerializer( "word/footnotes.xml",
@@ -699,7 +699,7 @@ void DocxExport::WriteFootnotesEndnotes()
// setup word/styles.xml and the relations + content type
m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
oox::getRelationship(Relationship::ENDNOTES),
- "endnotes.xml" );
+ u"endnotes.xml" );
::sax_fastparser::FSHelperPtr pEndnotesFS =
m_rFilter.openFragmentStreamWithSerializer( "word/endnotes.xml",
@@ -728,7 +728,7 @@ void DocxExport::WritePostitFields()
m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
oox::getRelationship(Relationship::COMMENTS),
- "comments.xml" );
+ u"comments.xml" );
::sax_fastparser::FSHelperPtr pPostitFS =
m_rFilter.openFragmentStreamWithSerializer( "word/comments.xml",
@@ -745,7 +745,7 @@ void DocxExport::WritePostitFields()
m_rFilter.addRelation(m_pDocumentFS->getOutputStream(),
oox::getRelationship(Relationship::COMMENTSEXTENDED),
- "commentsExtended.xml");
+ u"commentsExtended.xml");
pPostitFS = m_rFilter.openFragmentStreamWithSerializer(
"word/commentsExtended.xml",
@@ -768,7 +768,7 @@ void DocxExport::WriteNumbering()
m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
oox::getRelationship(Relationship::NUMBERING),
- "numbering.xml" );
+ u"numbering.xml" );
::sax_fastparser::FSHelperPtr pNumberingFS = m_rFilter.openFragmentStreamWithSerializer( "word/numbering.xml",
"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml" );
@@ -875,7 +875,7 @@ void DocxExport::WriteFonts()
{
m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
oox::getRelationship(Relationship::FONTTABLE),
- "fontTable.xml" );
+ u"fontTable.xml" );
::sax_fastparser::FSHelperPtr pFS = m_rFilter.openFragmentStreamWithSerializer(
"word/fontTable.xml",
@@ -993,7 +993,7 @@ void DocxExport::WriteSettings()
m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
oox::getRelationship(Relationship::SETTINGS),
- "settings.xml" );
+ u"settings.xml" );
::sax_fastparser::FSHelperPtr pFS = m_rFilter.openFragmentStreamWithSerializer(
"word/settings.xml",
@@ -1381,7 +1381,7 @@ void DocxExport::WriteTheme()
m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
oox::getRelationship(Relationship::THEME),
- "theme/theme1.xml" );
+ u"theme/theme1.xml" );
uno::Reference< xml::sax::XSAXSerializable > serializer( themeDom, uno::UNO_QUERY );
uno::Reference< xml::sax::XWriter > writer = xml::sax::Writer::create( comphelper::getProcessComponentContext() );
@@ -1428,7 +1428,7 @@ void DocxExport::WriteGlossary()
m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
oox::getRelationship(Relationship::GLOSSARYDOCUMENT),
- "glossary/document.xml" );
+ u"glossary/document.xml" );
uno::Reference< io::XOutputStream > xOutputStream = GetFilter().openFragmentStream( "word/glossary/document.xml",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml" );
@@ -1491,7 +1491,7 @@ void DocxExport::WriteCustomXml()
{
m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
oox::getRelationship(Relationship::CUSTOMXML),
- "../customXml/item"+OUString::number((j+1))+".xml" );
+ OUString("../customXml/item"+OUString::number((j+1))+".xml" ));
uno::Reference< xml::sax::XSAXSerializable > serializer( customXmlDom, uno::UNO_QUERY );
uno::Reference< xml::sax::XWriter > writer = xml::sax::Writer::create( comphelper::getProcessComponentContext() );
@@ -1514,7 +1514,7 @@ void DocxExport::WriteCustomXml()
m_rFilter.addRelation( GetFilter().openFragmentStream( "customXml/item"+OUString::number((j+1))+".xml",
"application/xml" ) ,
oox::getRelationship(Relationship::CUSTOMXMLPROPS),
- "itemProps"+OUString::number((j+1))+".xml" );
+ OUString("itemProps"+OUString::number((j+1))+".xml" ));
}
}
}
@@ -1548,7 +1548,7 @@ void DocxExport::WriteVBA()
pOut->WriteStream(*pIn);
// Write the relationship.
- m_rFilter.addRelation(m_pDocumentFS->getOutputStream(), oox::getRelationship(Relationship::VBAPROJECT), "vbaProject.bin");
+ m_rFilter.addRelation(m_pDocumentFS->getOutputStream(), oox::getRelationship(Relationship::VBAPROJECT), u"vbaProject.bin");
}
OUString aDataName("_MS_VBA_Macros_XML");
@@ -1575,7 +1575,7 @@ void DocxExport::WriteVBA()
if (!xProjectStream.is())
return;
- m_rFilter.addRelation(xProjectStream, oox::getRelationship(Relationship::WORDVBADATA), "vbaData.xml");
+ m_rFilter.addRelation(xProjectStream, oox::getRelationship(Relationship::WORDVBADATA), u"vbaData.xml");
}
void DocxExport::WriteEmbeddings()
@@ -1804,7 +1804,7 @@ DocxExport::DocxExport(DocxExportFilter& rFilter, SwDoc& rDocument,
// relations for the document
m_rFilter.addRelation( oox::getRelationship(Relationship::OFFICEDOCUMENT),
- "word/document.xml" );
+ u"word/document.xml" );
// Set media type depending of document type
OUString aMediaType;
diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx
index 08c5372460fd..381de49a7ef4 100644
--- a/sw/source/filter/ww8/docxexport.hxx
+++ b/sw/source/filter/ww8/docxexport.hxx
@@ -150,7 +150,7 @@ public:
virtual void ExportGrfBullet(const SwTextNode&) override;
/// Returns the relationd id
- OString AddRelation( const OUString& rType, const OUString& rTarget );
+ OString AddRelation( const OUString& rType, std::u16string_view rTarget );
virtual void WriteCR( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner = ww8::WW8TableNodeInfoInner::Pointer_t()*/ ) override { /* FIXME no-op for docx, most probably should not even be in MSWordExportBase */ }
virtual void WriteChar( sal_Unicode ) override { SAL_WARN("sw.ww8", "FIXME: WriteChar() has nothing to do for docx."); }
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index c2e72732878a..da5253f723b7 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -975,7 +975,7 @@ bool AttributeOutputBase::AnalyzeURL( const OUString& rUrl, const OUString& /*rT
if ( rUrl.getLength() > 1 && rUrl[0] == '#' )
{
- sMark = BookmarkToWriter( rUrl.copy(1) );
+ sMark = BookmarkToWriter( rUrl.subView(1) );
const sal_Int32 nPos = sMark.lastIndexOf( cMarkSeparator );
@@ -1221,7 +1221,7 @@ OUString BookmarkToWord(const OUString &rBookmark)
return TruncateBookmark(sRet);
}
-OUString BookmarkToWriter(const OUString &rBookmark)
+OUString BookmarkToWriter(std::u16string_view rBookmark)
{
return INetURLObject::decode(rBookmark,
INetURLObject::DecodeMechanism::Unambiguous, RTL_TEXTENCODING_ASCII_US);
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index d5d708b97398..d8e4241422c8 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -3121,12 +3121,12 @@ void WW8Export::StoreDoc1()
WriteFkpPlcUsw(); // FKP, PLC, ...
}
-void MSWordExportBase::AddLinkTarget(const OUString& rURL)
+void MSWordExportBase::AddLinkTarget(std::u16string_view rURL)
{
- if( rURL.isEmpty() || rURL[0] != '#' )
+ if( rURL.empty() || rURL[0] != '#' )
return;
- OUString aURL( BookmarkToWriter( rURL.copy( 1 ) ) );
+ OUString aURL( BookmarkToWriter( rURL.substr( 1 ) ) );
sal_Int32 nPos = aURL.lastIndexOf( cMarkSeparator );
if( nPos < 2 )
@@ -3143,7 +3143,7 @@ void MSWordExportBase::AddLinkTarget(const OUString& rURL)
if( sCmp == "outline" )
{
SwPosition aPos(*m_pCurPam->GetPoint());
- OUString aName(BookmarkToWriter(aURL.copy(0, nPos)));
+ OUString aName(BookmarkToWriter(aURL.subView(0, nPos)));
// If we can find the outline this bookmark refers to
// save the name of the bookmark and the
// node index number of where it points to
@@ -3156,7 +3156,7 @@ void MSWordExportBase::AddLinkTarget(const OUString& rURL)
else if( sCmp == "graphic" )
{
SwNodeIndex* pIdx;
- OUString aName(BookmarkToWriter(aURL.copy(0, nPos)));
+ OUString aName(BookmarkToWriter(aURL.subView(0, nPos)));
const SwFlyFrameFormat* pFormat = m_rDoc.FindFlyByName(aName, SwNodeType::Grf);
if (pFormat && nullptr != (pIdx = const_cast<SwNodeIndex*>(pFormat->GetContent().GetContentIdx())))
{
@@ -3167,7 +3167,7 @@ void MSWordExportBase::AddLinkTarget(const OUString& rURL)
else if( sCmp == "frame" )
{
SwNodeIndex* pIdx;
- OUString aName(BookmarkToWriter(aURL.copy(0, nPos)));
+ OUString aName(BookmarkToWriter(aURL.subView(0, nPos)));
const SwFlyFrameFormat* pFormat = m_rDoc.FindFlyByName(aName, SwNodeType::Text);
if (pFormat && nullptr != (pIdx = const_cast<SwNodeIndex*>(pFormat->GetContent().GetContentIdx())))
{
@@ -3178,7 +3178,7 @@ void MSWordExportBase::AddLinkTarget(const OUString& rURL)
else if( sCmp == "ole" )
{
SwNodeIndex* pIdx;
- OUString aName(BookmarkToWriter(aURL.copy(0, nPos)));
+ OUString aName(BookmarkToWriter(aURL.subView(0, nPos)));
const SwFlyFrameFormat* pFormat = m_rDoc.FindFlyByName(aName, SwNodeType::Ole);
if (pFormat && nullptr != (pIdx = const_cast<SwNodeIndex*>(pFormat->GetContent().GetContentIdx())))
{
@@ -3189,7 +3189,7 @@ void MSWordExportBase::AddLinkTarget(const OUString& rURL)
else if( sCmp == "region" )
{
SwNodeIndex* pIdx;
- OUString aName(BookmarkToWriter(aURL.copy(0, nPos)));
+ OUString aName(BookmarkToWriter(aURL.subView(0, nPos)));
for (const SwSectionFormat* pFormat : m_rDoc.GetSections())
{
if (aName == pFormat->GetSection()->GetSectionName()
@@ -3203,7 +3203,7 @@ void MSWordExportBase::AddLinkTarget(const OUString& rURL)
}
else if( sCmp == "table" )
{
- OUString aName(BookmarkToWriter(aURL.copy(0, nPos)));
+ OUString aName(BookmarkToWriter(aURL.subView(0, nPos)));
const SwTable* pTable = SwTable::FindTable(m_rDoc.FindTableFormatByName(aName));
if (pTable)
{
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 15e0d902731b..d5835a289492 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -834,7 +834,7 @@ protected:
/// Setup the chapter fields (maChapterFieldLocs).
void GatherChapterFields();
- void AddLinkTarget( const OUString& rURL );
+ void AddLinkTarget( std::u16string_view rURL );
void CollectOutlineBookmarks( const SwDoc &rDoc );
bool SetCurrentPageDescFromNode(const SwNode &rNd);
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 97bff178f66e..d43182d2e93a 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -1837,7 +1837,7 @@ public: // really private, but can only be done public
void Read_UnderlineColor(sal_uInt16, const sal_uInt8* pData, short nLen);
tools::Long MapBookmarkVariables(const WW8FieldDesc* pF, OUString &rOrigName,
const OUString &rData);
- OUString GetMappedBookmark(const OUString &rOrigName);
+ OUString GetMappedBookmark(std::u16string_view rOrigName);
// fields
eF_ResT Read_F_Input(WW8FieldDesc*, OUString& rStr);
@@ -1932,7 +1932,7 @@ void SyncIndentWithList( SvxLRSpaceItem &rLR,
const bool bFirstLineOfStSet,
const bool bLeftIndentSet );
tools::Long GetListFirstLineIndent(const SwNumFormat &rFormat);
-OUString BookmarkToWriter(const OUString &rBookmark);
+OUString BookmarkToWriter(std::u16string_view rBookmark);
bool RTLGraphicsHack(SwTwips &rLeft, SwTwips nWidth,
sal_Int16 eHoriOri, sal_Int16 eHoriRel, SwTwips nPageLeft,
SwTwips nPageRight, SwTwips nPageSize);
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index ad20690464ef..1bd48126ed35 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -1341,7 +1341,7 @@ SwFltStackEntry *SwWW8FltRefStack::RefToVar(const SwField* pField,
return pRet;
}
-OUString SwWW8ImplReader::GetMappedBookmark(const OUString &rOrigName)
+OUString SwWW8ImplReader::GetMappedBookmark(std::u16string_view rOrigName)
{
OUString sName(BookmarkToWriter(rOrigName));
OSL_ENSURE(m_xPlcxMan, "no pPlcxMan");
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index e905bc2a79cc..18c3d6f2476a 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -172,7 +172,7 @@ public:
size_t GetArrPos() const { return m_nArrPos; }
OUString GetFile() const;
OUString GetSubRegion() const;
- void SetFile(OUString const& rFile);
+ void SetFile(std::u16string_view rFile);
void SetFilter(std::u16string_view rFilter);
void SetSubRegion(std::u16string_view rSubRegion);
@@ -209,17 +209,17 @@ SectRepr::SectRepr( size_t nPos, SwSection& rSect )
}
}
-void SectRepr::SetFile( const OUString& rFile )
+void SectRepr::SetFile( std::u16string_view rFile )
{
OUString sNewFile( INetURLObject::decode( rFile,
INetURLObject::DecodeMechanism::Unambiguous ));
const OUString sOldFileName( m_SectionData.GetLinkFileName() );
const OUString sSub( sOldFileName.getToken( 2, sfx2::cTokenSeparator ) );
- if( !rFile.isEmpty() || !sSub.isEmpty() )
+ if( !rFile.empty() || !sSub.isEmpty() )
{
sNewFile += OUStringChar(sfx2::cTokenSeparator);
- if( !rFile.isEmpty() ) // Filter only with FileName
+ if( !rFile.empty() ) // Filter only with FileName
sNewFile += sOldFileName.getToken( 1, sfx2::cTokenSeparator );
sNewFile += OUStringChar(sfx2::cTokenSeparator) + sSub;
@@ -227,7 +227,7 @@ void SectRepr::SetFile( const OUString& rFile )
m_SectionData.SetLinkFileName( sNewFile );
- if( !rFile.isEmpty() || !sSub.isEmpty() )
+ if( !rFile.empty() || !sSub.isEmpty() )
{
m_SectionData.SetType( SectionType::FileLink );
}
@@ -943,7 +943,7 @@ IMPL_LINK(SwEditRegionDlg, UseFileHdl, weld::ToggleButton&, rButton, void)
pSectRepr->SetContent(false);
else
{
- pSectRepr->SetFile(OUString());
+ pSectRepr->SetFile(u"");
pSectRepr->SetSubRegion(std::u16string_view());
pSectRepr->GetSectionData().SetLinkFilePassword(OUString());
}
@@ -1151,7 +1151,7 @@ IMPL_LINK(SwEditRegionDlg, DDEHdl, weld::ToggleButton&, rButton, void)
m_xSubRegionED->hide();
if (SectionType::FileLink == rData.GetType())
{
- pSectRepr->SetFile(OUString());
+ pSectRepr->SetFile(u"");
m_xFileNameED->set_text(OUString());
rData.SetLinkFilePassword(OUString());
}
@@ -1170,7 +1170,7 @@ IMPL_LINK(SwEditRegionDlg, DDEHdl, weld::ToggleButton&, rButton, void)
if (SectionType::DdeLink == rData.GetType())
{
rData.SetType(SectionType::FileLink);
- pSectRepr->SetFile(OUString());
+ pSectRepr->SetFile(u"");
rData.SetLinkFilePassword(OUString());
m_xFileNameED->set_text(OUString());
}
diff --git a/sw/source/uibase/docvw/edtwin3.cxx b/sw/source/uibase/docvw/edtwin3.cxx
index d90df78919d5..d417b08b0510 100644
--- a/sw/source/uibase/docvw/edtwin3.cxx
+++ b/sw/source/uibase/docvw/edtwin3.cxx
@@ -114,7 +114,7 @@ void RepaintPagePreview( SwViewShell const * pVwSh, const SwRect& rRect )
pSwPagePreview->RepaintCoreRect(rRect);
}
-bool JumpToSwMark( SwViewShell const * pVwSh, const OUString& rMark )
+bool JumpToSwMark( SwViewShell const * pVwSh, std::u16string_view rMark )
{
SfxViewShell *pSfxViewShell = pVwSh->GetSfxViewShell();
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index db33b8c77c1d..39752c694d31 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -2155,10 +2155,10 @@ static auto JumpToTOXMark(SwWrtShell & rSh, OUString const& rName) -> bool
}
}
-bool SwView::JumpToSwMark( const OUString& rMark )
+bool SwView::JumpToSwMark( std::u16string_view rMark )
{
bool bRet = false;
- if( !rMark.isEmpty() )
+ if( !rMark.empty() )
{
// place bookmark at top-center
bool bSaveCC = m_bCenterCursor;