diff options
author | Andre Fischer <andre.f.fischer <Andre Fischer<andre.f.fischer@oracle.com> | 2010-10-14 14:03:13 +0200 |
---|---|---|
committer | Andre Fischer <andre.f.fischer <Andre Fischer<andre.f.fischer@oracle.com> | 2010-10-14 14:03:13 +0200 |
commit | d2f35280c987837671322c977138fcc2402287c0 (patch) | |
tree | e80ae5e02de50f752d22e73c628cebd7a75519f9 /slideshow | |
parent | impress195: #i113720# Break cyclic dependency between DrawController and Modu... (diff) | |
download | core-d2f35280c987837671322c977138fcc2402287c0.tar.gz core-d2f35280c987837671322c977138fcc2402287c0.zip |
impress195: #i80637# Changed the algorithm for mixing of elements.
Diffstat (limited to 'slideshow')
-rw-r--r-- | slideshow/source/engine/transitions/randomwipe.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/slideshow/source/engine/transitions/randomwipe.cxx b/slideshow/source/engine/transitions/randomwipe.cxx index 22c51e38852e..d8ac4a3da687 100644 --- a/slideshow/source/engine/transitions/randomwipe.cxx +++ b/slideshow/source/engine/transitions/randomwipe.cxx @@ -68,13 +68,11 @@ RandomWipe::RandomWipe( sal_Int32 nElements, bool randomBars ) m_rect.transform( aTransform ); // mix up: - for ( sal_Int32 i = (nElements / 2); i--; ) + for (sal_Int32 nIndex=0; nIndex<nElements; ++nIndex) { - const sal_Int32 pos1 = getRandomOrdinal(nElements); - const sal_Int32 pos2 = getRandomOrdinal(nElements); - const ::basegfx::B2DPoint point( m_positions[ pos1 ] ); - m_positions[ pos1 ] = m_positions[ pos2 ]; - m_positions[ pos2 ] = point; + const sal_Int32 nOtherIndex (getRandomOrdinal(nElements)); + OSL_ASSERT(nOtherIndex>=0 && nOtherIndex<nElements); + ::std::swap(m_positions[nIndex], m_positions[nOtherIndex]); } } |