summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-04-02 15:58:06 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-04-02 16:30:34 +0200
commit44b3e56bb4a4df59f53447c4ca4d8e02fe926206 (patch)
tree71a9efde3a6a2a00688e8feb8e3086cb32eceb4f /svtools
parent0b4965bcd7ec911951e7ca3a4cd48062843b2634 (diff)
Change INetProtocol to scoped enumeration
...and fix o3tl::enumarray::operator [] const overload Change-Id: I749b1b9d68686b03a97074253478d9d2d9d32b0b
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/contnr/contentenumeration.cxx2
-rw-r--r--svtools/source/contnr/fileview.cxx2
-rw-r--r--svtools/source/control/filectrl.cxx2
-rw-r--r--svtools/source/control/fileurlbox.cxx2
-rw-r--r--svtools/source/control/inettbc.cxx40
-rw-r--r--svtools/source/control/urlcontrol.cxx2
-rw-r--r--svtools/source/dialogs/ServerDetailsControls.cxx4
-rw-r--r--svtools/source/dialogs/addresstemplate.cxx6
-rw-r--r--svtools/source/misc/imagemgr.cxx4
-rw-r--r--svtools/source/misc/templatefoldercache.cxx8
-rw-r--r--svtools/source/uno/wizard/unowizard.cxx4
11 files changed, 38 insertions, 38 deletions
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();