From calligra-devel Mon Aug 05 19:54:44 2013 From: Sebastian Sauer Date: Mon, 05 Aug 2013 19:54:44 +0000 To: calligra-devel Subject: Re: suffix and prefix in and Message-Id: <52000304.1050200 () dipe ! org> X-MARC-Message: https://marc.info/?l=calligra-devel&m=137573537420567 On 08/05/2013 07:25 PM, Elvis Stansvik wrote: > 2013/8/5 Elvis Stansvik > >> 2013/8/5 Jos van den Oever >> >>> 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 and in the >>> elements and the elements. >>> >>> It was introduced in 2005: >>> === >>> commit 9964ed1963bbf629d0f6d54d83ab9f**1d423db3fc >>> Author: Laurent Montel >>> 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: >>> >>> PREFIX >>> >>> SUFFIX >>> SUFFIX >>> PREFIX >>> >>> >>> 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: >>> >>> PREFIX >>> >>> SUFFIX >>> >>> >>> 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 >>> element, I propose that Calligra removes the code for >>> writing and . +2 >> Sounds right to me (if you mean not remove, but replace it with writing of >> ), if they really are functionally equivalent. In Jos example above they are already written. its just that we write them two times cause somebody forgot to remove the prefix/suffix tag-writing when adding the ODF code :) > Though thinking a bit more; when loading back in, how do we > know that this was specified as a prefix/suffix by the user (and this > should be placed in the Prefix:/Suffix fields), and not as a general text > component of the format? (just assuming you can do that as well). That prefix/suffix thing is complete our own invention. I think its legacy from the old KSpread file format where KSpread didn't use formatting-masks like ODF uses and we just forgot to remove that code (and proper adjust the UI imho, but that's unrelated to the topic on hand). _______________________________________________ calligra-devel mailing list calligra-devel@kde.org https://mail.kde.org/mailman/listinfo/calligra-devel