Kaydet (Commit) 4ddd844c authored tarafından Herbert Dürr's avatar Herbert Dürr

#i122603# fix database wizard's use of the Numberformatter

Patch by: Tsutomu Uchino <hanya.runo@gmail.com>
Review by: Herbert Durr <hdu@apache.org>

When the setNumberFormat method is called from DBColumn::initializeNumberFormat
method the number formatter is the document's one and the passed arguments
are from the database column.

Before the format key is set to the table cell, the format key from the 
column is used to generate the new key on the number format supplier. 
Therefore setting the cell's FormatsSupplier property is not required 
as the document's one is used.

As the same setNumberFormat method is called from other wizards the line 
is not removed but only active if the property exists.
üst 3c07f6e1
......@@ -197,7 +197,8 @@ public class NumberFormatter
Locale oLocale = (Locale) Helper.getUnoPropertyValue(xNumberFormat, "Locale");
int NewFormatKey = defineNumberFormat(FormatString, oLocale);
XPropertySet xPSet = UnoRuntime.queryInterface(XPropertySet.class, _xFormatObject);
xPSet.setPropertyValue("FormatsSupplier", _oNumberFormatter.xNumberFormatter.getNumberFormatsSupplier());
if (xPSet.getPropertySetInfo().hasPropertyByName("FormatsSupplier"))
xPSet.setPropertyValue("FormatsSupplier", _oNumberFormatter.xNumberFormatter.getNumberFormatsSupplier());
if (xPSet.getPropertySetInfo().hasPropertyByName("NumberFormat"))
{
xPSet.setPropertyValue("NumberFormat", new Integer(NewFormatKey));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment