[Libreoffice-commits] core.git: include/svx include/vcl sd/source svx/inc svx/source sw/source vcl/source vcl/unx vcl/win

Stephan Bergmann sbergman at redhat.com
Tue Apr 7 06:48:59 PDT 2015


 include/svx/sdr/overlay/overlayanimatedbitmapex.hxx |    2 +-
 include/svx/sdr/overlay/overlayobject.hxx           |    2 +-
 include/vcl/settings.hxx                            |    6 +++---
 sd/source/ui/annotations/annotationtag.cxx          |    2 +-
 svx/inc/sdr/overlay/overlayrectangle.hxx            |    2 +-
 svx/source/sdr/overlay/overlayanimatedbitmapex.cxx  |    7 ++-----
 svx/source/sdr/overlay/overlayobject.cxx            |    2 +-
 svx/source/sdr/overlay/overlayrectangle.cxx         |    7 ++-----
 svx/source/svdraw/svdhdl.cxx                        |    4 ++--
 sw/source/core/crsr/crsrsh.cxx                      |    9 ++++-----
 vcl/source/app/settings.cxx                         |    6 +++---
 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx            |    2 +-
 vcl/win/source/window/salframe.cxx                  |    5 ++++-
 13 files changed, 26 insertions(+), 30 deletions(-)

New commits:
commit 71fefe1dc2bcda3a4cc18d71e1acaf161cc059f2
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Apr 7 15:42:59 2015 +0200

    Change "blink times" to be of type sal_uInt64
    
    ...and thus consistent with Timer::Get/SetTimeout since
    9c7016b5b530ca212b1275f44f9e2fc0527109ee "Scheduler: Changed uLong to
    uInt32/uInt64."  Otherwise, at least JunitTest_forms_unoapi on 32-bit Linux
    would stay busy forever in vcl::Cursor::ImplTimerHdl, alternating among
    ImplRestore() and ImplDraw().
    
    Change-Id: Ic3fd349344c105078b52749ca85559fce485d0c4

diff --git a/include/svx/sdr/overlay/overlayanimatedbitmapex.hxx b/include/svx/sdr/overlay/overlayanimatedbitmapex.hxx
index b14f01b..ccd768f 100644
--- a/include/svx/sdr/overlay/overlayanimatedbitmapex.hxx
+++ b/include/svx/sdr/overlay/overlayanimatedbitmapex.hxx
@@ -61,7 +61,7 @@ namespace sdr
                 const basegfx::B2DPoint& rBasePos,
                 const BitmapEx& rBitmapEx1,
                 const BitmapEx& rBitmapEx2,
-                sal_uInt32 nBlinkTime = 500,
+                sal_uInt64 nBlinkTime = 500,
                 sal_uInt16 nCenX1 = 0,
                 sal_uInt16 nCenY1 = 0,
                 sal_uInt16 nCenX2 = 0,
diff --git a/include/svx/sdr/overlay/overlayobject.hxx b/include/svx/sdr/overlay/overlayobject.hxx
index b663ec5..7e97abc 100644
--- a/include/svx/sdr/overlay/overlayobject.hxx
+++ b/include/svx/sdr/overlay/overlayobject.hxx
@@ -86,7 +86,7 @@ namespace sdr
             virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
 
             // #i53216# check blink time value range (currently 25 < mnBlinkTime < 10000)
-            sal_uInt32 impCheckBlinkTimeValueRange(sal_uInt32 nBlinkTime) const;
+            sal_uInt32 impCheckBlinkTimeValueRange(sal_uInt64 nBlinkTime) const;
 
             // region in logical coordinates
             basegfx::B2DRange                               maBaseRange;
diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx
index d2313c5..1b41ed2 100644
--- a/include/vcl/settings.hxx
+++ b/include/vcl/settings.hxx
@@ -194,7 +194,7 @@ struct FrameStyle
 #define STYLE_TOOLBAR_ICONSIZE_SMALL        ((sal_uLong)1)
 #define STYLE_TOOLBAR_ICONSIZE_LARGE        ((sal_uLong)2)
 
