diff options
author | Noel Grandin <noel@peralex.com> | 2015-01-20 12:38:10 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-01-26 08:42:28 +0200 |
commit | b44cbb26efe1d0b0950b1e1613e131b506dc3876 (patch) | |
tree | 9b4d5d99e5dad0971079b997a02a6d96536709ca /sfx2 | |
parent | 26ad60aec69310fecd918f1c2e09056aa4782320 (diff) |
new loplugin: change virtual methods to non-virtual
Where we can prove that the virtual method is never overriden.
In the case of pure-virtual methods, we remove the method entirely.
Sometimes this leads to entire methods and fields being
eliminated.
Change-Id: I138ef81c95f115dbd8c023a83cfc7e9d5d6d14ae
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/bastyp/fltlst.hxx | 4 | ||||
-rw-r--r-- | sfx2/source/control/thumbnailviewacc.hxx | 4 | ||||
-rw-r--r-- | sfx2/source/dialog/taskpane.cxx | 39 | ||||
-rw-r--r-- | sfx2/source/doc/printhelper.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/inc/templdgi.hxx | 18 | ||||
-rw-r--r-- | sfx2/source/inc/workwin.hxx | 8 | ||||
-rw-r--r-- | sfx2/source/sidebar/TitleBar.hxx | 2 |
7 files changed, 24 insertions, 53 deletions
diff --git a/sfx2/source/bastyp/fltlst.hxx b/sfx2/source/bastyp/fltlst.hxx index f61bb591ce2b..a78c6a72a82b 100644 --- a/sfx2/source/bastyp/fltlst.hxx +++ b/sfx2/source/bastyp/fltlst.hxx @@ -42,9 +42,9 @@ class SfxFilterListener public: // XRefreshListener - virtual void SAL_CALL refreshed( const ::com::sun::star::lang::EventObject& aSource ) throw( ::com::sun::star::uno::RuntimeException ); + void SAL_CALL refreshed( const ::com::sun::star::lang::EventObject& aSource ) throw( ::com::sun::star::uno::RuntimeException ); // XEventListener - virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& aSource ) throw( ::com::sun::star::uno::RuntimeException ); + void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& aSource ) throw( ::com::sun::star::uno::RuntimeException ); }; diff --git a/sfx2/source/control/thumbnailviewacc.hxx b/sfx2/source/control/thumbnailviewacc.hxx index ebb14a5231b6..737b0c09c4bc 100644 --- a/sfx2/source/control/thumbnailviewacc.hxx +++ b/sfx2/source/control/thumbnailviewacc.hxx @@ -111,7 +111,7 @@ public: virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual ::com::sun::star::awt::Size SAL_CALL getSize( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleKeyBinding( ) throw (::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL getAccessibleKeyBinding( ) throw (::com::sun::star::uno::RuntimeException); virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; @@ -226,7 +226,7 @@ public: virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual ::com::sun::star::awt::Size SAL_CALL getSize( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleKeyBinding( ) throw (::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL getAccessibleKeyBinding( ) throw (::com::sun::star::uno::RuntimeException); virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx index b290c7373f6f..9c7f3218f82a 100644 --- a/sfx2/source/dialog/taskpane.cxx +++ b/sfx2/source/dialog/taskpane.cxx @@ -503,8 +503,7 @@ namespace sfx2 class ModuleTaskPane_Impl : public ::boost::noncopyable { public: - ModuleTaskPane_Impl( ModuleTaskPane& i_rAntiImpl, const Reference< XFrame >& i_rDocumentFrame, - const IToolPanelCompare* i_pPanelCompare ) + ModuleTaskPane_Impl( ModuleTaskPane& i_rAntiImpl, const Reference< XFrame >& i_rDocumentFrame ) :m_rAntiImpl( i_rAntiImpl ) ,m_sModuleIdentifier( lcl_identifyModule( i_rDocumentFrame ) ) ,m_xFrame( i_rDocumentFrame ) @@ -512,7 +511,7 @@ namespace sfx2 { m_aPanelDeck.Show(); OnResize(); - impl_initFromConfiguration( i_pPanelCompare ); + impl_initFromConfiguration(); } ~ModuleTaskPane_Impl() @@ -528,14 +527,12 @@ namespace sfx2 ::boost::optional< size_t > GetPanelPos( const OUString& i_rResourceURL ); - OUString - GetPanelResourceURL( const size_t i_nPanelPos ) const; void SetDrawersLayout(); void SetTabsLayout( const ::svt::TabAlignment i_eTabAlignment, const ::svt::TabItemContent i_eTabContent ); private: - void impl_initFromConfiguration( const IToolPanelCompare* i_pPanelCompare ); + void impl_initFromConfiguration(); static bool impl_isToolPanelResource( const OUString& i_rResourceURL ); @@ -575,7 +572,7 @@ namespace sfx2 } - void ModuleTaskPane_Impl::impl_initFromConfiguration( const IToolPanelCompare* i_pPanelCompare ) + void ModuleTaskPane_Impl::impl_initFromConfiguration() { const ::utl::OConfigurationTreeRoot aWindowStateConfig( lcl_getModuleUIElementStatesConfig( m_sModuleIdentifier ) ); if ( !aWindowStateConfig.isValid() ) @@ -599,22 +596,6 @@ namespace sfx2 ::svt::PToolPanel pCustomPanel( new CustomToolPanel( aResourceNode, m_xFrame ) ); size_t nPanelPos = m_aPanelDeck.GetPanelCount(); - if ( i_pPanelCompare ) - { - // assuming that nobody will insert hundreths of panels, a simple O(n) search should suffice here ... - while ( nPanelPos > 0 ) - { - const short nCompare = i_pPanelCompare->compareToolPanelsURLs( - *resource, - GetPanelResourceURL( --nPanelPos ) - ); - if ( nCompare >= 0 ) - { - ++nPanelPos; - break; - } - } - } nPanelPos = m_aPanelDeck.InsertPanel( pCustomPanel, nPanelPos ); if ( ::comphelper::getBOOL( aResourceNode.getNodeValue( "Visible" ) ) ) @@ -676,16 +657,6 @@ namespace sfx2 } - OUString ModuleTaskPane_Impl::GetPanelResourceURL( const size_t i_nPanelPos ) const - { - ENSURE_OR_RETURN( i_nPanelPos < m_aPanelDeck.GetPanelCount(), "ModuleTaskPane_Impl::GetPanelResourceURL: illegal panel position!", OUString() ); - const ::svt::PToolPanel pPanel( m_aPanelDeck.GetPanel( i_nPanelPos ) ); - const CustomToolPanel* pCustomPanel = dynamic_cast< const CustomToolPanel* >( pPanel.get() ); - ENSURE_OR_RETURN( pCustomPanel != NULL, "ModuleTaskPane_Impl::GetPanelPos: illegal panel implementation!", OUString() ); - return pCustomPanel->GetResourceURL(); - } - - void ModuleTaskPane_Impl::SetDrawersLayout() { const ::svt::PDeckLayouter pLayouter( m_aPanelDeck.GetLayouter() ); @@ -724,7 +695,7 @@ namespace sfx2 ModuleTaskPane::ModuleTaskPane( vcl::Window& i_rParentWindow, const Reference< XFrame >& i_rDocumentFrame ) :Window( &i_rParentWindow, WB_DIALOGCONTROL ) - ,m_pImpl( new ModuleTaskPane_Impl( *this, i_rDocumentFrame, NULL ) ) + ,m_pImpl( new ModuleTaskPane_Impl( *this, i_rDocumentFrame ) ) { } diff --git a/sfx2/source/doc/printhelper.hxx b/sfx2/source/doc/printhelper.hxx index fdabc092a375..09f15f808bcf 100644 --- a/sfx2/source/doc/printhelper.hxx +++ b/sfx2/source/doc/printhelper.hxx @@ -60,7 +60,7 @@ private: osl::Mutex m_aMutex; IMPL_PrintListener_DataContainer* m_pData ; - virtual void impl_setPrinter(const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rPrinter,SfxPrinter*& pPrinter,sal_uInt16& nChangeFlags,SfxViewShell*& pViewSh); + void impl_setPrinter(const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rPrinter,SfxPrinter*& pPrinter,sal_uInt16& nChangeFlags,SfxViewShell*& pViewSh); } ; #endif diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx index fa7a26b90964..b7219a30ccba 100644 --- a/sfx2/source/inc/templdgi.hxx +++ b/sfx2/source/inc/templdgi.hxx @@ -208,8 +208,8 @@ protected: virtual void CheckItem( sal_uInt16 /*nMesId*/, bool /*bCheck*/ = true ) {} virtual bool IsCheckedItem( sal_uInt16 /*nMesId*/ ) { return true; } virtual void LoadedFamilies() {} - virtual void Update() { UpdateStyles_Impl(UPDATE_FAMILY_LIST); } - virtual void InvalidateBindings(); + void Update() { UpdateStyles_Impl(UPDATE_FAMILY_LIST); } + void InvalidateBindings(); virtual void InsertFamilyItem( sal_uInt16 nId, const SfxStyleFamilyItem* pIten ) = 0; virtual void EnableFamilyItem( sal_uInt16 nId, bool bEnabled = true ) = 0; virtual void ClearFamilyList() = 0; @@ -267,10 +267,10 @@ public: DECL_LINK( MenuSelectHdl, Menu * ); virtual void EnableEdit( bool b = true ) { bCanEdit = b; } - virtual void EnableDel( bool b = true ) { bCanDel = b; } - virtual void EnableNew( bool b = true ) { bCanNew = b; } - virtual void EnableHide( bool b = true ) { bCanHide = b; } - virtual void EnableShow( bool b = true ) { bCanShow = b; } + void EnableDel( bool b = true ) { bCanDel = b; } + void EnableNew( bool b = true ) { bCanNew = b; } + void EnableHide( bool b = true ) { bCanHide = b; } + void EnableShow( bool b = true ) { bCanShow = b; } vcl::Window* GetWindow() { return pWindow; } @@ -281,7 +281,7 @@ public: OUString GetSelectedEntry() const; SfxObjectShell* GetObjectShell() const { return pCurObjShell; } - virtual void PrepareDeleteAction(); // disable buttons, change button text, etc. when del is going to happen + void PrepareDeleteAction(); // disable buttons, change button text, etc. when del is going to happen inline bool CanEdit( void ) const { return bCanEdit; } inline bool CanDel( void ) const { return bCanDel; } @@ -290,7 +290,7 @@ public: inline bool CanShow( void ) const { return bCanShow; } // normally for derivates from SvTreeListBoxes, but in this case the dialog handles context menus - virtual PopupMenu* CreateContextMenu( void ); + PopupMenu* CreateContextMenu( void ); }; class DropToolBox_Impl : public ToolBox, public DropTargetHelper @@ -323,7 +323,7 @@ private: DECL_LINK( MenuSelectHdl, Menu* ); protected: - virtual void Command( const CommandEvent& rMEvt ); + void Command( const CommandEvent& rMEvt ); virtual void EnableEdit( bool = true ) SAL_OVERRIDE; virtual void EnableItem( sal_uInt16 nMesId, bool bCheck = true ) SAL_OVERRIDE; virtual void CheckItem( sal_uInt16 nMesId, bool bCheck = true ) SAL_OVERRIDE; diff --git a/sfx2/source/inc/workwin.hxx b/sfx2/source/inc/workwin.hxx index db58c1a54670..3d20a0e1dc31 100644 --- a/sfx2/source/inc/workwin.hxx +++ b/sfx2/source/inc/workwin.hxx @@ -242,10 +242,10 @@ protected: void RemoveChildWin_Impl(SfxChildWin_Impl*); void Sort_Impl(); SfxChild_Impl* FindChild_Impl( const vcl::Window& rWindow ) const; - virtual bool RequestTopToolSpacePixel_Impl( SvBorder aBorder ); + bool RequestTopToolSpacePixel_Impl( SvBorder aBorder ); virtual Rectangle GetTopRect_Impl(); SvBorder Arrange_Impl(); - virtual void SaveStatus_Impl(SfxChildWindow*, const SfxChildWinInfo&); + void SaveStatus_Impl(SfxChildWindow*, const SfxChildWinInfo&); static bool IsPluginMode( SfxObjectShell* pObjShell ); public: @@ -308,13 +308,13 @@ public: void ShowChildWindow_Impl(sal_uInt16, bool bVisible, bool bSetFocus); void SetChildWindow_Impl(sal_uInt16, bool bOn, bool bSetFocus); SfxChildWindow* GetChildWindow_Impl(sal_uInt16); - virtual void InitializeChild_Impl(SfxChildWin_Impl*); + void InitializeChild_Impl(SfxChildWin_Impl*); SfxSplitWindow* GetSplitWindow_Impl(SfxChildAlignment); bool IsVisible_Impl( sal_uInt16 nMode ) const; bool IsFloating( sal_uInt16 nId ); void SetActiveChild_Impl( vcl::Window *pChild ); - virtual bool ActivateNextChild_Impl( bool bForward = true ); + bool ActivateNextChild_Impl( bool bForward = true ); bool AllowChildWindowCreation_Impl( const SfxChildWin_Impl& i_rCW ) const; // Methods for StatusBar diff --git a/sfx2/source/sidebar/TitleBar.hxx b/sfx2/source/sidebar/TitleBar.hxx index a6bdedf0ff79..ea206c99f90a 100644 --- a/sfx2/source/sidebar/TitleBar.hxx +++ b/sfx2/source/sidebar/TitleBar.hxx @@ -58,7 +58,7 @@ protected: virtual Rectangle GetTitleArea (const Rectangle& rTitleBarBox) = 0; virtual void PaintDecoration (const Rectangle& rTitleBarBox) = 0; - virtual void PaintFocus (const Rectangle& rFocusBox); + void PaintFocus (const Rectangle& rFocusBox); virtual sidebar::Paint GetBackgroundPaint (void) = 0; virtual Color GetTextColor (void) = 0; virtual void HandleToolBoxItemClick (const sal_uInt16 nItemIndex); |