diff options
author | Matthias Huetsch <mhu@openoffice.org> | 2001-03-15 14:35:31 +0000 |
---|---|---|
committer | Matthias Huetsch <mhu@openoffice.org> | 2001-03-15 14:35:31 +0000 |
commit | 0528321f6afab45ca32154c7049dc4392d025c6a (patch) | |
tree | 15411139766331ae83f2d275eb7d045cbb3fa755 | |
parent | b00e1d98b99d3fd19aa82e34c683de00fd3263c4 (diff) |
Adapted to OFileLockBytes_impl::create() changes.
-rw-r--r-- | store/workben/t_file.cxx | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/store/workben/t_file.cxx b/store/workben/t_file.cxx index 6705dbb11265..d36559efc720 100644 --- a/store/workben/t_file.cxx +++ b/store/workben/t_file.cxx @@ -2,9 +2,9 @@ * * $RCSfile: t_file.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: mhu $ $Date: 2001-03-13 21:15:30 $ + * last change: $Author: mhu $ $Date: 2001-03-15 15:35:31 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,7 +59,7 @@ * ************************************************************************/ -#define _T_FILE_CXX "$Revision: 1.3 $" +#define _T_FILE_CXX "$Revision: 1.4 $" #ifndef _SAL_TYPES_H_ #include <sal/types.h> @@ -105,11 +105,36 @@ int SAL_CALL main (int argc, char **argv) #if 0 /* EXP */ - rtl::OUString aNormPath; - osl_searchNormalizedPath (aFilename.pData, 0, &(aNormPath.pData)); - - rtl::OUString aSysPath; - osl_getSystemPathFromNormalizedPath (aNormPath.pData, &(aSysPath.pData)); + if (aFilename.getLength() > 0) + { + oslFileError result; + + rtl::OUString aNormalizedPath; + result = osl_normalizePath ( + aFilename.pData, &(aNormalizedPath.pData)); + if (!(result == osl_File_E_None)) + { + // Neither System, nor Normalized. Try parsing as Url. + result = osl_getNormalizedPathFromFileURL ( + aFilename.pData, &(aNormalizedPath.pData)); + if (!(result == osl_File_E_None)) + { + // Invalid path. + return (store_E_InvalidParameter); + } + } + + rtl::OUString aSystemPath; + result = osl_getSystemPathFromNormalizedPath ( + aNormalizedPath.pData, &(aSystemPath.pData)); + if (!(result == osl_File_E_None)) + { + // Invalid path. + return (store_E_InvalidParameter); + } + + aFilename = aSystemPath; + } #endif /* EXP */ |