-#define STYLE_CURSOR_NOBLINKTIME    ((sal_uLong)0xFFFFFFFF)
+#define STYLE_CURSOR_NOBLINKTIME    SAL_MAX_UINT64
 
 class VCL_DLLPUBLIC StyleSettings
 {
@@ -450,8 +450,8 @@ public:
     void                            SetCursorSize( long nSize );
     long                            GetCursorSize() const;
 
-    void                            SetCursorBlinkTime( long nBlinkTime );
-    long                            GetCursorBlinkTime() const;
+    void                            SetCursorBlinkTime( sal_uInt64 nBlinkTime );
+    sal_uInt64                      GetCursorBlinkTime() const;
 
     void                            SetScreenZoom( sal_uInt16 nPercent );
     sal_uInt16                      GetScreenZoom() const;
diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx
index 09480da..610ed61 100644
--- a/sd/source/ui/annotations/annotationtag.cxx
+++ b/sd/source/ui/annotations/annotationtag.cxx
@@ -219,7 +219,7 @@ void AnnotationHdl::CreateB2dIAObject()
                             // animate focused handles
                             if(bFocused)
                             {
-                                const sal_uInt32 nBlinkTime = sal::static_int_cast<sal_uInt32>(rStyleSettings.GetCursorBlinkTime());
+                                const sal_uInt64 nBlinkTime = rStyleSettings.GetCursorBlinkTime();
 
                                 pOverlayObject = new ::sdr::overlay::OverlayAnimatedBitmapEx(aPosition, aBitmapEx, aBitmapEx2, nBlinkTime, 0, 0, 0, 0 );
                             }
diff --git a/svx/inc/sdr/overlay/overlayrectangle.hxx b/svx/inc/sdr/overlay/overlayrectangle.hxx
index 8879fdf..8be8a36 100644
--- a/svx/inc/sdr/overlay/overlayrectangle.hxx
+++ b/svx/inc/sdr/overlay/overlayrectangle.hxx
@@ -56,7 +56,7 @@ namespace sdr
                 double fDiscreteGrow,
                 double fDiscreteShrink,
                 double fRotation,
-                sal_uInt32 nBlinkTime,
+                sal_uInt64 nBlinkTime,
                 bool bAnimate);
 
             // data read access
diff --git a/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx b/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx
index ea717f4..bc26abe 100644
--- a/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx
+++ b/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx
@@ -63,7 +63,7 @@ namespace sdr
             const basegfx::B2DPoint& rBasePos,
             const BitmapEx& rBitmapEx1,
             const BitmapEx& rBitmapEx2,
-            sal_uInt32 nBlinkTime,
+            sal_uInt64 nBlinkTime,
             sal_uInt16 nCenX1,
             sal_uInt16 nCenY1,
             sal_uInt16 nCenX2,
@@ -75,16 +75,13 @@ namespace sdr
             maBitmapEx2(rBitmapEx2),
             mnCenterX1(nCenX1), mnCenterY1(nCenY1),
             mnCenterX2(nCenX2), mnCenterY2(nCenY2),
-            mnBlinkTime(nBlinkTime),
+            mnBlinkTime(impCheckBlinkTimeValueRange(nBlinkTime)),
             mfShearX(fShearX),
             mfRotation(fRotation),
             mbOverlayState(false)
         {
             // set AllowsAnimation flag to mark this object as animation capable
             mbAllowsAnimation = true;
-
-            // #i53216# check blink time value range
-            mnBlinkTime = impCheckBlinkTimeValueRange(mnBlinkTime);
         }
 
         OverlayAnimatedBitmapEx::~OverlayAnimatedBitmapEx()
diff --git a/svx/source/sdr/overlay/overlayobject.cxx b/svx/source/sdr/overlay/overlayobject.cxx
index 8a5c53c..1a8eeb0 100644
--- a/svx/source/sdr/overlay/overlayobject.cxx
+++ b/svx/source/sdr/overlay/overlayobject.cxx
@@ -63,7 +63,7 @@ namespace sdr
             return drawinglayer::primitive2d::Primitive2DSequence();
         }
 
