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