diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-02 15:58:06 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-02 16:30:34 +0200 |
commit | 44b3e56bb4a4df59f53447c4ca4d8e02fe926206 (patch) | |
tree | 71a9efde3a6a2a00688e8feb8e3086cb32eceb4f /sfx2/source | |
parent | 0b4965bcd7ec911951e7ca3a4cd48062843b2634 (diff) |
Change INetProtocol to scoped enumeration
...and fix o3tl::enumarray::operator [] const overload
Change-Id: I749b1b9d68686b03a97074253478d9d2d9d32b0b
Diffstat (limited to 'sfx2/source')
27 files changed, 67 insertions, 67 deletions
diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx index a5f9ce53af00..cb0227ead0be 100644 --- a/sfx2/source/appl/appdde.cxx +++ b/sfx2/source/appl/appdde.cxx @@ -84,7 +84,7 @@ namespace sal_Bool bRet = sal_False; INetURLObject aObj( rContent ); - DBG_ASSERT( aObj.GetProtocol() != INET_PROT_NOT_VALID, "Invalid URL!" ); + DBG_ASSERT( aObj.GetProtocol() != INetProtocol::NOT_VALID, "Invalid URL!" ); try { diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index f17495a6c65d..8f09e0247eac 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -531,7 +531,7 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq ) SfxStringItem aTarget( SID_TARGETNAME, "_default" ); if ( !aTemplateFileName.isEmpty() ) { - DBG_ASSERT( aObj.GetProtocol() != INET_PROT_NOT_VALID, "Illegal URL!" ); + DBG_ASSERT( aObj.GetProtocol() != INetProtocol::NOT_VALID, "Illegal URL!" ); SfxStringItem aName( SID_FILE_NAME, aObj.GetMainURL( INetURLObject::NO_DECODE ) ); SfxStringItem aTemplName( SID_TEMPLATE_NAME, aTemplateName ); @@ -826,7 +826,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) SvtExtendedSecurityOptions aExtendedSecurityOptions; SvtExtendedSecurityOptions::OpenHyperlinkMode eMode = aExtendedSecurityOptions.GetOpenHyperlinkMode(); - if ( eMode == SvtExtendedSecurityOptions::OPEN_NEVER && aINetProtocol != INET_PROT_VND_SUN_STAR_HELP ) + if ( eMode == SvtExtendedSecurityOptions::OPEN_NEVER && aINetProtocol != INetProtocol::VND_SUN_STAR_HELP ) { SolarMutexGuard aGuard; vcl::Window *pWindow = SfxGetpApp()->GetTopWindow(); @@ -845,15 +845,15 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) if (!pFilter || !lcl_isFilterNativelySupported(*pFilter)) { // hyperlink does not link to own type => special handling (http, ftp) browser and (other external protocols) OS - if ( aINetProtocol == INET_PROT_MAILTO ) + if ( aINetProtocol == INetProtocol::MAILTO ) { // don't dispatch mailto hyperlink to desktop dispatcher rReq.RemoveItem( SID_TARGETNAME ); rReq.AppendItem( SfxStringItem( SID_TARGETNAME, OUString("_self") ) ); } - else if ( aINetProtocol == INET_PROT_FTP || - aINetProtocol == INET_PROT_HTTP || - aINetProtocol == INET_PROT_HTTPS ) + else if ( aINetProtocol == INetProtocol::FTP || + aINetProtocol == INetProtocol::HTTP || + aINetProtocol == INetProtocol::HTTPS ) { sfx2::openUriExternally(aURL.Complete, true); return; diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx index b0930e8de47f..7c5434fe99f1 100644 --- a/sfx2/source/appl/fileobj.cxx +++ b/sfx2/source/appl/fileobj.cxx @@ -555,7 +555,7 @@ bool SvFileObject::IsDataComplete() const { INetURLObject aUrl( sFileNm ); if( aUrl.HasError() || - INET_PROT_NOT_VALID == aUrl.GetProtocol() ) + INetProtocol::NOT_VALID == aUrl.GetProtocol() ) bRet = true; } } diff --git a/sfx2/source/appl/imagemgr.cxx b/sfx2/source/appl/imagemgr.cxx index 11db32e02409..06fdb6fdd190 100644 --- a/sfx2/source/appl/imagemgr.cxx +++ b/sfx2/source/appl/imagemgr.cxx @@ -76,7 +76,7 @@ Image SAL_CALL GetImage( xModel = xController->getModel(); OUString aCommandURL( aURL ); - if ( nProtocol == INET_PROT_SLOT ) + if ( nProtocol == INetProtocol::SLOT ) { sal_uInt16 nId = ( sal_uInt16 ) aURL.copy(5).toInt32(); const SfxSlot* pSlot = 0; @@ -192,7 +192,7 @@ Image SAL_CALL GetImage( if ( !!aImage ) return aImage; - else if ( nProtocol != INET_PROT_UNO && nProtocol != INET_PROT_SLOT ) + else if ( nProtocol != INetProtocol::UNO && nProtocol != INetProtocol::SLOT ) return SvFileInformationManager::GetImageNoDefault( aObj, bBig ); } } diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index 65be6e6d74c3..50461699fd4e 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -563,7 +563,7 @@ OUString lcl_DDE_RelToAbs( const OUString& rTopic, const OUString& rBaseURL ) { OUString sRet; INetURLObject aURL( rTopic ); - if( INET_PROT_NOT_VALID == aURL.GetProtocol() ) + if( INetProtocol::NOT_VALID == aURL.GetProtocol() ) utl::LocalFileHelper::ConvertSystemPathToURL( rTopic, rBaseURL, sRet ); if( sRet.isEmpty() ) sRet = URIHelper::SmartRel2Abs( INetURLObject(rBaseURL), rTopic, URIHelper::GetMaybeFileHdl(), true ); @@ -657,8 +657,8 @@ bool SvxInternalLink::Connect( sfx2::SvBaseLink* pLink ) INetURLObject aURL( sTopic ); INetProtocol eOld = aURL.GetProtocol(); aURL.SetURL( sTopic = lcl_DDE_RelToAbs( sTopic, sReferer ) ); - if( INET_PROT_NOT_VALID != eOld || - INET_PROT_HTTP != aURL.GetProtocol() ) + if( INetProtocol::NOT_VALID != eOld || + INetProtocol::HTTP != aURL.GetProtocol() ) { SfxStringItem aName( SID_FILE_NAME, sTopic ); SfxBoolItem aMinimized(SID_MINIMIZED, true); diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index fb1464b0f08f..312e7d365324 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -2900,7 +2900,7 @@ void SfxHelpWindow_Impl::openDone(const OUString& sURL , bool bSuccess) { INetURLObject aObj( sURL ); - if ( aObj.GetProtocol() == INET_PROT_VND_SUN_STAR_HELP ) + if ( aObj.GetProtocol() == INetProtocol::VND_SUN_STAR_HELP ) SetFactory( aObj.GetHost() ); if ( IsWait() ) LeaveWait(); @@ -3042,7 +3042,7 @@ void SfxHelpWindow_Impl::SetFactory( const OUString& rFactory ) void SfxHelpWindow_Impl::SetHelpURL( const OUString& rURL ) { INetURLObject aObj( rURL ); - if ( aObj.GetProtocol() == INET_PROT_VND_SUN_STAR_HELP ) + if ( aObj.GetProtocol() == INetProtocol::VND_SUN_STAR_HELP ) SetFactory( aObj.GetHost() ); } diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx index 2051eb6c0b53..24b66809894e 100644 --- a/sfx2/source/appl/opengrf.cxx +++ b/sfx2/source/appl/opengrf.cxx @@ -126,7 +126,7 @@ short SvxOpenGraphicDialog::Execute() sal_uInt16 nFound = USHRT_MAX; // non-local? - if ( INET_PROT_FILE != aObj.GetProtocol() ) + if ( INetProtocol::FILE != aObj.GetProtocol() ) { SfxMedium aMed( aObj.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ ); aMed.Download(); diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 7db1a76d1960..fce5ddb1e0c3 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -549,7 +549,7 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const switch ( nProtocol ) { - case INET_PROT_VND_SUN_STAR_HELP: + case INetProtocol::VND_SUN_STAR_HELP: // already a vnd.sun.star.help URL -> nothing to do aHelpURL = rURL; break; diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx index 4c53a5098042..3b4261b73536 100644 --- a/sfx2/source/appl/sfxpicklist.cxx +++ b/sfx2/source/appl/sfxpicklist.cxx @@ -96,7 +96,7 @@ void SfxPickList::CreatePicklistMenuTitle( Menu* pMenu, sal_uInt16 nItemId, cons OUString aTipHelpText; OUString aAccessibleName = aPickEntry.toString(); - if ( aURL.GetProtocol() == INET_PROT_FILE ) + if ( aURL.GetProtocol() == INetProtocol::FILE ) { // Do handle file URL differently => convert it to a system // path and abbreviate it with a special function: @@ -172,7 +172,7 @@ void SfxPickList::AddDocumentToPickList( SfxObjectShell* pDocSh ) // Help not in History INetURLObject aURL( pDocSh->IsDocShared() ? pDocSh->GetSharedFileURL() : OUString( pMed->GetOrigURL() ) ); - if ( aURL.GetProtocol() == INET_PROT_VND_SUN_STAR_HELP ) + if ( aURL.GetProtocol() == INetProtocol::VND_SUN_STAR_HELP ) return; if ( !pMed->IsUpdatePickList() ) @@ -226,7 +226,7 @@ void SfxPickList::AddDocumentToPickList( SfxObjectShell* pDocSh ) OUString(), aThumbnail); - if ( aURL.GetProtocol() == INET_PROT_FILE ) + if ( aURL.GetProtocol() == INetProtocol::FILE ) Application::AddToRecentDocumentList( aURL.GetURLNoPass( INetURLObject::NO_DECODE ), (pFilter) ? pFilter->GetMimeType() : OUString(), (pFilter) ? pFilter->GetServiceName() : OUString() ); diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm index d69a207583ea..ef20b8cb027d 100644 --- a/sfx2/source/appl/shutdowniconaqua.mm +++ b/sfx2/source/appl/shutdowniconaqua.mm @@ -221,7 +221,7 @@ class RecentFilesStringLength : public ::cppu::WeakImplHelper1< ::com::sun::star rtl::OUString aMenuTitle; INetURLObject aURL( (*m_pRecentFilesItems)[i].aURL ); - if ( aURL.GetProtocol() == INET_PROT_FILE ) + if ( aURL.GetProtocol() == INetProtocol::FILE ) { // Do handle file URL differently => convert it to a system // path and abbreviate it with a special function: diff --git a/sfx2/source/bastyp/helper.cxx b/sfx2/source/bastyp/helper.cxx index 49260741f329..21a411852672 100644 --- a/sfx2/source/bastyp/helper.cxx +++ b/sfx2/source/bastyp/helper.cxx @@ -248,7 +248,7 @@ sal_Int64 SfxContentHelper::GetSize( const OUString& rContent ) { sal_Int64 nSize = 0; INetURLObject aObj( rContent ); - DBG_ASSERT( aObj.GetProtocol() != INET_PROT_NOT_VALID, "Invalid URL!" ); + DBG_ASSERT( aObj.GetProtocol() != INetProtocol::NOT_VALID, "Invalid URL!" ); try { ::ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() ); diff --git a/sfx2/source/control/recentdocsviewitem.cxx b/sfx2/source/control/recentdocsviewitem.cxx index 8f68306ef987..bf64b6a2c04c 100644 --- a/sfx2/source/control/recentdocsviewitem.cxx +++ b/sfx2/source/control/recentdocsviewitem.cxx @@ -41,7 +41,7 @@ RecentDocsViewItem::RecentDocsViewItem(ThumbnailView &rView, const OUString &rUR OUString aTitle(rTitle); INetURLObject aURLObj(rURL); - if( aURLObj.GetProtocol() == INET_PROT_FILE ) + if( aURLObj.GetProtocol() == INetProtocol::FILE ) m_sHelpText = aURLObj.getFSysPath(INetURLObject::FSYS_DETECT); if( m_sHelpText.isEmpty() ) m_sHelpText = aURLObj.GetURLNoPass(); @@ -50,7 +50,7 @@ RecentDocsViewItem::RecentDocsViewItem(ThumbnailView &rView, const OUString &rUR aTitle = aURLObj.GetName(INetURLObject::DECODE_WITH_CHARSET); BitmapEx aThumbnail(rThumbnail); - if (aThumbnail.IsEmpty() && aURLObj.GetProtocol() == INET_PROT_FILE) + if (aThumbnail.IsEmpty() && aURLObj.GetProtocol() == INetProtocol::FILE) aThumbnail = ThumbnailView::readThumbnail(rURL); if (aThumbnail.IsEmpty()) diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 5928480a3650..ab7833624d17 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -988,12 +988,12 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet ) // determine name INetURLObject aURL(aFile); OUString aName = aURL.GetName( INetURLObject::DECODE_WITH_CHARSET ); - if ( aName.isEmpty() || aURL.GetProtocol() == INET_PROT_PRIV_SOFFICE ) + if ( aName.isEmpty() || aURL.GetProtocol() == INetProtocol::PRIV_SOFFICE ) aName = SfxResId( STR_NONAME ).toString(); m_pNameED->SetText( aName ); // determine context symbol - aURL.SetSmartProtocol( INET_PROT_FILE ); + aURL.SetSmartProtocol( INetProtocol::FILE ); aURL.SetSmartURL( aFactory); const OUString& rMainURL = aURL.GetMainURL( INetURLObject::NO_DECODE ); Image aImage = SvFileInformationManager::GetImage( aURL, true ); @@ -1009,7 +1009,7 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet ) // determine size and type OUString aSizeText( m_aUnknownSize ); - if ( aURL.GetProtocol() == INET_PROT_FILE ) + if ( aURL.GetProtocol() == INetProtocol::FILE ) aSizeText = CreateSizeText( SfxContentHelper::GetSize( aURL.GetMainURL( INetURLObject::NO_DECODE ) ) ); m_pShowSizeFT->SetText( aSizeText ); @@ -1020,7 +1020,7 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet ) // determine location aURL.SetSmartURL( aFile); - if ( aURL.GetProtocol() == INET_PROT_FILE ) + if ( aURL.GetProtocol() == INetProtocol::FILE ) { INetURLObject aPath( aURL ); aPath.setFinalSlash(); @@ -1030,7 +1030,7 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet ) OUString aText( aPath.PathToFileName() ); //! (pb) MaxLen? m_pFileValFt->SetText( aText ); } - else if ( aURL.GetProtocol() != INET_PROT_PRIV_SOFFICE ) + else if ( aURL.GetProtocol() != INetProtocol::PRIV_SOFFICE ) m_pFileValFt->SetText( aURL.GetPartBeforeLastName() ); // handle access data @@ -1136,9 +1136,9 @@ SfxDocumentInfoDialog::SfxDocumentInfoDialog( vcl::Window* pParent, OUString aFile( rInfoItem.GetValue() ); INetURLObject aURL; - aURL.SetSmartProtocol( INET_PROT_FILE ); + aURL.SetSmartProtocol( INetProtocol::FILE ); aURL.SetSmartURL( aFile); - if ( INET_PROT_PRIV_SOFFICE != aURL.GetProtocol() ) + if ( INetProtocol::PRIV_SOFFICE != aURL.GetProtocol() ) { OUString aLastName( aURL.GetLastName() ); if ( !aLastName.isEmpty() ) diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index b12521f2f6a4..a6f641a5bd3b 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -607,7 +607,7 @@ void FileDialogHelper_Impl::updateVersions() { INetURLObject aObj( aPathSeq[0] ); - if ( ( aObj.GetProtocol() == INET_PROT_FILE ) && + if ( ( aObj.GetProtocol() == INetProtocol::FILE ) && ( utl::UCBContentHelper::IsDocument( aObj.GetMainURL( INetURLObject::NO_DECODE ) ) ) ) { try @@ -757,9 +757,9 @@ ErrCode FileDialogHelper_Impl::getGraphic( const OUString& rURL, INetURLObject aURLObj( rURL ); - if ( aURLObj.HasError() || INET_PROT_NOT_VALID == aURLObj.GetProtocol() ) + if ( aURLObj.HasError() || INetProtocol::NOT_VALID == aURLObj.GetProtocol() ) { - aURLObj.SetSmartProtocol( INET_PROT_FILE ); + aURLObj.SetSmartProtocol( INetProtocol::FILE ); aURLObj.SetSmartURL( rURL ); } @@ -767,7 +767,7 @@ ErrCode FileDialogHelper_Impl::getGraphic( const OUString& rURL, sal_uInt32 nFilterImportFlags = GRFILTER_I_FLAGS_SET_LOGSIZE_FOR_JPEG; // non-local? - if ( INET_PROT_FILE != aURLObj.GetProtocol() ) + if ( INetProtocol::FILE != aURLObj.GetProtocol() ) { SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( rURL, StreamMode::READ ); @@ -1144,7 +1144,7 @@ void FileDialogHelper_Impl::setControlHelpIds( const sal_Int16* _pControlId, con { while ( *_pControlId ) { - DBG_ASSERT( INetURLObject( OStringToOUString( *_pHelpId, RTL_TEXTENCODING_UTF8 ) ).GetProtocol() == INET_PROT_NOT_VALID, "Wrong HelpId!" ); + DBG_ASSERT( INetURLObject( OStringToOUString( *_pHelpId, RTL_TEXTENCODING_UTF8 ) ).GetProtocol() == INetProtocol::NOT_VALID, "Wrong HelpId!" ); OUString sId( sHelpIdPrefix ); sId += OUString( *_pHelpId, strlen( *_pHelpId ), RTL_TEXTENCODING_UTF8 ); xControlAccess->setValue( *_pControlId, ControlActions::SET_HELP_URL, makeAny( sId ) ); @@ -1567,7 +1567,7 @@ void FileDialogHelper_Impl::verifyPath() return; } INetURLObject url(maPath); - if (url.GetProtocol() != INET_PROT_FILE + if (url.GetProtocol() != INetProtocol::FILE || url.getName(0, true, INetURLObject::DECODE_WITH_CHARSET) != "tmp") { return; @@ -1923,7 +1923,7 @@ void FileDialogHelper_Impl::saveConfig() INetURLObject aObj( getPath() ); - if ( aObj.GetProtocol() == INET_PROT_FILE ) + if ( aObj.GetProtocol() == INetProtocol::FILE ) SetToken( aUserData, 2, ' ', aObj.GetMainURL( INetURLObject::NO_DECODE ) ); OUString aFilter = getFilter(); diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx index 211d21f66483..e6f2c2d7a5ce 100644 --- a/sfx2/source/dialog/mailmodel.cxx +++ b/sfx2/source/dialog/mailmodel.cxx @@ -310,7 +310,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( OUString aLocation = xStorable->getLocation(); INetURLObject aFileObj( aLocation ); - bool bPrivateProtocol = ( aFileObj.GetProtocol() == INET_PROT_PRIV_SOFFICE ); + bool bPrivateProtocol = ( aFileObj.GetProtocol() == INetProtocol::PRIV_SOFFICE ); bHasLocation = !aLocation.isEmpty() && !bPrivateProtocol; OSL_ASSERT( !bPrivateProtocol ); diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx index 7e5d3310d035..e982e561e0bd 100644 --- a/sfx2/source/dialog/taskpane.cxx +++ b/sfx2/source/dialog/taskpane.cxx @@ -401,7 +401,7 @@ namespace sfx2 static OString lcl_getHelpId( const OUString& _rHelpURL ) { INetURLObject aHID( _rHelpURL ); - if ( aHID.GetProtocol() == INET_PROT_HID ) + if ( aHID.GetProtocol() == INetProtocol::HID ) return OUStringToOString( aHID.GetURLPath(), RTL_TEXTENCODING_UTF8 ); else return OUStringToOString( _rHelpURL, RTL_TEXTENCODING_UTF8 ); diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 93808e693e85..f76633b3ea33 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -932,9 +932,9 @@ namespace INetURLObject aUrl( rLogicName ); INetProtocol eProt = aUrl.GetProtocol(); #if HAVE_FEATURE_MACOSX_SANDBOX - return eProt == INET_PROT_SFTP; + return eProt == INetProtocol::SFTP; #else - return eProt == INET_PROT_FILE || eProt == INET_PROT_SFTP; + return eProt == INetProtocol::FILE || eProt == INetProtocol::SFTP; #endif } } @@ -2420,7 +2420,7 @@ void SfxMedium::Init_Impl() { INetURLObject aUrl( pImp->m_aLogicName ); INetProtocol eProt = aUrl.GetProtocol(); - if ( eProt == INET_PROT_NOT_VALID ) + if ( eProt == INetProtocol::NOT_VALID ) { SAL_WARN( "sfx.doc", "Unknown protocol!" ); } @@ -2683,13 +2683,13 @@ void SfxMedium::SetIsRemote_Impl() INetURLObject aObj( GetName() ); switch( aObj.GetProtocol() ) { - case INET_PROT_FTP: - case INET_PROT_HTTP: - case INET_PROT_HTTPS: - case INET_PROT_POP3: - case INET_PROT_NEWS: - case INET_PROT_IMAP: - case INET_PROT_VIM: + case INetProtocol::FTP: + case INetProtocol::HTTP: + case INetProtocol::HTTPS: + case INetProtocol::POP3: + case INetProtocol::NEWS: + case INetProtocol::IMAP: + case INetProtocol::VIM: pImp->m_bRemote = true; break; default: diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx index d8f6cf22156f..def4e05ac0ac 100644 --- a/sfx2/source/doc/doctempl.cxx +++ b/sfx2/source/doc/doctempl.cxx @@ -1186,7 +1186,7 @@ bool SfxDocumentTemplates::GetLogicNames INetURLObject aFullPath; - aFullPath.SetSmartProtocol( INET_PROT_FILE ); + aFullPath.SetSmartProtocol( INetProtocol::FILE ); aFullPath.SetURL( rPath ); OUString aPath( aFullPath.GetMainURL( INetURLObject::NO_DECODE ) ); diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index 8b795cf1700e..15f175efefd3 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -570,7 +570,7 @@ void SfxDocTplService_Impl::getDirList() for (sal_Int32 i = 0; i < nCount; ++i) { - aURL.SetSmartProtocol( INET_PROT_FILE ); + aURL.SetSmartProtocol( INetProtocol::FILE ); aURL.SetURL( aDirs.getToken( i, C_DELIM ) ); maTemplateDirs[i] = aURL.GetMainURL( INetURLObject::NO_DECODE ); @@ -2907,7 +2907,7 @@ void SfxURLRelocator_Impl::initOfficeInstDirs() void SfxURLRelocator_Impl::implExpandURL( OUString& io_url ) { const INetURLObject aParser( io_url ); - if ( aParser.GetProtocol() != INET_PROT_VND_SUN_STAR_EXPAND ) + if ( aParser.GetProtocol() != INetProtocol::VND_SUN_STAR_EXPAND ) return; io_url = aParser.GetURLPath( INetURLObject::DECODE_WITH_CHARSET ); diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index b4beffb9c7ef..b1e580cba74c 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -1280,7 +1280,7 @@ OUString ModelData_Impl::GetRecommendedName( const OUString& aSuggestedName, con uno::UNO_QUERY ); if ( xTypeDetection.is() ) { - INetURLObject aObj( "c:/" + aRecommendedName, INET_PROT_FILE, + INetURLObject aObj( "c:/" + aRecommendedName, INetProtocol::FILE, INetURLObject::ENCODE_ALL, RTL_TEXTENCODING_UTF8, INetURLObject::FSYS_DOS ); uno::Sequence< beans::PropertyValue > aTypeNameProps; @@ -1618,7 +1618,7 @@ bool SfxStoringHelper::GUIStoreModel( uno::Reference< frame::XModel > xModel, OUString aFileName; aFileNameIter->second >>= aFileName; aURL.SetURL( aFileName ); - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "Illegal URL!" ); + DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NOT_VALID, "Illegal URL!" ); ::comphelper::SequenceAsHashMap::const_iterator aIter = aModelData.GetMediaDescr().find( sFilterNameString ); diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx index 22ddce08c6b9..b30e6f1c1e07 100644 --- a/sfx2/source/doc/new.cxx +++ b/sfx2/source/doc/new.cxx @@ -191,7 +191,7 @@ IMPL_LINK_NOARG(SfxNewFileDialog_Impl, Update) OUString aFileName = aTemplates.GetPath( m_pRegionLb->GetSelectEntryPos(), nEntry-1); INetURLObject aTestObj( aFileName ); - if( aTestObj.GetProtocol() == INET_PROT_NOT_VALID ) + if( aTestObj.GetProtocol() == INetProtocol::NOT_VALID ) { // temp. fix until Templates are managed by UCB compatible service // does NOT work with locally cached components ! diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 563c88c220e7..3f7b183e3ae5 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -860,7 +860,7 @@ OUString SfxObjectShell::GetTitle if ( pMed && ( nMaxLength == SFX_TITLE_CAPTION || nMaxLength == SFX_TITLE_PICKLIST ) ) { // If a specific title was given at open: - // important for URLs: use INET_PROT_FILE for which the set title is not + // important for URLs: use INetProtocol::FILE for which the set title is not // considered. (See below, analysis of aTitleMap_Impl) SFX_ITEMSET_ARG( pMed->GetItemSet(), pNameItem, SfxStringItem, SID_DOCINFO_TITLE, false ); if ( pNameItem ) @@ -891,7 +891,7 @@ OUString SfxObjectShell::GetTitle if ( nMaxLength > SFX_TITLE_CAPTION && nMaxLength <= SFX_TITLE_HISTORY ) { sal_uInt16 nRemote; - if( !pMed || aURL.GetProtocol() == INET_PROT_FILE ) + if( !pMed || aURL.GetProtocol() == INetProtocol::FILE ) nRemote = 0; else nRemote = 1; @@ -899,7 +899,7 @@ OUString SfxObjectShell::GetTitle } // Local file? - if ( aURL.GetProtocol() == INET_PROT_FILE ) + if ( aURL.GetProtocol() == INetProtocol::FILE ) { OUString aName( aURL.HasMark() ? INetURLObject( aURL.GetURLNoMark() ).PathToFileName() : aURL.PathToFileName() ); if ( nMaxLength == SFX_TITLE_FULLNAME ) diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 987cf9a4f3fd..cafa4b26ed3c 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2108,7 +2108,7 @@ void SfxObjectShell::AddToRecentlyUsedList() { INetURLObject aUrl( pMedium->GetOrigURL() ); - if ( aUrl.GetProtocol() == INET_PROT_FILE ) + if ( aUrl.GetProtocol() == INetProtocol::FILE ) { const SfxFilter* pOrgFilter = pMedium->GetOrigFilter(); Application::AddToRecentDocumentList( aUrl.GetURLNoPass( INetURLObject::NO_DECODE ), @@ -2644,7 +2644,7 @@ bool SfxObjectShell::CommonSaveAs_Impl } } - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "Illegal URL!" ); + DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NOT_VALID, "Illegal URL!" ); DBG_ASSERT( aParams->Count() != 0, "Incorrect Parameter"); SFX_ITEMSET_ARG( aParams, pSaveToItem, SfxBoolItem, SID_SAVETO, false ); diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index c7db58f3b118..c988ac704806 100644 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -638,7 +638,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& OUString sPath ; OUString sURL (sTemp); INetURLObject aCheck(sURL ); - if (aCheck.GetProtocol()==INET_PROT_NOT_VALID) + if (aCheck.GetProtocol()==INetProtocol::NOT_VALID) { // OK - it's not a valid URL. But may it's a simple // system path directly. It will be supported for historical diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx index 92249fa8adbb..7e433b5959e1 100644 --- a/sfx2/source/inet/inettbc.cxx +++ b/sfx2/source/inet/inettbc.cxx @@ -85,7 +85,7 @@ void SfxURLToolBoxControl_Impl::OpenURL( const OUString& rName, bool /*bNew*/ ) OUString aOptions; INetURLObject aObj( rName ); - if ( aObj.GetProtocol() == INET_PROT_NOT_VALID ) + if ( aObj.GetProtocol() == INetProtocol::NOT_VALID ) { OUString aBaseURL = GetURLBox()->GetBaseURL(); aName = SvtURLBox::ParseSmart( rName, aBaseURL, SvtPathOptions().GetWorkPath() ); @@ -247,7 +247,7 @@ void SfxURLToolBoxControl_Impl::StateChanged OUString aRep( pURL->GetValue() ); INetURLObject aURL( aRep ); INetProtocol eProt = aURL.GetProtocol(); - if ( eProt == INET_PROT_FILE ) + if ( eProt == INetProtocol::FILE ) { pURLBox->SetText( aURL.PathToFileName() ); } diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 0501ed65cb34..0b359c9ec673 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -443,7 +443,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) // the logic below is following, if the document seems not to need to be reloaded and the physical name is different // to the logical one, then on file system it can be checked that the copy is still newer than the original and no document reload is required - if ( ( !bNeedsReload && ( (aMedObj.GetProtocol() == INET_PROT_FILE && + if ( ( !bNeedsReload && ( (aMedObj.GetProtocol() == INetProtocol::FILE && aMedObj.getFSysPath(INetURLObject::FSYS_DETECT) != aPhysObj.getFSysPath(INetURLObject::FSYS_DETECT) && !::utl::UCBContentHelper::IsYounger( aMedObj.GetMainURL( INetURLObject::NO_DECODE ), aPhysObj.GetMainURL( INetURLObject::NO_DECODE ) )) || pMed->IsRemote() ) ) @@ -596,7 +596,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) aURL = pMedium->GetName(); bool bHandsOff = - ( pMedium->GetURLObject().GetProtocol() == INET_PROT_FILE && !xOldObj->IsDocShared() ); + ( pMedium->GetURLObject().GetProtocol() == INetProtocol::FILE && !xOldObj->IsDocShared() ); // Emty existing SfxMDIFrames for this Document // in native format or R/O, open it now for editing? diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 2d4ec9b4aec6..0c7620e7fcdf 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -670,7 +670,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) OUString aLocation = xStorable->getLocation(); INetURLObject aFileObj( aLocation ); - bool bPrivateProtocol = ( aFileObj.GetProtocol() == INET_PROT_PRIV_SOFFICE ); + bool bPrivateProtocol = ( aFileObj.GetProtocol() == INetProtocol::PRIV_SOFFICE ); bool bHasLocation = !aLocation.isEmpty() && !bPrivateProtocol; css::uno::Reference< css::container::XContainerQuery > xContainerQuery( |