diff --git a/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx b/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx index 4e079b48cc1a..773cad161093 100644 --- a/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx +++ b/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx @@ -328,7 +328,6 @@ void PageCacheManager::ReleaseCache (const ::boost::shared_ptr& rpCache) mpPageCaches->begin(), mpPageCaches->end(), PageCacheContainer::CompareWithCache(rpCache))); - OSL_ASSERT(iCacheToChange != mpPageCaches->end()); if (iCacheToChange != mpPageCaches->end()) { OSL_ASSERT(iCacheToChange->second == rpCache); @@ -345,6 +344,10 @@ void PageCacheManager::ReleaseCache (const ::boost::shared_ptr& rpCache) pResult = rpCache; } + else + { + OSL_ASSERT(iCacheToChange != mpPageCaches->end()); + } } return pResult; diff --git a/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx b/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx index 4abdfdc328b1..997aa17ebf6c 100644 --- a/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx +++ b/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx @@ -199,7 +199,6 @@ public: void SetPageUnderMouse (const model::SharedPageDescriptor& rpDescriptor); void SetButtonUnderMouse (const sal_Int32 nButtonIndex); - void AddVisualStateAnimation (const model::SharedPageDescriptor& rpDescriptor); bool SetState ( const model::SharedPageDescriptor& rpDescriptor, const model::PageDescriptor::State eState, diff --git a/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx b/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx index 36a7dde48eae..c73d0f5b7f24 100644 --- a/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx +++ b/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx @@ -97,7 +97,7 @@ private: void PrepareBackgrounds (OutputDevice& rDevice); Bitmap CreateBackgroundBitmap( const OutputDevice& rReferenceDevice, - const Theme::ColorType eType) const; + const Theme::GradientColorType eType) const; }; } } } // end of namespace sd::slidesorter::view diff --git a/sd/source/ui/slidesorter/inc/view/SlsTheme.hxx b/sd/source/ui/slidesorter/inc/view/SlsTheme.hxx index 6eed762a0c44..c8bdfd6e9882 100644 --- a/sd/source/ui/slidesorter/inc/view/SlsTheme.hxx +++ b/sd/source/ui/slidesorter/inc/view/SlsTheme.hxx @@ -76,15 +76,27 @@ public: ButtonBackground, MouseOverColor, PageNumberBorder, - Selection, + Selection + }; + ColorData GetColor (const ColorType eType); + + enum GradientColorType { NormalPage, SelectedPage, MouseOverPage }; - enum ColorClass { Border1, Border2, Fill1, Fill2, Other }; - ColorData GetColor (const ColorType eType, const ColorClass eClass = Other); + enum GradientColorClass { + Border1, + Border2, + Fill1, + Fill2 + }; + ColorData GetGradientColor ( + const GradientColorType eType, + const GradientColorClass eClass); - enum IconType { + enum IconType + { InsertionIndicator, RawShadow }; diff --git a/sd/source/ui/slidesorter/view/SlideSorterView.cxx b/sd/source/ui/slidesorter/view/SlideSorterView.cxx index ec3a83202e56..488defdfc0ce 100644 --- a/sd/source/ui/slidesorter/view/SlideSorterView.cxx +++ b/sd/source/ui/slidesorter/view/SlideSorterView.cxx @@ -38,7 +38,6 @@ #include "ViewShell.hxx" #include "SlsViewCacheContext.hxx" #include "SlsLayeredDevice.hxx" -#include "SlsSelectionPainter.hxx" #include "view/SlsLayouter.hxx" #include "view/SlsPageObjectLayouter.hxx" #include "view/SlsPageObjectPainter.hxx" @@ -975,32 +974,6 @@ void SlideSorterView::SetButtonUnderMouse (const sal_Int32 nButtonIndex) -void SlideSorterView::AddVisualStateAnimation (const model::SharedPageDescriptor& rpDescriptor) -{ - // Stop a state animation for the given descriptor that is still running. - const Animator::AnimationId nId (rpDescriptor->GetVisualState().GetStateAnimationId()); - if (nId != Animator::NotAnAnimationId) - { - mrSlideSorter.GetController().GetAnimator()->RemoveAnimation(nId); - } - - rpDescriptor->GetVisualState().SetStateAnimationId( - mrSlideSorter.GetController().GetAnimator()->AddAnimation( - ::boost::bind( - controller::AnimationFunction::ApplyVisualStateChange, - rpDescriptor, - ::boost::ref(*this), - ::boost::bind(AnimationFunction::FastInSlowOut_Sine, _1)), - 350, - ::boost::bind( - &VisualState::SetStateAnimationId, - ::boost::ref(rpDescriptor->GetVisualState()), - controller::Animator::NotAnAnimationId))); -} - - - - bool SlideSorterView::SetState ( const model::SharedPageDescriptor& rpDescriptor, const PageDescriptor::State eState, @@ -1013,15 +986,12 @@ bool SlideSorterView::SetState ( switch(eState) { case PageDescriptor::ST_Visible: - RequestRepaint(rpDescriptor); - break; - case PageDescriptor::ST_Selected: case PageDescriptor::ST_Focused: case PageDescriptor::ST_MouseOver: case PageDescriptor::ST_Current: case PageDescriptor::ST_Excluded: - AddVisualStateAnimation(rpDescriptor); + RequestRepaint(rpDescriptor); break; case PageDescriptor::ST_WasSelected: diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx index 41a9400c374c..ac605ecdbd5f 100644 --- a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx +++ b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx @@ -527,17 +527,12 @@ void PageObjectPainter::PrepareBackgrounds (OutputDevice& rDevice) Bitmap PageObjectPainter::CreateBackgroundBitmap( const OutputDevice& rReferenceDevice, - const Theme::ColorType eColorType) const + const Theme::GradientColorType eColorType) const { - ::canvas::tools::ElapsedTime aTimer; - const double nStartTime (aTimer.getElapsedTime()); - const Size aSize (mpPageObjectLayouter->GetPageObjectSize()); VirtualDevice aBitmapDevice (rReferenceDevice); aBitmapDevice.SetOutputSizePixel(aSize); - OSL_TRACE("created bitmap after %fms",(aTimer.getElapsedTime() - nStartTime)*1000); - // Paint the background with a linear gradient that starts some pixels // below the top and ends some pixels above the bottom. #if 1 @@ -551,8 +546,8 @@ Bitmap PageObjectPainter::CreateBackgroundBitmap( nDefaultConstantSize, (nHeight - nMinimalGradientSize)/2))); const sal_Int32 nY2 (nHeight-nY1); - const Color aTopColor(mpTheme->GetColor(eColorType, Theme::Fill1)); - const Color aBottomColor(mpTheme->GetColor(eColorType, Theme::Fill2)); + const Color aTopColor(mpTheme->GetGradientColor(eColorType, Theme::Fill1)); + const Color aBottomColor(mpTheme->GetGradientColor(eColorType, Theme::Fill2)); for (sal_Int32 nY=0; nYGetColor(eColorType, Theme::Border2)); + aBitmapDevice.SetLineColor(mpTheme->GetGradientColor(eColorType, Theme::Border2)); aBitmapDevice.DrawRect(Rectangle(Point(0,0),aSize)); - aBitmapDevice.SetLineColor(mpTheme->GetColor(eColorType, Theme::Border1)); + aBitmapDevice.SetLineColor(mpTheme->GetGradientColor(eColorType, Theme::Border1)); aBitmapDevice.DrawLine(Point(0,0),Point(aSize.Width()-1,0)); - OSL_TRACE("painted border after %fms",(aTimer.getElapsedTime() - nStartTime)*1000); - // Get bounding box of the preview around which a shadow is painted. // Compensate for the border around the preview. Rectangle aBox (mpPageObjectLayouter->GetBoundingBox( @@ -600,8 +591,6 @@ Bitmap PageObjectPainter::CreateBackgroundBitmap( aBox.Bottom() += 1; mpShadowPainter->PaintFrame(aBitmapDevice, aBox); - OSL_TRACE("painted shadow border after %fms",(aTimer.getElapsedTime() - nStartTime)*1000); - return aBitmapDevice.GetBitmap (Point(0,0),aSize); } diff --git a/sd/source/ui/slidesorter/view/SlsTheme.cxx b/sd/source/ui/slidesorter/view/SlsTheme.cxx index c866a3bc6014..3c43c8917e70 100644 --- a/sd/source/ui/slidesorter/view/SlsTheme.cxx +++ b/sd/source/ui/slidesorter/view/SlsTheme.cxx @@ -150,9 +150,7 @@ ColorData Theme::GetColorForVisualState (const model::VisualState::State eState) -ColorData Theme::GetColor ( - const ColorType eType, - const ColorClass eClass) +ColorData Theme::GetColor (const ColorType eType) { switch(eType) { @@ -170,7 +168,19 @@ ColorData Theme::GetColor ( case Selection: return StellaBlue; + } + return 0; +} + + + +ColorData Theme::GetGradientColor ( + const GradientColorType eType, + const GradientColorClass eClass) +{ + switch(eType) + { case NormalPage: switch (eClass) { diff --git a/sd/source/ui/slidesorter/view/makefile.mk b/sd/source/ui/slidesorter/view/makefile.mk index 50988f783531..d7837b1f3189 100644 --- a/sd/source/ui/slidesorter/view/makefile.mk +++ b/sd/source/ui/slidesorter/view/makefile.mk @@ -60,7 +60,6 @@ SLOFILES = \ $(SLO)$/SlsLayouter.obj \ $(SLO)$/SlsPageObjectLayouter.obj \ $(SLO)$/SlsPageObjectPainter.obj \ - $(SLO)$/SlsSelectionPainter.obj \ $(SLO)$/SlsTheme.obj \ $(SLO)$/SlsViewCacheContext.obj \ $(SLO)$/SlsViewOverlay.obj