summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wizards/source/scriptforge/SF_Services.xba19
-rw-r--r--wizards/source/scriptforge/python/scriptforge.py22
2 files changed, 29 insertions, 12 deletions
diff --git a/wizards/source/scriptforge/SF_Services.xba b/wizards/source/scriptforge/SF_Services.xba
index 4bd57c9e1b64..9533a4741b23 100644
--- a/wizards/source/scriptforge/SF_Services.xba
+++ b/wizards/source/scriptforge/SF_Services.xba
@@ -535,16 +535,17 @@ Dim sEncoding As String ' Alias for Encoding
Check:
If IsMissing(pvArgs) Then pvArgs = Array()
- If UBound(pvArgs) < 0 Then
- sPOFile = ""
- sEncoding = ""
- Else
- If Not SF_Utils._ValidateFile(pvArgs(0), "Folder (Arg0)") Then GoTo Catch
+ sPOFile = ""
+ sEncoding = ""
+ If UBound(pvArgs) >= 0 Then
+ If Not SF_Utils._ValidateFile(pvArgs(0), "Folder (Arg0)", , True) Then GoTo Catch
sFolderName = pvArgs(0)
+ sLocale = ""
If UBound(pvArgs) >= 1 Then
If Not SF_Utils._Validate(pvArgs(1), "Locale (Arg1)", V_STRING) Then GoTo Catch
sLocale = pvArgs(1)
- Else
+ End If
+ If Len(sLocale) = 0 Then ' Called from Python, the Locale argument may be the zero-length string
Set oLocale = SF_Utils._GetUNOService("Locale")
sLocale = oLocale.Language & "-" & oLocale.Country
End If
@@ -554,8 +555,10 @@ Check:
Else
sEncoding = "UTF-8"
End If
- sPOFile = SF_FileSystem.BuildPath(sFolderName, sLocale & ".po")
- If Not SF_FileSystem.FileExists(sPOFile) Then GoTo CatchNotExists
+ If Len(sFolderName) > 0 Then
+ sPOFile = SF_FileSystem.BuildPath(sFolderName, sLocale & ".po")
+ If Not SF_FileSystem.FileExists(sPOFile) Then GoTo CatchNotExists
+ End If
End If
Try:
diff --git a/wizards/source/scriptforge/python/scriptforge.py b/wizards/source/scriptforge/python/scriptforge.py
index 16dbca2b4fd2..d22d5d832d9a 100644
--- a/wizards/source/scriptforge/python/scriptforge.py
+++ b/wizards/source/scriptforge/python/scriptforge.py
@@ -1166,9 +1166,16 @@ class SFScriptForge:
# Mandatory class properties for service registration
serviceimplementation = 'basic'
servicename = 'ScriptForge.L10N'
- servicesynonyms = ()
+ servicesynonyms = ('l10n', 'scriptforge.l10n')
serviceproperties = dict(Folder = False, Languages = False, Locale = False)
+ @classmethod
+ def ReviewServiceArgs(cls, foldername = '', locale = '', encoding = 'UTF-8'):
+ """
+ Transform positional and keyword arguments into positional only
+ """
+ return foldername, locale, encoding
+
def AddText(self, context = '', msgid = '', comment = ''):
return self.ExecMethod(self.vbMethod, 'AddText', context, msgid, comment)
@@ -1429,12 +1436,19 @@ class SFScriptForge:
# Mandatory class properties for service registration
serviceimplementation = 'basic'
servicename = 'ScriptForge.Timer'
- servicesynonyms = ()
+ servicesynonyms = ('timer', 'scriptforge.timer')
serviceproperties = dict(Duration = False, IsStarted = False, IsSuspended = False,
SuspendDuration = False, TotalDuration = False)
# Force for each property to get its value from Basic
forceGetProperty = True
+ @classmethod
+ def ReviewServiceArgs(cls, start = False):
+ """
+ Transform positional and keyword arguments into positional only
+ """
+ return (start,)
+
def Continue(self):
return self.ExecMethod(self.vbMethod, 'Continue')
@@ -1661,7 +1675,7 @@ class SFDialogs:
# Mandatory class properties for service registration
serviceimplementation = 'basic'
servicename = 'SFDialogs.DialogControl'
- servicesynonyms = ('dialogcontrol', 'sfdialogs.dialog')
+ servicesynonyms = ()
serviceproperties = dict(Cancel = True, Caption = True, ControlType = False, CurrentNode = True,
Default = True, Enabled = True, Format = True, ListCount = False,
ListIndex = True, Locked = True, MultiSelect = True, Name = False,
@@ -1779,7 +1793,7 @@ class SFDocuments:
# Mandatory class properties for service registration
serviceimplementation = 'basic'
servicename = 'SFDocuments.Base'
- servicesynonyms = ()
+ servicesynonyms = ('base', 'scriptforge.base')
serviceproperties = dict(DocumentType = False, IsBase = False, IsCalc = False,
IsDraw = False, IsImpress = False, IsMath = False, IsWriter = False,
XComponent = False)