Author: hdu
Date: Tue Jul  9 08:48:59 2013
New Revision: 1501137

URL: http://svn.apache.org/r1501137
Log:
#i122603# fix database wizard's use of the Numberformatter

Patch by: Tsutomu Uchino <[email protected]>
Review by: Herbert Dürr <[email protected]>

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.

Modified:
    
openoffice/trunk/main/wizards/com/sun/star/wizards/common/NumberFormatter.java

Modified: 
openoffice/trunk/main/wizards/com/sun/star/wizards/common/NumberFormatter.java
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/wizards/com/sun/star/wizards/common/NumberFormatter.java?rev=1501137&r1=1501136&r2=1501137&view=diff
==============================================================================
--- 
openoffice/trunk/main/wizards/com/sun/star/wizards/common/NumberFormatter.java 
(original)
+++ 
openoffice/trunk/main/wizards/com/sun/star/wizards/common/NumberFormatter.java 
Tue Jul  9 08:48:59 2013
@@ -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));


Reply via email to