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