summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-11-16 10:41:03 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-11-21 12:44:55 +0100
commit2dbd02b576f28224204ac962f6ce20fde6687093 (patch)
tree28b3f8807d5909e7bcc3c5a629dadd6f475ad9d3 /sc
parent48314f25241e014a634dd5371543b90137ffd2bc (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/optdlg/tpformula.cxx5
-rw-r--r--sc/source/ui/styleui/styledlg.cxx2
-rw-r--r--sc/source/ui/view/printfun.cxx2
-rw-r--r--sc/source/ui/view/tabvwsh3.cxx6
4 files changed, 7 insertions, 8 deletions
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<const ScTpCalcItem&>(rCoreAttrs.Get(
- GetWhich(SID_SCDOCOPTIONS))).GetDocOptions());
+ maSavedDocOptions = static_cast<const ScTpCalcItem&>(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<const SvxNumberInfoItem&>(*pInfoItem) ) );
+ aSet.Put ( static_cast<const SvxNumberInfoItem&>(*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<const SfxBoolItem *>(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();