Author: hdu Date: Mon May 27 11:25:44 2013 New Revision: 1486581 URL: http://svn.apache.org/r1486581 Log: #i122208# const SW containers cannot provide non-const iterators
Modified: openoffice/trunk/main/sw/inc/SwNumberTree.hxx openoffice/trunk/main/sw/source/core/SwNumberTree/SwNodeNum.cxx openoffice/trunk/main/sw/source/core/SwNumberTree/SwNumberTree.cxx openoffice/trunk/main/sw/source/core/layout/paintfrm.cxx openoffice/trunk/main/sw/source/core/unocore/unochart.cxx Modified: openoffice/trunk/main/sw/inc/SwNumberTree.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/inc/SwNumberTree.hxx?rev=1486581&r1=1486580&r2=1486581&view=diff ============================================================================== --- openoffice/trunk/main/sw/inc/SwNumberTree.hxx (original) +++ openoffice/trunk/main/sw/inc/SwNumberTree.hxx Mon May 27 11:25:44 2013 @@ -478,7 +478,7 @@ protected: than or equal to the referenced child are valid. All children greater than the referenced child are invalid. */ - mutable tSwNumberTreeChildren::iterator mItLastValid; + mutable tSwNumberTreeChildren::const_iterator mItLastValid; #ifdef DBG_UTIL /** @@ -547,7 +547,7 @@ protected: - false only set if aItLastValid is preceeding the current last valid node */ - void SetLastValid(tSwNumberTreeChildren::iterator aItLastValid, + void SetLastValid(tSwNumberTreeChildren::const_iterator aItLastValid, bool bValidating = false) const; /** @@ -711,7 +711,7 @@ protected: */ void ClearObsoletePhantoms(); - tSwNumberTreeChildren::iterator GetIterator(const SwNumberTreeNode * pChild) const; + tSwNumberTreeChildren::const_iterator GetIterator(const SwNumberTreeNode * pChild) const; /** Moves all children to a given destination node. Modified: openoffice/trunk/main/sw/source/core/SwNumberTree/SwNodeNum.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/core/SwNumberTree/SwNodeNum.cxx?rev=1486581&r1=1486580&r2=1486581&view=diff ============================================================================== --- openoffice/trunk/main/sw/source/core/SwNumberTree/SwNodeNum.cxx (original) +++ openoffice/trunk/main/sw/source/core/SwNumberTree/SwNodeNum.cxx Mon May 27 11:25:44 2013 @@ -223,7 +223,7 @@ bool SwNodeNum::HasCountedChildren() con { bool bResult = false; - tSwNumberTreeChildren::iterator aIt; + tSwNumberTreeChildren::const_iterator aIt; for (aIt = mChildren.begin(); aIt != mChildren.end(); aIt++) { Modified: openoffice/trunk/main/sw/source/core/SwNumberTree/SwNumberTree.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/core/SwNumberTree/SwNumberTree.cxx?rev=1486581&r1=1486580&r2=1486581&view=diff ============================================================================== --- openoffice/trunk/main/sw/source/core/SwNumberTree/SwNumberTree.cxx (original) +++ openoffice/trunk/main/sw/source/core/SwNumberTree/SwNumberTree.cxx Mon May 27 11:25:44 2013 @@ -148,14 +148,14 @@ void SwNumberTreeNode::ClearObsoletePhan void SwNumberTreeNode::ValidateHierarchical(const SwNumberTreeNode * pNode) const { - tSwNumberTreeChildren::iterator aValidateIt = + tSwNumberTreeChildren::const_iterator aValidateIt = GetIterator(pNode); if (aValidateIt != mChildren.end()) { ASSERT((*aValidateIt)->mpParent == this, "wrong parent"); - tSwNumberTreeChildren::iterator aIt = mItLastValid; + tSwNumberTreeChildren::const_iterator aIt = mItLastValid; // --> OD 2005-10-19 #126009# // improvement: @@ -214,7 +214,7 @@ void SwNumberTreeNode::ValidateHierarchi if ( !(*aIt)->IsRestart() && GetParent() && !bParentCounted ) { - tSwNumberTreeChildren::iterator aParentChildIt = + tSwNumberTreeChildren::const_iterator aParentChildIt = GetParent()->GetIterator( this ); while ( aParentChildIt != GetParent()->mChildren.begin() ) { @@ -280,7 +280,7 @@ void SwNumberTreeNode::ValidateHierarchi void SwNumberTreeNode::ValidateContinuous(const SwNumberTreeNode * pNode) const { - tSwNumberTreeChildren::iterator aIt = mItLastValid; + tSwNumberTreeChildren::const_iterator aIt = mItLastValid; SwNumberTree::tSwNumTreeNumber nTmpNumber = 0; @@ -684,7 +684,7 @@ void SwNumberTreeNode::RemoveChild(SwNum return; } - tSwNumberTreeChildren::iterator aRemoveIt = GetIterator(pChild); + tSwNumberTreeChildren::const_iterator aRemoveIt = GetIterator(pChild); if (aRemoveIt != mChildren.end()) { @@ -692,7 +692,7 @@ void SwNumberTreeNode::RemoveChild(SwNum pRemove->mpParent = NULL; - tSwNumberTreeChildren::iterator aItPred = mChildren.end(); + tSwNumberTreeChildren::const_iterator aItPred = mChildren.end(); if (aRemoveIt == mChildren.begin()) { @@ -876,7 +876,7 @@ bool SwNumberTreeNode::HasPhantomCounted bool SwNumberTreeNode::IsFirst(const SwNumberTreeNode * pNode) const { - tSwNumberTreeChildren::iterator aIt = mChildren.begin(); + tSwNumberTreeChildren::const_iterator aIt = mChildren.begin(); if ((*aIt)->IsPhantom()) aIt++; @@ -1050,10 +1050,10 @@ bool SwNumberTreeNode::IsSane(bool bRecu } #endif // __SW_NUMBER_TREE_SANITY_CHECK -SwNumberTreeNode::tSwNumberTreeChildren::iterator +SwNumberTreeNode::tSwNumberTreeChildren::const_iterator SwNumberTreeNode::GetIterator(const SwNumberTreeNode * pChild) const { - tSwNumberTreeChildren::iterator aItResult = + tSwNumberTreeChildren::const_iterator aItResult = mChildren.find(const_cast<SwNumberTreeNode *>(pChild)); ASSERT( aItResult != mChildren.end(), @@ -1116,7 +1116,7 @@ bool SwNumberTreeNodeLessThan(const SwNu SwNumberTreeNode * SwNumberTreeNode::GetLastDescendant() const { SwNumberTreeNode * pResult = NULL; - tSwNumberTreeChildren::reverse_iterator aIt = mChildren.rbegin(); + tSwNumberTreeChildren::const_reverse_iterator aIt = mChildren.rbegin(); if (aIt != mChildren.rend()) { @@ -1140,7 +1140,7 @@ SwNumberTreeNode * SwNumberTreeNode::Get if (mpParent) { - tSwNumberTreeChildren::iterator aIt = + tSwNumberTreeChildren::const_iterator aIt = mpParent->GetIterator(this); if ( aIt == mpParent->mChildren.begin() ) @@ -1168,7 +1168,7 @@ SwNumberTreeNode * SwNumberTreeNode::Get } void SwNumberTreeNode::SetLastValid - ( SwNumberTreeNode::tSwNumberTreeChildren::iterator aItValid, + ( SwNumberTreeNode::tSwNumberTreeChildren::const_iterator aItValid, bool bValidating ) const { ASSERT( (aItValid == mChildren.end() || GetIterator(*aItValid) != mChildren.end()), @@ -1186,7 +1186,7 @@ void SwNumberTreeNode::SetLastValid // counted is needed if ( GetParent() ) { - tSwNumberTreeChildren::iterator aParentChildIt = + tSwNumberTreeChildren::const_iterator aParentChildIt = GetParent()->GetIterator( this ); ++aParentChildIt; if ( aParentChildIt != GetParent()->mChildren.end() ) @@ -1204,7 +1204,7 @@ void SwNumberTreeNode::SetLastValid { if (IsContinuous()) { - tSwNumberTreeChildren::iterator aIt = mItLastValid; + tSwNumberTreeChildren::const_iterator aIt = mItLastValid; if (aIt != mChildren.end()) aIt++; @@ -1227,7 +1227,7 @@ void SwNumberTreeNode::SetLastValid(bool { if (mpParent) { - tSwNumberTreeChildren::iterator aIt = mpParent->GetIterator(this); + tSwNumberTreeChildren::const_iterator aIt = mpParent->GetIterator(this); mpParent->SetLastValid(aIt, bValidating); } @@ -1238,7 +1238,7 @@ void SwNumberTreeNode::InvalidateTree() // do not call SetInvalid, would cause loop !!! mItLastValid = mChildren.end(); - tSwNumberTreeChildren::iterator aIt; + tSwNumberTreeChildren::const_iterator aIt; for (aIt = mChildren.begin(); aIt != mChildren.end(); aIt++) (*aIt)->InvalidateTree(); @@ -1248,7 +1248,7 @@ void SwNumberTreeNode::Invalidate(SwNumb { if (pChild->IsValid()) { - tSwNumberTreeChildren::iterator aIt = GetIterator(pChild); + tSwNumberTreeChildren::const_iterator aIt = GetIterator(pChild); if (aIt != mChildren.begin()) aIt--; @@ -1290,7 +1290,7 @@ void SwNumberTreeNode::NotifyInvalidChil { if (IsNotifiable()) { - tSwNumberTreeChildren::iterator aIt = mItLastValid; + tSwNumberTreeChildren::const_iterator aIt = mItLastValid; if (aIt == mChildren.end()) aIt = mChildren.begin(); @@ -1307,7 +1307,7 @@ void SwNumberTreeNode::NotifyInvalidChil // is also needed. if ( GetParent() ) { - tSwNumberTreeChildren::iterator aParentChildIt = + tSwNumberTreeChildren::const_iterator aParentChildIt = GetParent()->GetIterator( this ); ++aParentChildIt; if ( aParentChildIt != GetParent()->mChildren.end() ) Modified: openoffice/trunk/main/sw/source/core/layout/paintfrm.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/core/layout/paintfrm.cxx?rev=1486581&r1=1486580&r2=1486581&view=diff ============================================================================== --- openoffice/trunk/main/sw/source/core/layout/paintfrm.cxx (original) +++ openoffice/trunk/main/sw/source/core/layout/paintfrm.cxx Mon May 27 11:25:44 2013 @@ -2274,7 +2274,7 @@ void SwTabFrmPainter::PaintLines( Output break; const SwLineEntrySet& rEntrySet = (*aIter).second; - SwLineEntrySetIter aSetIter = rEntrySet.begin(); + SwLineEntrySetConstIter aSetIter = rEntrySet.begin(); while ( aSetIter != rEntrySet.end() ) { const SwLineEntry& rEntry = *aSetIter; Modified: openoffice/trunk/main/sw/source/core/unocore/unochart.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/core/unocore/unochart.cxx?rev=1486581&r1=1486580&r2=1486581&view=diff ============================================================================== --- openoffice/trunk/main/sw/source/core/unocore/unochart.cxx (original) +++ openoffice/trunk/main/sw/source/core/unocore/unochart.cxx Mon May 27 11:25:44 2013 @@ -1619,7 +1619,7 @@ void SwChartDataProvider::InvalidateTabl pTable->GetFrmFmt()->GetDoc()->GetChartControllerHelper().StartOrContinueLocking(); const Set_DataSequenceRef_t &rSet = aDataSequences[ pTable ]; - Set_DataSequenceRef_t::iterator aIt( rSet.begin() ); + Set_DataSequenceRef_t::const_iterator aIt( rSet.begin() ); while (aIt != rSet.end()) { // uno::Reference< util::XModifiable > xRef( uno::Reference< chart2::data::XDataSequence >(*aIt), uno::UNO_QUERY ); @@ -1712,8 +1712,8 @@ void SwChartDataProvider::DisposeAllData //! would become invalid. const Set_DataSequenceRef_t aSet( aDataSequences[ pTable ] ); - Set_DataSequenceRef_t::iterator aIt( aSet.begin() ); - Set_DataSequenceRef_t::iterator aEndIt( aSet.end() ); + Set_DataSequenceRef_t::const_iterator aIt( aSet.begin() ); + Set_DataSequenceRef_t::const_iterator aEndIt( aSet.end() ); while (aIt != aEndIt) { // uno::Reference< lang::XComponent > xRef( uno::Reference< chart2::data::XDataSequence >(*aIt), uno::UNO_QUERY ); @@ -1792,7 +1792,7 @@ void SwChartDataProvider::AddRowCols( // iterate over all data-sequences for the table const Set_DataSequenceRef_t &rSet = aDataSequences[ &rTable ]; - Set_DataSequenceRef_t::iterator aIt( rSet.begin() ); + Set_DataSequenceRef_t::const_iterator aIt( rSet.begin() ); while (aIt != rSet.end()) { // uno::Reference< chart2::data::XTextualDataSequence > xRef( uno::Reference< chart2::data::XDataSequence >(*aIt), uno::UNO_QUERY );