Thomas Krumbein wrote:
Hey,

I tried to get access to a toolbar created via addon.xcu of an extension.

Part of my addon.xcu:
.
<node oor:name="AddonUI">
   <node oor:name="OfficeToolBar">
        <node oor:name="MAK017_AL.OfficeToolBar" oor:op="replace">
           <node oor:name="m1" oor:op="replace">
..

Trying to access later this toolbar using configuration-manager:

..
aModTB = array("com.sun.star.text.TextDocument")
 oModuleCfgMgrSupplier =
createUnoService("com.sun.star.ui.ModuleUIConfigurationManagerSupplier")
 'xray oModuleCfgMgr
  For i = 0 to uBound(aModTB)  'für jedes Modul

    oModuleCfgMgr =
oModuleCfgMgrSupplier.getUIConfigurationManager(aModTB(i) )

    if (
oModuleCfgMgr.hasSettings("private:resource/toolbar/addon_MAK017_AL.OfficeToolBar"))
then
      oMod = oModuleCfgMgr.getSettings(
"private:resource/toolbar/addon_MAK017_AL.OfficeToolBar" ,
true).getByIndex(0)             
..

There is no setting in container. The code will work, if the
toolbar-name starts with "custom_", but this is only possible if I
create the toolbar via macro.
Is there another way to get access to this "addon-" toolbar?
Hi Thomas,

There is no way to access an add-on toolbar via the configuration API. These toolbars are not stored in the UI configuration base, but in the Office configuration. They are created on-demand via the Addons.xcu and not by reading a toolbar.xml file. I don't know why you want to change the structure using the UI configuration API. You have access using the Addons.xcu file. Custom toolbars are persistent toolbars where their structure is stored in the soffice.cfg folder. You can still access the toolbar (without structure info) via the LayoutManager and make it visible/invisible, move it around or dock/undock it.

Regards,
Carsten

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

Reply via email to