Kaydet (Commit) 152e2488 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Work around overly optimistic clang-analyzer-deadcode.DeadStores

...which assumes that the switch is exhaustive over all possible
SvxSearchCellType values, which in fact it is not (see the mail thread starting
at <http://lists.llvm.org/pipermail/cfe-dev/2015-September/045021.html>
"[cfe-dev] Unsound assumptions about exhaustiveness of enum switch cases?").
Make it clear via "default: std::abort();" that the switch /is/ known to be
exhaustive over the possible values of pSearchItem->GetCellType().

Change-Id: Id06abc19c0092a334c363ee739a0eda1dc8cf760
üst e1208d37
...@@ -68,6 +68,8 @@ ...@@ -68,6 +68,8 @@
#include <tools/resary.hxx> #include <tools/resary.hxx>
#include <svx/svxdlg.hxx> #include <svx/svxdlg.hxx>
#include <vcl/toolbox.hxx> #include <vcl/toolbox.hxx>
#include <cstdlib>
#include <memory> #include <memory>
using namespace com::sun::star::i18n; using namespace com::sun::star::i18n;
...@@ -812,7 +814,7 @@ void SvxSearchDialog::Init_Impl( bool bSearchPattern ) ...@@ -812,7 +814,7 @@ void SvxSearchDialog::Init_Impl( bool bSearchPattern )
m_pColumnsBtn->SetClickHdl( aLink ); m_pColumnsBtn->SetClickHdl( aLink );
m_pAllSheetsCB->SetClickHdl( aLink ); m_pAllSheetsCB->SetClickHdl( aLink );
sal_uIntPtr nModifyFlagCheck(nModifyFlag); sal_uIntPtr nModifyFlagCheck;
switch ( pSearchItem->GetCellType() ) switch ( pSearchItem->GetCellType() )
{ {
case SvxSearchCellType::FORMULA: case SvxSearchCellType::FORMULA:
...@@ -826,6 +828,9 @@ void SvxSearchDialog::Init_Impl( bool bSearchPattern ) ...@@ -826,6 +828,9 @@ void SvxSearchDialog::Init_Impl( bool bSearchPattern )
case SvxSearchCellType::NOTE: case SvxSearchCellType::NOTE:
nModifyFlagCheck = MODIFY_CALC_NOTES; nModifyFlagCheck = MODIFY_CALC_NOTES;
break; break;
default:
std::abort(); // cannot happen
} }
if ( (nModifyFlag & nModifyFlagCheck) == 0 ) if ( (nModifyFlag & nModifyFlagCheck) == 0 )
m_pCalcSearchInLB->SelectEntryPos( static_cast<sal_Int32>(pSearchItem->GetCellType()) ); m_pCalcSearchInLB->SelectEntryPos( static_cast<sal_Int32>(pSearchItem->GetCellType()) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment