1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 29*cdf0e10cSrcweir #include "precompiled_svx.hxx" 30*cdf0e10cSrcweir #include <editeng/eeitem.hxx> 31*cdf0e10cSrcweir 32*cdf0e10cSrcweir #include "svx/svdstr.hrc" // Namen aus der Resource 33*cdf0e10cSrcweir #include "svx/svdglob.hxx" // StringCache 34*cdf0e10cSrcweir #include <svx/svdpagv.hxx> 35*cdf0e10cSrcweir #include <svx/svdmrkv.hxx> 36*cdf0e10cSrcweir #include <svx/svdedxv.hxx> 37*cdf0e10cSrcweir #include <svx/svdobj.hxx> 38*cdf0e10cSrcweir #include <svx/svdopath.hxx> // fuer GetContext 39*cdf0e10cSrcweir #include <svx/svdograf.hxx> // fuer GetContext 40*cdf0e10cSrcweir #include <svx/svdomedia.hxx> // fuer GetContext 41*cdf0e10cSrcweir #include <svx/svdetc.hxx> // Fuer SdrEngineDefaults 42*cdf0e10cSrcweir 43*cdf0e10cSrcweir #ifdef DBG_UTIL 44*cdf0e10cSrcweir #include <svdibrow.hxx> 45*cdf0e10cSrcweir #endif 46*cdf0e10cSrcweir 47*cdf0e10cSrcweir #include "svx/svdoutl.hxx" 48*cdf0e10cSrcweir #include "svx/svdview.hxx" 49*cdf0e10cSrcweir #include "editeng/editview.hxx" // fuer GetField 50*cdf0e10cSrcweir #include "editeng/flditem.hxx" // fuer URLField 51*cdf0e10cSrcweir #include "svx/obj3d.hxx" 52*cdf0e10cSrcweir #include "svx/svddrgmt.hxx" 53*cdf0e10cSrcweir #include "svx/svdoutl.hxx" 54*cdf0e10cSrcweir #include "svx/svdotable.hxx" 55*cdf0e10cSrcweir #include <tools/tenccvt.hxx> 56*cdf0e10cSrcweir #include <svx/sdr/overlay/overlaypolypolygon.hxx> 57*cdf0e10cSrcweir #include <svx/sdr/overlay/overlaymanager.hxx> 58*cdf0e10cSrcweir #include <svx/sdrpaintwindow.hxx> 59*cdf0e10cSrcweir #include <svx/sdrpagewindow.hxx> 60*cdf0e10cSrcweir #include <svx/sdrhittesthelper.hxx> 61*cdf0e10cSrcweir 62*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 63*cdf0e10cSrcweir 64*cdf0e10cSrcweir SdrViewEvent::SdrViewEvent() 65*cdf0e10cSrcweir : pHdl(NULL), 66*cdf0e10cSrcweir pObj(NULL), 67*cdf0e10cSrcweir pRootObj(NULL), 68*cdf0e10cSrcweir pPV(NULL), 69*cdf0e10cSrcweir pURLField(NULL), 70*cdf0e10cSrcweir eHit(SDRHIT_NONE), 71*cdf0e10cSrcweir eEvent(SDREVENT_NONE), 72*cdf0e10cSrcweir eHdlKind(HDL_MOVE), 73*cdf0e10cSrcweir eEndCreateCmd(SDRCREATE_NEXTPOINT), 74*cdf0e10cSrcweir nMouseClicks(0), 75*cdf0e10cSrcweir nMouseMode(0), 76*cdf0e10cSrcweir nMouseCode(0), 77*cdf0e10cSrcweir nHlplIdx(0), 78*cdf0e10cSrcweir nGlueId(0), 79*cdf0e10cSrcweir bMouseDown(sal_False), 80*cdf0e10cSrcweir bMouseUp(sal_False), 81*cdf0e10cSrcweir bDoubleHdlSize(sal_False), 82*cdf0e10cSrcweir bIsAction(sal_False), 83*cdf0e10cSrcweir bIsTextEdit(sal_False), 84*cdf0e10cSrcweir bTextEditHit(sal_False), 85*cdf0e10cSrcweir bAddMark(sal_False), 86*cdf0e10cSrcweir bUnmark(sal_False), 87*cdf0e10cSrcweir bPrevNextMark(sal_False), 88*cdf0e10cSrcweir bMarkPrev(sal_False), 89*cdf0e10cSrcweir bInsPointNewObj(sal_False), 90*cdf0e10cSrcweir bDragWithCopy(sal_False), 91*cdf0e10cSrcweir bCaptureMouse(sal_False), 92*cdf0e10cSrcweir bReleaseMouse(sal_False) 93*cdf0e10cSrcweir { 94*cdf0e10cSrcweir } 95*cdf0e10cSrcweir 96*cdf0e10cSrcweir SdrViewEvent::~SdrViewEvent() 97*cdf0e10cSrcweir { 98*cdf0e10cSrcweir } 99*cdf0e10cSrcweir 100*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 101*cdf0e10cSrcweir // helper class for all D&D overlays 102*cdf0e10cSrcweir 103*cdf0e10cSrcweir void SdrDropMarkerOverlay::ImplCreateOverlays(const SdrView& rView, const basegfx::B2DPolyPolygon& rPolyPolygon) 104*cdf0e10cSrcweir { 105*cdf0e10cSrcweir for(sal_uInt32 a(0L); a < rView.PaintWindowCount(); a++) 106*cdf0e10cSrcweir { 107*cdf0e10cSrcweir SdrPaintWindow* pCandidate = rView.GetPaintWindow(a); 108*cdf0e10cSrcweir ::sdr::overlay::OverlayManager* pTargetOverlay = pCandidate->GetOverlayManager(); 109*cdf0e10cSrcweir 110*cdf0e10cSrcweir if(pTargetOverlay) 111*cdf0e10cSrcweir { 112*cdf0e10cSrcweir ::sdr::overlay::OverlayPolyPolygonStriped* pNew = new ::sdr::overlay::OverlayPolyPolygonStriped( 113*cdf0e10cSrcweir rPolyPolygon); 114*cdf0e10cSrcweir pTargetOverlay->add(*pNew); 115*cdf0e10cSrcweir maObjects.append(*pNew); 116*cdf0e10cSrcweir } 117*cdf0e10cSrcweir } 118*cdf0e10cSrcweir } 119*cdf0e10cSrcweir 120*cdf0e10cSrcweir SdrDropMarkerOverlay::SdrDropMarkerOverlay(const SdrView& rView, const SdrObject& rObject) 121*cdf0e10cSrcweir { 122*cdf0e10cSrcweir ImplCreateOverlays(rView, rObject.TakeXorPoly()); 123*cdf0e10cSrcweir } 124*cdf0e10cSrcweir 125*cdf0e10cSrcweir SdrDropMarkerOverlay::SdrDropMarkerOverlay(const SdrView& rView, const Rectangle& rRectangle) 126*cdf0e10cSrcweir { 127*cdf0e10cSrcweir basegfx::B2DPolygon aB2DPolygon; 128*cdf0e10cSrcweir aB2DPolygon.append(basegfx::B2DPoint(rRectangle.Left(), rRectangle.Top())); 129*cdf0e10cSrcweir aB2DPolygon.append(basegfx::B2DPoint(rRectangle.Right(), rRectangle.Top())); 130*cdf0e10cSrcweir aB2DPolygon.append(basegfx::B2DPoint(rRectangle.Right(), rRectangle.Bottom())); 131*cdf0e10cSrcweir aB2DPolygon.append(basegfx::B2DPoint(rRectangle.Left(), rRectangle.Bottom())); 132*cdf0e10cSrcweir aB2DPolygon.setClosed(true); 133*cdf0e10cSrcweir 134*cdf0e10cSrcweir basegfx::B2DPolyPolygon aB2DPolyPolygon; 135*cdf0e10cSrcweir aB2DPolyPolygon.append(aB2DPolygon); 136*cdf0e10cSrcweir 137*cdf0e10cSrcweir ImplCreateOverlays(rView, aB2DPolyPolygon); 138*cdf0e10cSrcweir } 139*cdf0e10cSrcweir 140*cdf0e10cSrcweir SdrDropMarkerOverlay::SdrDropMarkerOverlay(const SdrView& rView, const Point& rStart, const Point& rEnd) 141*cdf0e10cSrcweir { 142*cdf0e10cSrcweir basegfx::B2DPolygon aB2DPolygon; 143*cdf0e10cSrcweir aB2DPolygon.append(basegfx::B2DPoint(rStart.X(), rStart.Y())); 144*cdf0e10cSrcweir aB2DPolygon.append(basegfx::B2DPoint(rEnd.X(), rEnd.Y())); 145*cdf0e10cSrcweir aB2DPolygon.setClosed(true); 146*cdf0e10cSrcweir 147*cdf0e10cSrcweir basegfx::B2DPolyPolygon aB2DPolyPolygon; 148*cdf0e10cSrcweir aB2DPolyPolygon.append(aB2DPolygon); 149*cdf0e10cSrcweir 150*cdf0e10cSrcweir ImplCreateOverlays(rView, aB2DPolyPolygon); 151*cdf0e10cSrcweir } 152*cdf0e10cSrcweir 153*cdf0e10cSrcweir SdrDropMarkerOverlay::~SdrDropMarkerOverlay() 154*cdf0e10cSrcweir { 155*cdf0e10cSrcweir // The OverlayObjects are cleared using the destructor of OverlayObjectList. 156*cdf0e10cSrcweir // That destructor calls clear() at the list which removes all objects from the 157*cdf0e10cSrcweir // OverlayManager and deletes them. 158*cdf0e10cSrcweir } 159*cdf0e10cSrcweir 160*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 161*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 162*cdf0e10cSrcweir // 163*cdf0e10cSrcweir // @@ @@ @@ @@@@@ @@ @@ 164*cdf0e10cSrcweir // @@ @@ @@ @@ @@ @@ 165*cdf0e10cSrcweir // @@ @@ @@ @@ @@ @ @@ 166*cdf0e10cSrcweir // @@@@@ @@ @@@@ @@@@@@@ 167*cdf0e10cSrcweir // @@@ @@ @@ @@@@@@@ 168*cdf0e10cSrcweir // @@@ @@ @@ @@@ @@@ 169*cdf0e10cSrcweir // @ @@ @@@@@ @@ @@ 170*cdf0e10cSrcweir // 171*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 172*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 173*cdf0e10cSrcweir 174*cdf0e10cSrcweir TYPEINIT1(SdrView,SdrCreateView); 175*cdf0e10cSrcweir 176*cdf0e10cSrcweir SdrView::SdrView(SdrModel* pModel1, OutputDevice* pOut) 177*cdf0e10cSrcweir : SdrCreateView(pModel1,pOut), 178*cdf0e10cSrcweir bNoExtendedMouseDispatcher(sal_False), 179*cdf0e10cSrcweir bNoExtendedKeyDispatcher(sal_False), 180*cdf0e10cSrcweir bNoExtendedCommandDispatcher(sal_False), 181*cdf0e10cSrcweir mbMasterPagePaintCaching(sal_False) 182*cdf0e10cSrcweir { 183*cdf0e10cSrcweir bTextEditOnObjectsWithoutTextIfTextTool=sal_False; 184*cdf0e10cSrcweir 185*cdf0e10cSrcweir maAccessibilityOptions.AddListener(this); 186*cdf0e10cSrcweir 187*cdf0e10cSrcweir onAccessibilityOptionsChanged(); 188*cdf0e10cSrcweir } 189*cdf0e10cSrcweir 190*cdf0e10cSrcweir SdrView::~SdrView() 191*cdf0e10cSrcweir { 192*cdf0e10cSrcweir maAccessibilityOptions.RemoveListener(this); 193*cdf0e10cSrcweir } 194*cdf0e10cSrcweir 195*cdf0e10cSrcweir sal_Bool SdrView::KeyInput(const KeyEvent& rKEvt, Window* pWin) 196*cdf0e10cSrcweir { 197*cdf0e10cSrcweir SetActualWin(pWin); 198*cdf0e10cSrcweir sal_Bool bRet=SdrCreateView::KeyInput(rKEvt,pWin); 199*cdf0e10cSrcweir if (!bRet && !IsExtendedKeyInputDispatcherEnabled()) { 200*cdf0e10cSrcweir bRet=sal_True; 201*cdf0e10cSrcweir switch (rKEvt.GetKeyCode().GetFullFunction()) { 202*cdf0e10cSrcweir case KEYFUNC_CUT : Cut(); break; 203*cdf0e10cSrcweir case KEYFUNC_COPY : Yank(); break; 204*cdf0e10cSrcweir case KEYFUNC_PASTE : Paste(pWin); break; 205*cdf0e10cSrcweir case KEYFUNC_DELETE: DeleteMarked(); break; 206*cdf0e10cSrcweir case KEYFUNC_UNDO: pMod->Undo(); break; 207*cdf0e10cSrcweir case KEYFUNC_REDO: pMod->Redo(); break; 208*cdf0e10cSrcweir case KEYFUNC_REPEAT: pMod->Repeat(*this); break; 209*cdf0e10cSrcweir default: { 210*cdf0e10cSrcweir switch (rKEvt.GetKeyCode().GetFullCode()) { 211*cdf0e10cSrcweir case KEY_ESCAPE: { 212*cdf0e10cSrcweir if (IsTextEdit()) SdrEndTextEdit(); 213*cdf0e10cSrcweir if (IsAction()) BrkAction(); 214*cdf0e10cSrcweir if (pWin!=NULL) pWin->ReleaseMouse(); 215*cdf0e10cSrcweir } break; 216*cdf0e10cSrcweir case KEY_DELETE: DeleteMarked(); break; 217*cdf0e10cSrcweir case KEY_CUT: case KEY_DELETE+KEY_SHIFT: Cut(); break; 218*cdf0e10cSrcweir case KEY_COPY: case KEY_INSERT+KEY_MOD1: Yank(); break; 219*cdf0e10cSrcweir case KEY_PASTE: case KEY_INSERT+KEY_SHIFT: Paste(pWin); break; 220*cdf0e10cSrcweir case KEY_UNDO: case KEY_BACKSPACE+KEY_MOD2: pMod->Undo(); break; 221*cdf0e10cSrcweir case KEY_BACKSPACE+KEY_MOD2+KEY_SHIFT: pMod->Redo(); break; 222*cdf0e10cSrcweir case KEY_REPEAT: case KEY_BACKSPACE+KEY_MOD2+KEY_MOD1: pMod->Repeat(*this); break; 223*cdf0e10cSrcweir case KEY_MOD1+KEY_A: MarkAll(); break; 224*cdf0e10cSrcweir default: bRet=sal_False; 225*cdf0e10cSrcweir } // switch 226*cdf0e10cSrcweir } 227*cdf0e10cSrcweir } // switch 228*cdf0e10cSrcweir if (bRet && pWin!=NULL) { 229*cdf0e10cSrcweir pWin->SetPointer(GetPreferedPointer( 230*cdf0e10cSrcweir pWin->PixelToLogic(pWin->ScreenToOutputPixel( pWin->GetPointerPosPixel() ) ), 231*cdf0e10cSrcweir pWin, 232*cdf0e10cSrcweir rKEvt.GetKeyCode().GetModifier())); 233*cdf0e10cSrcweir } 234*cdf0e10cSrcweir } 235*cdf0e10cSrcweir return bRet; 236*cdf0e10cSrcweir } 237*cdf0e10cSrcweir 238*cdf0e10cSrcweir sal_Bool SdrView::MouseButtonDown(const MouseEvent& rMEvt, Window* pWin) 239*cdf0e10cSrcweir { 240*cdf0e10cSrcweir SetActualWin(pWin); 241*cdf0e10cSrcweir if (rMEvt.IsLeft()) aDragStat.SetMouseDown(sal_True); 242*cdf0e10cSrcweir sal_Bool bRet=SdrCreateView::MouseButtonDown(rMEvt,pWin); 243*cdf0e10cSrcweir if (!bRet && !IsExtendedMouseEventDispatcherEnabled()) { 244*cdf0e10cSrcweir SdrViewEvent aVEvt; 245*cdf0e10cSrcweir PickAnything(rMEvt,SDRMOUSEBUTTONDOWN,aVEvt); 246*cdf0e10cSrcweir bRet=DoMouseEvent(aVEvt); 247*cdf0e10cSrcweir } 248*cdf0e10cSrcweir return bRet; 249*cdf0e10cSrcweir } 250*cdf0e10cSrcweir 251*cdf0e10cSrcweir sal_Bool SdrView::MouseButtonUp(const MouseEvent& rMEvt, Window* pWin) 252*cdf0e10cSrcweir { 253*cdf0e10cSrcweir SetActualWin(pWin); 254*cdf0e10cSrcweir if (rMEvt.IsLeft()) aDragStat.SetMouseDown(sal_False); 255*cdf0e10cSrcweir sal_Bool bAction=IsAction(); 256*cdf0e10cSrcweir sal_Bool bRet=!bAction && SdrCreateView::MouseButtonUp(rMEvt,pWin); 257*cdf0e10cSrcweir if (!bRet && !IsExtendedMouseEventDispatcherEnabled()) { 258*cdf0e10cSrcweir SdrViewEvent aVEvt; 259*cdf0e10cSrcweir PickAnything(rMEvt,SDRMOUSEBUTTONUP,aVEvt); 260*cdf0e10cSrcweir bRet=DoMouseEvent(aVEvt); 261*cdf0e10cSrcweir } 262*cdf0e10cSrcweir return bRet; 263*cdf0e10cSrcweir } 264*cdf0e10cSrcweir 265*cdf0e10cSrcweir sal_Bool SdrView::MouseMove(const MouseEvent& rMEvt, Window* pWin) 266*cdf0e10cSrcweir { 267*cdf0e10cSrcweir SetActualWin(pWin); 268*cdf0e10cSrcweir aDragStat.SetMouseDown(rMEvt.IsLeft()); 269*cdf0e10cSrcweir sal_Bool bRet=SdrCreateView::MouseMove(rMEvt,pWin); 270*cdf0e10cSrcweir if (!IsExtendedMouseEventDispatcherEnabled() && !IsTextEditInSelectionMode()) { 271*cdf0e10cSrcweir SdrViewEvent aVEvt; 272*cdf0e10cSrcweir PickAnything(rMEvt,SDRMOUSEMOVE,aVEvt); 273*cdf0e10cSrcweir if (DoMouseEvent(aVEvt)) bRet=sal_True; 274*cdf0e10cSrcweir } 275*cdf0e10cSrcweir 276*cdf0e10cSrcweir // #87792# Removed code which did let the mouse snap on object 277*cdf0e10cSrcweir // points 278*cdf0e10cSrcweir 279*cdf0e10cSrcweir return bRet; 280*cdf0e10cSrcweir } 281*cdf0e10cSrcweir 282*cdf0e10cSrcweir sal_Bool SdrView::Command(const CommandEvent& rCEvt, Window* pWin) 283*cdf0e10cSrcweir { 284*cdf0e10cSrcweir SetActualWin(pWin); 285*cdf0e10cSrcweir sal_Bool bRet=SdrCreateView::Command(rCEvt,pWin); 286*cdf0e10cSrcweir return bRet; 287*cdf0e10cSrcweir } 288*cdf0e10cSrcweir 289*cdf0e10cSrcweir /* new interface src537 */ 290*cdf0e10cSrcweir sal_Bool SdrView::GetAttributes(SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr) const 291*cdf0e10cSrcweir { 292*cdf0e10cSrcweir return SdrCreateView::GetAttributes(rTargetSet, bOnlyHardAttr); 293*cdf0e10cSrcweir } 294*cdf0e10cSrcweir 295*cdf0e10cSrcweir SfxStyleSheet* SdrView::GetStyleSheet() const 296*cdf0e10cSrcweir { 297*cdf0e10cSrcweir //sal_Bool bOk=sal_False; 298*cdf0e10cSrcweir return SdrCreateView::GetStyleSheet(); //bOk); 299*cdf0e10cSrcweir } 300*cdf0e10cSrcweir 301*cdf0e10cSrcweir SdrHitKind SdrView::PickAnything(const MouseEvent& rMEvt, sal_uInt16 nEventKind, SdrViewEvent& rVEvt) const 302*cdf0e10cSrcweir { 303*cdf0e10cSrcweir rVEvt.bMouseDown=nEventKind==SDRMOUSEBUTTONDOWN; 304*cdf0e10cSrcweir rVEvt.bMouseUp=nEventKind==SDRMOUSEBUTTONUP; 305*cdf0e10cSrcweir rVEvt.nMouseClicks=rMEvt.GetClicks(); 306*cdf0e10cSrcweir rVEvt.nMouseMode=rMEvt.GetMode(); 307*cdf0e10cSrcweir rVEvt.nMouseCode=rMEvt.GetButtons() | rMEvt.GetModifier(); 308*cdf0e10cSrcweir const OutputDevice* pOut=pActualOutDev; 309*cdf0e10cSrcweir if (pOut==NULL) 310*cdf0e10cSrcweir { 311*cdf0e10cSrcweir pOut = GetFirstOutputDevice(); 312*cdf0e10cSrcweir //pOut=GetWin(0); 313*cdf0e10cSrcweir } 314*cdf0e10cSrcweir Point aPnt(rMEvt.GetPosPixel()); 315*cdf0e10cSrcweir if (pOut!=NULL) aPnt=pOut->PixelToLogic(aPnt); 316*cdf0e10cSrcweir rVEvt.aLogicPos=aPnt; 317*cdf0e10cSrcweir return PickAnything(aPnt,rVEvt); 318*cdf0e10cSrcweir } 319*cdf0e10cSrcweir 320*cdf0e10cSrcweir // Mit der Maus draggen (Move) 321*cdf0e10cSrcweir // Beispiel beim erzeugen eines Rechtecks. MouseDown muss ohne 322*cdf0e10cSrcweir // ModKey erfolgen, weil sonst i.d.R. Markieren forciert wird (s.u.) 323*cdf0e10cSrcweir // Drueckt man dann beim MouseMove gleichzeitig Shift, Ctrl, und Alt, 324*cdf0e10cSrcweir // so erzeugt man ein zentrisches Quadrat ohne Fang. 325*cdf0e10cSrcweir // Die Doppelbelegung von Ortho und Shift stellt i.d.R. kein Problem dar, 326*cdf0e10cSrcweir // da sich beides meisst gegenseitig ausschliesst. Einzig Shear (das beim 327*cdf0e10cSrcweir // Verzerren, nicht dass beim Drehen) beruecksichtigt beides gleichzeitig. 328*cdf0e10cSrcweir // Dass muss der Anwender erstmal noch umschiffen (z.B. mit einer Hilfslinie). 329*cdf0e10cSrcweir #define MODKEY_NoSnap bCtrl /* Fang temporaer aus */ 330*cdf0e10cSrcweir #define MODKEY_Ortho bShift /* na eben ortho */ 331*cdf0e10cSrcweir #define MODKEY_Center bAlt /* Zentrisch erzeugen/resizen */ 332*cdf0e10cSrcweir #define MODKEY_AngleSnap bShift 333*cdf0e10cSrcweir #define MODKEY_CopyDrag bCtrl /* Draggen mit kopieren */ 334*cdf0e10cSrcweir 335*cdf0e10cSrcweir // irgendwo hinklicken (MouseDown) 336*cdf0e10cSrcweir #define MODKEY_PolyPoly bAlt /* Neues Poly bei InsPt und bei Create */ 337*cdf0e10cSrcweir #define MODKEY_MultiMark bShift /* MarkObj ohne vorher UnmarkAll */ 338*cdf0e10cSrcweir #define MODKEY_Unmark bAlt /* Unmark durch Rahmenaufziehen */ 339*cdf0e10cSrcweir #define MODKEY_ForceMark bCtrl /* Rahmenaufziehen erzwingen, auch wenn Obj an MausPos */ 340*cdf0e10cSrcweir #define MODKEY_DeepMark bAlt /* MarkNextObj */ 341*cdf0e10cSrcweir #define MODKEY_DeepBackw bShift /* MarkNextObj rueckwaerts */ 342*cdf0e10cSrcweir 343*cdf0e10cSrcweir SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) const 344*cdf0e10cSrcweir { 345*cdf0e10cSrcweir const OutputDevice* pOut=pActualOutDev; 346*cdf0e10cSrcweir if (pOut==NULL) 347*cdf0e10cSrcweir { 348*cdf0e10cSrcweir pOut = GetFirstOutputDevice(); 349*cdf0e10cSrcweir //pOut=GetWin(0); 350*cdf0e10cSrcweir } 351*cdf0e10cSrcweir 352*cdf0e10cSrcweir // #i73628# Use a non-changeable copy of he logic pos 353*cdf0e10cSrcweir const Point aLocalLogicPosition(rLogicPos); 354*cdf0e10cSrcweir 355*cdf0e10cSrcweir sal_Bool bEditMode=IsEditMode(); 356*cdf0e10cSrcweir sal_Bool bPointMode=bEditMode && HasMarkablePoints(); 357*cdf0e10cSrcweir sal_Bool bGluePointMode=IsGluePointEditMode(); 358*cdf0e10cSrcweir sal_Bool bInsPolyPt=bPointMode && IsInsObjPointMode() && IsInsObjPointPossible(); 359*cdf0e10cSrcweir sal_Bool bInsGluePt=bGluePointMode && IsInsGluePointMode() && IsInsGluePointPossible(); 360*cdf0e10cSrcweir sal_Bool bIsTextEdit=IsTextEdit(); 361*cdf0e10cSrcweir sal_Bool bTextEditHit=IsTextEditHit(aLocalLogicPosition,0/*nHitTolLog*/); 362*cdf0e10cSrcweir sal_Bool bTextEditSel=IsTextEditInSelectionMode(); 363*cdf0e10cSrcweir sal_Bool bShift=(rVEvt.nMouseCode & KEY_SHIFT) !=0; 364*cdf0e10cSrcweir sal_Bool bCtrl=(rVEvt.nMouseCode & KEY_MOD1) !=0; 365*cdf0e10cSrcweir sal_Bool bAlt=(rVEvt.nMouseCode & KEY_MOD2) !=0; 366*cdf0e10cSrcweir SdrHitKind eHit=SDRHIT_NONE; 367*cdf0e10cSrcweir SdrHdl* pHdl=pOut!=NULL && !bTextEditSel ? PickHandle(aLocalLogicPosition) : NULL; 368*cdf0e10cSrcweir SdrPageView* pPV=NULL; 369*cdf0e10cSrcweir SdrObject* pObj=NULL; 370*cdf0e10cSrcweir SdrObject* pHitObj=NULL; 371*cdf0e10cSrcweir sal_uInt16 nHitPassNum=0; 372*cdf0e10cSrcweir sal_uInt16 nHlplIdx=0; 373*cdf0e10cSrcweir sal_uInt16 nGlueId=0; 374*cdf0e10cSrcweir sal_Bool bUnmarkedObjHit=sal_False; 375*cdf0e10cSrcweir if (bTextEditHit || bTextEditSel) 376*cdf0e10cSrcweir { 377*cdf0e10cSrcweir eHit=SDRHIT_TEXTEDIT; 378*cdf0e10cSrcweir bTextEditHit=sal_True; 379*cdf0e10cSrcweir } 380*cdf0e10cSrcweir else if (pHdl!=NULL) 381*cdf0e10cSrcweir { 382*cdf0e10cSrcweir eHit=SDRHIT_HANDLE; // Handle getroffen hat hoechste Prioritaet 383*cdf0e10cSrcweir } 384*cdf0e10cSrcweir else if (bEditMode && IsHlplVisible() && IsHlplFront() && pOut!=NULL && PickHelpLine(aLocalLogicPosition,nHitTolLog,*pOut,nHlplIdx,pPV)) 385*cdf0e10cSrcweir { 386*cdf0e10cSrcweir eHit=SDRHIT_HELPLINE; // Hilfslinie im Vordergrund getroffen zum verschieben 387*cdf0e10cSrcweir } 388*cdf0e10cSrcweir else if (bGluePointMode && PickGluePoint(aLocalLogicPosition,pObj,nGlueId,pPV)) 389*cdf0e10cSrcweir { 390*cdf0e10cSrcweir eHit=SDRHIT_GLUEPOINT; // nichtmarkierter Klebepunkt getroffen 391*cdf0e10cSrcweir } 392*cdf0e10cSrcweir else if (PickObj(aLocalLogicPosition,nHitTolLog,pHitObj,pPV,SDRSEARCH_DEEP|SDRSEARCH_MARKED,&pObj,NULL,&nHitPassNum)) 393*cdf0e10cSrcweir { 394*cdf0e10cSrcweir eHit=SDRHIT_MARKEDOBJECT; 395*cdf0e10cSrcweir ::sdr::table::SdrTableObj* pTableObj = dynamic_cast< ::sdr::table::SdrTableObj* >( pObj ); 396*cdf0e10cSrcweir if( pTableObj ) 397*cdf0e10cSrcweir { 398*cdf0e10cSrcweir sal_Int32 nX = 0, nY = 0; 399*cdf0e10cSrcweir switch( pTableObj->CheckTableHit( aLocalLogicPosition, nX, nY, 0 ) ) 400*cdf0e10cSrcweir { 401*cdf0e10cSrcweir case sdr::table::SDRTABLEHIT_CELL: 402*cdf0e10cSrcweir eHit = SDRHIT_CELL; 403*cdf0e10cSrcweir break; 404*cdf0e10cSrcweir case sdr::table::SDRTABLEHIT_CELLTEXTAREA: 405*cdf0e10cSrcweir eHit = SDRHIT_TEXTEDITOBJ; 406*cdf0e10cSrcweir break; 407*cdf0e10cSrcweir default: 408*cdf0e10cSrcweir break; 409*cdf0e10cSrcweir } 410*cdf0e10cSrcweir } 411*cdf0e10cSrcweir } 412*cdf0e10cSrcweir else if (PickObj(aLocalLogicPosition,nHitTolLog,pHitObj,pPV,SDRSEARCH_DEEP|/*SDRSEARCH_TESTMARKABLE|*/SDRSEARCH_ALSOONMASTER|SDRSEARCH_WHOLEPAGE,&pObj,NULL,&nHitPassNum)) 413*cdf0e10cSrcweir { 414*cdf0e10cSrcweir // MasterPages und WholePage fuer Macro und URL 415*cdf0e10cSrcweir eHit=SDRHIT_UNMARKEDOBJECT; 416*cdf0e10cSrcweir ::sdr::table::SdrTableObj* pTableObj = dynamic_cast< ::sdr::table::SdrTableObj* >( pObj ); 417*cdf0e10cSrcweir if( pTableObj ) 418*cdf0e10cSrcweir { 419*cdf0e10cSrcweir sal_Int32 nX = 0, nY = 0; 420*cdf0e10cSrcweir switch( pTableObj->CheckTableHit( aLocalLogicPosition, nX, nY, 0 ) ) 421*cdf0e10cSrcweir { 422*cdf0e10cSrcweir case sdr::table::SDRTABLEHIT_CELL: 423*cdf0e10cSrcweir eHit = SDRHIT_CELL; 424*cdf0e10cSrcweir break; 425*cdf0e10cSrcweir case sdr::table::SDRTABLEHIT_CELLTEXTAREA: 426*cdf0e10cSrcweir eHit = SDRHIT_TEXTEDITOBJ; 427*cdf0e10cSrcweir break; 428*cdf0e10cSrcweir default: 429*cdf0e10cSrcweir break; 430*cdf0e10cSrcweir } 431*cdf0e10cSrcweir } 432*cdf0e10cSrcweir bUnmarkedObjHit=sal_True; 433*cdf0e10cSrcweir } 434*cdf0e10cSrcweir else if (bEditMode && IsHlplVisible() && !IsHlplFront() && pOut!=NULL && PickHelpLine(aLocalLogicPosition,nHitTolLog,*pOut,nHlplIdx,pPV)) 435*cdf0e10cSrcweir { 436*cdf0e10cSrcweir eHit=SDRHIT_HELPLINE; // Hilfslinie im Vordergrund getroffen zum verschieben 437*cdf0e10cSrcweir } 438*cdf0e10cSrcweir if (IsMacroMode() && eHit==SDRHIT_UNMARKEDOBJECT) 439*cdf0e10cSrcweir { 440*cdf0e10cSrcweir bool bRoot=pObj->HasMacro(); 441*cdf0e10cSrcweir sal_Bool bDeep=pObj!=pHitObj && pHitObj->HasMacro(); 442*cdf0e10cSrcweir sal_Bool bMid=sal_False; // Gruppierte Gruppe mit Macro getroffen? 443*cdf0e10cSrcweir SdrObject* pMidObj=NULL; 444*cdf0e10cSrcweir if (pObj!=pHitObj) 445*cdf0e10cSrcweir { 446*cdf0e10cSrcweir SdrObject* pObjTmp=NULL; 447*cdf0e10cSrcweir pObjTmp=pHitObj->GetUpGroup(); 448*cdf0e10cSrcweir if (pObjTmp==pObj) pObjTmp=NULL; 449*cdf0e10cSrcweir while (pObjTmp!=NULL) 450*cdf0e10cSrcweir { 451*cdf0e10cSrcweir if (pObjTmp->HasMacro()) 452*cdf0e10cSrcweir { 453*cdf0e10cSrcweir bMid=sal_True; 454*cdf0e10cSrcweir pMidObj=pObjTmp; 455*cdf0e10cSrcweir } 456*cdf0e10cSrcweir pObjTmp=pObjTmp->GetUpGroup(); 457*cdf0e10cSrcweir if (pObjTmp==pObj) pObjTmp=NULL; 458*cdf0e10cSrcweir } 459*cdf0e10cSrcweir } 460*cdf0e10cSrcweir 461*cdf0e10cSrcweir if (bDeep || bMid || bRoot) 462*cdf0e10cSrcweir { 463*cdf0e10cSrcweir SdrObjMacroHitRec aHitRec; 464*cdf0e10cSrcweir aHitRec.aPos=aLocalLogicPosition; 465*cdf0e10cSrcweir aHitRec.aDownPos=aLocalLogicPosition; 466*cdf0e10cSrcweir aHitRec.nTol=nHitTolLog; 467*cdf0e10cSrcweir aHitRec.pVisiLayer=&pPV->GetVisibleLayers(); 468*cdf0e10cSrcweir aHitRec.pPageView=pPV; 469*cdf0e10cSrcweir if (bDeep) bDeep=pHitObj->IsMacroHit(aHitRec); 470*cdf0e10cSrcweir if (bMid ) bMid =pMidObj->IsMacroHit(aHitRec); 471*cdf0e10cSrcweir if (bRoot) bRoot=pObj->IsMacroHit(aHitRec); 472*cdf0e10cSrcweir if (bRoot || bMid || bDeep) 473*cdf0e10cSrcweir { 474*cdf0e10cSrcweir // Prio: 1.Root, 2.Mid, 3.Deep 475*cdf0e10cSrcweir rVEvt.pRootObj=pObj; 476*cdf0e10cSrcweir if (!bRoot) pObj=pMidObj; 477*cdf0e10cSrcweir if (!bRoot && !bMid) pObj=pHitObj; 478*cdf0e10cSrcweir eHit=SDRHIT_MACRO; 479*cdf0e10cSrcweir } 480*cdf0e10cSrcweir } 481*cdf0e10cSrcweir } 482*cdf0e10cSrcweir // auf URL-Field checken 483*cdf0e10cSrcweir if (IsMacroMode() && eHit==SDRHIT_UNMARKEDOBJECT) 484*cdf0e10cSrcweir { 485*cdf0e10cSrcweir SdrTextObj* pTextObj=PTR_CAST(SdrTextObj,pHitObj); 486*cdf0e10cSrcweir if (pTextObj!=NULL && pTextObj->HasText()) 487*cdf0e10cSrcweir { 488*cdf0e10cSrcweir bool bTEHit(pPV && 489*cdf0e10cSrcweir SdrObjectPrimitiveHit(*pTextObj, aLocalLogicPosition, 0, *pPV, &pPV->GetVisibleLayers(), true)); 490*cdf0e10cSrcweir 491*cdf0e10cSrcweir if (bTEHit) 492*cdf0e10cSrcweir { 493*cdf0e10cSrcweir Rectangle aTextRect; 494*cdf0e10cSrcweir Rectangle aAnchor; 495*cdf0e10cSrcweir SdrOutliner* pOutliner = &pTextObj->ImpGetDrawOutliner(); 496*cdf0e10cSrcweir if( pTextObj->GetModel() ) 497*cdf0e10cSrcweir pOutliner = &pTextObj->GetModel()->GetHitTestOutliner(); 498*cdf0e10cSrcweir 499*cdf0e10cSrcweir pTextObj->TakeTextRect( *pOutliner, aTextRect, sal_False, &aAnchor, sal_False ); 500*cdf0e10cSrcweir 501*cdf0e10cSrcweir // #i73628# Use a text-relative position for hit test in hit test outliner 502*cdf0e10cSrcweir Point aTemporaryTextRelativePosition(aLocalLogicPosition - aTextRect.TopLeft()); 503*cdf0e10cSrcweir 504*cdf0e10cSrcweir // FitToSize berueksichtigen 505*cdf0e10cSrcweir SdrFitToSizeType eFit=pTextObj->GetFitToSize(); 506*cdf0e10cSrcweir sal_Bool bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES); 507*cdf0e10cSrcweir if (bFitToSize) { 508*cdf0e10cSrcweir Fraction aX(aTextRect.GetWidth()-1,aAnchor.GetWidth()-1); 509*cdf0e10cSrcweir Fraction aY(aTextRect.GetHeight()-1,aAnchor.GetHeight()-1); 510*cdf0e10cSrcweir ResizePoint(aTemporaryTextRelativePosition,Point(),aX,aY); 511*cdf0e10cSrcweir } 512*cdf0e10cSrcweir // Drehung berueksichtigen 513*cdf0e10cSrcweir const GeoStat& rGeo=pTextObj->GetGeoStat(); 514*cdf0e10cSrcweir if (rGeo.nDrehWink!=0) RotatePoint(aTemporaryTextRelativePosition,Point(),-rGeo.nSin,rGeo.nCos); // -sin fuer Unrotate 515*cdf0e10cSrcweir // Laufschrift berueksichtigen fehlt noch ... 516*cdf0e10cSrcweir if(pActualOutDev && pActualOutDev->GetOutDevType() == OUTDEV_WINDOW) 517*cdf0e10cSrcweir { 518*cdf0e10cSrcweir OutlinerView aOLV(pOutliner, (Window*)pActualOutDev); 519*cdf0e10cSrcweir const EditView& aEV=aOLV.GetEditView(); 520*cdf0e10cSrcweir const SvxFieldItem* pItem=aEV.GetField(aTemporaryTextRelativePosition); 521*cdf0e10cSrcweir if (pItem!=NULL) { 522*cdf0e10cSrcweir const SvxFieldData* pFld=pItem->GetField(); 523*cdf0e10cSrcweir const SvxURLField* pURL=PTR_CAST(SvxURLField,pFld); 524*cdf0e10cSrcweir if (pURL!=NULL) { 525*cdf0e10cSrcweir eHit=SDRHIT_URLFIELD; 526*cdf0e10cSrcweir rVEvt.pURLField=pURL; 527*cdf0e10cSrcweir } 528*cdf0e10cSrcweir } 529*cdf0e10cSrcweir } 530*cdf0e10cSrcweir } 531*cdf0e10cSrcweir } 532*cdf0e10cSrcweir } 533*cdf0e10cSrcweir 534*cdf0e10cSrcweir if (nHitPassNum==SDRSEARCHPASS_DIRECT && 535*cdf0e10cSrcweir (eHit==SDRHIT_MARKEDOBJECT || eHit==SDRHIT_UNMARKEDOBJECT) && 536*cdf0e10cSrcweir (IsTextTool() || (IsEditMode() && IsQuickTextEditMode())) && pHitObj->HasTextEdit()) 537*cdf0e10cSrcweir { 538*cdf0e10cSrcweir // Ringsum die TextEditArea ein Rand zum Selektieren ohne Textedit 539*cdf0e10cSrcweir Rectangle aBoundRect(pHitObj->GetCurrentBoundRect()); 540*cdf0e10cSrcweir 541*cdf0e10cSrcweir // #105130# Force to SnapRect when Fontwork 542*cdf0e10cSrcweir if(pHitObj->ISA(SdrTextObj) && ((SdrTextObj*)pHitObj)->IsFontwork()) 543*cdf0e10cSrcweir { 544*cdf0e10cSrcweir aBoundRect = pHitObj->GetSnapRect(); 545*cdf0e10cSrcweir } 546*cdf0e10cSrcweir 547*cdf0e10cSrcweir // #105130# Old test for hit on BoundRect is completely wrong 548*cdf0e10cSrcweir // and never worked, doing it new here. 549*cdf0e10cSrcweir sal_Int32 nTolerance(nHitTolLog); 550*cdf0e10cSrcweir sal_Bool bBoundRectHit(sal_False); 551*cdf0e10cSrcweir 552*cdf0e10cSrcweir if(pOut) 553*cdf0e10cSrcweir { 554*cdf0e10cSrcweir nTolerance = pOut->PixelToLogic(Size(2, 0)).Width(); 555*cdf0e10cSrcweir } 556*cdf0e10cSrcweir 557*cdf0e10cSrcweir if( (aLocalLogicPosition.X() >= aBoundRect.Left() - nTolerance && aLocalLogicPosition.X() <= aBoundRect.Left() + nTolerance) 558*cdf0e10cSrcweir || (aLocalLogicPosition.X() >= aBoundRect.Right() - nTolerance && aLocalLogicPosition.X() <= aBoundRect.Right() + nTolerance) 559*cdf0e10cSrcweir || (aLocalLogicPosition.Y() >= aBoundRect.Top() - nTolerance && aLocalLogicPosition.Y() <= aBoundRect.Top() + nTolerance) 560*cdf0e10cSrcweir || (aLocalLogicPosition.Y() >= aBoundRect.Bottom() - nTolerance && aLocalLogicPosition.Y() <= aBoundRect.Bottom() + nTolerance)) 561*cdf0e10cSrcweir { 562*cdf0e10cSrcweir bBoundRectHit = sal_True; 563*cdf0e10cSrcweir } 564*cdf0e10cSrcweir 565*cdf0e10cSrcweir if(!bBoundRectHit) 566*cdf0e10cSrcweir { 567*cdf0e10cSrcweir bool bTEHit(pPV && 568*cdf0e10cSrcweir SdrObjectPrimitiveHit(*pHitObj, aLocalLogicPosition, 0, *pPV, &pPV->GetVisibleLayers(), true)); 569*cdf0e10cSrcweir 570*cdf0e10cSrcweir // TextEdit an Objekten im gesperrten Layer 571*cdf0e10cSrcweir if (pPV->GetLockedLayers().IsSet(pHitObj->GetLayer())) 572*cdf0e10cSrcweir { 573*cdf0e10cSrcweir bTEHit=sal_False; 574*cdf0e10cSrcweir } 575*cdf0e10cSrcweir 576*cdf0e10cSrcweir if (bTEHit) 577*cdf0e10cSrcweir { 578*cdf0e10cSrcweir rVEvt.pRootObj=pObj; 579*cdf0e10cSrcweir pObj=pHitObj; 580*cdf0e10cSrcweir eHit=SDRHIT_TEXTEDITOBJ; 581*cdf0e10cSrcweir } 582*cdf0e10cSrcweir } 583*cdf0e10cSrcweir } 584*cdf0e10cSrcweir if (nHitPassNum!=SDRSEARCHPASS_DIRECT && eHit==SDRHIT_UNMARKEDOBJECT) { 585*cdf0e10cSrcweir eHit=SDRHIT_NONE; 586*cdf0e10cSrcweir pObj=NULL; 587*cdf0e10cSrcweir pPV=NULL; 588*cdf0e10cSrcweir } 589*cdf0e10cSrcweir sal_Bool bMouseLeft=(rVEvt.nMouseCode&MOUSE_LEFT)!=0; 590*cdf0e10cSrcweir sal_Bool bMouseRight=(rVEvt.nMouseCode&MOUSE_RIGHT)!=0; 591*cdf0e10cSrcweir sal_Bool bMouseDown=rVEvt.bMouseDown; 592*cdf0e10cSrcweir sal_Bool bMouseUp=rVEvt.bMouseUp; 593*cdf0e10cSrcweir SdrEventKind eEvent=SDREVENT_NONE; 594*cdf0e10cSrcweir sal_Bool bIsAction=IsAction(); 595*cdf0e10cSrcweir 596*cdf0e10cSrcweir if (bIsAction) 597*cdf0e10cSrcweir { 598*cdf0e10cSrcweir if (bMouseDown) 599*cdf0e10cSrcweir { 600*cdf0e10cSrcweir if (bMouseRight) eEvent=SDREVENT_BCKACTION; 601*cdf0e10cSrcweir } 602*cdf0e10cSrcweir else if (bMouseUp) 603*cdf0e10cSrcweir { 604*cdf0e10cSrcweir if (bMouseLeft) 605*cdf0e10cSrcweir { 606*cdf0e10cSrcweir eEvent=SDREVENT_ENDACTION; 607*cdf0e10cSrcweir if (IsDragObj()) 608*cdf0e10cSrcweir { 609*cdf0e10cSrcweir eEvent=SDREVENT_ENDDRAG; 610*cdf0e10cSrcweir rVEvt.bDragWithCopy=MODKEY_CopyDrag; 611*cdf0e10cSrcweir } 612*cdf0e10cSrcweir else if (IsCreateObj() || IsInsObjPoint()) 613*cdf0e10cSrcweir { 614*cdf0e10cSrcweir eEvent=IsCreateObj() ? SDREVENT_ENDCREATE : SDREVENT_ENDINSOBJPOINT; 615*cdf0e10cSrcweir rVEvt.eEndCreateCmd=SDRCREATE_NEXTPOINT; 616*cdf0e10cSrcweir if (MODKEY_PolyPoly) rVEvt.eEndCreateCmd=SDRCREATE_NEXTOBJECT; 617*cdf0e10cSrcweir if (rVEvt.nMouseClicks>1) rVEvt.eEndCreateCmd=SDRCREATE_FORCEEND; 618*cdf0e10cSrcweir } 619*cdf0e10cSrcweir else if (IsMarking()) 620*cdf0e10cSrcweir { 621*cdf0e10cSrcweir eEvent=SDREVENT_ENDMARK; 622*cdf0e10cSrcweir if (!aDragStat.IsMinMoved()) 623*cdf0e10cSrcweir { 624*cdf0e10cSrcweir eEvent=SDREVENT_BRKMARK; 625*cdf0e10cSrcweir rVEvt.bAddMark=MODKEY_MultiMark; 626*cdf0e10cSrcweir } 627*cdf0e10cSrcweir } 628*cdf0e10cSrcweir } 629*cdf0e10cSrcweir } 630*cdf0e10cSrcweir else 631*cdf0e10cSrcweir { 632*cdf0e10cSrcweir eEvent=SDREVENT_MOVACTION; 633*cdf0e10cSrcweir } 634*cdf0e10cSrcweir } 635*cdf0e10cSrcweir else if (eHit==SDRHIT_TEXTEDIT) 636*cdf0e10cSrcweir { 637*cdf0e10cSrcweir eEvent=SDREVENT_TEXTEDIT; 638*cdf0e10cSrcweir } 639*cdf0e10cSrcweir else if (bMouseDown && bMouseLeft) 640*cdf0e10cSrcweir { 641*cdf0e10cSrcweir if (rVEvt.nMouseClicks==2 && rVEvt.nMouseCode==MOUSE_LEFT && pObj!=NULL && pHitObj!=NULL && pHitObj->HasTextEdit() && eHit==SDRHIT_MARKEDOBJECT) 642*cdf0e10cSrcweir { 643*cdf0e10cSrcweir rVEvt.pRootObj=pObj; 644*cdf0e10cSrcweir pObj=pHitObj; 645*cdf0e10cSrcweir eEvent=SDREVENT_BEGTEXTEDIT; 646*cdf0e10cSrcweir } 647*cdf0e10cSrcweir else if (MODKEY_ForceMark && eHit!=SDRHIT_URLFIELD) 648*cdf0e10cSrcweir { 649*cdf0e10cSrcweir eEvent=SDREVENT_BEGMARK; // AddMark,Unmark */ 650*cdf0e10cSrcweir } 651*cdf0e10cSrcweir else if (eHit==SDRHIT_HELPLINE) 652*cdf0e10cSrcweir { 653*cdf0e10cSrcweir eEvent=SDREVENT_BEGDRAGHELPLINE; // nix weiter 654*cdf0e10cSrcweir } 655*cdf0e10cSrcweir else if (eHit==SDRHIT_GLUEPOINT) 656*cdf0e10cSrcweir { 657*cdf0e10cSrcweir eEvent=SDREVENT_MARKGLUEPOINT; // AddMark+Drag 658*cdf0e10cSrcweir rVEvt.bAddMark=MODKEY_MultiMark || MODKEY_DeepMark; // falls bei Deep nicht getroffen 659*cdf0e10cSrcweir } 660*cdf0e10cSrcweir else if (eHit==SDRHIT_HANDLE) 661*cdf0e10cSrcweir { 662*cdf0e10cSrcweir eEvent=SDREVENT_BEGDRAGOBJ; // Mark+Drag,AddMark+Drag,DeepMark+Drag,Unmark 663*cdf0e10cSrcweir sal_Bool bGlue=pHdl->GetKind()==HDL_GLUE; 664*cdf0e10cSrcweir sal_Bool bPoly=!bGlue && IsPointMarkable(*pHdl); 665*cdf0e10cSrcweir sal_Bool bMarked=bGlue || bPoly && pHdl->IsSelected(); 666*cdf0e10cSrcweir if (bGlue || bPoly) 667*cdf0e10cSrcweir { 668*cdf0e10cSrcweir eEvent=bGlue ? SDREVENT_MARKGLUEPOINT : SDREVENT_MARKPOINT; 669*cdf0e10cSrcweir if (MODKEY_DeepMark) 670*cdf0e10cSrcweir { 671*cdf0e10cSrcweir rVEvt.bAddMark=sal_True; 672*cdf0e10cSrcweir rVEvt.bPrevNextMark=sal_True; 673*cdf0e10cSrcweir rVEvt.bMarkPrev=MODKEY_DeepBackw; 674*cdf0e10cSrcweir } 675*cdf0e10cSrcweir else if (MODKEY_MultiMark) 676*cdf0e10cSrcweir { 677*cdf0e10cSrcweir rVEvt.bAddMark=sal_True; 678*cdf0e10cSrcweir rVEvt.bUnmark=bMarked; // Toggle 679*cdf0e10cSrcweir if (bGlue) 680*cdf0e10cSrcweir { 681*cdf0e10cSrcweir pObj=pHdl->GetObj(); 682*cdf0e10cSrcweir nGlueId=(sal_uInt16)pHdl->GetObjHdlNum(); 683*cdf0e10cSrcweir } 684*cdf0e10cSrcweir } 685*cdf0e10cSrcweir else if (bMarked) 686*cdf0e10cSrcweir { 687*cdf0e10cSrcweir eEvent=SDREVENT_BEGDRAGOBJ; // MarkState nicht aendern, nur Drag 688*cdf0e10cSrcweir } 689*cdf0e10cSrcweir } 690*cdf0e10cSrcweir } 691*cdf0e10cSrcweir else if (bInsPolyPt && (MODKEY_PolyPoly || (!MODKEY_MultiMark && !MODKEY_DeepMark))) 692*cdf0e10cSrcweir { 693*cdf0e10cSrcweir eEvent=SDREVENT_BEGINSOBJPOINT; 694*cdf0e10cSrcweir rVEvt.bInsPointNewObj=MODKEY_PolyPoly; 695*cdf0e10cSrcweir } 696*cdf0e10cSrcweir else if (bInsGluePt && !MODKEY_MultiMark && !MODKEY_DeepMark) 697*cdf0e10cSrcweir { 698*cdf0e10cSrcweir eEvent=SDREVENT_BEGINSGLUEPOINT; 699*cdf0e10cSrcweir } 700*cdf0e10cSrcweir else if (eHit==SDRHIT_TEXTEDITOBJ) 701*cdf0e10cSrcweir { 702*cdf0e10cSrcweir eEvent=SDREVENT_BEGTEXTEDIT; // AddMark+Drag,DeepMark+Drag,Unmark 703*cdf0e10cSrcweir if (MODKEY_MultiMark || MODKEY_DeepMark) 704*cdf0e10cSrcweir { // falls bei Deep nicht getroffen 705*cdf0e10cSrcweir eEvent=SDREVENT_MARKOBJ; 706*cdf0e10cSrcweir } 707*cdf0e10cSrcweir } 708*cdf0e10cSrcweir else if (eHit==SDRHIT_MACRO) 709*cdf0e10cSrcweir { 710*cdf0e10cSrcweir eEvent=SDREVENT_BEGMACROOBJ; // AddMark+Drag 711*cdf0e10cSrcweir if (MODKEY_MultiMark || MODKEY_DeepMark) 712*cdf0e10cSrcweir { // falls bei Deep nicht getroffen 713*cdf0e10cSrcweir eEvent=SDREVENT_MARKOBJ; 714*cdf0e10cSrcweir } 715*cdf0e10cSrcweir } 716*cdf0e10cSrcweir else if (eHit==SDRHIT_URLFIELD) 717*cdf0e10cSrcweir { 718*cdf0e10cSrcweir eEvent=SDREVENT_EXECUTEURL; // AddMark+Drag 719*cdf0e10cSrcweir if (MODKEY_MultiMark || MODKEY_DeepMark) 720*cdf0e10cSrcweir { // falls bei Deep nicht getroffen 721*cdf0e10cSrcweir eEvent=SDREVENT_MARKOBJ; 722*cdf0e10cSrcweir } 723*cdf0e10cSrcweir } 724*cdf0e10cSrcweir else if (eHit==SDRHIT_MARKEDOBJECT) 725*cdf0e10cSrcweir { 726*cdf0e10cSrcweir eEvent=SDREVENT_BEGDRAGOBJ; // DeepMark+Drag,Unmark 727*cdf0e10cSrcweir 728*cdf0e10cSrcweir if (MODKEY_MultiMark || MODKEY_DeepMark) 729*cdf0e10cSrcweir { // falls bei Deep nicht getroffen 730*cdf0e10cSrcweir eEvent=SDREVENT_MARKOBJ; 731*cdf0e10cSrcweir } 732*cdf0e10cSrcweir } 733*cdf0e10cSrcweir else if (IsCreateMode()) 734*cdf0e10cSrcweir { 735*cdf0e10cSrcweir eEvent=SDREVENT_BEGCREATEOBJ; // Nix weiter 736*cdf0e10cSrcweir } 737*cdf0e10cSrcweir else if (eHit==SDRHIT_UNMARKEDOBJECT) 738*cdf0e10cSrcweir { 739*cdf0e10cSrcweir eEvent=SDREVENT_MARKOBJ; // AddMark+Drag 740*cdf0e10cSrcweir } 741*cdf0e10cSrcweir else 742*cdf0e10cSrcweir { 743*cdf0e10cSrcweir eEvent=SDREVENT_BEGMARK; 744*cdf0e10cSrcweir } 745*cdf0e10cSrcweir 746*cdf0e10cSrcweir if (eEvent==SDREVENT_MARKOBJ) 747*cdf0e10cSrcweir { 748*cdf0e10cSrcweir rVEvt.bAddMark=MODKEY_MultiMark || MODKEY_DeepMark; // falls bei Deep nicht getroffen 749*cdf0e10cSrcweir rVEvt.bPrevNextMark=MODKEY_DeepMark; 750*cdf0e10cSrcweir rVEvt.bMarkPrev=MODKEY_DeepMark && MODKEY_DeepBackw; 751*cdf0e10cSrcweir } 752*cdf0e10cSrcweir if (eEvent==SDREVENT_BEGMARK) 753*cdf0e10cSrcweir { 754*cdf0e10cSrcweir rVEvt.bAddMark=MODKEY_MultiMark; 755*cdf0e10cSrcweir rVEvt.bUnmark=MODKEY_Unmark; 756*cdf0e10cSrcweir } 757*cdf0e10cSrcweir } 758*cdf0e10cSrcweir rVEvt.bIsAction=bIsAction; 759*cdf0e10cSrcweir rVEvt.bIsTextEdit=bIsTextEdit; 760*cdf0e10cSrcweir rVEvt.bTextEditHit=bTextEditHit; 761*cdf0e10cSrcweir rVEvt.aLogicPos=aLocalLogicPosition; 762*cdf0e10cSrcweir rVEvt.pHdl=pHdl; 763*cdf0e10cSrcweir rVEvt.pObj=pObj; 764*cdf0e10cSrcweir if(rVEvt.pRootObj==NULL) 765*cdf0e10cSrcweir rVEvt.pRootObj=pObj; 766*cdf0e10cSrcweir rVEvt.pPV=pPV; 767*cdf0e10cSrcweir rVEvt.nHlplIdx=nHlplIdx; 768*cdf0e10cSrcweir rVEvt.nGlueId=nGlueId; 769*cdf0e10cSrcweir rVEvt.eHit=eHit; 770*cdf0e10cSrcweir rVEvt.eEvent=eEvent; 771*cdf0e10cSrcweir rVEvt.bCaptureMouse=bMouseLeft && bMouseDown && eEvent!=SDREVENT_NONE; 772*cdf0e10cSrcweir rVEvt.bReleaseMouse=bMouseLeft && bMouseUp; 773*cdf0e10cSrcweir #ifdef DGB_UTIL 774*cdf0e10cSrcweir if (rVEvt.pRootObj!=NULL) { 775*cdf0e10cSrcweir if (rVEvt.pRootObj->GetObjList()!=rVEvt.pPV->GetObjList()) { 776*cdf0e10cSrcweir DBG_ERROR("SdrView::PickAnything(): pRootObj->GetObjList()!=pPV->GetObjList() !"); 777*cdf0e10cSrcweir } 778*cdf0e10cSrcweir } 779*cdf0e10cSrcweir #endif 780*cdf0e10cSrcweir return eHit; 781*cdf0e10cSrcweir } 782*cdf0e10cSrcweir 783*cdf0e10cSrcweir sal_Bool SdrView::DoMouseEvent(const SdrViewEvent& rVEvt) 784*cdf0e10cSrcweir { 785*cdf0e10cSrcweir sal_Bool bRet=sal_False; 786*cdf0e10cSrcweir SdrHitKind eHit=rVEvt.eHit; 787*cdf0e10cSrcweir Point aLogicPos(rVEvt.aLogicPos); 788*cdf0e10cSrcweir 789*cdf0e10cSrcweir sal_Bool bShift=(rVEvt.nMouseCode & KEY_SHIFT) !=0; 790*cdf0e10cSrcweir sal_Bool bCtrl=(rVEvt.nMouseCode & KEY_MOD1) !=0; 791*cdf0e10cSrcweir sal_Bool bAlt=(rVEvt.nMouseCode & KEY_MOD2) !=0; 792*cdf0e10cSrcweir sal_Bool bMouseLeft=(rVEvt.nMouseCode&MOUSE_LEFT)!=0; 793*cdf0e10cSrcweir //sal_Bool bMouseRight=(rVEvt.nMouseCode&MOUSE_RIGHT)!=0; 794*cdf0e10cSrcweir sal_Bool bMouseDown=rVEvt.bMouseDown; 795*cdf0e10cSrcweir sal_Bool bMouseUp=rVEvt.bMouseUp; 796*cdf0e10cSrcweir if (bMouseDown) { 797*cdf0e10cSrcweir if (bMouseLeft) aDragStat.SetMouseDown(sal_True); 798*cdf0e10cSrcweir } else if (bMouseUp) { 799*cdf0e10cSrcweir if (bMouseLeft) aDragStat.SetMouseDown(sal_False); 800*cdf0e10cSrcweir } else { // ansonsten MoueMove 801*cdf0e10cSrcweir aDragStat.SetMouseDown(bMouseLeft); 802*cdf0e10cSrcweir } 803*cdf0e10cSrcweir 804*cdf0e10cSrcweir #ifdef MODKEY_NoSnap 805*cdf0e10cSrcweir SetSnapEnabled(!MODKEY_NoSnap); 806*cdf0e10cSrcweir #endif 807*cdf0e10cSrcweir #ifdef MODKEY_Ortho 808*cdf0e10cSrcweir SetOrtho(MODKEY_Ortho!=IsOrthoDesired()); 809*cdf0e10cSrcweir #endif 810*cdf0e10cSrcweir #ifdef MODKEY_BigOrtho 811*cdf0e10cSrcweir SetBigOrtho(MODKEY_BigOrtho); 812*cdf0e10cSrcweir #endif 813*cdf0e10cSrcweir #ifdef MODKEY_AngleSnap 814*cdf0e10cSrcweir SetAngleSnapEnabled(MODKEY_AngleSnap); 815*cdf0e10cSrcweir #endif 816*cdf0e10cSrcweir #ifdef MODKEY_CopyDrag 817*cdf0e10cSrcweir SetDragWithCopy(MODKEY_CopyDrag); 818*cdf0e10cSrcweir #endif 819*cdf0e10cSrcweir #ifdef MODKEY_Center 820*cdf0e10cSrcweir SetCreate1stPointAsCenter(MODKEY_Center); 821*cdf0e10cSrcweir SetResizeAtCenter(MODKEY_Center); 822*cdf0e10cSrcweir SetCrookAtCenter(MODKEY_Center); 823*cdf0e10cSrcweir #endif 824*cdf0e10cSrcweir if (bMouseLeft && bMouseDown && rVEvt.bIsTextEdit && (eHit==SDRHIT_UNMARKEDOBJECT || eHit==SDRHIT_NONE)) { 825*cdf0e10cSrcweir SdrEndTextEdit(); // Danebengeklickt, Ende mit Edit 826*cdf0e10cSrcweir // pHdl ist dann ungueltig. Sollte aber egal sein, wein pHdl==NULL 827*cdf0e10cSrcweir // sein muesste (wg. eHit). 828*cdf0e10cSrcweir } 829*cdf0e10cSrcweir switch (rVEvt.eEvent) { 830*cdf0e10cSrcweir case SDREVENT_NONE: bRet=sal_False; break; 831*cdf0e10cSrcweir case SDREVENT_TEXTEDIT: bRet=sal_False; break; // Events an die OutlinerView werden hier nicht beruecksichtigt 832*cdf0e10cSrcweir case SDREVENT_MOVACTION: MovAction(aLogicPos); bRet=sal_True; break; 833*cdf0e10cSrcweir case SDREVENT_ENDACTION: EndAction(); bRet=sal_True; break; 834*cdf0e10cSrcweir case SDREVENT_BCKACTION: BckAction(); bRet=sal_True; break; 835*cdf0e10cSrcweir case SDREVENT_BRKACTION: BrkAction(); bRet=sal_True; break; 836*cdf0e10cSrcweir case SDREVENT_ENDMARK : EndAction(); bRet=sal_True; break; 837*cdf0e10cSrcweir case SDREVENT_BRKMARK : { 838*cdf0e10cSrcweir BrkAction(); 839*cdf0e10cSrcweir if (!MarkObj(aLogicPos,nHitTolLog,rVEvt.bAddMark)) { 840*cdf0e10cSrcweir // Kein Obj getroffen. Dann werden zuerst 841*cdf0e10cSrcweir // - Markierte Klebepunkte deselektiert 842*cdf0e10cSrcweir // - dann ggf. selektierte Polygonpunkte 843*cdf0e10cSrcweir // - und ansonsten Objekte 844*cdf0e10cSrcweir if (!rVEvt.bAddMark) UnmarkAll(); 845*cdf0e10cSrcweir } 846*cdf0e10cSrcweir bRet=sal_True; 847*cdf0e10cSrcweir } break; 848*cdf0e10cSrcweir case SDREVENT_ENDCREATE: { // ggf. MarkObj 849*cdf0e10cSrcweir SdrCreateCmd eCmd=SDRCREATE_NEXTPOINT; 850*cdf0e10cSrcweir if (MODKEY_PolyPoly) eCmd=SDRCREATE_NEXTOBJECT; 851*cdf0e10cSrcweir if (rVEvt.nMouseClicks>1) eCmd=SDRCREATE_FORCEEND; 852*cdf0e10cSrcweir if (!EndCreateObj(eCmd)) { // Event fuer Create nicht ausgewerten? -> Markieren 853*cdf0e10cSrcweir if (eHit==SDRHIT_UNMARKEDOBJECT || eHit==SDRHIT_TEXTEDIT) { 854*cdf0e10cSrcweir MarkObj(rVEvt.pRootObj,rVEvt.pPV); 855*cdf0e10cSrcweir if (eHit==SDRHIT_TEXTEDIT) 856*cdf0e10cSrcweir { 857*cdf0e10cSrcweir sal_Bool bRet2(pActualOutDev && OUTDEV_WINDOW == pActualOutDev->GetOutDevType() && 858*cdf0e10cSrcweir SdrBeginTextEdit(rVEvt.pObj, rVEvt.pPV, (Window*)pActualOutDev, sal_False, (SdrOutliner*)0L)); 859*cdf0e10cSrcweir 860*cdf0e10cSrcweir if(bRet2) 861*cdf0e10cSrcweir { 862*cdf0e10cSrcweir MouseEvent aMEvt(pActualOutDev->LogicToPixel(aLogicPos), 863*cdf0e10cSrcweir 1,rVEvt.nMouseMode,rVEvt.nMouseCode,rVEvt.nMouseCode); 864*cdf0e10cSrcweir 865*cdf0e10cSrcweir OutlinerView* pOLV=GetTextEditOutlinerView(); 866*cdf0e10cSrcweir if (pOLV!=NULL) { 867*cdf0e10cSrcweir pOLV->MouseButtonDown(aMEvt); // Event an den Outliner, aber ohne Doppelklick 868*cdf0e10cSrcweir pOLV->MouseButtonUp(aMEvt); // Event an den Outliner, aber ohne Doppelklick 869*cdf0e10cSrcweir } 870*cdf0e10cSrcweir } 871*cdf0e10cSrcweir } 872*cdf0e10cSrcweir bRet=sal_True; // Obj markiert und ggf. TextEdit gestartet 873*cdf0e10cSrcweir } else bRet=sal_False; // Create abgebrochen, sonst nix weiter. 874*cdf0e10cSrcweir } else bRet=sal_True; // EndCreate mit sal_True returniert 875*cdf0e10cSrcweir } break; 876*cdf0e10cSrcweir case SDREVENT_ENDDRAG: { 877*cdf0e10cSrcweir bRet=EndDragObj(IsDragWithCopy()); 878*cdf0e10cSrcweir ForceMarkedObjToAnotherPage(); // Undo+Klammerung fehlt noch !!! 879*cdf0e10cSrcweir } break; 880*cdf0e10cSrcweir case SDREVENT_MARKOBJ: { // + ggf. BegDrag 881*cdf0e10cSrcweir if (!rVEvt.bAddMark) UnmarkAllObj(); 882*cdf0e10cSrcweir sal_Bool bUnmark=rVEvt.bUnmark; 883*cdf0e10cSrcweir if (rVEvt.bPrevNextMark) { 884*cdf0e10cSrcweir bRet=MarkNextObj(aLogicPos,nHitTolLog,rVEvt.bMarkPrev); 885*cdf0e10cSrcweir } else { 886*cdf0e10cSrcweir SortMarkedObjects(); 887*cdf0e10cSrcweir sal_uIntPtr nAnz0=GetMarkedObjectCount(); 888*cdf0e10cSrcweir bRet=MarkObj(aLogicPos,nHitTolLog,rVEvt.bAddMark); 889*cdf0e10cSrcweir SortMarkedObjects(); 890*cdf0e10cSrcweir sal_uIntPtr nAnz1=GetMarkedObjectCount(); 891*cdf0e10cSrcweir bUnmark=nAnz1<nAnz0; 892*cdf0e10cSrcweir } 893*cdf0e10cSrcweir if (!bUnmark) { 894*cdf0e10cSrcweir BegDragObj(aLogicPos,NULL,(SdrHdl*)NULL,nMinMovLog); 895*cdf0e10cSrcweir bRet=sal_True; 896*cdf0e10cSrcweir } 897*cdf0e10cSrcweir } break; 898*cdf0e10cSrcweir case SDREVENT_MARKPOINT: { // + ggf. BegDrag 899*cdf0e10cSrcweir if (!rVEvt.bAddMark) UnmarkAllPoints(); 900*cdf0e10cSrcweir if (rVEvt.bPrevNextMark) { 901*cdf0e10cSrcweir bRet=MarkNextPoint(aLogicPos,rVEvt.bMarkPrev); 902*cdf0e10cSrcweir } else { 903*cdf0e10cSrcweir bRet=MarkPoint(*rVEvt.pHdl,rVEvt.bUnmark); 904*cdf0e10cSrcweir } 905*cdf0e10cSrcweir if (!rVEvt.bUnmark && !rVEvt.bPrevNextMark) { 906*cdf0e10cSrcweir BegDragObj(aLogicPos,NULL,rVEvt.pHdl,nMinMovLog); 907*cdf0e10cSrcweir bRet=sal_True; 908*cdf0e10cSrcweir } 909*cdf0e10cSrcweir } break; 910*cdf0e10cSrcweir case SDREVENT_MARKGLUEPOINT: { // + ggf. BegDrag 911*cdf0e10cSrcweir if (!rVEvt.bAddMark) UnmarkAllGluePoints(); 912*cdf0e10cSrcweir if (rVEvt.bPrevNextMark) { 913*cdf0e10cSrcweir bRet=MarkNextGluePoint(aLogicPos,rVEvt.bMarkPrev); 914*cdf0e10cSrcweir } else { 915*cdf0e10cSrcweir bRet=MarkGluePoint(rVEvt.pObj,rVEvt.nGlueId,rVEvt.pPV,rVEvt.bUnmark); 916*cdf0e10cSrcweir } 917*cdf0e10cSrcweir if (!rVEvt.bUnmark && !rVEvt.bPrevNextMark) { 918*cdf0e10cSrcweir SdrHdl* pHdl=GetGluePointHdl(rVEvt.pObj,rVEvt.nGlueId); 919*cdf0e10cSrcweir BegDragObj(aLogicPos,NULL,pHdl,nMinMovLog); 920*cdf0e10cSrcweir bRet=sal_True; 921*cdf0e10cSrcweir } 922*cdf0e10cSrcweir } break; 923*cdf0e10cSrcweir case SDREVENT_BEGMARK: bRet=BegMark(aLogicPos,rVEvt.bAddMark,rVEvt.bUnmark); break; 924*cdf0e10cSrcweir case SDREVENT_BEGINSOBJPOINT: bRet = BegInsObjPoint(aLogicPos, MODKEY_PolyPoly); break; 925*cdf0e10cSrcweir case SDREVENT_ENDINSOBJPOINT: { 926*cdf0e10cSrcweir SdrCreateCmd eCmd=SDRCREATE_NEXTPOINT; 927*cdf0e10cSrcweir if (MODKEY_PolyPoly) eCmd=SDRCREATE_NEXTOBJECT; 928*cdf0e10cSrcweir if (rVEvt.nMouseClicks>1) eCmd=SDRCREATE_FORCEEND; 929*cdf0e10cSrcweir EndInsObjPoint(eCmd); 930*cdf0e10cSrcweir bRet=sal_True; 931*cdf0e10cSrcweir } break; 932*cdf0e10cSrcweir case SDREVENT_BEGINSGLUEPOINT: bRet=BegInsGluePoint(aLogicPos); break; 933*cdf0e10cSrcweir case SDREVENT_BEGDRAGHELPLINE: bRet=BegDragHelpLine(rVEvt.nHlplIdx,rVEvt.pPV); break; 934*cdf0e10cSrcweir case SDREVENT_BEGDRAGOBJ: bRet=BegDragObj(aLogicPos,NULL,rVEvt.pHdl,nMinMovLog); break; 935*cdf0e10cSrcweir case SDREVENT_BEGCREATEOBJ: { 936*cdf0e10cSrcweir if (nAktInvent==SdrInventor && nAktIdent==OBJ_CAPTION) { 937*cdf0e10cSrcweir long nHgt=SdrEngineDefaults::GetFontHeight(); 938*cdf0e10cSrcweir bRet=BegCreateCaptionObj(aLogicPos,Size(5*nHgt,2*nHgt)); 939*cdf0e10cSrcweir } else bRet=BegCreateObj(aLogicPos); 940*cdf0e10cSrcweir } break; 941*cdf0e10cSrcweir case SDREVENT_BEGMACROOBJ: bRet=BegMacroObj(aLogicPos,nHitTolLog,rVEvt.pObj,rVEvt.pPV,(Window*)pActualOutDev); break; 942*cdf0e10cSrcweir case SDREVENT_BEGTEXTEDIT: { 943*cdf0e10cSrcweir if (!IsObjMarked(rVEvt.pObj)) { 944*cdf0e10cSrcweir UnmarkAllObj(); 945*cdf0e10cSrcweir MarkObj(rVEvt.pRootObj,rVEvt.pPV); 946*cdf0e10cSrcweir } 947*cdf0e10cSrcweir 948*cdf0e10cSrcweir bRet = pActualOutDev && OUTDEV_WINDOW == pActualOutDev->GetOutDevType()&& 949*cdf0e10cSrcweir SdrBeginTextEdit(rVEvt.pObj, rVEvt.pPV, (Window*)pActualOutDev, sal_False, (SdrOutliner*)0L); 950*cdf0e10cSrcweir 951*cdf0e10cSrcweir if(bRet) 952*cdf0e10cSrcweir { 953*cdf0e10cSrcweir MouseEvent aMEvt(pActualOutDev->LogicToPixel(aLogicPos), 954*cdf0e10cSrcweir 1,rVEvt.nMouseMode,rVEvt.nMouseCode,rVEvt.nMouseCode); 955*cdf0e10cSrcweir OutlinerView* pOLV=GetTextEditOutlinerView(); 956*cdf0e10cSrcweir if (pOLV!=NULL) pOLV->MouseButtonDown(aMEvt); // Event an den Outliner, aber ohne Doppelklick 957*cdf0e10cSrcweir } 958*cdf0e10cSrcweir } break; 959*cdf0e10cSrcweir default: break; 960*cdf0e10cSrcweir } // switch 961*cdf0e10cSrcweir if (bRet && pActualOutDev!=NULL && pActualOutDev->GetOutDevType()==OUTDEV_WINDOW) { 962*cdf0e10cSrcweir Window* pWin=(Window*)pActualOutDev; 963*cdf0e10cSrcweir // Maus links gedrueckt? 964*cdf0e10cSrcweir sal_Bool bLeftDown=(rVEvt.nMouseCode&MOUSE_LEFT)!=0 && rVEvt.bMouseDown; 965*cdf0e10cSrcweir // Maus links losgelassen? 966*cdf0e10cSrcweir sal_Bool bLeftUp=(rVEvt.nMouseCode&MOUSE_LEFT)!=0 && rVEvt.bMouseUp; 967*cdf0e10cSrcweir // Maus links gedrueckt oder gehalten? 968*cdf0e10cSrcweir sal_Bool bLeftDown1=(rVEvt.nMouseCode&MOUSE_LEFT)!=0 && !rVEvt.bMouseUp; 969*cdf0e10cSrcweir pWin->SetPointer(GetPreferedPointer(rVEvt.aLogicPos,pWin, 970*cdf0e10cSrcweir rVEvt.nMouseCode & (KEY_SHIFT|KEY_MOD1|KEY_MOD2),bLeftDown1)); 971*cdf0e10cSrcweir sal_Bool bAction=IsAction(); 972*cdf0e10cSrcweir if (bLeftDown && bAction) pWin->CaptureMouse(); 973*cdf0e10cSrcweir else if (bLeftUp || (rVEvt.bIsAction && !bAction)) pWin->ReleaseMouse(); 974*cdf0e10cSrcweir } 975*cdf0e10cSrcweir return bRet; 976*cdf0e10cSrcweir } 977*cdf0e10cSrcweir #include <editeng/outlobj.hxx> 978*cdf0e10cSrcweir 979*cdf0e10cSrcweir Pointer SdrView::GetPreferedPointer(const Point& rMousePos, const OutputDevice* pOut, sal_uInt16 nModifier, sal_Bool bLeftDown) const 980*cdf0e10cSrcweir { 981*cdf0e10cSrcweir // Actions 982*cdf0e10cSrcweir if (IsCreateObj()) 983*cdf0e10cSrcweir { 984*cdf0e10cSrcweir return pAktCreate->GetCreatePointer(); 985*cdf0e10cSrcweir } 986*cdf0e10cSrcweir if (mpCurrentSdrDragMethod) 987*cdf0e10cSrcweir { 988*cdf0e10cSrcweir if ((IsDraggingPoints() || IsDraggingGluePoints()) && IsMouseHideWhileDraggingPoints()) 989*cdf0e10cSrcweir return Pointer(POINTER_NULL); 990*cdf0e10cSrcweir 991*cdf0e10cSrcweir return mpCurrentSdrDragMethod->GetSdrDragPointer(); 992*cdf0e10cSrcweir } 993*cdf0e10cSrcweir if (IsMarkObj() || IsMarkPoints() || IsMarkGluePoints() || IsEncirclement() || IsSetPageOrg()) return Pointer(POINTER_ARROW); 994*cdf0e10cSrcweir if (IsDragHelpLine()) return GetDraggedHelpLinePointer(); 995*cdf0e10cSrcweir if (IsMacroObj()) { 996*cdf0e10cSrcweir SdrObjMacroHitRec aHitRec; 997*cdf0e10cSrcweir aHitRec.aPos=pOut->LogicToPixel(rMousePos); 998*cdf0e10cSrcweir aHitRec.aDownPos=aMacroDownPos; 999*cdf0e10cSrcweir aHitRec.nTol=nMacroTol; 1000*cdf0e10cSrcweir aHitRec.pVisiLayer=&pMacroPV->GetVisibleLayers(); 1001*cdf0e10cSrcweir aHitRec.pPageView=pMacroPV; 1002*cdf0e10cSrcweir aHitRec.pOut=pMacroWin; 1003*cdf0e10cSrcweir aHitRec.bDown=bMacroDown; 1004*cdf0e10cSrcweir return pMacroObj->GetMacroPointer(aHitRec); 1005*cdf0e10cSrcweir } 1006*cdf0e10cSrcweir //sal_uInt16 nTol=nHitTolLog; 1007*cdf0e10cSrcweir // TextEdit, ObjEdit, Macro 1008*cdf0e10cSrcweir if (IsTextEdit() && (IsTextEditInSelectionMode() || IsTextEditHit(rMousePos,0/*nTol*/))) 1009*cdf0e10cSrcweir { 1010*cdf0e10cSrcweir if(!pOut || IsTextEditInSelectionMode()) 1011*cdf0e10cSrcweir { 1012*cdf0e10cSrcweir if(pTextEditOutliner->IsVertical()) 1013*cdf0e10cSrcweir return Pointer(POINTER_TEXT_VERTICAL); 1014*cdf0e10cSrcweir else 1015*cdf0e10cSrcweir return Pointer(POINTER_TEXT); 1016*cdf0e10cSrcweir } 1017*cdf0e10cSrcweir // hier muss besser der Outliner was liefern: 1018*cdf0e10cSrcweir Point aPos(pOut->LogicToPixel(rMousePos)); 1019*cdf0e10cSrcweir Pointer aPointer(pTextEditOutlinerView->GetPointer(aPos)); 1020*cdf0e10cSrcweir if (aPointer==POINTER_ARROW) 1021*cdf0e10cSrcweir { 1022*cdf0e10cSrcweir if(pTextEditOutliner->IsVertical()) 1023*cdf0e10cSrcweir aPointer = POINTER_TEXT_VERTICAL; 1024*cdf0e10cSrcweir else 1025*cdf0e10cSrcweir aPointer = POINTER_TEXT; 1026*cdf0e10cSrcweir } 1027*cdf0e10cSrcweir return aPointer; 1028*cdf0e10cSrcweir } 1029*cdf0e10cSrcweir 1030*cdf0e10cSrcweir SdrViewEvent aVEvt; 1031*cdf0e10cSrcweir aVEvt.nMouseCode=(nModifier&(KEY_SHIFT|KEY_MOD1|KEY_MOD2))|MOUSE_LEFT; // um zu sehen, was bei MouseLeftDown passieren wuerde 1032*cdf0e10cSrcweir aVEvt.bMouseDown=!bLeftDown; // Was waere wenn ... 1033*cdf0e10cSrcweir aVEvt.bMouseUp=bLeftDown; // Was waere wenn ... 1034*cdf0e10cSrcweir if (pOut!=NULL) 1035*cdf0e10cSrcweir ((SdrView*)this)->SetActualWin(pOut); 1036*cdf0e10cSrcweir SdrHitKind eHit=PickAnything(rMousePos,aVEvt); 1037*cdf0e10cSrcweir SdrEventKind eEvent=aVEvt.eEvent; 1038*cdf0e10cSrcweir switch (eEvent) 1039*cdf0e10cSrcweir { 1040*cdf0e10cSrcweir case SDREVENT_BEGCREATEOBJ: 1041*cdf0e10cSrcweir return aAktCreatePointer; 1042*cdf0e10cSrcweir case SDREVENT_MARKOBJ: 1043*cdf0e10cSrcweir case SDREVENT_BEGMARK: 1044*cdf0e10cSrcweir return Pointer(POINTER_ARROW); 1045*cdf0e10cSrcweir case SDREVENT_MARKPOINT: 1046*cdf0e10cSrcweir case SDREVENT_MARKGLUEPOINT: 1047*cdf0e10cSrcweir return Pointer(POINTER_MOVEPOINT); 1048*cdf0e10cSrcweir case SDREVENT_BEGINSOBJPOINT: 1049*cdf0e10cSrcweir case SDREVENT_BEGINSGLUEPOINT: 1050*cdf0e10cSrcweir return Pointer(POINTER_CROSS); 1051*cdf0e10cSrcweir case SDREVENT_EXECUTEURL: 1052*cdf0e10cSrcweir return Pointer(POINTER_REFHAND); 1053*cdf0e10cSrcweir case SDREVENT_BEGMACROOBJ: 1054*cdf0e10cSrcweir { 1055*cdf0e10cSrcweir SdrObjMacroHitRec aHitRec; 1056*cdf0e10cSrcweir aHitRec.aPos=aVEvt.aLogicPos; 1057*cdf0e10cSrcweir aHitRec.aDownPos=aHitRec.aPos; 1058*cdf0e10cSrcweir aHitRec.nTol=nHitTolLog; 1059*cdf0e10cSrcweir aHitRec.pVisiLayer=&aVEvt.pPV->GetVisibleLayers(); 1060*cdf0e10cSrcweir aHitRec.pPageView=aVEvt.pPV; 1061*cdf0e10cSrcweir aHitRec.pOut=(OutputDevice*)pOut; 1062*cdf0e10cSrcweir return aVEvt.pObj->GetMacroPointer(aHitRec); 1063*cdf0e10cSrcweir } 1064*cdf0e10cSrcweir default: break; 1065*cdf0e10cSrcweir } // switch 1066*cdf0e10cSrcweir 1067*cdf0e10cSrcweir switch(eHit) 1068*cdf0e10cSrcweir { 1069*cdf0e10cSrcweir case SDRHIT_CELL: 1070*cdf0e10cSrcweir return Pointer(POINTER_ARROW); 1071*cdf0e10cSrcweir case SDRHIT_HELPLINE : 1072*cdf0e10cSrcweir return aVEvt.pPV->GetHelpLines()[aVEvt.nHlplIdx].GetPointer(); 1073*cdf0e10cSrcweir case SDRHIT_GLUEPOINT: 1074*cdf0e10cSrcweir return Pointer(POINTER_MOVEPOINT); 1075*cdf0e10cSrcweir case SDRHIT_TEXTEDIT : 1076*cdf0e10cSrcweir case SDRHIT_TEXTEDITOBJ: 1077*cdf0e10cSrcweir { 1078*cdf0e10cSrcweir SdrTextObj* pText = dynamic_cast< SdrTextObj* >( aVEvt.pObj ); 1079*cdf0e10cSrcweir if(pText && pText->HasText()) 1080*cdf0e10cSrcweir { 1081*cdf0e10cSrcweir OutlinerParaObject* pParaObj = pText->GetOutlinerParaObject(); 1082*cdf0e10cSrcweir if(pParaObj && pParaObj->IsVertical()) 1083*cdf0e10cSrcweir return Pointer(POINTER_TEXT_VERTICAL); 1084*cdf0e10cSrcweir } 1085*cdf0e10cSrcweir return Pointer(POINTER_TEXT); 1086*cdf0e10cSrcweir } 1087*cdf0e10cSrcweir default: break; 1088*cdf0e10cSrcweir } 1089*cdf0e10cSrcweir 1090*cdf0e10cSrcweir sal_Bool bMarkHit=eHit==SDRHIT_MARKEDOBJECT; 1091*cdf0e10cSrcweir SdrHdl* pHdl=aVEvt.pHdl; 1092*cdf0e10cSrcweir // Nun die Pointer fuer Dragging checken 1093*cdf0e10cSrcweir if (pHdl!=NULL || bMarkHit) { 1094*cdf0e10cSrcweir SdrHdlKind eHdl= pHdl!=NULL ? pHdl->GetKind() : HDL_MOVE; 1095*cdf0e10cSrcweir sal_Bool bCorner=pHdl!=NULL && pHdl->IsCornerHdl(); 1096*cdf0e10cSrcweir sal_Bool bVertex=pHdl!=NULL && pHdl->IsVertexHdl(); 1097*cdf0e10cSrcweir sal_Bool bMov=eHdl==HDL_MOVE; 1098*cdf0e10cSrcweir if (bMov && (eDragMode==SDRDRAG_MOVE || eDragMode==SDRDRAG_RESIZE || bMarkedHitMovesAlways)) { 1099*cdf0e10cSrcweir if (!IsMoveAllowed()) return Pointer(POINTER_ARROW); // weil Doppelklick oder Drag&Drop moeglich 1100*cdf0e10cSrcweir return Pointer(POINTER_MOVE); 1101*cdf0e10cSrcweir } 1102*cdf0e10cSrcweir switch (eDragMode) { 1103*cdf0e10cSrcweir case SDRDRAG_ROTATE: { 1104*cdf0e10cSrcweir if ((bCorner || bMov) && !IsRotateAllowed(sal_True)) 1105*cdf0e10cSrcweir return Pointer(POINTER_NOTALLOWED); 1106*cdf0e10cSrcweir 1107*cdf0e10cSrcweir // Sind 3D-Objekte selektiert? 1108*cdf0e10cSrcweir sal_Bool b3DObjSelected = sal_False; 1109*cdf0e10cSrcweir #ifndef SVX_LIGHT 1110*cdf0e10cSrcweir for (sal_uInt32 a=0; !b3DObjSelected && a<GetMarkedObjectCount(); a++) { 1111*cdf0e10cSrcweir SdrObject* pObj = GetMarkedObjectByIndex(a); 1112*cdf0e10cSrcweir if(pObj && pObj->ISA(E3dObject)) 1113*cdf0e10cSrcweir b3DObjSelected = sal_True; 1114*cdf0e10cSrcweir } 1115*cdf0e10cSrcweir #endif 1116*cdf0e10cSrcweir // Falls es um ein 3D-Objekt geht, muss trotz !IsShearAllowed 1117*cdf0e10cSrcweir // weitergemacht werden, da es sich um eine Rotation statt um 1118*cdf0e10cSrcweir // einen Shear handelt 1119*cdf0e10cSrcweir if (bVertex && !IsShearAllowed() && !b3DObjSelected) 1120*cdf0e10cSrcweir return Pointer(POINTER_NOTALLOWED); 1121*cdf0e10cSrcweir if (bMov) 1122*cdf0e10cSrcweir return Pointer(POINTER_ROTATE); 1123*cdf0e10cSrcweir } break; 1124*cdf0e10cSrcweir case SDRDRAG_SHEAR: case SDRDRAG_DISTORT: { 1125*cdf0e10cSrcweir if (bCorner) { 1126*cdf0e10cSrcweir if (!IsDistortAllowed(sal_True) && !IsDistortAllowed(sal_False)) return Pointer(POINTER_NOTALLOWED); 1127*cdf0e10cSrcweir else return Pointer(POINTER_REFHAND); 1128*cdf0e10cSrcweir } 1129*cdf0e10cSrcweir if (bVertex && !IsShearAllowed()) return Pointer(POINTER_NOTALLOWED); 1130*cdf0e10cSrcweir if (bMov) { 1131*cdf0e10cSrcweir if (!IsMoveAllowed()) return Pointer(POINTER_ARROW); // weil Doppelklick oder Drag&Drop moeglich 1132*cdf0e10cSrcweir return Pointer(POINTER_MOVE); 1133*cdf0e10cSrcweir } 1134*cdf0e10cSrcweir } break; 1135*cdf0e10cSrcweir case SDRDRAG_MIRROR: { 1136*cdf0e10cSrcweir if (bCorner || bVertex || bMov) { 1137*cdf0e10cSrcweir SdrHdl* pH1=aHdl.GetHdl(HDL_REF1); 1138*cdf0e10cSrcweir SdrHdl* pH2=aHdl.GetHdl(HDL_REF2); 1139*cdf0e10cSrcweir sal_Bool b90=sal_False; 1140*cdf0e10cSrcweir sal_Bool b45=sal_False; 1141*cdf0e10cSrcweir Point aDif; 1142*cdf0e10cSrcweir if (pH1!=NULL && pH2!=NULL) { 1143*cdf0e10cSrcweir aDif=pH2->GetPos()-pH1->GetPos(); 1144*cdf0e10cSrcweir b90=(aDif.X()==0) || aDif.Y()==0; 1145*cdf0e10cSrcweir b45=b90 || (Abs(aDif.X())==Abs(aDif.Y())); 1146*cdf0e10cSrcweir } 1147*cdf0e10cSrcweir sal_Bool bNo=sal_False; 1148*cdf0e10cSrcweir if (!IsMirrorAllowed(sal_True,sal_True)) bNo=sal_True; // Spiegeln ueberhaupt nicht erlaubt 1149*cdf0e10cSrcweir if (!IsMirrorAllowed(sal_False,sal_False) && !b45) bNo=sal_True; // freies Spiegeln nicht erlaubt 1150*cdf0e10cSrcweir if (!IsMirrorAllowed(sal_True,sal_False) && !b90) bNo=sal_True; // Spiegeln hor/ver erlaubt 1151*cdf0e10cSrcweir if (bNo) return Pointer(POINTER_NOTALLOWED); 1152*cdf0e10cSrcweir if (b90) { 1153*cdf0e10cSrcweir return Pointer(POINTER_MIRROR); 1154*cdf0e10cSrcweir } 1155*cdf0e10cSrcweir return Pointer(POINTER_MIRROR); 1156*cdf0e10cSrcweir } 1157*cdf0e10cSrcweir } break; 1158*cdf0e10cSrcweir 1159*cdf0e10cSrcweir case SDRDRAG_TRANSPARENCE: 1160*cdf0e10cSrcweir { 1161*cdf0e10cSrcweir if(!IsTransparenceAllowed()) 1162*cdf0e10cSrcweir return Pointer(POINTER_NOTALLOWED); 1163*cdf0e10cSrcweir 1164*cdf0e10cSrcweir return Pointer(POINTER_REFHAND); 1165*cdf0e10cSrcweir } 1166*cdf0e10cSrcweir 1167*cdf0e10cSrcweir case SDRDRAG_GRADIENT: 1168*cdf0e10cSrcweir { 1169*cdf0e10cSrcweir if(!IsGradientAllowed()) 1170*cdf0e10cSrcweir return Pointer(POINTER_NOTALLOWED); 1171*cdf0e10cSrcweir 1172*cdf0e10cSrcweir return Pointer(POINTER_REFHAND); 1173*cdf0e10cSrcweir } 1174*cdf0e10cSrcweir 1175*cdf0e10cSrcweir case SDRDRAG_CROOK: { 1176*cdf0e10cSrcweir if (bCorner || bVertex || bMov) { 1177*cdf0e10cSrcweir if (!IsCrookAllowed(sal_True) && !IsCrookAllowed(sal_False)) return Pointer(POINTER_NOTALLOWED); 1178*cdf0e10cSrcweir return Pointer(POINTER_CROOK); 1179*cdf0e10cSrcweir } 1180*cdf0e10cSrcweir } 1181*cdf0e10cSrcweir 1182*cdf0e10cSrcweir case SDRDRAG_CROP: 1183*cdf0e10cSrcweir { 1184*cdf0e10cSrcweir return Pointer(POINTER_CROP); 1185*cdf0e10cSrcweir } 1186*cdf0e10cSrcweir 1187*cdf0e10cSrcweir default: { 1188*cdf0e10cSrcweir if ((bCorner || bVertex) && !IsResizeAllowed(sal_True)) return Pointer(POINTER_NOTALLOWED); 1189*cdf0e10cSrcweir } 1190*cdf0e10cSrcweir } 1191*cdf0e10cSrcweir if (pHdl!=NULL) return pHdl->GetPointer(); 1192*cdf0e10cSrcweir if (bMov) { 1193*cdf0e10cSrcweir if (!IsMoveAllowed()) return Pointer(POINTER_ARROW); // weil Doppelklick oder Drag&Drop moeglich 1194*cdf0e10cSrcweir return Pointer(POINTER_MOVE); 1195*cdf0e10cSrcweir } 1196*cdf0e10cSrcweir } 1197*cdf0e10cSrcweir if (eEditMode==SDREDITMODE_CREATE) return aAktCreatePointer; 1198*cdf0e10cSrcweir return Pointer(POINTER_ARROW); 1199*cdf0e10cSrcweir } 1200*cdf0e10cSrcweir 1201*cdf0e10cSrcweir XubString SdrView::GetStatusText() 1202*cdf0e10cSrcweir { 1203*cdf0e10cSrcweir XubString aStr; 1204*cdf0e10cSrcweir XubString aName; 1205*cdf0e10cSrcweir 1206*cdf0e10cSrcweir aStr.AppendAscii("nix"); 1207*cdf0e10cSrcweir 1208*cdf0e10cSrcweir if (pAktCreate!=NULL) 1209*cdf0e10cSrcweir { 1210*cdf0e10cSrcweir aStr=pAktCreate->getSpecialDragComment(aDragStat); 1211*cdf0e10cSrcweir 1212*cdf0e10cSrcweir if(!aStr.Len()) 1213*cdf0e10cSrcweir { 1214*cdf0e10cSrcweir pAktCreate->TakeObjNameSingul(aName); 1215*cdf0e10cSrcweir aStr = ImpGetResStr(STR_ViewCreateObj); 1216*cdf0e10cSrcweir } 1217*cdf0e10cSrcweir } 1218*cdf0e10cSrcweir else if (mpCurrentSdrDragMethod) 1219*cdf0e10cSrcweir { 1220*cdf0e10cSrcweir if (bInsPolyPoint || IsInsertGluePoint()) 1221*cdf0e10cSrcweir { 1222*cdf0e10cSrcweir aStr=aInsPointUndoStr; 1223*cdf0e10cSrcweir } 1224*cdf0e10cSrcweir else 1225*cdf0e10cSrcweir { 1226*cdf0e10cSrcweir if (aDragStat.IsMinMoved()) 1227*cdf0e10cSrcweir { 1228*cdf0e10cSrcweir OSL_TRACE("SdrView::GetStatusText(%lx) %lx\n", this, mpCurrentSdrDragMethod); 1229*cdf0e10cSrcweir mpCurrentSdrDragMethod->TakeSdrDragComment(aStr); 1230*cdf0e10cSrcweir } 1231*cdf0e10cSrcweir } 1232*cdf0e10cSrcweir } 1233*cdf0e10cSrcweir else if(IsMarkObj()) 1234*cdf0e10cSrcweir { 1235*cdf0e10cSrcweir if(AreObjectsMarked()) 1236*cdf0e10cSrcweir { 1237*cdf0e10cSrcweir aStr = ImpGetResStr(STR_ViewMarkMoreObjs); 1238*cdf0e10cSrcweir } 1239*cdf0e10cSrcweir else 1240*cdf0e10cSrcweir { 1241*cdf0e10cSrcweir aStr = ImpGetResStr(STR_ViewMarkObjs); 1242*cdf0e10cSrcweir } 1243*cdf0e10cSrcweir } 1244*cdf0e10cSrcweir else if(IsMarkPoints()) 1245*cdf0e10cSrcweir { 1246*cdf0e10cSrcweir if(HasMarkedPoints()) 1247*cdf0e10cSrcweir { 1248*cdf0e10cSrcweir aStr = ImpGetResStr(STR_ViewMarkMorePoints); 1249*cdf0e10cSrcweir } 1250*cdf0e10cSrcweir else 1251*cdf0e10cSrcweir { 1252*cdf0e10cSrcweir aStr = ImpGetResStr(STR_ViewMarkPoints); 1253*cdf0e10cSrcweir } 1254*cdf0e10cSrcweir } else if (IsMarkGluePoints()) 1255*cdf0e10cSrcweir { 1256*cdf0e10cSrcweir if(HasMarkedGluePoints()) 1257*cdf0e10cSrcweir { 1258*cdf0e10cSrcweir aStr = ImpGetResStr(STR_ViewMarkMoreGluePoints); 1259*cdf0e10cSrcweir } 1260*cdf0e10cSrcweir else 1261*cdf0e10cSrcweir { 1262*cdf0e10cSrcweir aStr = ImpGetResStr(STR_ViewMarkGluePoints); 1263*cdf0e10cSrcweir } 1264*cdf0e10cSrcweir } 1265*cdf0e10cSrcweir else if (IsTextEdit() && pTextEditOutlinerView!=NULL) { 1266*cdf0e10cSrcweir aStr=ImpGetResStr(STR_ViewTextEdit); // "TextEdit - Zeile y Spalte x"; 1267*cdf0e10cSrcweir ESelection aSel(pTextEditOutlinerView->GetSelection()); 1268*cdf0e10cSrcweir long nPar=aSel.nEndPara,nLin=0,nCol=aSel.nEndPos; 1269*cdf0e10cSrcweir if (aSel.nEndPara>0) { 1270*cdf0e10cSrcweir for (sal_uInt16 nParaNum=0; nParaNum<aSel.nEndPara; nParaNum++) { 1271*cdf0e10cSrcweir nLin+=pTextEditOutliner->GetLineCount(nParaNum); 1272*cdf0e10cSrcweir } 1273*cdf0e10cSrcweir } 1274*cdf0e10cSrcweir // Noch 'ne kleine Unschoenheit: 1275*cdf0e10cSrcweir // Am Ende einer Zeile eines mehrzeiligen Absatzes wird die Position 1276*cdf0e10cSrcweir // der naechsten Zeile des selben Absatzes angezeigt, so es eine solche 1277*cdf0e10cSrcweir // gibt. 1278*cdf0e10cSrcweir sal_uInt16 nParaLine=0; 1279*cdf0e10cSrcweir sal_uIntPtr nParaLineAnz=pTextEditOutliner->GetLineCount(aSel.nEndPara); 1280*cdf0e10cSrcweir sal_Bool bBrk=sal_False; 1281*cdf0e10cSrcweir while (!bBrk) { 1282*cdf0e10cSrcweir sal_uInt16 nLen=pTextEditOutliner->GetLineLen(aSel.nEndPara,nParaLine); 1283*cdf0e10cSrcweir sal_Bool bLastLine=(nParaLine==nParaLineAnz-1); 1284*cdf0e10cSrcweir if (nCol>nLen || (!bLastLine && nCol==nLen)) { 1285*cdf0e10cSrcweir nCol-=nLen; 1286*cdf0e10cSrcweir nLin++; 1287*cdf0e10cSrcweir nParaLine++; 1288*cdf0e10cSrcweir } else bBrk=sal_True; 1289*cdf0e10cSrcweir if (nLen==0) bBrk=sal_True; // Sicherheitshalber 1290*cdf0e10cSrcweir } 1291*cdf0e10cSrcweir 1292*cdf0e10cSrcweir aStr.SearchAndReplaceAscii("%1", UniString::CreateFromInt32(nPar + 1)); 1293*cdf0e10cSrcweir aStr.SearchAndReplaceAscii("%2", UniString::CreateFromInt32(nLin + 1)); 1294*cdf0e10cSrcweir aStr.SearchAndReplaceAscii("%3", UniString::CreateFromInt32(nCol + 1)); 1295*cdf0e10cSrcweir 1296*cdf0e10cSrcweir #ifdef DBG_UTIL 1297*cdf0e10cSrcweir aStr += UniString( RTL_CONSTASCII_USTRINGPARAM( ", Level " ) ); 1298*cdf0e10cSrcweir aStr += UniString::CreateFromInt32( pTextEditOutliner->GetDepth( aSel.nEndPara ) ); 1299*cdf0e10cSrcweir #endif 1300*cdf0e10cSrcweir } 1301*cdf0e10cSrcweir 1302*cdf0e10cSrcweir if(aStr.EqualsAscii("nix")) 1303*cdf0e10cSrcweir { 1304*cdf0e10cSrcweir if (AreObjectsMarked()) { 1305*cdf0e10cSrcweir ImpTakeDescriptionStr(STR_ViewMarked,aStr); 1306*cdf0e10cSrcweir if (IsGluePointEditMode()) { 1307*cdf0e10cSrcweir if (HasMarkedGluePoints()) { 1308*cdf0e10cSrcweir ImpTakeDescriptionStr(STR_ViewMarked,aStr,0,IMPSDR_GLUEPOINTSDESCRIPTION); 1309*cdf0e10cSrcweir } 1310*cdf0e10cSrcweir } else { 1311*cdf0e10cSrcweir if (HasMarkedPoints()) { 1312*cdf0e10cSrcweir ImpTakeDescriptionStr(STR_ViewMarked,aStr,0,IMPSDR_POINTSDESCRIPTION); 1313*cdf0e10cSrcweir } 1314*cdf0e10cSrcweir } 1315*cdf0e10cSrcweir } else { 1316*cdf0e10cSrcweir aStr.Erase(); 1317*cdf0e10cSrcweir } 1318*cdf0e10cSrcweir } 1319*cdf0e10cSrcweir else if(aName.Len()) 1320*cdf0e10cSrcweir { 1321*cdf0e10cSrcweir aStr.SearchAndReplaceAscii("%1", aName); 1322*cdf0e10cSrcweir } 1323*cdf0e10cSrcweir 1324*cdf0e10cSrcweir if(aStr.Len()) 1325*cdf0e10cSrcweir { 1326*cdf0e10cSrcweir // ersten Buchstaben gross schreiben 1327*cdf0e10cSrcweir String aTmpStr(aStr.Copy(0, 1)); 1328*cdf0e10cSrcweir aTmpStr.ToUpperAscii(); 1329*cdf0e10cSrcweir aStr.Replace(0, 1, aTmpStr); 1330*cdf0e10cSrcweir } 1331*cdf0e10cSrcweir return aStr; 1332*cdf0e10cSrcweir } 1333*cdf0e10cSrcweir 1334*cdf0e10cSrcweir SdrViewContext SdrView::GetContext() const 1335*cdf0e10cSrcweir { 1336*cdf0e10cSrcweir if( IsGluePointEditMode() ) 1337*cdf0e10cSrcweir return SDRCONTEXT_GLUEPOINTEDIT; 1338*cdf0e10cSrcweir 1339*cdf0e10cSrcweir const sal_uIntPtr nMarkAnz = GetMarkedObjectCount(); 1340*cdf0e10cSrcweir 1341*cdf0e10cSrcweir if( HasMarkablePoints() && !IsFrameHandles() ) 1342*cdf0e10cSrcweir { 1343*cdf0e10cSrcweir sal_Bool bPath=sal_True; 1344*cdf0e10cSrcweir for( sal_uIntPtr nMarkNum = 0; nMarkNum < nMarkAnz && bPath; nMarkNum++ ) 1345*cdf0e10cSrcweir if (!GetMarkedObjectByIndex(nMarkNum)->ISA(SdrPathObj)) 1346*cdf0e10cSrcweir bPath=sal_False; 1347*cdf0e10cSrcweir 1348*cdf0e10cSrcweir if( bPath ) 1349*cdf0e10cSrcweir return SDRCONTEXT_POINTEDIT; 1350*cdf0e10cSrcweir } 1351*cdf0e10cSrcweir 1352*cdf0e10cSrcweir if( GetMarkedObjectCount() ) 1353*cdf0e10cSrcweir { 1354*cdf0e10cSrcweir sal_Bool bGraf = sal_True, bMedia = sal_True, bTable = sal_True; 1355*cdf0e10cSrcweir 1356*cdf0e10cSrcweir for( sal_uIntPtr nMarkNum = 0; nMarkNum < nMarkAnz && ( bGraf || bMedia ); nMarkNum++ ) 1357*cdf0e10cSrcweir { 1358*cdf0e10cSrcweir const SdrObject* pMarkObj = GetMarkedObjectByIndex( nMarkNum ); 1359*cdf0e10cSrcweir DBG_ASSERT( pMarkObj, "SdrView::GetContext(), null pointer in mark list!" ); 1360*cdf0e10cSrcweir 1361*cdf0e10cSrcweir if( !pMarkObj ) 1362*cdf0e10cSrcweir continue; 1363*cdf0e10cSrcweir 1364*cdf0e10cSrcweir if( !pMarkObj->ISA( SdrGrafObj ) ) 1365*cdf0e10cSrcweir bGraf = sal_False; 1366*cdf0e10cSrcweir 1367*cdf0e10cSrcweir if( !pMarkObj->ISA( SdrMediaObj ) ) 1368*cdf0e10cSrcweir bMedia = sal_False; 1369*cdf0e10cSrcweir 1370*cdf0e10cSrcweir if( !pMarkObj->ISA( ::sdr::table::SdrTableObj ) ) 1371*cdf0e10cSrcweir bTable = sal_False; 1372*cdf0e10cSrcweir } 1373*cdf0e10cSrcweir 1374*cdf0e10cSrcweir if( bGraf ) 1375*cdf0e10cSrcweir return SDRCONTEXT_GRAPHIC; 1376*cdf0e10cSrcweir else if( bMedia ) 1377*cdf0e10cSrcweir return SDRCONTEXT_MEDIA; 1378*cdf0e10cSrcweir else if( bTable ) 1379*cdf0e10cSrcweir return SDRCONTEXT_TABLE; 1380*cdf0e10cSrcweir } 1381*cdf0e10cSrcweir 1382*cdf0e10cSrcweir return SDRCONTEXT_STANDARD; 1383*cdf0e10cSrcweir } 1384*cdf0e10cSrcweir 1385*cdf0e10cSrcweir void SdrView::MarkAll() 1386*cdf0e10cSrcweir { 1387*cdf0e10cSrcweir if (IsTextEdit()) { 1388*cdf0e10cSrcweir GetTextEditOutlinerView()->SetSelection(ESelection(0,0,0xFFFF,0xFFFF)); 1389*cdf0e10cSrcweir #ifdef DBG_UTIL 1390*cdf0e10cSrcweir if (pItemBrowser!=NULL) pItemBrowser->SetDirty(); 1391*cdf0e10cSrcweir #endif 1392*cdf0e10cSrcweir } else if (IsGluePointEditMode()) MarkAllGluePoints(); 1393*cdf0e10cSrcweir else if (HasMarkablePoints()) MarkAllPoints(); 1394*cdf0e10cSrcweir else MarkAllObj(); 1395*cdf0e10cSrcweir } 1396*cdf0e10cSrcweir 1397*cdf0e10cSrcweir void SdrView::UnmarkAll() 1398*cdf0e10cSrcweir { 1399*cdf0e10cSrcweir if (IsTextEdit()) { 1400*cdf0e10cSrcweir ESelection eSel=GetTextEditOutlinerView()->GetSelection(); 1401*cdf0e10cSrcweir eSel.nStartPara=eSel.nEndPara; 1402*cdf0e10cSrcweir eSel.nStartPos=eSel.nEndPos; 1403*cdf0e10cSrcweir GetTextEditOutlinerView()->SetSelection(eSel); 1404*cdf0e10cSrcweir #ifdef DBG_UTIL 1405*cdf0e10cSrcweir if (pItemBrowser!=NULL) pItemBrowser->SetDirty(); 1406*cdf0e10cSrcweir #endif 1407*cdf0e10cSrcweir } else if (HasMarkedGluePoints()) UnmarkAllGluePoints(); 1408*cdf0e10cSrcweir else if (HasMarkedPoints()) UnmarkAllPoints(); // ! Marked statt Markable ! 1409*cdf0e10cSrcweir else UnmarkAllObj(); 1410*cdf0e10cSrcweir } 1411*cdf0e10cSrcweir 1412*cdf0e10cSrcweir sal_Bool SdrView::IsAllMarked() const 1413*cdf0e10cSrcweir { 1414*cdf0e10cSrcweir if (IsTextEdit()) { 1415*cdf0e10cSrcweir return ImpIsTextEditAllSelected(); 1416*cdf0e10cSrcweir } 1417*cdf0e10cSrcweir if (IsGluePointEditMode()) { 1418*cdf0e10cSrcweir sal_uIntPtr nAnz=GetMarkableGluePointCount(); 1419*cdf0e10cSrcweir return nAnz!=0 && nAnz==GetMarkedGluePointCount(); 1420*cdf0e10cSrcweir } 1421*cdf0e10cSrcweir if (HasMarkedPoints()) { 1422*cdf0e10cSrcweir sal_uIntPtr nAnz=GetMarkablePointCount(); 1423*cdf0e10cSrcweir return nAnz!=0 && nAnz==GetMarkedPointCount(); 1424*cdf0e10cSrcweir } 1425*cdf0e10cSrcweir sal_uIntPtr nAnz=GetMarkableObjCount(); 1426*cdf0e10cSrcweir return nAnz!=0 && nAnz == GetMarkedObjectCount(); 1427*cdf0e10cSrcweir } 1428*cdf0e10cSrcweir 1429*cdf0e10cSrcweir sal_Bool SdrView::IsMarkPossible() const 1430*cdf0e10cSrcweir { 1431*cdf0e10cSrcweir if(IsTextEdit()) 1432*cdf0e10cSrcweir { 1433*cdf0e10cSrcweir return SdrTextObj::HasTextImpl( pTextEditOutliner ); 1434*cdf0e10cSrcweir } 1435*cdf0e10cSrcweir 1436*cdf0e10cSrcweir if(IsGluePointEditMode()) 1437*cdf0e10cSrcweir { 1438*cdf0e10cSrcweir return HasMarkableGluePoints(); 1439*cdf0e10cSrcweir } 1440*cdf0e10cSrcweir 1441*cdf0e10cSrcweir if(HasMarkedPoints()) 1442*cdf0e10cSrcweir { 1443*cdf0e10cSrcweir return HasMarkablePoints(); 1444*cdf0e10cSrcweir } 1445*cdf0e10cSrcweir 1446*cdf0e10cSrcweir return HasMarkableObj(); 1447*cdf0e10cSrcweir } 1448*cdf0e10cSrcweir 1449*cdf0e10cSrcweir sal_Bool SdrView::IsAllMarkPrevNextPossible() const 1450*cdf0e10cSrcweir { 1451*cdf0e10cSrcweir if (IsTextEdit()) { 1452*cdf0e10cSrcweir return sal_False; 1453*cdf0e10cSrcweir } 1454*cdf0e10cSrcweir if (IsGluePointEditMode()) { 1455*cdf0e10cSrcweir return HasMarkableGluePoints(); 1456*cdf0e10cSrcweir } 1457*cdf0e10cSrcweir if (HasMarkedPoints()) { 1458*cdf0e10cSrcweir return HasMarkablePoints(); 1459*cdf0e10cSrcweir } 1460*cdf0e10cSrcweir return HasMarkableObj(); 1461*cdf0e10cSrcweir } 1462*cdf0e10cSrcweir 1463*cdf0e10cSrcweir sal_Bool SdrView::MarkNext(sal_Bool bPrev) 1464*cdf0e10cSrcweir { 1465*cdf0e10cSrcweir if (IsTextEdit()) { 1466*cdf0e10cSrcweir return sal_False; 1467*cdf0e10cSrcweir } 1468*cdf0e10cSrcweir if (IsGluePointEditMode() && HasMarkedGluePoints()) { 1469*cdf0e10cSrcweir return MarkNextGluePoint(bPrev); 1470*cdf0e10cSrcweir } 1471*cdf0e10cSrcweir if (HasMarkedPoints()) { 1472*cdf0e10cSrcweir return MarkNextPoint(bPrev); 1473*cdf0e10cSrcweir } 1474*cdf0e10cSrcweir return MarkNextObj(bPrev); 1475*cdf0e10cSrcweir } 1476*cdf0e10cSrcweir 1477*cdf0e10cSrcweir sal_Bool SdrView::MarkNext(const Point& rPnt, sal_Bool bPrev) 1478*cdf0e10cSrcweir { 1479*cdf0e10cSrcweir if (IsTextEdit()) { 1480*cdf0e10cSrcweir return sal_False; 1481*cdf0e10cSrcweir } 1482*cdf0e10cSrcweir if (IsGluePointEditMode() && HasMarkedGluePoints()) { 1483*cdf0e10cSrcweir //return MarkNextGluePoint(rPnt,bPrev); fehlende Implementation !!! 1484*cdf0e10cSrcweir } 1485*cdf0e10cSrcweir if (HasMarkedPoints()) { 1486*cdf0e10cSrcweir //return MarkNextPoint(rPnt,bPrev); fehlende Implementation !!! 1487*cdf0e10cSrcweir } 1488*cdf0e10cSrcweir return MarkNextObj(rPnt,-2,bPrev); 1489*cdf0e10cSrcweir } 1490*cdf0e10cSrcweir 1491*cdf0e10cSrcweir const Rectangle& SdrView::GetMarkedRect() const 1492*cdf0e10cSrcweir { 1493*cdf0e10cSrcweir if (IsGluePointEditMode() && HasMarkedGluePoints()) { 1494*cdf0e10cSrcweir return GetMarkedGluePointsRect(); 1495*cdf0e10cSrcweir } 1496*cdf0e10cSrcweir if (HasMarkedPoints()) { 1497*cdf0e10cSrcweir return GetMarkedPointsRect(); 1498*cdf0e10cSrcweir } 1499*cdf0e10cSrcweir return GetMarkedObjRect(); 1500*cdf0e10cSrcweir } 1501*cdf0e10cSrcweir 1502*cdf0e10cSrcweir void SdrView::SetMarkedRect(const Rectangle& rRect) 1503*cdf0e10cSrcweir { 1504*cdf0e10cSrcweir if (IsGluePointEditMode() && HasMarkedGluePoints()) { 1505*cdf0e10cSrcweir //SetMarkedGluePointsRect(rRect); fehlende Implementation !!! 1506*cdf0e10cSrcweir } else if (HasMarkedPoints()) { 1507*cdf0e10cSrcweir //SetMarkedPointsRect(rRect); fehlende Implementation !!! 1508*cdf0e10cSrcweir } else SetMarkedObjRect(rRect); 1509*cdf0e10cSrcweir } 1510*cdf0e10cSrcweir 1511*cdf0e10cSrcweir void SdrView::DeleteMarked() 1512*cdf0e10cSrcweir { 1513*cdf0e10cSrcweir if (IsTextEdit()) 1514*cdf0e10cSrcweir { 1515*cdf0e10cSrcweir SdrObjEditView::KeyInput(KeyEvent(0,KeyCode(KEYFUNC_DELETE)),pTextEditWin); 1516*cdf0e10cSrcweir } 1517*cdf0e10cSrcweir else 1518*cdf0e10cSrcweir { 1519*cdf0e10cSrcweir if( mxSelectionController.is() && mxSelectionController->DeleteMarked() ) 1520*cdf0e10cSrcweir { 1521*cdf0e10cSrcweir // action already performed by current selection controller, do nothing 1522*cdf0e10cSrcweir } 1523*cdf0e10cSrcweir else if (IsGluePointEditMode() && HasMarkedGluePoints()) 1524*cdf0e10cSrcweir { 1525*cdf0e10cSrcweir DeleteMarkedGluePoints(); 1526*cdf0e10cSrcweir } 1527*cdf0e10cSrcweir else if (GetContext()==SDRCONTEXT_POINTEDIT && HasMarkedPoints()) 1528*cdf0e10cSrcweir { 1529*cdf0e10cSrcweir DeleteMarkedPoints(); 1530*cdf0e10cSrcweir } 1531*cdf0e10cSrcweir else 1532*cdf0e10cSrcweir { 1533*cdf0e10cSrcweir DeleteMarkedObj(); 1534*cdf0e10cSrcweir } 1535*cdf0e10cSrcweir } 1536*cdf0e10cSrcweir } 1537*cdf0e10cSrcweir 1538*cdf0e10cSrcweir sal_Bool SdrView::BegMark(const Point& rPnt, sal_Bool bAddMark, sal_Bool bUnmark) 1539*cdf0e10cSrcweir { 1540*cdf0e10cSrcweir if (bUnmark) bAddMark=sal_True; 1541*cdf0e10cSrcweir if (IsGluePointEditMode()) { 1542*cdf0e10cSrcweir if (!bAddMark) UnmarkAllGluePoints(); 1543*cdf0e10cSrcweir return BegMarkGluePoints(rPnt,bUnmark); 1544*cdf0e10cSrcweir } else if (HasMarkablePoints()) { 1545*cdf0e10cSrcweir if (!bAddMark) UnmarkAllPoints(); 1546*cdf0e10cSrcweir return BegMarkPoints(rPnt,bUnmark); 1547*cdf0e10cSrcweir } else { 1548*cdf0e10cSrcweir if (!bAddMark) UnmarkAllObj(); 1549*cdf0e10cSrcweir return BegMarkObj(rPnt,bUnmark); 1550*cdf0e10cSrcweir } 1551*cdf0e10cSrcweir } 1552*cdf0e10cSrcweir 1553*cdf0e10cSrcweir sal_Bool SdrView::IsDeleteMarkedPossible() const 1554*cdf0e10cSrcweir { 1555*cdf0e10cSrcweir if (IsReadOnly()) return sal_False; 1556*cdf0e10cSrcweir if (IsTextEdit()) return sal_True; 1557*cdf0e10cSrcweir if (IsGluePointEditMode() && HasMarkedGluePoints()) return sal_True; 1558*cdf0e10cSrcweir if (HasMarkedPoints()) return sal_True; 1559*cdf0e10cSrcweir return IsDeleteMarkedObjPossible(); 1560*cdf0e10cSrcweir } 1561*cdf0e10cSrcweir 1562*cdf0e10cSrcweir void SdrView::ConfigurationChanged( ::utl::ConfigurationBroadcaster*p, sal_uInt32 nHint) 1563*cdf0e10cSrcweir { 1564*cdf0e10cSrcweir onAccessibilityOptionsChanged(); 1565*cdf0e10cSrcweir SdrCreateView::ConfigurationChanged(p, nHint); 1566*cdf0e10cSrcweir } 1567*cdf0e10cSrcweir 1568*cdf0e10cSrcweir SvtAccessibilityOptions& SdrView::getAccessibilityOptions() 1569*cdf0e10cSrcweir { 1570*cdf0e10cSrcweir return maAccessibilityOptions; 1571*cdf0e10cSrcweir } 1572*cdf0e10cSrcweir 1573*cdf0e10cSrcweir /** method is called whenever the global SvtAccessibilityOptions is changed */ 1574*cdf0e10cSrcweir void SdrView::onAccessibilityOptionsChanged() 1575*cdf0e10cSrcweir { 1576*cdf0e10cSrcweir } 1577*cdf0e10cSrcweir 1578*cdf0e10cSrcweir void SdrView::SetMasterPagePaintCaching(sal_Bool bOn) 1579*cdf0e10cSrcweir { 1580*cdf0e10cSrcweir if(mbMasterPagePaintCaching != bOn) 1581*cdf0e10cSrcweir { 1582*cdf0e10cSrcweir mbMasterPagePaintCaching = bOn; 1583*cdf0e10cSrcweir 1584*cdf0e10cSrcweir // reset at all SdrPageWindow's 1585*cdf0e10cSrcweir SdrPageView* pPageView = GetSdrPageView(); 1586*cdf0e10cSrcweir 1587*cdf0e10cSrcweir if(pPageView) 1588*cdf0e10cSrcweir { 1589*cdf0e10cSrcweir for(sal_uInt32 b(0L); b < pPageView->PageWindowCount(); b++) 1590*cdf0e10cSrcweir { 1591*cdf0e10cSrcweir SdrPageWindow* pPageWindow = pPageView->GetPageWindow(b); 1592*cdf0e10cSrcweir DBG_ASSERT(pPageWindow, "SdrView::SetMasterPagePaintCaching: Corrupt SdrPageWindow list (!)"); 1593*cdf0e10cSrcweir 1594*cdf0e10cSrcweir // force deletion of ObjectContact, so at re-display all VOCs 1595*cdf0e10cSrcweir // will be re-created with updated flag setting 1596*cdf0e10cSrcweir pPageWindow->ResetObjectContact(); 1597*cdf0e10cSrcweir } 1598*cdf0e10cSrcweir 1599*cdf0e10cSrcweir // force redraw of this view 1600*cdf0e10cSrcweir pPageView->InvalidateAllWin(); 1601*cdf0e10cSrcweir } 1602*cdf0e10cSrcweir } 1603*cdf0e10cSrcweir } 1604*cdf0e10cSrcweir // eof 1605