diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-28 14:12:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-29 08:53:22 +0200 |
commit | d3849255b76e92a42f653c266b88945708984c4f (patch) | |
tree | ff1eab21b9e5a1ea00e1573db4b4595ba51b0098 /sfx2 | |
parent | f9b6bd6336b35de060f6f5bdd91517caf5e9a56e (diff) |
use more string_view in INetURLObject
Change-Id: I4462f7cf4740fa4d1b129d76a0775f4250f41bbd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133555
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/linkmgr2.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/newhelp.cxx | 7 | ||||
-rw-r--r-- | sfx2/source/appl/newhelp.hxx | 4 | ||||
-rw-r--r-- | sfx2/source/appl/sfxhelp.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/shutdownicon.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/shutdownicon.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/shutdowniconw32.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/bastyp/frmhtml.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/bastyp/helper.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/bastyp/sfxhtml.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/control/listview.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/control/recentdocsviewitem.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/control/templatelocalview.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 12 | ||||
-rw-r--r-- | sfx2/source/doc/doctempl.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/doctemplates.cxx | 27 | ||||
-rw-r--r-- | sfx2/source/doc/frmdescr.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/guisaveas.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/objserv.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/printhelper.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/inc/helper.hxx | 4 | ||||
-rw-r--r-- | sfx2/source/view/frmload.cxx | 2 |
23 files changed, 53 insertions, 51 deletions
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index 4b77bcf90fb6..977ed98518fe 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -573,7 +573,7 @@ bool LinkManager::GetGraphicFromAny(const OUString& rMimeType, return bRet; } -static OUString lcl_DDE_RelToAbs( const OUString& rTopic, const OUString& rBaseURL ) +static OUString lcl_DDE_RelToAbs( const OUString& rTopic, std::u16string_view rBaseURL ) { OUString sRet; INetURLObject aURL( rTopic ); diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 289a848b4b36..ecba5be38f3a 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -1109,7 +1109,8 @@ void BookmarksTabPage_Impl::DoAction(std::string_view rAction) { OUString sURL = m_xBookmarksBox->get_id(nPos); m_xBookmarksBox->remove(nPos); - m_xBookmarksBox->append(sURL, aDlg.GetTitle(), SvFileInformationManager::GetImageId(INetURLObject(IMAGE_URL+INetURLObject(sURL).GetHost()))); + m_xBookmarksBox->append(sURL, aDlg.GetTitle(), + SvFileInformationManager::GetImageId(INetURLObject(rtl::OUStringConcatenation(IMAGE_URL+INetURLObject(sURL).GetHost())))); m_xBookmarksBox->select(m_xBookmarksBox->n_children() - 1); } } @@ -2364,7 +2365,7 @@ IMPL_LINK( SfxHelpWindow_Impl, ChangeHdl, HelpListener_Impl&, rListener, void ) } -void SfxHelpWindow_Impl::openDone(const OUString& sURL , +void SfxHelpWindow_Impl::openDone(std::u16string_view sURL , bool bSuccess) { INetURLObject aObj( sURL ); @@ -2526,7 +2527,7 @@ void SfxHelpWindow_Impl::SetFactory( const OUString& rFactory ) xIndexWin->SetFactory( rFactory, true ); } -void SfxHelpWindow_Impl::SetHelpURL( const OUString& rURL ) +void SfxHelpWindow_Impl::SetHelpURL( std::u16string_view rURL ) { INetURLObject aObj( rURL ); if ( aObj.GetProtocol() == INetProtocol::VndSunStarHelp ) diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx index f26bf93379a9..9d5a5e42209a 100644 --- a/sfx2/source/appl/newhelp.hxx +++ b/sfx2/source/appl/newhelp.hxx @@ -468,7 +468,7 @@ public: getTextFrame() const { return pTextWin->getFrame(); } void SetFactory( const OUString& rFactory ); - void SetHelpURL( const OUString& rURL ); + void SetHelpURL( std::u16string_view rURL ); void DoAction(std::string_view rAction); void CloseWindow(); @@ -480,7 +480,7 @@ public: bool HasHistoryPredecessor() const; // forward to interceptor bool HasHistorySuccessor() const; // forward to interceptor - void openDone(const OUString& sURL , + void openDone(std::u16string_view sURL , bool bSuccess); static OUString buildHelpURL(std::u16string_view sFactory , diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 5a26931d3f66..d941fc2992e4 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -285,7 +285,7 @@ void AppendConfigToken( OUStringBuffer& rURL, bool bQuestionMark ) rURL.append(utl::ConfigManager::getProductVersion()); } -static bool GetHelpAnchor_Impl( const OUString& _rURL, OUString& _rAnchor ) +static bool GetHelpAnchor_Impl( std::u16string_view _rURL, OUString& _rAnchor ) { bool bRet = false; diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx index 91a97e09c344..8c28c4fa1888 100644 --- a/sfx2/source/appl/shutdownicon.cxx +++ b/sfx2/source/appl/shutdownicon.cxx @@ -232,7 +232,7 @@ void ShutdownIcon::FromTemplate() xDisp->dispatch( aTargetURL, aArgs ); } -OUString ShutdownIcon::GetUrlDescription( const OUString& aUrl ) +OUString ShutdownIcon::GetUrlDescription( std::u16string_view aUrl ) { ::SolarMutexGuard aGuard; diff --git a/sfx2/source/appl/shutdownicon.hxx b/sfx2/source/appl/shutdownicon.hxx index c551a190a01d..51c778e1dd53 100644 --- a/sfx2/source/appl/shutdownicon.hxx +++ b/sfx2/source/appl/shutdownicon.hxx @@ -108,7 +108,7 @@ class ShutdownIcon : public ShutdownIconServiceBase /// @throws css::uno::Exception void init(); - static OUString GetUrlDescription( const OUString& aUrl ); + static OUString GetUrlDescription( std::u16string_view aUrl ); void SetVeto( bool bVeto ) { m_bVeto = bVeto;} diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx index 13ef8aa07058..2580a8bd126d 100644 --- a/sfx2/source/appl/shutdowniconw32.cxx +++ b/sfx2/source/appl/shutdowniconw32.cxx @@ -181,7 +181,7 @@ static HMENU createSystrayMenu( ) continue; addMenuItem( hMenu, nMenuItemID, nMenuIconID, - ShutdownIcon::GetUrlDescription( sURL ), pos, true, "" ); + ShutdownIcon::GetUrlDescription( sURL.asView() ), pos, true, "" ); } diff --git a/sfx2/source/bastyp/frmhtml.cxx b/sfx2/source/bastyp/frmhtml.cxx index b7cc2ea127f6..a15a6cc7a022 100644 --- a/sfx2/source/bastyp/frmhtml.cxx +++ b/sfx2/source/bastyp/frmhtml.cxx @@ -38,7 +38,7 @@ HTMLOptionEnum<ScrollingMode> const aScrollingTable[] = namespace SfxFrameHTMLParser { void ParseFrameOptions( - SfxFrameDescriptor *pFrame, const HTMLOptions& rOptions, const OUString& rBaseURL ) + SfxFrameDescriptor *pFrame, const HTMLOptions& rOptions, std::u16string_view rBaseURL ) { // Get and set the options Size aMargin( pFrame->GetMargin() ); diff --git a/sfx2/source/bastyp/helper.cxx b/sfx2/source/bastyp/helper.cxx index 5138a790e15a..96f3b67f17eb 100644 --- a/sfx2/source/bastyp/helper.cxx +++ b/sfx2/source/bastyp/helper.cxx @@ -188,7 +188,7 @@ OUString SfxContentHelper::GetActiveHelpString( const OUString& rURL ) } -bool SfxContentHelper::IsHelpErrorDocument( const OUString& rURL ) +bool SfxContentHelper::IsHelpErrorDocument( std::u16string_view rURL ) { bool bRet = false; try @@ -209,7 +209,7 @@ bool SfxContentHelper::IsHelpErrorDocument( const OUString& rURL ) } -sal_Int64 SfxContentHelper::GetSize( const OUString& rContent ) +sal_Int64 SfxContentHelper::GetSize( std::u16string_view rContent ) { sal_Int64 nSize = 0; INetURLObject aObj( rContent ); diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx index efaab39ff881..5907a660ba73 100644 --- a/sfx2/source/bastyp/sfxhtml.cxx +++ b/sfx2/source/bastyp/sfxhtml.cxx @@ -99,7 +99,7 @@ bool SfxHTMLParser::ParseMapOptions( return !aName.isEmpty(); } -bool SfxHTMLParser::ParseAreaOptions(ImageMap * pImageMap, const OUString& rBaseURL, +bool SfxHTMLParser::ParseAreaOptions(ImageMap * pImageMap, std::u16string_view rBaseURL, const HTMLOptions& rOptions, SvMacroItemId nEventMouseOver, SvMacroItemId nEventMouseOut ) diff --git a/sfx2/source/control/listview.cxx b/sfx2/source/control/listview.cxx index 0aa1781c8f13..a53e85d7157b 100644 --- a/sfx2/source/control/listview.cxx +++ b/sfx2/source/control/listview.cxx @@ -42,7 +42,7 @@ static sal_uInt64 getFileSize(const OUString& rURL); static sal_uInt32 getFileModifyTime(const OUString& rURL); static OUString getDisplayFileSize(const OUString& rURL); static OUString getDisplayFileModifyTime(const OUString& rURL); -static OUString getApplication(const OUString& rURL); +static OUString getApplication(std::u16string_view rURL); ListView::ListView(std::unique_ptr<weld::TreeView> xTreeView) : mxTreeView(std::move(xTreeView)) @@ -416,7 +416,7 @@ static sal_uInt64 getFileSize(const OUString& rURL) return nSize; } -static OUString getApplication(const OUString& rURL) +static OUString getApplication(std::u16string_view rURL) { INetURLObject aUrl(rURL); OUString aExt = aUrl.getExtension(); diff --git a/sfx2/source/control/recentdocsviewitem.cxx b/sfx2/source/control/recentdocsviewitem.cxx index e9c53faeffcf..0cdf74418d05 100644 --- a/sfx2/source/control/recentdocsviewitem.cxx +++ b/sfx2/source/control/recentdocsviewitem.cxx @@ -73,7 +73,7 @@ bool IsDocEncrypted(const OUString& rURL) } using Ext2IconMap = std::map<sfx2::ApplicationType, OUString>; -BitmapEx Url2Icon(const OUString& rURL, const Ext2IconMap& rExtToIcon, const OUString& sDefault) +BitmapEx Url2Icon(std::u16string_view rURL, const Ext2IconMap& rExtToIcon, const OUString& sDefault) { auto it = std::find_if(rExtToIcon.begin(), rExtToIcon.end(), [aExt = INetURLObject(rURL).getExtension()](const auto& r) @@ -106,7 +106,7 @@ BitmapEx getDefaultThumbnail(const OUString& rURL) return Url2Icon(rURL, rWhichMap, SFX_FILE_THUMBNAIL_DEFAULT); } -BitmapEx getModuleOverlay(const OUString& rURL) +BitmapEx getModuleOverlay(std::u16string_view rURL) { static const Ext2IconMap OverlayBitmapForExtension = { { sfx2::ApplicationType::TYPE_WRITER, SFX_FILE_OVERLAY_TEXT }, diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx index d3a355b705b4..a223b62e128a 100644 --- a/sfx2/source/control/templatelocalview.cxx +++ b/sfx2/source/control/templatelocalview.cxx @@ -61,7 +61,7 @@ bool ViewFilter_Application::isFilteredExtension(FILTER_APPLICATION filter, std: return bRet; } -bool ViewFilter_Application::isValid (const OUString &rPath) const +bool ViewFilter_Application::isValid (std::u16string_view rPath) const { INetURLObject aUrl(rPath); return isFilteredExtension(mApp, aUrl.getExtension()); @@ -580,7 +580,7 @@ bool TemplateLocalView::copyFrom (TemplateContainerItem *pItem, const OUString & return false; } -bool TemplateLocalView::exportTo(const sal_uInt16 nItemId, const sal_uInt16 nRegionItemId, const OUString &rName) +bool TemplateLocalView::exportTo(const sal_uInt16 nItemId, const sal_uInt16 nRegionItemId, std::u16string_view rName) { for (auto const & pRegItem : maRegions) { @@ -870,7 +870,7 @@ void TemplateLocalView::RemoveDefaultTemplateIcon(std::u16string_view rPath) } } -BitmapEx TemplateLocalView::getDefaultThumbnail( const OUString& rPath ) +BitmapEx TemplateLocalView::getDefaultThumbnail( std::u16string_view rPath ) { BitmapEx aImg; INetURLObject aUrl(rPath); diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 2a1cf03c0601..c5a43f96797c 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -1005,7 +1005,7 @@ void SfxMedium::SetEncryptionDataToStorage_Impl() namespace { -OUString tryMSOwnerFiles(const OUString& sDocURL) +OUString tryMSOwnerFiles(std::u16string_view sDocURL) { svt::MSODocumentLockFile aMSOLockFile(sDocURL); LockFileEntry aData; @@ -1026,7 +1026,7 @@ OUString tryMSOwnerFiles(const OUString& sDocURL) return sUserData; } -OUString tryForeignLockfiles(const OUString& sDocURL) +OUString tryForeignLockfiles(std::u16string_view sDocURL) { OUString sUserData = tryMSOwnerFiles(sDocURL); // here we can test for empty result, and add other known applications' lockfile testing @@ -4264,14 +4264,14 @@ bool SfxMedium::IsOpen() const return pImpl->m_pInStream || pImpl->m_pOutStream || pImpl->xStorage.is(); } -OUString SfxMedium::CreateTempCopyWithExt( const OUString& aURL ) +OUString SfxMedium::CreateTempCopyWithExt( std::u16string_view aURL ) { OUString aResult; - if ( !aURL.isEmpty() ) + if ( !aURL.empty() ) { - sal_Int32 nPrefixLen = aURL.lastIndexOf( '.' ); - OUString aExt = ( nPrefixLen == -1 ) ? OUString() : aURL.copy( nPrefixLen ); + size_t nPrefixLen = aURL.rfind( '.' ); + OUString aExt = ( nPrefixLen == std::u16string_view::npos ) ? OUString() : OUString(aURL.substr( nPrefixLen )); OUString aNewTempFileURL = ::utl::TempFile( u"", true, &aExt ).GetURL(); if ( !aNewTempFileURL.isEmpty() ) diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx index d24260a0ddbf..cf9d70ceae75 100644 --- a/sfx2/source/doc/doctempl.cxx +++ b/sfx2/source/doc/doctempl.cxx @@ -708,7 +708,7 @@ bool SfxDocumentTemplates::CopyTo ( sal_uInt16 nRegion, // Region of the template to be exported sal_uInt16 nIdx, // Index of the template to be exported - const OUString& rName /* File name under which the template is to + std::u16string_view rName /* File name under which the template is to be created */ ) const @@ -1143,7 +1143,7 @@ bool SfxDocumentTemplates::GetFull bool SfxDocumentTemplates::GetLogicNames ( - const OUString &rPath, // Full Path to the template + std::u16string_view rPath, // Full Path to the template OUString &rRegion, // Out: Region name OUString &rName // Out: Template name ) const diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index ef4c4aa4f7fe..a478158edbe5 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -75,6 +75,7 @@ #include <unotools/ucbhelper.hxx> #include <i18nlangtag/languagetag.hxx> #include <ucbhelper/content.hxx> +#include <o3tl/string_view.hxx> #include <sfx2/sfxresid.hxx> #include <sfxurlrelocator.hxx> @@ -212,24 +213,24 @@ class SfxDocTplService_Impl bool bFsysFolder, Content &rNewFolder ); - static bool CreateNewUniqueFolderWithPrefix( const OUString& aPath, + static bool CreateNewUniqueFolderWithPrefix( std::u16string_view aPath, const OUString& aPrefix, OUString& aNewFolderName, OUString& aNewFolderURL, Content& aNewFolder ); - static OUString CreateNewUniqueFileWithPrefix( const OUString& aPath, + static OUString CreateNewUniqueFileWithPrefix( std::u16string_view aPath, const OUString& aPrefix, const OUString& aExt ); - std::vector< beans::StringPair > ReadUINamesForTemplateDir_Impl( const OUString& aUserPath ); - bool UpdateUINamesForTemplateDir_Impl( const OUString& aUserPath, + std::vector< beans::StringPair > ReadUINamesForTemplateDir_Impl( std::u16string_view aUserPath ); + bool UpdateUINamesForTemplateDir_Impl( std::u16string_view aUserPath, const OUString& aGroupName, const OUString& aNewFolderName ); - bool ReplaceUINamesForTemplateDir_Impl( const OUString& aUserPath, + bool ReplaceUINamesForTemplateDir_Impl( std::u16string_view aUserPath, const OUString& aFsysGroupName, std::u16string_view aOldGroupName, const OUString& aNewGroupName ); - void RemoveUINamesForTemplateDir_Impl( const OUString& aUserPath, + void RemoveUINamesForTemplateDir_Impl( std::u16string_view aUserPath, std::u16string_view aGroupName ); bool WriteUINamesForTemplateDir_Impl( std::u16string_view aUserPath, const std::vector< beans::StringPair >& aUINames ); @@ -551,7 +552,7 @@ void SfxDocTplService_Impl::getDirList() for (auto& rTemplateDir : asNonConstRange(maTemplateDirs)) { aURL.SetSmartProtocol( INetProtocol::File ); - aURL.SetURL( aDirs.getToken( 0, C_DELIM, nIdx ) ); + aURL.SetURL( o3tl::getToken(aDirs, 0, C_DELIM, nIdx ) ); rTemplateDir = aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ); if ( xExpander.is() ) @@ -773,7 +774,7 @@ bool SfxDocTplService_Impl::createFolder( const OUString& rNewFolderURL, } -bool SfxDocTplService_Impl::CreateNewUniqueFolderWithPrefix( const OUString& aPath, +bool SfxDocTplService_Impl::CreateNewUniqueFolderWithPrefix( std::u16string_view aPath, const OUString& aPrefix, OUString& aNewFolderName, OUString& aNewFolderURL, @@ -826,7 +827,7 @@ bool SfxDocTplService_Impl::CreateNewUniqueFolderWithPrefix( const OUString& aPa } -OUString SfxDocTplService_Impl::CreateNewUniqueFileWithPrefix( const OUString& aPath, +OUString SfxDocTplService_Impl::CreateNewUniqueFileWithPrefix( std::u16string_view aPath, const OUString& aPrefix, const OUString& aExt ) { @@ -1166,7 +1167,7 @@ void SfxDocTplService_Impl::doUpdate() } -std::vector< beans::StringPair > SfxDocTplService_Impl::ReadUINamesForTemplateDir_Impl( const OUString& aUserPath ) +std::vector< beans::StringPair > SfxDocTplService_Impl::ReadUINamesForTemplateDir_Impl( std::u16string_view aUserPath ) { INetURLObject aLocObj( aUserPath ); aLocObj.insertName( u"groupuinames.xml", false, @@ -1192,7 +1193,7 @@ std::vector< beans::StringPair > SfxDocTplService_Impl::ReadUINamesForTemplateDi } -bool SfxDocTplService_Impl::UpdateUINamesForTemplateDir_Impl( const OUString& aUserPath, +bool SfxDocTplService_Impl::UpdateUINamesForTemplateDir_Impl( std::u16string_view aUserPath, const OUString& aGroupName, const OUString& aNewFolderName ) { @@ -1212,7 +1213,7 @@ bool SfxDocTplService_Impl::UpdateUINamesForTemplateDir_Impl( const OUString& aU } -bool SfxDocTplService_Impl::ReplaceUINamesForTemplateDir_Impl( const OUString& aUserPath, +bool SfxDocTplService_Impl::ReplaceUINamesForTemplateDir_Impl( std::u16string_view aUserPath, const OUString& aDefaultFsysGroupName, std::u16string_view aOldGroupName, const OUString& aNewGroupName ) @@ -1238,7 +1239,7 @@ bool SfxDocTplService_Impl::ReplaceUINamesForTemplateDir_Impl( const OUString& a } -void SfxDocTplService_Impl::RemoveUINamesForTemplateDir_Impl( const OUString& aUserPath, +void SfxDocTplService_Impl::RemoveUINamesForTemplateDir_Impl( std::u16string_view aUserPath, std::u16string_view aGroupName ) { std::vector< beans::StringPair > aUINames = ReadUINamesForTemplateDir_Impl( aUserPath ); diff --git a/sfx2/source/doc/frmdescr.cxx b/sfx2/source/doc/frmdescr.cxx index b97d3b6bbdcc..43183986d233 100644 --- a/sfx2/source/doc/frmdescr.cxx +++ b/sfx2/source/doc/frmdescr.cxx @@ -42,7 +42,7 @@ SfxItemSet* SfxFrameDescriptor::GetArgs() return m_pArgs.get(); } -void SfxFrameDescriptor::SetURL( const OUString& rURL ) +void SfxFrameDescriptor::SetURL( std::u16string_view rURL ) { aURL = INetURLObject(rURL); SetActualURL(); diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index d3c862a01ce5..cc26abcb0606 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -1248,7 +1248,7 @@ OUString ModelData_Impl::GetRecommendedName( const OUString& aSuggestedName, con uno::UNO_QUERY ); if ( xTypeDetection.is() ) { - INetURLObject aObj( "c:/" + aRecommendedName, INetProtocol::File, + INetURLObject aObj( rtl::OUStringConcatenation("c:/" + aRecommendedName), INetProtocol::File, INetURLObject::EncodeMechanism::All, RTL_TEXTENCODING_UTF8, FSysStyle::Dos ); const OUString aExtension = GetRecommendedExtension( aTypeName ); diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 0c150ece85e6..2fd20952042f 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -269,7 +269,7 @@ void SfxObjectShell::PrintState_Impl(SfxItemSet &rSet) rSet.Put( SfxBoolItem( SID_PRINTOUT, bPrinting ) ); } -bool SfxObjectShell::APISaveAs_Impl(const OUString& aFileName, SfxItemSet& rItemSet, +bool SfxObjectShell::APISaveAs_Impl(std::u16string_view aFileName, SfxItemSet& rItemSet, const css::uno::Sequence<css::beans::PropertyValue>& rArgs) { bool bOk = false; diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 0dc8cb2d1d5b..b86750aef052 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2679,7 +2679,7 @@ bool SfxObjectShell::CommonSaveAs_Impl(const INetURLObject& aURL, const OUString return false; } - if ( aURL != INetURLObject( OUString( "private:stream" ) ) ) + if ( aURL != INetURLObject( u"private:stream" ) ) { // Is there already a Document with this name? SfxObjectShell* pDoc = nullptr; @@ -2731,7 +2731,7 @@ bool SfxObjectShell::CommonSaveAs_Impl(const INetURLObject& aURL, const OUString bool bWasReadonly = IsReadOnly(); - if ( aURL == aActName && aURL != INetURLObject( OUString("private:stream") ) + if ( aURL == aActName && aURL != INetURLObject( u"private:stream" ) && IsReadOnly() ) { SetError(ERRCODE_SFX_DOCUMENTREADONLY); diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index d2ac4883ea78..7a18910379d2 100644 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -507,7 +507,7 @@ class ImplUCBPrintWatcher : public ::osl::Thread the thread, if finishing of the job was detected outside this thread. But it must be called without using a corresponding thread for the given parameter! */ - static void moveAndDeleteTemp( ::utl::TempFile** ppTempFile, const OUString& sTargetURL ) + static void moveAndDeleteTemp( ::utl::TempFile** ppTempFile, std::u16string_view sTargetURL ) { // move the file try diff --git a/sfx2/source/inc/helper.hxx b/sfx2/source/inc/helper.hxx index ca278b07b56b..b2787a3ad146 100644 --- a/sfx2/source/inc/helper.hxx +++ b/sfx2/source/inc/helper.hxx @@ -31,9 +31,9 @@ public: static std::vector<OUString> GetResultSet(const OUString& rURL); static std::vector<OUString> GetHelpTreeViewContents(const OUString& rURL); static OUString GetActiveHelpString(const OUString& rURL); - static bool IsHelpErrorDocument(const OUString& rURL); + static bool IsHelpErrorDocument(std::u16string_view rURL); - static sal_Int64 GetSize(const OUString& rContent); + static sal_Int64 GetSize(std::u16string_view rContent); }; #endif // INCLUDED_SFX2_SOURCE_INC_HELPER_HXX diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index f45124849241..7c1db6f8b4ac 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -590,7 +590,7 @@ Reference< XController2 > SfxFrameLoader_Impl::impl_createDocumentView( const Re return xController; } -std::shared_ptr<const SfxFilter> getEmptyURLFilter(const OUString& sURL) +std::shared_ptr<const SfxFilter> getEmptyURLFilter(std::u16string_view sURL) { INetURLObject aParser(sURL); const OUString aExt = aParser.getExtension(INetURLObject::LAST_SEGMENT, true, |