[Libreoffice] [PATCH][REVIEW] Fix for fdo#36673: corrupt date formats of cells

Katarina Machalkova kmachalkova at suse.cz
Tue May 10 08:37:02 PDT 2011

Brothers & sisters in LibO :)

Can some1 please review the attached patch? It fixes fdo#36673 (one of the 
most annoying ones), which is a regression from 3.3. Some data in cells 
formatted using certain date formats are lost, since the default date format 
is used instead. The issue affects all locale :(

The regression was introduced by commit b0e90c6561dcf3 which adds two new 
fraction number formats. Unfortunately, new num. formats can't be added ad-hoc 
like that, since NfIndexTableOffset enum in 'svl/inc/svl/zforlist.hxx' and 
locale XML files in 'i18npool/source/localedata/data/*.xml are interconnected  
(and I learned that the hard way).  
Changing the former means that we'd have to adjust the latter ... and ehm ... 
I guess we don't really want to do that as there are some integrity checks for 
locale files and this would effectively make them not pass anymore.

I'm not really proud of the code, especially not of this bit:

ImpInsertNewStandardFormat( aSingleFormatCode, nPos+1, 

since we're not defining any standard here. But the "standard" bit seems to be 
necessary for Calc to pick up a format that is neither within the boundaries 
set by NfIndexTableOffset nor defined by locale XML file in i18npool. Few 
lines below  ( in SvNumberFormatter::ImpGenerateAdditionalFormats() ) similar 
code is used to collect any optional formats defined by locale.

Alternatively, if we want to retain the two new fraction formats (and I gather 
we do, because of Excel compatibility), they can be added into locale XML 
files. But that would mean editing ... uhm ... ~200 files, so it's certainly 
nothing for 3.4

Thx for feedback

  \\\\\              Katarina Machalkova    
  \\\\\\\__o          LibO developer
__\\\\\\\'/_          & hedgehog painter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fdo36673.diff
Type: text/x-patch
Size: 2821 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110510/6f74b7d8/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110510/6f74b7d8/attachment-0001.pgp>

More information about the LibreOffice mailing list