Kaydet (Commit) cd1bbdf0 authored tarafından Noel Grandin's avatar Noel Grandin

convert codemaker::UnoType::Sort to scoped enum

Change-Id: I70a84f777e714bcc20c2d7b06b918e3be0f3ce4a
üst 6ddc80e5
......@@ -61,7 +61,7 @@ void ExceptionTree::add(
rtl::Reference< unoidl::Entity > ent;
codemaker::UnoType::Sort s = manager->getSort(b2u(n), &ent);
(void) s; // WaE: unused variable
assert(s == codemaker::UnoType::SORT_EXCEPTION_TYPE);
assert(s == codemaker::UnoType::Sort::Exception);
n = u2b(
static_cast< unoidl::ExceptionTypeEntity * >(ent.get())->
getDirectBase());
......
......@@ -64,58 +64,58 @@ codemaker::UnoType::Sort TypeManager::getSort(
if (cursor != nullptr) {
*cursor = manager_->createCursor("");
}
return codemaker::UnoType::SORT_MODULE;
return codemaker::UnoType::Sort::Module;
}
if (name == "void") {
return codemaker::UnoType::SORT_VOID;
return codemaker::UnoType::Sort::Void;
}
if (name == "boolean") {
return codemaker::UnoType::SORT_BOOLEAN;
return codemaker::UnoType::Sort::Boolean;
}
if (name == "byte") {
return codemaker::UnoType::SORT_BYTE;
return codemaker::UnoType::Sort::Byte;
}
if (name == "short") {
return codemaker::UnoType::SORT_SHORT;
return codemaker::UnoType::Sort::Short;
}
if (name == "unsigned short") {
return codemaker::UnoType::SORT_UNSIGNED_SHORT;
return codemaker::UnoType::Sort::UnsignedShort;
}
if (name == "long") {
return codemaker::UnoType::SORT_LONG;
return codemaker::UnoType::Sort::Long;
}
if (name == "unsigned long") {
return codemaker::UnoType::SORT_UNSIGNED_LONG;
return codemaker::UnoType::Sort::UnsignedLong;
}
if (name == "hyper") {
return codemaker::UnoType::SORT_HYPER;
return codemaker::UnoType::Sort::Hyper;
}
if (name == "unsigned hyper") {
return codemaker::UnoType::SORT_UNSIGNED_HYPER;
return codemaker::UnoType::Sort::UnsignedHyper;
}
if (name == "float") {
return codemaker::UnoType::SORT_FLOAT;
return codemaker::UnoType::Sort::Float;
}
if (name == "double") {
return codemaker::UnoType::SORT_DOUBLE;
return codemaker::UnoType::Sort::Double;
}
if (name == "char") {
return codemaker::UnoType::SORT_CHAR;
return codemaker::UnoType::Sort::Char;
}
if (name == "string") {
return codemaker::UnoType::SORT_STRING;
return codemaker::UnoType::Sort::String;
}
if (name == "type") {
return codemaker::UnoType::SORT_TYPE;
return codemaker::UnoType::Sort::Type;
}
if (name == "any") {
return codemaker::UnoType::SORT_ANY;
return codemaker::UnoType::Sort::Any;
}
if (name.startsWith("[")) {
return codemaker::UnoType::SORT_SEQUENCE_TYPE;
return codemaker::UnoType::Sort::Sequence;
}
if (name.indexOf('<') != -1) {
return codemaker::UnoType::SORT_INSTANTIATED_POLYMORPHIC_STRUCT_TYPE;
return codemaker::UnoType::Sort::InstantiatedPolymorphicStruct;
}
rtl::Reference< unoidl::Entity > ent(manager_->findEntity(name));
if (!ent.is()) {
......@@ -129,29 +129,29 @@ codemaker::UnoType::Sort TypeManager::getSort(
if (cursor != nullptr) {
*cursor = manager_->createCursor(name);
}
return codemaker::UnoType::SORT_MODULE;
return codemaker::UnoType::Sort::Module;
case unoidl::Entity::SORT_ENUM_TYPE:
return codemaker::UnoType::SORT_ENUM_TYPE;
return codemaker::UnoType::Sort::Enum;
case unoidl::Entity::SORT_PLAIN_STRUCT_TYPE:
return codemaker::UnoType::SORT_PLAIN_STRUCT_TYPE;
return codemaker::UnoType::Sort::PlainStruct;
case unoidl::Entity::SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE:
return codemaker::UnoType::SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE;
return codemaker::UnoType::Sort::PolymorphicStructTemplate;
case unoidl::Entity::SORT_EXCEPTION_TYPE:
return codemaker::UnoType::SORT_EXCEPTION_TYPE;
return codemaker::UnoType::Sort::Exception;
case unoidl::Entity::SORT_INTERFACE_TYPE:
return codemaker::UnoType::SORT_INTERFACE_TYPE;
return codemaker::UnoType::Sort::Interface;
case unoidl::Entity::SORT_TYPEDEF:
return codemaker::UnoType::SORT_TYPEDEF;
return codemaker::UnoType::Sort::Typedef;
case unoidl::Entity::SORT_CONSTANT_GROUP:
return codemaker::UnoType::SORT_CONSTANT_GROUP;
return codemaker::UnoType::Sort::ConstantGroup;
case unoidl::Entity::SORT_SINGLE_INTERFACE_BASED_SERVICE:
return codemaker::UnoType::SORT_SINGLE_INTERFACE_BASED_SERVICE;
return codemaker::UnoType::Sort::SingleInterfaceBasedService;
case unoidl::Entity::SORT_ACCUMULATION_BASED_SERVICE:
return codemaker::UnoType::SORT_ACCUMULATION_BASED_SERVICE;
return codemaker::UnoType::Sort::AccumulationBasedService;
case unoidl::Entity::SORT_INTERFACE_BASED_SINGLETON:
return codemaker::UnoType::SORT_INTERFACE_BASED_SINGLETON;
return codemaker::UnoType::Sort::InterfaceBasedSingleton;
case unoidl::Entity::SORT_SERVICE_BASED_SINGLETON:
return codemaker::UnoType::SORT_SERVICE_BASED_SINGLETON;
return codemaker::UnoType::Sort::ServiceBasedSingleton;
default:
for (;;) { std::abort(); } // this cannot happen
}
......@@ -169,14 +169,14 @@ codemaker::UnoType::Sort TypeManager::decompose(
rtl::Reference< unoidl::Entity > ent;
codemaker::UnoType::Sort s = getSort(n, &ent);
if (args.empty()
!= (s != codemaker::UnoType::SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE))
!= (s != codemaker::UnoType::Sort::PolymorphicStructTemplate))
{
throw CannotDumpException(
"template arguments mismatch for \"" + n
+ "\" resolved from \"" + name + "\"");
}
switch (s) {
case codemaker::UnoType::SORT_TYPEDEF:
case codemaker::UnoType::Sort::Typedef:
if (resolveTypedefs) {
n = dynamic_cast<unoidl::TypedefEntity&>(*ent.get()).
getType();
......@@ -187,25 +187,25 @@ codemaker::UnoType::Sort TypeManager::decompose(
break;
}
// fall through
case codemaker::UnoType::SORT_VOID:
case codemaker::UnoType::SORT_BOOLEAN:
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_STRING:
case codemaker::UnoType::SORT_TYPE:
case codemaker::UnoType::SORT_ANY:
case codemaker::UnoType::SORT_ENUM_TYPE:
case codemaker::UnoType::SORT_PLAIN_STRUCT_TYPE:
case codemaker::UnoType::SORT_EXCEPTION_TYPE:
case codemaker::UnoType::SORT_INTERFACE_TYPE:
case codemaker::UnoType::Sort::Void:
case codemaker::UnoType::Sort::Boolean:
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:
case codemaker::UnoType::Sort::Char:
case codemaker::UnoType::Sort::String:
case codemaker::UnoType::Sort::Type:
case codemaker::UnoType::Sort::Any:
case codemaker::UnoType::Sort::Enum:
case codemaker::UnoType::Sort::PlainStruct:
case codemaker::UnoType::Sort::Exception:
case codemaker::UnoType::Sort::Interface:
if (nucleus != nullptr) {
*nucleus = n;
}
......@@ -219,7 +219,7 @@ codemaker::UnoType::Sort TypeManager::decompose(
*entity = ent;
}
return s;
case codemaker::UnoType::SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE:
case codemaker::UnoType::Sort::PolymorphicStructTemplate:
if (args.size()
!= (dynamic_cast<
unoidl::PolymorphicStructTypeTemplateEntity * >(ent.get())->
......@@ -246,8 +246,8 @@ codemaker::UnoType::Sort TypeManager::decompose(
*entity = ent;
}
return
codemaker::UnoType::SORT_INSTANTIATED_POLYMORPHIC_STRUCT_TYPE;
case codemaker::UnoType::SORT_SEQUENCE_TYPE:
codemaker::UnoType::Sort::InstantiatedPolymorphicStruct;
case codemaker::UnoType::Sort::Sequence:
assert(false); // this cannot happen
// fall through
default:
......
......@@ -68,15 +68,15 @@ OString translateUnoToCppType(
codemaker::UnoType::Sort sort, OUString const & nucleus)
{
OStringBuffer buf;
if (sort <= codemaker::UnoType::SORT_ANY) {
static char const * const cppTypes[codemaker::UnoType::SORT_ANY + 1] = {
if (sort <= codemaker::UnoType::Sort::Any) {
static char const * const cppTypes[static_cast<int>(codemaker::UnoType::Sort::Any) + 1] = {
"void", "::sal_Bool", "::sal_Int8", "::sal_Int16", "::sal_uInt16",
"::sal_Int32", "::sal_uInt32", "::sal_Int64", "::sal_uInt64",
"float", "double", "::sal_Unicode", "rtl::OUString",
"::css::uno::Type", "::css::uno::Any" };
buf.append(cppTypes[sort]);
buf.append(cppTypes[static_cast<int>(sort)]);
} else {
if (sort == codemaker::UnoType::SORT_INTERFACE_TYPE
if (sort == codemaker::UnoType::Sort::Interface
&& nucleus == "com.sun.star.uno.XInterface")
{
buf.append("::css::uno::XInterface");
......
......@@ -41,8 +41,8 @@ OString translateUnoToJavaType(
codemaker::UnoType::Sort sort, OString const & nucleus, bool referenceType)
{
OStringBuffer buf;
if (sort <= codemaker::UnoType::SORT_ANY) {
OString const javaTypes[codemaker::UnoType::SORT_ANY + 1][2] = {
if (sort <= codemaker::UnoType::Sort::Any) {
OString const javaTypes[static_cast<int>(codemaker::UnoType::Sort::Any) + 1][2] = {
{ "void", "java/lang/Void" },
{ "boolean", "java/lang/Boolean" },
{ "byte", "java/lang/Byte" },
......@@ -58,7 +58,7 @@ OString translateUnoToJavaType(
{ "java/lang/String", "java/lang/String" },
{ "com/sun/star/uno/Type", "com/sun/star/uno/Type" },
{ "java/lang/Object", "java/lang/Object" } };
buf.append(javaTypes[sort][referenceType]);
buf.append(javaTypes[static_cast<int>(sort)][referenceType]);
} else {
if (nucleus == "com/sun/star/uno/XInterface") {
buf.append("java/lang/Object");
......
......@@ -52,9 +52,9 @@ Dependencies::Dependencies(
assert(manager.is());
rtl::Reference< unoidl::Entity > ent;
switch (m_manager->getSort(name, &ent)) {
case UnoType::SORT_ENUM_TYPE:
case UnoType::Sort::Enum:
break;
case UnoType::SORT_PLAIN_STRUCT_TYPE:
case UnoType::Sort::PlainStruct:
{
rtl::Reference< unoidl::PlainStructTypeEntity > ent2(
static_cast< unoidl::PlainStructTypeEntity * >(ent.get()));
......@@ -67,7 +67,7 @@ Dependencies::Dependencies(
}
break;
}
case UnoType::SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE:
case UnoType::Sort::PolymorphicStructTemplate:
{
rtl::Reference< unoidl::PolymorphicStructTypeTemplateEntity > ent2(
static_cast< unoidl::PolymorphicStructTypeTemplateEntity * >(
......@@ -80,7 +80,7 @@ Dependencies::Dependencies(
}
break;
}
case UnoType::SORT_EXCEPTION_TYPE:
case UnoType::Sort::Exception:
{
rtl::Reference< unoidl::ExceptionTypeEntity > ent2(
static_cast< unoidl::ExceptionTypeEntity * >(ent.get()));
......@@ -93,7 +93,7 @@ Dependencies::Dependencies(
}
break;
}
case UnoType::SORT_INTERFACE_TYPE:
case UnoType::Sort::Interface:
{
rtl::Reference< unoidl::InterfaceTypeEntity > ent2(
static_cast< unoidl::InterfaceTypeEntity * >(ent.get()));
......@@ -132,10 +132,10 @@ Dependencies::Dependencies(
}
break;
}
case UnoType::SORT_TYPEDEF:
case UnoType::Sort::Typedef:
insert(static_cast< unoidl::TypedefEntity * >(ent.get())->getType());
break;
case UnoType::SORT_CONSTANT_GROUP:
case UnoType::Sort::ConstantGroup:
{
rtl::Reference< unoidl::ConstantGroupEntity > ent2(
static_cast< unoidl::ConstantGroupEntity * >(ent.get()));
......@@ -176,7 +176,7 @@ Dependencies::Dependencies(
}
break;
}
case UnoType::SORT_SINGLE_INTERFACE_BASED_SERVICE:
case UnoType::Sort::SingleInterfaceBasedService:
{
rtl::Reference< unoidl::SingleInterfaceBasedServiceEntity > ent2(
static_cast< unoidl::SingleInterfaceBasedServiceEntity * >(
......@@ -201,7 +201,7 @@ Dependencies::Dependencies(
}
break;
}
case UnoType::SORT_INTERFACE_BASED_SINGLETON:
case UnoType::Sort::InterfaceBasedSingleton:
insert(
static_cast< unoidl::InterfaceBasedSingletonEntity * >(ent.get())->
getBase());
......@@ -221,63 +221,63 @@ void Dependencies::insert(OUString const & name, bool base) {
m_sequenceDependency = true;
}
switch (m_manager->getSort(n)) {
case UnoType::SORT_VOID:
case UnoType::Sort::Void:
m_voidDependency = true;
break;
case UnoType::SORT_BOOLEAN:
case UnoType::Sort::Boolean:
m_booleanDependency = true;
break;
case UnoType::SORT_BYTE:
case UnoType::Sort::Byte:
m_byteDependency = true;
break;
case UnoType::SORT_SHORT:
case UnoType::Sort::Short:
m_shortDependency = true;
break;
case UnoType::SORT_UNSIGNED_SHORT:
case UnoType::Sort::UnsignedShort:
m_unsignedShortDependency = true;
break;
case UnoType::SORT_LONG:
case UnoType::Sort::Long:
m_longDependency = true;
break;
case UnoType::SORT_UNSIGNED_LONG:
case UnoType::Sort::UnsignedLong:
m_unsignedLongDependency = true;
break;
case UnoType::SORT_HYPER:
case UnoType::Sort::Hyper:
m_hyperDependency = true;
break;
case UnoType::SORT_UNSIGNED_HYPER:
case UnoType::Sort::UnsignedHyper:
m_unsignedHyperDependency = true;
break;
case UnoType::SORT_FLOAT:
case UnoType::Sort::Float:
m_floatDependency = true;
break;
case UnoType::SORT_DOUBLE:
case UnoType::Sort::Double:
m_doubleDependency = true;
break;
case UnoType::SORT_CHAR:
case UnoType::Sort::Char:
m_charDependency = true;
break;
case UnoType::SORT_STRING:
case UnoType::Sort::String:
m_stringDependency = true;
break;
case UnoType::SORT_TYPE:
case UnoType::Sort::Type:
m_typeDependency = true;
break;
case UnoType::SORT_ANY:
case UnoType::Sort::Any:
m_anyDependency = true;
break;
case UnoType::SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE:
case UnoType::Sort::PolymorphicStructTemplate:
for (const OString& arg : args)
{
insert(b2u(arg));
}
// fall through
case UnoType::SORT_SEQUENCE_TYPE:
case UnoType::SORT_ENUM_TYPE:
case UnoType::SORT_PLAIN_STRUCT_TYPE:
case UnoType::SORT_EXCEPTION_TYPE:
case UnoType::SORT_INTERFACE_TYPE:
case UnoType::SORT_TYPEDEF:
case UnoType::Sort::Sequence:
case UnoType::Sort::Enum:
case UnoType::Sort::PlainStruct:
case UnoType::Sort::Exception:
case UnoType::Sort::Interface:
case UnoType::Sort::Typedef:
{
std::pair< Map::iterator, bool > i(
m_map.insert(
......
......@@ -76,41 +76,41 @@ void Includes::add(OString const & entityName) {
m_includeSequence = true;
}
switch (m_manager->getSort(n)) {
case codemaker::UnoType::SORT_BOOLEAN:
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_CHAR:
case codemaker::UnoType::Sort::Boolean:
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::Char:
m_includeSalTypesH = true;
break;
case codemaker::UnoType::SORT_FLOAT:
case codemaker::UnoType::SORT_DOUBLE:
case codemaker::UnoType::Sort::Float:
case codemaker::UnoType::Sort::Double:
break;
case codemaker::UnoType::SORT_STRING:
case codemaker::UnoType::Sort::String:
m_includeRtlUstringHxx = true;
break;
case codemaker::UnoType::SORT_TYPE:
case codemaker::UnoType::Sort::Type:
m_includeType = true;
break;
case codemaker::UnoType::SORT_ANY:
case codemaker::UnoType::Sort::Any:
m_includeAny = true;
break;
case codemaker::UnoType::SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE:
case codemaker::UnoType::Sort::PolymorphicStructTemplate:
for (const OString& arg : args)
{
add(arg);
}
// fall through
case codemaker::UnoType::SORT_SEQUENCE_TYPE:
case codemaker::UnoType::SORT_ENUM_TYPE:
case codemaker::UnoType::SORT_PLAIN_STRUCT_TYPE:
case codemaker::UnoType::SORT_EXCEPTION_TYPE:
case codemaker::UnoType::SORT_INTERFACE_TYPE:
case codemaker::UnoType::SORT_TYPEDEF:
case codemaker::UnoType::Sort::Sequence:
case codemaker::UnoType::Sort::Enum:
case codemaker::UnoType::Sort::PlainStruct:
case codemaker::UnoType::Sort::Exception:
case codemaker::UnoType::Sort::Interface:
case codemaker::UnoType::Sort::Typedef:
m_map.insert(
Dependencies::Map::value_type(n, Dependencies::KIND_NO_BASE));
break;
......@@ -268,7 +268,7 @@ void Includes::dumpInclude(
}
bool Includes::isInterfaceType(OString const & entityName) const {
return m_manager->getSort(b2u(entityName)) == UnoType::SORT_INTERFACE_TYPE;
return m_manager->getSort(b2u(entityName)) == UnoType::Sort::Interface;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -268,13 +268,13 @@ void ClassFile::Code::instrNew(OString const & type) {
void ClassFile::Code::instrNewarray(codemaker::UnoType::Sort sort) {
OSL_ASSERT(
sort >= codemaker::UnoType::SORT_BOOLEAN
&& sort <= codemaker::UnoType::SORT_CHAR);
sort >= codemaker::UnoType::Sort::Boolean
&& sort <= codemaker::UnoType::Sort::Char);
// newarray <atype>:
appendU1(m_code, 0xBC);
static sal_uInt8 const atypes[codemaker::UnoType::SORT_CHAR] = {
static sal_uInt8 const atypes[static_cast<int>(codemaker::UnoType::Sort::Char)] = {
0x04, 0x08, 0x09, 0x09, 0x0A, 0x0A, 0x0B, 0x0B, 0x06, 0x07, 0x05 };
appendU1(m_code, atypes[sort - 1]);
appendU1(m_code, atypes[static_cast<int>(sort) - 1]);
}
void ClassFile::Code::instrPop() {
......
......@@ -32,36 +32,36 @@ namespace UnoType {
/**
An enumeration of all the sorts of relevant UNOIDL entities.
*/
enum Sort {
SORT_VOID,
SORT_BOOLEAN,
SORT_BYTE,
SORT_SHORT,
SORT_UNSIGNED_SHORT,
SORT_LONG,
SORT_UNSIGNED_LONG,
SORT_HYPER,
SORT_UNSIGNED_HYPER,
SORT_FLOAT,
SORT_DOUBLE,
SORT_CHAR,
SORT_STRING,
SORT_TYPE,
SORT_ANY,
SORT_SEQUENCE_TYPE,
SORT_MODULE,
SORT_ENUM_TYPE,
SORT_PLAIN_STRUCT_TYPE,
SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE,
SORT_INSTANTIATED_POLYMORPHIC_STRUCT_TYPE,
SORT_EXCEPTION_TYPE,
SORT_INTERFACE_TYPE,
SORT_TYPEDEF,
SORT_CONSTANT_GROUP,
SORT_SINGLE_INTERFACE_BASED_SERVICE,
SORT_ACCUMULATION_BASED_SERVICE,
SORT_INTERFACE_BASED_SINGLETON,
SORT_SERVICE_BASED_SINGLETON
enum class Sort {
Void,
Boolean,
Byte,
Short,
UnsignedShort,
Long,
UnsignedLong,
Hyper,
UnsignedHyper,
Float,
Double,
Char,
String,
Type,
Any,
Sequence,
Module,
Enum,
PlainStruct,
PolymorphicStructTemplate,
InstantiatedPolymorphicStruct,
Exception,
Interface,
Typedef,
ConstantGroup,
SingleInterfaceBasedService,
AccumulationBasedService,
InterfaceBasedSingleton,
ServiceBasedSingleton
};
/**
......
......@@ -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 << "(";
......
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment