diff options
author | Thorsten Behrens <tbehrens@suse.com> | 2012-01-11 00:05:50 +0100 |
---|---|---|
committer | Thorsten Behrens <tbehrens@suse.com> | 2012-01-11 00:08:01 +0100 |
commit | 122cb4ff9cdeea5c3c9b7a0a60f26cadb13a71fa (patch) | |
tree | 80d12c7cea929b3dd79baa32f2d7bacc14e8fd1b /slideshow/source | |
parent | c48bac19685d3a66a9abeba8477e1b763a6b13bf (diff) |
Fix fdo#43820 - properly initialize iterators before math.
Diffstat (limited to 'slideshow/source')
-rw-r--r-- | slideshow/source/engine/shapes/drawshapesubsetting.cxx | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/slideshow/source/engine/shapes/drawshapesubsetting.cxx b/slideshow/source/engine/shapes/drawshapesubsetting.cxx index 80c142cb9d4c..eea1202c45fd 100644 --- a/slideshow/source/engine/shapes/drawshapesubsetting.cxx +++ b/slideshow/source/engine/shapes/drawshapesubsetting.cxx @@ -725,9 +725,13 @@ namespace slideshow class FindNthElementFunctor { public: - FindNthElementFunctor( sal_Int32 nNodeIndex, - DrawShapeSubsetting::IndexClassificator eClass ) : + FindNthElementFunctor( sal_Int32 nNodeIndex, + DrawShapeSubsetting::IndexClassificatorVector::const_iterator& rLastBegin, + DrawShapeSubsetting::IndexClassificatorVector::const_iterator& rLastEnd, + DrawShapeSubsetting::IndexClassificator eClass ) : mnNodeIndex( nNodeIndex ), + mrLastBegin( rLastBegin ), + mrLastEnd( rLastEnd ), meClass( eClass ) { } @@ -740,8 +744,8 @@ namespace slideshow if( eCurrElemClassification == meClass && nCurrElemCount == mnNodeIndex ) { - maLastBegin = rCurrElemBegin; - maLastEnd = rCurrElemEnd; + mrLastBegin = rCurrElemBegin; + mrLastEnd = rCurrElemEnd; return false; // abort iteration, we've // already found what we've been @@ -751,20 +755,10 @@ namespace slideshow return true; // keep on truckin' } - DrawShapeSubsetting::IndexClassificatorVector::const_iterator getBeginElement() const - { - return maLastBegin; - } - - DrawShapeSubsetting::IndexClassificatorVector::const_iterator getEndElement() const - { - return maLastEnd; - } - private: sal_Int32 mnNodeIndex; - DrawShapeSubsetting::IndexClassificatorVector::const_iterator maLastBegin; - DrawShapeSubsetting::IndexClassificatorVector::const_iterator maLastEnd; + DrawShapeSubsetting::IndexClassificatorVector::const_iterator& mrLastBegin; + DrawShapeSubsetting::IndexClassificatorVector::const_iterator& mrLastEnd; DrawShapeSubsetting::IndexClassificator meClass; }; @@ -789,17 +783,21 @@ namespace slideshow const IndexClassificator eRequestedClass( mapDocTreeNode( eNodeType ) ); + DrawShapeSubsetting::IndexClassificatorVector::const_iterator aLastBegin(rEnd); + DrawShapeSubsetting::IndexClassificatorVector::const_iterator aLastEnd(rEnd); + // create a nth element functor for the requested class of // actions, and nNodeIndex as the target index FindNthElementFunctor aFunctor( nNodeIndex, + aLastBegin, + aLastEnd, eRequestedClass ); // find given index in the given range iterateActionClassifications( aFunctor, rBegin, rEnd ); return makeTreeNode( maActionClassVector.begin(), - aFunctor.getBeginElement(), - aFunctor.getEndElement(), + aLastBegin, aLastEnd, eNodeType ); } |