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

Albert Thuswaldner albert.thuswaldner at gmail.com
Sat Jun 25 14:23:58 PDT 2011


Hi Marcus,

Thank you for your reply. And thanks for the help, Your comments made
me have another look on the code and this time I saw some parts in a
different light. :)

On Fri, Jun 24, 2011 at 05:37, Markus Mohrhard
<markus.mohrhard at googlemail.com> wrote:
> 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.

I still don't know what this line does exactly. But I learned that
I'll had to add some more stuff  to the ScAppOptions class than
initially thought. I'm sure you can implement something similar like
this line, but for now I have left that out for now. I have a working
patch, I'll post it in a few minutes.

>> 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
> days.
>>
>> 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.

Thanks.

> Regards,
> Markus
>
>

/Albert


More information about the LibreOffice mailing list