diff options
author | Noel Grandin <noel@peralex.com> | 2015-04-08 14:45:50 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-04-09 08:41:11 +0200 |
commit | 0833143c271ae444ca83ec16923db9f403f98b86 (patch) | |
tree | 28e12be6bac8bedac51b1b324147c86bddf67c34 /registry | |
parent | 7b4ca582fcfd77b20eea5a11bd0e87b39d640e91 (diff) |
convert RT_ACCESS fields to scoped enum
Change-Id: Ifef0aaae6208f18c1352fef7c471deb60a97820d
Diffstat (limited to 'registry')
-rw-r--r-- | registry/source/reflread.cxx | 8 | ||||
-rw-r--r-- | registry/source/reflwrit.cxx | 8 | ||||
-rw-r--r-- | registry/source/regimpl.cxx | 36 | ||||
-rw-r--r-- | registry/test/testregcpp.cxx | 52 | ||||
-rw-r--r-- | registry/tools/regcompare.cxx | 32 |
5 files changed, 68 insertions, 68 deletions
diff --git a/registry/source/reflread.cxx b/registry/source/reflread.cxx index 15a9d0f4c25c..5b1c58c8dbef 100644 --- a/registry/source/reflread.cxx +++ b/registry/source/reflread.cxx @@ -681,7 +681,7 @@ const sal_Char* FieldList::getFieldType(sal_uInt16 index) RTFieldAccess FieldList::getFieldAccess(sal_uInt16 index) { - RTFieldAccess aAccess = RT_ACCESS_INVALID; + RTFieldAccess aAccess = RTFieldAccess::INVALID; if ((m_numOfEntries > 0) && (index <= m_numOfEntries)) { @@ -878,7 +878,7 @@ const sal_Char* ReferenceList::getReferenceDoku(sal_uInt16 index) RTFieldAccess ReferenceList::getReferenceAccess(sal_uInt16 index) { - RTFieldAccess aAccess = RT_ACCESS_INVALID; + RTFieldAccess aAccess = RTFieldAccess::INVALID; if ((m_numOfEntries > 0) && (index <= m_numOfEntries)) { @@ -1519,7 +1519,7 @@ RTFieldAccess TYPEREG_CALLTYPE typereg_reader_getFieldFlags(void * hEntry, sal_u { TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); - if (pEntry == NULL) return RT_ACCESS_INVALID; + if (pEntry == NULL) return RTFieldAccess::INVALID; return pEntry->m_pFields->getFieldAccess(index); } @@ -1815,7 +1815,7 @@ RTFieldAccess TYPEREG_CALLTYPE typereg_reader_getReferenceFlags(void * hEntry, s { TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry); - if (pEntry == NULL) return RT_ACCESS_INVALID; + if (pEntry == NULL) return RTFieldAccess::INVALID; return pEntry->m_pReferences->getReferenceAccess(index); } diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx index 49beeb0d325c..426911bce518 100644 --- a/registry/source/reflwrit.cxx +++ b/registry/source/reflwrit.cxx @@ -351,7 +351,7 @@ public: }; FieldEntry::FieldEntry() - : m_access(RT_ACCESS_INVALID) + : m_access(RTFieldAccess::INVALID) , m_constValueType(RT_TYPE_NONE) { } @@ -481,7 +481,7 @@ public: ReferenceEntry::ReferenceEntry() : m_type(RT_REF_INVALID) - , m_access(RT_ACCESS_INVALID) + , m_access(RTFieldAccess::INVALID) { } @@ -856,7 +856,7 @@ void TypeWriter::createBlop() cpIndexDoku2 = 0; cpIndexFileName2 = 0; - pBuffer += writeUINT16(pBuffer, m_fields[i].m_access); + pBuffer += writeUINT16(pBuffer, static_cast<sal_uInt16>(m_fields[i].m_access)); if (!m_fields[i].m_name.isEmpty()) { @@ -1060,7 +1060,7 @@ void TypeWriter::createBlop() } pBuffer += writeUINT16(pBuffer, cpIndexDoku2); - pBuffer += writeUINT16(pBuffer, m_references[i].m_access); + pBuffer += writeUINT16(pBuffer, static_cast<sal_uInt16>(m_references[i].m_access)); } } diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx index a1ed1ffba133..09afcc0c5cb7 100644 --- a/registry/source/regimpl.cxx +++ b/registry/source/regimpl.cxx @@ -73,7 +73,7 @@ void printString(OUString const & s) { void printFieldOrReferenceFlag( RTFieldAccess * flags, RTFieldAccess flag, char const * name, bool * first) { - if ((*flags & flag) != 0) { + if ((*flags & flag) != RTFieldAccess::NONE) { if (!*first) { printf("|"); } @@ -84,39 +84,39 @@ void printFieldOrReferenceFlag( } void printFieldOrReferenceFlags(RTFieldAccess flags) { - if (flags == 0) { + if (flags == RTFieldAccess::NONE) { printf("none"); } else { bool first = true; printFieldOrReferenceFlag( - &flags, RT_ACCESS_READONLY, "readonly", &first); + &flags, RTFieldAccess::READONLY, "readonly", &first); printFieldOrReferenceFlag( - &flags, RT_ACCESS_OPTIONAL, "optional", &first); + &flags, RTFieldAccess::OPTIONAL, "optional", &first); printFieldOrReferenceFlag( - &flags, RT_ACCESS_MAYBEVOID, "maybevoid", &first); - printFieldOrReferenceFlag(&flags, RT_ACCESS_BOUND, "bound", &first); + &flags, RTFieldAccess::MAYBEVOID, "maybevoid", &first); + printFieldOrReferenceFlag(&flags, RTFieldAccess::BOUND, "bound", &first); printFieldOrReferenceFlag( - &flags, RT_ACCESS_CONSTRAINED, "constrained", &first); + &flags, RTFieldAccess::CONSTRAINED, "constrained", &first); printFieldOrReferenceFlag( - &flags, RT_ACCESS_TRANSIENT, "transient", &first); + &flags, RTFieldAccess::TRANSIENT, "transient", &first); printFieldOrReferenceFlag( - &flags, RT_ACCESS_MAYBEAMBIGUOUS, "maybeambiguous", &first); + &flags, RTFieldAccess::MAYBEAMBIGUOUS, "maybeambiguous", &first); printFieldOrReferenceFlag( - &flags, RT_ACCESS_MAYBEDEFAULT, "maybedefault", &first); + &flags, RTFieldAccess::MAYBEDEFAULT, "maybedefault", &first); printFieldOrReferenceFlag( - &flags, RT_ACCESS_REMOVABLE, "removable", &first); + &flags, RTFieldAccess::REMOVABLE, "removable", &first); printFieldOrReferenceFlag( - &flags, RT_ACCESS_ATTRIBUTE, "attribute", &first); + &flags, RTFieldAccess::ATTRIBUTE, "attribute", &first); printFieldOrReferenceFlag( - &flags, RT_ACCESS_PROPERTY, "property", &first); - printFieldOrReferenceFlag(&flags, RT_ACCESS_CONST, "const", &first); + &flags, RTFieldAccess::PROPERTY, "property", &first); + printFieldOrReferenceFlag(&flags, RTFieldAccess::CONST, "const", &first); printFieldOrReferenceFlag( - &flags, RT_ACCESS_READWRITE, "readwrite", &first); + &flags, RTFieldAccess::READWRITE, "readwrite", &first); printFieldOrReferenceFlag( - &flags, RT_ACCESS_PARAMETERIZED_TYPE, "parameterized type", &first); + &flags, RTFieldAccess::PARAMETERIZED_TYPE, "parameterized type", &first); printFieldOrReferenceFlag( - &flags, RT_ACCESS_PUBLISHED, "published", &first); - if (flags != 0) { + &flags, RTFieldAccess::PUBLISHED, "published", &first); + if (flags != RTFieldAccess::NONE) { if (!first) { printf("|"); } diff --git a/registry/test/testregcpp.cxx b/registry/test/testregcpp.cxx index 514accf99822..e7853c36b81e 100644 --- a/registry/test/testregcpp.cxx +++ b/registry/test/testregcpp.cxx @@ -65,60 +65,60 @@ void test_coreReflection() writer.setFieldData(0, OUString("aConstBool"), OUString("boolean"), OUString("ich bin ein boolean"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); aConst.m_type = RT_TYPE_BYTE; aConst.m_value.aByte = 127; writer.setFieldData(1, OUString("aConstByte"), OUString("byte"), OUString("ich bin ein byte"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); aConst.m_type = RT_TYPE_INT16; aConst.m_value.aShort = -10; writer.setFieldData(2, OUString("aConstShort"), OUString("short"), OUString("ich bin ein short"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); aConst.m_type = RT_TYPE_UINT16; aConst.m_value.aUShort = 10; writer.setFieldData(3, OUString("aConstUShort"), OUString("unsigned short"), OUString("ich bin ein unsigned short"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); aConst.m_type = RT_TYPE_INT32; aConst.m_value.aLong = -100000; writer.setFieldData(4, OUString("aConstLong"), OUString("long"), OUString("ich bin ein long"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); aConst.m_type = RT_TYPE_UINT32; aConst.m_value.aULong = 100000; writer.setFieldData(5, OUString("aConstULong"), OUString("unsigned long"), OUString("ich bin ein unsigned long"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); aConst.m_type = RT_TYPE_INT64; aConst.m_value.aHyper = -100000000; writer.setFieldData(6, OUString("aConstHyper"), OUString("hyper"), OUString("ich bin ein hyper"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); aConst.m_type = RT_TYPE_UINT64; aConst.m_value.aUHyper = 100000000; writer.setFieldData(7, OUString("aConstULong"), OUString("unsigned long"), OUString("ich bin ein unsigned long"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); aConst.m_type = RT_TYPE_FLOAT; aConst.m_value.aFloat = -2e-10f; writer.setFieldData(8, OUString("aConstFloat"), OUString("float"), OUString("ich bin ein float"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); aConst.m_type = RT_TYPE_DOUBLE; aConst.m_value.aDouble = -2e-100; writer.setFieldData(9, OUString("aConstDouble"), OUString("double"), OUString("ich bin ein double"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); aConst.m_type = RT_TYPE_STRING; OUString tmpStr("dies ist ein unicode string"); aConst.m_value.aString = tmpStr.getStr(); @@ -126,7 +126,7 @@ void test_coreReflection() writer.setFieldData(10, OUString("aConstString"), OUString("string"), OUString("ich bin ein string"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); const sal_uInt8* pBlop = writer.getBlop(); sal_uInt32 aBlopSize = writer.getBlopSize(); @@ -167,13 +167,13 @@ void test_coreReflection() writer.setFieldData(0, OUString("asal_uInt32"), OUString("unsigned long"), - OUString(), OUString(), RT_ACCESS_READWRITE); + OUString(), OUString(), RTFieldAccess::READWRITE); writer.setFieldData(1, OUString("aXInterface"), OUString("stardiv/uno/XInterface"), - OUString(), OUString(), RT_ACCESS_READWRITE); + OUString(), OUString(), RTFieldAccess::READWRITE); writer.setFieldData(2, OUString("aSequence"), OUString("[]ModuleA/EnumA"), - OUString(), OUString(), RT_ACCESS_READWRITE); + OUString(), OUString(), RTFieldAccess::READWRITE); const sal_uInt8* pBlop = writer.getBlop(); sal_uInt32 aBlopSize = writer.getBlopSize(); @@ -196,11 +196,11 @@ void test_coreReflection() writer.setFieldData(0, OUString("ENUM_VAL_1"), OUString(), OUString("ich bin ein enum value"), - OUString(), RT_ACCESS_CONST, aConst); + OUString(), RTFieldAccess::CONST, aConst); aConst.m_value.aULong = 10; writer.setFieldData(1, OUString("ENUM_VAL_2"), - OUString(), OUString(), OUString(), RT_ACCESS_CONST, aConst); + OUString(), OUString(), OUString(), RTFieldAccess::CONST, aConst); const sal_uInt8* pBlop = writer.getBlop(); sal_uInt32 aBlopSize = writer.getBlopSize(); @@ -222,17 +222,17 @@ void test_coreReflection() writer.setFileName(OUString("DummyFile")); writer.setFieldData(0, OUString("aString"), - OUString("string"), OUString(), OUString(), RT_ACCESS_READWRITE); + OUString("string"), OUString(), OUString(), RTFieldAccess::READWRITE); writer.setFieldData(1, OUString("aStruct"), OUString("ModuleA/StructA"), - OUString(), OUString(), RT_ACCESS_READONLY); + OUString(), OUString(), RTFieldAccess::READONLY); writer.setFieldData(2, OUString("aEnum"), - OUString("ModuleA/EnumA"), OUString(), OUString(), RT_ACCESS_BOUND); + OUString("ModuleA/EnumA"), OUString(), OUString(), RTFieldAccess::BOUND); aConst.m_type = RT_TYPE_UINT16; aConst.m_value.aUShort = 12; writer.setFieldData(3, OUString("aConstUShort"), OUString("unsigned short"), OUString(), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); writer.setMethodData(0, OUString("methodA"), OUString("double"), RT_MODE_TWOWAY, 2, 1, @@ -278,7 +278,7 @@ void test_coreReflection() writer.setFieldData(0, OUString("aSource"), OUString("stardiv/uno/XInterface"), OUString("ich bin ein interface member"), - OUString(), RT_ACCESS_READWRITE); + OUString(), RTFieldAccess::READWRITE); const sal_uInt8* pBlop = writer.getBlop(); sal_uInt32 aBlopSize = writer.getBlopSize(); @@ -297,11 +297,11 @@ void test_coreReflection() writer.setFieldData(0, OUString("aProperty"), OUString("stardiv/uno/XInterface"), OUString("ich bin eine property"), - OUString(), RT_ACCESS_READWRITE); + OUString(), RTFieldAccess::READWRITE); writer.setReferenceData(0, OUString("ModuleA/XInterfaceA"), RT_REF_SUPPORTS, OUString("Hallo ich eine Reference auf ein supported interface"), - RT_ACCESS_OPTIONAL); + RTFieldAccess::OPTIONAL); writer.setReferenceData(1, OUString("ModuleA/XInterfaceA"), RT_REF_OBSERVES, OUString("Hallo ich eine Reference auf ein observed interface")); writer.setReferenceData(2, OUString("ModuleA/ServiceB"), RT_REF_EXPORTS, @@ -345,19 +345,19 @@ void test_coreReflection() writer.setFieldData(0, OUString("ConstantsA_aConstBool"), OUString("boolean"), OUString("ich bin ein boolean"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); aConst.m_type = RT_TYPE_BYTE; aConst.m_value.aByte = 127; writer.setFieldData(1, OUString("ConstantsA_aConstByte"), OUString("byte"), OUString("ich bin ein byte"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); aConst.m_type = RT_TYPE_INT16; aConst.m_value.aShort = -10; writer.setFieldData(2, OUString("ConstantsA_aConstShort"), OUString("short"), OUString("ich bin ein short"), - OUString("DummyFile"), RT_ACCESS_CONST, aConst); + OUString("DummyFile"), RTFieldAccess::CONST, aConst); const sal_uInt8* pBlop = writer.getBlop(); sal_uInt32 aBlopSize = writer.getBlopSize(); diff --git a/registry/tools/regcompare.cxx b/registry/tools/regcompare.cxx index def055ab7ced..2018f57e40e0 100644 --- a/registry/tools/regcompare.cxx +++ b/registry/tools/regcompare.cxx @@ -305,59 +305,59 @@ static char const * getTypeClass(RTTypeClass typeClass) static OString getFieldAccess(RTFieldAccess fieldAccess) { OString ret; - if ( (fieldAccess & RT_ACCESS_INVALID) == RT_ACCESS_INVALID ) + if ( (fieldAccess & RTFieldAccess::INVALID) == RTFieldAccess::INVALID ) { ret += OString("INVALID"); } - if ( (fieldAccess & RT_ACCESS_READONLY) == RT_ACCESS_READONLY ) + if ( (fieldAccess & RTFieldAccess::READONLY) == RTFieldAccess::READONLY ) { ret += OString(ret.isEmpty() ? "READONLY" : ",READONLY"); } - if ( (fieldAccess & RT_ACCESS_OPTIONAL) == RT_ACCESS_OPTIONAL ) + if ( (fieldAccess & RTFieldAccess::OPTIONAL) == RTFieldAccess::OPTIONAL ) { ret += OString(ret.isEmpty() ? "OPTIONAL" : ",OPTIONAL"); } - if ( (fieldAccess & RT_ACCESS_MAYBEVOID) == RT_ACCESS_MAYBEVOID ) + if ( (fieldAccess & RTFieldAccess::MAYBEVOID) == RTFieldAccess::MAYBEVOID ) { ret += OString(ret.isEmpty() ? "MAYBEVOID" : ",MAYBEVOID"); } - if ( (fieldAccess & RT_ACCESS_BOUND) == RT_ACCESS_BOUND ) + if ( (fieldAccess & RTFieldAccess::BOUND) == RTFieldAccess::BOUND ) { ret += OString(ret.isEmpty() ? "BOUND" : ",BOUND"); } - if ( (fieldAccess & RT_ACCESS_CONSTRAINED) == RT_ACCESS_CONSTRAINED ) + if ( (fieldAccess & RTFieldAccess::CONSTRAINED) == RTFieldAccess::CONSTRAINED ) { ret += OString(ret.isEmpty() ? "CONSTRAINED" : ",CONSTRAINED"); } - if ( (fieldAccess & RT_ACCESS_TRANSIENT) == RT_ACCESS_TRANSIENT ) + if ( (fieldAccess & RTFieldAccess::TRANSIENT) == RTFieldAccess::TRANSIENT ) { ret += OString(ret.isEmpty() ? "TRANSIENT" : ",TRANSIENT"); } - if ( (fieldAccess & RT_ACCESS_MAYBEAMBIGUOUS) == RT_ACCESS_MAYBEAMBIGUOUS ) + if ( (fieldAccess & RTFieldAccess::MAYBEAMBIGUOUS) == RTFieldAccess::MAYBEAMBIGUOUS ) { ret += OString(ret.isEmpty() ? "MAYBEAMBIGUOUS" : ",MAYBEAMBIGUOUS"); } - if ( (fieldAccess & RT_ACCESS_MAYBEDEFAULT) == RT_ACCESS_MAYBEDEFAULT ) + if ( (fieldAccess & RTFieldAccess::MAYBEDEFAULT) == RTFieldAccess::MAYBEDEFAULT ) { ret += OString(ret.isEmpty() ? "MAYBEDEFAULT" : ",MAYBEDEFAULT"); } - if ( (fieldAccess & RT_ACCESS_REMOVABLE) == RT_ACCESS_REMOVABLE ) + if ( (fieldAccess & RTFieldAccess::REMOVABLE) == RTFieldAccess::REMOVABLE ) { ret += OString(ret.isEmpty() ? "REMOVABLE" : ",REMOVABLE"); } - if ( (fieldAccess & RT_ACCESS_ATTRIBUTE) == RT_ACCESS_ATTRIBUTE ) + if ( (fieldAccess & RTFieldAccess::ATTRIBUTE) == RTFieldAccess::ATTRIBUTE ) { ret += OString(ret.isEmpty() ? "ATTRIBUTE" : ",ATTRIBUTE"); } - if ( (fieldAccess & RT_ACCESS_PROPERTY) == RT_ACCESS_PROPERTY ) + if ( (fieldAccess & RTFieldAccess::PROPERTY) == RTFieldAccess::PROPERTY ) { ret += OString(ret.isEmpty() ? "PROPERTY" : ",PROPERTY"); } - if ( (fieldAccess & RT_ACCESS_CONST) == RT_ACCESS_CONST ) + if ( (fieldAccess & RTFieldAccess::CONST) == RTFieldAccess::CONST ) { ret += OString(ret.isEmpty() ? "CONST" : ",CONST"); } - if ( (fieldAccess & RT_ACCESS_READWRITE) == RT_ACCESS_READWRITE ) + if ( (fieldAccess & RTFieldAccess::READWRITE) == RTFieldAccess::READWRITE ) { ret += OString(ret.isEmpty() ? "READWRITE" : ",READWRITE"); } @@ -1015,7 +1015,7 @@ static sal_uInt32 checkFieldsWithoutOrder(Options_Impl const & options, { if ( moreProps.find(j) == moreProps.end() ) { - if ( (reader2.getFieldFlags(j) & RT_ACCESS_OPTIONAL) != RT_ACCESS_OPTIONAL ) + if ( (reader2.getFieldFlags(j) & RTFieldAccess::OPTIONAL) != RTFieldAccess::OPTIONAL ) { if ( options.forceOutput() ) { @@ -1251,7 +1251,7 @@ static sal_uInt32 checkBlob( { if ( moreReferences.find(j) == moreReferences.end() ) { - if ( (reader2.getReferenceFlags(j) & RT_ACCESS_OPTIONAL) != RT_ACCESS_OPTIONAL ) + if ( (reader2.getReferenceFlags(j) & RTFieldAccess::OPTIONAL) != RTFieldAccess::OPTIONAL ) { if ( options.forceOutput() ) { |