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