unodevtools/source/skeletonmaker/javacompskeleton.cxx | 7 ++++++- unodevtools/source/skeletonmaker/skeletoncommon.hxx | 4 +++- unodevtools/source/skeletonmaker/skeletonmaker.cxx | 11 ++++++++++- 3 files changed, 19 insertions(+), 3 deletions(-)
New commits: commit f78397068fa7fd403046605fb37620fba7a76e63 Author: prrvchr <prrv...@gmail.com> AuthorDate: Mon Mar 3 15:39:03 2025 +0100 Commit: Stephan Bergmann <stephan.bergm...@allotropia.de> CommitDate: Thu Mar 6 11:59:07 2025 +0100 tdf#165580 uno-skeletonmaker provide passive registration Change-Id: Ic347a68eb1a13923493d6efe6d911e7e705145a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182436 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de> diff --git a/unodevtools/source/skeletonmaker/javacompskeleton.cxx b/unodevtools/source/skeletonmaker/javacompskeleton.cxx index deb352708e05..89dd9d8f8ce7 100644 --- a/unodevtools/source/skeletonmaker/javacompskeleton.cxx +++ b/unodevtools/source/skeletonmaker/javacompskeleton.cxx @@ -737,6 +737,11 @@ static void generateClassDefinition(std::ostream& o, << classname << ".class.getName(); "; if (!services.empty()) { + // additional member needed for passive registration in LOEclipse + if (options.passiveregistration) { + o << " private static final String m_serviceName = \"" + << services.begin()->replace('/','.') << "\"; "; + } o << " private static final String[] m_serviceNames = { "; std::set< OUString >::const_iterator iter = services.begin(); while (iter != services.end()) { @@ -790,7 +795,7 @@ static void generateClassDefinition(std::ostream& o, } - if (!services.empty()) + if (!services.empty() && !options.passiveregistration) generateCompFunctions(o, classname); generateMethodBodies(o, options, manager, interfaces, diff --git a/unodevtools/source/skeletonmaker/skeletoncommon.hxx b/unodevtools/source/skeletonmaker/skeletoncommon.hxx index a6ff05069613..0557be12a1bd 100644 --- a/unodevtools/source/skeletonmaker/skeletoncommon.hxx +++ b/unodevtools/source/skeletonmaker/skeletoncommon.hxx @@ -39,7 +39,8 @@ AttributeInfo; struct ProgramOptions { ProgramOptions(): all(false), dump(false), license(false), shortnames(false), supportpropertysetmixin(false), - backwardcompatible(false), language(1), componenttype(1) {} + backwardcompatible(false), passiveregistration(false), + language(1), componenttype(1) {} bool all; bool dump; @@ -47,6 +48,7 @@ struct ProgramOptions { bool shortnames; bool supportpropertysetmixin; bool backwardcompatible; + bool passiveregistration; // language specifier - is extendable // 1 = Java // 2 = C++ diff --git a/unodevtools/source/skeletonmaker/skeletonmaker.cxx b/unodevtools/source/skeletonmaker/skeletonmaker.cxx index e26dc2af0ac0..a026e962b75d 100644 --- a/unodevtools/source/skeletonmaker/skeletonmaker.cxx +++ b/unodevtools/source/skeletonmaker/skeletonmaker.cxx @@ -75,6 +75,10 @@ const char usageText[] = " add-in as well. Default is a minimal add-in component " " skeleton based on the configuration coming with the " " office since OO.org 2.0.4. " +" -pr specifies that the generated Java code skeleton use passive " +" --passive-registration registration. The methods __getComponentFactory() and " +" __writeRegistryServiceInfo() will not be created. " +" This option is not yet implemented for '--cpp' target language " " -o <path> path specifies an existing directory where the " " output files are generated to, only valid for " " sub-command 'component'. If path=stdout the generated " @@ -121,7 +125,7 @@ void printUsageAndExit(const char* programname, const char* version) SAL_IMPLEMENT_MAIN() { - const char* const version = "0.4"; + const char* const version = "0.5"; const char* const programname = "uno-skeletonmaker"; sal_uInt32 nCount = rtl_getAppCommandArgCount(); @@ -207,6 +211,11 @@ SAL_IMPLEMENT_MAIN() options.backwardcompatible = true; continue; } + if ( readOption( "pr", &nPos, arg) || + readOption( "passive-registration", &nPos, arg) ) { + options.passiveregistration = true; + continue; + } if ( readOption( "propertysetmixin", &nPos, arg) ) { options.supportpropertysetmixin = true; continue;