[PATCH] Moving misplaced Formula options from ScDocOptions to ScAppOptions

Kohei Yoshida kohei.yoshida at suse.com
Fri Feb 24 17:45:42 PST 2012


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.

Kohei



More information about the LibreOffice mailing list