tdf#151076 Create callable Python script using InsertText
As reported by the user, if you go to Tools - Macro - Run Macro and select the InsertText macro (under Application Macros), you'll get an error. The reason for this is that the InsertText macro is not meant to be called from the Macro Selector since it requires 1 positional argument. Therefore, this patch creates a simple callable Python macro that uses the InsertText funcion, so that this error message no longer happens. Change-Id: I63f766795bda2d2ae1b95a7c0d8110f41f9fbea2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140384 Tested-by: Jenkins Tested-by: Hossein <hossein@libreoffice.org> Reviewed-by: Hossein <hossein@libreoffice.org>
This commit is contained in:
@@ -63,3 +63,10 @@ def InsertText(text):
|
||||
xSelectionSupplier.select(xTextRange)
|
||||
|
||||
i += 1
|
||||
|
||||
def InsertHello(event=None):
|
||||
# Calls the InsertText function to insert the "Hello" string
|
||||
InsertText("Hello")
|
||||
|
||||
# Make InsertHello visible by the Macro Selector
|
||||
g_exportedScripts = (InsertHello, )
|
||||
|
||||
Reference in New Issue
Block a user