[Libreoffice-commits] core.git: sc/source
Tor Lillqvist
tml at collabora.com
Fri Nov 6 16:10:35 PST 2015
sc/source/core/data/dpsave.cxx | 10 +++++-----
sc/source/filter/xml/XMLExportDataPilot.cxx | 2 +-
sc/source/ui/unoobj/dapiuno.cxx | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
New commits:
commit c337c48f9f5018ecfe48fa1c6649cd0c80620fa5
Author: Tor Lillqvist <tml at collabora.com>
Date: Sat Nov 7 01:52:11 2015 +0200
WaE: redundant const_cast [loplugin:redundantcast]
Change-Id: I0a4007231747360cabc24adf73a0c131d30dd5cd
diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx
index e15dd88..4e01d4f 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 eff5e31..da683d4 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 f6422ca..b5e43b9 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
}
More information about the Libreoffice-commits
mailing list