diff options
207 files changed, 769 insertions, 736 deletions
diff --git a/avmedia/source/framework/modeltools.cxx b/avmedia/source/framework/modeltools.cxx index fe6ea56ca689..72e6a03371b7 100644 --- a/avmedia/source/framework/modeltools.cxx +++ b/avmedia/source/framework/modeltools.cxx @@ -90,7 +90,7 @@ bool KmzDae2Gltf(const OUString& rSourceURL, OUString& o_rOutput) // If *.dae file is not in the local file system, then copy it to a temp folder for the conversion OUString sInput = rSourceURL; const INetURLObject aSourceURLObj(rSourceURL); - if( aSourceURLObj.GetProtocol() != INET_PROT_FILE ) + if( aSourceURLObj.GetProtocol() != INetProtocol::FILE ) { try { diff --git a/avmedia/source/viewer/mediawindow.cxx b/avmedia/source/viewer/mediawindow.cxx index 7912bf5ddef5..9713666a13a9 100644 --- a/avmedia/source/viewer/mediawindow.cxx +++ b/avmedia/source/viewer/mediawindow.cxx @@ -339,7 +339,7 @@ bool MediaWindow::isMediaURL( const OUString& rURL, const OUString& rReferer, bo const INetURLObject aURL( rURL ); bool bRet = false; - if( aURL.GetProtocol() != INET_PROT_NOT_VALID ) + if( aURL.GetProtocol() != INetProtocol::NOT_VALID ) { if( bDeep || pPreferredSizePixel ) { diff --git a/avmedia/source/viewer/mediawindow_impl.cxx b/avmedia/source/viewer/mediawindow_impl.cxx index 26877f653bb5..9916b4451a85 100644 --- a/avmedia/source/viewer/mediawindow_impl.cxx +++ b/avmedia/source/viewer/mediawindow_impl.cxx @@ -310,7 +310,7 @@ void MediaWindowImpl::setURL( const OUString& rURL, { INetURLObject aURL( rURL ); - if (aURL.GetProtocol() != INET_PROT_NOT_VALID) + if (aURL.GetProtocol() != INetProtocol::NOT_VALID) maFileURL = aURL.GetMainURL(INetURLObject::DECODE_UNAMBIGUOUS); else maFileURL = rURL; diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index 4cb705d730f7..007d39537d63 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -292,7 +292,7 @@ OUString EditorWindow::GetWordAtCursor() { OUString aURL( URIHelper::FindFirstURLInText( aText, nStart, nEnd, aClass ) ); INetURLObject aURLObj( aURL ); - if ( aURLObj.GetProtocol() == INET_PROT_VND_SUN_STAR_HELP + if ( aURLObj.GetProtocol() == INetProtocol::VND_SUN_STAR_HELP && nSelStart >= nStart && nSelStart <= nEnd && nSelEnd >= nStart && nSelEnd <= nEnd ) { aWord = aURL; diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index 4f2b2c55014b..058fd97e3ab2 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -1269,7 +1269,7 @@ void LibPage::ExportAsBasic( const OUString& aLibName ) if( aPath.isEmpty() ) aPath = SvtPathOptions().GetWorkPath(); - // INetURLObject aURL(m_sSavePath, INET_PROT_FILE); + // INetURLObject aURL(m_sSavePath, INetProtocol::FILE); xFolderPicker->setDisplayDirectory( aPath ); short nRet = xFolderPicker->execute(); if( nRet == RET_OK ) diff --git a/basic/source/basmgr/basicmanagerrepository.cxx b/basic/source/basmgr/basicmanagerrepository.cxx index 3f873e4e6d5c..c12e904d1321 100644 --- a/basic/source/basmgr/basicmanagerrepository.cxx +++ b/basic/source/basmgr/basicmanagerrepository.cxx @@ -288,7 +288,7 @@ namespace basic // The first dir in the path as destination: OUString aFileName( aAppBasic.getName() ); aAppBasic = INetURLObject( aAppBasicDir.getToken(1, ';') ); - DBG_ASSERT(aAppBasic.GetProtocol() != INET_PROT_NOT_VALID, + DBG_ASSERT(aAppBasic.GetProtocol() != INetProtocol::NOT_VALID, OString("Invalid URL: \"" + OUStringToOString(aAppBasicDir, osl_getThreadTextEncoding()) + "\"").getStr()); diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 3472015dafc9..a4527d4a99bf 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -587,7 +587,7 @@ BasicManager::BasicManager( SotStorage& rStorage, const OUString& rBaseURL, Star pLibs->aBasicLibPath = *pLibPath; } OUString aStorName( rStorage.GetName() ); - maStorageName = INetURLObject(aStorName, INET_PROT_FILE).GetMainURL( INetURLObject::NO_DECODE ); + maStorageName = INetURLObject(aStorName, INetProtocol::FILE).GetMainURL( INetURLObject::NO_DECODE ); // If there is no Manager Stream, no further actions are necessary @@ -831,7 +831,7 @@ void BasicManager::LoadBasicManager( SotStorage& rStorage, const OUString& rBase return; } - maStorageName = INetURLObject(aStorName, INET_PROT_FILE).GetMainURL( INetURLObject::NO_DECODE ); + maStorageName = INetURLObject(aStorName, INetProtocol::FILE).GetMainURL( INetURLObject::NO_DECODE ); // #i13114 removed, DBG_ASSERT(aStorageName.Len() != 0, "Bad storage name"); OUString aRealStorageName = maStorageName; // for relative paths, can be modified through BaseURL @@ -839,7 +839,7 @@ void BasicManager::LoadBasicManager( SotStorage& rStorage, const OUString& rBase if ( !rBaseURL.isEmpty() ) { INetURLObject aObj( rBaseURL ); - if ( aObj.GetProtocol() == INET_PROT_FILE ) + if ( aObj.GetProtocol() == INetProtocol::FILE ) { aRealStorageName = aObj.PathToFileName(); } @@ -875,7 +875,7 @@ void BasicManager::LoadBasicManager( SotStorage& rStorage, const OUString& rBase // Always try relative first if there are two stands on disk if ( !pInfo->GetRelStorageName().isEmpty() && pInfo->GetRelStorageName() != szImbedded ) { - INetURLObject aObj( aRealStorageName, INET_PROT_FILE ); + INetURLObject aObj( aRealStorageName, INetProtocol::FILE ); aObj.removeSegment(); bool bWasAbsolute = false; aObj = aObj.smartRel2Abs( pInfo->GetRelStorageName(), bWasAbsolute ); @@ -946,7 +946,7 @@ void BasicManager::LoadOldBasicManager( SotStorage& rStorage ) if ( !aLibs.isEmpty() ) { OUString aCurStorageName( aStorName ); - INetURLObject aCurStorage( aCurStorageName, INET_PROT_FILE ); + INetURLObject aCurStorage( aCurStorageName, INetProtocol::FILE ); sal_Int32 nLibs = comphelper::string::getTokenCount(aLibs, LIB_SEP); for ( sal_Int32 nLib = 0; nLib < nLibs; nLib++ ) { @@ -956,7 +956,7 @@ void BasicManager::LoadOldBasicManager( SotStorage& rStorage ) OUString aLibName( aLibInfo.getToken( 0, LIBINFO_SEP ) ); OUString aLibAbsStorageName( aLibInfo.getToken( 1, LIBINFO_SEP ) ); OUString aLibRelStorageName( aLibInfo.getToken( 2, LIBINFO_SEP ) ); - INetURLObject aLibAbsStorage( aLibAbsStorageName, INET_PROT_FILE ); + INetURLObject aLibAbsStorage( aLibAbsStorageName, INetProtocol::FILE ); INetURLObject aLibRelStorage( aStorName ); aLibRelStorage.removeSegment(); @@ -1056,10 +1056,10 @@ bool BasicManager::ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStora OUString aStorName( pCurStorage->GetName() ); // #i13114 removed, DBG_ASSERT( aStorName.Len(), "No Storage Name!" ); - INetURLObject aCurStorageEntry(aStorName, INET_PROT_FILE); + INetURLObject aCurStorageEntry(aStorName, INetProtocol::FILE); // #i13114 removed, DBG_ASSERT(aCurStorageEntry.GetMainURL( INetURLObject::NO_DECODE ).Len() != 0, "Bad storage name"); - INetURLObject aStorageEntry(aStorageName, INET_PROT_FILE); + INetURLObject aStorageEntry(aStorageName, INetProtocol::FILE); // #i13114 removed, DBG_ASSERT(aCurStorageEntry.GetMainURL( INetURLObject::NO_DECODE ).Len() != 0, "Bad storage name"); if ( aCurStorageEntry == aStorageEntry ) @@ -1235,7 +1235,7 @@ StarBASIC* BasicManager::AddLib( SotStorage& rStorage, const OUString& rLibName, OUString aStorName( rStorage.GetName() ); DBG_ASSERT( !aStorName.isEmpty(), "No Storage Name!" ); - OUString aStorageName = INetURLObject(aStorName, INET_PROT_FILE).GetMainURL( INetURLObject::NO_DECODE ); + OUString aStorageName = INetURLObject(aStorName, INetProtocol::FILE).GetMainURL( INetURLObject::NO_DECODE ); DBG_ASSERT(!aStorageName.isEmpty(), "Bad storage name"); OUString aNewLibName( rLibName ); diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index e8502f45d3ed..8dbdf8e4f883 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -628,7 +628,7 @@ RTLFUNC(MkDir) // In vba if the full path is not specified then // folder is created relative to the curdir INetURLObject aURLObj( getFullPath( aPath ) ); - if ( aURLObj.GetProtocol() != INET_PROT_FILE ) + if ( aURLObj.GetProtocol() != INetProtocol::FILE ) { SbxArrayRef pPar = new SbxArray(); SbxVariableRef pResult = new SbxVariable(); diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index 2030490b1b4a..59459d932354 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -1644,7 +1644,7 @@ RTLFUNC(ConvertToUrl) if ( rPar.Count() == 2 ) { OUString aStr = rPar.Get(1)->GetOUString(); - INetURLObject aURLObj( aStr, INET_PROT_FILE ); + INetURLObject aURLObj( aStr, INetProtocol::FILE ); OUString aFileURL = aURLObj.GetMainURL( INetURLObject::NO_DECODE ); if( aFileURL.isEmpty() ) { diff --git a/connectivity/source/drivers/calc/CConnection.cxx b/connectivity/source/drivers/calc/CConnection.cxx index 35967f25c159..6ed3e12d27c4 100644 --- a/connectivity/source/drivers/calc/CConnection.cxx +++ b/connectivity/source/drivers/calc/CConnection.cxx @@ -72,13 +72,13 @@ void OCalcConnection::construct(const OUString& url,const Sequence< PropertyValu m_aFileName = aDSN; INetURLObject aURL; - aURL.SetSmartProtocol(INET_PROT_FILE); + aURL.SetSmartProtocol(INetProtocol::FILE); { SvtPathOptions aPathOptions; m_aFileName = aPathOptions.SubstituteVariable(m_aFileName); } aURL.SetSmartURL(m_aFileName); - if ( aURL.GetProtocol() == INET_PROT_NOT_VALID ) + if ( aURL.GetProtocol() == INetProtocol::NOT_VALID ) { // don't pass invalid URL to loadComponentFromURL throw SQLException(); diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index 8313889efa7a..b47a00f90983 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -628,7 +628,7 @@ OUString ODbaseTable::getEntry(OConnection* _pConnection,const OUString& _sName while(xDir->next()) { sName = xRow->getString(1); - aURL.SetSmartProtocol(INET_PROT_FILE); + aURL.SetSmartProtocol(INetProtocol::FILE); OUString sUrl = _pConnection->getURL() + s_sSeparator + sName; aURL.SetSmartURL( sUrl ); @@ -1038,7 +1038,7 @@ bool ODbaseTable::CreateImpl() } INetURLObject aURL; - aURL.SetSmartProtocol(INET_PROT_FILE); + aURL.SetSmartProtocol(INetProtocol::FILE); OUString aName = getEntry(m_pConnection, m_Name); if(aName.isEmpty()) { @@ -2523,7 +2523,7 @@ OUString ODbaseTable::createTempFile() getConnection()->throwGenericSQLException(STR_COULD_NOT_ALTER_TABLE, *this); INetURLObject aURL; - aURL.SetSmartProtocol(INET_PROT_FILE); + aURL.SetSmartProtocol(INetProtocol::FILE); aURL.SetURL(aTempFile.GetURL()); OUString sNewName(aURL.getName().copy(0, aURL.getName().getLength() - sExt.getLength())); diff --git a/connectivity/source/drivers/file/FConnection.cxx b/connectivity/source/drivers/file/FConnection.cxx index 4e1551674152..ae5d244e214f 100644 --- a/connectivity/source/drivers/file/FConnection.cxx +++ b/connectivity/source/drivers/file/FConnection.cxx @@ -136,7 +136,7 @@ void OConnection::construct(const OUString& url,const Sequence< PropertyValue >& OUString aFileName = aDSN; INetURLObject aURL; - aURL.SetSmartProtocol(INET_PROT_FILE); + aURL.SetSmartProtocol(INetProtocol::FILE); { SvtPathOptions aPathOptions; aFileName = aPathOptions.SubstituteVariable(aFileName); diff --git a/connectivity/source/drivers/file/FDatabaseMetaData.cxx b/connectivity/source/drivers/file/FDatabaseMetaData.cxx index 2d2b8f99f864..eb9e750175db 100644 --- a/connectivity/source/drivers/file/FDatabaseMetaData.cxx +++ b/connectivity/source/drivers/file/FDatabaseMetaData.cxx @@ -220,7 +220,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables( while(xResultSet->next()) { aName = xRow->getString(1); - aURL.SetSmartProtocol(INET_PROT_FILE); + aURL.SetSmartProtocol(INetProtocol::FILE); OUString sUrl = m_pConnection->getURL() + "/" + aName; aURL.SetSmartURL( sUrl ); sThisContentExtension = aURL.getExtension(); diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx index 7ca90d61c0bd..26d6b22c93e0 100644 --- a/connectivity/source/drivers/flat/ETable.cxx +++ b/connectivity/source/drivers/flat/ETable.cxx @@ -468,7 +468,7 @@ OUString OFlatTable::getEntry() while(xDir->next()) { sName = xRow->getString(1); - aURL.SetSmartProtocol(INET_PROT_FILE); + aURL.SetSmartProtocol(INetProtocol::FILE); OUString sUrl = m_pConnection->getURL() + s_sSeparator + sName; aURL.SetSmartURL( sUrl ); diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx index b1b045158301..9996a86811c4 100644 --- a/cui/source/dialogs/cuigaldlg.cxx +++ b/cui/source/dialogs/cuigaldlg.cxx @@ -145,7 +145,7 @@ void SearchThread::ImplSearch( const INetURLObject& rStartURL, while( xResultSet->next() && schedule() ) { INetURLObject aFoundURL( xContentAccess->queryContentIdentifierString() ); - DBG_ASSERT( aFoundURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aFoundURL.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); bool bFolder = xRow->getBoolean( 1 ); // property "IsFolder" if ( xRow->wasNull() ) diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx index d1107873e9e9..2daa9e51f186 100644 --- a/cui/source/dialogs/cuihyperdlg.cxx +++ b/cui/source/dialogs/cuihyperdlg.cxx @@ -305,17 +305,17 @@ sal_uInt16 SvxHpLinkDlg::SetPage ( SvxHyperlinkItem* pItem ) switch ( eProtocolTyp ) { - case INET_PROT_HTTP : - case INET_PROT_FTP : + case INetProtocol::HTTP : + case INetProtocol::FTP : nPageId = RID_SVXPAGE_HYPERLINK_INTERNET; break; - case INET_PROT_FILE : - case INET_PROT_POP3 : - case INET_PROT_IMAP : + case INetProtocol::FILE : + case INetProtocol::POP3 : + case INetProtocol::IMAP : nPageId = RID_SVXPAGE_HYPERLINK_DOCUMENT; break; - case INET_PROT_MAILTO : - case INET_PROT_NEWS : + case INetProtocol::MAILTO : + case INetProtocol::NEWS : nPageId = RID_SVXPAGE_HYPERLINK_MAIL; break; default : @@ -323,7 +323,7 @@ sal_uInt16 SvxHpLinkDlg::SetPage ( SvxHyperlinkItem* pItem ) nPageId = RID_SVXPAGE_HYPERLINK_DOCUMENT; else { - eProtocolTyp = INET_PROT_NOT_VALID; + eProtocolTyp = INetProtocol::NOT_VALID; nPageId = GetCurPageId(); } break; diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx index 2686b482c54c..f74809b8a640 100644 --- a/cui/source/dialogs/hldocntp.cxx +++ b/cui/source/dialogs/hldocntp.cxx @@ -64,7 +64,7 @@ bool SvxHyperlinkNewDocTp::ImplGetURLObject( const OUString& rPath, const OUStri if ( bIsValidURL ) { aURLObject.SetURL( rPath ); - if ( aURLObject.GetProtocol() == INET_PROT_NOT_VALID ) // test if the source is already a valid url + if ( aURLObject.GetProtocol() == INetProtocol::NOT_VALID ) // test if the source is already a valid url { // if not we have to create a url from a physical file name bool wasAbs; INetURLObject base(rBase); @@ -73,7 +73,7 @@ bool SvxHyperlinkNewDocTp::ImplGetURLObject( const OUString& rPath, const OUStri rPath, wasAbs, true, INetURLObject::ENCODE_ALL, RTL_TEXTENCODING_UTF8, true); } - bIsValidURL = aURLObject.GetProtocol() != INET_PROT_NOT_VALID; + bIsValidURL = aURLObject.GetProtocol() != INetProtocol::NOT_VALID; if ( bIsValidURL ) { OUString aBase( aURLObject.getName( INetURLObject::LAST_SEGMENT, false ) ); @@ -103,7 +103,7 @@ SvxHyperlinkNewDocTp::SvxHyperlinkNewDocTp ( vcl::Window *pParent, IconChoiceDia get(m_pRbtEditNow, "editnow"); get(m_pRbtEditLater, "editlater"); get(m_pCbbPath, "path"); - m_pCbbPath->SetSmartProtocol(INET_PROT_FILE); + m_pCbbPath->SetSmartProtocol(INetProtocol::FILE); get(m_pBtCreate, "create"); m_pBtCreate->SetModeImage(Image(CUI_RES(RID_SVXBMP_NEWDOC))); get(m_pLbDocTypes, "types"); @@ -417,7 +417,7 @@ IMPL_LINK_NOARG(SvxHyperlinkNewDocTp, ClickNewHdl_Impl) { sal_Char const sSlash[] = "/"; - INetURLObject aURL( aStrURL, INET_PROT_FILE ); + INetURLObject aURL( aStrURL, INetProtocol::FILE ); OUString aStrName; if( bHandleFileName ) aStrName = bZeroPath? aTempStrURL : OUString(aURL.getName()); @@ -442,7 +442,7 @@ IMPL_LINK_NOARG(SvxHyperlinkNewDocTp, ClickNewHdl_Impl) aNewURL.setExtension( static_cast<DocumentTypeData*>(m_pLbDocTypes->GetEntryData( nPos ))->aStrExt ); } - if( aNewURL.GetProtocol() == INET_PROT_FILE ) + if( aNewURL.GetProtocol() == INetProtocol::FILE ) { utl::LocalFileHelper::ConvertURLToSystemPath( aNewURL.GetMainURL( INetURLObject::NO_DECODE ), aStrTmp ); } diff --git a/cui/source/dialogs/hldoctp.cxx b/cui/source/dialogs/hldoctp.cxx index 2f5b8f7efb1a..12d73d1966ad 100644 --- a/cui/source/dialogs/hldoctp.cxx +++ b/cui/source/dialogs/hldoctp.cxx @@ -39,7 +39,7 @@ SvxHyperlinkDocTp::SvxHyperlinkDocTp ( vcl::Window *pParent, IconChoiceDialog* p mbMarkWndOpen ( false ) { get(m_pCbbPath, "path"); - m_pCbbPath->SetSmartProtocol(INET_PROT_FILE); + m_pCbbPath->SetSmartProtocol(INetProtocol::FILE); get(m_pBtFileopen, "fileopen"); m_pBtFileopen->SetModeImage(Image(CUI_RES(RID_SVXBMP_FILEOPEN))); get(m_pEdTarget, "target"); @@ -113,7 +113,7 @@ OUString SvxHyperlinkDocTp::GetCurrentURL () if ( aStrPath != aEmptyStr ) { INetURLObject aURL( aStrPath ); - if ( aURL.GetProtocol() != INET_PROT_NOT_VALID ) // maybe the path is already a valid + if ( aURL.GetProtocol() != INetProtocol::NOT_VALID ) // maybe the path is already a valid aStrURL = aStrPath; // hyperlink, then we can use this path directly else utl::LocalFileHelper::ConvertSystemPathToURL( aStrPath, aBaseURL, aStrURL ); @@ -341,7 +341,7 @@ void SvxHyperlinkDocTp::SetMarkStr ( const OUString& aStrMark ) SvxHyperlinkDocTp::EPathType SvxHyperlinkDocTp::GetPathType ( const OUString& rStrPath ) { - INetURLObject aURL( rStrPath, INET_PROT_FILE ); + INetURLObject aURL( rStrPath, INetProtocol::FILE ); if( aURL.HasError() ) return Type_Invalid; diff --git a/cui/source/dialogs/hlinettp.cxx b/cui/source/dialogs/hlinettp.cxx index 76088ba157d9..0471571facf9 100644 --- a/cui/source/dialogs/hlinettp.cxx +++ b/cui/source/dialogs/hlinettp.cxx @@ -44,7 +44,7 @@ SvxHyperlinkInternetTp::SvxHyperlinkInternetTp ( vcl::Window *pParent, get(m_pRbtLinktypInternet, "linktyp_internet"); get(m_pRbtLinktypFTP, "linktyp_ftp"); get(m_pCbbTarget, "target"); - m_pCbbTarget->SetSmartProtocol(INET_PROT_HTTP); + m_pCbbTarget->SetSmartProtocol(INetProtocol::HTTP); get(m_pBtBrowse, "browse"); m_pBtBrowse->SetModeImage(Image(CUI_RES (RID_SVXBMP_BROWSE))); get(m_pFtLogin, "login_label"); @@ -111,7 +111,7 @@ void SvxHyperlinkInternetTp::FillDlgFields(const OUString& rStrURL) // set URL-field // Show the scheme, #72740 - if ( aURL.GetProtocol() != INET_PROT_NOT_VALID ) + if ( aURL.GetProtocol() != INetProtocol::NOT_VALID ) m_pCbbTarget->SetText( aURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ) ); else m_pCbbTarget->SetText(rStrURL); // #77696# @@ -165,17 +165,17 @@ OUString SvxHyperlinkInternetTp::CreateAbsoluteURL() const INetURLObject aURL(aStrURL); - if( aURL.GetProtocol() == INET_PROT_NOT_VALID ) + if( aURL.GetProtocol() == INetProtocol::NOT_VALID ) { aURL.SetSmartProtocol( GetSmartProtocolFromButtons() ); aURL.SetSmartURL(aStrURL); } // username and password for ftp-url - if( aURL.GetProtocol() == INET_PROT_FTP && !m_pEdLogin->GetText().isEmpty() ) + if( aURL.GetProtocol() == INetProtocol::FTP && !m_pEdLogin->GetText().isEmpty() ) aURL.SetUserAndPass ( m_pEdLogin->GetText(), m_pEdPassword->GetText() ); - if ( aURL.GetProtocol() != INET_PROT_NOT_VALID ) + if ( aURL.GetProtocol() != INetProtocol::NOT_VALID ) return aURL.GetMainURL( INetURLObject::DECODE_TO_IURI ); else //#105788# always create a URL even if it is not valid return aStrURL; @@ -321,9 +321,9 @@ INetProtocol SvxHyperlinkInternetTp::GetSmartProtocolFromButtons() const { if( m_pRbtLinktypFTP->IsChecked() ) { - return INET_PROT_FTP; + return INetProtocol::FTP; } - return INET_PROT_HTTP; + return INetProtocol::HTTP; } /************************************************************************* diff --git a/cui/source/dialogs/hlmailtp.cxx b/cui/source/dialogs/hlmailtp.cxx index de79f64a3d12..60d8142b028f 100644 --- a/cui/source/dialogs/hlmailtp.cxx +++ b/cui/source/dialogs/hlmailtp.cxx @@ -44,7 +44,7 @@ SvxHyperlinkMailTp::SvxHyperlinkMailTp ( vcl::Window *pParent, IconChoiceDialog* get(m_pRbtMail, "linktyp_mail"); get(m_pRbtNews, "linktyp_news"); get(m_pCbbReceiver, "receiver"); - m_pCbbReceiver->SetSmartProtocol(INET_PROT_MAILTO); + m_pCbbReceiver->SetSmartProtocol(INetProtocol::MAILTO); get(m_pBtAdrBook, "adressbook"); m_pBtAdrBook->SetModeImage(Image(CUI_RES(RID_SVXBMP_ADRESSBOOK))); get(m_pFtSubject, "subject_label"); @@ -139,14 +139,14 @@ OUString SvxHyperlinkMailTp::CreateAbsoluteURL() const OUString aStrURL = m_pCbbReceiver->GetText(); INetURLObject aURL(aStrURL); - if( aURL.GetProtocol() == INET_PROT_NOT_VALID ) + if( aURL.GetProtocol() == INetProtocol::NOT_VALID ) { aURL.SetSmartProtocol( GetSmartProtocolFromButtons() ); aURL.SetSmartURL(aStrURL); } // subject for EMail-url - if( aURL.GetProtocol() == INET_PROT_MAILTO ) + if( aURL.GetProtocol() == INetProtocol::MAILTO ) { if ( m_pEdSubject->GetText() != OUString(aEmptyStr) ) { @@ -156,7 +156,7 @@ OUString SvxHyperlinkMailTp::CreateAbsoluteURL() const } } - if ( aURL.GetProtocol() != INET_PROT_NOT_VALID ) + if ( aURL.GetProtocol() != INetProtocol::NOT_VALID ) return aURL.GetMainURL( INetURLObject::DECODE_WITH_CHARSET ); else //#105788# always create a URL even if it is not valid return aStrURL; @@ -238,9 +238,9 @@ INetProtocol SvxHyperlinkMailTp::GetSmartProtocolFromButtons() const { if( m_pRbtNews->IsChecked() ) { - return INET_PROT_NEWS; + return INetProtocol::NEWS; } - return INET_PROT_MAILTO; + return INetProtocol::MAILTO; } /************************************************************************* diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx index 92c9703cc7f5..fcaaed8f7f75 100644 --- a/cui/source/dialogs/hltpbase.cxx +++ b/cui/source/dialogs/hltpbase.cxx @@ -43,7 +43,7 @@ SvxHyperURLBox::SvxHyperURLBox( vcl::Window* pParent, INetProtocol eSmart ) extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxHyperURLBox(vcl::Window *pParent, VclBuilder::stringmap &) { - return new SvxHyperURLBox(pParent, INET_PROT_HTTP); + return new SvxHyperURLBox(pParent, INetProtocol::HTTP); } sal_Int8 SvxHyperURLBox::AcceptDrop( const AcceptDropEvent& /* rEvt */ ) @@ -383,7 +383,7 @@ OUString SvxHyperlinkTabPageBase::GetSchemeFromURL( const OUString& rStrURL ) // #77696# // our new INetUrlObject now has the ability // to detect if an Url is valid or not :-( - if ( aProtocol == INET_PROT_NOT_VALID ) + if ( aProtocol == INetProtocol::NOT_VALID ) { if ( rStrURL.startsWithIgnoreAsciiCase( INET_HTTP_SCHEME ) ) { @@ -474,10 +474,10 @@ OUString SvxHyperlinkTabPageBase::CreateUiNameFromURL( const OUString& aStrURL ) switch(aURLObj.GetProtocol()) { - case INET_PROT_FILE: + case INetProtocol::FILE: utl::LocalFileHelper::ConvertURLToSystemPath( aURLObj.GetMainURL(INetURLObject::NO_DECODE), aStrUiURL ); break; - case INET_PROT_FTP : + case INetProtocol::FTP : { //remove password from name INetURLObject aTmpURL(aURLObj); diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx index 84c2fd7296dc..b8cd08bc29aa 100644 --- a/cui/source/dialogs/insdlg.cxx +++ b/cui/source/dialogs/insdlg.cxx @@ -295,7 +295,7 @@ short SvInsertOleDlg::Execute() { aFileName = GetFilePath(); INetURLObject aURL; - aURL.SetSmartProtocol( INET_PROT_FILE ); + aURL.SetSmartProtocol( INetProtocol::FILE ); aURL.SetSmartURL( aFileName ); aFileName = aURL.GetMainURL( INetURLObject::NO_DECODE ); bool bLink = IsLinked(); @@ -433,7 +433,7 @@ short SvInsertPlugInDialog::Execute() OUString aURL = GetPlugInFile(); // URL can be a valid and absolute URL or a system file name - m_pURL->SetSmartProtocol( INET_PROT_FILE ); + m_pURL->SetSmartProtocol( INetProtocol::FILE ); if ( aURL.isEmpty() || m_pURL->SetSmartURL( aURL ) ) { // create a plugin object @@ -618,7 +618,7 @@ short SfxInsertFloatingFrameDialog::Execute() { // URL can be a valid and absolute URL or a system file name INetURLObject aObj; - aObj.SetSmartProtocol( INET_PROT_FILE ); + aObj.SetSmartProtocol( INetProtocol::FILE ); if ( aObj.SetSmartURL( m_pEDURL->GetText() ) ) aURL = aObj.GetMainURL( INetURLObject::NO_DECODE ); } diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx index fc0c4d67cf58..bde358525512 100644 --- a/cui/source/dialogs/linkdlg.cxx +++ b/cui/source/dialogs/linkdlg.cxx @@ -361,7 +361,7 @@ IMPL_LINK( SvBaseLinksDlg, ChangeSourceClickHdl, PushButton *, pPushButton ) SvBaseLink* pLink = static_cast<SvBaseLink*>(pEntry->GetUserData()); pLinkMgr->GetDisplayNames( pLink, &sType, &sFile, 0, 0 ); INetURLObject aUrl(sFile); - if(aUrl.GetProtocol() == INET_PROT_FILE) + if(aUrl.GetProtocol() == INetProtocol::FILE) { OUString sOldPath(aUrl.PathToFileName()); sal_Int32 nLen = aUrl.GetName().getLength(); @@ -386,7 +386,7 @@ IMPL_LINK( SvBaseLinksDlg, ChangeSourceClickHdl, PushButton *, pPushButton ) continue; pLinkMgr->GetDisplayNames( pLink, &sType, &sFile, &sLinkName, &sFilter ); INetURLObject aUrl_(sFile); - INetURLObject aUrl2(aPath, INET_PROT_FILE); + INetURLObject aUrl2(aPath, INetProtocol::FILE); aUrl2.insertName( aUrl_.getName() ); OUString sNewLinkName; MakeLnkName( sNewLinkName, 0 , @@ -639,7 +639,7 @@ void SvBaseLinksDlg::InsertEntry( const SvBaseLink& rLink, sal_uLong nPos, bool long nWidthPixel = m_pTbLinks->GetLogicTab( 2 ) - m_pTbLinks->GetLogicTab( 1 ); nWidthPixel -= SV_TAB_BORDER; OUString aTxt = m_pTbLinks->GetEllipsisString( sFileNm, nWidthPixel, TEXT_DRAW_PATHELLIPSIS ); - INetURLObject aPath( sFileNm, INET_PROT_FILE ); + INetURLObject aPath( sFileNm, INetProtocol::FILE ); OUString aFileName = aPath.getName(); aFileName = INetURLObject::decode(aFileName, '%', INetURLObject::DECODE_UNAMBIGUOUS); diff --git a/cui/source/inc/hltpbase.hxx b/cui/source/inc/hltpbase.hxx index 8b645e84d619..b338534d0b81 100644 --- a/cui/source/inc/hltpbase.hxx +++ b/cui/source/inc/hltpbase.hxx @@ -59,7 +59,7 @@ protected: virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE; public: - SvxHyperURLBox( vcl::Window* pParent, INetProtocol eSmart = INET_PROT_FILE ); + SvxHyperURLBox( vcl::Window* pParent, INetProtocol eSmart = INetProtocol::FILE ); }; diff --git a/cui/source/options/doclinkdialog.cxx b/cui/source/options/doclinkdialog.cxx index 068f361ce61d..6a4eba8777fb 100644 --- a/cui/source/options/doclinkdialog.cxx +++ b/cui/source/options/doclinkdialog.cxx @@ -121,7 +121,7 @@ namespace svx return 0L; } // if (!bFileExists) INetURLObject aURL( sURL ); - if ( aURL.GetProtocol() != INET_PROT_FILE ) + if ( aURL.GetProtocol() != INetProtocol::FILE ) { OUString sMsg = CUI_RES(STR_LINKEDDOC_NO_SYSTEM_FILE); sMsg = sMsg.replaceFirst("$file$", m_pURL->GetText()); @@ -176,7 +176,7 @@ namespace svx { // default the name to the base of the chosen URL INetURLObject aParser; - aParser.SetSmartProtocol(INET_PROT_FILE); + aParser.SetSmartProtocol(INetProtocol::FILE); aParser.SetSmartURL(aFileDlg.GetPath()); m_pName->SetText(aParser.getBase(INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET)); diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index 29151a2961ff..33fe5cb3b34b 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -1676,9 +1676,9 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn ) { OUString sURL = xStor->getLocation(); INetURLObject aObj(sURL); - DBG_ASSERT( aObj.GetProtocol() == INET_PROT_FILE, + DBG_ASSERT( aObj.GetProtocol() == INetProtocol::FILE, "non-file URLs cannot be deleted" ); - if ( aObj.GetProtocol() == INET_PROT_FILE ) + if ( aObj.GetProtocol() == INetProtocol::FILE ) { KillFile_Impl( aObj.GetMainURL( INetURLObject::NO_DECODE ) ); } diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx index 747b310bf612..512c61f1fc94 100644 --- a/cui/source/options/optpath.cxx +++ b/cui/source/options/optpath.cxx @@ -150,7 +150,7 @@ OUString Convert_Impl( const OUString& rValue ) { OUString aValue = rValue.getToken( i, cDelim ); INetURLObject aObj( aValue ); - if ( aObj.GetProtocol() == INET_PROT_FILE ) + if ( aObj.GetProtocol() == INetProtocol::FILE ) aReturn += aObj.PathToFileName(); else if ( ::utl::LocalFileHelper::IsFileContent( aValue ) ) aReturn += aObj.GetURLPath( INetURLObject::DECODE_WITH_CHARSET ); @@ -482,7 +482,7 @@ void SvxPathTabPage::ChangeCurrentEntry( const OUString& _rFolder ) // old path is an URL? INetURLObject aObj( sWritable ); - bool bURL = ( aObj.GetProtocol() != INET_PROT_NOT_VALID ); + bool bURL = ( aObj.GetProtocol() != INetProtocol::NOT_VALID ); OUString aPathStr( _rFolder ); INetURLObject aNewObj( aPathStr ); aNewObj.removeFinalSlash(); @@ -607,7 +607,7 @@ IMPL_LINK_NOARG(SvxPathTabPage, PathHdl_Impl) Reference < XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); xFolderPicker = FolderPicker::create(xContext);; - INetURLObject aURL( sWritable, INET_PROT_FILE ); + INetURLObject aURL( sWritable, INetProtocol::FILE ); xFolderPicker->setDisplayDirectory( aURL.GetMainURL( INetURLObject::NO_DECODE ) ); Reference< XAsynchronousExecutableDialog > xAsyncDlg( xFolderPicker, UNO_QUERY ); diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index 36d63573a9f1..81fb8af0d09b 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -830,7 +830,7 @@ void OfaTreeOptionsDialog::ActivateLastSelection() : pLastPageSaver->m_sLastPageURL_Tools; } - bool bMustExpand = ( INetURLObject( sLastURL ).GetProtocol() == INET_PROT_FILE ); + bool bMustExpand = ( INetURLObject( sLastURL ).GetProtocol() == INetProtocol::FILE ); SvTreeListEntry* pTemp = pTreeLB->First(); while( !pEntry && pTemp ) diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index af67a18f11bf..12e0f1740dbb 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -1340,7 +1340,7 @@ IMPL_LINK( SvxBackgroundTabPage, FileClickHdl_Impl, CheckBox*, pBox ) m_pFtUnlinked->Hide(); INetURLObject aObj( aBgdGraphicPath ); OUString aFilePath; - if ( aObj.GetProtocol() == INET_PROT_FILE ) + if ( aObj.GetProtocol() == INetProtocol::FILE ) aFilePath = aObj.getFSysPath( INetURLObject::FSYS_DETECT ); else aFilePath = aBgdGraphicPath; @@ -1745,7 +1745,7 @@ void SvxBackgroundTabPage::FillControls_Impl( const SvxBrushItem& rBgdAttr, { #ifdef DBG_UTIL INetURLObject aObj( aStrLink ); - DBG_ASSERT( aObj.GetProtocol() != INET_PROT_NOT_VALID, "Invalid URL!" ); + DBG_ASSERT( aObj.GetProtocol() != INetProtocol::NOT_VALID, "Invalid URL!" ); #endif aBgdGraphicPath = aStrLink; m_pBtnLink->Check( true ); diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index 531a4a76a483..14b76460262b 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -799,7 +799,7 @@ SvxBitmapPickTabPage::SvxBitmapPickTabPage(vcl::Window* pParent, m_pExamplesVS->InsertItem( i + 1, i); INetURLObject aObj(*it); - if(aObj.GetProtocol() == INET_PROT_FILE) + if(aObj.GetProtocol() == INetProtocol::FILE) *it = aObj.PathToFileName(); m_pExamplesVS->SetItemText( i + 1, *it ); @@ -1978,7 +1978,7 @@ IMPL_LINK_NOARG(SvxNumOptionsTabPage, PopupActivateHdl_Impl) { sGrfName = *it; INetURLObject aObj(sGrfName); - if(aObj.GetProtocol() == INET_PROT_FILE) + if(aObj.GetProtocol() == INetProtocol::FILE) sGrfName = aObj.PathToFileName(); if(GalleryExplorer::GetGraphicObj( GALLERY_THEME_BULLETS, i, &aGraphic)) diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx index 1e9e466acb89..6170eb482e51 100644 --- a/cui/source/tabpages/tpbitmap.cxx +++ b/cui/source/tabpages/tpbitmap.cxx @@ -190,7 +190,7 @@ void SvxBitmapTabPage::ActivatePage( const SfxItemSet& ) INetURLObject aURL( pBitmapList->GetPath() ); aURL.Append( pBitmapList->GetName() ); - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); if( aURL.getBase().getLength() > 18 ) { @@ -857,7 +857,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickSaveHdl_Impl) aDlg.AddFilter( aStrFilterType, aStrFilterType ); INetURLObject aFile( SvtPathOptions().GetPalettePath() ); - DBG_ASSERT( aFile.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aFile.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); if( !pBitmapList->GetName().isEmpty() ) { diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx index ed3668b8ab25..8ed80122c414 100644 --- a/cui/source/tabpages/tpcolor.cxx +++ b/cui/source/tabpages/tpcolor.cxx @@ -210,7 +210,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickSaveHdl_Impl) aDlg.AddFilter( aStrFilterType, aStrFilterType ); INetURLObject aFile( SvtPathOptions().GetPalettePath() ); - DBG_ASSERT( aFile.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aFile.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); XPropertyListRef pList = GetList(); diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx index 46b001bd88ae..aab58f2d49eb 100644 --- a/cui/source/tabpages/tpgradnt.cxx +++ b/cui/source/tabpages/tpgradnt.cxx @@ -203,7 +203,7 @@ void SvxGradientTabPage::ActivatePage( const SfxItemSet& ) INetURLObject aURL( pGradientList->GetPath() ); aURL.Append( pGradientList->GetName() ); - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); if ( aURL.getBase().getLength() > 18 ) { @@ -712,7 +712,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickSaveHdl_Impl) aDlg.AddFilter( aStrFilterType, aStrFilterType ); INetURLObject aFile( SvtPathOptions().GetPalettePath() ); - DBG_ASSERT( aFile.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aFile.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); if( !pGradientList->GetName().isEmpty() ) { diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx index a8ce8ca49283..7754a07b11fe 100644 --- a/cui/source/tabpages/tphatch.cxx +++ b/cui/source/tabpages/tphatch.cxx @@ -187,7 +187,7 @@ void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet ) INetURLObject aURL( pHatchingList->GetPath() ); aURL.Append( pHatchingList->GetName() ); - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); if ( aURL.getBase().getLength() > 18 ) { @@ -745,7 +745,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickSaveHdl_Impl) aDlg.AddFilter( aStrFilterType, aStrFilterType ); INetURLObject aFile( SvtPathOptions().GetPalettePath() ); - DBG_ASSERT( aFile.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aFile.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); if( !pHatchingList->GetName().isEmpty() ) { diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx index 85a7cbe85a8b..6fffcef3d64d 100644 --- a/cui/source/tabpages/tpline.cxx +++ b/cui/source/tabpages/tpline.cxx @@ -562,7 +562,7 @@ void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet ) INetURLObject aDashURL( pDashList->GetPath() ); aDashURL.Append( pDashList->GetName() ); - DBG_ASSERT( aDashURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aDashURL.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); // LineEnd list if( ( *pnLineEndListState & CT_MODIFIED ) || ( *pnLineEndListState & CT_CHANGED ) ) { @@ -601,7 +601,7 @@ void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet ) INetURLObject aLineURL( pLineEndList->GetPath() ); aLineURL.Append( pLineEndList->GetName() ); - DBG_ASSERT( aLineURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aLineURL.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); // Evaluate if another TabPage set another fill type if( m_pLbLineStyle->GetSelectEntryPos() != 0 ) { diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx index bfc053efafcb..4fe1be6d4859 100644 --- a/cui/source/tabpages/tplnedef.cxx +++ b/cui/source/tabpages/tplnedef.cxx @@ -184,7 +184,7 @@ void SvxLineDefTabPage::ActivatePage( const SfxItemSet& ) INetURLObject aURL( pDashList->GetPath() ); aURL.Append( pDashList->GetName() ); - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); *pPageType = 0; // 2 *pPosDashLb = LISTBOX_ENTRY_NOTFOUND; @@ -801,7 +801,7 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickSaveHdl_Impl) aDlg.AddFilter( aStrFilterType, aStrFilterType ); INetURLObject aFile( SvtPathOptions().GetPalettePath() ); - DBG_ASSERT( aFile.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aFile.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); if( !pDashList->GetName().isEmpty() ) { diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx index b69f9d9e0b34..d00f37474ad0 100644 --- a/cui/source/tabpages/tplneend.cxx +++ b/cui/source/tabpages/tplneend.cxx @@ -163,7 +163,7 @@ void SvxLineEndDefTabPage::ActivatePage( const SfxItemSet& ) INetURLObject aURL( pLineEndList->GetPath() ); aURL.Append( pLineEndList->GetName() ); - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); *pPageType = 0; // 3 *pPosLineEndLb = LISTBOX_ENTRY_NOTFOUND; } @@ -623,7 +623,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickSaveHdl_Impl) aDlg.AddFilter( aStrFilterType, aStrFilterType ); INetURLObject aFile( SvtPathOptions().GetPalettePath() ); - DBG_ASSERT( aFile.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aFile.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); if( !pLineEndList->GetName().isEmpty() ) { diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx index 143cc198c5ba..30967d8e1369 100644 --- a/dbaccess/source/core/dataaccess/ModelImpl.cxx +++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx @@ -1245,7 +1245,7 @@ void ODatabaseModelImpl::impl_switchToLogicalURL( const OUString& i_rDocumentURL ) { INetURLObject aURL( i_rDocumentURL ); - if ( aURL.GetProtocol() != INET_PROT_NOT_VALID ) + if ( aURL.GetProtocol() != INetProtocol::NOT_VALID ) { m_sName = i_rDocumentURL; // TODO: our data source must broadcast the change of the Name property diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx index 25fc583b2ec4..98a305059a80 100644 --- a/dbaccess/source/core/dataaccess/databasecontext.cxx +++ b/dbaccess/source/core/dataaccess/databasecontext.cxx @@ -313,7 +313,7 @@ Reference< XInterface > ODatabaseContext::getRegisteredObject(const OUString& _ Reference< XInterface > ODatabaseContext::loadObjectFromURL(const OUString& _rName,const OUString& _sURL) { INetURLObject aURL( _sURL ); - if ( aURL.GetProtocol() == INET_PROT_NOT_VALID ) + if ( aURL.GetProtocol() == INetProtocol::NOT_VALID ) throw NoSuchElementException( _rName, *this ); try diff --git a/dbaccess/source/core/dataaccess/databaseregistrations.cxx b/dbaccess/source/core/dataaccess/databaseregistrations.cxx index 7039a1abba43..9d2d9b7f6c0d 100644 --- a/dbaccess/source/core/dataaccess/databaseregistrations.cxx +++ b/dbaccess/source/core/dataaccess/databaseregistrations.cxx @@ -239,7 +239,7 @@ namespace dbaccess throw IllegalArgumentException( OUString(), *this, 2 ); INetURLObject aURL( _rLocation ); - if ( aURL.GetProtocol() == INET_PROT_NOT_VALID ) + if ( aURL.GetProtocol() == INetProtocol::NOT_VALID ) throw IllegalArgumentException( OUString(), *this, 2 ); } diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx index b6c57087c0ae..021e9736bd98 100644 --- a/dbaccess/source/core/dataaccess/datasource.cxx +++ b/dbaccess/source/core/dataaccess/datasource.cxx @@ -1091,7 +1091,7 @@ Reference< XConnection > SAL_CALL ODatabaseSource::connectWithCompletion( const // the name which should be referred in the login dialog OUString sServerName( m_pImpl->m_sName ); INetURLObject aURLCheck( sServerName ); - if ( aURLCheck.GetProtocol() != INET_PROT_NOT_VALID ) + if ( aURLCheck.GetProtocol() != INetProtocol::NOT_VALID ) sServerName = aURLCheck.getBase( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_UNAMBIGUOUS ); // the request diff --git a/dbaccess/source/ext/macromigration/macromigrationpages.cxx b/dbaccess/source/ext/macromigration/macromigrationpages.cxx index 3a2f559fdab8..658a14a32bce 100644 --- a/dbaccess/source/ext/macromigration/macromigrationpages.cxx +++ b/dbaccess/source/ext/macromigration/macromigrationpages.cxx @@ -119,7 +119,7 @@ namespace dbmm // get the document's current URL Reference< XModel > xDocument( getDialog().getDocument(), UNO_QUERY_THROW ); INetURLObject aURLParser( xDocument->getURL() ); - OSL_ENSURE( aURLParser.GetProtocol() != INET_PROT_NOT_VALID, "SaveDBDocPage::initializePage: illegal document URL!" ); + OSL_ENSURE( aURLParser.GetProtocol() != INetProtocol::NOT_VALID, "SaveDBDocPage::initializePage: illegal document URL!" ); OUStringBuffer aBaseName( aURLParser.getBase() ); aBaseName.appendAscii( ".backup" ); diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index 618237e17f7e..53759bc083be 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -404,7 +404,7 @@ void SAL_CALL OApplicationController::disposing() OUString()); // add to recent document list - 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/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 93250faa87c5..11614688dfd1 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -1089,7 +1089,7 @@ namespace bool getDataSourceDisplayName_isURL( const OUString& _rDS, OUString& _rDisplayName, OUString& _rUniqueId ) { INetURLObject aURL( _rDS ); - if ( aURL.GetProtocol() != INET_PROT_NOT_VALID ) + if ( aURL.GetProtocol() != INetProtocol::NOT_VALID ) { _rDisplayName = aURL.getBase(INetURLObject::LAST_SEGMENT,true,INetURLObject::DECODE_WITH_CHARSET); _rUniqueId = aURL.GetMainURL( INetURLObject::NO_DECODE ); @@ -3653,7 +3653,7 @@ OUString SbaTableQueryBrowser::getPrivateTitle() const OUString sName = m_pTreeView->getListBox().GetEntryText(m_pCurrentlyDisplayed); sTitle = GetEntryText( pConnection ); INetURLObject aURL(sTitle); - if ( aURL.GetProtocol() != INET_PROT_NOT_VALID ) + if ( aURL.GetProtocol() != INetProtocol::NOT_VALID ) sTitle = aURL.getBase(INetURLObject::LAST_SEGMENT,true,INetURLObject::DECODE_WITH_CHARSET); if ( !sName.isEmpty() ) { diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index 06afe78cdc97..3f914c73f706 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -612,7 +612,7 @@ namespace dbaui ::ucbhelper::Content aParent(aParser.GetMainURL(INetURLObject::NO_DECODE), xEmptyEnv, comphelper::getProcessComponentContext()); OUString sContentType; - if ( INET_PROT_FILE == eProtocol ) + if ( INetProtocol::FILE == eProtocol ) { sContentType = "application/vnd.sun.staroffice.fsys-folder"; // the file UCP currently does not support the ContentType property diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx index 238a8ba415aa..847f69f2946f 100644 --- a/dbaccess/source/ui/dlg/dbfindex.cxx +++ b/dbaccess/source/ui/dlg/dbfindex.cxx @@ -268,7 +268,7 @@ void ODbaseIndexDialog::Init() // if the string does not contain a path, cut the string INetURLObject aURL; - aURL.SetSmartProtocol(INET_PROT_FILE); + aURL.SetSmartProtocol(INetProtocol::FILE); { SvtPathOptions aPathOptions; m_aDSN = aPathOptions.SubstituteVariable(m_aDSN); @@ -300,7 +300,7 @@ void ODbaseIndexDialog::Init() const OUString *pBegin = aFolderContent.getConstArray(); const OUString *pEnd = pBegin + aFolderContent.getLength(); - aURL.SetSmartProtocol(INET_PROT_FILE); + aURL.SetSmartProtocol(INetProtocol::FILE); for(;pBegin != pEnd;++pBegin) { OUString aName; @@ -408,7 +408,7 @@ void OTableInfo::WriteInfFile( const OUString& rDSN ) const { // open INF file INetURLObject aURL; - aURL.SetSmartProtocol(INET_PROT_FILE); + aURL.SetSmartProtocol(INetProtocol::FILE); OUString aDsn = rDSN; { SvtPathOptions aPathOptions; diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index 7111764d0f3a..725f79c99653 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -815,7 +815,7 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument() { m_aDocURL = INetURLObject(aFileDlg.GetPath()); - if( m_aDocURL.GetProtocol() != INET_PROT_NOT_VALID ) + if( m_aDocURL.GetProtocol() != INetProtocol::NOT_VALID ) { OUString sFileName = m_aDocURL.GetMainURL( INetURLObject::NO_DECODE ); if ( ::utl::UCBContentHelper::IsDocument(sFileName) ) diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx index a3ded92849bf..951e41f7e933 100644 --- a/dbaccess/source/ui/dlg/sqlmessage.cxx +++ b/dbaccess/source/ui/dlg/sqlmessage.cxx @@ -595,7 +595,7 @@ void OSQLMessageBox::impl_createStandardButtons( WinBits _nStyle ) OUString aTmp; INetURLObject aHID( m_sHelpURL ); - if ( aHID.GetProtocol() == INET_PROT_HID ) + if ( aHID.GetProtocol() == INetProtocol::HID ) aTmp = aHID.GetURLPath(); else aTmp = m_sHelpURL; diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index b51ae0bb4430..9dca902eaeea 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -1081,7 +1081,7 @@ OUString getStrippedDatabaseName(const Reference<XPropertySet>& _xDataSource,OUS } OUString sName = _rsDatabaseName; INetURLObject aURL(sName); - if ( aURL.GetProtocol() != INET_PROT_NOT_VALID ) + if ( aURL.GetProtocol() != INetProtocol::NOT_VALID ) sName = aURL.getBase(INetURLObject::LAST_SEGMENT,true,INetURLObject::DECODE_UNAMBIGUOUS); return sName; } diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx index ce5c2ac83c7f..d33459c93d8f 100644 --- a/desktop/source/app/dispatchwatcher.cxx +++ b/desktop/source/app/dispatchwatcher.cxx @@ -395,7 +395,7 @@ bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatchRequ else { INetURLObject aObj( aName ); - if ( aObj.GetProtocol() == INET_PROT_PRIV_SOFFICE ) + if ( aObj.GetProtocol() == INetProtocol::PRIV_SOFFICE ) aTarget = "_default"; // Set "AsTemplate" argument according to request type diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx index 7371b6cadc2c..09e8021f5ade 100644 --- a/editeng/source/items/flditem.cxx +++ b/editeng/source/items/flditem.cxx @@ -1008,7 +1008,7 @@ OUString SvxExtFileField::GetFormatted() const INetURLObject aURLObj( aFile ); - if( INET_PROT_NOT_VALID == aURLObj.GetProtocol() ) + if( INetProtocol::NOT_VALID == aURLObj.GetProtocol() ) { // invalid? try to interpret string as system file name OUString aURLStr; @@ -1020,12 +1020,12 @@ OUString SvxExtFileField::GetFormatted() const // #92009# Be somewhat liberate when trying to // get formatted content out of the FileField - if( INET_PROT_NOT_VALID == aURLObj.GetProtocol() ) + if( INetProtocol::NOT_VALID == aURLObj.GetProtocol() ) { // still not valid? Then output as is aString = aFile; } - else if( INET_PROT_FILE == aURLObj.GetProtocol() ) + else if( INetProtocol::FILE == aURLObj.GetProtocol() ) { switch( eFormat ) { diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 7ec0a8b96fb5..241b26b335bd 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -662,7 +662,7 @@ bool SvxAutoCorrect::FnAddNonBrkSpace( sal_Int32 nProtocolLen = nEndPos - nSttWdPos + 1; if (nIndex + nProtocolLen <= rTxt.getLength()) { - if (INetURLObject::CompareProtocolScheme(rTxt.copy(nIndex, nProtocolLen)) != INET_PROT_NOT_VALID) + if (INetURLObject::CompareProtocolScheme(rTxt.copy(nIndex, nProtocolLen)) != INetProtocol::NOT_VALID) return false; } @@ -854,7 +854,7 @@ bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, sal_Int32 nProtocolLen = pDelim - pWordStt + 1; if (nIndex + nProtocolLen <= rTxt.getLength()) { - if (INetURLObject::CompareProtocolScheme(rTxt.copy(nIndex, nProtocolLen)) != INET_PROT_NOT_VALID) + if (INetURLObject::CompareProtocolScheme(rTxt.copy(nIndex, nProtocolLen)) != INetProtocol::NOT_VALID) return false; // already ok } diff --git a/extensions/source/abpilot/abpfinalpage.cxx b/extensions/source/abpilot/abpfinalpage.cxx index 337b7329fbc6..55da306eac9d 100644 --- a/extensions/source/abpilot/abpfinalpage.cxx +++ b/extensions/source/abpilot/abpfinalpage.cxx @@ -87,7 +87,7 @@ namespace abp AddressSettings& rSettings = getSettings(); INetURLObject aURL( rSettings.sDataSourceName ); - if( aURL.GetProtocol() == INET_PROT_NOT_VALID ) + if( aURL.GetProtocol() == INetProtocol::NOT_VALID ) { OUString sPath = SvtPathOptions().GetWorkPath(); sPath += "/"; @@ -102,7 +102,7 @@ namespace abp aURL.SetURL(sPath); } - OSL_ENSURE( aURL.GetProtocol() != INET_PROT_NOT_VALID ,"No valid file name!"); + OSL_ENSURE( aURL.GetProtocol() != INetProtocol::NOT_VALID ,"No valid file name!"); rSettings.sDataSourceName = aURL.GetMainURL( INetURLObject::NO_DECODE ); m_pLocationController->setURL( rSettings.sDataSourceName ); OUString sName = aURL.getName( ); diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx index f6cbfee4023a..736bba151f28 100644 --- a/extensions/source/bibliography/general.cxx +++ b/extensions/source/bibliography/general.cxx @@ -448,7 +448,7 @@ uno::Reference< awt::XControlModel > BibGeneralPage::AddXControl( if(xPropInfo->hasPropertyByName(uProp)) { OUString sId( INET_HID_SCHEME ); - DBG_ASSERT( INetURLObject( OStringToOUString( sHelpId, RTL_TEXTENCODING_UTF8 ) ).GetProtocol() == INET_PROT_NOT_VALID, "Wrong HelpId!" ); + DBG_ASSERT( INetURLObject( OStringToOUString( sHelpId, RTL_TEXTENCODING_UTF8 ) ).GetProtocol() == INetProtocol::NOT_VALID, "Wrong HelpId!" ); sId += OStringToOUString( sHelpId, RTL_TEXTENCODING_UTF8 ); xPropSet->setPropertyValue( uProp, makeAny( sId ) ); } diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx index 061f7659db41..4aa7b278479f 100644 --- a/extensions/source/dbpilots/controlwizard.cxx +++ b/extensions/source/dbpilots/controlwizard.cxx @@ -202,7 +202,7 @@ namespace dbp } INetURLObject aURL( sDataSource ); - if( aURL.GetProtocol() != INET_PROT_NOT_VALID ) + if( aURL.GetProtocol() != INetProtocol::NOT_VALID ) sDataSource = aURL.GetName(INetURLObject::DECODE_WITH_CHARSET); m_pFormDatasource->SetText(sDataSource); m_pFormTable->SetText(sCommand); diff --git a/extensions/source/plugin/base/context.cxx b/extensions/source/plugin/base/context.cxx index 31250b59996b..c4007ab8d30a 100644 --- a/extensions/source/plugin/base/context.cxx +++ b/extensions/source/plugin/base/context.cxx @@ -131,7 +131,7 @@ void XPluginContext_Impl::getURL(const Reference< ::com::sun::star::plugin::XPlu if( target.isEmpty() ) { INetURLObject aURL; - aURL.SetSmartProtocol( INET_PROT_FILE ); + aURL.SetSmartProtocol( INetProtocol::FILE ); aURL.SetSmartURL( url ); OUString aUrl = aURL.GetMainURL(INetURLObject::DECODE_TO_IURI); diff --git a/extensions/source/plugin/base/xplugin.cxx b/extensions/source/plugin/base/xplugin.cxx index cef5e4be347c..41feb4e86f26 100644 --- a/extensions/source/plugin/base/xplugin.cxx +++ b/extensions/source/plugin/base/xplugin.cxx @@ -1051,7 +1051,7 @@ void PluginInputStream::load() Guard< Mutex > aGuard( m_pPlugin->getMutex() ); INetURLObject aUrl; - aUrl.SetSmartProtocol( INET_PROT_FILE ); + aUrl.SetSmartProtocol( INetProtocol::FILE ); aUrl.SetSmartURL( OUString( getStream().url, strlen( getStream().url ), diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index ae7a46c86dec..b0077113d932 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -2432,7 +2432,7 @@ namespace pcr } // additional info about what happened INetURLObject aParser( sDataSourceName ); - if ( aParser.GetProtocol() != INET_PROT_NOT_VALID ) + if ( aParser.GetProtocol() != INetProtocol::NOT_VALID ) sDataSourceName = aParser.getBase( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ); OUString sInfo(PcrRes(RID_STR_UNABLETOCONNECT).toString().replaceAll("$name$", sDataSourceName)); SQLContext aContext; @@ -2845,7 +2845,7 @@ namespace pcr OUString sURL; OSL_VERIFY( impl_getPropertyValue_throw( PROPERTY_TARGET_URL ) >>= sURL ); INetURLObject aParser( sURL ); - if ( INET_PROT_FILE == aParser.GetProtocol() ) + if ( INetProtocol::FILE == aParser.GetProtocol() ) // set the initial directory only for file-URLs. Everything else // is considered to be potentially expensive aFileDlg.SetDisplayDirectory( sURL ); @@ -2900,7 +2900,7 @@ namespace pcr OUString sDataSource; OSL_VERIFY( impl_getPropertyValue_throw( PROPERTY_DATASOURCE ) >>= sDataSource ); INetURLObject aParser( sDataSource ); - if ( INET_PROT_FILE == aParser.GetProtocol() ) + if ( INetProtocol::FILE == aParser.GetProtocol() ) // set the initial directory only for file-URLs. Everything else // is considered to be potentially expensive aFileDlg.SetDisplayDirectory( sDataSource ); diff --git a/extensions/source/propctrlr/pcrcommon.cxx b/extensions/source/propctrlr/pcrcommon.cxx index 9292a029a4e8..25bed3f418fd 100644 --- a/extensions/source/propctrlr/pcrcommon.cxx +++ b/extensions/source/propctrlr/pcrcommon.cxx @@ -39,7 +39,7 @@ namespace pcr OString HelpIdUrl::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 ); @@ -51,7 +51,7 @@ namespace pcr OUStringBuffer aBuffer; OUString aTmp( OStringToOUString(sHelpId, RTL_TEXTENCODING_UTF8) ); INetURLObject aHID( aTmp ); - if ( aHID.GetProtocol() == INET_PROT_NOT_VALID ) + if ( aHID.GetProtocol() == INetProtocol::NOT_VALID ) aBuffer.appendAscii( INET_HID_SCHEME ); aBuffer.append( aTmp.getStr() ); return aBuffer.makeStringAndClear(); diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index b2f7093416d4..ffd0cda3a250 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -3944,7 +3944,7 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aFileName, aValidURL ) ) aAbsURL = INetURLObject( aValidURL ); } - if( aAbsURL.GetProtocol() != INET_PROT_NOT_VALID ) + if( aAbsURL.GetProtocol() != INetProtocol::NOT_VALID ) { GraphicFilter &rGrfFilter = GraphicFilter::GetGraphicFilter(); aLinkFilterName = rGrfFilter.GetImportFormatName( diff --git a/filter/source/msfilter/msvbahelper.cxx b/filter/source/msfilter/msvbahelper.cxx index e7662cad1705..3dbdde9959f6 100644 --- a/filter/source/msfilter/msvbahelper.cxx +++ b/filter/source/msfilter/msvbahelper.cxx @@ -80,7 +80,7 @@ SfxObjectShell* findShellForUrl( const OUString& sMacroURLOrPath ) SfxObjectShell* pShell = SfxObjectShell::GetFirst(); INetURLObject aObj; aObj.SetURL( sMacroURLOrPath ); - bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; + bool bIsURL = aObj.GetProtocol() != INetProtocol::NOT_VALID; OUString aURL; if ( bIsURL ) aURL = sMacroURLOrPath; @@ -398,7 +398,7 @@ MacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const OUString& Macro { INetURLObject aObj; aObj.SetURL( sCreatedFrom ); - bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; + bool bIsURL = aObj.GetProtocol() != INetProtocol::NOT_VALID; OUString aURL; if ( bIsURL ) aURL = sCreatedFrom; diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index 19e3f183e694..d4942b906d23 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -381,7 +381,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& std::set< PDFWriter::ErrorCode > aErrors; - if( aURL.GetProtocol() != INET_PROT_FILE ) + if( aURL.GetProtocol() != INetProtocol::FILE ) { OUString aTmp; @@ -389,7 +389,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& aURL = INetURLObject(aTmp); } - if( aURL.GetProtocol() == INET_PROT_FILE ) + if( aURL.GetProtocol() == INetProtocol::FILE ) { Reference< XRenderable > xRenderable( mxSrcDoc, UNO_QUERY ); diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index 225967cbfe77..3041e83dbe11 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -489,9 +489,9 @@ OUString ODatabaseForm::GetDataEncoded(bool _bURLEncoded,const Reference<XContro { // For File URLs we transfer the file name and not a URL, because Netscape does it like that INetURLObject aURL; - aURL.SetSmartProtocol(INET_PROT_FILE); + aURL.SetSmartProtocol(INetProtocol::FILE); aURL.SetSmartURL(aValue); - if( INET_PROT_FILE == aURL.GetProtocol() ) + if( INetProtocol::FILE == aURL.GetProtocol() ) aValue = INetURLObject::decode(aURL.PathToFileName(), '%', INetURLObject::DECODE_UNAMBIGUOUS); } Encode( aName ); @@ -1035,9 +1035,9 @@ bool ODatabaseForm::InsertFilePart( INetMIMEMessage& rParent, const OUString& rN { // We can only process File URLs yet INetURLObject aURL; - aURL.SetSmartProtocol(INET_PROT_FILE); + aURL.SetSmartProtocol(INetProtocol::FILE); aURL.SetSmartURL(rFileName); - if( INET_PROT_FILE == aURL.GetProtocol() ) + if( INetProtocol::FILE == aURL.GetProtocol() ) { aFileName = INetURLObject::decode(aURL.PathToFileName(), '%', INetURLObject::DECODE_UNAMBIGUOUS); pStream = ::utl::UcbStreamHelper::CreateStream(aFileName, StreamMode::READ); diff --git a/forms/source/component/clickableimage.cxx b/forms/source/component/clickableimage.cxx index d111fc8616fe..79a4d04b375d 100644 --- a/forms/source/component/clickableimage.cxx +++ b/forms/source/component/clickableimage.cxx @@ -716,7 +716,7 @@ namespace frm // the SfxMedium is not allowed to be created with an invalid URL, so we have to check this first INetURLObject aUrl(rURL); - if (INET_PROT_NOT_VALID == aUrl.GetProtocol()) + if (INetProtocol::NOT_VALID == aUrl.GetProtocol()) // we treat an invalid URL like we would treat no URL return; diff --git a/forms/source/xforms/submission/submission_get.cxx b/forms/source/xforms/submission/submission_get.cxx index de7caa654f74..79a295ae661c 100644 --- a/forms/source/xforms/submission/submission_get.cxx +++ b/forms/source/xforms/submission/submission_get.cxx @@ -80,7 +80,7 @@ CSubmission::SubmissionResult CSubmissionGet::submit(const css::uno::Reference< Sequence< sal_Int8 > aByteBuffer(size); while ((n = aInStream->readSomeBytes(aByteBuffer, size-1)) != 0) aQueryString.append(reinterpret_cast<char const *>(aByteBuffer.getConstArray()), n); - if (!aQueryString.isEmpty() && m_aURLObj.GetProtocol() != INET_PROT_FILE) + if (!aQueryString.isEmpty() && m_aURLObj.GetProtocol() != INetProtocol::FILE) { aUTF8QueryURL.append('?'); aUTF8QueryURL.append(aQueryString.makeStringAndClear()); diff --git a/fpicker/source/office/OfficeControlAccess.cxx b/fpicker/source/office/OfficeControlAccess.cxx index a5bfde1241e3..d7b0aab20c8f 100644 --- a/fpicker/source/office/OfficeControlAccess.cxx +++ b/fpicker/source/office/OfficeControlAccess.cxx @@ -182,7 +182,7 @@ namespace svt { OUString sHelpID( sHelpURL ); INetURLObject aHID( sHelpURL ); - if ( aHID.GetProtocol() == INET_PROT_HID ) + if ( aHID.GetProtocol() == INetProtocol::HID ) sHelpID = aHID.GetURLPath(); // URLs should always be UTF8 encoded and escaped @@ -205,7 +205,7 @@ namespace svt OUString sHelpURL; OUString aTmp( OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ) ); INetURLObject aHID( aTmp ); - if ( aHID.GetProtocol() == INET_PROT_NOT_VALID ) + if ( aHID.GetProtocol() == INetProtocol::NOT_VALID ) sHelpURL = INET_HID_SCHEME; sHelpURL += aTmp; return sHelpURL; diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 7ad01ab5b330..b13e5ec20273 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -210,13 +210,13 @@ namespace // So we have to check if the file name denotes a folder or a file. // For performance reasons, we do this for file urls only INetURLObject aURL( aNewFile ); - if ( INET_PROT_NOT_VALID == aURL.GetProtocol() ) + if ( INetProtocol::NOT_VALID == aURL.GetProtocol() ) { OUString sURL; if ( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aNewFile, sURL ) ) aURL = INetURLObject( sURL ); } - if ( INET_PROT_FILE == aURL.GetProtocol() ) + if ( INetProtocol::FILE == aURL.GetProtocol() ) { try { @@ -277,7 +277,7 @@ namespace static OUString lcl_ensureFinalSlash( const OUString& _rDir ) { - INetURLObject aWorkPathObj( _rDir, INET_PROT_FILE ); + INetURLObject aWorkPathObj( _rDir, INetProtocol::FILE ); aWorkPathObj.setFinalSlash(); return aWorkPathObj.GetMainURL( INetURLObject::NO_DECODE ); } @@ -916,7 +916,7 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) { INetURLObject aFileObject( aFileName ); - if ( ( aFileObject.GetProtocol() == INET_PROT_NOT_VALID ) && !aFileName.isEmpty() ) + if ( ( aFileObject.GetProtocol() == INetProtocol::NOT_VALID ) && !aFileName.isEmpty() ) { OUString sCompleted = SvtURLBox::ParseSmart( aFileName, pThis->_pFileView->GetViewURL(), SvtPathOptions().GetWorkPath() ); if ( !sCompleted.isEmpty() ) @@ -1073,7 +1073,7 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) { // do an existence check herein, again - if ( INET_PROT_FILE == aFileObj.GetProtocol( ) ) + if ( INetProtocol::FILE == aFileObj.GetProtocol( ) ) { bool bExists = pThis->m_aContent.is( aFileObj.GetMainURL( INetURLObject::NO_DECODE ) ); @@ -1082,7 +1082,7 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) OUString sError( SVT_RESSTR( RID_FILEOPEN_NOTEXISTENTFILE ) ); OUString sInvalidFile( aFileObj.GetMainURL( INetURLObject::DECODE_TO_IURI ) ); - if ( INET_PROT_FILE == aFileObj.GetProtocol() ) + if ( INetProtocol::FILE == aFileObj.GetProtocol() ) { // if it's a file URL, transform the URL into system notation OUString sURL( sInvalidFile ); OUString sSystem; @@ -1394,7 +1394,7 @@ void SvtFileDialog::UpdateControls( const OUString& rURL ) { OUString sText; - DBG_ASSERT( INET_PROT_NOT_VALID != aObj.GetProtocol(), "SvtFileDialog::UpdateControls: Invalid URL!" ); + DBG_ASSERT( INetProtocol::NOT_VALID != aObj.GetProtocol(), "SvtFileDialog::UpdateControls: Invalid URL!" ); if ( aObj.getSegmentCount() ) { @@ -1402,7 +1402,7 @@ void SvtFileDialog::UpdateControls( const OUString& rURL ) if ( !sText.isEmpty() ) { // no Fsys path for server file system ( only UCB has mountpoints! ) - if ( INET_PROT_FILE != aObj.GetProtocol() ) + if ( INetProtocol::FILE != aObj.GetProtocol() ) sText = rURL.copy( INetURLObject::GetScheme( aObj.GetProtocol() ).getLength() ); } @@ -1449,7 +1449,7 @@ IMPL_LINK( SvtFileDialog, SelectHdl_Impl, SvTabListBox*, pBox ) INetURLObject aObj( pUserData->maURL ); if ( FILEDLG_TYPE_PATHDLG == _pImp->_eDlgType ) { - if ( aObj.GetProtocol() == INET_PROT_FILE ) + if ( aObj.GetProtocol() == INetProtocol::FILE ) { if ( !pUserData->mbIsFolder ) aObj.removeSegment(); @@ -1524,7 +1524,7 @@ IMPL_LINK( SvtFileDialog, OpenDoneHdl_Impl, SvtFileView*, pView ) { // additional check: the parent folder should not be prohibited INetURLObject aCurrentFolder( sCurrentFolder ); - DBG_ASSERT( INET_PROT_NOT_VALID != aCurrentFolder.GetProtocol(), + DBG_ASSERT( INetProtocol::NOT_VALID != aCurrentFolder.GetProtocol(), "SvtFileDialog::OpenDoneHdl_Impl: invalid current URL!" ); aCurrentFolder.removeSegment(); @@ -1719,7 +1719,7 @@ short SvtFileDialog::Execute() if ( RET_OK == nResult ) { INetURLObject aURL( _aPath ); - if ( aURL.GetProtocol() == INET_PROT_FILE ) + if ( aURL.GetProtocol() == INetProtocol::FILE ) { // remember the selected directory only for file URLs not for virtual folders sal_Int32 nLevel = aURL.getSegmentCount(); @@ -2004,7 +2004,7 @@ short SvtFileDialog::PrepareExecute() } INetURLObject aObj = aFolderURL; - if ( aObj.GetProtocol() == INET_PROT_FILE ) + if ( aObj.GetProtocol() == INetProtocol::FILE ) { // set folder as current directory aObj.setFinalSlash(); @@ -2076,7 +2076,7 @@ void SvtFileDialog::SetStandardDir( const OUString& rStdDir ) { INetURLObject aObj( rStdDir ); - DBG_ASSERT( aObj.GetProtocol() != INET_PROT_NOT_VALID, "Invalid protocol!" ); + DBG_ASSERT( aObj.GetProtocol() != INetProtocol::NOT_VALID, "Invalid protocol!" ); aObj.setFinalSlash(); _pImp->SetStandardDir( aObj.GetMainURL( INetURLObject::NO_DECODE ) ); } @@ -2269,7 +2269,7 @@ bool SvtFileDialog::IsolateFilterFromPath_Impl( OUString& rPath, OUString& rFilt // use question mark as wildcard only for files INetProtocol eProt = INetURLObject::CompareProtocolScheme( rPath ); - if ( INET_PROT_NOT_VALID != eProt && INET_PROT_FILE != eProt ) + if ( INetProtocol::NOT_VALID != eProt && INetProtocol::FILE != eProt ) nQuestionMarkPos = -1; nWildCardPos = std::min( nWildCardPos, nQuestionMarkPos ); diff --git a/framework/source/classes/menumanager.cxx b/framework/source/classes/menumanager.cxx index b9350eff7c9a..06ff1e253eb5 100644 --- a/framework/source/classes/menumanager.cxx +++ b/framework/source/classes/menumanager.cxx @@ -567,7 +567,7 @@ void MenuManager::UpdateSpecialFileMenu( Menu* pMenu ) OUString aMenuTitle; INetURLObject aURL( aURLString ); - 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/framework/source/fwe/helper/titlehelper.cxx b/framework/source/fwe/helper/titlehelper.cxx index 5ddf1252fb4a..ee5cbf946007 100644 --- a/framework/source/fwe/helper/titlehelper.cxx +++ b/framework/source/fwe/helper/titlehelper.cxx @@ -618,7 +618,7 @@ OUString TitleHelper::impl_convertURL2Title(const OUString& sURL) INetURLObject aURL (sURL); OUString sTitle; - if (aURL.GetProtocol() == INET_PROT_FILE) + if (aURL.GetProtocol() == INetProtocol::FILE) { if (aURL.HasMark()) aURL = INetURLObject(aURL.GetURLNoMark()); diff --git a/framework/source/services/urltransformer.cxx b/framework/source/services/urltransformer.cxx index 77394bbbdb3a..c17743fe5fbc 100644 --- a/framework/source/services/urltransformer.cxx +++ b/framework/source/services/urltransformer.cxx @@ -140,14 +140,14 @@ sal_Bool SAL_CALL URLTransformer::parseStrict( css::util::URL& aURL ) throw( css aProtocol = aURL.Complete.copy( 0, nURLIndex+1 ); // If INetURLObject knows this protocol let it parse - if ( INetURLObject::CompareProtocolScheme( aProtocol ) != INET_PROT_NOT_VALID ) + if ( INetURLObject::CompareProtocolScheme( aProtocol ) != INetProtocol::NOT_VALID ) { // Initialize parser with given URL. INetURLObject aParser( aURL.Complete ); // Get all information about this URL. INetProtocol eINetProt = aParser.GetProtocol(); - if ( eINetProt == INET_PROT_NOT_VALID ) + if ( eINetProt == INetProtocol::NOT_VALID ) { return sal_False; } @@ -200,7 +200,7 @@ sal_Bool SAL_CALL URLTransformer::parseSmart( css::util::URL& aURL, { // Minmal support for unknown protocols. This is mandatory to support the "Protocol Handlers" implemented // in framework! - if ( INetURLObject::CompareProtocolScheme( sSmartProtocol ) == INET_PROT_NOT_VALID ) + if ( INetURLObject::CompareProtocolScheme( sSmartProtocol ) == INetProtocol::NOT_VALID ) { // Try to extract the protocol sal_Int32 nIndex = aURL.Complete.indexOf( ':' ); @@ -211,7 +211,7 @@ sal_Bool SAL_CALL URLTransformer::parseSmart( css::util::URL& aURL, // If INetURLObject knows this protocol something is wrong as detected before => // give up and return false! - if ( INetURLObject::CompareProtocolScheme( aProtocol ) != INET_PROT_NOT_VALID ) + if ( INetURLObject::CompareProtocolScheme( aProtocol ) != INetProtocol::NOT_VALID ) return sal_False; else aURL.Protocol = aProtocol; @@ -234,7 +234,7 @@ sal_Bool SAL_CALL URLTransformer::assemble( css::util::URL& aURL ) throw( css::u // Initialize parser. INetURLObject aParser; - if ( INetURLObject::CompareProtocolScheme( aURL.Protocol ) != INET_PROT_NOT_VALID ) + if ( INetURLObject::CompareProtocolScheme( aURL.Protocol ) != INetProtocol::NOT_VALID ) { OUStringBuffer aCompletePath( aURL.Path ); diff --git a/framework/source/uielement/generictoolbarcontroller.cxx b/framework/source/uielement/generictoolbarcontroller.cxx index f59982a729cd..8cdfb51bf161 100644 --- a/framework/source/uielement/generictoolbarcontroller.cxx +++ b/framework/source/uielement/generictoolbarcontroller.cxx @@ -55,7 +55,7 @@ static bool isEnumCommand( const OUString& rCommand ) { INetURLObject aURL( rCommand ); - if (( aURL.GetProtocol() == INET_PROT_UNO ) && + if (( aURL.GetProtocol() == INetProtocol::UNO ) && ( aURL.GetURLPath().indexOf( '.' ) != -1)) return true; @@ -79,7 +79,7 @@ static OUString getMasterCommand( const OUString& rCommand ) { OUString aMasterCommand( rCommand ); INetURLObject aURL( rCommand ); - if ( aURL.GetProtocol() == INET_PROT_UNO ) + if ( aURL.GetProtocol() == INetProtocol::UNO ) { sal_Int32 nIndex = aURL.GetURLPath().indexOf( '.' ); if ( nIndex ) diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx index ed23595c9d05..f536e2610d8a 100644 --- a/framework/source/uielement/recentfilesmenucontroller.cxx +++ b/framework/source/uielement/recentfilesmenucontroller.cxx @@ -198,7 +198,7 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > INetURLObject aURL( m_aRecentFilesItems[i].aURL ); OUString aTipHelpText( aURL.getFSysPath( INetURLObject::FSYS_DETECT ) ); - if ( aURL.GetProtocol() == INET_PROT_FILE ) + if ( aURL.GetProtocol() == INetProtocol::FILE ) { // Do handle file URL differently: don't show the protocol, just the file name aMenuTitle = aURL.GetLastName(INetURLObject::DECODE_WITH_CHARSET, RTL_TEXTENCODING_UTF8); diff --git a/include/o3tl/enumarray.hxx b/include/o3tl/enumarray.hxx index b476cb3671d2..6bc3dff7a608 100644 --- a/include/o3tl/enumarray.hxx +++ b/include/o3tl/enumarray.hxx @@ -51,7 +51,7 @@ public: static const size_type max_index = static_cast<size_type>(E::LAST); - const V operator[](E index) const + const V& operator[](E index) const { assert(index>=static_cast<E>(0) && index<=E::LAST); return detail_values[static_cast<size_type>(index)]; diff --git a/include/svl/inethist.hxx b/include/svl/inethist.hxx index a21db8a4732e..6b4f9755011b 100644 --- a/include/svl/inethist.hxx +++ b/include/svl/inethist.hxx @@ -63,10 +63,10 @@ public: */ bool QueryProtocol (INetProtocol eProto) const { - return ((eProto == INET_PROT_FILE ) || - (eProto == INET_PROT_FTP ) || - (eProto == INET_PROT_HTTP ) || - (eProto == INET_PROT_HTTPS) ); + return ((eProto == INetProtocol::FILE ) || + (eProto == INetProtocol::FTP ) || + (eProto == INetProtocol::HTTP ) || + (eProto == INetProtocol::HTTPS) ); } /** QueryUrl. diff --git a/include/svtools/inettbc.hxx b/include/svtools/inettbc.hxx index b9852ce6fc7b..92a07661c6cb 100644 --- a/include/svtools/inettbc.hxx +++ b/include/svtools/inettbc.hxx @@ -59,9 +59,9 @@ protected: virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE; public: - SvtURLBox( vcl::Window* pParent, INetProtocol eSmart = INET_PROT_NOT_VALID, bool bSetDefaultHelpID = true ); - SvtURLBox( vcl::Window* pParent, WinBits _nStyle, INetProtocol eSmart = INET_PROT_NOT_VALID, bool bSetDefaultHelpID = true ); - SvtURLBox( vcl::Window* pParent, const ResId& _rResId, INetProtocol eSmart = INET_PROT_NOT_VALID, bool bSetDefaultHelpID = true ); + SvtURLBox( vcl::Window* pParent, INetProtocol eSmart = INetProtocol::NOT_VALID, bool bSetDefaultHelpID = true ); + SvtURLBox( vcl::Window* pParent, WinBits _nStyle, INetProtocol eSmart = INetProtocol::NOT_VALID, bool bSetDefaultHelpID = true ); + SvtURLBox( vcl::Window* pParent, const ResId& _rResId, INetProtocol eSmart = INetProtocol::NOT_VALID, bool bSetDefaultHelpID = true ); virtual ~SvtURLBox(); void SetBaseURL( const OUString& rURL ); diff --git a/include/svtools/place.hxx b/include/svtools/place.hxx index e46eba4e2785..0933f998a1a5 100644 --- a/include/svtools/place.hxx +++ b/include/svtools/place.hxx @@ -33,7 +33,7 @@ public: OUString& GetName( ) { return msName; } OUString GetUrl( ) { return maUrl.GetMainURL( INetURLObject::NO_DECODE ); } INetURLObject& GetUrlObject( ) { return maUrl; } - bool IsLocal( ) { return maUrl.GetProtocol() == INET_PROT_FILE; } + bool IsLocal( ) { return maUrl.GetProtocol() == INetProtocol::FILE; } bool IsEditable( ) { return mbEditable; } }; diff --git a/include/tools/urlobj.hxx b/include/tools/urlobj.hxx index bbe6d3945bbc..50c5b5109b40 100644 --- a/include/tools/urlobj.hxx +++ b/include/tools/urlobj.hxx @@ -64,43 +64,43 @@ enum }; // Schemes: -enum INetProtocol +enum class INetProtocol { - INET_PROT_NOT_VALID = 0, - INET_PROT_FTP = 1, - INET_PROT_HTTP = 2, - INET_PROT_FILE = 3, - INET_PROT_MAILTO = 4, - INET_PROT_VND_SUN_STAR_WEBDAV = 5, - INET_PROT_NEWS = 6, - INET_PROT_PRIV_SOFFICE = 7, - INET_PROT_VND_SUN_STAR_HELP = 8, - INET_PROT_HTTPS = 9, - INET_PROT_SLOT = 10, - INET_PROT_MACRO = 11, - INET_PROT_JAVASCRIPT = 12, - INET_PROT_IMAP = 13, - INET_PROT_POP3 = 14, - INET_PROT_DATA = 15, - INET_PROT_CID = 16, - INET_PROT_OUT = 17, - INET_PROT_VND_SUN_STAR_HIER = 18, - INET_PROT_VIM = 19, - INET_PROT_UNO = 20, - INET_PROT_COMPONENT = 21, - INET_PROT_VND_SUN_STAR_PKG = 22, - INET_PROT_LDAP = 23, - INET_PROT_DB = 24, - INET_PROT_VND_SUN_STAR_CMD = 25, - INET_PROT_TELNET = 26, - INET_PROT_VND_SUN_STAR_EXPAND = 27, - INET_PROT_VND_SUN_STAR_TDOC = 28, - INET_PROT_GENERIC = 29, - INET_PROT_SMB = 30, - INET_PROT_HID = 31, - INET_PROT_SFTP = 32, - INET_PROT_CMIS = 33, - INET_PROT_END = 34 + NOT_VALID, + FTP, + HTTP, + FILE, + MAILTO, + VND_SUN_STAR_WEBDAV, + NEWS, + PRIV_SOFFICE, + VND_SUN_STAR_HELP, + HTTPS, + SLOT, + MACRO, + JAVASCRIPT, + IMAP, + POP3, + DATA, + CID, + OUT, + VND_SUN_STAR_HIER, + VIM, + UNO, + COMPONENT, + VND_SUN_STAR_PKG, + LDAP, + DB, + VND_SUN_STAR_CMD, + TELNET, + VND_SUN_STAR_EXPAND, + VND_SUN_STAR_TDOC, + GENERIC, + SMB, + HID, + SFTP, + CMIS, + LAST = CMIS }; class TOOLS_DLLPUBLIC SAL_WARN_UNUSED INetURLObject @@ -182,9 +182,9 @@ public: // General Structure: inline INetURLObject(): - m_eScheme(INET_PROT_NOT_VALID), m_eSmartScheme(INET_PROT_HTTP) {} + m_eScheme(INetProtocol::NOT_VALID), m_eSmartScheme(INetProtocol::HTTP) {} - inline bool HasError() const { return m_eScheme == INET_PROT_NOT_VALID; } + inline bool HasError() const { return m_eScheme == INetProtocol::NOT_VALID; } inline OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset @@ -1234,7 +1234,7 @@ private: // Coding: static inline sal_Char getEscapePrefix(INetProtocol eTheScheme) - { return eTheScheme == INET_PROT_VIM ? '=' : '%'; } + { return eTheScheme == INetProtocol::VIM ? '=' : '%'; } inline sal_Char getEscapePrefix() const { return getEscapePrefix(m_eScheme); } @@ -1299,7 +1299,7 @@ inline OUString INetURLObject::decode(SubString const & rSubString, inline INetURLObject::INetURLObject(OUString const & rTheAbsURIRef, EncodeMechanism eMechanism, rtl_TextEncoding eCharset): - m_eScheme(INET_PROT_NOT_VALID), m_eSmartScheme(INET_PROT_HTTP) + m_eScheme(INetProtocol::NOT_VALID), m_eSmartScheme(INetProtocol::HTTP) { setAbsURIRef(rTheAbsURIRef, false, eMechanism, eCharset, false, FSysStyle(0)); @@ -1318,7 +1318,7 @@ inline INetURLObject::INetURLObject(OUString const & rTheAbsURIRef, EncodeMechanism eMechanism, rtl_TextEncoding eCharset, FSysStyle eStyle): - m_eScheme(INET_PROT_NOT_VALID), m_eSmartScheme(eTheSmartScheme) + m_eScheme(INetProtocol::NOT_VALID), m_eSmartScheme(eTheSmartScheme) { setAbsURIRef(rTheAbsURIRef, false, eMechanism, eCharset, true, eStyle); } @@ -1456,7 +1456,7 @@ inline bool INetURLObject::SetMark(OUString const & rTheFragment, inline INetURLObject::INetURLObject(OUString const & rFSysPath, FSysStyle eStyle): - m_eScheme(INET_PROT_NOT_VALID), m_eSmartScheme(INET_PROT_HTTP) + m_eScheme(INetProtocol::NOT_VALID), m_eSmartScheme(INetProtocol::HTTP) { setFSysPath(rFSysPath, eStyle); } diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx index f1cc93064839..6ebd8c4e5dee 100644 --- a/linguistic/source/convdiclist.cxx +++ b/linguistic/source/convdiclist.cxx @@ -71,7 +71,7 @@ OUString GetConvDicMainURL( const OUString &rDicName, const OUString &rDirectory OUString aFullDicName = OUString(rDicName) + CONV_DIC_DOT_EXT; INetURLObject aURLObj; - aURLObj.SetSmartProtocol( INET_PROT_FILE ); + aURLObj.SetSmartProtocol( INetProtocol::FILE ); aURLObj.SetSmartURL( rDirectoryURL ); aURLObj.Append( aFullDicName, INetURLObject::ENCODE_ALL ); DBG_ASSERT(!aURLObj.HasError(), "invalid URL"); @@ -276,8 +276,8 @@ void SAL_CALL ConvDicNameContainer::removeByName( const OUString& rName ) OUString aName( xDel->getName() ); OUString aDicMainURL( GetConvDicMainURL( aName, GetDictionaryWriteablePath() ) ); INetURLObject aObj( aDicMainURL ); - DBG_ASSERT( aObj.GetProtocol() == INET_PROT_FILE, "+HangulHanjaOptionsDialog::OkHdl(): non-file URLs cannot be deleted" ); - if( aObj.GetProtocol() == INET_PROT_FILE ) + DBG_ASSERT( aObj.GetProtocol() == INetProtocol::FILE, "+HangulHanjaOptionsDialog::OkHdl(): non-file URLs cannot be deleted" ); + if( aObj.GetProtocol() == INetProtocol::FILE ) { try { diff --git a/linguistic/source/misc2.cxx b/linguistic/source/misc2.cxx index e7e8031e41c8..ed3c3d8bc56c 100644 --- a/linguistic/source/misc2.cxx +++ b/linguistic/source/misc2.cxx @@ -140,7 +140,7 @@ OUString GetWritableDictionaryURL( const OUString &rDicName ) // build URL to use for a new (persistent) dictionary INetURLObject aURLObj; - aURLObj.SetSmartProtocol( INET_PROT_FILE ); + aURLObj.SetSmartProtocol( INetProtocol::FILE ); aURLObj.SetSmartURL( aDirName ); DBG_ASSERT(!aURLObj.HasError(), "lng : invalid URL"); aURLObj.Append( rDicName, INetURLObject::ENCODE_ALL ); diff --git a/reportdesign/source/ui/inspection/DefaultInspection.cxx b/reportdesign/source/ui/inspection/DefaultInspection.cxx index 792b64c21c6e..718e89defb0f 100644 --- a/reportdesign/source/ui/inspection/DefaultInspection.cxx +++ b/reportdesign/source/ui/inspection/DefaultInspection.cxx @@ -37,7 +37,7 @@ namespace rptui { OUStringBuffer aBuffer; OUString aTmp( OStringToOUString(sHelpId, RTL_TEXTENCODING_UTF8) ); - DBG_ASSERT( INetURLObject( aTmp ).GetProtocol() == INET_PROT_NOT_VALID, "Wrong HelpId!" ); + DBG_ASSERT( INetURLObject( aTmp ).GetProtocol() == INetProtocol::NOT_VALID, "Wrong HelpId!" ); aBuffer.appendAscii( INET_HID_SCHEME ); aBuffer.append( aTmp.getStr() ); return aBuffer.makeStringAndClear(); diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index f3f0cf393e12..0553ff1bd1fd 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -349,7 +349,7 @@ XclExpHyperlink::XclExpHyperlink( const XclExpRoot& rRoot, const SvxURLField& rU } // file link or URL - if( eProtocol == INET_PROT_FILE || eProtocol == INET_PROT_SMB ) + if( eProtocol == INetProtocol::FILE || eProtocol == INetProtocol::SMB ) { sal_uInt16 nLevel; bool bRel; @@ -357,7 +357,7 @@ XclExpHyperlink::XclExpHyperlink( const XclExpRoot& rRoot, const SvxURLField& rU * encoded for OOXML? */ OUString aFileName( BuildFileName( nLevel, bRel, rUrl, rRoot, false ) ); - if( eProtocol == INET_PROT_SMB ) + if( eProtocol == INetProtocol::SMB ) { // #n382718# (and #n261623#) Convert smb notation to '\\' aFileName = aUrlObj.GetMainURL( INetURLObject::NO_DECODE ); @@ -392,7 +392,7 @@ XclExpHyperlink::XclExpHyperlink( const XclExpRoot& rRoot, const SvxURLField& rU // ms2007 does, ms2010 is more tolerant ) msTarget = "file:///" + msTarget; } - else if( eProtocol != INET_PROT_NOT_VALID ) + else if( eProtocol != INetProtocol::NOT_VALID ) { XclExpString aUrl( aUrlObj.GetURLNoMark(), EXC_STR_FORCEUNICODE, 255 ); aXclStrm << XclTools::maGuidUrlMoniker diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx index 614af46b9a24..3b4a06357571 100644 --- a/sc/source/filter/html/htmlexp.cxx +++ b/sc/source/filter/html/htmlexp.cxx @@ -1236,11 +1236,11 @@ bool ScHTMLExport::CopyLocalFileToINet( OUString& rFileNm, INetURLObject aFileUrl, aTargetUrl; aFileUrl.SetSmartURL( rFileNm ); aTargetUrl.SetSmartURL( rTargetNm ); - if( INET_PROT_FILE == aFileUrl.GetProtocol() && - ( (bFileToFile && INET_PROT_FILE == aTargetUrl.GetProtocol()) || - (!bFileToFile && INET_PROT_FILE != aTargetUrl.GetProtocol() && - INET_PROT_FTP <= aTargetUrl.GetProtocol() && - INET_PROT_NEWS >= aTargetUrl.GetProtocol()) ) ) + if( INetProtocol::FILE == aFileUrl.GetProtocol() && + ( (bFileToFile && INetProtocol::FILE == aTargetUrl.GetProtocol()) || + (!bFileToFile && INetProtocol::FILE != aTargetUrl.GetProtocol() && + INetProtocol::FTP <= aTargetUrl.GetProtocol() && + INetProtocol::NEWS >= aTargetUrl.GetProtocol()) ) ) { if( pFileNameMap ) { @@ -1304,7 +1304,7 @@ void ScHTMLExport::MakeCIdURL( OUString& rURL ) return; INetURLObject aURLObj( rURL ); - if( INET_PROT_FILE != aURLObj.GetProtocol() ) + if( INetProtocol::FILE != aURLObj.GetProtocol() ) return; OUString aLastName( aURLObj.GetLastName().toAsciiLowerCase() ); diff --git a/sc/source/filter/xml/xmltabi.cxx b/sc/source/filter/xml/xmltabi.cxx index 8376558d282c..af399d50adb4 100644 --- a/sc/source/filter/xml/xmltabi.cxx +++ b/sc/source/filter/xml/xmltabi.cxx @@ -81,7 +81,7 @@ static bool lcl_isExternalRefCache(const OUString& rName, OUString& rUrl, OUStri // #i114504# Other schemes besides "file:" are also allowed. // CompareProtocolScheme is quick, only looks at the start of the string. INetProtocol eProt = INetURLObject::CompareProtocolScheme( rName.copy(1) ); - if ( eProt == INET_PROT_NOT_VALID ) + if ( eProt == INetProtocol::NOT_VALID ) return false; OUString aPrefix = INetURLObject::GetScheme( eProt ); diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index fa3895fee3b4..8edbf822a7fa 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -2327,7 +2327,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed ) eError = eERR_OK; } - INetURLObject aTmpFile( rMed.GetPhysicalName(), INET_PROT_FILE ); + INetURLObject aTmpFile( rMed.GetPhysicalName(), INetProtocol::FILE ); if ( bHasMemo ) aTmpFile.setExtension(OUString("dbt")); if ( eError != eERR_OK ) @@ -2344,7 +2344,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed ) { const SfxStringItem* pNameItem = static_cast<const SfxStringItem*>( rMed.GetItemSet()->GetItem( SID_FILE_NAME ) ); - INetURLObject aDbtFile( pNameItem->GetValue(), INET_PROT_FILE ); + INetURLObject aDbtFile( pNameItem->GetValue(), INetProtocol::FILE ); aDbtFile.setExtension(OUString("dbt")); if ( IsDocument( aDbtFile ) && !KillFile( aDbtFile ) ) bRet = false; diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index 12260b602ba4..4125ffa74162 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -104,7 +104,7 @@ namespace sal_uLong lcl_getDBaseConnection(uno::Reference<sdbc::XDriverManager2>& _rDrvMgr, uno::Reference<sdbc::XConnection>& _rConnection, OUString& _rTabName, const OUString& rFullFileName, rtl_TextEncoding eCharSet) { INetURLObject aURL; - aURL.SetSmartProtocol( INET_PROT_FILE ); + aURL.SetSmartProtocol( INetProtocol::FILE ); aURL.SetSmartURL( rFullFileName ); _rTabName = aURL.getBase( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_UNAMBIGUOUS ); @@ -794,7 +794,7 @@ sal_uLong ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncodi return ERRCODE_IO_GENERAL; #else // remove the file so the dBase driver doesn't find an invalid file - INetURLObject aDeleteObj( rFullFileName, INET_PROT_FILE ); + INetURLObject aDeleteObj( rFullFileName, INetProtocol::FILE ); KillFile( aDeleteObj ); sal_uLong nErr = eERR_OK; diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx index 0e946050cdee..6ee467cfda5f 100644 --- a/sc/source/ui/docshell/tablink.cxx +++ b/sc/source/ui/docshell/tablink.cxx @@ -463,7 +463,7 @@ bool ScDocumentLoader::GetFilterName( const OUString& rFileName, INetURLObject aUrl( rFileName ); INetProtocol eProt = aUrl.GetProtocol(); - if ( eProt == INET_PROT_NOT_VALID ) // invalid URL? + if ( eProt == INetProtocol::NOT_VALID ) // invalid URL? return false; // abort without creating a medium // Filter-Detection diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx index 0956311852af..24a1e1a0a8b1 100644 --- a/sc/source/ui/drawfunc/fuins2.cxx +++ b/sc/source/ui/drawfunc/fuins2.cxx @@ -273,7 +273,7 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawView* { // get URL INetURLObject aURL; - aURL.SetSmartProtocol( INET_PROT_FILE ); + aURL.SetSmartProtocol( INetProtocol::FILE ); if ( aURL.SetURL( aPluginFileDialog.GetPath() ) ) { // create a plugin object diff --git a/sc/source/ui/vba/vbaworkbooks.cxx b/sc/source/ui/vba/vbaworkbooks.cxx index b22326edeb5b..ab9b79db483a 100644 --- a/sc/source/ui/vba/vbaworkbooks.cxx +++ b/sc/source/ui/vba/vbaworkbooks.cxx @@ -209,7 +209,7 @@ ScVbaWorkbooks::Open( const OUString& rFileName, const uno::Any& /*UpdateLinks*/ OUString aURL; INetURLObject aObj; aObj.SetURL( rFileName ); - bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; + bool bIsURL = aObj.GetProtocol() != INetProtocol::NOT_VALID; if ( bIsURL ) aURL = rFileName; else diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index 31cbc5948ca7..86bf529d16f3 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -1131,9 +1131,9 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u OUString aFile( pFieldEntry->aFieldUrl ); OUString aTarget( pFieldEntry->aFieldUrl ); INetURLObject aUrl( pFieldEntry->aFieldUrl ); - if ( INET_PROT_FILE == aUrl.GetProtocol() ) + if ( INetProtocol::FILE == aUrl.GetProtocol() ) aFile = aUrl.PathToFileName(); - else if ( INET_PROT_SMB == aUrl.GetProtocol() ) + else if ( INetProtocol::SMB == aUrl.GetProtocol() ) { // Convert smb notation to '\\' and skip the 'smb:' part aFile = aUrl.GetMainURL(INetURLObject::NO_DECODE).copy(4); @@ -1968,7 +1968,7 @@ void PPTWriter::ImplWriteClickAction( SvStream& rSt, ::com::sun::star::presentat if ( ImplGetPropertyValue( OUString( "Bookmark" ) ) ) { INetURLObject aUrl( *static_cast<OUString const *>(mAny.getValue()) ); - if ( INET_PROT_FILE == aUrl.GetProtocol() ) + if ( INetProtocol::FILE == aUrl.GetProtocol() ) { aFile = aUrl.PathToFileName(); nAction = 2; @@ -2016,7 +2016,7 @@ void PPTWriter::ImplWriteClickAction( SvStream& rSt, ::com::sun::star::presentat OUString aBookmarkFile( aBookmark ); INetURLObject aUrl( aBookmark ); - if ( INET_PROT_FILE == aUrl.GetProtocol() ) + if ( INetProtocol::FILE == aUrl.GetProtocol() ) aBookmarkFile = aUrl.PathToFileName(); nHyperLinkID = ImplInsertBookmarkURL( aBookmark, (sal_uInt32)(2 | ( 1U << 31 )), aBookmarkFile, aBookmark, "", "" ); } diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 3bdbae53f114..e943858fdea4 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -607,7 +607,7 @@ void HtmlExport::InitExportParameters( const Sequence< PropertyValue >& rParams // we come up with a destination... INetURLObject aINetURLObj( maPath ); - DBG_ASSERT( aINetURLObj.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aINetURLObj.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); maExportPath = aINetURLObj.GetPartBeforeLastName(); // with trailing '/' maIndex = aINetURLObj.GetLastName(); @@ -3031,7 +3031,7 @@ OUString HtmlExport::InsertSound( const OUString& rSoundFile ) INetURLObject aURL( rSoundFile ); OUString aSoundFileName = aURL.getName(); - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); OUString aStr("<embed src=\"" + aSoundFileName + "\" hidden=\"true\" autostart=\"true\">"); @@ -3203,13 +3203,13 @@ sal_uLong EasyFile::createFileName( const OUString& rURL, OUString& rFileName ) { INetURLObject aURL( rURL ); - if( aURL.GetProtocol() == INET_PROT_NOT_VALID ) + if( aURL.GetProtocol() == INetProtocol::NOT_VALID ) { OUString aURLStr; ::utl::LocalFileHelper::ConvertPhysicalNameToURL( rURL, aURLStr ); aURL = INetURLObject( aURLStr ); } - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); rFileName = aURL.GetMainURL( INetURLObject::NO_DECODE ); } diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx index c65adae60e68..f2ab340e26ae 100644 --- a/sd/source/filter/html/pubdlg.cxx +++ b/sd/source/filter/html/pubdlg.cxx @@ -782,7 +782,7 @@ void SdPublishingDlg::GetParameterSequence( Sequence< PropertyValue >& rParams ) // try to guess protocol for user's homepage INetURLObject aHomeURL( pPage4_WWW->GetText(), - INET_PROT_HTTP, // default proto is HTTP + INetProtocol::HTTP, // default proto is HTTP INetURLObject::ENCODE_ALL ); aValue.Name = "HomepageURL"; diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 076a71119362..0d6622ad28a2 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -397,7 +397,7 @@ bool ImplSdPPTImport::Import() break; // Convert '\\' notation to 'smb://' - INetURLObject aUrl( pHyperlink->aTarget, INET_PROT_FILE ); + INetURLObject aUrl( pHyperlink->aTarget, INetProtocol::FILE ); pHyperlink->aTarget = aUrl.GetMainURL( INetURLObject::NO_DECODE ); if ( !aPropItem.Read( pHyperlink->aSubAdress, VT_EMPTY ) ) @@ -2065,7 +2065,7 @@ void ImplSdPPTImport::FillSdAnimationInfo( SdAnimationInfo* pInfo, PptInteractiv OUString aBaseURL = pDocShell->GetMedium()->GetBaseURL(); OUString aBookmarkURL( pInfo->GetBookmark() ); INetURLObject aURL( pPtr->aTarget ); - if( INET_PROT_NOT_VALID == aURL.GetProtocol() ) + if( INetProtocol::NOT_VALID == aURL.GetProtocol() ) utl::LocalFileHelper::ConvertSystemPathToURL( pPtr->aTarget, aBaseURL, aBookmarkURL ); if( aBookmarkURL.isEmpty() ) aBookmarkURL = URIHelper::SmartRel2Abs( INetURLObject(aBaseURL), pPtr->aTarget, URIHelper::GetMaybeFileHdl(), true ); diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx index 5a62f7207fad..6b9783c4cd47 100644 --- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx +++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx @@ -579,15 +579,15 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, SelectHdl) sal_uInt16 nFilter = GRFILTER_FORMAT_DONTKNOW; - 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( sImgUrl ); } sal_uInt32 nFilterImportFlags = GRFILTER_I_FLAGS_SET_LOGSIZE_FOR_JPEG; // remote? - if ( INET_PROT_FILE != aURLObj.GetProtocol() ) + if ( INetProtocol::FILE != aURLObj.GetProtocol() ) { SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( sImgUrl, StreamMode::READ ); diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx index fbf21f5ac386..cc95909988ca 100644 --- a/sd/source/ui/dlg/dlgass.cxx +++ b/sd/source/ui/dlg/dlgass.cxx @@ -1616,7 +1616,7 @@ bool AssistentDlgImpl::IsOwnFormat( const OUString& rPath ) INetURLObject aURL( rPath ); OUString aExt( aURL.GetFileExtension() ); - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); return !aExt.equalsIgnoreAsciiCase( "ppt" ); } diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index c1bf56d1e661..24df6b6225f2 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -584,7 +584,7 @@ bool SdNavigatorWin::InsertFile(const OUString& rFileName) { INetURLObject aURL( rFileName ); - if( aURL.GetProtocol() == INET_PROT_NOT_VALID ) + if( aURL.GetProtocol() == INetProtocol::NOT_VALID ) { OUString aURLStr; ::utl::LocalFileHelper::ConvertPhysicalNameToURL( rFileName, aURLStr ); diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index cd90acf2f1f7..c21ea4eb8e8e 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -1176,7 +1176,7 @@ void SdPageObjsTLB::DoDrag() if( mpDropNavWin ) { ::sd::DrawDocShell* pDocShell = mpDoc->GetDocSh(); - OUString aURL = INetURLObject( pDocShell->GetMedium()->GetPhysicalName(), INET_PROT_FILE ).GetMainURL( INetURLObject::NO_DECODE ); + OUString aURL = INetURLObject( pDocShell->GetMedium()->GetPhysicalName(), INetProtocol::FILE ).GetMainURL( INetURLObject::NO_DECODE ); NavigatorDragType eDragType = mpDropNavWin->GetNavigatorDragType(); aURL += "#" + GetSelectEntry(); diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx index e281738b6a25..a2d3cd1dc455 100644 --- a/sd/source/ui/dlg/tpaction.cxx +++ b/sd/source/ui/dlg/tpaction.cxx @@ -811,7 +811,7 @@ OUString SdTPAction::GetEditText( bool bFullDocDestination ) if( mpDoc && mpDoc->GetDocSh() && mpDoc->GetDocSh()->GetMedium() ) aBaseURL = mpDoc->GetDocSh()->GetMedium()->GetBaseURL(); - if( !aStr.isEmpty() && aURL.GetProtocol() == INET_PROT_NOT_VALID ) + if( !aStr.isEmpty() && aURL.GetProtocol() == INetProtocol::NOT_VALID ) aURL = INetURLObject( ::URIHelper::SmartRel2Abs( INetURLObject(aBaseURL), aStr, URIHelper::GetMaybeFileHdl(), true, false ) ); // get adjusted file name diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx index ffa9c4977965..ccdcb5c7d8fe 100644 --- a/sd/source/ui/func/fuinsert.cxx +++ b/sd/source/ui/func/fuinsert.cxx @@ -485,8 +485,8 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) { // get URL OUString aStrURL(aPluginFileDialog.GetPath()); - INetURLObject aURL( aStrURL, INET_PROT_FILE ); - if( aURL.GetProtocol() != INET_PROT_NOT_VALID ) + INetURLObject aURL( aStrURL, INetProtocol::FILE ); + if( aURL.GetProtocol() != INetProtocol::NOT_VALID ) { // create a plugin object xObj = mpViewShell->GetObjectShell()->GetEmbeddedObjectContainer().CreateEmbeddedObject( SvGlobalName( SO3_PLUGIN_CLASSID ).GetByteSequence(), aName ); diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index c17aba83a8bf..6f90fd6e4c9d 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -1380,7 +1380,7 @@ bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos) URIHelper::GetMaybeFileHdl(), true, false, INetURLObject::WAS_ENCODED, INetURLObject::DECODE_UNAMBIGUOUS ) ); - if( INET_PROT_FILE == aURL.GetProtocol() ) + if( INetProtocol::FILE == aURL.GetProtocol() ) { SfxStringItem aUrl( SID_FILE_NAME, aURL.GetMainURL( INetURLObject::NO_DECODE ) ); SfxBoolItem aBrowsing( SID_BROWSE, true ); diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 314d6b1339e5..c1f251952822 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -1594,7 +1594,7 @@ void SlideshowImpl::click( const Reference< XShape >& xShape, const ::com::sun:: false, INetURLObject::WAS_ENCODED, INetURLObject::DECODE_UNAMBIGUOUS ) ); - if( INET_PROT_FILE == aURL.GetProtocol() ) + if( INetProtocol::FILE == aURL.GetProtocol() ) { SfxStringItem aUrl( SID_FILE_NAME, aURL.GetMainURL( INetURLObject::NO_DECODE ) ); SfxBoolItem aBrowsing( SID_BROWSE, true ); diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx index 205f17a12141..510bbec86d55 100644 --- a/sd/source/ui/view/sdview4.cxx +++ b/sd/source/ui/view/sdview4.cxx @@ -415,7 +415,7 @@ IMPL_LINK_NOARG(View, DropInsertFileHdl) INetURLObject aURL( aCurrentDropFile ); bool bOK = false; - if( aURL.GetProtocol() == INET_PROT_NOT_VALID ) + if( aURL.GetProtocol() == INetProtocol::NOT_VALID ) { OUString aURLStr; ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aCurrentDropFile, aURLStr ); 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( diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index 03a7a9f8c50c..bfb57d52fc16 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -359,7 +359,7 @@ void SotStorage::CreateStorage( bool bForceUCBStorage, StreamMode nMode, Storage ::utl::UCBContentHelper::Kill( m_aName ); INetURLObject aObj( m_aName ); - if ( aObj.GetProtocol() == INET_PROT_NOT_VALID ) + if ( aObj.GetProtocol() == INetProtocol::NOT_VALID ) { OUString aURL; ::utl::LocalFileHelper::ConvertPhysicalNameToURL( m_aName, aURL ); @@ -565,7 +565,7 @@ bool SotStorage::IsStorageFile( const OUString & rFileName ) { OUString aName( rFileName ); INetURLObject aObj( aName ); - if ( aObj.GetProtocol() == INET_PROT_NOT_VALID ) + if ( aObj.GetProtocol() == INetProtocol::NOT_VALID ) { OUString aURL; ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aName, aURL ); diff --git a/svl/source/misc/filenotation.cxx b/svl/source/misc/filenotation.cxx index a6cf323c947b..c10dd60d65b2 100644 --- a/svl/source/misc/filenotation.cxx +++ b/svl/source/misc/filenotation.cxx @@ -35,7 +35,7 @@ namespace svt if ( _eInputNotation == N_URL ) { INetURLObject aParser( _rUrlOrPath ); - if ( aParser.GetProtocol() == INET_PROT_FILE ) + if ( aParser.GetProtocol() == INetProtocol::FILE ) implInitWithURLNotation( _rUrlOrPath ); else m_sSystem = m_sFileURL = _rUrlOrPath; @@ -56,7 +56,7 @@ namespace svt if ( !_rSystemPath.isEmpty() ) { INetURLObject aSmartParser; - aSmartParser.SetSmartProtocol( INET_PROT_FILE ); + aSmartParser.SetSmartProtocol( INetProtocol::FILE ); if ( aSmartParser.SetSmartURL( _rSystemPath ) ) { m_sFileURL = aSmartParser.GetMainURL( INetURLObject::NO_DECODE ); @@ -84,12 +84,12 @@ namespace svt INetURLObject aParser( _rUrlOrPath ); switch ( aParser.GetProtocol() ) { - case INET_PROT_FILE: + case INetProtocol::FILE: // file URL bSuccess = implInitWithURLNotation( _rUrlOrPath ); break; - case INET_PROT_NOT_VALID: + case INetProtocol::NOT_VALID: // assume system notation bSuccess = implInitWithSystemNotation( _rUrlOrPath ); break; diff --git a/svl/source/misc/inethist.cxx b/svl/source/misc/inethist.cxx index 3987cbb2384e..5c3f1a9ada6f 100644 --- a/svl/source/misc/inethist.cxx +++ b/svl/source/misc/inethist.cxx @@ -335,7 +335,7 @@ void INetURLHistory::NormalizeUrl_Impl (INetURLObject &rUrl) { switch (rUrl.GetProtocol()) { - case INET_PROT_FILE: + case INetProtocol::FILE: if (!INetURLObject::IsCaseSensitive()) { OUString aPath (rUrl.GetURLPath(INetURLObject::NO_DECODE).toAsciiLowerCase()); @@ -343,19 +343,19 @@ void INetURLHistory::NormalizeUrl_Impl (INetURLObject &rUrl) } break; - case INET_PROT_FTP: + case INetProtocol::FTP: if (!rUrl.HasPort()) rUrl.SetPort (INETHIST_DEF_FTP_PORT); break; - case INET_PROT_HTTP: + case INetProtocol::HTTP: if (!rUrl.HasPort()) rUrl.SetPort (INETHIST_DEF_HTTP_PORT); if (!rUrl.HasURLPath()) rUrl.SetURLPath("/"); break; - case INET_PROT_HTTPS: + case INetProtocol::HTTPS: if (!rUrl.HasPort()) rUrl.SetPort (INETHIST_DEF_HTTPS_PORT); if (!rUrl.HasURLPath()) diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx index bbb3e9ebcaa2..5e53645b7916 100644 --- a/svl/source/misc/urihelper.cxx +++ b/svl/source/misc/urihelper.cxx @@ -76,7 +76,7 @@ OUString URIHelper::SmartRel2Abs(INetURLObject const & rTheBaseURIRef, eStyle); if (bCheckFileExists && !bWasAbsolute - && (aAbsURIRef.GetProtocol() == INET_PROT_FILE)) + && (aAbsURIRef.GetProtocol() == INetProtocol::FILE)) { INetURLObject aNonFileURIRef; aNonFileURIRef.SetSmartURL(rTheRelURIRef, @@ -84,7 +84,7 @@ OUString URIHelper::SmartRel2Abs(INetURLObject const & rTheBaseURIRef, eCharset, eStyle); if (!aNonFileURIRef.HasError() - && aNonFileURIRef.GetProtocol() != INET_PROT_FILE) + && aNonFileURIRef.GetProtocol() != INetProtocol::FILE) { bool bMaybeFile = false; if (rMaybeFileHdl.IsSet()) @@ -507,7 +507,7 @@ OUString URIHelper::FindFirstURLInText(OUString const & rText, { sal_Int32 i = nPos; INetProtocol eScheme = INetURLObject::CompareProtocolScheme(rText.copy(i, rEnd - i)); - if (eScheme == INET_PROT_FILE) // 2nd + if (eScheme == INetProtocol::FILE) // 2nd { while (rText[i++] != ':') ; sal_Int32 nPrefixEnd = i; @@ -525,7 +525,7 @@ OUString URIHelper::FindFirstURLInText(OUString const & rText, && isBoundary1(rCharClass, rText, nUriEnd, rEnd)) { INetURLObject aUri(rText.copy(nPos, nUriEnd - nPos), - INET_PROT_FILE, eMechanism, eCharset, + INetProtocol::FILE, eMechanism, eCharset, eStyle); if (!aUri.HasError()) { @@ -536,7 +536,7 @@ OUString URIHelper::FindFirstURLInText(OUString const & rText, } } } - else if (eScheme != INET_PROT_NOT_VALID) // 1st + else if (eScheme != INetProtocol::NOT_VALID) // 1st { while (rText[i++] != ':') ; sal_Int32 nPrefixEnd = i; @@ -554,7 +554,7 @@ OUString URIHelper::FindFirstURLInText(OUString const & rText, || rText[nUriEnd] == '\\')) { INetURLObject aUri(rText.copy(nPos, nUriEnd - nPos), - INET_PROT_HTTP, eMechanism, + INetProtocol::HTTP, eMechanism, eCharset); if (!aUri.HasError()) { @@ -603,7 +603,7 @@ OUString URIHelper::FindFirstURLInText(OUString const & rText, || rText[nUriEnd] == '\\') { INetURLObject aUri(rText.copy(nPos, nUriEnd - nPos), - INET_PROT_HTTP, eMechanism, + INetProtocol::HTTP, eMechanism, eCharset); if (!aUri.HasError()) { @@ -627,7 +627,7 @@ OUString URIHelper::FindFirstURLInText(OUString const & rText, if (isBoundary1(rCharClass, rText, nUriEnd, rEnd)) { INetURLObject aUri(rText.copy(nPos, nUriEnd - nPos), - INET_PROT_FILE, + INetProtocol::FILE, INetURLObject::ENCODE_ALL, RTL_TEXTENCODING_UTF8, INetURLObject::FSYS_DOS); @@ -656,7 +656,7 @@ OUString URIHelper::FindFirstURLInText(OUString const & rText, if (isBoundary1(rCharClass, rText, nUriEnd, rEnd)) { INetURLObject aUri(rText.copy(nPos, nUriEnd - nPos), - INET_PROT_FILE, + INetProtocol::FILE, INetURLObject::ENCODE_ALL, RTL_TEXTENCODING_UTF8, INetURLObject::FSYS_DOS); @@ -693,7 +693,7 @@ OUString URIHelper::FindFirstURLInText(OUString const & rText, && isBoundary1(rCharClass, rText, i, rEnd)) { INetURLObject aUri(rText.copy(nPos, i - nPos), - INET_PROT_MAILTO, + INetProtocol::MAILTO, INetURLObject::ENCODE_ALL); if (!aUri.HasError()) { diff --git a/svtools/source/contnr/contentenumeration.cxx b/svtools/source/contnr/contentenumeration.cxx index 2c8e29666860..7d4b546b0cfd 100644 --- a/svtools/source/contnr/contentenumeration.cxx +++ b/svtools/source/contnr/contentenumeration.cxx @@ -244,7 +244,7 @@ namespace svt pData->maSize = xRow->getLong( ROW_SIZE ); if ( bHasTargetURL && - INetURLObject( aContentURL ).GetProtocol() == INET_PROT_VND_SUN_STAR_HIER ) + INetURLObject( aContentURL ).GetProtocol() == INetProtocol::VND_SUN_STAR_HIER ) { ::ucbhelper::Content aCnt( aTargetURL, xEnvironment, comphelper::getProcessComponentContext() ); try diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index b34cce5d33de..f3cc0d580a48 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -1607,7 +1607,7 @@ FileViewResult SvtFileView_Impl::GetFolderContent_Impl( { ::osl::ClearableMutexGuard aGuard( maMutex ); INetURLObject aFolderObj( rFolder ); - DBG_ASSERT( aFolderObj.GetProtocol() != INET_PROT_NOT_VALID, "Invalid URL!" ); + DBG_ASSERT( aFolderObj.GetProtocol() != INetProtocol::NOT_VALID, "Invalid URL!" ); // prepare name translation SetActualFolder( aFolderObj ); diff --git a/svtools/source/control/filectrl.cxx b/svtools/source/control/filectrl.cxx index cf72f0f2080a..fba5ac31fdeb 100644 --- a/svtools/source/control/filectrl.cxx +++ b/svtools/source/control/filectrl.cxx @@ -236,7 +236,7 @@ void FileControl::ImplBrowseFile( ) { OUString aNewText = aPathSeq[0]; INetURLObject aObj( aNewText ); - if ( aObj.GetProtocol() == INET_PROT_FILE ) + if ( aObj.GetProtocol() == INetProtocol::FILE ) aNewText = aObj.PathToFileName(); SetText( aNewText ); maEdit.GetModifyHdl().Call( &maEdit ); diff --git a/svtools/source/control/fileurlbox.cxx b/svtools/source/control/fileurlbox.cxx index a4daf5a34c93..3974b10bc6ed 100644 --- a/svtools/source/control/fileurlbox.cxx +++ b/svtools/source/control/fileurlbox.cxx @@ -31,7 +31,7 @@ namespace svt FileURLBox::FileURLBox( vcl::Window* _pParent, WinBits _nStyle ) - :SvtURLBox( _pParent, _nStyle, INET_PROT_FILE ) + :SvtURLBox( _pParent, _nStyle, INetProtocol::FILE ) { DisableHistory(); } diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx index 5f396ff57fd1..ef15f02e3b45 100644 --- a/svtools/source/control/inettbc.cxx +++ b/svtools/source/control/inettbc.cxx @@ -351,7 +351,7 @@ void SvtMatchContext_Impl::ReadFolder( const OUString& rURL, sal_Int32 nMatchLen = aMatchName.getLength(); INetURLObject aFolderObj( rURL ); - DBG_ASSERT( aFolderObj.GetProtocol() != INET_PROT_NOT_VALID, "Invalid URL!" ); + DBG_ASSERT( aFolderObj.GetProtocol() != INetProtocol::NOT_VALID, "Invalid URL!" ); try { @@ -494,7 +494,7 @@ OUString SvtURLBox::ParseSmart( const OUString& _aText, const OUString& _aBaseUR aTemp += aTextURL; INetURLObject aTmp( aTemp ); - if ( !aTmp.HasError() && aTmp.GetProtocol() != INET_PROT_NOT_VALID ) + if ( !aTmp.HasError() && aTmp.GetProtocol() != INetProtocol::NOT_VALID ) aMatch = aTmp.GetMainURL( INetURLObject::NO_DECODE ); } else @@ -537,7 +537,7 @@ OUString SvtURLBox::ParseSmart( const OUString& _aText, const OUString& _aBaseUR // INetURLObject appends a final slash for the directories "." and "..", this is a bug! // Remove it as a workaround aTmp.removeFinalSlash(); - if ( !aTmp.HasError() && aTmp.GetProtocol() != INET_PROT_NOT_VALID ) + if ( !aTmp.HasError() && aTmp.GetProtocol() != INetProtocol::NOT_VALID ) aMatch = aTmp.GetMainURL( INetURLObject::NO_DECODE ); } } @@ -587,12 +587,12 @@ void SvtMatchContext_Impl::doExecute() // if the user input is a valid URL, go on with it // otherwise it could be parsed smart with a predefined smart protocol // ( or if this is not set with the protocol of a predefined base URL ) - if( eProt == INET_PROT_NOT_VALID || eProt == eSmartProt || (eSmartProt == INET_PROT_NOT_VALID && eProt == eBaseProt) ) + if( eProt == INetProtocol::NOT_VALID || eProt == eSmartProt || (eSmartProt == INetProtocol::NOT_VALID && eProt == eBaseProt) ) { // not stopped yet ? if( schedule() ) { - if ( eProt == INET_PROT_NOT_VALID ) + if ( eProt == INetProtocol::NOT_VALID ) aMatch = SvtURLBox::ParseSmart( aText, aBaseURL, aWorkDir ); else aMatch = aText; @@ -607,7 +607,7 @@ void SvtMatchContext_Impl::doExecute() // SvtMatchContext_Impl::Stop does not guarantee a speedy // return: if ( !aMainURL.isEmpty() - && aURLObject.GetProtocol() == INET_PROT_FILE ) + && aURLObject.GetProtocol() == INetProtocol::FILE ) { // if text input is a directory, it must be part of the match list! Until then it is scanned bool folder = false; @@ -691,7 +691,7 @@ void SvtMatchContext_Impl::doExecute() aURLObject.removeSegment(); // scan directory and insert all matches - ReadFolder( aURLObject.GetMainURL( INetURLObject::NO_DECODE ), aMatch, eProt == INET_PROT_NOT_VALID ); + ReadFolder( aURLObject.GetMainURL( INetURLObject::NO_DECODE ), aMatch, eProt == INetProtocol::NOT_VALID ); } } } @@ -706,7 +706,7 @@ void SvtMatchContext_Impl::doExecute() INetURLObject aCurObj; OUString aEmpty, aCurString, aCurMainURL; INetURLObject aObj; - aObj.SetSmartProtocol( eSmartProt == INET_PROT_NOT_VALID ? INET_PROT_HTTP : eSmartProt ); + aObj.SetSmartProtocol( eSmartProt == INetProtocol::NOT_VALID ? INetProtocol::HTTP : eSmartProt ); for( ;; ) { for(std::vector<OUString>::iterator i = aPickList.begin(); schedule() && i != aPickList.end(); ++i) @@ -715,19 +715,19 @@ void SvtMatchContext_Impl::doExecute() aCurObj.SetSmartURL( aCurObj.GetURLNoPass()); aCurMainURL = aCurObj.GetMainURL( INetURLObject::NO_DECODE ); - if( eProt != INET_PROT_NOT_VALID && aCurObj.GetProtocol() != eProt ) + if( eProt != INetProtocol::NOT_VALID && aCurObj.GetProtocol() != eProt ) continue; - if( eSmartProt != INET_PROT_NOT_VALID && aCurObj.GetProtocol() != eSmartProt ) + if( eSmartProt != INetProtocol::NOT_VALID && aCurObj.GetProtocol() != eSmartProt ) continue; switch( aCurObj.GetProtocol() ) { - case INET_PROT_HTTP: - case INET_PROT_HTTPS: - case INET_PROT_FTP: + case INetProtocol::HTTP: + case INetProtocol::HTTPS: + case INetProtocol::FTP: { - if( eProt == INET_PROT_NOT_VALID && !bFull ) + if( eProt == INetProtocol::NOT_VALID && !bFull ) { aObj.SetSmartURL( aText ); if( aObj.GetURLPath().getLength() > 1 ) @@ -735,7 +735,7 @@ void SvtMatchContext_Impl::doExecute() } aCurString = aCurMainURL; - if( eProt == INET_PROT_NOT_VALID ) + if( eProt == INetProtocol::NOT_VALID ) { // try if text matches the scheme OUString aScheme( INetURLObject::GetScheme( aCurObj.GetProtocol() ) ); @@ -771,7 +771,7 @@ void SvtMatchContext_Impl::doExecute() } OUString aURL( aMatch ); - if( eProt == INET_PROT_NOT_VALID ) + if( eProt == INetProtocol::NOT_VALID ) aMatch = aMatch.copy( INetURLObject::GetScheme( aCurObj.GetProtocol() ).getLength() ); if( aText.getLength() < aMatch.getLength() ) @@ -868,7 +868,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvtURLBox(vcl::Window { WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP| WB_DROPDOWN|WB_AUTOSIZE|WB_AUTOHSCROLL; - SvtURLBox* pListBox = new SvtURLBox(pParent, nWinBits, INET_PROT_NOT_VALID, false); + SvtURLBox* pListBox = new SvtURLBox(pParent, nWinBits, INetProtocol::NOT_VALID, false); pListBox->EnableAutoSize(true); return pListBox; } @@ -966,7 +966,7 @@ void SvtURLBox::UpdatePicklistForSmartProtocol_Impl() seqPropertySet[nProperty].Value >>= sURL; aCurObj.SetURL( sURL ); - if ( !sURL.isEmpty() && ( eSmartProtocol != INET_PROT_NOT_VALID ) ) + if ( !sURL.isEmpty() && ( eSmartProtocol != INetProtocol::NOT_VALID ) ) { if( aCurObj.GetProtocol() != eSmartProtocol ) break; @@ -1209,7 +1209,7 @@ OUString SvtURLBox::GetURL() { // no autocompletion for wildcards INetURLObject aTempObj; - if ( eSmartProtocol != INET_PROT_NOT_VALID ) + if ( eSmartProtocol != INetProtocol::NOT_VALID ) aTempObj.SetSmartProtocol( eSmartProtocol ); if ( aTempObj.SetSmartURL( aText ) ) return aTempObj.GetMainURL( INetURLObject::NO_DECODE ); @@ -1217,7 +1217,7 @@ OUString SvtURLBox::GetURL() return aText; } - if ( aObj.GetProtocol() == INET_PROT_NOT_VALID ) + if ( aObj.GetProtocol() == INetProtocol::NOT_VALID ) { OUString aName = ParseSmart( aText, aBaseURL, SvtPathOptions().GetWorkPath() ); aObj.SetURL(aName); diff --git a/svtools/source/control/urlcontrol.cxx b/svtools/source/control/urlcontrol.cxx index 81a1969bf102..a21e835e2caa 100644 --- a/svtools/source/control/urlcontrol.cxx +++ b/svtools/source/control/urlcontrol.cxx @@ -27,7 +27,7 @@ namespace svt { //= OFileURLControl OFileURLControl::OFileURLControl(vcl::Window* _pParent, WinBits nStyle) - : SvtURLBox(_pParent, nStyle, INET_PROT_FILE) + : SvtURLBox(_pParent, nStyle, INetProtocol::FILE) { DisableHistory(); } diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx index 71cec8c7b3ff..263a533903f9 100644 --- a/svtools/source/dialogs/ServerDetailsControls.cxx +++ b/svtools/source/dialogs/ServerDetailsControls.cxx @@ -225,7 +225,7 @@ INetURLObject SmbDetailsContainer::getUrl( ) bool SmbDetailsContainer::setUrl( const INetURLObject& rUrl ) { - bool bSuccess = rUrl.GetProtocol() == INET_PROT_SMB; + bool bSuccess = rUrl.GetProtocol() == INetProtocol::SMB; if ( bSuccess ) { @@ -324,7 +324,7 @@ INetURLObject CmisDetailsContainer::getUrl( ) bool CmisDetailsContainer::setUrl( const INetURLObject& rUrl ) { - bool bSuccess = rUrl.GetProtocol() == INET_PROT_CMIS; + bool bSuccess = rUrl.GetProtocol() == INetProtocol::CMIS; if ( bSuccess ) { diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx index 57a389531db3..9d0729160d9b 100644 --- a/svtools/source/dialogs/addresstemplate.cxx +++ b/svtools/source/dialogs/addresstemplate.cxx @@ -707,7 +707,7 @@ void AssignmentPersistentData::ImplCommit() { OUString sName = m_pImpl->pConfigData->getDatasourceName(); INetURLObject aURL( sName ); - if( aURL.GetProtocol() != INET_PROT_NOT_VALID ) + if( aURL.GetProtocol() != INetProtocol::NOT_VALID ) { OFileNotation aFileNotation( aURL.GetMainURL( INetURLObject::NO_DECODE ) ); sName = aFileNotation.get(OFileNotation::N_SYSTEM); @@ -828,7 +828,7 @@ void AssignmentPersistentData::ImplCommit() // get the data source the user has chosen and let it build a connection INetURLObject aURL( sSelectedDS ); - if ( aURL.GetProtocol() != INET_PROT_NOT_VALID || m_xDatabaseContext->hasByName(sSelectedDS) ) + if ( aURL.GetProtocol() != INetProtocol::NOT_VALID || m_xDatabaseContext->hasByName(sSelectedDS) ) m_xDatabaseContext->getByName( sSelectedDS ) >>= xDS; } else @@ -1198,7 +1198,7 @@ void AssignmentPersistentData::ImplCommit() xProp->getPropertyValue("DataSourceName") >>= sName; INetURLObject aURL( sName ); - if( aURL.GetProtocol() != INET_PROT_NOT_VALID ) + if( aURL.GetProtocol() != INetProtocol::NOT_VALID ) { OFileNotation aFileNotation( aURL.GetMainURL( INetURLObject::NO_DECODE ) ); sName = aFileNotation.get(OFileNotation::N_SYSTEM); diff --git a/svtools/source/misc/imagemgr.cxx b/svtools/source/misc/imagemgr.cxx index 250d140c13d6..1e1e327d97c2 100644 --- a/svtools/source/misc/imagemgr.cxx +++ b/svtools/source/misc/imagemgr.cxx @@ -356,7 +356,7 @@ static sal_uInt16 GetImageId_Impl( const INetURLObject& rObject, bool bDetectFol OUString aExt, sURL = rObject.GetMainURL( INetURLObject::NO_DECODE ); sal_uInt16 nImage = IMG_FILE; - if ( rObject.GetProtocol() == INET_PROT_PRIV_SOFFICE ) + if ( rObject.GetProtocol() == INetProtocol::PRIV_SOFFICE ) { OUString aURLPath = sURL.copy( URL_PREFIX_PRIV_SOFFICE_LEN ); OUString aType = aURLPath.getToken( 0, '/' ); @@ -534,7 +534,7 @@ OUString SvFileInformationManager::GetDescription_Impl( const INetURLObject& rOb { if ( !bDetected ) { - if ( rObject.GetProtocol() == INET_PROT_PRIV_SOFFICE ) + if ( rObject.GetProtocol() == INetProtocol::PRIV_SOFFICE ) { OUString aURLPath = sURL.copy( URL_PREFIX_PRIV_SOFFICE_LEN ); OUString aType = aURLPath.getToken( 0, '/' ); diff --git a/svtools/source/misc/templatefoldercache.cxx b/svtools/source/misc/templatefoldercache.cxx index 8c1e2a4eadf3..0a9a867947e1 100644 --- a/svtools/source/misc/templatefoldercache.cxx +++ b/svtools/source/misc/templatefoldercache.cxx @@ -163,7 +163,7 @@ namespace svt TemplateContent::TemplateContent( const INetURLObject& _rURL ) :m_aURL( _rURL ) { - DBG_ASSERT( INET_PROT_NOT_VALID != m_aURL.GetProtocol(), "TemplateContent::TemplateContent: invalid URL!" ); + DBG_ASSERT( INetProtocol::NOT_VALID != m_aURL.GetProtocol(), "TemplateContent::TemplateContent: invalid URL!" ); m_sLocalName = m_aURL.getName(); implResetDate(); } @@ -562,9 +562,9 @@ namespace svt OUString TemplateFolderCacheImpl::implParseSmart( const OUString& _rPath ) { INetURLObject aParser; - aParser.SetSmartProtocol( INET_PROT_FILE ); + aParser.SetSmartProtocol( INetProtocol::FILE ); aParser.SetURL( _rPath, INetURLObject::WAS_ENCODED ); - if ( INET_PROT_NOT_VALID == aParser.GetProtocol() ) + if ( INetProtocol::NOT_VALID == aParser.GetProtocol() ) { OUString sURL; LocalFileHelper::ConvertPhysicalNameToURL( _rPath, sURL ); @@ -752,7 +752,7 @@ namespace svt // get the storage directory OUString sStorageURL = implParseSmart( SvtPathOptions().GetStoragePath() ); INetURLObject aStorageURL( sStorageURL ); - if ( INET_PROT_NOT_VALID == aStorageURL.GetProtocol() ) + if ( INetProtocol::NOT_VALID == aStorageURL.GetProtocol() ) { OSL_FAIL( "TemplateFolderCacheImpl::openCacheStream: invalid storage path!" ); return false; diff --git a/svtools/source/uno/wizard/unowizard.cxx b/svtools/source/uno/wizard/unowizard.cxx index c36ccbc33cf3..4e078fa71772 100644 --- a/svtools/source/uno/wizard/unowizard.cxx +++ b/svtools/source/uno/wizard/unowizard.cxx @@ -248,7 +248,7 @@ namespace { 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 ); @@ -261,7 +261,7 @@ namespace { OUString aTmp( OStringToOUString( sHelpId, RTL_TEXTENCODING_UTF8 ) ); INetURLObject aHID( aTmp ); - if ( aHID.GetProtocol() == INET_PROT_NOT_VALID ) + if ( aHID.GetProtocol() == INetProtocol::NOT_VALID ) aBuffer.appendAscii( INET_HID_SCHEME ); aBuffer.append( aTmp.getStr() ); return aBuffer.makeStringAndClear(); diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx index ec5941f234f4..ef6a48f6e21e 100644 --- a/svx/source/dialog/docrecovery.cxx +++ b/svx/source/dialog/docrecovery.cxx @@ -1318,7 +1318,7 @@ void BrokenRecoveryDialog::impl_askForSavePath() css::uno::Reference< css::ui::dialogs::XFolderPicker2 > xFolderPicker = css::ui::dialogs::FolderPicker::create( m_pCore->getComponentContext() ); - INetURLObject aURL(m_sSavePath, INET_PROT_FILE); + INetURLObject aURL(m_sSavePath, INetProtocol::FILE); xFolderPicker->setDisplayDirectory(aURL.GetMainURL(INetURLObject::NO_DECODE)); short nRet = xFolderPicker->execute(); if (nRet == css::ui::dialogs::ExecutableDialogResults::OK) diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx index 3a790abc2caa..ad1ba121a26b 100644 --- a/svx/source/dialog/imapdlg.cxx +++ b/svx/source/dialog/imapdlg.cxx @@ -449,7 +449,7 @@ void SvxIMapDlg::DoOpen() if( aDlg.Execute() == ERRCODE_NONE ) { INetURLObject aURL( aDlg.GetPath() ); - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ )); if( pIStm ) @@ -516,7 +516,7 @@ bool SvxIMapDlg::DoSave() INetURLObject aURL( aDlg.GetPath() ); - if( aURL.GetProtocol() == INET_PROT_NOT_VALID ) + if( aURL.GetProtocol() == INetProtocol::NOT_VALID ) { OSL_FAIL( "invalid URL" ); } diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index 7ff7feb7d1e5..d0ee9386fa02 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -685,8 +685,8 @@ void IMapWindow::DoPropertyDialog() if ( !aURLText.isEmpty() ) { - INetURLObject aObj( aURLText, INET_PROT_FILE ); - DBG_ASSERT( aObj.GetProtocol() != INET_PROT_NOT_VALID, "Invalid URL" ); + INetURLObject aObj( aURLText, INetProtocol::FILE ); + DBG_ASSERT( aObj.GetProtocol() != INetProtocol::NOT_VALID, "Invalid URL" ); pIMapObj->SetURL( aObj.GetMainURL( INetURLObject::NO_DECODE ) ); } else diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx index b6259c359acd..1c7a0c0d95df 100644 --- a/svx/source/dialog/langbox.cxx +++ b/svx/source/dialog/langbox.cxx @@ -44,7 +44,7 @@ static_assert((LISTBOX_APPEND == COMBOBOX_APPEND) && (LISTBOX_ENTRY_NOTFOUND == OUString GetDicInfoStr( const OUString& rName, const sal_uInt16 nLang, bool bNeg ) { INetURLObject aURLObj; - aURLObj.SetSmartProtocol( INET_PROT_FILE ); + aURLObj.SetSmartProtocol( INetProtocol::FILE ); aURLObj.SetSmartURL( rName, INetURLObject::ENCODE_ALL ); OUString aTmp( aURLObj.GetBase() ); aTmp += " "; diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index 8532774db6d2..7047887d99b9 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -1897,7 +1897,7 @@ void FmXGridPeer::setProperty( const OUString& PropertyName, const Any& Value) t OUString sHelpURL; OSL_VERIFY( Value >>= sHelpURL ); INetURLObject aHID( sHelpURL ); - if ( aHID.GetProtocol() == INET_PROT_HID ) + if ( aHID.GetProtocol() == INetProtocol::HID ) sHelpURL = aHID.GetURLPath(); pGrid->SetHelpId( OUStringToOString( sHelpURL, RTL_TEXTENCODING_UTF8 ) ); } diff --git a/svx/source/form/dataaccessdescriptor.cxx b/svx/source/form/dataaccessdescriptor.cxx index 1b53ad0e1b23..1f1d93312ea3 100644 --- a/svx/source/form/dataaccessdescriptor.cxx +++ b/svx/source/form/dataaccessdescriptor.cxx @@ -392,7 +392,7 @@ namespace svx if ( !_sDataSourceNameOrLocation.isEmpty() ) { INetURLObject aURL(_sDataSourceNameOrLocation); - (*this)[ (( aURL.GetProtocol() == INET_PROT_FILE ) ? daDatabaseLocation : daDataSource)] <<= _sDataSourceNameOrLocation; + (*this)[ (( aURL.GetProtocol() == INetProtocol::FILE ) ? daDatabaseLocation : daDataSource)] <<= _sDataSourceNameOrLocation; } else (*this)[ daDataSource ] <<= OUString(); diff --git a/svx/source/form/databaselocationinput.cxx b/svx/source/form/databaselocationinput.cxx index 2a4f2d40b8cc..ae712941f736 100644 --- a/svx/source/form/databaselocationinput.cxx +++ b/svx/source/form/databaselocationinput.cxx @@ -243,7 +243,7 @@ namespace svx if ( aFileDlg.Execute() == ERRCODE_NONE ) { INetURLObject aURL( aFileDlg.GetPath() ); - if( aURL.GetProtocol() != INET_PROT_NOT_VALID ) + if( aURL.GetProtocol() != INetProtocol::NOT_VALID ) { ::svt::OFileNotation aFileNotation( aURL.GetMainURL( INetURLObject::NO_DECODE ) ); m_rLocationInput.SetText( aFileNotation.get( ::svt::OFileNotation::N_SYSTEM ) ); diff --git a/svx/source/form/fmpage.cxx b/svx/source/form/fmpage.cxx index 5c41a768728f..3117930c26d3 100644 --- a/svx/source/form/fmpage.cxx +++ b/svx/source/form/fmpage.cxx @@ -191,9 +191,9 @@ bool FmFormPage::RequestHelp( vcl::Window* pWindow, SdrView* pView, // testen, ob es ein Protokoll-Typ ist, den ich anzeigen will INetProtocol aProtocol = aUrl.GetProtocol(); static const INetProtocol s_aQuickHelpSupported[] = - { INET_PROT_FTP, INET_PROT_HTTP, INET_PROT_FILE, INET_PROT_MAILTO, INET_PROT_NEWS, - INET_PROT_HTTPS, INET_PROT_JAVASCRIPT, INET_PROT_IMAP, INET_PROT_POP3, - INET_PROT_VIM, INET_PROT_LDAP + { INetProtocol::FTP, INetProtocol::HTTP, INetProtocol::FILE, INetProtocol::MAILTO, INetProtocol::NEWS, + INetProtocol::HTTPS, INetProtocol::JAVASCRIPT, INetProtocol::IMAP, INetProtocol::POP3, + INetProtocol::VIM, INetProtocol::LDAP }; for (sal_uInt16 i=0; i<sizeof(s_aQuickHelpSupported)/sizeof(s_aQuickHelpSupported[0]); ++i) if (s_aQuickHelpSupported[i] == aProtocol) diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx index 145dd97739cf..997da1a9a7dc 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -137,7 +137,7 @@ GalleryBrowser1::GalleryBrowser1( maNewTheme.SetClickHdl( LINK( this, GalleryBrowser1, ClickNewThemeHdl ) ); // disable creation of new themes if a writable directory is not available - if( mpGallery->GetUserURL().GetProtocol() == INET_PROT_NOT_VALID ) + if( mpGallery->GetUserURL().GetProtocol() == INetProtocol::NOT_VALID ) maNewTheme.Disable(); mpThemes->SetHelpId( HID_GALLERY_THEMELIST ); diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index 13e34abe9b30..16e6e948582c 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -239,7 +239,7 @@ void GalleryThemePopup::ExecutePopup( vcl::Window *pWindow, const ::Point &aPos INetURLObject aURL; const_cast< GalleryTheme* >( mpTheme )->GetURL( mnObjectPos, aURL ); - const bool bValidURL = ( aURL.GetProtocol() != INET_PROT_NOT_VALID ); + const bool bValidURL = ( aURL.GetProtocol() != INetProtocol::NOT_VALID ); maPopupMenu.EnableItem( MN_ADD, bValidURL && SGA_OBJ_SOUND != eObjKind ); @@ -668,7 +668,7 @@ bool GalleryBrowser2::KeyInput( const KeyEvent& rKEvt, vcl::Window* pWindow ) const_cast< GalleryTheme* >( mpCurTheme )->GetURL( nItemId - 1, aURL ); - const bool bValidURL = ( aURL.GetProtocol() != INET_PROT_NOT_VALID ); + const bool bValidURL = ( aURL.GetProtocol() != INetProtocol::NOT_VALID ); bool bPreview = bValidURL; bool bDelete = false; bool bTitle = false; diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx index 517b3a9094c3..a8d6bd431430 100644 --- a/svx/source/gallery2/galctrl.cxx +++ b/svx/source/gallery2/galctrl.cxx @@ -236,7 +236,7 @@ void GalleryPreview::StartDrag( sal_Int8, const Point& ) void GalleryPreview::PreviewMedia( const INetURLObject& rURL ) { - if( rURL.GetProtocol() != INET_PROT_NOT_VALID ) + if( rURL.GetProtocol() != INetProtocol::NOT_VALID ) { ::avmedia::MediaFloater* pFloater = avmedia::getMediaFloater(); diff --git a/svx/source/gallery2/galexpl.cxx b/svx/source/gallery2/galexpl.cxx index 75def1b09e86..5db382344529 100644 --- a/svx/source/gallery2/galexpl.cxx +++ b/svx/source/gallery2/galexpl.cxx @@ -121,7 +121,7 @@ bool GalleryExplorer::InsertURL( const OUString& rThemeName, const OUString& rUR if( pTheme ) { INetURLObject aURL( rURL ); - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); bRet = pTheme->InsertURL( aURL ); pGal->ReleaseTheme( pTheme, aListener ); } diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx index 32b14eb3e2d9..3328b46677d5 100644 --- a/svx/source/gallery2/gallery1.cxx +++ b/svx/source/gallery2/gallery1.cxx @@ -67,7 +67,7 @@ GalleryThemeEntry::GalleryThemeEntry( bool bCreateUniqueURL, bThemeNameFromResource ( _bThemeNameFromResource ) { INetURLObject aURL( rBaseURL ); - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); if (bCreateUniqueURL) { @@ -226,8 +226,8 @@ void Gallery::ImplLoad( const OUString& rMultiPath ) else aRelURL = INetURLObject( rMultiPath ); - DBG_ASSERT( aUserURL.GetProtocol() != INET_PROT_NOT_VALID, "no writable Gallery user directory available" ); - DBG_ASSERT( aRelURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aUserURL.GetProtocol() != INetProtocol::NOT_VALID, "no writable Gallery user directory available" ); + DBG_ASSERT( aRelURL.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); } void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, bool& rbDirIsReadOnly ) @@ -245,7 +245,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, bool& rbDirIsReadO uno::Reference< sdbc::XResultSet > xResultSet( aCnt.createCursor( aProps, ::ucbhelper::INCLUDE_DOCUMENTS_ONLY ) ); #if defined(MACOSX) && HAVE_FEATURE_READONLY_INSTALLSET - if( rBaseURL.GetProtocol() == INET_PROT_FILE ) + if( rBaseURL.GetProtocol() == INetProtocol::FILE ) { const char *appBundle = [[[NSBundle mainBundle] bundlePath] UTF8String]; OUString path = rBaseURL.GetURLPath(); @@ -509,7 +509,7 @@ bool Gallery::CreateTheme( const OUString& rThemeName ) { bool bRet = false; - if( !HasTheme( rThemeName ) && ( GetUserURL().GetProtocol() != INET_PROT_NOT_VALID ) ) + if( !HasTheme( rThemeName ) && ( GetUserURL().GetProtocol() != INetProtocol::NOT_VALID ) ) { INetURLObject aURL( GetUserURL() ); aURL.Append( rThemeName ); @@ -616,7 +616,7 @@ GalleryTheme* Gallery::ImplGetCachedTheme(const GalleryThemeEntry* pThemeEntry) { INetURLObject aURL = pThemeEntry->GetThmURL(); - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); if( FileExists( aURL ) ) { diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx index 4cafc7439793..789bdaa8dcf6 100644 --- a/svx/source/gallery2/galmisc.cxx +++ b/svx/source/gallery2/galmisc.cxx @@ -190,7 +190,7 @@ OUString GetReducedString( const INetURLObject& rURL, sal_Int32 nMaxLen ) aReduced = aReduced.getToken( comphelper::string::getTokenCount(aReduced, '/') - 1, '/' ); - if( INET_PROT_PRIV_SOFFICE != rURL.GetProtocol() ) + if( INetProtocol::PRIV_SOFFICE != rURL.GetProtocol() ) { sal_Unicode aDelimiter; const OUString aPath( rURL.getFSysPath( INetURLObject::FSYS_DETECT, &aDelimiter ) ); @@ -226,7 +226,7 @@ OUString GetSvDrawStreamNameFromURL( const INetURLObject& rSvDrawObjURL ) { OUString aRet; - if( rSvDrawObjURL.GetProtocol() == INET_PROT_PRIV_SOFFICE && + if( rSvDrawObjURL.GetProtocol() == INetProtocol::PRIV_SOFFICE && comphelper::string::getTokenCount(rSvDrawObjURL.GetMainURL( INetURLObject::NO_DECODE ), '/') == 3 ) { aRet = rSvDrawObjURL.GetMainURL( INetURLObject::NO_DECODE ).getToken( 2, '/' ); @@ -239,7 +239,7 @@ bool FileExists( const INetURLObject& rURL ) { bool bRet = false; - if( rURL.GetProtocol() != INET_PROT_NOT_VALID ) + if( rURL.GetProtocol() != INetProtocol::NOT_VALID ) { try { @@ -585,7 +585,7 @@ void GalleryTransferable::StartDrag( vcl::Window* pWindow, sal_Int8 nDragSourceA { INetURLObject aURL; - if( mpTheme->GetURL( mnObjectPos, aURL ) && ( aURL.GetProtocol() != INET_PROT_NOT_VALID ) ) + if( mpTheme->GetURL( mnObjectPos, aURL ) && ( aURL.GetProtocol() != INetProtocol::NOT_VALID ) ) { mpTheme->SetDragging( true ); mpTheme->SetDragPos( mnObjectPos ); diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index f7dc2cb19cae..1f6c7ec547b4 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -201,7 +201,7 @@ void GalleryTheme::ImplWrite() aPathURL.removeSegment(); aPathURL.removeFinalSlash(); - DBG_ASSERT( aPathURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aPathURL.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); if( FileExists( aPathURL ) || CreateDir( aPathURL ) ) { @@ -293,7 +293,7 @@ INetURLObject GalleryTheme::ImplCreateUniqueURL( SgaObjKind eObjKind, sal_uIntPt if( SGA_OBJ_SVDRAW == eObjKind ) { OUString aFileName( "gallery/svdraw/dd" ); - aNewURL = INetURLObject( aFileName += OUString::number( ++nNextNumber % 99999999 ), INET_PROT_PRIV_SOFFICE ); + aNewURL = INetURLObject( aFileName += OUString::number( ++nNextNumber % 99999999 ), INetProtocol::PRIV_SOFFICE ); bExists = false; @@ -614,8 +614,8 @@ void GalleryTheme::Actualize( const Link& rActualizeLink, GalleryProgress* pProg INetURLObject aInURL( GetSdgURL() ); INetURLObject aTmpURL( aTmp.GetURL() ); - DBG_ASSERT( aInURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); - DBG_ASSERT( aTmpURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aInURL.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); + DBG_ASSERT( aTmpURL.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( aInURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ )); boost::scoped_ptr<SvStream> pTmpStm(::utl::UcbStreamHelper::CreateStream( aTmpURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::WRITE | StreamMode::TRUNC )); @@ -691,7 +691,7 @@ void GalleryTheme::Actualize( const Link& rActualizeLink, GalleryProgress* pProg GalleryThemeEntry* GalleryTheme::CreateThemeEntry( const INetURLObject& rURL, bool bReadOnly ) { - DBG_ASSERT( rURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( rURL.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); GalleryThemeEntry* pRet = NULL; @@ -1211,7 +1211,7 @@ bool GalleryTheme::InsertTransferable( const uno::Reference< datatransfer::XTran const OUString aFile( aFileList.GetFile( i ) ); INetURLObject aURL( aFile ); - if( aURL.GetProtocol() == INET_PROT_NOT_VALID ) + if( aURL.GetProtocol() == INetProtocol::NOT_VALID ) { OUString aLocalURL; @@ -1219,7 +1219,7 @@ bool GalleryTheme::InsertTransferable( const uno::Reference< datatransfer::XTran aURL = INetURLObject( aLocalURL ); } - if( aURL.GetProtocol() != INET_PROT_NOT_VALID ) + if( aURL.GetProtocol() != INetProtocol::NOT_VALID ) bRet = InsertFileOrDirURL( aURL, nInsertPos ); } } @@ -1459,7 +1459,7 @@ SvStream& GalleryTheme::ReadData( SvStream& rIStm ) if( SGA_OBJ_SVDRAW == pObj->eObjKind ) { OUString aDummyURL( "gallery/svdraw/" ); - pObj->aURL = INetURLObject( aDummyURL += aFileName, INET_PROT_PRIV_SOFFICE ); + pObj->aURL = INetURLObject( aDummyURL += aFileName, INetProtocol::PRIV_SOFFICE ); } else { @@ -1467,7 +1467,7 @@ SvStream& GalleryTheme::ReadData( SvStream& rIStm ) pObj->aURL = INetURLObject( aFileName ); - if( ( pObj->aURL.GetProtocol() == INET_PROT_NOT_VALID ) && + if( ( pObj->aURL.GetProtocol() == INetProtocol::NOT_VALID ) && ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aFileName, aLocalURL ) ) { pObj->aURL = INetURLObject( aLocalURL ); diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx index f0e2ed04a60e..64a83acc5947 100644 --- a/svx/source/sidebar/nbdtmg.cxx +++ b/svx/source/sidebar/nbdtmg.cxx @@ -561,7 +561,7 @@ void GraphyicBulletsTypeMgr::Init() { OUString sGrfNm = aGrfNames[i]; INetURLObject aObj(sGrfNm); - if(aObj.GetProtocol() == INET_PROT_FILE) + if(aObj.GetProtocol() == INetProtocol::FILE) sGrfNm = aObj.PathToFileName(); GrfBulDataRelation* pEntry = new GrfBulDataRelation(eNBType::GRAPHICBULLETS); diff --git a/svx/source/svdraw/svdotxln.cxx b/svx/source/svdraw/svdotxln.cxx index 489dae44a2c7..a62c27d31891 100644 --- a/svx/source/svdraw/svdotxln.cxx +++ b/svx/source/svdraw/svdotxln.cxx @@ -171,7 +171,7 @@ bool SdrTextObj::ReloadLinkedText( bool bForceLoad) try { INetURLObject aURL( pData->aFileName ); - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); ::ucbhelper::Content aCnt( aURL.GetMainURL( INetURLObject::NO_DECODE ), ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() ); ::com::sun::star::uno::Any aAny( aCnt.getPropertyValue("DateModified") ); @@ -210,7 +210,7 @@ bool SdrTextObj::LoadText(const OUString& rFileName, const OUString& /*rFilterNa INetURLObject aFileURL( rFileName ); bool bRet = false; - if( aFileURL.GetProtocol() == INET_PROT_NOT_VALID ) + if( aFileURL.GetProtocol() == INetProtocol::NOT_VALID ) { OUString aFileURLStr; @@ -220,7 +220,7 @@ bool SdrTextObj::LoadText(const OUString& rFileName, const OUString& /*rFilterNa aFileURL.SetSmartURL( rFileName ); } - DBG_ASSERT( aFileURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aFileURL.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( aFileURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ )); diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index 7f2a32ba18be..4a5ab7cc561a 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -1059,7 +1059,7 @@ sal_Bool SAL_CALL GraphicExporter::filter( const Sequence< PropertyValue >& aDes else { INetURLObject aURLObject( aSettings.maURL.Complete ); - DBG_ASSERT( aURLObject.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aURLObject.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); nStatus = XOutBitmap::ExportGraphic( aGraphic, aURLObject, rFilter, nFilter, &aSettings.maFilterData ); } diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index f0f4eb3bb932..b942a0d7057c 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -1495,7 +1495,7 @@ bool SvxGraphicObject::setPropertyValueImpl( const OUString& rName, const SfxIte { INetURLObject aURLObj( aURL ); - if( aURLObj.GetProtocol() == INET_PROT_NOT_VALID ) + if( aURLObj.GetProtocol() == INetProtocol::NOT_VALID ) { OUString aValidURL; @@ -1503,7 +1503,7 @@ bool SvxGraphicObject::setPropertyValueImpl( const OUString& rName, const SfxIte aURLObj = INetURLObject( aValidURL ); } - if( aURLObj.GetProtocol() != INET_PROT_NOT_VALID ) + if( aURLObj.GetProtocol() != INetProtocol::NOT_VALID ) { GraphicFilter &rGrfFilter = GraphicFilter::GetGraphicFilter(); aFilterName = rGrfFilter.GetImportFormatName( rGrfFilter.GetImportFormatNumberForShortName( aURLObj.getExtension() ) ); diff --git a/svx/source/unogallery/unogaltheme.cxx b/svx/source/unogallery/unogaltheme.cxx index 8381641fae35..1d3b6fa76129 100644 --- a/svx/source/unogallery/unogaltheme.cxx +++ b/svx/source/unogallery/unogaltheme.cxx @@ -228,7 +228,7 @@ void SAL_CALL GalleryTheme::update( ) nIndex = ::std::max( ::std::min( nIndex, getCount() ), sal_Int32( 0 ) ); - if( ( aURL.GetProtocol() != INET_PROT_NOT_VALID ) && mpTheme->InsertURL( aURL, nIndex ) ) + if( ( aURL.GetProtocol() != INetProtocol::NOT_VALID ) && mpTheme->InsertURL( aURL, nIndex ) ) { const GalleryObject* pObj = mpTheme->ImplGetGalleryObject( aURL ); diff --git a/svx/source/xml/xmlxtexp.cxx b/svx/source/xml/xmlxtexp.cxx index 6bd11a0df730..e308779f7331 100644 --- a/svx/source/xml/xmlxtexp.cxx +++ b/svx/source/xml/xmlxtexp.cxx @@ -218,7 +218,7 @@ bool SvxXMLXTableExportComponent::save( sal_Int32 eCreate = embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE; INetURLObject aURLObj( rURL ); - bool bToStorage = aURLObj.GetProtocol() == INET_PROT_NOT_VALID; // a relative path + bool bToStorage = aURLObj.GetProtocol() == INetProtocol::NOT_VALID; // a relative path bool bSaveAsStorage = xTable->getElementType() == cppu::UnoType<OUString>::get(); diff --git a/svx/source/xml/xmlxtimp.cxx b/svx/source/xml/xmlxtimp.cxx index 57632db61458..e3239c3f9648 100644 --- a/svx/source/xml/xmlxtimp.cxx +++ b/svx/source/xml/xmlxtimp.cxx @@ -375,7 +375,7 @@ bool SvxXMLXTableImport::load( const OUString &rPath, const OUString &rReferer, SvXMLGraphicHelper* pGraphicHelper = 0; INetURLObject aURLObj( rPath ); - bool bUseStorage = aURLObj.GetProtocol() == INET_PROT_NOT_VALID; // a relative path + bool bUseStorage = aURLObj.GetProtocol() == INetProtocol::NOT_VALID; // a relative path try { diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index ed7682953c86..87dbb9f55dc3 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -127,7 +127,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam sal_uInt16 nErr = GRFILTER_FILTERERROR, nFilter = GRFILTER_FORMAT_NOTFOUND; bool bTransparent = rGraphic.IsTransparent(), bAnimated = rGraphic.IsAnimated(); - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "XOutBitmap::WriteGraphic(...): invalid URL" ); + DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NOT_VALID, "XOutBitmap::WriteGraphic(...): invalid URL" ); // calculate correct file name if( !( nFlags & XOUTBMP_DONT_EXPAND_FILENAME ) ) @@ -364,7 +364,7 @@ sal_uInt16 XOutBitmap::ExportGraphic( const Graphic& rGraphic, const INetURLObje GraphicFilter& rFilter, const sal_uInt16 nFormat, const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData ) { - DBG_ASSERT( rURL.GetProtocol() != INET_PROT_NOT_VALID, "XOutBitmap::ExportGraphic(...): invalid URL" ); + DBG_ASSERT( rURL.GetProtocol() != INetProtocol::NOT_VALID, "XOutBitmap::ExportGraphic(...): invalid URL" ); SfxMedium aMedium( rURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::WRITE | StreamMode::SHARE_DENYNONE | StreamMode::TRUNC ); SvStream* pOStm = aMedium.GetOutStream(); diff --git a/svx/source/xoutdev/xtable.cxx b/svx/source/xoutdev/xtable.cxx index c5cd0c549602..bae363fb044b 100644 --- a/svx/source/xoutdev/xtable.cxx +++ b/svx/source/xoutdev/xtable.cxx @@ -227,7 +227,7 @@ bool XPropertyList::Load() INetURLObject aURL( maPath ); - if( INET_PROT_NOT_VALID == aURL.GetProtocol() ) + if( INetProtocol::NOT_VALID == aURL.GetProtocol() ) { DBG_ASSERT( maPath.isEmpty(), "invalid URL" ); return false; @@ -258,7 +258,7 @@ bool XPropertyList::Save() { INetURLObject aURL( maPath ); - if( INET_PROT_NOT_VALID == aURL.GetProtocol() ) + if( INetProtocol::NOT_VALID == aURL.GetProtocol() ) { DBG_ASSERT( maPath.isEmpty(), "invalid URL" ); return false; diff --git a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx index c336871bea49..45733f588737 100644 --- a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx +++ b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx @@ -77,8 +77,8 @@ namespace rLnkMgr.GetDisplayNames( xLink, 0, &sFName, 0, 0 ); INetURLObject aURL( sFName ); - if( INET_PROT_FILE == aURL.GetProtocol() || - INET_PROT_CID == aURL.GetProtocol() ) + if( INetProtocol::FILE == aURL.GetProtocol() || + INetProtocol::CID == aURL.GetProtocol() ) return pLnk; } } diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx index 8a4749e86857..1170ef387d63 100644 --- a/sw/source/core/doc/acmplwrd.cxx +++ b/sw/source/core/doc/acmplwrd.cxx @@ -242,7 +242,7 @@ bool SwAutoCompleteWord::InsertWord( const OUString& rWord, SwDoc& rDoc ) if( pMedium ) { const INetURLObject& rURL = pMedium->GetURLObject(); - if ( rURL.GetProtocol() == INET_PROT_VND_SUN_STAR_HELP ) + if ( rURL.GetProtocol() == INetProtocol::VND_SUN_STAR_HELP ) return false; } diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 34d147b9aa7f..efae9eed545e 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -422,7 +422,7 @@ OUString SwFileNameFieldType::Expand(sal_uLong nFmt) const { case FF_PATH: { - if( INET_PROT_FILE == rURLObj.GetProtocol() ) + if( INetProtocol::FILE == rURLObj.GetProtocol() ) { INetURLObject aTemp(rURLObj); aTemp.removeSegment(); @@ -452,7 +452,7 @@ OUString SwFileNameFieldType::Expand(sal_uLong nFmt) const break; default: - if( INET_PROT_FILE == rURLObj.GetProtocol() ) + if( INetProtocol::FILE == rURLObj.GetProtocol() ) aRet = rURLObj.GetFull(); else aRet = URIHelper::removePassword( diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index 228e61ba4169..2d38b75cc2a9 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -127,7 +127,7 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere, if( IsLinkedFile() ) { INetURLObject aUrl( rGrfName ); - if( INET_PROT_FILE == aUrl.GetProtocol() && + if( INetProtocol::FILE == aUrl.GetProtocol() && FStatHelper::IsDocument( aUrl.GetMainURL( INetURLObject::NO_DECODE ) )) { // file exists, so create connection without an update diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx index 4154767253e9..75186b277a18 100644 --- a/sw/source/core/swg/SwXMLTextBlocks.cxx +++ b/sw/source/core/swg/SwXMLTextBlocks.cxx @@ -523,7 +523,7 @@ bool SwXMLTextBlocks::IsFileUCBStorage( const OUString & rFileName) { OUString aName( rFileName ); INetURLObject aObj( aName ); - if ( aObj.GetProtocol() == INET_PROT_NOT_VALID ) + if ( aObj.GetProtocol() == INetProtocol::NOT_VALID ) { OUString aURL; ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aName, aURL ); diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index b5faf4192354..3b37e31c82a7 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -886,7 +886,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, // a non-empty string. INetURLObject aObj; aObj.SetURL( aDataSource ); - bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; + bool bIsURL = aObj.GetProtocol() != INetProtocol::NOT_VALID; if (bIsURL && rPropertyName == UNO_NAME_DATA_BASE_URL) pStr = &aDataSource; // DataBaseURL else if (!bIsURL && rPropertyName == UNO_NAME_DATA_BASE_NAME) @@ -925,7 +925,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, // only one of these properties returns a non-empty string. INetURLObject aObj; aObj.SetURL(m_pImpl->m_sParam5); // SetSmartURL - bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; + bool bIsURL = aObj.GetProtocol() != INetProtocol::NOT_VALID; if (bIsURL && rPropertyName == UNO_NAME_DATA_BASE_URL) aRet <<= m_pImpl->m_sParam5; // DataBaseURL else if ( rPropertyName == UNO_NAME_DATA_BASE_NAME) diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx index e9bb306c9310..af2f911f987b 100644 --- a/sw/source/filter/basflt/iodetect.cxx +++ b/sw/source/filter/basflt/iodetect.cxx @@ -158,7 +158,7 @@ const SfxFilter* SwIoSystem::GetFileFilter(const OUString& rFileName) // package storage or OLEStorage based format SotStorageRef xStg; INetURLObject aObj; - aObj.SetSmartProtocol( INET_PROT_FILE ); + aObj.SetSmartProtocol( INetProtocol::FILE ); aObj.SetSmartURL( rFileName ); SfxMedium aMedium(aObj.GetMainURL(INetURLObject::NO_DECODE), STREAM_STD_READ); diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 38f06b0af863..fb5b960ab38c 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -466,7 +466,7 @@ IMAGE_SETEVENT: Graphic aGraphic; INetURLObject aGraphicURL( sGrfNm ); - if( aGraphicURL.GetProtocol() == INET_PROT_DATA ) + if( aGraphicURL.GetProtocol() == INetProtocol::DATA ) { std::unique_ptr<SvMemoryStream> const pStream(aGraphicURL.getData()); if (pStream) diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 0e03963d58b0..40977d4dbe6e 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -219,7 +219,7 @@ void SwBasicEscherEx::WriteHyperlinkWithinFly( SvMemoryStream& rStrm, const SwFm } // file link or URL - if (eProtocol == INET_PROT_FILE || (eProtocol == INET_PROT_NOT_VALID && rUrl[0] != '#')) + if (eProtocol == INetProtocol::FILE || (eProtocol == INetProtocol::NOT_VALID && rUrl[0] != '#')) { sal_uInt16 nLevel; bool bRel; @@ -242,7 +242,7 @@ void SwBasicEscherEx::WriteHyperlinkWithinFly( SvMemoryStream& rStrm, const SwFm tmpStrm.WriteUInt16( 0x0003 ); SwWW8Writer::WriteString16(tmpStrm, aFileName, false); } - else if( eProtocol != INET_PROT_NOT_VALID ) + else if( eProtocol != INetProtocol::NOT_VALID ) { tmpStrm.Write( maGuidUrlMoniker,sizeof(maGuidUrlMoniker) ); SwWW8Writer::WriteLong(tmpStrm, 2*(rUrl.getLength()+1)); diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 49d2a80b1c22..ed3f07edf3e0 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -877,7 +877,7 @@ bool AttributeOutputBase::AnalyzeURL( const OUString& rUrl, const OUString& /*rT } else { - INetURLObject aURL( rUrl, INET_PROT_NOT_VALID ); + INetURLObject aURL( rUrl, INetProtocol::NOT_VALID ); sURL = aURL.GetURLNoMark( INetURLObject::DECODE_UNAMBIGUOUS ); sMark = aURL.GetMark( INetURLObject::DECODE_UNAMBIGUOUS ); } @@ -993,7 +993,7 @@ bool WW8AttributeOutput::StartURL( const OUString &rUrl, const OUString &rTarget SwWW8Writer::WriteLong( *m_rWW8Export.pDataStrm, nFlag ); INetProtocol eProto = aURL.GetProtocol(); - if ( eProto == INET_PROT_FILE || eProto == INET_PROT_SMB ) + if ( eProto == INetProtocol::FILE || eProto == INetProtocol::SMB ) { // version 1 (for a document) @@ -1011,7 +1011,7 @@ bool WW8AttributeOutput::StartURL( const OUString &rUrl, const OUString &rTarget // save the links to files as relative sURL = URIHelper::simpleNormalizedMakeRelative( m_rWW8Export.GetWriter().GetBaseURL(), sURL ); - if ( eProto == INET_PROT_FILE && sURL.startsWith( "/" ) ) + if ( eProto == INetProtocol::FILE && sURL.startsWith( "/" ) ) sURL = aURL.PathToFileName(); // special case for the absolute windows names @@ -1028,7 +1028,7 @@ bool WW8AttributeOutput::StartURL( const OUString &rUrl, const OUString &rTarget // n#261623 convert smb notation to '\\' const char pSmb[] = "smb://"; - if ( eProto == INET_PROT_SMB && sURL.startsWith( pSmb ) ) + if ( eProto == INetProtocol::SMB && sURL.startsWith( pSmb ) ) { sURL = sURL.copy( sizeof(pSmb)-3 ).replaceAll( "/", "\\" ); } @@ -1044,7 +1044,7 @@ bool WW8AttributeOutput::StartURL( const OUString &rUrl, const OUString &rTarget SwWW8Writer::WriteShort( *m_rWW8Export.pDataStrm, 3 ); SwWW8Writer::WriteString16( *m_rWW8Export.pDataStrm, sURL, false ); } - else if ( eProto != INET_PROT_NOT_VALID ) + else if ( eProto != INetProtocol::NOT_VALID ) { // version 2 (simple url) // an write some data to the data stream, but dont ask diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index e2446d1c2ef3..615b2af56e2e 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -4743,7 +4743,7 @@ static void lcl_createTemplateToProjectEntry( const uno::Reference< container::X { INetURLObject aObj; aObj.SetURL( sTemplatePathOrURL ); - bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; + bool bIsURL = aObj.GetProtocol() != INetProtocol::NOT_VALID; OUString aURL; if ( bIsURL ) aURL = sTemplatePathOrURL; @@ -4828,7 +4828,7 @@ bool SwWW8ImplReader::ReadGlobalTemplateSettings( const OUString& sCreatedFrom, { INetURLObject aObj; aObj.SetURL( sGlobalTemplates[ i ] ); - bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; + bool bIsURL = aObj.GetProtocol() != INetProtocol::NOT_VALID; OUString aURL; if ( bIsURL ) aURL = sGlobalTemplates[ i ]; diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx index 7316fb8022b3..592f643645ad 100644 --- a/sw/source/ui/envelp/mailmrge.cxx +++ b/sw/source/ui/envelp/mailmrge.cxx @@ -314,7 +314,7 @@ SwMailMergeDlg::SwMailMergeDlg(vcl::Window* pParent, SwWrtShell& rShell, sPath = aPathOpt.GetWorkPath(); } INetURLObject aURL(sPath); - if(aURL.GetProtocol() == INET_PROT_FILE) + if(aURL.GetProtocol() == INetProtocol::FILE) m_pPathED->SetText(aURL.PathToFileName()); else m_pPathED->SetText(aURL.GetFull()); @@ -605,7 +605,7 @@ IMPL_LINK_NOARG(SwMailMergeDlg, InsertPathHdl) if( xFP->execute() == RET_OK ) { INetURLObject aURL(xFP->getDirectory()); - if(aURL.GetProtocol() == INET_PROT_FILE) + if(aURL.GetProtocol() == INetProtocol::FILE) m_pPathED->SetText(aURL.PathToFileName()); else m_pPathED->SetText(aURL.GetFull()); diff --git a/sw/source/ui/fldui/javaedit.cxx b/sw/source/ui/fldui/javaedit.cxx index 0e270865bf2e..2271593839c9 100644 --- a/sw/source/ui/fldui/javaedit.cxx +++ b/sw/source/ui/fldui/javaedit.cxx @@ -161,7 +161,7 @@ void SwJavaEditDialog::CheckTravel() if(!sURL.isEmpty()) { INetURLObject aINetURL(sURL); - if(INET_PROT_FILE == aINetURL.GetProtocol()) + if(INetProtocol::FILE == aINetURL.GetProtocol()) sURL = aINetURL.PathToFileName(); } m_pUrlED->SetText(sURL); @@ -267,7 +267,7 @@ IMPL_LINK_NOARG(SwJavaEditDialog, DlgClosedHdl) if ( !sFileName.isEmpty() ) { INetURLObject aINetURL( sFileName ); - if ( INET_PROT_FILE == aINetURL.GetProtocol() ) + if ( INetProtocol::FILE == aINetURL.GetProtocol() ) sFileName = aINetURL.PathToFileName(); } m_pUrlED->SetText( sFileName ); diff --git a/sw/source/ui/vba/vbadocument.cxx b/sw/source/ui/vba/vbadocument.cxx index b3979f5be7e8..912cf162c9bb 100644 --- a/sw/source/ui/vba/vbadocument.cxx +++ b/sw/source/ui/vba/vbadocument.cxx @@ -270,7 +270,7 @@ SwVbaDocument::setAttachedTemplate( const css::uno::Any& _attachedtemplate ) thr OUString aURL; INetURLObject aObj; aObj.SetURL( sTemplate ); - bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; + bool bIsURL = aObj.GetProtocol() != INetProtocol::NOT_VALID; if ( bIsURL ) aURL = sTemplate; else diff --git a/sw/source/ui/vba/vbadocuments.cxx b/sw/source/ui/vba/vbadocuments.cxx index 87ad6169eaf4..d2b4e6b6f6ee 100644 --- a/sw/source/ui/vba/vbadocuments.cxx +++ b/sw/source/ui/vba/vbadocuments.cxx @@ -132,7 +132,7 @@ SwVbaDocuments::Open( const OUString& Filename, const uno::Any& /*ConfirmConvers OUString aURL; INetURLObject aObj; aObj.SetURL( Filename ); - bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; + bool bIsURL = aObj.GetProtocol() != INetProtocol::NOT_VALID; if ( bIsURL ) aURL = Filename; else diff --git a/sw/source/ui/vba/vbasystem.cxx b/sw/source/ui/vba/vbasystem.cxx index b2de217a8d2d..6e2fd2f6c203 100644 --- a/sw/source/ui/vba/vbasystem.cxx +++ b/sw/source/ui/vba/vbasystem.cxx @@ -249,7 +249,7 @@ SwVbaSystem::PrivateProfileString( const OUString& rFilename, const OUString& rS { INetURLObject aObj; aObj.SetURL( rFilename ); - bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; + bool bIsURL = aObj.GetProtocol() != INetProtocol::NOT_VALID; if ( bIsURL ) sFileUrl = rFilename; else diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index 1ed665765e68..4df243b2500c 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -1542,7 +1542,7 @@ int SwFindDocShell( SfxObjectShellRef& xDocSh, // 2. Open the file ourselves SfxMedium* pMed = new SfxMedium( aTmpObj.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ ); - if( INET_PROT_FILE == aTmpObj.GetProtocol() ) + if( INetProtocol::FILE == aTmpObj.GetProtocol() ) pMed->Download(); // Touch the medium (download it) const SfxFilter* pSfxFlt = 0; diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index ed4c180dcb47..f354333a4d05 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -2500,7 +2500,7 @@ bool SwTransferable::_PasteAsHyperlink( TransferableDataHelper& rData, // first, make the URL absolute INetURLObject aURL; - aURL.SetSmartProtocol( INET_PROT_FILE ); + aURL.SetSmartProtocol( INetProtocol::FILE ); aURL.SetSmartURL( sFile ); sFile = aURL.GetMainURL( INetURLObject::NO_DECODE ); @@ -2594,7 +2594,7 @@ bool SwTransferable::_PasteFileName( TransferableDataHelper& rData, // first, make the URL absolute INetURLObject aURL; - aURL.SetSmartProtocol( INET_PROT_FILE ); + aURL.SetSmartProtocol( INetProtocol::FILE ); aURL.SetSmartURL( sFile ); sFile = aURL.GetMainURL( INetURLObject::NO_DECODE ); diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index 2ef122b9e8f9..d4761633bc5f 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -251,7 +251,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) INetURLObject(), aStrURL, URIHelper::GetMaybeFileHdl() ); INetURLObject url; - url.SetSmartProtocol( INET_PROT_FILE ); + url.SetSmartProtocol( INetProtocol::FILE ); if ( url.SetURL( aStrURL, INetURLObject::WAS_ENCODED ) ) { diff --git a/sw/source/uibase/uno/unomailmerge.cxx b/sw/source/uibase/uno/unomailmerge.cxx index 9ffed3a8af84..1af660cb393d 100644 --- a/sw/source/uibase/uno/unomailmerge.cxx +++ b/sw/source/uibase/uno/unomailmerge.cxx @@ -703,7 +703,7 @@ uno::Any SAL_CALL SwXMailMerge::execute( case MailMergeType::MAIL: { INetURLObject aURLObj; - aURLObj.SetSmartProtocol( INET_PROT_FILE ); + aURLObj.SetSmartProtocol( INetProtocol::FILE ); if (!aCurDocumentURL.isEmpty()) { diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx index b66cf6e1a7bb..6c9fcb187baf 100644 --- a/sw/source/uibase/uno/unomod.cxx +++ b/sw/source/uibase/uno/unomod.cxx @@ -729,7 +729,7 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c throw IllegalArgumentException(); INetURLObject aHID( sHelpURL ); - if ( aHID.GetProtocol() == INET_PROT_HID ) + if ( aHID.GetProtocol() == INetProtocol::HID ) pView->GetEditWin().SetHelpId( OUStringToOString( aHID.GetURLPath(), RTL_TEXTENCODING_UTF8 ) ); else throw IllegalArgumentException (); diff --git a/toolkit/source/awt/animatedimagespeer.cxx b/toolkit/source/awt/animatedimagespeer.cxx index 3c77117e6116..5b6964c4826c 100644 --- a/toolkit/source/awt/animatedimagespeer.cxx +++ b/toolkit/source/awt/animatedimagespeer.cxx @@ -110,7 +110,7 @@ namespace toolkit OUString lcl_getHighContrastURL( OUString const& i_imageURL ) { INetURLObject aURL( i_imageURL ); - if ( aURL.GetProtocol() != INET_PROT_PRIV_SOFFICE ) + if ( aURL.GetProtocol() != INetProtocol::PRIV_SOFFICE ) { OSL_VERIFY( aURL.insertName( OUString( "hicontrast" ), false, 0 ) ); return aURL.GetMainURL( INetURLObject::NO_DECODE ); diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index 588641713110..9039356d19e8 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -1519,7 +1519,7 @@ void VCLXWindow::setProperty( const OUString& PropertyName, const ::com::sun::st if ( Value >>= aURL ) { INetURLObject aHelpURL( aURL ); - if ( aHelpURL.GetProtocol() == INET_PROT_HID ) + if ( aHelpURL.GetProtocol() == INetProtocol::HID ) pWindow->SetHelpId( OUStringToOString( aHelpURL.GetURLPath(), RTL_TEXTENCODING_UTF8 ) ); else pWindow->SetHelpId( OUStringToOString( aURL, RTL_TEXTENCODING_UTF8 ) ); diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index 289b804c27fd..fde89ee50b74 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -1865,7 +1865,7 @@ OUString getPhysicalLocation( const ::com::sun::star::uno::Any& rbase, const ::c const INetURLObject protocolCheck( url ); const INetProtocol protocol = protocolCheck.GetProtocol(); - if ( protocol == INET_PROT_NOT_VALID ) + if ( protocol == INetProtocol::NOT_VALID ) { OUString testAbsoluteURL; if ( ::osl::FileBase::E_None == ::osl::FileBase::getAbsoluteFileURL( baseLocation, url, testAbsoluteURL ) ) diff --git a/tools/qa/cppunit/test_urlobj.cxx b/tools/qa/cppunit/test_urlobj.cxx index 97656e4adb07..daeb3217873f 100644 --- a/tools/qa/cppunit/test_urlobj.cxx +++ b/tools/qa/cppunit/test_urlobj.cxx @@ -60,13 +60,13 @@ namespace tools_urlobj #ifdef LINUX CPPUNIT_ASSERT( aUrl.GetMainURL( INetURLObject::NO_DECODE ) == "smb://10.10.1.1/sampledir/sample.file" ); - CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_SMB ); + CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INetProtocol::SMB ); #endif #ifdef WIN CPPUNIT_ASSERT( aUrl.GetMainURL( INetURLObject::NO_DECODE ). equalsAscii ( "file://10.10.1.1/sampledir/sample.file" ) ); - CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_FILE ); + CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INetProtocol::FILE ); #endif CPPUNIT_ASSERT( aUrl.GetHost( INetURLObject::NO_DECODE ) == "10.10.1.1" ); @@ -87,12 +87,12 @@ namespace tools_urlobj #ifdef LINUX CPPUNIT_ASSERT( aUrl.GetMainURL( INetURLObject::NO_DECODE ) == "smb://137.65.170.24/c$/Img0001.jpg" ); - CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_SMB ); + CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INetProtocol::SMB ); #endif #ifdef WIN CPPUNIT_ASSERT( aUrl.GetMainURL( INetURLObject::NO_DECODE ). equalsAscii( "file://137.65.170.24/c$/Img0001.jpg" ) ); - CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_FILE ); + CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INetProtocol::FILE ); #endif CPPUNIT_ASSERT( aUrl.GetHost( INetURLObject::NO_DECODE ) == "137.65.170.24" ); @@ -113,12 +113,12 @@ namespace tools_urlobj #ifdef LINUX CPPUNIT_ASSERT( aUrl.GetMainURL( INetURLObject::NO_DECODE ) == "smb://hive-winxp-x86/pmladek/test2.odt" ); - CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_SMB ); + CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INetProtocol::SMB ); #endif #ifdef WIN CPPUNIT_ASSERT( aUrl.GetMainURL( INetURLObject::NO_DECODE ). equalsAscii( "file://hive-winxp-x86/pmladek/test2.odt" ) ); - CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_FILE ); + CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INetProtocol::FILE ); #endif CPPUNIT_ASSERT( aUrl.GetHost( INetURLObject::NO_DECODE ) == "hive-winxp-x86" ); @@ -132,12 +132,12 @@ namespace tools_urlobj #ifdef LINUX CPPUNIT_ASSERT( aUrl.GetMainURL( INetURLObject::NO_DECODE ) == "smb://10.10.1.1/sampledir/sample.file" ); - CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_SMB ); + CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INetProtocol::SMB ); #endif #ifdef WIN CPPUNIT_ASSERT( aUrl.GetMainURL( INetURLObject::NO_DECODE ). equalsAscii( "file://10.10.1.1/sampledir/sample.file" ) ); - CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_FILE ); + CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INetProtocol::FILE ); #endif CPPUNIT_ASSERT( aUrl.GetHost( INetURLObject::NO_DECODE ) == "10.10.1.1" ); @@ -156,12 +156,12 @@ namespace tools_urlobj #ifdef LINUX CPPUNIT_ASSERT( aUrl.GetMainURL( INetURLObject::NO_DECODE ) == "smb://137.65.170.24/c$/Img0001.jpg" ); - CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_SMB ); + CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INetProtocol::SMB ); #endif #ifdef WIN CPPUNIT_ASSERT( aUrl.GetMainURL( INetURLObject::NO_DECODE ). equalsAscii( "file://137.65.170.24/c$/Img0001.jpg" ) ); - CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_FILE ); + CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INetProtocol::FILE ); #endif CPPUNIT_ASSERT( aUrl.GetHost( INetURLObject::NO_DECODE ) == "137.65.170.24" ); @@ -181,12 +181,12 @@ namespace tools_urlobj #ifdef LINUX CPPUNIT_ASSERT( aUrl.GetMainURL( INetURLObject::NO_DECODE ) == "smb://hive-winxp-x86/pmladek/test2.odt" ); - CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_SMB ); + CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INetProtocol::SMB ); #endif #ifdef WIN CPPUNIT_ASSERT( aUrl.GetMainURL( INetURLObject::NO_DECODE ). equalsAscii( "file://hive-winxp-x86/pmladek/test2.odt" ) ); - CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INET_PROT_FILE ); + CPPUNIT_ASSERT( aUrl.GetProtocol( ) == INetProtocol::FILE ); #endif CPPUNIT_ASSERT( aUrl.GetHost( INetURLObject::NO_DECODE ) == "hive-winxp-x86" ); @@ -204,7 +204,7 @@ namespace tools_urlobj CPPUNIT_ASSERT_EQUAL( std::string( "username" ), OUSTR_TO_STDSTR( aUrl.GetUser( ) ) ); CPPUNIT_ASSERT_EQUAL( std::string( "/path/to/content" ), OUSTR_TO_STDSTR( aUrl.GetURLPath( INetURLObject::NO_DECODE ) ) ); - CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong protocol found", INET_PROT_CMIS, aUrl.GetProtocol( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong protocol found", INetProtocol::CMIS, aUrl.GetProtocol( ) ); } // Test without a username part @@ -216,14 +216,14 @@ namespace tools_urlobj CPPUNIT_ASSERT( !aUrl.HasUserData() ); CPPUNIT_ASSERT_EQUAL( std::string( "/path/to/content" ), OUSTR_TO_STDSTR( aUrl.GetURLPath( INetURLObject::NO_DECODE ) ) ); - CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong protocol found", INET_PROT_CMIS, aUrl.GetProtocol( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong protocol found", INetProtocol::CMIS, aUrl.GetProtocol( ) ); } } void urlobjTest_emptyPath() { { INetURLObject url(OUString("http://example.com")); - CPPUNIT_ASSERT_EQUAL(INET_PROT_HTTP, url.GetProtocol()); + CPPUNIT_ASSERT_EQUAL(INetProtocol::HTTP, url.GetProtocol()); CPPUNIT_ASSERT_EQUAL(OUString("example.com"), url.GetHost()); CPPUNIT_ASSERT_EQUAL(OUString("/"), url.GetURLPath()); } @@ -234,7 +234,7 @@ namespace tools_urlobj } { INetURLObject url(OUString("http://example.com#fragment")); - CPPUNIT_ASSERT_EQUAL(INET_PROT_HTTP, url.GetProtocol()); + CPPUNIT_ASSERT_EQUAL(INetProtocol::HTTP, url.GetProtocol()); CPPUNIT_ASSERT_EQUAL(OUString("example.com"), url.GetHost()); CPPUNIT_ASSERT_EQUAL(OUString("/"), url.GetURLPath()); CPPUNIT_ASSERT_EQUAL(OUString("fragment"), url.GetMark()); diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index f149dc1a9a41..936fa1bc6865 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -26,6 +26,7 @@ #include <tools/stream.hxx> #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/util/XStringWidth.hpp> +#include <o3tl/enumarray.hxx> #include <osl/diagnose.h> #include <osl/file.hxx> #include <rtl/character.hxx> @@ -340,80 +341,112 @@ struct INetURLObject::PrefixInfo Kind m_eKind; }; -static INetURLObject::SchemeInfo const aSchemeInfoMap[INET_PROT_END] - = { { "", "", 0, false, false, false, false, false, false, false, - false }, - { "ftp", "ftp://", 21, true, true, false, true, true, true, true, - false }, - { "http", "http://", 80, true, false, false, false, true, true, - true, true }, - { "file", "file://", 0, true, false, false, false, true, false, - true, false }, - { "mailto", "mailto:", 0, false, false, false, false, false, - false, false, true }, - { "vnd.sun.star.webdav", "vnd.sun.star.webdav://", 80, true, false, - false, false, true, true, true, true }, - { "news", "news:", 0, false, false, false, false, false, false, false, - false }, - { "private", "private:", 0, false, false, false, false, false, - false, false, true }, - { "vnd.sun.star.help", "vnd.sun.star.help://", 0, true, false, false, - false, false, false, true, true }, - { "https", "https://", 443, true, false, false, false, true, true, - true, true }, - { "slot", "slot:", 0, false, false, false, false, false, false, - false, true }, - { "macro", "macro:", 0, false, false, false, false, false, false, - false, true }, - { "javascript", "javascript:", 0, false, false, false, false, - false, false, false, false }, - { "imap", "imap://", 143, true, true, true, false, true, true, - true, false }, - { "pop3", "pop3://", 110, true, true, false, true, true, true, - false, false }, - { "data", "data:", 0, false, false, false, false, false, false, - false, false }, - { "cid", "cid:", 0, false, false, false, false, false, false, - false, false }, - { "out", "out://", 0, true, false, false, false, false, false, - false, false }, - { "vnd.sun.star.hier", "vnd.sun.star.hier:", 0, true, false, false, - false, false, false, true, false }, - { "vim", "vim://", 0, true, true, false, true, false, false, true, - false }, - { ".uno", ".uno:", 0, false, false, false, false, false, false, - false, true }, - { ".component", ".component:", 0, false, false, false, false, - false, false, false, true }, - { "vnd.sun.star.pkg", "vnd.sun.star.pkg://", 0, true, false, false, - false, false, false, true, true }, - { "ldap", "ldap://", 389, true, false, false, false, true, true, - false, true }, - { "db", "db:", 0, false, false, false, false, false, false, false, - false }, - { "vnd.sun.star.cmd", "vnd.sun.star.cmd:", 0, false, false, false, - false, false, false, false, false }, - { "telnet", "telnet://", 23, true, true, false, true, true, true, true, - false }, - { "vnd.sun.star.expand", "vnd.sun.star.expand:", 0, false, false, false, - false, false, false, false, false }, - { "vnd.sun.star.tdoc", "vnd.sun.star.tdoc:", 0, false, false, false, - false, false, false, true, false }, - { "", "", 0, false, false, false, false, true, true, true, false }, - { "smb", "smb://", 139, true, true, false, true, true, true, true, - true }, - { "hid", "hid:", 0, false, false, false, false, false, false, - false, true }, - { "sftp", "sftp://", 22, true, true, false, true, true, true, true, - true }, - { "vnd.libreoffice.cmis", "vnd.libreoffice.cmis://", 0, true, true, false, - false, true, false, true, true } }; - // static inline INetURLObject::SchemeInfo const & INetURLObject::getSchemeInfo(INetProtocol eTheScheme) { - return aSchemeInfoMap[eTheScheme]; + static o3tl::enumarray<INetProtocol, SchemeInfo> const map = { + SchemeInfo{ + "", "", 0, false, false, false, false, false, false, false, false}, + SchemeInfo{ + "ftp", "ftp://", 21, true, true, false, true, true, true, true, + false}, + SchemeInfo{ + "http", "http://", 80, true, false, false, false, true, true, true, + true}, + SchemeInfo{ + "file", "file://", 0, true, false, false, false, true, false, true, + false}, + SchemeInfo{ + "mailto", "mailto:", 0, false, false, false, false, false, false, + false, true}, + SchemeInfo{ + "vnd.sun.star.webdav", "vnd.sun.star.webdav://", 80, true, false, + false, false, true, true, true, true}, + SchemeInfo{ + "news", "news:", 0, false, false, false, false, false, false, false, + false}, + SchemeInfo{ + "private", "private:", 0, false, false, false, false, false, false, + false, true}, + SchemeInfo{ + "vnd.sun.star.help", "vnd.sun.star.help://", 0, true, false, false, + false, false, false, true, true}, + SchemeInfo{ + "https", "https://", 443, true, false, false, false, true, true, + true, true}, + SchemeInfo{ + "slot", "slot:", 0, false, false, false, false, false, false, false, + true}, + SchemeInfo{ + "macro", "macro:", 0, false, false, false, false, false, false, + false, true}, + SchemeInfo{ + "javascript", "javascript:", 0, false, false, false, false, false, + false, false, false}, + SchemeInfo{ + "imap", "imap://", 143, true, true, true, false, true, true, true, + false}, + SchemeInfo{ + "pop3", "pop3://", 110, true, true, false, true, true, true, false, + false}, + SchemeInfo{ + "data", "data:", 0, false, false, false, false, false, false, false, + false}, + SchemeInfo{ + "cid", "cid:", 0, false, false, false, false, false, false, false, + false}, + SchemeInfo{ + "out", "out://", 0, true, false, false, false, false, false, false, + false}, + SchemeInfo{ + "vnd.sun.star.hier", "vnd.sun.star.hier:", 0, true, false, false, + false, false, false, true, false}, + SchemeInfo{ + "vim", "vim://", 0, true, true, false, true, false, false, true, + false}, + SchemeInfo{ + ".uno", ".uno:", 0, false, false, false, false, false, false, false, + true}, + SchemeInfo{ + ".component", ".component:", 0, false, false, false, false, false, + false, false, true}, + SchemeInfo{ + "vnd.sun.star.pkg", "vnd.sun.star.pkg://", 0, true, false, false, + false, false, false, true, true}, + SchemeInfo{ + "ldap", "ldap://", 389, true, false, false, false, true, true, + false, true}, + SchemeInfo{ + "db", "db:", 0, false, false, false, false, false, false, false, + false}, + SchemeInfo{ + "vnd.sun.star.cmd", "vnd.sun.star.cmd:", 0, false, false, false, + false, false, false, false, false}, + SchemeInfo{ + "telnet", "telnet://", 23, true, true, false, true, true, true, + true, false}, + SchemeInfo{ + "vnd.sun.star.expand", "vnd.sun.star.expand:", 0, false, false, + false, false, false, false, false, false}, + SchemeInfo{ + "vnd.sun.star.tdoc", "vnd.sun.star.tdoc:", 0, false, false, false, + false, false, false, true, false}, + SchemeInfo{ + "", "", 0, false, false, false, false, true, true, true, false }, + SchemeInfo{ + "smb", "smb://", 139, true, true, false, true, true, true, true, + true}, + SchemeInfo{ + "hid", "hid:", 0, false, false, false, false, false, false, false, + true}, + SchemeInfo{ + "sftp", "sftp://", 22, true, true, false, true, true, true, true, + true}, + SchemeInfo{ + "vnd.libreoffice.cmis", "vnd.libreoffice.cmis://", 0, true, true, + false, false, true, false, true, true} }; + return map[eTheScheme]; }; inline INetURLObject::SchemeInfo const & INetURLObject::getSchemeInfo() const @@ -566,7 +599,7 @@ inline bool mustEncode(sal_uInt32 nUTF32, INetURLObject::Part ePart) void INetURLObject::setInvalid() { m_aAbsURIRef.setLength(0); - m_eScheme = INET_PROT_NOT_VALID; + m_eScheme = INetProtocol::NOT_VALID; m_aScheme.clear(); m_aUser.clear(); m_aAuth.clear(); @@ -596,7 +629,7 @@ std::unique_ptr<SvMemoryStream> memoryStream( std::unique_ptr<SvMemoryStream> INetURLObject::getData() { - if( GetProtocol() != INET_PROT_DATA ) + if( GetProtocol() != INetProtocol::DATA ) { return nullptr; } @@ -773,7 +806,7 @@ bool INetURLObject::setAbsURIRef(OUString const & rTheAbsURIRef, && p1[1] == ':' && (pEnd - p1 == 2 || p1[2] == '/' || p1[2] == '\\')) { - m_eScheme = INET_PROT_FILE; // 8th, 9th + m_eScheme = INetProtocol::FILE; // 8th, 9th eMechanism = ENCODE_ALL; nFragmentDelimiter = 0x80000000; } @@ -782,11 +815,11 @@ bool INetURLObject::setAbsURIRef(OUString const & rTheAbsURIRef, p1 += 2; if ((scanDomain(p1, pEnd) > 0 || scanIPv6reference(p1, pEnd)) && (p1 == pEnd || *p1 == '/')) - m_eScheme = INET_PROT_FILE; // 5th + m_eScheme = INetProtocol::FILE; // 5th } else if (p1 != pEnd && *p1 == '/') { - m_eScheme = INET_PROT_FILE; // 6th + m_eScheme = INetProtocol::FILE; // 6th eMechanism = ENCODE_ALL; nFragmentDelimiter = 0x80000000; } @@ -806,7 +839,7 @@ bool INetURLObject::setAbsURIRef(OUString const & rTheAbsURIRef, (scanDomain(p1, pe) > 0 && p1 == pe) ) { - m_eScheme = INET_PROT_FILE; // 7th + m_eScheme = INetProtocol::FILE; // 7th eMechanism = ENCODE_ALL; nFragmentDelimiter = 0x80000000; } @@ -820,7 +853,7 @@ bool INetURLObject::setAbsURIRef(OUString const & rTheAbsURIRef, ++pDomainEnd; if (scanDomain(pDomainEnd, pEnd) > 0 && pDomainEnd == pEnd) - m_eScheme = INET_PROT_MAILTO; // 2nd + m_eScheme = INetProtocol::MAILTO; // 2nd } else if (nLabels >= 3 && (pDomainEnd == pEnd || *pDomainEnd == '/')) @@ -830,34 +863,34 @@ bool INetURLObject::setAbsURIRef(OUString const & rTheAbsURIRef, && (p1[1] == 't' || p1[1] == 'T') && (p1[2] == 'p' || p1[2] == 'P') && p1[3] == '.' ? - INET_PROT_FTP : INET_PROT_HTTP; // 3rd, 4th + INetProtocol::FTP : INetProtocol::HTTP; // 3rd, 4th } } OUString aSynScheme; - if (m_eScheme == INET_PROT_NOT_VALID) { + if (m_eScheme == INetProtocol::NOT_VALID) { sal_Unicode const * p1 = pPos; aSynScheme = parseScheme(&p1, pEnd, nFragmentDelimiter); if (!aSynScheme.isEmpty()) { - m_eScheme = INET_PROT_GENERIC; + m_eScheme = INetProtocol::GENERIC; pPos = p1; } } - if (bSmart && m_eScheme == INET_PROT_NOT_VALID && pPos != pEnd + if (bSmart && m_eScheme == INetProtocol::NOT_VALID && pPos != pEnd && *pPos != nFragmentDelimiter) { m_eScheme = m_eSmartScheme; } - if (m_eScheme == INET_PROT_NOT_VALID) + if (m_eScheme == INetProtocol::NOT_VALID) { setInvalid(); return false; } - if (m_eScheme != INET_PROT_GENERIC) { + if (m_eScheme != INetProtocol::GENERIC) { aSynScheme = OUString::createFromAscii(getSchemeInfo().m_pScheme); } m_aScheme.set(aSynAbsURIRef, aSynScheme, aSynAbsURIRef.getLength()); @@ -881,7 +914,7 @@ bool INetURLObject::setAbsURIRef(OUString const & rTheAbsURIRef, switch (m_eScheme) { - case INET_PROT_VND_SUN_STAR_HELP: + case INetProtocol::VND_SUN_STAR_HELP: { if (pEnd - pPos < 2 || *pPos++ != '/' || *pPos++ != '/') { @@ -909,7 +942,7 @@ bool INetURLObject::setAbsURIRef(OUString const & rTheAbsURIRef, break; } - case INET_PROT_VND_SUN_STAR_HIER: + case INetProtocol::VND_SUN_STAR_HIER: { if (pEnd - pPos >= 2 && pPos[0] == '/' && pPos[1] == '/') { @@ -950,8 +983,8 @@ bool INetURLObject::setAbsURIRef(OUString const & rTheAbsURIRef, break; } - case INET_PROT_VND_SUN_STAR_PKG: - case INET_PROT_CMIS: + case INetProtocol::VND_SUN_STAR_PKG: + case INetProtocol::CMIS: { if (pEnd - pPos < 2 || *pPos++ != '/' || *pPos++ != '/') { @@ -1015,7 +1048,7 @@ bool INetURLObject::setAbsURIRef(OUString const & rTheAbsURIRef, break; } - case INET_PROT_FILE: + case INetProtocol::FILE: if (bSmart) { // The first of the following seven productions that @@ -1197,14 +1230,14 @@ bool INetURLObject::setAbsURIRef(OUString const & rTheAbsURIRef, } default: { - // For INET_PROT_FILE, allow an empty authority ("//") to be + // For INetProtocol::FILE, allow an empty authority ("//") to be // missing if the following path starts with an explicit "/" // (Java is notorious in generating such file URLs, so be // liberal here): if (pEnd - pPos >= 2 && pPos[0] == '/' && pPos[1] == '/') pPos += 2; else if (!bSmart - && !(m_eScheme == INET_PROT_FILE + && !(m_eScheme == INetProtocol::FILE && pPos != pEnd && *pPos == '/')) { setInvalid(); @@ -1257,9 +1290,9 @@ bool INetURLObject::setAbsURIRef(OUString const & rTheAbsURIRef, if (pUserInfoBegin) { - Part ePart = m_eScheme == INET_PROT_IMAP ? + Part ePart = m_eScheme == INetProtocol::IMAP ? PART_IMAP_ACHAR : - m_eScheme == INET_PROT_VIM ? + m_eScheme == INetProtocol::VIM ? PART_VIM : PART_USER_PASSWORD; bool bSupportsPassword = getSchemeInfo().m_bPassword; @@ -1359,7 +1392,7 @@ bool INetURLObject::setAbsURIRef(OUString const & rTheAbsURIRef, bool bNetBiosName = false; switch (m_eScheme) { - case INET_PROT_FILE: + case INetProtocol::FILE: // If the host equals "LOCALHOST" (unencoded and ignoring // case), turn it into an empty host: if (INetMIME::equalIgnoreCase(pHostPortBegin, pPort, @@ -1368,8 +1401,8 @@ bool INetURLObject::setAbsURIRef(OUString const & rTheAbsURIRef, bNetBiosName = true; break; - case INET_PROT_LDAP: - case INET_PROT_SMB: + case INetProtocol::LDAP: + case INetProtocol::SMB: if (pHostPortBegin == pPort && pPort != pHostPortEnd) { setInvalid(); @@ -1463,20 +1496,20 @@ bool INetURLObject::setAbsURIRef(OUString const & rTheAbsURIRef, // At this point references of type "\\server\paths" have // been converted to file:://server/path". #ifdef LINUX - if (m_eScheme==INET_PROT_FILE && !m_aHost.isEmpty()) { + if (m_eScheme==INetProtocol::FILE && !m_aHost.isEmpty()) { // Change "file:://server/path" URIs to "smb:://server/path" on // Linux // Leave "file::path" URIs unchanged. - changeScheme(INET_PROT_SMB); + changeScheme(INetProtocol::SMB); } #endif #ifdef WIN - if (m_eScheme==INET_PROT_SMB) { + if (m_eScheme==INetProtocol::SMB) { // Change "smb://server/path" URIs to "file://server/path" // URIs on Windows, since Windows doesn't understand the // SMB scheme. - changeScheme(INET_PROT_FILE); + changeScheme(INetProtocol::FILE); } #endif @@ -1587,7 +1620,7 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef, // When the base URL is a file URL, accept relative file system paths // using "\" or ":" as delimiter (and ignoring URI conventions for "%" // and "#"), as well as relative URIs using "/" as delimiter: - if (m_eScheme == INET_PROT_FILE) + if (m_eScheme == INetProtocol::FILE) switch (guessFSysStyleByCounting(p, pEnd, eStyle)) { case FSYS_UNX: @@ -1648,7 +1681,7 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef, OUStringBuffer aSynAbsURIRef; // make sure that the scheme is copied for generic schemes: getSchemeInfo().m_pScheme // is empty ("") in that case, so take the scheme from m_aAbsURIRef - if (m_eScheme != INET_PROT_GENERIC) + if (m_eScheme != INetProtocol::GENERIC) { aSynAbsURIRef.appendAscii(getSchemeInfo().m_pScheme); } @@ -1996,7 +2029,7 @@ bool INetURLObject::convertAbsToRel(OUString const & rTheAbsURIRef, // If the two URLs are DOS file URLs starting with different volumes // (e.g., file:///a:/... and file:///b:/...), the subject is not made // relative (it could be, but some people do not like that): - if (m_eScheme == INET_PROT_FILE + if (m_eScheme == INetProtocol::FILE && nMatch <= 1 && hasDosVolume(eStyle) && aSubject.hasDosVolume(eStyle)) //TODO! ok to use eStyle for these? @@ -2130,95 +2163,95 @@ INetURLObject::PrefixInfo const * INetURLObject::getPrefix(sal_Unicode const *& { static PrefixInfo const aMap[] = { // dummy entry at front needed, because pLast may point here: - { 0, 0, INET_PROT_NOT_VALID, PrefixInfo::INTERNAL }, - { ".component:", "staroffice.component:", INET_PROT_COMPONENT, + { 0, 0, INetProtocol::NOT_VALID, PrefixInfo::INTERNAL }, + { ".component:", "staroffice.component:", INetProtocol::COMPONENT, PrefixInfo::INTERNAL }, - { ".uno:", "staroffice.uno:", INET_PROT_UNO, + { ".uno:", "staroffice.uno:", INetProtocol::UNO, PrefixInfo::INTERNAL }, - { "cid:", 0, INET_PROT_CID, PrefixInfo::OFFICIAL }, - { "data:", 0, INET_PROT_DATA, PrefixInfo::OFFICIAL }, - { "db:", "staroffice.db:", INET_PROT_DB, PrefixInfo::INTERNAL }, - { "file:", 0, INET_PROT_FILE, PrefixInfo::OFFICIAL }, - { "ftp:", 0, INET_PROT_FTP, PrefixInfo::OFFICIAL }, - { "hid:", "staroffice.hid:", INET_PROT_HID, + { "cid:", 0, INetProtocol::CID, PrefixInfo::OFFICIAL }, + { "data:", 0, INetProtocol::DATA, PrefixInfo::OFFICIAL }, + { "db:", "staroffice.db:", INetProtocol::DB, PrefixInfo::INTERNAL }, + { "file:", 0, INetProtocol::FILE, PrefixInfo::OFFICIAL }, + { "ftp:", 0, INetProtocol::FTP, PrefixInfo::OFFICIAL }, + { "hid:", "staroffice.hid:", INetProtocol::HID, PrefixInfo::INTERNAL }, - { "http:", 0, INET_PROT_HTTP, PrefixInfo::OFFICIAL }, - { "https:", 0, INET_PROT_HTTPS, PrefixInfo::OFFICIAL }, - { "imap:", 0, INET_PROT_IMAP, PrefixInfo::OFFICIAL }, - { "javascript:", 0, INET_PROT_JAVASCRIPT, PrefixInfo::OFFICIAL }, - { "ldap:", 0, INET_PROT_LDAP, PrefixInfo::OFFICIAL }, - { "macro:", "staroffice.macro:", INET_PROT_MACRO, + { "http:", 0, INetProtocol::HTTP, PrefixInfo::OFFICIAL }, + { "https:", 0, INetProtocol::HTTPS, PrefixInfo::OFFICIAL }, + { "imap:", 0, INetProtocol::IMAP, PrefixInfo::OFFICIAL }, + { "javascript:", 0, INetProtocol::JAVASCRIPT, PrefixInfo::OFFICIAL }, + { "ldap:", 0, INetProtocol::LDAP, PrefixInfo::OFFICIAL }, + { "macro:", "staroffice.macro:", INetProtocol::MACRO, PrefixInfo::INTERNAL }, - { "mailto:", 0, INET_PROT_MAILTO, PrefixInfo::OFFICIAL }, - { "news:", 0, INET_PROT_NEWS, PrefixInfo::OFFICIAL }, - { "out:", "staroffice.out:", INET_PROT_OUT, + { "mailto:", 0, INetProtocol::MAILTO, PrefixInfo::OFFICIAL }, + { "news:", 0, INetProtocol::NEWS, PrefixInfo::OFFICIAL }, + { "out:", "staroffice.out:", INetProtocol::OUT, PrefixInfo::INTERNAL }, - { "pop3:", "staroffice.pop3:", INET_PROT_POP3, + { "pop3:", "staroffice.pop3:", INetProtocol::POP3, PrefixInfo::INTERNAL }, - { "private:", "staroffice.private:", INET_PROT_PRIV_SOFFICE, + { "private:", "staroffice.private:", INetProtocol::PRIV_SOFFICE, PrefixInfo::INTERNAL }, { "private:factory/", "staroffice.factory:", - INET_PROT_PRIV_SOFFICE, PrefixInfo::INTERNAL }, - { "private:helpid/", "staroffice.helpid:", INET_PROT_PRIV_SOFFICE, + INetProtocol::PRIV_SOFFICE, PrefixInfo::INTERNAL }, + { "private:helpid/", "staroffice.helpid:", INetProtocol::PRIV_SOFFICE, PrefixInfo::INTERNAL }, - { "private:java/", "staroffice.java:", INET_PROT_PRIV_SOFFICE, + { "private:java/", "staroffice.java:", INetProtocol::PRIV_SOFFICE, PrefixInfo::INTERNAL }, { "private:searchfolder:", "staroffice.searchfolder:", - INET_PROT_PRIV_SOFFICE, PrefixInfo::INTERNAL }, + INetProtocol::PRIV_SOFFICE, PrefixInfo::INTERNAL }, { "private:trashcan:", "staroffice.trashcan:", - INET_PROT_PRIV_SOFFICE, PrefixInfo::INTERNAL }, - { "sftp:", 0, INET_PROT_SFTP, PrefixInfo::OFFICIAL }, - { "slot:", "staroffice.slot:", INET_PROT_SLOT, + INetProtocol::PRIV_SOFFICE, PrefixInfo::INTERNAL }, + { "sftp:", 0, INetProtocol::SFTP, PrefixInfo::OFFICIAL }, + { "slot:", "staroffice.slot:", INetProtocol::SLOT, PrefixInfo::INTERNAL }, - { "smb:", 0, INET_PROT_SMB, PrefixInfo::OFFICIAL }, - { "staroffice.component:", ".component:", INET_PROT_COMPONENT, + { "smb:", 0, INetProtocol::SMB, PrefixInfo::OFFICIAL }, + { "staroffice.component:", ".component:", INetProtocol::COMPONENT, PrefixInfo::EXTERNAL }, - { "staroffice.db:", "db:", INET_PROT_DB, PrefixInfo::EXTERNAL }, + { "staroffice.db:", "db:", INetProtocol::DB, PrefixInfo::EXTERNAL }, { "staroffice.factory:", "private:factory/", - INET_PROT_PRIV_SOFFICE, PrefixInfo::EXTERNAL }, - { "staroffice.helpid:", "private:helpid/", INET_PROT_PRIV_SOFFICE, + INetProtocol::PRIV_SOFFICE, PrefixInfo::EXTERNAL }, + { "staroffice.helpid:", "private:helpid/", INetProtocol::PRIV_SOFFICE, PrefixInfo::EXTERNAL }, - { "staroffice.hid:", "hid:", INET_PROT_HID, + { "staroffice.hid:", "hid:", INetProtocol::HID, PrefixInfo::EXTERNAL }, - { "staroffice.java:", "private:java/", INET_PROT_PRIV_SOFFICE, + { "staroffice.java:", "private:java/", INetProtocol::PRIV_SOFFICE, PrefixInfo::EXTERNAL }, - { "staroffice.macro:", "macro:", INET_PROT_MACRO, + { "staroffice.macro:", "macro:", INetProtocol::MACRO, PrefixInfo::EXTERNAL }, - { "staroffice.out:", "out:", INET_PROT_OUT, + { "staroffice.out:", "out:", INetProtocol::OUT, PrefixInfo::EXTERNAL }, - { "staroffice.pop3:", "pop3:", INET_PROT_POP3, + { "staroffice.pop3:", "pop3:", INetProtocol::POP3, PrefixInfo::EXTERNAL }, - { "staroffice.private:", "private:", INET_PROT_PRIV_SOFFICE, + { "staroffice.private:", "private:", INetProtocol::PRIV_SOFFICE, PrefixInfo::EXTERNAL }, { "staroffice.searchfolder:", "private:searchfolder:", - INET_PROT_PRIV_SOFFICE, PrefixInfo::EXTERNAL }, - { "staroffice.slot:", "slot:", INET_PROT_SLOT, + INetProtocol::PRIV_SOFFICE, PrefixInfo::EXTERNAL }, + { "staroffice.slot:", "slot:", INetProtocol::SLOT, PrefixInfo::EXTERNAL }, { "staroffice.trashcan:", "private:trashcan:", - INET_PROT_PRIV_SOFFICE, PrefixInfo::EXTERNAL }, - { "staroffice.uno:", ".uno:", INET_PROT_UNO, + INetProtocol::PRIV_SOFFICE, PrefixInfo::EXTERNAL }, + { "staroffice.uno:", ".uno:", INetProtocol::UNO, PrefixInfo::EXTERNAL }, - { "staroffice.vim:", "vim:", INET_PROT_VIM, + { "staroffice.vim:", "vim:", INetProtocol::VIM, PrefixInfo::EXTERNAL }, - { "staroffice:", "private:", INET_PROT_PRIV_SOFFICE, + { "staroffice:", "private:", INetProtocol::PRIV_SOFFICE, PrefixInfo::EXTERNAL }, - { "telnet:", 0, INET_PROT_TELNET, PrefixInfo::OFFICIAL }, - { "vim:", "staroffice.vim:", INET_PROT_VIM, + { "telnet:", 0, INetProtocol::TELNET, PrefixInfo::OFFICIAL }, + { "vim:", "staroffice.vim:", INetProtocol::VIM, PrefixInfo::INTERNAL }, - { "vnd.libreoffice.cmis:", 0, INET_PROT_CMIS, PrefixInfo::INTERNAL }, - { "vnd.sun.star.cmd:", 0, INET_PROT_VND_SUN_STAR_CMD, + { "vnd.libreoffice.cmis:", 0, INetProtocol::CMIS, PrefixInfo::INTERNAL }, + { "vnd.sun.star.cmd:", 0, INetProtocol::VND_SUN_STAR_CMD, PrefixInfo::OFFICIAL }, - { "vnd.sun.star.expand:", 0, INET_PROT_VND_SUN_STAR_EXPAND, + { "vnd.sun.star.expand:", 0, INetProtocol::VND_SUN_STAR_EXPAND, PrefixInfo::OFFICIAL }, - { "vnd.sun.star.help:", 0, INET_PROT_VND_SUN_STAR_HELP, + { "vnd.sun.star.help:", 0, INetProtocol::VND_SUN_STAR_HELP, PrefixInfo::OFFICIAL }, - { "vnd.sun.star.hier:", 0, INET_PROT_VND_SUN_STAR_HIER, + { "vnd.sun.star.hier:", 0, INetProtocol::VND_SUN_STAR_HIER, PrefixInfo::OFFICIAL }, - { "vnd.sun.star.pkg:", 0, INET_PROT_VND_SUN_STAR_PKG, + { "vnd.sun.star.pkg:", 0, INetProtocol::VND_SUN_STAR_PKG, PrefixInfo::OFFICIAL }, - { "vnd.sun.star.tdoc:", 0, INET_PROT_VND_SUN_STAR_TDOC, + { "vnd.sun.star.tdoc:", 0, INetProtocol::VND_SUN_STAR_TDOC, PrefixInfo::OFFICIAL }, - { "vnd.sun.star.webdav:", 0, INET_PROT_VND_SUN_STAR_WEBDAV, + { "vnd.sun.star.webdav:", 0, INetProtocol::VND_SUN_STAR_WEBDAV, PrefixInfo::OFFICIAL } }; /* This list needs to be sorted, or you'll introduce serious bugs */ @@ -2296,16 +2329,16 @@ bool INetURLObject::setUser(OUString const & rTheUser, { if ( !getSchemeInfo().m_bUser || - (m_eScheme == INET_PROT_IMAP && rTheUser.isEmpty()) + (m_eScheme == INetProtocol::IMAP && rTheUser.isEmpty()) ) { return false; } OUString aNewUser(encodeText(rTheUser, bOctets, - m_eScheme == INET_PROT_IMAP ? + m_eScheme == INetProtocol::IMAP ? PART_IMAP_ACHAR : - m_eScheme == INET_PROT_VIM ? + m_eScheme == INetProtocol::VIM ? PART_VIM : PART_USER_PASSWORD, getEscapePrefix(), eMechanism, eCharset, @@ -2365,7 +2398,7 @@ bool INetURLObject::setPassword(OUString const & rThePassword, if (!getSchemeInfo().m_bPassword) return false; OUString aNewAuth(encodeText(rThePassword, bOctets, - m_eScheme == INET_PROT_VIM ? + m_eScheme == INetProtocol::VIM ? PART_VIM : PART_USER_PASSWORD, getEscapePrefix(), eMechanism, eCharset, false)); @@ -2909,7 +2942,7 @@ bool INetURLObject::setHost(OUString const & rTheHost, bool bOctets, bool bNetBiosName = false; switch (m_eScheme) { - case INET_PROT_FILE: + case INetProtocol::FILE: { OUString sTemp(aSynHost.toString()); if (sTemp.equalsIgnoreAsciiCase("localhost")) @@ -2919,7 +2952,7 @@ bool INetURLObject::setHost(OUString const & rTheHost, bool bOctets, bNetBiosName = true; } break; - case INET_PROT_LDAP: + case INetProtocol::LDAP: if (aSynHost.isEmpty() && m_aPort.isPresent()) return false; break; @@ -2962,11 +2995,11 @@ bool INetURLObject::parsePath(INetProtocol eScheme, switch (eScheme) { - case INET_PROT_NOT_VALID: + case INetProtocol::NOT_VALID: return false; - case INET_PROT_FTP: - case INET_PROT_IMAP: + case INetProtocol::FTP: + case INetProtocol::IMAP: if (pPos < pEnd && *pPos != '/' && *pPos != nFragmentDelimiter) return false; while (pPos < pEnd && *pPos != nFragmentDelimiter) @@ -2982,11 +3015,11 @@ bool INetURLObject::parsePath(INetProtocol eScheme, aTheSynPath.append('/'); break; - case INET_PROT_HTTP: - case INET_PROT_VND_SUN_STAR_WEBDAV: - case INET_PROT_HTTPS: - case INET_PROT_SMB: - case INET_PROT_CMIS: + case INetProtocol::HTTP: + case INetProtocol::VND_SUN_STAR_WEBDAV: + case INetProtocol::HTTPS: + case INetProtocol::SMB: + case INetProtocol::CMIS: if (pPos < pEnd && *pPos != '/' && *pPos != nFragmentDelimiter) return false; while (pPos < pEnd && *pPos != nQueryDelimiter @@ -3003,7 +3036,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme, aTheSynPath.append('/'); break; - case INET_PROT_FILE: + case INetProtocol::FILE: { if (bSkippedInitialSlash) aTheSynPath.append('/'); @@ -3047,7 +3080,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme, break; } - case INET_PROT_MAILTO: + case INetProtocol::MAILTO: while (pPos < pEnd && *pPos != nQueryDelimiter && *pPos != nFragmentDelimiter) { @@ -3060,7 +3093,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme, } break; - case INET_PROT_NEWS: + case INetProtocol::NEWS: if (pPos == pEnd || *pPos == nQueryDelimiter || *pPos == nFragmentDelimiter) return false; @@ -3128,7 +3161,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme, done: break; - case INET_PROT_POP3: + case INetProtocol::POP3: while (pPos < pEnd && *pPos != nFragmentDelimiter) { EscapeType eEscapeType; @@ -3141,13 +3174,13 @@ bool INetURLObject::parsePath(INetProtocol eScheme, } break; - case INET_PROT_PRIV_SOFFICE: - case INET_PROT_SLOT: - case INET_PROT_HID: - case INET_PROT_MACRO: - case INET_PROT_UNO: - case INET_PROT_COMPONENT: - case INET_PROT_LDAP: + case INetProtocol::PRIV_SOFFICE: + case INetProtocol::SLOT: + case INetProtocol::HID: + case INetProtocol::MACRO: + case INetProtocol::UNO: + case INetProtocol::COMPONENT: + case INetProtocol::LDAP: while (pPos < pEnd && *pPos != nQueryDelimiter && *pPos != nFragmentDelimiter) { @@ -3161,7 +3194,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme, } break; - case INET_PROT_VND_SUN_STAR_HELP: + case INetProtocol::VND_SUN_STAR_HELP: if (pPos == pEnd || *pPos == nQueryDelimiter || *pPos == nFragmentDelimiter) @@ -3183,10 +3216,10 @@ bool INetURLObject::parsePath(INetProtocol eScheme, } break; - case INET_PROT_JAVASCRIPT: - case INET_PROT_DATA: - case INET_PROT_CID: - case INET_PROT_DB: + case INetProtocol::JAVASCRIPT: + case INetProtocol::DATA: + case INetProtocol::CID: + case INetProtocol::DB: while (pPos < pEnd && *pPos != nFragmentDelimiter) { EscapeType eEscapeType; @@ -3198,7 +3231,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme, } break; - case INET_PROT_OUT: + case INetProtocol::OUT: if (pEnd - pPos < 2 || *pPos++ != '/' || *pPos++ != '~') return false; aTheSynPath.append("/~"); @@ -3213,8 +3246,8 @@ bool INetURLObject::parsePath(INetProtocol eScheme, } break; - case INET_PROT_VND_SUN_STAR_HIER: - case INET_PROT_VND_SUN_STAR_PKG: + case INetProtocol::VND_SUN_STAR_HIER: + case INetProtocol::VND_SUN_STAR_PKG: if (pPos < pEnd && *pPos != '/' && *pPos != nQueryDelimiter && *pPos != nFragmentDelimiter) return false; @@ -3235,7 +3268,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme, aTheSynPath.append('/'); break; - case INET_PROT_VIM: + case INetProtocol::VIM: { sal_Unicode const * pPathEnd = pPos; while (pPathEnd < pEnd && *pPathEnd != nFragmentDelimiter) @@ -3339,8 +3372,8 @@ bool INetURLObject::parsePath(INetProtocol eScheme, break; } - case INET_PROT_VND_SUN_STAR_CMD: - case INET_PROT_VND_SUN_STAR_EXPAND: + case INetProtocol::VND_SUN_STAR_CMD: + case INetProtocol::VND_SUN_STAR_EXPAND: { if (pPos == pEnd || *pPos == nFragmentDelimiter) return false; @@ -3358,7 +3391,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme, break; } - case INET_PROT_TELNET: + case INetProtocol::TELNET: if (pPos < pEnd) { if (*pPos != '/' || pEnd - pPos > 1) @@ -3368,7 +3401,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme, aTheSynPath.append('/'); break; - case INET_PROT_VND_SUN_STAR_TDOC: + case INetProtocol::VND_SUN_STAR_TDOC: if (pPos == pEnd || *pPos != '/') return false; while (pPos < pEnd && *pPos != nFragmentDelimiter) @@ -3385,8 +3418,8 @@ bool INetURLObject::parsePath(INetProtocol eScheme, } break; - case INET_PROT_GENERIC: - case INET_PROT_SFTP: + case INetProtocol::GENERIC: + case INetProtocol::SFTP: while (pPos < pEnd && *pPos != nFragmentDelimiter) { EscapeType eEscapeType; @@ -3427,7 +3460,7 @@ bool INetURLObject::setPath(OUString const & rThePath, bool bOctets, } bool INetURLObject::checkHierarchical() const { - if (m_eScheme == INET_PROT_VND_SUN_STAR_EXPAND) { + if (m_eScheme == INetProtocol::VND_SUN_STAR_EXPAND) { OSL_FAIL( "INetURLObject::checkHierarchical vnd.sun.star.expand"); return true; @@ -3760,7 +3793,7 @@ INetURLObject::getAbbreviated( OUStringBuffer aBuffer; // make sure that the scheme is copied for generic schemes: getSchemeInfo().m_pScheme // is empty ("") in that case, so take the scheme from m_aAbsURIRef - if (m_eScheme != INET_PROT_GENERIC) + if (m_eScheme != INetProtocol::GENERIC) { aBuffer.appendAscii(getSchemeInfo().m_pScheme); } @@ -3940,7 +3973,7 @@ bool INetURLObject::operator ==(INetURLObject const & rObject) const { if (m_eScheme != rObject.m_eScheme) return false; - if (m_eScheme == INET_PROT_NOT_VALID) + if (m_eScheme == INetProtocol::NOT_VALID) return m_aAbsURIRef.toString() == rObject.m_aAbsURIRef.toString(); if ((m_aScheme.compare( rObject.m_aScheme, m_aAbsURIRef, rObject.m_aAbsURIRef) @@ -3958,7 +3991,7 @@ bool INetURLObject::operator ==(INetURLObject const & rObject) const OUString aPath2(rObject.GetURLPath(NO_DECODE)); switch (m_eScheme) { - case INET_PROT_FILE: + case INetProtocol::FILE: { // If the URL paths of two file URLs only differ in that one has a // final '/' and the other has not, take the two paths as @@ -4046,7 +4079,7 @@ bool INetURLObject::ConcatData(INetProtocol eTheScheme, { setInvalid(); m_eScheme = eTheScheme; - if (HasError() || m_eScheme == INET_PROT_GENERIC) + if (HasError() || m_eScheme == INetProtocol::GENERIC) return false; m_aAbsURIRef.setLength(0); m_aAbsURIRef.appendAscii(getSchemeInfo().m_pScheme); @@ -4057,7 +4090,7 @@ bool INetURLObject::ConcatData(INetProtocol eTheScheme, bool bUserInfo = false; if (getSchemeInfo().m_bUser) { - if (m_eScheme == INET_PROT_IMAP && rTheUser.isEmpty()) + if (m_eScheme == INetProtocol::IMAP && rTheUser.isEmpty()) { setInvalid(); return false; @@ -4066,9 +4099,9 @@ bool INetURLObject::ConcatData(INetProtocol eTheScheme, { m_aUser.set(m_aAbsURIRef, encodeText(rTheUser, false, - m_eScheme == INET_PROT_IMAP ? + m_eScheme == INetProtocol::IMAP ? PART_IMAP_ACHAR : - m_eScheme == INET_PROT_VIM ? + m_eScheme == INetProtocol::VIM ? PART_VIM : PART_USER_PASSWORD, getEscapePrefix(), eMechanism, @@ -4089,7 +4122,7 @@ bool INetURLObject::ConcatData(INetProtocol eTheScheme, m_aAbsURIRef.append(':'); m_aAuth.set(m_aAbsURIRef, encodeText(rThePassword, false, - m_eScheme == INET_PROT_VIM ? + m_eScheme == INetProtocol::VIM ? PART_VIM : PART_USER_PASSWORD, getEscapePrefix(), eMechanism, eCharset, false), @@ -4110,7 +4143,7 @@ bool INetURLObject::ConcatData(INetProtocol eTheScheme, bool bNetBiosName = false; switch (m_eScheme) { - case INET_PROT_FILE: + case INetProtocol::FILE: { OUString sTemp(aSynHost.toString()); if (sTemp.equalsIgnoreAsciiCase( "localhost" )) @@ -4121,7 +4154,7 @@ bool INetURLObject::ConcatData(INetProtocol eTheScheme, } break; - case INET_PROT_LDAP: + case INetProtocol::LDAP: if (aSynHost.isEmpty() && nThePort != 0) { setInvalid(); @@ -4237,7 +4270,7 @@ INetProtocol INetURLObject::CompareProtocolScheme(OUString const & { sal_Unicode const * p = rTheAbsURIRef.getStr(); PrefixInfo const * pPrefix = getPrefix(p, p + rTheAbsURIRef.getLength()); - return pPrefix ? pPrefix->m_eScheme : INET_PROT_NOT_VALID; + return pPrefix ? pPrefix->m_eScheme : INetProtocol::NOT_VALID; } OUString INetURLObject::GetHostPort(DecodeMechanism eMechanism, @@ -4785,7 +4818,7 @@ bool INetURLObject::setFSysPath(OUString const & rFSysPath, OUString INetURLObject::getFSysPath(FSysStyle eStyle, sal_Unicode * pDelimiter) const { - if (m_eScheme != INET_PROT_FILE) + if (m_eScheme != INetProtocol::FILE) return OUString(); if ((eStyle & FSYS_VOS ? 1 : 0) @@ -4880,7 +4913,7 @@ OUString INetURLObject::getFSysPath(FSysStyle eStyle, OUString INetURLObject::GetMsgId(DecodeMechanism eMechanism, rtl_TextEncoding eCharset) const { - if (m_eScheme != INET_PROT_POP3) + if (m_eScheme != INetProtocol::POP3) return OUString(); sal_Unicode const * p = m_aAbsURIRef.getStr() + m_aPath.getBegin(); sal_Unicode const * pEnd = p + m_aPath.getLength(); @@ -5256,7 +5289,7 @@ bool INetURLObject::CutLastName() OUString INetURLObject::PathToFileName() const { - if (m_eScheme != INET_PROT_FILE) + if (m_eScheme != INetProtocol::FILE) return OUString(); OUString aSystemPath; if (osl::FileBase::getSystemPathFromFileURL( diff --git a/ucb/source/core/FileAccess.cxx b/ucb/source/core/FileAccess.cxx index 1632cfd9d83a..fb8fcf58312c 100644 --- a/ucb/source/core/FileAccess.cxx +++ b/ucb/source/core/FileAccess.cxx @@ -225,8 +225,8 @@ void OFileAccess::transferImpl( const OUString& rSource, throw(CommandAbortedException, Exception, RuntimeException) { // SfxContentHelper::Transfer_Impl - INetURLObject aSourceObj( rSource, INET_PROT_FILE ); - INetURLObject aDestObj( rDest, INET_PROT_FILE ); + INetURLObject aSourceObj( rSource, INetProtocol::FILE ); + INetURLObject aDestObj( rDest, INetProtocol::FILE ); OUString aName = aDestObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ); OUString aDestURL; @@ -245,7 +245,7 @@ void OFileAccess::transferImpl( const OUString& rSource, // #i29648# - if ( aDestObj.GetProtocol() == INET_PROT_VND_SUN_STAR_EXPAND ) + if ( aDestObj.GetProtocol() == INetProtocol::VND_SUN_STAR_EXPAND ) { // Hack: Expand destination URL using Macro Expander and try again // with the hopefully hierarchical expanded URL... @@ -308,7 +308,7 @@ void OFileAccess::kill( const OUString& FileURL ) throw(CommandAbortedException, Exception, RuntimeException, std::exception) { // SfxContentHelper::Kill - INetURLObject aDeleteObj( FileURL, INET_PROT_FILE ); + INetURLObject aDeleteObj( FileURL, INetProtocol::FILE ); ucbhelper::Content aCnt( aDeleteObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment, comphelper::getProcessComponentContext() ); try { @@ -326,7 +326,7 @@ sal_Bool OFileAccess::isFolder( const OUString& FileURL ) bool bRet = false; try { - INetURLObject aURLObj( FileURL, INET_PROT_FILE ); + INetURLObject aURLObj( FileURL, INetProtocol::FILE ); ucbhelper::Content aCnt( aURLObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment, comphelper::getProcessComponentContext() ); bRet = aCnt.isFolder(); } @@ -337,7 +337,7 @@ sal_Bool OFileAccess::isFolder( const OUString& FileURL ) sal_Bool OFileAccess::isReadOnly( const OUString& FileURL ) throw(CommandAbortedException, Exception, RuntimeException, std::exception) { - INetURLObject aURLObj( FileURL, INET_PROT_FILE ); + INetURLObject aURLObj( FileURL, INetProtocol::FILE ); ucbhelper::Content aCnt( aURLObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment, comphelper::getProcessComponentContext() ); Any aRetAny = aCnt.getPropertyValue("IsReadOnly"); bool bRet = false; @@ -348,7 +348,7 @@ sal_Bool OFileAccess::isReadOnly( const OUString& FileURL ) void OFileAccess::setReadOnly( const OUString& FileURL, sal_Bool bReadOnly ) throw(CommandAbortedException, Exception, RuntimeException, std::exception) { - INetURLObject aURLObj( FileURL, INET_PROT_FILE ); + INetURLObject aURLObj( FileURL, INetProtocol::FILE ); ucbhelper::Content aCnt( aURLObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment, comphelper::getProcessComponentContext() ); Any aAny; aAny <<= bReadOnly; @@ -363,7 +363,7 @@ void OFileAccess::createFolder( const OUString& NewFolderURL ) return; // SfxContentHelper::MakeFolder - INetURLObject aURL( NewFolderURL, INET_PROT_FILE ); + INetURLObject aURL( NewFolderURL, INetProtocol::FILE ); OUString aTitle = aURL.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ); if ( !aTitle.isEmpty() ) { @@ -429,7 +429,7 @@ sal_Int32 OFileAccess::getSize( const OUString& FileURL ) // SfxContentHelper::GetSize sal_Int32 nSize = 0; sal_Int64 nTemp = 0; - INetURLObject aObj( FileURL, INET_PROT_FILE ); + INetURLObject aObj( FileURL, INetProtocol::FILE ); ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment, comphelper::getProcessComponentContext() ); aCnt.getPropertyValue( "Size" ) >>= nTemp; nSize = (sal_Int32)nTemp; @@ -439,7 +439,7 @@ sal_Int32 OFileAccess::getSize( const OUString& FileURL ) OUString OFileAccess::getContentType( const OUString& FileURL ) throw(CommandAbortedException, Exception, RuntimeException, std::exception) { - INetURLObject aObj( FileURL, INET_PROT_FILE ); + INetURLObject aObj( FileURL, INetProtocol::FILE ); ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment, comphelper::getProcessComponentContext() ); Reference< XContent > xContent = aCnt.get(); @@ -450,7 +450,7 @@ OUString OFileAccess::getContentType( const OUString& FileURL ) ::com::sun::star::util::DateTime OFileAccess::getDateTimeModified( const OUString& FileURL ) throw(CommandAbortedException, Exception, RuntimeException, std::exception) { - INetURLObject aFileObj( FileURL, INET_PROT_FILE ); + INetURLObject aFileObj( FileURL, INetProtocol::FILE ); ::com::sun::star::util::DateTime aDateTime; Reference< XCommandEnvironment > aCmdEnv; @@ -467,7 +467,7 @@ Sequence< OUString > OFileAccess::getFolderContents( const OUString& FolderURL, // SfxContentHelper::GetFolderContents StringList_Impl* pFiles = NULL; - INetURLObject aFolderObj( FolderURL, INET_PROT_FILE ); + INetURLObject aFolderObj( FolderURL, INetProtocol::FILE ); ucbhelper::Content aCnt( aFolderObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment, comphelper::getProcessComponentContext() ); Reference< XResultSet > xResultSet; @@ -492,7 +492,7 @@ Sequence< OUString > OFileAccess::getFolderContents( const OUString& FolderURL, while ( xResultSet->next() ) { OUString aId = xContentAccess->queryContentIdentifierString(); - INetURLObject aURL( aId, INET_PROT_FILE ); + INetURLObject aURL( aId, INetProtocol::FILE ); OUString* pFile = new OUString( aURL.GetMainURL( INetURLObject::NO_DECODE ) ); pFiles->push_back( pFile ); } @@ -540,7 +540,7 @@ Reference< XInputStream > OFileAccess::openFileRead( const OUString& FileURL ) throw(CommandAbortedException, Exception, RuntimeException, std::exception) { Reference< XInputStream > xRet; - INetURLObject aObj( FileURL, INET_PROT_FILE ); + INetURLObject aObj( FileURL, INetProtocol::FILE ); ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment, comphelper::getProcessComponentContext() ); Reference< XActiveDataSink > xSink = (XActiveDataSink*)(new OActiveDataSink()); @@ -584,7 +584,7 @@ Reference< XStream > OFileAccess::openFileReadWrite( const OUString& FileURL ) Any aCmdArg; aCmdArg <<= aArg; - INetURLObject aFileObj( FileURL, INET_PROT_FILE ); + INetURLObject aFileObj( FileURL, INetProtocol::FILE ); ucbhelper::Content aCnt( aFileObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment, comphelper::getProcessComponentContext() ); // Be silent... @@ -703,7 +703,7 @@ void SAL_CALL OFileAccess::writeFile( const OUString& FileURL, const Reference< XInputStream >& data ) throw ( Exception, RuntimeException, std::exception ) { - INetURLObject aURL( FileURL, INET_PROT_FILE ); + INetURLObject aURL( FileURL, INetProtocol::FILE ); try { ucbhelper::Content aCnt( @@ -753,7 +753,7 @@ void SAL_CALL OFileAccess::writeFile( const OUString& FileURL, sal_Bool OFileAccess::isHidden( const OUString& FileURL ) throw(CommandAbortedException, Exception, RuntimeException, std::exception) { - INetURLObject aURLObj( FileURL, INET_PROT_FILE ); + INetURLObject aURLObj( FileURL, INetProtocol::FILE ); ucbhelper::Content aCnt( aURLObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment, comphelper::getProcessComponentContext() ); Any aRetAny = aCnt.getPropertyValue("IsHidden"); bool bRet = false; @@ -764,7 +764,7 @@ sal_Bool OFileAccess::isHidden( const OUString& FileURL ) void OFileAccess::setHidden( const OUString& FileURL, sal_Bool bHidden ) throw(CommandAbortedException, Exception, RuntimeException, std::exception) { - INetURLObject aURLObj( FileURL, INET_PROT_FILE ); + INetURLObject aURLObj( FileURL, INetProtocol::FILE ); ucbhelper::Content aCnt( aURLObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment, comphelper::getProcessComponentContext() ); Any aAny; aAny <<= bHidden; diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index 6b542e6d47eb..5ab655ddb35c 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -1183,7 +1183,7 @@ namespace cmis { // If the source isn't on the same CMIS repository, then simply copy INetURLObject aSourceUrl( rTransferInfo.SourceURL ); - if ( aSourceUrl.GetProtocol() != INET_PROT_CMIS ) + if ( aSourceUrl.GetProtocol() != INetProtocol::CMIS ) { OUString sSrcBindingUrl = URL( rTransferInfo.SourceURL ).getBindingUrl( ); if ( sSrcBindingUrl != m_aURL.getBindingUrl( ) ) diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx index 4473397b2ea9..cadf02f3904f 100644 --- a/unotools/source/config/pathoptions.cxx +++ b/unotools/source/config/pathoptions.cxx @@ -299,7 +299,7 @@ OUString SvtPathOptions_Impl::ExpandMacros( const OUString& rPath ) const OUString sExpanded( rPath ); const INetURLObject aParser( rPath ); - if ( aParser.GetProtocol() == INET_PROT_VND_SUN_STAR_EXPAND ) + if ( aParser.GetProtocol() == INetProtocol::VND_SUN_STAR_EXPAND ) sExpanded = m_xMacroExpander->expandMacros( aParser.GetURLPath( INetURLObject::DECODE_WITH_CHARSET ) ); return sExpanded; @@ -795,7 +795,7 @@ bool SvtPathOptions::SearchFile( OUString& rIniFile, Paths ePath ) if ( LocalFileHelper::ConvertPhysicalNameToURL( aPathToken, aURL ) ) aObj.SetURL( aURL ); } - if ( aObj.GetProtocol() == INET_PROT_VND_SUN_STAR_EXPAND ) + if ( aObj.GetProtocol() == INetProtocol::VND_SUN_STAR_EXPAND ) { Reference< XMacroExpander > xMacroExpander = theMacroExpander::get( ::comphelper::getProcessComponentContext() ); const OUString sExpandedPath = xMacroExpander->expandMacros( aObj.GetURLPath( INetURLObject::DECODE_WITH_CHARSET ) ); diff --git a/unotools/source/config/securityoptions.cxx b/unotools/source/config/securityoptions.cxx index 3c00b0eb46ce..33c90f6122e4 100644 --- a/unotools/source/config/securityoptions.cxx +++ b/unotools/source/config/securityoptions.cxx @@ -999,14 +999,14 @@ bool SvtSecurityOptions::isSecureMacroUri( OUString const & uri, OUString const & referer) const { switch (INetURLObject(uri).GetProtocol()) { - case INET_PROT_MACRO: + case INetProtocol::MACRO: if (uri.startsWithIgnoreAsciiCase("macro:///")) { // Denotes an App-BASIC macro (see SfxMacroLoader::loadMacro), which // is considered safe: return true; } // fall through - case INET_PROT_SLOT: + case INetProtocol::SLOT: return referer.equalsIgnoreAsciiCase("private:user") || isTrustedLocationUri(referer); default: diff --git a/unotools/source/ucbhelper/ucbhelper.cxx b/unotools/source/ucbhelper/ucbhelper.cxx index ec00faf062b0..39bd6fefb142 100644 --- a/unotools/source/ucbhelper/ucbhelper.cxx +++ b/unotools/source/ucbhelper/ucbhelper.cxx @@ -408,7 +408,7 @@ bool utl::UCBContentHelper::IsSubPath( INetURLObject tmp; do { if (candidate == folder - || (candidate.GetProtocol() == INET_PROT_FILE + || (candidate.GetProtocol() == INetProtocol::FILE && candidateLower == folderLower && (getCasePreservingUrl(candidate) == getCasePreservingUrl(folder)))) diff --git a/vbahelper/source/vbahelper/vbadocumentsbase.cxx b/vbahelper/source/vbahelper/vbadocumentsbase.cxx index 849bbd97e092..c4d515868d64 100644 --- a/vbahelper/source/vbahelper/vbadocumentsbase.cxx +++ b/vbahelper/source/vbahelper/vbadocumentsbase.cxx @@ -278,7 +278,7 @@ uno::Any VbaDocumentsBase::openDocument( const OUString& rFileName, const uno::A OUString aURL; INetURLObject aObj; aObj.SetURL( rFileName ); - bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; + bool bIsURL = aObj.GetProtocol() != INetProtocol::NOT_VALID; if ( bIsURL ) aURL = rFileName; else diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 907205258112..69f566e5eb7b 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -1282,7 +1282,7 @@ sal_uInt16 GraphicFilter::CanImportGraphic( const INetURLObject& rPath, sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat ) { sal_uInt16 nRetValue = GRFILTER_FORMATERROR; - DBG_ASSERT( rPath.GetProtocol() != INET_PROT_NOT_VALID, "GraphicFilter::CanImportGraphic() : ProtType == INET_PROT_NOT_VALID" ); + DBG_ASSERT( rPath.GetProtocol() != INetProtocol::NOT_VALID, "GraphicFilter::CanImportGraphic() : ProtType == INetProtocol::NOT_VALID" ); OUString aMainUrl( rPath.GetMainURL( INetURLObject::NO_DECODE ) ); std::unique_ptr<SvStream> xStream(::utl::UcbStreamHelper::CreateStream( aMainUrl, StreamMode::READ | StreamMode::SHARE_DENYNONE )); @@ -1312,7 +1312,7 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const INetURLObject& sal_uInt16 nFormat, sal_uInt16 * pDeterminedFormat, sal_uInt32 nImportFlags ) { sal_uInt16 nRetValue = GRFILTER_FORMATERROR; - DBG_ASSERT( rPath.GetProtocol() != INET_PROT_NOT_VALID, "GraphicFilter::ImportGraphic() : ProtType == INET_PROT_NOT_VALID" ); + DBG_ASSERT( rPath.GetProtocol() != INetProtocol::NOT_VALID, "GraphicFilter::ImportGraphic() : ProtType == INetProtocol::NOT_VALID" ); OUString aMainUrl( rPath.GetMainURL( INetURLObject::NO_DECODE ) ); std::unique_ptr<SvStream> xStream(::utl::UcbStreamHelper::CreateStream( aMainUrl, StreamMode::READ | StreamMode::SHARE_DENYNONE )); @@ -1804,7 +1804,7 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const INetURLO #else SAL_INFO( "vcl.filter", "GraphicFilter::ExportGraphic() (thb)" ); sal_uInt16 nRetValue = GRFILTER_FORMATERROR; - DBG_ASSERT( rPath.GetProtocol() != INET_PROT_NOT_VALID, "GraphicFilter::ExportGraphic() : ProtType == INET_PROT_NOT_VALID" ); + DBG_ASSERT( rPath.GetProtocol() != INetProtocol::NOT_VALID, "GraphicFilter::ExportGraphic() : ProtType == INetProtocol::NOT_VALID" ); bool bAlreadyExists = DirEntryExists( rPath ); OUString aMainUrl( rPath.GetMainURL( INetURLObject::NO_DECODE ) ); @@ -2254,12 +2254,12 @@ int GraphicFilter::LoadGraphic( const OUString &rPath, const OUString &rFilterNa INetURLObject aURL( rPath ); if ( aURL.HasError() ) { - aURL.SetSmartProtocol( INET_PROT_FILE ); + aURL.SetSmartProtocol( INetProtocol::FILE ); aURL.SetSmartURL( rPath ); } SvStream* pStream = NULL; - if ( INET_PROT_FILE != aURL.GetProtocol() ) + if ( INetProtocol::FILE != aURL.GetProtocol() ) { pStream = ::utl::UcbStreamHelper::CreateStream( rPath, StreamMode::READ ); } diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index eabf0c1b8c1d..b6e1a65f63a0 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -4504,7 +4504,7 @@ we check in the following sequence: // check if the protocol is a known one, or if there is no protocol at all (on target only) // if there is no protocol, make the target relative to the current document directory // getting the needed URL information from the current document path - if( eTargetProtocol == INET_PROT_NOT_VALID ) + if( eTargetProtocol == INetProtocol::NOT_VALID ) { if( rLink.m_aURL.getLength() > 4 && rLink.m_aURL.startsWith("\\\\\\\\")) { @@ -4571,7 +4571,7 @@ we check in the following sequence: bool bSetRelative = false; bool bFileSpec = false; //check if relative file link is requested and if the protocol is 'file://' - if( m_aContext.RelFsys && eBaseProtocol == eTargetProtocol && eTargetProtocol == INET_PROT_FILE ) + if( m_aContext.RelFsys && eBaseProtocol == eTargetProtocol && eTargetProtocol == INetProtocol::FILE ) bSetRelative = true; OUString aFragment = aTargetURL.GetMark( INetURLObject::NO_DECODE /*DECODE_WITH_CHARSET*/ ); //fragment as is, @@ -4593,7 +4593,7 @@ we check in the following sequence: // the one that normally have fragments (but I may be wrong...) // and will force the use of URI when the protocol is not file: if( (!aFragment.isEmpty() && !bTargetHasPDFExtension) || - eTargetProtocol != INET_PROT_FILE ) + eTargetProtocol != INetProtocol::FILE ) { aLine.append( "/URI/URI" ); } diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx index 62f184505a94..87ef52e2347b 100644 --- a/vcl/unx/generic/printer/ppdparser.cxx +++ b/vcl/unx/generic/printer/ppdparser.cxx @@ -458,7 +458,7 @@ void PPDParser::initPPDFiles(PPDCache &rPPDCache) psp::getPrinterPathList( aPathList, PRINTER_PPDDIR ); for( std::list< OUString >::const_iterator ppd_it = aPathList.begin(); ppd_it != aPathList.end(); ++ppd_it ) { - INetURLObject aPPDDir( *ppd_it, INET_PROT_FILE, INetURLObject::ENCODE_ALL ); + INetURLObject aPPDDir( *ppd_it, INetProtocol::FILE, INetURLObject::ENCODE_ALL ); scanPPDDir( aPPDDir.GetMainURL( INetURLObject::NO_DECODE ) ); } if( rPPDCache.pAllPPDFiles->find( OUString( "SGENPRT" ) ) == rPPDCache.pAllPPDFiles->end() ) @@ -481,7 +481,7 @@ void PPDParser::initPPDFiles(PPDCache &rPPDCache) OUString PPDParser::getPPDFile( const OUString& rFile ) { - INetURLObject aPPD( rFile, INET_PROT_FILE, INetURLObject::ENCODE_ALL ); + INetURLObject aPPD( rFile, INetProtocol::FILE, INetURLObject::ENCODE_ALL ); // someone might enter a full qualified name here PPDDecompressStream aStream( aPPD.PathToFileName() ); if( ! aStream.IsOpen() ) diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx index 0c9ed6369f74..7c69eaf6d66a 100644 --- a/vcl/unx/generic/printer/printerinfomanager.cxx +++ b/vcl/unx/generic/printer/printerinfomanager.cxx @@ -210,7 +210,7 @@ void PrinterInfoManager::initialize() std::list< OUString >::const_iterator print_dir_it; for( print_dir_it = aDirList.begin(); print_dir_it != aDirList.end(); ++print_dir_it ) { - INetURLObject aFile( *print_dir_it, INET_PROT_FILE, INetURLObject::ENCODE_ALL ); + INetURLObject aFile( *print_dir_it, INetProtocol::FILE, INetURLObject::ENCODE_ALL ); aFile.Append( OUString( PRINT_FILENAME ) ); Config aConfig( aFile.PathToFileName() ); if( aConfig.HasGroup( GLOBAL_DEFAULTS_GROUP ) ) @@ -277,7 +277,7 @@ void PrinterInfoManager::initialize() // now collect all available printers for( print_dir_it = aDirList.begin(); print_dir_it != aDirList.end(); ++print_dir_it ) { - INetURLObject aDir( *print_dir_it, INET_PROT_FILE, INetURLObject::ENCODE_ALL ); + INetURLObject aDir( *print_dir_it, INetProtocol::FILE, INetURLObject::ENCODE_ALL ); INetURLObject aFile( aDir ); aFile.Append( OUString( PRINT_FILENAME ) ); diff --git a/vcl/unx/gtk/fpicker/SalGtkPicker.cxx b/vcl/unx/gtk/fpicker/SalGtkPicker.cxx index ebadb962888c..0443eda76340 100644 --- a/vcl/unx/gtk/fpicker/SalGtkPicker.cxx +++ b/vcl/unx/gtk/fpicker/SalGtkPicker.cxx @@ -51,7 +51,7 @@ OUString SalGtkPicker::uritounicode(const gchar* pIn) RTL_TEXTENCODING_UTF8 ); INetURLObject aURL(sURL); - if (INET_PROT_FILE == aURL.GetProtocol()) + if (INetProtocol::FILE == aURL.GetProtocol()) { // all the URLs are handled by office in UTF-8 // so the Gnome FP related URLs should be converted accordingly @@ -81,7 +81,7 @@ OString SalGtkPicker::unicodetouri(const OUString &rURL) // so the Gnome FP related URLs should be converted accordingly OString sURL = OUStringToOString(rURL, RTL_TEXTENCODING_UTF8); INetURLObject aURL(rURL); - if (INET_PROT_FILE == aURL.GetProtocol()) + if (INetProtocol::FILE == aURL.GetProtocol()) { OUString aNewURL = uri::ExternalUriReferenceTranslator::create( m_xContext )->translateToInternal(rURL); diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx index 2f0f375e3167..9fd3a6142cd8 100644 --- a/xmloff/source/forms/elementexport.cxx +++ b/xmloff/source/forms/elementexport.cxx @@ -2116,7 +2116,7 @@ namespace xmloff if ( !m_bCreateConnectionResourceElement ) { INetURLObject aURL(sPropValue); - m_bCreateConnectionResourceElement = ( aURL.GetProtocol() == INET_PROT_FILE ); + m_bCreateConnectionResourceElement = ( aURL.GetProtocol() == INetProtocol::FILE ); if ( !m_bCreateConnectionResourceElement ) exportStringPropertyAttribute( OAttributeMetaData::getFormAttributeNamespace(faDatasource), diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx index c41c0d76a8d6..99c0af3700c5 100644 --- a/xmloff/source/forms/elementimport.cxx +++ b/xmloff/source/forms/elementimport.cxx @@ -2061,7 +2061,7 @@ namespace xmloff OUString sValue = _xAttrList->getValueByIndex( i ); INetURLObject aURL(sValue); - if ( aURL.GetProtocol() == INET_PROT_FILE ) + if ( aURL.GetProtocol() == INetProtocol::FILE ) _xElement->setPropertyValue(PROPERTY_DATASOURCENAME,makeAny(sValue)); else _xElement->setPropertyValue(PROPERTY_URL,makeAny(sValue)); // the url is the "sdbc:" string diff --git a/xmlsecurity/source/dialogs/macrosecurity.cxx b/xmlsecurity/source/dialogs/macrosecurity.cxx index 33c37ba1be3b..17cedc4eaca6 100644 --- a/xmlsecurity/source/dialogs/macrosecurity.cxx +++ b/xmlsecurity/source/dialogs/macrosecurity.cxx @@ -240,7 +240,7 @@ IMPL_LINK_NOARG(MacroSecurityTrustedSourcesTP, AddLocPBHdl) aNewObj.removeFinalSlash(); // then the new path also an URL else system path - OUString aSystemFileURL = ( aNewObj.GetProtocol() != INET_PROT_NOT_VALID ) ? + OUString aSystemFileURL = ( aNewObj.GetProtocol() != INetProtocol::NOT_VALID ) ? aPathStr : aNewObj.getFSysPath( INetURLObject::FSYS_DETECT ); OUString aNewPathStr(aSystemFileURL); |