sc/inc/conditio.hxx | 3 +-- sc/source/core/data/conditio.cxx | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 15 deletions(-)
New commits: commit 2e4805442a9eeedb32d6b570c4c11594aca7c642 Author: Tor Lillqvist <t...@collabora.com> Date: Thu Nov 23 17:32:40 2017 +0200 Avoid a trivial typedef Change-Id: Iea8700f168c5d13ebf1b98f435eeabea425b8259 Reviewed-on: https://gerrit.libreoffice.org/45275 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Tor Lillqvist <t...@collabora.com> diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx index 10906f0dbacb..9094add488ab 100644 --- a/sc/inc/conditio.hxx +++ b/sc/inc/conditio.hxx @@ -409,8 +409,7 @@ class SC_DLLPUBLIC ScConditionalFormat ScDocument* pDoc; sal_uInt32 nKey; // Index in attributes - typedef std::vector<std::unique_ptr<ScFormatEntry>> CondFormatContainer; - CondFormatContainer maEntries; + std::vector<std::unique_ptr<ScFormatEntry>> maEntries; ScRangeList maRanges; // Ranges for conditional format public: diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index 7e2d9a30b372..8170d1fcec6f 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -1778,7 +1778,7 @@ ScConditionalFormat* ScConditionalFormat::Clone(ScDocument* pNewDoc) const ScConditionalFormat* pNew = new ScConditionalFormat(nKey, pNewDoc); pNew->SetRange( maRanges ); // prerequisite for listeners - for (CondFormatContainer::const_iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) + for (auto itr = maEntries.cbegin(); itr != maEntries.cend(); ++itr) { ScFormatEntry* pNewEntry = (*itr)->Clone(pNewDoc); pNew->maEntries.push_back( std::unique_ptr<ScFormatEntry>(pNewEntry) ); @@ -1849,7 +1849,7 @@ const ScFormatEntry* ScConditionalFormat::GetEntry( sal_uInt16 nPos ) const const OUString& ScConditionalFormat::GetCellStyle( ScRefCellValue& rCell, const ScAddress& rPos ) const { - for (CondFormatContainer::const_iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) + for (auto itr = maEntries.cbegin(); itr != maEntries.cend(); ++itr) { if((*itr)->GetType() == condformat::CONDITION) { @@ -1871,7 +1871,7 @@ const OUString& ScConditionalFormat::GetCellStyle( ScRefCellValue& rCell, const ScCondFormatData ScConditionalFormat::GetData( ScRefCellValue& rCell, const ScAddress& rPos ) const { ScCondFormatData aData; - for(CondFormatContainer::const_iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) + for(auto itr = maEntries.cbegin(); itr != maEntries.cend(); ++itr) { if((*itr)->GetType() == condformat::CONDITION && aData.aStyleName.isEmpty()) { @@ -1912,21 +1912,21 @@ void ScConditionalFormat::DoRepaint() void ScConditionalFormat::CompileAll() { - for(CondFormatContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) + for(auto itr = maEntries.cbegin(); itr != maEntries.cend(); ++itr) if((*itr)->GetType() == condformat::CONDITION) static_cast<ScCondFormatEntry&>(**itr).CompileAll(); } void ScConditionalFormat::CompileXML() { - for(CondFormatContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) + for(auto itr = maEntries.cbegin(); itr != maEntries.cend(); ++itr) if((*itr)->GetType() == condformat::CONDITION) static_cast<ScCondFormatEntry&>(**itr).CompileXML(); } void ScConditionalFormat::UpdateReference( sc::RefUpdateContext& rCxt, bool bCopyAsMove ) { - for(CondFormatContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) + for(auto itr = maEntries.cbegin(); itr != maEntries.cend(); ++itr) (*itr)->UpdateReference(rCxt); if (rCxt.meMode == URM_COPY && bCopyAsMove) @@ -1961,7 +1961,7 @@ void ScConditionalFormat::UpdateInsertTab( sc::RefUpdateInsertTabContext& rCxt ) pRange->aEnd.IncTab(rCxt.mnSheets); } - for (CondFormatContainer::iterator it = maEntries.begin(); it != maEntries.end(); ++it) + for (auto it = maEntries.cbegin(); it != maEntries.cend(); ++it) (*it)->UpdateInsertTab(rCxt); } @@ -1990,7 +1990,7 @@ void ScConditionalFormat::UpdateDeleteTab( sc::RefUpdateDeleteTabContext& rCxt ) pRange->aEnd.IncTab(-1*rCxt.mnSheets); } - for (CondFormatContainer::iterator it = maEntries.begin(); it != maEntries.end(); ++it) + for (auto it = maEntries.cbegin(); it != maEntries.cend(); ++it) (*it)->UpdateDeleteTab(rCxt); } @@ -2027,7 +2027,7 @@ void ScConditionalFormat::UpdateMoveTab( sc::RefUpdateMoveTabContext& rCxt ) } } - for (CondFormatContainer::iterator it = maEntries.begin(); it != maEntries.end(); ++it) + for (auto it = maEntries.cbegin(); it != maEntries.cend(); ++it) (*it)->UpdateMoveTab(rCxt); } @@ -2042,7 +2042,7 @@ void ScConditionalFormat::DeleteArea( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCR void ScConditionalFormat::RenameCellStyle(const OUString& rOld, const OUString& rNew) { - for(CondFormatContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) + for(auto itr = maEntries.cbegin(); itr != maEntries.cend(); ++itr) if((*itr)->GetType() == condformat::CONDITION) { ScCondFormatEntry& rFormat = static_cast<ScCondFormatEntry&>(**itr); @@ -2054,7 +2054,7 @@ void ScConditionalFormat::RenameCellStyle(const OUString& rOld, const OUString& bool ScConditionalFormat::MarkUsedExternalReferences() const { bool bAllMarked = false; - for(CondFormatContainer::const_iterator itr = maEntries.begin(); itr != maEntries.end() && !bAllMarked; ++itr) + for(auto itr = maEntries.cbegin(); itr != maEntries.cend() && !bAllMarked; ++itr) if((*itr)->GetType() == condformat::CONDITION) { const ScCondFormatEntry& rFormat = static_cast<const ScCondFormatEntry&>(**itr); @@ -2066,7 +2066,7 @@ bool ScConditionalFormat::MarkUsedExternalReferences() const void ScConditionalFormat::startRendering() { - for(CondFormatContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) + for(auto itr = maEntries.cbegin(); itr != maEntries.cend(); ++itr) { (*itr)->startRendering(); } @@ -2074,7 +2074,7 @@ void ScConditionalFormat::startRendering() void ScConditionalFormat::endRendering() { - for(CondFormatContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) + for(auto itr = maEntries.cbegin(); itr != maEntries.cend(); ++itr) { (*itr)->endRendering(); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits