[Libreoffice-commits] core.git: 2 commits - sw/source

Matteo Casalin matteo.casalin at yahoo.com
Sun May 12 08:39:01 PDT 2013


 sw/source/ui/uiview/viewport.cxx |   30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)

New commits:
commit 0e540d7e393b05b3813206ed60be2c51a8d80aa2
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sun May 12 17:37:22 2013 +0200

    Fix indentation
    
    Change-Id: I56f4352ca1703950a2eb37eda1dbe0c1ab5a0b1c

diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx
index 0e87e45..e9f5d1a 100644
--- a/sw/source/ui/uiview/viewport.cxx
+++ b/sw/source/ui/uiview/viewport.cxx
@@ -1286,16 +1286,15 @@ sal_Bool SwView::HandleWheelCommands( const CommandEvent& rCEvt )
         }
 
         if ((COMMAND_WHEEL_SCROLL==pWData->GetMode()) && (((sal_uLong)0xFFFFFFFF) == pWData->GetScrollLines()))
-            {
-                        if (pWData->GetDelta()<0)
-                                PhyPageDown();
-                        else
-                                PhyPageUp();
-                        bOk = sal_True;
-                }
+        {
+            if (pWData->GetDelta()<0)
+                PhyPageDown();
+            else
+                PhyPageUp();
+            bOk = sal_True;
+        }
         else
-            bOk = m_pEditWin->HandleScrollCommand( rCEvt,
-                            m_pHScrollbar, m_pVScrollbar);
+            bOk = m_pEditWin->HandleScrollCommand(rCEvt, m_pHScrollbar, m_pVScrollbar);
 
         // Restore default state for case when scroll command comes from dragging scrollbar handle
         m_bWheelScrollInProgress=false;
commit 5141201fba2d080841b81e02be92f4b47aae2684
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sun May 12 16:52:54 2013 +0200

    Return early in case of NULL pointer
    
    Change-Id: I1c31608b960f750ef777d214ac482c4f52b44aff

diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx
index a273495..0e87e45 100644
--- a/sw/source/ui/uiview/viewport.cxx
+++ b/sw/source/ui/uiview/viewport.cxx
@@ -1253,9 +1253,14 @@ void SwView::Move()
 
 sal_Bool SwView::HandleWheelCommands( const CommandEvent& rCEvt )
 {
-    sal_Bool bOk = sal_False;
     const CommandWheelData* pWData = rCEvt.GetWheelData();
-    if( pWData && COMMAND_WHEEL_ZOOM == pWData->GetMode() )
+    if (!pWData)
+    {
+        return sal_False;
+    }
+
+    sal_Bool bOk = sal_False;
+    if( COMMAND_WHEEL_ZOOM == pWData->GetMode() )
     {
         long nFact = m_pWrtShell->GetViewOptions()->GetZoom();
         if( 0L > pWData->GetDelta() )
@@ -1266,7 +1271,7 @@ sal_Bool SwView::HandleWheelCommands( const CommandEvent& rCEvt )
         SetZoom( SVX_ZOOM_PERCENT, nFact );
         bOk = sal_True;
     }
-    else if( pWData && COMMAND_WHEEL_ZOOM_SCALE == pWData->GetMode() )
+    else if( COMMAND_WHEEL_ZOOM_SCALE == pWData->GetMode() )
     {
         int newZoom = 100 * (m_pWrtShell->GetViewOptions()->GetZoom() / 100.0) * (pWData->GetDelta() / 100.0);
         SetZoom( SVX_ZOOM_PERCENT, std::max( 20, std::min( 600, newZoom ) ) );
@@ -1280,7 +1285,7 @@ sal_Bool SwView::HandleWheelCommands( const CommandEvent& rCEvt )
             m_bWheelScrollInProgress=true;
         }
 
-        if (pWData && (COMMAND_WHEEL_SCROLL==pWData->GetMode()) && (((sal_uLong)0xFFFFFFFF) == pWData->GetScrollLines()))
+        if ((COMMAND_WHEEL_SCROLL==pWData->GetMode()) && (((sal_uLong)0xFFFFFFFF) == pWData->GetScrollLines()))
             {
                         if (pWData->GetDelta()<0)
                                 PhyPageDown();


More information about the Libreoffice-commits mailing list