summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2016-07-20 20:26:52 -0400
committerHenry Castro <hcastro@collabora.com>2016-07-21 15:23:45 -0400
commit993a0069ebb296b766a79c867f70a95cacd9c96e (patch)
treeab3875d9aa63a899733c465210efa0a68c8579b7
parent76bb5a2deeeec927747e8e624e455735356fc77e (diff)
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@libreoffice.org> Reviewed-by: Henry Castro <hcastro@collabora.com> Conflicts: include/svx/svdotable.hxx svx/source/svdraw/svdview.cxx svx/source/table/svdotable.cxx Change-Id: Ia8213ae452f93cd2faa957a50246638d1eb2198e
-rw-r--r--include/svx/svdotable.hxx2
-rw-r--r--svx/source/svdraw/svdview.cxx2
-rw-r--r--svx/source/table/svdotable.cxx14
3 files changed, 9 insertions, 9 deletions
diff --git a/include/svx/svdotable.hxx b/include/svx/svdotable.hxx
index a8be427cef3c..ee15745e00cb 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 e1dbaa3a30d5..6d300ccb8a59 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 62ad011ef575..64984d0791d0 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;