From bfde4866e07746eafa2f0d6173c29d805cc35ad0 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 5 Dec 2016 08:47:18 +0200 Subject: convert DecodeMechanism to scoped enum Change-Id: I5c56634b1bca8e37fa73d02d2428645301b6c547 --- sfx2/source/appl/appdde.cxx | 8 ++-- sfx2/source/appl/appopen.cxx | 2 +- sfx2/source/appl/macroloader.cxx | 6 +-- sfx2/source/appl/newhelp.cxx | 2 +- sfx2/source/appl/opengrf.cxx | 6 +-- sfx2/source/appl/sfxhelp.cxx | 2 +- sfx2/source/appl/sfxpicklist.cxx | 4 +- sfx2/source/appl/shutdowniconaqua.mm | 2 +- sfx2/source/bastyp/fltfnc.cxx | 4 +- sfx2/source/bastyp/frmhtmlw.cxx | 2 +- sfx2/source/bastyp/helper.cxx | 4 +- sfx2/source/control/recentdocsview.cxx | 2 +- sfx2/source/control/recentdocsviewitem.cxx | 2 +- sfx2/source/control/unoctitm.cxx | 2 +- sfx2/source/dialog/dinfdlg.cxx | 6 +-- sfx2/source/dialog/filedlghelper.cxx | 24 +++++----- sfx2/source/dialog/mailmodel.cxx | 8 ++-- sfx2/source/doc/docfile.cxx | 76 +++++++++++++++--------------- sfx2/source/doc/docinsert.cxx | 2 +- sfx2/source/doc/docmacromode.cxx | 2 +- sfx2/source/doc/doctempl.cxx | 22 ++++----- sfx2/source/doc/doctemplates.cxx | 74 ++++++++++++++--------------- sfx2/source/doc/frmdescr.cxx | 2 +- sfx2/source/doc/guisaveas.cxx | 22 ++++----- sfx2/source/doc/iframe.cxx | 4 +- sfx2/source/doc/objcont.cxx | 2 +- sfx2/source/doc/objmisc.cxx | 26 +++++----- sfx2/source/doc/objstor.cxx | 8 ++-- sfx2/source/doc/objxtor.cxx | 2 +- sfx2/source/doc/printhelper.cxx | 4 +- sfx2/source/doc/sfxbasemodel.cxx | 2 +- sfx2/source/doc/templatedlg.cxx | 4 +- sfx2/source/inet/inettbc.cxx | 2 +- sfx2/source/notify/eventsupplier.cxx | 2 +- sfx2/source/view/viewfrm.cxx | 8 ++-- sfx2/source/view/viewfrm2.cxx | 2 +- sfx2/source/view/viewsh.cxx | 4 +- 37 files changed, 178 insertions(+), 178 deletions(-) (limited to 'sfx2/source') diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx index 06569040d1f0..3b8e9f1230a8 100644 --- a/sfx2/source/appl/appdde.cxx +++ b/sfx2/source/appl/appdde.cxx @@ -87,7 +87,7 @@ namespace try { - ::ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() ); + ::ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ), uno::Reference< ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() ); bRet = aCnt.isDocument(); } catch( const ucb::CommandAbortedException& ) @@ -141,10 +141,10 @@ bool ImplDdeService::MakeTopic( const OUString& rNm ) INetURLObject aWorkPath( SvtPathOptions().GetWorkPath() ); INetURLObject aFile; if ( aWorkPath.GetNewAbsURL( rNm, &aFile ) && - lcl_IsDocument( aFile.GetMainURL( INetURLObject::NO_DECODE ) ) ) + lcl_IsDocument( aFile.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ) ) { // File exists? then try to load it: - SfxStringItem aName( SID_FILE_NAME, aFile.GetMainURL( INetURLObject::NO_DECODE ) ); + SfxStringItem aName( SID_FILE_NAME, aFile.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); SfxBoolItem aNewView(SID_OPEN_NEW_VIEW, true); SfxBoolItem aSilent(SID_SILENT, true); @@ -439,7 +439,7 @@ bool SfxApplication::InitializeDde() INetURLObject aOfficeLockFile( SvtPathOptions().GetUserConfigPath() ); aOfficeLockFile.insertName( "soffice.lck" ); OUString aService( SfxDdeServiceName_Impl( - aOfficeLockFile.GetMainURL(INetURLObject::DECODE_TO_IURI) ) ); + aOfficeLockFile.GetMainURL(INetURLObject::DecodeMechanism::ToIUri) ) ); aService = aService.toAsciiUpperCase(); pImpl->pDdeService2 = new ImplDdeService( aService ); pImpl->pTriggerTopic = new SfxDdeTriggerTopic_Impl; diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index caec98f9e705..6a259edaf9b6 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -528,7 +528,7 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq ) { DBG_ASSERT( aObj.GetProtocol() != INetProtocol::NotValid, "Illegal URL!" ); - SfxStringItem aName( SID_FILE_NAME, aObj.GetMainURL( INetURLObject::NO_DECODE ) ); + SfxStringItem aName( SID_FILE_NAME, aObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); SfxStringItem aTemplName( SID_TEMPLATE_NAME, aTemplateName ); SfxStringItem aTemplRegionName( SID_TEMPLATE_REGIONNAME, aTemplateRegion ); pRet = GetDispatcher_Impl()->ExecuteList(SID_OPENDOC, eMode, diff --git a/sfx2/source/appl/macroloader.cxx b/sfx2/source/appl/macroloader.cxx index 3ab011f3dac0..92ecab7313c7 100644 --- a/sfx2/source/appl/macroloader.cxx +++ b/sfx2/source/appl/macroloader.cxx @@ -216,7 +216,7 @@ ErrCode SfxMacroLoader::loadMacro( const OUString& rURL, css::uno::Any& rRetval, { // find BasicManager SfxObjectShell* pDoc = nullptr; - OUString aBasMgrName( INetURLObject::decode(aMacro.copy( 8, nHashPos-8 ), INetURLObject::DECODE_WITH_CHARSET) ); + OUString aBasMgrName( INetURLObject::decode(aMacro.copy( 8, nHashPos-8 ), INetURLObject::DecodeMechanism::WithCharset) ); if ( aBasMgrName.isEmpty() ) pBasMgr = pAppMgr; else if ( aBasMgrName == "." ) @@ -253,7 +253,7 @@ ErrCode SfxMacroLoader::loadMacro( const OUString& rURL, css::uno::Any& rRetval, } // find BASIC method - OUString aQualifiedMethod( INetURLObject::decode(aMacro.copy( nHashPos+1 ), INetURLObject::DECODE_WITH_CHARSET) ); + OUString aQualifiedMethod( INetURLObject::decode(aMacro.copy( nHashPos+1 ), INetURLObject::DecodeMechanism::WithCharset) ); OUString aArgs; if ( -1 != nArgsPos ) { @@ -317,7 +317,7 @@ ErrCode SfxMacroLoader::loadMacro( const OUString& rURL, css::uno::Any& rRetval, // direct API call on a specified object OUStringBuffer aCall; aCall.append('[').append(INetURLObject::decode(aMacro.copy(6), - INetURLObject::DECODE_WITH_CHARSET)); + INetURLObject::DecodeMechanism::WithCharset)); aCall.append(']'); pAppMgr->GetLib(0)->Execute(aCall.makeStringAndClear()); nErr = SbxBase::GetError(); diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 97412bb3b0ca..52d37a0d688f 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -944,7 +944,7 @@ SearchTabPage_Impl::SearchTabPage_Impl(vcl::Window* pParent, SfxHelpIndexWindow_ { OUString aToken = aUserData.getToken(i, ';'); m_pSearchED->InsertEntry( INetURLObject::decode( - aToken, INetURLObject::DECODE_WITH_CHARSET ) ); + aToken, INetURLObject::DecodeMechanism::WithCharset ) ); } } } diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx index 70670fe25852..278dba81d57f 100644 --- a/sfx2/source/appl/opengrf.cxx +++ b/sfx2/source/appl/opengrf.cxx @@ -125,12 +125,12 @@ short SvxOpenGraphicDialog::Execute() // non-local? if ( INetProtocol::File != aObj.GetProtocol() ) { - SfxMedium aMed( aObj.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ ); + SfxMedium aMed( aObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::READ ); aMed.Download(); SvStream* pStream = aMed.GetInStream(); if( pStream ) - nImpRet = rFilter.CanImportGraphic( aObj.GetMainURL( INetURLObject::NO_DECODE ), *pStream, nFormatNum, &nRetFormat ); + nImpRet = rFilter.CanImportGraphic( aObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ), *pStream, nFormatNum, &nRetFormat ); else nImpRet = rFilter.CanImportGraphic( aObj, nFormatNum, &nRetFormat ); @@ -139,7 +139,7 @@ short SvxOpenGraphicDialog::Execute() if ( !pStream ) nImpRet = rFilter.CanImportGraphic( aObj, GRFILTER_FORMAT_DONTKNOW, &nRetFormat ); else - nImpRet = rFilter.CanImportGraphic( aObj.GetMainURL( INetURLObject::NO_DECODE ), *pStream, + nImpRet = rFilter.CanImportGraphic( aObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ), *pStream, GRFILTER_FORMAT_DONTKNOW, &nRetFormat ); } } diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 2a4c32566c98..e992cc9a4d5a 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -173,7 +173,7 @@ bool GetHelpAnchor_Impl( const OUString& _rURL, OUString& _rAnchor ) try { - ::ucbhelper::Content aCnt( INetURLObject( _rURL ).GetMainURL( INetURLObject::NO_DECODE ), + ::ucbhelper::Content aCnt( INetURLObject( _rURL ).GetMainURL( INetURLObject::DecodeMechanism::NONE ), Reference< css::ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() ); if ( ( aCnt.getPropertyValue("AnchorName") >>= sAnchor ) ) diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx index 0e794b3db2f7..771205a5354c 100644 --- a/sfx2/source/appl/sfxpicklist.cxx +++ b/sfx2/source/appl/sfxpicklist.cxx @@ -154,14 +154,14 @@ void SfxPickList::AddDocumentToPickList( SfxObjectShell* pDocSh ) // add to svtool history options SvtHistoryOptions().AppendItem( ePICKLIST, - aURL.GetURLNoPass( INetURLObject::NO_DECODE ), + aURL.GetURLNoPass( INetURLObject::DecodeMechanism::NONE ), aFilter, aTitle, OUString(), aThumbnail); if ( aURL.GetProtocol() == INetProtocol::File ) - Application::AddToRecentDocumentList( aURL.GetURLNoPass( INetURLObject::NO_DECODE ), + Application::AddToRecentDocumentList( aURL.GetURLNoPass( INetURLObject::DecodeMechanism::NONE ), (pFilter) ? pFilter->GetMimeType() : OUString(), (pFilter) ? pFilter->GetServiceName() : OUString() ); } diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm index c28cf0c646dd..2d466b48458c 100644 --- a/sfx2/source/appl/shutdowniconaqua.mm +++ b/sfx2/source/appl/shutdowniconaqua.mm @@ -230,7 +230,7 @@ class RecentFilesStringLength : public ::cppu::WeakImplHelper< css::util::XStrin { // Use INetURLObject to abbreviate all other URLs css::uno::Reference< css::util::XStringWidth > xStringLength( new RecentFilesStringLength() ); - aMenuTitle = aURL.getAbbreviated( xStringLength, 46, INetURLObject::DECODE_UNAMBIGUOUS ); + aMenuTitle = aURL.getAbbreviated( xStringLength, 46, INetURLObject::DecodeMechanism::Unambiguous ); } NSMenuItem* pNewItem = [[NSMenuItem alloc] initWithTitle: getAutoreleasedString( aMenuTitle ) diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index a85c95fcf596..3132535768b6 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -378,7 +378,7 @@ sal_uInt32 SfxFilterMatcher::GuessFilterIgnoringContent( OUString sTypeName; try { - sTypeName = xDetection->queryTypeByURL( rMedium.GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ); + sTypeName = xDetection->queryTypeByURL( rMedium.GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); } catch (uno::Exception&) { @@ -419,7 +419,7 @@ sal_uInt32 SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, s // open the stream one times only ... // Otherwhise it will be tried more than once and show the same interaction more than once ... - OUString sURL( rMedium.GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ); + OUString sURL( rMedium.GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); uno::Reference< io::XInputStream > xInStream = rMedium.GetInputStream(); OUString aFilterName; diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx index 0bbe5f71758e..977c96aab369 100644 --- a/sfx2/source/bastyp/frmhtmlw.cxx +++ b/sfx2/source/bastyp/frmhtmlw.cxx @@ -242,7 +242,7 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor( uno::Any aAny = xSet->getPropertyValue("FrameURL"); if ( (aAny >>= aStr) && !aStr.isEmpty() ) { - OUString aURL = INetURLObject( aStr ).GetMainURL( INetURLObject::DECODE_TO_IURI ); + OUString aURL = INetURLObject( aStr ).GetMainURL( INetURLObject::DecodeMechanism::ToIUri ); if( !aURL.isEmpty() ) { aURL = URIHelper::simpleNormalizedMakeRelative( diff --git a/sfx2/source/bastyp/helper.cxx b/sfx2/source/bastyp/helper.cxx index eeb981e38a3f..e42be6dd3ac0 100644 --- a/sfx2/source/bastyp/helper.cxx +++ b/sfx2/source/bastyp/helper.cxx @@ -224,7 +224,7 @@ bool SfxContentHelper::IsHelpErrorDocument( const OUString& rURL ) bool bRet = false; try { - ::ucbhelper::Content aCnt( INetURLObject( rURL ).GetMainURL( INetURLObject::NO_DECODE ), + ::ucbhelper::Content aCnt( INetURLObject( rURL ).GetMainURL( INetURLObject::DecodeMechanism::NONE ), uno::Reference< ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() ); if ( !( aCnt.getPropertyValue( "IsErrorDocument" ) >>= bRet ) ) @@ -247,7 +247,7 @@ sal_Int64 SfxContentHelper::GetSize( const OUString& rContent ) DBG_ASSERT( aObj.GetProtocol() != INetProtocol::NotValid, "Invalid URL!" ); try { - ::ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() ); + ::ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ), uno::Reference< ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() ); aCnt.getPropertyValue( "Size" ) >>= nSize; } catch( const ucb::CommandAbortedException& ) diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx index 8ff3953f83f0..587bf7ce77a8 100644 --- a/sfx2/source/control/recentdocsview.cxx +++ b/sfx2/source/control/recentdocsview.cxx @@ -204,7 +204,7 @@ void RecentDocsView::Reload() { INetURLObject aURLObj( aURL ); //Remove extension from url's last segment and use it as title - aTitle = aURLObj.GetBase(); //DECODE_WITH_CHARSET + aTitle = aURLObj.GetBase(); //DecodeMechanism::WithCharset } if (isAcceptedFile(aURL)) diff --git a/sfx2/source/control/recentdocsviewitem.cxx b/sfx2/source/control/recentdocsviewitem.cxx index 317f9f4700e3..0c12f38e9ce3 100644 --- a/sfx2/source/control/recentdocsviewitem.cxx +++ b/sfx2/source/control/recentdocsviewitem.cxx @@ -48,7 +48,7 @@ RecentDocsViewItem::RecentDocsViewItem(ThumbnailView &rView, const OUString &rUR m_sHelpText = aURLObj.GetURLNoPass(); if (aTitle.isEmpty()) - aTitle = aURLObj.GetName(INetURLObject::DECODE_WITH_CHARSET); + aTitle = aURLObj.GetName(INetURLObject::DecodeMechanism::WithCharset); BitmapEx aThumbnail(rThumbnail); //fdo#74834: only load thumbnail if the corresponding option is not disabled in the configuration diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 920f921a5cfb..067619d49aa0 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -432,7 +432,7 @@ void SfxDispatchController_Impl::addParametersToArgs( const css::util::URL& aURL else if ( aParamType.equalsAsciiL( URLTypeNames[URLType_STRING], 6 )) { // STRING support - rArgs[nLen].Value <<= OUString( INetURLObject::decode( aValue, INetURLObject::DECODE_WITH_CHARSET )); + rArgs[nLen].Value <<= OUString( INetURLObject::decode( aValue, INetURLObject::DecodeMechanism::WithCharset )); } else if ( aParamType.equalsAsciiL( URLTypeNames[URLType_DOUBLE], 6)) { diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index dd1d784665f4..4be6661f4495 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1031,7 +1031,7 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet ) // determine name INetURLObject aURL(aFile); - OUString aName = aURL.GetName( INetURLObject::DECODE_WITH_CHARSET ); + OUString aName = aURL.GetName( INetURLObject::DecodeMechanism::WithCharset ); if ( aName.isEmpty() || aURL.GetProtocol() == INetProtocol::PrivSoffice ) aName = SfxResId( STR_NONAME ).toString(); m_pNameED->SetText( aName ); @@ -1039,7 +1039,7 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet ) // determine context symbol aURL.SetSmartProtocol( INetProtocol::File ); aURL.SetSmartURL( aFactory); - const OUString& rMainURL = aURL.GetMainURL( INetURLObject::NO_DECODE ); + const OUString& rMainURL = aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ); Image aImage = SvFileInformationManager::GetImage( aURL, true ); if ( GetDPIScaleFactor() > 1) @@ -1055,7 +1055,7 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet ) OUString aSizeText( m_aUnknownSize ); if ( aURL.GetProtocol() == INetProtocol::File || aURL.isAnyKnownWebDAVScheme() ) - aSizeText = CreateSizeText( SfxContentHelper::GetSize( aURL.GetMainURL( INetURLObject::NO_DECODE ) ) ); + aSizeText = CreateSizeText( SfxContentHelper::GetSize( aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ) ); m_pShowSizeFT->SetText( aSizeText ); OUString aDescription = SvFileInformationManager::GetDescription( INetURLObject(rMainURL) ); diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 8abb8d4092bb..4e8150851a8d 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -602,12 +602,12 @@ void FileDialogHelper_Impl::updateVersions() INetURLObject aObj( aPathSeq[0] ); if ( ( aObj.GetProtocol() == INetProtocol::File ) && - ( utl::UCBContentHelper::IsDocument( aObj.GetMainURL( INetURLObject::NO_DECODE ) ) ) ) + ( utl::UCBContentHelper::IsDocument( aObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ) ) ) { try { uno::Reference< embed::XStorage > xStorage = ::comphelper::OStorageHelper::GetStorageFromURL( - aObj.GetMainURL( INetURLObject::NO_DECODE ), + aObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ), embed::ElementModes::READ ); DBG_ASSERT( xStorage.is(), "The method must return the storage or throw an exception!" ); @@ -1236,7 +1236,7 @@ void FileDialogHelper_Impl::implInitializeFileName( ) if ( bAutoExtChecked ) { // cut the extension aObj.removeExtension( ); - mxFileDlg->setDefaultName( aObj.GetName( INetURLObject::DECODE_WITH_CHARSET ) ); + mxFileDlg->setDefaultName( aObj.GetName( INetURLObject::DecodeMechanism::WithCharset ) ); } } } @@ -1357,7 +1357,7 @@ void FileDialogHelper_Impl::implGetAndCacheFiles(const uno::Reference< XInterfac else aPath.setName( lFiles[i] ); - rpURLList.push_back(aPath.GetMainURL(INetURLObject::NO_DECODE)); + rpURLList.push_back(aPath.GetMainURL(INetURLObject::DecodeMechanism::NONE)); } } } @@ -1578,7 +1578,7 @@ void FileDialogHelper_Impl::verifyPath() } INetURLObject url(maPath); if (url.GetProtocol() != INetProtocol::File - || url.getName(0, true, INetURLObject::DECODE_WITH_CHARSET) != "tmp") + || url.getName(0, true, INetURLObject::DecodeMechanism::WithCharset) != "tmp") { return; } @@ -1591,12 +1591,12 @@ void FileDialogHelper_Impl::verifyPath() INetURLObject::EncodeMechanism::All); OUString sysPathU; osl::FileBase::RC e = osl::FileBase::getSystemPathFromFileURL( - url.GetMainURL(INetURLObject::NO_DECODE), sysPathU); + url.GetMainURL(INetURLObject::DecodeMechanism::NONE), sysPathU); if (e != osl::FileBase::E_None) { SAL_WARN( "sfx.dialog", "getSystemPathFromFileURL(" - << url.GetMainURL(INetURLObject::NO_DECODE) << ") failed with " + << url.GetMainURL(INetURLObject::DecodeMechanism::NONE) << ") failed with " << +e); return; } @@ -1936,7 +1936,7 @@ void FileDialogHelper_Impl::saveConfig() INetURLObject aObj( getPath() ); if ( aObj.GetProtocol() == INetProtocol::File ) - SetToken( aUserData, 2, ' ', aObj.GetMainURL( INetURLObject::NO_DECODE ) ); + SetToken( aUserData, 2, ' ', aObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); OUString aFilter = getFilter(); aFilter = EncodeSpaces_Impl( aFilter ); @@ -2440,7 +2440,7 @@ Sequence< OUString > FileDialogHelper::GetSelectedFiles() const else aPath.setName( lFiles[i] ); - aResultSeq[i-1] = aPath.GetMainURL( INetURLObject::NO_DECODE ); + aResultSeq[i-1] = aPath.GetMainURL( INetURLObject::DecodeMechanism::NONE ); } } else @@ -2495,9 +2495,9 @@ void FileDialogHelper::SetDisplayDirectory( const OUString& _rPath ) INetURLObject aObj( _rPath ); - OUString sFileName = aObj.GetName( INetURLObject::DECODE_WITH_CHARSET ); + OUString sFileName = aObj.GetName( INetURLObject::DecodeMechanism::WithCharset ); aObj.removeSegment(); - OUString sPath = aObj.GetMainURL( INetURLObject::NO_DECODE ); + OUString sPath = aObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); int nIsFolder = impl_isFolder( _rPath ); if ( nIsFolder == 0 || @@ -2509,7 +2509,7 @@ void FileDialogHelper::SetDisplayDirectory( const OUString& _rPath ) else { INetURLObject aObjPathName( _rPath ); - OUString sFolder( aObjPathName.GetMainURL( INetURLObject::NO_DECODE ) ); + OUString sFolder( aObjPathName.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); if ( sFolder.isEmpty() ) { // _rPath is not a valid path -> fallback to home directory diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx index d66f25849345..7bcc296598c5 100644 --- a/sfx2/source/dialog/mailmodel.cxx +++ b/sfx2/source/dialog/mailmodel.cxx @@ -457,7 +457,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( { // Determine file name from model INetURLObject aFileObj( xStorable->getLocation() ); - aFileName = aFileObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::NO_DECODE ); + aFileName = aFileObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::NONE ); } } @@ -478,7 +478,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( aFilePathObj.insertName( aFileName ); aFilePathObj.setExtension( aExtension ); - OUString aFileURL = aFilePathObj.GetMainURL( INetURLObject::NO_DECODE ); + OUString aFileURL = aFilePathObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); sal_Int32 nNumArgs(0); const OUString aPasswordPropName( "Password" ); @@ -785,9 +785,9 @@ SfxMailModel::SendMailResult SfxMailModel::Send( const css::uno::Reference< css: url.getBase( INetURLObject::LAST_SEGMENT, false, #ifdef _WIN32 - INetURLObject::NO_DECODE)); // MAPISendMail does not accept Unicode + INetURLObject::DecodeMechanism::NONE)); // MAPISendMail does not accept Unicode #else - INetURLObject::DECODE_WITH_CHARSET)); + INetURLObject::DecodeMechanism::WithCharset)); #endif if (subject.isEmpty()) { subject = maAttachedDocuments[0]; diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index d9a090d7c4db..76ff7a30ec32 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -396,7 +396,7 @@ util::DateTime SfxMedium::GetInitFileDate( bool bIgnoreOldValue ) { // add a default css::ucb::XCommandEnvironment // in order to have the WebDAV UCP provider manage http/https authentication correctly - ::ucbhelper::Content aContent( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), + ::ucbhelper::Content aContent( GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ), utl::UCBContentHelper::getDefaultCommandEnvironment(), comphelper::getProcessComponentContext() ); @@ -449,7 +449,7 @@ Reference < XContent > SfxMedium::GetContent() const if ( !pImpl->m_aName.isEmpty() ) osl::FileBase::getFileURLFromSystemPath( pImpl->m_aName, aURL ); else if ( !pImpl->m_aLogicName.isEmpty() ) - aURL = GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); + aURL = GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ); if (!aURL.isEmpty() ) (void)::ucbhelper::Content::create( aURL, xEnv, comphelper::getProcessComponentContext(), pImpl->aContent ); } @@ -476,7 +476,7 @@ OUString SfxMedium::GetBaseURL( bool bForSaving ) } if ( aBaseURL.isEmpty() ) - aBaseURL = GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); + aBaseURL = GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ); } if ( bForSaving ) @@ -752,12 +752,12 @@ void SfxMedium::StorageBackup_Impl() Reference< css::ucb::XCommandEnvironment > xDummyEnv; bool bBasedOnOriginalFile = ( !pImpl->pTempFile && !( !pImpl->m_aLogicName.isEmpty() && pImpl->m_bSalvageMode ) - && !GetURLObject().GetMainURL( INetURLObject::NO_DECODE ).isEmpty() + && !GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ).isEmpty() && GetURLObject().GetProtocol() == INetProtocol::File - && ::utl::UCBContentHelper::IsDocument( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) ); + && ::utl::UCBContentHelper::IsDocument( GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ) ) ); if ( bBasedOnOriginalFile && pImpl->m_aBackupURL.isEmpty() - && ::ucbhelper::Content::create( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), xDummyEnv, comphelper::getProcessComponentContext(), aOriginalContent ) ) + && ::ucbhelper::Content::create( GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ), xDummyEnv, comphelper::getProcessComponentContext(), aOriginalContent ) ) { DoInternalBackup_Impl( aOriginalContent ); if( pImpl->m_aBackupURL.isEmpty() ) @@ -997,7 +997,7 @@ void SfxMedium::LockOrigFileOnDemand( bool bLoading, bool bNoUI ) xCHandler, Reference< css::ucb::XProgressHandler >() ); ucbhelper::Content aContentToLock( - GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), + GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ), xComEnv, comphelper::getProcessComponentContext() ); try @@ -1126,7 +1126,7 @@ void SfxMedium::LockOrigFileOnDemand( bool bLoading, bool bNoUI ) { // MediaDescriptor does this check also, the duplication should be avoided in future Reference< css::ucb::XCommandEnvironment > xDummyEnv; - ::ucbhelper::Content aContent( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), xDummyEnv, comphelper::getProcessComponentContext() ); + ::ucbhelper::Content aContent( GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ), xDummyEnv, comphelper::getProcessComponentContext() ); aContent.getPropertyValue("IsReadOnly") >>= bContentReadonly; } catch( const uno::Exception& ) {} @@ -1141,7 +1141,7 @@ void SfxMedium::LockOrigFileOnDemand( bool bLoading, bool bNoUI ) // the file is not readonly, check the ACL OUString aPhysPath; - if ( osl::FileBase::getSystemPathFromFileURL( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), aPhysPath ) + if ( osl::FileBase::getSystemPathFromFileURL( GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ), aPhysPath ) == osl::FileBase::E_None ) bContentReadonly = IsReadonlyAccordingACL( aPhysPath.getStr() ); } @@ -1637,7 +1637,7 @@ bool SfxMedium::StorageCommit_Impl() { OSL_ENSURE( !pImpl->m_aBackupURL.isEmpty(), "No backup on storage commit!\n" ); if ( !pImpl->m_aBackupURL.isEmpty() - && ::ucbhelper::Content::create( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), + && ::ucbhelper::Content::create( GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ), xDummyEnv, comphelper::getProcessComponentContext(), aOriginalContent ) ) { @@ -1681,7 +1681,7 @@ void SfxMedium::TransactedTransferForFS_Impl( const INetURLObject& aSource, try { - aOriginalContent = ::ucbhelper::Content( aDest.GetMainURL( INetURLObject::NO_DECODE ), xComEnv, comphelper::getProcessComponentContext() ); + aOriginalContent = ::ucbhelper::Content( aDest.GetMainURL( INetURLObject::DecodeMechanism::NONE ), xComEnv, comphelper::getProcessComponentContext() ); } catch ( const css::ucb::CommandAbortedException& ) { @@ -1715,7 +1715,7 @@ void SfxMedium::TransactedTransferForFS_Impl( const INetURLObject& aSource, CloseStreams_Impl(); ::ucbhelper::Content aTempCont; - if( ::ucbhelper::Content::create( aSource.GetMainURL( INetURLObject::NO_DECODE ), xDummyEnv, comphelper::getProcessComponentContext(), aTempCont ) ) + if( ::ucbhelper::Content::create( aSource.GetMainURL( INetURLObject::DecodeMechanism::NONE ), xDummyEnv, comphelper::getProcessComponentContext(), aTempCont ) ) { bool bTransactStarted = false; const SfxBoolItem* pOverWrite = SfxItemSet::GetItem(GetItemSet(), SID_OVERWRITE, false); @@ -1723,7 +1723,7 @@ void SfxMedium::TransactedTransferForFS_Impl( const INetURLObject& aSource, try { - if( bOverWrite && ::utl::UCBContentHelper::IsDocument( aDest.GetMainURL( INetURLObject::NO_DECODE ) ) ) + if( bOverWrite && ::utl::UCBContentHelper::IsDocument( aDest.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ) ) { if( pImpl->m_aBackupURL.isEmpty() ) DoInternalBackup_Impl( aOriginalContent ); @@ -1894,7 +1894,7 @@ void SfxMedium::Transfer_Impl() INetURLObject aSource( aNameURL ); ::ucbhelper::Content aTempCont; - if( ::ucbhelper::Content::create( aSource.GetMainURL( INetURLObject::NO_DECODE ), xEnv, comphelper::getProcessComponentContext(), aTempCont ) ) + if( ::ucbhelper::Content::create( aSource.GetMainURL( INetURLObject::DecodeMechanism::NONE ), xEnv, comphelper::getProcessComponentContext(), aTempCont ) ) { try { @@ -1961,7 +1961,7 @@ void SfxMedium::Transfer_Impl() xComEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< css::ucb::XProgressHandler >() ); - OUString aDestURL( aDest.GetMainURL( INetURLObject::NO_DECODE ) ); + OUString aDestURL( aDest.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); if ( comphelper::isFileUrl( aDestURL ) || !aDest.removeSegment() ) { @@ -2002,7 +2002,7 @@ void SfxMedium::Transfer_Impl() } if ( sParentUrl.isEmpty() ) - aDestURL = aDest.GetMainURL( INetURLObject::NO_DECODE ); + aDestURL = aDest.GetMainURL( INetURLObject::DecodeMechanism::NONE ); // adjust to above aDest.removeSegment() else aDestURL = sParentUrl; @@ -2017,7 +2017,7 @@ void SfxMedium::Transfer_Impl() OUString sObjectId; aAny >>= sObjectId; if ( aFileName.isEmpty() ) - aFileName = GetURLObject().getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ); + aFileName = GetURLObject().getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset ); try { @@ -2047,7 +2047,7 @@ void SfxMedium::Transfer_Impl() CloseStreams_Impl(); - (void)::ucbhelper::Content::create( aSource.GetMainURL( INetURLObject::NO_DECODE ), xEnv, comphelper::getProcessComponentContext(), aSourceContent ); + (void)::ucbhelper::Content::create( aSource.GetMainURL( INetURLObject::DecodeMechanism::NONE ), xEnv, comphelper::getProcessComponentContext(), aSourceContent ); // check for external parameters that may customize the handling of NameClash situations const SfxBoolItem* pOverWrite = SfxItemSet::GetItem(GetItemSet(), SID_OVERWRITE, false); @@ -2098,7 +2098,7 @@ void SfxMedium::Transfer_Impl() // // If the WebDAV resource is already locked by this LO instance, nothing will // happen, e.g. the LOCK method will not be sent to the server. - ::ucbhelper::Content aLockContent = ::ucbhelper::Content( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), xComEnv, comphelper::getProcessComponentContext() ); + ::ucbhelper::Content aLockContent = ::ucbhelper::Content( GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ), xComEnv, comphelper::getProcessComponentContext() ); aLockContent.lock(); } } @@ -2139,7 +2139,7 @@ void SfxMedium::Transfer_Impl() { // without a TempFile the physical and logical name should be the same after successful transfer if (osl::FileBase::getSystemPathFromFileURL( - GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), pImpl->m_aName ) + GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ), pImpl->m_aName ) != osl::FileBase::E_None) { pImpl->m_aName.clear(); @@ -2161,7 +2161,7 @@ void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalCont ::utl::TempFile aTransactTemp( aPrefix, true, &aExtension, &aDestDir ); INetURLObject aBackObj( aTransactTemp.GetURL() ); - OUString aBackupName = aBackObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ); + OUString aBackupName = aBackObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset ); Reference < css::ucb::XCommandEnvironment > xDummyEnv; ::ucbhelper::Content aBackupCont; @@ -2176,7 +2176,7 @@ void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalCont NameClash::OVERWRITE, sMimeType ) ) { - pImpl->m_aBackupURL = aBackObj.GetMainURL( INetURLObject::NO_DECODE ); + pImpl->m_aBackupURL = aBackObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); pImpl->m_bRemoveBackup = true; } } @@ -2196,7 +2196,7 @@ void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalCont OUString aFileName = GetURLObject().getName( INetURLObject::LAST_SEGMENT, true, - INetURLObject::NO_DECODE ); + INetURLObject::DecodeMechanism::NONE ); sal_Int32 nPrefixLen = aFileName.lastIndexOf( '.' ); OUString aPrefix = ( nPrefixLen == -1 ) ? aFileName : aFileName.copy( 0, nPrefixLen ); @@ -2220,7 +2220,7 @@ void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalCont INetURLObject aDest = GetURLObject(); if ( aDest.removeSegment() ) - DoInternalBackup_Impl( aOriginalContent, aPrefix, aExtension, aDest.GetMainURL( INetURLObject::NO_DECODE ) ); + DoInternalBackup_Impl( aOriginalContent, aPrefix, aExtension, aDest.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); } } @@ -2231,7 +2231,7 @@ void SfxMedium::DoBackup_Impl() INetURLObject aSource( GetURLObject() ); // there is nothing to backup in case source file does not exist - if ( !::utl::UCBContentHelper::IsDocument( aSource.GetMainURL( INetURLObject::NO_DECODE ) ) ) + if ( !::utl::UCBContentHelper::IsDocument( aSource.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ) ) return; bool bSuccess = false; @@ -2249,11 +2249,11 @@ void SfxMedium::DoBackup_Impl() INetURLObject aDest( aBakDir ); aDest.insertName( aSource.getName() ); aDest.setExtension( "bak" ); - OUString aFileName = aDest.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ); + OUString aFileName = aDest.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset ); // create a content for the source file ::ucbhelper::Content aSourceContent; - if ( ::ucbhelper::Content::create( aSource.GetMainURL( INetURLObject::NO_DECODE ), xEnv, comphelper::getProcessComponentContext(), aSourceContent ) ) + if ( ::ucbhelper::Content::create( aSource.GetMainURL( INetURLObject::DecodeMechanism::NONE ), xEnv, comphelper::getProcessComponentContext(), aSourceContent ) ) { try { @@ -2266,7 +2266,7 @@ void SfxMedium::DoBackup_Impl() sMimeType ); if( bSuccess ) { - pImpl->m_aBackupURL = aDest.GetMainURL( INetURLObject::NO_DECODE ); + pImpl->m_aBackupURL = aDest.GetMainURL( INetURLObject::DecodeMechanism::NONE ); pImpl->m_bRemoveBackup = false; } } @@ -2556,14 +2556,14 @@ void SfxMedium::Init_Impl() { if ( aUrl.HasMark() ) { - pImpl->m_aLogicName = aUrl.GetURLNoMark( INetURLObject::NO_DECODE ); + pImpl->m_aLogicName = aUrl.GetURLNoMark( INetURLObject::DecodeMechanism::NONE ); GetItemSet()->Put( SfxStringItem( SID_JUMPMARK, aUrl.GetMark() ) ); } // try to convert the URL into a physical name - but never change a physical name // physical name may be set if the logical name is changed after construction if ( pImpl->m_aName.isEmpty() ) - osl::FileBase::getSystemPathFromFileURL( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), pImpl->m_aName ); + osl::FileBase::getSystemPathFromFileURL( GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ), pImpl->m_aName ); else { DBG_ASSERT( pSalvageItem, "Suspicious change of logical name!" ); @@ -2598,7 +2598,7 @@ void SfxMedium::Init_Impl() // let the ItemSet be created if necessary GetItemSet()->Put( SfxStringItem( - SID_FILE_NAME, INetURLObject( pImpl->m_aLogicName ).GetMainURL( INetURLObject::NO_DECODE ) ) ); + SID_FILE_NAME, INetURLObject( pImpl->m_aLogicName ).GetMainURL( INetURLObject::DecodeMechanism::NONE ) ) ); } } @@ -2744,7 +2744,7 @@ void SfxMedium::UnlockFile( bool bReleaseLockStream ) uno::Reference< css::task::XInteractionHandler > xHandler = GetInteractionHandler( true ); uno::Reference< css::ucb::XCommandEnvironment > xComEnv = new ::ucbhelper::CommandEnvironment( xHandler, Reference< css::ucb::XProgressHandler >() ); - ucbhelper::Content aContentToUnlock( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), xComEnv, comphelper::getProcessComponentContext()); + ucbhelper::Content aContentToUnlock( GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ), xComEnv, comphelper::getProcessComponentContext()); pImpl->m_bLocked = false; //check if WebDAV unlock was explicitly disabled if ( !pImpl->m_bDisableUnlockWebDAV ) @@ -3392,7 +3392,7 @@ void SfxMedium::CreateTempFile( bool bReplace ) if ( GetContent().is() && GetURLObject().GetProtocol() == INetProtocol::File - && ::utl::UCBContentHelper::IsDocument( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) ) + && ::utl::UCBContentHelper::IsDocument( GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ) ) ) { // if there is already such a document, we should copy it // if it is a file system use OS copy process @@ -3402,10 +3402,10 @@ void SfxMedium::CreateTempFile( bool bReplace ) INetURLObject aTmpURLObj( aTmpURL ); OUString aFileName = aTmpURLObj.getName( INetURLObject::LAST_SEGMENT, true, - INetURLObject::DECODE_WITH_CHARSET ); + INetURLObject::DecodeMechanism::WithCharset ); if ( !aFileName.isEmpty() && aTmpURLObj.removeSegment() ) { - ::ucbhelper::Content aTargetContent( aTmpURLObj.GetMainURL( INetURLObject::NO_DECODE ), xComEnv, comphelper::getProcessComponentContext() ); + ::ucbhelper::Content aTargetContent( aTmpURLObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ), xComEnv, comphelper::getProcessComponentContext() ); OUString sMimeType = pImpl->getFilterMimeType(); if ( aTargetContent.transferContent( pImpl->aContent, ::ucbhelper::InsertOperation_COPY, aFileName, NameClash::OVERWRITE, sMimeType ) ) { @@ -3689,14 +3689,14 @@ OUString SfxMedium::CreateTempCopyWithExt( const OUString& aURL ) INetURLObject aDest( aNewTempFileURL ); OUString aFileName = aDest.getName( INetURLObject::LAST_SEGMENT, true, - INetURLObject::DECODE_WITH_CHARSET ); + INetURLObject::DecodeMechanism::WithCharset ); if ( !aFileName.isEmpty() && aDest.removeSegment() ) { try { uno::Reference< css::ucb::XCommandEnvironment > xComEnv; - ::ucbhelper::Content aTargetContent( aDest.GetMainURL( INetURLObject::NO_DECODE ), xComEnv, comphelper::getProcessComponentContext() ); - ::ucbhelper::Content aSourceContent( aSource.GetMainURL( INetURLObject::NO_DECODE ), xComEnv, comphelper::getProcessComponentContext() ); + ::ucbhelper::Content aTargetContent( aDest.GetMainURL( INetURLObject::DecodeMechanism::NONE ), xComEnv, comphelper::getProcessComponentContext() ); + ::ucbhelper::Content aSourceContent( aSource.GetMainURL( INetURLObject::DecodeMechanism::NONE ), xComEnv, comphelper::getProcessComponentContext() ); if ( aTargetContent.transferContent( aSourceContent, ::ucbhelper::InsertOperation_COPY, aFileName, diff --git a/sfx2/source/doc/docinsert.cxx b/sfx2/source/doc/docinsert.cxx index d1f03827f5c6..36079f27ee7d 100644 --- a/sfx2/source/doc/docinsert.cxx +++ b/sfx2/source/doc/docinsert.cxx @@ -160,7 +160,7 @@ void impl_FillURLList( sfx2::FileDialogHelper* _pFileDlg, std::vector& for ( sal_Int32 i = 0; i < aPathSeq.getLength(); ++i ) { INetURLObject aPathObj( aPathSeq[i] ); - _rpURLList.push_back(aPathObj.GetMainURL(INetURLObject::NO_DECODE)); + _rpURLList.push_back(aPathObj.GetMainURL(INetURLObject::DecodeMechanism::NONE)); } } } diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx index 934d42562546..a67a455284e0 100644 --- a/sfx2/source/doc/docmacromode.cxx +++ b/sfx2/source/doc/docmacromode.cxx @@ -207,7 +207,7 @@ namespace sfx2 OUString aLocation; if ( aURLReferer.removeSegment() ) - aLocation = aURLReferer.GetMainURL( INetURLObject::NO_DECODE ); + aLocation = aURLReferer.GetMainURL( INetURLObject::DecodeMechanism::NONE ); if ( !aLocation.isEmpty() && xSignatures->isLocationTrusted( aLocation ) ) { diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx index 6384008a3b78..cadeb45fa7e2 100644 --- a/sfx2/source/doc/doctempl.cxx +++ b/sfx2/source/doc/doctempl.cxx @@ -465,7 +465,7 @@ OUString SfxDocumentTemplates::GetTemplateTargetURLFromComponent( const OUString OUString aResult; Content aTemplate; uno::Reference< XCommandEnvironment > aCmdEnv; - if ( Content::create( aTemplateObj.GetMainURL( INetURLObject::NO_DECODE ), aCmdEnv, comphelper::getProcessComponentContext(), aTemplate ) ) + if ( Content::create( aTemplateObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ), aCmdEnv, comphelper::getProcessComponentContext(), aTemplate ) ) { OUString aPropName( TARGET_URL ); getTextProperty_Impl( aTemplate, aPropName, aResult ); @@ -703,10 +703,10 @@ bool SfxDocumentTemplates::CopyTo INetURLObject aTargetURL( rName ); OUString aTitle( aTargetURL.getName( INetURLObject::LAST_SEGMENT, true, - INetURLObject::DECODE_WITH_CHARSET ) ); + INetURLObject::DecodeMechanism::WithCharset ) ); aTargetURL.removeSegment(); - OUString aParentURL = aTargetURL.GetMainURL( INetURLObject::NO_DECODE ); + OUString aParentURL = aTargetURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ); uno::Reference< XCommandEnvironment > aCmdEnv; Content aTarget; @@ -796,7 +796,7 @@ bool SfxDocumentTemplates::CopyFrom try { xStorable.set( - xDesktop->loadComponentFromURL( aTemplURL.GetMainURL(INetURLObject::NO_DECODE), + xDesktop->loadComponentFromURL( aTemplURL.GetMainURL(INetURLObject::DecodeMechanism::NONE), "_blank", 0, aArgs ), @@ -825,7 +825,7 @@ bool SfxDocumentTemplates::CopyFrom INetURLObject aURL( aTemplURL ); aURL.CutExtension(); aTitle = aURL.getName( INetURLObject::LAST_SEGMENT, true, - INetURLObject::DECODE_WITH_CHARSET ); + INetURLObject::DecodeMechanism::WithCharset ); } // write a template using XStorable interface @@ -840,7 +840,7 @@ bool SfxDocumentTemplates::CopyFrom aTemplObj.insertName( aTitle, false, INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All ); - OUString aTemplURL = aTemplObj.GetMainURL( INetURLObject::NO_DECODE ); + OUString aTemplURL = aTemplObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); uno::Reference< XCommandEnvironment > aCmdEnv; Content aTemplCont; @@ -1146,7 +1146,7 @@ bool SfxDocumentTemplates::GetLogicNames aFullPath.SetSmartProtocol( INetProtocol::File ); aFullPath.SetURL( rPath ); - OUString aPath( aFullPath.GetMainURL( INetURLObject::NO_DECODE ) ); + OUString aPath( aFullPath.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); RegionData_Impl *pData = nullptr; DocTempl_EntryData_Impl *pEntry = nullptr; @@ -1248,7 +1248,7 @@ const OUString& DocTempl_EntryData_Impl::GetHierarchyURL() INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All ); - maOwnURL = aTemplateObj.GetMainURL( INetURLObject::NO_DECODE ); + maOwnURL = aTemplateObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); DBG_ASSERT( !maOwnURL.isEmpty(), "GetHierarchyURL(): Could not create URL!" ); } @@ -1364,7 +1364,7 @@ void RegionData_Impl::AddEntry( const OUString& rTitle, aLinkObj.insertName( rTitle, false, INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All ); - OUString aLinkURL = aLinkObj.GetMainURL( INetURLObject::NO_DECODE ); + OUString aLinkURL = aLinkObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); bool bFound = false; size_t nPos = GetEntryPos( rTitle, bFound ); @@ -1405,7 +1405,7 @@ const OUString& RegionData_Impl::GetHierarchyURL() INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All ); - maOwnURL = aRegionObj.GetMainURL( INetURLObject::NO_DECODE ); + maOwnURL = aRegionObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); DBG_ASSERT( !maOwnURL.isEmpty(), "GetHierarchyURL(): Could not create URL!" ); } @@ -1744,7 +1744,7 @@ bool SfxDocTemplate_Impl::GetTitleFromURL( const OUString& rURL, INetURLObject aURL( rURL ); aURL.CutExtension(); aTitle = aURL.getName( INetURLObject::LAST_SEGMENT, true, - INetURLObject::DECODE_WITH_CHARSET ); + INetURLObject::DecodeMechanism::WithCharset ); } return true; diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index e3e619fb5b8a..d0ecf8862f2a 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -544,7 +544,7 @@ void SfxDocTplService_Impl::getDirList() { aURL.SetSmartProtocol( INetProtocol::File ); aURL.SetURL( aDirs.getToken( i, C_DELIM ) ); - maTemplateDirs[i] = aURL.GetMainURL( INetURLObject::NO_DECODE ); + maTemplateDirs[i] = aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ); sal_Int32 nIndex = maTemplateDirs[i].indexOf( aPrefix ); if ( nIndex != -1 && xExpander.is() ) @@ -671,7 +671,7 @@ bool SfxDocTplService_Impl::getTitleFromURL( const OUString& rURL, OUString& aTi INetURLObject aURL( rURL ); aURL.CutExtension(); aTitle = aURL.getName( INetURLObject::LAST_SEGMENT, true, - INetURLObject::DECODE_WITH_CHARSET ); + INetURLObject::DecodeMechanism::WithCharset ); } else bDocHasTitle = true; @@ -691,7 +691,7 @@ bool SfxDocTplService_Impl::addEntry( Content& rParentFolder, aLinkObj.insertName( rTitle, false, INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All ); - OUString aLinkURL = aLinkObj.GetMainURL( INetURLObject::NO_DECODE ); + OUString aLinkURL = aLinkObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); Content aLink; @@ -732,7 +732,7 @@ bool SfxDocTplService_Impl::createFolder( const OUString& rNewFolderURL, bool bCreatedFolder = false; INetURLObject aParentURL( rNewFolderURL ); OUString aFolderName = aParentURL.getName( INetURLObject::LAST_SEGMENT, true, - INetURLObject::DECODE_WITH_CHARSET ); + INetURLObject::DecodeMechanism::WithCharset ); // compute the parent folder url from the new folder url // and remove the final slash, because Content::create doesn't @@ -744,7 +744,7 @@ bool SfxDocTplService_Impl::createFolder( const OUString& rNewFolderURL, // if the parent exists, we can continue with the creation of the // new folder, we have to create the parent otherwise ( as long as // bCreateParent is set to true ) - if ( Content::create( aParentURL.GetMainURL( INetURLObject::NO_DECODE ), maCmdEnv, comphelper::getProcessComponentContext(), aParent ) ) + if ( Content::create( aParentURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), maCmdEnv, comphelper::getProcessComponentContext(), aParent ) ) { try { @@ -782,7 +782,7 @@ bool SfxDocTplService_Impl::createFolder( const OUString& rNewFolderURL, // try to create the new folder again ( but this time, we set // bCreateParent to false to avoid endless recursions ) if ( ( aParentURL.getSegmentCount() >= 1 ) && - createFolder( aParentURL.GetMainURL( INetURLObject::NO_DECODE ), bCreateParent, bFsysFolder, aParent ) ) + createFolder( aParentURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), bCreateParent, bFsysFolder, aParent ) ) { bCreatedFolder = createFolder( rNewFolderURL, false, bFsysFolder, rNewFolder ); } @@ -803,7 +803,7 @@ bool SfxDocTplService_Impl::CreateNewUniqueFolderWithPrefix( const OUString& aPa Content aParent; uno::Reference< XCommandEnvironment > aQuietEnv; - if ( Content::create( aDirPath.GetMainURL( INetURLObject::NO_DECODE ), aQuietEnv, comphelper::getProcessComponentContext(), aParent ) ) + if ( Content::create( aDirPath.GetMainURL( INetURLObject::DecodeMechanism::NONE ), aQuietEnv, comphelper::getProcessComponentContext(), aParent ) ) { for ( sal_Int32 nInd = 0; nInd < 32000; nInd++ ) { @@ -837,7 +837,7 @@ bool SfxDocTplService_Impl::CreateNewUniqueFolderWithPrefix( const OUString& aPa INetURLObject::EncodeMechanism::All ); // if there is already an element, retry // if there was another error, do not try any more - if ( !::utl::UCBContentHelper::Exists( aObjPath.GetMainURL( INetURLObject::NO_DECODE ) ) ) + if ( !::utl::UCBContentHelper::Exists( aObjPath.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ) ) break; } @@ -864,7 +864,7 @@ OUString SfxDocTplService_Impl::CreateNewUniqueFileWithPrefix( const OUString& a Content aParent; uno::Reference< XCommandEnvironment > aQuietEnv; - if ( Content::create( aDirPath.GetMainURL( INetURLObject::NO_DECODE ), aQuietEnv, comphelper::getProcessComponentContext(), aParent ) ) + if ( Content::create( aDirPath.GetMainURL( INetURLObject::DecodeMechanism::NONE ), aQuietEnv, comphelper::getProcessComponentContext(), aParent ) ) { for ( sal_Int32 nInd = 0; nInd < 32000; nInd++ ) { @@ -903,7 +903,7 @@ OUString SfxDocTplService_Impl::CreateNewUniqueFileWithPrefix( const OUString& a INetURLObject::EncodeMechanism::All ); // if there is already an element, retry // if there was another error, do not try any more - if ( !::utl::UCBContentHelper::Exists( aObjPath.GetMainURL( INetURLObject::NO_DECODE ) ) ) + if ( !::utl::UCBContentHelper::Exists( aObjPath.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ) ) break; } @@ -1223,7 +1223,7 @@ std::vector< beans::StringPair > SfxDocTplService_Impl::ReadUINamesForTemplateDi // TODO/LATER: Use hashmap in future std::vector< beans::StringPair > aUINames; - if ( Content::create( aLocObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference < ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext(), aLocContent ) ) + if ( Content::create( aLocObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ), uno::Reference < ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext(), aLocContent ) ) { try { @@ -1414,7 +1414,7 @@ bool SfxDocTplService_Impl::addGroup( const OUString& rGroupName ) INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All ); - aNewGroupURL = aNewGroupObj.GetMainURL( INetURLObject::NO_DECODE ); + aNewGroupURL = aNewGroupObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); if ( Content::create( aNewGroupURL, maCmdEnv, comphelper::getProcessComponentContext(), aNewGroup ) || ! createFolder( aNewGroupURL, false, false, aNewGroup ) ) @@ -1501,7 +1501,7 @@ bool SfxDocTplService_Impl::removeGroup( const OUString& rGroupName ) // Get the target url Content aGroup; - OUString aGroupURL = aGroupObj.GetMainURL( INetURLObject::NO_DECODE ); + OUString aGroupURL = aGroupObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); if ( Content::create( aGroupURL, maCmdEnv, comphelper::getProcessComponentContext(), aGroup ) ) { @@ -1524,7 +1524,7 @@ bool SfxDocTplService_Impl::removeGroup( const OUString& rGroupName ) return false; OUString aGeneralTempPath = findParentTemplateDir( - aGroupParentFolder.GetMainURL(INetURLObject::NO_DECODE)); + aGroupParentFolder.GetMainURL(INetURLObject::DecodeMechanism::NONE)); if (aGeneralTempPath.isEmpty()) return false; @@ -1602,7 +1602,7 @@ bool SfxDocTplService_Impl::renameGroup( const OUString& rOldName, aGroupObj.insertName( rNewName, false, INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All ); - OUString aGroupURL = aGroupObj.GetMainURL( INetURLObject::NO_DECODE ); + OUString aGroupURL = aGroupObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); // Check, if there is a group with the new name, return false // if there is one. @@ -1613,7 +1613,7 @@ bool SfxDocTplService_Impl::renameGroup( const OUString& rOldName, aGroupObj.insertName( rOldName, false, INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All ); - aGroupURL = aGroupObj.GetMainURL( INetURLObject::NO_DECODE ); + aGroupURL = aGroupObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); // When there is no group with the old name, we can't rename it if ( ! Content::create( aGroupURL, maCmdEnv, comphelper::getProcessComponentContext(), aGroup ) ) @@ -1636,7 +1636,7 @@ bool SfxDocTplService_Impl::renameGroup( const OUString& rOldName, // check that the fs location is in writable folder and this is not a "My templates" folder INetURLObject aGroupParentFolder( aGroupTargetURL ); if (!aGroupParentFolder.removeSegment() || - isInternalTemplateDir(aGroupParentFolder.GetMainURL(INetURLObject::NO_DECODE))) + isInternalTemplateDir(aGroupParentFolder.GetMainURL(INetURLObject::DecodeMechanism::NONE))) { return false; } @@ -1671,10 +1671,10 @@ bool SfxDocTplService_Impl::renameGroup( const OUString& rOldName, if ( bCanBeRenamed ) { INetURLObject aGroupTargetObj( aGroupTargetURL ); - OUString aFsysName = aGroupTargetObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ); + OUString aFsysName = aGroupTargetObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset ); if ( aGroupTargetObj.removeSegment() - && ReplaceUINamesForTemplateDir_Impl( aGroupTargetObj.GetMainURL( INetURLObject::NO_DECODE ), + && ReplaceUINamesForTemplateDir_Impl( aGroupTargetObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ), aFsysName, rOldName, rNewName ) ) @@ -1709,7 +1709,7 @@ bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName, aGroupObj.insertName( rGroupName, false, INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All ); - aGroupURL = aGroupObj.GetMainURL( INetURLObject::NO_DECODE ); + aGroupURL = aGroupObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); if ( ! Content::create( aGroupURL, maCmdEnv, comphelper::getProcessComponentContext(), aGroup ) ) return false; @@ -1728,7 +1728,7 @@ bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName, aGroupObj.insertName( rTemplateName, false, INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All ); - aTemplateURL = aGroupObj.GetMainURL( INetURLObject::NO_DECODE ); + aTemplateURL = aGroupObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); if ( Content::create( aTemplateURL, maCmdEnv, comphelper::getProcessComponentContext(), aTemplateToRemove ) ) { @@ -1893,7 +1893,7 @@ bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName, aGroupObj.insertName( rGroupName, false, INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All ); - aGroupURL = aGroupObj.GetMainURL( INetURLObject::NO_DECODE ); + aGroupURL = aGroupObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); if ( ! Content::create( aGroupURL, maCmdEnv, comphelper::getProcessComponentContext(), aGroup ) ) return false; @@ -1903,7 +1903,7 @@ bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName, aGroupObj.insertName( rTemplateName, false, INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All ); - aTemplateURL = aGroupObj.GetMainURL( INetURLObject::NO_DECODE ); + aTemplateURL = aGroupObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); if ( Content::create( aTemplateURL, maCmdEnv, comphelper::getProcessComponentContext(), aTemplate ) ) return false; @@ -1946,7 +1946,7 @@ bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName, INetURLObject::EncodeMechanism::All ); aTargetObj.setExtension( aSourceObj.getExtension() ); - aTargetURL2 = aTargetObj.GetMainURL( INetURLObject::NO_DECODE ); + aTargetURL2 = aTargetObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); if ( aTargetURL2 == rSourceURL ) return addEntry( aGroup, rTemplateName, aTargetURL2, aType ); @@ -1956,11 +1956,11 @@ bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName, INetURLObject aTmpURL( aSourceObj ); aTmpURL.CutExtension(); - OUString aPattern = aTmpURL.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ); + OUString aPattern = aTmpURL.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset ); OUString aNewTemplateTargetURL = CreateNewUniqueFileWithPrefix( aTargetURL, aPattern, aSourceObj.getExtension() ); INetURLObject aNewTemplateTargetObj( aNewTemplateTargetURL ); - OUString aNewTemplateTargetName = aNewTemplateTargetObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ); + OUString aNewTemplateTargetName = aNewTemplateTargetObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset ); if ( aNewTemplateTargetURL.isEmpty() || aNewTemplateTargetName.isEmpty() ) return false; @@ -1968,7 +1968,7 @@ bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName, Content aSourceContent; uno::Reference < ucb::XCommandEnvironment > xEnv; INetURLObject aSourceURL( rSourceURL ); - if( ! Content::create( aSourceURL.GetMainURL( INetURLObject::NO_DECODE ), xEnv, comphelper::getProcessComponentContext(), aSourceContent ) ) + if( ! Content::create( aSourceURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), xEnv, comphelper::getProcessComponentContext(), aSourceContent ) ) return false; if( ! Content::create( aTargetURL, xEnv, comphelper::getProcessComponentContext(), aTargetGroup ) ) @@ -2009,7 +2009,7 @@ bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName, { INetURLObject aNewTmpObj( aNewTemplateTargetObj ); aNewTmpObj.CutExtension(); - bCorrectTitle = ( aNewTmpObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ).equals( rTemplateName ) ); + bCorrectTitle = ( aNewTmpObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset ).equals( rTemplateName ) ); } if ( !bCorrectTitle ) @@ -2066,7 +2066,7 @@ bool SfxDocTplService_Impl::removeTemplate( const OUString& rGroupName, aGroupObj.insertName( rGroupName, false, INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All ); - aGroupURL = aGroupObj.GetMainURL( INetURLObject::NO_DECODE ); + aGroupURL = aGroupObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); if ( ! Content::create( aGroupURL, maCmdEnv, comphelper::getProcessComponentContext(), aGroup ) ) return false; @@ -2076,7 +2076,7 @@ bool SfxDocTplService_Impl::removeTemplate( const OUString& rGroupName, aGroupObj.insertName( rTemplateName, false, INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All ); - aTemplateURL = aGroupObj.GetMainURL( INetURLObject::NO_DECODE ); + aTemplateURL = aGroupObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); if ( !Content::create( aTemplateURL, maCmdEnv, comphelper::getProcessComponentContext(), aTemplate ) ) return false; @@ -2118,7 +2118,7 @@ bool SfxDocTplService_Impl::renameTemplate( const OUString& rGroupName, aGroupObj.insertName( rGroupName, false, INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All ); - aGroupURL = aGroupObj.GetMainURL( INetURLObject::NO_DECODE ); + aGroupURL = aGroupObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); if ( ! Content::create( aGroupURL, maCmdEnv, comphelper::getProcessComponentContext(), aGroup ) ) return false; @@ -2128,7 +2128,7 @@ bool SfxDocTplService_Impl::renameTemplate( const OUString& rGroupName, aGroupObj.insertName( rNewName, false, INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All ); - aTemplateURL = aGroupObj.GetMainURL( INetURLObject::NO_DECODE ); + aTemplateURL = aGroupObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); if ( Content::create( aTemplateURL, maCmdEnv, comphelper::getProcessComponentContext(), aTemplate ) ) return false; @@ -2139,7 +2139,7 @@ bool SfxDocTplService_Impl::renameTemplate( const OUString& rGroupName, aGroupObj.insertName( rOldName, false, INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All ); - aTemplateURL = aGroupObj.GetMainURL( INetURLObject::NO_DECODE ); + aTemplateURL = aGroupObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); if ( !Content::create( aTemplateURL, maCmdEnv, comphelper::getProcessComponentContext(), aTemplate ) ) return false; @@ -2563,7 +2563,7 @@ void SfxDocTplService_Impl::createFromContent( GroupList_Impl& rList, // TODO/LATER: Use hashmap in future std::vector< beans::StringPair > aUINames; if ( !bHierarchy ) - aUINames = ReadUINamesForTemplateDir_Impl( aLayerObj.GetMainURL( INetURLObject::NO_DECODE ) ); + aUINames = ReadUINamesForTemplateDir_Impl( aLayerObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); uno::Reference< XResultSet > xResultSet; Sequence< OUString > aProps { TITLE }; @@ -2636,7 +2636,7 @@ void SfxDocTplService_Impl::addToHierarchy( GroupData_Impl *pGroup, INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All ); - OUString aTemplateURL = aGroupObj.GetMainURL( INetURLObject::NO_DECODE ); + OUString aTemplateURL = aGroupObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); if ( Content::create( aTemplateURL, maCmdEnv, comphelper::getProcessComponentContext(), aTemplate ) ) return; @@ -2680,7 +2680,7 @@ void SfxDocTplService_Impl::addGroupToHierarchy( GroupData_Impl *pGroup ) INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All ); - OUString aNewGroupURL = aNewGroupObj.GetMainURL( INetURLObject::NO_DECODE ); + OUString aNewGroupURL = aNewGroupObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); if ( createFolder( aNewGroupURL, false, false, aGroup ) ) { @@ -2831,7 +2831,7 @@ void SfxURLRelocator_Impl::implExpandURL( OUString& io_url ) if ( aParser.GetProtocol() != INetProtocol::VndSunStarExpand ) return; - io_url = aParser.GetURLPath( INetURLObject::DECODE_WITH_CHARSET ); + io_url = aParser.GetURLPath( INetURLObject::DecodeMechanism::WithCharset ); try { if ( !mxMacroExpander.is() ) diff --git a/sfx2/source/doc/frmdescr.cxx b/sfx2/source/doc/frmdescr.cxx index c2f217b99adb..a23126be9c80 100644 --- a/sfx2/source/doc/frmdescr.cxx +++ b/sfx2/source/doc/frmdescr.cxx @@ -64,7 +64,7 @@ SfxItemSet* SfxFrameDescriptor::GetArgs() void SfxFrameDescriptor::SetURL( const OUString& rURL ) { aURL = INetURLObject(rURL); - SetActualURL(aURL.GetMainURL( INetURLObject::DECODE_TO_IURI )); + SetActualURL(aURL.GetMainURL( INetURLObject::DecodeMechanism::ToIUri )); } void SfxFrameDescriptor::SetActualURL( const OUString& rURL ) diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index ce69cf683482..cf93b3cb6f43 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -1023,7 +1023,7 @@ bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode, // get the path from the dialog INetURLObject aURL( pFileDlg->GetPath() ); // the path should be provided outside since it might be used for further calls to the dialog - aSuggestedName = aURL.GetName( INetURLObject::DECODE_WITH_CHARSET ); + aSuggestedName = aURL.GetName( INetURLObject::DecodeMechanism::WithCharset ); aSuggestedDir = pFileDlg->GetDisplayDirectory(); // old filter options should be cleared in case different filter is used @@ -1106,7 +1106,7 @@ bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode, // merge in results of the dialog execution GetMediaDescr()[OUString("URL")] <<= - OUString( aURL.GetMainURL( INetURLObject::NO_DECODE )); + OUString( aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE )); GetMediaDescr()[sFilterNameString] <<= aFilterName; return bUseFilterOptions; @@ -1203,11 +1203,11 @@ OUString ModelData_Impl::GetRecommendedDir( const OUString& aSuggestedDir ) aLocation.setFinalSlash(); if ( !aLocation.HasError() ) - aRecommendedDir = aLocation.GetMainURL( INetURLObject::NO_DECODE ); + aRecommendedDir = aLocation.GetMainURL( INetURLObject::DecodeMechanism::NONE ); } else { - aRecommendedDir = INetURLObject( SvtPathOptions().GetWorkPath() ).GetMainURL( INetURLObject::NO_DECODE ); + aRecommendedDir = INetURLObject( SvtPathOptions().GetWorkPath() ).GetMainURL( INetURLObject::DecodeMechanism::NONE ); } return aRecommendedDir; @@ -1223,7 +1223,7 @@ OUString ModelData_Impl::GetRecommendedName( const OUString& aSuggestedName, con aRecommendedName = aSuggestedName; else { - aRecommendedName = INetURLObject( GetStorable()->getLocation() ).GetName( INetURLObject::DECODE_WITH_CHARSET ); + aRecommendedName = INetURLObject( GetStorable()->getLocation() ).GetName( INetURLObject::DecodeMechanism::WithCharset ); if ( aRecommendedName.isEmpty() ) { try { @@ -1247,7 +1247,7 @@ OUString ModelData_Impl::GetRecommendedName( const OUString& aSuggestedName, con if ( !aExtension.isEmpty() ) aObj.SetExtension( aExtension ); - aRecommendedName = aObj.GetName( INetURLObject::DECODE_WITH_CHARSET ); + aRecommendedName = aObj.GetName( INetURLObject::DecodeMechanism::WithCharset ); } } } @@ -1653,9 +1653,9 @@ bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& xMo // Document properties can contain streams that should be freed before storing aModelData.FreeDocumentProps(); if ( nStoreMode & EXPORT_REQUESTED ) - aModelData.GetStorable()->storeToURL( aURL.GetMainURL( INetURLObject::NO_DECODE ), aArgsSequence ); + aModelData.GetStorable()->storeToURL( aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), aArgsSequence ); else - aModelData.GetStorable()->storeAsURL( aURL.GetMainURL( INetURLObject::NO_DECODE ), aArgsSequence ); + aModelData.GetStorable()->storeAsURL( aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), aArgsSequence ); } catch( const uno::Exception& ) { @@ -1679,9 +1679,9 @@ bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& xMo // this is actually a save operation with different parameters // so storeTo or storeAs without DocInfo operations are used if ( nStoreMode & EXPORT_REQUESTED ) - aModelData.GetStorable()->storeToURL( aURL.GetMainURL( INetURLObject::NO_DECODE ), aArgsSequence ); + aModelData.GetStorable()->storeToURL( aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), aArgsSequence ); else - aModelData.GetStorable()->storeAsURL( aURL.GetMainURL( INetURLObject::NO_DECODE ), aArgsSequence ); + aModelData.GetStorable()->storeAsURL( aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), aArgsSequence ); } // Launch PDF viewer @@ -1693,7 +1693,7 @@ bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& xMo if ( aViewPDF ) { uno::Reference xSystemShellExecute(SystemShellExecute::create( ::comphelper::getProcessComponentContext() ) ); - xSystemShellExecute->execute( aURL.GetMainURL( INetURLObject::NO_DECODE ), "", SystemShellExecuteFlags::URIS_ONLY ); + xSystemShellExecute->execute( aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), "", SystemShellExecuteFlags::URIS_ONLY ); } } diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx index 3654103ddd39..7fd0404925ed 100644 --- a/sfx2/source/doc/iframe.cxx +++ b/sfx2/source/doc/iframe.cxx @@ -185,7 +185,7 @@ throw( uno::RuntimeException, std::exception ) mxFrame->setCreator( xFramesSupplier ); util::URL aTargetURL; - aTargetURL.Complete = maFrmDescr.GetURL().GetMainURL( INetURLObject::NO_DECODE ); + aTargetURL.Complete = maFrmDescr.GetURL().GetMainURL( INetURLObject::DecodeMechanism::NONE ); uno::Reference < util::XURLTransformer > xTrans( util::URLTransformer::create( mxContext ) ); xTrans->parseStrict( aTargetURL ); @@ -333,7 +333,7 @@ uno::Any SAL_CALL IFrameObject::getPropertyValue(const OUString& aPropertyName) { case WID_FRAME_URL: { - aAny <<= OUString( maFrmDescr.GetURL().GetMainURL( INetURLObject::NO_DECODE ) ); + aAny <<= OUString( maFrmDescr.GetURL().GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); } break; case WID_FRAME_NAME: diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index fc25b5f9ae65..13ba0ec0d266 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -531,7 +531,7 @@ void SfxObjectShell::ResetFromTemplate( const OUString& rTemplateName, const OUS if( SfxGetpApp()->Get_Impl()->GetDocumentTemplates()->GetFull( OUString(), rTemplateName, aFoundName ) ) { INetURLObject aObj( rFileName ); - xDocProps->setTemplateURL( aObj.GetMainURL(INetURLObject::DECODE_TO_IURI) ); + xDocProps->setTemplateURL( aObj.GetMainURL(INetURLObject::DecodeMechanism::ToIUri) ); xDocProps->setTemplateName( rTemplateName ); ::DateTime now( ::DateTime::SYSTEM ); diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index c862ad74001c..569a92f87939 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -479,7 +479,7 @@ bool SfxObjectShell::SwitchToShared( bool bShared, bool bSave ) if ( bShared != IsDocShared() ) { - OUString aOrigURL = GetMedium()->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); + OUString aOrigURL = GetMedium()->GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ); if ( aOrigURL.isEmpty() && bSave ) { @@ -496,7 +496,7 @@ bool SfxObjectShell::SwitchToShared( bool bShared, bool bSave ) const SfxBoolItem* pResult = dynamic_cast( pItem ); bResult = ( pResult && pResult->GetValue() ); if ( bResult ) - aOrigURL = GetMedium()->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); + aOrigURL = GetMedium()->GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ); } } @@ -542,7 +542,7 @@ bool SfxObjectShell::SwitchToShared( bool bShared, bool bSave ) } else { - OUString aTempFileURL = pMedium->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); + OUString aTempFileURL = pMedium->GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ); GetMedium()->SwitchDocumentToFile( GetSharedFileURL() ); (pImpl->m_aSharedFileURL).clear(); @@ -552,7 +552,7 @@ bool SfxObjectShell::SwitchToShared( bool bShared, bool bSave ) try { // aOrigURL can not be used since it contains an old value - ::svt::ShareControlFile aControlFile( GetMedium()->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ); + ::svt::ShareControlFile aControlFile( GetMedium()->GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); aControlFile.RemoveFile(); } catch( uno::Exception& ) @@ -844,16 +844,16 @@ OUString SfxObjectShell::GetTitle if ( nMaxLength == SFX_TITLE_FULLNAME ) return aName; else if ( nMaxLength == SFX_TITLE_FILENAME ) - return aURL.getName(INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET); + return aURL.getName(INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset); else if ( pImpl->aTitle.isEmpty() ) pImpl->aTitle = aURL.getBase( INetURLObject::LAST_SEGMENT, - true, INetURLObject::DECODE_WITH_CHARSET ); + true, INetURLObject::DecodeMechanism::WithCharset ); } else { if ( nMaxLength >= SFX_TITLE_MAXLEN ) { - OUString aComplete( aURL.GetMainURL( INetURLObject::NO_DECODE ) ); + OUString aComplete( aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); if( aComplete.getLength() > nMaxLength ) { OUString aRet( "..." ); @@ -866,13 +866,13 @@ OUString SfxObjectShell::GetTitle else if ( nMaxLength == SFX_TITLE_FILENAME ) { OUString aName( aURL.GetBase() ); - aName = INetURLObject::decode( aName, INetURLObject::DECODE_WITH_CHARSET ); + aName = INetURLObject::decode( aName, INetURLObject::DecodeMechanism::WithCharset ); if( aName.isEmpty() ) aName = aURL.GetURLNoPass(); return aName; } else if ( nMaxLength == SFX_TITLE_FULLNAME ) - return aURL.GetMainURL( INetURLObject::DECODE_TO_IURI ); + return aURL.GetMainURL( INetURLObject::DecodeMechanism::ToIUri ); // Generate Title from file name if possible if ( pImpl->aTitle.isEmpty() ) @@ -880,7 +880,7 @@ OUString SfxObjectShell::GetTitle // workaround for the case when the name can not be retrieved from URL by INetURLObject if ( pImpl->aTitle.isEmpty() ) - pImpl->aTitle = aURL.GetMainURL( INetURLObject::DECODE_WITH_CHARSET ); + pImpl->aTitle = aURL.GetMainURL( INetURLObject::DecodeMechanism::WithCharset ); } // Complete Title @@ -1079,7 +1079,7 @@ void SfxObjectShell::SetAutoLoad( if ( bReload ) { pImpl->pReloadTimer = new AutoReloadTimer_Impl( - rUrl.GetMainURL( INetURLObject::DECODE_TO_IURI ), + rUrl.GetMainURL( INetURLObject::DecodeMechanism::ToIUri ), nTime, this ); pImpl->pReloadTimer->Start(); } @@ -1239,7 +1239,7 @@ void SfxObjectShell::TemplateDisconnectionAfterLoad() { INetURLObject aURL( aName ); aURL.CutExtension(); - aTemplateName = aURL.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ); + aTemplateName = aURL.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset ); } } @@ -1535,7 +1535,7 @@ void SfxHeaderAttributes_Impl::SetAttribute( const SvKeyValue& rKV ) INetURLObject aObj; INetURLObject( pDoc->GetMedium()->GetName() ).GetNewAbsURL( aURL.copy( 4 ), &aObj ); xDocProps->setAutoloadURL( - aObj.GetMainURL( INetURLObject::NO_DECODE ) ); + aObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); } try { diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 46fca81d2ea2..ed67e58d5a11 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2102,7 +2102,7 @@ void SfxObjectShell::AddToRecentlyUsedList() if ( aUrl.GetProtocol() == INetProtocol::File ) { std::shared_ptr pOrgFilter = pMedium->GetOrigFilter(); - Application::AddToRecentDocumentList( aUrl.GetURLNoPass( INetURLObject::NO_DECODE ), + Application::AddToRecentDocumentList( aUrl.GetURLNoPass( INetURLObject::DecodeMechanism::NONE ), (pOrgFilter) ? pOrgFilter->GetMimeType() : OUString(), (pOrgFilter) ? pOrgFilter->GetServiceName() : OUString() ); } @@ -2654,7 +2654,7 @@ bool SfxObjectShell::CommonSaveAs_Impl(const INetURLObject& aURL, const OUString const SfxBoolItem* pCopyStreamItem = rItemSet.GetItem(SID_COPY_STREAM_IF_POSSIBLE, false); if ( bSaveTo && pCopyStreamItem && pCopyStreamItem->GetValue() && !IsModified() ) { - if (pMedium->TryDirectTransfer(aURL.GetMainURL(INetURLObject::NO_DECODE), rItemSet)) + if (pMedium->TryDirectTransfer(aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE), rItemSet)) return true; } rItemSet.ClearItem( SID_COPY_STREAM_IF_POSSIBLE ); @@ -2678,9 +2678,9 @@ bool SfxObjectShell::CommonSaveAs_Impl(const INetURLObject& aURL, const OUString OUString aTempFileURL; if ( IsDocShared() ) - aTempFileURL = pMedium->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); + aTempFileURL = pMedium->GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ); - if (PreDoSaveAs_Impl(aURL.GetMainURL(INetURLObject::NO_DECODE), aFilterName, rItemSet)) + if (PreDoSaveAs_Impl(aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE), aFilterName, rItemSet)) { // Update Data on media SfxItemSet *pSet = GetMedium()->GetItemSet(); diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index e4784b00adbf..438b4d7b2493 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -358,7 +358,7 @@ SfxObjectShell::~SfxObjectShell() #if HAVE_FEATURE_MULTIUSER_ENVIRONMENT if ( IsDocShared() && pMedium ) - FreeSharedFile( pMedium->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ); + FreeSharedFile( pMedium->GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); #endif DELETEX( SfxMedium, pMedium ); } diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index 8887ca079ac6..9da2bc273d09 100644 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -537,7 +537,7 @@ class ImplUCBPrintWatcher : public ::osl::Thread OUString sFileName = aSplitter.getName( INetURLObject::LAST_SEGMENT, true, - INetURLObject::DECODE_WITH_CHARSET); + INetURLObject::DecodeMechanism::WithCharset); if (aSplitter.removeSegment() && !sFileName.isEmpty()) { ::ucbhelper::Content aSource( @@ -546,7 +546,7 @@ class ImplUCBPrintWatcher : public ::osl::Thread comphelper::getProcessComponentContext()); ::ucbhelper::Content aTarget( - OUString(aSplitter.GetMainURL(INetURLObject::NO_DECODE)), + OUString(aSplitter.GetMainURL(INetURLObject::DecodeMechanism::NONE)), css::uno::Reference< css::ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext()); diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index b247d039e0f4..17e248a3cda0 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -1838,7 +1838,7 @@ void SAL_CALL SfxBaseModel::load( const Sequence< beans::PropertyValue >& seqA nError = m_pData->m_pObjectShell->GetErrorCode(); if ( nError == ERRCODE_IO_BROKENPACKAGE && xHandler.is() ) { - OUString aDocName = pMedium->GetURLObject().getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ); + OUString aDocName = pMedium->GetURLObject().getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset ); const SfxBoolItem* pRepairItem = SfxItemSet::GetItem(pMedium->GetItemSet(), SID_REPAIRPACKAGE, false); if ( !pRepairItem || !pRepairItem->GetValue() ) { diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index 941f451f1916..114c6a7120a0 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -988,7 +988,7 @@ void SfxTemplateManagerDlg::OnTemplateExport() else aPathObj.setName(aItemPath.getName()); - OUString aPath = aPathObj.GetMainURL( INetURLObject::NO_DECODE ); + OUString aPath = aPathObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); if (!mpLocalView->exportTo(pItem->mnAssocId,pItem->mnRegionId,aPath)) { @@ -1019,7 +1019,7 @@ void SfxTemplateManagerDlg::OnTemplateExport() else aPathObj.setName(aItemPath.getName()); - OUString aPath = aPathObj.GetMainURL( INetURLObject::NO_DECODE ); + OUString aPath = aPathObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); if (!mpLocalView->exportTo(pItem->mnDocId + 1, //mnId w.r.t. region = mDocId + 1 mpLocalView->getRegionId(pItem->mnRegionId), //pItem->mnRegionId does not store actual region Id diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx index d13ad0371732..0fcdb557e811 100644 --- a/sfx2/source/inet/inettbc.cxx +++ b/sfx2/source/inet/inettbc.cxx @@ -224,7 +224,7 @@ void SfxURLToolBoxControl_Impl::StateChanged continue; INetURLObject aURL ( sURL ); - OUString sMainURL( aURL.GetMainURL( INetURLObject::DECODE_WITH_CHARSET ) ); + OUString sMainURL( aURL.GetMainURL( INetURLObject::DecodeMechanism::WithCharset ) ); OUString sFile; if (osl::FileBase::getSystemPathFromFileURL(sMainURL, sFile) == osl::FileBase::E_None) diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx index 6c54b467c488..aa94e1b8e07f 100644 --- a/sfx2/source/notify/eventsupplier.cxx +++ b/sfx2/source/notify/eventsupplier.cxx @@ -437,7 +437,7 @@ void SfxEvents_Impl::NormalizeMacro( const ::comphelper::NamedValueCollection& i sal_Int32 nArgsPos = aScript.indexOf( '(' ); if ( ( nHashPos != -1 ) && ( nArgsPos == -1 || nHashPos < nArgsPos ) ) { - OUString aBasMgrName( INetURLObject::decode( aScript.copy( 8, nHashPos-8 ), INetURLObject::DECODE_WITH_CHARSET ) ); + OUString aBasMgrName( INetURLObject::decode( aScript.copy( 8, nHashPos-8 ), INetURLObject::DecodeMechanism::WithCharset ) ); if ( aBasMgrName == "." ) aLibrary = pDoc->GetTitle(); else diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 69aaa29c2ab0..3e18546749a3 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -290,7 +290,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) { SfxApplication* pApp = SfxGetpApp(); SfxAllItemSet aSet( pApp->GetPool() ); - aSet.Put( SfxStringItem( SID_FILE_NAME, pMed->GetURLObject().GetMainURL(INetURLObject::NO_DECODE) ) ); + aSet.Put( SfxStringItem( SID_FILE_NAME, pMed->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::NONE) ) ); aSet.Put( SfxBoolItem( SID_TEMPLATE, true ) ); aSet.Put( SfxStringItem( SID_TARGETNAME, OUString("_blank") ) ); const SfxStringItem* pReferer = SfxItemSet::GetItem(pMed->GetItemSet(), SID_REFERER, false); @@ -340,7 +340,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) && ( pSh->GetModifyPasswordHash() || pSh->GetModifyPasswordInfo().getLength() ) && !pSh->IsModifyPasswordEntered() ) { - OUString aDocumentName = INetURLObject( pMed->GetOrigURL() ).GetMainURL( INetURLObject::DECODE_WITH_CHARSET ); + OUString aDocumentName = INetURLObject( pMed->GetOrigURL() ).GetMainURL( INetURLObject::DecodeMechanism::WithCharset ); if( !AskPasswordToModify_Impl( pMed->GetInteractionHandler(), aDocumentName, pMed->GetOrigFilter(), pSh->GetModifyPasswordHash(), pSh->GetModifyPasswordInfo() ) ) { // this is a read-only document, if it has "Password to modify" @@ -403,8 +403,8 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) // etag tells that the cache representation (e.g. in LO) is different from the one on the server, // but tells nothing about the age // Details at this link: http://tools.ietf.org/html/rfc4918#section-15, section 15.7 - bool bPhysObjIsYounger = ::utl::UCBContentHelper::IsYounger( aMedObj.GetMainURL( INetURLObject::NO_DECODE ), - aPhysObj.GetMainURL( INetURLObject::NO_DECODE ) ); + bool bPhysObjIsYounger = ::utl::UCBContentHelper::IsYounger( aMedObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ), + aPhysObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); bool bIsWebDAV = aMedObj.isAnyKnownWebDAVScheme(); if ( ( !bNeedsReload && ( ( aMedObj.GetProtocol() == INetProtocol::File && diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx index 16ca900da627..625bf0a526c5 100644 --- a/sfx2/source/view/viewfrm2.cxx +++ b/sfx2/source/view/viewfrm2.cxx @@ -129,7 +129,7 @@ void SfxViewFrame::UpdateTitle() if ( pObjSh->HasName() ) { INetURLObject aTmp( pMedium->GetName() ); - aURL = aTmp.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ); + aURL = aTmp.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset ); } if ( aURL != m_pImpl->aActualURL ) diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 75ec8d1876a0..766e67f81207 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -639,7 +639,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) { // Determine file name from model INetURLObject aFObj( xStorable->getLocation() ); - aFileName = aFObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::NO_DECODE ); + aFileName = aFObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::NONE ); } OSL_ASSERT( !aFilterName.isEmpty() ); @@ -652,7 +652,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) aFilePathObj.insertName( aFileName ); aFilePathObj.setExtension( aExtension ); - OUString aFileURL = aFilePathObj.GetMainURL( INetURLObject::NO_DECODE ); + OUString aFileURL = aFilePathObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); css::uno::Sequence< css::beans::PropertyValue > aArgs( 1 ); aArgs[0].Name = "FilterName"; -- cgit