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: GetModel().Undo(); break;
169 case KeyFuncType::REDO: GetModel().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: GetModel().Undo(); break;
180 case KEY_REPEAT: case KEY_BACKSPACE+KEY_MOD2+KEY_MOD1: GetModel().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, 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 auto pTextObj = DynCastSdrTextObj(pHitObj);
518
519 // Around the TextEditArea there's a border to select without going into text edit mode.
520 tools::Rectangle aBoundRect;
521 const GeoStat& rGeo = pTextObj->GetGeoStat();
522 if (pTextObj && !rGeo.m_nRotationAngle && !rGeo.m_nShearAngle)
523 {
524 pTextObj->TakeTextEditArea(nullptr, nullptr, &aBoundRect, nullptr);
525 }
526 else
527 aBoundRect = pHitObj->GetCurrentBoundRect();
528
529 // Force to SnapRect when Fontwork
530 if( pTextObj && pTextObj->IsFontwork() )
531 aBoundRect = pHitObj->GetSnapRect();
532
533 sal_Int32 nTolerance(mnHitTolLog);
534 bool bBoundRectHit(false);
535
536 if(pOut)
537 {
538 nTolerance = pOut->PixelToLogic(Size(2, 0)).Width();
539 }
540
541 if( (aLocalLogicPosition.X() >= aBoundRect.Left() - nTolerance && aLocalLogicPosition.X() <= aBoundRect.Left() + nTolerance)
542 || (aLocalLogicPosition.X() >= aBoundRect.Right() - nTolerance && aLocalLogicPosition.X() <= aBoundRect.Right() + nTolerance)
543 || (aLocalLogicPosition.Y() >= aBoundRect.Top() - nTolerance && aLocalLogicPosition.Y() <= aBoundRect.Top() + nTolerance)
544 || (aLocalLogicPosition.Y() >= aBoundRect.Bottom() - nTolerance && aLocalLogicPosition.Y() <= aBoundRect.Bottom() + nTolerance))
545 {
546 bBoundRectHit = true;
547 }
548
549 if(!bBoundRectHit && aBoundRect.Contains(aLocalLogicPosition))
550 {
551 bool bTEHit(pPV
552 && SdrObjectPrimitiveHit(*pHitObj, aLocalLogicPosition, { 2000.0, 0.0 },
553 *pPV, &pPV->GetVisibleLayers(), true));
554
555 // TextEdit attached to an object in a locked layer
556 if (bTEHit && pPV->GetLockedLayers().IsSet(pHitObj->GetLayer()))
557 {
558 bTEHit=false;
559 }
560
561 if (bTEHit)
562 {
563 rVEvt.mpRootObj=pObj;
564 pObj=pHitObj;
566 }
567 }
568 }
569 if (!bHitPassDirect && eHit==SdrHitKind::UnmarkedObject) {
570 eHit=SdrHitKind::NONE;
571 pObj=nullptr;
572 pPV=nullptr;
573 }
574 bool bMouseLeft = (rVEvt.mnMouseCode & MOUSE_LEFT) != 0;
575 bool bMouseRight = (rVEvt.mnMouseCode & MOUSE_RIGHT) != 0;
576 bool bMouseDown = rVEvt.mbMouseDown;
577 bool bMouseUp = rVEvt.mbMouseUp;
579 bool bIsAction=IsAction();
580
581 if (bIsAction)
582 {
583 if (bMouseDown)
584 {
585 if (bMouseRight) eEvent=SdrEventKind::BackAction;
586 }
587 else if (bMouseUp)
588 {
589 if (bMouseLeft)
590 {
592 if (IsDragObj())
593 {
595 }
596 else if (IsCreateObj() || IsInsObjPoint())
597 {
599 }
600 else if (IsMarking())
601 {
603 if (!maDragStat.IsMinMoved())
604 {
607 }
608 }
609 }
610 }
611 else
612 {
614 }
615 }
616 else if (eHit==SdrHitKind::TextEdit)
617 {
619 }
620 else if (bMouseDown && bMouseLeft)
621 {
622 if (rVEvt.mnMouseClicks == 2 && rVEvt.mnMouseCode == MOUSE_LEFT && pObj!=nullptr && pHitObj!=nullptr && pHitObj->HasTextEdit() && eHit==SdrHitKind::MarkedObject)
623 {
624 rVEvt.mpRootObj = pObj;
625 pObj=pHitObj;
627 }
628 else if (MODKEY_ForceMark && eHit!=SdrHitKind::UrlField)
629 {
630 eEvent=SdrEventKind::BeginMark; // AddMark,Unmark */
631 }
632 else if (eHit==SdrHitKind::HelpLine)
633 {
634 eEvent=SdrEventKind::BeginDragHelpline; // nothing, actually
635 }
636 else if (eHit==SdrHitKind::Gluepoint)
637 {
638 eEvent=SdrEventKind::MarkGluePoint; // AddMark+Drag
639 rVEvt.mbAddMark = MODKEY_MultiMark || MODKEY_DeepMark; // if not hit with Deep
640 }
641 else if (eHit==SdrHitKind::Handle)
642 {
643 eEvent=SdrEventKind::BeginDragObj; // Mark+Drag,AddMark+Drag,DeepMark+Drag,Unmark
644 bool bGlue=pHdl->GetKind()==SdrHdlKind::Glue;
645 bool bPoly=!bGlue && IsPointMarkable(*pHdl);
646 bool bMarked=bGlue || (bPoly && pHdl->IsSelected());
647 if (bGlue || bPoly)
648 {
650 if (MODKEY_DeepMark)
651 {
652 rVEvt.mbAddMark = true;
653 rVEvt.mbPrevNextMark = true;
655 }
656 else if (MODKEY_MultiMark)
657 {
658 rVEvt.mbAddMark = true;
659 rVEvt.mbUnmark = bMarked; // Toggle
660 if (bGlue)
661 {
662 pObj=pHdl->GetObj();
663 nGlueId=static_cast<sal_uInt16>(pHdl->GetObjHdlNum());
664 }
665 }
666 else if (bMarked)
667 {
668 eEvent=SdrEventKind::BeginDragObj; // don't change MarkState, only change Drag
669 }
670 }
671 }
672 else if (bInsPolyPt && (MODKEY_PolyPoly || (!MODKEY_MultiMark && !MODKEY_DeepMark)))
673 {
675 }
676 else if (bInsGluePt && !MODKEY_MultiMark && !MODKEY_DeepMark)
677 {
679 }
680 else if (eHit==SdrHitKind::TextEditObj)
681 {
682 eEvent=SdrEventKind::BeginTextEdit; // AddMark+Drag,DeepMark+Drag,Unmark
684 { // if not hit with Deep
686 }
687 }
688 else if (eHit==SdrHitKind::Macro)
689 {
690 eEvent=SdrEventKind::BeginMacroObj; // AddMark+Drag
692 { // if not hit with Deep
694 }
695 }
696 else if (eHit==SdrHitKind::UrlField)
697 {
698 eEvent=SdrEventKind::ExecuteUrl; // AddMark+Drag
700 { // if not hit with Deep
702 }
703 }
704 else if (eHit==SdrHitKind::MarkedObject)
705 {
706 eEvent=SdrEventKind::BeginDragObj; // DeepMark+Drag,Unmark
707
709 { // if not hit with Deep
711 }
712 }
713 else if (IsCreateMode())
714 {
715 eEvent=SdrEventKind::BeginCreateObj; // nothing, actually
716 }
717 else if (eHit==SdrHitKind::UnmarkedObject)
718 {
719 eEvent=SdrEventKind::MarkObj; // AddMark+Drag
720 }
721 else
722 {
724 }
725
726 if (eEvent==SdrEventKind::MarkObj)
727 {
728 rVEvt.mbAddMark = MODKEY_MultiMark || MODKEY_DeepMark; // if not hit with Deep
731 }
732 if (eEvent==SdrEventKind::BeginMark)
733 {
735 rVEvt.mbUnmark = MODKEY_Unmark;
736 }
737 }
738 rVEvt.mbIsAction = bIsAction;
739 rVEvt.mbIsTextEdit = bIsTextEdit;
740 rVEvt.maLogicPos = aLocalLogicPosition;
741 rVEvt.mpHdl = pHdl;
742 rVEvt.mpObj = pObj;
743 if (rVEvt.mpRootObj == nullptr)
744 rVEvt.mpRootObj = pObj;
745 rVEvt.mpPV = pPV;
746 rVEvt.mnHlplIdx = nHlplIdx;
747 rVEvt.mnGlueId = nGlueId;
748 rVEvt.meHit = eHit;
749 rVEvt.meEvent = eEvent;
750#ifdef DGB_UTIL
751 if (rVEvt.mpRootObj != nullptr)
752 {
754 {
755 OSL_FAIL("SdrView::PickAnything(): pRootObj->getParentSdrObjListFromSdrObject()!=pPV->GetObjList() !");
756 }
757 }
758#endif
759 return eHit;
760}
761
763{
764 bool bRet=false;
765 SdrHitKind eHit = rVEvt.meHit;
766 Point aLogicPos(rVEvt.maLogicPos);
767
768 bool bShift = (rVEvt.mnMouseCode & KEY_SHIFT) != 0;
769 bool bCtrl = (rVEvt.mnMouseCode & KEY_MOD1) != 0;
770 bool bAlt = (rVEvt.mnMouseCode & KEY_MOD2) != 0;
771 bool bMouseLeft = (rVEvt.mnMouseCode & MOUSE_LEFT) != 0;
772 bool bMouseDown = rVEvt.mbMouseDown;
773 bool bMouseUp = rVEvt.mbMouseUp;
774 if (bMouseDown) {
775 if (bMouseLeft) maDragStat.SetMouseDown(true);
776 } else if (bMouseUp) {
777 if (bMouseLeft) maDragStat.SetMouseDown(false);
778 } else { // else, MouseMove
779 maDragStat.SetMouseDown(bMouseLeft);
780 }
781
782#ifdef MODKEY_NoSnap
784#endif
785#ifdef MODKEY_Ortho
787#endif
788#ifdef MODKEY_AngleSnap
790#endif
791#ifdef MODKEY_CopyDrag
793#endif
794#ifdef MODKEY_Center
798#endif
799 if (bMouseLeft && bMouseDown && rVEvt.mbIsTextEdit && (eHit==SdrHitKind::UnmarkedObject || eHit==SdrHitKind::NONE)) {
800 SdrEndTextEdit(); // User has clicked beneath object, exit edit mode.
801 // pHdl is invalid, then, that shouldn't matter, though, as we expect
802 // pHdl==NULL (because of eHit).
803 }
804 switch (rVEvt.meEvent)
805 {
806 case SdrEventKind::NONE: bRet=false; break;
807 case SdrEventKind::TextEdit: bRet=false; break; // Events handled by the OutlinerView are not taken into account here.
808 case SdrEventKind::MoveAction: MovAction(aLogicPos); bRet=true; break;
809 case SdrEventKind::EndAction: EndAction(); bRet=true; break;
810 case SdrEventKind::BackAction: BckAction(); bRet=true; break;
811 case SdrEventKind::EndMark : EndAction(); bRet=true; break;
812 case SdrEventKind::BrkMark : {
813 BrkAction();
814 if (!MarkObj(aLogicPos, mnHitTolLog, rVEvt.mbAddMark))
815 {
816 // No object hit. Do the following:
817 // 1. deselect any selected gluepoints
818 // 2. deselect any selected polygon points
819 // 3. deselect any selected objects
820 if (!rVEvt.mbAddMark) UnmarkAll();
821 }
822 bRet=true;
823 } break;
824 case SdrEventKind::EndCreate: { // if necessary, MarkObj
827 if (rVEvt.mnMouseClicks > 1) eCmd=SdrCreateCmd::ForceEnd;
828 if (!EndCreateObj(eCmd)) { // Don't evaluate event for Create? -> Select
830 MarkObj(rVEvt.mpRootObj, rVEvt.mpPV);
831 if (eHit==SdrHitKind::TextEdit)
832 {
833 bool bRet2(mpActualOutDev && OUTDEV_WINDOW == mpActualOutDev->GetOutDevType() &&
834 SdrBeginTextEdit(rVEvt.mpObj, rVEvt.mpPV, mpActualOutDev->GetOwnerWindow()));
835
836 if(bRet2)
837 {
838 MouseEvent aMEvt(mpActualOutDev->LogicToPixel(aLogicPos), 1,
839 rVEvt.mnMouseMode,rVEvt.mnMouseCode,rVEvt.mnMouseCode);
840
842 if (pOLV!=nullptr) {
843 pOLV->MouseButtonDown(aMEvt); // event for the Outliner, but without double-click
844 pOLV->MouseButtonUp(aMEvt); // event for the Outliner, but without double-click
845 }
846 }
847 }
848 bRet=true; // object is selected and (if necessary) TextEdit is started
849 } else bRet=false; // canceled Create, nothing else
850 } else bRet=true; // return true for EndCreate
851 } break;
854 ForceMarkedObjToAnotherPage(); // TODO: Undo+bracing missing!
855 } break;
856 case SdrEventKind::MarkObj: { // + (if applicable) BegDrag
857 if (!rVEvt.mbAddMark) UnmarkAllObj();
858 bool bUnmark = rVEvt.mbUnmark;
859 if (rVEvt.mbPrevNextMark) {
860 bRet=MarkNextObj(aLogicPos, mnHitTolLog, rVEvt.mbMarkPrev);
861 } else {
863 const size_t nCount0=GetMarkedObjectCount();
864 bRet=MarkObj(aLogicPos, mnHitTolLog, rVEvt.mbAddMark);
866 const size_t nCount1=GetMarkedObjectCount();
867 bUnmark=nCount1<nCount0;
868 }
869 if (!bUnmark) {
870 BegDragObj(aLogicPos,nullptr,nullptr,mnMinMovLog);
871 bRet=true;
872 }
873 } break;
874 case SdrEventKind::MarkPoint: { // + (if applicable) BegDrag
875 if (!rVEvt.mbAddMark) UnmarkAllPoints();
876 if (rVEvt.mbPrevNextMark) {
878 bRet=false;
879 } else {
880 bRet = MarkPoint(*rVEvt.mpHdl, rVEvt.mbUnmark);
881 }
882 if (!rVEvt.mbUnmark && !rVEvt.mbPrevNextMark) {
883 BegDragObj(aLogicPos, nullptr, rVEvt.mpHdl, mnMinMovLog);
884 bRet=true;
885 }
886 } break;
887 case SdrEventKind::MarkGluePoint: { // + (if applicable) BegDrag
888 if (!rVEvt.mbAddMark) UnmarkAllGluePoints();
889 if (rVEvt.mbPrevNextMark) {
891 bRet=false;
892 } else {
893 bRet=MarkGluePoint(rVEvt.mpObj,rVEvt.mnGlueId,rVEvt.mbUnmark);
894 }
895 if (!rVEvt.mbUnmark && !rVEvt.mbPrevNextMark) {
896 SdrHdl* pHdl = GetGluePointHdl(rVEvt.mpObj, rVEvt.mnGlueId);
897 BegDragObj(aLogicPos,nullptr,pHdl,mnMinMovLog);
898 bRet=true;
899 }
900 } break;
901 case SdrEventKind::BeginMark: bRet = BegMark(aLogicPos,rVEvt.mbAddMark,rVEvt.mbUnmark); break;
906 if (rVEvt.mnMouseClicks > 1) eCmd = SdrCreateCmd::ForceEnd;
907 EndInsObjPoint(eCmd);
908 bRet=true;
909 } break;
910 case SdrEventKind::BeginInsertGluePoint: bRet=BegInsGluePoint(aLogicPos); break;
911 case SdrEventKind::BeginDragHelpline: bRet = BegDragHelpLine(rVEvt.mnHlplIdx,rVEvt.mpPV); break;
912 case SdrEventKind::BeginDragObj: bRet=BegDragObj(aLogicPos, nullptr, rVEvt.mpHdl, mnMinMovLog); break;
916 bRet=BegCreateCaptionObj(aLogicPos,Size(5*nHgt,2*nHgt));
917 } else bRet=BegCreateObj(aLogicPos);
918 } break;
920 BegMacroObj(aLogicPos, mnHitTolLog, rVEvt.mpObj, rVEvt.mpPV, mpActualOutDev->GetOwnerWindow());
921 bRet=false;
922 } break;
924 if (!IsObjMarked(rVEvt.mpObj)) {
925 UnmarkAllObj();
926 MarkObj(rVEvt.mpRootObj,rVEvt.mpPV);
927 }
928
929 bRet = mpActualOutDev && OUTDEV_WINDOW == mpActualOutDev->GetOutDevType()&&
930 SdrBeginTextEdit(rVEvt.mpObj, rVEvt.mpPV, mpActualOutDev->GetOwnerWindow());
931
932 if(bRet)
933 {
934 MouseEvent aMEvt(mpActualOutDev->LogicToPixel(aLogicPos),
935 1, rVEvt.mnMouseMode, rVEvt.mnMouseCode, rVEvt.mnMouseCode);
937 if (pOLV!=nullptr) pOLV->MouseButtonDown(aMEvt); // event for the Outliner, but without double-click
938 }
939 } break;
940 default: break;
941 } // switch
942 if (bRet && mpActualOutDev && mpActualOutDev->GetOutDevType()==OUTDEV_WINDOW) {
943 vcl::Window* pWin=mpActualOutDev->GetOwnerWindow();
944 // left mouse button pressed?
945 bool bLeftDown = (rVEvt.mnMouseCode & MOUSE_LEFT) != 0 && rVEvt.mbMouseDown;
946 // left mouse button released?
947 bool bLeftUp = (rVEvt.mnMouseCode & MOUSE_LEFT) != 0 && rVEvt.mbMouseUp;
948 // left mouse button pressed or held?
949 bool bLeftDown1=(rVEvt.mnMouseCode & MOUSE_LEFT) != 0 && !rVEvt.mbMouseUp;
951 rVEvt.mnMouseCode & (KEY_SHIFT|KEY_MOD1|KEY_MOD2),bLeftDown1));
952 bool bAction=IsAction();
953 if (bLeftDown && bAction)
954 pWin->CaptureMouse();
955 else if (bLeftUp || (rVEvt.mbIsAction && !bAction))
956 pWin->ReleaseMouse();
957 }
958 return bRet;
959}
960
961PointerStyle SdrView::GetPreferredPointer(const Point& rMousePos, const OutputDevice* pOut, sal_uInt16 nModifier, bool bLeftDown) const
962{
963 // Actions
964 if (IsCreateObj())
965 {
966 return mpCurrentCreate->GetCreatePointer();
967 }
969 {
970 return mpCurrentSdrDragMethod->GetSdrDragPointer();
971 }
972 if (IsMarkObj() || IsMarkPoints() || IsMarkGluePoints() || IsSetPageOrg()) return PointerStyle::Arrow;
974 if (IsMacroObj()) {
975 SdrObjMacroHitRec aHitRec;
976 aHitRec.aPos=pOut->LogicToPixel(rMousePos);
977 aHitRec.nTol=nMacroTol;
979 aHitRec.pPageView=pMacroPV;
980 return pMacroObj->GetMacroPointer(aHitRec);
981 }
982
983 // TextEdit, ObjEdit, Macro
984 if (IsTextEdit() && (IsTextEditInSelectionMode() || IsTextEditHit(rMousePos)))
985 {
987 {
988 if (mpTextEditOutliner->IsVertical())
989 return PointerStyle::TextVertical;
990 else
991 return PointerStyle::Text;
992 }
993 // Outliner should return something here...
994 Point aPos(pOut->LogicToPixel(rMousePos));
996 if (aPointer==PointerStyle::Arrow)
997 {
998 if (mpTextEditOutliner->IsVertical())
999 aPointer = PointerStyle::TextVertical;
1000 else
1001 aPointer = PointerStyle::Text;
1002 }
1003 return aPointer;
1004 }
1005
1006 SdrViewEvent aVEvt;
1007 aVEvt.mnMouseCode = (nModifier&(KEY_SHIFT|KEY_MOD1|KEY_MOD2))|MOUSE_LEFT; // to see what would happen on MouseLeftDown
1008 aVEvt.mbMouseDown = !bLeftDown; // What if ..?
1009 aVEvt.mbMouseUp = bLeftDown; // What if ..?
1010 if (pOut!=nullptr)
1011 const_cast<SdrView*>(this)->SetActualWin(pOut);
1012 SdrHitKind eHit=PickAnything(rMousePos,aVEvt);
1013 SdrEventKind eEvent = aVEvt.meEvent;
1014 switch (eEvent)
1015 {
1019 return PointerStyle::Move;
1021 return PointerStyle::Arrow;
1024 return PointerStyle::MovePoint;
1027 return PointerStyle::Cross;
1029 return PointerStyle::RefHand;
1031 {
1032 SdrObjMacroHitRec aHitRec;
1033 aHitRec.aPos = aVEvt.maLogicPos;
1034 aHitRec.nTol=mnHitTolLog;
1035 aHitRec.pVisiLayer = &aVEvt.mpPV->GetVisibleLayers();
1036 aHitRec.pPageView = aVEvt.mpPV;
1037 return aVEvt.mpObj->GetMacroPointer(aHitRec);
1038 }
1039 default: break;
1040 } // switch
1041
1042 switch(eHit)
1043 {
1044 case SdrHitKind::Cell:
1045 return PointerStyle::Arrow;
1047 return aVEvt.mpPV->GetHelpLines()[aVEvt.mnHlplIdx].GetPointer();
1049 return PointerStyle::MovePoint;
1052 {
1053 SdrTextObj* pText = DynCastSdrTextObj(aVEvt.mpObj);
1054 if(pText && pText->HasText())
1055 {
1056 OutlinerParaObject* pParaObj = pText->GetOutlinerParaObject();
1057 if(pParaObj && pParaObj->IsEffectivelyVertical())
1058 return PointerStyle::TextVertical;
1059 }
1060 return PointerStyle::Text;
1061 }
1062 default: break;
1063 }
1064
1065 bool bMarkHit=eHit==SdrHitKind::MarkedObject;
1066 SdrHdl* pHdl = aVEvt.mpHdl;
1067 // now check the pointers for dragging
1068 if (pHdl!=nullptr || bMarkHit) {
1069 SdrHdlKind eHdl= pHdl!=nullptr ? pHdl->GetKind() : SdrHdlKind::Move;
1070 bool bCorner=pHdl!=nullptr && pHdl->IsCornerHdl();
1071 bool bVertex=pHdl!=nullptr && pHdl->IsVertexHdl();
1072 bool bMov=eHdl==SdrHdlKind::Move;
1074 if (!IsMoveAllowed()) return PointerStyle::Arrow; // because double click or drag & drop is possible
1075 return PointerStyle::Move;
1076 }
1077 switch (meDragMode) {
1078 case SdrDragMode::Rotate: {
1079 if ((bCorner || bMov) && !IsRotateAllowed(true))
1080 return PointerStyle::NotAllowed;
1081
1082 // are 3D objects selected?
1083 bool b3DObjSelected = false;
1084 for (size_t a=0; !b3DObjSelected && a<GetMarkedObjectCount(); ++a) {
1086 if(DynCastE3dObject(pObj))
1087 b3DObjSelected = true;
1088 }
1089 // If we have a 3D object, go on despite !IsShearAllowed,
1090 // because then we have a rotation instead of a shear.
1091 if (bVertex && !IsShearAllowed() && !b3DObjSelected)
1092 return PointerStyle::NotAllowed;
1093 if (bMov)
1094 return PointerStyle::Rotate;
1095 } break;
1096 case SdrDragMode::Shear: {
1097 if (bCorner) {
1098 if (!IsDistortAllowed(true) && !IsDistortAllowed()) return PointerStyle::NotAllowed;
1099 else return PointerStyle::RefHand;
1100 }
1101 if (bVertex && !IsShearAllowed()) return PointerStyle::NotAllowed;
1102 if (bMov) {
1103 if (!IsMoveAllowed()) return PointerStyle::Arrow; // because double click or drag & drop is possible
1104 return PointerStyle::Move;
1105 }
1106 } break;
1107 case SdrDragMode::Mirror: {
1108 if (bCorner || bVertex || bMov) {
1111 bool b90=false;
1112 bool b45=false;
1113 if (pH1!=nullptr && pH2!=nullptr) {
1114 Point aDif = pH2->GetPos()-pH1->GetPos();
1115 b90=(aDif.X()==0) || aDif.Y()==0;
1116 b45=b90 || (std::abs(aDif.X())==std::abs(aDif.Y()));
1117 }
1118 bool bNo=false;
1119 if (!IsMirrorAllowed(true,true)) bNo=true; // any mirroring is forbidden
1120 if (!IsMirrorAllowed() && !b45) bNo=true; // mirroring freely is forbidden
1121 if (!IsMirrorAllowed(true) && !b90) bNo=true; // mirroring horizontally/vertically is allowed
1122 if (bNo) return PointerStyle::NotAllowed;
1123 if (b90) {
1124 return PointerStyle::Mirror;
1125 }
1126 return PointerStyle::Mirror;
1127 }
1128 } break;
1129
1131 {
1133 return PointerStyle::NotAllowed;
1134
1135 return PointerStyle::RefHand;
1136 }
1137
1139 {
1140 if(!IsGradientAllowed())
1141 return PointerStyle::NotAllowed;
1142
1143 return PointerStyle::RefHand;
1144 }
1145
1146 case SdrDragMode::Crook: {
1147 if (bCorner || bVertex || bMov) {
1148 if (!IsCrookAllowed(true) && !IsCrookAllowed()) return PointerStyle::NotAllowed;
1149 return PointerStyle::Crook;
1150 }
1151 break;
1152 }
1153
1154 case SdrDragMode::Crop:
1155 {
1156 return PointerStyle::Crop;
1157 }
1158
1159 default: {
1160 if ((bCorner || bVertex) && !IsResizeAllowed(true)) return PointerStyle::NotAllowed;
1161 }
1162 }
1163 if (pHdl!=nullptr) return pHdl->GetPointer();
1164 if (bMov) {
1165 if (!IsMoveAllowed()) return PointerStyle::Arrow; // because double click or drag & drop is possible
1166 return PointerStyle::Move;
1167 }
1168 }
1170 return PointerStyle::Arrow;
1171}
1172
1173constexpr OUStringLiteral STR_NOTHING = u"nothing";
1175{
1176 OUString aName;
1177 OUString aStr = STR_NOTHING;
1178
1179 if (mpCurrentCreate!=nullptr)
1180 {
1181 aStr=mpCurrentCreate->getSpecialDragComment(maDragStat);
1182
1183 if(aStr.isEmpty())
1184 {
1185 aName = mpCurrentCreate->TakeObjNameSingul();
1186 aStr = SvxResId(STR_ViewCreateObj);
1187 }
1188 }
1189 else if (mpCurrentSdrDragMethod)
1190 {
1192 {
1194 }
1195 else
1196 {
1197 if (maDragStat.IsMinMoved())
1198 {
1199 SAL_INFO(
1200 "svx.svdraw",
1201 "(" << this << ") " << mpCurrentSdrDragMethod.get());
1202 aStr = mpCurrentSdrDragMethod->GetSdrDragComment();
1203 }
1204 }
1205 }
1206 else if(IsMarkObj())
1207 {
1208 if(AreObjectsMarked())
1209 {
1210 aStr = SvxResId(STR_ViewMarkMoreObjs);
1211 }
1212 else
1213 {
1214 aStr = SvxResId(STR_ViewMarkObjs);
1215 }
1216 }
1217 else if(IsMarkPoints())
1218 {
1219 if(HasMarkedPoints())
1220 {
1221 aStr = SvxResId(STR_ViewMarkMorePoints);
1222 }
1223 else
1224 {
1225 aStr = SvxResId(STR_ViewMarkPoints);
1226 }
1227 } else if (IsMarkGluePoints())
1228 {
1230 {
1231 aStr = SvxResId(STR_ViewMarkMoreGluePoints);
1232 }
1233 else
1234 {
1235 aStr = SvxResId(STR_ViewMarkGluePoints);
1236 }
1237 }
1238 else if (IsTextEdit() && mpTextEditOutlinerView != nullptr) {
1239 aStr=SvxResId(STR_ViewTextEdit); // "TextEdit - Row y, Column x";
1241 tools::Long nPar = aSel.nEndPara,nLin=0,nCol=aSel.nEndPos;
1242 if (aSel.nEndPara>0) {
1243 for (sal_Int32 nParaNum=0; nParaNum<aSel.nEndPara; nParaNum++) {
1244 nLin += mpTextEditOutliner->GetLineCount(nParaNum);
1245 }
1246 }
1247 // A little imperfection:
1248 // At the end of a line of any multi-line paragraph, we display the
1249 // position of the next line of the same paragraph, if there is one.
1250 sal_uInt16 nParaLine = 0;
1251 sal_uLong nParaLineCount = mpTextEditOutliner->GetLineCount(aSel.nEndPara);
1252 bool bBrk = false;
1253 while (!bBrk)
1254 {
1255 sal_uInt16 nLen = mpTextEditOutliner->GetLineLen(aSel.nEndPara, nParaLine);
1256 bool bLastLine = (nParaLine == nParaLineCount - 1);
1257 if (nCol>nLen || (!bLastLine && nCol == nLen))
1258 {
1259 nCol -= nLen;
1260 nLin++;
1261 nParaLine++;
1262 }
1263 else
1264 bBrk = true;
1265
1266 if (nLen == 0)
1267 bBrk = true; // to be sure
1268 }
1269
1270 aStr = aStr.replaceFirst("%1", OUString::number(nPar + 1));
1271 aStr = aStr.replaceFirst("%2", OUString::number(nLin + 1));
1272 aStr = aStr.replaceFirst("%3", OUString::number(nCol + 1));
1273
1274#ifdef DBG_UTIL
1275 aStr += ", Level " + OUString::number(mpTextEditOutliner->GetDepth( aSel.nEndPara ));
1276#endif
1277 }
1278
1279 if(aStr == STR_NOTHING)
1280 {
1281 if (AreObjectsMarked()) {
1282 aStr = ImpGetDescriptionString(STR_ViewMarked);
1283 if (IsGluePointEditMode()) {
1284 if (HasMarkedGluePoints()) {
1286 }
1287 } else {
1288 if (HasMarkedPoints()) {
1290 }
1291 }
1292 } else {
1293 aStr.clear();
1294 }
1295 }
1296 else if(!aName.isEmpty())
1297 {
1298 aStr = aStr.replaceFirst("%1", aName);
1299 }
1300
1301 if(!aStr.isEmpty())
1302 {
1303 // capitalize first letter
1304 aStr = aStr.replaceAt(0, 1, OUString(aStr[0]).toAsciiUpperCase());
1305 }
1306 return aStr;
1307}
1308
1310{
1311 if( IsGluePointEditMode() )
1313
1314 const size_t nMarkCount = GetMarkedObjectCount();
1315
1316 if( HasMarkablePoints() && !IsFrameHandles() )
1317 {
1318 bool bPath=true;
1319 for( size_t nMarkNum = 0; nMarkNum < nMarkCount && bPath; ++nMarkNum )
1320 if (dynamic_cast<const SdrPathObj*>(GetMarkedObjectByIndex(nMarkNum)) == nullptr)
1321 bPath=false;
1322
1323 if( bPath )
1325 }
1326
1327 if( GetMarkedObjectCount() )
1328 {
1329 bool bGraf = true, bMedia = true, bTable = true;
1330
1331 for( size_t nMarkNum = 0; nMarkNum < nMarkCount && ( bGraf || bMedia ); ++nMarkNum )
1332 {
1333 const SdrObject* pMarkObj = GetMarkedObjectByIndex( nMarkNum );
1334 DBG_ASSERT( pMarkObj, "SdrView::GetContext(), null pointer in mark list!" );
1335
1336 if( !pMarkObj )
1337 continue;
1338
1339 if( dynamic_cast<const SdrGrafObj*>( pMarkObj) == nullptr )
1340 bGraf = false;
1341
1342 if( dynamic_cast<const SdrMediaObj*>( pMarkObj) == nullptr )
1343 bMedia = false;
1344
1345 if( dynamic_cast<const sdr::table::SdrTableObj* >( pMarkObj ) == nullptr )
1346 bTable = false;
1347 }
1348
1349 if( bGraf )
1351 else if( bMedia )
1352 return SdrViewContext::Media;
1353 else if( bTable )
1354 return SdrViewContext::Table;
1355 }
1356
1358}
1359
1361{
1362 if (IsTextEdit()) {
1364 } else if (IsGluePointEditMode()) MarkAllGluePoints();
1365 else if (HasMarkablePoints()) MarkAllPoints();
1366 else {
1367 // check for table
1368 bool bMarkAll = true;
1369 const SdrMarkList& rMarkList = GetMarkedObjectList();
1370 if (rMarkList.GetMarkCount() == 1)
1371 {
1372 const SdrObject* pObj(rMarkList.GetMark(0)->GetMarkedSdrObj());
1373 SdrView* pView = this;
1374 if (pObj && pView && (pObj->GetObjInventor() == SdrInventor::Default)
1375 && (pObj->GetObjIdentifier() == SdrObjKind::Table))
1376 {
1377 mxSelectionController.clear();
1379 *pView, static_cast<const sdr::table::SdrTableObj&>(*pObj),
1381
1382 if (mxSelectionController.is())
1383 {
1385 mxSelectionController->onSelectAll();
1386 bMarkAll = false;
1387 }
1388 }
1389 }
1390 if ( bMarkAll )
1391 MarkAllObj();
1392 }
1393}
1394
1396{
1397 if (IsTextEdit()) {
1399 eSel.nStartPara=eSel.nEndPara;
1400 eSel.nStartPos=eSel.nEndPos;
1403 else if (HasMarkedPoints()) UnmarkAllPoints(); // Marked, not Markable!
1404 else UnmarkAllObj();
1405}
1406
1408{
1410 return GetMarkedGluePointsRect();
1411 }
1412 if (HasMarkedPoints()) {
1413 return GetMarkedPointsRect();
1414 }
1415 return GetMarkedObjRect();
1416}
1417
1419{
1420 if (IsTextEdit())
1421 {
1423 }
1424 else
1425 {
1426 if( mxSelectionController.is() && mxSelectionController->DeleteMarked() )
1427 {
1428 // action already performed by current selection controller, do nothing
1429 }
1431 {
1433 }
1435 {
1437 }
1438 else
1439 {
1441 }
1442 }
1443}
1444
1445bool SdrView::BegMark(const Point& rPnt, bool bAddMark, bool bUnmark)
1446{
1447 if (bUnmark) bAddMark=true;
1448 if (IsGluePointEditMode()) {
1449 if (!bAddMark) UnmarkAllGluePoints();
1450 return BegMarkGluePoints(rPnt,bUnmark);
1451 } else if (HasMarkablePoints()) {
1452 if (!bAddMark) UnmarkAllPoints();
1453 return BegMarkPoints(rPnt,bUnmark);
1454 } else {
1455 if (!bAddMark) UnmarkAllObj();
1456 BegMarkObj(rPnt,bUnmark);
1457 return true;
1458 }
1459}
1460
1461bool SdrView::MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint, const sal_Int32 aObjectOrdNum)
1462{
1463 if (GetHdlList().IsMoveOutside())
1464 return false;
1465
1466 if (!GetMarkedObjectList().GetMarkCount())
1467 return false;
1468
1469 SdrHdl * pHdl = GetHdlList().GetHdl(handleNum);
1470 if (pHdl == nullptr)
1471 return false;
1472
1473 SdrDragStat& rDragStat = const_cast<SdrDragStat&>(GetDragStat());
1474 // start dragging
1475 BegDragObj(pHdl->GetPos(), nullptr, pHdl, 0);
1476 if (!IsDragObj())
1477 return false;
1478
1479 bool bWasNoSnap = rDragStat.IsNoSnap();
1480 bool bWasSnapEnabled = IsSnapEnabled();
1481
1482 // switch snapping off
1483 if(!bWasNoSnap)
1484 rDragStat.SetNoSnap();
1485 if(bWasSnapEnabled)
1486 SetSnapEnabled(false);
1487
1488 if (aObjectOrdNum != -1)
1489 {
1490 rDragStat.GetGlueOptions().objectOrdNum = aObjectOrdNum;
1491 }
1492 MovDragObj(aEndPoint);
1493 EndDragObj();
1494
1495 // Clear Glue Options
1496 rDragStat.GetGlueOptions().objectOrdNum = -1;
1497
1498 if (!bWasNoSnap)
1499 rDragStat.SetNoSnap(bWasNoSnap);
1500 if (bWasSnapEnabled)
1501 SetSnapEnabled(bWasSnapEnabled);
1502
1503 return true;
1504}
1505
1507{
1510}
1511
1512
1515{
1516}
1517
1519{
1520 if(mbMasterPagePaintCaching == bOn)
1521 return;
1522
1524
1525 // reset at all SdrPageWindows
1526 SdrPageView* pPageView = GetSdrPageView();
1527
1528 if(!pPageView)
1529 return;
1530
1531 for(sal_uInt32 b(0); b < pPageView->PageWindowCount(); b++)
1532 {
1533 SdrPageWindow* pPageWindow = pPageView->GetPageWindow(b);
1534 assert(pPageWindow && "SdrView::SetMasterPagePaintCaching: Corrupt SdrPageWindow list (!)");
1535
1536 // force deletion of ObjectContact, so at re-display all VOCs
1537 // will be re-created with updated flag setting
1538 pPageWindow->ResetObjectContact();
1539 }
1540
1541 // force redraw of this view
1542 pPageView->InvalidateAllWin();
1543}
1544
1545// Default ObjectContact is ObjectContactOfPageView
1547 SdrPageWindow& rPageWindow,
1548 const char* pDebugName) const
1549{
1550 return new sdr::contact::ObjectContactOfPageView(rPageWindow, pDebugName);
1551}
1552
1553/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
The transformation of a rectangle into a polygon, by using angle parameters from GeoStat.
Definition: svdtrans.hxx:201
Degree100 m_nShearAngle
Definition: svdtrans.hxx:204
Degree100 m_nRotationAngle
Definition: svdtrans.hxx:203
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)
constexpr tools::Long Y() const
void setX(tools::Long nX)
constexpr tools::Long X() const
PointerStyle maCurrentCreatePointer
Definition: svdcrtv.hxx:48
bool BegCreateObj(const Point &rPnt, OutputDevice *pOut=nullptr, short nMinMov=-3)
Definition: svdcrtv.cxx:490
bool IsTextTool() const
Definition: svdcrtv.cxx:315
void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr) const
Definition: svdcrtv.cxx:854
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:584
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:509
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:532
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:184
bool IsOrthoDesired() const
Definition: svddrgv.cxx:886
bool IsDragWithCopy() const
Definition: svddrgv.hxx:114
bool IsInsGluePointMode() const
Definition: svddrgv.hxx:141
bool BegInsGluePoint(const Point &rPnt)
Definition: svddrgv.cxx:734
bool IsInsObjPointPossible() const
Definition: svddrgv.cxx:633
void SetDragWithCopy(bool bOn)
Definition: svddrgv.hxx:113
bool mbMarkedHitMovesAlways
Definition: svddrgv.hxx:50
bool IsInsertGluePoint() const
Definition: svddrgv.hxx:120
bool IsInsObjPoint() const
Definition: svddrgv.hxx:127
void SetResizeAtCenter(bool bOn)
Definition: svddrgv.hxx:194
bool BegInsObjPoint(const Point &rPnt, bool bNewObj)
Definition: svddrgv.hxx:124
bool IsInsGluePointPossible() const
Definition: svddrgv.cxx:712
void MovDragObj(const Point &rPnt)
Definition: svddrgv.cxx:507
bool IsInsObjPointMode() const
Definition: svddrgv.hxx:132
void SetCrookAtCenter(bool bOn)
Definition: svddrgv.hxx:199
bool EndInsObjPoint(SdrCreateCmd eCmd)
Definition: svddrgv.cxx:696
bool IsDragObj() const
Definition: svddrgv.hxx:104
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:258
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:223
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:1933
bool MarkAllPoints()
Definition: svdmrkv.hxx:347
OUString ImpGetDescriptionString(TranslateId pStrCacheID, ImpGetDescriptionOptions nOpt=ImpGetDescriptionOptions::NONE) const
Definition: svdmrkv.cxx:2656
bool IsObjMarked(SdrObject const *pObj) const
Definition: svdmrkv.cxx:2208
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:390
bool BegMarkGluePoints(const Point &rPnt, bool bUnmark=false)
Definition: svdmrkv.cxx:510
bool BegMarkPoints(const Point &rPnt, bool bUnmark=false)
Definition: svdmrkv.cxx:446
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:2426
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:2567
bool UnmarkAllPoints()
Definition: svdmrkv.hxx:348
virtual bool HasMarkablePoints() const
Definition: svdmrkv1.cxx:29
void MarkAllObj(SdrPageView *pPV=nullptr)
Definition: svdmrkv.cxx:2587
SdrViewEditMode meEditMode
Definition: svdmrkv.hxx:119
const tools::Rectangle & GetMarkedObjRect() const
Definition: svdmrkv.cxx:2636
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:1955
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:1941
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:298
void Repeat(SfxRepeatTarget &)
Definition: svdmodel.cxx:342
void Redo()
Definition: svdmodel.cxx:320
bool IsTextEditInSelectionMode() const
Definition: svdedxv.cxx:2510
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:1565
virtual bool KeyInput(const KeyEvent &rKEvt, vcl::Window *pWin) override
Definition: svdedxv.cxx:1951
const OutlinerView * GetTextEditOutlinerView() const
Definition: svdedxv.hxx:252
virtual bool MouseButtonUp(const MouseEvent &rMEvt, OutputDevice *pWin) override
Definition: svdedxv.cxx:2027
rtl::Reference< sdr::SelectionController > mxLastSelectionController
Definition: svdedxv.hxx:109
virtual bool MouseButtonDown(const MouseEvent &rMEvt, OutputDevice *pWin) override
Definition: svdedxv.cxx:1983
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:2517
virtual bool Command(const CommandEvent &rCEvt, vcl::Window *pWin) override
Definition: svdedxv.cxx:2108
bool IsTextEditHit(const Point &rHit) const
Definition: svdedxv.cxx:1875
virtual bool IsTextEdit() const final override
Definition: svdedxv.cxx:1833
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:1224
sal_uInt16 nMacroTol
Definition: svdedxv.hxx:100
const SdrPageView * pPageView
Definition: svdobj.hxx:140
const SdrLayerIDSet * pVisiLayer
Definition: svdobj.hxx:139
sal_uInt16 nTol
Definition: svdobj.hxx:141
Abstract DrawObject.
Definition: svdobj.hxx:260
const OUString & getHyperlink() const
Definition: svdobj.hxx:883
virtual basegfx::B2DPolyPolygon TakeXorPoly() const
The Xor-Polygon is required by the View to drag the object.
Definition: svdobj.cxx:1131
virtual SdrInventor GetObjInventor() const
Definition: svdobj.cxx:621
virtual const tools::Rectangle & GetCurrentBoundRect() const
Definition: svdobj.cxx:962
SdrObjList * getParentSdrObjListFromSdrObject() const
Definition: svdobj.cxx:318
virtual const tools::Rectangle & GetSnapRect() const
Definition: svdobj.cxx:1662
virtual bool HasTextEdit() const
Definition: svdobj.cxx:1753
virtual SdrObjKind GetObjIdentifier() const
Definition: svdobj.cxx:626
bool IsMacroHit(const SdrObjMacroHitRec &rRec) const
Definition: svdobj.cxx:1889
SdrObject * getParentSdrObjectFromSdrObject() const
Definition: svdobj.cxx:722
virtual SdrLayerID GetLayer() const
Definition: svdobj.cxx:645
virtual PointerStyle GetMacroPointer(const SdrObjMacroHitRec &rRec) const
Definition: svdobj.cxx:1862
virtual bool HasMacro() const
Definition: svdobj.cxx:1847
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:149
sal_uInt16 mnHitTolLog
Definition: svdpntv.hxx:148
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:233
SdrDragStat maDragStat
Definition: svdpntv.hxx:139
VclPtr< OutputDevice > mpActualOutDev
Definition: svdpntv.hxx:125
sal_uInt32 PaintWindowCount() const
Definition: svdpntv.hxx:241
bool IsHlplVisible() const
Draw Help line of the Page or not.
Definition: svdpntv.hxx:396
const SdrDragStat & GetDragStat() const
Definition: svdpntv.hxx:310
SdrPageView * GetSdrPageView() const
Definition: svdpntv.hxx:323
SdrModel & GetModel() const
Definition: svdpntv.hxx:282
bool IsHlplFront() const
Draw Help line in front of the objects or behind them.
Definition: svdpntv.hxx:399
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:1412
virtual bool HasText() const override
Definition: svdotxat.cxx:420
virtual ~SdrView() override
Definition: svdview.cxx:155
virtual SdrViewContext GetContext() const
Definition: svdview.cxx:1309
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:1506
bool mbMasterPagePaintCaching
Definition: svdview.hxx:152
bool IsExtendedKeyInputDispatcherEnabled() const
Definition: svdview.hxx:179
virtual void DeleteMarked()
Definition: svdview.cxx:1418
virtual void onAccessibilityOptionsChanged()
method is called whenever the global SvtAccessibilityOptions is changed
Definition: svdview.cxx:1514
void SetMasterPagePaintCaching(bool bOn)
Definition: svdview.cxx:1518
void MarkAll()
Definition: svdview.cxx:1360
bool BegMark(const Point &rPnt, bool bAddMark, bool bUnmark)
Definition: svdview.cxx:1445
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:1395
virtual sdr::contact::ObjectContact * createViewSpecificObjectContact(SdrPageWindow &rPageWindow, const char *pDebugName) const
Definition: svdview.cxx:1546
bool MoveShapeHandle(const sal_uInt32 handleNum, const Point &aEndPoint, const sal_Int32 aObjectOrdNum=-1)
Definition: svdview.cxx:1461
PointerStyle GetPreferredPointer(const Point &rMousePos, const OutputDevice *pOut, sal_uInt16 nModifier=0, bool bLeftDown=false) const
Definition: svdview.cxx:961
bool DoMouseEvent(const SdrViewEvent &rVEvt)
Definition: svdview.cxx:762
OUString GetStatusText()
Definition: svdview.cxx:1174
const tools::Rectangle & GetMarkedRect() const
Definition: svdview.cxx:1407
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:1160
bool Contains(const Point &rPOINT) const
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()
virtual 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:75
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, const basegfx::B2DVector &rHitTolerance, 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:3205
SdrTextObj * DynCastSdrTextObj(SdrObject *pObj)
Definition: svdobj.cxx:3212
@ 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:1173
SdrViewContext
Definition: svdview.hxx:54
SdrMouseEventKind
Definition: svdview.hxx:90
SdrEventKind
Definition: svdview.hxx:63
oslFileHandle & pOut