Didier Dorange-Pattoret wrote:
Hello Tim,

I hope that this code will work for you ... :-)
The user have to restart OOo, included quickstarter.

oConfigAccess = GetConfigAccess( "/org.openoffice.Office.UI.WriterWindowState/UIElements/States", True )
   If oConfigAccess.HasByName( "private:resource/toolbar/addon_1") Then
   oAddon = oConfigAccess.getByName( "private:resource/toolbar/addon_1")
   oAddon.UIName = "Essbase"
   oConfigAccess.commitChanges()

Function GetConfigAccess( ByVal cNodePath As String,ByVal bWriteAccess As Boolean,Optional bEnableSync,Optional bLazyWrite) As Object
   If IsMissing(bEnableSync) Then     bEnableSync = True
   If IsMissing( bLazyWrite ) Then bLazyWrite = False
   Dim oConfigProvider, oConfigAccess as Object
oConfigProvider = GetProcessServiceManager.createInstanceWithArguments("com.sun.star.configuration.ConfigurationProvider",Array( MakePropertyValue( "enableasync", bEnableSync)))
   If bWriteAccess Then
cServiceName = "com.sun.star.configuration.ConfigurationUpdateAccess"
   Else
       cServiceName = "com.sun.star.configuration.ConfigurationAccess"
   EndIf
oConfigAccess = oConfigProvider.createInstanceWithArguments( cServiceName, Array( MakePropertyValue( "nodepath", cNodePath ), MakePropertyValue( "lazywrite", bLazyWrite )))
   GetConfigAccess() = oConfigAccess
End Function

Hi Didier,

your "solution" can only work if you install exactly one add-on. You have to know which add-on you are, which is not really possible. We have another problem with the entries in the <AppModule>WindowState configuration. The order of add-on toolbars is not persistent and can change when you install another add-on. So your add-on_1 can become add-on_2!. We also hope to fix this for OOo 2.0.3 where we want to use the "Node" name in the Addon.xcu to have unique entries in the WindowState configuration.

Regards,
Carsten

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  • Re: [... Carsten Driesner
    • ... Tim Tow
    • ... Carsten Driesner
    • ... Carsten Driesner - Sun Germany - ham02 - Hamburg - Software Engineer
      • ... Laurent Godard
    • ... Carsten Driesner - Sun Germany - ham02 - Hamburg - Software Engineer
      • ... Laurent Godard

Reply via email to