diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2013-10-17 16:00:07 +0200 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2013-10-17 16:00:55 +0200 |
commit | 080e9c298738988f36df43b8edd7b6e7bf4224cf (patch) | |
tree | 63ae7a87a8ebdeb3c929c3d9cd3f6d718ffd77bb /forms/source/component/CheckBox.cxx | |
parent | 1fc195f7e830619d56cc4c56043b154bc3a72b02 (diff) |
bogus WaE: 'bValue' may be used uninitialized in this function
Change-Id: Ifde0f9370d093f447edac4899c5bbc7940da5a8c
Diffstat (limited to 'forms/source/component/CheckBox.cxx')
-rw-r--r-- | forms/source/component/CheckBox.cxx | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/forms/source/component/CheckBox.cxx b/forms/source/component/CheckBox.cxx index 479672948661..04a5399d23da 100644 --- a/forms/source/component/CheckBox.cxx +++ b/forms/source/component/CheckBox.cxx @@ -211,17 +211,13 @@ bool OCheckBoxModel::DbUseBool() } //------------------------------------------------------------------------------ -#if defined __GNUC__ && ! defined __clang__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" -#endif Any OCheckBoxModel::translateDbColumnToControlValue() { Any aValue; ////////////////////////////////////////////////////////////////// // Set value in ControlModel - bool bValue; + bool bValue = bool(); // avoid warning if(DbUseBool()) { bValue = m_xColumn->getBoolean(); @@ -247,17 +243,13 @@ Any OCheckBoxModel::translateDbColumnToControlValue() { // Since above either bValue is initialised, either aValue.hasValue(), // bValue cannot be used uninitialised here. - // But GCC does not see/understand that, which breaks -Werror builds. - // And Clang compiler does not support #pragma GCC diagnostic - // within a function, moved them to outside the function. + // But GCC does not see/understand that, which breaks -Werror builds, + // so we explicitly default-initialise it. aValue <<= (sal_Int16)( bValue ? STATE_CHECK : STATE_NOCHECK ); } return aValue; } -#if defined __GNUC__ && ! defined __clang__ -#pragma GCC diagnostic pop -#endif //----------------------------------------------------------------------------- sal_Bool OCheckBoxModel::commitControlValueToDbColumn( bool /*_bPostReset*/ ) |