[PATCH 2/2] Remove unused code (sdext)

Christina Rossmanith ChrRossmanith at web.de
Sat Mar 17 07:24:39 PDT 2012


---
 sdext/source/presenter/PresenterAnimation.cxx |   31 +------------------------
 sdext/source/presenter/PresenterAnimation.hxx |   17 -------------
 sdext/source/presenter/PresenterAnimator.cxx  |   11 ---------
 sdext/source/presenter/PresenterAnimator.hxx  |    8 +-----
 unusedcode.easy                               |    4 ---
 5 files changed, 2 insertions(+), 69 deletions(-)

diff --git a/sdext/source/presenter/PresenterAnimation.cxx b/sdext/source/presenter/PresenterAnimation.cxx
index cacf98d..b5c30ec 100644
--- a/sdext/source/presenter/PresenterAnimation.cxx
+++ b/sdext/source/presenter/PresenterAnimation.cxx
@@ -47,9 +47,7 @@ PresenterAnimation::PresenterAnimation (
     const sal_uInt64 nStepDuration)
     : mnStartTime(GetCurrentTime()+nStartDelay),
       mnTotalDuration(nTotalDuration),
-      mnStepDuration(nStepDuration),
-      mpStartCallbacks(),
-      mpEndCallbacks()
+      mnStepDuration(nStepDuration)
 {
 }
 
@@ -72,33 +70,6 @@ sal_uInt64 PresenterAnimation::GetStepDuration (void)
     return mnStepDuration;
 }
 
-void PresenterAnimation::AddEndCallback (const Callback& rCallback)
-{
-    if (mpEndCallbacks.get() == NULL)
-        mpEndCallbacks.reset(new ::std::vector<Callback>());
-    mpEndCallbacks->push_back(rCallback);
-}
-
-void PresenterAnimation::RunStartCallbacks (void)
-{
-    if (mpStartCallbacks.get() != NULL)
-    {
-        ::std::vector<Callback>::const_iterator iCallback;
-        for (iCallback=mpStartCallbacks->begin(); iCallback!=mpStartCallbacks->end(); ++iCallback)
-            (*iCallback)();
-    }
-}
-
-void PresenterAnimation::RunEndCallbacks (void)
-{
-    if (mpEndCallbacks.get() != NULL)
-    {
-        ::std::vector<Callback>::const_iterator iCallback;
-        for (iCallback=mpEndCallbacks->begin(); iCallback!=mpEndCallbacks->end(); ++iCallback)
-            (*iCallback)();
-    }
-}
-
 } } // end of namespace ::sdext::presenter
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sdext/source/presenter/PresenterAnimation.hxx b/sdext/source/presenter/PresenterAnimation.hxx
index fdd8de6..8c2ce42 100644
--- a/sdext/source/presenter/PresenterAnimation.hxx
+++ b/sdext/source/presenter/PresenterAnimation.hxx
@@ -83,11 +83,6 @@ public:
 
     typedef ::boost::function<void(void)> Callback;
 
-    /** Add a callback that is executed after Run() is called for the last
-        time.
-    */
-    void AddEndCallback (const Callback& rCallback);
-
     /** Called with nProgress taking on values between 0 and 1.
         @param nProgress
             A value between 0 and 1.
@@ -96,22 +91,10 @@ public:
     */
     virtual void Run (const double nProgress, const sal_uInt64 nCurrentTime) = 0;
 
-    /** Called just before Run() is called for the first time to trigger the
-        callbacks registered via the <method>AddStartCallback()</method>.
-    */
-    void RunStartCallbacks (void);
-
-    /** Called just after Run() is called for the last time to trigger the
-        callbacks registered via the <method>AddEndCallback()</method>.
-    */
-    void RunEndCallbacks (void);
-
 private:
     const sal_uInt64 mnStartTime;
     const sal_uInt64 mnTotalDuration;
     const sal_uInt64 mnStepDuration;
-    ::boost::scoped_ptr<std::vector<Callback> > mpStartCallbacks;
-    ::boost::scoped_ptr<std::vector<Callback> > mpEndCallbacks;
 };
 
 sal_uInt64 GetCurrentTime (void);
diff --git a/sdext/source/presenter/PresenterAnimator.cxx b/sdext/source/presenter/PresenterAnimator.cxx
index 55c9fd5..a401c2a 100644
--- a/sdext/source/presenter/PresenterAnimator.cxx
+++ b/sdext/source/presenter/PresenterAnimator.cxx
@@ -52,14 +52,6 @@ PresenterAnimator::~PresenterAnimator (void)
     PresenterTimer::CancelTask(mnCurrentTaskId);
 }
 
