[Libreoffice-commits] .: patches/dev300

Kohei Yoshida kohei at kemper.freedesktop.org
Mon Dec 20 22:11:56 PST 2010


 patches/dev300/apply                 |    4 
 patches/dev300/scroll-accel-sc.diff  |  163 -----------------------------------
 patches/dev300/scroll-accel-vcl.diff |  110 -----------------------
 3 files changed, 277 deletions(-)

New commits:
commit 560a111bddda43ec4ea43328e79d2b9b49f85cf9
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Tue Dec 21 01:11:05 2010 -0500

    Removed ported patches.
    
    The following patches are now in git:
    
      * scroll-accel-sc.diff
      * scroll-accel-vcl.diff

diff --git a/patches/dev300/apply b/patches/dev300/apply
index f5a7929..6817a2a 100755
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -453,10 +453,6 @@ svtools-unsort-template-dialogentries.diff, rodo
 # display command line help '-h' to stdout instead of stderr.
 desktop-cmdhelp-stdout.diff, kohei
 
-# Adjust scroll speed while extending selection beyoud visible sheet area.
-scroll-accel-sc.diff, n#375909, i#71362, kohei
-scroll-accel-vcl.diff, n#375909, i#71362, kohei
-
 # reduce mininum password length from 5 to 1.
 min-password-length-sfx2.diff, i#85453, kohei
 min-password-length-helpcontent2.diff, i#112772, timar
