Ok, I'm going to try it using your directives and the code snippet provided
by Tobias;-)

Thank you both for your help.


2007/10/8, Carsten Driesner <[EMAIL PROTECTED]>:
>
> Jordi Sanchez wrote:
> > Thanks for your quick reply.
> >
> > Meanwhile I was investigating a little bit and I realised that the ODF
> > documents are able to store a set of custom settings per document. If I
> > unzip, (for instance), a writer document we can see the following
> structure:
> >
> > (I customized the menubar with a new entry for the document using
> > tools->customize)
> >
> > Archive:  /home/jordi/test.odt
> >  extracting: mimetype
> >    creating: Configurations2/statusbar/
> >   inflating: Configurations2/accelerator/current.xml
> >    creating: Configurations2/floater/
> >    creating: Configurations2/popupmenu/
> >    creating: Configurations2/progressbar/
> >   inflating: Configurations2/menubar/menubar.xml
> >    creating: Configurations2/toolbar/
> >    creating: Configurations2/images/Bitmaps/
> >   inflating: content.xml
> >   inflating: styles.xml
> >   inflating: meta.xml
> >   inflating: Thumbnails/thumbnail.png
> >   inflating: settings.xml
> >   inflating: META-INF/manifest.xml
> >
> > So, my next question is: How can I access (for creating/updating) the
> > document-specific settings (Configurations2/menubar/menubar.xml) using
> the
> > OOo API??
> >
> Hi Jordi,
>
> you can retrieve the ui configuration manager from the model of the
> document. Just use the interface com.sun.star.ui.XUIConfigurationManager
> available at the model. As Tobias wrote you can find some code snippets
> which explains you how to use the ui configuration manager to change the
> menu bar. Please be aware that the document based ui configuration
> manager normally has no ui elements (getSettings will throw an
> exception). First you have to retrieve the menu bar settings from the
> module ui configuration manager and adapt it. Then you can set it at the
> document ui configuration manager. Don't forget to call store() to make
> your changes persistent.
>
> Regards,
> Carsten
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to