diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-27 18:08:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-28 15:41:02 +0200 |
commit | 39c3574b799690d4405d9318a5ba221b5feaccbe (patch) | |
tree | 40cacd124e11dd71b23affec3713c6f0fef27906 /sw | |
parent | 9658115370bf33c2fdb68a3b759cf2f9d9e7c6c1 (diff) |
use string_view in INetURLObject::encode
Change-Id: Ib686c6872388b02c8939d3b65f6bd25cda348bc8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114754
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/htmlexport/htmlexport.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/doc/visiturl.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/swg/swblocks.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/html/htmlflywriter.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/html/htmlplug.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/dbui/createaddresslistdialog.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/app/docsh2.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/config/uinums.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/dbui/dbmgr.cxx | 2 |
9 files changed, 14 insertions, 14 deletions
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx index 37f92c99dbd4..69dbc5b615b2 100644 --- a/sw/qa/extras/htmlexport/htmlexport.cxx +++ b/sw/qa/extras/htmlexport/htmlexport.cxx @@ -280,8 +280,8 @@ OUString SwHtmlDomExportTest::GetOlePath() OUString aOleSuffix(".ole"); CPPUNIT_ASSERT(aOlePath.endsWith(aOleSuffix)); INetURLObject aUrl(maTempFile.GetURL()); - aUrl.setBase(aOlePath.copy(0, aOlePath.getLength() - aOleSuffix.getLength())); - aUrl.setExtension("ole"); + aUrl.setBase(aOlePath.subView(0, aOlePath.getLength() - aOleSuffix.getLength())); + aUrl.setExtension(u"ole"); return aUrl.GetMainURL(INetURLObject::DecodeMechanism::NONE); } @@ -853,8 +853,8 @@ DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testReqIfOle2, "reqif-ole2.xhtml") OUString aOleSuffix(".ole"); CPPUNIT_ASSERT(aOlePath.endsWith(aOleSuffix)); INetURLObject aUrl(maTempFile.GetURL()); - aUrl.setBase(aOlePath.copy(0, aOlePath.getLength() - aOleSuffix.getLength())); - aUrl.setExtension("ole"); + aUrl.setBase(aOlePath.subView(0, aOlePath.getLength() - aOleSuffix.getLength())); + aUrl.setExtension(u"ole"); OUString aOleUrl = aUrl.GetMainURL(INetURLObject::DecodeMechanism::NONE); // Search for \result in the RTF data. diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx index 1f462e06e448..c32e3317dc2d 100644 --- a/sw/source/core/doc/visiturl.cxx +++ b/sw/source/core/doc/visiturl.cxx @@ -106,7 +106,7 @@ bool SwDoc::IsVisitedURL( const OUString& rURL ) if( '#' == rURL[0] && mpDocShell && mpDocShell->GetMedium() ) { INetURLObject aIObj( mpDocShell->GetMedium()->GetURLObject() ); - aIObj.SetMark( rURL.copy( 1 ) ); + aIObj.SetMark( rURL.subView( 1 ) ); bRet = pHist->QueryUrl( aIObj ); } else diff --git a/sw/source/core/swg/swblocks.cxx b/sw/source/core/swg/swblocks.cxx index eac9494c69fe..e805cf096c0a 100644 --- a/sw/source/core/swg/swblocks.cxx +++ b/sw/source/core/swg/swblocks.cxx @@ -87,7 +87,7 @@ SwImpBlocks::SwImpBlocks( const OUString& rFile ) FStatHelper::GetModifiedDateTimeOfFile( rFile, &m_aDateModified, &m_aTimeModified ); INetURLObject aObj(rFile); - aObj.setExtension( OUString() ); + aObj.setExtension( u"" ); m_aName = aObj.GetBase(); } diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index 7064622fb7f9..bbc0874a4784 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -1874,7 +1874,7 @@ static Writer& OutHTML_FrameFormatGrfNode( Writer& rWrt, const SwFrameFormat& rF aURL.getExtension() + "_" + OUString::number(aGraphic.GetChecksum(), 16); aURL.setBase(aName); - aURL.setExtension("ole"); + aURL.setExtension(u"ole"); aFileName = aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE); SvFileStream aOutStream(aFileName, StreamMode::WRITE); diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index 9e82ac075e83..b18b695d27e8 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -142,7 +142,7 @@ namespace * itself and a wanted extension. */ OUString lcl_CalculateFileName(const OUString* pOrigFileName, const Graphic& rGraphic, - const OUString& rExtension) + std::u16string_view rExtension) { OUString aFileName; @@ -1522,7 +1522,7 @@ Writer& OutHTML_FrameFormatOLENodeGrf( Writer& rWrt, const SwFrameFormat& rFrame // Calculate the file name, which is meant to be the same as the // replacement image, just with a .ole extension. - OUString aFileName = lcl_CalculateFileName(rHTMLWrt.GetOrigFileName(), aGraphic, "ole"); + OUString aFileName = lcl_CalculateFileName(rHTMLWrt.GetOrigFileName(), aGraphic, u"ole"); // Write the data. SwOLEObj& rOLEObj = pOLENd->GetOLEObj(); @@ -1631,7 +1631,7 @@ Writer& OutHTML_FrameFormatOLENodeGrf( Writer& rWrt, const SwFrameFormat& rFrame if (aGraphic.GetType() == GraphicType::NONE) { // The OLE Object has no replacement image, write a stub. - aGraphicURL = lcl_CalculateFileName(rHTMLWrt.GetOrigFileName(), aGraphic, "png"); + aGraphicURL = lcl_CalculateFileName(rHTMLWrt.GetOrigFileName(), aGraphic, u"png"); osl::File aFile(aGraphicURL); aFile.open(osl_File_OpenFlag_Create); aFile.close(); diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx index 39a8a1dc8a59..068a8347cfdb 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.cxx +++ b/sw/source/ui/dbui/createaddresslistdialog.cxx @@ -431,7 +431,7 @@ IMPL_LINK_NOARG(SwCreateAddressListDialog, OkHdl_Impl, weld::Button&, void) { m_sURL = xFP->getSelectedFiles().getConstArray()[0]; INetURLObject aResult( m_sURL ); - aResult.setExtension("csv"); + aResult.setExtension(u"csv"); m_sURL = aResult.GetMainURL(INetURLObject::DecodeMechanism::NONE); } } diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index 6319a253c241..893872b66118 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -1657,7 +1657,7 @@ int SwFindDocShell( SfxObjectShellRef& xDocSh, // 1. Does the file already exist in the list of all Documents? INetURLObject aTmpObj( rFileName ); - aTmpObj.SetMark( OUString() ); + aTmpObj.SetMark( u"" ); // Iterate over the DocShell and get the ones with the name diff --git a/sw/source/uibase/config/uinums.cxx b/sw/source/uibase/config/uinums.cxx index 0c2602f48c5f..29b8a1f9a2c3 100644 --- a/sw/source/uibase/config/uinums.cxx +++ b/sw/source/uibase/config/uinums.cxx @@ -52,7 +52,7 @@ void SwChapterNumRules::Save() SvtPathOptions aPathOpt; aURL.SetSmartURL( aPathOpt.GetUserConfigPath() ); aURL.setFinalSlash(); - aURL.Append(CHAPTER_FILENAME); + aURL.Append(u"" CHAPTER_FILENAME); SfxMedium aMedium( aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE), StreamMode::WRITE ); SvStream* pStream = aMedium.GetOutStream(); diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index db181c0bb89b..367647037e4c 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -2761,7 +2761,7 @@ OUString LoadAndRegisterDataSource_Impl(DBConnURIType type, const uno::Reference } // Construct vnd.sun.star.pkg:// URL -OUString ConstructVndSunStarPkgUrl(const OUString& rMainURL, const OUString& rStreamRelPath) +OUString ConstructVndSunStarPkgUrl(const OUString& rMainURL, std::u16string_view rStreamRelPath) { auto xContext(comphelper::getProcessComponentContext()); auto xUri = css::uri::UriReferenceFactory::create(xContext)->parse(rMainURL); |