incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r1172128 - in /incubator/ooo/trunk/main/sd/source/ui/slidesorter: controller/SlsAnimationFunction.cxx controller/SlsScrollBarManager.cxx view/SlsButtonBar.cxx
Date Sat, 17 Sep 2011 22:42:41 GMT
Author: mst
Date: Sat Sep 17 22:42:40 2011
New Revision: 1172128

URL: http://svn.apache.org/viewvc?rev=1172128&view=rev
Log:
slidesorter1: #i114186# Applied patches that fix double-to-int conversions.

# HG changeset patch
# User Andre Fischer<andre.f.fischer@oracle.com>
# Date 1287062183 -7200
# Node ID 23dcb2ba5fbd8ae4026f6bb71d89038f75017aeb
# Parent  805df2d00c12631fe697e8737a91199bf5f54ee3

Modified:
    incubator/ooo/trunk/main/sd/source/ui/slidesorter/controller/SlsAnimationFunction.cxx
    incubator/ooo/trunk/main/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx
    incubator/ooo/trunk/main/sd/source/ui/slidesorter/view/SlsButtonBar.cxx

Modified: incubator/ooo/trunk/main/sd/source/ui/slidesorter/controller/SlsAnimationFunction.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sd/source/ui/slidesorter/controller/SlsAnimationFunction.cxx?rev=1172128&r1=1172127&r2=1172128&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sd/source/ui/slidesorter/controller/SlsAnimationFunction.cxx
(original)
+++ incubator/ooo/trunk/main/sd/source/ui/slidesorter/controller/SlsAnimationFunction.cxx
Sat Sep 17 22:42:40 2011
@@ -276,7 +276,7 @@ AnimationParametricFunction::AnimationPa
 
 double AnimationParametricFunction::operator() (const double nX)
 {
-    const sal_Int32 nIndex0 (nX * maY.size());
+    const sal_Int32 nIndex0 (static_cast<sal_Int32>(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));

Modified: incubator/ooo/trunk/main/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx?rev=1172128&r1=1172127&r2=1172128&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx (original)
+++ incubator/ooo/trunk/main/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx Sat
Sep 17 22:42:40 2011
@@ -185,7 +185,7 @@ void ScrollBarManager::PlaceHorizontalSc
    
 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());

Modified: incubator/ooo/trunk/main/sd/source/ui/slidesorter/view/SlsButtonBar.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sd/source/ui/slidesorter/view/SlsButtonBar.cxx?rev=1172128&r1=1172127&r2=1172128&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sd/source/ui/slidesorter/view/SlsButtonBar.cxx (original)
+++ incubator/ooo/trunk/main/sd/source/ui/slidesorter/view/SlsButtonBar.cxx Sat Sep 17 22:42:40
2011
@@ -51,6 +51,7 @@
 #include <vcl/virdev.hxx>
 #include <basegfx/polygon/b2dpolygontools.hxx>
 #include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/numeric/ftools.hxx>
 #include <com/sun/star/presentation/XPresentation2.hpp>
 #include <boost/bind.hpp>
 
@@ -157,8 +158,11 @@ namespace {
                 for (sal_Int32 nX = 0; nX<nWidth; ++nX)
                 {
                     const sal_uInt8 nValue (255 - pSourceBitmap->GetPixel(nY, nX).GetBlueOrIndex());
-                    const sal_uInt8 nNewValue (nValue * (1-nAlpha));
-                    pBitmap->SetPixel(nY, nX, 255-nNewValue);
+                    const sal_Int32 nNewValue (::basegfx::clamp<sal_Int32>(
+                            static_cast<sal_Int32>(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(



Mime
View raw message