Apache OpenOffice (AOO) Bugzilla – Issue 121577
Allow setting toolbar name in Addons.xcu
Last modified: 2022-10-28 12:54:15 UTC
Currently the localized name of the toolbar defined by an extension cannot be set in the same file where the toolbar is defined, Addons.xcu In order to set the toolbar name, the extension developer has to create a configuration file <Modelue>WindowState.xcu for every office module where the toolbar is to be displayed, even if the toolbar name will be exactly the same in every module. This situation is rather sub-optimal.
.
Change applied in revision 1429069 schema modification, framework refactoring revision 1429068 ToolbarLayoutManager changes revision 1429070 adapt existing Addons.xcu Now the OfficeToolBar is a set of ToolBar <set oor:name="OfficeToolBar" oor:node-type="ToolBar"> <info> <desc>Contains a lists of addon toolbars.</desc> </info> </set> A ToolBar consist of a localized Title and a set of ToolBarItems: <group oor:name="ToolBar"> <info> <desc>Contains the structure of a toolbar.</desc> </info> <prop oor:name="Title" oor:type="xs:string" oor:localized="true"> <info> <desc>A localized string used as the toolbar title.</desc> </info> <value></value> </prop> <set oor:name="ToolBarItems" oor:node-type="ToolBarItem"> <info> <desc>Contains a list of sets of toolbar items that are part of add-on toolbars.</desc> </info> </set> </group> A ToolBarItem has the same elements as before (though some clean-up should be made here, to remove the obsolete "ImageIdentifier"). Setting the toolbar title in Addons.xcu will take precedence over the <Module>WindowState.xcu. The later will be taken into account only when the title is empty in Addons.xcu. This way, an extension wanting to provide a different localized name for different modules, has to leave the Title in Addons.xcu empty, and set the UIName in the WindowState xcu's.
Created attachment 80097 [details] Sample extension where the toolbar title is set in Addons.xcu
Created attachment 80098 [details] Sample extension where the toolbar title is set in the UIName property The "Title" in Addons.xcu is empty. The extensions sets the "UIName" property in CalcWindowState.xcu and WriterWindowState
Created attachment 80099 [details] Sample extension where the toolbar has no title If the title is not set in Addons.xcu nor in a WindowState xcu, the toolbar title will be generated as before: "Add-on N"