[Libreoffice-commits] core.git: compilerplugins/clang include/tools registry/tools sd/source vcl/source

Noel Grandin noel at peralex.com
Fri Feb 12 06:14:25 UTC 2016


 compilerplugins/clang/unusedmethods.py          |   24 +++---
 include/tools/globname.hxx                      |    1 
 registry/tools/options.hxx                      |    1 
 sd/source/ui/animations/CategoryListBox.hxx     |    2 
 sd/source/ui/animations/CustomAnimationPane.cxx |   83 ------------------------
 sd/source/ui/animations/CustomAnimationPane.hxx |    4 -
 sd/source/ui/inc/slideshow.hxx                  |    6 -
 sd/source/ui/slideshow/slideshow.cxx            |   20 -----
 sd/source/ui/slideshow/slideshowimpl.hxx        |    3 
 vcl/source/gdi/bmpfast.cxx                      |    1 
 vcl/source/window/menubarwindow.hxx             |    3 
 11 files changed, 12 insertions(+), 136 deletions(-)

New commits:
commit 198f3ec116996788be1d73f9462ecb808b78f309
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Feb 9 13:37:03 2016 +0200

    loplugin:unusedmethods
    
    Change-Id: I0fb06079ff8a9d0b2f5a2929f31846f91391f5c4
    Reviewed-on: https://gerrit.libreoffice.org/22229
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/compilerplugins/clang/unusedmethods.py b/compilerplugins/clang/unusedmethods.py
index 504a97f..a81bd6b 100755
--- a/compilerplugins/clang/unusedmethods.py
+++ b/compilerplugins/clang/unusedmethods.py
@@ -260,10 +260,10 @@ def natural_sort_key(s, _nsre=re.compile('([0-9]+)')):
 tmp1list = sorted(tmp1set, key=lambda v: natural_sort_key(v[1]))
 
 # print out the results
-#for t in tmp1list:
-#    print t[1]
-#    print "    ", t[0]
-#sys.exit(0)
+with open("unused.methods", "wt") as f:
+    for t in tmp1list:
+        f.write(t[1] + "\n")
+        f.write("    " + t[0] + "\n")
 
 # -------------------------------------------
 # Do the "unused return types" part
@@ -304,9 +304,10 @@ for d in definitionSet:
 # sort results by name and line number
 tmp2list = sorted(tmp2set, key=lambda v: natural_sort_key(v[1]))
     
-#for t in tmp2list:
-#    print t[1]
-#    print "    ", t[0]
+with open("unused.returns", "wt") as f:
+    for t in tmp2list:
+        f.write(t[1])
+        f.write("    " +  t[0] + "\n")
 
 
 # -------------------------------------------
@@ -328,11 +329,10 @@ for d in publicDefinitionSet:
 # sort results by name and line number
 tmp3list = sorted(tmp3set, key=lambda v: natural_sort_key(v[1]))
     
-for t in tmp3list:
-    print t[1]
-    print "    ", t[0]
+with open("unused.public", "wt") as f:
+    for t in tmp3list:
+        f.write(t[1] + "\n")
+        f.write("    " + t[0] + "\n")
 
-# add an empty line at the end to make it easier for the unusedmethodsremove plugin to mmap() the output file 
-print
         
 
diff --git a/include/tools/globname.hxx b/include/tools/globname.hxx
index e1ec0e3..8c30b37 100644
--- a/include/tools/globname.hxx
+++ b/include/tools/globname.hxx
@@ -80,7 +80,6 @@ public:
 
     bool          operator < ( const SvGlobalName & rObj ) const;
     SvGlobalName& operator += ( sal_uInt32 );
-    SvGlobalName& operator ++ () { return operator += ( 1 ); }
 
     bool          operator == ( const SvGlobalName & rObj ) const;
     bool          operator != ( const SvGlobalName & rObj ) const
diff --git a/registry/tools/options.hxx b/registry/tools/options.hxx
index 2c08a71..7b3bee2 100644
--- a/registry/tools/options.hxx
+++ b/registry/tools/options.hxx
@@ -45,7 +45,6 @@ public:
     bool initOptions (std::vector< std::string > & rArgs);
     bool badOption (char const * reason, char const * option) const;
 
-    std::string const & getProgramName() const { return m_program; }
     bool printUsage() const;
 
 protected:
diff --git a/sd/source/ui/animations/CategoryListBox.hxx b/sd/source/ui/animations/CategoryListBox.hxx
index f044ac4..fa29b4a 100644
--- a/sd/source/ui/animations/CategoryListBox.hxx
+++ b/sd/source/ui/animations/CategoryListBox.hxx
@@ -16,8 +16,6 @@ public:
 
     sal_Int32           InsertCategory( const OUString& rStr, sal_Int32  nPos = LISTBOX_APPEND );
 
