diff options
author | Tor Lillqvist <tml@iki.fi> | 2013-08-24 11:53:39 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-08-24 12:26:03 +0300 |
commit | 4cebcbedfe56a869e54a61f7023275dd6b426ca4 (patch) | |
tree | 0b352794bdf6d2bca418631ff69505fd7ccb43f0 /sal/osl | |
parent | 3e8c8728967bab1aca1892b55af1497ceccaf67b (diff) |
Simplify osl_getSystemPathFromFileURL_Ex()
It was always called with the bAllowRelative parameter as false
anyway.
Change-Id: I6c4bf739e3f8c1d52dbe8af5df13e97dc9be96e5
Diffstat (limited to 'sal/osl')
-rw-r--r-- | sal/osl/unx/file_misc.cxx | 7 | ||||
-rw-r--r-- | sal/osl/unx/file_url.cxx | 15 | ||||
-rw-r--r-- | sal/osl/unx/file_url.h | 5 | ||||
-rw-r--r-- | sal/osl/unx/tempfile.c | 2 |
4 files changed, 11 insertions, 18 deletions
diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx index b262d84185df..0ee3a66c1bb2 100644 --- a/sal/osl/unx/file_misc.cxx +++ b/sal/osl/unx/file_misc.cxx @@ -145,7 +145,7 @@ oslFileError SAL_CALL osl_openDirectory(rtl_uString* ustrDirectoryURL, oslDirect return osl_File_E_INVAL; /* convert file URL to system path */ - eRet = osl_getSystemPathFromFileURL_Ex(ustrDirectoryURL, &ustrSystemPath, sal_False); + eRet = osl_getSystemPathFromFileURL_Ex(ustrDirectoryURL, &ustrSystemPath); if( osl_File_E_None != eRet ) return eRet; @@ -355,7 +355,7 @@ oslFileError SAL_CALL osl_getDirectoryItem( rtl_uString* ustrFileURL, oslDirecto if ((0 == ustrFileURL) || (0 == ustrFileURL->length) || (0 == pItem)) return osl_File_E_INVAL; - osl_error = osl_getSystemPathFromFileURL_Ex(ustrFileURL, &ustrSystemPath, sal_False); + osl_error = osl_getSystemPathFromFileURL_Ex(ustrFileURL, &ustrSystemPath); if (osl_File_E_None != osl_error) return osl_error; @@ -541,8 +541,7 @@ oslFileError SAL_CALL osl_createDirectoryPath( return osl_File_E_INVAL; rtl::OUString sys_path; - oslFileError osl_error = osl_getSystemPathFromFileURL_Ex( - aDirectoryUrl, &sys_path.pData, sal_False); + oslFileError osl_error = osl_getSystemPathFromFileURL_Ex(aDirectoryUrl, &sys_path.pData); if (osl_error != osl_File_E_None) return osl_error; diff --git a/sal/osl/unx/file_url.cxx b/sal/osl/unx/file_url.cxx index b55251fcea53..539732ec5f6c 100644 --- a/sal/osl/unx/file_url.cxx +++ b/sal/osl/unx/file_url.cxx @@ -339,21 +339,18 @@ oslFileError SAL_CALL osl_getFileURLFromSystemPath( rtl_uString *ustrSystemPath, return osl_File_E_None; } -/**************************************************************************** - * osl_getSystemPathFromFileURL_Ex - helper function - * clients may specify if they want to accept relative - * URLs or not - ****************************************************************************/ - +/* + * relative URLs are not accepted + */ oslFileError osl_getSystemPathFromFileURL_Ex( - rtl_uString *ustrFileURL, rtl_uString **pustrSystemPath, sal_Bool bAllowRelative) + rtl_uString *ustrFileURL, rtl_uString **pustrSystemPath) { rtl_uString* temp = 0; oslFileError osl_error = osl_getSystemPathFromFileURL(ustrFileURL, &temp); if (osl_File_E_None == osl_error) { - if (bAllowRelative || (UNICHAR_SLASH == temp->buffer[0])) + if (UNICHAR_SLASH == temp->buffer[0]) { *pustrSystemPath = temp; } @@ -629,7 +626,7 @@ oslFileError osl_getAbsoluteFileURL(rtl_uString* ustrBaseDirURL, rtl_uString* u if (systemPathIsRelativePath(unresolved_path)) { rtl::OUString base_path; - rc = (FileBase::RC) osl_getSystemPathFromFileURL_Ex(ustrBaseDirURL, &base_path.pData, sal_False); + rc = (FileBase::RC) osl_getSystemPathFromFileURL_Ex(ustrBaseDirURL, &base_path.pData); if (FileBase::E_None != rc) return oslFileError(rc); diff --git a/sal/osl/unx/file_url.h b/sal/osl/unx/file_url.h index 9c97d3799c2e..4f418b264705 100644 --- a/sal/osl/unx/file_url.h +++ b/sal/osl/unx/file_url.h @@ -27,10 +27,7 @@ extern "C" { #endif -#define FURL_ALLOW_RELATIVE sal_True -#define FURL_DENY_RELATIVE sal_False - -oslFileError osl_getSystemPathFromFileURL_Ex(rtl_uString *ustrFileURL, rtl_uString **pustrSystemPath, sal_Bool bAllowRelative); +oslFileError osl_getSystemPathFromFileURL_Ex(rtl_uString *ustrFileURL, rtl_uString **pustrSystemPath); oslFileError FileURLToPath(char * buffer, size_t bufLen, rtl_uString* ustrFileURL); diff --git a/sal/osl/unx/tempfile.c b/sal/osl/unx/tempfile.c index 3d60477c7752..b36054ef0b9b 100644 --- a/sal/osl/unx/tempfile.c +++ b/sal/osl/unx/tempfile.c @@ -120,7 +120,7 @@ static oslFileError osl_setup_base_directory_impl_( if (osl_File_E_None == error) { - error = osl_getSystemPathFromFileURL_Ex(dir_url, &dir, FURL_DENY_RELATIVE); + error = osl_getSystemPathFromFileURL_Ex(dir_url, &dir); rtl_uString_release(dir_url); } |