Issue 119943 - [From Symphony]Underline "_" can not work with ";" in format code, the semicolon will always be regarded as separator
Summary: [From Symphony]Underline "_" can not work with ";" in format code, the semico...
Alias: None
Product: Calc
Classification: Application
Component: editing (show other issues)
Version: 3.4.0
Hardware: PC All
: P3 Normal (vote)
Target Milestone: 4.0.0
Assignee: AOO issues mailing list
QA Contact:
Depends on:
Reported: 2012-06-11 08:39 UTC by Yan Ji
Modified: 2012-11-07 08:48 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---

Add patch (993 bytes, patch)
2012-06-14 05:11 UTC, Zhang Lu
zhanglu.aoo: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Yan Ji 2012-06-11 08:39:47 UTC
Build: AOO3.4
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.

The _ can not makes this number format skip a blank width as character ";". 
The ";" will be regarded as a separator in format code.
Comment 1 Regina Henschel 2012-06-11 15:10:43 UTC
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.
Comment 2 Zhang Lu 2012-06-12 06:53:41 UTC
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.
Comment 3 Zhang Lu 2012-06-14 05:11:09 UTC
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 

if ';' is put behind of '_' and '*'(such escape symbol) , recognized it as a simple string and checked the number of such special symbol
Comment 4 Wang Lei 2012-06-21 02:44:32 UTC
I will review it
Comment 5 Wang Lei 2012-06-21 07:34:09 UTC
Reviewed.  Patch looks good.
Thanks for the good work.
Applied on SVN revision 1352434
Comment 6 Wang Lei 2012-06-21 08:49:14 UTC
Request it by developer, Zhang Lu.
Recommit it in reversion 1352457 since the original patch miss a condition.
Comment 7 binguo 2012-08-20 09:47:40 UTC
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.
Comment 8 Shenfeng Liu 2012-11-07 08:48:11 UTC
set Target Milestone to AOO 3.5.0 for PM purpose.