-void PresenterAnimator::AddAnimation (const SharedPresenterAnimation& rpAnimation)
-{
-    ::osl::MutexGuard aGuard (m_aMutex);
-
-    maFutureAnimations.insert(AnimationList::value_type(rpAnimation->GetStartTime(), rpAnimation));
-    ScheduleNextRun();
-}
-
 void PresenterAnimator::Process (void)
 {
     ::osl::MutexGuard aGuard (m_aMutex);
@@ -96,8 +88,6 @@ void PresenterAnimator::Process (void)
                 AnimationList::value_type(
                     nCurrentTime + pAnimation->GetStepDuration(),
                     pAnimation));
-        else
-            pAnimation->RunEndCallbacks();
     }
 
     ScheduleNextRun();
@@ -111,7 +101,6 @@ void PresenterAnimator::ActivateAnimations (const sal_uInt64 nCurrentTime)
         SharedPresenterAnimation pAnimation (maFutureAnimations.begin()->second);
         maActiveAnimations.insert(*maFutureAnimations.begin());
         maFutureAnimations.erase(maFutureAnimations.begin());
-        pAnimation->RunStartCallbacks();
     }
 }
 
diff --git a/sdext/source/presenter/PresenterAnimator.hxx b/sdext/source/presenter/PresenterAnimator.hxx
index 073592b..2ee3522 100644
--- a/sdext/source/presenter/PresenterAnimator.hxx
+++ b/sdext/source/presenter/PresenterAnimator.hxx
@@ -37,8 +37,7 @@
 
 namespace sdext { namespace presenter {
 
-/** Simple animation management.  Call AddAnimation to run animations
-    concurrently or one of the other.  See PresenterAnimation for details of
+/** Simple animation management. See PresenterAnimation for details of
     how to specify animations.
 */
 class PresenterAnimator
@@ -49,11 +48,6 @@ public:
     PresenterAnimator (void);
     virtual ~PresenterAnimator (void);
 
-    /** Add an animation.  The time at which to start and end this animation
-        is provided by the animation itself.
-    */
-    void AddAnimation (const SharedPresenterAnimation& rpAnimation);
-
 private:
     typedef ::std::multimap<sal_uInt64,SharedPresenterAnimation> AnimationList;
     AnimationList maFutureAnimations;
diff --git a/unusedcode.easy b/unusedcode.easy
index 5e63e06..d36f5d1 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -969,9 +969,7 @@ sd::slidesorter::model::VisualState::SetVisualStateBlend(double)
 sd::slidesorter::view::(anonymous namespace)::PageObjectRun::GetInnerBoundingBox(sd::slidesorter::view::Layouter const&, int) const
 sd::slidesorter::view::Button::IsDown() const
 sd::slidesorter::view::FontProvider::GetFont(OutputDevice const&)
-sdext::presenter::PresenterAnimation::AddEndCallback(boost::function<void ()> const&)
 sdext::presenter::PresenterAnimation::PresenterAnimation(unsigned long, unsigned long, unsigned long)
-sdext::presenter::PresenterAnimator::AddAnimation(boost::shared_ptr<sdext::presenter::PresenterAnimation> const&)
 sdext::presenter::PresenterController::GetAnimator() const
 sdext::presenter::PresenterGeometryHelper::Union(com::sun::star::awt::Rectangle const&, com::sun::star::awt::Rectangle const&)
 sdext::presenter::PresenterHorizontalScrollBar::PresenterHorizontalScrollBar(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, com::sun::star::uno::Reference<com::sun::star::awt::XWindow> const&, boost::shared_ptr<sdext::presenter::PresenterPaintManager> const&, boost::function<void (double)> const&)
@@ -980,8 +978,6 @@ sdext::presenter::PresenterSprite::GetSize() const
 sdext::presenter::PresenterSprite::SetAlpha(double)
 sdext::presenter::PresenterSprite::Transform(com::sun::star::geometry::AffineMatrix2D const&)
 sdext::presenter::PresenterSpritePane::ShowTransparentBorder()
-sdext::presenter::PresenterWindowManager::GetParentCanvas() const
-sdext::presenter::PresenterWindowManager::GetParentWindow() const
 sdr::animation::Scheduler::Reset(unsigned int)
 sdr::contact::ViewContactOfPageObj::GetReferencedPage() const
 sdr::contact::ViewContactOfSdrMediaObj::hasPreferredSize() const
-- 
1.7.4.1


--------------050804070200080805000902--


More information about the LibreOffice mailing list