diff options
author | tkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7> | 2013-04-10 19:28:41 +0000 |
---|---|---|
committer | tkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7> | 2013-04-10 19:28:41 +0000 |
commit | 47c8c6b377fe51ee60cdad518946613a262792cf (patch) | |
tree | 72f19905369f599d0441792ad40d86da475c399c /pdf-over-gui | |
parent | 0a24f8c56cb0f156bd548883a5e3b53cfc149ce2 (diff) | |
download | mocca-47c8c6b377fe51ee60cdad518946613a262792cf.tar.gz mocca-47c8c6b377fe51ee60cdad518946613a262792cf.tar.bz2 mocca-47c8c6b377fe51ee60cdad518946613a262792cf.zip |
More null guards in config
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@341 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
Diffstat (limited to 'pdf-over-gui')
4 files changed, 13 insertions, 7 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java index 88fcfc0d..73e36074 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java @@ -290,7 +290,7 @@ public class ConfigurationComposite extends StateComposite { this.configurationContainer.setSignatureNote( this.configProvider.getSignatureNote()); - this.configurationContainer.setLocale(this.configProvider.getConfigLocale()); + this.configurationContainer.setLocale(this.configProvider.getLocale()); this.configurationContainer.setSignLocale(this.configProvider.getSignLocale()); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/ConfigProvider.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/ConfigProvider.java index 9d337b6d..7807079b 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/ConfigProvider.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/ConfigProvider.java @@ -116,7 +116,7 @@ public interface ConfigProvider { * Gets the configured locale * @return the configured locale */ - public Locale getConfigLocale(); + public Locale getLocale(); /** * Gets the configured locale diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/ConfigProviderImpl.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/ConfigProviderImpl.java index 12b60c0f..45a834ab 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/ConfigProviderImpl.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/ConfigProviderImpl.java @@ -275,7 +275,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, Point size = this.configuration.getMainWindowSize(); props.setProperty(Constants.CFG_MAINWINDOW_SIZE, size.x + "," + size.y); //$NON-NLS-1$ - Locale configLocale = this.getConfigLocale(); + Locale configLocale = this.getLocale(); if(configLocale != null) { props.setProperty(Constants.CFG_LOCALE, LocaleSerializer.getParsableString(configLocale)); } @@ -822,8 +822,11 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, * @see at.asit.pdfover.gui.workflow.ConfigProvider#getConfigLocale() */ @Override - public Locale getConfigLocale() { - return this.configuration.getLocale(); + public Locale getLocale() { + Locale locale = this.configuration.getLocale(); + if (locale == null) + locale = Messages.getDefaultLocale(); + return locale; } /* (non-Javadoc) @@ -843,7 +846,10 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, */ @Override public Locale getSignLocale() { - return this.configuration.getSignLocale(); + Locale locale = this.configuration.getSignLocale(); + if (locale == null) + locale = Messages.getDefaultLocale(); + return locale; } /* (non-Javadoc) diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/PersistentConfigProvider.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/PersistentConfigProvider.java index c9c02b63..764265fb 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/PersistentConfigProvider.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/PersistentConfigProvider.java @@ -100,7 +100,7 @@ public interface PersistentConfigProvider { * Gets the configured locale * @return the configured locale */ - public Locale getConfigLocale(); + public Locale getLocale(); /** * Gets the configured locale |