[Libreoffice-commits] core.git: avmedia/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Dec 28 15:48:42 UTC 2018


 avmedia/source/viewer/mediawindow.cxx |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

New commits:
commit a33c2a1ad09f834207b15e664e5b30a21c50b3ab
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Tue Nov 27 22:51:25 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Fri Dec 28 16:48:20 2018 +0100

    Return early
    
    Change-Id: I96774c66d2a14b9be2d8e400be928c3c0073411f
    Reviewed-on: https://gerrit.libreoffice.org/65663
    Tested-by: Jenkins
    Reviewed-by: Matteo Casalin <matteo.casalin at yahoo.com>

diff --git a/avmedia/source/viewer/mediawindow.cxx b/avmedia/source/viewer/mediawindow.cxx
index d778c72e7c31..f1ef17a4b664 100644
--- a/avmedia/source/viewer/mediawindow.cxx
+++ b/avmedia/source/viewer/mediawindow.cxx
@@ -306,7 +306,6 @@ void MediaWindow::executeFormatErrorBox(weld::Window* pParent)
 bool MediaWindow::isMediaURL( const OUString& rURL, const OUString& rReferer, bool bDeep, Size* pPreferredSizePixel )
 {
     const INetURLObject aURL( rURL );
-    bool                bRet = false;
 
     if( aURL.GetProtocol() != INetProtocol::NotValid )
     {
@@ -320,8 +319,6 @@ bool MediaWindow::isMediaURL( const OUString& rURL, const OUString& rReferer, bo
 
                 if( xPlayer.is() )
                 {
-                    bRet = true;
-
                     if( pPreferredSizePixel )
                     {
                         const awt::Size aAwtSize( xPlayer->getPreferredPlayerWindowSize() );
@@ -329,6 +326,8 @@ bool MediaWindow::isMediaURL( const OUString& rURL, const OUString& rReferer, bo
                         pPreferredSizePixel->setWidth( aAwtSize.Width );
                         pPreferredSizePixel->setHeight( aAwtSize.Height );
                     }
+
+                    return true;
                 }
             }
             catch( ... )
@@ -342,18 +341,18 @@ bool MediaWindow::isMediaURL( const OUString& rURL, const OUString& rReferer, bo
 
             getMediaFilters( aFilters );
 
-            for( FilterNameVector::size_type i = 0; ( i < aFilters.size() ) && !bRet; ++i )
+            for( FilterNameVector::size_type i = 0; i < aFilters.size(); ++i )
             {
-                for( sal_Int32 nIndex = 0; nIndex >= 0 && !bRet; )
+                for( sal_Int32 nIndex = 0; nIndex >= 0; )
                 {
                     if( aExt.equalsIgnoreAsciiCase( aFilters[ i ].second.getToken( 0, ';', nIndex ) ) )
-                        bRet = true;
+                        return true;
                 }
             }
         }
     }
 
-    return bRet;
+    return false;
 }
 
 


More information about the Libreoffice-commits mailing list