diff options
Diffstat (limited to 'sd/source/ui')
27 files changed, 97 insertions, 354 deletions
diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx index bcd12aa42e65..b2b23fb4c7a9 100644 --- a/sd/source/ui/animations/motionpathtag.cxx +++ b/sd/source/ui/animations/motionpathtag.cxx @@ -75,7 +75,6 @@ namespace sd { const sal_uInt32 SMART_TAG_HDL_NUM = SAL_MAX_UINT32; -static const int DRGPIX = 2; // Drag MinMove in Pixel // -------------------------------------------------------------------- @@ -458,7 +457,6 @@ void MotionPathTag::MovePath( double fDX, double fDY ) if(mpPathObj) { mpPathObj->setSdrObjectTransformation(basegfx::tools::createTranslateB2DHomMatrix(fDX, fDY) * mpPathObj->getSdrObjectTransformation()); - // sdr::legacy::MoveSdrObject(*mpPathObj, Size( nDX, nDY ) ); mrView.RecreateAllMarkHandles(); // TTTT: Neded? } } @@ -581,8 +579,7 @@ bool MotionPathTag::MouseButtonDown( const MouseEvent& rMEvt, SmartHdl& rHdl ) pDragMethod = new PathDragResize( mrView, xTag, aDragPoly ); } - const double fTolerance(basegfx::B2DVector(pOut->GetInverseViewTransformation() * basegfx::B2DVector(DRGPIX, 0.0)).getLength()); - mrView.BegDragObj(aMDPos, pHdl, fTolerance, pDragMethod ); + mrView.BegDragObj(aMDPos, pHdl, mrView.getMinMovLog(), pDragMethod ); } return true; } diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx index 30a5d4c41749..c4610a07d100 100644 --- a/sd/source/ui/annotations/annotationtag.cxx +++ b/sd/source/ui/annotations/annotationtag.cxx @@ -64,7 +64,6 @@ namespace sd { const sal_uInt32 SMART_TAG_HDL_NUM = SAL_MAX_UINT32; -static const int DRGPIX = 2; // Drag MinMove in Pixel // -------------------------------------------------------------------- @@ -727,8 +726,7 @@ IMPL_LINK(AnnotationTag, WindowEventHandler, VclWindowEvent*, pEvent) rtl::Reference< AnnotationTag > xTag( this ); SdrDragMethod* pDragMethod = new AnnotationDragMove( mrView, xTag ); - const double fTolerance(basegfx::B2DVector(pWindow->GetInverseViewTransformation() * basegfx::B2DVector(DRGPIX, 0.0)).getLength()); - mrView.BegDragObj(maMouseDownPos, pHdl, fTolerance, pDragMethod ); + mrView.BegDragObj(maMouseDownPos, pHdl, mrView.getMinMovLog(), pDragMethod ); } } break; diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx index 36dd05fe7f86..211b7a68ad41 100644 --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -277,7 +277,7 @@ void SdTransferable::CreateObjectReplacement( SdrObject* pObj ) if( pInfo ) mpImageMap = new ImageMap( pInfo->GetImageMap() ); - mbIsUnoObj = pObj && pObj->IsSdrUnoObj(); + mbIsUnoObj = dynamic_cast< SdrUnoObj* >(pObj); } } diff --git a/sd/source/ui/dlg/sdpreslt.cxx b/sd/source/ui/dlg/sdpreslt.cxx index 3233fac026bf..416cbf6cda59 100644 --- a/sd/source/ui/dlg/sdpreslt.cxx +++ b/sd/source/ui/dlg/sdpreslt.cxx @@ -73,8 +73,6 @@ SdPresLayoutDlg::SdPresLayoutDlg( { FreeResource(); - //mpLayoutNames = new List; - maVS.SetDoubleClickHdl(LINK(this, SdPresLayoutDlg, ClickLayoutHdl)); maBtnLoad.SetClickHdl(LINK(this, SdPresLayoutDlg, ClickLoadHdl)); @@ -89,14 +87,6 @@ SdPresLayoutDlg::SdPresLayoutDlg( SdPresLayoutDlg::~SdPresLayoutDlg() { - //String* pName = (String*)mpLayoutNames->First(); - //while (pName) - //{ - // delete pName; - // pName = (String*)mpLayoutNames->Next(); - //} - // - //delete mpLayoutNames; } /************************************************************************* @@ -132,8 +122,9 @@ void SdPresLayoutDlg::Reset() for( nName = 0; nName < mnLayoutCount; nName++ ) { if(maLayoutNames[nName] == maName) - //if (*((String*)mpLayoutNames->GetObject(nName)) == maName) + { break; + } } DBG_ASSERT(nName < mnLayoutCount, "Layout nicht gefunden"); @@ -159,12 +150,10 @@ void SdPresLayoutDlg::GetAttr(SfxItemSet& rOutAttrs) { aLayoutName = maName; aLayoutName.Append( DOCUMENT_TOKEN ); - //aLayoutName.Append( *(String*)mpLayoutNames->GetObject( nId - 1 ) ); aLayoutName.Append(maLayoutNames[nId - 1]); } else { - //aLayoutName = *(String*)mpLayoutNames->GetObject( nId - 1 ); aLayoutName = maLayoutNames[nId - 1]; if( aLayoutName == maStrNone ) aLayoutName.Erase(); // so wird "- keine -" codiert (s.u.) @@ -203,10 +192,8 @@ void SdPresLayoutDlg::FillValueSet() String aLayoutName(pMaster->GetLayoutName()); aLayoutName.Erase( aLayoutName.SearchAscii( SD_LT_SEPARATOR ) ); maLayoutNames.push_back(aLayoutName); - //mpLayoutNames->Insert(new String(aLayoutName), LIST_APPEND); Bitmap aBitmap(mpDocSh->GetPagePreviewBitmap(pMaster, 90)); - //maVS.InsertItem(mpLayoutNames->Count(), aBitmap, aLayoutName); maVS.InsertItem(maLayoutNames.size(), aBitmap, aLayoutName); } } @@ -278,10 +265,7 @@ IMPL_LINK(SdPresLayoutDlg, ClickLoadHdl, void *, EMPTYARG) if( !bCancel ) { // Pruefen, ob Vorlage schon vorhanden - // TTTT: check if this works and if yes, cleanup mpLayoutNames - bool bExists = false; - //String* pName = (String*)mpLayoutNames->First(); String aCompareStr( maName ); if( maName.Len() == 0 ) aCompareStr = maStrNone; @@ -298,18 +282,6 @@ IMPL_LINK(SdPresLayoutDlg, ClickLoadHdl, void *, EMPTYARG) } } - //while( pName && !bExists ) - //{ - // if( aCompareStr == *pName ) - // { - // bExists = true; - // // Vorlage selektieren - // sal_uInt16 nId = (sal_uInt16) mpLayoutNames->GetCurPos() + 1; - // maVS.SelectItem( nId ); - // } - // pName = (String*)mpLayoutNames->Next(); - //} - if( !bExists ) { // Dokument laden um Preview-Bitmap zu ermitteln (wenn Vorlage ausgewaehlt) @@ -322,13 +294,6 @@ IMPL_LINK(SdPresLayoutDlg, ClickLoadHdl, void *, EMPTYARG) if (pTemplDoc) { ::sd::DrawDocShell* pTemplDocSh= pTemplDoc->GetDocSh(); - -/* SdPage* pMaster = pTemplDoc->GetMasterSdPage( 0, PK_STANDARD ); - mpLayoutNames->Insert( new String( maName ), LIST_APPEND ); - - Bitmap aBitmap( pTemplDocSh->GetPagePreviewBitmap( pMaster, 90 ) ); - maVS.InsertItem( (sal_uInt16) mpLayoutNames->Count(), aBitmap, maName); -*/ sal_uInt32 nCount = pTemplDoc->GetMasterPageCount(); for (sal_uInt32 nLayout = 0; nLayout < nCount; nLayout++) @@ -338,11 +303,9 @@ IMPL_LINK(SdPresLayoutDlg, ClickLoadHdl, void *, EMPTYARG) { String aLayoutName(pMaster->GetLayoutName()); aLayoutName.Erase( aLayoutName.SearchAscii( SD_LT_SEPARATOR ) ); - //mpLayoutNames->Insert(new String(aLayoutName), LIST_APPEND); maLayoutNames.push_back(aLayoutName); Bitmap aBitmap(pTemplDocSh->GetPagePreviewBitmap(pMaster, 90)); - //maVS.InsertItem(mpLayoutNames->Count(), aBitmap, aLayoutName); maVS.InsertItem(maLayoutNames.size(), aBitmap, aLayoutName); } } @@ -357,17 +320,13 @@ IMPL_LINK(SdPresLayoutDlg, ClickLoadHdl, void *, EMPTYARG) else { // leeres Layout - //mpLayoutNames->Insert( new String( maStrNone ), LIST_APPEND ); maLayoutNames.push_back(maStrNone); - //maVS.InsertItem( (sal_uInt16) mpLayoutNames->Count(), - // Bitmap( SdResId( BMP_FOIL_NONE ) ), maStrNone ); maVS.InsertItem(maLayoutNames.size(), Bitmap( SdResId( BMP_FOIL_NONE ) ), maStrNone ); } if (!bCancel) { // Vorlage selektieren - //maVS.SelectItem( (sal_uInt16) mpLayoutNames->Count() ); maVS.SelectItem(static_cast< sal_uInt16 >(maLayoutNames.size())); } } diff --git a/sd/source/ui/func/fucon3d.cxx b/sd/source/ui/func/fucon3d.cxx index ef4a247a963d..cb1400c96fe7 100644 --- a/sd/source/ui/func/fucon3d.cxx +++ b/sd/source/ui/func/fucon3d.cxx @@ -363,12 +363,8 @@ bool FuConstruct3dObject::MouseButtonDown(const MouseEvent& rMEvt) { const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y()); const basegfx::B2DPoint aLogicPos(mpWindow->GetInverseViewTransformation() * aPixelPos); - mpWindow->CaptureMouse(); - sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() ); - E3dCompoundObject* p3DObj = NULL; - WaitObject aWait( (Window*)mpViewShell->GetActiveWindow() ); // #97016# @@ -377,7 +373,7 @@ bool FuConstruct3dObject::MouseButtonDown(const MouseEvent& rMEvt) // #97016# ImpPrepareBasic3DShape(p3DObj, pScene); - bReturn = mpView->BegCreatePreparedObject(aLogicPos, nDrgLog, pScene); + bReturn = mpView->BegCreatePreparedObject(aLogicPos, mpView->getMinMovLog(), pScene); SdrObject* pObj = mpView->GetCreateObj(); diff --git a/sd/source/ui/func/fuconarc.cxx b/sd/source/ui/func/fuconarc.cxx index 8fb5ac05e996..486b31e32df6 100644 --- a/sd/source/ui/func/fuconarc.cxx +++ b/sd/source/ui/func/fuconarc.cxx @@ -133,8 +133,7 @@ bool FuConstructArc::MouseButtonDown( const MouseEvent& rMEvt ) const basegfx::B2DPoint aLogicPos(mpWindow->GetInverseViewTransformation() * aPixelPos); mpWindow->CaptureMouse(); - const double fTolerance(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(DRGPIX, 0.0)).getLength()); - mpView->BegCreateObj(aLogicPos, fTolerance); + mpView->BegCreateObj(aLogicPos, mpView->getMinMovLog()); SdrObject* pObj = mpView->GetCreateObj(); diff --git a/sd/source/ui/func/fuconbez.cxx b/sd/source/ui/func/fuconbez.cxx index ca6d051edd2c..93112e16d7a3 100644 --- a/sd/source/ui/func/fuconbez.cxx +++ b/sd/source/ui/func/fuconbez.cxx @@ -380,15 +380,6 @@ void FuConstructBezierPolygon::SetEditMode(sal_uInt16 nMode) // #97016# SdrObject* FuConstructBezierPolygon::CreateDefaultObject(const sal_uInt16 nID, const basegfx::B2DRange& rRange) { - // case SID_DRAW_POLYGON: - // case SID_DRAW_POLYGON_NOFILL: - // case SID_DRAW_XPOLYGON: - // case SID_DRAW_XPOLYGON_NOFILL: - // case SID_DRAW_FREELINE: - // case SID_DRAW_FREELINE_NOFILL: - // case SID_DRAW_BEZIER_FILL: // BASIC - // case SID_DRAW_BEZIER_NOFILL: // BASIC - SdrPathObj* pObj = dynamic_cast< SdrPathObj* >( SdrObjFactory::MakeNewObject( mpView->getSdrModelFromSdrView(), @@ -439,141 +430,6 @@ SdrObject* FuConstructBezierPolygon::CreateDefaultObject(const sal_uInt16 nID, c } return pObj; - - // TTTT - //{ - // SdrPathObj* pSdrPathObj = dynamic_cast< SdrPathObj* >(pObj); - // - // if(pSdrPathObj) - // { - // basegfx::B2DPolyPolygon aPoly; - // - // switch(nID) - // { - // case SID_DRAW_BEZIER_FILL: - // { - // const double fWdt(rRange.getWidth() * 0.5); - // const double fHgt(rRange.getHeight() * 0.5); - // const basegfx::B2DPolygon aInnerPoly(basegfx::tools::createPolygonFromEllipse(rRange.getCenter(), fWdt, fHgt)); - // - // aPoly.append(aInnerPoly); - // break; - // } - // case SID_DRAW_BEZIER_NOFILL: - // { - // basegfx::B2DPolygon aInnerPoly; - // - // aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY())); - // - // const basegfx::B2DPoint aCenterBottom(rRange.getCenterX(), rRange.getMaxY()); - // aInnerPoly.appendBezierSegment( - // aCenterBottom, - // aCenterBottom, - // rRange.getCenter()); - // - // const basegfx::B2DPoint aCenterTop(rRange.getCenterX(), rRange.getMinY()); - // aInnerPoly.appendBezierSegment( - // aCenterTop, - // aCenterTop, - // basegfx::B2DPoint(rRange.getMaxX(), rRange.getMinY())); - // - // aPoly.append(aInnerPoly); - // break; - // } - // case SID_DRAW_FREELINE: - // case SID_DRAW_FREELINE_NOFILL: - // { - // basegfx::B2DPolygon aInnerPoly; - // - // aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY())); - // - // aInnerPoly.appendBezierSegment( - // rRange.getMinimum(), - // basegfx::B2DPoint(rRange.getCenterX(), rRange.getMinY()), - // rRange.getCenter()); - // - // aInnerPoly.appendBezierSegment( - // basegfx::B2DPoint(rRange.getCenterX(), rRange.getMaxY()), - // rRange.getMaximum(), - // basegfx::B2DPoint(rRange.getMaxX(), rRange.getMinY())); - // - // if(SID_DRAW_FREELINE == nID) - // { - // aInnerPoly.append(rRange.getMaximum()); - // } - // else - // { - // aInnerPoly.setClosed(true); - // } - // - // aPoly.append(aInnerPoly); - // break; - // } - // case SID_DRAW_XPOLYGON: - // case SID_DRAW_XPOLYGON_NOFILL: - // { - // basegfx::B2DPolygon aInnerPoly; - // - // aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY())); - // aInnerPoly.append(rRange.getMinimum()); - // aInnerPoly.append(basegfx::B2DPoint(rRange.getCenterX(), rRange.getMinY())); - // aInnerPoly.append(rRange.getCenter()); - // aInnerPoly.append(basegfx::B2DPoint(rRange.getMaxX(), rRange.getCenterY())); - // aInnerPoly.append(rRange.getMaximum()); - // - // if(SID_DRAW_XPOLYGON_NOFILL == nID) - // { - // aInnerPoly.append(basegfx::B2DPoint(rRange.getCenterX(), rRange.getMaxY())); - // } - // else - // { - // aInnerPoly.setClosed(true); - // } - // - // aPoly.append(aInnerPoly); - // break; - // } - // case SID_DRAW_POLYGON: - // case SID_DRAW_POLYGON_NOFILL: - // { - // basegfx::B2DPolygon aInnerPoly; - // const double fWdt(rRange.getWidth()); - // const double fHgt(rRange.getHeight()); - // - // aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY())); - // aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.3, rRange.getMinY() + fHgt * 0.7)); - // aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMinY() + fHgt * 0.15)); - // aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.65, rRange.getMinY())); - // aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt, rRange.getMinY() + fHgt * 0.3)); - // aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.8, rRange.getMinY() + fHgt * 0.5)); - // aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.8, rRange.getMinY() + fHgt * 0.75)); - // aInnerPoly.append(basegfx::B2DPoint(rRange.getMaxY(), rRange.getMaxX())); - // - // if(SID_DRAW_POLYGON_NOFILL == nID) - // { - // aInnerPoly.append(basegfx::B2DPoint(rRange.getCenterX(), rRange.getMaxY())); - // } - // else - // { - // aInnerPoly.setClosed(true); - // } - // - // aPoly.append(aInnerPoly); - // break; - // } - // } - // - // pSdrPathObj->setB2DPolyPolygonInObjectCoordinates(aPoly); - // } - // else - // { - // DBG_ERROR("Object is NO path object"); - // } - // - // sdr::legacy::SetLogicRange(*pObj, rRange); - //} - // - //return pObj; } } // end of namespace sd diff --git a/sd/source/ui/func/fuconcs.cxx b/sd/source/ui/func/fuconcs.cxx index 124046e3718b..911548481e81 100644 --- a/sd/source/ui/func/fuconcs.cxx +++ b/sd/source/ui/func/fuconcs.cxx @@ -125,13 +125,10 @@ bool FuConstructCustomShape::MouseButtonDown(const MouseEvent& rMEvt) { const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y()); const basegfx::B2DPoint aLogicPos(mpWindow->GetInverseViewTransformation() * aPixelPos); - mpWindow->CaptureMouse(); - sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() ); - - mpView->BegCreateObj(aLogicPos, nDrgLog); - + mpView->BegCreateObj(aLogicPos, mpView->getMinMovLog()); SdrObject* pObj = mpView->GetCreateObj(); + if ( pObj ) { SetAttributes( pObj ); diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx index f848b11481ba..80e11f1e796c 100644 --- a/sd/source/ui/func/fuconrec.cxx +++ b/sd/source/ui/func/fuconrec.cxx @@ -202,22 +202,20 @@ bool FuConstructRectangle::MouseButtonDown(const MouseEvent& rMEvt) { const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y()); const basegfx::B2DPoint aLogicPos(mpWindow->GetInverseViewTransformation() * aPixelPos); - mpWindow->CaptureMouse(); - sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() ); if(OBJ_CAPTION == mpView->getSdrObjectCreationInfo().getIdent()) { bReturn = mpView->BegCreateCaptionObj( aLogicPos, basegfx::B2DVector(846.0, 846.0), // (4x2)cm - nDrgLog); + mpView->getMinMovLog()); } else { mpView->BegCreateObj( aLogicPos, - nDrgLog); + mpView->getMinMovLog()); } SdrObject* pObj = mpView->GetCreateObj(); @@ -850,15 +848,6 @@ SdrObject* FuConstructRectangle::CreateDefaultObject(const sal_uInt16 nID, const if(pSdrPathObj) { initializeDefaultSdrPathObjByObjectType(*pSdrPathObj, DefaultSdrPathObjType_Line, rRange, false); - //pSdrPathObj->initializeDefaultSdrPathObjBySlotID(nID, aRange); - - // TTTT - //const double fYMiddle((aRange.getMinY() + aRange.getMaxY()) * 0.5); - // - //::basegfx::B2DPolygon aB2DPolygon; - //aB2DPolygon.append(::basegfx::B2DPoint(aStart.getX(), fYMiddle)); - //aB2DPolygon.append(::basegfx::B2DPoint(aEnd.getX(), fYMiddle)); - //pSdrPathObj->setB2DPolyPolygonInObjectCoordinates(::basegfx::B2DPolyPolygon(aB2DPolygon)); } else { diff --git a/sd/source/ui/func/fuconstr.cxx b/sd/source/ui/func/fuconstr.cxx index 239e12aa2d5f..6a9d9990386d 100644 --- a/sd/source/ui/func/fuconstr.cxx +++ b/sd/source/ui/func/fuconstr.cxx @@ -98,8 +98,7 @@ bool FuConstruct::MouseButtonDown(const MouseEvent& rMEvt) const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y()); aMDPos = mpWindow->GetInverseViewTransformation() * aPixelPos; - // TTTT: evtl. unify fHitLog/fDrgLog/fHitTol at SdrView? - const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength()); + const double fHitLog(mpView->getHitTolLog()); if (rMEvt.IsLeft() && mpView->IsExtendedMouseEventDispatcherEnabled()) { @@ -109,8 +108,7 @@ bool FuConstruct::MouseButtonDown(const MouseEvent& rMEvt) if ( pHdl != NULL || mpView->IsMarkedObjHit(aMDPos, fHitLog) ) { - const double fTolerance(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(DRGPIX, 0.0)).getLength()); - mpView->BegDragObj(aMDPos, pHdl, fTolerance); + mpView->BegDragObj(aMDPos, pHdl, mpView->getMinMovLog()); bReturn = true; } else if ( mpView->areSdrObjectsSelected() ) @@ -199,7 +197,6 @@ bool FuConstruct::MouseButtonUp(const MouseEvent& rMEvt) if ( mpView && !mpView->IsAction() ) { mpWindow->ReleaseMouse(); - sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() ); if ( !mpView->areSdrObjectsSelected() ) { @@ -207,16 +204,15 @@ bool FuConstruct::MouseButtonUp(const MouseEvent& rMEvt) if (!mpView->PickObj(aPnt, mpView->getHitTolLog(), pObj)) { - const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength()); - mpView->MarkObj(aPnt, fHitLog); + mpView->MarkObj(aPnt, mpView->getHitTolLog()); } mpViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON); } else if (rMEvt.IsLeft() && !rMEvt.IsShift() && !rMEvt.IsMod1() && !rMEvt.IsMod2() && !bSelectionChanged && - fabs(aPnt.getX() - aMDPos.getX()) < nDrgLog && - fabs(aPnt.getY() - aMDPos.getY()) < nDrgLog) + fabs(aPnt.getX() - aMDPos.getX()) < mpView->getMinMovLog() && + fabs(aPnt.getY() - aMDPos.getY()) < mpView->getMinMovLog()) { /************************************************************** * Toggle zw. Selektion und Rotation diff --git a/sd/source/ui/func/fuconuno.cxx b/sd/source/ui/func/fuconuno.cxx index 301a0d98ab61..ade46dcd6204 100644 --- a/sd/source/ui/func/fuconuno.cxx +++ b/sd/source/ui/func/fuconuno.cxx @@ -106,8 +106,7 @@ bool FuConstructUnoControl::MouseButtonDown(const MouseEvent& rMEvt) const basegfx::B2DPoint aLogicPos(mpWindow->GetInverseViewTransformation() * aPixelPos); mpWindow->CaptureMouse(); - const double fTolerance(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(DRGPIX, 0.0)).getLength()); - mpView->BegCreateObj(aLogicPos, fTolerance); + mpView->BegCreateObj(aLogicPos, mpView->getMinMovLog()); bReturn = true; } return bReturn; diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx index 82ab8ebafdb5..56b10cf8e707 100644 --- a/sd/source/ui/func/fudraw.cxx +++ b/sd/source/ui/func/fudraw.cxx @@ -204,12 +204,10 @@ bool FuDraw::MouseButtonDown(const MouseEvent& rMEvt) mpView->SetResizeAtCenter(bCenter); } - const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength()); - // #76572# look only for HelpLines when they are visible (!) bool bHelpLine(false); if(mpView->IsHlplVisible()) - bHelpLine = mpView->PickHelpLine(aMDPos, fHitLog, nHelpLine); + bHelpLine = mpView->PickHelpLine(aMDPos, mpView->getHitTolLog(), nHelpLine); bool bHitHdl = (mpView->PickHandle(aMDPos) != NULL); if ( bHelpLine @@ -730,7 +728,7 @@ bool FuDraw::SetPointer(SdrObject* pObj, const basegfx::B2DPoint& rPos) if (bAnimationInfo || bImageMapInfo) { - const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength()); + const double fHitLog(mpView->getHitTolLog()); const double f2HitLog(fHitLog * 2.0); const basegfx::B2DPoint aHitPosR(rPos.getX() + f2HitLog, rPos.getY()); const basegfx::B2DPoint aHitPosL(rPos.getX() - f2HitLog, rPos.getY()); @@ -846,8 +844,7 @@ void FuDraw::DoubleClick(const MouseEvent& rMEvt) { // hit group -> select subobject mpView->UnmarkAllObj(); - const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength()); - mpView->MarkObj(aMDPos, fHitLog, rMEvt.IsShift(), true); + mpView->MarkObj(aMDPos, mpView->getHitTolLog(), rMEvt.IsShift(), true); } } } diff --git a/sd/source/ui/func/fuediglu.cxx b/sd/source/ui/func/fuediglu.cxx index ca055c872264..5bf8dd9eb21a 100644 --- a/sd/source/ui/func/fuediglu.cxx +++ b/sd/source/ui/func/fuediglu.cxx @@ -117,8 +117,6 @@ bool FuEditGluePoints::MouseButtonDown(const MouseEvent& rMEvt) if (rMEvt.IsLeft()) { bReturn = true; - const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength()); - const double fDrgLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(DRGPIX, 0.0)).getLength()); mpWindow->CaptureMouse(); SdrViewEvent aVEvt; @@ -140,7 +138,7 @@ bool FuEditGluePoints::MouseButtonDown(const MouseEvent& rMEvt) if (pHdl) { // Handle draggen - mpView->BegDragObj(aMDPos, aVEvt.mpHdl, fDrgLog); + mpView->BegDragObj(aMDPos, aVEvt.mpHdl, mpView->getMinMovLog()); } } else if (eHit == SDRHIT_MARKEDOBJECT && mpView->IsInsGluePointMode()) @@ -165,7 +163,7 @@ bool FuEditGluePoints::MouseButtonDown(const MouseEvent& rMEvt) /****************************************************************** * Objekt verschieben ******************************************************************/ - mpView->BegDragObj(aMDPos, NULL, fDrgLog); + mpView->BegDragObj(aMDPos, NULL, mpView->getMinMovLog()); } else if (eHit == SDRHIT_GLUEPOINT) { @@ -180,7 +178,7 @@ bool FuEditGluePoints::MouseButtonDown(const MouseEvent& rMEvt) if (pHdl) { - mpView->BegDragObj(aMDPos, pHdl, fDrgLog); + mpView->BegDragObj(aMDPos, pHdl, mpView->getMinMovLog()); } } else @@ -199,11 +197,11 @@ bool FuEditGluePoints::MouseButtonDown(const MouseEvent& rMEvt) { if (rMEvt.IsMod2()) { - bMarked = mpView->MarkNextObj(aMDPos, fHitLog, rMEvt.IsShift()); + bMarked = mpView->MarkNextObj(aMDPos, mpView->getHitTolLog(), rMEvt.IsShift()); } else { - bMarked = mpView->MarkObj(aMDPos, fHitLog, rMEvt.IsShift()); + bMarked = mpView->MarkObj(aMDPos, mpView->getHitTolLog(), rMEvt.IsShift()); } } @@ -211,7 +209,7 @@ bool FuEditGluePoints::MouseButtonDown(const MouseEvent& rMEvt) (!rMEvt.IsShift() || eHit == SDRHIT_MARKEDOBJECT)) { // Objekt verschieben - mpView->BegDragObj(aMDPos, aVEvt.mpHdl, fDrgLog); + mpView->BegDragObj(aMDPos, aVEvt.mpHdl, mpView->getMinMovLog()); } else if (mpView->areSdrObjectsSelected()) { @@ -283,12 +281,10 @@ bool FuEditGluePoints::MouseButtonUp(const MouseEvent& rMEvt) } FuDraw::MouseButtonUp(rMEvt); - - sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() ); Point aPos = mpWindow->PixelToLogic( rMEvt.GetPosPixel() ); - if (fabs(aMDPos.getX() - aPos.getX()) < nDrgLog && - fabs(aMDPos.getY() - aPos.getY()) < nDrgLog && + if (fabs(aMDPos.getX() - aPos.getX()) < mpView->getMinMovLog() && + fabs(aMDPos.getY() - aPos.getY()) < mpView->getMinMovLog() && !rMEvt.IsShift() && !rMEvt.IsMod2()) { SdrViewEvent aVEvt; diff --git a/sd/source/ui/func/fuformatpaintbrush.cxx b/sd/source/ui/func/fuformatpaintbrush.cxx index 0c54d078bac9..9b15c5e87c75 100644 --- a/sd/source/ui/func/fuformatpaintbrush.cxx +++ b/sd/source/ui/func/fuformatpaintbrush.cxx @@ -105,13 +105,12 @@ bool FuFormatPaintBrush::MouseButtonDown(const MouseEvent& rMEvt) { SdrViewEvent aVEvt; SdrHitKind eHit = mpView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt); - const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength()); if( (eHit == SDRHIT_TEXTEDIT) || (eHit == SDRHIT_TEXTEDITOBJ && ( mpViewShell->GetFrameView()->IsQuickEdit() || dynamic_cast< sdr::table::SdrTableObj* >( aVEvt.mpObj ) != NULL ) )) { SdrObject* pPickObj=0; const basegfx::B2DPoint aPnt(mpWindow->GetInverseViewTransformation() * basegfx::B2DPoint(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y())); - mpView->PickObj( aPnt, fHitLog, pPickObj, SDRSEARCH_PICKMARKABLE); + mpView->PickObj( aPnt, mpView->getHitTolLog(), pPickObj, SDRSEARCH_PICKMARKABLE); if( pPickObj && !pPickObj->IsEmptyPresObj() ) { @@ -150,7 +149,7 @@ bool FuFormatPaintBrush::MouseButtonDown(const MouseEvent& rMEvt) const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y()); const basegfx::B2DPoint aLogicPos(mpWindow->GetInverseViewTransformation() * aPixelPos); - mpView->MarkObj(aLogicPos, fHitLog, bToggle, false); + mpView->MarkObj(aLogicPos, mpView->getHitTolLog(), bToggle, false); return true; } @@ -170,10 +169,9 @@ bool FuFormatPaintBrush::MouseMove(const MouseEvent& rMEvt) } else { - const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength()); SdrObject* pObj=0; const basegfx::B2DPoint aPnt(mpWindow->GetInverseViewTransformation() * basegfx::B2DPoint(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y())); - bool bOverMarkableObject = mpView->PickObj( aPnt, fHitLog, pObj, SDRSEARCH_PICKMARKABLE); + bool bOverMarkableObject = mpView->PickObj( aPnt, mpView->getHitTolLog(), pObj, SDRSEARCH_PICKMARKABLE); if(bOverMarkableObject && pObj && HasContentForThisType(*pObj) ) mpWindow->SetPointer(Pointer(POINTER_FILL)); diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx index 80e5a76c3416..20d0fffa6c0f 100644 --- a/sd/source/ui/func/fuinsert.cxx +++ b/sd/source/ui/func/fuinsert.cxx @@ -119,11 +119,6 @@ FunctionReference FuInsertGraphic::Create( ViewShell* pViewSh, ::sd::Window* pWi return xFunc; } -// TTTT needed? Check! -//#ifdef _MSC_VER -//#pragma optimize ( "", off ) -//#endif - void FuInsertGraphic::DoExecute( SfxRequest& ) { SvxOpenGraphicDialog aDlg(SdResId(STR_INSERTGRAPHIC)); @@ -169,11 +164,6 @@ void FuInsertGraphic::DoExecute( SfxRequest& ) } } -// TTTT needed? Check! -//#ifdef _MSC_VER -//#pragma optimize ( "", on ) -//#endif - /************************************************************************* |* |* FuInsertClipboard::Konstruktor diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx index 0a17dbb97ea4..02389d66652b 100644 --- a/sd/source/ui/func/fupoor.cxx +++ b/sd/source/ui/func/fupoor.cxx @@ -707,7 +707,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) { if(0 == pHdl->GetPointNum()) { - if(pEdgeObj->GetConnection(true).GetObject()) + if(pEdgeObj->GetSdrObjectConnection(true)) { bIsMoveOfConnectedHandle = true; } @@ -715,7 +715,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) if(1 == pHdl->GetPointNum()) { - if(pEdgeObj->GetConnection(false).GetObject()) + if(pEdgeObj->GetSdrObjectConnection(false)) { bIsMoveOfConnectedHandle = true; } @@ -933,9 +933,6 @@ bool FuPoor::MouseMove(const MouseEvent& ) void FuPoor::SelectionHasChanged() { - // Not needed TTTT - // const SdrHdlList& rHdlList = mpView->GetHdlList(); - // ((SdrHdlList&)rHdlList).ResetFocusHdl(); } /************************************************************************* @@ -990,10 +987,9 @@ IMPL_LINK( FuPoor, DragHdl, Timer *, EMPTYARG ) { if( mpView ) { - sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() ); SdrHdl* pHdl = mpView->PickHandle(aMDPos); - if ( pHdl==NULL && mpView->IsMarkedObjHit(aMDPos, nHitLog) + if ( pHdl==NULL && mpView->IsMarkedObjHit(aMDPos, mpView->getHitTolLog()) && !mpView->IsPresObjSelected(false, true) ) { mpWindow->ReleaseMouse(); diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index 6b22c69631d1..9c5da26e695c 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -170,9 +170,6 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) return true; } - const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength()); - const double fDrgLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(DRGPIX, 0.0)).getLength()); - // The following code is executed for right clicks as well as for left // clicks in order to modify the selection for the right button as a // preparation for the context menu. The functions BegMarkObject() and @@ -223,7 +220,7 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) if(!bTextEdit && !mpDocSh->IsReadOnly() - && ((mpView->IsMarkedObjHit(aMDPos, fHitLog) && !rMEvt.IsShift() && !rMEvt.IsMod2()) || pHdl != NULL) + && ((mpView->IsMarkedObjHit(aMDPos, mpView->getHitTolLog()) && !rMEvt.IsShift() && !rMEvt.IsMod2()) || pHdl != NULL) && (rMEvt.GetClicks() != 2) ) { @@ -246,14 +243,14 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) } if ( ! rMEvt.IsRight()) - mpView->BegDragObj(aMDPos, pHdl, fDrgLog); + mpView->BegDragObj(aMDPos, pHdl, mpView->getMinMovLog()); bReturn = true; } else { if (!rMEvt.IsMod2() && mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, SDRSEARCH_PICKMACRO)) { - mpView->BegMacroObj(aMDPos, fHitLog, pObj, mpWindow); + mpView->BegMacroObj(aMDPos, mpView->getHitTolLog(), pObj, mpWindow); bReturn = true; } else if ( bTextEdit ) @@ -387,7 +384,7 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) { if ( rMEvt.IsMod2() ) { - bMarked = mpView->MarkNextObj(aMDPos, fHitLog, rMEvt.IsShift() ); + bMarked = mpView->MarkNextObj(aMDPos, mpView->getHitTolLog(), rMEvt.IsShift() ); } else { @@ -399,7 +396,7 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) bToggle = true; } - bMarked = mpView->MarkObj(aMDPos, fHitLog, bToggle, false); + bMarked = mpView->MarkObj(aMDPos, mpView->getHitTolLog(), bToggle, false); } } @@ -407,7 +404,7 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) { if ( !bReadOnly && bMarked && - (!rMEvt.IsShift() || mpView->IsMarkedObjHit(aMDPos, fHitLog))) + (!rMEvt.IsShift() || mpView->IsMarkedObjHit(aMDPos, mpView->getHitTolLog()))) { /********************************************************** * Objekt verschieben @@ -416,7 +413,7 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) pHdl=mpView->PickHandle(aMDPos); if ( ! rMEvt.IsRight()) - mpView->BegDragObj(aMDPos, pHdl, fDrgLog); + mpView->BegDragObj(aMDPos, pHdl, mpView->getMinMovLog()); } else { @@ -454,7 +451,7 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) * Handle draggen ******************************************************************/ if ( ! rMEvt.IsRight()) - mpView->BegDragObj(aMDPos, aVEvt.mpHdl, fDrgLog); + mpView->BegDragObj(aMDPos, aVEvt.mpHdl, mpView->getMinMovLog()); } else if (eHit == SDRHIT_MARKEDOBJECT && nEditMode == SID_BEZIER_INSERT) { @@ -484,7 +481,7 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) * Objekt verschieben ******************************************************************/ if ( ! rMEvt.IsRight()) - mpView->BegDragObj(aMDPos, NULL, fDrgLog); + mpView->BegDragObj(aMDPos, NULL, mpView->getMinMovLog()); } else if (eHit == SDRHIT_HANDLE) { @@ -536,7 +533,7 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) if(pHdl) { - mpView->BegDragObj(aMDPos, pHdl, fDrgLog); + mpView->BegDragObj(aMDPos, pHdl, mpView->getMinMovLog()); } else { @@ -552,7 +549,7 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) pHdl = mpView->PickHandle(aMDPos); if(pHdl) if ( ! rMEvt.IsRight()) - mpView->BegDragObj(aMDPos, pHdl, fDrgLog); + mpView->BegDragObj(aMDPos, pHdl, mpView->getMinMovLog()); } } else @@ -571,11 +568,11 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) { if (rMEvt.IsMod2()) { - bMarked = mpView->MarkNextObj(aMDPos, fHitLog, rMEvt.IsShift()); + bMarked = mpView->MarkNextObj(aMDPos, mpView->getHitTolLog(), rMEvt.IsShift()); } else { - bMarked = mpView->MarkObj(aMDPos, fHitLog, rMEvt.IsShift(), false); + bMarked = mpView->MarkObj(aMDPos, mpView->getHitTolLog(), rMEvt.IsShift(), false); } } @@ -584,7 +581,7 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) { // Objekt verschieben if ( ! rMEvt.IsRight()) - mpView->BegDragObj(aMDPos, aVEvt.mpHdl, fDrgLog); + mpView->BegDragObj(aMDPos, aVEvt.mpHdl, mpView->getMinMovLog()); } else if (mpView->areSdrObjectsSelected()) { @@ -703,9 +700,6 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) // force trigger selection change to get bSelectionChanged // set in FuSelection::SelectionHasChanged() call eventually // mpView->forceSelectionChange(); TTTT: Should be done in HasMarkablePoints - - const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength()); - const double fDrgLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(DRGPIX, 0.0)).getLength()); const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y()); const basegfx::B2DPoint aLogicPos(mpWindow->GetInverseViewTransformation() * aPixelPos); @@ -732,8 +726,8 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) if (!rMEvt.IsShift() && !rMEvt.IsMod1() && !rMEvt.IsMod2() && !bSelectionChanged && - fabs(aLogicPos.getX() - aMDPos.getX()) < fDrgLog && - fabs(aLogicPos.getY() - aMDPos.getY()) < fDrgLog) + fabs(aLogicPos.getX() - aMDPos.getX()) < mpView->getMinMovLog() && + fabs(aLogicPos.getY() - aMDPos.getY()) < mpView->getMinMovLog()) { /************************************************************** * Toggle zw. Selektion und Rotation @@ -799,11 +793,11 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) } else if (rMEvt.IsMod1() && !rMEvt.IsMod2() - && fabs(aLogicPos.getX() - aMDPos.getX()) < fDrgLog - && fabs(aLogicPos.getY() - aMDPos.getY()) < fDrgLog) + && fabs(aLogicPos.getX() - aMDPos.getX()) < mpView->getMinMovLog() + && fabs(aLogicPos.getY() - aMDPos.getY()) < mpView->getMinMovLog()) { // Gruppe betreten - mpView->MarkObj(aLogicPos, fHitLog, rMEvt.IsShift(), rMEvt.IsMod1()); + mpView->MarkObj(aLogicPos, mpView->getHitTolLog(), rMEvt.IsShift(), rMEvt.IsMod1()); } if (mpView->IsAction() ) @@ -916,8 +910,8 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) mpView->EndAction(); const basegfx::B2DVector aDelta(aMDPos - aLogicPos); - if(fabs(aDelta.getX()) < fDrgLog - && fabs(aDelta.getY()) < fDrgLog + if(fabs(aDelta.getX()) < mpView->getMinMovLog() + && fabs(aDelta.getY()) < mpView->getMinMovLog() && !rMEvt.IsShift() && !rMEvt.IsMod2()) { @@ -933,11 +927,11 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) } } else if (!rMEvt.IsShift() && rMEvt.IsMod1() && !rMEvt.IsMod2() && - fabs(aLogicPos.getX() - aMDPos.getX()) < fDrgLog && - fabs(aLogicPos.getY() - aMDPos.getY()) < fDrgLog) + fabs(aLogicPos.getX() - aMDPos.getX()) < mpView->getMinMovLog() && + fabs(aLogicPos.getY() - aMDPos.getY()) < mpView->getMinMovLog()) { // Gruppe betreten - mpView->MarkObj(aLogicPos, fHitLog, false, rMEvt.IsMod1()); + mpView->MarkObj(aLogicPos, mpView->getHitTolLog(), false, rMEvt.IsMod1()); } @@ -1212,8 +1206,7 @@ bool FuSelection::AnimateObj(SdrObject* pObj, const basegfx::B2DPoint& rPos) bool bAnimated(false); const bool bClosed(pObj->IsClosedObj()); const bool bFilled(bClosed? pObj->HasFillStyle() : false); - const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength()); - double f2HitLog(fHitLog * 2); + double f2HitLog(mpView->getHitTolLog() * 2); const basegfx::B2DPoint aHitPosR(rPos.getX() + f2HitLog, rPos.getY()); const basegfx::B2DPoint aHitPosL(rPos.getX() - f2HitLog, rPos.getY()); @@ -1222,10 +1215,10 @@ bool FuSelection::AnimateObj(SdrObject* pObj, const basegfx::B2DPoint& rPos) if ( !bClosed || !bFilled || - (SdrObjectPrimitiveHit(*pObj, aHitPosR, fHitLog, *mpView, false, 0) && - SdrObjectPrimitiveHit(*pObj, aHitPosL, fHitLog, *mpView, false, 0) && - SdrObjectPrimitiveHit(*pObj, aHitPosT, fHitLog, *mpView, false, 0) && - SdrObjectPrimitiveHit(*pObj, aHitPosB, fHitLog, *mpView, false, 0) ) ) + (SdrObjectPrimitiveHit(*pObj, aHitPosR, mpView->getHitTolLog(), *mpView, false, 0) && + SdrObjectPrimitiveHit(*pObj, aHitPosL, mpView->getHitTolLog(), *mpView, false, 0) && + SdrObjectPrimitiveHit(*pObj, aHitPosT, mpView->getHitTolLog(), *mpView, false, 0) && + SdrObjectPrimitiveHit(*pObj, aHitPosB, mpView->getHitTolLog(), *mpView, false, 0) ) ) { if ( mpDoc->GetIMapInfo( pObj ) ) { @@ -1502,9 +1495,8 @@ bool FuSelection::cancel() SdrObject* FuSelection::pickObject (const basegfx::B2DPoint& rTestPoint) { SdrObject* pObject = 0; - const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength()); - mpView->PickObj(rTestPoint, fHitLog, pObject, SDRSEARCH_PICKMARKABLE); + mpView->PickObj(rTestPoint, mpView->getHitTolLog(), pObject, SDRSEARCH_PICKMARKABLE); return pObject; } diff --git a/sd/source/ui/func/fusnapln.cxx b/sd/source/ui/func/fusnapln.cxx index d6f12fe70a72..25c554d09a8c 100644 --- a/sd/source/ui/func/fusnapln.cxx +++ b/sd/source/ui/func/fusnapln.cxx @@ -99,8 +99,7 @@ void FuSnapLine::DoExecute( SfxRequest& rReq ) if(basegfx::fTools::moreOrEqual(aLinePos.getX(), 0.0)) { aLinePos = mpWindow->GetInverseViewTransformation() * aLinePos; - const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength()); - bLineExist = mpView->PickHelpLine(aLinePos, fHitLog, nHelpLine); + bLineExist = mpView->PickHelpLine(aLinePos, mpView->getHitTolLog(), nHelpLine); if(bLineExist) { diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index 81b8b06fd33a..a939a7400efb 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -319,13 +319,10 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt) if (bMacro && mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, SDRSEARCH_PICKMACRO)) { // Makro - const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength()); - mpView->BegMacroObj(aMDPos, fHitLog, pObj, mpWindow); + mpView->BegMacroObj(aMDPos, mpView->getHitTolLog(), pObj, mpWindow); } else { - const double fTolerance(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(DRGPIX, 0.0)).getLength()); - if (eHit != SDRHIT_HANDLE) { // Selektion aufheben @@ -444,7 +441,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt) eHit = mpView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt); if( (eHit == SDRHIT_HANDLE) || (eHit == SDRHIT_MARKEDOBJECT) ) { - mpView->BegDragObj(aMDPos, aVEvt.mpHdl, fTolerance); + mpView->BegDragObj(aMDPos, aVEvt.mpHdl, mpView->getMinMovLog()); } } bReturn = true; @@ -458,7 +455,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt) **********************************************************/ mpView->setSdrObjectCreationInfo(SdrObjectCreationInfo(static_cast< sal_uInt16 >(OBJ_TEXT))); mpView->SetViewEditMode(SDREDITMODE_CREATE); - mpView->BegCreateObj(aMDPos, fTolerance); + mpView->BegCreateObj(aMDPos, mpView->getMinMovLog()); } else { @@ -670,7 +667,6 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) return (true); // Event von der SdrView ausgewertet bool bEmptyTextObj = false; - const double fTolerance(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(DRGPIX, 0.0)).getLength()); if (mxTextObj.is()) { @@ -706,8 +702,8 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) if ( mpView->IsRotateAllowed() && mpViewShell->GetFrameView()->IsClickChangeRotation() && (rMEvt.GetClicks() != 2) && !rMEvt.IsShift() && !rMEvt.IsMod1() && !rMEvt.IsMod2() && !rMEvt.IsRight() && - fabs(aLogicPos.getX() - aMDPos.getX()) < fTolerance && - fabs(aLogicPos.getY() - aMDPos.getY()) < fTolerance) + fabs(aLogicPos.getX() - aMDPos.getX()) < mpView->getMinMovLog() && + fabs(aLogicPos.getY() - aMDPos.getY()) < mpView->getMinMovLog()) { // toggle to rotation mode mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_OBJECT_ROTATE, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD ); @@ -794,8 +790,8 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) mpWindow->ReleaseMouse(); if ( mpView && !mpView->areSdrObjectsSelected() && - fabs(aMDPos.getX() - aLogicPos.getX()) < fTolerance && - fabs(aMDPos.getY() - aLogicPos.getY()) < fTolerance && + fabs(aMDPos.getX() - aLogicPos.getX()) < mpView->getMinMovLog() && + fabs(aMDPos.getY() - aLogicPos.getY()) < mpView->getMinMovLog() && !rMEvt.IsShift() && !rMEvt.IsMod2() ) { SdrViewEvent aVEvt; @@ -819,15 +815,15 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) **********************************************************************/ mpView->setSdrObjectCreationInfo(SdrObjectCreationInfo(static_cast< sal_uInt16 >(OBJ_TEXT))); mpView->SetViewEditMode(SDREDITMODE_CREATE); - mpView->BegCreateObj(aMDPos, fTolerance); + mpView->BegCreateObj(aMDPos, mpView->getMinMovLog()); bool bSnapEnabled = mpView->IsSnapEnabled(); if (bSnapEnabled) mpView->SetSnapEnabled(false); - aLogicPos.setX(aLogicPos.getX() + fTolerance + fTolerance); - aLogicPos.setY(aLogicPos.getY() + fTolerance + fTolerance); + aLogicPos.setX(aLogicPos.getX() + (mpView->getMinMovLog() * 2.0)); + aLogicPos.setY(aLogicPos.getY() + (mpView->getMinMovLog() * 2.0)); mpView->MovAction(aLogicPos); mxTextObj.reset( dynamic_cast< SdrTextObj* >( mpView->GetCreateObj() ) ); diff --git a/sd/source/ui/func/fuzoom.cxx b/sd/source/ui/func/fuzoom.cxx index 081c4c00ba8e..df7c58987096 100644 --- a/sd/source/ui/func/fuzoom.cxx +++ b/sd/source/ui/func/fuzoom.cxx @@ -195,9 +195,8 @@ bool FuZoom::MouseButtonUp(const MouseEvent& rMEvt) { // Zoom const basegfx::B2DVector aZoomSizePixel(mpWindow->GetInverseViewTransformation() * maZoomRange.getRange()); - const double fTol(DRGPIX + DRGPIX); - if ( aZoomSizePixel.getX() < fTol && aZoomSizePixel.getY() < fTol ) + if ( aZoomSizePixel.getX() < mpView->getMinMovLog() && aZoomSizePixel.getY() < mpView->getMinMovLog() ) { // Klick auf der Stelle: Zoomfaktor verdoppeln const basegfx::B2DPoint aPos(mpWindow->GetInverseViewTransformation() * aPosPix); diff --git a/sd/source/ui/inc/fupoor.hxx b/sd/source/ui/inc/fupoor.hxx index 2687071379fa..44519c43339d 100644 --- a/sd/source/ui/inc/fupoor.hxx +++ b/sd/source/ui/inc/fupoor.hxx @@ -58,7 +58,6 @@ class FuPoor : public SimpleReferenceComponent { public: static const int HITPIX = 2; // Hit-Toleranz in Pixel - static const int DRGPIX = 2; // Drag MinMove in Pixel virtual void DoExecute( SfxRequest& rReq ); diff --git a/sd/source/ui/inc/sdpreslt.hxx b/sd/source/ui/inc/sdpreslt.hxx index 08a7d5db797d..2fc2f7abace4 100644 --- a/sd/source/ui/inc/sdpreslt.hxx +++ b/sd/source/ui/inc/sdpreslt.hxx @@ -72,7 +72,6 @@ private: const SfxItemSet& mrOutAttrs; std::vector< String > maLayoutNames; - // List* mpLayoutNames; String maName; // Layoutname oder Dateiname sal_uInt32 mnLayoutCount; // Anzahl, der im Dokument vorhandenen MasterPages diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 964f2de57b5e..0a63c00c494f 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -808,11 +808,10 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) case SID_DELETE_SNAPITEM: { const basegfx::B2DPoint aMPos(GetActiveWindow()->GetInverseViewTransformation() * maMousePos); - const double fHitLog(basegfx::B2DVector(GetActiveWindow()->GetInverseViewTransformation() * basegfx::B2DVector(FuPoor::HITPIX, 0.0)).getLength()); sal_uInt32 nHelpLine; mbMousePosFreezed = false; - if( mpDrawView->PickHelpLine( aMPos, fHitLog, nHelpLine) ) + if( mpDrawView->PickHelpLine( aMPos, mpView->getHitTolLog(), nHelpLine) ) { if(mpDrawView->GetSdrPageView()) { diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index 55bcd4c43649..3f79f00dea0a 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -987,10 +987,9 @@ void DrawViewShell::ExecStatusBar(SfxRequest& rReq) void DrawViewShell::GetSnapItemState( SfxItemSet &rSet ) { const basegfx::B2DPoint aMPos(GetActiveWindow()->GetInverseViewTransformation() * maMousePos); - const double fHitLog(basegfx::B2DVector(GetActiveWindow()->GetInverseViewTransformation() * basegfx::B2DVector(FuPoor::HITPIX, 0.0)).getLength()); sal_uInt32 nHelpLine; - if ( mpDrawView->PickHelpLine(aMPos, fHitLog, nHelpLine) ) + if ( mpDrawView->PickHelpLine(aMPos, mpView->getHitTolLog(), nHelpLine) ) { if(mpDrawView->GetSdrPageView()) { diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index 3ca68b3880e2..ecbbf4377073 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -529,7 +529,6 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin) // Ist ein Fangobjekt unter dem Mauszeiger? basegfx::B2DPoint aMPos(pWin->GetInverseViewTransformation() * maMousePos); - const double fHitLog(basegfx::B2DVector(GetActiveWindow()->GetInverseViewTransformation() * basegfx::B2DVector(FuPoor::HITPIX, 0.0)).getLength()); sal_uInt32 nHelpLine; // fuer Klebepunkt SdrObject* pObj = NULL; @@ -542,7 +541,7 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin) //pFldItem = pOLV->GetFieldUnderMousePointer(); // Hilfslinie - if ( mpDrawView->PickHelpLine( aMPos, fHitLog, nHelpLine) ) + if ( mpDrawView->PickHelpLine( aMPos, mpView->getHitTolLog(), nHelpLine) ) { if(mpDrawView->GetSdrPageView()) { diff --git a/sd/source/ui/view/drviewsc.cxx b/sd/source/ui/view/drviewsc.cxx index c7ebd3a2c315..7aee8c9e207d 100644 --- a/sd/source/ui/view/drviewsc.cxx +++ b/sd/source/ui/view/drviewsc.cxx @@ -472,7 +472,6 @@ void DrawViewShell::FuTemp03(SfxRequest& rReq) case SID_FLIP_HORIZONTAL: { mpDrawView->MirrorMarkedObjHorizontal(); - // mpDrawView->MirrorAllMarkedHorizontal(); TTTT: Which one? Cancel(); rReq.Done (); } diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index 48aa1a9241fd..a1ad1e794950 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -517,8 +517,10 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, pRem->pClone = pObj; aConnectorContainer.Insert(pRem, CONTAINER_APPEND); - if(pObj->IsSdrEdgeObj()) + if(dynamic_cast< SdrEdgeObj* >(pObj)) + { nConnectorCount++; + } } // #83525# try to re-establish connections at clones @@ -533,16 +535,16 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, if(pOrigEdge && pCloneEdge) { // test first connection - SdrObjConnection& rConn0 = pOrigEdge->GetConnection(false); - SdrObject* pConnObj = rConn0.GetObject(); + SdrObject* pConnObj = pOrigEdge->GetSdrObjectConnection(false); + if(pConnObj) { SdrObject* pConnClone = ImpGetClone(aConnectorContainer, pConnObj); if(pConnClone) { // if dest obj was cloned, too, re-establish connection - pCloneEdge->ConnectToNode(false, pConnClone); - pCloneEdge->GetConnection(false).SetConnectorId(rConn0.GetConnectorId()); + pCloneEdge->ConnectToSdrObject(false, pConnClone); + pCloneEdge->SetConnectorId(false, pOrigEdge->GetConnectorId(false)); } else { @@ -551,7 +553,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, if(rProvider.hasUserGluePoints()) { - const sdr::glue::GluePoint* pCandidate = rProvider.findUserGluePointByID(rConn0.GetConnectorId()); + const sdr::glue::GluePoint* pCandidate = rProvider.findUserGluePointByID(pOrigEdge->GetConnectorId(false)); if(pCandidate) { @@ -564,16 +566,16 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, } // test second connection - SdrObjConnection& rConn1 = pOrigEdge->GetConnection(true); - pConnObj = rConn1.GetObject(); + pConnObj = pOrigEdge->GetSdrObjectConnection(true); + if(pConnObj) { SdrObject* pConnClone = ImpGetClone(aConnectorContainer, pConnObj); if(pConnClone) { // if dest obj was cloned, too, re-establish connection - pCloneEdge->ConnectToNode(true, pConnClone); - pCloneEdge->GetConnection(true).SetConnectorId(rConn1.GetConnectorId()); + pCloneEdge->ConnectToSdrObject(true, pConnClone); + pCloneEdge->SetConnectorId(true, pOrigEdge->GetConnectorId(true)); } else { @@ -582,7 +584,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, if(rProvider.hasUserGluePoints()) { - const sdr::glue::GluePoint* pCandidate = rProvider.findUserGluePointByID(rConn1.GetConnectorId()); + const sdr::glue::GluePoint* pCandidate = rProvider.findUserGluePointByID(pOrigEdge->GetConnectorId(true)); if(pCandidate) { @@ -1350,9 +1352,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, String aName( rColItem.GetName() ); SfxItemSet aSet( mpDoc->GetItemPool() ); const bool bClosed(pPickObj->IsClosedObj()); - ::sd::Window* pWin = mpViewSh->GetActiveWindow(); - const double fHitLog(basegfx::B2DVector(pWin->GetInverseViewTransformation() * basegfx::B2DVector(FuPoor::HITPIX, 0.0)).getLength()); - double f2HitLog(fHitLog * 2); + double f2HitLog(getHitTolLog() * 2); const basegfx::B2DPoint aHitPosR(rPos.getX() + f2HitLog, rPos.getY()); const basegfx::B2DPoint aHitPosL(rPos.getX() - f2HitLog, rPos.getY()); @@ -1360,10 +1360,10 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, const basegfx::B2DPoint aHitPosB(rPos.getX(), rPos.getY() - f2HitLog); if( bClosed && - SdrObjectPrimitiveHit(*pPickObj, aHitPosR, fHitLog, *this, false, 0) && - SdrObjectPrimitiveHit(*pPickObj, aHitPosL, fHitLog, *this, false, 0) && - SdrObjectPrimitiveHit(*pPickObj, aHitPosT, fHitLog, *this, false, 0) && - SdrObjectPrimitiveHit(*pPickObj, aHitPosB, fHitLog, *this, false, 0) ) + SdrObjectPrimitiveHit(*pPickObj, aHitPosR, getHitTolLog(), *this, false, 0) && + SdrObjectPrimitiveHit(*pPickObj, aHitPosL, getHitTolLog(), *this, false, 0) && + SdrObjectPrimitiveHit(*pPickObj, aHitPosT, getHitTolLog(), *this, false, 0) && + SdrObjectPrimitiveHit(*pPickObj, aHitPosB, getHitTolLog(), *this, false, 0) ) { // area fill if(eFill == XFILL_SOLID ) |