From 96712b12ee364867d5bf818112540f7729999061 Mon Sep 17 00:00:00 2001 From: Daniel Boelzle Date: Tue, 30 Jul 2002 11:00:48 +0000 Subject: #101138# using memory registry if no url given && create flag set --- registry/source/regimpl.cxx | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'registry') diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx index 0575054b8..665ec42cf 100644 --- a/registry/source/regimpl.cxx +++ b/registry/source/regimpl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: regimpl.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: jsc $ $Date: 2002-06-18 17:28:00 $ + * last change: $Author: dbo $ $Date: 2002-07-30 12:00:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -485,7 +485,17 @@ RegError ORegistry::initRegistry(const OUString& regName, RegAccessMode accessMo m_readOnly = sal_True; } - if (errCode = rRegFile.create(regName, sAccessMode, REG_PAGESIZE)) + if (0 == regName.getLength() && + store_AccessCreate == sAccessMode) + { + errCode = rRegFile.createInMemory(); + } + else + { + errCode = rRegFile.create(regName, sAccessMode, REG_PAGESIZE); + } + + if (errCode) { switch (errCode) { @@ -580,14 +590,17 @@ RegError ORegistry::destroyRegistry(const OUString& regName) m_file.close(); m_isOpen = sal_False; - 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) + if (m_name.getLength()) { - return REG_DESTROY_REGISTRY_FAILED; + 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; + } } } else { -- cgit v1.2.3