diff options
author | Oliver Bolte <obo@openoffice.org> | 2005-04-12 11:11:17 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2005-04-12 11:11:17 +0000 |
commit | 5e502db8c81d633b8674a5ce58f3ca8e256a4737 (patch) | |
tree | 8ea03c70c6ee08a478b5def469df04e3f75b8166 /psprint/source | |
parent | e289bb54961a6ba8a2213fc0628ce3921b77bffb (diff) |
INTEGRATION: CWS vclfinal01 (1.57.4); FILE MERGED
2005/04/05 10:10:31 pl 1.57.4.1: #i46115# fix for already existing but not writeable directory
Diffstat (limited to 'psprint/source')
-rw-r--r-- | psprint/source/fontmanager/fontmanager.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/psprint/source/fontmanager/fontmanager.cxx b/psprint/source/fontmanager/fontmanager.cxx index aaf069f1955f..64c00e7b7c33 100644 --- a/psprint/source/fontmanager/fontmanager.cxx +++ b/psprint/source/fontmanager/fontmanager.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fontmanager.cxx,v $ * - * $Revision: 1.57 $ + * $Revision: 1.58 $ * - * last change: $Author: kz $ $Date: 2005-03-18 17:46:50 $ + * last change: $Author: obo $ $Date: 2005-04-12 12:11:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -3119,18 +3119,18 @@ bool PrintFontManager::getMetrics( fontID nFontID, sal_Unicode minCharacter, sal // ------------------------------------------------------------------------- -static bool createPath( const ByteString& rPath ) +static bool createWriteablePath( const ByteString& rPath ) { bool bSuccess = false; - if( access( rPath.GetBuffer(), F_OK ) ) + if( access( rPath.GetBuffer(), W_OK ) ) { int nPos = rPath.SearchBackward( '/' ); if( nPos != STRING_NOTFOUND ) while( nPos > 0 && rPath.GetChar( nPos ) == '/' ) nPos--; - if( nPos != STRING_NOTFOUND && nPos != 0 && createPath( rPath.Copy( 0, nPos+1 ) ) ) + if( nPos != STRING_NOTFOUND && nPos != 0 && createWriteablePath( rPath.Copy( 0, nPos+1 ) ) ) { bSuccess = mkdir( rPath.GetBuffer(), 0777 ) ? false : true; } @@ -3158,7 +3158,7 @@ int PrintFontManager::importFonts( const ::std::list< OString >& rFiles, bool bL { // check if we can create files in that directory ByteString aDirPath = getDirectory( *dir_it ); - if( ! access( aDirPath.GetBuffer(), W_OK ) || createPath( aDirPath ) ) + if( createWriteablePath( aDirPath ) ) { aDir = INetURLObject( OStringToOUString( aDirPath, aEncoding ), INET_PROT_FILE, INetURLObject::ENCODE_ALL ); nDirID = *dir_it; @@ -3326,7 +3326,7 @@ bool PrintFontManager::checkImportPossible() const dir_it != m_aPrivateFontDirectories.end(); ++dir_it ) { aDir = getDirectory( *dir_it ); - if( ! access( aDir.GetBuffer(), W_OK ) || createPath( aDir ) ) + if( createWriteablePath( aDir ) ) { bSuccess = true; break; |