KDE

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • koffice doesn't read formulas correctly (testcase)

    1 answers - 2076 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Thursday 16 March 2006 16:19, Martin Ellis wrote:
    Wednesday 15 March 2006 22.11, Raul Fernandes wrote:
    When saving, kspread saves the formula replacing the commas to dot
    (it is ok as openoffice.org uses dot),
    but when loading, it doesn't convert to
    commas again. So, the result is:
    36 (not 3,6)
    This is as it should be. The storage format should not be localized,
    even though the GUI is.
    It eliminates the thousands separator (in your case '.'). With a space as
    thousands separator it works.
    As far as I can tell, the problem is as follows:
    loading a formula, the method
    void Cell::convertFormula( QString & text, const QString & f )
    is used to
    * Put single quotes round the names, where a formulae refer to sheet areas
    by name
    * Convert '.' (the DF decimal symbol) to the locale decimal symbol
    * Tidy up references between cells
    There look like a few problems with it.
    It seems to assume that formulae are of the form =areaname, or of the form
    =FUNCTIN(arg_1, , arg_n).
    This means that formulae with the following forms aren't converted properly:
    =const_value
    =x*y
    =expr+FUNCTIN()
    It currently translates the string by iterating over it character by
    character, firstly to get the function name, then to translate it's
    arguments.
    I can't make head nor tail of what the variable par is, and the parameter
    variable is checked for .isEmpty() before it could have been initialised.
    I'm not sure I see how to do the translation properly, without modifying
    the formula parser to also be able to parse the non-localised formulae,
    and output a localised formula.
    Here are some things that don't round-trip when saving and loading then:
    ="[areaname]" Where areaname exists becomes ="'areaname'"
    ="[areaname]" Where areaname doesn't exist becomes ="areaname"
    Martin
    koffice-devel mailing list
    koffice-devel (AT) kde (DOT) org
  • No.1 | | 439 bytes | |

    Hi,

    I've converted the localization to use an adoption of the formula tokenizer.
    Hopefully, it does the job not worse than before.

    It would really help me, if someone comes up with further unit tests.

    Bye,
    Stefan

    koffice-devel mailing list
    koffice-devel (AT) kde (DOT) org

    PGP SIGNATURE
    Version: GnuPG v1.4.2 (GNU/Linux)

    PG768eNz2QX/4bMakSY=
    =0ZaM
    PGP SIGNATURE

Re: koffice doesn't read formulas correctly (testcase)


max 4000 letters.
Your nickname that display:
In order to stop the spam: 7 + 6 =
QUESTION ON "KDE"

EMSDN.COM