[Libreoffice-commits] core.git: avmedia/source basctl/source basic/source canvas/source include/avmedia include/basic include/canvas

Noel Grandin noel.grandin at collabora.co.uk
Fri Nov 11 07:00:51 UTC 2016


 avmedia/source/viewer/mediawindow.cxx            |   15 ++-------------
 basctl/source/basicide/baside2.cxx               |    7 +------
 basctl/source/basicide/baside2.hxx               |    2 --
 basctl/source/basicide/basidesh.cxx              |    7 +------
 basctl/source/inc/basidesh.hxx                   |    2 --
 basic/source/classes/sb.cxx                      |    7 +------
 basic/source/inc/namecont.hxx                    |    3 ---
 basic/source/uno/namecont.cxx                    |   21 +++++----------------
 canvas/source/tools/canvascustomspritehelper.cxx |   13 ++++---------
 include/avmedia/mediawindow.hxx                  |    3 ---
 include/basic/sbstar.hxx                         |    1 -
 include/canvas/base/canvascustomspritehelper.hxx |    3 ---
 12 files changed, 14 insertions(+), 70 deletions(-)

New commits:
commit f31d98f63c4ad11897e0a961fb378fdf7989f4d3
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Nov 10 15:26:06 2016 +0200

    loplugin:expandablemethods in avmedia..canvas
    
    Change-Id: Ic230f1ef6b1dbe796ac7862a1a7e6a718f9e4e54
    Reviewed-on: https://gerrit.libreoffice.org/30753
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/avmedia/source/viewer/mediawindow.cxx b/avmedia/source/viewer/mediawindow.cxx
index a3d6bc7..9ae9070 100644
--- a/avmedia/source/viewer/mediawindow.cxx
+++ b/avmedia/source/viewer/mediawindow.cxx
@@ -394,7 +394,7 @@ uno::Reference< graphic::XGraphic > MediaWindow::grabFrame( const OUString& rURL
 
             if( !aPrefSize.Width && !aPrefSize.Height )
             {
-                const BitmapEx aBmpEx( getAudioLogo() );
+                const BitmapEx aBmpEx( AVMEDIA_RESID(AVMEDIA_BMP_AUDIOLOGO) );
                 xGraphic.reset( new Graphic( aBmpEx ) );
             }
         }
@@ -402,7 +402,7 @@ uno::Reference< graphic::XGraphic > MediaWindow::grabFrame( const OUString& rURL
 
     if( !xRet.is() && !xGraphic.get() )
     {
-        const BitmapEx aBmpEx( getEmptyLogo() );
+        const BitmapEx aBmpEx( AVMEDIA_RESID(AVMEDIA_BMP_EMPTYLOGO) );
         xGraphic.reset( new Graphic( aBmpEx ) );
     }
 
@@ -413,17 +413,6 @@ uno::Reference< graphic::XGraphic > MediaWindow::grabFrame( const OUString& rURL
 }
 
 
-BitmapEx MediaWindow::getAudioLogo()
-{
-    return BitmapEx(AVMEDIA_RESID(AVMEDIA_BMP_AUDIOLOGO));
-}
-
-
-BitmapEx MediaWindow::getEmptyLogo()
-{
-    return BitmapEx(AVMEDIA_RESID(AVMEDIA_BMP_EMPTYLOGO));
-}
-
 } // namespace avmedia
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 0afd147..fdd837e 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -592,7 +592,7 @@ void ModulWindow::ManageBreakPoints()
 
 bool ModulWindow::BasicErrorHdl( StarBASIC * pBasic )
 {
-    GoOnTop();
+    GetShell()->GetViewFrame()->ToTop();
 
     // ReturnWert: BOOL
     //  FALSE:  cancel
@@ -1152,11 +1152,6 @@ bool ModulWindow::IsModified()
     return GetEditEngine() && GetEditEngine()->IsModified();
 }
 
