[Libreoffice-commits] core.git: sc/source

Herbert Dürr hdu at apache.org
Tue May 28 12:08:43 PDT 2013


 sc/source/core/data/bcaslot.cxx     |    6 +++---
 sc/source/core/inc/bcaslot.hxx      |    2 +-
 sc/source/filter/excel/xeescher.cxx |    3 ++-
 3 files changed, 6 insertions(+), 5 deletions(-)

New commits:
commit 4074c441bf3d959cfeb30f6d0eb5c73f7bf89b1f
Author: Herbert Dürr <hdu at apache.org>
Date:   Mon May 27 11:27:43 2013 +0000

    Related: #i122208# const SC containers cannot provide non-const iterators
    
    (cherry picked from commit c6f4bbfa54bd0fbef6bbc048cbd930c2781b2137)
    
    Conflicts:
    	sc/source/core/data/bcaslot.cxx
    
    Change-Id: I774235d445192833031f99211639f23116e37bb4

diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx
index 0f5b657..e55c183 100644
--- a/sc/source/core/data/bcaslot.cxx
+++ b/sc/source/core/data/bcaslot.cxx
@@ -219,7 +219,7 @@ void ScBroadcastAreaSlot::EndListeningArea( const ScRange& rRange,
     OSL_ENSURE(pListener, "EndListeningArea: pListener Null");
     if ( !rpArea )
     {
-        ScBroadcastAreas::iterator aIter( FindBroadcastArea( rRange));
+        ScBroadcastAreas::const_iterator aIter( FindBroadcastArea( rRange));
         if (aIter == aBroadcastAreaTbl.end() || isMarkedErased( aIter))
             return;
         rpArea = (*aIter).mpArea;
@@ -235,7 +235,7 @@ void ScBroadcastAreaSlot::EndListeningArea( const ScRange& rRange,
     {
         if ( !rpArea->GetBroadcaster().HasListeners() )
         {
-            ScBroadcastAreas::iterator aIter( FindBroadcastArea( rRange));
+            ScBroadcastAreas::const_iterator aIter( FindBroadcastArea( rRange));
             if (aIter == aBroadcastAreaTbl.end() || isMarkedErased( aIter))
                 return;
             OSL_ENSURE( (*aIter).mpArea == rpArea, "EndListeningArea: area pointer mismatch");
@@ -247,7 +247,7 @@ void ScBroadcastAreaSlot::EndListeningArea( const ScRange& rRange,
 }
 
 
-ScBroadcastAreas::iterator ScBroadcastAreaSlot::FindBroadcastArea(
+ScBroadcastAreas::const_iterator ScBroadcastAreaSlot::FindBroadcastArea(
         const ScRange& rRange ) const
 {
     aTmpSeekBroadcastArea.UpdateRange( rRange);
diff --git a/sc/source/core/inc/bcaslot.hxx b/sc/source/core/inc/bcaslot.hxx
index 4fbbb85..53e13d6 100644
--- a/sc/source/core/inc/bcaslot.hxx
+++ b/sc/source/core/inc/bcaslot.hxx
@@ -132,7 +132,7 @@ private:
     ScBroadcastAreaSlotMachine* pBASM;
     bool                mbInBroadcastIteration;
 
-    ScBroadcastAreas::iterator  FindBroadcastArea( const ScRange& rRange ) const;
+    ScBroadcastAreas::const_iterator  FindBroadcastArea( const ScRange& rRange ) const;
 
     /**
         More hypothetical (memory would probably be doomed anyway) check
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index 6acbf4d..5c23ba3 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -1512,12 +1512,13 @@ void XclExpComments::SaveXml( XclExpXmlStream& rStrm )
     rComments->endElement( XML_authors );
     rComments->startElement( XML_commentList, FSEND );
 
+    Authors::const_iterator aAuthorsBegin = aAuthors.begin();
     for( size_t i = 0; i < nNotes; ++i )
     {
         XclExpNoteList::RecordRefType xNote = mrNotes.GetRecord( i );
         Authors::iterator aAuthor = aAuthors.find(
                 XclXmlUtils::ToOUString( xNote->GetAuthor() ) );
-        sal_Int32 nAuthorId = distance( aAuthors.begin(), aAuthor );
+        sal_Int32 nAuthorId = distance( aAuthorsBegin, aAuthor );
         xNote->WriteXml( nAuthorId, rStrm );
     }
 


More information about the Libreoffice-commits mailing list