LibreOffice Module sw (master)  1
txtfld.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 #include <fmtfld.hxx>
22 #include <txtfld.hxx>
23 #include <charfmt.hxx>
24 
25 #include <viewsh.hxx>
26 #include <doc.hxx>
27 #include <rootfrm.hxx>
28 #include <pagefrm.hxx>
29 #include <ndtxt.hxx>
30 #include <fldbas.hxx>
31 #include <viewopt.hxx>
32 #include <flyfrm.hxx>
33 #include <viewimp.hxx>
34 #include <txtatr.hxx>
35 #include <swfont.hxx>
36 #include <fntcache.hxx>
37 #include "porfld.hxx"
38 #include "porftn.hxx"
39 #include "porref.hxx"
40 #include "portox.hxx"
41 #include "porhyph.hxx"
42 #include "porfly.hxx"
43 #include "itrform2.hxx"
44 #include <chpfld.hxx>
45 #include <dbfld.hxx>
46 #include <expfld.hxx>
47 #include <docufld.hxx>
48 #include <pagedesc.hxx>
49 #include "pormulti.hxx"
50 #include <fmtmeta.hxx>
51 #include <reffld.hxx>
52 #include <flddat.hxx>
53 #include <fmtautofmt.hxx>
55 #include <sfx2/docfile.hxx>
56 #include <svl/itemiter.hxx>
57 
58 static bool lcl_IsInBody( SwFrame const *pFrame )
59 {
60  if ( pFrame->IsInDocBody() )
61  return true;
62  else
63  {
64  const SwFrame *pTmp = pFrame;
65  const SwFlyFrame *pFly;
66  while ( nullptr != (pFly = pTmp->FindFlyFrame()) )
67  pTmp = pFly->GetAnchorFrame();
68  return pTmp->IsInDocBody();
69  }
70 }
71 
73  const SwTextAttr *pHint ) const
74 {
75  SwExpandPortion *pRet = nullptr;
76  SwFrame *pFrame = m_pFrame;
77  SwField *pField = const_cast<SwField*>(pHint->GetFormatField().GetField());
78  const bool bName = rInf.GetOpt().IsFieldName();
79 
80  SwCharFormat* pChFormat = nullptr;
81  bool bNewFlyPor = false;
82  sal_uInt16 subType = 0;
83 
84  // set language
85  const_cast<SwTextFormatter*>(this)->SeekAndChg( rInf );
86  if (pField->GetLanguage() != GetFnt()->GetLanguage())
87  {
88  pField->SetLanguage( GetFnt()->GetLanguage() );
89  // let the visual note know about its new language
90  if (pField->GetTyp()->Which()==SwFieldIds::Postit)
91  const_cast<SwFormatField*> (&pHint->GetFormatField())->Broadcast( SwFormatFieldHint( &pHint->GetFormatField(), SwFormatFieldHintWhich::LANGUAGE ) );
92  }
93 
94  SwViewShell *pSh = rInf.GetVsh();
95  SwDoc *const pDoc( pSh ? pSh->GetDoc() : nullptr );
96  bool const bInClipboard( pDoc == nullptr || pDoc->IsClipBoard() );
97  bool bPlaceHolder = false;
98 
99  switch( pField->GetTyp()->Which() )
100  {
101  case SwFieldIds::Script:
102  case SwFieldIds::Postit:
103  pRet = new SwPostItsPortion( SwFieldIds::Script == pField->GetTyp()->Which() );
104  break;
105 
107  {
108  if( bName )
109  pRet = new SwFieldPortion( pField->GetFieldName() );
110  else
111  pRet = new SwCombinedPortion( pField->ExpandField(bInClipboard, pFrame->getRootFrame()) );
112  }
113  break;
114 
116  {
117  OUString const aStr( bName
118  ? pField->GetFieldName()
119  : pField->ExpandField(bInClipboard, pFrame->getRootFrame()) );
120  pRet = new SwHiddenPortion(aStr);
121  }
122  break;
123 
124  case SwFieldIds::Chapter:
125  if( !bName && pSh && !pSh->Imp()->IsUpdateExpFields() )
126  {
127  static_cast<SwChapterField*>(pField)->ChangeExpansion(*pFrame,
128  &static_txtattr_cast<SwTextField const*>(pHint)->GetTextNode());
129  }
130  {
131  OUString const aStr( bName
132  ? pField->GetFieldName()
133  : pField->ExpandField(bInClipboard, pFrame->getRootFrame()) );
134  pRet = new SwFieldPortion( aStr );
135  }
136  break;
137 
138  case SwFieldIds::DocStat:
139  if( !bName && pSh && !pSh->Imp()->IsUpdateExpFields() )
140  {
141  static_cast<SwDocStatField*>(pField)->ChangeExpansion( pFrame );
142  }
143  {
144  OUString const aStr( bName
145  ? pField->GetFieldName()
146  : pField->ExpandField(bInClipboard, pFrame->getRootFrame()) );
147  pRet = new SwFieldPortion( aStr );
148  }
149  static_cast<SwFieldPortion*>(pRet)->m_nAttrFieldType= ATTR_PAGECOOUNTFLD;
150  break;
151 
153  {
154  if( !bName && pSh && pSh->GetLayout() && !pSh->Imp()->IsUpdateExpFields() )
155  {
156  SwPageNumberFieldType *pPageNr = static_cast<SwPageNumberFieldType *>(pField->GetTyp());
157 
158  const SwRootFrame* pTmpRootFrame = pSh->GetLayout();
159  const bool bVirt = pTmpRootFrame->IsVirtPageNum();
160 
161  sal_uInt16 nVirtNum = pFrame->GetVirtPageNum();
162  sal_uInt16 nNumPages = pTmpRootFrame->GetPageNum();
163  SvxNumType nNumFormat = SvxNumType(-1);
164  if(SVX_NUM_PAGEDESC == pField->GetFormat())
165  nNumFormat = pFrame->FindPageFrame()->GetPageDesc()->GetNumType().GetNumberingType();
166  static_cast<SwPageNumberField*>(pField)
167  ->ChangeExpansion(nVirtNum, nNumPages);
168  pPageNr->ChangeExpansion(pDoc,
169  bVirt, nNumFormat != SvxNumType(-1) ? &nNumFormat : nullptr);
170  }
171  {
172  OUString const aStr( bName
173  ? pField->GetFieldName()
174  : pField->ExpandField(bInClipboard, pFrame->getRootFrame()) );
175  pRet = new SwFieldPortion( aStr );
176  }
177  static_cast<SwFieldPortion*>(pRet)->m_nAttrFieldType= ATTR_PAGENUMBERFLD;
178  break;
179  }
180  case SwFieldIds::GetExp:
181  {
182  if( !bName && pSh && !pSh->Imp()->IsUpdateExpFields() )
183  {
184  SwGetExpField* pExpField = static_cast<SwGetExpField*>(pField);
185  if( !::lcl_IsInBody( pFrame ) )
186  {
187  pExpField->ChgBodyTextFlag( false );
188  pExpField->ChangeExpansion(*pFrame,
189  *static_txtattr_cast<SwTextField const*>(pHint));
190  }
191  else if( !pExpField->IsInBodyText() )
192  {
193  // Was something else previously, thus: expand first, then convert it!
194  pExpField->ChangeExpansion(*pFrame,
195  *static_txtattr_cast<SwTextField const*>(pHint));
196  pExpField->ChgBodyTextFlag( true );
197  }
198  }
199  {
200  OUString const aStr( bName
201  ? pField->GetFieldName()
202  : pField->ExpandField(bInClipboard, pFrame->getRootFrame()) );
203  pRet = new SwFieldPortion( aStr );
204  }
205  break;
206  }
208  {
209  if( !bName )
210  {
211  SwDBField* pDBField = static_cast<SwDBField*>(pField);
212  pDBField->ChgBodyTextFlag( ::lcl_IsInBody( pFrame ) );
213  }
214  {
215  OUString const aStr( bName
216  ? pField->GetFieldName()
217  : pField->ExpandField(bInClipboard, pFrame->getRootFrame()) );
218  pRet = new SwFieldPortion(aStr);
219  }
220  break;
221  }
223  if( !bName && pSh && !pSh->Imp()->IsUpdateExpFields() )
224  {
225  static_cast<SwRefPageGetField*>(pField)->ChangeExpansion(*pFrame,
226  static_txtattr_cast<SwTextField const*>(pHint));
227  }
228  {
229  OUString const aStr( bName
230  ? pField->GetFieldName()
231  : pField->ExpandField(bInClipboard, pFrame->getRootFrame()) );
232  pRet = new SwFieldPortion(aStr);
233  }
234  break;
235 
237  if( !bName )
238  pChFormat = static_cast<SwJumpEditField*>(pField)->GetCharFormat();
239  bNewFlyPor = true;
240  bPlaceHolder = true;
241  break;
242  case SwFieldIds::GetRef:
243  subType = static_cast<SwGetRefField*>(pField)->GetSubType();
244  {
245  OUString const str( bName
246  ? pField->GetFieldName()
247  : pField->ExpandField(bInClipboard, pFrame->getRootFrame()) );
248  pRet = new SwFieldPortion(str);
249  }
250  if( subType == REF_BOOKMARK )
251  static_cast<SwFieldPortion*>(pRet)->m_nAttrFieldType = ATTR_BOOKMARKFLD;
252  else if( subType == REF_SETREFATTR )
253  static_cast<SwFieldPortion*>(pRet)->m_nAttrFieldType = ATTR_SETREFATTRFLD;
254  break;
256  subType = static_cast<SwDateTimeField*>(pField)->GetSubType();
257  {
258  OUString const str( bName
259  ? pField->GetFieldName()
260  : pField->ExpandField(bInClipboard, pFrame->getRootFrame()) );
261  pRet = new SwFieldPortion(str);
262  }
263  if( subType & DATEFLD )
264  static_cast<SwFieldPortion*>(pRet)->m_nAttrFieldType= ATTR_DATEFLD;
265  else if( subType & TIMEFLD )
266  static_cast<SwFieldPortion*>(pRet)->m_nAttrFieldType = ATTR_TIMEFLD;
267  break;
268  default:
269  {
270  OUString const aStr( bName
271  ? pField->GetFieldName()
272  : pField->ExpandField(bInClipboard, pFrame->getRootFrame()) );
273  pRet = new SwFieldPortion(aStr);
274  }
275  }
276 
277  if( bNewFlyPor )
278  {
279  std::unique_ptr<SwFont> pTmpFnt;
280  if( !bName )
281  {
282  pTmpFnt.reset(new SwFont( *m_pFont ));
283  pTmpFnt->SetDiffFnt(&pChFormat->GetAttrSet(), &m_pFrame->GetDoc().getIDocumentSettingAccess());
284  }
285  OUString const aStr( bName
286  ? pField->GetFieldName()
287  : pField->ExpandField(bInClipboard, pFrame->getRootFrame()) );
288  pRet = new SwFieldPortion(aStr, std::move(pTmpFnt), bPlaceHolder);
289  }
290 
291  return pRet;
292 }
293 
294 static SwFieldPortion * lcl_NewMetaPortion(SwTextAttr & rHint, const bool bPrefix)
295 {
296  ::sw::Meta *const pMeta(
297  static_cast<SwFormatMeta &>(rHint.GetAttr()).GetMeta() );
298  OUString fix;
299  ::sw::MetaField *const pField( dynamic_cast< ::sw::MetaField * >(pMeta) );
300  OSL_ENSURE(pField, "lcl_NewMetaPortion: no meta field?");
301  if (pField)
302  {
303  pField->GetPrefixAndSuffix(bPrefix ? &fix : nullptr, bPrefix ? nullptr : &fix);
304  }
305  return new SwFieldPortion( fix );
306 }
307 
317 {
318  const TextFrameIndex nIdx(rInfo.GetIdx());
319 
320  // sw_redlinehide: because there is a dummy character at the start of these
321  // hints, it's impossible to have ends of hints from different nodes at the
322  // same view position, so it's sufficient to check the hints of the current
323  // node. However, m_pByEndIter exists for the whole text frame, so
324  // it's necessary to iterate all hints for that purpose...
325  if (!m_pByEndIter)
326  {
328  }
329  SwTextNode const* pNode(nullptr);
330  for (SwTextAttr const* pHint = m_pByEndIter->NextAttr(pNode); pHint;
331  pHint = m_pByEndIter->NextAttr(pNode))
332  {
333  SwTextAttr & rHint(const_cast<SwTextAttr&>(*pHint));
334  TextFrameIndex const nEnd(
335  rInfo.GetTextFrame()->MapModelToView(pNode, rHint.GetAnyEnd()));
336  if (nEnd > nIdx)
337  {
338  m_pByEndIter->PrevAttr();
339  break;
340  }
341  if (nEnd == nIdx)
342  {
343  if (RES_TXTATR_METAFIELD == rHint.Which())
344  {
345  SwFieldPortion *const pPortion(
346  lcl_NewMetaPortion(rHint, false));
347  pPortion->SetNoLength(); // no CH_TXTATR at hint end!
348  return pPortion;
349  }
350  }
351  }
352  return nullptr;
353 }
354 
356 {
357  SwTextAttr *pHint = GetAttr( rInf.GetIdx() );
358  SwLinePortion *pRet = nullptr;
359  if( !pHint )
360  {
361  pRet = new SwTextPortion;
362  pRet->SetLen(TextFrameIndex(1));
363  rInf.SetLen(TextFrameIndex(1));
364  return pRet;
365  }
366 
367  switch( pHint->Which() )
368  {
369  case RES_TXTATR_FLYCNT :
370  {
371  pRet = NewFlyCntPortion( rInf, pHint );
372  break;
373  }
374  case RES_TXTATR_FTN :
375  {
376  pRet = NewFootnotePortion( rInf, pHint );
377  break;
378  }
379  case RES_TXTATR_FIELD :
380  case RES_TXTATR_ANNOTATION :
381  {
382  pRet = NewFieldPortion( rInf, pHint );
383  break;
384  }
385  case RES_TXTATR_REFMARK :
386  {
387  pRet = new SwIsoRefPortion;
388  break;
389  }
390  case RES_TXTATR_TOXMARK :
391  {
392  pRet = new SwIsoToxPortion;
393  break;
394  }
396  {
397  pRet = lcl_NewMetaPortion( *pHint, true );
398  break;
399  }
400  default: ;
401  }
402  if( !pRet )
403  {
404  const OUString aNothing;
405  pRet = new SwFieldPortion( aNothing );
406  rInf.SetLen(TextFrameIndex(1));
407  }
408  return pRet;
409 }
410 
417  const IDocumentSettingAccess* pIDSA,
418  const SwAttrSet* pFormat)
419 {
421  return;
422  TextFrameIndex const nTextLen(rInf.GetTextFrame()->GetText().getLength());
423  SwTextNode const* pNode(nullptr);
425  for (SwTextAttr const* pHint = iter.PrevAttr(&pNode); pHint;
426  pHint = iter.PrevAttr(&pNode))
427  {
428  TextFrameIndex const nHintEnd(
429  rInf.GetTextFrame()->MapModelToView(pNode, pHint->GetAnyEnd()));
430  if (nHintEnd < nTextLen)
431  {
432  break; // only those at para end are interesting
433  }
434  // Formatting for the paragraph mark is set to apply only to the
435  // (non-existent) extra character at end of the text node.
436  if (pHint->Which() == RES_TXTATR_AUTOFMT
437  && pHint->GetStart() == *pHint->End())
438  {
439  std::shared_ptr<SfxItemSet> pSet(pHint->GetAutoFormat().GetStyleHandle());
440 
441  // Check each item and in case it should be ignored, then clear it.
442  std::unique_ptr<SfxItemSet> pCleanedSet;
443  if (pSet.get())
444  {
445  pCleanedSet = pSet->Clone();
446 
447  SfxItemIter aIter(*pSet);
448  const SfxPoolItem* pItem = aIter.GetCurItem();
449  while (true)
450  {
452  pCleanedSet->ClearItem(pItem->Which());
453  else if (pFormat && pFormat->HasItem(pItem->Which()))
454  pCleanedSet->ClearItem(pItem->Which());
455 
456  if (aIter.IsAtEnd())
457  break;
458 
459  pItem = aIter.NextItem();
460  }
461  }
462 
463  // Highlightcolor also needed to be untouched, but we can't have that just by clearing the item
464  Color nSaveHighlight = pNumFnt->GetHighlightColor();
465 
466  pNumFnt->SetDiffFnt(pCleanedSet.get(), pIDSA);
467  pNumFnt->SetHighlightColor(nSaveHighlight);
468  }
469  }
470 }
471 
472 
474 {
475  if( rInf.IsNumDone() || rInf.GetTextStart() != m_nStart
476  || rInf.GetTextStart() != rInf.GetIdx() )
477  return nullptr;
478 
479  SwNumberPortion *pRet = nullptr;
480  // sw_redlinehide: at this point it's certain that pTextNd is the node with
481  // the numbering of the frame; only the actual number-vector (GetNumString)
482  // depends on the hide-mode in the layout so other calls don't need to care
483  const SwTextNode *const pTextNd = GetTextFrame()->GetTextNodeForParaProps();
484  const SwNumRule* pNumRule = pTextNd->GetNumRule();
485 
486  // Has a "valid" number?
487  // sw_redlinehide: check that pParaPropsNode is the correct one
488  assert(pTextNd->IsNumbered(m_pFrame->getRootFrame()) == pTextNd->IsNumbered(nullptr));
489  if (pTextNd->IsNumbered(m_pFrame->getRootFrame()) && pTextNd->IsCountedInList())
490  {
491  int nLevel = pTextNd->GetActualListLevel();
492 
493  if (nLevel < 0)
494  nLevel = 0;
495 
496  if (nLevel >= MAXLEVEL)
497  nLevel = MAXLEVEL - 1;
498 
499  const SwNumFormat &rNumFormat = pNumRule->Get( nLevel );
500  const bool bLeft = SvxAdjust::Left == rNumFormat.GetNumAdjust();
501  const bool bCenter = SvxAdjust::Center == rNumFormat.GetNumAdjust();
502  const bool bLabelAlignmentPosAndSpaceModeActive(
504  const sal_uInt16 nMinDist = bLabelAlignmentPosAndSpaceModeActive
505  ? 0 : rNumFormat.GetCharTextDistance();
506 
507  if( SVX_NUM_BITMAP == rNumFormat.GetNumberingType() )
508  {
509  OUString referer;
510  if (auto const sh1 = rInf.GetVsh()) {
511  if (auto const doc = sh1->GetDoc()) {
512  auto const sh2 = doc->GetPersist();
513  if (sh2 != nullptr && sh2->HasName()) {
514  referer = sh2->GetMedium()->GetName();
515  }
516  }
517  }
518  pRet = new SwGrfNumPortion( pTextNd->GetLabelFollowedBy(),
519  rNumFormat.GetBrush(), referer,
520  rNumFormat.GetGraphicOrientation(),
521  rNumFormat.GetGraphicSize(),
522  bLeft, bCenter, nMinDist,
523  bLabelAlignmentPosAndSpaceModeActive );
524  long nTmpA = rInf.GetLast()->GetAscent();
525  long nTmpD = rInf.GetLast()->Height() - nTmpA;
526  if( !rInf.IsTest() )
527  static_cast<SwGrfNumPortion*>(pRet)->SetBase( nTmpA, nTmpD, nTmpA, nTmpD );
528  }
529  else
530  {
531  // The SwFont is created dynamically and passed in the ctor,
532  // as the CharFormat only returns an SV-Font.
533  // In the dtor of SwNumberPortion, the SwFont is deleted.
534  const SwAttrSet* pFormat = rNumFormat.GetCharFormat() ?
535  &rNumFormat.GetCharFormat()->GetAttrSet() :
536  nullptr;
537  const IDocumentSettingAccess* pIDSA = pTextNd->getIDocumentSettingAccess();
538 
539  if( SVX_NUM_CHAR_SPECIAL == rNumFormat.GetNumberingType() )
540  {
541  const vcl::Font *pFormatFnt = rNumFormat.GetBulletFont();
542 
543  // Build a new bullet font basing on the current paragraph font:
544  std::unique_ptr<SwFont> pNumFnt(new SwFont( &rInf.GetCharAttr(), pIDSA ));
545 
546  // #i53199#
548  {
549  // i18463:
550  // Underline style of paragraph font should not be considered
551  // Overline style of paragraph font should not be considered
552  // Weight style of paragraph font should not be considered
553  // Posture style of paragraph font should not be considered
554  pNumFnt->SetUnderline( LINESTYLE_NONE );
555  pNumFnt->SetOverline( LINESTYLE_NONE );
556  pNumFnt->SetItalic( ITALIC_NONE, SwFontScript::Latin );
557  pNumFnt->SetItalic( ITALIC_NONE, SwFontScript::CJK );
558  pNumFnt->SetItalic( ITALIC_NONE, SwFontScript::CTL );
559  pNumFnt->SetWeight( WEIGHT_NORMAL, SwFontScript::Latin );
560  pNumFnt->SetWeight( WEIGHT_NORMAL, SwFontScript::CJK );
561  pNumFnt->SetWeight( WEIGHT_NORMAL, SwFontScript::CTL );
562  }
563 
564  // Apply the explicit attributes from the character style
565  // associated with the numbering to the new bullet font.
566  if( pFormat )
567  pNumFnt->SetDiffFnt( pFormat, pIDSA );
568 
569  checkApplyParagraphMarkFormatToNumbering(pNumFnt.get(), rInf, pIDSA, pFormat);
570 
571  if ( pFormatFnt )
572  {
573  const SwFontScript nAct = pNumFnt->GetActual();
574  pNumFnt->SetFamily( pFormatFnt->GetFamilyType(), nAct );
575  pNumFnt->SetName( pFormatFnt->GetFamilyName(), nAct );
576  pNumFnt->SetStyleName( pFormatFnt->GetStyleName(), nAct );
577  pNumFnt->SetCharSet( pFormatFnt->GetCharSet(), nAct );
578  pNumFnt->SetPitch( pFormatFnt->GetPitch(), nAct );
579  }
580 
581  // we do not allow a vertical font
582  pNumFnt->SetVertical( pNumFnt->GetOrientation(),
583  m_pFrame->IsVertical() );
584 
585  // --> OD 2008-01-23 #newlistelevelattrs#
586  pRet = new SwBulletPortion( rNumFormat.GetBulletChar(),
587  pTextNd->GetLabelFollowedBy(),
588  std::move(pNumFnt),
589  bLeft, bCenter, nMinDist,
590  bLabelAlignmentPosAndSpaceModeActive );
591  }
592  else
593  {
594  OUString aText( pTextNd->GetNumString(true, MAXLEVEL, m_pFrame->getRootFrame()) );
595  if ( !aText.isEmpty() )
596  {
597  aText += pTextNd->GetLabelFollowedBy();
598  }
599 
600  // Not just an optimization ...
601  // A number portion without text will be assigned a width of 0.
602  // The succeeding text portion will flow into the BreakCut in the BreakLine,
603  // although we have rInf.GetLast()->GetFlyPortion()!
604  if( !aText.isEmpty() )
605  {
606 
607  // Build a new numbering font basing on the current paragraph font:
608  std::unique_ptr<SwFont> pNumFnt(new SwFont( &rInf.GetCharAttr(), pIDSA ));
609 
610  // #i53199#
612  {
613  // i18463:
614  // Underline style of paragraph font should not be considered
615  pNumFnt->SetUnderline( LINESTYLE_NONE );
616  // Overline style of paragraph font should not be considered
617  pNumFnt->SetOverline( LINESTYLE_NONE );
618  }
619 
620  // Apply the explicit attributes from the character style
621  // associated with the numbering to the new bullet font.
622  if( pFormat )
623  pNumFnt->SetDiffFnt( pFormat, pIDSA );
624 
625  checkApplyParagraphMarkFormatToNumbering(pNumFnt.get(), rInf, pIDSA, pFormat);
626 
627  // we do not allow a vertical font
628  pNumFnt->SetVertical( pNumFnt->GetOrientation(), m_pFrame->IsVertical() );
629 
630  pRet = new SwNumberPortion( aText, std::move(pNumFnt),
631  bLeft, bCenter, nMinDist,
632  bLabelAlignmentPosAndSpaceModeActive );
633  }
634  }
635  }
636  }
637  return pRet;
638 }
639 
640 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxNumType GetNumberingType() const
Base class of the Writer layout elements.
Definition: frame.hxx:295
SwViewShell * GetVsh()
Definition: inftxt.hxx:228
void GetPrefixAndSuffix(OUString *const o_pPrefix, OUString *const o_pSuffix)
get prefix/suffix from the RDF repository.
Definition: fmtatr2.cxx:733
const OUString & GetFamilyName() const
const SwField * GetField() const
Definition: fmtfld.hxx:71
bool IsInDocBody() const
Definition: frame.hxx:919
LanguageType GetLanguage() const
Language at field position.
Definition: fldbas.hxx:392
OUString GetLabelFollowedBy() const
Retrieves the character following the list label, if the paragraph's list level defines one...
Definition: ndtxt.cxx:4507
SwFlyCntPortion * NewFlyCntPortion(SwTextFormatInfo &rInf, SwTextAttr *pHt) const
Sets a new portion for an object anchored as character.
Definition: itrform2.cxx:2474
SwExpandPortion * NewFieldPortion(SwTextFormatInfo &rInf, const SwTextAttr *pHt) const
Definition: txtfld.cxx:72
sal_uInt16 Height() const
Definition: possiz.hxx:44
SwViewShellImp * Imp()
Definition: viewsh.hxx:185
SwTextAttr * GetAttr(TextFrameIndex nPos) const
Returns the attribute for a position.
Definition: itratr.cxx:147
#define RES_TXTATR_METAFIELD
Definition: hintids.hxx:139
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
Definition: fldbas.hxx:387
const OUString & GetStyleName() const
const SvxBrushItem * GetBrush() const
Base class of all fields.
Definition: fldbas.hxx:279
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
Definition: langhelper.cxx:402
Definition: doc.hxx:185
bool IsNumDone() const
Definition: inftxt.hxx:634
void SetLen(TextFrameIndex const nLen)
Definition: porlin.hxx:74
Distinguish only for painting/hide.
Definition: porfld.hxx:107
SwFont * m_pFont
Definition: itratr.hxx:39
bool SeekAndChg(SwTextSizeInfo &rInf)
Definition: itrtxt.hxx:310
bool IsAtEnd() const
sal_uInt16 Which() const
Definition: txatbase.hxx:110
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
Definition: txtfrm.cxx:1282
sal_Int32 GetAnyEnd() const
end (if available), else start
Definition: txatbase.hxx:153
The root element of a Writer document layout.
Definition: rootfrm.hxx:79
For old documents the Field-Which IDs must be preserved !!!
int GetActualListLevel() const
Returns the actual list level of this text node, when it is a list item.
Definition: ndtxt.cxx:4095
FontFamily GetFamilyType()
SvxNumType
bool IsFieldName() const
Definition: viewopt.hxx:251
SwExpandPortion * TryNewNoLengthPortion(SwTextFormatInfo const &rInfo)
Try to create a new portion with zero length, for an end of a hint (where there is no CH_TXTATR)...
Definition: txtfld.cxx:316
LINESTYLE_NONE
void ChangeExpansion(SwDoc *pDoc, bool bVirtPageNum, const SvxNumType *pNumFormat)
Definition: docufld.cxx:134
const sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:95
short GetCharTextDistance() const
SwDoc * GetDoc() const
Definition: viewsh.hxx:284
const SwFormatField & GetFormatField() const
Definition: txatbase.hxx:191
SwFlyFrame * FindFlyFrame()
Definition: frame.hxx:1087
This portion represents a part of the paragraph string.
Definition: portxt.hxx:27
SVX_NUM_BITMAP
sal_uInt16 GetVirtPageNum() const
Definition: trvlfrm.cxx:1805
SVX_NUM_CHAR_SPECIAL
SwCharFormat * GetCharFormat() const
Definition: numrule.hxx:74
static SwFieldPortion * lcl_NewMetaPortion(SwTextAttr &rHint, const bool bPrefix)
Definition: txtfld.cxx:294
const SwFormatVertOrient * GetGraphicOrientation() const
Definition: number.cxx:346
const SwViewOption & GetOpt() const
Definition: inftxt.hxx:245
Used in for asian layout specialities to display up to six characters in 2 rows and 2-3 columns...
Definition: porfld.hxx:199
SwTextNode const * GetTextNodeForParaProps() const
Definition: txtfrm.cxx:1292
SwFootnotePortion * NewFootnotePortion(SwTextFormatInfo &rInf, SwTextAttr *pHt)
The portion for the Footnote Reference in the Text.
Definition: txtftn.cxx:767
FontPitch GetPitch()
void ChgBodyTextFlag(bool bIsInBody)
Set by UpdateExpFields where node position is known.
Definition: expfld.hxx:139
#define RES_TXTATR_FTN
Definition: hintids.hxx:152
SwPageFrame * FindPageFrame()
Definition: frame.hxx:658
SwPageDesc * GetPageDesc()
Definition: pagefrm.hxx:129
SwNumberPortion * NewNumberPortion(SwTextFormatInfo &rInf) const
Definition: txtfld.cxx:473
const SfxPoolItem * NextItem()
SwLinePortion * NewExtraPortion(SwTextFormatInfo &rInf)
Definition: txtfld.cxx:355
const vcl::Font * GetBulletFont() const
std::unique_ptr< sw::MergedAttrIterByEnd > m_pByEndIter
Definition: itrform2.hxx:45
WEIGHT_NORMAL
bool IsInBodyText() const
Called by formatting.
Definition: expfld.hxx:135
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
Definition: ndtxt.cxx:2812
Provides access to settings of a document.
SwFont * GetFnt()
Definition: itratr.hxx:103
#define RES_TXTATR_TOXMARK
Definition: hintids.hxx:137
TextFrameIndex GetIdx() const
Definition: inftxt.hxx:278
const IDocumentSettingAccess * getIDocumentSettingAccess() const
Provides access to the document setting interface.
Definition: node.cxx:2039
SvxAdjust GetNumAdjust() const
bool IsUpdateExpFields()
Definition: viewimp.cxx:157
ITALIC_NONE
SvxNumPositionAndSpaceMode GetPositionAndSpaceMode() const
SwTextFrame * GetTextFrame()
Definition: inftxt.hxx:291
const SwAttrSet & GetCharAttr() const
Definition: inftxt.hxx:774
void SetNoLength()
Definition: porfld.hxx:52
SwFieldType * GetTyp() const
Definition: fldbas.hxx:382
static void checkApplyParagraphMarkFormatToNumbering(SwFont *pNumFnt, SwTextFormatInfo &rInf, const IDocumentSettingAccess *pIDSA, const SwAttrSet *pFormat)
OOXML spec says that w:rPr inside w:pPr specifies formatting for the paragraph mark symbol (i...
Definition: txtfld.cxx:416
SwTextFrame * m_pFrame
Definition: itrtxt.hxx:34
Base class for anything that can be part of a line in the Writer layout.
Definition: porlin.hxx:49
const SwNumFormat & Get(sal_uInt16 i) const
Definition: number.cxx:83
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
SVX_NUM_PAGEDESC
OUString ExpandField(bool bCached, SwRootFrame const *pLayout) const
expand the field.
Definition: fldbas.cxx:412
LanguageType GetLanguage() const
Definition: swfont.hxx:279
TextFrameIndex m_nStart
Definition: itrtxt.hxx:41
#define RES_TXTATR_FIELD
Definition: hintids.hxx:150
const Size & GetGraphicSize() const
#define RES_TXTATR_AUTOFMT
Definition: hintids.hxx:140
void SetLen(const TextFrameIndex nNew)
Definition: inftxt.hxx:281
virtual void SetLanguage(LanguageType nLng)
Definition: fldbas.cxx:370
general base class for all free-flowing frames
Definition: flyfrm.hxx:60
bool IsNumbered(SwRootFrame const *pLayout=nullptr) const
Returns is this text node is numbered.
Definition: ndtxt.cxx:2887
#define RES_TXTATR_ANNOTATION
Definition: hintids.hxx:153
TextFrameIndex MapModelToView(SwTextNode const *pNode, sal_Int32 nIndex) const
Definition: txtfrm.cxx:1243
bool IsCountedInList() const
Definition: ndtxt.cxx:4238
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:208
static bool IsIgnoredCharFormatForNumbering(const sal_uInt16 nWhich)
In MS Word, the font underline setting of the paragraph end position won't affect the formatting of n...
Definition: thints.cxx:1766
bool HasItem(sal_uInt16 nWhich, const SfxPoolItem **ppItem=nullptr) const
virtual OUString GetFieldName() const
get name or content
Definition: fldbas.cxx:255
SwFontScript
Definition: swfont.hxx:119
SwLinePortion * GetLast()
Definition: inftxt.hxx:566
const Color & GetHighlightColor() const
Definition: swfont.hxx:190
#define RES_TXTATR_FLYCNT
Definition: hintids.hxx:151
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
#define RES_TXTATR_REFMARK
Definition: hintids.hxx:136
sal_Unicode GetBulletChar() const
OUString GetNumString(const bool _bInclPrefixAndSuffixStrings=true, const unsigned int _nRestrictToThisLevel=MAXLEVEL, SwRootFrame const *pLayout=nullptr) const
Returns outline of numbering string.
Definition: ndtxt.cxx:3129
const SfxPoolItem & GetAttr() const
Definition: txatbase.hxx:159
bool IsVertical() const
Definition: frame.hxx:949
SwDoc & GetDoc()
Definition: txtfrm.hxx:448
void SetDiffFnt(const SfxItemSet *pSet, const IDocumentSettingAccess *pIDocumentSettingAccess)
Definition: swfont.cxx:496
bool IsTest() const
Definition: inftxt.hxx:593
SwTextFrame * GetTextFrame()
Definition: itrtxt.hxx:134
const SwFrame * GetAnchorFrame() const
void ChangeExpansion(const SwFrame &, const SwTextField &)
For fields in header/footer/footnotes/flys: Only called by formatting!!
Definition: expfld.cxx:343
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:116
void ChgBodyTextFlag(bool bIsInBody)
set from UpdateExpFields (the Node-Position is known there)
Definition: dbfld.hxx:117
void SetHighlightColor(const Color &aNewColor)
Definition: swfont.hxx:946
SwRootFrame * GetLayout() const
Definition: viewsh.cxx:2072
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...
SwFieldIds Which() const
Definition: fldbas.hxx:265
aStr
sal_uInt16 GetPageNum() const
Definition: rootfrm.hxx:307
sal_uInt16 & GetAscent()
Definition: porlin.hxx:76
TextFrameIndex GetTextStart() const
Definition: inftxt.hxx:130
sal_uInt16 Which() const
SwRootFrame * getRootFrame()
Definition: frame.hxx:657
rtl_TextEncoding GetCharSet() const
const SfxPoolItem * GetCurItem() const
bool IsVirtPageNum() const
Definition: rootfrm.hxx:310
static bool lcl_IsInBody(SwFrame const *pFrame)
Definition: txtfld.cxx:58
const SvxNumberType & GetNumType() const
Definition: pagedesc.hxx:192