summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2011-07-12 00:59:26 +0200
committerXisco Fauli <anistenis@gmail.com>2011-07-12 01:01:09 +0200
commita9eda0eb4c8d40919feb6c9d47ff106afe1879a7 (patch)
tree00de7256694e5258eb8e66ea0e9757f8ef1632a2
parent7d23e260cce288878b61e78a1db523b7678ba299 (diff)
fdo#37290: migrate Basic to new resource service
-rw-r--r--wizards/source/tools/Misc.xba16
1 files changed, 10 insertions, 6 deletions
diff --git a/wizards/source/tools/Misc.xba b/wizards/source/tools/Misc.xba
index 7eca46671..faa0f802f 100644
--- a/wizards/source/tools/Misc.xba
+++ b/wizards/source/tools/Misc.xba
@@ -271,14 +271,18 @@ End Sub
Function InitResources(Description, ShortDescription as String) as boolean
+Dim xResource as Object
+Dim aArgs(0) as String
On Error Goto ErrorOcurred
- oResSrv = createUnoService( &quot;com.sun.star.resource.VclStringResourceLoader&quot; )
- If (IsNull(oResSrv)) then
+ aArgs(0) = ShortDescription
+ oConfigProvider = createUnoService(&quot;com.sun.star.configuration.ConfigurationProvider&quot;)
+ xResource = getProcessServiceManager().createInstanceWithArguments( &quot;org.libreoffice.resource.ResourceIndexAccess&quot;, aArgs() )
+ If (IsNull(xResource)) then
InitResources = FALSE
- MsgBox( Description &amp; &quot;: No resource loader found&quot;, 16, GetProductName())
+ MsgBox(&quot;could not initialize ResourceIndexAccess&quot;)
Else
InitResources = TRUE
- oResSrv.FileName = ShortDescription
+ oResSrv = xResource.getByName( &quot;String&quot; )
End If
Exit Function
ErrorOcurred:
@@ -294,7 +298,7 @@ End Function
Function GetResText( nID as integer ) As string
On Error Goto ErrorOcurred
If Not IsNull(oResSrv) Then
- GetResText = oResSrv.getString( nID )
+ GetResText = oResSrv.getByIndex( nID )
Else
GetResText = &quot;&quot;
End If
@@ -814,4 +818,4 @@ End Sub
Function CalIsLeapYear(ByVal iYear as Integer) as Boolean
CalIsLeapYear = ((iYear Mod 4 = 0) And ((iYear Mod 100 &lt;&gt; 0) Or (iYear Mod 400 = 0)))
End Function
-</script:module> \ No newline at end of file
+</script:module>