summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-01-24 09:08:34 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-02-11 13:25:31 +0100
commit0d1253c2328106a443d16b6c8e96347de33e2ace (patch)
treee26e7ca9f9b91f50573f446b8a93515f4c4302eb /sc
parent2dd7aba7564a222c2acbac22975a76a6ab33c41f (diff)
new loplugin writeonlyvars
largely based on the relevant portion of the unusedfields loplugin, but adapted for local vars Change-Id: Ic522a941573940e8f75c88f90ba5f37508ca49b1 Reviewed-on: https://gerrit.libreoffice.org/66835 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/documen2.cxx3
-rw-r--r--sc/source/core/data/table3.cxx4
-rw-r--r--sc/source/ui/unoobj/PivotTableDataProvider.cxx15
-rw-r--r--sc/source/ui/vba/vbaworkbook.cxx2
-rw-r--r--sc/source/ui/view/gridwin5.cxx3
5 files changed, 1 insertions, 26 deletions
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index a97dbc389a90..d2395cdbb0fb 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -1241,7 +1241,6 @@ void ScDocument::GetCellChangeTrackNote( const ScAddress &aCellPos, OUString &aT
const ScChangeAction* pFound = nullptr;
const ScChangeAction* pFoundContent = nullptr;
const ScChangeAction* pFoundMove = nullptr;
- long nModified = 0;
const ScChangeAction* pAction = pTrack->GetFirst();
while (pAction)
{
@@ -1271,7 +1270,6 @@ void ScDocument::GetCellChangeTrackNote( const ScAddress &aCellPos, OUString &aT
default:
break;
}
- ++nModified;
}
}
if ( eType == SC_CAT_MOVE )
@@ -1282,7 +1280,6 @@ void ScDocument::GetCellChangeTrackNote( const ScAddress &aCellPos, OUString &aT
if ( aRange.In( aCellPos ) )
{
pFound = pAction;
- ++nModified;
}
}
}
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 0b5e07497a27..eb2d1d9c4857 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -3133,9 +3133,7 @@ SCSIZE ScTable::Query(const ScQueryParam& rParamOrg, bool bKeepSub)
aStr = aBuf.makeStringAndClear();
}
- std::pair<StrSetType::iterator, bool> r = aStrSet.insert(aStr);
- bool bIsUnique = r.second; // unique if inserted.
- bResult = bIsUnique;
+ bResult = aStrSet.insert(aStr).second; // unique if inserted.
}
}
else
diff --git a/sc/source/ui/unoobj/PivotTableDataProvider.cxx b/sc/source/ui/unoobj/PivotTableDataProvider.cxx
index b8e8eb73ce7d..c72ab042b4cf 100644
--- a/sc/source/ui/unoobj/PivotTableDataProvider.cxx
+++ b/sc/source/ui/unoobj/PivotTableDataProvider.cxx
@@ -197,13 +197,8 @@ uno::Reference<chart2::data::XDataSource> SAL_CALL
if (!m_pDocument)
throw uno::RuntimeException();
- bool bLabel = true;
- bool bCategories = false;
bool bOrientCol = true;
OUString aRangeRepresentation;
- OUString sPivotTable;
- uno::Sequence<sal_Int32> aSequenceMapping;
- bool bTimeBased = false;
for (beans::PropertyValue const & rProperty : aArguments)
{
@@ -218,18 +213,8 @@ uno::Reference<chart2::data::XDataSource> SAL_CALL
}
bOrientCol = (eSource == chart::ChartDataRowSource_COLUMNS);
}
- else if (rProperty.Name == "FirstCellAsLabel")
- rProperty.Value >>= bLabel;
- else if (rProperty.Name == "HasCategories")
- rProperty.Value >>= bCategories;
else if (rProperty.Name == "CellRangeRepresentation")
rProperty.Value >>= aRangeRepresentation;
- else if (rProperty.Name == "SequenceMapping")
- rProperty.Value >>= aSequenceMapping;
- else if (rProperty.Name == "TimeBased")
- rProperty.Value >>= bTimeBased;
- else if (rProperty.Name == "ConnectedPivotTable")
- rProperty.Value >>= sPivotTable;
}
uno::Reference<chart2::data::XDataSource> xResult;
diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx
index 6793bf70bc66..57dfaddeccda 100644
--- a/sc/source/ui/vba/vbaworkbook.cxx
+++ b/sc/source/ui/vba/vbaworkbook.cxx
@@ -368,8 +368,6 @@ ScVbaWorkbook::SaveAs( const uno::Any& FileName, const uno::Any& FileFormat, con
setFilterPropsFromFormat( nFileFormat, storeProps );
uno::Reference< frame::XStorable > xStor( getModel(), uno::UNO_QUERY_THROW );
- OUString sFilterName;
- storeProps[0].Value >>= sFilterName;
xStor->storeAsURL( sURL, storeProps );
}
diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx
index 40f3bd722019..cf19422208d6 100644
--- a/sc/source/ui/view/gridwin5.cxx
+++ b/sc/source/ui/view/gridwin5.cxx
@@ -75,7 +75,6 @@ bool ScGridWindow::ShowNoteMarker( SCCOL nPosX, SCROW nPosY, bool bKeyboard )
const ScChangeAction* pFound = nullptr;
const ScChangeAction* pFoundContent = nullptr;
const ScChangeAction* pFoundMove = nullptr;
- long nModified = 0;
const ScChangeAction* pAction = pTrack->GetFirst();
while (pAction)
{
@@ -109,7 +108,6 @@ bool ScGridWindow::ShowNoteMarker( SCCOL nPosX, SCROW nPosY, bool bKeyboard )
// added to avoid warnings
}
}
- ++nModified;
}
}
if ( eType == SC_CAT_MOVE )
@@ -120,7 +118,6 @@ bool ScGridWindow::ShowNoteMarker( SCCOL nPosX, SCROW nPosY, bool bKeyboard )
if ( aRange.In( aCellPos ) )
{
pFound = pAction;
- ++nModified;
}
}
}