[Libreoffice] Help with moving misplaced options from ScDocOptions to ScAppOptions

Markus Mohrhard markus.mohrhard at googlemail.com
Thu Jun 23 20:37:26 PDT 2011

Hello Albert,

I forgot to respond to your mail. Kohei is not here till the beginning of
July, but I try to answer your questions as good as possible.

Simple as this task might seem (it's is mostly a matter of copy&paste)
> I still have run into troubles that I can't figure out. In
> tpcompatibility.cxx we have the following line:
>  const ScTpCalcItem& rItem = static_cast<const ScTpCalcItem&>(
>         rCoreAttrs.Get(GetWhich(SID_SCDOCOPTIONS)));
> Ref::
> http://opengrok.libreoffice.org/xref/calc/sc/source/ui/optdlg/tpcompatibility.cxx#48

This line searches the SfxItemSet  for the entry with the key
SID_SCDOCOPTIONS. The result is an SfxPoolItem, in this case casted to a
ScTpCalcItem which is a subclass of SfxPoolItem.

> I'm no quite sure what this line actually does. It seems to identify
> the ScDocOption class and bind a pointer to this class to a
> ScTpCalcItem.
> Unfortunately for me there is no corresponding slot-ID to
> SID_SCDOCOPTIONS for the ScAppOptions class, otherwise I could just
> changed that and be done.

No you would not. You would get a totally different SfxPoolItem, that you
could not cast to ScTpCalcItem. so if you want to move this option to the
other dialog(I think Kohei suggested this) you first need to make sure that
you get the same SfxItemSet to your class.

> The question is now how to implement some corresponding functionality
> here for ScAppOptions.

Let me have a look at the code and search you some code pointers. I'll sent
you a mail with some more information in this direction during the next

> As I understand the overall purpose you what to create two pointers to
> copies of the option set, manipulate one set, compare them and then
> store the modified set to file.

No, they are saved back to the SfxItemSet. This ItemSet is used in several
other locations to get the Information, for example to write the Shortcuts
to the menu entries. At the moment this whole construct is only used to save
the keybindings. It might be that some parts could be improved there but I
don't know Kohei's plan for this class.

> Help on this is appreciated.

If this didn't help you, go on with asking. I try to answer your questions
as good as possible. You can also poke me at IRC, my nick is moggi.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110624/ae22fe3f/attachment.html>

More information about the LibreOffice mailing list