https://bz.apache.org/bugzilla/show_bug.cgi?id=62639
Bug ID: 62639
Summary: DataFormatter can never set its provided locale
Product: POI
Version: 3.17-FINAL
Hardware: PC
Status: NEW
Severity: major
Priority: P2
Component: POI Overall
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Hi,
I use POI 3.17 version.
And i found that the formated date cell for instance allways follow the current
locale.
Analysis :
With "this.localeIsAdapting = true;" in the constructor with 3 arguments
we can never set localsAdapting to <code>false</code> in the Construstor with 2
arguments.
it will always be <code>true</code> for field localIsAdapting.
in "this(locale, false, emulateCSV);"
//snipppet org.apache.poi.ss.usermodel.DataFormatter -------------
/**
* Creates a formatter using the given locale.
*
* @param emulateCSV whether to emulate CSV output.
*/
public DataFormatter(Locale locale, boolean emulateCSV) {
this(locale, false, emulateCSV);
}
/**
* Creates a formatter using the given locale.
* @param localeIsAdapting (true only if locale is not user-specified)
* @param emulateCSV whether to emulate CSV output.
*/
private DataFormatter(Locale locale, boolean localeIsAdapting, boolean
emulateCSV) {
this.localeIsAdapting = true;
localeChangedObservable.addObserver(this);
// localeIsAdapting must be true prior to this first
checkForLocaleChange call.
localeChangedObservable.checkForLocaleChange(locale);
// set localeIsAdapting so subsequent checks perform correctly
// (whether a specific locale was provided to this DataFormatter or
DataFormatter should
// adapt to the current user locale as the locale changes)
this.localeIsAdapting = localeIsAdapting;
this.emulateCSV = emulateCSV;
}
Best Regards,
Rochemont Patrice.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]