diff options
author | sb <sb@openoffice.org> | 2010-04-07 13:14:23 +0200 |
---|---|---|
committer | sb <sb@openoffice.org> | 2010-04-07 13:14:23 +0200 |
commit | 66597e72124ff5e2cc91395262498fc84906b769 (patch) | |
tree | a75df91ba8131012ab0ce1d975bf7a5a31b2617c /idlc/source | |
parent | 9d09cf39be3e28e14f28e88a01cc4bdb83eb449d (diff) | |
parent | 9734c73c9a61fc5ef4e263617add17914a9b5f15 (diff) |
sb118: merged in re/DEV300_next towards DEV300_m76
Diffstat (limited to 'idlc/source')
-rw-r--r-- | idlc/source/astdump.cxx | 4 | ||||
-rw-r--r-- | idlc/source/idlcproduce.cxx | 22 |
2 files changed, 11 insertions, 15 deletions
diff --git a/idlc/source/astdump.cxx b/idlc/source/astdump.cxx index 2c8a7d8b6638..3934cfb67e19 100644 --- a/idlc/source/astdump.cxx +++ b/idlc/source/astdump.cxx @@ -134,6 +134,10 @@ sal_Bool AstModule::dump(RegistryKey& rKey) } } } + if ( getNodeType() == NT_root ) + { + localKey.releaseKey(); + } return AstDeclaration::dump(rKey); } diff --git a/idlc/source/idlcproduce.cxx b/idlc/source/idlcproduce.cxx index b7c4bc57dfc3..e20b7da1c42b 100644 --- a/idlc/source/idlcproduce.cxx +++ b/idlc/source/idlcproduce.cxx @@ -146,11 +146,11 @@ sal_Int32 SAL_CALL produceFile(const OString& regFileName) return 1; } - Registry regFile; - removeIfExists(regTmpName); OString urlRegTmpName = convertToFileUrl(regTmpName); - if ( regFile.create(OStringToOUString(urlRegTmpName, RTL_TEXTENCODING_UTF8)) ) + + Registry regFile; + if ( regFile.create(OStringToOUString(urlRegTmpName, RTL_TEXTENCODING_UTF8)) != REG_NO_ERROR ) { fprintf(stderr, "%s: could not create registry file '%s'\n", pOptions->getProgramName().getStr(), regTmpName.getStr()); @@ -161,7 +161,7 @@ sal_Int32 SAL_CALL produceFile(const OString& regFileName) } RegistryKey rootKey; - if ( regFile.openRootKey(rootKey) ) + if ( regFile.openRootKey(rootKey) != REG_NO_ERROR ) { fprintf(stderr, "%s: could not open root of registry file '%s'\n", pOptions->getProgramName().getStr(), regFileName.getStr()); @@ -174,7 +174,7 @@ sal_Int32 SAL_CALL produceFile(const OString& regFileName) // produce registry file if ( !idlc()->getRoot()->dump(rootKey) ) { - rootKey.closeKey(); + rootKey.releaseKey(); regFile.close(); regFile.destroy(OStringToOUString(regFileName, RTL_TEXTENCODING_UTF8)); removeIfExists(regFileName); @@ -182,16 +182,8 @@ sal_Int32 SAL_CALL produceFile(const OString& regFileName) return 1; } - if ( rootKey.closeKey() ) - { - fprintf(stderr, "%s: could not close root of registry file '%s'\n", - pOptions->getProgramName().getStr(), regFileName.getStr()); - removeIfExists(regTmpName); - removeIfExists(regFileName); - cleanPath(); - return 1; - } - if ( regFile.close() ) + rootKey.releaseKey(); + if ( regFile.close() != REG_NO_ERROR ) { fprintf(stderr, "%s: could not close registry file '%s'\n", pOptions->getProgramName().getStr(), regFileName.getStr()); |