Apache OpenOffice (AOO) Bugzilla – Issue 119943
[From Symphony]Underline "_" can not work with ";" in format code, the semicolon will always be regarded as separator
Last modified: 2012-11-07 08:48:11 UTC
Build: AOO3.4 Steps: 1. New spreadsheet document 2. Open "Format Cell" dialog by cell context menu 3. In "Number" tab, Selecet a number format.Say, "0.00" 4. Insert "_;" into the format code string. Say, "0_;.00", click OK. Defect: The _ can not makes this number format skip a blank width as character ";". The ";" will be regarded as a separator in format code.
I do not consider it a bug, that ; is treated as separator. There exists no escape mechanism in this case. You could say, a underscore without a valid character following, is an invalid format code. But currently the user gets no information, that the syntax of the format code is not valid. So the real issue might be, that the user can enter invalid format codes.
Refer to AOO's help, "to use a character to define the width of a space in a number format, type an underscore(_) followed by the character. The width of the space varies according to the width of the character that you choose." So there is no define the scope of character that you can choose, and (;) can be selected. In MS Excel, if user input "0_;.00" as a cell's number format and cell's value is 12.34, result is 12 .34, MS Excel didn't consider (;) as the section separator. So I think it is a defect.
Created attachment 78314 [details] Add patch I'm working on this defect. Root Cause: Underline "_" can not work with ";" in format code, the semicolon will always be regarded as separator. when meet ";", number format scanner recognized it as a section divide symbol. ignore '*' and '_' before ';', and need to handle several place holder or other special symbol Resolution: if ';' is put behind of '_' and '*'(such escape symbol) , recognized it as a simple string and checked the number of such special symbol
I will review it
Reviewed. Patch looks good. Thanks for the good work. Applied on SVN revision 1352434
Request it by developer, Zhang Lu. Recommit it in reversion 1352457 since the original patch miss a condition.
Verified on latest AOO Trunk 0817 build on Window OS/Linux OS/Linux 64bit OS, this bug is fixed. Underline "_" works with ";" well in format code.
set Target Milestone to AOO 3.5.0 for PM purpose.