suffix and prefix in <number:number-style> and <number:text-style>

Elvis Stansvik elvstone at gmail.com
Mon Aug 5 13:15:36 BST 2013


2013/8/5 Jos van den Oever <jos.van.den.oever at kogmbh.com>

> Look what I found in libs/odf/KoOdfNumberStyles.**cpp:
>
> ===
> //This is an extension of numeric style. For the moment we used namespace
> of
> //oasis format for specific calligra extension. Change it for the future.
> void addCalligraNumericStyleExtensi**on(KoXmlWriter &elementWriter, const
> QString &_suffix, const QString &_prefix)
> ===
>
> This function write tags <number:suffix> and <number:prefix> in the
> <number:number-style> elements and the <number:text-style> elements.
>
> It was introduced in 2005:
> ===
> commit 9964ed1963bbf629d0f6d54d83ab9f**1d423db3fc
> Author: Laurent Montel <montel at kde.org>
> Date:   Sun Feb 27 12:21:40 2005 +0000
>
>     Allow to store prefix/suffix into numeric style
>     (koffice extension)
> ===
>
> This feature is used in Sheets:
>  - create empty spreadsheet
>  - choose 'Cell Format ..." from the context menu of a cell
>  - write 'PREFIX' in the 'Prefix:' field
>  - write 'SUFFIX' in the 'Postfix:' field
>  - close the dialog
>  - The cell now contains this text: "PREFIX 0 SUFFIX"
>  - save the file
>
> Saving gives this ODF fragment:
>     <number:number-style style:name="N1">
>       <number:text>PREFIX</number:**text>
>       <number:number number:min-integer-digits="1"/**>
>       <number:text>SUFFIX</number:**text>
>       <number:suffix>SUFFIX</number:**suffix>
>       <number:prefix>PREFIX</number:**prefix>
>     </number:number-style>
>
> Opening it in LibreOffice shows: "PREFIX0SUFFIX" which is correct
> interpretation of the XML. Looking at the cell format dialog shows this
> formatting string:
>   "PREFIX"General"SUFFIX"
>
> Saving the spreadsheet again, gives this:
>     <number:number-style style:name="N120">
>       <number:text>PREFIX</number:**text>
>       <number:number number:min-integer-digits="1"/**>
>       <number:text>SUFFIX</number:**text>
>     </number:number-style>
>
> As expected, the non-standard, prefix and suffix are removed.
>
> Gnumeric can load the file too but does not show the prefix and suffix.
>
> Since the prefix and postfix behavior can be obtained with the
> <number:text/> element, I propose that Calligra removes the code for
> writing <text:suffix> and <text:prefix>.
>

Sounds right to me (if you mean not remove, but replace it with writing of
<number:text>), if they really are functionally equivalent.

Elvis


> Cheers,
> Jos
>
> ______________________________**_________________
> calligra-devel mailing list
> calligra-devel at kde.org
> https://mail.kde.org/mailman/**listinfo/calligra-devel<https://mail.kde.org/mailman/listinfo/calligra-devel>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20130805/4bed607d/attachment.htm>


More information about the calligra-devel mailing list