summaryrefslogtreecommitdiff
path: root/registry
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2011-11-21 18:21:04 +0100
committerMichael Stahl <mstahl@redhat.com>2011-11-21 22:46:19 +0100
commitd4be9c7a2bfb8d682c4a2c781e5c58b72be47b6a (patch)
tree2815f3bc2685a85320f68ef157bc130196241d54 /registry
parentd63d64c4dea4d29592d21ff2841fc4df25a8373d (diff)
regcompare: fix error reporting:
Function checkField() is called from 2 different contexts, one of which must not report errors, but the other should.
Diffstat (limited to 'registry')
-rw-r--r--registry/tools/regcompare.cxx18
1 files changed, 10 insertions, 8 deletions
diff --git a/registry/tools/regcompare.cxx b/registry/tools/regcompare.cxx
index 44f725ce0d49..1cba9069527b 100644
--- a/registry/tools/regcompare.cxx
+++ b/registry/tools/regcompare.cxx
@@ -630,6 +630,7 @@ static sal_uInt32 checkConstValue(Options_Impl const & options,
return 0;
}
+enum verbosity_t {SILENT, REPORT};
static sal_uInt32 checkField(Options_Impl const & options,
const OUString& keyName,
RTTypeClass typeClass,
@@ -637,12 +638,13 @@ static sal_uInt32 checkField(Options_Impl const & options,
typereg::Reader& reader1,
typereg::Reader& reader2,
sal_uInt16 index1,
- sal_uInt16 index2)
+ sal_uInt16 index2,
+ verbosity_t const eVerbosity)
{
sal_uInt32 nError = 0;
if ( reader1.getFieldName(index1) != reader2.getFieldName(index2) )
{
- if ( options.forceOutput() && !options.unoTypeCheck() )
+ if (options.forceOutput() && (REPORT == eVerbosity))
{
dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Field %d: Name1 = %s != Name2 = %s\n", index1,
@@ -652,7 +654,7 @@ static sal_uInt32 checkField(Options_Impl const & options,
}
if ( reader1.getFieldTypeName(index1) != reader2.getFieldTypeName(index2) )
{
- if ( options.forceOutput() && !options.unoTypeCheck() )
+ if (options.forceOutput() && (REPORT == eVerbosity))
{
dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Field %d: Type1 = %s != Type2 = %s\n", index1,
@@ -666,7 +668,7 @@ static sal_uInt32 checkField(Options_Impl const & options,
RTConstValue constValue2 = reader2.getFieldValue(index2);
if ( constValue1.m_type != constValue2.m_type )
{
- if ( options.forceOutput() && !options.unoTypeCheck() )
+ if (options.forceOutput() && (REPORT == eVerbosity))
{
dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Field %d: Access1 = %s != Access2 = %s\n", index1,
@@ -687,7 +689,7 @@ static sal_uInt32 checkField(Options_Impl const & options,
if ( reader1.getFieldFlags(index1) != reader2.getFieldFlags(index2) )
{
- if ( options.forceOutput() && !options.unoTypeCheck() )
+ if (options.forceOutput() && (REPORT == eVerbosity))
{
dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Field %d: FieldAccess1 = %s != FieldAccess2 = %s\n", index1,
@@ -699,7 +701,7 @@ static sal_uInt32 checkField(Options_Impl const & options,
if ( options.fullCheck() && (reader1.getFieldDocumentation(index1) != reader2.getFieldDocumentation(index2)) )
{
- if ( options.forceOutput() && !options.unoTypeCheck() )
+ if (options.forceOutput() && (REPORT == eVerbosity))
{
dumpTypeClass (bDump, typeClass, keyName);
fprintf(stdout, " Field %d: Doku1 = %s\n Doku2 = %s\n", index1,
@@ -1000,7 +1002,7 @@ static sal_uInt32 checkFieldsWithoutOrder(Options_Impl const & options,
{
for (j=0; j < nFields2; j++)
{
- if (!checkField(options, keyName, typeClass, bDump, reader1, reader2, i, j))
+ if (!checkField(options, keyName, typeClass, bDump, reader1, reader2, i, j, SILENT))
{
bFound = sal_True;
moreProps.insert(j);
@@ -1162,7 +1164,7 @@ static sal_uInt32 checkBlob(
sal_uInt16 i;
for (i=0; i < nFields1 && i < nFields2; i++)
{
- nError += checkField(options, keyName, typeClass, bDump, reader1, reader2, i, i);
+ nError += checkField(options, keyName, typeClass, bDump, reader1, reader2, i, i, REPORT);
}
if ( i < nFields1 && options.forceOutput() )
{