Kaydet (Commit) f455a608 authored tarafından Matteo Casalin's avatar Matteo Casalin

Throbber: remove redundant field and fix conversion warnings

Change-Id: I1e4712c4c6eae890b93936f25632aa8a7422e1db
üst aa1918ef
...@@ -82,7 +82,6 @@ private: ...@@ -82,7 +82,6 @@ private:
bool mbRepeat; bool mbRepeat;
sal_Int32 mnStepTime; sal_Int32 mnStepTime;
sal_Int32 mnCurStep; sal_Int32 mnCurStep;
sal_Int32 mnStepCount;
AutoTimer maWaitTimer; AutoTimer maWaitTimer;
ImageSet meImageSet; ImageSet meImageSet;
......
...@@ -47,7 +47,6 @@ Throbber::Throbber( vcl::Window* i_parentWindow, WinBits i_style, const ImageSet ...@@ -47,7 +47,6 @@ Throbber::Throbber( vcl::Window* i_parentWindow, WinBits i_style, const ImageSet
,mbRepeat( true ) ,mbRepeat( true )
,mnStepTime( 100 ) ,mnStepTime( 100 )
,mnCurStep( 0 ) ,mnCurStep( 0 )
,mnStepCount( 0 )
,meImageSet( i_imageSet ) ,meImageSet( i_imageSet )
{ {
maWaitTimer.SetTimeout( mnStepTime ); maWaitTimer.SetTimeout( mnStepTime );
...@@ -185,10 +184,11 @@ bool Throbber::isRunning() const ...@@ -185,10 +184,11 @@ bool Throbber::isRunning() const
void Throbber::setImageList( ::std::vector< Image > const& i_images ) 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; maImageList = i_images;
mnStepCount = maImageList.size(); const Image aInitialImage( maImageList.size() ? maImageList[ 0 ] : Image() );
const Image aInitialImage( mnStepCount ? maImageList[ 0 ] : Image() );
SetImage( aInitialImage ); SetImage( aInitialImage );
} }
...@@ -245,8 +245,8 @@ IMPL_LINK_NOARG_TYPED(Throbber, TimeOutHdl, Timer *, void) ...@@ -245,8 +245,8 @@ IMPL_LINK_NOARG_TYPED(Throbber, TimeOutHdl, Timer *, void)
if ( maImageList.empty() ) if ( maImageList.empty() )
return; return;
if ( mnCurStep < mnStepCount - 1 ) if ( mnCurStep < static_cast<sal_Int32>(maImageList.size()-1) )
mnCurStep += 1; ++mnCurStep;
else else
{ {
if ( mbRepeat ) if ( mbRepeat )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment