summaryrefslogtreecommitdiff
path: root/registry/source
diff options
context:
space:
mode:
authorJuergen Schmidt <jsc@openoffice.org>2001-07-23 14:43:28 +0000
committerJuergen Schmidt <jsc@openoffice.org>2001-07-23 14:43:28 +0000
commit45401bca08111989570d303eaa1abda8b36ca5b3 (patch)
treed10080ccf4544d83d2c65980b4a0170be9af9b0d /registry/source
parentbecc546a2034eb1ecf70d270f4b091404cbca99a (diff)
#89618# change text encoding
Diffstat (limited to 'registry/source')
-rw-r--r--registry/source/keyimpl.cxx9
-rw-r--r--registry/source/regimpl.cxx28
2 files changed, 24 insertions, 13 deletions
diff --git a/registry/source/keyimpl.cxx b/registry/source/keyimpl.cxx
index 245727201653..f4d4184e5dba 100644
--- a/registry/source/keyimpl.cxx
+++ b/registry/source/keyimpl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: keyimpl.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jsc $ $Date: 2001-01-10 10:15:53 $
+ * last change: $Author: jsc $ $Date: 2001-07-23 15:43:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -422,11 +422,6 @@ RegError ORegKey::setValue(const OUString& valueName, RegValueType vType, RegVal
sal_uInt32 size = vSize;
-// if (vType == RG_VALUETYPE_UNICODE)
-// {
-// size = (rtl_ustr_getLength((sal_Unicode*)value)+1) * 2;
-// }
-
sal_uInt8 type = (sal_uInt8)vType;
pBuffer = (sal_uInt8*)rtl_allocateMemory(VALUE_HEADERSIZE + size);
rtl_copyMemory(pBuffer, &type, 1);
diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx
index 7ae7d7a00dfe..ee30c59fe18a 100644
--- a/registry/source/regimpl.cxx
+++ b/registry/source/regimpl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: regimpl.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: jsc $ $Date: 2001-05-18 15:32:31 $
+ * last change: $Author: jsc $ $Date: 2001-07-23 15:43:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -87,6 +87,10 @@
#include "keyimpl.hxx"
#endif
+#ifndef _OSL_THREAD_H_
+#include <osl/thread.h>
+#endif
+
#ifndef _RTL_ALLOC_H_
#include <rtl/alloc.h>
#endif
@@ -101,6 +105,10 @@
#ifndef _RTL_USTRBUF_HXX_
#include <rtl/ustrbuf.hxx>
#endif
+#ifndef _ODL_FILE_HXX_
+#include <osl/file.hxx>
+#endif
+
#if defined ( GCC ) && ( defined ( SCO ) || defined ( OS2 ) )
sal_helper::ORealDynamicLoader* sal_helper::ODynamicLoader<RegistryTypeReader_Api>::m_pLoader = NULL;
@@ -536,7 +544,11 @@ RegError ORegistry::destroyRegistry(const OUString& regName)
{
delete pReg;
- OString name( OUStringToOString(regName, RTL_TEXTENCODING_UTF8) );
+ OUString systemName;
+ if ( FileBase::getSystemPathFromFileURL(regName, systemName) != FileBase::E_None )
+ systemName = regName;
+
+ OString name( OUStringToOString(systemName, osl_getThreadTextEncoding()) );
if (unlink(name) != 0)
{
return REG_DESTROY_REGISTRY_FAILED;
@@ -558,8 +570,12 @@ RegError ORegistry::destroyRegistry(const OUString& regName)
m_file.close();
m_isOpen = sal_False;
- OString name( OUStringToOString(m_name, RTL_TEXTENCODING_UTF8) );
- if (unlink(name) != 0)
+ OUString systemName;
+ if ( FileBase::getSystemPathFromFileURL(m_name, systemName) != FileBase::E_None )
+ systemName = m_name;
+
+ OString name( OUStringToOString(systemName, osl_getThreadTextEncoding()) );
+ if (unlink(name.getStr()) != 0)
{
return REG_DESTROY_REGISTRY_FAILED;
}
@@ -1558,7 +1574,7 @@ RegError ORegistry::dumpRegistry(RegKeyHandle hKey) const
OStoreDirectory rStoreDir(pKey->getStoreDir());
storeError _err = rStoreDir.first(iter);
- OString regName( OUStringToOString( getName(), RTL_TEXTENCODING_UTF8 ) );
+ OString regName( OUStringToOString( getName(), osl_getThreadTextEncoding() ) );
OString keyName( OUStringToOString( pKey->getName(), RTL_TEXTENCODING_UTF8 ) );
fprintf(stdout, "Registry \"%s\":\n\n%s\n", regName.getStr(), keyName.getStr());