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