-        sal_uInt32 OverlayObject::impCheckBlinkTimeValueRange(sal_uInt32 nBlinkTime) const
+        sal_uInt32 OverlayObject::impCheckBlinkTimeValueRange(sal_uInt64 nBlinkTime) const
         {
             if(nBlinkTime < 25)
             {
diff --git a/svx/source/sdr/overlay/overlayrectangle.cxx b/svx/source/sdr/overlay/overlayrectangle.cxx
index 0f1f6b6..92932f5 100644
--- a/svx/source/sdr/overlay/overlayrectangle.cxx
+++ b/svx/source/sdr/overlay/overlayrectangle.cxx
@@ -71,7 +71,7 @@ namespace sdr
             double fDiscreteGrow,
             double fDiscreteShrink,
             double fRotation,
-            sal_uInt32 nBlinkTime,
+            sal_uInt64 nBlinkTime,
             bool bAnimate)
         :   OverlayObjectWithBasePosition(rBasePosition, rHatchColor),
             maSecondPosition(rSecondPosition),
@@ -79,7 +79,7 @@ namespace sdr
             mfDiscreteGrow(fDiscreteGrow),
             mfDiscreteShrink(fDiscreteShrink),
             mfRotation(fRotation),
-            mnBlinkTime(nBlinkTime),
+            mnBlinkTime(impCheckBlinkTimeValueRange(nBlinkTime)),
             mbOverlayState(false)
         {
             if(Application::GetSettings().GetStyleSettings().GetHighContrastMode())
@@ -90,9 +90,6 @@ namespace sdr
 
             // set AllowsAnimation flag to mark this object as animation capable
             mbAllowsAnimation = bAnimate;
-
-            // #i53216# check blink time value range
-            mnBlinkTime = impCheckBlinkTimeValueRange(mnBlinkTime);
         }
 
         void OverlayRectangle::Trigger(sal_uInt32 nTime)
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index eb26d56..d6248ff 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -759,7 +759,7 @@ BitmapEx SdrHdl::ImpGetBitmapEx( BitmapMarkerKind eKindOfMarker, sal_uInt16 nInd
 
         // #i53216# Use system cursor blink time. Use the unsigned value.
         const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
-        const sal_uInt32 nBlinkTime((sal_uInt32)rStyleSettings.GetCursorBlinkTime());
+        const sal_uInt64 nBlinkTime(rStyleSettings.GetCursorBlinkTime());
 
         if(eKindOfMarker == Anchor || eKindOfMarker == AnchorPressed)
         {
@@ -2339,7 +2339,7 @@ void SdrCropHdl::CreateB2dIAObject()
 
                         BitmapEx aBmpEx2( GetBitmapForHandle( aHandlesBitmap, nHdlSize + 1 ) );
 
-                        const sal_uInt32 nBlinkTime = sal::static_int_cast<sal_uInt32>(rStyleSettings.GetCursorBlinkTime());
+                        const sal_uInt64 nBlinkTime = rStyleSettings.GetCursorBlinkTime();
 
                         pOverlayObject = new ::sdr::overlay::OverlayAnimatedBitmapEx(
                             aPosition,
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 1d19e11..ca9266d 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1832,19 +1832,18 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, bool bIdleEnd )
         Imp()->InvalidateAccessibleCursorPosition( pFrm );
 
     // switch from blinking cursor to read-only-text-selection cursor
-    static const long nNoBlinkTime = STYLE_CURSOR_NOBLINKTIME;
-    const long nBlinkTime = GetOut()->GetSettings().GetStyleSettings().
+    const sal_uInt64 nBlinkTime = GetOut()->GetSettings().GetStyleSettings().
                             GetCursorBlinkTime();
 
     if ( (IsCrsrReadonly() && GetViewOptions()->IsSelectionInReadonly()) ==
-        ( nBlinkTime != nNoBlinkTime ) )
+        ( nBlinkTime != STYLE_CURSOR_NOBLINKTIME ) )
     {
         // non blinking cursor in read only - text selection mode
         AllSettings aSettings = GetOut()->GetSettings();
         StyleSettings aStyleSettings = aSettings.GetStyleSettings();
-        const long nNewBlinkTime = nBlinkTime == nNoBlinkTime ?
+        const sal_uInt64 nNewBlinkTime = nBlinkTime == STYLE_CURSOR_NOBLINKTIME ?
                                    Application::GetSettings().GetStyleSettings().GetCursorBlinkTime() :
-                                   nNoBlinkTime;
+                                   STYLE_CURSOR_NOBLINKTIME;
         aStyleSettings.SetCursorBlinkTime( nNewBlinkTime );
         aSettings.SetStyleSettings( aStyleSettings );
         GetOut()->SetSettings( aSettings );
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 7d625df..76d06be 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -156,7 +156,7 @@ struct ImplStyleData
     long                            mnSpinSize;
     long                            mnCursorSize;
     long                            mnAntialiasedMin;
-    sal_uLong                       mnCursorBlinkTime;
+    sal_uInt64                      mnCursorBlinkTime;
     sal_uLong                       mnDragFullOptions;
     sal_uLong                       mnSelectionOptions;
     sal_uLong                       mnDisplayOptions;
@@ -1758,13 +1758,13 @@ StyleSettings::GetCursorSize() const
 }
 
 void
-StyleSettings::SetCursorBlinkTime( long nBlinkTime )
+StyleSettings::SetCursorBlinkTime( sal_uInt64 nBlinkTime )
 {
     CopyData();
     mxData->mnCursorBlinkTime = nBlinkTime;
 }
 
-long
+sal_uInt64
 StyleSettings::GetCursorBlinkTime() const
 {
     return (long) mxData->mnCursorBlinkTime;
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 32a3de5..c7acbbc 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -4146,7 +4146,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
     g_object_get( pSettings, "gtk-cursor-blink", &blink, (char *)NULL );
     if( blink )
     {
-        gint blink_time = STYLE_CURSOR_NOBLINKTIME;
+        gint blink_time = static_cast<gint>(STYLE_CURSOR_NOBLINKTIME);
         g_object_get( pSettings, "gtk-cursor-blink-time", &blink_time, (char *)NULL );
         // set the blink_time if there is a setting and it is reasonable
         // else leave the default value
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index 47a7205..e9da734 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -2657,7 +2657,10 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
 
     aStyleSettings.SetScrollBarSize( GetSystemMetrics( SM_CXVSCROLL ) );
     aStyleSettings.SetSpinSize( GetSystemMetrics( SM_CXVSCROLL ) );
-    aStyleSettings.SetCursorBlinkTime( GetCaretBlinkTime() );
+    UINT blinkTime = GetCaretBlinkTime();
+    aStyleSettings.SetCursorBlinkTime(
+        blinkTime == 0 || blinkTime == INFINITE // 0 indicates error
+        ? STYLE_CURSOR_NOBLINKTIME : blinkTime );
     aStyleSettings.SetFloatTitleHeight( GetSystemMetrics( SM_CYSMCAPTION ) );
     aStyleSettings.SetTitleHeight( GetSystemMetrics( SM_CYCAPTION ) );
     aStyleSettings.SetActiveBorderColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVEBORDER ) ) );


More information about the Libreoffice-commits mailing list