diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-24 09:28:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-24 10:03:29 +0100 |
commit | 399ef5c1a1af6ded3cd650b3012d5990e5015365 (patch) | |
tree | b5506080a97ea0ea731bf49f6464b3e5fcd2e217 /sc/source | |
parent | cf693b02159982bbcbbd13b564a81227fbba78cf (diff) |
loplugin:constparams in sc
Change-Id: Ie211eea01eaceb718f701d3fdbb6253700d14e5e
Reviewed-on: https://gerrit.libreoffice.org/66831
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source')
22 files changed, 41 insertions, 41 deletions
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx index 720bd573b0d0..38b583fb02cf 100644 --- a/sc/source/core/data/dociter.cxx +++ b/sc/source/core/data/dociter.cxx @@ -77,7 +77,7 @@ void decBlock(std::pair<Iter, size_t>& rPos) static void ScAttrArray_IterGetNumberFormat( sal_uInt32& nFormat, const ScAttrArray*& rpArr, SCROW& nAttrEndRow, const ScAttrArray* pNewArr, SCROW nRow, - const ScDocument* pDoc, ScInterpreterContext* pContext = nullptr ) + const ScDocument* pDoc, const ScInterpreterContext* pContext = nullptr ) { if ( rpArr != pNewArr || nAttrEndRow < nRow ) { diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx index 2b57c2d71dbd..72204133dc6a 100644 --- a/sc/source/core/data/documen9.cxx +++ b/sc/source/core/data/documen9.cxx @@ -62,7 +62,7 @@ void ScDocument::BeginDrawUndo() mpDrawLayer->BeginCalcUndo(false); } -void ScDocument::TransferDrawPage(ScDocument* pSrcDoc, SCTAB nSrcPos, SCTAB nDestPos) +void ScDocument::TransferDrawPage(const ScDocument* pSrcDoc, SCTAB nSrcPos, SCTAB nDestPos) { if (mpDrawLayer && pSrcDoc->mpDrawLayer) { diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 8be9c6665e21..6b933019f4f8 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -1212,7 +1212,7 @@ namespace { struct SetDirtyIfPostponedHandler { - void operator() (ScTableUniquePtr & p) + void operator() (const ScTableUniquePtr & p) { if (p) p->SetDirtyIfPostponed(); @@ -1221,7 +1221,7 @@ struct SetDirtyIfPostponedHandler struct BroadcastRecalcOnRefMoveHandler { - void operator() (ScTableUniquePtr & p) + void operator() (const ScTableUniquePtr & p) { if (p) p->BroadcastRecalcOnRefMove(); diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx index b688c1db80e5..c495ff133db6 100644 --- a/sc/source/core/data/document10.cxx +++ b/sc/source/core/data/document10.cxx @@ -396,7 +396,7 @@ void ScDocument::DelayFormulaGrouping( bool delay ) } } -void ScDocument::AddDelayedFormulaGroupingCell( ScFormulaCell* cell ) +void ScDocument::AddDelayedFormulaGroupingCell( const ScFormulaCell* cell ) { if( !pDelayedFormulaGrouping->In( cell->aPos )) pDelayedFormulaGrouping->ExtendTo( cell->aPos ); @@ -501,7 +501,7 @@ public: mpCxt->setColumnSet( rpColSet); } - void operator() (ScTableUniquePtr & p) + void operator() (const ScTableUniquePtr & p) { if (p) p->StartListeners(*mpCxt, false); diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx index bb760bda8c57..4dd4cf713746 100644 --- a/sc/source/core/data/fillinfo.cxx +++ b/sc/source/core/data/fillinfo.cxx @@ -151,8 +151,8 @@ class RowInfoFiller } public: - RowInfoFiller(ScDocument& rDoc, SCTAB nTab, RowInfo* pRowInfo, SCCOL nArrX, SCSIZE& rArrY) : - mrDoc(rDoc), mnTab(nTab), mpRowInfo(pRowInfo), mnArrX(nArrX), mnArrY(rArrY), + RowInfoFiller(ScDocument& rDoc, SCTAB nTab, RowInfo* pRowInfo, SCCOL nArrX, SCSIZE nArrY) : + mrDoc(rDoc), mnTab(nTab), mpRowInfo(pRowInfo), mnArrX(nArrX), mnArrY(nArrY), mnHiddenEndRow(-1), mbHiddenRow(false) {} void operator() (size_t nRow, double fVal) diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index 48952234341d..3e0e2eb085a5 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -2488,7 +2488,7 @@ public: // Called from compareByString() method, where different sources of strings are checked. // The value is placed inside one parameter: [pValueSource1] or [pValueSource2] but never in both. std::pair<bool,bool> compareByStringComparator(const ScQueryEntry& rEntry, const ScQueryEntry::Item& rItem, - const svl::SharedString* pValueSource1, OUString * pValueSource2) + const svl::SharedString* pValueSource1, const OUString * pValueSource2) { bool bOk = false; bool bTestEqual = false; diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index 1846770996ef..60b4ef6e7d3b 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -1035,7 +1035,7 @@ class DynamicKernelSlidingArgument : public Base public: DynamicKernelSlidingArgument(const ScCalcConfig& config, const std::string& s, const FormulaTreeNodeRef& ft, - std::shared_ptr<SlidingFunctionBase>& CodeGen, int index) + const std::shared_ptr<SlidingFunctionBase>& CodeGen, int index) : Base(config, s, ft, index) , mpCodeGen(CodeGen) { @@ -1217,7 +1217,7 @@ class DynamicKernelMixedSlidingArgument : public VectorRef { public: DynamicKernelMixedSlidingArgument( const ScCalcConfig& config, const std::string& s, - const FormulaTreeNodeRef& ft, std::shared_ptr<SlidingFunctionBase>& CodeGen, + const FormulaTreeNodeRef& ft, const std::shared_ptr<SlidingFunctionBase>& CodeGen, int index ) : VectorRef(config, s, ft), mDoubleArgument(mCalcConfig, s, ft, CodeGen, index), @@ -1321,7 +1321,7 @@ class ParallelReductionVectorRef : public Base public: ParallelReductionVectorRef(const ScCalcConfig& config, const std::string& s, const FormulaTreeNodeRef& ft, - std::shared_ptr<SlidingFunctionBase>& CodeGen, int index) + const std::shared_ptr<SlidingFunctionBase>& CodeGen, int index) : Base(config, s, ft, index) , mpCodeGen(CodeGen) , mpClmem2(nullptr) diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index f7cb87d8f21f..d2d73f37c56f 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -3133,12 +3133,12 @@ bool ScMatrix::IsNumeric() const return pImpl->IsNumeric(); } -void ScMatrix::MatCopy(ScMatrix& mRes) const +void ScMatrix::MatCopy(const ScMatrix& mRes) const { pImpl->MatCopy(*mRes.pImpl); } -void ScMatrix::MatTrans(ScMatrix& mRes) const +void ScMatrix::MatTrans(const ScMatrix& mRes) const { pImpl->MatTrans(*mRes.pImpl); } @@ -3377,28 +3377,28 @@ public: } -void ScMatrix::NotOp( ScMatrix& rMat) +void ScMatrix::NotOp( const ScMatrix& rMat) { auto not_ = [](double a, double){return double(a == 0.0);}; matop::MatOp<decltype(not_), double> aOp(not_, pImpl->GetErrorInterpreter()); pImpl->ApplyOperation(aOp, *rMat.pImpl); } -void ScMatrix::NegOp( ScMatrix& rMat) +void ScMatrix::NegOp( const ScMatrix& rMat) { auto neg_ = [](double a, double){return -a;}; matop::MatOp<decltype(neg_), double> aOp(neg_, pImpl->GetErrorInterpreter()); pImpl->ApplyOperation(aOp, *rMat.pImpl); } -void ScMatrix::AddOp( double fVal, ScMatrix& rMat) +void ScMatrix::AddOp( double fVal, const ScMatrix& rMat) { auto add_ = [](double a, double b){return a + b;}; matop::MatOp<decltype(add_)> aOp(add_, pImpl->GetErrorInterpreter(), fVal); pImpl->ApplyOperation(aOp, *rMat.pImpl); } -void ScMatrix::SubOp( bool bFlag, double fVal, ScMatrix& rMat) +void ScMatrix::SubOp( bool bFlag, double fVal, const ScMatrix& rMat) { if (bFlag) { @@ -3414,14 +3414,14 @@ void ScMatrix::SubOp( bool bFlag, double fVal, ScMatrix& rMat) } } -void ScMatrix::MulOp( double fVal, ScMatrix& rMat) +void ScMatrix::MulOp( double fVal, const ScMatrix& rMat) { auto mul_ = [](double a, double b){return a * b;}; matop::MatOp<decltype(mul_)> aOp(mul_, pImpl->GetErrorInterpreter(), fVal); pImpl->ApplyOperation(aOp, *rMat.pImpl); } -void ScMatrix::DivOp( bool bFlag, double fVal, ScMatrix& rMat) +void ScMatrix::DivOp( bool bFlag, double fVal, const ScMatrix& rMat) { if (bFlag) { @@ -3437,7 +3437,7 @@ void ScMatrix::DivOp( bool bFlag, double fVal, ScMatrix& rMat) } } -void ScMatrix::PowOp( bool bFlag, double fVal, ScMatrix& rMat) +void ScMatrix::PowOp( bool bFlag, double fVal, const ScMatrix& rMat) { if (bFlag) { diff --git a/sc/source/ui/StatisticsDialogs/RegressionDialog.cxx b/sc/source/ui/StatisticsDialogs/RegressionDialog.cxx index 5cc45f1cee4a..f61f6f11a531 100644 --- a/sc/source/ui/StatisticsDialogs/RegressionDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/RegressionDialog.cxx @@ -679,10 +679,10 @@ void ScRegressionDialog::WritePredictionsWithResiduals(AddressWalkerWriter& rOut } // Generic table writer -void ScRegressionDialog::WriteTable(std::function<CellValueGetter>& rCellGetter, +void ScRegressionDialog::WriteTable(const std::function<CellValueGetter>& rCellGetter, size_t nRowsInTable, size_t nColsInTable, AddressWalkerWriter& rOutput, - std::function<CellWriter>& rFunc) + const std::function<CellWriter>& rFunc) { for (size_t nRowIdx = 0; nRowIdx < nRowsInTable; ++nRowIdx) { diff --git a/sc/source/ui/dataprovider/datatransformation.cxx b/sc/source/ui/dataprovider/datatransformation.cxx index e3b526a588a9..1c67d8d9ee45 100644 --- a/sc/source/ui/dataprovider/datatransformation.cxx +++ b/sc/source/ui/dataprovider/datatransformation.cxx @@ -19,7 +19,7 @@ namespace { -Date getDate(double nDateTime, SvNumberFormatter* pFormatter) +Date getDate(double nDateTime, const SvNumberFormatter* pFormatter) { Date aDate = pFormatter->GetNullDate(); aDate.AddDays(static_cast<sal_Int32>(::rtl::math::approxFloor(nDateTime))); diff --git a/sc/source/ui/inc/ChildWindowWrapper.hxx b/sc/source/ui/inc/ChildWindowWrapper.hxx index 89bf560499d2..08301fb3a22d 100644 --- a/sc/source/ui/inc/ChildWindowWrapper.hxx +++ b/sc/source/ui/inc/ChildWindowWrapper.hxx @@ -23,7 +23,7 @@ class ChildWindowWrapper : public SfxChildWindow { public: ChildWindowWrapper( vcl::Window* pParentP, sal_uInt16 nId, - SfxBindings* pBindings, SfxChildWinInfo* pInfo ) : + SfxBindings* pBindings, const SfxChildWinInfo* pInfo ) : SfxChildWindow(pParentP, nId) { ScTabViewShell* pViewShell = getTabViewShell( pBindings ); @@ -71,7 +71,7 @@ public: } private: - static ScTabViewShell* getTabViewShell( SfxBindings *pBindings ) + static ScTabViewShell* getTabViewShell( const SfxBindings *pBindings ) { if( !pBindings ) return nullptr; diff --git a/sc/source/ui/inc/RegressionDialog.hxx b/sc/source/ui/inc/RegressionDialog.hxx index 7503e07c382d..f02fcb472f21 100644 --- a/sc/source/ui/inc/RegressionDialog.hxx +++ b/sc/source/ui/inc/RegressionDialog.hxx @@ -71,9 +71,9 @@ private: FormulaTemplate& rTemplate, size_t nRegressionIndex); // Generic table writer - static void WriteTable(std::function<CellValueGetter>& rCellGetter, size_t nRowsInTable, + static void WriteTable(const std::function<CellValueGetter>& rCellGetter, size_t nRowsInTable, size_t nColsInTable, AddressWalkerWriter& rOutput, - std::function<CellWriter>& rFunc); + const std::function<CellWriter>& rFunc); DECL_LINK( CheckBoxHdl, CheckBox&, void ); DECL_LINK( NumericFieldHdl, Edit&, void ); diff --git a/sc/source/ui/inc/dataproviderdlg.hxx b/sc/source/ui/inc/dataproviderdlg.hxx index ed590a7634bc..7a3a98bfed55 100644 --- a/sc/source/ui/inc/dataproviderdlg.hxx +++ b/sc/source/ui/inc/dataproviderdlg.hxx @@ -46,7 +46,7 @@ private: public: - ScDataProviderDlg(vcl::Window* pWindow, std::shared_ptr<ScDocument> pDoc, ScDocument* pDocument); + ScDataProviderDlg(vcl::Window* pWindow, std::shared_ptr<ScDocument> pDoc, const ScDocument* pDocument); virtual ~ScDataProviderDlg() override; virtual void dispose() override; diff --git a/sc/source/ui/inc/sharedocdlg.hxx b/sc/source/ui/inc/sharedocdlg.hxx index ae1d28c9aafc..1eaf9bb5dc1f 100644 --- a/sc/source/ui/inc/sharedocdlg.hxx +++ b/sc/source/ui/inc/sharedocdlg.hxx @@ -46,7 +46,7 @@ private: DECL_LINK(SizeAllocated, const Size&, void); public: - SC_DLLPUBLIC ScShareDocumentDlg(weld::Window* pParent, ScViewData* pViewData); + SC_DLLPUBLIC ScShareDocumentDlg(weld::Window* pParent, const ScViewData* pViewData); virtual ~ScShareDocumentDlg() override; bool IsShareDocumentChecked() const; diff --git a/sc/source/ui/inc/tptable.hxx b/sc/source/ui/inc/tptable.hxx index 61e5317fc8b0..52b2a36628a0 100644 --- a/sc/source/ui/inc/tptable.hxx +++ b/sc/source/ui/inc/tptable.hxx @@ -76,7 +76,7 @@ private: // Handler: DECL_LINK(PageDirHdl, weld::ToggleButton&, void); DECL_LINK(PageNoHdl, weld::ToggleButton&, void); - void PageNoHdl(weld::ToggleButton* pBtn); + void PageNoHdl(const weld::ToggleButton* pBtn); DECL_LINK(ScaleHdl, weld::ComboBox&, void); DECL_LINK(ToggleHdl, weld::ToggleButton&, void); }; diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx index 85857d5065d7..3d2627e3b15a 100644 --- a/sc/source/ui/inc/viewfunc.hxx +++ b/sc/source/ui/inc/viewfunc.hxx @@ -104,7 +104,7 @@ public: bool bApi = false, bool bIncludeObjects = false, bool bStopEdit = true ); bool CopyToClipSingleRange( ScDocument* pClipDoc, const ScRangeList& rRanges, bool bCut, bool bIncludeObjects ); - bool CopyToClipMultiRange( ScDocument* pClipDoc, const ScRangeList& rRanges, bool bCut, + bool CopyToClipMultiRange( const ScDocument* pClipDoc, const ScRangeList& rRanges, bool bCut, bool bApi, bool bIncludeObjects ); ScTransferObj* CopyToTransferable(); SC_DLLPUBLIC bool PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, diff --git a/sc/source/ui/miscdlgs/dataproviderdlg.cxx b/sc/source/ui/miscdlgs/dataproviderdlg.cxx index f273eebafd40..d55babb13174 100644 --- a/sc/source/ui/miscdlgs/dataproviderdlg.cxx +++ b/sc/source/ui/miscdlgs/dataproviderdlg.cxx @@ -951,7 +951,7 @@ std::shared_ptr<sc::DataTransformation> ScDateTimeTransformation::getTransformat } ScDataProviderDlg::ScDataProviderDlg(vcl::Window* pParent, std::shared_ptr<ScDocument> pDoc, - ScDocument* pDocument) + const ScDocument* pDocument) : ModalDialog(pParent, "dataproviderdlg", "modules/scalc/ui/dataproviderdlg.ui", true) , mpDoc(std::move(pDoc)) , mpBar(VclPtr<MenuBar>::Create()) diff --git a/sc/source/ui/miscdlgs/sharedocdlg.cxx b/sc/source/ui/miscdlgs/sharedocdlg.cxx index c6b22b2f757d..261cd5505550 100644 --- a/sc/source/ui/miscdlgs/sharedocdlg.cxx +++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx @@ -46,7 +46,7 @@ IMPL_LINK(ScShareDocumentDlg, SizeAllocated, const Size&, rSize, void) // class ScShareDocumentDlg -ScShareDocumentDlg::ScShareDocumentDlg(weld::Window* pParent, ScViewData* pViewData) +ScShareDocumentDlg::ScShareDocumentDlg(weld::Window* pParent, const ScViewData* pViewData) : GenericDialogController(pParent, "modules/scalc/ui/sharedocumentdlg.ui", "ShareDocumentDialog") , m_aStrNoUserData(ScResId(STR_NO_USER_DATA_AVAILABLE)) diff --git a/sc/source/ui/pagedlg/tptable.cxx b/sc/source/ui/pagedlg/tptable.cxx index 109a56453728..3030ee27ea5b 100644 --- a/sc/source/ui/pagedlg/tptable.cxx +++ b/sc/source/ui/pagedlg/tptable.cxx @@ -374,7 +374,7 @@ IMPL_LINK(ScTablePage, PageNoHdl, weld::ToggleButton&, rBtn, void) PageNoHdl(&rBtn); } -void ScTablePage::PageNoHdl(weld::ToggleButton* pBtn) +void ScTablePage::PageNoHdl(const weld::ToggleButton* pBtn) { if (m_xBtnPageNo->get_active()) { diff --git a/sc/source/ui/vba/vbapagebreak.cxx b/sc/source/ui/vba/vbapagebreak.cxx index ba8f7549d8bd..ec3c14ce8ee6 100644 --- a/sc/source/ui/vba/vbapagebreak.cxx +++ b/sc/source/ui/vba/vbapagebreak.cxx @@ -29,7 +29,7 @@ using namespace ::ooo::vba; template< typename... Ifc > ScVbaPageBreak< Ifc... >::ScVbaPageBreak( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, - uno::Reference< beans::XPropertySet >& xProps, + const uno::Reference< beans::XPropertySet >& xProps, sheet::TablePageBreakData aTablePageBreakData): ScVbaPageBreak_BASE( xParent, xContext ), mxRowColPropertySet( xProps ), @@ -113,7 +113,7 @@ template class ScVbaPageBreak< excel::XVPageBreak >; /* class ScVbaVPageBreak */ ScVbaVPageBreak::ScVbaVPageBreak( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, - css::uno::Reference< css::beans::XPropertySet >& xProps, + const css::uno::Reference< css::beans::XPropertySet >& xProps, css::sheet::TablePageBreakData aTablePageBreakData ) : ScVbaVPageBreak_BASE( xParent, xContext, xProps, aTablePageBreakData ) { diff --git a/sc/source/ui/vba/vbapagebreak.hxx b/sc/source/ui/vba/vbapagebreak.hxx index a5958e66e420..1f7b296bc1c1 100644 --- a/sc/source/ui/vba/vbapagebreak.hxx +++ b/sc/source/ui/vba/vbapagebreak.hxx @@ -39,7 +39,7 @@ public: /// @throws css::uno::RuntimeException ScVbaPageBreak( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, - css::uno::Reference< css::beans::XPropertySet >& xProps, + const css::uno::Reference< css::beans::XPropertySet >& xProps, css::sheet::TablePageBreakData aTablePageBreakData); virtual sal_Int32 SAL_CALL getType( ) override; @@ -57,7 +57,7 @@ public: /// @throws css::uno::RuntimeException ScVbaHPageBreak( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, - css::uno::Reference< css::beans::XPropertySet >& xProps, + const css::uno::Reference< css::beans::XPropertySet >& xProps, css::sheet::TablePageBreakData aTablePageBreakData): ScVbaHPageBreak_BASE( xParent,xContext,xProps,aTablePageBreakData ){} @@ -75,7 +75,7 @@ public: /// @throws css::uno::RuntimeException ScVbaVPageBreak( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, - css::uno::Reference< css::beans::XPropertySet >& xProps, + const css::uno::Reference< css::beans::XPropertySet >& xProps, css::sheet::TablePageBreakData aTablePageBreakData); virtual ~ScVbaVPageBreak() override; diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index 719b3d555991..c50c9086339e 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -289,7 +289,7 @@ bool ScViewFunc::CopyToClipSingleRange( ScDocument* pClipDoc, const ScRangeList& return true; } -bool ScViewFunc::CopyToClipMultiRange( ScDocument* pInputClipDoc, const ScRangeList& rRanges, bool bCut, bool bApi, bool bIncludeObjects ) +bool ScViewFunc::CopyToClipMultiRange( const ScDocument* pInputClipDoc, const ScRangeList& rRanges, bool bCut, bool bApi, bool bIncludeObjects ) { if (bCut) { |