summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2013-10-17 04:06:24 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2013-10-17 04:06:42 +0200
commit9d5e05edb20819e7b989f366fbd86ca4c2cd7cc5 (patch)
tree13bcc5b4c3c44d661094bfb716eff976c995bb18 /forms
parent6aa0488da21ef21b9da68253682b174f11f305f5 (diff)
bogus WaE: 'bValue' may be used uninitialized in this function
Change-Id: I14983509a41bd6be0d7fed29d7f89fa4a21fe08a
Diffstat (limited to 'forms')
-rw-r--r--forms/source/component/CheckBox.cxx12
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;