summaryrefslogtreecommitdiff
path: root/store
diff options
context:
space:
mode:
authorMatthias Huetsch <mhu@openoffice.org>2001-04-17 10:48:35 +0000
committerMatthias Huetsch <mhu@openoffice.org>2001-04-17 10:48:35 +0000
commitc190fcf6f4c0e09bc0a87cb68ef3f0052e05e6ea (patch)
treee6b38fef2eda3579c21a48aa3e747c778d48b1c9 /store
parent8d67e7ebb0e278748fabdd6896779c87219a19ca (diff)
#85854# Adapted OFileLockBytes_Impl::create() to support UNC and URL
path conventions, too.
Diffstat (limited to 'store')
-rw-r--r--store/source/filelckb.cxx31
1 files changed, 12 insertions, 19 deletions
diff --git a/store/source/filelckb.cxx b/store/source/filelckb.cxx
index 91d7cbe1f1e5..1e6cfb5f91f5 100644
--- a/store/source/filelckb.cxx
+++ b/store/source/filelckb.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: filelckb.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: mhu $ $Date: 2001-03-19 11:58:32 $
+ * last change: $Author: mhu $ $Date: 2001-04-17 11:48:35 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -59,7 +59,7 @@
*
************************************************************************/
-#define _STORE_FILELCKB_CXX_ "$Revision: 1.5 $"
+#define _STORE_FILELCKB_CXX_ "$Revision: 1.6 $"
#ifndef _SAL_TYPES_H_
#include <sal/types.h>
@@ -506,17 +506,17 @@ inline storeError OFileLockBytes_Impl::create (
inline storeError OFileLockBytes_Impl::create (
rtl_uString *pFilename, storeAccessMode eAccessMode)
{
-#if 0 /* NEW */
-
+ // Path conversion result.
oslFileError result;
+ // Convert into normalized path.
rtl::OUString aNormPath;
- result = osl_normalizePath (pFilename, &(aNormPath.pData));
+ result = osl_getNormalizedPathFromFileURL (
+ pFilename, &(aNormPath.pData));
if (!(result == osl_File_E_None))
{
- // Neither System, nor Normalized. May be FileUrl.
- result = osl_getNormalizedPathFromFileURL (
- pFilename, &(aNormPath.pData));
+ // Not FileUrl. Maybe System or already Normalized.
+ result = osl_normalizePath (pFilename, &(aNormPath.pData));
if (!(result == osl_File_E_None))
{
// Invalid path.
@@ -524,6 +524,7 @@ inline storeError OFileLockBytes_Impl::create (
}
}
+ // Convert into system path.
rtl::OUString aSystemPath;
result = osl_getSystemPathFromNormalizedPath (
aNormPath.pData, &(aSystemPath.pData));
@@ -533,21 +534,13 @@ inline storeError OFileLockBytes_Impl::create (
return store_E_InvalidParameter;
}
+ // Convert into system text encoding.
rtl::OString aFilename (
aSystemPath.pData->buffer,
aSystemPath.pData->length,
osl_getThreadTextEncoding());
-#endif /* NEW */
-#if 1 /* OLD */
-
- rtl::OString aFilename (
- pFilename->buffer,
- pFilename->length,
- osl_getThreadTextEncoding());
-
-#endif /* OLD */
-
+ // Open file.
return create (aFilename.pData->buffer, eAccessMode);
}