Yan Wu wrote:
Hi Carsten,

Currently button 'Reset' on Dialog Tools->Customize->Keyboard is to restore the default shortcuts for an application/module. when implementing the reset feature for the XCU based configuration accelerators, we shouldn't try to remove the whole Accelerators.xcu in the user layer, because the Accelerators.xcs contains all the module depending accelerators entries. And now I have three ideas:

1)remove the entry(e.g.: <node oor:name="com.sun.star.text.TextDocument" oor:op="replace">) from the user layer's Accelerators.xcu, using configuration API. But currently removeByName(XNameAccess) is to OVERRIDE the lower entry, not to REMOVE the entry indeed from the already merged XCU. Is there API can be used to restore the default data for set node? I found an implementation like doDifferenceToDefaultState(...) in the configmgr, but found no such UNO API.

2)would the the XML API(e.g.: XNode->removeChild), which has already an implementation in module unoxml, be an choice to remove an node from an XCU(XML) file?

3)create a new duplicated default Acelerators.xcu, to compare the AcceleratorsDefault.xcu and Accelerators.xcu, then write the diffs to configuration. But as for performance, this solution wouldn't be better than 1) and 2).

What's your opinion?
Hi Yan,

You should use the HierarchyAccess (look at com.sun.star.configuration.HierarchyAccess) service of the configuration which provides a com.sun.star.beans.XMultiPropertyState interface. There you can call setAllPropertiesToDefault(). According to Joerg Barfurth, the inventor of the OpenOffice.org configuration implementation, this should be possible for whole sets. It's not clear how well this part of the implementation is tested, therefore you have to try out. Solution 2 or 3 are nothing one would like to implement. We clearly need support for this kind of operation from the configuration itself.

Regards,
Carsten

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@framework.openoffice.org
For additional commands, e-mail: dev-h...@framework.openoffice.org

Reply via email to