Kaydet (Commit) 3c5c11bf authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Use OUStringLiteral

Change-Id: I20685c733b12ef2a7efc894091a6e40d1347ac84
üst 3783df20
...@@ -1811,30 +1811,27 @@ cppuhelper::TypeManager::TypeManager(): ...@@ -1811,30 +1811,27 @@ cppuhelper::TypeManager::TypeManager():
css::uno::Any cppuhelper::TypeManager::find(rtl::OUString const & name) { css::uno::Any cppuhelper::TypeManager::find(rtl::OUString const & name) {
//TODO: caching? (here or in unoidl::Manager?) //TODO: caching? (here or in unoidl::Manager?)
struct Simple { struct Simple {
char const * name; sal_Int32 length; OUStringLiteral name;
css::uno::TypeClass typeClass; css::uno::TypeClass typeClass;
}; };
static Simple const simple[] = { static Simple const simple[] = {
{ RTL_CONSTASCII_STRINGPARAM("void"), css::uno::TypeClass_VOID }, { "void", css::uno::TypeClass_VOID },
{ RTL_CONSTASCII_STRINGPARAM("boolean"), css::uno::TypeClass_BOOLEAN }, { "boolean", css::uno::TypeClass_BOOLEAN },
{ RTL_CONSTASCII_STRINGPARAM("byte"), css::uno::TypeClass_BYTE }, { "byte", css::uno::TypeClass_BYTE },
{ RTL_CONSTASCII_STRINGPARAM("short"), css::uno::TypeClass_SHORT }, { "short", css::uno::TypeClass_SHORT },
{ RTL_CONSTASCII_STRINGPARAM("unsigned short"), { "unsigned short", css::uno::TypeClass_UNSIGNED_SHORT },
css::uno::TypeClass_UNSIGNED_SHORT }, { "long", css::uno::TypeClass_LONG },
{ RTL_CONSTASCII_STRINGPARAM("long"), css::uno::TypeClass_LONG }, { "unsigned long", css::uno::TypeClass_UNSIGNED_LONG },
{ RTL_CONSTASCII_STRINGPARAM("unsigned long"), { "hyper", css::uno::TypeClass_HYPER },
css::uno::TypeClass_UNSIGNED_LONG }, { "unsigned hyper", css::uno::TypeClass_UNSIGNED_HYPER },
{ RTL_CONSTASCII_STRINGPARAM("hyper"), css::uno::TypeClass_HYPER }, { "float", css::uno::TypeClass_FLOAT },
{ RTL_CONSTASCII_STRINGPARAM("unsigned hyper"), { "double", css::uno::TypeClass_DOUBLE },
css::uno::TypeClass_UNSIGNED_HYPER }, { "char", css::uno::TypeClass_CHAR },
{ RTL_CONSTASCII_STRINGPARAM("float"), css::uno::TypeClass_FLOAT }, { "string", css::uno::TypeClass_STRING },
{ RTL_CONSTASCII_STRINGPARAM("double"), css::uno::TypeClass_DOUBLE }, { "type", css::uno::TypeClass_TYPE },
{ RTL_CONSTASCII_STRINGPARAM("char"), css::uno::TypeClass_CHAR }, { "any", css::uno::TypeClass_ANY } };
{ RTL_CONSTASCII_STRINGPARAM("string"), css::uno::TypeClass_STRING },
{ RTL_CONSTASCII_STRINGPARAM("type"), css::uno::TypeClass_TYPE },
{ RTL_CONSTASCII_STRINGPARAM("any"), css::uno::TypeClass_ANY } };
for (std::size_t i = 0; i != SAL_N_ELEMENTS(simple); ++i) { for (std::size_t i = 0; i != SAL_N_ELEMENTS(simple); ++i) {
if (name.equalsAsciiL(simple[i].name, simple[i].length)) { if (name == simple[i].name) {
return css::uno::makeAny< return css::uno::makeAny<
css::uno::Reference< css::reflection::XTypeDescription > >( css::uno::Reference< css::reflection::XTypeDescription > >(
new SimpleTypeDescription(simple[i].typeClass, name)); new SimpleTypeDescription(simple[i].typeClass, name));
......
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