[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - include/svx svx/source

Henry Castro hcastro at collabora.com
Thu Jul 21 19:26:05 UTC 2016


 include/svx/svdotable.hxx      |    2 +-
 svx/source/svdraw/svdview.cxx  |    2 +-
 svx/source/table/svdotable.cxx |   14 +++++++-------
 3 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 993a0069ebb296b766a79c867f70a95cacd9c96e
Author: Henry Castro <hcastro at collabora.com>
Date:   Wed Jul 20 20:26:52 2016 -0400

    sd lok: fix hard to select a full table
    
    It requires a precise mouse down button in the rectangle border bounds
    to select a full table, so it has added a tolerance value.
    
    Reviewed-on: https://gerrit.libreoffice.org/27356
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Henry Castro <hcastro at collabora.com>
    
    Conflicts:
    	include/svx/svdotable.hxx
    	svx/source/svdraw/svdview.cxx
    	svx/source/table/svdotable.cxx
    
    Change-Id: Ia8213ae452f93cd2faa957a50246638d1eb2198e

diff --git a/include/svx/svdotable.hxx b/include/svx/svdotable.hxx
index a8be427..ee15745 100644
--- a/include/svx/svdotable.hxx
+++ b/include/svx/svdotable.hxx
@@ -134,7 +134,7 @@ public:
     const sdr::table::TableStyleSettings& getTableStyleSettings() const;
     void setTableStyleSettings( const sdr::table::TableStyleSettings& rStyle );
 
-    TableHitKind CheckTableHit( const Point& rPos, sal_Int32& rnX, sal_Int32& rnY, int nTol ) const;
+    TableHitKind CheckTableHit( const Point& rPos, sal_Int32& rnX, sal_Int32& rnY, const sal_uInt16 aTol = 0 ) const;
 
     void uno_lock();
     void uno_unlock();
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index e1dbaa3..6d300cc 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -387,7 +387,7 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co
         if( pTableObj )
         {
             sal_Int32 nX = 0, nY = 0;
-            switch( pTableObj->CheckTableHit( aLocalLogicPosition, nX, nY, 0 ) )
+            switch( pTableObj->CheckTableHit( aLocalLogicPosition, nX, nY, mnHitTolLog ) )
             {
                 case sdr::table::SDRTABLEHIT_CELL:
                     eHit = SDRHIT_CELL;
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 62ad011..64984d0 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -1059,7 +1059,7 @@ void SdrTableObj::setTableStyleSettings( const TableStyleSettings& rStyle )
 }
 
 
-TableHitKind SdrTableObj::CheckTableHit( const Point& rPos, sal_Int32& rnX, sal_Int32& rnY, int nTol ) const
+TableHitKind SdrTableObj::CheckTableHit( const Point& rPos, sal_Int32& rnX, sal_Int32& rnY, const sal_uInt16 aTol ) const
 {
     if( !mpImpl || !mpImpl->mxTable.is() )
         return SDRTABLEHIT_NONE;
@@ -1070,10 +1070,10 @@ TableHitKind SdrTableObj::CheckTableHit( const Point& rPos, sal_Int32& rnX, sal_
     const sal_Int32 nColCount = mpImpl->getColumnCount();
     const sal_Int32 nRowCount = mpImpl->getRowCount();
 
-    sal_Int32 nX = rPos.X() + nTol - maRect.Left();
-    sal_Int32 nY = rPos.Y() + nTol - maRect.Top();
+    sal_Int32 nX = rPos.X() - maRect.Left();
+    sal_Int32 nY = rPos.Y() - maRect.Top();
 
-    if( (nX < 0) || (nX > (maRect.GetWidth() + nTol)) || (nY < 0) || (nY > (maRect.GetHeight() + nTol) ) )
+    if( (nX < 0) || (nX > maRect.GetWidth()) || (nY < 0) || (nY > maRect.GetHeight()) )
         return SDRTABLEHIT_NONE;
 
     // get vertical edge number and check for a hit
@@ -1085,7 +1085,7 @@ TableHitKind SdrTableObj::CheckTableHit( const Point& rPos, sal_Int32& rnX, sal_
         {
             while( rnX <= nColCount )
             {
-                if( nX <= (2*nTol) )
+                if( nX - aTol <= 0 )
                 {
                     bVrtHit = true;
                     break;
@@ -1105,7 +1105,7 @@ TableHitKind SdrTableObj::CheckTableHit( const Point& rPos, sal_Int32& rnX, sal_
             rnX = nColCount;
             while( rnX >= 0 )
             {
-                if( nX <= (2*nTol) )
+                if( nX - aTol <= 0 )
                 {
                     bVrtHit = true;
                     break;
@@ -1130,7 +1130,7 @@ TableHitKind SdrTableObj::CheckTableHit( const Point& rPos, sal_Int32& rnX, sal_
     {
         while( rnY <= nRowCount )
         {
-            if( nY <= (2*nTol) )
+            if( nY - aTol <= 0 )
             {
                 bHrzHit = true;
                 break;


More information about the Libreoffice-commits mailing list