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