[PATCH] Moving misplaced Formula options from ScDocOptions to ScAppOptions
Albert Thuswaldner
albert.thuswaldner at gmail.com
Sun Feb 26 15:44:30 PST 2012
Hi Kohei,
Thank you for your feedback.
On Sat, Feb 25, 2012 at 02:45, Kohei Yoshida <kohei.yoshida at suse.com> wrote:
> On Fri, 2012-02-24 at 20:38 -0500, Kohei Yoshida wrote:
>> Hi Albert,
>>
>> On Sat, 2012-02-25 at 01:12 +0100, Albert Thuswaldner wrote:
>>
>> > 1.) ScDocument::SetDocOptions requires some rethink. Here, now that
>> > the format option stuff is moved to appoptions, only
>> > xPoolHelper->SetFormTableOpt(rOpt); uses data from docoptions, the mix
>> > of options makes this method ugly. Splitting this up might be a
>> > solution, however ScDocument::SetDocOptions is used in quite many
>> > places....
>>
>> So, your observation is correct. As you say, it's best to take the code
>> that sets the formula options out of SetDocOptions and into its own
>> method. We could call it SetFormulaOptions() or something. The new
>> SetDocOptions() would basically have nothing other than
>>
>> {
>> OSL_ENSURE( pDocOptions, "No DocOptions! :-(" );
>> *pDocOptions = rOpt;
>> xPoolHelper->SetFormTableOpt(rOpt);
>> }
>>
>> and the rest can go to the new method.
>
> Actually, the new method doesn't have to be in ScDocument at all. The
> only thing you need to set to ScDocument is the grammar, but other than
> that, the rest can be done outside of ScDocument. I'm not really sure
> what the best place would be, but you could, for instance, put it in
> ScDocShell, since it needs to be callable from CheckConfigOptions...
> Just an idea.
Yes, SeDocShell seems to be a good place to put it in. I made the
necessary changes as a follow-up patch, see attached file.
I noticed that the SetFormulaOptions is also needed in
ScDocShell::InitOptions otherwise documents will not show up with the
selected formula format on open.
As a next step I will try to group the Formula options as discussed.
/Albert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Splitting-ScDocument-SetDocOptions-moved-new-SetForm.patch
Type: text/x-patch
Size: 7118 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120227/bed707f9/attachment.bin>
More information about the LibreOffice
mailing list