mirror of https://github.com/apache/poi.git
add comments and make the statefulness of localeIsAdapting more obvious.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1747171 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
84a5a27dc1
commit
6fbb02ef14
|
@ -207,7 +207,7 @@ public class DataFormatter implements Observer {
|
||||||
private Locale locale;
|
private Locale locale;
|
||||||
|
|
||||||
/** stores if the locale should change according to {@link LocaleUtil#getUserLocale()} */
|
/** stores if the locale should change according to {@link LocaleUtil#getUserLocale()} */
|
||||||
private boolean localeIsAdapting = true;
|
private boolean localeIsAdapting;
|
||||||
|
|
||||||
private class LocaleChangeObservable extends Observable {
|
private class LocaleChangeObservable extends Observable {
|
||||||
void checkForLocaleChange() {
|
void checkForLocaleChange() {
|
||||||
|
@ -265,8 +265,13 @@ public class DataFormatter implements Observer {
|
||||||
* @param emulateCSV whether to emulate CSV output.
|
* @param emulateCSV whether to emulate CSV output.
|
||||||
*/
|
*/
|
||||||
private DataFormatter(Locale locale, boolean localeIsAdapting, boolean emulateCSV) {
|
private DataFormatter(Locale locale, boolean localeIsAdapting, boolean emulateCSV) {
|
||||||
|
this.localeIsAdapting = true;
|
||||||
localeChangedObservable.addObserver(this);
|
localeChangedObservable.addObserver(this);
|
||||||
|
// localeIsAdapting must be true prior to this first checkForLocaleChange call.
|
||||||
localeChangedObservable.checkForLocaleChange(locale);
|
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.localeIsAdapting = localeIsAdapting;
|
||||||
this.emulateCSV = emulateCSV;
|
this.emulateCSV = emulateCSV;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue