diff options
author | Noel Grandin <noel@peralex.com> | 2016-02-23 12:01:14 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-02-24 11:48:38 +0200 |
commit | cd1bbdf0a494298882f79add7b5f28c3b56d9a14 (patch) | |
tree | bef29e2648302ce58ace4e9ff7d110cd2205bcb0 /unodevtools/source | |
parent | 6ddc80e53a601cdf6984e36a56cd18b2e99377bc (diff) |
convert codemaker::UnoType::Sort to scoped enum
Change-Id: I70a84f777e714bcc20c2d7b06b918e3be0f3ce4a
Diffstat (limited to 'unodevtools/source')
-rw-r--r-- | unodevtools/source/skeletonmaker/cppcompskeleton.cxx | 2 | ||||
-rw-r--r-- | unodevtools/source/skeletonmaker/cpptypemaker.cxx | 118 | ||||
-rw-r--r-- | unodevtools/source/skeletonmaker/javatypemaker.cxx | 116 | ||||
-rw-r--r-- | unodevtools/source/skeletonmaker/skeletoncommon.cxx | 28 |
4 files changed, 132 insertions, 132 deletions
diff --git a/unodevtools/source/skeletonmaker/cppcompskeleton.cxx b/unodevtools/source/skeletonmaker/cppcompskeleton.cxx index dc49eb8bb5bd..4b6aa7d57f51 100644 --- a/unodevtools/source/skeletonmaker/cppcompskeleton.cxx +++ b/unodevtools/source/skeletonmaker/cppcompskeleton.cxx @@ -585,7 +585,7 @@ void generateMemberInitialization(std::ostream& o, { sal_Int32 rank; if ((manager->decompose(i->type, true, nullptr, &rank, nullptr, nullptr) - <= codemaker::UnoType::SORT_CHAR) + <= codemaker::UnoType::Sort::Char) && rank == 0) { o << ",\n m_" << i->name << "("; diff --git a/unodevtools/source/skeletonmaker/cpptypemaker.cxx b/unodevtools/source/skeletonmaker/cpptypemaker.cxx index 4472f3f943f1..1fdeabd15201 100644 --- a/unodevtools/source/skeletonmaker/cpptypemaker.cxx +++ b/unodevtools/source/skeletonmaker/cpptypemaker.cxx @@ -38,21 +38,21 @@ void printType( rtl::Reference< unoidl::Entity > const & entity, short referenceType, bool defaultvalue) { - if (defaultvalue && rank == 0 && sort <= codemaker::UnoType::SORT_CHAR) { + if (defaultvalue && rank == 0 && sort <= codemaker::UnoType::Sort::Char) { switch (sort) { - case codemaker::UnoType::SORT_BOOLEAN: + case codemaker::UnoType::Sort::Boolean: o << "sal_False"; return; - case codemaker::UnoType::SORT_CHAR: - case codemaker::UnoType::SORT_BYTE: - case codemaker::UnoType::SORT_SHORT: - case codemaker::UnoType::SORT_UNSIGNED_SHORT: - case codemaker::UnoType::SORT_LONG: - case codemaker::UnoType::SORT_UNSIGNED_LONG: - case codemaker::UnoType::SORT_HYPER: - case codemaker::UnoType::SORT_UNSIGNED_HYPER: - case codemaker::UnoType::SORT_FLOAT: - case codemaker::UnoType::SORT_DOUBLE: + case codemaker::UnoType::Sort::Char: + case codemaker::UnoType::Sort::Byte: + case codemaker::UnoType::Sort::Short: + case codemaker::UnoType::Sort::UnsignedShort: + case codemaker::UnoType::Sort::Long: + case codemaker::UnoType::Sort::UnsignedLong: + case codemaker::UnoType::Sort::Hyper: + case codemaker::UnoType::Sort::UnsignedHyper: + case codemaker::UnoType::Sort::Float: + case codemaker::UnoType::Sort::Double: o << "0"; return; default: @@ -61,7 +61,7 @@ void printType( } if (defaultvalue && referenceType == 16) { - if (sort == codemaker::UnoType::SORT_ENUM_TYPE) { + if (sort == codemaker::UnoType::Sort::Enum) { o << nucleus.copy(nucleus.lastIndexOf('.') + 1) << "_" << dynamic_cast< unoidl::EnumTypeEntity * >(entity.get())-> getMembers()[0].name; @@ -69,10 +69,10 @@ void printType( return; } bool bReference = false; - if (((sort > codemaker::UnoType::SORT_CHAR || + if (((sort > codemaker::UnoType::Sort::Char || rank > 0) && referenceType != 8 && - !(sort == codemaker::UnoType::SORT_ENUM_TYPE && referenceType == 4 && rank == 0)) || - (sort <= codemaker::UnoType::SORT_CHAR && referenceType == 2)) + !(sort == codemaker::UnoType::Sort::Enum && referenceType == 4 && rank == 0)) || + (sort <= codemaker::UnoType::Sort::Char && referenceType == 2)) { bReference = true; } @@ -84,7 +84,7 @@ void printType( o << ((options.shortnames) ? "css::uno::Sequence< " : "::com::sun::star::uno::Sequence< "); } - if (sort == codemaker::UnoType::SORT_INTERFACE_TYPE && referenceType > 0) { + if (sort == codemaker::UnoType::Sort::Interface && referenceType > 0) { o << ((options.shortnames) ? "css::uno::Reference< " : "::com::sun::star::uno::Reference< "); } @@ -92,7 +92,7 @@ void printType( o << scopedCppName(codemaker::cpp::translateUnoToCppType(sort, nucleus), options.shortnames && referenceType > 0); - if (sort == codemaker::UnoType::SORT_INTERFACE_TYPE && referenceType > 0) + if (sort == codemaker::UnoType::Sort::Interface && referenceType > 0) o << " >"; if (!arguments.empty()) { @@ -114,7 +114,7 @@ void printType( if (bReference && referenceType > 1) o << " &"; - if (referenceType == 8 && (sort > codemaker::UnoType::SORT_CHAR || rank > 0)) + if (referenceType == 8 && (sort > codemaker::UnoType::Sort::Char || rank > 0)) o << "()"; } @@ -143,7 +143,7 @@ bool printConstructorParameters( { bool previous = false; switch (sort) { - case codemaker::UnoType::SORT_PLAIN_STRUCT_TYPE: + case codemaker::UnoType::Sort::PlainStruct: { rtl::Reference< unoidl::PlainStructTypeEntity > ent2( dynamic_cast< unoidl::PlainStructTypeEntity * >(entity.get())); @@ -171,7 +171,7 @@ bool printConstructorParameters( } break; } - case codemaker::UnoType::SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE: + case codemaker::UnoType::Sort::PolymorphicStructTemplate: { rtl::Reference< unoidl::PolymorphicStructTypeTemplateEntity > ent2( dynamic_cast< unoidl::PolymorphicStructTypeTemplateEntity * >( @@ -197,7 +197,7 @@ bool printConstructorParameters( } break; } - case codemaker::UnoType::SORT_INSTANTIATED_POLYMORPHIC_STRUCT_TYPE: + case codemaker::UnoType::Sort::InstantiatedPolymorphicStruct: { rtl::Reference< unoidl::PolymorphicStructTypeTemplateEntity > ent2( dynamic_cast< unoidl::PolymorphicStructTypeTemplateEntity * >( @@ -232,7 +232,7 @@ bool printConstructorParameters( } break; } - case codemaker::UnoType::SORT_EXCEPTION_TYPE: + case codemaker::UnoType::Sort::Exception: { rtl::Reference< unoidl::ExceptionTypeEntity > ent2( dynamic_cast< unoidl::ExceptionTypeEntity * >(entity.get())); @@ -498,7 +498,7 @@ void printMethods(std::ostream & o, generated.add(u2b(name)); rtl::Reference< unoidl::Entity > ent; - if (manager->getSort(name, &ent) != codemaker::UnoType::SORT_INTERFACE_TYPE) + if (manager->getSort(name, &ent) != codemaker::UnoType::Sort::Interface) { throw CannotDumpException( "unexpected entity \"" + name @@ -658,7 +658,7 @@ void printConstructors( { rtl::Reference< unoidl::Entity > ent; if (manager->getSort(name, &ent) - != codemaker::UnoType::SORT_SINGLE_INTERFACE_BASED_SERVICE) + != codemaker::UnoType::Sort::SingleInterfaceBasedService) { throw CannotDumpException( "unexpected entity \"" + name @@ -772,9 +772,9 @@ void generateDocumentation(std::ostream & o, bool comment = true; if (!delegate.isEmpty()) { - if (sort != codemaker::UnoType::SORT_INTERFACE_TYPE && - sort != codemaker::UnoType::SORT_SINGLE_INTERFACE_BASED_SERVICE && - sort != codemaker::UnoType::SORT_ACCUMULATION_BASED_SERVICE ) + if (sort != codemaker::UnoType::Sort::Interface && + sort != codemaker::UnoType::Sort::SingleInterfaceBasedService && + sort != codemaker::UnoType::Sort::AccumulationBasedService ) { return; } @@ -785,59 +785,59 @@ void generateDocumentation(std::ostream & o, o << "\n// UNO"; if (rank != 0) { o << " sequence type"; - } else if (sort <= codemaker::UnoType::SORT_ANY) { + } else if (sort <= codemaker::UnoType::Sort::Any) { o << " simple type"; } else { switch (sort) { - case codemaker::UnoType::SORT_INTERFACE_TYPE: + case codemaker::UnoType::Sort::Interface: o << " interface type"; break; - case codemaker::UnoType::SORT_MODULE: + case codemaker::UnoType::Sort::Module: o << "IDL module"; break; - case codemaker::UnoType::SORT_PLAIN_STRUCT_TYPE: + case codemaker::UnoType::Sort::PlainStruct: o << " simple struct type"; break; - case codemaker::UnoType::SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE: + case codemaker::UnoType::Sort::PolymorphicStructTemplate: o << " polymorphic struct type template"; break; - case codemaker::UnoType::SORT_INSTANTIATED_POLYMORPHIC_STRUCT_TYPE: + case codemaker::UnoType::Sort::InstantiatedPolymorphicStruct: o << " instantiated polymorphic struct type"; break; - case codemaker::UnoType::SORT_ENUM_TYPE: + case codemaker::UnoType::Sort::Enum: o << " enum type"; break; - case codemaker::UnoType::SORT_EXCEPTION_TYPE: + case codemaker::UnoType::Sort::Exception: o << " exception type"; break; - case codemaker::UnoType::SORT_TYPEDEF: + case codemaker::UnoType::Sort::Typedef: o << "IDL typedef"; break; - case codemaker::UnoType::SORT_SINGLE_INTERFACE_BASED_SERVICE: + case codemaker::UnoType::Sort::SingleInterfaceBasedService: o << " single-inheritance--based service"; break; - case codemaker::UnoType::SORT_ACCUMULATION_BASED_SERVICE: + case codemaker::UnoType::Sort::AccumulationBasedService: o << "IDL accumulation-based service"; break; - case codemaker::UnoType::SORT_INTERFACE_BASED_SINGLETON: + case codemaker::UnoType::Sort::InterfaceBasedSingleton: o << " inheritance-based singleton"; break; - case codemaker::UnoType::SORT_SERVICE_BASED_SINGLETON: + case codemaker::UnoType::Sort::ServiceBasedSingleton: o << "IDL service-based singleton"; break; - case codemaker::UnoType::SORT_CONSTANT_GROUP: + case codemaker::UnoType::Sort::ConstantGroup: o << "IDL constant group"; break; @@ -859,7 +859,7 @@ void generateDocumentation(std::ostream & o, "array"); o << '\n'; } - } else if (sort <= codemaker::UnoType::SORT_ANY) { + } else if (sort <= codemaker::UnoType::Sort::Any) { if (comment) { printMapsToCppType( o, options, manager, sort, nucleus, rank, arguments, entity, nullptr); @@ -867,7 +867,7 @@ void generateDocumentation(std::ostream & o, } } else { switch (sort) { - case codemaker::UnoType::SORT_INTERFACE_TYPE: + case codemaker::UnoType::Sort::Interface: if (comment) printMapsToCppType( o, options, manager, sort, nucleus, rank, arguments, entity, @@ -886,70 +886,70 @@ void generateDocumentation(std::ostream & o, } break; - case codemaker::UnoType::SORT_MODULE: + case codemaker::UnoType::Sort::Module: printMapsToCppType( o, options, manager, sort, nucleus, rank, arguments, entity, "namespace"); o << '\n'; break; - case codemaker::UnoType::SORT_PLAIN_STRUCT_TYPE: + case codemaker::UnoType::Sort::PlainStruct: printMapsToCppType( o, options, manager, sort, nucleus, rank, arguments, entity, "class"); o << "; full constructor:\n"; printConstructor( - o, options, manager, codemaker::UnoType::SORT_PLAIN_STRUCT_TYPE, + o, options, manager, codemaker::UnoType::Sort::PlainStruct, entity, nucleus, arguments); break; - case codemaker::UnoType::SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE: + case codemaker::UnoType::Sort::PolymorphicStructTemplate: printMapsToCppType( o, options, manager, sort, nucleus, rank, arguments, entity, "class template"); o << "; full constructor:\n"; printConstructor( o, options, manager, - codemaker::UnoType::SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE, + codemaker::UnoType::Sort::PolymorphicStructTemplate, entity, nucleus, arguments); break; - case codemaker::UnoType::SORT_INSTANTIATED_POLYMORPHIC_STRUCT_TYPE: + case codemaker::UnoType::Sort::InstantiatedPolymorphicStruct: printMapsToCppType( o, options, manager, sort, nucleus, rank, arguments, entity, "class template instantiation"); o << "; full constructor:\n"; printConstructor( o, options, manager, - codemaker::UnoType::SORT_INSTANTIATED_POLYMORPHIC_STRUCT_TYPE, + codemaker::UnoType::Sort::InstantiatedPolymorphicStruct, entity, nucleus, arguments); break; - case codemaker::UnoType::SORT_ENUM_TYPE: + case codemaker::UnoType::Sort::Enum: printMapsToCppType( o, options, manager, sort, nucleus, rank, arguments, entity, "enum"); o << '\n'; break; - case codemaker::UnoType::SORT_CONSTANT_GROUP: + case codemaker::UnoType::Sort::ConstantGroup: printMapsToCppType( o, options, manager, sort, nucleus, rank, arguments, entity, "namespace"); o << '\n'; break; - case codemaker::UnoType::SORT_EXCEPTION_TYPE: + case codemaker::UnoType::Sort::Exception: printMapsToCppType( o, options, manager, sort, nucleus, rank, arguments, entity, "exception class"); o << "; full constructor:\n"; printConstructor( - o, options, manager, codemaker::UnoType::SORT_EXCEPTION_TYPE, + o, options, manager, codemaker::UnoType::Sort::Exception, entity, nucleus, arguments); break; - case codemaker::UnoType::SORT_SINGLE_INTERFACE_BASED_SERVICE: + case codemaker::UnoType::Sort::SingleInterfaceBasedService: if (comment) { printMapsToCppType( o, options, manager, sort, nucleus, rank, arguments, entity, @@ -964,7 +964,7 @@ void generateDocumentation(std::ostream & o, delegate); break; - case codemaker::UnoType::SORT_ACCUMULATION_BASED_SERVICE: + case codemaker::UnoType::Sort::AccumulationBasedService: if (comment) o << ("does not map to C++\n" "// the service members are generated instead\n"); @@ -975,7 +975,7 @@ void generateDocumentation(std::ostream & o, delegate); break; - case codemaker::UnoType::SORT_INTERFACE_BASED_SINGLETON: + case codemaker::UnoType::Sort::InterfaceBasedSingleton: printMapsToCppType( o, options, manager, sort, nucleus, rank, arguments, entity, "class"); @@ -988,7 +988,7 @@ void generateDocumentation(std::ostream & o, o << " get(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & context);\n"; break; - case codemaker::UnoType::SORT_SERVICE_BASED_SINGLETON: + case codemaker::UnoType::Sort::ServiceBasedSingleton: o << "does not map to C++\n"; break; diff --git a/unodevtools/source/skeletonmaker/javatypemaker.cxx b/unodevtools/source/skeletonmaker/javatypemaker.cxx index 20c1c8c47d2c..e097b831be90 100644 --- a/unodevtools/source/skeletonmaker/javatypemaker.cxx +++ b/unodevtools/source/skeletonmaker/javatypemaker.cxx @@ -37,21 +37,21 @@ void printType( std::vector< OUString > const & arguments, bool referenceType, bool defaultvalue) { - if (defaultvalue && rank == 0 && sort <= codemaker::UnoType::SORT_CHAR) { + if (defaultvalue && rank == 0 && sort <= codemaker::UnoType::Sort::Char) { switch (sort) { - case codemaker::UnoType::SORT_BOOLEAN: + case codemaker::UnoType::Sort::Boolean: o << "false"; return; - case codemaker::UnoType::SORT_CHAR: - case codemaker::UnoType::SORT_BYTE: - case codemaker::UnoType::SORT_SHORT: - case codemaker::UnoType::SORT_UNSIGNED_SHORT: - case codemaker::UnoType::SORT_LONG: - case codemaker::UnoType::SORT_UNSIGNED_LONG: - case codemaker::UnoType::SORT_HYPER: - case codemaker::UnoType::SORT_UNSIGNED_HYPER: - case codemaker::UnoType::SORT_FLOAT: - case codemaker::UnoType::SORT_DOUBLE: + case codemaker::UnoType::Sort::Char: + case codemaker::UnoType::Sort::Byte: + case codemaker::UnoType::Sort::Short: + case codemaker::UnoType::Sort::UnsignedShort: + case codemaker::UnoType::Sort::Long: + case codemaker::UnoType::Sort::UnsignedLong: + case codemaker::UnoType::Sort::Hyper: + case codemaker::UnoType::Sort::UnsignedHyper: + case codemaker::UnoType::Sort::Float: + case codemaker::UnoType::Sort::Double: o << "0"; return; default: @@ -60,16 +60,16 @@ void printType( } if (defaultvalue) { - if (sort == codemaker::UnoType::SORT_INTERFACE_TYPE) { + if (sort == codemaker::UnoType::Sort::Interface) { o << "null"; return; - } else if (sort == codemaker::UnoType::SORT_ANY && rank == 0) { + } else if (sort == codemaker::UnoType::Sort::Any && rank == 0) { o << "com.sun.star.uno.Any.VOID"; return; - } else if (sort == codemaker::UnoType::SORT_TYPE && rank == 0) { + } else if (sort == codemaker::UnoType::Sort::Type && rank == 0) { o << "com.sun.star.uno.Type.VOID"; return; - } else if (sort != codemaker::UnoType::SORT_ENUM_TYPE || rank != 0) { + } else if (sort != codemaker::UnoType::Sort::Enum || rank != 0) { o << "new "; } } @@ -100,8 +100,8 @@ void printType( o << "[]"; } - if (defaultvalue && sort > codemaker::UnoType::SORT_CHAR && rank == 0) { - if (sort == codemaker::UnoType::SORT_ENUM_TYPE) + if (defaultvalue && sort > codemaker::UnoType::Sort::Char && rank == 0) { + if (sort == codemaker::UnoType::Sort::Enum) o << ".getDefault()"; else o << "()"; @@ -132,7 +132,7 @@ bool printConstructorParameters( { bool previous = false; switch (sort) { - case codemaker::UnoType::SORT_PLAIN_STRUCT_TYPE: + case codemaker::UnoType::Sort::PlainStruct: { rtl::Reference< unoidl::PlainStructTypeEntity > ent2( dynamic_cast< unoidl::PlainStructTypeEntity * >(entity.get())); @@ -160,7 +160,7 @@ bool printConstructorParameters( } break; } - case codemaker::UnoType::SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE: + case codemaker::UnoType::Sort::PolymorphicStructTemplate: { rtl::Reference< unoidl::PolymorphicStructTypeTemplateEntity > ent2( dynamic_cast< unoidl::PolymorphicStructTypeTemplateEntity * >( @@ -186,7 +186,7 @@ bool printConstructorParameters( } break; } - case codemaker::UnoType::SORT_INSTANTIATED_POLYMORPHIC_STRUCT_TYPE: + case codemaker::UnoType::Sort::InstantiatedPolymorphicStruct: { rtl::Reference< unoidl::PolymorphicStructTypeTemplateEntity > ent2( dynamic_cast< unoidl::PolymorphicStructTypeTemplateEntity * >( @@ -221,7 +221,7 @@ bool printConstructorParameters( } break; } - case codemaker::UnoType::SORT_EXCEPTION_TYPE: + case codemaker::UnoType::Sort::Exception: { rtl::Reference< unoidl::ExceptionTypeEntity > ent2( dynamic_cast< unoidl::ExceptionTypeEntity * >(entity.get())); @@ -445,7 +445,7 @@ void printMethods(std::ostream & o, generated.add(u2b(name)); rtl::Reference< unoidl::Entity > ent; - if (manager->getSort(name, &ent) != codemaker::UnoType::SORT_INTERFACE_TYPE) + if (manager->getSort(name, &ent) != codemaker::UnoType::Sort::Interface) { throw CannotDumpException( "unexpected entity \"" + name @@ -576,7 +576,7 @@ void printConstructors( { rtl::Reference< unoidl::Entity > ent; if (manager->getSort(name, &ent) - != codemaker::UnoType::SORT_SINGLE_INTERFACE_BASED_SERVICE) + != codemaker::UnoType::Sort::SingleInterfaceBasedService) { throw CannotDumpException( "unexpected entity \"" + name @@ -686,9 +686,9 @@ void generateDocumentation(std::ostream & o, bool comment = true; if (!delegate.isEmpty()) { - if (sort != codemaker::UnoType::SORT_INTERFACE_TYPE && - sort != codemaker::UnoType::SORT_SINGLE_INTERFACE_BASED_SERVICE && - sort != codemaker::UnoType::SORT_ACCUMULATION_BASED_SERVICE ) + if (sort != codemaker::UnoType::Sort::Interface && + sort != codemaker::UnoType::Sort::SingleInterfaceBasedService && + sort != codemaker::UnoType::Sort::AccumulationBasedService ) { return; } @@ -699,59 +699,59 @@ void generateDocumentation(std::ostream & o, o << "\n// UNO"; if (rank != 0) { o << " sequence type"; - } else if (sort <= codemaker::UnoType::SORT_ANY) { + } else if (sort <= codemaker::UnoType::Sort::Any) { o << " simple type"; } else { switch (sort) { - case codemaker::UnoType::SORT_INTERFACE_TYPE: + case codemaker::UnoType::Sort::Interface: o << " interface type"; break; - case codemaker::UnoType::SORT_MODULE: + case codemaker::UnoType::Sort::Module: o << "IDL module"; break; - case codemaker::UnoType::SORT_PLAIN_STRUCT_TYPE: + case codemaker::UnoType::Sort::PlainStruct: o << " simple struct type"; break; - case codemaker::UnoType::SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE: + case codemaker::UnoType::Sort::PolymorphicStructTemplate: o << " polymorphic struct type template"; break; - case codemaker::UnoType::SORT_INSTANTIATED_POLYMORPHIC_STRUCT_TYPE: + case codemaker::UnoType::Sort::InstantiatedPolymorphicStruct: o << " instantiated polymorphic struct type"; break; - case codemaker::UnoType::SORT_ENUM_TYPE: + case codemaker::UnoType::Sort::Enum: o << " enum type"; break; - case codemaker::UnoType::SORT_EXCEPTION_TYPE: + case codemaker::UnoType::Sort::Exception: o << " exception type"; break; - case codemaker::UnoType::SORT_TYPEDEF: + case codemaker::UnoType::Sort::Typedef: o << "IDL typedef"; break; - case codemaker::UnoType::SORT_SINGLE_INTERFACE_BASED_SERVICE: + case codemaker::UnoType::Sort::SingleInterfaceBasedService: o << " single-inheritance--based service"; break; - case codemaker::UnoType::SORT_ACCUMULATION_BASED_SERVICE: + case codemaker::UnoType::Sort::AccumulationBasedService: o << "IDL accumulation-based service"; break; - case codemaker::UnoType::SORT_INTERFACE_BASED_SINGLETON: + case codemaker::UnoType::Sort::InterfaceBasedSingleton: o << " inheritance-based singleton"; break; - case codemaker::UnoType::SORT_SERVICE_BASED_SINGLETON: + case codemaker::UnoType::Sort::ServiceBasedSingleton: o << "IDL service-based singleton"; break; - case codemaker::UnoType::SORT_CONSTANT_GROUP: + case codemaker::UnoType::Sort::ConstantGroup: o << "IDL constant group"; break; @@ -770,13 +770,13 @@ void generateDocumentation(std::ostream & o, printMapsToJavaType( o, options, manager, sort, nucleus, rank, arguments, "array"); o << '\n'; - } else if (sort <= codemaker::UnoType::SORT_ANY) { + } else if (sort <= codemaker::UnoType::Sort::Any) { printMapsToJavaType( o, options, manager, sort, nucleus, rank, arguments, nullptr); o << '\n'; } else { switch (sort) { - case codemaker::UnoType::SORT_INTERFACE_TYPE: + case codemaker::UnoType::Sort::Interface: printMapsToJavaType( o, options, manager, sort, nucleus, rank, arguments, "interface"); @@ -790,61 +790,61 @@ void generateDocumentation(std::ostream & o, } break; - case codemaker::UnoType::SORT_MODULE: + case codemaker::UnoType::Sort::Module: printMapsToJavaType( o, options, manager, sort, nucleus, rank, arguments, "package"); o << '\n'; break; - case codemaker::UnoType::SORT_PLAIN_STRUCT_TYPE: + case codemaker::UnoType::Sort::PlainStruct: printMapsToJavaType( o, options, manager, sort, nucleus, rank, arguments, "class"); o << "; full constructor:\n"; printConstructor( - o, options, manager, codemaker::UnoType::SORT_PLAIN_STRUCT_TYPE, + o, options, manager, codemaker::UnoType::Sort::PlainStruct, entity, nucleus, arguments); break; - case codemaker::UnoType::SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE: + case codemaker::UnoType::Sort::PolymorphicStructTemplate: printMapsToJavaType( o, options, manager, sort, nucleus, rank, arguments, "generic class"); o << "; full constructor:\n"; printConstructor( o, options, manager, - codemaker::UnoType::SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE, + codemaker::UnoType::Sort::PolymorphicStructTemplate, entity, nucleus, arguments); break; - case codemaker::UnoType::SORT_INSTANTIATED_POLYMORPHIC_STRUCT_TYPE: + case codemaker::UnoType::Sort::InstantiatedPolymorphicStruct: printMapsToJavaType( o, options, manager, sort, nucleus, rank, arguments, "generic class instantiation"); o << "; full constructor:\n"; printConstructor( o, options, manager, - codemaker::UnoType::SORT_INSTANTIATED_POLYMORPHIC_STRUCT_TYPE, + codemaker::UnoType::Sort::InstantiatedPolymorphicStruct, entity, nucleus, arguments); break; - case codemaker::UnoType::SORT_ENUM_TYPE: - case codemaker::UnoType::SORT_CONSTANT_GROUP: + case codemaker::UnoType::Sort::Enum: + case codemaker::UnoType::Sort::ConstantGroup: printMapsToJavaType( o, options, manager, sort, nucleus, rank, arguments, "class"); o << '\n'; break; - case codemaker::UnoType::SORT_EXCEPTION_TYPE: + case codemaker::UnoType::Sort::Exception: printMapsToJavaType( o, options, manager, sort, nucleus, rank, arguments, "exception class"); o << "; full constructor:\n"; printConstructor( - o, options, manager, codemaker::UnoType::SORT_EXCEPTION_TYPE, + o, options, manager, codemaker::UnoType::Sort::Exception, entity, nucleus, arguments); break; - case codemaker::UnoType::SORT_SINGLE_INTERFACE_BASED_SERVICE: + case codemaker::UnoType::Sort::SingleInterfaceBasedService: printMapsToJavaType( o, options, manager, sort, nucleus, rank, arguments, "class"); o << "; construction methods:\n"; @@ -856,7 +856,7 @@ void generateDocumentation(std::ostream & o, delegate); break; - case codemaker::UnoType::SORT_ACCUMULATION_BASED_SERVICE: + case codemaker::UnoType::Sort::AccumulationBasedService: o << ("does not map to Java\n" "// the service members are generated instead\n"); printServiceMembers( @@ -866,7 +866,7 @@ void generateDocumentation(std::ostream & o, delegate); break; - case codemaker::UnoType::SORT_INTERFACE_BASED_SINGLETON: + case codemaker::UnoType::Sort::InterfaceBasedSingleton: printMapsToJavaType( o, options, manager, sort, nucleus, rank, arguments, "class"); o << "; get method:\npublic static "; @@ -878,7 +878,7 @@ void generateDocumentation(std::ostream & o, o << " get(com.sun.star.uno.XComponentContext context);\n"; break; - case codemaker::UnoType::SORT_SERVICE_BASED_SINGLETON: + case codemaker::UnoType::Sort::ServiceBasedSingleton: o << "does not map to Java\n"; break; diff --git a/unodevtools/source/skeletonmaker/skeletoncommon.cxx b/unodevtools/source/skeletonmaker/skeletoncommon.cxx index 8bf54f664627..b0dc9333c687 100644 --- a/unodevtools/source/skeletonmaker/skeletoncommon.cxx +++ b/unodevtools/source/skeletonmaker/skeletoncommon.cxx @@ -116,7 +116,7 @@ void checkAttributes(rtl::Reference< TypeManager > const & manager, } rtl::Reference< unoidl::Entity > ent; switch (manager->getSort(name, &ent)) { - case codemaker::UnoType::SORT_INTERFACE_TYPE: + case codemaker::UnoType::Sort::Interface: { rtl::Reference< unoidl::InterfaceTypeEntity > ent2( dynamic_cast< unoidl::InterfaceTypeEntity * >(ent.get())); @@ -149,7 +149,7 @@ void checkAttributes(rtl::Reference< TypeManager > const & manager, } break; } - case codemaker::UnoType::SORT_ACCUMULATION_BASED_SERVICE: + case codemaker::UnoType::Sort::AccumulationBasedService: { rtl::Reference< unoidl::AccumulationBasedServiceEntity > ent2( dynamic_cast< unoidl::AccumulationBasedServiceEntity * >( @@ -193,7 +193,7 @@ void checkType(rtl::Reference< TypeManager > const & manager, { rtl::Reference< unoidl::Entity > ent; switch (manager->getSort(name, &ent)) { - case codemaker::UnoType::SORT_INTERFACE_TYPE: + case codemaker::UnoType::Sort::Interface: // com.sun.star.lang.XComponent should be also not in the list // but it will be used for checking the impl helper and will be // removed later if necessary. @@ -204,7 +204,7 @@ void checkType(rtl::Reference< TypeManager > const & manager, interfaceTypes.insert(name); } break; - case codemaker::UnoType::SORT_SINGLE_INTERFACE_BASED_SERVICE: + case codemaker::UnoType::Sort::SingleInterfaceBasedService: if (serviceTypes.find(name) == serviceTypes.end()) { serviceTypes.insert(name); rtl::Reference< unoidl::SingleInterfaceBasedServiceEntity > ent2( @@ -228,7 +228,7 @@ void checkType(rtl::Reference< TypeManager > const & manager, } } break; - case codemaker::UnoType::SORT_ACCUMULATION_BASED_SERVICE: + case codemaker::UnoType::Sort::AccumulationBasedService: if ( serviceTypes.find(name) == serviceTypes.end() ) { serviceTypes.insert(name); rtl::Reference< unoidl::AccumulationBasedServiceEntity > ent2( @@ -289,7 +289,7 @@ bool checkServiceProperties(rtl::Reference< TypeManager > const & manager, { rtl::Reference< unoidl::Entity > ent; if (manager->getSort(name, &ent) - == codemaker::UnoType::SORT_ACCUMULATION_BASED_SERVICE) + == codemaker::UnoType::Sort::AccumulationBasedService) { rtl::Reference< unoidl::AccumulationBasedServiceEntity > ent2( dynamic_cast< unoidl::AccumulationBasedServiceEntity * >( @@ -337,7 +337,7 @@ OUString checkPropertyHelper( if ( !services.empty() ) { if (options.supportpropertysetmixin && (sort - == codemaker::UnoType::SORT_SINGLE_INTERFACE_BASED_SERVICE)) + == codemaker::UnoType::Sort::SingleInterfaceBasedService)) { rtl::Reference< unoidl::SingleInterfaceBasedServiceEntity > ent2( @@ -374,7 +374,7 @@ bool checkXComponentSupport( } rtl::Reference< unoidl::Entity > ent; codemaker::UnoType::Sort sort = manager->getSort(name, &ent); - if (sort != codemaker::UnoType::SORT_INTERFACE_TYPE) { + if (sort != codemaker::UnoType::Sort::Interface) { throw CannotDumpException( "unexpected entity \"" + name + "\" in call to skeletonmaker::checkXComponentSupport"); @@ -459,14 +459,14 @@ bool checkAddinType(rtl::Reference< TypeManager > const & manager, codemaker::UnoType::Sort sort = manager->decompose( type, true, nullptr, &rank, nullptr, nullptr); - if ( sort == codemaker::UnoType::SORT_LONG || - sort == codemaker::UnoType::SORT_DOUBLE || - sort == codemaker::UnoType::SORT_STRING ) + if ( sort == codemaker::UnoType::Sort::Long || + sort == codemaker::UnoType::Sort::Double || + sort == codemaker::UnoType::Sort::String ) { if ( rank == 0 || rank ==2 ) return true; } - if ( sort == codemaker::UnoType::SORT_ANY ) + if ( sort == codemaker::UnoType::Sort::Any ) { if ( rank <= 2 ) { if ( rank ==1 ) { @@ -478,7 +478,7 @@ bool checkAddinType(rtl::Reference< TypeManager > const & manager, return true; } } - if ( sort == codemaker::UnoType::SORT_INTERFACE_TYPE ) + if ( sort == codemaker::UnoType::Sort::Interface ) { if ( bIsReturn && type == "com.sun.star.sheet.XVolatileResult" ) return true; @@ -566,7 +566,7 @@ void generateFunctionParameterMap(std::ostream& o, rtl::Reference< unoidl::Entity > ent; codemaker::UnoType::Sort sort = manager->getSort(name, &ent); - if (sort != codemaker::UnoType::SORT_INTERFACE_TYPE) { + if (sort != codemaker::UnoType::Sort::Interface) { throw CannotDumpException( "unexpected entity \"" + name + "\" in call to skeletonmaker::generateFunctionParameterMap"); |