-    void                SetDoubleClickLink( const Link<CategoryListBox&,void>& rDoubleClickHdl ) { maDoubleClickHdl = rDoubleClickHdl; }
-
     DECL_LINK_TYPED(implDoubleClickHdl, ListBox&, void);
 
 private:
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index f7589cf..ac3b1ae 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -275,30 +275,6 @@ void CustomAnimationPane::dispose()
     PanelLayout::dispose();
 }
 
-PathKind CustomAnimationPane::getCreatePathKind() const
-{
-    PathKind eKind = PathKind::NONE;
-
-    if( mpLBAnimation->GetSelectEntryCount() == 1 )
-    {
-        const sal_Int32 nPos = mpLBAnimation->GetSelectEntryPos();
-        if( nPos == mnCurvePathPos )
-        {
-            eKind = PathKind::CURVE;
-        }
-        else if( nPos == mnPolygonPathPos )
-        {
-            eKind = PathKind::POLYGON;
-        }
-        else if( nPos == mnFreeformPathPos )
-        {
-            eKind = PathKind::FREEFORM;
-        }
-    }
-
-    return eKind;
-}
-
 void CustomAnimationPane::addUndo()
 {
     ::svl::IUndoManager* pManager = mrBase.GetDocShell()->GetUndoManager();
@@ -1768,33 +1744,6 @@ bool getTextSelection( const Any& rSelection, Reference< XShape >& xShape, std::
     return false;
 }
 
-void CustomAnimationPane::animationChange()
-{
-    if( maListSelection.size() == 1 )
-    {
-        CustomAnimationPresetPtr* pPreset = static_cast< CustomAnimationPresetPtr* >(mpLBAnimation->GetSelectEntryData());
-        const double fDuration = (*pPreset)->getDuration();
-        CustomAnimationPresetPtr pDescriptor(*pPreset);
-        MainSequenceRebuildGuard aGuard( mpMainSequence );
-
-        // get selected effect
-        EffectSequence::iterator aIter( maListSelection.begin() );
-        const EffectSequence::iterator aEnd( maListSelection.end() );
-        while( aIter != aEnd )
-        {
-            CustomAnimationEffectPtr pEffect = (*aIter++);
-
-            EffectSequenceHelper* pEffectSequence = pEffect->getEffectSequence();
-            if( !pEffectSequence )
-                pEffectSequence = mpMainSequence.get();
-
-            pEffectSequence->replace( pEffect, pDescriptor, fDuration );
-        }
-        onPreview(true);
-    }
-
-}
-
 void CustomAnimationPane::onChange()
 {
     bool bHasText = true;
@@ -1926,38 +1875,6 @@ void CustomAnimationPane::onChange()
     SlideShow::Stop( mrBase );
 }
 
-void CustomAnimationPane::createPath( PathKind eKind, std::vector< Any >& rTargets, double fDuration)
-{
-    sal_uInt16 nSID = 0;
-
-    switch( eKind )
-    {
-    case PathKind::CURVE:     nSID = SID_DRAW_BEZIER_NOFILL; break;
-    case PathKind::POLYGON:   nSID = SID_DRAW_POLYGON_NOFILL; break;
-    case PathKind::FREEFORM:  nSID = SID_DRAW_FREELINE_NOFILL; break;
-    default: break;
-    }
-
-    if( nSID )
-    {
-        DrawViewShell* pViewShell = dynamic_cast< DrawViewShell* >(
-            FrameworkHelper::Instance(mrBase)->GetViewShell(FrameworkHelper::msCenterPaneURL).get());
-
-        if( pViewShell )
-        {
-            DrawView* pView = pViewShell->GetDrawView();
-            if( pView )
-                pView->UnmarkAllObj();
-
-            std::vector< Any > aTargets( 1, Any( fDuration ) );
-            aTargets.insert( aTargets.end(), rTargets.begin(), rTargets.end() );
-            Sequence< Any > aTargetSequence( comphelper::containerToSequence( aTargets ) );
-            const SfxUnoAnyItem aItem( SID_ADD_MOTION_PATH, Any( aTargetSequence ) );
-            pViewShell->GetViewFrame()->GetDispatcher()->Execute( nSID, SfxCallMode::ASYNCHRON, &aItem, 0 );
-        }
-    }
-}
-
 void CustomAnimationPane::onRemove()
 {
    if( !maListSelection.empty() )
diff --git a/sd/source/ui/animations/CustomAnimationPane.hxx b/sd/source/ui/animations/CustomAnimationPane.hxx
index a5b4c6e..04305d5 100644
--- a/sd/source/ui/animations/CustomAnimationPane.hxx
+++ b/sd/source/ui/animations/CustomAnimationPane.hxx
@@ -71,7 +71,6 @@ public:
     void onSelectionChanged();
     void onChangeCurrentPage();
     void onChange();
-    void animationChange();
     void onRemove();
     void onChangeStart();
     void onChangeStart( sal_Int16 nNodeType );
@@ -82,7 +81,6 @@ public:
     void preview( const css::uno::Reference< css::animations::XAnimationNode >& xAnimationNode );
     void remove( CustomAnimationEffectPtr& pEffect );
 
-    PathKind getCreatePathKind() const;
     // Control
     virtual void StateChanged( StateChangedType nStateChange ) override;
     virtual void KeyInput( const KeyEvent& rKEvt ) override;
@@ -111,8 +109,6 @@ private:
     void moveSelection( bool bUp );
     void onPreview( bool bForcePreview );
 
-    void createPath( PathKind eKind, std::vector< css::uno::Any >& rTargets, double fDuration );
-
     STLPropertySet* createSelectionSet();
     void changeSelection( STLPropertySet* pResultSet, STLPropertySet* pOldSet );
 
diff --git a/sd/source/ui/inc/slideshow.hxx b/sd/source/ui/inc/slideshow.hxx
index 118c719..741af84 100644
--- a/sd/source/ui/inc/slideshow.hxx
+++ b/sd/source/ui/inc/slideshow.hxx
@@ -165,10 +165,6 @@ public:
     OutputDevice* getShowWindow();                      // a.k.a. FuSlideShow::GetShowWindow()
     int getAnimationMode();                             // a.k.a. FuSlideShow::GetAnimationMode()
     sal_Int32 getCurrentPageNumber();                   // a.k.a. FuSlideShow::GetCurrentPage()
-    sal_Int32 getFirstPageNumber();
-    sal_Int32 getLastPageNumber();
-    bool isEndless();
-    bool isDrawingPossible();
 
     // events
     void resize( const Size &rSize );
@@ -178,8 +174,6 @@ public:
 
     bool keyInput(const KeyEvent& rKEvt);
 
-    void receiveRequest(SfxRequest& rReq);
-
     bool dependsOn( ViewShellBase* pViewShellBase );
 
     static sal_Int32 GetDisplay();
diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx
index 99b27e0..6d30a08 100644
--- a/sd/source/ui/slideshow/slideshow.cxx
+++ b/sd/source/ui/slideshow/slideshow.cxx
@@ -1020,26 +1020,6 @@ void SlideShow::pause( bool bPause )
     }
 }
 
