Fix fdo#43820 - properly initialize iterators before math.
This commit is contained in:
@@ -725,9 +725,13 @@ namespace slideshow
|
|||||||
class FindNthElementFunctor
|
class FindNthElementFunctor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FindNthElementFunctor( sal_Int32 nNodeIndex,
|
FindNthElementFunctor( sal_Int32 nNodeIndex,
|
||||||
DrawShapeSubsetting::IndexClassificator eClass ) :
|
DrawShapeSubsetting::IndexClassificatorVector::const_iterator& rLastBegin,
|
||||||
|
DrawShapeSubsetting::IndexClassificatorVector::const_iterator& rLastEnd,
|
||||||
|
DrawShapeSubsetting::IndexClassificator eClass ) :
|
||||||
mnNodeIndex( nNodeIndex ),
|
mnNodeIndex( nNodeIndex ),
|
||||||
|
mrLastBegin( rLastBegin ),
|
||||||
|
mrLastEnd( rLastEnd ),
|
||||||
meClass( eClass )
|
meClass( eClass )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -740,8 +744,8 @@ namespace slideshow
|
|||||||
if( eCurrElemClassification == meClass &&
|
if( eCurrElemClassification == meClass &&
|
||||||
nCurrElemCount == mnNodeIndex )
|
nCurrElemCount == mnNodeIndex )
|
||||||
{
|
{
|
||||||
maLastBegin = rCurrElemBegin;
|
mrLastBegin = rCurrElemBegin;
|
||||||
maLastEnd = rCurrElemEnd;
|
mrLastEnd = rCurrElemEnd;
|
||||||
|
|
||||||
return false; // abort iteration, we've
|
return false; // abort iteration, we've
|
||||||
// already found what we've been
|
// already found what we've been
|
||||||
@@ -751,20 +755,10 @@ namespace slideshow
|
|||||||
return true; // keep on truckin'
|
return true; // keep on truckin'
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawShapeSubsetting::IndexClassificatorVector::const_iterator getBeginElement() const
|
|
||||||
{
|
|
||||||
return maLastBegin;
|
|
||||||
}
|
|
||||||
|
|
||||||
DrawShapeSubsetting::IndexClassificatorVector::const_iterator getEndElement() const
|
|
||||||
{
|
|
||||||
return maLastEnd;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
sal_Int32 mnNodeIndex;
|
sal_Int32 mnNodeIndex;
|
||||||
DrawShapeSubsetting::IndexClassificatorVector::const_iterator maLastBegin;
|
DrawShapeSubsetting::IndexClassificatorVector::const_iterator& mrLastBegin;
|
||||||
DrawShapeSubsetting::IndexClassificatorVector::const_iterator maLastEnd;
|
DrawShapeSubsetting::IndexClassificatorVector::const_iterator& mrLastEnd;
|
||||||
DrawShapeSubsetting::IndexClassificator meClass;
|
DrawShapeSubsetting::IndexClassificator meClass;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -789,17 +783,21 @@ namespace slideshow
|
|||||||
const IndexClassificator eRequestedClass(
|
const IndexClassificator eRequestedClass(
|
||||||
mapDocTreeNode( eNodeType ) );
|
mapDocTreeNode( eNodeType ) );
|
||||||
|
|
||||||
|
DrawShapeSubsetting::IndexClassificatorVector::const_iterator aLastBegin(rEnd);
|
||||||
|
DrawShapeSubsetting::IndexClassificatorVector::const_iterator aLastEnd(rEnd);
|
||||||
|
|
||||||
// create a nth element functor for the requested class of
|
// create a nth element functor for the requested class of
|
||||||
// actions, and nNodeIndex as the target index
|
// actions, and nNodeIndex as the target index
|
||||||
FindNthElementFunctor aFunctor( nNodeIndex,
|
FindNthElementFunctor aFunctor( nNodeIndex,
|
||||||
|
aLastBegin,
|
||||||
|
aLastEnd,
|
||||||
eRequestedClass );
|
eRequestedClass );
|
||||||
|
|
||||||
// find given index in the given range
|
// find given index in the given range
|
||||||
iterateActionClassifications( aFunctor, rBegin, rEnd );
|
iterateActionClassifications( aFunctor, rBegin, rEnd );
|
||||||
|
|
||||||
return makeTreeNode( maActionClassVector.begin(),
|
return makeTreeNode( maActionClassVector.begin(),
|
||||||
aFunctor.getBeginElement(),
|
aLastBegin, aLastEnd,
|
||||||
aFunctor.getEndElement(),
|
|
||||||
eNodeType );
|
eNodeType );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user