loplugin:flatten in avmedia

Change-Id: Ie066ee15833a58db4a9a18006629c015d50a56b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92486
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2020-04-18 15:06:23 +02:00
parent 7fa4f64098
commit 0034fba36b
3 changed files with 147 additions and 146 deletions

View File

@@ -38,8 +38,9 @@ MediaControlBase::MediaControlBase()
void MediaControlBase::UpdateTimeField( MediaItem const & aMediaItem, double fTime )
{
if( !aMediaItem.getURL().isEmpty())
{
if( aMediaItem.getURL().isEmpty())
return;
OUString aTimeString;
SvtSysLocale aSysLocale;
@@ -52,7 +53,6 @@ void MediaControlBase::UpdateTimeField( MediaItem const & aMediaItem, double fTi
if( mxTimeEdit->get_text() != aTimeString )
mxTimeEdit->set_text( aTimeString );
}
}
void MediaControlBase::UpdateVolumeSlider( MediaItem const & aMediaItem )
{

View File

@@ -674,7 +674,9 @@ void SAL_CALL Player::setMediaTime( double fTime )
{
::osl::MutexGuard aGuard(m_aMutex);
if( mpPlaybin ) {
if( !mpPlaybin )
return;
gint64 gst_position = llround (fTime * GST_SECOND);
gst_element_seek( mpPlaybin, 1.0,
@@ -687,7 +689,6 @@ void SAL_CALL Player::setMediaTime( double fTime )
SAL_INFO( "avmedia.gstreamer", AVVERSION "seek to: " << gst_position << " ns original: " << fTime << " s" );
}
}
double SAL_CALL Player::getMediaTime()

View File

@@ -224,8 +224,9 @@ void MediaWindowImpl::setURL( const OUString& rURL,
OUString const& rTempURL, OUString const& rReferer)
{
maReferer = rReferer;
if( rURL != getURL() )
{
if( rURL == getURL() )
return;
if( mxPlayer.is() )
mxPlayer->stop();
@@ -256,7 +257,6 @@ void MediaWindowImpl::setURL( const OUString& rURL,
mxPlayer = createPlayer((!mTempFileURL.isEmpty()) ? mTempFileURL : maFileURL, rReferer, &m_sMimeType );
onURLChanged();
}
}
const OUString& MediaWindowImpl::getURL() const
{
@@ -332,8 +332,9 @@ void MediaWindowImpl::executeMediaItem( const MediaItem& rItem )
mxPlayerWindow->setZoomLevel( rItem.getZoom() );
// set play state at last
if (nMaskSet & AVMediaSetMask::STATE)
{
if (!(nMaskSet & AVMediaSetMask::STATE))
return;
switch (rItem.getState())
{
case MediaState::Play:
@@ -362,7 +363,6 @@ void MediaWindowImpl::executeMediaItem( const MediaItem& rItem )
break;
}
}
}
void MediaWindowImpl::stop()
{
@@ -472,8 +472,9 @@ void MediaWindowImpl::setPointer(PointerStyle aPointer)
if (mpChildWindow)
mpChildWindow->SetPointer(aPointer);
if (mxPlayerWindow.is())
{
if (!mxPlayerWindow.is())
return;
long nPointer;
switch (aPointer)
@@ -497,7 +498,6 @@ void MediaWindowImpl::setPointer(PointerStyle aPointer)
mxPlayerWindow->setPointerType(nPointer);
}
}
void MediaWindowImpl::Resize()
{
@@ -524,8 +524,9 @@ void MediaWindowImpl::Resize()
void MediaWindowImpl::StateChanged(StateChangedType eType)
{
if (mxPlayerWindow.is())
{
if (!mxPlayerWindow.is())
return;
// stop playing when going disabled or hidden
switch (eType)
{
@@ -547,7 +548,6 @@ void MediaWindowImpl::StateChanged(StateChangedType eType)
break;
}
}
}
void MediaWindowImpl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
{
@@ -577,8 +577,9 @@ void MediaWindowImpl::Paint(vcl::RenderContext& rRenderContext, const tools::Rec
const Point aBasePos(mpChildWindow->GetPosPixel());
const tools::Rectangle aVideoRect(aBasePos, mpChildWindow->GetSizePixel());
if (pLogo && !pLogo->IsEmpty() && !aVideoRect.IsEmpty())
{
if (!(pLogo && !pLogo->IsEmpty() && !aVideoRect.IsEmpty()))
return;
Size aLogoSize(pLogo->GetSizePixel());
const Color aBackgroundColor(67, 67, 67);
@@ -608,7 +609,6 @@ void MediaWindowImpl::Paint(vcl::RenderContext& rRenderContext, const tools::Rec
rRenderContext.DrawBitmapEx(aPoint, aLogoSize, *pLogo);
}
}
void MediaWindowImpl::GetFocus()
{