LibreOffice Module svx (master)  1
svdsnpv.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 
21 #include <svx/svdsnpv.hxx>
22 #include <math.h>
23 
24 #include <svx/svdobj.hxx>
25 #include <svx/svdpagv.hxx>
26 #include <svx/svdpage.hxx>
27 #include <svx/svditer.hxx>
32 #include <svx/sdrpaintwindow.hxx>
33 #include <tools/debug.hxx>
34 #include <vcl/ptrstyle.hxx>
35 
36 
38 {
39  // The OverlayObjects
41 
42  // The current position in logical coordinates
44 
45 public:
46  ImplPageOriginOverlay(const SdrPaintView& rView, const basegfx::B2DPoint& rStartPos);
47 
48  // The OverlayObjects are cleared using the destructor of OverlayObjectList.
49  // That destructor calls clear() at the list which removes all objects from the
50  // OverlayManager and deletes them.
51 
52  void SetPosition(const basegfx::B2DPoint& rNewPosition);
53 };
54 
56 : maPosition(rStartPos)
57 {
58  for(sal_uInt32 a(0); a < rView.PaintWindowCount(); a++)
59  {
60  SdrPaintWindow* pCandidate = rView.GetPaintWindow(a);
61  const rtl::Reference< sdr::overlay::OverlayManager >& xTargetOverlay = pCandidate->GetOverlayManager();
62 
63  if (xTargetOverlay.is())
64  {
65  std::unique_ptr<sdr::overlay::OverlayCrosshairStriped> aNew(new sdr::overlay::OverlayCrosshairStriped(
66  maPosition));
67  xTargetOverlay->add(*aNew);
68  maObjects.append(std::move(aNew));
69  }
70  }
71 }
72 
74 {
75  if(rNewPosition != maPosition)
76  {
77  // apply to OverlayObjects
78  for(sal_uInt32 a(0); a < maObjects.count(); a++)
79  {
82 
83  if(pCandidate)
84  {
85  pCandidate->setBasePosition(rNewPosition);
86  }
87  }
88 
89  // remember new position
90  maPosition = rNewPosition;
91  }
92 }
93 
94 
96 {
97  // The OverlayObjects
99 
100  // The current position in logical coordinates
102 
103  // HelpLine specific stuff
105  sal_uInt16 mnHelpLineNumber;
107 
108 public:
109  ImplHelpLineOverlay(const SdrPaintView& rView, const basegfx::B2DPoint& rStartPos,
110  SdrPageView* pPageView, sal_uInt16 nHelpLineNumber, SdrHelpLineKind eKind);
111 
112  // The OverlayObjects are cleared using the destructor of OverlayObjectList.
113  // That destructor calls clear() at the list which removes all objects from the
114  // OverlayManager and deletes them.
115 
116  void SetPosition(const basegfx::B2DPoint& rNewPosition);
117 
118  // access to HelpLine specific stuff
119  SdrPageView* GetPageView() const { return mpPageView; }
120  sal_uInt16 GetHelpLineNumber() const { return mnHelpLineNumber; }
122 };
123 
125  const SdrPaintView& rView, const basegfx::B2DPoint& rStartPos,
126  SdrPageView* pPageView, sal_uInt16 nHelpLineNumber, SdrHelpLineKind eKind)
127 : maPosition(rStartPos),
128  mpPageView(pPageView),
129  mnHelpLineNumber(nHelpLineNumber),
130  meHelpLineKind(eKind)
131 {
132  for(sal_uInt32 a(0); a < rView.PaintWindowCount(); a++)
133  {
134  SdrPaintWindow* pCandidate = rView.GetPaintWindow(a);
135  const rtl::Reference< sdr::overlay::OverlayManager >& xTargetOverlay = pCandidate->GetOverlayManager();
136 
137  if (xTargetOverlay.is())
138  {
139  std::unique_ptr<sdr::overlay::OverlayHelplineStriped> aNew(new sdr::overlay::OverlayHelplineStriped(
141  xTargetOverlay->add(*aNew);
142  maObjects.append(std::move(aNew));
143  }
144  }
145 }
146 
148 {
149  if(rNewPosition != maPosition)
150  {
151  // apply to OverlayObjects
152  for(sal_uInt32 a(0); a < maObjects.count(); a++)
153  {
156 
157  if(pCandidate)
158  {
159  pCandidate->setBasePosition(rNewPosition);
160  }
161  }
162 
163  // remember new position
164  maPosition = rNewPosition;
165  }
166 }
167 
169  SdrModel& rSdrModel,
170  OutputDevice* pOut)
171 : SdrPaintView(rSdrModel, pOut)
172  ,mpPageOriginOverlay(nullptr)
173  ,mpHelpLineOverlay(nullptr)
174  ,nMagnSizPix(4)
175  ,nSnapAngle(1500)
176  ,nEliminatePolyPointLimitAngle(0)
177  ,eCrookMode(SdrCrookMode::Rotate)
178  ,bSnapEnab(true)
179  ,bGridSnap(true)
180  ,bBordSnap(true)
181  ,bHlplSnap(true)
182  ,bOFrmSnap(true)
183  ,bOPntSnap(false)
184  ,bOConSnap(true)
185  ,bMoveSnapOnlyTopLeft(false)
186  ,bOrtho(false)
187  ,bBigOrtho(true)
188  ,bAngleSnapEnab(false)
189  ,bMoveOnlyDragging(false)
190  ,bSlantButShear(false)
191  ,bCrookNoContortion(false)
192  ,bEliminatePolyPoints(false)
193 {
194 }
195 
197 {
198  BrkSetPageOrg();
199  BrkDragHelpLine();
200 }
201 
202 
204 {
206 }
207 
208 void SdrSnapView::MovAction(const Point& rPnt)
209 {
211  if (IsSetPageOrg()) {
212  MovSetPageOrg(rPnt);
213  }
214  if (IsDragHelpLine()) {
215  MovDragHelpLine(rPnt);
216  }
217 }
218 
220 {
221  if (IsSetPageOrg()) {
222  EndSetPageOrg();
223  }
224  if (IsDragHelpLine()) {
225  EndDragHelpLine();
226  }
228 }
229 
231 {
232  BrkSetPageOrg();
233  BrkDragHelpLine();
235 }
236 
238 {
239  BrkSetPageOrg();
240  BrkDragHelpLine();
242 }
243 
245 {
246  if (IsSetPageOrg() || IsDragHelpLine()) {
248  } else {
250  }
251 }
252 
253 
254 Point SdrSnapView::GetSnapPos(const Point& rPnt, const SdrPageView* pPV) const
255 {
256  Point aPt(rPnt);
257  SnapPos(aPt,pPV);
258  return aPt;
259 }
260 
261 #define NOT_SNAPPED 0x7FFFFFFF
262 SdrSnap SdrSnapView::SnapPos(Point& rPnt, const SdrPageView* pPV) const
263 {
264  if (!bSnapEnab) return SdrSnap::NOTSNAPPED;
265  long x=rPnt.X();
266  long y=rPnt.Y();
267  if (pPV==nullptr) {
268  pPV=GetSdrPageView();
269  if (pPV==nullptr) return SdrSnap::NOTSNAPPED;
270  }
271 
272  long dx=NOT_SNAPPED;
273  long dy=NOT_SNAPPED;
274  long dx1,dy1;
275  long mx=aMagnSiz.Width();
276  long my=aMagnSiz.Height();
278  {
279  const SdrHelpLineList& rHLL=pPV->GetHelpLines();
280  sal_uInt16 nCount=rHLL.GetCount();
281  for (sal_uInt16 i=nCount; i>0;) {
282  i--;
283  const SdrHelpLine& rHL=rHLL[i];
284  const Point& rPos=rHL.GetPos();
285  switch (rHL.GetKind()) {
287  long a=x-rPos.X();
288  if (std::abs(a)<=mx) { dx1=-a; if (std::abs(dx1)<std::abs(dx)) dx=dx1; }
289  } break;
291  long b=y-rPos.Y();
292  if (std::abs(b)<=my) { dy1=-b; if (std::abs(dy1)<std::abs(dy)) dy=dy1; }
293  } break;
294  case SdrHelpLineKind::Point: {
295  long a=x-rPos.X();
296  long b=y-rPos.Y();
297  if (std::abs(a)<=mx && std::abs(b)<=my) {
298  dx1=-a; dy1=-b;
299  if (std::abs(dx1)<std::abs(dx) && std::abs(dy1)<std::abs(dy)) { dx=dx1; dy=dy1; }
300  }
301  } break;
302  } // switch
303  }
304  }
305  if (mbBordVisible && bBordSnap) {
306  SdrPage* pPage=pPV->GetPage();
307  long xs=pPage->GetWidth();
308  long ys=pPage->GetHeight();
309  long lft=pPage->GetLeftBorder();
310  long rgt=pPage->GetRightBorder();
311  long upp=pPage->GetUpperBorder();
312  long lwr=pPage->GetLowerBorder();
313  long a;
314  a=x- lft ; if (std::abs(a)<=mx) { dx1=-a; if (std::abs(dx1)<std::abs(dx)) dx=dx1; } // left margin
315  a=x-(xs-rgt); if (std::abs(a)<=mx) { dx1=-a; if (std::abs(dx1)<std::abs(dx)) dx=dx1; } // right margin
316  a=x ; if (std::abs(a)<=mx) { dx1=-a; if (std::abs(dx1)<std::abs(dx)) dx=dx1; } // left edge of paper
317  a=x- xs ; if (std::abs(a)<=mx) { dx1=-a; if (std::abs(dx1)<std::abs(dx)) dx=dx1; } // right edge of paper
318  a=y- upp ; if (std::abs(a)<=my) { dy1=-a; if (std::abs(dy1)<std::abs(dy)) dy=dy1; } // left margin
319  a=y-(ys-lwr); if (std::abs(a)<=my) { dy1=-a; if (std::abs(dy1)<std::abs(dy)) dy=dy1; } // right margin
320  a=y ; if (std::abs(a)<=my) { dy1=-a; if (std::abs(dy1)<std::abs(dy)) dy=dy1; } // left edge of paper
321  a=y- ys ; if (std::abs(a)<=my) { dy1=-a; if (std::abs(dy1)<std::abs(dy)) dy=dy1; } // right edge of paper
322  }
323  if (bOFrmSnap || bOPntSnap) {
324  sal_uInt32 nMaxPointSnapCount=200;
325  sal_uInt32 nMaxFrameSnapCount=200;
326 
327  // go back to SdrIterMode::DeepNoGroups runthrough for snap to object comparisons
329 
330  while (aIter.IsMore() && (nMaxPointSnapCount>0 || nMaxFrameSnapCount>0)) {
331  SdrObject* pO=aIter.Next();
333  aRect.AdjustLeft( -mx );
334  aRect.AdjustRight(mx );
335  aRect.AdjustTop( -my );
336  aRect.AdjustBottom(my );
337  if (aRect.IsInside(rPnt)) {
338  if (bOPntSnap && nMaxPointSnapCount>0)
339  {
340  sal_uInt32 nCount(pO->GetSnapPointCount());
341  for (sal_uInt32 i(0); i < nCount && nMaxPointSnapCount > 0; i++)
342  {
343  Point aP(pO->GetSnapPoint(i));
344  dx1=x-aP.X();
345  dy1=y-aP.Y();
346  if (std::abs(dx1)<=mx && std::abs(dy1)<=my && std::abs(dx1)<std::abs(dx) && std::abs(dy1)<std::abs(dy)) {
347  dx=-dx1;
348  dy=-dy1;
349  }
350  nMaxPointSnapCount--;
351  }
352  }
353  if (bOFrmSnap && nMaxFrameSnapCount>0) {
354  tools::Rectangle aLog(pO->GetSnapRect());
355  tools::Rectangle aR1(aLog);
356  aR1.AdjustLeft( -mx );
357  aR1.AdjustRight(mx );
358  aR1.AdjustTop( -my );
359  aR1.AdjustBottom(my );
360  if (aR1.IsInside(rPnt)) {
361  if (std::abs(x-aLog.Left ())<=mx) { dx1=-(x-aLog.Left ()); if (std::abs(dx1)<std::abs(dx)) dx=dx1; }
362  if (std::abs(x-aLog.Right ())<=mx) { dx1=-(x-aLog.Right ()); if (std::abs(dx1)<std::abs(dx)) dx=dx1; }
363  if (std::abs(y-aLog.Top ())<=my) { dy1=-(y-aLog.Top ()); if (std::abs(dy1)<std::abs(dy)) dy=dy1; }
364  if (std::abs(y-aLog.Bottom())<=my) { dy1=-(y-aLog.Bottom()); if (std::abs(dy1)<std::abs(dy)) dy=dy1; }
365  }
366  nMaxFrameSnapCount--;
367  }
368  }
369  }
370  }
371  if(bGridSnap)
372  {
373  double fSnapWidth(aSnapWdtX);
374  if(dx == NOT_SNAPPED && fSnapWidth != 0.0)
375  {
376  double fx = static_cast<double>(x);
377 
378  // round instead of trunc
379  if(fx - static_cast<double>(pPV->GetPageOrigin().X()) >= 0.0)
380  fx += fSnapWidth / 2.0;
381  else
382  fx -= fSnapWidth / 2.0;
383 
384  x = static_cast<long>((fx - static_cast<double>(pPV->GetPageOrigin().X())) / fSnapWidth);
385  x = static_cast<long>(static_cast<double>(x) * fSnapWidth + static_cast<double>(pPV->GetPageOrigin().X()));
386  dx = 0;
387  }
388  fSnapWidth = double(aSnapWdtY);
389  if(dy == NOT_SNAPPED && fSnapWidth)
390  {
391  double fy = static_cast<double>(y);
392 
393  // round instead of trunc
394  if(fy - static_cast<double>(pPV->GetPageOrigin().Y()) >= 0.0)
395  fy += fSnapWidth / 2.0;
396  else
397  fy -= fSnapWidth / 2.0;
398 
399  y = static_cast<long>((fy - static_cast<double>(pPV->GetPageOrigin().Y())) / fSnapWidth);
400  y = static_cast<long>(static_cast<double>(y) * fSnapWidth + static_cast<double>(pPV->GetPageOrigin().Y()));
401  dy = 0;
402  }
403  }
405  if (dx==NOT_SNAPPED) dx=0; else bRet|=SdrSnap::XSNAPPED;
406  if (dy==NOT_SNAPPED) dy=0; else bRet|=SdrSnap::YSNAPPED;
407  rPnt.setX(x+dx );
408  rPnt.setY(y+dy );
409  return bRet;
410 }
411 
412 void SdrSnapView::CheckSnap(const Point& rPt, long& nBestXSnap, long& nBestYSnap, bool& bXSnapped, bool& bYSnapped) const
413 {
414  Point aPt(rPt);
415  SdrSnap nRet=SnapPos(aPt,nullptr);
416  aPt-=rPt;
417  if (nRet & SdrSnap::XSNAPPED) {
418  if (bXSnapped) {
419  if (std::abs(aPt.X())<std::abs(nBestXSnap)) {
420  nBestXSnap=aPt.X();
421  }
422  } else {
423  nBestXSnap=aPt.X();
424  bXSnapped=true;
425  }
426  }
427  if (nRet & SdrSnap::YSNAPPED) {
428  if (bYSnapped) {
429  if (std::abs(aPt.Y())<std::abs(nBestYSnap)) {
430  nBestYSnap=aPt.Y();
431  }
432  } else {
433  nBestYSnap=aPt.Y();
434  bYSnapped=true;
435  }
436  }
437 }
438 
439 
440 void SdrSnapView::BegSetPageOrg(const Point& rPnt)
441 {
442  BrkAction();
443 
444  DBG_ASSERT(nullptr == mpPageOriginOverlay, "SdrSnapView::BegSetPageOrg: There exists an ImplPageOriginOverlay (!)");
445  basegfx::B2DPoint aStartPos(rPnt.X(), rPnt.Y());
446  mpPageOriginOverlay = new ImplPageOriginOverlay(*this, aStartPos);
447  maDragStat.Reset(GetSnapPos(rPnt,nullptr));
448 }
449 
450 void SdrSnapView::MovSetPageOrg(const Point& rPnt)
451 {
452  if(IsSetPageOrg())
453  {
454  maDragStat.NextMove(GetSnapPos(rPnt,nullptr));
455  DBG_ASSERT(mpPageOriginOverlay, "SdrSnapView::MovSetPageOrg: no ImplPageOriginOverlay (!)");
456  basegfx::B2DPoint aNewPos(maDragStat.GetNow().X(), maDragStat.GetNow().Y());
458  }
459 }
460 
462 {
463  if(IsSetPageOrg())
464  {
465  SdrPageView* pPV = GetSdrPageView();
466 
467  if(pPV)
468  {
469  Point aPnt(maDragStat.GetNow());
470  pPV->SetPageOrigin(aPnt);
471  }
472 
473  // cleanup
474  BrkSetPageOrg();
475  }
476 }
477 
479 {
480  if(IsSetPageOrg())
481  {
482  DBG_ASSERT(mpPageOriginOverlay, "SdrSnapView::MovSetPageOrg: no ImplPageOriginOverlay (!)");
483  delete mpPageOriginOverlay;
484  mpPageOriginOverlay = nullptr;
485  }
486 }
487 
488 
489 bool SdrSnapView::PickHelpLine(const Point& rPnt, short nTol, const OutputDevice& rOut, sal_uInt16& rnHelpLineNum, SdrPageView*& rpPV) const
490 {
491  rpPV=nullptr;
492  nTol=ImpGetHitTolLogic(nTol,&rOut);
493  SdrPageView* pPV = GetSdrPageView();
494 
495  if(pPV)
496  {
497  Point aPnt(rPnt);
498  sal_uInt16 nIndex=pPV->GetHelpLines().HitTest(aPnt,sal_uInt16(nTol),rOut);
499  if (nIndex!=SDRHELPLINE_NOTFOUND) {
500  rpPV=pPV;
501  rnHelpLineNum=nIndex;
502  return true;
503  }
504  }
505  return false;
506 }
507 
508 // start HelpLine drag for new HelpLine
509 bool SdrSnapView::BegDragHelpLine(sal_uInt16 nHelpLineNum, SdrPageView* pPV)
510 {
511  bool bRet(false);
512 
513  BrkAction();
514 
515  if(pPV && nHelpLineNum < pPV->GetHelpLines().GetCount())
516  {
517  const SdrHelpLineList& rHelpLines = pPV->GetHelpLines();
518  const SdrHelpLine& rHelpLine = rHelpLines[nHelpLineNum];
519  Point aHelpLinePos = rHelpLine.GetPos();
520  basegfx::B2DPoint aStartPos(aHelpLinePos.X(), aHelpLinePos.Y());
521 
522  DBG_ASSERT(nullptr == mpHelpLineOverlay, "SdrSnapView::BegDragHelpLine: There exists an ImplHelpLineOverlay (!)");
523  mpHelpLineOverlay = new ImplHelpLineOverlay(*this, aStartPos, pPV, nHelpLineNum, rHelpLine.GetKind());
524 
525  maDragStat.Reset(GetSnapPos(aHelpLinePos, pPV));
527 
528  bRet = true;
529  }
530 
531  return bRet;
532 }
533 
534 // start HelpLine drag with existing HelpLine
535 void SdrSnapView::BegDragHelpLine(const Point& rPnt, SdrHelpLineKind eNewKind)
536 {
537  BrkAction();
538 
539  if(GetSdrPageView())
540  {
541  DBG_ASSERT(nullptr == mpHelpLineOverlay, "SdrSnapView::BegDragHelpLine: There exists an ImplHelpLineOverlay (!)");
542  basegfx::B2DPoint aStartPos(rPnt.X(), rPnt.Y());
543  mpHelpLineOverlay = new ImplHelpLineOverlay(*this, aStartPos, nullptr, 0, eNewKind);
544  maDragStat.Reset(GetSnapPos(rPnt, nullptr));
545  }
546 }
547 
549 {
550  if(IsDragHelpLine())
551  {
553  {
554  case SdrHelpLineKind::Vertical : return PointerStyle::ESize;
555  case SdrHelpLineKind::Horizontal: return PointerStyle::SSize;
556  default : return PointerStyle::Move;
557  }
558  }
559 
560  return PointerStyle::Move;
561 }
562 
563 void SdrSnapView::MovDragHelpLine(const Point& rPnt)
564 {
566  {
567  Point aPnt(GetSnapPos(rPnt, nullptr));
568 
569  if(aPnt != maDragStat.GetNow())
570  {
571  maDragStat.NextMove(aPnt);
572  DBG_ASSERT(mpHelpLineOverlay, "SdrSnapView::MovDragHelpLine: no ImplHelpLineOverlay (!)");
573  basegfx::B2DPoint aNewPos(maDragStat.GetNow().X(), maDragStat.GetNow().Y());
574  mpHelpLineOverlay->SetPosition(aNewPos);
575  }
576  }
577 }
578 
580 {
581  bool bRet(false);
582 
583  if(IsDragHelpLine())
584  {
585  if(maDragStat.IsMinMoved())
586  {
587  SdrPageView* pPageView = mpHelpLineOverlay->GetPageView();
588 
589  if(pPageView)
590  {
591  // moved existing one
592  Point aPnt(maDragStat.GetNow());
593  const SdrHelpLineList& rHelpLines = pPageView->GetHelpLines();
594  SdrHelpLine aChangedHelpLine = rHelpLines[mpHelpLineOverlay->GetHelpLineNumber()];
595  aChangedHelpLine.SetPos(aPnt);
596  pPageView->SetHelpLine(mpHelpLineOverlay->GetHelpLineNumber(), aChangedHelpLine);
597 
598  bRet = true;
599  }
600  else
601  {
602  // create new one
603  pPageView = GetSdrPageView();
604 
605  if(pPageView)
606  {
607  Point aPnt(maDragStat.GetNow());
608  SdrHelpLine aNewHelpLine(mpHelpLineOverlay->GetHelpLineKind(), aPnt);
609  pPageView->InsertHelpLine(aNewHelpLine);
610 
611  bRet = true;
612  }
613  }
614  }
615 
616  // cleanup
617  BrkDragHelpLine();
618  }
619 
620  return bRet;
621 }
622 
624 {
625  if(IsDragHelpLine())
626  {
627  DBG_ASSERT(mpHelpLineOverlay, "SdrSnapView::EndDragHelpLine: no ImplHelpLineOverlay (!)");
628  delete mpHelpLineOverlay;
629  mpHelpLineOverlay = nullptr;
630  }
631 }
632 
633 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
long Width() const
void SetMinMove(sal_uInt16 nDist)
Definition: svddrag.hxx:111
sal_Int32 nIndex
void Reset()
Definition: svddrag.cxx:36
PointerStyle GetDraggedHelpLinePointer() const
Definition: svdsnpv.cxx:548
virtual const tools::Rectangle & GetCurrentBoundRect() const
Definition: svdobj.cxx:853
bool bBordSnap
Definition: svdsnpv.hxx:114
SdrHelpLineKind meHelpLineKind
Definition: svdsnpv.cxx:106
Fraction aSnapWdtY
Definition: svdsnpv.hxx:104
virtual bool IsAction() const
Definition: svdpntv.cxx:281
void InsertHelpLine(const SdrHelpLine &rHL)
Definition: svdpagv.cxx:693
sal_Int32 GetHeight() const
Definition: svdpage.cxx:1410
rtl::Reference< sdr::overlay::OverlayManager > const & GetOverlayManager() const
basegfx::B2DPoint maPosition
Definition: svdsnpv.cxx:43
long Height() const
void MovSetPageOrg(const Point &rPnt)
Definition: svdsnpv.cxx:450
long AdjustLeft(long nHorzMoveDelta)
void SetPos(const Point &rPnt)
Definition: svdhlpln.hxx:50
void CheckSnap(const Point &rPt, long &nBestXSnap, long &nBestYSnap, bool &bXSnapped, bool &bYSnapped) const
Definition: svdsnpv.cxx:412
bool CheckMinMoved(const Point &rPnt)
Definition: svddrag.cxx:86
sal_Int32 GetRightBorder() const
Definition: svdpage.cxx:1495
sdr::overlay::OverlayObjectList maObjects
Definition: svdsnpv.cxx:40
bool EndDragHelpLine()
Definition: svdsnpv.cxx:579
SdrDragStat maDragStat
Definition: svdpntv.hxx:147
basegfx::B2DPoint maPosition
Definition: svdsnpv.cxx:101
bool mbBordVisible
Definition: svdpntv.hxx:165
geometry::RealPoint2D maPosition
void append(std::unique_ptr< OverlayObject > pOverlayObject)
sal_Int32 GetLowerBorder() const
Definition: svdpage.cxx:1500
float x
void BegSetPageOrg(const Point &rPnt)
Definition: svdsnpv.cxx:440
const SdrHelpLineList & GetHelpLines() const
Definition: svdpagv.hxx:221
sal_uInt16 ImpGetMinMovLogic(short nMinMov, const OutputDevice *pOut) const
Definition: svdpntv.cxx:313
sal_Int32 GetLeftBorder() const
Definition: svdpage.cxx:1485
void SetPosition(const basegfx::B2DPoint &rNewPosition)
Definition: svdsnpv.cxx:147
virtual const tools::Rectangle & GetSnapRect() const
Definition: svdobj.cxx:1596
virtual void BrkAction() override
Definition: svdsnpv.cxx:237
SdrCrookMode
Definition: svdsnpv.hxx:83
sal_uInt16 ImpGetHitTolLogic(short nHitTol, const OutputDevice *pOut) const
Definition: svdpntv.cxx:327
SdrHelpLineKind GetKind() const
Definition: svdhlpln.hxx:49
void BrkDragHelpLine()
Definition: svdsnpv.cxx:623
bool bOPntSnap
Definition: svdsnpv.hxx:117
Point GetSnapPos(const Point &rPnt, const SdrPageView *pPV) const
Definition: svdsnpv.cxx:254
virtual Point GetSnapPoint(sal_uInt32 i) const
Definition: svdobj.cxx:1654
sal_uInt16 HitTest(const Point &rPnt, sal_uInt16 nTolLog, const OutputDevice &rOut) const
Definition: svdhlpln.cxx:99
Size aMagnSiz
Definition: svdsnpv.hxx:102
virtual void TakeActionRect(tools::Rectangle &rRect) const override
Definition: svdsnpv.cxx:244
bool IsDragHelpLine() const
Definition: svdsnpv.hxx:207
int nCount
void SetPageOrigin(const Point &rOrg)
Definition: svdpagv.cxx:628
const Point & GetPos() const
Definition: svdhlpln.hxx:51
const Point & GetPageOrigin() const
The Origin always refers to the upper left corner of the Page.
Definition: svdpagv.hxx:207
bool IsMinMoved() const
Definition: svddrag.hxx:108
sal_uInt32 PaintWindowCount() const
Definition: svdpntv.hxx:228
float y
bool bSnapEnab
Definition: svdsnpv.hxx:112
virtual void EndAction()
Definition: svdpntv.cxx:290
bool mbHlplVisible
Definition: svdpntv.hxx:168
Fraction aSnapWdtX
Definition: svdsnpv.hxx:103
class ImplHelpLineOverlay * mpHelpLineOverlay
Definition: svdsnpv.hxx:100
SdrPageView * GetPageView() const
Definition: svdsnpv.cxx:119
bool bHlplSnap
Definition: svdsnpv.hxx:115
#define DBG_ASSERT(sCon, aError)
sdr::overlay::OverlayObjectList maObjects
Definition: svdsnpv.cxx:98
int i
uno_Any a
SdrSnap
Definition:
Definition: svdsnpv.hxx:71
#define NOT_SNAPPED
Definition: svdsnpv.cxx:261
virtual ~SdrSnapView() override
Definition: svdsnpv.cxx:196
ImplHelpLineOverlay(const SdrPaintView &rView, const basegfx::B2DPoint &rStartPos, SdrPageView *pPageView, sal_uInt16 nHelpLineNumber, SdrHelpLineKind eKind)
Definition: svdsnpv.cxx:124
sal_Int32 GetUpperBorder() const
Definition: svdpage.cxx:1490
virtual bool IsAction() const override
Definition: svdsnpv.cxx:203
sal_uInt16 GetHelpLineNumber() const
Definition: svdsnpv.cxx:120
class ImplPageOriginOverlay * mpPageOriginOverlay
Definition: svdsnpv.hxx:97
void NextMove(const Point &rPnt)
Definition: svddrag.cxx:66
Abstract DrawObject.
Definition: svdobj.hxx:312
void SetHelpLine(sal_uInt16 nNum, const SdrHelpLine &rNewHelpLine)
Definition: svdpagv.cxx:668
sal_uInt16 GetCount() const
Definition: svdhlpln.hxx:70
SdrSnap SnapPos(Point &rPnt, const SdrPageView *pPV) const
Definition: svdsnpv.cxx:262
SdrHelpLineKind
Definition: svdhlpln.hxx:34
ImplPageOriginOverlay(const SdrPaintView &rView, const basegfx::B2DPoint &rStartPos)
Definition: svdsnpv.cxx:55
OverlayObject & getOverlayObject(sal_uInt32 nIndex) const
void SetPosition(const basegfx::B2DPoint &rNewPosition)
Definition: svdsnpv.cxx:73
#define SDRHELPLINE_NOTFOUND
Definition: svdhlpln.hxx:59
SdrPage * GetPage() const
Definition: svdpagv.hxx:171
virtual void MovAction(const Point &rPnt) override
Definition: svdsnpv.cxx:208
void setBasePosition(const basegfx::B2DPoint &rNew)
sal_uInt16 mnHelpLineNumber
Definition: svdsnpv.cxx:105
virtual void BckAction() override
Definition: svdsnpv.cxx:230
bool BegDragHelpLine(sal_uInt16 nHelpLineNum, SdrPageView *pPV)
Definition: svdsnpv.cxx:509
bool IsSetPageOrg() const
Definition: svdsnpv.hxx:190
virtual void MovAction(const Point &rPnt)
Definition: svdpntv.cxx:286
virtual void EndAction() override
Definition: svdsnpv.cxx:219
bool bGridSnap
Definition: svdsnpv.hxx:113
const Point & GetNow() const
Definition: svddrag.hxx:95
PointerStyle
SdrPageView * GetSdrPageView() const
Definition: svdpntv.hxx:310
virtual void BrkAction()
Definition: svdpntv.cxx:298
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:366
SdrSnapView(SdrModel &rSdrModel, OutputDevice *pOut)
Definition: svdsnpv.cxx:168
bool PickHelpLine(const Point &rPnt, short nTol, const OutputDevice &rOut, sal_uInt16 &rnHelpLineNum, SdrPageView *&rpPV) const
Definition: svdsnpv.cxx:489
SdrHelpLineKind GetHelpLineKind() const
Definition: svdsnpv.cxx:121
sal_Int32 GetWidth() const
Definition: svdpage.cxx:1384
void EndSetPageOrg()
Definition: svdsnpv.cxx:461
SdrPageView * mpPageView
Definition: svdsnpv.cxx:104
virtual void BckAction()
Definition: svdpntv.cxx:294
virtual void TakeActionRect(tools::Rectangle &rRect) const
Definition: svdpntv.cxx:302
void MovDragHelpLine(const Point &rPnt)
Definition: svdsnpv.cxx:563
SdrPaintWindow * GetPaintWindow(sal_uInt32 nIndex) const
Definition: svdpntv.cxx:71
bool bOFrmSnap
Definition: svdsnpv.hxx:116
void BrkSetPageOrg()
Definition: svdsnpv.cxx:478
Point Rotate(const Point &rPoint, short nOrientation, const Point &rOrigin)
virtual sal_uInt32 GetSnapPointCount() const
snap to special points of an Object (polygon points, center of circle)
Definition: svdobj.cxx:1649