summaryrefslogtreecommitdiff
path: root/idlc
diff options
context:
space:
mode:
authorsb <sb@openoffice.org>2010-04-07 13:14:23 +0200
committersb <sb@openoffice.org>2010-04-07 13:14:23 +0200
commit2125356e5c460ce83ff62fccade80434430a4023 (patch)
treecfaf6ae042dbc6ed639b16c5d7fde10519cf7d7e /idlc
parentc4d2bd89eb5c97d6ddb60cc72c9cd5061342bd63 (diff)
parent03c229bb415b533f683217657ed72b4e250a6f64 (diff)
sb118: merged in re/DEV300_next towards DEV300_m76
Diffstat (limited to 'idlc')
-rw-r--r--idlc/source/astdump.cxx4
-rw-r--r--idlc/source/idlcproduce.cxx24
2 files changed, 12 insertions, 16 deletions
diff --git a/idlc/source/astdump.cxx b/idlc/source/astdump.cxx
index 94c5c0239..7e4e7ab75 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 2c07fd096..f37619f6a 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,24 +174,16 @@ 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);
cleanPath();
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());