From a4f39904dca51f86171508c08cfd00d35b7a3989 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 14 Nov 2014 10:34:40 +0000 Subject: coverity#1251587 Unchecked dynamic_cast Change-Id: Ibde77906333699046357bec4ff392e5e08b4a426 --- sc/source/ui/optdlg/calcoptionsdlg.cxx | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'sc/source') diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx index 5e003dfcb01e..14d2de5d00aa 100644 --- a/sc/source/ui/optdlg/calcoptionsdlg.cxx +++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx @@ -763,13 +763,11 @@ const ScCalcConfig::OpenCLImplMatcher& ScCalcOptionsDialog::CurrentWhiteOrBlackL void ScCalcOptionsDialog::EditFieldValueChanged(Control *pCtrl) { - Edit* pEdit(dynamic_cast(pCtrl)); + Edit& rEdit(dynamic_cast(*pCtrl)); - assert(pEdit); + OUString sVal = rEdit.GetText(); - OUString sVal = pEdit->GetText(); - - if (pEdit == mpEditField) + if (&rEdit == mpEditField) { // We know that the mpEditField is used for only one thing at the moment, // the OpenCL subset list of opcodes @@ -783,32 +781,32 @@ void ScCalcOptionsDialog::EditFieldValueChanged(Control *pCtrl) const ScCalcConfig::OpenCLImplMatcher& impl(CurrentWhiteOrBlackListEntry()); ScCalcConfig::OpenCLImplMatcher newImpl(impl); - if (pEdit == mpOS) + if (&rEdit == mpOS) { newImpl.maOS = sVal; } - else if (pEdit == mpOSVersion) + else if (&rEdit == mpOSVersion) { newImpl.maOSVersion = sVal; } - else if (pEdit == mpPlatformVendor) + else if (&rEdit == mpPlatformVendor) { newImpl.maPlatformVendor = sVal; } - else if (pEdit == mpDevice) + else if (&rEdit == mpDevice) { newImpl.maDevice = sVal; } - else if (pEdit == mpDriverVersionMin) + else if (&rEdit == mpDriverVersionMin) { newImpl.maDriverVersionMin = sVal; } - else if (pEdit == mpDriverVersionMax) + else if (&rEdit == mpDriverVersionMax) { newImpl.maDriverVersionMax = sVal; } else - assert(false && "pEdit does not match any of the Edit fields"); + assert(false && "rEdit does not match any of the Edit fields"); ScCalcConfig::OpenCLImplMatcherSet& rSet(CurrentWhiteOrBlackList()); -- cgit