diff --git a/patches/dev300/scroll-accel-sc.diff b/patches/dev300/scroll-accel-sc.diff
deleted file mode 100644
index 67e6511..0000000
--- a/patches/dev300/scroll-accel-sc.diff
+++ /dev/null
@@ -1,163 +0,0 @@
----
- sc/source/ui/inc/select.hxx  |    3 +
- sc/source/ui/view/select.cxx |  102 ++++++++++++++++++++++++++++++++++++++++--
- 2 files changed, 101 insertions(+), 4 deletions(-)
-
-diff --git sc/source/ui/inc/select.hxx sc/source/ui/inc/select.hxx
-index 47d1669..237517e 100644
---- sc/source/ui/inc/select.hxx
-+++ sc/source/ui/inc/select.hxx
-@@ -65,6 +65,9 @@ private:
- 
-     ScSplitPos		GetWhich();
- 
-+    ULONG           CalcUpdateInterval( const Size& rWinSize, const Point& rEffPos,
-+                                        bool bLeftScroll, bool bTopScroll, bool bRightScroll, bool bBottomScroll );
-+
- public:
-                     ScViewFunctionSet( ScViewData* pNewViewData );
- 
-diff --git sc/source/ui/view/select.cxx sc/source/ui/view/select.cxx
-index 29ec2ca..46c11bd 100644
---- sc/source/ui/view/select.cxx
-+++ sc/source/ui/view/select.cxx
-@@ -34,6 +34,7 @@
- 
- #include <tools/urlobj.hxx>
- #include <vcl/sound.hxx>
-+#include <vcl/svapp.hxx>
- #include <sfx2/docfile.hxx>
- 
- #include "select.hxx"
-@@ -46,6 +47,8 @@
- #include "docsh.hxx"
- #include "tabprotection.hxx"
- 
-+#define SC_SELENG_REFMODE_UPDATE_INTERVAL_MIN 65
-+
- extern USHORT nScFillModeMouseModifier;				// global.cxx
- 
- using namespace com::sun::star;
-@@ -78,6 +81,83 @@ ScSplitPos ScViewFunctionSet::GetWhich()
-         return pViewData->GetActivePart();
- }
- 
-+ULONG ScViewFunctionSet::CalcUpdateInterval( const Size& rWinSize, const Point& rEffPos,
-+                                             bool bLeftScroll, bool bTopScroll, bool bRightScroll, bool bBottomScroll )
-+{
-+    ULONG nUpdateInterval = SELENG_AUTOREPEAT_INTERVAL_MAX;
-+    Window* pWin = pEngine->GetWindow();
-+    Rectangle aScrRect = pWin->GetDesktopRectPixel();
-+    Point aRootPos = pWin->OutputToAbsoluteScreenPixel(Point(0,0));
-+    if (bRightScroll)
-+    {
-+        double nWinRight = rWinSize.getWidth() + aRootPos.getX();
-+        double nMarginRight = aScrRect.GetWidth() - nWinRight;
-+        double nHOffset = rEffPos.X() - rWinSize.Width();
-+        double nHAccelRate = nHOffset / nMarginRight;
-+
-+        if (nHAccelRate > 1.0)
-+            nHAccelRate = 1.0;
-+
-+        nUpdateInterval = static_cast<ULONG>(SELENG_AUTOREPEAT_INTERVAL_MAX*(1.0 - nHAccelRate));
-+    }
-+
-+    if (bLeftScroll)
-+    {
-+        double nMarginLeft = aRootPos.getX();
-+        double nHOffset = -rEffPos.X();
-+        double nHAccelRate = nHOffset / nMarginLeft;
-+
-+        if (nHAccelRate > 1.0)
-+            nHAccelRate = 1.0;
-+
-+        ULONG nTmp = static_cast<ULONG>(SELENG_AUTOREPEAT_INTERVAL_MAX*(1.0 - nHAccelRate));
-+        if (nUpdateInterval > nTmp)
-+            nUpdateInterval = nTmp;
-+    }
-+
-+    if (bBottomScroll)
-+    {
-+        double nWinBottom = rWinSize.getHeight() + aRootPos.getY();
-+        double nMarginBottom = aScrRect.GetHeight() - nWinBottom;
-+        double nVOffset = rEffPos.Y() - rWinSize.Height();
-+        double nVAccelRate = nVOffset / nMarginBottom;
-+
-+        if (nVAccelRate > 1.0)
-+            nVAccelRate = 1.0;
-+
-+        ULONG nTmp = static_cast<ULONG>(SELENG_AUTOREPEAT_INTERVAL_MAX*(1.0 - nVAccelRate));
-+        if (nUpdateInterval > nTmp)
-+            nUpdateInterval = nTmp;
-+    }
-+
-+    if (bTopScroll)
-+    {
-+        double nMarginTop = aRootPos.getY();
-+        double nVOffset = -rEffPos.Y();
-+        double nVAccelRate = nVOffset / nMarginTop;
-+
-+        if (nVAccelRate > 1.0)
-+            nVAccelRate = 1.0;
-+
-+        ULONG nTmp = static_cast<ULONG>(SELENG_AUTOREPEAT_INTERVAL_MAX*(1.0 - nVAccelRate));
-+        if (nUpdateInterval > nTmp)
-+            nUpdateInterval = nTmp;
-+    }
-+
-+#ifdef WNT
-+    ScTabViewShell* pViewShell = pViewData->GetViewShell();
-+    bool bRefMode = pViewShell && pViewShell->IsRefInputMode();
-+    if (bRefMode && nUpdateInterval < SC_SELENG_REFMODE_UPDATE_INTERVAL_MIN)
-+        // Lower the update interval during ref mode, because re-draw can be
-+        // expensive on Windows.  Making this interval too small would queue up
-+        // the scroll/paint requests which would cause semi-infinite
-+        // scrolls even after the mouse cursor is released.  We don't have
-+        // this problem on Linux.
-+        nUpdateInterval = SC_SELENG_REFMODE_UPDATE_INTERVAL_MIN;
-+#endif
-+    return nUpdateInterval;
-+}
-+
- void ScViewFunctionSet::SetSelectionEngine( ScViewSelectionEngine* pSelEngine )
- {
-     pEngine = pSelEngine;
-@@ -256,10 +336,11 @@ BOOL __EXPORT ScViewFunctionSet::SetCursorAtPoint( const Point& rPointPixel, BOO
-     //	Scrolling
- 
-     Size aWinSize = pEngine->GetWindow()->GetOutputSizePixel();
--    BOOL bRightScroll  = ( aEffPos.X() >= aWinSize.Width() );
--    BOOL bBottomScroll = ( aEffPos.Y() >= aWinSize.Height() );
--    BOOL bNegScroll    = ( aEffPos.X() < 0 || aEffPos.Y() < 0 );
--    BOOL bScroll = bRightScroll || bBottomScroll || bNegScroll;
-+    bool bRightScroll  = ( aEffPos.X() >= aWinSize.Width() );
-+    bool bLeftScroll  = ( aEffPos.X() < 0 );
-+    bool bBottomScroll = ( aEffPos.Y() >= aWinSize.Height() );
-+    bool bTopScroll = ( aEffPos.Y() < 0 );
-+    bool bScroll = bRightScroll || bBottomScroll || bLeftScroll || bTopScroll;
- 
-     SCsCOL	nPosX;
-     SCsROW	nPosY;
-@@ -312,6 +393,19 @@ BOOL __EXPORT ScViewFunctionSet::SetCursorAtPoint( const Point& rPointPixel, BOO
-             }
-     }
- 
-+    if (bScroll)
-+    {
-+        // Adjust update interval based on how far the mouse pointer is from the edge.
-+        ULONG nUpdateInterval = CalcUpdateInterval(
-+            aWinSize, aEffPos, bLeftScroll, bTopScroll, bRightScroll, bBottomScroll);
-+        pEngine->SetUpdateInterval(nUpdateInterval);
-+    }
-+    else
-+    {
-+        // Don't forget to reset the interval when not scrolling!
-+        pEngine->SetUpdateInterval(SELENG_AUTOREPEAT_INTERVAL);
-+    }
-+
-     pViewData->ResetOldCursor();
-     return SetCursorAtCell( nPosX, nPosY, bScroll );
- }
--- 
-1.7.0.1
-
diff --git a/patches/dev300/scroll-accel-vcl.diff b/patches/dev300/scroll-accel-vcl.diff
deleted file mode 100644
index b6c1d46..0000000
--- a/patches/dev300/scroll-accel-vcl.diff
+++ /dev/null
@@ -1,110 +0,0 @@
----
- vcl/inc/vcl/seleng.hxx       |    8 +++++++-
- vcl/source/window/seleng.cxx |   34 ++++++++++++++++++++++++++++++----
- 2 files changed, 37 insertions(+), 5 deletions(-)
-
-diff --git vcl/inc/vcl/seleng.hxx vcl/inc/vcl/seleng.hxx
-index 3c31d09..dcb764b 100644
---- vcl/inc/vcl/seleng.hxx
-+++ vcl/inc/vcl/seleng.hxx
-@@ -38,6 +38,8 @@ class CommandEvent;
- // Timerticks
- #define SELENG_DRAGDROP_TIMEOUT     400
- #define SELENG_AUTOREPEAT_INTERVAL  50
-+#define SELENG_AUTOREPEAT_INTERVAL_MIN 25
-+#define SELENG_AUTOREPEAT_INTERVAL_MAX 300
- 
- enum SelectionMode { NO_SELECTION, SINGLE_SELECTION, RANGE_SELECTION, MULTIPLE_SELECTION };
- 
-@@ -87,6 +89,7 @@ private:
-     Timer               aWTimer; // erzeugt kuenstliche Mouse-Moves
-     MouseEvent          aLastMove;
-     SelectionMode       eSelMode;
-+    ULONG               nUpdateInterval;
-     // Stufigkeit fuer Mausbewegungen waehrend einer Selektion
-     USHORT              nMouseSensitivity;
-     USHORT              nLockedMods;
-@@ -100,7 +103,8 @@ private:
- public:
- 
-                         SelectionEngine( Window* pWindow,
--                                         FunctionSet* pFunctions = NULL );
-+                                         FunctionSet* pFunctions = NULL,
-+                                         ULONG nAutoRepeatInterval = SELENG_AUTOREPEAT_INTERVAL );
-                         ~SelectionEngine();
- 
-     // TRUE: Event wurde von Selection-Engine verarbeitet.
-@@ -159,6 +163,8 @@ public:
-     BOOL                HasAnchor() const;
-     void                SetAnchor( BOOL bAnchor );
- 
-+    void                SetUpdateInterval( ULONG nInterval );
-+
-     // wird im Ctor eingeschaltet
-     void				ExpandSelectionOnMouseMove( BOOL bExpand = TRUE )
-                         {
-diff --git vcl/source/window/seleng.cxx vcl/source/window/seleng.cxx
-index 8c59779..83b608e 100644
---- vcl/source/window/seleng.cxx
-+++ vcl/source/window/seleng.cxx
-@@ -55,8 +55,10 @@ inline BOOL SelectionEngine::ShouldDeselect( BOOL bModifierKey1 ) const
- |*
- *************************************************************************/
- 
--SelectionEngine::SelectionEngine( Window* pWindow, FunctionSet* pFuncSet ) :
--                    pWin( pWindow )
-+SelectionEngine::SelectionEngine( Window* pWindow, FunctionSet* pFuncSet,
-+                                  ULONG nAutoRepeatInterval ) :
-+    pWin( pWindow ),
-+    nUpdateInterval( nAutoRepeatInterval )
- {
-     eSelMode = SINGLE_SELECTION;
-     pFunctionSet = pFuncSet;
-@@ -64,7 +66,7 @@ SelectionEngine::SelectionEngine( Window* pWindow, FunctionSet* pFuncSet ) :
-     nLockedMods = 0;
- 
-     aWTimer.SetTimeoutHdl( LINK( this, SelectionEngine, ImpWatchDog ) );
--    aWTimer.SetTimeout( SELENG_AUTOREPEAT_INTERVAL );
-+    aWTimer.SetTimeout( nUpdateInterval );
- }
- 
- /*************************************************************************
-@@ -393,7 +395,7 @@ BOOL SelectionEngine::SelMouseMove( const MouseEvent& rMEvt )
-     if( aWTimer.IsActive() && !aArea.IsInside( rMEvt.GetPosPixel() ))
-         return TRUE;
- 
--
-+    aWTimer.SetTimeout( nUpdateInterval );
-     aWTimer.Start();
-     if ( eSelMode != SINGLE_SELECTION )
-     {
-@@ -489,5 +491,29 @@ void SelectionEngine::Command( const CommandEvent& rCEvt )
-             nFlags &= ~SELENG_CMDEVT;
-     }
- }
-+
-+void SelectionEngine::SetUpdateInterval( ULONG nInterval )
-+{
-+    if (nInterval < SELENG_AUTOREPEAT_INTERVAL_MIN)
-+        // Set a lower threshold.  On Windows, setting this value too low
-+        // would cause selection to get updated indefinitely.
-+        nInterval = SELENG_AUTOREPEAT_INTERVAL_MIN;
-+
-+    if (nUpdateInterval == nInterval)
-+        // no update needed.
-+        return;
-+
-+    if (aWTimer.IsActive())
-+    {
-+        // reset the timer right away on interval change.
-+        aWTimer.Stop();
-+        aWTimer.SetTimeout(nInterval);
-+        aWTimer.Start();
-+    }
-+    else
-+        aWTimer.SetTimeout(nInterval);
-+
-+    nUpdateInterval = nInterval;
-+}
- 
- /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list