diff options
Diffstat (limited to 'unodevtools')
-rw-r--r-- | unodevtools/source/skeletonmaker/javacompskeleton.cxx | 7 | ||||
-rw-r--r-- | unodevtools/source/skeletonmaker/skeletoncommon.hxx | 4 | ||||
-rw-r--r-- | unodevtools/source/skeletonmaker/skeletonmaker.cxx | 11 |
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; |