On 2/10/2011 5:42 PM, Nick Burch wrote:
On Thu, 10 Feb 2011, Yegor Kozlov wrote:
Since BuiltinFormats is a common class shared by HSSF and XSSF, I think it is best to escape format definitions hardcoded in it. I committed the fix in r1069396.

Do .xlsx files generated by excel have the escaped or non-escaped form? If they have the old BuiltIn style form, we should maybe just add the escaping when we create the record


Yup, .xlsx escapes dollars and brackets too. I created a test file in Office 2007 and see that dollar is enclosed in double quotes:

<styleSheet>
<numFmts count="4">
<numFmt numFmtId="42" formatCode="_("$"* #,##0_);_("$"* \(#,##0\);_("$"* "-"_);_(@_)"/> <numFmt numFmtId="41" formatCode="_(* #,##0_);_(* \(#,##0\);_(* "-"_);_(@_)"/> <numFmt numFmtId="44" formatCode="_("$"* #,##0.00_);_("$"* \(#,##0.00\);_("$"* "-"??_);_(@_)"/> <numFmt numFmtId="43" formatCode="_(* #,##0.00_);_(* \(#,##0.00\);_(* "-"??_);_(@_)"/>
</numFmts>
....


So the fix seems to be OK for both HSSF and XSSF.

Yegor



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to