diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-03-17 12:25:11 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-03-17 12:25:11 +0100 |
commit | 3099c70b11c7e5b80fe4dbe3dc99171fb38c6fc2 (patch) | |
tree | 63699b525800b2c6708e90b817853bb60be5f6d8 /scripting | |
parent | 5229726b4d4e7d76f410d221f8f8cd8abcfd5a19 (diff) |
Fix various XServiceInfo implementations
...to match what is recorded in the .component files
Change-Id: Ie548cd37872d3b8540222201afaac73040e65c8f
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java | 6 | ||||
-rw-r--r-- | scripting/source/pyprov/mailmerge.py | 32 | ||||
-rw-r--r-- | scripting/source/stringresource/stringresource.cxx | 2 |
3 files changed, 32 insertions, 8 deletions
diff --git a/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java b/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java index 497b0731ce1e..dcf173ab4aba 100644 --- a/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java +++ b/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java @@ -79,7 +79,9 @@ public abstract class ScriptProvider implements private final String[] __serviceNames = { "com.sun.star.script.provider.ScriptProviderFor", - "com.sun.star.script.provider.LanguageScriptProvider" + "com.sun.star.script.provider.LanguageScriptProvider", + "com.sun.star.script.browse.BrowseNode", + "com.sun.star.script.provider.ScriptProvider" }; protected String language; @@ -671,4 +673,4 @@ public abstract class ScriptProvider implements return xModel; } -}
\ No newline at end of file +} diff --git a/scripting/source/pyprov/mailmerge.py b/scripting/source/pyprov/mailmerge.py index 201b5c9752a0..c8867aa796d1 100644 --- a/scripting/source/pyprov/mailmerge.py +++ b/scripting/source/pyprov/mailmerge.py @@ -34,6 +34,7 @@ from com.sun.star.mail.MailServiceType import IMAP from com.sun.star.uno import XCurrentContext from com.sun.star.lang import IllegalArgumentException from com.sun.star.lang import EventObject +from com.sun.star.lang import XServiceInfo from com.sun.star.mail import SendMailMessageFailedException from email.mime.base import MIMEBase @@ -50,6 +51,11 @@ from socket import _GLOBAL_DEFAULT_TIMEOUT import sys, smtplib, imaplib, poplib dbg = False +# pythonloader looks for a static g_ImplementationHelper variable +g_ImplementationHelper = unohelper.ImplementationHelper() +g_providerImplName = "org.openoffice.pyuno.MailServiceProvider" +g_messageImplName = "org.openoffice.pyuno.MailMessage" + #no stderr under windows, output to pymailmerge.log #with no buffering if dbg and os.name == 'nt': @@ -428,7 +434,7 @@ class PyMailPOP3Service(unohelper.Base, XMailService): print("PyMailPOP3Service getCurrentConnectionContext", file=dbgout) return self.connectioncontext -class PyMailServiceProvider(unohelper.Base, XMailServiceProvider): +class PyMailServiceProvider(unohelper.Base, XMailServiceProvider, XServiceInfo): def __init__( self, ctx ): if dbg: print("PyMailServiceProvider init", file=dbgout) @@ -445,6 +451,15 @@ class PyMailServiceProvider(unohelper.Base, XMailServiceProvider): else: print("PyMailServiceProvider, unknown TYPE " + aType, file=dbgout) + def getImplementationName(self): + return g_providerImplName + + def supportsService(self, ServiceName): + return g_ImplementationHelper.supportsService(g_providerImplName, ServiceName) + + def getSupportedServiceNames(self): + return g_ImplementationHelper.getSupportedServiceNames(g_providerImplName) + class PyMailMessage(unohelper.Base, XMailMessage): def __init__( self, ctx, sTo='', sFrom='', Subject='', Body=None, aMailAttachment=None ): if dbg: @@ -497,11 +512,18 @@ class PyMailMessage(unohelper.Base, XMailMessage): print("PyMailMessage.getAttachments", file=dbgout) return tuple(self.aMailAttachments) -# pythonloader looks for a static g_ImplementationHelper variable -g_ImplementationHelper = unohelper.ImplementationHelper() + def getImplementationName(self): + return g_messageImplName + + def supportsService(self, ServiceName): + return g_ImplementationHelper.supportsService(g_messageImplName, ServiceName) + + def getSupportedServiceNames(self): + return g_ImplementationHelper.getSupportedServiceNames(g_messageImplName) + g_ImplementationHelper.addImplementation( \ - PyMailServiceProvider, "org.openoffice.pyuno.MailServiceProvider", + PyMailServiceProvider, g_providerImplName, ("com.sun.star.mail.MailServiceProvider",),) g_ImplementationHelper.addImplementation( \ - PyMailMessage, "org.openoffice.pyuno.MailMessage", + PyMailMessage, g_messageImplName, ("com.sun.star.mail.MailMessage",),) diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx index 3a693d2297cc..381552c29369 100644 --- a/scripting/source/stringresource/stringresource.cxx +++ b/scripting/source/stringresource/stringresource.cxx @@ -775,7 +775,7 @@ StringResourcePersistenceImpl::~StringResourcePersistenceImpl() OUString StringResourcePersistenceImpl::getImplementationName( ) throw (RuntimeException, std::exception) { - return OUString( "com.sun.star.comp.scripting.StringResourceWithLocation"); + return OUString( "com.sun.star.comp.scripting.StringResource"); } |