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 <svl/itemiter.hxx>
56 
57 static bool lcl_IsInBody( SwFrame const *pFrame )
58 {
59  if ( pFrame->IsInDocBody() )
60  return true;
61  else
62  {
63  const SwFrame *pTmp = pFrame;
64  const SwFlyFrame *pFly;
65  while ( nullptr != (pFly = pTmp->FindFlyFrame()) )
66  pTmp = pFly->GetAnchorFrame();
67  return pTmp->IsInDocBody();
68  }
69 }
70 
72  const SwTextAttr *pHint ) const
73 {
74  SwExpandPortion *pRet = nullptr;
75  SwFrame *pFrame = m_pFrame;
76  SwField *pField = const_cast<SwField*>(pHint->GetFormatField().GetField());
77  const bool bName = rInf.GetOpt().IsFieldName();
78 
79  SwCharFormat* pChFormat = nullptr;
80  bool bNewFlyPor = false;
81  sal_uInt16 subType = 0;
82 
83  // set language
84  const_cast<SwTextFormatter*>(this)->SeekAndChg( rInf );
85  if (pField->GetLanguage() != GetFnt()->GetLanguage())
86  {
87  pField->SetLanguage( GetFnt()->GetLanguage() );
88  // let the visual note know about its new language
89  if (pField->GetTyp()->Which()==SwFieldIds::Postit)
90  const_cast<SwFormatField*> (&pHint->GetFormatField())->Broadcast( SwFormatFieldHint( &pHint->GetFormatField(), SwFormatFieldHintWhich::LANGUAGE ) );
91  }
92 
93  SwViewShell *pSh = rInf.GetVsh();
94  SwDoc *const pDoc( pSh ? pSh->GetDoc() : nullptr );
95  bool const bInClipboard( pDoc == nullptr || pDoc->IsClipBoard() );
96  bool bPlaceHolder = false;
97 
98  switch( pField->GetTyp()->Which() )
99  {
100  case SwFieldIds::Script:
101  case SwFieldIds::Postit:
102  pRet = new SwPostItsPortion( SwFieldIds::Script == pField->GetTyp()->Which() );
103  break;
104 
106  {
107  if( bName )
108  pRet = new SwFieldPortion( pField->GetFieldName() );
109  else
110  pRet = new SwCombinedPortion( pField->ExpandField(bInClipboard, pFrame->getRootFrame()) );
111  }
112  break;
113 
115  {
116  OUString const aStr( bName
117  ? pField->GetFieldName()
118  : pField->ExpandField(bInClipboard, pFrame->getRootFrame()) );
119  pRet = new SwHiddenPortion(aStr);
120  }
121  break;
122 
123  case SwFieldIds::Chapter:
124  if( !bName && pSh && !pSh->Imp()->IsUpdateExpFields() )
125  {
126  static_cast<SwChapterField*>(pField)->ChangeExpansion(*pFrame,
127  &static_txtattr_cast<SwTextField const*>(pHint)->GetTextNode());
128  }
129  {
130  OUString const aStr( bName
131  ? pField->GetFieldName()
132  : pField->ExpandField(bInClipboard, pFrame->getRootFrame()) );
133  pRet = new SwFieldPortion( aStr );
134  }
135  break;
136 
137  case SwFieldIds::DocStat:
138  if( !bName && pSh && !pSh->Imp()->IsUpdateExpFields() )
139  {
140  static_cast<SwDocStatField*>(pField)->ChangeExpansion( pFrame );
141  }
142  {
143  OUString const aStr( bName
144  ? pField->GetFieldName()
145  : pField->ExpandField(bInClipboard, pFrame->getRootFrame()) );
146  pRet = new SwFieldPortion( aStr );
147  }
148  static_cast<SwFieldPortion*>(pRet)->m_nAttrFieldType= ATTR_PAGECOOUNTFLD;
149  break;
150 
152  {
153  if( !bName && pSh && pSh->GetLayout() && !pSh->Imp()->IsUpdateExpFields() )
154  {
155  SwPageNumberFieldType *pPageNr = static_cast<SwPageNumberFieldType *>(pField->GetTyp());
156 
157  const SwRootFrame* pTmpRootFrame = pSh->GetLayout();
158  const bool bVirt = pTmpRootFrame->IsVirtPageNum();
159 
160  sal_uInt16 nVirtNum = pFrame->GetVirtPageNum();
161  sal_uInt16 nNumPages = pTmpRootFrame->GetPageNum();
162  SvxNumType nNumFormat = SvxNumType(-1);
163  if(SVX_NUM_PAGEDESC == pField->GetFormat())
164  nNumFormat = pFrame->FindPageFrame()->GetPageDesc()->GetNumType().GetNumberingType();
165  static_cast<SwPageNumberField*>(pField)
166  ->ChangeExpansion(nVirtNum, nNumPages);
167  pPageNr->ChangeExpansion(pDoc,
168  bVirt, nNumFormat != SvxNumType(-1) ? &nNumFormat : nullptr);
169  }
170  {
171  OUString const aStr( bName
172  ? pField->GetFieldName()
173  : pField->ExpandField(bInClipboard, pFrame->getRootFrame()) );
174  pRet = new SwFieldPortion( aStr );
175  }
176  static_cast<SwFieldPortion*>(pRet)->m_nAttrFieldType= ATTR_PAGENUMBERFLD;
177  break;
178  }
179  case SwFieldIds::GetExp:
180  {
181  if( !bName && pSh && !pSh->Imp()->IsUpdateExpFields() )
182  {
183  SwGetExpField* pExpField = static_cast<SwGetExpField*>(pField);
184  if( !::lcl_IsInBody( pFrame ) )
185  {
186  pExpField->ChgBodyTextFlag( false );
187  pExpField->ChangeExpansion(*pFrame,
188  *static_txtattr_cast<SwTextField const*>(pHint));
189  }
190  else if( !pExpField->IsInBodyText() )
191  {
192  // Was something else previously, thus: expand first, then convert it!
193  pExpField->ChangeExpansion(*pFrame,
194  *static_txtattr_cast<SwTextField const*>(pHint));
195  pExpField->ChgBodyTextFlag( true );
196  }
197  }
198  {
199  OUString const aStr( bName
200  ? pField->GetFieldName()
201  : pField->ExpandField(bInClipboard, pFrame->getRootFrame()) );
202  pRet = new SwFieldPortion( aStr );
203  }
204  break;
205  }
207  {
208  if( !bName )
209  {
210  SwDBField* pDBField = static_cast<SwDBField*>(pField);
211  pDBField->ChgBodyTextFlag( ::lcl_IsInBody( pFrame ) );
212  }
213  {
214  OUString const aStr( bName
215  ? pField->GetFieldName()
216  : pField->ExpandField(bInClipboard, pFrame->getRootFrame()) );
217  pRet = new SwFieldPortion(aStr);
218  }
219  break;
220  }
222  if( !bName && pSh && !pSh->Imp()->IsUpdateExpFields() )
223  {
224  static_cast<SwRefPageGetField*>(pField)->ChangeExpansion(*pFrame,
225  static_txtattr_cast<SwTextField const*>(pHint));
226  }
227  {
228  OUString const aStr( bName
229  ? pField->GetFieldName()
230  : pField->ExpandField(bInClipboard, pFrame->getRootFrame()) );
231  pRet = new SwFieldPortion(aStr);
232  }
233  break;
234 
236  if( !bName )
237  pChFormat = static_cast<SwJumpEditField*>(pField)->GetCharFormat();
238  bNewFlyPor = true;
239  bPlaceHolder = true;
240  break;
241  case SwFieldIds::GetRef:
242  subType = static_cast<SwGetRefField*>(pField)->GetSubType();
243  {
244  OUString const str( bName
245  ? pField->GetFieldName()
246  : pField->ExpandField(bInClipboard, pFrame->getRootFrame()) );
247  pRet = new SwFieldPortion(str);
248  }
249  if( subType == REF_BOOKMARK )
250  static_cast<SwFieldPortion*>(pRet)->m_nAttrFieldType = ATTR_BOOKMARKFLD;
251  else if( subType == REF_SETREFATTR )
252  static_cast<SwFieldPortion*>(pRet)->m_nAttrFieldType = ATTR_SETREFATTRFLD;
253  break;
255  subType = static_cast<SwDateTimeField*>(pField)->GetSubType();
256  {
257  OUString const str( bName
258  ? pField->GetFieldName()
259  : pField->ExpandField(bInClipboard, pFrame->getRootFrame()) );
260  pRet = new SwFieldPortion(str);
261  }
262  if( subType & DATEFLD )
263  static_cast<SwFieldPortion*>(pRet)->m_nAttrFieldType= ATTR_DATEFLD;
264  else if( subType & TIMEFLD )
265  static_cast<SwFieldPortion*>(pRet)->m_nAttrFieldType = ATTR_TIMEFLD;
266  break;
267  default:
268  {
269  OUString const aStr( bName
270  ? pField->GetFieldName()
271  : pField->ExpandField(bInClipboard, pFrame->getRootFrame()) );
272  pRet = new SwFieldPortion(aStr);
273  }
274  }
275 
276  if( bNewFlyPor )
277  {
278  std::unique_ptr<SwFont> pTmpFnt;
279  if( !bName )
280  {
281  pTmpFnt.reset(new SwFont( *m_pFont ));
282  pTmpFnt->SetDiffFnt(&pChFormat->GetAttrSet(), &m_pFrame->GetDoc().getIDocumentSettingAccess());
283  }
284  OUString const aStr( bName
285  ? pField->GetFieldName()
286  : pField->ExpandField(bInClipboard, pFrame->getRootFrame()) );
287  pRet = new SwFieldPortion(aStr, std::move(pTmpFnt), bPlaceHolder);
288  }
289 
290  return pRet;
291 }
292 
293 static SwFieldPortion * lcl_NewMetaPortion(SwTextAttr & rHint, const bool bPrefix)
294 {
295  ::sw::Meta *const pMeta(
296  static_cast<SwFormatMeta &>(rHint.GetAttr()).GetMeta() );
297  OUString fix;
298  ::sw::MetaField *const pField( dynamic_cast< ::sw::MetaField * >(pMeta) );
299  OSL_ENSURE(pField, "lcl_NewMetaPortion: no meta field?");
300  if (pField)
301  {
302  pField->GetPrefixAndSuffix(bPrefix ? &fix : nullptr, bPrefix ? nullptr : &fix);
303  }
304  return new SwFieldPortion( fix );
305 }
306 
316 {
317  const TextFrameIndex nIdx(rInfo.GetIdx());
318 
319  // sw_redlinehide: because there is a dummy character at the start of these
320  // hints, it's impossible to have ends of hints from different nodes at the
321  // same view position, so it's sufficient to check the hints of the current
322  // node. However, m_pByEndIter exists for the whole text frame, so
323  // it's necessary to iterate all hints for that purpose...
324  if (!m_pByEndIter)
325  {
327  }
328  SwTextNode const* pNode(nullptr);
329  for (SwTextAttr const* pHint = m_pByEndIter->NextAttr(pNode); pHint;
330  pHint = m_pByEndIter->NextAttr(pNode))
331  {
332  SwTextAttr & rHint(const_cast<SwTextAttr&>(*pHint));
333  TextFrameIndex const nEnd(
334  rInfo.GetTextFrame()->MapModelToView(pNode, *rHint.GetAnyEnd()));
335  if (nEnd > nIdx)
336  {
337  m_pByEndIter->PrevAttr();
338  break;
339  }
340  if (nEnd == nIdx)
341  {
342  if (RES_TXTATR_METAFIELD == rHint.Which())
343  {
344  SwFieldPortion *const pPortion(
345  lcl_NewMetaPortion(rHint, false));
346  pPortion->SetNoLength(); // no CH_TXTATR at hint end!
347  return pPortion;
348  }
349  }
350  }
351  return nullptr;
352 }
353 
355 {
356  SwTextAttr *pHint = GetAttr( rInf.GetIdx() );
357  SwLinePortion *pRet = nullptr;
358  if( !pHint )
359  {
360  pRet = new SwTextPortion;
361  pRet->SetLen(TextFrameIndex(1));
362  rInf.SetLen(TextFrameIndex(1));
363  return pRet;
364  }
365 
366  switch( pHint->Which() )
367  {
368  case RES_TXTATR_FLYCNT :
369  {
370  pRet = NewFlyCntPortion( rInf, pHint );
371  break;
372  }
373  case RES_TXTATR_FTN :
374  {
375  pRet = NewFootnotePortion( rInf, pHint );
376  break;
377  }
378  case RES_TXTATR_FIELD :
379  case RES_TXTATR_ANNOTATION :
380  {
381  pRet = NewFieldPortion( rInf, pHint );
382  break;
383  }
384  case RES_TXTATR_REFMARK :
385  {
386  pRet = new SwIsoRefPortion;
387  break;
388  }
389  case RES_TXTATR_TOXMARK :
390  {
391  pRet = new SwIsoToxPortion;
392  break;
393  }
395  {
396  pRet = lcl_NewMetaPortion( *pHint, true );
397  break;
398  }
399  default: ;
400  }
401  if( !pRet )
402  {
403  const OUString aNothing;
404  pRet = new SwFieldPortion( aNothing );
405  rInf.SetLen(TextFrameIndex(1));
406  }
407  return pRet;
408 }
409 
416  const IDocumentSettingAccess* pIDSA,
417  const SwAttrSet* pFormat)
418 {
420  return;
421  TextFrameIndex const nTextLen(rInf.GetTextFrame()->GetText().getLength());
422  SwTextNode const* pNode(nullptr);
424  for (SwTextAttr const* pHint = iter.PrevAttr(&pNode); pHint;
425  pHint = iter.PrevAttr(&pNode))
426  {
427  TextFrameIndex const nHintEnd(
428  rInf.GetTextFrame()->MapModelToView(pNode, *pHint->GetAnyEnd()));
429  if (nHintEnd < nTextLen)
430  {
431  break; // only those at para end are interesting
432  }
433  // Formatting for the paragraph mark is set to apply only to the
434  // (non-existent) extra character at end of the text node.
435  if (pHint->Which() == RES_TXTATR_AUTOFMT
436  && pHint->GetStart() == *pHint->End())
437  {
438  std::shared_ptr<SfxItemSet> pSet(pHint->GetAutoFormat().GetStyleHandle());
439 
440  // Check each item and in case it should be ignored, then clear it.
441  std::unique_ptr<SfxItemSet> pCleanedSet;
442  if (pSet.get())
443  {
444  pCleanedSet = pSet->Clone();
445 
446  SfxItemIter aIter(*pSet);
447  const SfxPoolItem* pItem = aIter.GetCurItem();
448  while (true)
449  {
451  pCleanedSet->ClearItem(pItem->Which());
452  else if (pFormat && pFormat->HasItem(pItem->Which()))
453  pCleanedSet->ClearItem(pItem->Which());
454 
455  if (aIter.IsAtEnd())
456  break;
457 
458  pItem = aIter.NextItem();
459  }
460  }
461 
462  // Highlightcolor also needed to be untouched, but we can't have that just by clearing the item
463  Color nSaveHighlight = pNumFnt->GetHighlightColor();
464 
465  pNumFnt->SetDiffFnt(pCleanedSet.get(), pIDSA);
466  pNumFnt->SetHighlightColor(nSaveHighlight);
467  }
468  }
469 }
470 
471 
473 {
474  if( rInf.IsNumDone() || rInf.GetTextStart() != m_nStart
475  || rInf.GetTextStart() != rInf.GetIdx() )
476  return nullptr;
477 
478  SwNumberPortion *pRet = nullptr;
479  // sw_redlinehide: at this point it's certain that pTextNd is the node with
480  // the numbering of the frame; only the actual number-vector (GetNumString)
481  // depends on the hide-mode in the layout so other calls don't need to care
482  const SwTextNode *const pTextNd = GetTextFrame()->GetTextNodeForParaProps();
483  const SwNumRule* pNumRule = pTextNd->GetNumRule();
484 
485  // Has a "valid" number?
486  // sw_redlinehide: check that pParaPropsNode is the correct one
487  assert(pTextNd->IsNumbered(m_pFrame->getRootFrame()) == pTextNd->IsNumbered(nullptr));
488  if (pTextNd->IsNumbered(m_pFrame->getRootFrame()) && pTextNd->IsCountedInList())
489  {
490  int nLevel = pTextNd->GetActualListLevel();
491 
492  if (nLevel < 0)
493  nLevel = 0;
494 
495  if (nLevel >= MAXLEVEL)
496  nLevel = MAXLEVEL - 1;
497 
498  const SwNumFormat &rNumFormat = pNumRule->Get( nLevel );
499  const bool bLeft = SvxAdjust::Left == rNumFormat.GetNumAdjust();
500  const bool bCenter = SvxAdjust::Center == rNumFormat.GetNumAdjust();
501  const bool bLabelAlignmentPosAndSpaceModeActive(
503  const sal_uInt16 nMinDist = bLabelAlignmentPosAndSpaceModeActive
504  ? 0 : rNumFormat.GetCharTextDistance();
505 
506  if( SVX_NUM_BITMAP == rNumFormat.GetNumberingType() )
507  {
508  pRet = new SwGrfNumPortion( pTextNd->GetLabelFollowedBy(),
509  rNumFormat.GetBrush(),
510  rNumFormat.GetGraphicOrientation(),
511  rNumFormat.GetGraphicSize(),
512  bLeft, bCenter, nMinDist,
513  bLabelAlignmentPosAndSpaceModeActive );
514  long nTmpA = rInf.GetLast()->GetAscent();
515  long nTmpD = rInf.GetLast()->Height() - nTmpA;
516  if( !rInf.IsTest() )
517  static_cast<SwGrfNumPortion*>(pRet)->SetBase( nTmpA, nTmpD, nTmpA, nTmpD );
518  }
519  else
520  {
521  // The SwFont is created dynamically and passed in the ctor,
522  // as the CharFormat only returns an SV-Font.
523  // In the dtor of SwNumberPortion, the SwFont is deleted.
524  const SwAttrSet* pFormat = rNumFormat.GetCharFormat() ?
525  &rNumFormat.GetCharFormat()->GetAttrSet() :
526  nullptr;
527  const IDocumentSettingAccess* pIDSA = pTextNd->getIDocumentSettingAccess();
528 
529  if( SVX_NUM_CHAR_SPECIAL == rNumFormat.GetNumberingType() )
530  {
531  const vcl::Font *pFormatFnt = rNumFormat.GetBulletFont();
532 
533  // Build a new bullet font basing on the current paragraph font:
534  std::unique_ptr<SwFont> pNumFnt(new SwFont( &rInf.GetCharAttr(), pIDSA ));
535 
536  // #i53199#
538  {
539  // i18463:
540  // Underline style of paragraph font should not be considered
541  // Overline style of paragraph font should not be considered
542  // Weight style of paragraph font should not be considered
543  // Posture style of paragraph font should not be considered
544  pNumFnt->SetUnderline( LINESTYLE_NONE );
545  pNumFnt->SetOverline( LINESTYLE_NONE );
546  pNumFnt->SetItalic( ITALIC_NONE, SwFontScript::Latin );
547  pNumFnt->SetItalic( ITALIC_NONE, SwFontScript::CJK );
548  pNumFnt->SetItalic( ITALIC_NONE, SwFontScript::CTL );
549  pNumFnt->SetWeight( WEIGHT_NORMAL, SwFontScript::Latin );
550  pNumFnt->SetWeight( WEIGHT_NORMAL, SwFontScript::CJK );
551  pNumFnt->SetWeight( WEIGHT_NORMAL, SwFontScript::CTL );
552  }
553 
554  // Apply the explicit attributes from the character style
555  // associated with the numbering to the new bullet font.
556  if( pFormat )
557  pNumFnt->SetDiffFnt( pFormat, pIDSA );
558 
559  checkApplyParagraphMarkFormatToNumbering(pNumFnt.get(), rInf, pIDSA, pFormat);
560 
561  if ( pFormatFnt )
562  {
563  const SwFontScript nAct = pNumFnt->GetActual();
564  pNumFnt->SetFamily( pFormatFnt->GetFamilyType(), nAct );
565  pNumFnt->SetName( pFormatFnt->GetFamilyName(), nAct );
566  pNumFnt->SetStyleName( pFormatFnt->GetStyleName(), nAct );
567  pNumFnt->SetCharSet( pFormatFnt->GetCharSet(), nAct );
568  pNumFnt->SetPitch( pFormatFnt->GetPitch(), nAct );
569  }
570 
571  // we do not allow a vertical font
572  pNumFnt->SetVertical( pNumFnt->GetOrientation(),
573  m_pFrame->IsVertical() );
574 
575  // --> OD 2008-01-23 #newlistelevelattrs#
576  pRet = new SwBulletPortion( rNumFormat.GetBulletChar(),
577  pTextNd->GetLabelFollowedBy(),
578  std::move(pNumFnt),
579  bLeft, bCenter, nMinDist,
580  bLabelAlignmentPosAndSpaceModeActive );
581  }
582  else
583  {
584  OUString aText( pTextNd->GetNumString(true, MAXLEVEL, m_pFrame->getRootFrame()) );
585  if ( !aText.isEmpty() )
586  {
587  aText += pTextNd->GetLabelFollowedBy();
588  }
589 
590  // Not just an optimization ...
591  // A number portion without text will be assigned a width of 0.
592  // The succeeding text portion will flow into the BreakCut in the BreakLine,
593  // although we have rInf.GetLast()->GetFlyPortion()!
594  if( !aText.isEmpty() )
595  {
596 
597  // Build a new numbering font basing on the current paragraph font:
598  std::unique_ptr<SwFont> pNumFnt(new SwFont( &rInf.GetCharAttr(), pIDSA ));
599 
600  // #i53199#
602  {
603  // i18463:
604  // Underline style of paragraph font should not be considered
605  pNumFnt->SetUnderline( LINESTYLE_NONE );
606  // Overline style of paragraph font should not be considered
607  pNumFnt->SetOverline( LINESTYLE_NONE );
608  }
609 
610  // Apply the explicit attributes from the character style
611  // associated with the numbering to the new bullet font.
612  if( pFormat )
613  pNumFnt->SetDiffFnt( pFormat, pIDSA );
614 
615  checkApplyParagraphMarkFormatToNumbering(pNumFnt.get(), rInf, pIDSA, pFormat);
616 
617  // we do not allow a vertical font
618  pNumFnt->SetVertical( pNumFnt->GetOrientation(), m_pFrame->IsVertical() );
619 
620  pRet = new SwNumberPortion( aText, std::move(pNumFnt),
621  bLeft, bCenter, nMinDist,
622  bLabelAlignmentPosAndSpaceModeActive );
623  }
624  }
625  }
626  }
627  return pRet;
628 }
629 
630 /* 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:235
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:4509
SwFlyCntPortion * NewFlyCntPortion(SwTextFormatInfo &rInf, SwTextAttr *pHt) const
Sets a new portion for an object anchored as character.
Definition: itrform2.cxx:2464
SwExpandPortion * NewFieldPortion(SwTextFormatInfo &rInf, const SwTextAttr *pHt) const
Definition: txtfld.cxx:71
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:641
void SetLen(TextFrameIndex const nLen)
Definition: porlin.hxx:77
Distinguish only for painting/hide.
Definition: porfld.hxx:109
SwFont * m_pFont
Definition: itratr.hxx:45
bool SeekAndChg(SwTextSizeInfo &rInf)
Definition: itrtxt.hxx:311
bool IsAtEnd() const
sal_uInt16 Which() const
Definition: txatbase.hxx:105
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
Definition: txtfrm.cxx:1278
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:4097
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:315
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:185
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:293
const SwFormatVertOrient * GetGraphicOrientation() const
Definition: number.cxx:346
const SwViewOption & GetOpt() const
Definition: inftxt.hxx:252
Used in for asian layout specialities to display up to six characters in 2 rows and 2-3 columns...
Definition: porfld.hxx:200
SwTextNode const * GetTextNodeForParaProps() const
Definition: txtfrm.cxx:1288
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:128
SwNumberPortion * NewNumberPortion(SwTextFormatInfo &rInf) const
Definition: txtfld.cxx:472
const SfxPoolItem * NextItem()
SwLinePortion * NewExtraPortion(SwTextFormatInfo &rInf)
Definition: txtfld.cxx:354
const vcl::Font * GetBulletFont() const
std::unique_ptr< sw::MergedAttrIterByEnd > m_pByEndIter
Definition: itrform2.hxx:48
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:2814
Provides access to settings of a document.
SwFont * GetFnt()
Definition: itratr.hxx:109
#define RES_TXTATR_TOXMARK
Definition: hintids.hxx:137
TextFrameIndex GetIdx() const
Definition: inftxt.hxx:285
const IDocumentSettingAccess * getIDocumentSettingAccess() const
Provides access to the document setting interface.
Definition: node.cxx:2039
SvxAdjust GetNumAdjust() const
bool IsUpdateExpFields()
Definition: viewimp.cxx:156
ITALIC_NONE
SvxNumPositionAndSpaceMode GetPositionAndSpaceMode() const
const sal_Int32 * GetAnyEnd() const
end (if available), else start
Definition: txatbase.hxx:147
SwTextFrame * GetTextFrame()
Definition: inftxt.hxx:298
const SwAttrSet & GetCharAttr() const
Definition: inftxt.hxx:781
void SetNoLength()
Definition: porfld.hxx:54
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:415
SwTextFrame * m_pFrame
Definition: itrtxt.hxx:35
Base class for anything that can be part of a line in the Writer layout.
Definition: porlin.hxx:52
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:42
#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:288
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:2889
#define RES_TXTATR_ANNOTATION
Definition: hintids.hxx:153
TextFrameIndex MapModelToView(SwTextNode const *pNode, sal_Int32 nIndex) const
Definition: txtfrm.cxx:1239
bool IsCountedInList() const
Definition: ndtxt.cxx:4240
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:1761
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:573
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:3131
const SfxPoolItem & GetAttr() const
Definition: txatbase.hxx:153
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:600
SwTextFrame * GetTextFrame()
Definition: itrtxt.hxx:135
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:79
TextFrameIndex GetTextStart() const
Definition: inftxt.hxx:137
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:57
const SvxNumberType & GetNumType() const
Definition: pagedesc.hxx:192