From 65ae6af9f460b1a28f3e07480347ff7f90adae38 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 18 Aug 2020 09:43:04 +0200 Subject: loplugin:unusedvarsglobal tackle some read-only vars. Mark some of them const to make it obvious they are not really used, and to make the constantparam plugin see more data. Change-Id: Ia25927745866746aa1aa9d5affd5857ad9f9ee24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100895 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sc/source/core/data/stlpool.cxx | 2 +- sc/source/filter/oox/querytablebuffer.cxx | 7 +++---- sc/source/filter/xml/xmlexprt.cxx | 4 ++-- sc/source/ui/app/inputhdl.cxx | 5 ++--- sc/source/ui/pagedlg/areasdlg.cxx | 7 +++---- 5 files changed, 11 insertions(+), 14 deletions(-) (limited to 'sc') diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx index 8395315883f8..f2f337e56bad 100644 --- a/sc/source/core/data/stlpool.cxx +++ b/sc/source/core/data/stlpool.cxx @@ -212,7 +212,7 @@ void ScStyleSheetPool::CreateStandardStyles() Color aColBlack ( COL_BLACK ); OUString aStr; sal_Int32 nStrLen; - OUString aHelpFile;//which text??? + const OUString aHelpFile;//which text??? SfxItemSet* pSet = nullptr; SfxItemSet* pHFSet = nullptr; SvxSetItem* pHFSetItem = nullptr; diff --git a/sc/source/filter/oox/querytablebuffer.cxx b/sc/source/filter/oox/querytablebuffer.cxx index 8d5ec052d139..883e0cd90041 100644 --- a/sc/source/filter/oox/querytablebuffer.cxx +++ b/sc/source/filter/oox/querytablebuffer.cxx @@ -246,14 +246,13 @@ void QueryTable::finalizeImport() PropertySet aDocProps( getDocument() ); Reference< XAreaLinks > xAreaLinks( aDocProps.getAnyProperty( PROP_AreaLinks ), UNO_QUERY_THROW ); CellAddress aDestPos( aDestRange.aStart.Tab(), aDestRange.aStart.Col(), aDestRange.aStart.Row() ); - OUString aFilterName = "calc_HTML_WebQuery"; - OUString aFilterOptions; - xAreaLinks->insertAtPosition( aDestPos, aFileUrl, aTables, aFilterName, aFilterOptions ); + const OUString aFilterName = "calc_HTML_WebQuery"; + xAreaLinks->insertAtPosition( aDestPos, aFileUrl, aTables, aFilterName, /*aFilterOptions*/"" ); // set refresh interval (convert minutes to seconds) sal_Int32 nRefreshPeriod = xConnection->getModel().mnInterval * 60; if( nRefreshPeriod > 0 ) { - PropertySet aPropSet( lclFindAreaLink( xAreaLinks, aDestRange.aStart, aFileUrl, aTables, aFilterName, aFilterOptions ) ); + PropertySet aPropSet( lclFindAreaLink( xAreaLinks, aDestRange.aStart, aFileUrl, aTables, aFilterName, /*aFilterOptions*/"" ) ); aPropSet.setProperty( PROP_RefreshPeriod, nRefreshPeriod ); } } diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 1c35e014a6c8..d2f7250f8a95 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -2142,7 +2142,7 @@ void ScXMLExport::AddStyleFromColumn(const uno::Reference& aItr->maValue >>= rIsVisible; } - OUString sParent; + const OUString sParent; if (pOldName) { if (GetAutoStylePool()->AddNamed(*pOldName, XmlStyleFamily::TABLE_COLUMN, sParent, aPropStates)) @@ -2171,7 +2171,7 @@ void ScXMLExport::AddStyleFromRow(const uno::Reference& xRo if(aPropStates.empty()) return; - OUString sParent; + const OUString sParent; if (pOldName) { if (GetAutoStylePool()->AddNamed(*pOldName, XmlStyleFamily::TABLE_ROW, sParent, aPropStates)) diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 1eda36788038..5ffe1d83d205 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -3887,15 +3887,14 @@ void ScInputHandler::InputCommand( const CommandEvent& rCEvt ) if (eMode==SC_INPUT_NONE) if (pTableView || pTopView) { - OUString aStrLoP; if (pTableView) { - pTableView->GetEditEngine()->SetText( aStrLoP ); + pTableView->GetEditEngine()->SetText( "" ); pTableView->SetSelection( ESelection(0,0, 0,0) ); } if (pTopView) { - pTopView->GetEditEngine()->SetText( aStrLoP ); + pTopView->GetEditEngine()->SetText( "" ); pTopView->SetSelection( ESelection(0,0, 0,0) ); } } diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx index c9221ac68b78..9726b70c4316 100644 --- a/sc/source/ui/pagedlg/areasdlg.cxx +++ b/sc/source/ui/pagedlg/areasdlg.cxx @@ -450,10 +450,9 @@ IMPL_LINK(ScPrintAreasDlg, Impl_BtnHdl, weld::Button&, rBtn, void) { if ( Impl_CheckRefStrings() ) { - OUString aStr; - SfxStringItem aPrintArea( SID_CHANGE_PRINTAREA, aStr ); - SfxStringItem aRepeatRow( FN_PARAM_2, aStr ); - SfxStringItem aRepeatCol( FN_PARAM_3, aStr ); + SfxStringItem aPrintArea( SID_CHANGE_PRINTAREA, "" ); + SfxStringItem aRepeatRow( FN_PARAM_2, "" ); + SfxStringItem aRepeatCol( FN_PARAM_3, "" ); // Printing area changed? -- cgit