-sal_Int32 SlideShow::getFirstPageNumber()
-{
-    return mxController.is() ? mxController->getFirstSlideNumber() : 0;
-}
-
-sal_Int32 SlideShow::getLastPageNumber()
-{
-    return mxController.is() ? mxController->getLastSlideNumber() : 0;
-}
-
-bool SlideShow::isEndless()
-{
-    return mxController.is() && mxController->isEndless();
-}
-
-bool SlideShow::isDrawingPossible()
-{
-    return mxController.is() && mxController->getUsePen();
-}
-
 bool SlideShow::swipe(const CommandSwipeData& rSwipeData)
 {
     return mxController.is() && mxController->swipe(rSwipeData);
diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx
index 8aa17bd..5845175 100644
--- a/sd/source/ui/slideshow/slideshowimpl.hxx
+++ b/sd/source/ui/slideshow/slideshowimpl.hxx
@@ -283,9 +283,6 @@ private:
     DECL_LINK_TYPED( deactivateHdl, Timer *, void );
     DECL_LINK_TYPED( EventListenerHdl, VclSimpleEvent&, void );
 
-    // helper
-    void receiveRequest(SfxRequest& rReq);
-
     /** called only by the slideshow view when the first paint event occurs.
         This actually starts the slideshow. */
     void onFirstPaint();
diff --git a/vcl/source/gdi/bmpfast.cxx b/vcl/source/gdi/bmpfast.cxx
index bed0528..e912310 100644
--- a/vcl/source/gdi/bmpfast.cxx
+++ b/vcl/source/gdi/bmpfast.cxx
@@ -50,7 +50,6 @@ public:
 
     void    SetColor( PIXBYTE r, PIXBYTE g, PIXBYTE b ) const;
     void    SetAlpha( PIXBYTE a ) const;
-    void    operator++(int);
 };
 
 // template specializations for truecolor pixel formats
diff --git a/vcl/source/window/menubarwindow.hxx b/vcl/source/window/menubarwindow.hxx
index 592f962..9abc478 100644
--- a/vcl/source/window/menubarwindow.hxx
+++ b/vcl/source/window/menubarwindow.hxx
@@ -127,9 +127,6 @@ public:
     virtual void    Resize() override;
     virtual void    RequestHelp( const HelpEvent& rHEvt ) override;
 
-    void    SetFocusId(const VclPtr<vcl::Window>& xId) { xSaveFocusId = xId; }
-    VclPtr<vcl::Window> GetFocusId() const { return xSaveFocusId; }
-
     void    SetMenu(MenuBar* pMenu);
     void    SetHeight(long nHeight);
     void    KillActivePopup();


More information about the Libreoffice-commits mailing list