summaryrefslogtreecommitdiff
path: root/codemaker
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-12-19 14:42:10 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-12-19 14:42:10 +0100
commit15abebbde560e17413f17b16b8b2e9c1f31f01a5 (patch)
tree475a2b747663ab29576632d2b2b9212f015b50c9 /codemaker
parent9dccff429db197a92ed2af957fb6d3d75b3f2154 (diff)
WIP: Direct service ctor calls at least on Android/iOS
Change-Id: I8a1907bc4b8f2134efb15d38a0fb5176b4384317
Diffstat (limited to 'codemaker')
-rw-r--r--codemaker/source/cppumaker/cpputype.cxx31
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";