summaryrefslogtreecommitdiff
path: root/unodevtools
diff options
context:
space:
mode:
authorprrvchr <prrvchr@gmail.com>2025-03-03 15:39:03 +0100
committerStephan Bergmann <stephan.bergmann@allotropia.de>2025-03-06 11:59:07 +0100
commitf78397068fa7fd403046605fb37620fba7a76e63 (patch)
treeca1587ce1e4fad2ef4961ad86a7b5f9d80f79e5e /unodevtools
parentf78a20ea166123c6891c06b50b6a2394e4fcae06 (diff)
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.bergmann@allotropia.de>
Diffstat (limited to 'unodevtools')
-rw-r--r--unodevtools/source/skeletonmaker/javacompskeleton.cxx7
-rw-r--r--unodevtools/source/skeletonmaker/skeletoncommon.hxx4
-rw-r--r--unodevtools/source/skeletonmaker/skeletonmaker.cxx11
3 files changed, 19 insertions, 3 deletions
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();\n";
if (!services.empty()) {
+ // additional member needed for passive registration in LOEclipse
+ if (options.passiveregistration) {
+ o << " private static final String m_serviceName = \""
+ << services.begin()->replace('/','.') << "\";\n";
+ }
o << " private static final String[] m_serviceNames = {\n";
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\n"
" skeleton based on the configuration coming with the\n"
" office since OO.org 2.0.4.\n"
+" -pr specifies that the generated Java code skeleton use passive\n"
+" --passive-registration registration. The methods __getComponentFactory() and\n"
+" __writeRegistryServiceInfo() will not be created.\n"
+" This option is not yet implemented for '--cpp' target language\n"
" -o <path> path specifies an existing directory where the\n"
" output files are generated to, only valid for\n"
" sub-command 'component'. If path=stdout the generated\n"
@@ -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;