https://bugs.documentfoundation.org/show_bug.cgi?id=157915

--- Comment #13 from Isatis34 <laurent.bo...@gmail.com> ---
Hello,

I tested Version: 7.6.5.0.0+ (X86_64) / LibreOffice Community
Build ID: 4073f13330600d3efc25fc25450f9f635c6e74b2
CPU threads: 2; OS: Linux 3.10; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); UI: en-US
Calc: threaded

There is no crash now, many thanks.

So now, this code works, When disableCommand stops, the menu About is not
visible. :

Sub disableAboutCommand()
        disableCommand("About")
End Sub
Function disableCommand( cmd As String )
Dim keyNode As Object ' com.sun.star.configuration.Configuration(Update)Access
'

        With GlobalScope.Basiclibraries
                If Not .IsLibraryLoaded("Tools") Then .LoadLibrary("Tools")
        End With

        ' Set the root path for our configuration access
        keyNode =
Tools.Misc.GetRegistryKeyContent("org.openoffice.Office.Commands/Execute/Disabled",
True)

        newCmd = keyNode.CreateInstanceWithArguments( Array() )         
        newCmd.setPropertyValue( "Command", cmd ) ' Add cmd to disabled command
list 
        keyNode.insertByName( "Command-" & cmd, newCmd) ' name must be unique

        keyNode.commitChanges ' flush changes
End Function


I try the inverse :

Sub enableAboutCommand()
        enableCommand("About")
End Sub

Function enableCommand( cmd As String )
'on error resume next

        Dim keyNode As Object '
com.sun.star.configuration.Configuration(Update)Access '

        ' Set the root path for our configuration access
        With GlobalScope.Basiclibraries
        If Not .IsLibraryLoaded("Tools") Then .LoadLibrary("Tools")
    End With
    keyNode =
Tools.Misc.GetRegistryKeyContent("org.openoffice.Office.Commands/Execute/Disabled",
True)

        newCmd = keyNode.CreateInstanceWithArguments( Array() )         

        newCmd.setPropertyValue( "Command", cmd ) ' Add cmd to disabled command
list 

        keyNode.removeByName( "Command-" & cmd) ' name must be unique

        keyNode.commitChanges ' flush changes

End Function 

This code doesn't crash, but I've to restart LibreOffice to hae About menu
visible.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to