LibreOffice Module sw (master)  1
porfld.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <hintids.hxx>
21 
22 #include <com/sun/star/i18n/ScriptType.hpp>
23 #include <com/sun/star/i18n/XBreakIterator.hpp>
24 #include <vcl/graph.hxx>
25 #include <editeng/brushitem.hxx>
26 #include <vcl/metric.hxx>
27 #include <vcl/outdev.hxx>
28 #include <viewopt.hxx>
29 #include <SwPortionHandler.hxx>
30 #include "porlay.hxx"
31 #include "porfld.hxx"
32 #include "inftxt.hxx"
33 #include <fmtornt.hxx>
34 #include <frmatr.hxx>
35 #include <frmtool.hxx>
36 #include <viewsh.hxx>
37 #include <doc.hxx>
39 #include <rootfrm.hxx>
40 #include <breakit.hxx>
41 #include "porftn.hxx"
42 #include <accessibilityoptions.hxx>
43 #include <editeng/lrspitem.hxx>
44 #include <unicode/ubidi.h>
45 #include <bookmark.hxx>
46 
47 using namespace ::com::sun::star;
48 
50 { return (GetLen() || !m_aExpand.isEmpty() || SwLinePortion::Compress()) ? this : nullptr; }
51 
52 SwFieldPortion *SwFieldPortion::Clone( const OUString &rExpand ) const
53 {
54  std::unique_ptr<SwFont> pNewFnt;
55  if( m_pFont )
56  {
57  pNewFnt.reset(new SwFont( *m_pFont ));
58  }
59  // #i107143#
60  // pass placeholder property to created <SwFieldPortion> instance.
61  SwFieldPortion* pClone = new SwFieldPortion( rExpand, std::move(pNewFnt), m_bPlaceHolder );
62  pClone->SetNextOffset( m_nNextOffset );
63  pClone->m_bNoLength = m_bNoLength;
64  return pClone;
65 }
66 
68 {
69  OSL_ENSURE( pField, "TakeNextOffset: Missing Source" );
70  m_nNextOffset = pField->GetNextOffset();
71  m_aExpand = m_aExpand.replaceAt(0, sal_Int32(m_nNextOffset), u"");
72  m_bFollow = true;
73 }
74 
75 SwFieldPortion::SwFieldPortion(const OUString &rExpand, std::unique_ptr<SwFont> pFont, bool bPlaceHold, TextFrameIndex const nFieldLen)
76  : m_aExpand(rExpand), m_pFont(std::move(pFont)), m_nNextOffset(0)
77  , m_nNextScriptChg(COMPLETE_STRING), m_nFieldLen(nFieldLen), m_nViewWidth(0)
78  , m_bFollow( false ), m_bLeft( false), m_bHide( false)
79  , m_bCenter (false), m_bHasFollow( false )
80  , m_bAnimated( false), m_bNoPaint( false)
81  , m_bReplace( false), m_bPlaceHolder( bPlaceHold )
82  , m_bNoLength( false )
83  , m_nAttrFieldType(0)
84 {
86 }
87 
89  : SwExpandPortion( rField )
90  , m_aExpand( rField.GetExp() )
91  , m_nNextOffset( rField.GetNextOffset() )
92  , m_nNextScriptChg( rField.m_nNextScriptChg )
93  , m_nFieldLen(rField.m_nFieldLen)
94  , m_nViewWidth( rField.m_nViewWidth )
95  , m_bFollow( rField.IsFollow() )
96  , m_bLeft( rField.IsLeft() )
97  , m_bHide( rField.IsHide() )
98  , m_bCenter( rField.IsCenter() )
99  , m_bHasFollow( rField.HasFollow() )
100  , m_bAnimated ( rField.m_bAnimated )
101  , m_bNoPaint( rField.m_bNoPaint)
102  , m_bReplace( rField.m_bReplace )
103  , m_bPlaceHolder( rField.m_bPlaceHolder )
104  , m_bNoLength( rField.m_bNoLength )
105  , m_nAttrFieldType( rField.m_nAttrFieldType)
106 {
107  if ( rField.HasFont() )
108  m_pFont.reset( new SwFont( *rField.GetFont() ) );
109 
111 }
112 
114 {
115  m_pFont.reset();
116 }
117 
118 sal_uInt16 SwFieldPortion::GetViewWidth( const SwTextSizeInfo &rInf ) const
119 {
120  // even though this is const, nViewWidth should be computed at the very end:
121  SwFieldPortion* pThis = const_cast<SwFieldPortion*>(this);
122  if( !Width() && rInf.OnWin() && !rInf.GetOpt().IsPagePreview() &&
124  {
125  if( !m_nViewWidth )
126  pThis->m_nViewWidth = rInf.GetTextSize(OUString(' ')).Width();
127  }
128  else
129  pThis->m_nViewWidth = 0;
130  return m_nViewWidth;
131 }
132 
133 namespace {
134 
138 class SwFieldSlot
139 {
140  std::shared_ptr<const vcl::text::TextLayoutCache> m_pOldCachedVclData;
141  const OUString *pOldText;
142  OUString aText;
143  TextFrameIndex nIdx;
144  TextFrameIndex nLen;
145  SwTextFormatInfo *pInf;
146  bool bOn;
147 public:
148  SwFieldSlot( const SwTextFormatInfo* pNew, const SwFieldPortion *pPor );
149  ~SwFieldSlot();
150 };
151 
152 }
153 
154 SwFieldSlot::SwFieldSlot( const SwTextFormatInfo* pNew, const SwFieldPortion *pPor )
155  : pOldText(nullptr)
156  , nIdx(0)
157  , nLen(0)
158  , pInf(nullptr)
159 {
160  bOn = pPor->GetExpText( *pNew, aText );
161 
162  // The text will be replaced ...
163  if( !bOn )
164  return;
165 
166  pInf = const_cast<SwTextFormatInfo*>(pNew);
167  nIdx = pInf->GetIdx();
168  nLen = pInf->GetLen();
169  pOldText = &(pInf->GetText());
170  m_pOldCachedVclData = pInf->GetCachedVclData();
171  pInf->SetLen(TextFrameIndex(aText.getLength()));
172  pInf->SetCachedVclData(nullptr);
173  if( pPor->IsFollow() )
174  {
175  pInf->SetFakeLineStart( nIdx > pInf->GetLineStart() );
176  pInf->SetIdx(TextFrameIndex(0));
177  }
178  else
179  {
180  TextFrameIndex nEnd(pOldText->getLength());
181  if (nIdx < nEnd)
182  {
183  sal_Int32 const nFieldLen(pPor->GetFieldLen());
184  aText = (*pOldText).replaceAt(sal_Int32(nIdx), nFieldLen, aText);
185  }
186  else if (nIdx == nEnd)
187  aText = *pOldText + aText;
188  else
189  SAL_WARN("sw.core", "SwFieldSlot bad SwFieldPortion index.");
190  }
191  pInf->SetText( aText );
192 }
193 
194 SwFieldSlot::~SwFieldSlot()
195 {
196  if( bOn )
197  {
198  pInf->SetCachedVclData(m_pOldCachedVclData);
199  pInf->SetText( *pOldText );
200  pInf->SetIdx( nIdx );
201  pInf->SetLen( nLen );
202  pInf->SetFakeLineStart( false );
203  }
204 }
205 
207 {
208  OUString aText;
209  if (!GetExpText(rInf, aText) || aText.isEmpty())
210  return;
211 
212  SwFontScript nActual = m_pFont ? m_pFont->GetActual() : rInf.GetFont()->GetActual();
213  sal_uInt16 nScript = g_pBreakIt->GetBreakIter()->getScriptType( aText, 0 );
214  sal_Int32 nChg = 0;
215  if( i18n::ScriptType::WEAK == nScript )
216  {
217  nChg = g_pBreakIt->GetBreakIter()->endOfScript(aText,0,nScript);
218  if (nChg < aText.getLength() && nChg >= 0)
219  nScript = g_pBreakIt->GetBreakIter()->getScriptType( aText, nChg );
220  }
221 
222  // nNextScriptChg will be evaluated during SwFieldPortion::Format()
223 
224  if (nChg < aText.getLength() && nChg >= 0)
226  g_pBreakIt->GetBreakIter()->endOfScript(aText, nChg, nScript));
227  else
228  m_nNextScriptChg = TextFrameIndex(aText.getLength());
229 
230  SwFontScript nTmp;
231  switch ( nScript ) {
232  case i18n::ScriptType::LATIN : nTmp = SwFontScript::Latin; break;
233  case i18n::ScriptType::ASIAN : nTmp = SwFontScript::CJK; break;
234  case i18n::ScriptType::COMPLEX : nTmp = SwFontScript::CTL; break;
235  default: nTmp = nActual;
236  }
237 
238  // #i16354# Change script type for RTL text to CTL.
239  const SwScriptInfo& rSI = rInf.GetParaPortion()->GetScriptInfo();
240  // #i98418#
241  const sal_uInt8 nFieldDir = (IsNumberPortion() || IsFootnoteNumPortion())
242  ? rSI.GetDefaultDir()
243  : rSI.DirType(IsFollow() ? rInf.GetIdx() - m_nFieldLen : rInf.GetIdx());
244 
245  {
246  UErrorCode nError = U_ZERO_ERROR;
247  UBiDi* pBidi = ubidi_openSized( aText.getLength(), 0, &nError );
248  ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(aText.getStr()), aText.getLength(), nFieldDir, nullptr, &nError );
249  int32_t nEnd;
250  UBiDiLevel nCurrDir;
251  ubidi_getLogicalRun( pBidi, 0, &nEnd, &nCurrDir );
252  ubidi_close( pBidi );
253  const TextFrameIndex nNextDirChg(nEnd);
254  m_nNextScriptChg = std::min( m_nNextScriptChg, nNextDirChg );
255 
256  // #i89825# change the script type also to CTL
257  // if there is no strong LTR char in the LTR run (numbers)
258  if (nCurrDir != UBIDI_RTL &&
259  (UBIDI_LTR != nFieldDir || i18n::ScriptType::COMPLEX == nScript))
260  {
261  nCurrDir = UBIDI_RTL;
262  for( sal_Int32 nCharIdx = 0; nCharIdx < nEnd; ++nCharIdx )
263  {
264  UCharDirection nCharDir = u_charDirection ( aText[ nCharIdx ]);
265  if ( nCharDir == U_LEFT_TO_RIGHT ||
266  nCharDir == U_LEFT_TO_RIGHT_EMBEDDING ||
267  nCharDir == U_LEFT_TO_RIGHT_OVERRIDE )
268  {
269  nCurrDir = UBIDI_LTR;
270  break;
271  }
272  }
273  }
274 
275  if (nCurrDir == UBIDI_RTL)
276  {
277  nTmp = SwFontScript::CTL;
278  // If we decided that this range was RTL after all and the
279  // previous range was complex but clipped to the start of this
280  // range, then extend it to be complex over the additional RTL range
281  if (nScript == i18n::ScriptType::COMPLEX)
282  m_nNextScriptChg = nNextDirChg;
283  }
284  }
285 
286  // #i98418#
287  // keep determined script type for footnote portions as preferred script type.
288  // For footnote portions a font can not be created directly - see footnote
289  // portion format method.
290  if ( IsFootnotePortion() )
291  {
292  static_cast<SwFootnotePortion*>(this)->SetPreferredScriptType( nTmp );
293  }
294  else if ( nTmp != nActual )
295  {
296  if( !m_pFont )
297  m_pFont.reset( new SwFont( *rInf.GetFont() ) );
298  m_pFont->SetActual( nTmp );
299  }
300 
301 }
302 
304 {
305  // Scope wegen aDiffText::DTOR!
306  bool bFull = false;
307  bool bEOL = false;
308  TextFrameIndex const nTextRest = TextFrameIndex(rInf.GetText().getLength()) - rInf.GetIdx();
309  {
310  TextFrameIndex nRest;
311  SwFieldSlot aDiffText( &rInf, this );
312  SwLayoutModeModifier aLayoutModeModifier( *rInf.GetOut() );
313  aLayoutModeModifier.SetAuto();
314 
315  // Field portion has to be split in several parts if
316  // 1. There are script/direction changes inside the field
317  // 2. There are portion breaks (tab, break) inside the field:
318  const TextFrameIndex nOldFullLen = rInf.GetLen();
319  TextFrameIndex nFullLen = rInf.ScanPortionEnd(rInf.GetIdx(), rInf.GetIdx() + nOldFullLen) - rInf.GetIdx();
320  if ( m_nNextScriptChg < nFullLen )
321  {
322  nFullLen = m_nNextScriptChg;
323  rInf.SetHookChar( 0 );
324  }
325  rInf.SetLen( nFullLen );
326 
328  rInf.GetUnderScorePos() > rInf.GetIdx() )
329  rInf.SetUnderScorePos( rInf.GetIdx() );
330 
331  if( m_pFont )
332  m_pFont->AllocFontCacheId( rInf.GetVsh(), m_pFont->GetActual() );
333 
334  SwFontSave aSave( rInf, m_pFont.get() );
335 
336  // Length must be 0: the length is set for bFull after format
337  // and passed along in nRest. Or else the old length would be
338  // retained and be used for nRest!
340  TextFrameIndex const nFollow(IsFollow() ? TextFrameIndex(0) : m_nFieldLen);
341 
342  // As odd is may seem: the query for GetLen() must return false due
343  // to the ExpandPortions _after_ aDiffText (see SoftHyphs), caused
344  // by SetFull.
345  if( !nFullLen )
346  {
347  // Don't Init(), as we need height and ascent
348  Width(0);
349  bFull = rInf.Width() <= rInf.GetPos().X();
350  }
351  else
352  {
353  TextFrameIndex const nOldLineStart = rInf.GetLineStart();
354  if( IsFollow() )
355  rInf.SetLineStart(TextFrameIndex(0));
356  rInf.SetNotEOL( nFullLen == nOldFullLen && nTextRest > nFollow );
357 
358  // the height depending on the fields font is set,
359  // this is required for SwTextGuess::Guess
360  Height( rInf.GetTextHeight() + rInf.GetFont()->GetTopBorderSpace() +
361  rInf.GetFont()->GetBottomBorderSpace() );
362  // If a kerning portion is inserted after our field portion,
363  // the ascent and height must be known
364  SetAscent( rInf.GetAscent() + rInf.GetFont()->GetTopBorderSpace() );
365  bFull = SwTextPortion::Format( rInf );
366  rInf.SetNotEOL( false );
367  rInf.SetLineStart( nOldLineStart );
368  }
369  TextFrameIndex const nTmpLen = GetLen();
370  bEOL = !nTmpLen && nFollow && bFull;
371  nRest = nOldFullLen - nTmpLen;
372 
373  // The char is held in the first position
374  // Unconditionally after format!
375  SetLen( m_bNoLength ? TextFrameIndex(0) : nFollow );
376 
377  if( nRest )
378  {
379  // aExpand has not yet been shortened; the new Ofst is a
380  // result of nRest
381  TextFrameIndex nNextOfst = TextFrameIndex(m_aExpand.getLength()) - nRest;
382 
383  if ( IsQuoVadisPortion() )
384  nNextOfst = nNextOfst + TextFrameIndex(static_cast<SwQuoVadisPortion*>(this)->GetContText().getLength());
385 
386  OUString aNew( m_aExpand.copy(sal_Int32(nNextOfst)) );
387  m_aExpand = m_aExpand.copy(0, sal_Int32(nNextOfst));
388 
389  // These characters should not be contained in the follow
390  // field portion. They are handled via the HookChar mechanism.
391  const sal_Unicode nNew = !aNew.isEmpty() ? aNew[0] : 0;
392  switch (nNew)
393  {
394  case CH_BREAK : bFull = true;
395  [[fallthrough]];
396  case ' ' :
397  case CH_TAB :
398  case CHAR_HARDHYPHEN: // non-breaking hyphen
399  case CHAR_SOFTHYPHEN:
400  case CHAR_HARDBLANK:
401  case CHAR_ZWSP :
402  case CHAR_WJ :
403  case CH_TXTATR_BREAKWORD:
404  case CH_TXTATR_INWORD:
405  {
406  aNew = aNew.copy( 1 );
407  ++nNextOfst;
408  break;
409  }
410  default: ;
411  }
412 
413  // Even if there is no more text left for a follow field,
414  // we have to build a follow field portion (without font),
415  // otherwise the HookChar mechanism would not work.
416  SwFieldPortion *pField = Clone( aNew );
417  if( !aNew.isEmpty() && !pField->GetFont() )
418  {
419  pField->SetFont( std::make_unique<SwFont>( *rInf.GetFont() ) );
420  }
421  pField->SetFollow( true );
422  SetHasFollow( true );
423 
424  // For a newly created field, nNextOffset contains the Offset
425  // of its start of the original string
426  // If a FollowField is created when formatting, this FollowField's
427  // Offset is being held in nNextOffset
428  m_nNextOffset = m_nNextOffset + nNextOfst;
429  pField->SetNextOffset( m_nNextOffset );
430  rInf.SetRest( pField );
431  }
432  }
433 
434  if( bEOL && rInf.GetLast() && !rInf.GetUnderflow() )
435  rInf.GetLast()->FormatEOL( rInf );
436  return bFull;
437 }
438 
439 void SwFieldPortion::Paint( const SwTextPaintInfo &rInf ) const
440 {
441  SwFontSave aSave( rInf, m_pFont.get() );
442 
443 // OSL_ENSURE(GetLen() <= TextFrameIndex(1), "SwFieldPortion::Paint: rest-portion pollution?");
444  if( Width() && ( !m_bPlaceHolder || rInf.GetOpt().IsShowPlaceHolderFields() ) )
445  {
446  // A very liberal use of the background
447  rInf.DrawViewOpt( *this, PortionType::Field );
448  SwExpandPortion::Paint( rInf );
449  }
450 }
451 
452 bool SwFieldPortion::GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const
453 {
454  rText = m_aExpand;
455  if( rText.isEmpty() && rInf.OnWin() &&
456  !rInf.GetOpt().IsPagePreview() && !rInf.GetOpt().IsReadonly() &&
458  !HasFollow() )
459  rText = " ";
460  return true;
461 }
462 
464 {
465  sal_Int32 nH = 0;
466  sal_Int32 nW = 0;
467  if (m_pFont)
468  {
469  nH = m_pFont->GetSize(m_pFont->GetActual()).Height();
470  nW = m_pFont->GetSize(m_pFont->GetActual()).Width();
471  }
472  rPH.Special( GetLen(), m_aExpand, GetWhichPor(), nH, nW, m_pFont.get() );
473 }
474 
475 void SwFieldPortion::dumpAsXml(xmlTextWriterPtr pWriter, const OUString& rText,
476  TextFrameIndex& nOffset) const
477 {
478  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwFieldPortion"));
479  dumpAsXmlAttributes(pWriter, rText, nOffset);
480  nOffset += GetLen();
481 
482  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("expand"), BAD_CAST(m_aExpand.toUtf8().getStr()));
483 
484  (void)xmlTextWriterEndElement(pWriter);
485 }
486 
488 {
489  SwFontSave aSave( rInf, m_pFont.get() );
490  SwPosSize aSize( SwExpandPortion::GetTextSize( rInf ) );
491  return aSize;
492 }
493 
494 SwFieldPortion *SwHiddenPortion::Clone(const OUString &rExpand ) const
495 {
496  std::unique_ptr<SwFont> pNewFnt;
497  if( m_pFont )
498  pNewFnt.reset(new SwFont( *m_pFont ));
499  return new SwHiddenPortion( rExpand, std::move(pNewFnt) );
500 }
501 
502 void SwHiddenPortion::Paint( const SwTextPaintInfo &rInf ) const
503 {
504  if( Width() )
505  {
506  SwFontSave aSave( rInf, m_pFont.get() );
507  rInf.DrawViewOpt( *this, PortionType::Hidden );
508  SwExpandPortion::Paint( rInf );
509  }
510 }
511 
512 bool SwHiddenPortion::GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const
513 {
514  // Do not query for IsHidden()!
515  return SwFieldPortion::GetExpText( rInf, rText );
516 }
517 
518 SwNumberPortion::SwNumberPortion( const OUString &rExpand,
519  std::unique_ptr<SwFont> pFont,
520  const bool bLft,
521  const bool bCntr,
522  const sal_uInt16 nMinDst,
523  const bool bLabelAlignmentPosAndSpaceModeActive )
524  : SwFieldPortion( rExpand, std::move(pFont) ),
525  m_nFixWidth(0),
526  m_nMinDist( nMinDst ),
527  mbLabelAlignmentPosAndSpaceModeActive( bLabelAlignmentPosAndSpaceModeActive )
528 {
530  SetLeft( bLft );
531  SetHide( false );
532  SetCenter( bCntr );
533 }
534 
536 {
537  return TextFrameIndex(0);
538 }
539 
540 SwFieldPortion *SwNumberPortion::Clone( const OUString &rExpand ) const
541 {
542  std::unique_ptr<SwFont> pNewFnt;
543  if( m_pFont )
544  pNewFnt.reset(new SwFont( *m_pFont ));
545 
546  return new SwNumberPortion( rExpand, std::move(pNewFnt), IsLeft(), IsCenter(),
548 }
549 
557 {
558  SetHide( false );
559  const bool bFull = SwFieldPortion::Format( rInf );
561  // a numbering portion can be contained in a rotated portion!!!
562  m_nFixWidth = rInf.IsMulti() ? Height() : Width();
563  rInf.SetNumDone( !rInf.GetRest() );
564  if( rInf.IsNumDone() )
565  {
566 // SetAscent( rInf.GetAscent() );
567  OSL_ENSURE( Height() && mnAscent, "NumberPortions without Height | Ascent" );
568 
569  tools::Long nDiff( 0 );
570 
572  {
574  // #i32902#
576  {
577  nDiff = rInf.Left()
579  GetSwAttrSet().GetLRSpace().GetTextFirstLineOffset()
580  - rInf.First()
581  + rInf.ForcedLeftMargin();
582  }
583  else
584  {
585  nDiff = rInf.Left() - rInf.First() + rInf.ForcedLeftMargin();
586  }
587  }
588  // The text part of the numbering should always at least
589  // start at the left margin
590  if( nDiff < 0 )
591  nDiff = 0;
592  else if ( nDiff > rInf.X() )
593  nDiff -= rInf.X();
594  else
595  nDiff = 0;
596 
597  if( nDiff < m_nFixWidth + m_nMinDist )
598  nDiff = m_nFixWidth + m_nMinDist;
599 
600  // Numbering evades the Fly, no nDiff in the second round
601  // Tricky special case: FlyFrame is in an Area we're just about to
602  // acquire
603  // The NumberPortion is marked as hidden
604  const bool bFly = rInf.GetFly() ||
605  ( rInf.GetLast() && rInf.GetLast()->IsFlyPortion() );
606  if( nDiff > rInf.Width() )
607  {
608  nDiff = rInf.Width();
609  if ( bFly )
610  SetHide( true );
611  }
612 
613  // A numbering portion can be inside a SwRotatedPortion. Then the
614  // Height has to be changed
615  if ( rInf.IsMulti() )
616  {
617  if ( Height() < nDiff )
618  Height( nDiff );
619  }
620  else if( Width() < nDiff )
621  Width( nDiff );
622  }
623  return bFull;
624 }
625 
626 
633 {
634 
635  // This caused trouble with flys anchored as characters.
636  // If one of these is numbered but does not fit to the line,
637  // it calls this function, causing a loop because both the number
638  // portion and the fly portion go to the next line
639 // SetHide( true );
640 }
641 
642 
647 void SwNumberPortion::Paint( const SwTextPaintInfo &rInf ) const
648 {
649  if ( IsHide() && rInf.GetParaPortion() && rInf.GetParaPortion()->GetNext() )
650  {
651  SwLinePortion *pTmp = GetNextPortion();
652  while ( pTmp && !pTmp->InTextGrp() )
653  pTmp = pTmp->GetNextPortion();
654  if ( !pTmp )
655  return;
656  }
657 
658  // calculate the width of the number portion, including follows
659  const sal_uInt16 nOldWidth = Width();
660  sal_uInt16 nSumWidth = 0;
661  sal_uInt16 nOffset = 0;
662 
663  const SwLinePortion* pTmp = this;
664  while ( pTmp && pTmp->InNumberGrp() )
665  {
666  nSumWidth = nSumWidth + pTmp->Width();
667  if ( static_cast<const SwNumberPortion*>(pTmp)->HasFollow() )
668  pTmp = pTmp->GetNextPortion();
669  else
670  {
671  nOffset = pTmp->Width() - static_cast<const SwNumberPortion*>(pTmp)->m_nFixWidth;
672  break;
673  }
674  }
675 
676  // The master portion takes care for painting the background of the
677  // follow field portions
678  if ( ! IsFollow() )
679  {
680  SwNumberPortion *pThis = const_cast<SwNumberPortion*>(this);
681  pThis->Width( nSumWidth );
682  rInf.DrawViewOpt( *this, PortionType::Number );
683  pThis->Width( nOldWidth );
684  }
685 
686  if( m_aExpand.isEmpty() )
687  return;
688 
689  const SwFont *pTmpFnt = rInf.GetFont();
690  bool bPaintSpace = ( LINESTYLE_NONE != pTmpFnt->GetUnderline() ||
691  LINESTYLE_NONE != pTmpFnt->GetOverline() ||
692  STRIKEOUT_NONE != pTmpFnt->GetStrikeout() ) &&
693  !pTmpFnt->IsWordLineMode();
694  if( bPaintSpace && m_pFont )
695  bPaintSpace = ( LINESTYLE_NONE != m_pFont->GetUnderline() ||
696  LINESTYLE_NONE != m_pFont->GetOverline() ||
697  STRIKEOUT_NONE != m_pFont->GetStrikeout() ) &&
698  !m_pFont->IsWordLineMode();
699 
700  SwFontSave aSave( rInf, m_pFont.get() );
701 
702  if( m_nFixWidth == Width() && ! HasFollow() )
703  SwExpandPortion::Paint( rInf );
704  else
705  {
706  // logical const: reset width
707  SwNumberPortion *pThis = const_cast<SwNumberPortion*>(this);
708  bPaintSpace = bPaintSpace && m_nFixWidth < nOldWidth;
709  sal_uInt16 nSpaceOffs = m_nFixWidth;
710  pThis->Width( m_nFixWidth );
711 
712  if( ( IsLeft() && ! rInf.GetTextFrame()->IsRightToLeft() ) ||
713  ( ! IsLeft() && ! IsCenter() && rInf.GetTextFrame()->IsRightToLeft() ) )
714  SwExpandPortion::Paint( rInf );
715  else
716  {
717  SwTextPaintInfo aInf( rInf );
718  if( nOffset < m_nMinDist )
719  nOffset = 0;
720  else
721  {
722  if( IsCenter() )
723  {
724  /* #110778# a / 2 * 2 == a is not a tautology */
725  sal_uInt16 nTmpOffset = nOffset;
726  nOffset /= 2;
727  if( nOffset < m_nMinDist )
728  nOffset = nTmpOffset - m_nMinDist;
729  }
730  else
731  nOffset = nOffset - m_nMinDist;
732  }
733  aInf.X( aInf.X() + nOffset );
734  SwExpandPortion::Paint( aInf );
735  if( bPaintSpace )
736  nSpaceOffs = nSpaceOffs + nOffset;
737  }
738  if( bPaintSpace && nOldWidth > nSpaceOffs )
739  {
740  SwTextPaintInfo aInf( rInf );
741  aInf.X( aInf.X() + nSpaceOffs );
742 
743  // #i53199# Adjust position of underline:
744  if ( rInf.GetUnderFnt() )
745  {
746  const Point aNewPos( aInf.GetPos().X(), rInf.GetUnderFnt()->GetPos().Y() );
747  rInf.GetUnderFnt()->SetPos( aNewPos );
748  }
749 
750  pThis->Width( nOldWidth - nSpaceOffs + 12 );
751  {
752  SwTextSlot aDiffText( &aInf, this, true, false, " " );
753  aInf.DrawText( *this, aInf.GetLen(), true );
754  }
755  }
756  pThis->Width( nOldWidth );
757  }
758 }
759 
761  std::u16string_view rBulletFollowedBy,
762  std::unique_ptr<SwFont> pFont,
763  const bool bLft,
764  const bool bCntr,
765  const sal_uInt16 nMinDst,
766  const bool bLabelAlignmentPosAndSpaceModeActive )
767  : SwNumberPortion( OUString(&cBullet, 1) + rBulletFollowedBy,
768  std::move(pFont), bLft, bCntr, nMinDst,
769  bLabelAlignmentPosAndSpaceModeActive )
770 {
772 }
773 
774 #define GRFNUM_SECURE 10
775 
777  const OUString& rGraphicFollowedBy,
778  const SvxBrushItem* pGrfBrush, OUString const & referer,
779  const SwFormatVertOrient* pGrfOrient, const Size& rGrfSize,
780  const bool bLft, const bool bCntr, const sal_uInt16 nMinDst,
781  const bool bLabelAlignmentPosAndSpaceModeActive ) :
782  SwNumberPortion( rGraphicFollowedBy, nullptr, bLft, bCntr, nMinDst,
783  bLabelAlignmentPosAndSpaceModeActive ),
784  m_pBrush( new SvxBrushItem(RES_BACKGROUND) ), m_nId( 0 )
785 {
787  SetAnimated( false );
788  m_bReplace = false;
789  if( pGrfBrush )
790  {
791  m_pBrush.reset(pGrfBrush->Clone());
792  const Graphic* pGraph = pGrfBrush->GetGraphic(referer);
793  if( pGraph )
794  SetAnimated( pGraph->IsAnimated() );
795  else
796  m_bReplace = true;
797  }
798  if( pGrfOrient )
799  {
800  m_nYPos = pGrfOrient->GetPos();
801  m_eOrient = pGrfOrient->GetVertOrient();
802  }
803  else
804  {
805  m_nYPos = 0;
806  m_eOrient = text::VertOrientation::TOP;
807  }
808  Width( rGrfSize.Width() + 2 * GRFNUM_SECURE );
809  m_nFixWidth = Width();
810  m_nGrfHeight = rGrfSize.Height() + 2 * GRFNUM_SECURE;
811  Height( sal_uInt16(m_nGrfHeight) );
812  m_bNoPaint = false;
813 }
814 
816 {
817  if ( IsAnimated() )
818  {
819  Graphic* pGraph = const_cast<Graphic*>(m_pBrush->GetGraphic());
820  if (pGraph)
821  pGraph->StopAnimation( nullptr, m_nId );
822  }
823  m_pBrush.reset();
824 }
825 
827 {
828  if ( IsAnimated() )
829  {
830  Graphic* pGraph = const_cast<Graphic*>(m_pBrush->GetGraphic());
831  if (pGraph)
832  pGraph->StopAnimation( pOut, m_nId );
833  }
834 }
835 
837 {
838  SetHide( false );
839 // Width( nFixWidth );
840  sal_uInt16 nFollowedByWidth( 0 );
842  {
843  SwFieldPortion::Format( rInf );
844  nFollowedByWidth = Width();
846  }
847  Width( m_nFixWidth + nFollowedByWidth );
848  const bool bFull = rInf.Width() < rInf.X() + Width();
849  const bool bFly = rInf.GetFly() ||
850  ( rInf.GetLast() && rInf.GetLast()->IsFlyPortion() );
851  SetAscent( GetRelPos() > 0 ? GetRelPos() : 0 );
852  if( GetAscent() > Height() )
853  Height( GetAscent() );
854 
855  if( bFull )
856  {
857  Width( rInf.Width() - rInf.X() );
858  if( bFly )
859  {
861  m_bNoPaint = true;
862  rInf.SetNumDone( false );
863  return true;
864  }
865  }
866  rInf.SetNumDone( true );
867 // long nDiff = rInf.Left() - rInf.First() + rInf.ForcedLeftMargin();
869  ? 0
870  : rInf.Left() - rInf.First() + rInf.ForcedLeftMargin();
871  // The TextPortion should at least always start on the
872  // left margin
873  if( nDiff < 0 )
874  nDiff = 0;
875  else if ( nDiff > rInf.X() )
876  nDiff -= rInf.X();
877  if( nDiff < m_nFixWidth + m_nMinDist )
878  nDiff = m_nFixWidth + m_nMinDist;
879 
880  // Numbering evades Fly, no nDiff in the second round
881  // Tricky special case: FlyFrame is in the Area we were just
882  // about to get a hold of.
883  // The NumberPortion is marked as hidden
884  if( nDiff > rInf.Width() )
885  {
886  nDiff = rInf.Width();
887  if( bFly )
888  SetHide( true );
889  }
890 
891  if( Width() < nDiff )
892  Width( nDiff );
893  return bFull;
894 }
895 
896 
901 void SwGrfNumPortion::Paint( const SwTextPaintInfo &rInf ) const
902 {
903  if( m_bNoPaint )
904  return;
905  if ( IsHide() && rInf.GetParaPortion() && rInf.GetParaPortion()->GetNext() )
906  {
907  SwLinePortion *pTmp = GetNextPortion();
908  while ( pTmp && !pTmp->InTextGrp() )
909  pTmp = pTmp->GetNextPortion();
910  if ( !pTmp )
911  return;
912  }
913  Point aPos( rInf.X() + GRFNUM_SECURE, rInf.Y() - GetRelPos() + GRFNUM_SECURE );
914  tools::Long nTmpWidth = std::max( tools::Long(0), static_cast<tools::Long>(m_nFixWidth - 2 * GRFNUM_SECURE) );
915  Size aSize( nTmpWidth, GetGrfHeight() - 2 * GRFNUM_SECURE );
916 
917  const bool bTmpLeft = mbLabelAlignmentPosAndSpaceModeActive ||
918  ( IsLeft() && ! rInf.GetTextFrame()->IsRightToLeft() ) ||
919  ( ! IsLeft() && ! IsCenter() && rInf.GetTextFrame()->IsRightToLeft() );
920 
921  if( m_nFixWidth < Width() && !bTmpLeft )
922  {
923  sal_uInt16 nOffset = Width() - m_nFixWidth;
924  if( nOffset < m_nMinDist )
925  nOffset = 0;
926  else
927  {
928  if( IsCenter() )
929  {
930  nOffset /= 2;
931  if( nOffset < m_nMinDist )
932  nOffset = Width() - m_nFixWidth - m_nMinDist;
933  }
934  else
935  nOffset = nOffset - m_nMinDist;
936  }
937  aPos.AdjustX(nOffset );
938  }
939 
940  if( m_bReplace )
941  {
942  const tools::Long nTmpH = GetNextPortion() ? GetNextPortion()->GetAscent() : 120;
943  aSize = Size( nTmpH, nTmpH );
944  aPos.setY( rInf.Y() - nTmpH );
945  }
946  SwRect aTmp( aPos, aSize );
947 
948  bool bDraw = true;
949 
950  if ( IsAnimated() )
951  {
952  bDraw = !rInf.GetOpt().IsGraphic();
953  if( !m_nId )
954  {
955  SetId( reinterpret_cast<sal_IntPtr>( rInf.GetTextFrame() ) );
956  rInf.GetTextFrame()->SetAnimation();
957  }
958  if( aTmp.Overlaps( rInf.GetPaintRect() ) && !bDraw )
959  {
960  rInf.NoteAnimation();
961  const SwViewShell* pViewShell = rInf.GetVsh();
962 
963  // virtual device, not pdf export
964  if( OUTDEV_VIRDEV == rInf.GetOut()->GetOutDevType() &&
965  pViewShell && pViewShell->GetWin() )
966  {
967  Graphic* pGraph = const_cast<Graphic*>(m_pBrush->GetGraphic());
968  if (pGraph)
969  pGraph->StopAnimation(nullptr,m_nId);
971  }
972 
973  else if ( pViewShell &&
975  !pViewShell->IsPreview() &&
976  // #i9684# Stop animation during printing/pdf export.
977  pViewShell->GetWin() )
978  {
979  Graphic* pGraph = const_cast<Graphic*>(m_pBrush->GetGraphic());
980  if (pGraph)
981  {
982  const OutputDevice* pOut = rInf.GetOut();
983  assert(pOut);
984  pGraph->StartAnimation(
985  *const_cast<OutputDevice*>(pOut), aPos, aSize, m_nId);
986  }
987  }
988 
989  // pdf export, printing, preview, stop animations...
990  else
991  bDraw = true;
992  }
993  if( bDraw )
994  {
995 
996  Graphic* pGraph = const_cast<Graphic*>(m_pBrush->GetGraphic());
997  if (pGraph)
998  pGraph->StopAnimation( nullptr, m_nId );
999  }
1000  }
1001 
1002  SwRect aRepaint( rInf.GetPaintRect() );
1003  const SwTextFrame& rFrame = *rInf.GetTextFrame();
1004  if( rFrame.IsVertical() )
1005  {
1006  rFrame.SwitchHorizontalToVertical( aTmp );
1007  rFrame.SwitchHorizontalToVertical( aRepaint );
1008  }
1009 
1010  if( rFrame.IsRightToLeft() )
1011  {
1012  rFrame.SwitchLTRtoRTL( aTmp );
1013  rFrame.SwitchLTRtoRTL( aRepaint );
1014  }
1015 
1016  if( bDraw && aTmp.HasArea() )
1017  {
1018  const OutputDevice* pOut = rInf.GetOut();
1019  assert(pOut);
1020  DrawGraphic( m_pBrush.get(), *const_cast<OutputDevice*>(pOut),
1021  aTmp, aRepaint, m_bReplace ? GRFNUM_REPLACE : GRFNUM_YES );
1022  }
1023 }
1024 
1026  tools::Long nFlyAsc, tools::Long nFlyDesc )
1027 {
1029  return;
1030 
1031  SetRelPos( 0 );
1032  if ( GetOrient() == text::VertOrientation::CENTER )
1033  SetRelPos( GetGrfHeight() / 2 );
1034  else if ( GetOrient() == text::VertOrientation::TOP )
1036  else if ( GetOrient() == text::VertOrientation::BOTTOM )
1037  ;
1038  else if ( GetOrient() == text::VertOrientation::CHAR_CENTER )
1039  SetRelPos( ( GetGrfHeight() + nLnAscent - nLnDescent ) / 2 );
1040  else if ( GetOrient() == text::VertOrientation::CHAR_TOP )
1041  SetRelPos( nLnAscent );
1042  else if ( GetOrient() == text::VertOrientation::CHAR_BOTTOM )
1043  SetRelPos( GetGrfHeight() - nLnDescent );
1044  else
1045  {
1046  if( GetGrfHeight() >= nFlyAsc + nFlyDesc )
1047  {
1048  // If I'm as large as the line, I do not need to adjust
1049  // at the line; I'll leave the max. ascent unchanged
1050  SetRelPos( nFlyAsc );
1051  }
1052  else if ( GetOrient() == text::VertOrientation::LINE_CENTER )
1053  SetRelPos( ( GetGrfHeight() + nFlyAsc - nFlyDesc ) / 2 );
1054  else if ( GetOrient() == text::VertOrientation::LINE_TOP )
1055  SetRelPos( nFlyAsc );
1056  else if ( GetOrient() == text::VertOrientation::LINE_BOTTOM )
1057  SetRelPos( GetGrfHeight() - nFlyDesc );
1058  }
1059 }
1060 
1062 {
1063  OSL_ENSURE( HasAnimation(), "SwTextFrame::StopAnimation: Which Animation?" );
1064  if( !HasPara() )
1065  return;
1066 
1067  SwLineLayout *pLine = GetPara();
1068  while( pLine )
1069  {
1070  SwLinePortion *pPor = pLine->GetNextPortion();
1071  while( pPor )
1072  {
1073  if( pPor->IsGrfNumPortion() )
1074  static_cast<SwGrfNumPortion*>(pPor)->StopAnimation( pOut );
1075  // The NumberPortion is always at the first char,
1076  // which means we can cancel as soon as we've reached a portion
1077  // with a length > 0
1078  pPor = pPor->GetLen() ? nullptr : pPor->GetNextPortion();
1079  }
1080  pLine = pLine->GetLen() ? nullptr : pLine->GetNext();
1081  }
1082 }
1083 
1088  : SwFieldPortion( rText )
1089  , m_nUpPos(0)
1090  , m_nLowPos(0)
1091  , m_nProportion(55)
1092 {
1093  SetLen(TextFrameIndex(1));
1095  if( m_aExpand.getLength() > 6 )
1096  m_aExpand = m_aExpand.copy( 0, 6 );
1097 
1098  // Initialization of the scripttype array,
1099  // the arrays of width and position are filled by the format function
1100  assert(g_pBreakIt && g_pBreakIt->GetBreakIter().is());
1101 
1102  SwFontScript nScr = SW_SCRIPTS;
1103  for( sal_Int32 i = 0; i < rText.getLength(); ++i )
1104  {
1105  switch ( g_pBreakIt->GetBreakIter()->getScriptType( rText, i ) ) {
1106  case i18n::ScriptType::LATIN : nScr = SwFontScript::Latin; break;
1107  case i18n::ScriptType::ASIAN : nScr = SwFontScript::CJK; break;
1108  case i18n::ScriptType::COMPLEX : nScr = SwFontScript::CTL; break;
1109  }
1110  m_aScrType[i] = nScr;
1111  }
1112 }
1113 
1115 {
1116  OSL_ENSURE(GetLen() <= TextFrameIndex(1), "SwFieldPortion::Paint: rest-portion pollution?");
1117  if( !Width() )
1118  return;
1119 
1120  rInf.DrawBackBrush( *this );
1121  rInf.DrawViewOpt( *this, PortionType::Field );
1122 
1123  // do we have to repaint a post it portion?
1124  if( rInf.OnWin() && mpNextPortion && !mpNextPortion->Width() )
1125  mpNextPortion->PrePaint( rInf, this );
1126 
1127  const sal_Int32 nCount = m_aExpand.getLength();
1128  if( !nCount )
1129  return;
1130  OSL_ENSURE( nCount < 7, "Too much combined characters" );
1131 
1132  // the first character of the second row
1133  const sal_Int32 nTop = ( nCount + 1 ) / 2;
1134 
1135  SwFont aTmpFont( *rInf.GetFont() );
1136  aTmpFont.SetProportion( m_nProportion ); // a smaller font
1137  SwFontSave aFontSave( rInf, &aTmpFont );
1138 
1139  Point aOldPos = rInf.GetPos();
1140  Point aOutPos( aOldPos.X(), aOldPos.Y() - m_nUpPos );// Y of the first row
1141  for( sal_Int32 i = 0 ; i < nCount; ++i )
1142  {
1143  if( i == nTop ) // change the row
1144  aOutPos.setY( aOldPos.Y() + m_nLowPos ); // Y of the second row
1145  aOutPos.setX( aOldPos.X() + m_aPos[i] ); // X position
1146  const SwFontScript nAct = m_aScrType[i]; // script type
1147  aTmpFont.SetActual( nAct );
1148 
1149  // if there're more than 4 characters to display, we choose fonts
1150  // with 2/3 of the original font width.
1151  if( m_aWidth[ nAct ] )
1152  {
1153  Size aTmpSz = aTmpFont.GetSize( nAct );
1154  if( aTmpSz.Width() != m_aWidth[ nAct ] )
1155  {
1156  aTmpSz.setWidth( m_aWidth[ nAct ] );
1157  aTmpFont.SetSize( aTmpSz, nAct );
1158  }
1159  }
1160  const_cast<SwTextPaintInfo&>(rInf).SetPos( aOutPos );
1161  rInf.DrawText(m_aExpand, *this, TextFrameIndex(i), TextFrameIndex(1));
1162  }
1163  // rInf is const, so we have to take back our manipulations
1164  const_cast<SwTextPaintInfo&>(rInf).SetPos( aOldPos );
1165 
1166 }
1167 
1169 {
1170  const sal_Int32 nCount = m_aExpand.getLength();
1171  if( !nCount )
1172  {
1173  Width( 0 );
1174  return false;
1175  }
1176 
1177  OSL_ENSURE( nCount < 7, "Too much combined characters" );
1178 
1179  // If there are leading "weak"-scripttyped characters in this portion,
1180  // they get the actual scripttype.
1181  for( sal_Int32 i = 0; i < nCount && SW_SCRIPTS == m_aScrType[i]; ++i )
1182  m_aScrType[i] = rInf.GetFont()->GetActual();
1183  if( nCount > 4 )
1184  {
1185  // more than four? Ok, then we need the 2/3 font width
1186  for( sal_Int32 i = 0; i < m_aExpand.getLength(); ++i )
1187  {
1188  OSL_ENSURE( m_aScrType[i] < SW_SCRIPTS, "Combined: Script fault" );
1189  if( !m_aWidth[ m_aScrType[i] ] )
1190  {
1191  rInf.GetOut()->SetFont( rInf.GetFont()->GetFnt( m_aScrType[i] ) );
1192  m_aWidth[ m_aScrType[i] ] =
1193  o3tl::narrowing<sal_uInt16>(2 * rInf.GetOut()->GetFontMetric().GetFontSize().Width() / 3);
1194  }
1195  }
1196  }
1197 
1198  const sal_Int32 nTop = ( nCount + 1 ) / 2; // the first character of the second line
1199  SwViewShell *pSh = rInf.GetTextFrame()->getRootFrame()->GetCurrShell();
1200  SwFont aTmpFont( *rInf.GetFont() );
1201  SwFontSave aFontSave( rInf, &aTmpFont );
1202  m_nProportion = 55;
1203  // In nMainAscent/Descent we store the ascent and descent
1204  // of the original surrounding font
1205  sal_uInt16 nMaxDescent, nMaxAscent, nMaxWidth;
1206  sal_uInt16 nMainDescent = rInf.GetFont()->GetHeight( pSh, *rInf.GetOut() );
1207  const sal_uInt16 nMainAscent = rInf.GetFont()->GetAscent( pSh, *rInf.GetOut() );
1208  nMainDescent = nMainDescent - nMainAscent;
1209  // we start with a 50% font, but if we notice that the combined portion
1210  // becomes bigger than the surrounding font, we check 45% and maybe 40%.
1211  do
1212  {
1213  m_nProportion -= 5;
1214  aTmpFont.SetProportion( m_nProportion );
1215  memset( &m_aPos, 0, sizeof(m_aPos) );
1216  nMaxDescent = 0;
1217  nMaxAscent = 0;
1218  nMaxWidth = 0;
1219  m_nUpPos = m_nLowPos = 0;
1220 
1221  // Now we get the width of all characters.
1222  // The ascent and the width of the first line are stored in the
1223  // ascent member of the portion, the descent in nLowPos.
1224  // The ascent, descent and width of the second line are stored in the
1225  // local nMaxAscent, nMaxDescent and nMaxWidth variables.
1226  for( sal_Int32 i = 0; i < nCount; ++i )
1227  {
1228  SwFontScript nScrp = m_aScrType[i];
1229  aTmpFont.SetActual( nScrp );
1230  if( m_aWidth[ nScrp ] )
1231  {
1232  Size aFontSize( aTmpFont.GetSize( nScrp ) );
1233  aFontSize.setWidth( m_aWidth[ nScrp ] );
1234  aTmpFont.SetSize( aFontSize, nScrp );
1235  }
1236 
1237  SwDrawTextInfo aDrawInf(pSh, *rInf.GetOut(), m_aExpand, i, 1);
1238  Size aSize = aTmpFont.GetTextSize_( aDrawInf );
1239  const sal_uInt16 nAsc = aTmpFont.GetAscent( pSh, *rInf.GetOut() );
1240  m_aPos[ i ] = o3tl::narrowing<sal_uInt16>(aSize.Width());
1241  if( i == nTop ) // enter the second line
1242  {
1243  m_nLowPos = nMaxDescent;
1244  Height( nMaxDescent + nMaxAscent );
1245  Width( nMaxWidth );
1246  SetAscent( nMaxAscent );
1247  nMaxAscent = 0;
1248  nMaxDescent = 0;
1249  nMaxWidth = 0;
1250  }
1251  nMaxWidth = nMaxWidth + m_aPos[ i ];
1252  if( nAsc > nMaxAscent )
1253  nMaxAscent = nAsc;
1254  if( aSize.Height() - nAsc > nMaxDescent )
1255  nMaxDescent = aSize.Height() - nAsc;
1256  }
1257  // for one or two characters we double the width of the portion
1258  if( nCount < 3 )
1259  {
1260  nMaxWidth *= 2;
1261  Width( 2*Width() );
1262  if( nCount < 2 )
1263  {
1264  Height( nMaxAscent + nMaxDescent );
1265  m_nLowPos = nMaxDescent;
1266  }
1267  }
1268  Height( Height() + nMaxDescent + nMaxAscent );
1269  m_nUpPos = nMaxAscent;
1270  SetAscent( Height() - nMaxDescent - m_nLowPos );
1271  } while( m_nProportion > 40 && ( GetAscent() > nMainAscent ||
1272  Height() - GetAscent() > nMainDescent ) );
1273  // if the combined portion is smaller than the surrounding text,
1274  // the portion grows. This looks better, if there's a character background.
1275  if( GetAscent() < nMainAscent )
1276  {
1277  Height( Height() + nMainAscent - GetAscent() );
1278  SetAscent( nMainAscent );
1279  }
1280  if( Height() < nMainAscent + nMainDescent )
1281  Height( nMainAscent + nMainDescent );
1282 
1283  // We calculate the x positions of the characters in both lines...
1284  sal_uInt16 nTopDiff = 0;
1285  sal_uInt16 nBotDiff = 0;
1286  if( nMaxWidth > Width() )
1287  {
1288  nTopDiff = ( nMaxWidth - Width() ) / 2;
1289  Width( nMaxWidth );
1290  }
1291  else
1292  nBotDiff = ( Width() - nMaxWidth ) / 2;
1293  switch( nTop)
1294  {
1295  case 3: m_aPos[1] = m_aPos[0] + nTopDiff;
1296  [[fallthrough]];
1297  case 2: m_aPos[nTop-1] = Width() - m_aPos[nTop-1];
1298  }
1299  m_aPos[0] = 0;
1300  switch( nCount )
1301  {
1302  case 5: m_aPos[4] = m_aPos[3] + nBotDiff;
1303  [[fallthrough]];
1304  case 3: m_aPos[nTop] = nBotDiff; break;
1305  case 6: m_aPos[4] = m_aPos[3] + nBotDiff;
1306  [[fallthrough]];
1307  case 4: m_aPos[nTop] = 0;
1308  [[fallthrough]];
1309  case 2: m_aPos[nCount-1] = Width() - m_aPos[nCount-1];
1310  }
1311 
1312  // Does the combined portion fit the line?
1313  const bool bFull = rInf.Width() < rInf.X() + Width();
1314  if( bFull )
1315  {
1316  if( rInf.GetLineStart() == rInf.GetIdx() && (!rInf.GetLast()->InFieldGrp()
1317  || !static_cast<SwFieldPortion*>(rInf.GetLast())->IsFollow() ) )
1318  Width( rInf.Width() - rInf.X() );
1319  else
1320  {
1321  Truncate();
1322  Width( 0 );
1323  SetLen(TextFrameIndex(0));
1324  if( rInf.GetLast() )
1325  rInf.GetLast()->FormatEOL( rInf );
1326  }
1327  }
1328  return bFull;
1329 }
1330 
1331 sal_uInt16 SwCombinedPortion::GetViewWidth( const SwTextSizeInfo &rInf ) const
1332 {
1333  if( !GetLen() ) // for the dummy part at the end of the line, where
1334  return 0; // the combined portion doesn't fit.
1335  return SwFieldPortion::GetViewWidth( rInf );
1336 }
1337 
1338 SwFieldPortion *SwFieldFormDropDownPortion::Clone(const OUString &rExpand) const
1339 {
1340  return new SwFieldFormDropDownPortion(m_pFieldMark, rExpand);
1341 }
1342 
1344 {
1345  SwFieldPortion::Paint( rInf );
1346 
1347  ::sw::mark::DropDownFieldmark* pDropDownField = dynamic_cast< ::sw::mark::DropDownFieldmark* >(m_pFieldMark);
1348  if(pDropDownField)
1349  {
1350  SwRect aPaintArea;
1351  rInf.CalcRect( *this, &aPaintArea );
1352  pDropDownField->SetPortionPaintArea(aPaintArea);
1353  }
1354 }
1355 
1356 SwFieldPortion *SwFieldFormDatePortion::Clone(const OUString &/*rExpand*/) const
1357 {
1359 }
1360 
1362 {
1363  SwFieldPortion::Paint( rInf );
1364 
1365  ::sw::mark::DateFieldmark* pDateField = dynamic_cast< ::sw::mark::DateFieldmark* >(m_pFieldMark);
1366  if(pDateField)
1367  {
1368  SwRect aPaintArea;
1369  rInf.CalcRect( *this, &aPaintArea );
1370  if(m_bStart)
1371  pDateField->SetPortionPaintAreaStart(aPaintArea);
1372  else
1373  pDateField->SetPortionPaintAreaEnd(aPaintArea);
1374  }
1375 }
1376 
1377 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define CHAR_WJ
Definition: swtypes.hxx:167
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
Definition: nodeoffset.hxx:35
Fieldmark representing a date form field.
OutDevType GetOutDevType() const
SwFieldPortion(const SwFieldPortion &rField)
Definition: porfld.cxx:88
const sal_Unicode CH_BREAK
Definition: swfont.hxx:43
SwNumberPortion(const OUString &rExpand, std::unique_ptr< SwFont > pFnt, const bool bLeft, const bool bCenter, const sal_uInt16 nMinDst, const bool bLabelAlignmentPosAndSpaceModeActive)
Definition: porfld.cxx:518
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:159
void StartAnimation(OutputDevice &rOutDev, const Point &rDestPt, const Size &rDestSize, tools::Long nExtraData=0, OutputDevice *pFirstFrameOutDev=nullptr)
bool m_bFollow
Definition: porfld.hxx:45
SwViewShell * GetVsh()
Definition: inftxt.hxx:221
void DrawBackBrush(const SwLinePortion &rPor) const
Definition: inftxt.cxx:1142
bool IsGrfNumPortion() const
Definition: porlin.hxx:115
bool IsPagePreview() const
Definition: viewopt.hxx:635
bool m_bNoPaint
Definition: porfld.hxx:51
void StopAnimation(const OutputDevice *pOut)
Definition: porfld.cxx:826
sal_uInt32 sal_UCS4
sal_uInt16 m_nLowPos
Definition: porfld.hxx:216
void setWidth(tools::Long nWidth)
SwFont * GetFont()
Definition: inftxt.hxx:231
SwLineLayout * GetNext()
Definition: porlay.hxx:159
const SwAccessibilityOptions * GetAccessibilityOptions() const
Definition: viewsh.hxx:436
OUTDEV_VIRDEV
bool IsAnimated() const
Definition: porfld.hxx:192
sal_uInt8 m_nProportion
Definition: porfld.hxx:217
bool InNumberGrp() const
Definition: porlin.hxx:106
bool HasPara() const
Definition: txtfrm.hxx:820
SwTwips GetRelPos() const
Definition: porfld.hxx:197
void SetCenter(bool bNew)
Definition: porfld.hxx:92
bool IsGraphic() const
Definition: viewopt.hxx:333
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porexp.cxx:74
bool HasFont() const
Definition: porfld.hxx:68
void SwitchHorizontalToVertical(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from horizontal to vertical layout...
Definition: txtfrm.cxx:476
sal_Int16 m_eOrient
Definition: porfld.hxx:172
long Long
void dumpAsXmlAttributes(xmlTextWriterPtr writer, std::u16string_view rText, TextFrameIndex nOffset) const
Definition: porlin.cxx:330
#define SW_SCRIPTS
Definition: swfont.hxx:129
The SwPortionHandler interface implements a visitor for the layout engine's text portions.
bool IsCenter() const
Definition: porfld.hxx:91
TextFrameIndex GetUnderScorePos() const
Definition: inftxt.hxx:641
SwTwips Left() const
Definition: inftxt.hxx:542
virtual bool Format(SwTextFormatInfo &rInf) override
We can create multiple NumFields Tricky, if one enters enough previous-text in the dialog box to caus...
Definition: porfld.cxx:556
TextFrameIndex ScanPortionEnd(TextFrameIndex nStart, TextFrameIndex nEnd)
Definition: inftxt.cxx:1626
bool IsNumDone() const
Definition: inftxt.hxx:629
sal_uInt16 GetTextHeight() const
Definition: inftxt.hxx:713
SwParaPortion * GetPara()
Definition: txtcache.cxx:90
sal_uInt16 m_nViewWidth
Definition: porfld.hxx:44
#define CHAR_HARDBLANK
Definition: swtypes.hxx:161
void SetLen(TextFrameIndex const nLen)
Definition: porlin.hxx:77
tools::Long m_nId
Definition: porfld.hxx:169
sw::mark::IFieldmark * m_pFieldMark
Definition: porfld.hxx:259
std::unique_ptr< SwFont > m_pFont
Definition: porfld.hxx:39
void DrawText(const OUString &rText, const SwLinePortion &rPor, TextFrameIndex nIdx=TextFrameIndex(0), TextFrameIndex nLen=TextFrameIndex(COMPLETE_STRING), const bool bKern=false) const
Definition: inftxt.hxx:747
void SetAnimation() const
Definition: txtfrm.hxx:532
void NoteAnimation() const
Definition: inftxt.cxx:373
FontStrikeout GetStrikeout() const
Definition: swfont.hxx:276
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
bool InFieldGrp() const
Definition: porlin.hxx:108
virtual SvxBrushItem * Clone(SfxItemPool *pPool=nullptr) const override
void SetPortionPaintAreaEnd(const SwRect &rPortionPaintArea)
SwPosSize GetTextSize(OutputDevice *pOut, const SwScriptInfo *pSI, const OUString &rText, TextFrameIndex nIdx, TextFrameIndex nLen) const
Definition: inftxt.cxx:382
bool IsMulti() const
Definition: inftxt.hxx:203
sal_uInt8 DirType(const TextFrameIndex nPos) const
Definition: porlay.cxx:1841
sal_uInt16 ForcedLeftMargin() const
Definition: inftxt.hxx:551
void SetHookChar(const sal_Unicode cNew)
Definition: inftxt.hxx:621
virtual SwFieldPortion * Clone(const OUString &rExpand) const override
Definition: porfld.cxx:1356
virtual SwLinePortion * Compress()
Definition: porlin.cxx:56
virtual ~SwFieldPortion() override
Definition: porfld.cxx:113
#define CHAR_SOFTHYPHEN
Definition: swtypes.hxx:163
constexpr tools::Long Width() const
#define CH_TXTATR_BREAKWORD
Definition: hintids.hxx:173
sal_uInt16 sal_Unicode
bool IsReadonly() const
Definition: viewopt.hxx:463
SwTwips GetGrfHeight() const
Definition: porfld.hxx:198
#define CH_TXTATR_INWORD
Definition: hintids.hxx:174
virtual ~SwGrfNumPortion() override
Definition: porfld.cxx:815
#define GRFNUM_YES
Definition: frmtool.hxx:56
LINESTYLE_NONE
void SetFollow(bool bNew)
Definition: porfld.hxx:83
sal_uInt16 GetAscent(SwViewShell const *pSh, const OutputDevice &rOut)
Definition: swfont.hxx:327
void SetHasFollow(bool bNew)
Definition: porfld.hxx:95
SwBreakIt * g_pBreakIt
Definition: breakit.cxx:33
int nCount
oslFileHandle & pOut
o3tl::enumarray< SwFontScript, sal_uInt16 > m_aWidth
Definition: porfld.hxx:213
void DrawViewOpt(const SwLinePortion &rPor, PortionType nWhich, const Color *pColor=nullptr) const
Definition: inftxt.cxx:1304
FontMetric GetFontMetric() const
const Graphic * GetGraphic(OUString const &referer=OUString()) const
void DrawGraphic(const SvxBrushItem *, vcl::RenderContext &, const SwRect &rOrg, const SwRect &rOut, const sal_uInt8 nGrfNum=GRFNUM_NO, const bool bConsiderBackgroundTransparency=false)
Definition: paintfrm.cxx:1816
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:442
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: porfld.cxx:452
TextFrameIndex GetLineStart() const
Definition: inftxt.hxx:590
SwFontScript m_aScrType[6]
Definition: porfld.hxx:214
bool m_bNoLength
Definition: porfld.hxx:54
sal_Int16 GetOrient() const
Definition: porfld.hxx:199
bool IsAnimated() const
SwFontScript GetActual() const
Definition: swfont.hxx:184
virtual bool Format(SwTextFormatInfo &rInf) override
We can create multiple NumFields Tricky, if one enters enough previous-text in the dialog box to caus...
Definition: porfld.cxx:836
void SetNumDone(const bool bNew)
Definition: inftxt.hxx:630
SwTwips Y() const
Definition: inftxt.hxx:381
virtual void Special(TextFrameIndex nLength, const OUString &rText, PortionType nType, sal_Int32 nHeight=0, sal_Int32 nWidth=0, const SwFont *pFont=nullptr)=0
special portion.
virtual SwFieldPortion * Clone(const OUString &rExpand) const override
Definition: porfld.cxx:1338
SwTwips First() const
Definition: inftxt.hxx:546
SwCombinedPortion(const OUString &rExpand)
Initializes the script array and clears the width array.
Definition: porfld.cxx:1087
SwGrfNumPortion(const OUString &rGraphicFollowedBy, const SvxBrushItem *pGrfBrush, OUString const &referer, const SwFormatVertOrient *pGrfOrient, const Size &rGrfSize, const bool bLeft, const bool bCenter, const sal_uInt16 nMinDst, const bool bLabelAlignmentPosAndSpaceModeActive)
Definition: porfld.cxx:776
void CheckScript(const SwTextSizeInfo &rInf)
Definition: porfld.cxx:206
const SwViewOption & GetOpt() const
Definition: inftxt.hxx:238
SwTextNode const * GetTextNodeForParaProps() const
Definition: txtfrm.cxx:1306
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porfld.cxx:1114
void SetAnimated(bool bNew)
Definition: porfld.hxx:193
bool IsFootnoteNumPortion() const
Definition: porlin.hxx:125
void SetLeft(bool bNew)
Definition: porfld.hxx:86
void SetRelPos(SwTwips nNew)
Definition: porfld.hxx:194
int i
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: porfld.cxx:512
Collection of SwLinePortion instances, representing one line of text.
Definition: porlay.hxx:78
const Point & GetPos() const
Definition: swfont.hxx:974
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porfld.cxx:1343
void TakeNextOffset(const SwFieldPortion *pField)
Definition: porfld.cxx:67
bool IsHide() const
Definition: porfld.hxx:88
vcl::RenderContext * GetOut()
Definition: inftxt.hxx:224
const sal_Unicode CH_TAB
Definition: swfont.hxx:44
TextFrameIndex m_nNextOffset
Definition: porfld.hxx:40
SwParaPortion * GetParaPortion()
Definition: inftxt.hxx:121
void SetWhichPor(const PortionType nNew)
Definition: porlin.hxx:98
bool IsFlyPortion() const
Definition: porlin.hxx:131
bool IsPreview() const
Definition: viewsh.hxx:493
FontLineStyle GetOverline() const
Definition: swfont.hxx:274
bool IsNumberPortion() const
Definition: porlin.hxx:141
TextFrameIndex GetFieldLen() const
Definition: porfld.hxx:100
sal_uInt16 GetTopBorderSpace() const
Definition: swfont.hxx:862
bool HasArea() const
Definition: swrect.hxx:300
SwFieldFormDatePortion(sw::mark::IFieldmark *pFieldMark, bool bStart)
Definition: porfld.hxx:247
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porfld.cxx:1361
SwBulletPortion(const sal_UCS4 cCh, std::u16string_view rBulletFollowedBy, std::unique_ptr< SwFont > pFnt, const bool bLeft, const bool bCenter, const sal_uInt16 nMinDst, const bool bLabelAlignmentPosAndSpaceModeActive)
Definition: porfld.cxx:760
float u
virtual SwFieldPortion * Clone(const OUString &rExpand) const override
Definition: porfld.cxx:494
SwTwips mnAscent
Definition: porlin.hxx:58
void CalcRect(const SwLinePortion &rPor, SwRect *pRect, SwRect *pIntersect=nullptr, const bool bInsideBox=false) const
Calculate the rectangular area where the portion takes place.
Definition: inftxt.cxx:719
sal_uInt16 Width() const
Definition: inftxt.hxx:528
std::unique_ptr< SvxBrushItem > m_pBrush
Definition: porfld.hxx:168
const Size & GetFontSize() const
TextFrameIndex m_nNextScriptChg
Definition: porfld.hxx:41
void SetUnderScorePos(TextFrameIndex const nNew)
Definition: inftxt.hxx:642
#define CHAR_ZWSP
Definition: swtypes.hxx:166
bool IsLeft() const
Definition: porfld.hxx:85
TextFrameIndex GetIdx() const
Definition: inftxt.hxx:272
virtual SwLinePortion * Compress() override
Definition: porfld.cxx:49
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: porfld.cxx:1168
OUString m_aExpand
Definition: porfld.hxx:38
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: porfld.cxx:463
void SetPortionPaintAreaStart(const SwRect &rPortionPaintArea)
void PrePaint(const SwTextPaintInfo &rInf, const SwLinePortion *pLast) const
Definition: porlin.cxx:77
SwTwips Height() const
Definition: possiz.hxx:49
bool mbLabelAlignmentPosAndSpaceModeActive
Definition: porfld.hxx:136
static bool IsFieldShadings()
Definition: viewopt.hxx:671
virtual TextFrameIndex GetModelPositionForViewPoint(sal_uInt16 nOfst) const override
the parameter is actually SwTwips apparently?
Definition: porfld.cxx:535
TextFrameIndex GetLen() const
Definition: porlin.hxx:76
sal_uInt16 m_nMinDist
Definition: porfld.hxx:135
#define GRFNUM_SECURE
Definition: porfld.cxx:774
void SetPos(const Point &rPoint)
Definition: swfont.hxx:977
SwHiddenPortion(const OUString &rExpand, std::unique_ptr< SwFont > pFntL=nullptr)
Definition: porfld.hxx:121
SwTextFrame * GetTextFrame()
Definition: inftxt.hxx:285
void InvalidateWindows(const SwRect &rRect)
Definition: viewsh.cxx:556
const OUString & GetText() const
Definition: inftxt.hxx:239
TextFrameIndex m_nFieldLen
Definition: porfld.hxx:42
void dumpAsXml(xmlTextWriterPtr pWriter, const OUString &rText, TextFrameIndex &nOffset) const override
Definition: porfld.cxx:475
void SetHide(bool bNew)
Definition: porfld.hxx:89
const SwLinePortion * GetUnderflow() const
Definition: inftxt.hxx:599
void SetId(tools::Long nNew) const
Definition: porfld.hxx:195
SwTwips & GetAscent()
Definition: porlin.hxx:79
SwUnderlineFont * GetUnderFnt() const
Definition: inftxt.hxx:236
void Truncate()
Definition: porlin.hxx:209
SwLinePortion * mpNextPortion
Definition: porlin.hxx:55
const Point & GetPos() const
Definition: inftxt.hxx:429
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() const
Definition: breakit.hxx:62
FontLineStyle GetUnderline() const
Definition: swfont.hxx:272
SwTwips X() const
Definition: inftxt.hxx:379
Base class for anything that can be part of a line in the Writer layout.
Definition: porlin.hxx:51
virtual void FormatEOL(SwTextFormatInfo &rInf) override
A FormatEOL indicates that the subsequent text did not fit onto the line anymore. ...
Definition: porfld.cxx:632
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: porfld.cxx:303
#define CHAR_HARDHYPHEN
Definition: swtypes.hxx:162
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
void SetLen(const TextFrameIndex nNew)
Definition: inftxt.hxx:275
SwTwips Width() const
Definition: possiz.hxx:51
For the text replacement and restoration of SwTextSizeInfo.
Definition: inftxt.hxx:674
constexpr tools::Long Height() const
virtual sal_uInt16 GetViewWidth(const SwTextSizeInfo &rInf) const override
Definition: porfld.cxx:118
unsigned char sal_uInt8
PortionType GetWhichPor() const
Definition: porlin.hxx:99
sw::mark::IFieldmark * m_pFieldMark
Definition: porfld.hxx:241
bool IsFootnotePortion() const
Definition: porlin.hxx:126
vcl::Window * GetWin() const
Definition: viewsh.hxx:338
SwTwips GetPos() const
Definition: fmtornt.hxx:59
void SetFont(const vcl::Font &rNewFont)
SwLinePortion * GetRest()
Definition: inftxt.hxx:576
sal_uInt16 m_nFixWidth
Definition: porfld.hxx:134
void StopAnimation(const OutputDevice *pOut)
Stops the animations within numberings.
Definition: porfld.cxx:1061
bool IsFollow() const
Definition: porfld.hxx:82
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:176
bool OnWin() const
Definition: inftxt.hxx:192
bool IsRightToLeft() const
Definition: frame.hxx:987
TextFrameIndex GetLen() const
Definition: inftxt.hxx:274
sal_uInt16 GetBottomBorderSpace() const
Definition: swfont.hxx:877
const SwFont * GetFont() const
Definition: porfld.hxx:70
bool HasFollow() const
Definition: porfld.hxx:94
void SetFont(std::unique_ptr< SwFont > pNew)
Definition: porfld.hxx:56
void SetBase(tools::Long nLnAscent, tools::Long nLnDescent, tools::Long nFlyAscent, tools::Long nFlyDescent)
Definition: porfld.cxx:1025
#define GRFNUM_REPLACE
Definition: frmtool.hxx:57
void SetLineStart(TextFrameIndex const nNew)
Definition: inftxt.hxx:591
bool HasAnimation() const
Definition: txtfrm.hxx:534
bool InTextGrp() const
Definition: porlin.hxx:102
void SetPortionPaintArea(const SwRect &rPortionPaintArea)
SwTwips m_nGrfHeight
Definition: porfld.hxx:171
SwScriptInfo & GetScriptInfo()
Definition: porlay.hxx:291
SwFontScript
Definition: swfont.hxx:123
sal_Int16 GetVertOrient() const
Definition: fmtornt.hxx:54
SwLinePortion * GetLast()
Definition: inftxt.hxx:561
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porfld.cxx:502
SwFieldFormDropDownPortion(sw::mark::IFieldmark *pFieldMark, const OUString &rExpand)
Definition: porfld.hxx:230
constexpr sal_Int32 COMPLETE_STRING
Definition: swtypes.hxx:57
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porfld.cxx:439
virtual SwPosSize GetTextSize(const SwTextSizeInfo &rInfo) const override
Definition: porfld.cxx:487
virtual void Paint(const SwTextPaintInfo &rInf) const override
A hidden NumberPortion is not displayed, unless there are TextPortions in this line or there's only o...
Definition: porfld.cxx:901
virtual sal_uInt16 GetViewWidth(const SwTextSizeInfo &rInf) const override
Definition: porfld.cxx:1331
void StopAnimation(const OutputDevice *pOutputDevice, tools::Long nExtraData)
void SetNextOffset(TextFrameIndex nNew)
Definition: porfld.hxx:98
#define SAL_WARN(area, stream)
bool m_bReplace
Definition: porfld.hxx:52
SwDoc & GetDoc()
Definition: txtfrm.hxx:461
struct _xmlTextWriter * xmlTextWriterPtr
const SwRect & GetPaintRect() const
Definition: inftxt.hxx:432
virtual SwFieldPortion * Clone(const OUString &rExpand) const
Definition: porfld.cxx:52
virtual SwFieldPortion * Clone(const OUString &rExpand) const override
Definition: porfld.cxx:540
bool IsWordLineMode() const
Definition: swfont.hxx:278
sal_uInt8 GetDefaultDir() const
Definition: scriptinfo.hxx:124
STRIKEOUT_NONE
virtual void FormatEOL(SwTextFormatInfo &rInf)
Definition: porlin.cxx:266
bool IsQuoVadisPortion() const
Definition: porlin.hxx:120
void SetProportion(const sal_uInt8 nNewPropr)
Definition: swfont.hxx:769
SwFlyPortion * GetFly()
Definition: inftxt.hxx:609
virtual void Paint(const SwTextPaintInfo &rInf) const override
A hidden NumberPortion is not displayed, unless there are TextPortions in this line or there's just o...
Definition: porfld.cxx:647
SwLinePortion * GetNextPortion() const
Definition: porlin.hxx:74
const bool m_bPlaceHolder
Definition: porfld.hxx:53
sal_uInt16 m_aPos[6]
Definition: porfld.hxx:212
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:206
o3tl::strong_int< sal_Int32, struct Tag_TextFrameIndex > TextFrameIndex
Denotes a character index in a text frame at a layout level, after extent mapping from a text node at...
void SetRest(SwLinePortion *pNewRest)
Definition: inftxt.hxx:577
virtual SwPosSize GetTextSize(const SwTextSizeInfo &rInfo) const override
Definition: porexp.cxx:51
TextFrameIndex GetNextOffset() const
Definition: porfld.hxx:97
bool Overlaps(const SwRect &rRect) const
Definition: swrect.hxx:374
sal_uInt16 m_nUpPos
Definition: porfld.hxx:215
Fieldmark representing a drop-down form field.
tools::Long GetHeight() const
Definition: swfont.hxx:284
SwRootFrame * getRootFrame()
Definition: frame.hxx:679
const SvxFont & GetFnt(const SwFontScript nWhich) const
Definition: swfont.hxx:267
SwTwips m_nYPos
Definition: porfld.hxx:170
sal_uInt16 GetAscent() const
Definition: inftxt.hxx:707
bool m_bDetectedRangeSegmentation false
bool IsShowPlaceHolderFields() const
Definition: viewopt.hxx:641
void SetAscent(const SwTwips nNewAsc)
Definition: porlin.hxx:81
void SetNotEOL(const bool bNew)
Definition: inftxt.hxx:195
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo