From 2dbd02b576f28224204ac962f6ce20fde6687093 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 16 Nov 2018 10:41:03 +0200 Subject: loplugin:redundantfcast improvements check for calls to constructors, and extend the list of types we check for unnecessary temporary creation Change-Id: Ia2c1f202b41ed6866779fff5343c821128033eec Reviewed-on: https://gerrit.libreoffice.org/63472 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sc/source/ui/optdlg/tpformula.cxx | 5 ++--- sc/source/ui/styleui/styledlg.cxx | 2 +- sc/source/ui/view/printfun.cxx | 2 +- sc/source/ui/view/tabvwsh3.cxx | 6 +++--- 4 files changed, 7 insertions(+), 8 deletions(-) (limited to 'sc') diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx index 09797b051071..9ceb2ee71565 100644 --- a/sc/source/ui/optdlg/tpformula.cxx +++ b/sc/source/ui/optdlg/tpformula.cxx @@ -73,9 +73,8 @@ ScTpFormulaOptions::ScTpFormulaOptions(vcl::Window* pParent, const SfxItemSet& r OUString aSep = ScGlobal::GetpLocaleData()->getNumDecimalSep(); mnDecSep = aSep.isEmpty() ? u'.' : aSep[0]; - maSavedDocOptions = ScDocOptions( - static_cast(rCoreAttrs.Get( - GetWhich(SID_SCDOCOPTIONS))).GetDocOptions()); + maSavedDocOptions = static_cast(rCoreAttrs.Get( + GetWhich(SID_SCDOCOPTIONS))).GetDocOptions(); } ScTpFormulaOptions::~ScTpFormulaOptions() diff --git a/sc/source/ui/styleui/styledlg.cxx b/sc/source/ui/styleui/styledlg.cxx index f0b261841650..0389a408c6a9 100644 --- a/sc/source/ui/styleui/styledlg.cxx +++ b/sc/source/ui/styleui/styledlg.cxx @@ -113,7 +113,7 @@ void ScStyleDlg::PageCreated(const OString& rPageId, SfxTabPage& rTabPage) OSL_ENSURE( pInfoItem, "NumberInfoItem not found!" ); - aSet.Put (SvxNumberInfoItem( static_cast(*pInfoItem) ) ); + aSet.Put ( static_cast(*pInfoItem) ); rTabPage.PageCreated(aSet); } else if (rPageId == "font") diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 42cb2fb3f90a..2ba69ecc79dc 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -3038,7 +3038,7 @@ bool PrintPageRanges::checkIfAlreadyCalculatedAndSet( m_aInput.m_nStartCol = nStartCol; m_aInput.m_nEndCol = nEndCol; m_aInput.m_nPrintTab = nPrintTab; - m_aInput.m_aDocSize = Size(rDocSize); + m_aInput.m_aDocSize = rDocSize; return false; } diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx index 7c72694a31f4..11c5b1eedbc4 100644 --- a/sc/source/ui/view/tabvwsh3.cxx +++ b/sc/source/ui/view/tabvwsh3.cxx @@ -666,9 +666,9 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) if( pReqArgs && pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET ) bFormulaMode = static_cast(pItem)->GetValue(); - ScViewOptions rSetOpts = ScViewOptions( rOpts ); - rSetOpts.SetOption( VOPT_FORMULAS, bFormulaMode ); - rViewData.SetOptions( rSetOpts ); + ScViewOptions aSetOpts = rOpts; + aSetOpts.SetOption( VOPT_FORMULAS, bFormulaMode ); + rViewData.SetOptions( aSetOpts ); rViewData.GetDocShell()->PostPaintGridAll(); -- cgit