diff options
author | Stephan Bergmann <sb@openoffice.org> | 2000-12-15 07:40:14 +0000 |
---|---|---|
committer | Stephan Bergmann <sb@openoffice.org> | 2000-12-15 07:40:14 +0000 |
commit | 00fbf48c93bf69f5fa6ebbd2cc3c9251fda20051 (patch) | |
tree | 3679c58ba1e62d082c6523fa1ef6d2171cff16fa /unotools | |
parent | f95c6c979d94b9742a7dbaacec346ecd0e8a87b2 (diff) |
#82037# Adapted to modified FileIdentifierConverter mechanism.
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/ucbhelper/localfilehelper.cxx | 29 | ||||
-rw-r--r-- | unotools/source/ucbhelper/tempfile.cxx | 12 |
2 files changed, 19 insertions, 22 deletions
diff --git a/unotools/source/ucbhelper/localfilehelper.cxx b/unotools/source/ucbhelper/localfilehelper.cxx index 6c617f2cc0db..167c74e3a116 100644 --- a/unotools/source/ucbhelper/localfilehelper.cxx +++ b/unotools/source/ucbhelper/localfilehelper.cxx @@ -2,9 +2,9 @@ * * $RCSfile: localfilehelper.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: mba $ $Date: 2000-12-14 17:13:34 $ + * last change: $Author: sb $ $Date: 2000-12-15 08:40:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -75,7 +75,6 @@ #include <ucbhelper/contentbroker.hxx> #include <rtl/ustring.hxx> #include <osl/file.hxx> -#include <osl/socket.h> #include <tools/debug.hxx> #include <tools/list.hxx> #include <ucbhelper/content.hxx> @@ -122,7 +121,7 @@ sal_Bool LocalFileHelper::ConvertURLToSystemPath( const String& rName, String& r { ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentProviderManager > xManager = pBroker->getContentProviderManagerInterface(); - aRet = ::ucb::getSystemPathFromFileURL( xManager, rName, rName ); + aRet = ::ucb::getSystemPathFromFileURL( xManager, rName ); } rReturn = aRet; @@ -132,12 +131,12 @@ sal_Bool LocalFileHelper::ConvertURLToSystemPath( const String& rName, String& r sal_Bool LocalFileHelper::ConvertPhysicalNameToURL( const String& rName, String& rReturn ) { rtl::OUString aRet; - ::rtl::OUString aTmp; - FileBase::normalizePath( rName, aTmp ); ::ucb::ContentBroker* pBroker = ::ucb::ContentBroker::get(); if ( !pBroker ) { + ::rtl::OUString aTmp; + FileBase::normalizePath( rName, aTmp ); FileBase::getFileURLFromNormalizedPath( aTmp, aRet ); } else @@ -145,9 +144,8 @@ sal_Bool LocalFileHelper::ConvertPhysicalNameToURL( const String& rName, String& ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentProviderManager > xManager = pBroker->getContentProviderManagerInterface(); - rtl::OUString aHost; - osl_getLocalHostname( &aHost.pData ); - aRet = ::ucb::getFileURLFromNormalizedPath( xManager, aHost, aTmp ); + rtl::OUString aBase( ::ucb::getLocalFileURL( xManager ) ); + aRet = ::ucb::getFileURLFromSystemPath( xManager, aBase, rName ); } rReturn = aRet; @@ -160,21 +158,20 @@ sal_Bool LocalFileHelper::ConvertURLToPhysicalName( const String& rName, String& ::ucb::ContentBroker* pBroker = ::ucb::ContentBroker::get(); if ( !pBroker ) { - FileBase::getNormalizedPathFromFileURL( rName, aRet ); + ::rtl::OUString aTmp; + FileBase::getNormalizedPathFromFileURL( rName, aTmp ); + FileBase::getSystemPathFromNormalizedPath( aTmp, aRet ); + aRet = aTmp; } else { ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentProviderManager > xManager = pBroker->getContentProviderManagerInterface(); - rtl::OUString aHost; - osl_getLocalHostname( &aHost.pData ); - aRet = ::ucb::getNormalizedPathFromFileURL( xManager, aHost, rName ); + aRet = ::ucb::getSystemPathFromFileURL( xManager, rName ); } - ::rtl::OUString aTmp; - FileBase::getSystemPathFromNormalizedPath( aRet, aTmp ); - rReturn = aTmp; + rReturn = aRet; return sal_True; } diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx index 1b41c7c06b81..49f3c304e5f0 100644 --- a/unotools/source/ucbhelper/tempfile.cxx +++ b/unotools/source/ucbhelper/tempfile.cxx @@ -2,9 +2,9 @@ * * $RCSfile: tempfile.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: mba $ $Date: 2000-12-01 11:54:11 $ + * last change: $Author: sb $ $Date: 2000-12-15 08:40:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -66,7 +66,6 @@ #include <ucbhelper/contentbroker.hxx> #include <rtl/ustring.hxx> #include <osl/file.hxx> -#include <osl/socket.h> #include <tools/time.hxx> #include <tools/debug.hxx> #include <stdio.h> @@ -104,11 +103,12 @@ String ConstructTempDir_Impl( const String* pParent ) // if parent given try to use it rtl::OUString aTmp( *pParent ); - rtl::OUString aHost; - osl_getLocalHostname( &aHost.pData ); // test for valid filename - rtl::OUString aRet = ::ucb::getNormalizedPathFromFileURL( xManager, aHost, aTmp ); + rtl::OUString aRet; + ::osl::FileBase::normalizePath( + ::ucb::getSystemPathFromFileURL( xManager, aTmp ), + aRet ); if ( aRet.getLength() ) { ::osl::DirectoryItem aItem; |