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