Hi Eike,

Eike Rathke schrieb:
Hi Regina,

On Tuesday, 2009-03-17 18:04:12 +0100, Regina Henschel wrote:

But export to "Microsoft Excel 2003 XML (.xml) is problematic.
If OOo is set to save in "odf1.2", the file opens with errors in Excel. All formulae are stripped. The error log says for example
GRUND: Ungültiger Wert
WERT:   of:=LOGNORMDIST(0.6;[.B12];[.B11])
I think, there should not be this kind of WERT, because that form was unkown 2003.

That's http://qa.openoffice.org/issues/show_bug.cgi?id=96018

OK, so i don't worry, it is outside my scope.



If OOo is set to save in "odf1.1", the cases with parameter count <= 3 are opened with formulas, only the cases with parameter count=4 give an error and the formulas are stripped. The error log says for example
GRUND: Ungültiger Wert
WERT:   =LOGNORMDIST(0.6,R[-1]C,R[-2]C,R[-3]C)
I think that is the correct behaviour.

Yes, it is.


Now the OOo-part:

I have added in FormulaMissingContext::AddMoreArgs() the lines
<code>
        case ocLogNormDist:
            if (mnCurArg == 0)
            {
                pNewArr->AddOpCode (ocSep );
                pNewArr->AddDouble( 0.0 );      // 2nd, mean = 0.0
            }
            if (mnCurArg == 1)

That should be  if (mnCurArg <= 1)  instead. The AddMoreArgs() method is
called once for each function, both arguments have to be added if only
one was present.

I found it in the meantime too. Using a switch as Daniel has shown me for Excel export works as well.


            {
                pNewArr->AddOpCode (ocSep );
pNewArr->AddDouble( 1.0 ); // 3rd, standard deviatioen = 1.0
            }
            break;
</code>

If OOo is set to save to odf1.2, then I get the transformation
=LOGNORMDIST(0,6;3) --> =LOGNORMDIST(0,6;3;1)
That is undesirable. It is contrary to the new feature, that the parameter is optional.

We want to add the parameters in any case because otherwise OOo3.0/3.1
wouldn't be able to interpret the formula, as they expect 3 parameters.
This is perfectly well. While 3.2 will be able to read without arguments
for the optional parameters, it will write something that can be read by
any 3.x release.

OK, a kind of 'political' decision. I'll implement it that way.


And I get the transformation
=LOGNORMDIST(0,6) --> =LOGNORMDIST(0,6;0)
It shouldn't be transformed at all (see above). But when it is transformed, why is the third parameter missing?

See above, mnCurArg==0 in this case.

It is not missing, when using "odf1.1", see below.

If OOo is set to save to odf1.1, then I get the transformations
=LOGNORMDIST(0,6;3) --> =LOGNORMDIST(0,6;3;1)
=LOGNORMDIST(0,6) --> =LOGNORMDIST(0,6;0;1)
I think, those transformations are OK.

Huh? That would be strange for the second case. Are you sure it was
produced using the code you posted above? Seems more you fixed already
what I lined out ;-)

You are right, it works now as it should.

No more questions for now, I'll continue my tests. Thanks for your help.

kind regards
Regina


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@sc.openoffice.org
For additional commands, e-mail: dev-h...@sc.openoffice.org

Reply via email to