diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2013-10-17 04:06:24 +0200 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2013-10-17 04:06:42 +0200 |
commit | 9d5e05edb20819e7b989f366fbd86ca4c2cd7cc5 (patch) | |
tree | 13bcc5b4c3c44d661094bfb716eff976c995bb18 /forms/source/component/CheckBox.cxx | |
parent | this method is not supposed to throw, fdo#66241 (diff) | |
download | core-9d5e05edb20819e7b989f366fbd86ca4c2cd7cc5.tar.gz core-9d5e05edb20819e7b989f366fbd86ca4c2cd7cc5.zip |
bogus WaE: 'bValue' may be used uninitialized in this function
Change-Id: I14983509a41bd6be0d7fed29d7f89fa4a21fe08a
Diffstat (limited to 'forms/source/component/CheckBox.cxx')
-rw-r--r-- | forms/source/component/CheckBox.cxx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/forms/source/component/CheckBox.cxx b/forms/source/component/CheckBox.cxx index 5198ccc06a91..5db73971d693 100644 --- a/forms/source/component/CheckBox.cxx +++ b/forms/source/component/CheckBox.cxx @@ -217,7 +217,7 @@ Any OCheckBoxModel::translateDbColumnToControlValue() ////////////////////////////////////////////////////////////////// // Set value in ControlModel - bool bValue = false; + bool bValue; if(DbUseBool()) { bValue = m_xColumn->getBoolean(); @@ -241,7 +241,17 @@ Any OCheckBoxModel::translateDbColumnToControlValue() } else if ( !aValue.hasValue() ) { + // 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. +#if defined __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif aValue <<= (sal_Int16)( bValue ? STATE_CHECK : STATE_NOCHECK ); +#if defined __GNUC__ +#pragma GCC diagnostic pop +#endif } return aValue; |