merge the formfield patch from ooo-build
[ooovba.git] / applied_patches / 0208-scroll-accel-vcl.diff
blobb58f462ce98e3d74c6e6b634007fb2cc15906111
1 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/inc/vcl/seleng.hxx vcl/inc/vcl/seleng.hxx
2 --- vcl.clean/inc/vcl/seleng.hxx 2008-04-01 19:28:32.000000000 -0400
3 +++ vcl/inc/vcl/seleng.hxx 2008-04-03 17:57:26.000000000 -0400
4 @@ -41,6 +41,8 @@ class CommandEvent;
5 // Timerticks
6 #define SELENG_DRAGDROP_TIMEOUT 400
7 #define SELENG_AUTOREPEAT_INTERVAL 50
8 +#define SELENG_AUTOREPEAT_INTERVAL_MIN 25
9 +#define SELENG_AUTOREPEAT_INTERVAL_MAX 300
11 enum SelectionMode { NO_SELECTION, SINGLE_SELECTION, RANGE_SELECTION, MULTIPLE_SELECTION };
13 @@ -103,6 +104,7 @@ private:
14 Timer aWTimer; // erzeugt kuenstliche Mouse-Moves
15 MouseEvent aLastMove;
16 SelectionMode eSelMode;
17 + ULONG nUpdateInterval;
18 // Stufigkeit fuer Mausbewegungen waehrend einer Selektion
19 USHORT nMouseSensitivity;
20 USHORT nLockedMods;
21 @@ -116,7 +118,8 @@ private:
22 public:
24 SelectionEngine( Window* pWindow,
25 - FunctionSet* pFunctions = NULL );
26 + FunctionSet* pFunctions = NULL,
27 + ULONG nAutoRepeatInterval = SELENG_AUTOREPEAT_INTERVAL );
28 ~SelectionEngine();
30 // TRUE: Event wurde von Selection-Engine verarbeitet.
31 @@ -175,6 +178,8 @@ public:
32 BOOL HasAnchor() const;
33 void SetAnchor( BOOL bAnchor );
35 + void SetUpdateInterval( ULONG nInterval );
37 // wird im Ctor eingeschaltet
38 void ExpandSelectionOnMouseMove( BOOL bExpand = TRUE )
40 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/source/window/seleng.cxx vcl/source/window/seleng.cxx
41 --- vcl.clean/source/window/seleng.cxx 2008-04-01 19:28:36.000000000 -0400
42 +++ vcl/source/window/seleng.cxx 2008-04-03 18:24:56.000000000 -0400
43 @@ -63,8 +63,10 @@ inline BOOL SelectionEngine::ShouldDesel
45 *************************************************************************/
47 -SelectionEngine::SelectionEngine( Window* pWindow, FunctionSet* pFuncSet ) :
48 - pWin( pWindow )
49 +SelectionEngine::SelectionEngine( Window* pWindow, FunctionSet* pFuncSet,
50 + ULONG nAutoRepeatInterval ) :
51 + pWin( pWindow ),
52 + nUpdateInterval( nAutoRepeatInterval )
54 eSelMode = SINGLE_SELECTION;
55 pFunctionSet = pFuncSet;
56 @@ -72,7 +74,7 @@ SelectionEngine::SelectionEngine( Window
57 nLockedMods = 0;
59 aWTimer.SetTimeoutHdl( LINK( this, SelectionEngine, ImpWatchDog ) );
60 - aWTimer.SetTimeout( SELENG_AUTOREPEAT_INTERVAL );
61 + aWTimer.SetTimeout( nUpdateInterval );
64 /*************************************************************************
65 @@ -397,7 +399,7 @@ BOOL SelectionEngine::SelMouseMove( cons
66 if( aWTimer.IsActive() && !aArea.IsInside( rMEvt.GetPosPixel() ))
67 return TRUE;
70 + aWTimer.SetTimeout( nUpdateInterval );
71 aWTimer.Start();
72 if ( eSelMode != SINGLE_SELECTION )
74 @@ -488,3 +490,27 @@ void SelectionEngine::Command( const CommandEvent& rCEvt )
75 nFlags &= ~SELENG_CMDEVT;
79 +void SelectionEngine::SetUpdateInterval( ULONG nInterval )
81 + if (nInterval < SELENG_AUTOREPEAT_INTERVAL_MIN)
82 + // Set a lower threshold. On Windows, setting this value too low
83 + // would cause selection to get updated indefinitely.
84 + nInterval = SELENG_AUTOREPEAT_INTERVAL_MIN;
86 + if (nUpdateInterval == nInterval)
87 + // no update needed.
88 + return;
90 + if (aWTimer.IsActive())
91 + {
92 + // reset the timer right away on interval change.
93 + aWTimer.Stop();
94 + aWTimer.SetTimeout(nInterval);
95 + aWTimer.Start();
96 + }
97 + else
98 + aWTimer.SetTimeout(nInterval);
100 + nUpdateInterval = nInterval;