diff options
author | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-03-14 09:47:56 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-03-14 09:47:56 +0100 |
commit | c0e0f396a642e412343f7fe0e49f4dea6e9dec2a (patch) | |
tree | 584b0504cb56e7d76f91d267a06244cf3393699c /slideshow/source/engine/transitions/randomwipe.cxx | |
parent | debuglevels: pulled and merged latest changes from DEV300_next (diff) | |
parent | CWS-TOOLING: integrate CWS os150 (diff) | |
download | core-c0e0f396a642e412343f7fe0e49f4dea6e9dec2a.tar.gz core-c0e0f396a642e412343f7fe0e49f4dea6e9dec2a.zip |
debuglevels: pulled and merged DEV300.m102
Diffstat (limited to 'slideshow/source/engine/transitions/randomwipe.cxx')
-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]); } } |