diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-02-11 15:56:21 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-02-12 10:31:25 +0100 |
commit | f147b160aef1735d34c488353a7d4b875788a7e1 (patch) | |
tree | ab3bd613cf016cde906b3fdcbaab4246ca699e1e /sc/source/ui/view | |
parent | tdf#130440: Add UItest (diff) | |
download | core-f147b160aef1735d34c488353a7d4b875788a7e1.tar.gz core-f147b160aef1735d34c488353a7d4b875788a7e1.zip |
clang-analyzer-deadcode.DeadStores
Change-Id: Ifa384933569b27d0d08eb479bb95b799163ae386
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88450
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/view')
-rw-r--r-- | sc/source/ui/view/formatsh.cxx | 24 | ||||
-rw-r--r-- | sc/source/ui/view/output2.cxx | 6 |
2 files changed, 14 insertions, 16 deletions
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 3ed5a2a48208..a83db735127c 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -1169,19 +1169,17 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq ) //Just use eType to judge whether the command is fired for NUMBER/PERCENT/CURRENCY/SCIENTIFIC/FRACTION //In sidebar, users can fire SID_NUMBER_FORMAT command by operating the related UI controls before they are disable - if(eType == SvNumFormatType::ALL - || eType == SvNumFormatType::NUMBER - || eType == (SvNumFormatType::NUMBER | SvNumFormatType::DEFINED) - || eType == SvNumFormatType::PERCENT - || eType == (SvNumFormatType::PERCENT | SvNumFormatType::DEFINED) - || eType == SvNumFormatType::CURRENCY - || eType == (SvNumFormatType::CURRENCY | SvNumFormatType::DEFINED) - || eType == SvNumFormatType::SCIENTIFIC - || eType == (SvNumFormatType::SCIENTIFIC | SvNumFormatType::DEFINED) - || eType == SvNumFormatType::FRACTION - || eType == (SvNumFormatType::FRACTION | SvNumFormatType::DEFINED)) - eType = SvNumFormatType::ALL; - else + if(!(eType == SvNumFormatType::ALL + || eType == SvNumFormatType::NUMBER + || eType == (SvNumFormatType::NUMBER | SvNumFormatType::DEFINED) + || eType == SvNumFormatType::PERCENT + || eType == (SvNumFormatType::PERCENT | SvNumFormatType::DEFINED) + || eType == SvNumFormatType::CURRENCY + || eType == (SvNumFormatType::CURRENCY | SvNumFormatType::DEFINED) + || eType == SvNumFormatType::SCIENTIFIC + || eType == (SvNumFormatType::SCIENTIFIC | SvNumFormatType::DEFINED) + || eType == SvNumFormatType::FRACTION + || eType == (SvNumFormatType::FRACTION | SvNumFormatType::DEFINED))) pEntry = nullptr; if(SfxItemState::SET == pReqArgs->GetItemState(nSlot, true, &pItem) && pEntry) diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 7f38fe353561..c50c3c06df94 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -2958,8 +2958,8 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam) for ( long nRepeat = 1; nRepeat < nRepeatCount; nRepeat++ ) aRepeated.append(aCellStr); - nEngineWidth = SetEngineTextAndGetWidth( rParam, aRepeated.makeStringAndClear(), - nNeededPixel, (nLeftM + nRightM ) ); + SetEngineTextAndGetWidth( rParam, aRepeated.makeStringAndClear(), + nNeededPixel, (nLeftM + nRightM ) ); nEngineHeight = rParam.mpEngine->GetTextHeight(); } @@ -2970,7 +2970,7 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam) if ( rParam.mbCellIsValue && ( aAreaParam.mbLeftClip || aAreaParam.mbRightClip ) ) { - nEngineWidth = SetEngineTextAndGetWidth( rParam, "###", nNeededPixel, ( nLeftM + nRightM ) ); + SetEngineTextAndGetWidth( rParam, "###", nNeededPixel, ( nLeftM + nRightM ) ); // No clip marks if "###" doesn't fit (same as in DrawStrings) } |