-void ModulWindow::GoOnTop()
-{
-    GetShell()->GetViewFrame()->ToTop();
-}
-
 OUString ModulWindow::GetSbModuleName()
 {
     OUString aModuleName;
diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx
index 6770ffb..e631d8e 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -310,8 +310,6 @@ private:
     void                CheckCompileBasic();
     void                BasicExecute();
 
-    static void         GoOnTop();
-
     sal_Int32           FormatAndPrint( Printer* pPrinter, sal_Int32 nPage );
     SbModuleRef const & XModule();
 protected:
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index e24794b..bcbbf46 100644
--- a/basctl/source/basicide/basidesh.cxx
+++ b/basctl/source/basicide/basidesh.cxx
@@ -671,7 +671,7 @@ void Shell::UpdateWindows()
                     {
                         StarBASIC* pLib = doc->getBasicManager()->GetLib( aLibName );
                         if ( pLib )
-                            ImplStartListening( pLib );
+                            StartListening( pLib->GetBroadcaster(), true /* log on only once */ );
 
                         try
                         {
@@ -913,11 +913,6 @@ void Shell::SetCurLibForLocalization( const ScriptDocument& rDocument, const OUS
     m_pCurLocalizationMgr->handleTranslationbar();
 }
 
-void Shell::ImplStartListening( StarBASIC* pBasic )
-{
-    StartListening( pBasic->GetBroadcaster(), true /* log on only once */ );
-}
-
 } // namespace basctl
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx
index d6acd5c..aa41e8b 100644
--- a/basctl/source/inc/basidesh.hxx
+++ b/basctl/source/inc/basidesh.hxx
@@ -99,8 +99,6 @@ private:
     void                SetCurLib( const ScriptDocument& rDocument, const OUString& aLibName, bool bUpdateWindows = true , bool bCheck = true );
     void                SetCurLibForLocalization( const ScriptDocument& rDocument, const OUString& aLibName );
 
-    void                ImplStartListening( StarBASIC* pBasic );
-
     DECL_LINK( TabBarHdl, ::TabBar*, void );
 
     static unsigned nShellCount;
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index e34daa0..b4e21a4 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -1362,7 +1362,7 @@ bool StarBASIC::Call( const OUString& rName, SbxArray* pParam )
         SbxBase::ResetError();
         if( eErr != ERRCODE_SBX_OK )
         {
-            RTError( (SbError)eErr, 0, 0, 0 );
+            RTError( (SbError)eErr, OUString(), 0, 0, 0 );
         }
     }
     return bRes;
@@ -1680,11 +1680,6 @@ bool StarBASIC::CError( SbError code, const OUString& rMsg,
     return bRet;
 }
 
-void StarBASIC::RTError( SbError code, sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
-{
-    RTError( code, OUString(), l, c1, c2 );
-}
-
 bool StarBASIC::RTError( SbError code, const OUString& rMsg, sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
 {
     SolarMutexGuard aSolarGuard;
diff --git a/basic/source/inc/namecont.hxx b/basic/source/inc/namecont.hxx
index a09639f..fd0e9e3 100644
--- a/basic/source/inc/namecont.hxx
+++ b/basic/source/inc/namecont.hxx
@@ -355,7 +355,6 @@ protected:
                             const css::uno::Reference< css::embed::XStorage >& xStorage,
                             bool bComplete );
 
-    void SAL_CALL initializeFromDocumentURL( const OUString& _rInitialDocumentURL );
     void SAL_CALL initializeFromDocument( const css::uno::Reference< css::document::XStorageBasedDocument >& _rxDocument );
 
     // OEventListenerAdapter
@@ -382,8 +381,6 @@ public:
 
     void    enterMethod();
     static void leaveMethod();
-    bool    isDisposed() const { return rBHelper.bInDispose || rBHelper.bDisposed; }
-    void    checkDisposed() const;
 
     // Methods XElementAccess
     virtual css::uno::Type SAL_CALL getElementType()
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 5e0b56e..7c9965e 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -404,19 +404,13 @@ SfxLibraryContainer::~SfxLibraryContainer()
     }
 }
 
-void SfxLibraryContainer::checkDisposed() const
-{
-    if ( isDisposed() )
-    {
-        throw DisposedException( OUString(),
-                                 *const_cast< SfxLibraryContainer* >( this ) );
-    }
-}
-
 void SfxLibraryContainer::enterMethod()
 {
     Application::GetSolarMutex().acquire();
-    checkDisposed();
+    if ( rBHelper.bInDispose || rBHelper.bDisposed )
+    {
+        throw DisposedException( OUString(), *this );
+    }
 }
 
 void SfxLibraryContainer::leaveMethod()
@@ -2710,7 +2704,7 @@ void SAL_CALL SfxLibraryContainer::initialize( const Sequence< Any >& _rArgument
         Reference< XStorageBasedDocument > xDocument;
         if ( _rArguments[0] >>= sInitialDocumentURL )
         {
-            initializeFromDocumentURL( sInitialDocumentURL );
+            init( sInitialDocumentURL, nullptr );
             return;
         }
 
@@ -2724,11 +2718,6 @@ void SAL_CALL SfxLibraryContainer::initialize( const Sequence< Any >& _rArgument
     throw IllegalArgumentException();
 }
 
-void SAL_CALL SfxLibraryContainer::initializeFromDocumentURL( const OUString& _rInitialDocumentURL )
-{
-    init( _rInitialDocumentURL, nullptr );
-}
-
 void SAL_CALL SfxLibraryContainer::initializeFromDocument( const Reference< XStorageBasedDocument >& _rxDocument )
 {
     // check whether this is a valid OfficeDocument, and obtain the document's root storage
diff --git a/canvas/source/tools/canvascustomspritehelper.cxx b/canvas/source/tools/canvascustomspritehelper.cxx
index 49a266e..37d010c 100644
--- a/canvas/source/tools/canvascustomspritehelper.cxx
+++ b/canvas/source/tools/canvascustomspritehelper.cxx
@@ -264,7 +264,10 @@ namespace canvas
 
         if( aPoint != maPosition )
         {
-            const ::basegfx::B2DRectangle&  rBounds( getFullSpriteRect() );
+            const ::basegfx::B2DRectangle&  rBounds
+                = getUpdateArea( ::basegfx::B2DRectangle( 0.0, 0.0,
+                                                          maSize.getX(),
+                                                          maSize.getY() ) );
 
             if( mbActive )
             {
@@ -453,14 +456,6 @@ namespace canvas
                 maPosition + maCurrClipBounds.getMinimum(),
                 maPosition + maCurrClipBounds.getMaximum() );
     }
-
-    ::basegfx::B2DRange CanvasCustomSpriteHelper::getFullSpriteRect() const
-    {
-        // Internal! Only call with locked object mutex!
-        return getUpdateArea( ::basegfx::B2DRectangle( 0.0, 0.0,
-                                                       maSize.getX(),
-                                                       maSize.getY() ) );
-    }
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/avmedia/mediawindow.hxx b/include/avmedia/mediawindow.hxx
index e20d740..414b06f 100644
--- a/include/avmedia/mediawindow.hxx
+++ b/include/avmedia/mediawindow.hxx
@@ -108,9 +108,6 @@ namespace avmedia
         static css::uno::Reference< css::graphic::XGraphic > grabFrame( const OUString& rURL, const OUString& rReferer,
             const OUString& sMimeType );
 
-        static BitmapEx getAudioLogo();
-        static BitmapEx getEmptyLogo();
-
     private:
         MediaWindow(const MediaWindow&) = delete;
         MediaWindow& operator =( const MediaWindow& ) = delete;
diff --git a/include/basic/sbstar.hxx b/include/basic/sbstar.hxx
index 9ec0918..aeb7874 100644
--- a/include/basic/sbstar.hxx
+++ b/include/basic/sbstar.hxx
@@ -71,7 +71,6 @@ class BASIC_DLLPUBLIC StarBASIC : public SbxObject
 protected:
     bool                                CError( SbError, const OUString&, sal_Int32, sal_Int32, sal_Int32 );
 private:
-    BASIC_DLLPRIVATE void               RTError( SbError, sal_Int32, sal_Int32, sal_Int32 );
     BASIC_DLLPRIVATE bool               RTError( SbError, const OUString& rMsg, sal_Int32, sal_Int32, sal_Int32 );
     BASIC_DLLPRIVATE sal_uInt16         BreakPoint( sal_Int32 nLine, sal_Int32 nCol1, sal_Int32 nCol2 );
     BASIC_DLLPRIVATE sal_uInt16         StepPoint( sal_Int32 nLine, sal_Int32 nCol1, sal_Int32 nCol2 );
diff --git a/include/canvas/base/canvascustomspritehelper.hxx b/include/canvas/base/canvascustomspritehelper.hxx
index 8d81821..f44f521 100644
--- a/include/canvas/base/canvascustomspritehelper.hxx
+++ b/include/canvas/base/canvascustomspritehelper.hxx
@@ -106,9 +106,6 @@ namespace canvas
         /// Calc sprite update area from given raw sprite bounds
         ::basegfx::B2DRange getUpdateArea( const ::basegfx::B2DRange& rUntransformedSpriteBounds ) const;
 
-        /// Calc update area for unclipped sprite content
-        ::basegfx::B2DRange getFullSpriteRect() const;
-
         /** Returns true, if sprite content bitmap is fully opaque.
 
             This does not take clipping or transformation into


More information about the Libreoffice-commits mailing list