LibreOffice Module svx (master)  1
svdocapt.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 <sal/config.h>
21 
22 #include <cassert>
23 
29 #include <editeng/eeitem.hxx>
30 #include <svl/style.hxx>
31 #include <tools/bigint.hxx>
32 #include <tools/helpers.hxx>
33 
34 #include <svx/dialmgr.hxx>
35 #include <svx/strings.hrc>
36 
39 #include <svx/sdrhittesthelper.hxx>
40 #include <svx/sdooitm.hxx>
41 #include <svx/svddrag.hxx>
42 #include <svx/svdetc.hxx>
43 #include <svx/svdhdl.hxx>
44 #include <svx/svdmodel.hxx>
45 #include <svx/svdocapt.hxx>
46 #include <svx/svdopath.hxx>
47 #include <svx/svdogrp.hxx>
48 #include <svx/svdpage.hxx>
49 #include <svx/svdpool.hxx>
50 #include <svx/svdtrans.hxx>
51 #include <svx/svdview.hxx>
52 #include <svx/sxcaitm.hxx>
53 #include <svx/sxcecitm.hxx>
54 #include <svx/sxcgitm.hxx>
55 #include <svx/sxcllitm.hxx>
56 #include <svx/sxctitm.hxx>
57 #include <svx/xflclit.hxx>
58 #include <svx/xflhtit.hxx>
59 #include <svx/xfltrit.hxx>
60 #include <svx/xlnwtit.hxx>
61 #include <svx/xpoly.hxx>
62 #include <svx/xpool.hxx>
63 #include <vcl/canvastools.hxx>
64 #include <vcl/ptrstyle.hxx>
65 
66 namespace {
67 
68 enum EscDir {LKS,RTS,OBN,UNT};
69 
70 }
71 
73 {
74 public:
76  long nGap;
77  long nEscRel;
78  long nEscAbs;
79  long nLineLen;
82  bool bEscRel;
84 
85 public:
87  : eType(SdrCaptionType::Type3),
88  nGap(0), nEscRel(5000), nEscAbs(0),
89  nLineLen(0), eEscDir(SdrCaptionEscDir::Horizontal),
90  bFitLineLen(true), bEscRel(true), bFixedAngle(false)
91  {
92  }
93  void CalcEscPos(const Point& rTail, const tools::Rectangle& rRect, Point& rPt, EscDir& rDir) const;
94 };
95 
96 void ImpCaptParams::CalcEscPos(const Point& rTailPt, const tools::Rectangle& rRect, Point& rPt, EscDir& rDir) const
97 {
98  Point aTl(rTailPt); // copy locally for performance reasons
99  long nX,nY;
100  if (bEscRel) {
101  nX=rRect.Right()-rRect.Left();
102  nX=BigMulDiv(nX,nEscRel,10000);
103  nY=rRect.Bottom()-rRect.Top();
104  nY=BigMulDiv(nY,nEscRel,10000);
105  } else {
106  nX=nEscAbs;
107  nY=nEscAbs;
108  }
109  nX+=rRect.Left();
110  nY+=rRect.Top();
111  Point aBestPt;
112  EscDir eBestDir=LKS;
114  if (!bTryH) {
117  } else {
119  }
120  }
122  if (!bTryV) {
125  } else {
127  }
128  }
129 
130  if (bTryH) {
131  Point aLft(rRect.Left()-nGap,nY);
132  Point aRgt(rRect.Right()+nGap,nY);
133  bool bLft=(aTl.X()-aLft.X()<aRgt.X()-aTl.X());
134  if (bLft) {
135  eBestDir=LKS;
136  aBestPt=aLft;
137  } else {
138  eBestDir=RTS;
139  aBestPt=aRgt;
140  }
141  }
142  if (bTryV) {
143  Point aTop(nX,rRect.Top()-nGap);
144  Point aBtm(nX,rRect.Bottom()+nGap);
145  bool bTop=(aTl.Y()-aTop.Y()<aBtm.Y()-aTl.Y());
146  Point aBest2;
147  EscDir eBest2;
148  if (bTop) {
149  eBest2=OBN;
150  aBest2=aTop;
151  } else {
152  eBest2=UNT;
153  aBest2=aBtm;
154  }
155  bool bTakeIt=eEscDir!=SdrCaptionEscDir::BestFit;
156  if (!bTakeIt) {
157  BigInt aHorX(aBestPt.X()-aTl.X()); aHorX*=aHorX;
158  BigInt aHorY(aBestPt.Y()-aTl.Y()); aHorY*=aHorY;
159  BigInt aVerX(aBest2.X()-aTl.X()); aVerX*=aVerX;
160  BigInt aVerY(aBest2.Y()-aTl.Y()); aVerY*=aVerY;
162  bTakeIt=aVerX+aVerY<aHorX+aHorY;
163  } else {
164  bTakeIt=aVerX+aVerY>=aHorX+aHorY;
165  }
166  }
167  if (bTakeIt) {
168  aBestPt=aBest2;
169  eBestDir=eBest2;
170  }
171  }
172  rPt=aBestPt;
173  rDir=eBestDir;
174 }
175 
176 
177 // BaseProperties section
178 
179 std::unique_ptr<sdr::properties::BaseProperties> SdrCaptionObj::CreateObjectSpecificProperties()
180 {
181  return std::make_unique<sdr::properties::CaptionProperties>(*this);
182 }
183 
184 
185 // DrawContact section
186 
187 std::unique_ptr<sdr::contact::ViewContact> SdrCaptionObj::CreateObjectSpecificViewContact()
188 {
189  return std::make_unique<sdr::contact::ViewContactOfSdrCaptionObj>(*this);
190 }
191 
192 
194 : SdrRectObj(rSdrModel, OBJ_TEXT),
195  aTailPoly(3), // default size: 3 points = 2 lines
196  mbSpecialTextBoxShadow(false),
197  mbFixedTail(false),
198  mbSuppressGetBitmap(false),
199  maFixedTailPos()
200 {
201 }
202 
204  SdrModel& rSdrModel,
205  const tools::Rectangle& rRect,
206  const Point& rTail)
207 : SdrRectObj(rSdrModel, OBJ_TEXT,rRect),
208  aTailPoly(3), // default size: 3 points = 2 lines
209  mbSpecialTextBoxShadow(false),
210  mbFixedTail(false),
211  mbSuppressGetBitmap(false),
212  maFixedTailPos()
213 {
214  aTailPoly[0]=maFixedTailPos=rTail;
215 }
216 
218 {
219 }
220 
222 {
223  rInfo.bRotateFreeAllowed=false;
224  rInfo.bRotate90Allowed =false;
225  rInfo.bMirrorFreeAllowed=false;
226  rInfo.bMirror45Allowed =false;
227  rInfo.bMirror90Allowed =false;
228  rInfo.bTransparenceAllowed = false;
229  rInfo.bShearAllowed =false;
230  rInfo.bEdgeRadiusAllowed=false;
231  rInfo.bCanConvToPath =true;
232  rInfo.bCanConvToPoly =true;
233  rInfo.bCanConvToPathLineToArea=false;
234  rInfo.bCanConvToPolyLineToArea=false;
236 }
237 
239 {
240  return sal_uInt16(OBJ_CAPTION);
241 }
242 
244 {
245  return CloneHelper< SdrCaptionObj >(rTargetModel);
246 }
247 
249 {
250  if( this == &rObj )
251  return *this;
252  SdrRectObj::operator=(rObj);
253 
254  aTailPoly = rObj.aTailPoly;
256  mbFixedTail = rObj.mbFixedTail;
258 
259  return *this;
260 }
261 
263 {
264  OUStringBuffer sName(SvxResId(STR_ObjNameSingulCAPTION));
265 
266  OUString aName(GetName());
267  if (!aName.isEmpty())
268  {
269  sName.append(' ');
270  sName.append('\'');
271  sName.append(aName);
272  sName.append('\'');
273  }
274 
275  return sName.makeStringAndClear();
276 }
277 
279 {
280  return SvxResId(STR_ObjNamePluralCAPTION);
281 }
282 
284 {
286  aPolyPoly.append(aTailPoly.getB2DPolygon());
287 
288  return aPolyPoly;
289 }
290 
291 sal_uInt32 SdrCaptionObj::GetHdlCount() const
292 {
293  sal_uInt32 nCount1(SdrRectObj::GetHdlCount());
294  // Currently only dragging the tail's end is implemented.
295  return nCount1 + 1;
296 }
297 
299 {
300  SdrRectObj::AddToHdlList(rHdlList);
301  // Currently only dragging the tail's end is implemented.
302  std::unique_ptr<SdrHdl> pHdl(new SdrHdl(aTailPoly.GetPoint(0), SdrHdlKind::Poly));
303  pHdl->SetPolyNum(1);
304  pHdl->SetPointNum(0);
305  rHdlList.AddHdl(std::move(pHdl));
306 }
307 
309 {
310  return true;
311 }
312 
314 {
315  const SdrHdl* pHdl = rDrag.GetHdl();
316  rDrag.SetEndDragChangesAttributes(true);
318 
319  if(pHdl && 0 == pHdl->GetPolyNum())
320  {
321  return SdrRectObj::beginSpecialDrag(rDrag);
322  }
323  else
324  {
325  rDrag.SetOrtho8Possible();
326 
327  if(!pHdl)
328  {
329  if (bMovProt)
330  return false;
331 
332  rDrag.SetNoSnap();
333  rDrag.SetActionRect(maRect);
334 
335  Point aHit(rDrag.GetStart());
336 
337  if(rDrag.GetPageView() && SdrObjectPrimitiveHit(*this, aHit, 0, *rDrag.GetPageView(), nullptr, false))
338  {
339  return true;
340  }
341  }
342  else
343  {
344  if((1 == pHdl->GetPolyNum()) && (0 == pHdl->GetPointNum()))
345  return true;
346  }
347  }
348 
349  return false;
350 }
351 
353 {
354  const SdrHdl* pHdl = rDrag.GetHdl();
355 
356  if(pHdl && 0 == pHdl->GetPolyNum())
357  {
358  const bool bRet(SdrRectObj::applySpecialDrag(rDrag));
359  ImpRecalcTail();
360  ActionChanged();
361 
362  return bRet;
363  }
364  else
365  {
366  Point aDelt(rDrag.GetNow()-rDrag.GetStart());
367 
368  if(!pHdl)
369  {
370  maRect.Move(aDelt.X(),aDelt.Y());
371  }
372  else
373  {
374  aTailPoly[0] += aDelt;
375  }
376 
377  ImpRecalcTail();
378  ActionChanged();
379 
380  return true;
381  }
382 }
383 
385 {
386  const bool bCreateComment(rDrag.GetView() && this == rDrag.GetView()->GetCreateObj());
387 
388  if(bCreateComment)
389  {
390  return OUString();
391  }
392  else
393  {
394  const SdrHdl* pHdl = rDrag.GetHdl();
395 
396  if(pHdl && 0 == pHdl->GetPolyNum())
397  {
398  return SdrRectObj::getSpecialDragComment(rDrag);
399  }
400  else
401  {
402  if(!pHdl)
403  {
404  return ImpGetDescriptionStr(STR_DragCaptFram);
405  }
406  else
407  {
408  return ImpGetDescriptionStr(STR_DragCaptTail);
409  }
410  }
411  }
412 }
413 
414 
416 {
417  const SfxItemSet& rSet = GetObjectItemSet();
418  rPara.eType =rSet.Get(SDRATTR_CAPTIONTYPE ).GetValue();
419  rPara.bFixedAngle=rSet.Get(SDRATTR_CAPTIONFIXEDANGLE).GetValue();
420  rPara.nGap =static_cast<const SdrCaptionGapItem&> (rSet.Get(SDRATTR_CAPTIONGAP )).GetValue();
421  rPara.eEscDir =rSet.Get(SDRATTR_CAPTIONESCDIR ).GetValue();
422  rPara.bEscRel =rSet.Get(SDRATTR_CAPTIONESCISREL ).GetValue();
423  rPara.nEscRel =rSet.Get(SDRATTR_CAPTIONESCREL ).GetValue();
424  rPara.nEscAbs =rSet.Get(SDRATTR_CAPTIONESCABS ).GetValue();
425  rPara.nLineLen =rSet.Get(SDRATTR_CAPTIONLINELEN ).GetValue();
426  rPara.bFitLineLen=rSet.Get(SDRATTR_CAPTIONFITLINELEN).GetValue();
427 }
428 
430 {
431  ImpCaptParams aPara;
432  ImpGetCaptParams(aPara);
433  ImpCalcTail(aPara, aTailPoly, maRect);
434  SetRectsDirty();
435  SetXPolyDirty();
436 }
437 
438 // #i35971#
439 // SdrCaptionObj::ImpCalcTail1 does move the object(!). What a hack.
440 // I really wonder why this had not triggered problems before. I am
441 // sure there are some places where SetTailPos() is called at least
442 // twice or SetSnapRect after it again just to work around this.
443 // Changed this method to not do that.
444 // Also found why this has been done: For interactive dragging of the
445 // tail end pos for SdrCaptionType::Type1. This sure was the simplest method
446 // to achieve this, at the cost of making a whole group of const methods
447 // of this object implicitly change the object's position.
449 {
450  tools::Polygon aPol(2);
451  Point aTl(rPoly[0]);
452 
453  aPol[0] = aTl;
454  aPol[1] = aTl;
455 
456  EscDir eEscDir;
457  Point aEscPos;
458 
459  rPara.CalcEscPos(aTl, rRect, aEscPos, eEscDir);
460  aPol[1] = aEscPos;
461 
462  if(eEscDir==LKS || eEscDir==RTS)
463  {
464  aPol[0].setX( aEscPos.X() );
465  }
466  else
467  {
468  aPol[0].setY( aEscPos.Y() );
469  }
470 
471  rPoly = aPol;
472 }
473 
475 { // Gap/EscDir/EscPos/Angle
476  tools::Polygon aPol(2);
477  Point aTl(rPoly[0]);
478  aPol[0]=aTl;
479 
480  EscDir eEscDir;
481  Point aEscPos;
482  rPara.CalcEscPos(aTl,rRect,aEscPos,eEscDir);
483  aPol[1]=aEscPos;
484 
485  if (!rPara.bFixedAngle) {
486  // TODO: Implementation missing.
487  }
488  rPoly=aPol;
489 }
490 
492 { // Gap/EscDir/EscPos/Angle/LineLen
493  tools::Polygon aPol(3);
494  Point aTl(rPoly[0]);
495  aPol[0]=aTl;
496 
497  EscDir eEscDir;
498  Point aEscPos;
499  rPara.CalcEscPos(aTl,rRect,aEscPos,eEscDir);
500  aPol[1]=aEscPos;
501  aPol[2]=aEscPos;
502 
503  if (eEscDir==LKS || eEscDir==RTS) {
504  if (rPara.bFitLineLen) {
505  aPol[1].setX((aTl.X()+aEscPos.X())/2 );
506  } else {
507  if (eEscDir==LKS) aPol[1].AdjustX( -(rPara.nLineLen) );
508  else aPol[1].AdjustX(rPara.nLineLen );
509  }
510  } else {
511  if (rPara.bFitLineLen) {
512  aPol[1].setY((aTl.Y()+aEscPos.Y())/2 );
513  } else {
514  if (eEscDir==OBN) aPol[1].AdjustY( -(rPara.nLineLen) );
515  else aPol[1].AdjustY(rPara.nLineLen );
516  }
517  }
518  if (!rPara.bFixedAngle) {
519  // TODO: Implementation missing.
520  }
521  rPoly=aPol;
522 }
523 
525 {
526  switch (rPara.eType) {
527  case SdrCaptionType::Type1: ImpCalcTail1(rPara,rPoly,rRect); break;
528  case SdrCaptionType::Type2: ImpCalcTail2(rPara,rPoly,rRect); break;
529  case SdrCaptionType::Type3: ImpCalcTail3(rPara,rPoly,rRect); break;
530  case SdrCaptionType::Type4: ImpCalcTail3(rPara,rPoly,rRect); break;
531  }
532 }
533 
535 {
536  if (maRect.IsEmpty()) return false; // Create currently only works with the given Rect
537 
538  ImpCaptParams aPara;
539  ImpGetCaptParams(aPara);
540  maRect.SetPos(rStat.GetNow());
541  aTailPoly[0]=rStat.GetStart();
543  rStat.SetActionRect(maRect);
544  return true;
545 }
546 
548 {
549  ImpCaptParams aPara;
550  ImpGetCaptParams(aPara);
551  maRect.SetPos(rStat.GetNow());
553  rStat.SetActionRect(maRect);
555  bSnapRectDirty=true;
556  return true;
557 }
558 
560 {
561  ImpCaptParams aPara;
562  ImpGetCaptParams(aPara);
563  maRect.SetPos(rStat.GetNow());
565  SetRectsDirty();
566  return (eCmd==SdrCreateCmd::ForceEnd || rStat.GetPointCount()>=2);
567 }
568 
570 {
571  return false;
572 }
573 
575 {
576 }
577 
579 {
580  basegfx::B2DPolyPolygon aRetval;
583  aRetval.append(aTailPoly.getB2DPolygon());
584  return aRetval;
585 }
586 
588 {
589  return PointerStyle::DrawCaption;
590 }
591 
592 void SdrCaptionObj::NbcMove(const Size& rSiz)
593 {
594  SdrRectObj::NbcMove(rSiz);
595  MovePoly(aTailPoly,rSiz);
596  if(mbFixedTail)
598 }
599 
600 void SdrCaptionObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
601 {
602  SdrRectObj::NbcResize(rRef,xFact,yFact);
603  ResizePoly(aTailPoly,rRef,xFact,yFact);
604  ImpRecalcTail();
605  if(mbFixedTail)
607 }
608 
610 {
611  Point aRelPos0(aTailPoly.GetPoint(0)-aAnchor);
612  Size aSiz(rPnt.X()-aRelPos0.X(),rPnt.Y()-aRelPos0.Y());
613  NbcMove(aSiz); // This also calls SetRectsDirty()
614 }
615 
617 {
618  return aTailPoly.GetPoint(0)-aAnchor;
619 }
620 
622 {
623  return maRect;
624 }
625 
627 {
629  ImpRecalcTail();
630 }
631 
633 {
634  return aTailPoly[0];
635 }
636 
638 {
639  if (aTailPoly.GetSize()==0 || aTailPoly[0]!=rPos) {
640  tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
641  NbcSetTailPos(rPos);
642  SetChanged();
645  }
646 }
647 
649 {
650  aTailPoly[0]=rPos;
651  ImpRecalcTail();
652 }
653 
655 {
656  // TODO: Implementation missing.
657  return 0L;
658 }
659 
660 Point SdrCaptionObj::GetSnapPoint(sal_uInt32 /*i*/) const
661 {
662  // TODO: Implementation missing.
663  return Point(0,0);
664 }
665 
667 {
668  SdrRectObj::Notify(rBC,rHint);
669  ImpRecalcTail();
670 }
671 
673 {
674  return new SdrCaptObjGeoData;
675 }
676 
678 {
680  SdrCaptObjGeoData& rCGeo=static_cast<SdrCaptObjGeoData&>(rGeo);
681  rCGeo.aTailPoly=aTailPoly;
682 }
683 
685 {
687  const SdrCaptObjGeoData& rCGeo=static_cast<const SdrCaptObjGeoData&>(rGeo);
688  aTailPoly=rCGeo.aTailPoly;
689 }
690 
691 SdrObjectUniquePtr SdrCaptionObj::DoConvertToPolyObj(bool bBezier, bool bAddText) const
692 {
693  SdrObjectUniquePtr pRect = SdrRectObj::DoConvertToPolyObj(bBezier, bAddText);
695  SdrObjectUniquePtr pRet;
696  if (pTail && !pRect)
697  pRet = std::move(pTail);
698  else if (pRect && !pTail)
699  pRet = std::move(pRect);
700  else if (pTail && pRect)
701  {
702  if (pTail->GetSubList())
703  {
704  pTail->GetSubList()->NbcInsertObject(pRect.release());
705  pRet = std::move(pTail);
706  }
707  else if (pRect->GetSubList())
708  {
709  pRect->GetSubList()->NbcInsertObject(pTail.release(),0);
710  pRet = std::move(pRect);
711  }
712  else
713  {
715  pGrp->GetSubList()->NbcInsertObject(pRect.release());
716  pGrp->GetSubList()->NbcInsertObject(pTail.release(),0);
717  pRet.reset(pGrp);
718  }
719  }
720  return pRet;
721 }
722 
723 namespace {
724 
725 void handleNegativeScale(basegfx::B2DTuple & scale, double * rotate) {
726  assert(rotate != nullptr);
727 
728  // #i75086# Old DrawingLayer (GeoStat and geometry) does not support holding negative scalings
729  // in X and Y which equal a 180 degree rotation. Recognize it and react accordingly
730  if(basegfx::fTools::less(scale.getX(), 0.0) && basegfx::fTools::less(scale.getY(), 0.0))
731  {
732  scale.setX(fabs(scale.getX()));
733  scale.setY(fabs(scale.getY()));
734  *rotate = fmod(*rotate + F_PI, F_2PI);
735  }
736 }
737 
738 }
739 
740 // #i32599#
741 // Add own implementation for TRSetBaseGeometry to handle TailPos over changes.
743 {
744  // break up matrix
745  basegfx::B2DTuple aScale;
746  basegfx::B2DTuple aTranslate;
747  double fRotate, fShearX;
748  rMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
749 
750  handleNegativeScale(aScale, &fRotate);
751 
752  // if anchor is used, make position relative to it
753  if(getSdrModelFromSdrObject().IsWriter())
754  {
755  if(GetAnchorPos().X() || GetAnchorPos().Y())
756  {
757  aTranslate += basegfx::B2DTuple(GetAnchorPos().X(), GetAnchorPos().Y());
758  }
759  }
760 
761  // build BaseRect
762  Point aPoint(FRound(aTranslate.getX()), FRound(aTranslate.getY()));
763  tools::Rectangle aBaseRect(aPoint, Size(FRound(aScale.getX()), FRound(aScale.getY())));
764 
765  // set BaseRect, but rescue TailPos over this call
766  const Point aTailPoint = GetTailPos();
767  SetSnapRect(aBaseRect);
768  SetTailPos(aTailPoint);
769  ImpRecalcTail();
770 }
771 
772 // geometry access
774 {
775  return aTailPoly.getB2DPolygon();
776 }
777 
778 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void NbcMove(const Size &rSiz) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: svdorect.cxx:473
virtual bool applySpecialDrag(SdrDragStat &rDrag) override
Definition: svdorect.cxx:387
void SetPos(const Point &rPoint)
SdrCaptionType eType
Definition: svdocapt.cxx:75
void setX(double fX)
virtual void RestGeoData(const SdrObjGeoData &rGeo) override
Definition: svdocapt.cxx:684
SdrPageView * GetPageView() const
Definition: svddrag.hxx:88
sal_uInt32 GetPolyNum() const
Definition: svdhdl.hxx:219
virtual ~SdrCaptionObj() override
Definition: svdocapt.cxx:217
long FRound(double fVal)
#define SDRATTR_CAPTIONFIXEDANGLE
Definition: svddef.hxx:182
SdrObjUserCall * pUserCall
Definition: svdobj.hxx:923
virtual OUString getSpecialDragComment(const SdrDragStat &rDrag) const override
Definition: svdorect.cxx:416
std::string GetValue
const Point & GetStart() const
Definition: svddrag.hxx:92
SVX_DLLPRIVATE void ImpGetCaptParams(ImpCaptParams &rPara) const
Definition: svdocapt.cxx:415
void ResizePoly(tools::Polygon &rPoly, const Point &rRef, const Fraction &xFact, const Fraction &yFact)
Definition: svdtrans.cxx:63
bool mbSpecialTextBoxShadow
Definition: svdocapt.hxx:60
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties() override
Definition: svdocapt.cxx:179
periodic cubic Spline (ni)
Definition: svdobj.hxx:133
Point maFixedTailPos
Definition: svdocapt.hxx:63
SdrCaptionObj(SdrModel &rSdrModel)
Definition: svdocapt.cxx:193
void SetTailPos(const Point &rPos)
Definition: svdocapt.cxx:637
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
Definition: svdocapt.cxx:677
virtual void NbcInsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Definition: svdpage.cxx:307
virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix &rMatrix, const basegfx::B2DPolyPolygon &rPolyPolygon) override
Definition: svdocapt.cxx:742
double getX() const
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Detects when a stylesheet is changed.
Definition: svdocapt.cxx:666
virtual const tools::Rectangle & GetLogicRect() const override
Definition: svdocapt.cxx:621
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const override
Definition: svdocapt.cxx:313
virtual Point GetRelativePos() const override
Definition: svdocapt.cxx:616
bool mbFixedTail
Definition: svdocapt.hxx:61
sal_uInt32 GetPointNum() const
Definition: svdhdl.hxx:222
virtual void SetBoundRectDirty()
Definition: svdobj.cxx:336
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd) override
Definition: svdocapt.cxx:559
double getY() const
::basegfx::B2DPolygon getTailPolygon() const
Definition: svdocapt.cxx:773
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
Definition: svdocapt.cxx:298
virtual bool BckCreate(SdrDragStat &rStat) override
Definition: svdocapt.cxx:569
virtual basegfx::B2DPolyPolygon TakeXorPoly() const override
The Xor-Polygon is required by the View to drag the object.
Definition: svdorect.cxx:278
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat &rDrag) const override
Polygon dragged by the user when creating the object.
Definition: svdocapt.cxx:578
All geometrical data of an arbitrary object for use in undo/redo.
Definition: svdobj.hxx:226
SdrCaptionEscDir
Definition: sxcecitm.hxx:28
virtual Point GetSnapPoint(sal_uInt32 i) const override
Definition: svdocapt.cxx:660
virtual void NbcSetRelativePos(const Point &rPnt) override
The relative position of a SdrObject is the distance of the upper left corner of the logic bounding r...
Definition: svdocapt.cxx:609
void SetOrtho8Possible(bool bOn=true)
Definition: svddrag.hxx:129
bool bFitLineLen
Definition: svdocapt.cxx:81
void Move(long nHorzMoveDelta, long nVertMoveDelta)
bool bSnapRectDirty
Definition: svdobj.hxx:928
Rectangle objects (rectangle, circle, ...)
Definition: svdorect.hxx:39
bool IsEmpty() const
Provides information about various ZObject properties.
Definition: svdobj.hxx:248
const SdrHdl * GetHdl() const
Definition: svddrag.hxx:101
static SVX_DLLPRIVATE void ImpCalcTail1(const ImpCaptParams &rPara, tools::Polygon &rPoly, tools::Rectangle const &rRect)
Definition: svdocapt.cxx:448
long Right() const
#define SDRATTR_CAPTIONESCABS
Definition: svddef.hxx:188
connector object
Definition: svdobj.hxx:139
virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override
Definition: svdocapt.cxx:691
void CalcEscPos(const Point &rTail, const tools::Rectangle &rRect, Point &rPt, EscDir &rDir) const
Definition: svdocapt.cxx:96
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const override
Definition: svdorect.cxx:373
OUString SvxResId(const char *pId)
Definition: dialmgr.cxx:28
SdrCaptionObj & operator=(const SdrCaptionObj &rObj)
Definition: svdocapt.cxx:248
#define X
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
Definition: svdotext.cxx:1440
virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override
Definition: svdorect.cxx:555
#define SDRATTR_CAPTIONESCISREL
Definition: svddef.hxx:186
const SfxItemSet & GetObjectItemSet() const
Definition: svdobj.cxx:1906
SdrObject * SdrObjectPrimitiveHit(const SdrObject &rObject, const Point &rPnt, sal_uInt16 nTol, const SdrPageView &rSdrPageView, const SdrLayerIDSet *pVisiLayer, bool bTextOnly, drawinglayer::primitive2d::Primitive2DContainer *pHitContainer)
tools::Rectangle maRect
Definition: svdotext.hxx:182
SdrCaptionType
Definition: sxctitm.hxx:26
virtual SdrObjGeoData * NewGeoData() const override
A derived class must override these 3 methods if it has own geometric data that must be saved for Und...
Definition: svdocapt.cxx:672
long Top() const
static SVX_DLLPRIVATE void ImpCalcTail(const ImpCaptParams &rPara, tools::Polygon &rPoly, tools::Rectangle const &rRect)
Definition: svdocapt.cxx:524
#define SDRATTR_CAPTIONTYPE
Definition: svddef.hxx:181
#define SDRATTR_CAPTIONGAP
Definition: svddef.hxx:184
static SVX_DLLPRIVATE void ImpCalcTail3(const ImpCaptParams &rPara, tools::Polygon &rPoly, tools::Rectangle const &rRect)
Definition: svdocapt.cxx:491
virtual sal_uInt16 GetObjIdentifier() const override
Definition: svdocapt.cxx:238
tools::Polygon aTailPoly
Definition: svdocapt.hxx:38
#define SDRATTR_CAPTIONLINELEN
Definition: svddef.hxx:189
virtual OUString getSpecialDragComment(const SdrDragStat &rDrag) const override
Definition: svdocapt.cxx:384
static bool less(const double &rfValA, const double &rfValB)
void SetNoSnap(bool bOn=true)
Definition: svddrag.hxx:121
void SetEndDragChangesGeoAndAttributes(bool bOn)
Definition: svddrag.hxx:135
SVX_DLLPRIVATE void ImpRecalcTail()
Definition: svdocapt.cxx:429
OUString sName
bool decompose(B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
SdrObject * GetCreateObj() const
Definition: svdcrtv.hxx:119
virtual bool applySpecialDrag(SdrDragStat &rDrag) override
Definition: svdocapt.cxx:352
class SdrCaptionGapItem Distance of the line start from the Rect
Definition: sxcgitm.hxx:29
virtual sal_uInt32 GetHdlCount() const override
Via GetHdlCount the number of Handles can be retrieved.
Definition: svdorect.cxx:307
SdrPathObjUniquePtr ImpConvertMakeObj(const basegfx::B2DPolyPolygon &rPolyPolygon, bool bClosed, bool bBezier) const
Definition: svdotxtr.cxx:433
virtual SdrCaptionObj * CloneSdrObject(SdrModel &rTargetModel) const override
Definition: svdocapt.cxx:243
#define SDRATTR_CAPTIONESCDIR
Definition: svddef.hxx:185
virtual sal_uInt32 GetHdlCount() const override
Via GetHdlCount the number of Handles can be retrieved.
Definition: svdocapt.cxx:291
void BroadcastObjectChange() const
Definition: svdobj.cxx:932
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
sal_Int32 GetPointCount() const
Definition: svddrag.hxx:91
void ActionChanged() const
Definition: svdobj.cxx:283
SdrView * GetView() const
Definition: svddrag.hxx:86
void SetXPolyDirty()
Definition: svdorect.cxx:106
long Bottom() const
SdrModel & getSdrModelFromSdrObject() const
Definition: svdobj.cxx:299
sal_uInt16 GetSize() const
virtual SdrObjList * GetSubList() const override
Definition: svdogrp.cxx:186
void SetEndDragChangesAttributes(bool bOn)
Definition: svddrag.hxx:133
::basegfx::B2DPolygon getB2DPolygon() const
#define SDRATTR_CAPTIONFITLINELEN
Definition: svddef.hxx:190
long X() const
OUString GetName() const
Definition: svdobj.cxx:725
Point aAnchor
Definition: svdobj.hxx:922
#define Y
long BigMulDiv(long nVal, long nMul, long nDiv)
Definition: svdtrans.cxx:558
tools::Polygon aTailPoly
Definition: svdocapt.hxx:59
basegfx::B2DRange b2DRectangleFromRectangle(const ::tools::Rectangle &rRect)
virtual OUString TakeObjNamePlural() const override
Definition: svdocapt.cxx:278
const Point & GetPoint(sal_uInt16 nPos) const
void MovePoly(tools::Polygon &rPoly, const Size &S)
Definition: svdtrans.hxx:51
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
Definition: svdorect.cxx:301
virtual const tools::Rectangle & GetLastBoundRect() const
Definition: svdobj.cxx:895
virtual bool MovCreate(SdrDragStat &rStat) override
Definition: svdocapt.cxx:547
SdrRectObj & operator=(const SdrRectObj &rCopy)
Definition: svdorect.cxx:263
void SetActionRect(const tools::Rectangle &rR)
Definition: svddrag.hxx:157
virtual PointerStyle GetCreatePointer() const override
get the cursor/pointer that signals creating this object
Definition: svdocapt.cxx:587
virtual OUString TakeObjNameSingul() const override
Definition: svdocapt.cxx:262
void setY(double fY)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() override
Definition: svdocapt.cxx:187
#define SDRATTR_CAPTIONESCREL
Definition: svddef.hxx:187
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: svdorect.cxx:479
OUString ImpGetDescriptionStr(const char *pStrCacheID) const
Definition: svdobj.cxx:1065
OUString aName
bool bMovProt
Definition: svdobj.hxx:930
virtual void BrkCreate(SdrDragStat &rStat) override
Definition: svdocapt.cxx:574
virtual void NbcMove(const Size &rSiz) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: svdocapt.cxx:592
std::unique_ptr< SdrObject, SdrObjectFreeOp > SdrObjectUniquePtr
Definition: svdobj.hxx:114
const Point & GetNow() const
Definition: svddrag.hxx:95
long Left() const
PointerStyle
const Point & GetAnchorPos() const
Definition: svdobj.cxx:1615
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const override
Definition: svdocapt.cxx:221
virtual void RestGeoData(const SdrObjGeoData &rGeo) override
Definition: svdorect.cxx:589
virtual void SetRectsDirty(bool bNotMyself=false, bool bRecursive=true)
Definition: svdobj.cxx:462
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
Definition: svdorect.cxx:312
virtual bool hasSpecialDrag() const override
The standard transformations (Move,Resize,Rotate,Mirror,Shear) are taken over by the View (TakeXorPol...
Definition: svdocapt.cxx:308
virtual void SetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1649
EscDir
Definition: svdocapt.cxx:68
bool LineGeometryUsageIsNecessary() const
Definition: svdobj.cxx:989
void NbcSetTailPos(const Point &rPos)
Definition: svdocapt.cxx:648
SdrCreateCmd
Definition: svdtypes.hxx:27
virtual void SetChanged()
Definition: svdobj.cxx:956
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: svdocapt.cxx:600
virtual basegfx::B2DPolyPolygon TakeXorPoly() const override
The Xor-Polygon is required by the View to drag the object.
Definition: svdocapt.cxx:283
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
Definition: svdocapt.cxx:626
void SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle &rBoundRect) const
Definition: svdobj.cxx:2676
SdrCaptionEscDir eEscDir
Definition: svdocapt.cxx:80
static SVX_DLLPRIVATE void ImpCalcTail2(const ImpCaptParams &rPara, tools::Polygon &rPoly, tools::Rectangle const &rRect)
Definition: svdocapt.cxx:474
void AddHdl(std::unique_ptr< SdrHdl > pHdl)
Definition: svdhdl.cxx:2299
long Y() const
const Point & GetFixedTailPos() const
Definition: svdocapt.hxx:150
const Point & GetTailPos() const
Definition: svdocapt.cxx:632
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Detects when a stylesheet is changed.
Definition: svdorect.cxx:583
virtual sal_uInt32 GetSnapPointCount() const override
snap to special points of an Object (polygon points, center of circle)
Definition: svdocapt.cxx:654
virtual bool BegCreate(SdrDragStat &rStat) override
Every object must be able to create itself interactively.
Definition: svdocapt.cxx:534
bool bFixedAngle
Definition: svdocapt.cxx:83