diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-12-19 16:54:36 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-12-19 16:54:36 +0100 |
commit | e500b25b08fdab927b987949139588c198edc40b (patch) | |
tree | 4e7f6bcba6988f0da98def8eac4097831fb3f5f0 /codemaker | |
parent | 914a00a13c8f3045282e27c8717ae0fd21ad740f (diff) |
...and support direct calls of non-default ctors, too
Change-Id: I507a5664e642c75f6e9e9fe0c95c97ea76a8e5b3
Diffstat (limited to 'codemaker')
-rw-r--r-- | codemaker/source/cppumaker/cpputype.cxx | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx index dc5874c35f52..4bd7a9856f7a 100644 --- a/codemaker/source/cppumaker/cpputype.cxx +++ b/codemaker/source/cppumaker/cpputype.cxx @@ -3581,8 +3581,31 @@ void ServiceType::dumpHxxFile( o << 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(), "; + if (rest) { + o << codemaker::cpp::translateUnoToCppIdentifier( + u2b(i->parameters.back().name), "param", + codemaker::cpp::ITM_NONGLOBAL); + } else if (i->parameters.empty()) { + o << ("::css::uno::Sequence< ::css::uno::Any >()"); + } else { + o << "the_arguments"; + } + o << (".get())), ::SAL_NO_ACQUIRE), ::css::uno::UNO_QUERY);\n" + "#else\n") + << indent() << "the_instance = ::css::uno::Reference< " << scopedBaseName << (" >(the_context->getServiceManager()->" "createInstanceWithArgumentsAndContext(::rtl::OUString(" @@ -3597,7 +3620,7 @@ void ServiceType::dumpHxxFile( } else { o << "the_arguments"; } - o << ", the_context), ::css::uno::UNO_QUERY);\n"; + o << ", the_context), ::css::uno::UNO_QUERY);\n#endif\n"; if (!tree.getRoot()->present) { dec(); o << indent() |