diff options
author | Tor Lillqvist <tml@collabora.com> | 2015-11-07 01:52:11 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2015-11-07 01:55:42 +0200 |
commit | c337c48f9f5018ecfe48fa1c6649cd0c80620fa5 (patch) | |
tree | eb8e3becfa9f53fe9193b170b180ff3d122a2e8e /sc | |
parent | ef04c666591612bb222672de29a15be4515da040 (diff) |
WaE: redundant const_cast [loplugin:redundantcast]
Change-Id: I0a4007231747360cabc24adf73a0c131d30dd5cd
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/dpsave.cxx | 10 | ||||
-rw-r--r-- | sc/source/filter/xml/XMLExportDataPilot.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/dapiuno.cxx | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx index e15dd8874146..4e01d4f5b4ba 100644 --- a/sc/source/core/data/dpsave.cxx +++ b/sc/source/core/data/dpsave.cxx @@ -957,7 +957,7 @@ ScDPSaveDimension* ScDPSaveData::GetDimensionByName(const OUString& rName) for (auto const& iter : m_DimList) { if (iter->GetName() == rName && !iter->IsDataLayout() ) - return const_cast<ScDPSaveDimension*>(&(*iter)); + return &(*iter); } return AppendNewDimension(rName, false); @@ -968,7 +968,7 @@ ScDPSaveDimension* ScDPSaveData::GetExistingDimensionByName(const OUString& rNam for (auto const& iter : m_DimList) { if (iter->GetName() == rName && !iter->IsDataLayout() ) - return const_cast<ScDPSaveDimension*>(&(*iter)); + return &(*iter); } return nullptr; // don't create new } @@ -998,7 +998,7 @@ ScDPSaveDimension* ScDPSaveData::GetExistingDataLayoutDimension() const for (auto const& iter : m_DimList) { if ( iter->IsDataLayout() ) - return const_cast<ScDPSaveDimension*>(&(*iter)); + return &(*iter); } return nullptr; } @@ -1045,7 +1045,7 @@ ScDPSaveDimension* ScDPSaveData::GetInnermostDimension(sal_uInt16 nOrientation) for (auto const& iter : m_DimList) { if (iter->GetOrientation() == nOrientation && !iter->IsDataLayout()) - return const_cast<ScDPSaveDimension*>(&(*iter)); + return &(*iter); } return nullptr; @@ -1056,7 +1056,7 @@ ScDPSaveDimension* ScDPSaveData::GetFirstDimension(sheet::DataPilotFieldOrientat for (auto const& iter : m_DimList) { if (iter->GetOrientation() == eOrientation && !iter->IsDataLayout()) - return const_cast<ScDPSaveDimension*>(&(*iter)); + return &(*iter); } return nullptr; } diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx b/sc/source/filter/xml/XMLExportDataPilot.cxx index eff5e31c328c..da683d42cc65 100644 --- a/sc/source/filter/xml/XMLExportDataPilot.cxx +++ b/sc/source/filter/xml/XMLExportDataPilot.cxx @@ -723,7 +723,7 @@ void ScXMLExportDataPilot::WriteDimensions(ScDPSaveData* pDPSave) const ScDPSaveData::DimsType& rDimensions = pDPSave->GetDimensions(); for (auto const& iter : rDimensions) { - WriteDimension(const_cast<ScDPSaveDimension*>(iter.get()), + WriteDimension(iter.get(), pDPSave->GetExistingDimensionData()); } } diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index f6422ca750d7..b5e43b94e4cc 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -1495,7 +1495,7 @@ ScDPSaveDimension* ScDataPilotChildObjBase::GetDPDimension( ScDPObject** ppDPObj if (aSrcName == maFieldId.maFieldName) { if( nFoundIdx == maFieldId.mnFieldIdx ) - return const_cast<ScDPSaveDimension*>(it.get()); + return it.get(); ++nFoundIdx; } } @@ -2071,7 +2071,7 @@ void ScDataPilotFieldObj::setOrientation(DataPilotFieldOrientation eNew) if ( !it->IsDataLayout() && (it->GetName() == maFieldId.maFieldName) ) { if ( it->GetOrientation() == DataPilotFieldOrientation_HIDDEN ) - pNewDim = const_cast<ScDPSaveDimension*>(it.get()); // use this one + pNewDim = it.get(); // use this one else ++nFound; // count existing non-hidden occurrences } |