LibreOffice Module svx (master) 1
svdview.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <editeng/outlobj.hxx>
21
22#include <svx/strings.hrc>
23#include <svx/dialmgr.hxx>
24#include <svx/svdpagv.hxx>
25#include <svx/svdmrkv.hxx>
26#include <svx/svdedxv.hxx>
27#include <svx/svdobj.hxx>
28#include <svx/svdopath.hxx>
29#include <svx/svdograf.hxx>
30#include <svx/svdomedia.hxx>
31#include <svx/svdetc.hxx>
32
34#include <svx/svdoutl.hxx>
35#include <svx/svdview.hxx>
36#include <editeng/flditem.hxx>
37#include <svx/obj3d.hxx>
38#include <svx/svddrgmt.hxx>
39#include <svx/svdotable.hxx>
40#include <tools/debug.hxx>
44#include <svx/sdrpagewindow.hxx>
49#include <sal/log.hxx>
50#include <vcl/ptrstyle.hxx>
51#include <vcl/window.hxx>
52#include <comphelper/lok.hxx>
53
54
56 : mpHdl(nullptr),
57 mpObj(nullptr),
58 mpRootObj(nullptr),
59 mpPV(nullptr),
60 mpURLField(nullptr),
61 meHit(SdrHitKind::NONE),
62 meEvent(SdrEventKind::NONE),
63 mnMouseClicks(0),
64 mnMouseMode(MouseEventModifiers::NONE),
65 mnMouseCode(0),
66 mnHlplIdx(0),
67 mnGlueId(0),
68 mbMouseDown(false),
69 mbMouseUp(false),
70 mbIsAction(false),
71 mbIsTextEdit(false),
72 mbAddMark(false),
73 mbUnmark(false),
74 mbPrevNextMark(false),
75 mbMarkPrev(false)
76{
77}
78
79// helper class for all D&D overlays
80
82 const SdrView& rView,
83 const basegfx::B2DPolyPolygon& rLinePolyPolygon)
84{
85 for(sal_uInt32 a(0); a < rView.PaintWindowCount(); a++)
86 {
87 SdrPaintWindow* pCandidate = rView.GetPaintWindow(a);
88 const rtl::Reference< sdr::overlay::OverlayManager >& xTargetOverlay = pCandidate->GetOverlayManager();
89
90 if (xTargetOverlay.is())
91 {
92 std::unique_ptr<sdr::overlay::OverlayPolyPolygonStripedAndFilled> pNew(new sdr::overlay::OverlayPolyPolygonStripedAndFilled(
93 rLinePolyPolygon));
94
95 xTargetOverlay->add(*pNew);
96 maObjects.append(std::move(pNew));
97 }
98 }
99}
100
102{
104 rView,
105 rObject.TakeXorPoly());
106}
107
109{
110 basegfx::B2DPolygon aB2DPolygon;
111
112 aB2DPolygon.append(basegfx::B2DPoint(rRectangle.Left(), rRectangle.Top()));
113 aB2DPolygon.append(basegfx::B2DPoint(rRectangle.Right(), rRectangle.Top()));
114 aB2DPolygon.append(basegfx::B2DPoint(rRectangle.Right(), rRectangle.Bottom()));
115 aB2DPolygon.append(basegfx::B2DPoint(rRectangle.Left(), rRectangle.Bottom()));
116 aB2DPolygon.setClosed(true);
117
119 rView,
120 basegfx::B2DPolyPolygon(aB2DPolygon));
121}
122
123SdrDropMarkerOverlay::SdrDropMarkerOverlay(const SdrView& rView, const Point& rStart, const Point& rEnd)
124{
125 basegfx::B2DPolygon aB2DPolygon;
126
127 aB2DPolygon.append(basegfx::B2DPoint(rStart.X(), rStart.Y()));
128 aB2DPolygon.append(basegfx::B2DPoint(rEnd.X(), rEnd.Y()));
129 aB2DPolygon.setClosed(true);
130
132 rView,
133 basegfx::B2DPolyPolygon(aB2DPolygon));
134}
135
137{
138 // The OverlayObjects are cleared using the destructor of OverlayObjectList.
139 // That destructor calls clear() at the list which removes all objects from the
140 // OverlayManager and deletes them.
141}
142
144 SdrModel& rSdrModel,
145 OutputDevice* pOut)
146: SdrCreateView(rSdrModel, pOut),
147 mbNoExtendedMouseDispatcher(false),
148 mbNoExtendedKeyDispatcher(false),
149 mbMasterPagePaintCaching(false)
150{
151 maAccessibilityOptions.AddListener(this);
153}
154
156{
157 maAccessibilityOptions.RemoveListener(this);
158}
159
160bool SdrView::KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin)
161{
162 SetActualWin(pWin ? pWin->GetOutDev() : nullptr);
163 bool bRet = SdrCreateView::KeyInput(rKEvt,pWin);
164 if (!bRet && !IsExtendedKeyInputDispatcherEnabled()) {
165 bRet = true;
166 switch (rKEvt.GetKeyCode().GetFullFunction()) {
167 case KeyFuncType::DELETE: DeleteMarked(); break;
168 case KeyFuncType::UNDO: mpModel->Undo(); break;
169 case KeyFuncType::REDO: mpModel->Redo(); break;
170 default: {
171 switch (rKEvt.GetKeyCode().GetFullCode()) {
172 case KEY_ESCAPE: {
173 if (IsTextEdit()) SdrEndTextEdit();
174 if (IsAction()) BrkAction();
175 if (pWin!=nullptr) pWin->ReleaseMouse();
176 } break;
177 case KEY_DELETE: DeleteMarked(); break;
178 case KEY_UNDO: case KEY_BACKSPACE+KEY_MOD2: mpModel->Undo(); break;
180 case KEY_REPEAT: case KEY_BACKSPACE+KEY_MOD2+KEY_MOD1: mpModel->Repeat(*this); break;
181 case KEY_MOD1+KEY_A: MarkAll(); break;
182 default: bRet=false;
183 } // switch
184 }
185 } // switch
186 if (bRet && pWin!=nullptr) {
188 pWin->PixelToLogic(pWin->ScreenToOutputPixel( pWin->GetPointerPosPixel() ) ),
189 pWin->GetOutDev(),
190 rKEvt.GetKeyCode().GetModifier()));
191 }
192 }
193 return bRet;
194}
195
197{
198 SetActualWin(pWin);
199 if (rMEvt.IsLeft()) maDragStat.SetMouseDown(true);
200 bool bRet = SdrCreateView::MouseButtonDown(rMEvt,pWin);
202 SdrViewEvent aVEvt;
204 bRet = DoMouseEvent(aVEvt);
205 }
206 return bRet;
207}
208
210{
211 SetActualWin(pWin);
212 if (rMEvt.IsLeft()) maDragStat.SetMouseDown(false);
213 bool bAction = IsAction();
214 bool bRet = !bAction && SdrCreateView::MouseButtonUp(rMEvt,pWin);
216 SdrViewEvent aVEvt;
218 bRet = DoMouseEvent(aVEvt);
219 }
220 return bRet;
221}
222
224{
225 SetActualWin(pWin);
227 bool bRet = SdrCreateView::MouseMove(rMEvt,pWin);
229 SdrViewEvent aVEvt;
231 if (DoMouseEvent(aVEvt)) bRet=true;
232 }
233
234 return bRet;
235}
236
238{
239 SetActualWin(pWin->GetOutDev());
240 bool bRet = SdrCreateView::Command(rCEvt,pWin);
241 return bRet;
242}
243
244void SdrView::GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const
245{
246 SdrCreateView::GetAttributes(rTargetSet, bOnlyHardAttr);
247}
248
250{
251 rVEvt.mbMouseDown = nEventKind==SdrMouseEventKind::BUTTONDOWN;
252 rVEvt.mbMouseUp = nEventKind==SdrMouseEventKind::BUTTONUP;
253 rVEvt.mnMouseClicks = rMEvt.GetClicks();
254 rVEvt.mnMouseMode = rMEvt.GetMode();
255 rVEvt.mnMouseCode = rMEvt.GetButtons() | rMEvt.GetModifier();
257 if (pOut==nullptr)
258 {
260 }
261 Point aPnt(rMEvt.GetPosPixel());
262 if (pOut!=nullptr) aPnt=pOut->PixelToLogic(aPnt);
263
264 if (mbNegativeX)
265 {
266 // Shape's x coordinates are all negated,
267 // Hence negate mouse event's x coord to match.
268 aPnt.setX(-aPnt.X());
269 }
270
271 rVEvt.maLogicPos = aPnt;
272 return PickAnything(aPnt,rVEvt);
273}
274
275// Dragging with the Mouse (Move)
276// Example when creating a rectangle: MouseDown has to happen without a ModKey,
277// else we usually force a selection (see below).
278// When pressing Shift, Ctrl and Alt at the same time while doing a MouseMove,
279// a centered, not snapped square is created.
280// The dual allocation of Ortho and Shift won't usually create a problem, as the
281// two functions are in most cases mutually exclusive. Only shearing (the kind
282// that happens when contorting, not when rotating) can use both functions at
283// the same time. To get around this, the user can use e. g. help lines.
284#define MODKEY_NoSnap bCtrl /* temporarily disable snapping */
285#define MODKEY_Ortho bShift /* ortho */
286#define MODKEY_Center bAlt /* create/resize centeredly */
287#define MODKEY_AngleSnap bShift
288#define MODKEY_CopyDrag bCtrl /* drag and copy */
289
290// click somewhere (MouseDown)
291#define MODKEY_PolyPoly bAlt /* new Poly at InsPt and at Create */
292#define MODKEY_MultiMark bShift /* MarkObj without doing UnmarkAll first */
293#define MODKEY_Unmark bAlt /* deselect with a dragged frame */
294#define MODKEY_ForceMark bCtrl /* force dragging a frame, even if there's an object at cursor position */
295#define MODKEY_DeepMark bAlt /* MarkNextObj */
296#define MODKEY_DeepBackw bShift /* MarkNextObj but backwards */
297
298SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) const
299{
301 if (pOut==nullptr)
302 {
304 }
305
306 // #i73628# Use a non-changeable copy of he logic position
307 const Point aLocalLogicPosition(rLogicPos);
308
309 bool bEditMode=IsEditMode();
310 bool bPointMode=bEditMode && HasMarkablePoints();
311 bool bGluePointMode=IsGluePointEditMode();
312 bool bInsPolyPt=bPointMode && IsInsObjPointMode() && IsInsObjPointPossible();
313 bool bInsGluePt=bGluePointMode && IsInsGluePointMode() && IsInsGluePointPossible();
314 bool bIsTextEdit=IsTextEdit();
315 bool bTextEditHit=IsTextEditHit(aLocalLogicPosition);
316 bool bTextEditSel=IsTextEditInSelectionMode();
317 bool bShift = (rVEvt.mnMouseCode & KEY_SHIFT) != 0;
318 bool bCtrl = (rVEvt.mnMouseCode & KEY_MOD1) != 0;
319 bool bAlt = (rVEvt.mnMouseCode & KEY_MOD2) != 0;
321 SdrHdl* pHdl=pOut!=nullptr && !bTextEditSel ? PickHandle(aLocalLogicPosition) : nullptr;
322 SdrPageView* pPV=nullptr;
323 SdrObject* pObj=nullptr;
324 SdrObject* pHitObj=nullptr;
325 bool bHitPassDirect=true;
326 sal_uInt16 nHlplIdx=0;
327 sal_uInt16 nGlueId=0;
328 if (bTextEditHit || bTextEditSel)
329 {
331 }
332 else if (pHdl!=nullptr)
333 {
334 eHit=SdrHitKind::Handle; // handle is hit: highest priority
335 }
336 else if (bEditMode && IsHlplVisible() && IsHlplFront() && pOut!=nullptr && PickHelpLine(aLocalLogicPosition,mnHitTolLog,*pOut,nHlplIdx,pPV))
337 {
338 eHit=SdrHitKind::HelpLine; // help line in the foreground hit: can be moved now
339 }
340 else if (bGluePointMode && PickGluePoint(aLocalLogicPosition,pObj,nGlueId,pPV))
341 {
342 eHit=SdrHitKind::Gluepoint; // deselected gluepoint hit
343 }
344 else if ((pHitObj = PickObj(aLocalLogicPosition,mnHitTolLog,pPV,SdrSearchOptions::DEEP|SdrSearchOptions::MARKED,&pObj,&bHitPassDirect)))
345 {
347 sdr::table::SdrTableObj* pTableObj = dynamic_cast< sdr::table::SdrTableObj* >( pObj );
348 if( pTableObj )
349 {
350 sal_Int32 nX = 0, nY = 0;
351 switch( pTableObj->CheckTableHit( aLocalLogicPosition, nX, nY ) )
352 {
354 eHit = SdrHitKind::Cell;
355 break;
358 break;
359 default:
360 break;
361 }
362 }
363 }
364 else if ((pHitObj = PickObj(aLocalLogicPosition,mnHitTolLog,pPV,SdrSearchOptions::DEEP|SdrSearchOptions::ALSOONMASTER|SdrSearchOptions::WHOLEPAGE,&pObj,&bHitPassDirect)))
365 {
366 // MasterPages and WholePage for Macro and URL
368 sdr::table::SdrTableObj* pTableObj = dynamic_cast< sdr::table::SdrTableObj* >( pObj );
369 if( pTableObj )
370 {
371 sal_Int32 nX = 0, nY = 0;
372 switch( pTableObj->CheckTableHit( aLocalLogicPosition, nX, nY, mnHitTolLog ) )
373 {
375 eHit = SdrHitKind::Cell;
376 break;
378 // Keep state on UnmarkedObject to allow the below
379 // 'check for URL field' to be executed, else popups
380 // for e.g. URL links when hoovering and clicking
381 // them will not work. Tried several other changes,
382 // but this one safely keeps existing behaviour as-is.
383 // Except for the LOK. LOK doesn't have hoovering popup
384 // feature.
386 break;
387 default:
388 break;
389 }
390 }
391 }
392 else if (bEditMode && IsHlplVisible() && !IsHlplFront() && pOut!=nullptr && PickHelpLine(aLocalLogicPosition,mnHitTolLog,*pOut,nHlplIdx,pPV))
393 {
394 eHit=SdrHitKind::HelpLine; // help line in foreground hit: can be moved now
395 }
397 {
398 bool bRoot=pObj->HasMacro();
399 bool bDeep=pObj!=pHitObj && pHitObj->HasMacro();
400 bool bMid=false; // Have we hit upon a grouped group with a macro?
401 SdrObject* pMidObj=nullptr;
402 if (pObj!=pHitObj)
403 {
404 SdrObject* pObjTmp=pHitObj->getParentSdrObjectFromSdrObject();
405 if (pObjTmp==pObj) pObjTmp=nullptr;
406 while (pObjTmp!=nullptr)
407 {
408 if (pObjTmp->HasMacro())
409 {
410 bMid=true;
411 pMidObj=pObjTmp;
412 }
413 pObjTmp=pObjTmp->getParentSdrObjectFromSdrObject();
414 if (pObjTmp==pObj) pObjTmp=nullptr;
415 }
416 }
417
418 if (bDeep || bMid || bRoot)
419 {
420 SdrObjMacroHitRec aHitRec;
421 aHitRec.aPos=aLocalLogicPosition;
422 aHitRec.nTol=mnHitTolLog;
423 aHitRec.pVisiLayer=&pPV->GetVisibleLayers();
424 aHitRec.pPageView=pPV;
425 if (bDeep) bDeep=pHitObj->IsMacroHit(aHitRec);
426 if (bMid ) bMid =pMidObj->IsMacroHit(aHitRec);
427 if (bRoot) bRoot=pObj->IsMacroHit(aHitRec);
428 if (bRoot || bMid || bDeep)
429 {
430 // Priorities: 1. Root, 2. Mid, 3. Deep
431 rVEvt.mpRootObj = pObj;
432 if (!bRoot) pObj=pMidObj;
433 if (!bRoot && !bMid) pObj=pHitObj;
435 }
436 }
437 }
438 // check for URL field
440 {
441 SdrTextObj* pTextObj=DynCastSdrTextObj( pHitObj );
442 if (pTextObj!=nullptr && pTextObj->HasText())
443 {
444 // use the primitive-based HitTest which is more accurate anyways. It
445 // will correctly handle rotated/mirrored/sheared/scaled text and can
446 // now return a HitContainer containing the primitive hierarchy of the
447 // primitive that triggered the hit. The first entry is that primitive,
448 // the others are the full stack of primitives leading to that one which
449 // includes grouping primitives (like TextHierarchyPrimitives we deed here)
450 // but also all decomposed ones which lead to the creation of that primitive
452 const bool bTEHit(pPV && SdrObjectPrimitiveHit(*pTextObj, aLocalLogicPosition, 0, *pPV, &pPV->GetVisibleLayers(), true, &aHitContainer));
453
454 if (bTEHit && !aHitContainer.empty())
455 {
456 // search for TextHierarchyFieldPrimitive2D which contains the needed information
457 // about a possible URLField
458 const drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D* pTextHierarchyFieldPrimitive2D = nullptr;
459
460 for (const drawinglayer::primitive2d::Primitive2DReference& xReference : aHitContainer)
461 {
462 auto pBasePrimitive = xReference.get();
463 if (pBasePrimitive && pBasePrimitive->getPrimitive2DID() == PRIMITIVE2D_ID_TEXTHIERARCHYFIELDPRIMITIVE2D)
464 {
465 pTextHierarchyFieldPrimitive2D = static_cast<const drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D*>(pBasePrimitive);
466 break;
467 }
468 }
469
470 if (nullptr != pTextHierarchyFieldPrimitive2D)
471 {
472 if (drawinglayer::primitive2d::FieldType::FIELD_TYPE_URL == pTextHierarchyFieldPrimitive2D->getType())
473 {
474 // problem with the old code is that a *pointer* to an instance of
475 // SvxURLField is set in the Event which is per se not good since that
476 // data comes from a temporary EditEngine's data and could vanish any
477 // moment. Have to replace for now with a static instance that gets
478 // filled/initialized from the original data held in the TextHierarchyField-
479 // Primitive2D (see impTextBreakupHandler::impCheckFieldPrimitive).
480 // Unfortunately things like 'TargetFrame' are still used in Calc, so this
481 // can currently not get replaced. For the future the Name/Value vector or
482 // the TextHierarchyFieldPrimitive2D itself should/will be used for handling
483 // that data
484 static SvxURLField aSvxURLField;
485
486 aSvxURLField.SetURL(pTextHierarchyFieldPrimitive2D->getValue("URL"));
487 aSvxURLField.SetRepresentation(pTextHierarchyFieldPrimitive2D->getValue("Representation"));
488 aSvxURLField.SetTargetFrame(pTextHierarchyFieldPrimitive2D->getValue("TargetFrame"));
489 const OUString aFormat(pTextHierarchyFieldPrimitive2D->getValue("SvxURLFormat"));
490
491 if (!aFormat.isEmpty())
492 {
493 aSvxURLField.SetFormat(static_cast<SvxURLFormat>(aFormat.toInt32()));
494 }
495
496 // set HitKind and pointer to local static instance in the Event
497 // to comply to old stuff
499 rVEvt.mpURLField = &aSvxURLField;
500 }
501 }
502 }
503 }
504 if (eHit==SdrHitKind::UnmarkedObject && !pHitObj->getHyperlink().isEmpty())
505 {
506 static SvxURLField aSvxURLField;
507 aSvxURLField.SetURL(pHitObj->getHyperlink());
508 rVEvt.mpURLField = &aSvxURLField;
510 }
511 }
512
513 if (bHitPassDirect &&
515 (IsTextTool() || (IsEditMode() && IsQuickTextEditMode())) && pHitObj->HasTextEdit())
516 {
517 // Around the TextEditArea there's a border to select without going into text edit mode.
518 tools::Rectangle aBoundRect(pHitObj->GetCurrentBoundRect());
519
520 // Force to SnapRect when Fontwork
521 if( auto pTextObj = DynCastSdrTextObj(pHitObj) )
522 if( pTextObj->IsFontwork() )
523 aBoundRect = pHitObj->GetSnapRect();
524
525 sal_Int32 nTolerance(mnHitTolLog);
526 bool bBoundRectHit(false);
527
528 if(pOut)
529 {
530 nTolerance = pOut->PixelToLogic(Size(2, 0)).Width();
531 }
532
533 if( (aLocalLogicPosition.X() >= aBoundRect.Left() - nTolerance && aLocalLogicPosition.X() <= aBoundRect.Left() + nTolerance)
534 || (aLocalLogicPosition.X() >= aBoundRect.Right() - nTolerance && aLocalLogicPosition.X() <= aBoundRect.Right() + nTolerance)
535 || (aLocalLogicPosition.Y() >= aBoundRect.Top() - nTolerance && aLocalLogicPosition.Y() <= aBoundRect.Top() + nTolerance)
536 || (aLocalLogicPosition.Y() >= aBoundRect.Bottom() - nTolerance && aLocalLogicPosition.Y() <= aBoundRect.Bottom() + nTolerance))
537 {
538 bBoundRectHit = true;
539 }
540
541 if(!bBoundRectHit)
542 {
543 bool bTEHit(pPV &&
544 SdrObjectPrimitiveHit(*pHitObj, aLocalLogicPosition, 0, *pPV, &pPV->GetVisibleLayers(), true));
545
546 // TextEdit attached to an object in a locked layer
547 if (bTEHit && pPV->GetLockedLayers().IsSet(pHitObj->GetLayer()))
548 {
549 bTEHit=false;
550 }
551
552 if (bTEHit)
553 {
554 rVEvt.mpRootObj=pObj;
555 pObj=pHitObj;
557 }
558 }
559 }
560 if (!bHitPassDirect && eHit==SdrHitKind::UnmarkedObject) {
561 eHit=SdrHitKind::NONE;
562 pObj=nullptr;
563 pPV=nullptr;
564 }
565 bool bMouseLeft = (rVEvt.mnMouseCode & MOUSE_LEFT) != 0;
566 bool bMouseRight = (rVEvt.mnMouseCode & MOUSE_RIGHT) != 0;
567 bool bMouseDown = rVEvt.mbMouseDown;
568 bool bMouseUp = rVEvt.mbMouseUp;
570 bool bIsAction=IsAction();
571
572 if (bIsAction)
573 {
574 if (bMouseDown)
575 {
576 if (bMouseRight) eEvent=SdrEventKind::BackAction;
577 }
578 else if (bMouseUp)
579 {
580 if (bMouseLeft)
581 {
583 if (IsDragObj())
584 {
586 }
587 else if (IsCreateObj() || IsInsObjPoint())
588 {
590 }
591 else if (IsMarking())
592 {
594 if (!maDragStat.IsMinMoved())
595 {
598 }
599 }
600 }
601 }
602 else
603 {
605 }
606 }
607 else if (eHit==SdrHitKind::TextEdit)
608 {
610 }
611 else if (bMouseDown && bMouseLeft)
612 {
613 if (rVEvt.mnMouseClicks == 2 && rVEvt.mnMouseCode == MOUSE_LEFT && pObj!=nullptr && pHitObj!=nullptr && pHitObj->HasTextEdit() && eHit==SdrHitKind::MarkedObject)
614 {
615 rVEvt.mpRootObj = pObj;
616 pObj=pHitObj;
618 }
619 else if (MODKEY_ForceMark && eHit!=SdrHitKind::UrlField)
620 {
621 eEvent=SdrEventKind::BeginMark; // AddMark,Unmark */
622 }
623 else if (eHit==SdrHitKind::HelpLine)
624 {
625 eEvent=SdrEventKind::BeginDragHelpline; // nothing, actually
626 }
627 else if (eHit==SdrHitKind::Gluepoint)
628 {
629 eEvent=SdrEventKind::MarkGluePoint; // AddMark+Drag
630 rVEvt.mbAddMark = MODKEY_MultiMark || MODKEY_DeepMark; // if not hit with Deep
631 }
632 else if (eHit==SdrHitKind::Handle)
633 {
634 eEvent=SdrEventKind::BeginDragObj; // Mark+Drag,AddMark+Drag,DeepMark+Drag,Unmark
635 bool bGlue=pHdl->GetKind()==SdrHdlKind::Glue;
636 bool bPoly=!bGlue && IsPointMarkable(*pHdl);
637 bool bMarked=bGlue || (bPoly && pHdl->IsSelected());
638 if (bGlue || bPoly)
639 {
641 if (MODKEY_DeepMark)
642 {
643 rVEvt.mbAddMark = true;
644 rVEvt.mbPrevNextMark = true;
646 }
647 else if (MODKEY_MultiMark)
648 {
649 rVEvt.mbAddMark = true;
650 rVEvt.mbUnmark = bMarked; // Toggle
651 if (bGlue)
652 {
653 pObj=pHdl->GetObj();
654 nGlueId=static_cast<sal_uInt16>(pHdl->GetObjHdlNum());
655 }
656 }
657 else if (bMarked)
658 {
659 eEvent=SdrEventKind::BeginDragObj; // don't change MarkState, only change Drag
660 }
661 }
662 }
663 else if (bInsPolyPt && (MODKEY_PolyPoly || (!MODKEY_MultiMark && !MODKEY_DeepMark)))
664 {
666 }
667 else if (bInsGluePt && !MODKEY_MultiMark && !MODKEY_DeepMark)
668 {
670 }
671 else if (eHit==SdrHitKind::TextEditObj)
672 {
673 eEvent=SdrEventKind::BeginTextEdit; // AddMark+Drag,DeepMark+Drag,Unmark
675 { // if not hit with Deep
677 }
678 }
679 else if (eHit==SdrHitKind::Macro)
680 {
681 eEvent=SdrEventKind::BeginMacroObj; // AddMark+Drag
683 { // if not hit with Deep
685 }
686 }
687 else if (eHit==SdrHitKind::UrlField)
688 {
689 eEvent=SdrEventKind::ExecuteUrl; // AddMark+Drag
691 { // if not hit with Deep
693 }
694 }
695 else if (eHit==SdrHitKind::MarkedObject)
696 {
697 eEvent=SdrEventKind::BeginDragObj; // DeepMark+Drag,Unmark
698
700 { // if not hit with Deep
702 }
703 }
704 else if (IsCreateMode())
705 {
706 eEvent=SdrEventKind::BeginCreateObj; // nothing, actually
707 }
708 else if (eHit==SdrHitKind::UnmarkedObject)
709 {
710 eEvent=SdrEventKind::MarkObj; // AddMark+Drag
711 }
712 else
713 {
715 }
716
717 if (eEvent==SdrEventKind::MarkObj)
718 {
719 rVEvt.mbAddMark = MODKEY_MultiMark || MODKEY_DeepMark; // if not hit with Deep
722 }
723 if (eEvent==SdrEventKind::BeginMark)
724 {
726 rVEvt.mbUnmark = MODKEY_Unmark;
727 }
728 }
729 rVEvt.mbIsAction = bIsAction;
730 rVEvt.mbIsTextEdit = bIsTextEdit;
731 rVEvt.maLogicPos = aLocalLogicPosition;
732 rVEvt.mpHdl = pHdl;
733 rVEvt.mpObj = pObj;
734 if (rVEvt.mpRootObj == nullptr)
735 rVEvt.mpRootObj = pObj;
736 rVEvt.mpPV = pPV;
737 rVEvt.mnHlplIdx = nHlplIdx;
738 rVEvt.mnGlueId = nGlueId;
739 rVEvt.meHit = eHit;
740 rVEvt.meEvent = eEvent;
741#ifdef DGB_UTIL
742 if (rVEvt.mpRootObj != nullptr)
743 {
745 {
746 OSL_FAIL("SdrView::PickAnything(): pRootObj->getParentSdrObjListFromSdrObject()!=pPV->GetObjList() !");
747 }
748 }
749#endif
750 return eHit;
751}
752
754{
755 bool bRet=false;
756 SdrHitKind eHit = rVEvt.meHit;
757 Point aLogicPos(rVEvt.maLogicPos);
758
759 bool bShift = (rVEvt.mnMouseCode & KEY_SHIFT) != 0;
760 bool bCtrl = (rVEvt.mnMouseCode & KEY_MOD1) != 0;
761 bool bAlt = (rVEvt.mnMouseCode & KEY_MOD2) != 0;
762 bool bMouseLeft = (rVEvt.mnMouseCode & MOUSE_LEFT) != 0;
763 bool bMouseDown = rVEvt.mbMouseDown;
764 bool bMouseUp = rVEvt.mbMouseUp;
765 if (bMouseDown) {
766 if (bMouseLeft) maDragStat.SetMouseDown(true);
767 } else if (bMouseUp) {
768 if (bMouseLeft) maDragStat.SetMouseDown(false);
769 } else { // else, MouseMove
770 maDragStat.SetMouseDown(bMouseLeft);
771 }
772
773#ifdef MODKEY_NoSnap
775#endif
776#ifdef MODKEY_Ortho
778#endif
779#ifdef MODKEY_AngleSnap
781#endif
782#ifdef MODKEY_CopyDrag
784#endif
785#ifdef MODKEY_Center
789#endif
790 if (bMouseLeft && bMouseDown && rVEvt.mbIsTextEdit && (eHit==SdrHitKind::UnmarkedObject || eHit==SdrHitKind::NONE)) {
791 SdrEndTextEdit(); // User has clicked beneath object, exit edit mode.
792 // pHdl is invalid, then, that shouldn't matter, though, as we expect
793 // pHdl==NULL (because of eHit).
794 }
795 switch (rVEvt.meEvent)
796 {
797 case SdrEventKind::NONE: bRet=false; break;
798 case SdrEventKind::TextEdit: bRet=false; break; // Events handled by the OutlinerView are not taken into account here.
799 case SdrEventKind::MoveAction: MovAction(aLogicPos); bRet=true; break;
800 case SdrEventKind::EndAction: EndAction(); bRet=true; break;
801 case SdrEventKind::BackAction: BckAction(); bRet=true; break;
802 case SdrEventKind::EndMark : EndAction(); bRet=true; break;
803 case SdrEventKind::BrkMark : {
804 BrkAction();
805 if (!MarkObj(aLogicPos, mnHitTolLog, rVEvt.mbAddMark))
806 {
807 // No object hit. Do the following:
808 // 1. deselect any selected gluepoints
809 // 2. deselect any selected polygon points
810 // 3. deselect any selected objects
811 if (!rVEvt.mbAddMark) UnmarkAll();
812 }
813 bRet=true;
814 } break;
815 case SdrEventKind::EndCreate: { // if necessary, MarkObj
818 if (rVEvt.mnMouseClicks > 1) eCmd=SdrCreateCmd::ForceEnd;
819 if (!EndCreateObj(eCmd)) { // Don't evaluate event for Create? -> Select
821 MarkObj(rVEvt.mpRootObj, rVEvt.mpPV);
822 if (eHit==SdrHitKind::TextEdit)
823 {
824 bool bRet2(mpActualOutDev && OUTDEV_WINDOW == mpActualOutDev->GetOutDevType() &&
825 SdrBeginTextEdit(rVEvt.mpObj, rVEvt.mpPV, mpActualOutDev->GetOwnerWindow()));
826
827 if(bRet2)
828 {
829 MouseEvent aMEvt(mpActualOutDev->LogicToPixel(aLogicPos), 1,
830 rVEvt.mnMouseMode,rVEvt.mnMouseCode,rVEvt.mnMouseCode);
831
833 if (pOLV!=nullptr) {
834 pOLV->MouseButtonDown(aMEvt); // event for the Outliner, but without double-click
835 pOLV->MouseButtonUp(aMEvt); // event for the Outliner, but without double-click
836 }
837 }
838 }
839 bRet=true; // object is selected and (if necessary) TextEdit is started
840 } else bRet=false; // canceled Create, nothing else
841 } else bRet=true; // return true for EndCreate
842 } break;
845 ForceMarkedObjToAnotherPage(); // TODO: Undo+bracing missing!
846 } break;
847 case SdrEventKind::MarkObj: { // + (if applicable) BegDrag
848 if (!rVEvt.mbAddMark) UnmarkAllObj();
849 bool bUnmark = rVEvt.mbUnmark;
850 if (rVEvt.mbPrevNextMark) {
851 bRet=MarkNextObj(aLogicPos, mnHitTolLog, rVEvt.mbMarkPrev);
852 } else {
854 const size_t nCount0=GetMarkedObjectCount();
855 bRet=MarkObj(aLogicPos, mnHitTolLog, rVEvt.mbAddMark);
857 const size_t nCount1=GetMarkedObjectCount();
858 bUnmark=nCount1<nCount0;
859 }
860 if (!bUnmark) {
861 BegDragObj(aLogicPos,nullptr,nullptr,mnMinMovLog);
862 bRet=true;
863 }
864 } break;
865 case SdrEventKind::MarkPoint: { // + (if applicable) BegDrag
866 if (!rVEvt.mbAddMark) UnmarkAllPoints();
867 if (rVEvt.mbPrevNextMark) {
869 bRet=false;
870 } else {
871 bRet = MarkPoint(*rVEvt.mpHdl, rVEvt.mbUnmark);
872 }
873 if (!rVEvt.mbUnmark && !rVEvt.mbPrevNextMark) {
874 BegDragObj(aLogicPos, nullptr, rVEvt.mpHdl, mnMinMovLog);
875 bRet=true;
876 }
877 } break;
878 case SdrEventKind::MarkGluePoint: { // + (if applicable) BegDrag
879 if (!rVEvt.mbAddMark) UnmarkAllGluePoints();
880 if (rVEvt.mbPrevNextMark) {
882 bRet=false;
883 } else {
884 bRet=MarkGluePoint(rVEvt.mpObj,rVEvt.mnGlueId,rVEvt.mbUnmark);
885 }
886 if (!rVEvt.mbUnmark && !rVEvt.mbPrevNextMark) {
887 SdrHdl* pHdl = GetGluePointHdl(rVEvt.mpObj, rVEvt.mnGlueId);
888 BegDragObj(aLogicPos,nullptr,pHdl,mnMinMovLog);
889 bRet=true;
890 }
891 } break;
892 case SdrEventKind::BeginMark: bRet = BegMark(aLogicPos,rVEvt.mbAddMark,rVEvt.mbUnmark); break;
897 if (rVEvt.mnMouseClicks > 1) eCmd = SdrCreateCmd::ForceEnd;
898 EndInsObjPoint(eCmd);
899 bRet=true;
900 } break;
901 case SdrEventKind::BeginInsertGluePoint: bRet=BegInsGluePoint(aLogicPos); break;
902 case SdrEventKind::BeginDragHelpline: bRet = BegDragHelpLine(rVEvt.mnHlplIdx,rVEvt.mpPV); break;
903 case SdrEventKind::BeginDragObj: bRet=BegDragObj(aLogicPos, nullptr, rVEvt.mpHdl, mnMinMovLog); break;
907 bRet=BegCreateCaptionObj(aLogicPos,Size(5*nHgt,2*nHgt));
908 } else bRet=BegCreateObj(aLogicPos);
909 } break;
911 BegMacroObj(aLogicPos, mnHitTolLog, rVEvt.mpObj, rVEvt.mpPV, mpActualOutDev->GetOwnerWindow());
912 bRet=false;
913 } break;
915 if (!IsObjMarked(rVEvt.mpObj)) {
916 UnmarkAllObj();
917 MarkObj(rVEvt.mpRootObj,rVEvt.mpPV);
918 }
919
920 bRet = mpActualOutDev && OUTDEV_WINDOW == mpActualOutDev->GetOutDevType()&&
921 SdrBeginTextEdit(rVEvt.mpObj, rVEvt.mpPV, mpActualOutDev->GetOwnerWindow());
922
923 if(bRet)
924 {
925 MouseEvent aMEvt(mpActualOutDev->LogicToPixel(aLogicPos),
926 1, rVEvt.mnMouseMode, rVEvt.mnMouseCode, rVEvt.mnMouseCode);
928 if (pOLV!=nullptr) pOLV->MouseButtonDown(aMEvt); // event for the Outliner, but without double-click
929 }
930 } break;
931 default: break;
932 } // switch
933 if (bRet && mpActualOutDev && mpActualOutDev->GetOutDevType()==OUTDEV_WINDOW) {
934 vcl::Window* pWin=mpActualOutDev->GetOwnerWindow();
935 // left mouse button pressed?
936 bool bLeftDown = (rVEvt.mnMouseCode & MOUSE_LEFT) != 0 && rVEvt.mbMouseDown;
937 // left mouse button released?
938 bool bLeftUp = (rVEvt.mnMouseCode & MOUSE_LEFT) != 0 && rVEvt.mbMouseUp;
939 // left mouse button pressed or held?
940 bool bLeftDown1=(rVEvt.mnMouseCode & MOUSE_LEFT) != 0 && !rVEvt.mbMouseUp;
942 rVEvt.mnMouseCode & (KEY_SHIFT|KEY_MOD1|KEY_MOD2),bLeftDown1));
943 bool bAction=IsAction();
944 if (bLeftDown && bAction)
945 pWin->CaptureMouse();
946 else if (bLeftUp || (rVEvt.mbIsAction && !bAction))
947 pWin->ReleaseMouse();
948 }
949 return bRet;
950}
951
952PointerStyle SdrView::GetPreferredPointer(const Point& rMousePos, const OutputDevice* pOut, sal_uInt16 nModifier, bool bLeftDown) const
953{
954 // Actions
955 if (IsCreateObj())
956 {
957 return mpCurrentCreate->GetCreatePointer();
958 }
960 {
961 return mpCurrentSdrDragMethod->GetSdrDragPointer();
962 }
963 if (IsMarkObj() || IsMarkPoints() || IsMarkGluePoints() || IsSetPageOrg()) return PointerStyle::Arrow;
965 if (IsMacroObj()) {
966 SdrObjMacroHitRec aHitRec;
967 aHitRec.aPos=pOut->LogicToPixel(rMousePos);
968 aHitRec.nTol=nMacroTol;
970 aHitRec.pPageView=pMacroPV;
971 return pMacroObj->GetMacroPointer(aHitRec);
972 }
973
974 // TextEdit, ObjEdit, Macro
975 if (IsTextEdit() && (IsTextEditInSelectionMode() || IsTextEditHit(rMousePos)))
976 {
978 {
979 if (mpTextEditOutliner->IsVertical())
980 return PointerStyle::TextVertical;
981 else
982 return PointerStyle::Text;
983 }
984 // Outliner should return something here...
985 Point aPos(pOut->LogicToPixel(rMousePos));
987 if (aPointer==PointerStyle::Arrow)
988 {
989 if (mpTextEditOutliner->IsVertical())
990 aPointer = PointerStyle::TextVertical;
991 else
992 aPointer = PointerStyle::Text;
993 }
994 return aPointer;
995 }
996
997 SdrViewEvent aVEvt;
998 aVEvt.mnMouseCode = (nModifier&(KEY_SHIFT|KEY_MOD1|KEY_MOD2))|MOUSE_LEFT; // to see what would happen on MouseLeftDown
999 aVEvt.mbMouseDown = !bLeftDown; // What if ..?
1000 aVEvt.mbMouseUp = bLeftDown; // What if ..?
1001 if (pOut!=nullptr)
1002 const_cast<SdrView*>(this)->SetActualWin(pOut);
1003 SdrHitKind eHit=PickAnything(rMousePos,aVEvt);
1004 SdrEventKind eEvent = aVEvt.meEvent;
1005 switch (eEvent)
1006 {
1010 return PointerStyle::Move;
1012 return PointerStyle::Arrow;
1015 return PointerStyle::MovePoint;
1018 return PointerStyle::Cross;
1020 return PointerStyle::RefHand;
1022 {
1023 SdrObjMacroHitRec aHitRec;
1024 aHitRec.aPos = aVEvt.maLogicPos;
1025 aHitRec.nTol=mnHitTolLog;
1026 aHitRec.pVisiLayer = &aVEvt.mpPV->GetVisibleLayers();
1027 aHitRec.pPageView = aVEvt.mpPV;
1028 return aVEvt.mpObj->GetMacroPointer(aHitRec);
1029 }
1030 default: break;
1031 } // switch
1032
1033 switch(eHit)
1034 {
1035 case SdrHitKind::Cell:
1036 return PointerStyle::Arrow;
1038 return aVEvt.mpPV->GetHelpLines()[aVEvt.mnHlplIdx].GetPointer();
1040 return PointerStyle::MovePoint;
1043 {
1044 SdrTextObj* pText = DynCastSdrTextObj(aVEvt.mpObj);
1045 if(pText && pText->HasText())
1046 {
1047 OutlinerParaObject* pParaObj = pText->GetOutlinerParaObject();
1048 if(pParaObj && pParaObj->IsEffectivelyVertical())
1049 return PointerStyle::TextVertical;
1050 }
1051 return PointerStyle::Text;
1052 }
1053 default: break;
1054 }
1055
1056 bool bMarkHit=eHit==SdrHitKind::MarkedObject;
1057 SdrHdl* pHdl = aVEvt.mpHdl;
1058 // now check the pointers for dragging
1059 if (pHdl!=nullptr || bMarkHit) {
1060 SdrHdlKind eHdl= pHdl!=nullptr ? pHdl->GetKind() : SdrHdlKind::Move;
1061 bool bCorner=pHdl!=nullptr && pHdl->IsCornerHdl();
1062 bool bVertex=pHdl!=nullptr && pHdl->IsVertexHdl();
1063 bool bMov=eHdl==SdrHdlKind::Move;
1065 if (!IsMoveAllowed()) return PointerStyle::Arrow; // because double click or drag & drop is possible
1066 return PointerStyle::Move;
1067 }
1068 switch (meDragMode) {
1069 case SdrDragMode::Rotate: {
1070 if ((bCorner || bMov) && !IsRotateAllowed(true))
1071 return PointerStyle::NotAllowed;
1072
1073 // are 3D objects selected?
1074 bool b3DObjSelected = false;
1075 for (size_t a=0; !b3DObjSelected && a<GetMarkedObjectCount(); ++a) {
1077 if(DynCastE3dObject(pObj))
1078 b3DObjSelected = true;
1079 }
1080 // If we have a 3D object, go on despite !IsShearAllowed,
1081 // because then we have a rotation instead of a shear.
1082 if (bVertex && !IsShearAllowed() && !b3DObjSelected)
1083 return PointerStyle::NotAllowed;
1084 if (bMov)
1085 return PointerStyle::Rotate;
1086 } break;
1087 case SdrDragMode::Shear: {
1088 if (bCorner) {
1089 if (!IsDistortAllowed(true) && !IsDistortAllowed()) return PointerStyle::NotAllowed;
1090 else return PointerStyle::RefHand;
1091 }
1092 if (bVertex && !IsShearAllowed()) return PointerStyle::NotAllowed;
1093 if (bMov) {
1094 if (!IsMoveAllowed()) return PointerStyle::Arrow; // because double click or drag & drop is possible
1095 return PointerStyle::Move;
1096 }
1097 } break;
1098 case SdrDragMode::Mirror: {
1099 if (bCorner || bVertex || bMov) {
1102 bool b90=false;
1103 bool b45=false;
1104 if (pH1!=nullptr && pH2!=nullptr) {
1105 Point aDif = pH2->GetPos()-pH1->GetPos();
1106 b90=(aDif.X()==0) || aDif.Y()==0;
1107 b45=b90 || (std::abs(aDif.X())==std::abs(aDif.Y()));
1108 }
1109 bool bNo=false;
1110 if (!IsMirrorAllowed(true,true)) bNo=true; // any mirroring is forbidden
1111 if (!IsMirrorAllowed() && !b45) bNo=true; // mirroring freely is forbidden
1112 if (!IsMirrorAllowed(true) && !b90) bNo=true; // mirroring horizontally/vertically is allowed
1113 if (bNo) return PointerStyle::NotAllowed;
1114 if (b90) {
1115 return PointerStyle::Mirror;
1116 }
1117 return PointerStyle::Mirror;
1118 }
1119 } break;
1120
1122 {
1124 return PointerStyle::NotAllowed;
1125
1126 return PointerStyle::RefHand;
1127 }
1128
1130 {
1131 if(!IsGradientAllowed())
1132 return PointerStyle::NotAllowed;
1133
1134 return PointerStyle::RefHand;
1135 }
1136
1137 case SdrDragMode::Crook: {
1138 if (bCorner || bVertex || bMov) {
1139 if (!IsCrookAllowed(true) && !IsCrookAllowed()) return PointerStyle::NotAllowed;
1140 return PointerStyle::Crook;
1141 }
1142 break;
1143 }
1144
1145 case SdrDragMode::Crop:
1146 {
1147 return PointerStyle::Crop;
1148 }
1149
1150 default: {
1151 if ((bCorner || bVertex) && !IsResizeAllowed(true)) return PointerStyle::NotAllowed;
1152 }
1153 }
1154 if (pHdl!=nullptr) return pHdl->GetPointer();
1155 if (bMov) {
1156 if (!IsMoveAllowed()) return PointerStyle::Arrow; // because double click or drag & drop is possible
1157 return PointerStyle::Move;
1158 }
1159 }
1161 return PointerStyle::Arrow;
1162}
1163
1164constexpr OUStringLiteral STR_NOTHING = u"nothing";
1166{
1167 OUString aName;
1168 OUString aStr = STR_NOTHING;
1169
1170 if (mpCurrentCreate!=nullptr)
1171 {
1172 aStr=mpCurrentCreate->getSpecialDragComment(maDragStat);
1173
1174 if(aStr.isEmpty())
1175 {
1176 aName = mpCurrentCreate->TakeObjNameSingul();
1177 aStr = SvxResId(STR_ViewCreateObj);
1178 }
1179 }
1180 else if (mpCurrentSdrDragMethod)
1181 {
1183 {
1185 }
1186 else
1187 {
1188 if (maDragStat.IsMinMoved())
1189 {
1190 SAL_INFO(
1191 "svx.svdraw",
1192 "(" << this << ") " << mpCurrentSdrDragMethod.get());
1193 aStr = mpCurrentSdrDragMethod->GetSdrDragComment();
1194 }
1195 }
1196 }
1197 else if(IsMarkObj())
1198 {
1199 if(AreObjectsMarked())
1200 {
1201 aStr = SvxResId(STR_ViewMarkMoreObjs);
1202 }
1203 else
1204 {
1205 aStr = SvxResId(STR_ViewMarkObjs);
1206 }
1207 }
1208 else if(IsMarkPoints())
1209 {
1210 if(HasMarkedPoints())
1211 {
1212 aStr = SvxResId(STR_ViewMarkMorePoints);
1213 }
1214 else
1215 {
1216 aStr = SvxResId(STR_ViewMarkPoints);
1217 }
1218 } else if (IsMarkGluePoints())
1219 {
1221 {
1222 aStr = SvxResId(STR_ViewMarkMoreGluePoints);
1223 }
1224 else
1225 {
1226 aStr = SvxResId(STR_ViewMarkGluePoints);
1227 }
1228 }
1229 else if (IsTextEdit() && mpTextEditOutlinerView != nullptr) {
1230 aStr=SvxResId(STR_ViewTextEdit); // "TextEdit - Row y, Column x";
1232 tools::Long nPar = aSel.nEndPara,nLin=0,nCol=aSel.nEndPos;
1233 if (aSel.nEndPara>0) {
1234 for (sal_Int32 nParaNum=0; nParaNum<aSel.nEndPara; nParaNum++) {
1235 nLin += mpTextEditOutliner->GetLineCount(nParaNum);
1236 }
1237 }
1238 // A little imperfection:
1239 // At the end of a line of any multi-line paragraph, we display the
1240 // position of the next line of the same paragraph, if there is one.
1241 sal_uInt16 nParaLine = 0;
1242 sal_uLong nParaLineCount = mpTextEditOutliner->GetLineCount(aSel.nEndPara);
1243 bool bBrk = false;
1244 while (!bBrk)
1245 {
1246 sal_uInt16 nLen = mpTextEditOutliner->GetLineLen(aSel.nEndPara, nParaLine);
1247 bool bLastLine = (nParaLine == nParaLineCount - 1);
1248 if (nCol>nLen || (!bLastLine && nCol == nLen))
1249 {
1250 nCol -= nLen;
1251 nLin++;
1252 nParaLine++;
1253 }
1254 else
1255 bBrk = true;
1256
1257 if (nLen == 0)
1258 bBrk = true; // to be sure
1259 }
1260
1261 aStr = aStr.replaceFirst("%1", OUString::number(nPar + 1));
1262 aStr = aStr.replaceFirst("%2", OUString::number(nLin + 1));
1263 aStr = aStr.replaceFirst("%3", OUString::number(nCol + 1));
1264
1265#ifdef DBG_UTIL
1266 aStr += ", Level " + OUString::number(mpTextEditOutliner->GetDepth( aSel.nEndPara ));
1267#endif
1268 }
1269
1270 if(aStr == STR_NOTHING)
1271 {
1272 if (AreObjectsMarked()) {
1273 aStr = ImpGetDescriptionString(STR_ViewMarked);
1274 if (IsGluePointEditMode()) {
1275 if (HasMarkedGluePoints()) {
1277 }
1278 } else {
1279 if (HasMarkedPoints()) {
1281 }
1282 }
1283 } else {
1284 aStr.clear();
1285 }
1286 }
1287 else if(!aName.isEmpty())
1288 {
1289 aStr = aStr.replaceFirst("%1", aName);
1290 }
1291
1292 if(!aStr.isEmpty())
1293 {
1294 // capitalize first letter
1295 aStr = aStr.replaceAt(0, 1, OUString(aStr[0]).toAsciiUpperCase());
1296 }
1297 return aStr;
1298}
1299
1301{
1302 if( IsGluePointEditMode() )
1304
1305 const size_t nMarkCount = GetMarkedObjectCount();
1306
1307 if( HasMarkablePoints() && !IsFrameHandles() )
1308 {
1309 bool bPath=true;
1310 for( size_t nMarkNum = 0; nMarkNum < nMarkCount && bPath; ++nMarkNum )
1311 if (dynamic_cast<const SdrPathObj*>(GetMarkedObjectByIndex(nMarkNum)) == nullptr)
1312 bPath=false;
1313
1314 if( bPath )
1316 }
1317
1318 if( GetMarkedObjectCount() )
1319 {
1320 bool bGraf = true, bMedia = true, bTable = true;
1321
1322 for( size_t nMarkNum = 0; nMarkNum < nMarkCount && ( bGraf || bMedia ); ++nMarkNum )
1323 {
1324 const SdrObject* pMarkObj = GetMarkedObjectByIndex( nMarkNum );
1325 DBG_ASSERT( pMarkObj, "SdrView::GetContext(), null pointer in mark list!" );
1326
1327 if( !pMarkObj )
1328 continue;
1329
1330 if( dynamic_cast<const SdrGrafObj*>( pMarkObj) == nullptr )
1331 bGraf = false;
1332
1333 if( dynamic_cast<const SdrMediaObj*>( pMarkObj) == nullptr )
1334 bMedia = false;
1335
1336 if( dynamic_cast<const sdr::table::SdrTableObj* >( pMarkObj ) == nullptr )
1337 bTable = false;
1338 }
1339
1340 if( bGraf )
1342 else if( bMedia )
1343 return SdrViewContext::Media;
1344 else if( bTable )
1345 return SdrViewContext::Table;
1346 }
1347
1349}
1350
1352{
1353 if (IsTextEdit()) {
1355 } else if (IsGluePointEditMode()) MarkAllGluePoints();
1356 else if (HasMarkablePoints()) MarkAllPoints();
1357 else {
1358 // check for table
1359 bool bMarkAll = true;
1360 const SdrMarkList& rMarkList = GetMarkedObjectList();
1361 if (rMarkList.GetMarkCount() == 1)
1362 {
1363 const SdrObject* pObj(rMarkList.GetMark(0)->GetMarkedSdrObj());
1364 SdrView* pView = this;
1365 if (pObj && pView && (pObj->GetObjInventor() == SdrInventor::Default)
1366 && (pObj->GetObjIdentifier() == SdrObjKind::Table))
1367 {
1368 mxSelectionController.clear();
1370 *pView, static_cast<const sdr::table::SdrTableObj&>(*pObj),
1372
1373 if (mxSelectionController.is())
1374 {
1376 mxSelectionController->onSelectAll();
1377 bMarkAll = false;
1378 }
1379 }
1380 }
1381 if ( bMarkAll )
1382 MarkAllObj();
1383 }
1384}
1385
1387{
1388 if (IsTextEdit()) {
1390 eSel.nStartPara=eSel.nEndPara;
1391 eSel.nStartPos=eSel.nEndPos;
1394 else if (HasMarkedPoints()) UnmarkAllPoints(); // Marked, not Markable!
1395 else UnmarkAllObj();
1396}
1397
1399{
1401 return GetMarkedGluePointsRect();
1402 }
1403 if (HasMarkedPoints()) {
1404 return GetMarkedPointsRect();
1405 }
1406 return GetMarkedObjRect();
1407}
1408
1410{
1411 if (IsTextEdit())
1412 {
1414 }
1415 else
1416 {
1417 if( mxSelectionController.is() && mxSelectionController->DeleteMarked() )
1418 {
1419 // action already performed by current selection controller, do nothing
1420 }
1422 {
1424 }
1426 {
1428 }
1429 else
1430 {
1432 }
1433 }
1434}
1435
1436bool SdrView::BegMark(const Point& rPnt, bool bAddMark, bool bUnmark)
1437{
1438 if (bUnmark) bAddMark=true;
1439 if (IsGluePointEditMode()) {
1440 if (!bAddMark) UnmarkAllGluePoints();
1441 return BegMarkGluePoints(rPnt,bUnmark);
1442 } else if (HasMarkablePoints()) {
1443 if (!bAddMark) UnmarkAllPoints();
1444 return BegMarkPoints(rPnt,bUnmark);
1445 } else {
1446 if (!bAddMark) UnmarkAllObj();
1447 BegMarkObj(rPnt,bUnmark);
1448 return true;
1449 }
1450}
1451
1452bool SdrView::MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint, const sal_Int32 aObjectOrdNum)
1453{
1454 if (GetHdlList().IsMoveOutside())
1455 return false;
1456
1457 if (!GetMarkedObjectList().GetMarkCount())
1458 return false;
1459
1460 SdrHdl * pHdl = GetHdlList().GetHdl(handleNum);
1461 if (pHdl == nullptr)
1462 return false;
1463
1464 SdrDragStat& rDragStat = const_cast<SdrDragStat&>(GetDragStat());
1465 // start dragging
1466 BegDragObj(pHdl->GetPos(), nullptr, pHdl, 0);
1467 if (!IsDragObj())
1468 return false;
1469
1470 bool bWasNoSnap = rDragStat.IsNoSnap();
1471 bool bWasSnapEnabled = IsSnapEnabled();
1472
1473 // switch snapping off
1474 if(!bWasNoSnap)
1475 rDragStat.SetNoSnap();
1476 if(bWasSnapEnabled)
1477 SetSnapEnabled(false);
1478
1479 if (aObjectOrdNum != -1)
1480 {
1481 rDragStat.GetGlueOptions().objectOrdNum = aObjectOrdNum;
1482 }
1483 MovDragObj(aEndPoint);
1484 EndDragObj();
1485
1486 // Clear Glue Options
1487 rDragStat.GetGlueOptions().objectOrdNum = -1;
1488
1489 if (!bWasNoSnap)
1490 rDragStat.SetNoSnap(bWasNoSnap);
1491 if (bWasSnapEnabled)
1492 SetSnapEnabled(bWasSnapEnabled);
1493
1494 return true;
1495}
1496
1498{
1501}
1502
1503
1506{
1507}
1508
1510{
1511 if(mbMasterPagePaintCaching == bOn)
1512 return;
1513
1515
1516 // reset at all SdrPageWindows
1517 SdrPageView* pPageView = GetSdrPageView();
1518
1519 if(!pPageView)
1520 return;
1521
1522 for(sal_uInt32 b(0); b < pPageView->PageWindowCount(); b++)
1523 {
1524 SdrPageWindow* pPageWindow = pPageView->GetPageWindow(b);
1525 assert(pPageWindow && "SdrView::SetMasterPagePaintCaching: Corrupt SdrPageWindow list (!)");
1526
1527 // force deletion of ObjectContact, so at re-display all VOCs
1528 // will be re-created with updated flag setting
1529 pPageWindow->ResetObjectContact();
1530 }
1531
1532 // force redraw of this view
1533 pPageView->InvalidateAllWin();
1534}
1535
1536// Default ObjectContact is ObjectContactOfPageView
1538 SdrPageWindow& rPageWindow,
1539 const char* pDebugName) const
1540{
1541 return new sdr::contact::ObjectContactOfPageView(rPageWindow, pDebugName);
1542}
1543
1544/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const vcl::KeyCode & GetKeyCode() const
MouseEventModifiers GetMode() const
sal_uInt16 GetModifier() const
sal_uInt16 GetClicks() const
sal_uInt16 GetButtons() const
const Point & GetPosPixel() const
bool IsLeft() const
bool IsEffectivelyVertical() const
void SetSelection(const ESelection &)
bool MouseButtonUp(const MouseEvent &)
ESelection GetSelection() const
bool MouseButtonDown(const MouseEvent &)
PointerStyle GetPointer(const Point &rPosPixel)
PointerStyle maCurrentCreatePointer
Definition: svdcrtv.hxx:48
bool BegCreateObj(const Point &rPnt, OutputDevice *pOut=nullptr, short nMinMov=-3)
Definition: svdcrtv.cxx:493
bool IsTextTool() const
Definition: svdcrtv.cxx:315
void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr) const
Definition: svdcrtv.cxx:857
bool IsCreateObj() const
Definition: svdcrtv.hxx:119
void SetCreate1stPointAsCenter(bool bOn)
Definition: svdcrtv.hxx:134
SdrObjKind mnCurrentIdent
Definition: svdcrtv.hxx:53
bool EndCreateObj(SdrCreateCmd eCmd)
Definition: svdcrtv.cxx:587
virtual void MovAction(const Point &rPnt) override
Definition: svdcrtv.cxx:206
virtual void BrkAction() override
Definition: svdcrtv.cxx:226
SdrInventor mnCurrentInvent
Definition: svdcrtv.hxx:52
virtual bool IsAction() const override
Definition: svdcrtv.cxx:201
bool BegCreateCaptionObj(const Point &rPnt, const Size &rObjSiz, OutputDevice *pOut=nullptr, short nMinMov=-3)
Definition: svdcrtv.cxx:512
rtl::Reference< SdrObject > mpCurrentCreate
Definition: svdcrtv.hxx:40
virtual void BckAction() override
Definition: svdcrtv.cxx:220
virtual void EndAction() override
Definition: svdcrtv.cxx:214
virtual bool MouseMove(const MouseEvent &rMEvt, OutputDevice *pWin) override
handle mouse over effects for handles
Definition: svdcrtv.cxx:296
auto & GetGlueOptions()
Definition: svddrag.hxx:172
bool IsMinMoved() const
Definition: svddrag.hxx:118
bool IsNoSnap() const
Definition: svddrag.hxx:130
void SetMouseDown(bool bDown)
Definition: svddrag.hxx:151
void SetNoSnap(bool bOn=true)
Definition: svddrag.hxx:131
bool EndDragObj(bool bCopy=false)
Definition: svddrgv.cxx:531
OUString maInsPointUndoStr
Definition: svddrgv.hxx:45
virtual bool BegDragObj(const Point &rPnt, OutputDevice *pOut, SdrHdl *pHdl, short nMinMov=-3, SdrDragMethod *pForcedMeth=nullptr)
Definition: svddrgv.cxx:183
bool IsOrthoDesired() const
Definition: svddrgv.cxx:885
bool IsDragWithCopy() const
Definition: svddrgv.hxx:113
bool IsInsGluePointMode() const
Definition: svddrgv.hxx:137
bool BegInsGluePoint(const Point &rPnt)
Definition: svddrgv.cxx:733
bool IsInsObjPointPossible() const
Definition: svddrgv.cxx:632
void SetDragWithCopy(bool bOn)
Definition: svddrgv.hxx:112
bool mbMarkedHitMovesAlways
Definition: svddrgv.hxx:49
bool IsInsertGluePoint() const
Definition: svddrgv.hxx:116
bool IsInsObjPoint() const
Definition: svddrgv.hxx:123
void SetResizeAtCenter(bool bOn)
Definition: svddrgv.hxx:190
bool BegInsObjPoint(const Point &rPnt, bool bNewObj)
Definition: svddrgv.hxx:120
bool IsInsGluePointPossible() const
Definition: svddrgv.cxx:711
void MovDragObj(const Point &rPnt)
Definition: svddrgv.cxx:506
bool IsInsObjPointMode() const
Definition: svddrgv.hxx:128
void SetCrookAtCenter(bool bOn)
Definition: svddrgv.hxx:195
bool EndInsObjPoint(SdrCreateCmd eCmd)
Definition: svddrgv.cxx:695
bool IsDragObj() const
Definition: svddrgv.hxx:103
std::unique_ptr< SdrDragMethod > mpCurrentSdrDragMethod
Definition: svddrgv.hxx:42
SdrDropMarkerOverlay(const SdrView &rView, const SdrObject &rObject)
Definition: svdview.cxx:101
void ImplCreateOverlays(const SdrView &rView, const basegfx::B2DPolyPolygon &rLinePolyPolygon)
Definition: svdview.cxx:81
sdr::overlay::OverlayObjectList maObjects
Definition: svdview.hxx:132
bool IsResizeAllowed(bool bProp=false) const
Definition: svdedtv.cxx:383
bool IsMoveAllowed() const
Definition: svdedtv.hxx:235
void ForceMarkedObjToAnotherPage()
Definition: svdedtv.cxx:683
bool IsTransparenceAllowed() const
Definition: svdedtv.cxx:408
bool IsDistortAllowed(bool bNoContortion=false) const
Definition: svdedtv.cxx:451
bool IsCrookAllowed(bool bNoContortion=false) const
Definition: svdedtv.cxx:439
bool IsGradientAllowed() const
Definition: svdedtv.cxx:420
void DeleteMarkedObj()
Definition: svdedtv.cxx:794
bool IsShearAllowed() const
Definition: svdedtv.cxx:426
bool IsRotateAllowed(bool b90Deg=false) const
Definition: svdedtv.cxx:391
bool IsMirrorAllowed(bool b45Deg=false, bool b90Deg=false) const
Definition: svdedtv.cxx:399
void DeleteMarkedGluePoints()
Definition: svdglev.cxx:222
This class represents an embedded or linked bitmap graphic object.
Definition: svdograf.hxx:68
SdrHdl * GetHdl(size_t nNum) const
Definition: svdhdl.hxx:460
bool IsSelected() const
Definition: svdhdl.hxx:206
SdrHdlKind GetKind() const
Definition: svdhdl.hxx:194
sal_uInt32 GetObjHdlNum() const
Definition: svdhdl.hxx:216
bool IsVertexHdl() const
Definition: svdhdl.hxx:213
bool IsCornerHdl() const
Definition: svdhdl.hxx:212
virtual PointerStyle GetPointer() const
Definition: svdhdl.cxx:954
SdrObject * GetObj() const
Definition: svdhdl.hxx:203
const Point & GetPos() const
Definition: svdhdl.hxx:197
bool IsSet(SdrLayerID a) const
Definition: svdsob.hxx:69
size_t GetMarkCount() const
Definition: svdmark.hxx:178
SdrMark * GetMark(size_t nNum) const
Definition: svdmark.cxx:230
bool MarkAllGluePoints()
Definition: svdmrkv.hxx:397
bool mbInsPolyPoint
Definition: svdmrkv.hxx:125
SdrHdl * PickHandle(const Point &rPnt) const
Definition: svdmrkv.cxx:1931
bool MarkAllPoints()
Definition: svdmrkv.hxx:347
OUString ImpGetDescriptionString(TranslateId pStrCacheID, ImpGetDescriptionOptions nOpt=ImpGetDescriptionOptions::NONE) const
Definition: svdmrkv.cxx:2654
bool IsObjMarked(SdrObject const *pObj) const
Definition: svdmrkv.cxx:2206
bool IsMarkPoints() const
Definition: svdmrkv.hxx:368
void MarkNextPoint()
Definition: svdmrkv1.cxx:230
const SdrMarkList & GetMarkedObjectList() const
Definition: svdmrkv.hxx:258
bool AreObjectsMarked() const
Definition: svdmrkv.hxx:266
const tools::Rectangle & GetMarkedGluePointsRect() const
Definition: svdmrkv1.cxx:540
void SortMarkedObjects() const
Definition: svdmrkv.hxx:265
void BegMarkObj(const Point &rPnt, bool bUnmark=false)
Definition: svdmrkv.cxx:391
bool BegMarkGluePoints(const Point &rPnt, bool bUnmark=false)
Definition: svdmrkv.cxx:511
bool BegMarkPoints(const Point &rPnt, bool bUnmark=false)
Definition: svdmrkv.cxx:447
bool IsEditMode() const
Definition: svdmrkv.hxx:232
SdrObject * GetMarkedObjectByIndex(size_t nNum) const
Definition: svdmrkv.hxx:263
const SdrHdlList & GetHdlList() const
Definition: svdmrkv.hxx:360
bool HasMarkedGluePoints() const
Definition: svdmrkv1.cxx:379
SdrObject * PickObj(const Point &rPnt, short nTol, SdrPageView *&rpPV, SdrSearchOptions nOptions, SdrObject **ppRootObj, bool *pbHitPassDirect=nullptr) const
Definition: svdmrkv.cxx:2424
SdrHdlList maHdlList
Definition: svdmrkv.hxx:107
virtual bool HasMarkedPoints() const
Definition: svdmrkv1.cxx:65
bool IsMarkGluePoints() const
Definition: svdmrkv.hxx:414
size_t GetMarkedObjectCount() const
Definition: svdmrkv.hxx:264
const tools::Rectangle & GetMarkedPointsRect() const
Definition: svdmrkv1.cxx:236
bool mbNegativeX
Definition: svdmrkv.hxx:134
bool IsMarkObj() const
Definition: svdmrkv.hxx:215
SdrDragMode meDragMode
Definition: svdmrkv.hxx:118
virtual bool MarkPoint(SdrHdl &rHdl, bool bUnmark=false)
Definition: svdmrkv1.cxx:167
bool IsPointMarkable(const SdrHdl &rHdl) const
Definition: svdmrkv1.cxx:82
void MarkNextGluePoint()
Definition: svdmrkv1.cxx:534
SdrHdl * GetGluePointHdl(const SdrObject *pObj, sal_uInt16 nId) const
Definition: svdmrkv1.cxx:521
void UnmarkAllObj(SdrPageView const *pPV=nullptr)
Definition: svdmrkv.cxx:2565
bool UnmarkAllPoints()
Definition: svdmrkv.hxx:348
virtual bool HasMarkablePoints() const
Definition: svdmrkv1.cxx:29
void MarkAllObj(SdrPageView *pPV=nullptr)
Definition: svdmrkv.cxx:2585
SdrViewEditMode meEditMode
Definition: svdmrkv.hxx:119
const tools::Rectangle & GetMarkedObjRect() const
Definition: svdmrkv.cxx:2634
bool UnmarkAllGluePoints()
Definition: svdmrkv.hxx:398
bool IsCreateMode() const
Definition: svdmrkv.hxx:234
bool IsMarking() const
Definition: svdmrkv.hxx:208
bool IsFrameHandles() const
Definition: svdmrkv.hxx:223
bool IsGluePointEditMode() const
Definition: svdmrkv.hxx:236
bool MarkNextObj(bool bPrev=false)
Definition: svdmrkv.cxx:1953
bool MarkGluePoint(const SdrObject *pObj, sal_uInt16 nId, bool bUnmark)
Definition: svdmrkv1.cxx:478
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
Definition: svdmrkv.cxx:1939
bool PickGluePoint(const Point &rPnt, SdrObject *&rpObj, sal_uInt16 &rnId, SdrPageView *&rpPV) const
Definition: svdmrkv1.cxx:442
SdrObject * GetMarkedSdrObj() const
Definition: svdmark.hxx:68
void Undo()
Definition: svdmodel.cxx:276
void Repeat(SfxRepeatTarget &)
Definition: svdmodel.cxx:320
void Redo()
Definition: svdmodel.cxx:298
bool IsTextEditInSelectionMode() const
Definition: svdedxv.cxx:2519
std::unique_ptr< SdrOutliner > mpTextEditOutliner
Definition: svdedxv.hxx:86
SdrPageView * pMacroPV
Definition: svdedxv.hxx:92
VclPtr< vcl::Window > mpTextEditWin
Definition: svdedxv.hxx:88
SdrObject * pMacroObj
Definition: svdedxv.hxx:91
OutlinerView * mpTextEditOutlinerView
Definition: svdedxv.hxx:87
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false)
Definition: svdedxv.cxx:1570
virtual bool KeyInput(const KeyEvent &rKEvt, vcl::Window *pWin) override
Definition: svdedxv.cxx:1957
const OutlinerView * GetTextEditOutlinerView() const
Definition: svdedxv.hxx:252
virtual bool MouseButtonUp(const MouseEvent &rMEvt, OutputDevice *pWin) override
Definition: svdedxv.cxx:2036
rtl::Reference< sdr::SelectionController > mxLastSelectionController
Definition: svdedxv.hxx:109
virtual bool MouseButtonDown(const MouseEvent &rMEvt, OutputDevice *pWin) override
Definition: svdedxv.cxx:1992
bool IsMacroObj() const
Definition: svdedxv.hxx:291
bool IsQuickTextEditMode() const
Definition: svdedxv.hxx:193
rtl::Reference< sdr::SelectionController > mxSelectionController
Definition: svdedxv.hxx:108
void BegMacroObj(const Point &rPnt, short nTol, SdrObject *pObj, SdrPageView *pPV, vcl::Window *pWin)
Definition: svdedxv.cxx:2526
virtual bool Command(const CommandEvent &rCEvt, vcl::Window *pWin) override
Definition: svdedxv.cxx:2117
bool IsTextEditHit(const Point &rHit) const
Definition: svdedxv.cxx:1881
virtual bool IsTextEdit() const final override
Definition: svdedxv.cxx:1839
virtual bool SdrBeginTextEdit(SdrObject *pObj, SdrPageView *pPV=nullptr, vcl::Window *pWin=nullptr, bool bIsNewObj=false, SdrOutliner *pGivenOutliner=nullptr, OutlinerView *pGivenOutlinerView=nullptr, bool bDontDeleteOutliner=false, bool bOnlyOneView=false, bool bGrabFocus=true)
Definition: svdedxv.cxx:1223
sal_uInt16 nMacroTol
Definition: svdedxv.hxx:100
const SdrPageView * pPageView
Definition: svdobj.hxx:141
const SdrLayerIDSet * pVisiLayer
Definition: svdobj.hxx:140
sal_uInt16 nTol
Definition: svdobj.hxx:142
Abstract DrawObject.
Definition: svdobj.hxx:261
const OUString & getHyperlink() const
Definition: svdobj.hxx:889
virtual basegfx::B2DPolyPolygon TakeXorPoly() const
The Xor-Polygon is required by the View to drag the object.
Definition: svdobj.cxx:1096
virtual SdrInventor GetObjInventor() const
Definition: svdobj.cxx:621
virtual const tools::Rectangle & GetCurrentBoundRect() const
Definition: svdobj.cxx:926
SdrObjList * getParentSdrObjListFromSdrObject() const
Definition: svdobj.cxx:318
virtual const tools::Rectangle & GetSnapRect() const
Definition: svdobj.cxx:1665
virtual bool HasTextEdit() const
Definition: svdobj.cxx:1756
virtual SdrObjKind GetObjIdentifier() const
Definition: svdobj.cxx:626
bool IsMacroHit(const SdrObjMacroHitRec &rRec) const
Definition: svdobj.cxx:1892
SdrObject * getParentSdrObjectFromSdrObject() const
Definition: svdobj.cxx:720
virtual SdrLayerID GetLayer() const
Definition: svdobj.cxx:645
virtual PointerStyle GetMacroPointer(const SdrObjMacroHitRec &rRec) const
Definition: svdobj.cxx:1865
virtual bool HasMacro() const
Definition: svdobj.cxx:1850
const SdrLayerIDSet & GetVisibleLayers() const
Definition: svdpagv.hxx:210
SdrObjList * GetObjList() const
Return current List.
Definition: svdpagv.hxx:169
sal_uInt32 PageWindowCount() const
Definition: svdpagv.hxx:89
void InvalidateAllWin()
Invalidates the Page's whole area.
Definition: svdpagv.cxx:195
const SdrHelpLineList & GetHelpLines() const
Definition: svdpagv.hxx:216
const SdrLayerIDSet & GetLockedLayers() const
Definition: svdpagv.hxx:214
SdrPageWindow * GetPageWindow(sal_uInt32 nIndex) const
Definition: svdpagv.cxx:83
void ResetObjectContact()
sal_uInt16 mnMinMovLog
Definition: svdpntv.hxx:150
sal_uInt16 mnHitTolLog
Definition: svdpntv.hxx:149
SdrPaintWindow * GetPaintWindow(sal_uInt32 nIndex) const
Definition: svdpntv.cxx:75
OutputDevice * GetFirstOutputDevice() const
Definition: svdpntv.cxx:91
void ConfigurationChanged(::utl::ConfigurationBroadcaster *, ConfigurationHints) override
Definition: svdpntv.cxx:234
SdrDragStat maDragStat
Definition: svdpntv.hxx:140
VclPtr< OutputDevice > mpActualOutDev
Definition: svdpntv.hxx:126
sal_uInt32 PaintWindowCount() const
Definition: svdpntv.hxx:219
bool IsHlplVisible() const
Draw Help line of the Page or not.
Definition: svdpntv.hxx:373
const SdrDragStat & GetDragStat() const
Definition: svdpntv.hxx:287
SdrPageView * GetSdrPageView() const
Definition: svdpntv.hxx:300
bool IsHlplFront() const
Draw Help line in front of the objects or behind them.
Definition: svdpntv.hxx:376
SdrModel * mpModel
Definition: svdpntv.hxx:125
rtl::Reference< sdr::overlay::OverlayManager > const & GetOverlayManager() const
void DeleteMarkedPoints() override
Definition: svdpoev.cxx:286
PointerStyle GetDraggedHelpLinePointer() const
Definition: svdsnpv.cxx:548
bool IsSetPageOrg() const
Definition: svdsnpv.hxx:190
void SetOrtho(bool bOn)
Definition: svdsnpv.hxx:245
void SetSnapEnabled(bool bOn)
Definition: svdsnpv.hxx:171
void SetAngleSnapEnabled(bool bOn)
Definition: svdsnpv.hxx:221
bool IsSnapEnabled() const
Definition: svdsnpv.hxx:164
bool PickHelpLine(const Point &rPnt, short nTol, const OutputDevice &rOut, sal_uInt16 &rnHelpLineNum, SdrPageView *&rpPV) const
Definition: svdsnpv.cxx:489
bool BegDragHelpLine(sal_uInt16 nHelpLineNum, SdrPageView *pPV)
Definition: svdsnpv.cxx:509
bool IsDragHelpLine() const
Definition: svdsnpv.hxx:207
void SetActualWin(const OutputDevice *pWin)
Definition: svdsnpv.hxx:154
virtual OutlinerParaObject * GetOutlinerParaObject() const override
Definition: svdotext.cxx:1344
virtual bool HasText() const override
Definition: svdotxat.cxx:418
virtual ~SdrView() override
Definition: svdview.cxx:155
virtual SdrViewContext GetContext() const
Definition: svdview.cxx:1300
virtual bool MouseButtonDown(const MouseEvent &rMEvt, OutputDevice *pWin) override
Definition: svdview.cxx:196
SvtAccessibilityOptions maAccessibilityOptions
Definition: svdview.hxx:154
bool KeyInput(const KeyEvent &rKEvt, vcl::Window *pWin) override
Definition: svdview.cxx:160
SdrView(SdrModel &rSdrModel, OutputDevice *pOut=nullptr)
Definition: svdview.cxx:143
virtual void ConfigurationChanged(utl::ConfigurationBroadcaster *, ConfigurationHints) override
Definition: svdview.cxx:1497
bool mbMasterPagePaintCaching
Definition: svdview.hxx:152
bool IsExtendedKeyInputDispatcherEnabled() const
Definition: svdview.hxx:179
virtual void DeleteMarked()
Definition: svdview.cxx:1409
virtual void onAccessibilityOptionsChanged()
method is called whenever the global SvtAccessibilityOptions is changed
Definition: svdview.cxx:1505
void SetMasterPagePaintCaching(bool bOn)
Definition: svdview.cxx:1509
void MarkAll()
Definition: svdview.cxx:1351
bool BegMark(const Point &rPnt, bool bAddMark, bool bUnmark)
Definition: svdview.cxx:1436
bool IsExtendedMouseEventDispatcherEnabled() const
Definition: svdview.hxx:176
virtual bool MouseButtonUp(const MouseEvent &rMEvt, OutputDevice *pWin) override
Definition: svdview.cxx:209
SdrHitKind PickAnything(const MouseEvent &rMEvt, SdrMouseEventKind nMouseDownOrMoveOrUp, SdrViewEvent &rVEvt) const
Definition: svdview.cxx:249
void UnmarkAll()
Definition: svdview.cxx:1386
virtual sdr::contact::ObjectContact * createViewSpecificObjectContact(SdrPageWindow &rPageWindow, const char *pDebugName) const
Definition: svdview.cxx:1537
bool MoveShapeHandle(const sal_uInt32 handleNum, const Point &aEndPoint, const sal_Int32 aObjectOrdNum=-1)
Definition: svdview.cxx:1452
PointerStyle GetPreferredPointer(const Point &rMousePos, const OutputDevice *pOut, sal_uInt16 nModifier=0, bool bLeftDown=false) const
Definition: svdview.cxx:952
bool DoMouseEvent(const SdrViewEvent &rVEvt)
Definition: svdview.cxx:753
OUString GetStatusText()
Definition: svdview.cxx:1165
const tools::Rectangle & GetMarkedRect() const
Definition: svdview.cxx:1398
virtual bool MouseMove(const MouseEvent &rMEvt, OutputDevice *pWin) override
handle mouse over effects for handles
Definition: svdview.cxx:223
void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr=false) const
Definition: svdview.cxx:244
virtual bool Command(const CommandEvent &rCEvt, vcl::Window *pWin) override
Definition: svdview.cxx:237
void SetFormat(SvxURLFormat eFmt)
void SetTargetFrame(const OUString &rFrm)
void SetURL(const OUString &rURL)
void SetRepresentation(const OUString &rRep)
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
void setClosed(bool bNew)
OUString getValue(const OUString &rName) const
void append(std::unique_ptr< OverlayObject > pOverlayObject)
TableHitKind CheckTableHit(const Point &rPos, sal_Int32 &rnX, sal_Int32 &rnY, const sal_uInt16 aTol=0) const
Definition: svdotable.cxx:1210
constexpr tools::Long Top() const
constexpr tools::Long Right() const
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
sal_uInt16 GetModifier() const
KeyFuncType GetFullFunction() const
sal_uInt16 GetFullCode() const
::OutputDevice const * GetOutDev() const
void ReleaseMouse()
Point PixelToLogic(const Point &rDevicePt) const
Point GetPointerPosPixel()
void SetPointer(PointerStyle)
void CaptureMouse()
Point ScreenToOutputPixel(const Point &rPos) const
#define DBG_ASSERT(sCon, aError)
OUString SvxResId(TranslateId aId)
Definition: dialmgr.cxx:24
#define PRIMITIVE2D_ID_TEXTHIERARCHYFIELDPRIMITIVE2D
float u
#define EE_PARA_ALL
#define EE_TEXTPOS_ALL
#define MOUSE_LEFT
#define MOUSE_RIGHT
MouseEventModifiers
SvxURLFormat
OUString aName
void * p
uno_Any a
constexpr sal_uInt16 KEY_MOD2
constexpr sal_uInt16 KEY_ESCAPE
constexpr sal_uInt16 KEY_MOD1
constexpr sal_uInt16 KEY_A
constexpr sal_uInt16 KEY_REPEAT
constexpr sal_uInt16 KEY_UNDO
constexpr sal_uInt16 KEY_DELETE
constexpr sal_uInt16 KEY_SHIFT
constexpr sal_uInt16 KEY_BACKSPACE
#define SAL_INFO(area, stream)
aStr
size_t GetFontHeight()
Definition: svdetc.hxx:74
NONE
rtl::Reference< sdr::SelectionController > CreateTableController(SdrView &rView, const SdrTableObj &rObj, const rtl::Reference< sdr::SelectionController > &xRefController)
long Long
ConfigurationHints
OUTDEV_WINDOW
PointerStyle
SdrObject * SdrObjectPrimitiveHit(const SdrObject &rObject, const Point &rPnt, sal_uInt16 nTol, const SdrPageView &rSdrPageView, const SdrLayerIDSet *pVisiLayer, bool bTextOnly, drawinglayer::primitive2d::Primitive2DContainer *pHitContainer)
sal_uIntPtr sal_uLong
sal_Int32 nStartPara
sal_Int32 nEndPos
sal_Int32 nStartPos
sal_Int32 nEndPara
SdrObject * mpObj
Definition: svdview.hxx:100
SdrHdl * mpHdl
Definition: svdview.hxx:99
MouseEventModifiers mnMouseMode
Definition: svdview.hxx:110
bool mbUnmark
Definition: svdview.hxx:120
bool mbIsTextEdit
Definition: svdview.hxx:118
const SvxURLField * mpURLField
Definition: svdview.hxx:103
bool mbPrevNextMark
Definition: svdview.hxx:121
SdrPageView * mpPV
Definition: svdview.hxx:102
sal_uInt16 mnMouseClicks
Definition: svdview.hxx:109
bool mbMouseUp
Definition: svdview.hxx:116
sal_uInt16 mnHlplIdx
Definition: svdview.hxx:112
bool mbMouseDown
Definition: svdview.hxx:115
bool mbIsAction
Definition: svdview.hxx:117
bool mbAddMark
Definition: svdview.hxx:119
SdrEventKind meEvent
Definition: svdview.hxx:107
bool mbMarkPrev
Definition: svdview.hxx:122
SdrObject * mpRootObj
Definition: svdview.hxx:101
sal_uInt16 mnGlueId
Definition: svdview.hxx:113
SdrHitKind meHit
Definition: svdview.hxx:106
sal_uInt16 mnMouseCode
Definition: svdview.hxx:111
Point maLogicPos
Definition: svdview.hxx:105
SdrHdlKind
Definition: svdhdl.hxx:53
SdrHitKind
Definition: svdmrkv.hxx:58
E3dObject * DynCastE3dObject(SdrObject *pObj)
Definition: svdobj.cxx:3210
SdrTextObj * DynCastSdrTextObj(SdrObject *pObj)
Definition: svdobj.cxx:3217
@ Caption
connector object
@ Table
media shape
SdrCreateCmd
Definition: svdtypes.hxx:27
#define MODKEY_AngleSnap
Definition: svdview.cxx:287
#define MODKEY_ForceMark
Definition: svdview.cxx:294
#define MODKEY_Ortho
Definition: svdview.cxx:285
#define MODKEY_Center
Definition: svdview.cxx:286
#define MODKEY_Unmark
Definition: svdview.cxx:293
#define MODKEY_MultiMark
Definition: svdview.cxx:292
#define MODKEY_PolyPoly
Definition: svdview.cxx:291
#define MODKEY_DeepBackw
Definition: svdview.cxx:296
#define MODKEY_CopyDrag
Definition: svdview.cxx:288
#define MODKEY_NoSnap
Definition: svdview.cxx:284
#define MODKEY_DeepMark
Definition: svdview.cxx:295
constexpr OUStringLiteral STR_NOTHING
Definition: svdview.cxx:1164
SdrViewContext
Definition: svdview.hxx:54
SdrMouseEventKind
Definition: svdview.hxx:90
SdrEventKind
Definition: svdview.hxx:63
oslFileHandle & pOut