diff options
author | Hennes Rohling <hro@openoffice.org> | 2001-07-27 06:54:21 +0000 |
---|---|---|
committer | Hennes Rohling <hro@openoffice.org> | 2001-07-27 06:54:21 +0000 |
commit | 1e7c619b783c5b63b24dc6dbb22638d0d2ec105c (patch) | |
tree | c27142c514e660925c64cb2a84aea414fe35bb50 /ucb | |
parent | 8988492f5f43244a8f957a5d9cc92337950b9fd4 (diff) |
90267# Removed TF_FILEURL defines
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/file/bc.cxx | 8 | ||||
-rw-r--r-- | ucb/source/ucp/file/filglob.cxx | 44 | ||||
-rw-r--r-- | ucb/source/ucp/file/prov.cxx | 54 | ||||
-rw-r--r-- | ucb/source/ucp/file/shell.cxx | 75 |
4 files changed, 13 insertions, 168 deletions
diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx index cb3defbe9f4b..d20ca8140ef4 100644 --- a/ucb/source/ucp/file/bc.cxx +++ b/ucb/source/ucp/file/bc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: bc.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: kso $ $Date: 2001-07-23 13:05:55 $ + * last change: $Author: hro $ $Date: 2001-07-27 07:54:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1097,11 +1097,7 @@ BaseContent::transfer( sal_Int32 nMyCommandIdentifier, return; // Never write access to virtual root in case of access restrictions -#ifdef TF_FILEURL if( m_pMyShell->m_bFaked && m_aUncPath.compareToAscii( "file:///" ) == 0 ) -#else - if( m_pMyShell->m_bFaked && m_aUncPath.compareToAscii( "//./" ) == 0 ) -#endif { m_pMyShell->installError( nMyCommandIdentifier, TASKHANDLING_TRANSFER_ACCESSINGROOT ); diff --git a/ucb/source/ucp/file/filglob.cxx b/ucb/source/ucp/file/filglob.cxx index 91ef384e3902..f03d1d9bbd66 100644 --- a/ucb/source/ucp/file/filglob.cxx +++ b/ucb/source/ucp/file/filglob.cxx @@ -145,12 +145,8 @@ namespace fileaccess { oslFileError getResolvedURL(rtl_uString* ustrPath, rtl_uString** pustrResolvedURL) { -#ifdef TF_FILEURL /* TODO: If file exist and is a link get link target URL */ rtl_uString_assign( pustrResolvedURL, ustrPath ); -#else - rtl_uString_assign( pustrResolvedURL, ustrPath ); -#endif return osl_File_E_None; } @@ -161,7 +157,6 @@ namespace fileaccess { // makeAbsolute Path //---------------------------------------------------------------------------- -#ifdef TF_FILEURL sal_Bool SAL_CALL makeAbsolutePath( const rtl::OUString& aRelPath, rtl::OUString& aAbsPath ) { @@ -200,45 +195,6 @@ namespace fileaccess { return sal_True; } -#else - - - sal_Bool SAL_CALL makeAbsolutePath( const rtl::OUString& aRelPath, rtl::OUString& aAbsPath ) - { - sal_Int32 nIndex = 0; - - std::vector< rtl::OUString > aTokenStack; - - if ( 0 != aRelPath.compareTo( rtl::OUString::createFromAscii( "//./" ), 4 ) ) - return sal_False; - - aRelPath.getToken( 0, '/', nIndex ); - - while ( nIndex >= 0 ) - { - rtl::OUString aToken = aRelPath.getToken( 0, '/', nIndex ); - - if ( aToken.compareToAscii( ".." ) == 0 ) - aTokenStack.pop_back(); - else - aTokenStack.push_back( aToken ); - } - - - std::vector< rtl::OUString >::iterator it; - aAbsPath = rtl::OUString::createFromAscii("file:"); - - for ( it = aTokenStack.begin(); it != aTokenStack.end(); it++ ) - { - aAbsPath += rtl::OUString::createFromAscii( "/" ); - aAbsPath += *it; - } - - return sal_True; - } - -#endif - diff --git a/ucb/source/ucp/file/prov.cxx b/ucb/source/ucp/file/prov.cxx index b35efa3dc342..48287bb30955 100644 --- a/ucb/source/ucp/file/prov.cxx +++ b/ucb/source/ucp/file/prov.cxx @@ -2,9 +2,9 @@ * * $RCSfile: prov.cxx,v $ * - * $Revision: 1.26 $ + * $Revision: 1.27 $ * - * last change: $Author: abi $ $Date: 2001-07-20 11:17:32 $ + * last change: $Author: hro $ $Date: 2001-07-27 07:54:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -338,49 +338,29 @@ FileProvider::FileProvider( const Reference< XMultiServiceFactory >& xMultiServi = xCfgMgr->substituteVariables( aDirectory ); // old,assuming URL: osl::FileBase::getNormalizedPathFromFileURL( aDir, aUnqDir ); // new, assuming system path: -#ifdef TF_FILEURL osl::FileBase::getFileURLFromSystemPath( aDir,aUnqDir ); -#else - osl::FileBase::normalizePath( aDir,aUnqDir ); -#endif rtl::OUString aAlias = xCfgMgr->substituteVariables( aAliasName ); // old, assuming URL: osl::FileBase::getNormalizedPathFromFileURL( aAlias, aUnqAl ); // new, assuming system path: -#ifdef TF_FILEURL osl::FileBase::getFileURLFromSystemPath( aAlias,aUnqAl ); -#else - osl::FileBase::normalizePath( aAlias,aUnqAl ); -#endif } if ( !aUnqDir.getLength() ) -#ifdef TF_FILEURL osl::FileBase::getFileURLFromSystemPath( aDirectory,aUnqDir ); -#else - osl::FileBase::normalizePath( aDirectory,aUnqDir ); -#endif // m_pMyShell->getUnqFromUrl( aDirectory,aUnqDir ); if ( !aUnqAl.getLength() ) -#ifdef TF_FILEURL osl::FileBase::getFileURLFromSystemPath( aAliasName,aUnqAl ); -#else - osl::FileBase::normalizePath( aAliasName,aUnqAl ); -#endif // m_pMyShell->getUnqFromUrl( aAliasName,aUnqAl ); rtl::OUString aRealUnqDir; rtl::OUString aRealUnqAlias; getResolvedURL( aUnqDir.pData, &aRealUnqDir.pData ); -#if 0 - getResolvedURL( aUnqAl.pData, &aRealUnqAlias.pData ); -#else aRealUnqAlias = aUnqAl; -#endif if ( !aRealUnqAlias.getLength() ) aRealUnqAlias = aUnqAl; @@ -611,23 +591,14 @@ FileProvider::compareContentIds( if ( error != osl::FileBase::E_None ) return iComp; -#ifdef TF_FILEURL osl::FileStatus aStatus1( FileStatusMask_FileURL ); osl::FileStatus aStatus2( FileStatusMask_FileURL ); -#else - osl::FileStatus aStatus1( FileStatusMask_FilePath ); - osl::FileStatus aStatus2( FileStatusMask_FilePath ); -#endif error = aItem1.getFileStatus( aStatus1 ); if ( error == osl::FileBase::E_None ) error = aItem2.getFileStatus( aStatus2 ); if ( error == osl::FileBase::E_None ) -#ifdef TF_FILEURL iComp = aStatus1.getFileURL().compareTo( aStatus2.getFileURL() ); -#else - iComp = aStatus1.getFilePath().compareTo( aStatus2.getFilePath() ); -#endif } return iComp; @@ -933,11 +904,7 @@ rtl::OUString SAL_CALL FileProvider::getFileURLFromSystemPath( const rtl::OUStri throw( RuntimeException ) { rtl::OUString aNormalizedPath; -#ifdef TF_FILEURL if ( osl::FileBase::getFileURLFromSystemPath( SystemPath,aNormalizedPath ) != osl::FileBase::E_None ) -#else - if ( osl::FileBase::normalizePath( SystemPath,aNormalizedPath ) != osl::FileBase::E_None ) -#endif return rtl::OUString(); rtl::OUString aRed; @@ -947,13 +914,7 @@ rtl::OUString SAL_CALL FileProvider::getFileURLFromSystemPath( const rtl::OUStri rtl::OUString aUrl; -#ifdef TF_FILEURL aUrl = aRed; -#else - sal_Bool err = m_pMyShell->getUrlFromUnq( aRed,aUrl ); - if( err ) - return rtl::OUString(); -#endif return aUrl; } @@ -963,13 +924,7 @@ rtl::OUString SAL_CALL FileProvider::getSystemPathFromFileURL( const rtl::OUStri { rtl::OUString aUnq; -#ifdef TF_FILEURL aUnq = URL; -#else - sal_Bool err = m_pMyShell->getUnqFromUrl( URL,aUnq ); - if( err ) - return rtl::OUString(); -#endif rtl::OUString aRed; sal_Bool success = m_pMyShell->checkMountPoint( aUnq,aRed ); @@ -977,13 +932,8 @@ rtl::OUString SAL_CALL FileProvider::getSystemPathFromFileURL( const rtl::OUStri return rtl::OUString(); rtl::OUString aSystemPath; -#ifdef TF_FILEURL if (osl::FileBase::getSystemPathFromFileURL( aRed,aSystemPath ) != osl::FileBase::E_None ) return rtl::OUString(); -#else - if (osl::FileBase::getSystemPathFromNormalizedPath( aRed,aSystemPath ) != osl::FileBase::E_None ) - return rtl::OUString(); -#endif return aSystemPath; } diff --git a/ucb/source/ucp/file/shell.cxx b/ucb/source/ucp/file/shell.cxx index da785406c2e8..3b59c66863ea 100644 --- a/ucb/source/ucp/file/shell.cxx +++ b/ucb/source/ucp/file/shell.cxx @@ -2,9 +2,9 @@ * * $RCSfile: shell.cxx,v $ * - * $Revision: 1.53 $ + * $Revision: 1.54 $ * - * last change: $Author: hro $ $Date: 2001-07-24 13:09:34 $ + * last change: $Author: hro $ $Date: 2001-07-27 07:54:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1394,11 +1394,7 @@ shell::remove( sal_Int32 CommandId, sal_Int32 IsWhat ) throw() { -#ifdef TF_FILEURL sal_Int32 nMask = FileStatusMask_Type | FileStatusMask_FileURL; -#else - sal_Int32 nMask = FileStatusMask_Type | FileStatusMask_FilePath; -#endif osl::DirectoryItem aItem; osl::FileStatus aStatus( nMask ); @@ -1486,11 +1482,7 @@ shell::remove( sal_Int32 CommandId, aStatus.getFileType() == osl::FileStatus::Volume ) recurse = +1; -#ifdef TF_FILEURL name = aStatus.getFileURL(); -#else - name = aStatus.getFilePath(); -#endif if( ! ( whileSuccess = remove( CommandId, name, @@ -1809,21 +1801,13 @@ sal_Bool SAL_CALL shell::getUnqFromUrl( const rtl::OUString& Url,rtl::OUString& 0 == Url.compareToAscii( "file://localhost/" ) || 0 == Url.compareToAscii( "file://127.0.0.1/" ) ) { -#ifdef TF_FILEURL Unq = rtl::OUString::createFromAscii( "file:///" ); -#else - Unq = rtl::OUString::createFromAscii( "//./" ); -#endif return false; } -#ifdef TF_FILEURL sal_Bool err = osl::FileBase::E_None != osl::FileBase::getSystemPathFromFileURL( Url,Unq ); Unq = Url; -#else - sal_Bool err = osl::FileBase::E_None != osl::FileBase::getNormalizedPathFromFileURL( Url,Unq ); -#endif sal_Int32 l = Unq.getLength()-1; if( ! err && Unq.getStr()[ l ] == '/' && @@ -1837,27 +1821,11 @@ sal_Bool SAL_CALL shell::getUnqFromUrl( const rtl::OUString& Url,rtl::OUString& sal_Bool SAL_CALL shell::getUrlFromUnq( const rtl::OUString& Unq,rtl::OUString& Url ) { -#ifdef TF_FILEURL sal_Bool err = osl::FileBase::E_None != osl::FileBase::getSystemPathFromFileURL( Unq,Url ); Url = Unq; return err; -#else - if( Unq.compareToAscii( "//./" ) == 0 ) - { - Url = rtl::OUString::createFromAscii( "file:///" ); - return false; - } - - rtl::OUString aUnq = Unq; - if( aUnq[ aUnq.getLength()-1 ] == sal_Unicode( ':' ) && aUnq.getLength() == 6 ) - { - aUnq += rtl::OUString::createFromAscii( "/" ); - } - sal_Bool err = osl::FileBase::E_None != osl::FileBase::getFileURLFromNormalizedPath( aUnq,Url ); - return err; -#endif } @@ -1886,11 +1854,7 @@ shell::copy_recursive( const rtl::OUString& srcUnqPath, osl::FileBase::RC next = err; if( err == osl::FileBase::E_None ) { -#ifdef TF_FILEURL sal_Int32 n_Mask = FileStatusMask_FileURL | FileStatusMask_FileName | FileStatusMask_Type; -#else - sal_Int32 n_Mask = FileStatusMask_FilePath | FileStatusMask_FileName | FileStatusMask_Type; -#endif osl::DirectoryItem aDirItem; @@ -1906,13 +1870,8 @@ shell::copy_recursive( const rtl::OUString& srcUnqPath, sal_Int32 newTypeToCopy = IsDocument ? -1 : +1; rtl::OUString newSrcUnqPath; -#ifdef TF_FILEURL if( aFileStatus.isValid( FileStatusMask_FileURL ) ) newSrcUnqPath = aFileStatus.getFileURL(); -#else - if( aFileStatus.isValid( FileStatusMask_FilePath ) ) - newSrcUnqPath = aFileStatus.getFilePath(); -#endif rtl::OUString newDstUnqPath = dstUnqPath; rtl::OUString tit; @@ -2018,11 +1977,7 @@ sal_Bool SAL_CALL shell::ensuredir( sal_Int32 CommandId, void SAL_CALL shell::getMaskFromProperties( sal_Int32& n_Mask, const uno::Sequence< beans::Property >& seq ) { -#ifdef TF_FILEURL n_Mask = FileStatusMask_FileURL | FileStatusMask_LinkTargetURL | FileStatusMask_Type; -#else - n_Mask = FileStatusMask_FilePath | FileStatusMask_Type; -#endif rtl::OUString PropertyName; for( sal_Int32 i = 0; i < seq.getLength(); ++i ) @@ -2208,11 +2163,7 @@ shell::commit( const shell::ContentMap::iterator& it, } -#ifdef TF_FILEURL if( m_bFaked && it->first.compareToAscii( "file:///" ) == 0 ) -#else - if( m_bFaked && it->first.compareToAscii( "//./" ) == 0 ) -#endif { sal_Bool dummy = true; @@ -2254,20 +2205,16 @@ shell::commit( const shell::ContentMap::iterator& it, } } -#ifdef TF_FILEURL if( m_bFaked && it->first.compareToAscii( "file:///" ) == 0 ) -#else - if( m_bFaked && it->first.compareToAscii( "//./" ) == 0 ) -#endif + { + sal_Bool readonly = true; + aAny <<= readonly; + it1 = properties.find( MyProperty( IsReadOnly ) ); + if( it1 != properties.end() ) { - sal_Bool readonly = true; - aAny <<= readonly; - it1 = properties.find( MyProperty( IsReadOnly ) ); - if( it1 != properties.end() ) - { - it1->setValue( aAny ); - } + it1->setValue( aAny ); } + } if( aFileStatus.isValid( FileStatusMask_ModifyTime ) ) { @@ -2348,11 +2295,7 @@ shell::getv( osl::FileStatus aFileStatus( n_Mask | FileStatusMask_LinkTargetURL ); aDirItem.getFileStatus( aFileStatus ); -#ifdef TF_FILEURL aUnqPath = aFileStatus.getFileURL(); -#else - aUnqPath = aFileStatus.getFilePath(); -#endif // If the directory item type is a link retrieve the type of the target |