summaryrefslogtreecommitdiff
path: root/fpicker
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 /fpicker
parent0b4965bcd7ec911951e7ca3a4cd48062843b2634 (diff)
Change INetProtocol to scoped enumeration
...and fix o3tl::enumarray::operator [] const overload Change-Id: I749b1b9d68686b03a97074253478d9d2d9d32b0b
Diffstat (limited to 'fpicker')
-rw-r--r--fpicker/source/office/OfficeControlAccess.cxx4
-rw-r--r--fpicker/source/office/iodlg.cxx28
2 files changed, 16 insertions, 16 deletions
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 );