[Libreoffice-commits] core.git: chart2/source include/svx svx/source
Stephan Bergmann
sbergman at redhat.com
Wed Sep 9 05:01:41 PDT 2015
chart2/source/controller/main/ChartController_Window.cxx | 6 +---
include/svx/svdedxv.hxx | 2 -
svx/source/svdraw/svdedxv.cxx | 19 +++------------
svx/source/svdraw/svdview.cxx | 4 +--
4 files changed, 10 insertions(+), 21 deletions(-)
New commits:
commit f9f3e97ca867db59f2fc2e4fdb5583ed49cab49c
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Sep 9 13:51:10 2015 +0200
SdrObjEditView::IsTextEditHit effectively ignores its nTol argument
...ever since
nTol=0; // Joe am 6.3.1997: Keine Hittoleranz mehr hier
had been added into it sometime prior to
fd069bee7e57ad529c3c0974559fd2d84ec3151a "initial import." So lets assume Joe
meant that as a permanent fix rather than a temporal hack (which would have
survived for longer than 18 years anyway).
Change-Id: Ib30ac8d578f70c861d4c0f5f71bf4c13e9281db8
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index 9c1c7c4..dd6ccaf4 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -215,8 +215,6 @@ OUString lcl_getFormatCommandForObjectCID( const OUString& rCID )
} // anonymous namespace
-const short HITPIX=2; //hit-tolerance in pixel
-
// awt::XWindow
void SAL_CALL ChartController::setPosSize(
sal_Int32 X,
@@ -581,7 +579,7 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt )
if( pDrawViewWrapper->IsTextEdit() )
{
SdrViewEvent aVEvt;
- if ( pDrawViewWrapper->IsTextEditHit( aMPos, HITPIX ) ||
+ if ( pDrawViewWrapper->IsTextEditHit( aMPos ) ||
// #i12587# support for shapes in chart
( rMEvt.IsRight() && pDrawViewWrapper->PickAnything( rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt ) == SDRHIT_MARKEDOBJECT ) )
{
@@ -1836,7 +1834,7 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
if ( m_pDrawViewWrapper->IsTextEdit() )
{
- if( m_pDrawViewWrapper->IsTextEditHit( aMousePos, HITPIX) )
+ if( m_pDrawViewWrapper->IsTextEditHit( aMousePos ) )
{
m_pChartWindow->SetPointer( m_pDrawViewWrapper->GetPreferredPointer(
aMousePos, m_pChartWindow, nModifier, bLeftDown ) );
diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx
index a6ef4ed..a34b9a8 100644
--- a/include/svx/svdedxv.hxx
+++ b/include/svx/svdedxv.hxx
@@ -181,7 +181,7 @@ public:
// This method returns sal_True, if the point rHit is inside the
// objectspace or the OutlinerView.
- bool IsTextEditHit(const Point& rHit, short nTol) const;
+ bool IsTextEditHit(const Point& rHit) const;
// This method returns sal_True, if the point rHit is inside the
// handle-thick frame, which surrounds the OutlinerView at TextFrames.
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 43dee90..ececaa6 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1125,26 +1125,17 @@ void SdrObjEditView::SetTextEditWin(vcl::Window* pWin)
}
}
-bool SdrObjEditView::IsTextEditHit(const Point& rHit, short nTol) const
+bool SdrObjEditView::IsTextEditHit(const Point& rHit) const
{
bool bOk=false;
if(mxTextEditObj.is())
{
- nTol=ImpGetHitTolLogic(nTol,NULL);
- // only a third of the tolerance here, so handles can be hit well
- nTol=nTol/3;
- nTol=0; // no hit tolerance here any more
-
Rectangle aEditArea;
OutlinerView* pOLV=pTextEditOutliner->GetView(0);
if (pOLV!=NULL)
{
aEditArea.Union(pOLV->GetOutputArea());
}
- aEditArea.Left()-=nTol;
- aEditArea.Top()-=nTol;
- aEditArea.Right()+=nTol;
- aEditArea.Bottom()+=nTol;
bOk=aEditArea.IsInside(rHit);
if (bOk)
{ // check if any characters were actually hit
@@ -1221,7 +1212,7 @@ bool SdrObjEditView::MouseButtonDown(const MouseEvent& rMEvt, vcl::Window* pWin)
Point aPt(rMEvt.GetPosPixel());
if (pWin!=NULL) aPt=pWin->PixelToLogic(aPt);
else if (pTextEditWin!=nullptr) aPt=pTextEditWin->PixelToLogic(aPt);
- bPostIt=IsTextEditHit(aPt,mnHitTolLog);
+ bPostIt=IsTextEditHit(aPt);
}
if (bPostIt) {
Point aPixPos(rMEvt.GetPosPixel());
@@ -1256,7 +1247,7 @@ bool SdrObjEditView::MouseButtonUp(const MouseEvent& rMEvt, vcl::Window* pWin)
Point aPt(rMEvt.GetPosPixel());
if (pWin!=NULL) aPt=pWin->PixelToLogic(aPt);
else if (pTextEditWin!=nullptr) aPt=pTextEditWin->PixelToLogic(aPt);
- bPostIt=IsTextEditHit(aPt,mnHitTolLog);
+ bPostIt=IsTextEditHit(aPt);
}
if (bPostIt) {
Point aPixPos(rMEvt.GetPosPixel());
@@ -1290,7 +1281,7 @@ bool SdrObjEditView::MouseMove(const MouseEvent& rMEvt, vcl::Window* pWin)
aPt=pWin->PixelToLogic(aPt);
else if (pTextEditWin)
aPt=pTextEditWin->PixelToLogic(aPt);
- bPostIt=IsTextEditHit(aPt,mnHitTolLog);
+ bPostIt=IsTextEditHit(aPt);
}
if (bPostIt) {
Point aPixPos(rMEvt.GetPosPixel());
@@ -1328,7 +1319,7 @@ bool SdrObjEditView::Command(const CommandEvent& rCEvt, vcl::Window* pWin)
Point aPt(rCEvt.GetMousePosPixel());
if (pWin!=NULL) aPt=pWin->PixelToLogic(aPt);
else if (pTextEditWin!=nullptr) aPt=pTextEditWin->PixelToLogic(aPt);
- bPostIt=IsTextEditHit(aPt,mnHitTolLog);
+ bPostIt=IsTextEditHit(aPt);
}
if (bPostIt) {
Point aPixPos(rCEvt.GetMousePosPixel());
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index 775da20..f203509 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -334,7 +334,7 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co
bool bInsPolyPt=bPointMode && IsInsObjPointMode() && IsInsObjPointPossible();
bool bInsGluePt=bGluePointMode && IsInsGluePointMode() && IsInsGluePointPossible();
bool bIsTextEdit=IsTextEdit();
- bool bTextEditHit=IsTextEditHit(aLocalLogicPosition,0/*nHitTolLog*/);
+ bool bTextEditHit=IsTextEditHit(aLocalLogicPosition);
bool bTextEditSel=IsTextEditInSelectionMode();
bool bShift=(rVEvt.nMouseCode & KEY_SHIFT) !=0;
bool bCtrl=(rVEvt.nMouseCode & KEY_MOD1) !=0;
@@ -976,7 +976,7 @@ Pointer SdrView::GetPreferredPointer(const Point& rMousePos, const OutputDevice*
}
// TextEdit, ObjEdit, Macro
- if (IsTextEdit() && (IsTextEditInSelectionMode() || IsTextEditHit(rMousePos,0/*nTol*/)))
+ if (IsTextEdit() && (IsTextEditInSelectionMode() || IsTextEditHit(rMousePos)))
{
if(!pOut || IsTextEditInSelectionMode())
{
More information about the Libreoffice-commits
mailing list