diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-12-19 14:42:10 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-12-19 14:42:10 +0100 |
commit | 15abebbde560e17413f17b16b8b2e9c1f31f01a5 (patch) | |
tree | 475a2b747663ab29576632d2b2b9212f015b50c9 /codemaker/source | |
parent | 9dccff429db197a92ed2af957fb6d3d75b3f2154 (diff) |
WIP: Direct service ctor calls at least on Android/iOS
Change-Id: I8a1907bc4b8f2134efb15d38a0fb5176b4384317
Diffstat (limited to 'codemaker/source')
-rw-r--r-- | codemaker/source/cppumaker/cpputype.cxx | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx index 0a710a88e4df..dc5874c35f52 100644 --- a/codemaker/source/cppumaker/cpputype.cxx +++ b/codemaker/source/cppumaker/cpputype.cxx @@ -3408,6 +3408,17 @@ void ServiceType::dumpHxxFile( OUString headerDefine(dumpHeaderDefine(o, "HPP")); o << "\n"; includes.dump(o, 0); + if (!entity_->getConstructors().empty()) { + o << ("\n#if defined ANDROID || defined IOS //TODO\n" + "#include <osl/detail/component-defines.h>\n#endif\n\n" + "#if defined LO_URE_CURRENT_ENV && defined LO_URE_CTOR_ENV_") + << name_.replaceAll(".", "_dot_") + << " && (LO_URE_CURRENT_ENV) == (LO_URE_CTOR_ENV_" + << name_.replaceAll(".", "_dot_") << ") && defined LO_URE_CTOR_FUN_" + << name_.replaceAll(".", "_dot_") + << "\nextern \"C\" void * SAL_CALL LO_URE_CTOR_FUN_" + << name_.replaceAll(".", "_dot_") << "(void *, void *);\n#endif\n"; + } o << "\n"; if (codemaker::cppumaker::dumpNamespaceOpen(o, name_, false)) { o << "\n"; @@ -3436,14 +3447,28 @@ void ServiceType::dumpHxxFile( << "::css::uno::Reference< " << scopedBaseName << " > the_instance;\n" << indent() << "try {\n"; inc(); - o << indent() - << "the_instance = ::css::uno::Reference< " + o << ("#if defined LO_URE_CURRENT_ENV && defined " + "LO_URE_CTOR_ENV_") + << name_.replaceAll(".", "_dot_") + << " && (LO_URE_CURRENT_ENV) == (LO_URE_CTOR_ENV_" + << name_.replaceAll(".", "_dot_") + << ") && defined LO_URE_CTOR_FUN_" + << name_.replaceAll(".", "_dot_") << "\n" << indent() + << "the_instance = ::css::uno::Reference< " << scopedBaseName + << (" >(::css::uno::Reference< ::css::uno::XInterface >(" + "static_cast< ::css::uno::XInterface * >((*" + "LO_URE_CTOR_FUN_") + << name_.replaceAll(".", "_dot_") + << (")(the_context.get(), ::css::uno::Sequence<" + " ::css::uno::Any >().get())), ::SAL_NO_ACQUIRE)," + " ::css::uno::UNO_QUERY);\n#else\n") + << indent() << "the_instance = ::css::uno::Reference< " << scopedBaseName << (" >(the_context->getServiceManager()->" "createInstanceWithContext(::rtl::OUString(" " \"") << name_ - << "\" ), the_context), ::css::uno::UNO_QUERY);\n"; + << "\" ), the_context), ::css::uno::UNO_QUERY);\n#endif\n"; dec(); o << indent() << "} catch (const ::css::uno::RuntimeException &) {\n"; |