From c89365eb0e58e00e0a8756ba4ac2977a5aaea25a Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Sat, 17 Sep 2011 21:42:40 +0000 Subject: slidesorter1: #i114186# Applied patches that fix double-to-int conversions. # HG changeset patch # User Andre Fischer # Date 1287062183 -7200 # Node ID 23dcb2ba5fbd8ae4026f6bb71d89038f75017aeb # Parent 805df2d00c12631fe697e8737a91199bf5f54ee3 --- sd/source/ui/slidesorter/controller/SlsAnimationFunction.cxx | 2 +- sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx | 2 +- sd/source/ui/slidesorter/view/SlsButtonBar.cxx | 12 ++++++++---- 3 files changed, 10 insertions(+), 6 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/slidesorter/controller/SlsAnimationFunction.cxx b/sd/source/ui/slidesorter/controller/SlsAnimationFunction.cxx index 71b6c024ae7a..0acaff6833a2 100644 --- a/sd/source/ui/slidesorter/controller/SlsAnimationFunction.cxx +++ b/sd/source/ui/slidesorter/controller/SlsAnimationFunction.cxx @@ -276,7 +276,7 @@ AnimationParametricFunction::AnimationParametricFunction (const ParametricFuncti double AnimationParametricFunction::operator() (const double nX) { - const sal_Int32 nIndex0 (nX * maY.size()); + const sal_Int32 nIndex0 (static_cast(nX * maY.size())); const double nX0 (nIndex0 / double(maY.size()-1)); const sal_uInt32 nIndex1 (nIndex0 + 1); const double nX1 (nIndex1 / double(maY.size()-1)); diff --git a/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx b/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx index e411dc76d6ba..da52cad76275 100644 --- a/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx @@ -185,7 +185,7 @@ void ScrollBarManager::PlaceHorizontalScrollBar (const Rectangle& aAvailableArea void ScrollBarManager::PlaceVerticalScrollBar (const Rectangle& aArea) { - const double nThumbPosition (mpVerticalScrollBar->GetThumbPos()); + const sal_Int32 nThumbPosition (mpVerticalScrollBar->GetThumbPos()); // Place the scroll bar. Size aScrollBarSize (mpVerticalScrollBar->GetSizePixel()); diff --git a/sd/source/ui/slidesorter/view/SlsButtonBar.cxx b/sd/source/ui/slidesorter/view/SlsButtonBar.cxx index dee80e5ed5d8..ff680f932be7 100644 --- a/sd/source/ui/slidesorter/view/SlsButtonBar.cxx +++ b/sd/source/ui/slidesorter/view/SlsButtonBar.cxx @@ -51,6 +51,7 @@ #include #include #include +#include #include #include @@ -157,8 +158,11 @@ namespace { for (sal_Int32 nX = 0; nXGetPixel(nY, nX).GetBlueOrIndex()); - const sal_uInt8 nNewValue (nValue * (1-nAlpha)); - pBitmap->SetPixel(nY, nX, 255-nNewValue); + const sal_Int32 nNewValue (::basegfx::clamp( + static_cast(nValue * (1-nAlpha)), + 0, + 255)); + pBitmap->SetPixel(nY, nX, 255-sal_uInt8(nNewValue)); } } } @@ -742,12 +746,12 @@ void ButtonBar::StartFadeAnimation ( // all so that we do not leave a trail of half-visible buttons when the // mouse is moved across the screen. No delay on fade out or when the // buttons are already showing. Fade out is faster than fade in. - const double nDelay (nCurrentButtonBarAlpha>0 && nCurrentButtonBarAlpha<1 + const sal_Int32 nDelay (nCurrentButtonBarAlpha>0 && nCurrentButtonBarAlpha<1 ? 0 : (mrSlideSorter.GetTheme()->GetIntegerValue(bFadeIn ? Theme::Integer_ButtonFadeInDelay : Theme::Integer_ButtonFadeOutDelay))); - const double nDuration (mrSlideSorter.GetTheme()->GetIntegerValue(bFadeIn + const sal_Int32 nDuration (mrSlideSorter.GetTheme()->GetIntegerValue(bFadeIn ? Theme::Integer_ButtonFadeInDuration : Theme::Integer_ButtonFadeOutDuration)); pDescriptor->GetVisualState().SetButtonAlphaAnimationId( -- cgit