diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-08-02 11:30:14 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-08-16 09:10:14 +0200 |
commit | f455a60824c9af4ec9e7e6b8692677a83392a02c (patch) | |
tree | 79e7d2f382cbfa474baf247664f01c6d3d9368c2 | |
parent | aa1918efe9afac79b5a715a7a31239d320a75edc (diff) |
Throbber: remove redundant field and fix conversion warnings
Change-Id: I1e4712c4c6eae890b93936f25632aa8a7422e1db
-rw-r--r-- | include/vcl/throbber.hxx | 1 | ||||
-rw-r--r-- | vcl/source/control/throbber.cxx | 10 |
2 files changed, 5 insertions, 6 deletions
diff --git a/include/vcl/throbber.hxx b/include/vcl/throbber.hxx index 2c986adc23f3..910bd54679bd 100644 --- a/include/vcl/throbber.hxx +++ b/include/vcl/throbber.hxx @@ -82,7 +82,6 @@ private: bool mbRepeat; sal_Int32 mnStepTime; sal_Int32 mnCurStep; - sal_Int32 mnStepCount; AutoTimer maWaitTimer; ImageSet meImageSet; diff --git a/vcl/source/control/throbber.cxx b/vcl/source/control/throbber.cxx index f71aee55361f..c38690f01389 100644 --- a/vcl/source/control/throbber.cxx +++ b/vcl/source/control/throbber.cxx @@ -47,7 +47,6 @@ Throbber::Throbber( vcl::Window* i_parentWindow, WinBits i_style, const ImageSet ,mbRepeat( true ) ,mnStepTime( 100 ) ,mnCurStep( 0 ) - ,mnStepCount( 0 ) ,meImageSet( i_imageSet ) { maWaitTimer.SetTimeout( mnStepTime ); @@ -185,10 +184,11 @@ bool Throbber::isRunning() const void Throbber::setImageList( ::std::vector< Image > const& i_images ) { + SAL_WARN_IF( i_images.size()>=SAL_MAX_INT32, "vcl.control", "Throbber::setImageList: too many images!" ); + maImageList = i_images; - mnStepCount = maImageList.size(); - const Image aInitialImage( mnStepCount ? maImageList[ 0 ] : Image() ); + const Image aInitialImage( maImageList.size() ? maImageList[ 0 ] : Image() ); SetImage( aInitialImage ); } @@ -245,8 +245,8 @@ IMPL_LINK_NOARG_TYPED(Throbber, TimeOutHdl, Timer *, void) if ( maImageList.empty() ) return; - if ( mnCurStep < mnStepCount - 1 ) - mnCurStep += 1; + if ( mnCurStep < static_cast<sal_Int32>(maImageList.size()-1) ) + ++mnCurStep; else { if ( mbRepeat ) |