LibreOffice Module svx (master) 1
svdotext.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 <comphelper/string.hxx>
22#include <svl/stritem.hxx>
23#include <svx/svdotext.hxx>
24#include <svx/svdpage.hxx>
25#include <svx/svdoutl.hxx>
26#include <svx/svdmodel.hxx>
27#include <svx/dialmgr.hxx>
28#include <svx/strings.hrc>
30#include <svx/sdtfchim.hxx>
31#include <editeng/editdata.hxx>
32#include <editeng/editstat.hxx>
33#include <editeng/outlobj.hxx>
34#include <editeng/editobj.hxx>
35#include <editeng/outliner.hxx>
36#include <textchain.hxx>
37#include <textchainflow.hxx>
38#include <tools/helpers.hxx>
39#include <svx/sderitm.hxx>
40#include <svx/sdooitm.hxx>
41#include <svx/sdshitm.hxx>
42#include <svx/sdtagitm.hxx>
43#include <svx/sdtfsitm.hxx>
44#include <svx/sdtmfitm.hxx>
45#include <svx/xtextit0.hxx>
50#include <vcl/gdimtf.hxx>
51#include <vcl/virdev.hxx>
53#include <sal/log.hxx>
54#include <o3tl/temporary.hxx>
56
57using namespace com::sun::star;
58
59// BaseProperties section
60std::unique_ptr<sdr::properties::BaseProperties> SdrTextObj::CreateObjectSpecificProperties()
61{
62 return std::make_unique<sdr::properties::TextProperties>(*this);
63}
64
65// DrawContact section
66std::unique_ptr<sdr::contact::ViewContact> SdrTextObj::CreateObjectSpecificViewContact()
67{
68 return std::make_unique<sdr::contact::ViewContactOfTextObj>(*this);
69}
70
72 : SdrAttrObj(rSdrModel)
73 , mpEditingOutliner(nullptr)
74 , meTextKind(SdrObjKind::Text)
75 , maTextEditOffset(Point(0, 0))
76 , mbTextFrame(false)
77 , mbNoShear(false)
78 , mbTextSizeDirty(false)
79 , mbInEditMode(false)
80 , mbDisableAutoWidthOnDragging(false)
81 , mbTextAnimationAllowed(true)
82 , mbInDownScale(false)
83{
84 // #i25616#
86}
87
88SdrTextObj::SdrTextObj(SdrModel& rSdrModel, SdrTextObj const & rSource)
89 : SdrAttrObj(rSdrModel, rSource)
90 , mpEditingOutliner(nullptr)
91 , meTextKind(rSource.meTextKind)
92 , maTextEditOffset(Point(0, 0))
93 , mbTextFrame(rSource.mbTextFrame)
94 , mbNoShear(rSource.mbNoShear)
95 , mbTextSizeDirty(rSource.mbTextSizeDirty)
96 , mbInEditMode(false)
97 , mbDisableAutoWidthOnDragging(rSource.mbDisableAutoWidthOnDragging)
98 , mbTextAnimationAllowed(true)
99 , mbInDownScale(false)
100{
101 // #i25616#
103
104 maRectangle = rSource.maRectangle;
105 maGeo = rSource.maGeo;
106 maTextSize = rSource.maTextSize;
107
108 // Not all of the necessary parameters were copied yet.
109 SdrText* pText = getActiveText();
110
111 if( pText && rSource.HasText() )
112 {
113 // before pNewOutlinerParaObject was created the same, but
114 // set at mpText (outside this scope), but mpText might be
115 // empty (this operator== seems not prepared for MultiText
116 // objects). In the current form it makes only sense to
117 // create locally and use locally on a known existing SdrText
118 const Outliner* pEO = rSource.mpEditingOutliner;
119 std::optional<OutlinerParaObject> pNewOutlinerParaObject;
120
121 if (pEO!=nullptr)
122 {
123 pNewOutlinerParaObject = pEO->CreateParaObject();
124 }
125 else if (nullptr != rSource.getActiveText()->GetOutlinerParaObject())
126 {
127 pNewOutlinerParaObject = *rSource.getActiveText()->GetOutlinerParaObject();
128 }
129
130 pText->SetOutlinerParaObject( std::move(pNewOutlinerParaObject) );
131 }
132
134}
135
137 : SdrAttrObj(rSdrModel)
138 , mpEditingOutliner(nullptr)
139 , meTextKind(SdrObjKind::Text)
140 , maTextEditOffset(Point(0, 0))
141 , mbTextFrame(false)
142 , mbNoShear(false)
143 , mbTextSizeDirty(false)
144 , mbInEditMode(false)
145 , mbDisableAutoWidthOnDragging(false)
146 , mbTextAnimationAllowed(true)
147 , mbInDownScale(false)
148{
149 tools::Rectangle aRectangle(rNewRect);
150 ImpJustifyRect(aRectangle);
151 setRectangle(aRectangle);
152
153 // #i25616#
155}
156
158 : SdrAttrObj(rSdrModel)
159 , mpEditingOutliner(nullptr)
160 , meTextKind(eNewTextKind)
161 , maTextEditOffset(Point(0, 0))
162 , mbTextFrame(true)
163 , mbNoShear(true)
164 , mbTextSizeDirty(false)
165 , mbInEditMode(false)
166 , mbDisableAutoWidthOnDragging(false)
167 , mbTextAnimationAllowed(true)
168 , mbInDownScale(false)
169{
170 // #i25616#
172}
173
175 const tools::Rectangle& rNewRect)
176 : SdrAttrObj(rSdrModel)
177 , mpEditingOutliner(nullptr)
178 , meTextKind(eNewTextKind)
179 , maTextEditOffset(Point(0, 0))
180 , mbTextFrame(true)
181 , mbNoShear(true)
182 , mbTextSizeDirty(false)
183 , mbInEditMode(false)
184 , mbDisableAutoWidthOnDragging(false)
185 , mbTextAnimationAllowed(true)
186 , mbInDownScale(false)
187{
188 tools::Rectangle aRectangle(rNewRect);
189 ImpJustifyRect(aRectangle);
190 setRectangle(aRectangle);
191
192 // #i25616#
194}
195
197{
198 mxText.clear();
200}
201
203{
205
206 SdrText* pText = getActiveText();
207 if(pText==nullptr || !pText->GetOutlinerParaObject())
208 return;
209
210 SdrOutliner& rOutliner=ImpGetDrawOutliner();
212 rOutliner.SetUpdateLayout(true);
213 rOutliner.SetText(*pText->GetOutlinerParaObject());
214 Size aNewSize(rOutliner.CalcTextSize());
215 rOutliner.Clear();
216 aNewSize.AdjustWidth( 1 ); // because of possible rounding errors
219 tools::Rectangle aNewRect(getRectangle());
220 aNewRect.SetSize(aNewSize);
221 ImpJustifyRect(aNewRect);
222
223 if (aNewRect != getRectangle())
224 SetLogicRect(aNewRect);
225}
226
227void SdrTextObj::NbcSetText(const OUString& rStr)
228{
229 SdrOutliner& rOutliner=ImpGetDrawOutliner();
230 rOutliner.SetStyleSheet( 0, GetStyleSheet());
231 rOutliner.SetText(rStr,rOutliner.GetParagraph( 0 ));
233 NbcSetOutlinerParaObject(std::move(pNewText));
234 mbTextSizeDirty=true;
235}
236
237void SdrTextObj::SetText(const OUString& rStr)
238{
239 tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
240 NbcSetText(rStr);
241 SetChanged();
244}
245
246void SdrTextObj::NbcSetText(SvStream& rInput, const OUString& rBaseURL, EETextFormat eFormat)
247{
248 SdrOutliner& rOutliner=ImpGetDrawOutliner();
249 rOutliner.SetStyleSheet( 0, GetStyleSheet());
250 rOutliner.Read(rInput,rBaseURL,eFormat);
252 rOutliner.SetUpdateLayout(true);
253 Size aSize(rOutliner.CalcTextSize());
254 rOutliner.Clear();
255 NbcSetOutlinerParaObject(std::move(pNewText));
256 maTextSize=aSize;
257 mbTextSizeDirty=false;
258}
259
260void SdrTextObj::SetText(SvStream& rInput, const OUString& rBaseURL, EETextFormat eFormat)
261{
262 tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
263 NbcSetText(rInput,rBaseURL,eFormat);
264 SetChanged();
267}
268
270{
271 if (mbTextSizeDirty)
272 {
273 Size aSiz;
274 SdrText* pText = getActiveText();
275 if( pText && pText->GetOutlinerParaObject ())
276 {
277 SdrOutliner& rOutliner=ImpGetDrawOutliner();
278 rOutliner.SetText(*pText->GetOutlinerParaObject());
279 rOutliner.SetUpdateLayout(true);
280 aSiz=rOutliner.CalcTextSize();
281 rOutliner.Clear();
282 }
283 // casting to nonconst twice
284 const_cast<SdrTextObj*>(this)->maTextSize = aSiz;
285 const_cast<SdrTextObj*>(this)->mbTextSizeDirty = false;
286 }
287 return maTextSize;
288}
289
291{
292 if(!mbTextFrame)
293 return false; // AutoGrow only together with TextFrames
294
296 bool bRet = rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT).GetValue();
297
298 if(bRet)
299 {
300 SdrTextAniKind eAniKind = rSet.Get(SDRATTR_TEXT_ANIKIND).GetValue();
301
302 if(eAniKind == SdrTextAniKind::Scroll || eAniKind == SdrTextAniKind::Alternate || eAniKind == SdrTextAniKind::Slide)
303 {
304 SdrTextAniDirection eDirection = rSet.Get(SDRATTR_TEXT_ANIDIRECTION).GetValue();
305
306 if(eDirection == SdrTextAniDirection::Up || eDirection == SdrTextAniDirection::Down)
307 {
308 bRet = false;
309 }
310 }
311 }
312 return bRet;
313}
314
316{
317 if (!mbTextFrame)
318 return false; // AutoGrow only together with TextFrames
319
321 bool bRet = rSet.Get(SDRATTR_TEXT_AUTOGROWWIDTH).GetValue();
322
323 bool bInEditMOde = IsInEditMode();
324
325 if(!bInEditMOde && bRet)
326 {
327 SdrTextAniKind eAniKind = rSet.Get(SDRATTR_TEXT_ANIKIND).GetValue();
328
329 if(eAniKind == SdrTextAniKind::Scroll || eAniKind == SdrTextAniKind::Alternate || eAniKind == SdrTextAniKind::Slide)
330 {
331 SdrTextAniDirection eDirection = rSet.Get(SDRATTR_TEXT_ANIDIRECTION).GetValue();
332
333 if(eDirection == SdrTextAniDirection::Left || eDirection == SdrTextAniDirection::Right)
334 {
335 bRet = false;
336 }
337 }
338 }
339 return bRet;
340}
341
343{
345}
346
348{
351
353
354 bool bInEditMode = IsInEditMode();
355
356 if(!bInEditMode && eRet == SDRTEXTHORZADJUST_BLOCK)
357 {
358 SdrTextAniKind eAniKind = rSet.Get(SDRATTR_TEXT_ANIKIND).GetValue();
359
360 if(eAniKind == SdrTextAniKind::Scroll || eAniKind == SdrTextAniKind::Alternate || eAniKind == SdrTextAniKind::Slide)
361 {
362 SdrTextAniDirection eDirection = rSet.Get(SDRATTR_TEXT_ANIDIRECTION).GetValue();
363
364 if(eDirection == SdrTextAniDirection::Left || eDirection == SdrTextAniDirection::Right)
365 {
367 }
368 }
369 }
370
371 return eRet;
372} // defaults: BLOCK (justify) for text frame, CENTER for captions of drawing objects
373
375{
377}
378
380{
383
384 // Take care for vertical text animation here
386 bool bInEditMode = IsInEditMode();
387
388 // Take care for vertical text animation here
389 if(!bInEditMode && eRet == SDRTEXTVERTADJUST_BLOCK)
390 {
391 SdrTextAniKind eAniKind = rSet.Get(SDRATTR_TEXT_ANIKIND).GetValue();
392
393 if(eAniKind == SdrTextAniKind::Scroll || eAniKind == SdrTextAniKind::Alternate || eAniKind == SdrTextAniKind::Slide)
394 {
395 SdrTextAniDirection eDirection = rSet.Get(SDRATTR_TEXT_ANIDIRECTION).GetValue();
396
397 if(eDirection == SdrTextAniDirection::Left || eDirection == SdrTextAniDirection::Right)
398 {
400 }
401 }
402 }
403
404 return eRet;
405} // defaults: TOP for text frame, CENTER for captions of drawing objects
406
408{
409 if (!rRect.IsEmpty()) {
410 rRect.Normalize();
411 if (rRect.Left()==rRect.Right()) rRect.AdjustRight( 1 );
412 if (rRect.Top()==rRect.Bottom()) rRect.AdjustBottom( 1 );
413 }
414}
415
417{
419 {
420 maGeo.nShearAngle = 0_deg100;
422 }
423}
424
426{
427 bool bNoTextFrame=!IsTextFrame();
428 rInfo.bResizeFreeAllowed=bNoTextFrame || ((maGeo.nRotationAngle.get() % 9000) == 0);
429 rInfo.bResizePropAllowed=true;
430 rInfo.bRotateFreeAllowed=true;
431 rInfo.bRotate90Allowed =true;
432 rInfo.bMirrorFreeAllowed=bNoTextFrame;
433 rInfo.bMirror45Allowed =bNoTextFrame;
434 rInfo.bMirror90Allowed =bNoTextFrame;
435
436 // allow transparency
437 rInfo.bTransparenceAllowed = true;
438
439 rInfo.bShearAllowed =bNoTextFrame;
440 rInfo.bEdgeRadiusAllowed=true;
441 bool bCanConv=ImpCanConvTextToCurve();
442 rInfo.bCanConvToPath =bCanConv;
443 rInfo.bCanConvToPoly =bCanConv;
444 rInfo.bCanConvToPathLineToArea=bCanConv;
445 rInfo.bCanConvToPolyLineToArea=bCanConv;
447}
448
450{
451 return meTextKind;
452}
453
454bool SdrTextObj::HasTextImpl( SdrOutliner const * pOutliner )
455{
456 bool bRet=false;
457 if(pOutliner)
458 {
459 Paragraph* p1stPara=pOutliner->GetParagraph( 0 );
460 sal_Int32 nParaCount=pOutliner->GetParagraphCount();
461 if(p1stPara==nullptr)
462 nParaCount=0;
463
464 if(nParaCount==1)
465 {
466 // if it is only one paragraph, check if that paragraph is empty
467 if( pOutliner->GetText(p1stPara).isEmpty() )
468 nParaCount = 0;
469 }
470
471 bRet= nParaCount!=0;
472 }
473 return bRet;
474}
475
477{
478 const bool bRemove(pNewPage == nullptr && pOldPage != nullptr);
479 const bool bInsert(pNewPage != nullptr && pOldPage == nullptr);
480 const bool bLinked(IsLinkedText());
481
482 if (bLinked && bRemove)
483 {
485 }
486
487 // call parent
488 SdrAttrObj::handlePageChange(pOldPage, pNewPage);
489
490 if (bLinked && bInsert)
491 {
493 }
494}
495
497{
499}
500
501// #115391# This implementation is based on the object size (aRect) and the
502// states of IsAutoGrowWidth/Height to correctly set TextMinFrameWidth/Height
504{
505 if (!mbTextFrame)
506 // Only do this for text frame.
507 return;
508
509 if (getSdrModelFromSdrObject().IsPasteResize())
510 // Don't do this during paste resize.
511 return;
512
513 const bool bW = IsAutoGrowWidth();
514 const bool bH = IsAutoGrowHeight();
515
516 if (!bW && !bH)
517 // No auto grow requested. Bail out.
518 return;
519
521 SDRATTR_TEXT_MINFRAMEWIDTH, SDRATTR_TEXT_AUTOGROWWIDTH> // contains SDRATTR_TEXT_MAXFRAMEWIDTH
522 aSet(*GetObjectItemSet().GetPool());
523
524 if(bW)
525 {
526 // Set minimum width.
528 const tools::Long nW = std::max<tools::Long>(0, getRectangle().GetWidth() - 1 - nDist); // text width without margins
529
530 aSet.Put(makeSdrTextMinFrameWidthItem(nW));
531
533 {
535 aSet.Put(makeSdrTextAutoGrowWidthItem(false));
536 }
537 }
538
539 if(bH)
540 {
541 // Set Minimum height.
543 const tools::Long nH = std::max<tools::Long>(0, getRectangle().GetHeight() - 1 - nDist); // text height without margins
544
545 aSet.Put(makeSdrTextMinFrameHeightItem(nH));
546
548 {
550 aSet.Put(makeSdrTextAutoGrowHeightItem(false));
551 }
552 }
553
554 SetObjectItemSet(aSet);
555}
556
557void SdrTextObj::ImpSetContourPolygon( SdrOutliner& rOutliner, tools::Rectangle const & rAnchorRect, bool bLineWidth ) const
558{
559 basegfx::B2DPolyPolygon aXorPolyPolygon(TakeXorPoly());
560 std::optional<basegfx::B2DPolyPolygon> pContourPolyPolygon;
562 -rAnchorRect.Left(), -rAnchorRect.Top()));
563
565 {
566 // Unrotate!
568 }
569
570 aXorPolyPolygon.transform(aMatrix);
571
572 if( bLineWidth )
573 {
574 // Take line width into account.
575 // When doing the hit test, avoid this. (Performance!)
576 pContourPolyPolygon.emplace();
577
578 // test if shadow needs to be avoided for TakeContour()
580 bool bShadowOn = rSet.Get(SDRATTR_SHADOW).GetValue();
581
582 // #i33696#
583 // Remember TextObject currently set at the DrawOutliner, it WILL be
584 // replaced during calculating the outline since it uses an own paint
585 // and that one uses the DrawOutliner, too.
586 const SdrTextObj* pLastTextObject = rOutliner.GetTextObj();
587
588 if(bShadowOn)
589 {
590 // force shadow off
592 pCopy->SetMergedItem(makeSdrShadowItem(false));
593 *pContourPolyPolygon = pCopy->TakeContour();
594 }
595 else
596 {
597 *pContourPolyPolygon = TakeContour();
598 }
599
600 // #i33696#
601 // restore remembered text object
602 if(pLastTextObject != rOutliner.GetTextObj())
603 {
604 rOutliner.SetTextObj(pLastTextObject);
605 }
606
607 pContourPolyPolygon->transform(aMatrix);
608 }
609
610 rOutliner.SetPolygon(aXorPolyPolygon, pContourPolyPolygon ? &*pContourPolyPolygon : nullptr);
611}
612
614{
615 rRect = getRectangle();
616}
617
618// See also: <unnamed>::getTextAnchorRange in svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
620{
621 const tools::Long nLeftDist = GetTextLeftDistance();
622 const tools::Long nRightDist = GetTextRightDistance();
623 const tools::Long nUpperDist = GetTextUpperDistance();
624 const tools::Long nLowerDist = GetTextLowerDistance();
625 if (!IsVerticalWriting())
626 {
627 rAnchorRect.AdjustLeft(nLeftDist);
628 rAnchorRect.AdjustTop(nUpperDist);
629 rAnchorRect.AdjustRight(-nRightDist);
630 rAnchorRect.AdjustBottom(-nLowerDist);
631 }
632 else if (IsTopToBottom())
633 {
634 rAnchorRect.AdjustLeft(nLowerDist);
635 rAnchorRect.AdjustTop(nLeftDist);
636 rAnchorRect.AdjustRight(-nUpperDist);
637 rAnchorRect.AdjustBottom(-nRightDist);
638 }
639 else
640 {
641 rAnchorRect.AdjustLeft(nUpperDist);
642 rAnchorRect.AdjustTop(nRightDist);
643 rAnchorRect.AdjustRight(-nLowerDist);
644 rAnchorRect.AdjustBottom(-nLeftDist);
645 }
646
647 // Since sizes may be bigger than the object bounds it is necessary to
648 // justify the rect now.
649 ImpJustifyRect(rAnchorRect);
650}
651
653{
654 tools::Rectangle aAnkRect(getRectangle()); // the rectangle in which we anchor
655 bool bFrame=IsTextFrame();
656 if (!bFrame) {
657 TakeUnrotatedSnapRect(aAnkRect);
658 }
659 Point aRotateRef(aAnkRect.TopLeft());
660 AdjustRectToTextDistance(aAnkRect);
661
662 if (bFrame) {
663 // TODO: Optimize this.
664 if (aAnkRect.GetWidth()<2) aAnkRect.SetRight(aAnkRect.Left()+1 ); // minimum size h and v: 2 px
665 if (aAnkRect.GetHeight()<2) aAnkRect.SetBottom(aAnkRect.Top()+1 );
666 }
667 if (maGeo.nRotationAngle) {
668 Point aTmpPt(aAnkRect.TopLeft());
670 aTmpPt-=aAnkRect.TopLeft();
671 aAnkRect.Move(aTmpPt.X(),aTmpPt.Y());
672 }
673 rAnchorRect=aAnkRect;
674}
675
676void SdrTextObj::TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& rTextRect, bool bNoEditText,
677 tools::Rectangle* pAnchorRect, bool bLineWidth ) const
678{
679 tools::Rectangle aAnkRect; // the rectangle in which we anchor
680 TakeTextAnchorRect(aAnkRect);
685
686 bool bFitToSize(IsFitToSize());
687 bool bContourFrame=IsContourTextFrame();
688
689 bool bFrame=IsTextFrame();
690 EEControlBits nStat0=rOutliner.GetControlWord();
691 Size aNullSize;
692 if (!bContourFrame)
693 {
694 rOutliner.SetControlWord(nStat0|EEControlBits::AUTOPAGESIZE);
695 rOutliner.SetMinAutoPaperSize(aNullSize);
696 rOutliner.SetMaxAutoPaperSize(Size(1000000,1000000));
697 }
698
699 if (!bFitToSize && !bContourFrame)
700 {
701 tools::Long nAnkWdt=aAnkRect.GetWidth();
702 tools::Long nAnkHgt=aAnkRect.GetHeight();
703 if (bFrame)
704 {
705 tools::Long nWdt=nAnkWdt;
706 tools::Long nHgt=nAnkHgt;
707
708 bool bInEditMode = IsInEditMode();
709
710 if (!bInEditMode && (eAniKind==SdrTextAniKind::Scroll || eAniKind==SdrTextAniKind::Alternate || eAniKind==SdrTextAniKind::Slide))
711 {
712 // unlimited paper size for ticker text
713 if (eAniDirection==SdrTextAniDirection::Left || eAniDirection==SdrTextAniDirection::Right) nWdt=1000000;
714 if (eAniDirection==SdrTextAniDirection::Up || eAniDirection==SdrTextAniDirection::Down) nHgt=1000000;
715 }
716
717 bool bChainedFrame = IsChainable();
718 // Might be required for overflow check working: do limit height to frame if box is chainable.
719 if (!bChainedFrame) {
720 // #i119885# Do not limit/force height to geometrical frame (vice versa for vertical writing)
721
723 {
724 nWdt = 1000000;
725 }
726 else
727 {
728 nHgt = 1000000;
729 }
730 }
731
732 rOutliner.SetMaxAutoPaperSize(Size(nWdt,nHgt));
733 }
734
735 // New try with _BLOCK for hor and ver after completely
736 // supporting full width for vertical text.
738 {
739 rOutliner.SetMinAutoPaperSize(Size(nAnkWdt, 0));
740 rOutliner.SetMinColumnWrapHeight(nAnkHgt);
741 }
742
744 {
745 rOutliner.SetMinAutoPaperSize(Size(0, nAnkHgt));
746 rOutliner.SetMinColumnWrapHeight(nAnkWdt);
747 }
748 }
749
750 rOutliner.SetPaperSize(aNullSize);
751 if (bContourFrame)
752 ImpSetContourPolygon( rOutliner, aAnkRect, bLineWidth );
753
754 // put text into the outliner, if available from the edit outliner
755 SdrText* pText = getActiveText();
756 OutlinerParaObject* pOutlinerParaObject = pText ? pText->GetOutlinerParaObject() : nullptr;
758 if (mpEditingOutliner && !bNoEditText)
760 else if (pOutlinerParaObject)
761 pPara = *pOutlinerParaObject;
762
763 if (pPara)
764 {
765 const bool bHitTest(&getSdrModelFromSdrObject().GetHitTestOutliner() == &rOutliner);
766 const SdrTextObj* pTestObj = rOutliner.GetTextObj();
767
768 if( !pTestObj || !bHitTest || pTestObj != this ||
769 pTestObj->GetOutlinerParaObject() != pOutlinerParaObject )
770 {
771 if( bHitTest ) // #i33696# take back fix #i27510#
772 {
773 rOutliner.SetTextObj( this );
775 }
776
777 rOutliner.SetUpdateLayout(true);
778 rOutliner.SetText(*pPara);
779 }
780 }
781 else
782 {
783 rOutliner.SetTextObj( nullptr );
784 }
785
786 rOutliner.SetUpdateLayout(true);
787 rOutliner.SetControlWord(nStat0);
788
789 if( pText )
790 pText->CheckPortionInfo(rOutliner);
791
792 Point aTextPos(aAnkRect.TopLeft());
793 Size aTextSiz(rOutliner.GetPaperSize()); // GetPaperSize() adds a little tolerance, right?
794
795 // For draw objects containing text correct hor/ver alignment if text is bigger
796 // than the object itself. Without that correction, the text would always be
797 // formatted to the left edge (or top edge when vertical) of the draw object.
798 if(!IsTextFrame())
799 {
800 if(aAnkRect.GetWidth() < aTextSiz.Width() && !IsVerticalWriting())
801 {
802 // Horizontal case here. Correct only if eHAdj == SDRTEXTHORZADJUST_BLOCK,
803 // else the alignment is wanted.
804 if(SDRTEXTHORZADJUST_BLOCK == eHAdj)
805 {
807 }
808 }
809
810 if(aAnkRect.GetHeight() < aTextSiz.Height() && IsVerticalWriting())
811 {
812 // Vertical case here. Correct only if eHAdj == SDRTEXTVERTADJUST_BLOCK,
813 // else the alignment is wanted.
814 if(SDRTEXTVERTADJUST_BLOCK == eVAdj)
815 {
817 }
818 }
819 }
820
822 {
823 tools::Long nFreeWdt=aAnkRect.GetWidth()-aTextSiz.Width();
824 if (eHAdj==SDRTEXTHORZADJUST_CENTER)
825 aTextPos.AdjustX(nFreeWdt/2 );
826 if (eHAdj==SDRTEXTHORZADJUST_RIGHT)
827 aTextPos.AdjustX(nFreeWdt );
828 }
830 {
831 tools::Long nFreeHgt=aAnkRect.GetHeight()-aTextSiz.Height();
832 if (eVAdj==SDRTEXTVERTADJUST_CENTER)
833 aTextPos.AdjustY(nFreeHgt/2 );
834 if (eVAdj==SDRTEXTVERTADJUST_BOTTOM)
835 aTextPos.AdjustY(nFreeHgt );
836 }
839
840 if (pAnchorRect)
841 *pAnchorRect=aAnkRect;
842
843 // rTextRect might not be correct in some cases at ContourFrame
844 rTextRect=tools::Rectangle(aTextPos,aTextSiz);
845 if (bContourFrame)
846 rTextRect=aAnkRect;
847}
848
850{
852 {
854 }
855 return false;
856}
857
859{
862 {
863 sal_Int32 nParaCount = mpEditingOutliner->GetParagraphCount();
864 pPara = mpEditingOutliner->CreateParaObject(0, nParaCount);
865 }
866 return pPara;
867}
868
869void SdrTextObj::ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextSize, const Size& rShapeSize, Fraction& rFitXCorrection)
870{
871 OutputDevice* pOut = rOutliner.GetRefDevice();
872 bool bNoStretching(false);
873
874 if(pOut && pOut->GetOutDevType() == OUTDEV_PRINTER)
875 {
876 // check whether CharStretching is possible at all
877 GDIMetaFile* pMtf = pOut->GetConnectMetaFile();
878 OUString aTestString(u'J');
879
880 if(pMtf && (!pMtf->IsRecord() || pMtf->IsPause()))
881 pMtf = nullptr;
882
883 if(pMtf)
884 pMtf->Pause(true);
885
886 vcl::Font aOriginalFont(pOut->GetFont());
887 vcl::Font aTmpFont( OutputDevice::GetDefaultFont( DefaultFontType::SERIF, LANGUAGE_SYSTEM, GetDefaultFontFlags::OnlyOne ) );
888
889 aTmpFont.SetFontSize(Size(0,100));
890 pOut->SetFont(aTmpFont);
891 Size aSize1(pOut->GetTextWidth(aTestString), pOut->GetTextHeight());
892 aTmpFont.SetFontSize(Size(800,100));
893 pOut->SetFont(aTmpFont);
894 Size aSize2(pOut->GetTextWidth(aTestString), pOut->GetTextHeight());
895 pOut->SetFont(aOriginalFont);
896
897 if(pMtf)
898 pMtf->Pause(false);
899
900 bNoStretching = (aSize1 == aSize2);
901
902#ifdef _WIN32
903 // Windows zooms the font proportionally when using Size(100,500),
904 // we don't like that.
905 if(aSize2.Height() >= aSize1.Height() * 2)
906 {
907 bNoStretching = true;
908 }
909#endif
910 }
911 unsigned nLoopCount=0;
912 bool bNoMoreLoop = false;
913 tools::Long nXDiff0=0x7FFFFFFF;
914 tools::Long nWantWdt=rShapeSize.Width();
915 tools::Long nIsWdt=rTextSize.Width();
916 if (nIsWdt==0) nIsWdt=1;
917
918 tools::Long nWantHgt=rShapeSize.Height();
919 tools::Long nIsHgt=rTextSize.Height();
920 if (nIsHgt==0) nIsHgt=1;
921
922 tools::Long nXTolPl=nWantWdt/100; // tolerance: +1%
923 tools::Long nXTolMi=nWantWdt/25; // tolerance: -4%
924 tools::Long nXCorr =nWantWdt/20; // correction scale: 5%
925
926 double nX = (nWantWdt * 100.0) / double(nIsWdt); // calculate X stretching
927 double nY = (nWantHgt * 100.0) / double(nIsHgt); // calculate Y stretching
928 bool bChkX = true;
929 if (bNoStretching)
930 { // might only be possible proportionally
931 if (nX > nY)
932 {
933 nX = nY;
934 bChkX = false;
935 }
936 else
937 {
938 nY = nX;
939 }
940 }
941
942 while (nLoopCount<5 && !bNoMoreLoop)
943 {
944 if (nX < 0.0)
945 nX = -nX;
946 if (nX < 1.0)
947 {
948 nX = 1.0;
949 bNoMoreLoop = true;
950 }
951 if (nX > 65535.0)
952 {
953 nX = 65535.0;
954 bNoMoreLoop = true;
955 }
956
957 if (nY < 0.0)
958 {
959 nY = -nY;
960 }
961 if (nY < 1.0)
962 {
963 nY = 1.0;
964 bNoMoreLoop = true;
965 }
966 if (nY > 65535.0)
967 {
968 nY = 65535.0;
969 bNoMoreLoop = true;
970 }
971
972 // exception, there is no text yet (horizontal case)
973 if (nIsWdt <= 1)
974 {
975 nX = nY;
976 bNoMoreLoop = true;
977 }
978
979 // exception, there is no text yet (vertical case)
980 if (nIsHgt <= 1)
981 {
982 nY = nX;
983 bNoMoreLoop = true;
984 }
985 rOutliner.SetGlobalCharStretching(nX, nY);
986 nLoopCount++;
987 Size aSiz(rOutliner.CalcTextSize());
988 tools::Long nXDiff = aSiz.Width() - nWantWdt;
989 rFitXCorrection=Fraction(nWantWdt,aSiz.Width());
990 if (((nXDiff>=nXTolMi || !bChkX) && nXDiff<=nXTolPl) || nXDiff==nXDiff0) {
991 bNoMoreLoop = true;
992 } else {
993 // correct stretching factors
994 tools::Long nMul = nWantWdt;
995 tools::Long nDiv = aSiz.Width();
996 if (std::abs(nXDiff) <= 2 * nXCorr)
997 {
998 if (nMul > nDiv)
999 nDiv += (nMul - nDiv) / 2.0; // but only add half of what we calculated,
1000 else
1001 nMul += (nDiv - nMul) / 2.0;// because the EditEngine calculates wrongly later on
1002 }
1003 nX = nX * double(nMul) / double(nDiv);
1004 if (bNoStretching)
1005 nY = nX;
1006 }
1007 nXDiff0 = nXDiff;
1008 }
1009}
1010
1012{
1013 OUString aStr;
1014
1015 switch(meTextKind)
1016 {
1018 {
1019 aStr = SvxResId(STR_ObjNameSingulOUTLINETEXT);
1020 break;
1021 }
1022
1024 {
1025 aStr = SvxResId(STR_ObjNameSingulTITLETEXT);
1026 break;
1027 }
1028
1029 default:
1030 {
1031 if(IsLinkedText())
1032 aStr = SvxResId(STR_ObjNameSingulTEXTLNK);
1033 else
1034 aStr = SvxResId(STR_ObjNameSingulTEXT);
1035 break;
1036 }
1037 }
1038
1039 OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject();
1040 if(pOutlinerParaObject && meTextKind != SdrObjKind::OutlineText)
1041 {
1042 // shouldn't currently cause any problems at OUTLINETEXT
1043 OUString aStr2(comphelper::string::stripStart(pOutlinerParaObject->GetTextObject().GetText(0), ' '));
1044
1045 // avoid non expanded text portions in object name
1046 // (second condition is new)
1047 if(!aStr2.isEmpty() && aStr2.indexOf(u'\x00FF') == -1)
1048 {
1049 // space between ResStr and content text
1050 aStr += " \'";
1051
1052 if(aStr2.getLength() > 10)
1053 {
1054 aStr2 = OUString::Concat(aStr2.subView(0, 8)) + "...";
1055 }
1056
1057 aStr += aStr2 + "\'";
1058 }
1059 }
1060
1061 OUString sName(aStr);
1062
1063 OUString aName(GetName());
1064 if (!aName.isEmpty())
1065 sName += " '" + aName + "'";
1066
1067 return sName;
1068}
1069
1071{
1072 OUString sName;
1073 switch (meTextKind)
1074 {
1075 case SdrObjKind::OutlineText: sName=SvxResId(STR_ObjNamePluralOUTLINETEXT); break;
1076 case SdrObjKind::TitleText : sName=SvxResId(STR_ObjNamePluralTITLETEXT); break;
1077 default: {
1078 if (IsLinkedText()) {
1079 sName=SvxResId(STR_ObjNamePluralTEXTLNK);
1080 } else {
1081 sName=SvxResId(STR_ObjNamePluralTEXT);
1082 }
1083 } break;
1084 } // switch
1085 return sName;
1086}
1087
1089{
1090 return new SdrTextObj(rTargetModel, *this);
1091}
1092
1094{
1096 if (maGeo.nShearAngle)
1100
1102 aRetval.append(aPol.getB2DPolygon());
1103 return aRetval;
1104}
1105
1107{
1109
1110 // and now add the BoundRect of the text, if necessary
1112 {
1113 // using Clone()-Paint() strategy inside TakeContour() leaves a destroyed
1114 // SdrObject as pointer in DrawOutliner. Set *this again in fetching the outliner
1115 // in every case
1116 SdrOutliner& rOutliner=ImpGetDrawOutliner();
1117
1118 tools::Rectangle aAnchor2;
1120 TakeTextRect(rOutliner,aR,false,&aAnchor2);
1121 rOutliner.Clear();
1122 bool bFitToSize(IsFitToSize());
1123 if (bFitToSize) aR=aAnchor2;
1124 tools::Polygon aPol(aR);
1126
1127 aRetval.append(aPol.getB2DPolygon());
1128 }
1129
1130 return aRetval;
1131}
1132
1134{
1136 {
1138 } else {
1140 }
1141}
1142
1144{
1145 return 4;
1146}
1147
1149{
1150 Point aP;
1151 auto aRectangle = getRectangle();
1152 switch (i) {
1153 case 0: aP = aRectangle.TopLeft(); break;
1154 case 1: aP = aRectangle.TopRight(); break;
1155 case 2: aP = aRectangle.BottomLeft(); break;
1156 case 3: aP = aRectangle.BottomRight(); break;
1157 default: aP = aRectangle.Center(); break;
1158 }
1159 if (maGeo.nShearAngle)
1160 ShearPoint(aP, aRectangle.TopLeft(), maGeo.mfTanShearAngle);
1162 RotatePoint(aP, aRectangle.TopLeft(), maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
1163 return aP;
1164}
1165
1166// Extracted from ImpGetDrawOutliner()
1168{
1169 rOutl.SetUpdateLayout(false);
1170 OutlinerMode nOutlinerMode = OutlinerMode::OutlineObject;
1171 if ( !IsOutlText() )
1172 nOutlinerMode = OutlinerMode::TextObject;
1173 rOutl.Init( nOutlinerMode );
1174
1175 rOutl.SetGlobalCharStretching(100.0, 100.0);
1176 EEControlBits nStat=rOutl.GetControlWord();
1177 nStat &= ~EEControlBits(EEControlBits::STRETCHING|EEControlBits::AUTOPAGESIZE);
1178 rOutl.SetControlWord(nStat);
1179 Size aMaxSize(100000,100000);
1180 rOutl.SetMinAutoPaperSize(Size());
1181 rOutl.SetMaxAutoPaperSize(aMaxSize);
1182 rOutl.SetPaperSize(aMaxSize);
1183 rOutl.ClearPolygon();
1184}
1185
1187{
1188 SdrOutliner& rOutl(getSdrModelFromSdrObject().GetDrawOutliner(this));
1189
1190 // Code extracted to ImpInitDrawOutliner()
1191 ImpInitDrawOutliner( rOutl );
1192
1193 return rOutl;
1194}
1195
1196// Extracted from Paint()
1198 SdrOutliner& rOutliner,
1199 tools::Rectangle& rTextRect,
1200 tools::Rectangle& rAnchorRect,
1201 tools::Rectangle& rPaintRect,
1202 Fraction& rFitXCorrection ) const
1203{
1204 if (!bContourFrame)
1205 {
1206 // FitToSize can't be used together with ContourFrame for now
1207 if (IsFitToSize() || IsAutoFit())
1208 {
1209 EEControlBits nStat=rOutliner.GetControlWord();
1210 nStat|=EEControlBits::STRETCHING|EEControlBits::AUTOPAGESIZE;
1211 rOutliner.SetControlWord(nStat);
1212 }
1213 }
1215 TakeTextRect(rOutliner, rTextRect, false, &rAnchorRect);
1216 rPaintRect = rTextRect;
1217
1218 if (bContourFrame)
1219 return;
1220
1221 // FitToSize can't be used together with ContourFrame for now
1222 if (IsFitToSize())
1223 {
1224 ImpSetCharStretching(rOutliner,rTextRect.GetSize(),rAnchorRect.GetSize(),rFitXCorrection);
1225 rPaintRect=rAnchorRect;
1226 }
1227 else if (IsAutoFit())
1228 {
1229 ImpAutoFitText(rOutliner);
1230 }
1231}
1232
1234{
1235 SdrOutliner& rOutliner = ImpGetDrawOutliner();
1236 // This eventually calls ImpAutoFitText
1238
1239 double nStretchY;
1240 rOutliner.GetGlobalCharStretching(o3tl::temporary(double()), nStretchY);
1241 return nStretchY;
1242}
1243
1245{
1246 const Size aShapeSize=GetSnapRect().GetSize();
1247 ImpAutoFitText( rOutliner,
1251}
1252
1253void SdrTextObj::ImpAutoFitText(SdrOutliner& rOutliner, const Size& rTextSize,
1254 bool bIsVerticalWriting) const
1255{
1256 // EditEngine formatting is unstable enough for
1257 // line-breaking text that we need some more samples
1258
1259 // loop early-exits if we detect an already attained value
1260 double nMinStretchX = 0.0;
1261 double nMinStretchY = 0.0;
1262 std::array<sal_Int32, 10> aOldStretchXVals = {0,0,0,0,0,0,0,0,0,0};
1263 for (size_t i = 0; i < aOldStretchXVals.size(); ++i)
1264 {
1265 const Size aCurrTextSize = rOutliner.CalcTextSizeNTP();
1266 double fFactor = 1.0;
1267 if( bIsVerticalWriting )
1268 {
1269 if (aCurrTextSize.Width() != 0)
1270 {
1271 fFactor = double(rTextSize.Width())/aCurrTextSize.Width();
1272 }
1273 }
1274 else if (aCurrTextSize.Height() != 0)
1275 {
1276 fFactor = double(rTextSize.Height())/aCurrTextSize.Height();
1277 }
1278 // fFactor scales in both x and y directions
1279 // - this is fine for bulleted words
1280 // - but it scales too much for a long paragraph
1281 // - taking sqrt scales long paragraphs the best
1282 // - bulleted words will have to go through more iterations
1283 fFactor = std::sqrt(fFactor);
1284
1285 double nCurrStretchX, nCurrStretchY;
1286 rOutliner.GetGlobalCharStretching(nCurrStretchX, nCurrStretchY);
1287
1288 if (fFactor >= 0.98)
1289 {
1290 // resulting text area fits into available shape rect -
1291 // err on the larger stretching, to optimally fill area
1292 nMinStretchX = std::max(nMinStretchX, nCurrStretchX);
1293 nMinStretchY = std::max(nMinStretchY, nCurrStretchY);
1294 }
1295
1296 aOldStretchXVals[i] = basegfx::fround(nCurrStretchX * 10.0);
1297 if (std::find(aOldStretchXVals.begin(), aOldStretchXVals.begin() + i, basegfx::fround(nCurrStretchX * 10.0)) != aOldStretchXVals.begin() + i)
1298 break; // same value already attained once; algo is looping, exit
1299
1300 if (fFactor < 1.0 || nCurrStretchX != 100)
1301 {
1302 nCurrStretchX = double(basegfx::fround(nCurrStretchX * fFactor * 100.0)) / 100.00;
1303 nCurrStretchY = double(basegfx::fround(nCurrStretchY * fFactor * 100.0)) / 100.00;
1304
1305 rOutliner.SetGlobalCharStretching(std::min(100.0, nCurrStretchX), std::min(100.0, nCurrStretchY));
1306 SAL_INFO("svx", "zoom is " << nCurrStretchX);
1307 }
1308 }
1309
1311 if (rItem.GetMaxScale() > 0)
1312 {
1313 nMinStretchX = std::min<sal_uInt16>(rItem.GetMaxScale(), nMinStretchX);
1314 nMinStretchY = std::min<sal_uInt16>(rItem.GetMaxScale(), nMinStretchY);
1315 }
1316
1317 SAL_INFO("svx", "final zoom is " << nMinStretchX);
1318 rOutliner.SetGlobalCharStretching(std::min(100.0, nMinStretchX), std::min(100.0, nMinStretchY));
1319}
1320
1322{
1323 ImpInitDrawOutliner( rOutl );
1324 UpdateOutlinerFormatting( rOutl, rPaintRect );
1325}
1326
1328{
1329 tools::Rectangle aTextRect;
1330 tools::Rectangle aAnchorRect;
1331 Fraction aFitXCorrection(1,1);
1332
1333 const bool bContourFrame(IsContourTextFrame());
1334 const MapMode aMapMode(getSdrModelFromSdrObject().GetScaleUnit());
1335
1336 rOutl.SetRefMapMode(aMapMode);
1338 bContourFrame,
1339 rOutl,
1340 aTextRect,
1341 aAnchorRect,
1342 rPaintRect,
1343 aFitXCorrection);
1344}
1345
1346
1348{
1349 SdrText* pText = getActiveText();
1350 if( pText )
1351 return pText->GetOutlinerParaObject();
1352 else
1353 return nullptr;
1354}
1355
1357{
1358 NbcSetOutlinerParaObjectForText( std::move(pTextObject), getActiveText() );
1359}
1360
1361namespace
1362{
1363 bool IsAutoGrow(const SdrTextObj& rObj)
1364 {
1365 bool bAutoGrow = rObj.IsAutoGrowHeight() || rObj.IsAutoGrowWidth();
1366 return bAutoGrow && !utl::ConfigManager::IsFuzzing();
1367 }
1368}
1369
1371{
1372 if( pText )
1373 pText->SetOutlinerParaObject( std::move(pTextObject) );
1374
1375 if (pText && pText->GetOutlinerParaObject())
1376 {
1378 ? css::text::WritingMode_TB_RL
1379 : css::text::WritingMode_LR_TB,
1381 GetProperties().SetObjectItemDirect(aWritingMode);
1382 }
1383
1385 if (IsTextFrame() && IsAutoGrow(*this))
1386 { // adapt text frame!
1388 }
1389 if (!IsTextFrame())
1390 {
1391 // the SnapRect keeps its size
1393 }
1394
1395 // always invalidate BoundRect on change
1397 ActionChanged();
1398
1400}
1401
1403{
1404 SdrText* pText = getActiveText();
1405 if( !(pText && pText->GetOutlinerParaObject()) )
1406 return;
1407
1408 pText->ReformatText();
1409 if (mbTextFrame)
1410 {
1412 }
1413 else
1414 {
1415 // the SnapRect keeps its size
1417 SetBoundAndSnapRectsDirty(/*bNotMyself*/true);
1418 }
1420 ActionChanged();
1421 // i22396
1422 // Necessary here since we have no compare operator at the outliner
1423 // para object which may detect changes regarding the combination
1424 // of outliner para data and configuration (e.g., change of
1425 // formatting of text numerals)
1427}
1428
1429std::unique_ptr<SdrObjGeoData> SdrTextObj::NewGeoData() const
1430{
1431 return std::make_unique<SdrTextObjGeoData>();
1432}
1433
1435{
1437 SdrTextObjGeoData& rTGeo=static_cast<SdrTextObjGeoData&>(rGeo);
1438 rTGeo.maRect = getRectangle();
1439 rTGeo.maGeo = maGeo;
1440}
1441
1443{ // RectsDirty is called by SdrObject
1445 const SdrTextObjGeoData& rTGeo=static_cast<const SdrTextObjGeoData&>(rGeo);
1446 NbcSetLogicRect(rTGeo.maRect);
1447 maGeo = rTGeo.maGeo;
1449}
1450
1451drawing::TextFitToSizeType SdrTextObj::GetFitToSize() const
1452{
1453 drawing::TextFitToSizeType eType = drawing::TextFitToSizeType_NONE;
1454
1455 if(!IsAutoGrowWidth())
1457
1458 return eType;
1459}
1460
1462{
1463 return getRectangle();
1464}
1465
1467{
1468 SdrText* pText = getActiveText();
1469 if( pText && (pText->GetOutlinerParaObject() == nullptr) )
1470 {
1471 OutlinerMode nOutlMode = OutlinerMode::TextObject;
1473 nOutlMode = OutlinerMode::OutlineObject;
1474
1475 pText->ForceOutlinerParaObject( nOutlMode );
1476 }
1477}
1478
1480{
1481 //if (!IsChainable())
1482 // return NULL;
1483
1485}
1486
1488{
1490 {
1491 return mpEditingOutliner->IsVertical();
1492 }
1493
1494 OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject();
1495 if(pOutlinerParaObject)
1496 {
1497 return pOutlinerParaObject->IsEffectivelyVertical();
1498 }
1499
1500 return false;
1501}
1502
1504{
1505 OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject();
1506
1507 if( !pOutlinerParaObject && bVertical )
1508 {
1509 // we only need to force an outliner para object if the default of
1510 // horizontal text is changed
1512 pOutlinerParaObject = GetOutlinerParaObject();
1513 }
1514
1515 if (!pOutlinerParaObject ||
1516 (pOutlinerParaObject->IsEffectivelyVertical() == bVertical))
1517 return;
1518
1519 // get item settings
1520 const SfxItemSet& rSet = GetObjectItemSet();
1521 bool bAutoGrowWidth = rSet.Get(SDRATTR_TEXT_AUTOGROWWIDTH).GetValue();
1522 bool bAutoGrowHeight = rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT).GetValue();
1523
1524 // Also exchange hor/ver adjust items
1527
1528 // rescue object size
1529 tools::Rectangle aObjectRect = GetSnapRect();
1530
1531 // prepare ItemSet to set exchanged width and height items
1533 // Expanded item ranges to also support hor and ver adjust.
1536
1537 aNewSet.Put(rSet);
1538 aNewSet.Put(makeSdrTextAutoGrowWidthItem(bAutoGrowHeight));
1539 aNewSet.Put(makeSdrTextAutoGrowHeightItem(bAutoGrowWidth));
1540
1541 // Exchange horz and vert adjusts
1542 switch (eVert)
1543 {
1548 }
1549 switch (eHorz)
1550 {
1555 }
1556
1557 SetObjectItemSet(aNewSet);
1558
1559 pOutlinerParaObject = GetOutlinerParaObject();
1560 if (pOutlinerParaObject)
1561 {
1562 // set ParaObject orientation accordingly
1563 pOutlinerParaObject->SetVertical(bVertical);
1564 }
1565
1566 // restore object size
1567 SetSnapRect(aObjectRect);
1568}
1569
1571{
1574
1575 if (OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject())
1576 return pOutlinerParaObject->IsTopToBottom();
1577
1578 return false;
1579}
1580
1581// transformation interface for StarOfficeAPI. This implements support for
1582// homogeneous 3x3 matrices containing the transformation of the SdrObject. At the
1583// moment it contains a shearX, rotation and translation, but for setting all linear
1584// transforms like Scale, ShearX, ShearY, Rotate and Translate are supported.
1585
1586
1587// gets base transformation and rectangle of object. If it's an SdrPathObj it fills the PolyPolygon
1588// with the base geometry and returns TRUE. Otherwise it returns FALSE.
1590{
1591 // get turn and shear
1592 double fRotate = toRadians(maGeo.nRotationAngle);
1593 double fShearX = toRadians(maGeo.nShearAngle);
1594
1595 // get aRect, this is the unrotated snaprect
1596 tools::Rectangle aRectangle(getRectangle());
1597
1598 // fill other values
1599 basegfx::B2DTuple aScale(aRectangle.GetWidth(), aRectangle.GetHeight());
1600 basegfx::B2DTuple aTranslate(aRectangle.Left(), aRectangle.Top());
1601
1602 // position maybe relative to anchorpos, convert
1603 if( getSdrModelFromSdrObject().IsWriter() )
1604 {
1605 if(GetAnchorPos().X() || GetAnchorPos().Y())
1606 {
1607 aTranslate -= basegfx::B2DTuple(GetAnchorPos().X(), GetAnchorPos().Y());
1608 }
1609 }
1610
1611 // build matrix
1613 aScale,
1614 basegfx::fTools::equalZero(fShearX) ? 0.0 : tan(fShearX),
1615 basegfx::fTools::equalZero(fRotate) ? 0.0 : -fRotate,
1616 aTranslate);
1617
1618 return false;
1619}
1620
1621// sets the base geometry of the object using infos contained in the homogeneous 3x3 matrix.
1622// If it's an SdrPathObj it will use the provided geometry information. The Polygon has
1623// to use (0,0) as upper left and will be scaled to the given size in the matrix.
1625{
1626 // break up matrix
1627 basegfx::B2DTuple aScale;
1628 basegfx::B2DTuple aTranslate;
1629 double fRotate(0.0);
1630 double fShearX(0.0);
1631 rMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
1632
1633 // flip?
1634 bool bFlipX = aScale.getX() < 0.0,
1635 bFlipY = aScale.getY() < 0.0;
1636 if (bFlipX)
1637 {
1638 aScale.setX(fabs(aScale.getX()));
1639 }
1640 if (bFlipY)
1641 {
1642 aScale.setY(fabs(aScale.getY()));
1643 }
1644
1645 // reset object shear and rotations
1646 maGeo.nRotationAngle = 0_deg100;
1648 maGeo.nShearAngle = 0_deg100;
1649 maGeo.RecalcTan();
1650
1651 // if anchor is used, make position relative to it
1652 if( getSdrModelFromSdrObject().IsWriter() )
1653 {
1654 if(GetAnchorPos().X() || GetAnchorPos().Y())
1655 {
1656 aTranslate += basegfx::B2DTuple(GetAnchorPos().X(), GetAnchorPos().Y());
1657 }
1658 }
1659
1660 // build and set BaseRect (use scale)
1661 Size aSize(FRound(aScale.getX()), FRound(aScale.getY()));
1662 tools::Rectangle aBaseRect(Point(), aSize);
1663 SetSnapRect(aBaseRect);
1664
1665 // flip?
1666 if (bFlipX)
1667 {
1668 Mirror(Point(), Point(0, 1));
1669 }
1670 if (bFlipY)
1671 {
1672 Mirror(Point(), Point(1, 0));
1673 }
1674
1675 // shear?
1676 if(!basegfx::fTools::equalZero(fShearX))
1677 {
1678 GeoStat aGeoStat;
1679 aGeoStat.nShearAngle = Degree100(FRound(basegfx::rad2deg<100>(atan(fShearX))));
1680 aGeoStat.RecalcTan();
1681 Shear(Point(), aGeoStat.nShearAngle, aGeoStat.mfTanShearAngle, false);
1682 }
1683
1684 // rotation?
1685 if(!basegfx::fTools::equalZero(fRotate))
1686 {
1687 GeoStat aGeoStat;
1688
1689 // #i78696#
1690 // fRotate is matematically correct, but aGeoStat.nRotationAngle is
1691 // mirrored -> mirror value here
1692 aGeoStat.nRotationAngle = NormAngle36000(Degree100(FRound(-basegfx::rad2deg<100>(fRotate))));
1693 aGeoStat.RecalcSinCos();
1694 Rotate(Point(), aGeoStat.nRotationAngle, aGeoStat.mfSinRotationAngle, aGeoStat.mfCosRotationAngle);
1695 }
1696
1697 // translate?
1698 if(!aTranslate.equalZero())
1699 {
1700 Move(Size(FRound(aTranslate.getX()), FRound(aTranslate.getY())));
1701 }
1702}
1703
1705{
1707}
1708
1709// moved inlines here form hxx
1710
1712{
1713 return GetObjectItemSet().Get(SDRATTR_CORNER_RADIUS).GetValue();
1714}
1715
1717{
1719}
1720
1722{
1724}
1725
1727{
1728 return GetObjectItemSet().Get(SDRATTR_TEXT_MINFRAMEWIDTH).GetValue();
1729}
1730
1732{
1733 return GetObjectItemSet().Get(SDRATTR_TEXT_MAXFRAMEWIDTH).GetValue();
1734}
1735
1737{
1738 return !mbTextFrame // Default is FALSE
1740}
1741
1743{
1744 return !mbTextFrame // Default is: no, don't HideContour; HideContour not together with TextFrames
1746}
1747
1749{
1750 return !mbTextFrame // ContourFrame not together with normal TextFrames
1752}
1753
1755{
1756 return GetObjectItemSet().Get(SDRATTR_TEXT_LEFTDIST).GetValue();
1757}
1758
1760{
1761 return GetObjectItemSet().Get(SDRATTR_TEXT_RIGHTDIST).GetValue();
1762}
1763
1765{
1766 return GetObjectItemSet().Get(SDRATTR_TEXT_UPPERDIST).GetValue();
1767}
1768
1770{
1771 return GetObjectItemSet().Get(SDRATTR_TEXT_LOWERDIST).GetValue();
1772}
1773
1775{
1776 return GetObjectItemSet().Get(SDRATTR_TEXT_ANIKIND).GetValue();
1777}
1778
1780{
1781 return GetObjectItemSet().Get(SDRATTR_TEXT_ANIDIRECTION).GetValue();
1782}
1783
1785{
1787}
1788
1790{
1791 return GetObjectItemSet().Get(SDRATTR_TEXTCOLUMNS_NUMBER).GetValue();
1792}
1793
1794void SdrTextObj::SetTextColumnsNumber(sal_Int16 nColumns)
1795{
1797}
1798
1800{
1802}
1803
1805{
1807}
1808
1810{
1812}
1813
1814// Get necessary data for text scroll animation. ATM base it on a Text-Metafile and a
1815// painting rectangle. Rotation is excluded from the returned values.
1817 tools::Rectangle& rScrollRectangle, tools::Rectangle& rPaintRectangle)
1818{
1819 GDIMetaFile* pRetval = nullptr;
1820 SdrOutliner& rOutliner = ImpGetDrawOutliner();
1821 tools::Rectangle aTextRect;
1822 tools::Rectangle aAnchorRect;
1823 tools::Rectangle aPaintRect;
1824 Fraction aFitXCorrection(1,1);
1825 bool bContourFrame(IsContourTextFrame());
1826
1827 // get outliner set up. To avoid getting a somehow rotated MetaFile,
1828 // temporarily disable object rotation.
1830 maGeo.nRotationAngle = 0_deg100;
1831 ImpSetupDrawOutlinerForPaint( bContourFrame, rOutliner, aTextRect, aAnchorRect, aPaintRect, aFitXCorrection );
1832 maGeo.nRotationAngle = nAngle;
1833
1834 tools::Rectangle aScrollFrameRect(aPaintRect);
1835 const SfxItemSet& rSet = GetObjectItemSet();
1836 SdrTextAniDirection eDirection = rSet.Get(SDRATTR_TEXT_ANIDIRECTION).GetValue();
1837
1838 if(SdrTextAniDirection::Left == eDirection || SdrTextAniDirection::Right == eDirection)
1839 {
1840 aScrollFrameRect.SetLeft( aAnchorRect.Left() );
1841 aScrollFrameRect.SetRight( aAnchorRect.Right() );
1842 }
1843
1844 if(SdrTextAniDirection::Up == eDirection || SdrTextAniDirection::Down == eDirection)
1845 {
1846 aScrollFrameRect.SetTop( aAnchorRect.Top() );
1847 aScrollFrameRect.SetBottom( aAnchorRect.Bottom() );
1848 }
1849
1850 // create the MetaFile
1851 pRetval = new GDIMetaFile;
1853 pBlackHole->EnableOutput(false);
1854 pRetval->Record(pBlackHole);
1855 Point aPaintPos = aPaintRect.TopLeft();
1856
1857 rOutliner.Draw(*pBlackHole, aPaintPos);
1858
1859 pRetval->Stop();
1860 pRetval->WindStart();
1861
1862 // return PaintRectanglePixel and pRetval;
1863 rScrollRectangle = aScrollFrameRect;
1864 rPaintRectangle = aPaintRect;
1865
1866 return pRetval;
1867}
1868
1869// Access to TextAnimationAllowed flag
1871{
1872 return GetFitToSize() == drawing::TextFitToSizeType_AUTOFIT;
1873}
1874
1876{
1877 const drawing::TextFitToSizeType eFit = GetFitToSize();
1878 return (eFit == drawing::TextFitToSizeType_PROPORTIONAL
1879 || eFit == drawing::TextFitToSizeType_ALLLINES);
1880}
1881
1883{
1884 if(mbTextAnimationAllowed != bNew)
1885 {
1887 ActionChanged();
1888 }
1889}
1890
1893{
1894 const EditStatusFlags nStat = pEditStatus->GetStatusWord();
1895 const bool bGrowX = bool(nStat & EditStatusFlags::TEXTWIDTHCHANGED);
1896 const bool bGrowY = bool(nStat & EditStatusFlags::TextHeightChanged);
1897 if(!(mbTextFrame && (bGrowX || bGrowY)))
1898 return;
1899
1900 if ((bGrowX && IsAutoGrowWidth()) || (bGrowY && IsAutoGrowHeight()))
1901 {
1903 }
1904 else if ( (IsAutoFit() || IsFitToSize()) && !mbInDownScale)
1905 {
1906 assert(mpEditingOutliner);
1907 mbInDownScale = true;
1908
1909 // sucks that we cannot disable paints via
1910 // mpEditingOutliner->SetUpdateMode(FALSE) - but EditEngine skips
1911 // formatting as well, then.
1913 mbInDownScale = false;
1914 }
1915}
1916
1917/* Begin chaining code */
1918
1919// XXX: Make it a method somewhere?
1920static SdrObject *ImpGetObjByName(SdrObjList const *pObjList, std::u16string_view aObjName)
1921{
1922 // scan the whole list
1923 size_t nObjCount = pObjList->GetObjCount();
1924 for (size_t i = 0; i < nObjCount; i++) {
1925 SdrObject *pCurObj = pObjList->GetObj(i);
1926
1927 if (pCurObj->GetName() == aObjName) {
1928 return pCurObj;
1929 }
1930 }
1931 // not found
1932 return nullptr;
1933}
1934
1935// XXX: Make it a (private) method of SdrTextObj
1936static void ImpUpdateChainLinks(SdrTextObj *pTextObj, std::u16string_view aNextLinkName)
1937{
1938 // XXX: Current implementation constraints text boxes to be on the same page
1939
1940 // No next link
1941 if (aNextLinkName.empty()) {
1942 pTextObj->SetNextLinkInChain(nullptr);
1943 return;
1944 }
1945
1946 SdrPage *pPage(pTextObj->getSdrPageFromSdrObject());
1947 assert(pPage);
1948 SdrTextObj *pNextTextObj = DynCastSdrTextObj
1949 (ImpGetObjByName(pPage, aNextLinkName));
1950 if (!pNextTextObj) {
1951 SAL_INFO("svx.chaining", "[CHAINING] Can't find object as next link.");
1952 return;
1953 }
1954
1955 pTextObj->SetNextLinkInChain(pNextTextObj);
1956}
1957
1959{
1960 // Read it as item
1961 const SfxItemSet& rSet = GetObjectItemSet();
1962 OUString aNextLinkName = rSet.Get(SDRATTR_TEXT_CHAINNEXTNAME).GetValue();
1963
1964 // Update links if any inconsistency is found
1965 bool bNextLinkUnsetYet = !aNextLinkName.isEmpty() && !mpNextInChain;
1966 bool bInconsistentNextLink = mpNextInChain && mpNextInChain->GetName() != aNextLinkName;
1967 // if the link is not set despite there should be one OR if it has changed
1968 if (bNextLinkUnsetYet || bInconsistentNextLink) {
1969 ImpUpdateChainLinks(const_cast<SdrTextObj *>(this), aNextLinkName);
1970 }
1971
1972 return !aNextLinkName.isEmpty(); // XXX: Should we also check for GetNilChainingEvent? (see old code below)
1973
1974/*
1975 // Check that no overflow is going on
1976 if (!GetTextChain() || GetTextChain()->GetNilChainingEvent(this))
1977 return false;
1978*/
1979}
1980
1982{
1983 if (!mpEditingOutliner)
1984 return;
1985
1986 // Outliner for text transfer
1987 SdrOutliner &aDrawOutliner = ImpGetDrawOutliner();
1988
1989 EditingTextChainFlow aTxtChainFlow(this);
1991
1992 if (aTxtChainFlow.IsOverflow()) {
1993 SAL_INFO("svx.chaining", "[CHAINING] Overflow going on");
1994 // One outliner is for non-overflowing text, the other for overflowing text
1995 // We remove text directly from the editing outliner
1996 aTxtChainFlow.ExecuteOverflow(mpEditingOutliner, &aDrawOutliner);
1997 } else if (aTxtChainFlow.IsUnderflow()) {
1998 SAL_INFO("svx.chaining", "[CHAINING] Underflow going on");
1999 // underflow-induced overflow
2000 aTxtChainFlow.ExecuteUnderflow(&aDrawOutliner);
2001 bool bIsOverflowFromUnderflow = aTxtChainFlow.IsOverflow();
2002 // handle overflow
2003 if (bIsOverflowFromUnderflow) {
2004 SAL_INFO("svx.chaining", "[CHAINING] Overflow going on (underflow induced)");
2005 // prevents infinite loops when setting text for editing outliner
2006 aTxtChainFlow.ExecuteOverflow(&aDrawOutliner, &aDrawOutliner);
2007 }
2008 }
2009}
2010
2012{
2013 /*
2014 if (GetTextChain())
2015 return GetTextChain()->GetNextLink(this);
2016
2017 return NULL;
2018 */
2019
2020 return mpNextInChain;
2021}
2022
2024{
2025 // Basically a doubly linked list implementation
2026
2027 SdrTextObj *pOldNextObj = mpNextInChain;
2028
2029 // Replace next link
2030 mpNextInChain = pNextObj;
2031 // Deal with old next link's prev link
2032 if (pOldNextObj) {
2033 pOldNextObj->mpPrevInChain = nullptr;
2034 }
2035
2036 // Deal with new next link's prev link
2037 if (mpNextInChain) {
2038 // If there is a prev already at all and this is not already the current object
2043 }
2044
2045 // TODO: Introduce check for circular chains
2046
2047}
2048
2050{
2051 /*
2052 if (GetTextChain())
2053 return GetTextChain()->GetPrevLink(this);
2054
2055 return NULL;
2056 */
2057
2058 return mpPrevInChain;
2059}
2060
2062{
2063 // Prevent chaining it 1) during dragging && 2) when we are editing next link
2065}
2066
2068{
2070 SdrTextObj *pTextObjClone = DynCastSdrTextObj(pClone.get());
2071 if (pTextObjClone != nullptr) {
2072 // Avoid transferring of text for chainable object during dragging
2073 pTextObjClone->mbIsUnchainableClone = true;
2074 }
2075
2076 return pClone;
2077 }
2078
2079/* End chaining code */
2080
2083{
2084 if( !mxText )
2085 return getText( 0 );
2086 else
2087 return mxText.get();
2088}
2089
2091SdrText* SdrTextObj::getText( sal_Int32 nIndex ) const
2092{
2093 if( nIndex == 0 )
2094 {
2095 if( !mxText )
2096 const_cast< SdrTextObj* >(this)->mxText = new SdrText( *const_cast< SdrTextObj* >(this) );
2097 return mxText.get();
2098 }
2099 else
2100 {
2101 return nullptr;
2102 }
2103}
2104
2107{
2108 return 1;
2109}
2110
2112void SdrTextObj::setActiveText( sal_Int32 /*nIndex*/ )
2113{
2114}
2115
2117sal_Int32 SdrTextObj::CheckTextHit(const Point& /*rPnt*/) const
2118{
2119 return 0;
2120}
2121
2123{
2125}
2126
2127
2128// The concept of the text object:
2129// ~~~~~~~~~~~~~~~~~~~~~~~~
2130// Attributes/Variations:
2131// - bool text frame / graphics object with caption
2132// - bool FontWork (if it is not a text frame and not a ContourTextFrame)
2133// - bool ContourTextFrame (if it is not a text frame and not Fontwork)
2134// - long rotation angle (if it is not FontWork)
2135// - long text frame margins (if it is not FontWork)
2136// - bool FitToSize (if it is not FontWork)
2137// - bool AutoGrowingWidth/Height (if it is not FitToSize and not FontWork)
2138// - long Min/MaxFrameWidth/Height (if AutoGrowingWidth/Height)
2139// - enum horizontal text anchoring left,center,right,justify/block,Stretch(ni)
2140// - enum vertical text anchoring top, middle, bottom, block, stretch(ni)
2141// - enum ticker text (if it is not FontWork)
2142
2143// Every derived object is either a text frame (mbTextFrame=true)
2144// or a drawing object with a caption (mbTextFrame=false).
2145
2146// Default anchoring for text frames:
2147// SDRTEXTHORZADJUST_BLOCK, SDRTEXTVERTADJUST_TOP
2148// = static Pool defaults
2149// Default anchoring for drawing objects with a caption:
2150// SDRTEXTHORZADJUST_CENTER, SDRTEXTVERTADJUST_CENTER
2151// via "hard" attribution of SdrAttrObj
2152
2153// Every object derived from SdrTextObj must return an "UnrotatedSnapRect"
2154// (->TakeUnrotatedSnapRect()) (the reference point for the rotation is the top
2155// left of the rectangle (maGeo.nRotationAngle)) which is the basis for anchoring
2156// text. We then subtract the text frame margins from this rectangle, as a re-
2157// sult we get the anchoring area (->TakeTextAnchorRect()). Within this area, we
2158// calculate the anchoring point and the painting area, depending on the hori-
2159// zontal and vertical adjustment of the text (SdrTextVertAdjust,
2160// SdrTextHorzAdjust).
2161// In the case of drawing objects with a caption the painting area might well
2162// be larger than the anchoring area, for text frames on the other hand, it is
2163// always of the same or a smaller size (except when there are negative text
2164// frame margins).
2165
2166// FitToSize takes priority over text anchoring and AutoGrowHeight/Width. When
2167// FitToSize is turned on, the painting area is always equal to the anchoring
2168// area. Additionally, FitToSize doesn't allow automatic line breaks.
2169
2170// ContourTextFrame:
2171// - long rotation angle
2172// - long text frame margins (maybe later)
2173// - bool FitToSize (maybe later)
2174// - bool AutoGrowingWidth/Height (maybe much later)
2175// - long Min/MaxFrameWidth/Height (maybe much later)
2176// - enum horizontal text anchoring (maybe later, for now: left, centered)
2177// - enum vertical text anchoring (maybe later, for now: top)
2178// - enum ticker text (maybe later, maybe even with correct clipping)
2179
2180// When making changes, check these:
2181// - Paint
2182// - HitTest
2183// - ConvertToPoly
2184// - Edit
2185// - Printing, Saving, Painting in neighboring View while editing
2186// - ModelChanged (e. g. through a neighboring View or rulers) while editing
2187// - FillColorChanged while editing
2188// - and many more...
2189
2190
2191/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
EditStatusFlags GetStatusWord() const
virtual OUString GetText(sal_Int32 nPara) const=0
virtual void CheckForFlowEvents(SdrOutliner *) override
void WindStart()
bool IsPause() const
void Pause(bool bPause)
bool IsRecord() const
void Record(OutputDevice *pOutDev)
The transformation of a rectangle into a polygon, by using angle parameters from GeoStat.
Definition: svdtrans.hxx:201
double mfTanShearAngle
Definition: svdtrans.hxx:205
double mfCosRotationAngle
Definition: svdtrans.hxx:207
Degree100 nShearAngle
Definition: svdtrans.hxx:204
double mfSinRotationAngle
Definition: svdtrans.hxx:206
void RecalcTan()
Definition: svdtrans.cxx:456
void RecalcSinCos()
Definition: svdtrans.cxx:444
Degree100 nRotationAngle
Definition: svdtrans.hxx:203
const EditTextObject & GetTextObject() const
void SetVertical(bool bNew)
bool IsTopToBottom() const
bool IsEffectivelyVertical() const
void SetMaxAutoPaperSize(const Size &rSz)
void SetText(const OutlinerParaObject &)
OUString GetText(Paragraph const *pPara, sal_Int32 nParaCount=1) const
const Size & GetPaperSize() const
void SetMinColumnWrapHeight(tools::Long nVal)
Paragraph * GetParagraph(sal_Int32 nAbsPos) const
void GetGlobalCharStretching(double &rX, double &rY) const
void SetGlobalCharStretching(double nX=100.0, double nY=100.0)
void SetMinAutoPaperSize(const Size &rSz)
std::optional< OutlinerParaObject > CreateParaObject(sal_Int32 nStartPara=0, sal_Int32 nParaCount=EE_PARA_ALL) const
void SetPaperSize(const Size &rSize)
void Clear()
void SetStyleSheet(sal_Int32 nPara, SfxStyleSheet *pStyle)
bool SetUpdateLayout(bool bUpdate)
void SetFixedCellHeight(bool bUseFixedCellHeight)
EEControlBits GetControlWord() const
void SetControlWord(EEControlBits nWord)
void ClearPolygon()
void SetPolygon(const basegfx::B2DPolyPolygon &rPolyPolygon)
Size CalcTextSize()
bool IsVertical() const
void Draw(OutputDevice &rOutDev, const tools::Rectangle &rOutRect)
ErrCode Read(SvStream &rInput, const OUString &rBaseURL, EETextFormat, SvKeyValueIterator *pHTTPHeaderAttrs=nullptr)
void SetRefMapMode(const MapMode &)
void Init(OutlinerMode nMode)
OutputDevice * GetRefDevice() const
bool IsModified() const
bool IsTopToBottom() const
Size CalcTextSizeNTP()
sal_Int32 GetParagraphCount() const
static vcl::Font GetDefaultFont(DefaultFontType nType, LanguageType eLang, GetDefaultFontFlags nFlags, const OutputDevice *pOutDev=nullptr)
virtual const tools::Rectangle & GetSnapRect() const override
Definition: svdoattr.cxx:49
tools::Rectangle maSnapRect
Definition: svdoattr.hxx:41
TextChain * GetTextChain() const
Definition: svdmodel.cxx:1889
All geometrical data of an arbitrary object for use in undo/redo.
Definition: svdobj.hxx:174
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:824
size_t GetObjCount() const
Definition: svdpage.cxx:818
Provides information about various ZObject properties.
Definition: svdobj.hxx:196
Abstract DrawObject.
Definition: svdobj.hxx:260
const SfxPoolItem & GetMergedItem(const sal_uInt16 nWhich) const
Definition: svdobj.cxx:1973
const Point & GetAnchorPos() const
Definition: svdobj.cxx:1617
void ActionChanged() const
Definition: svdobj.cxx:273
virtual rtl::Reference< SdrObject > getFullDragClone() const
Definition: svdobj.cxx:1305
virtual sdr::properties::BaseProperties & GetProperties() const
Definition: svdobj.cxx:220
virtual void Shear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear)
Definition: svdobj.cxx:1560
bool LineGeometryUsageIsNecessary() const
Definition: svdobj.cxx:1039
void BroadcastObjectChange() const
Definition: svdobj.cxx:982
void SetObjectItemSet(const SfxItemSet &rSet)
Definition: svdobj.cxx:1958
virtual void RestoreGeoData(const SdrObjGeoData &rGeo)
Definition: svdobj.cxx:1887
bool mbSupportTextIndentingOnLineWidthChange
Definition: svdobj.hxx:921
void SetObjectItem(const SfxPoolItem &rItem)
Definition: svdobj.cxx:1943
const SfxPoolItem & GetObjectItem(const sal_uInt16 nWhich) const
Definition: svdobj.cxx:1968
virtual void Mirror(const Point &rRef1, const Point &rRef2)
Definition: svdobj.cxx:1551
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage)
Definition: svdobj.cxx:523
virtual void SaveGeoData(SdrObjGeoData &rGeo) const
Definition: svdobj.cxx:1864
static rtl::Reference< T > Clone(T const &rObj, SdrModel &rTargetModel)
Definition: svdobj.hxx:448
virtual void Move(const Size &rSiz)
Definition: svdobj.cxx:1495
SdrModel & getSdrModelFromSdrObject() const
Definition: svdobj.cxx:289
SdrObjUserCall * m_pUserCall
Definition: svdobj.hxx:896
virtual void SetLogicRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1660
SfxStyleSheet * GetStyleSheet() const
Definition: svdobj.cxx:2208
virtual const OUString & GetName() const
Definition: svdobj.cxx:769
sdr::contact::ViewContact & GetViewContact() const
Definition: svdobj.cxx:261
virtual void Rotate(const Point &rRef, Degree100 nAngle, double sn, double cs)
Definition: svdobj.cxx:1540
void SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle &rBoundRect) const
Definition: svdobj.cxx:2727
virtual void SetChanged()
Definition: svdobj.cxx:1006
virtual const tools::Rectangle & GetLastBoundRect() const
Definition: svdobj.cxx:941
SdrPage * getSdrPageFromSdrObject() const
Definition: svdobj.cxx:279
virtual basegfx::B2DPolyPolygon TakeContour() const
contour for TextToContour
Definition: svdobj.cxx:1104
virtual void SetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1651
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:1933
void SetTextObj(const SdrTextObj *pObj)
Definition: svdoutl.cxx:43
const SdrTextObj * GetTextObj() const
Definition: svdoutl.cxx:90
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:377
sal_Int16 GetMaxScale() const
Definition: sdtfsitm.hxx:59
tools::Rectangle maRect
Definition: svdotext.hxx:91
SdrTextObj * GetPrevLinkInChain() const
Definition: svdotext.cxx:2049
SdrTextHorzAdjust GetTextHorizontalAdjust() const
Definition: svdotext.cxx:342
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties() override
Definition: svdotext.cxx:60
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const override
Definition: svdotext.cxx:1088
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: svdotext.cxx:1429
GeoStat maGeo
Definition: svdotext.hxx:196
virtual void AdaptTextMinSize()
Definition: svdotext.cxx:503
bool HasTextColumnsSpacing() const
Definition: svdotext.cxx:1799
virtual bool IsAutoGrowWidth() const
Definition: svdotext.cxx:315
tools::Long GetMaxTextFrameHeight() const
Definition: svdotext.cxx:1721
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
Definition: svdotext.cxx:1434
bool IsTopToBottom() const
Definition: svdotext.cxx:1570
tools::Rectangle const & getRectangle() const
Definition: svdotext.hxx:170
virtual void RestoreGeoData(const SdrObjGeoData &rGeo) override
Definition: svdotext.cxx:1442
void UpdateOutlinerFormatting(SdrOutliner &rOutl, tools::Rectangle &rPaintRect) const
Update given Outliner equivalently to SdrTextObj::Paint()
Definition: svdotext.cxx:1327
virtual void RecalcSnapRect() override
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
Definition: svdotext.cxx:1133
tools::Long GetTextLowerDistance() const
Bottom inner spacing to borders.
Definition: svdotext.cxx:1769
bool IsChainable() const
Definition: svdotext.cxx:1958
SVX_DLLPRIVATE void ImpDeregisterLink()
Definition: svdotxln.cxx:266
SdrOutliner & ImpGetDrawOutliner() const
Definition: svdotext.cxx:1186
SdrTextObj * GetNextLinkInChain() const
Definition: svdotext.cxx:2011
sal_Int32 GetTextColumnsSpacing() const
Definition: svdotext.cxx:1804
void ImpSetTextStyleSheetListeners()
Definition: svdotxat.cxx:300
virtual sal_Int32 CheckTextHit(const Point &rPnt) const
returns the index of the text that contains the given point or -1
Definition: svdotext.cxx:2117
tools::Long GetMinTextFrameHeight() const
Definition: svdotext.cxx:1716
virtual OUString TakeObjNameSingul() const override
Definition: svdotext.cxx:1011
void SetTextColumnsSpacing(sal_Int32 nSpacing)
Definition: svdotext.cxx:1809
bool IsAutoFit() const
returns true if the PPT autofit of text into shape bounds is enabled. implies IsFitToSize()==false!
Definition: svdotext.cxx:1870
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const override
Definition: svdotext.cxx:425
virtual const Size & GetTextSize() const
Definition: svdotext.cxx:269
void NbcSetEckenradius(tools::Long nRad)
Definition: svdotext.cxx:496
bool IsFitToSize() const
returns true if the old feature for fitting shape content should into shape is enabled....
Definition: svdotext.cxx:1875
bool CanCreateEditOutlinerParaObject() const
Definition: svdotext.cxx:849
bool IsInEditMode() const
Definition: svdotext.hxx:337
SVX_DLLPRIVATE void ImpRegisterLink()
Definition: svdotxln.cxx:254
SdrTextObj * mpPrevInChain
Definition: svdotext.hxx:235
virtual ~SdrTextObj() override
Definition: svdotext.cxx:196
static void ImpSetCharStretching(SdrOutliner &rOutliner, const Size &rTextSize, const Size &rShapeSize, Fraction &rFitXCorrection)
Definition: svdotext.cxx:869
SVX_DLLPRIVATE void ImpSetupDrawOutlinerForPaint(bool bContourFrame, SdrOutliner &rOutliner, tools::Rectangle &rTextRect, tools::Rectangle &rAnchorRect, tools::Rectangle &rPaintRect, Fraction &aFitXCorrection) const
Definition: svdotext.cxx:1197
virtual SdrText * getActiveText() const
returns the currently active text.
Definition: svdotext.cxx:2082
SdrOutliner * mpEditingOutliner
Definition: svdotext.hxx:207
tools::Long GetMaxTextFrameWidth() const
Definition: svdotext.cxx:1731
virtual void TakeTextAnchorRect(::tools::Rectangle &rAnchorRect) const
Definition: svdotext.cxx:652
void ImpSetContourPolygon(SdrOutliner &rOutliner, tools::Rectangle const &rAnchorRect, bool bLineWidth) const
Definition: svdotext.cxx:557
virtual OutlinerParaObject * GetOutlinerParaObject() const override
Definition: svdotext.cxx:1347
bool mbIsUnchainableClone
Definition: svdotext.hxx:231
void SetText(const OUString &rStr)
Definition: svdotext.cxx:237
void NbcSetOutlinerParaObjectForText(std::optional< OutlinerParaObject > pTextObject, SdrText *pText)
Definition: svdotext.cxx:1370
void ImpCheckShear()
Definition: svdotext.cxx:416
virtual bool IsReallyEdited() const
returns true only if we are in edit mode and the user actually changed anything
Definition: svdotext.cxx:1704
virtual void onEditOutlinerStatusEvent(EditStatus *pEditStatus)
called from the SdrObjEditView during text edit when the status of the edit outliner changes
Definition: svdotext.cxx:1892
virtual void NbcReformatText() override
Definition: svdotext.cxx:1402
tools::Long GetTextLeftDistance() const
Left inner spacing to borders
Definition: svdotext.cxx:1754
tools::Rectangle maRectangle
Definition: svdotext.hxx:168
virtual OUString TakeObjNamePlural() const override
Definition: svdotext.cxx:1070
std::optional< OutlinerParaObject > CreateEditOutlinerParaObject() const
Definition: svdotext.cxx:858
GDIMetaFile * GetTextScrollMetaFileAndRectangle(tools::Rectangle &rScrollRectangle, tools::Rectangle &rPaintRectangle)
Definition: svdotext.cxx:1816
bool mbInDownScale
Definition: svdotext.hxx:262
virtual basegfx::B2DPolyPolygon TakeContour() const override
contour for TextToContour
Definition: svdotext.cxx:1106
virtual bool IsAutoGrowHeight() const
Definition: svdotext.cxx:290
bool ImpCanConvTextToCurve() const
Definition: svdotxtr.cxx:420
void ImpAutoFitText(SdrOutliner &rOutliner) const
Definition: svdotext.cxx:1244
bool mbTextAnimationAllowed
Definition: svdotext.hxx:259
virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix &rMatrix, const basegfx::B2DPolyPolygon &rPolyPolygon) override
Definition: svdotext.cxx:1624
tools::Long GetTextRightDistance() const
Right inner spacing to borders
Definition: svdotext.cxx:1759
rtl::Reference< SdrText > mxText
Definition: svdotext.hxx:199
void NbcSetText(const OUString &rStr)
Definition: svdotext.cxx:227
virtual bool IsFontwork() const
Definition: svdotext.cxx:1736
virtual bool NbcAdjustTextFrameWidthAndHeight(bool bHgt=true, bool bWdt=true)
Definition: svdotxat.cxx:241
SVX_DLLPRIVATE void ImpInitDrawOutliner(SdrOutliner &rOutl) const
Definition: svdotext.cxx:1167
virtual basegfx::B2DPolyPolygon TakeXorPoly() const override
The Xor-Polygon is required by the View to drag the object.
Definition: svdotext.cxx:1093
friend class SdrText
Definition: svdotext.hxx:162
SdrTextAniDirection GetTextAniDirection() const
Definition: svdotext.cxx:1779
static void ImpJustifyRect(tools::Rectangle &rRect)
Definition: svdotext.cxx:407
bool IsContourTextFrame() const
Definition: svdotext.cxx:1748
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() override
Definition: svdotext.cxx:66
virtual Point GetSnapPoint(sal_uInt32 i) const override
Definition: svdotext.cxx:1148
bool IsLinkedText() const
Definition: svdotext.hxx:350
bool mbDisableAutoWidthOnDragging
Definition: svdotext.hxx:256
SdrTextObj(SdrModel &rSdrModel)
Definition: svdotext.cxx:71
void SetTextSizeDirty()
Definition: svdotext.hxx:299
bool mbTextSizeDirty
Definition: svdotext.hxx:244
virtual bool HasText() const override
Definition: svdotxat.cxx:420
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage) override
Definition: svdotext.cxx:476
virtual sal_uInt32 GetSnapPointCount() const override
snap to special points of an Object (polygon points, center of circle)
Definition: svdotext.cxx:1143
const tools::Rectangle & GetGeoRect() const
Definition: svdotext.cxx:1461
static bool HasTextImpl(SdrOutliner const *pOutliner)
returns false if the given pointer is NULL or if the given SdrOutliner contains no text.
Definition: svdotext.cxx:454
virtual void SetVerticalWriting(bool bVertical)
Definition: svdotext.cxx:1503
void SetTextColumnsNumber(sal_Int16 nColumns)
Definition: svdotext.cxx:1794
virtual void TakeTextRect(SdrOutliner &rOutliner, tools::Rectangle &rTextRect, bool bNoEditText, tools::Rectangle *pAnchorRect, bool bLineWidth=true) const
Definition: svdotext.cxx:676
virtual sal_Int32 getTextCount() const override
returns the number of texts available for this object.
Definition: svdotext.cxx:2106
bool IsOutlText() const
Definition: svdotext.hxx:358
css::drawing::TextFitToSizeType GetFitToSize() const
Definition: svdotext.cxx:1451
sal_uInt16 GetFontScaleY() const
Definition: svdotext.cxx:1233
virtual bool AdjustTextFrameWidthAndHeight()
Definition: svdotxat.cxx:259
virtual rtl::Reference< SdrObject > getFullDragClone() const override
Definition: svdotext.cxx:2067
virtual void NbcSetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject) override
Definition: svdotext.cxx:1356
void onChainingEvent()
called from the SdrObjEditView during text edit when a chain of boxes is to be updated
Definition: svdotext.cxx:1981
tools::Long GetMinTextFrameWidth() const
Definition: svdotext.cxx:1726
SdrObjKind meTextKind
Definition: svdotext.hxx:215
virtual void setActiveText(sal_Int32 nIndex)
changes the current active text
Definition: svdotext.cxx:2112
SdrTextObj * mpNextInChain
Definition: svdotext.hxx:234
tools::Long GetEckenradius() const
Definition: svdotext.cxx:1711
bool IsTextFrame() const
Definition: svdotext.hxx:357
SdrTextVertAdjust GetTextVerticalAdjust() const
Definition: svdotext.cxx:374
TextChain * GetTextChain() const
Definition: svdotext.cxx:1479
void AdjustRectToTextDistance(tools::Rectangle &rAnchorRect) const
Definition: svdotext.cxx:619
virtual SdrObjKind GetObjIdentifier() const override
Definition: svdotext.cxx:449
virtual void TakeUnrotatedSnapRect(tools::Rectangle &rRect) const
Definition: svdotext.cxx:613
virtual SdrText * getText(sal_Int32 nIndex) const override
returns the nth available text.
Definition: svdotext.cxx:2091
void SetTextAnimationAllowed(bool bNew)
Definition: svdotext.cxx:1882
void ForceOutlinerParaObject()
Definition: svdotext.cxx:1466
bool mbNoShear
Definition: svdotext.hxx:243
SdrTextAniKind GetTextAniKind() const
Definition: svdotext.cxx:1774
bool IsHideContour() const
Definition: svdotext.cxx:1742
void FitFrameToTextSize()
Definition: svdotext.cxx:202
Size maTextSize
Definition: svdotext.hxx:202
bool HasTextColumnsNumber() const
Definition: svdotext.cxx:1784
void SetObjectItemNoBroadcast(const SfxPoolItem &rItem)
Definition: svdotext.cxx:2122
bool GetPreventChainable() const
Definition: svdotext.cxx:2061
void SetNextLinkInChain(SdrTextObj *)
Definition: svdotext.cxx:2023
void SetupOutlinerFormatting(SdrOutliner &rOutl, tools::Rectangle &rPaintRect) const
Setup given Outliner equivalently to SdrTextObj::Paint()
Definition: svdotext.cxx:1321
sal_Int16 GetTextColumnsNumber() const
Definition: svdotext.cxx:1789
void setRectangle(tools::Rectangle const &rRectangle)
Definition: svdotext.hxx:175
bool mbTextFrame
Definition: svdotext.hxx:242
tools::Long GetTextUpperDistance() const
Top inner spacing to borders.
Definition: svdotext.cxx:1764
virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix &rMatrix, basegfx::B2DPolyPolygon &rPolyPolygon) const override
Definition: svdotext.cxx:1589
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
Definition: svdotxtr.cxx:75
virtual bool IsVerticalWriting() const
Definition: svdotext.cxx:1487
OutlinerParaObject * GetOutlinerParaObject()
Definition: svdtext.cxx:88
void CheckPortionInfo(const SdrOutliner &rOutliner)
Definition: svdtext.cxx:41
void ReformatText()
Definition: svdtext.cxx:61
void ForceOutlinerParaObject(OutlinerMode nOutlMode)
Definition: svdtext.cxx:117
virtual void SetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject)
Definition: svdtext.cxx:72
SfxItemPool * GetPool() const
bool HasItem(sal_uInt16 nWhich, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
tools::Long AdjustWidth(tools::Long n)
constexpr tools::Long Width() const
bool IsOverflow() const
bool IsUnderflow() const
void ExecuteUnderflow(SdrOutliner *)
void ExecuteOverflow(SdrOutliner *, SdrOutliner *)
bool decompose(B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
void rotate(double fRadiant)
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
void transform(const basegfx::B2DHomMatrix &rMatrix)
bool equalZero() const
TYPE getX() const
void setY(TYPE fY)
TYPE getY() const
void setX(TYPE fX)
void flushViewObjectContacts(bool bWithHierarchy=true)
virtual void SetObjectItemDirect(const SfxPoolItem &rItem)=0
::basegfx::B2DPolygon getB2DPolygon() const
tools::Rectangle GetBoundRect() const
constexpr tools::Long GetWidth() const
constexpr void SetLeft(tools::Long v)
constexpr void SetTop(tools::Long v)
constexpr tools::Long Top() const
void SetSize(const Size &)
constexpr Point TopLeft() const
constexpr void SetRight(tools::Long v)
constexpr Size GetSize() const
void Move(tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta)
constexpr tools::Long Right() const
tools::Long AdjustTop(tools::Long nVertMoveDelta)
tools::Long AdjustRight(tools::Long nHorzMoveDelta)
constexpr void SetBottom(tools::Long v)
constexpr tools::Long GetHeight() const
tools::Long AdjustBottom(tools::Long nVertMoveDelta)
tools::Long AdjustLeft(tools::Long nHorzMoveDelta)
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
constexpr bool IsEmpty() const
static bool IsFuzzing()
void SetFontSize(const Size &)
double toRadians(D x)
OUString SvxResId(TranslateId aId)
Definition: dialmgr.cxx:24
float u
EETextFormat
EEControlBits
EditStatusFlags
DocumentType eType
OUString sName
tools::Long FRound(double fVal)
sal_Int32 nIndex
OUString aName
#define LANGUAGE_SYSTEM
#define SAL_INFO(area, stream)
aStr
bool equalZero(const T &rfVal)
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
B2DHomMatrix createScaleShearXRotateTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fShearX, double fRadiant, double fTranslateX, double fTranslateY)
B2IRange fround(const B2DRange &rRange)
OString stripStart(const OString &rIn, char c)
int i
constexpr T & temporary(T &&x)
long Long
const char GetValue[]
OUTDEV_PRINTER
OutlinerMode
#define Y
SdrMetricItem makeSdrEckenradiusItem(tools::Long nRadius)
Definition: sderitm.hxx:25
SdrOnOffItem makeSdrShadowItem(bool bShadow)
Definition: sdshitm.hxx:25
SdrTextAniDirection
Definition: sdtaditm.hxx:30
SdrOnOffItem makeSdrTextAutoGrowHeightItem(bool bAuto)
Definition: sdtagitm.hxx:25
SdrOnOffItem makeSdrTextAutoGrowWidthItem(bool bAuto)
Definition: sdtagitm.hxx:30
SdrTextVertAdjust
Definition: sdtaitm.hxx:29
@ SDRTEXTVERTADJUST_BOTTOM
Definition: sdtaitm.hxx:31
@ SDRTEXTVERTADJUST_BLOCK
Definition: sdtaitm.hxx:32
@ SDRTEXTVERTADJUST_CENTER
Definition: sdtaitm.hxx:30
@ SDRTEXTVERTADJUST_TOP
Definition: sdtaitm.hxx:29
SdrTextHorzAdjust
Definition: sdtaitm.hxx:53
@ SDRTEXTHORZADJUST_LEFT
Definition: sdtaitm.hxx:53
@ SDRTEXTHORZADJUST_BLOCK
Definition: sdtaitm.hxx:56
@ SDRTEXTHORZADJUST_CENTER
Definition: sdtaitm.hxx:54
@ SDRTEXTHORZADJUST_RIGHT
Definition: sdtaitm.hxx:55
SdrTextAniKind
Animation type for text frame.
Definition: sdtakitm.hxx:29
@ Scroll
blinking
@ Slide
scroll back and forth
@ Alternate
scroll through
SdrMetricItem makeSdrTextMinFrameHeightItem(tools::Long mnHeight)
Definition: sdtmfitm.hxx:25
SdrMetricItem makeSdrTextMinFrameWidthItem(tools::Long mnWidth)
Definition: sdtmfitm.hxx:35
static SfxItemSet & rSet
UNDERLYING_TYPE get() const
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_SHADOW(SDRATTR_SHADOW_FIRST+0)
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_AUTOGROWWIDTH(SDRATTR_MISC_FIRST+12)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_LEFTDIST(SDRATTR_MISC_FIRST+4)
constexpr TypedWhichId< SdrTextFitToSizeTypeItem > SDRATTR_TEXT_FITTOSIZE(SDRATTR_MISC_FIRST+3)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_MAXFRAMEHEIGHT(SDRATTR_MISC_FIRST+9)
constexpr TypedWhichId< SdrTextFixedCellHeightItem > SDRATTR_TEXT_USEFIXEDCELLHEIGHT(SDRATTR_MISC_FIRST+23)
constexpr TypedWhichId< SdrTextHorzAdjustItem > SDRATTR_TEXT_HORZADJUST(SDRATTR_MISC_FIRST+13)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_MINFRAMEWIDTH(SDRATTR_MISC_FIRST+10)
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_AUTOGROWHEIGHT(SDRATTR_MISC_FIRST+2)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_MINFRAMEHEIGHT(SDRATTR_MISC_FIRST+1)
constexpr TypedWhichId< SdrTextVertAdjustItem > SDRATTR_TEXT_VERTADJUST(SDRATTR_MISC_FIRST+8)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_MAXFRAMEWIDTH(SDRATTR_MISC_FIRST+11)
constexpr TypedWhichId< SdrTextAniKindItem > SDRATTR_TEXT_ANIKIND(SDRATTR_MISC_FIRST+14)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_RIGHTDIST(SDRATTR_MISC_FIRST+5)
constexpr TypedWhichId< SdrTextAniDirectionItem > SDRATTR_TEXT_ANIDIRECTION(SDRATTR_MISC_FIRST+15)
constexpr TypedWhichId< SfxInt16Item > SDRATTR_TEXTCOLUMNS_NUMBER(SDRATTR_TEXTCOLUMNS_FIRST+0)
constexpr TypedWhichId< SfxStringItem > SDRATTR_TEXT_CHAINNEXTNAME(SDRATTR_MISC_FIRST+25)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_LOWERDIST(SDRATTR_MISC_FIRST+7)
constexpr TypedWhichId< SvxWritingModeItem > SDRATTR_TEXTDIRECTION(SDRATTR_NOTPERSIST_FIRST+34)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_CORNER_RADIUS(SDRATTR_MISC_FIRST+0)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXTCOLUMNS_SPACING(SDRATTR_TEXTCOLUMNS_FIRST+1)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_UPPERDIST(SDRATTR_MISC_FIRST+6)
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_CONTOURFRAME(SDRATTR_MISC_FIRST+21)
SdrTextObj * DynCastSdrTextObj(SdrObject *pObj)
Definition: svdobj.cxx:3176
SdrObjKind
Definition: svdobjkind.hxx:25
@ OutlineText
TitleText, special text object for StarDraw.
@ TitleText
text object
static SdrObject * ImpGetObjByName(SdrObjList const *pObjList, std::u16string_view aObjName)
Definition: svdotext.cxx:1920
static void ImpUpdateChainLinks(SdrTextObj *pTextObj, std::u16string_view aNextLinkName)
Definition: svdotext.cxx:1936
tools::Polygon Rect2Poly(const tools::Rectangle &rRect, const GeoStat &rGeo)
Definition: svdtrans.cxx:467
void RotatePoly(tools::Polygon &rPoly, const Point &rRef, double sn, double cs)
Definition: svdtrans.cxx:81
void ShearPoly(tools::Polygon &rPoly, const Point &rRef, double tn)
Definition: svdtrans.cxx:147
Degree100 NormAngle36000(Degree100 a)
Normalize angle to -180.00..179.99.
Definition: svdtrans.cxx:408
void ShearPoint(Point &rPnt, const Point &rRef, double tn, bool bVShear=false)
Definition: svdtrans.hxx:109
void RotatePoint(Point &rPnt, const Point &rRef, double sn, double cs)
Definition: svdtrans.hxx:101
Left
Right
oslFileHandle & pOut
constexpr TypedWhichId< XFormTextStyleItem > XATTR_FORMTXTSTYLE(XATTR_TEXT_FIRST)
constexpr TypedWhichId< XFormTextHideFormItem > XATTR_FORMTXTHIDEFORM(XATTR_TEXT_FIRST+10)