LibreOffice Module sw (master)  1
txtfrm.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 <hints.hxx>
22 #include <svl/ctloptions.hxx>
23 #include <editeng/lspcitem.hxx>
24 #include <editeng/lrspitem.hxx>
25 #include <editeng/brushitem.hxx>
26 #include <editeng/pgrditem.hxx>
27 #include <unotools/configmgr.hxx>
28 #include <swmodule.hxx>
29 #include <SwSmartTagMgr.hxx>
30 #include <doc.hxx>
34 #include <rootfrm.hxx>
35 #include <pagefrm.hxx>
36 #include <viewsh.hxx>
37 #include <pam.hxx>
38 #include <ndtxt.hxx>
39 #include <paratr.hxx>
40 #include <viewopt.hxx>
41 #include <flyfrm.hxx>
42 #include <tabfrm.hxx>
43 #include <frmatr.hxx>
44 #include <frmtool.hxx>
45 #include <tgrditem.hxx>
46 #include <dbg_lay.hxx>
47 #include <fmtfld.hxx>
48 #include <fmtftn.hxx>
49 #include <txtfld.hxx>
50 #include <txtftn.hxx>
51 #include <ftninfo.hxx>
52 #include <fmtline.hxx>
53 #include <txtfrm.hxx>
54 #include <notxtfrm.hxx>
55 #include <sectfrm.hxx>
56 #include "itrform2.hxx"
57 #include "widorp.hxx"
58 #include "txtcache.hxx"
59 #include <fntcache.hxx>
60 #include <SwGrammarMarkUp.hxx>
61 #include <lineinfo.hxx>
62 #include <SwPortionHandler.hxx>
63 #include <dcontact.hxx>
64 #include <sortedobjs.hxx>
65 #include <txtflcnt.hxx>
66 #include <fmtflcnt.hxx>
67 #include <fmtcntnt.hxx>
68 #include <numrule.hxx>
69 #include <IGrammarContact.hxx>
70 #include <calbck.hxx>
71 #include <ftnidx.hxx>
72 #include <ftnfrm.hxx>
73 
74 #include <wrtsh.hxx>
75 #include <view.hxx>
76 #include <edtwin.hxx>
77 #include <FrameControlsManager.hxx>
78 
79 namespace sw {
80 
82  : m_pMerged(rFrame.GetMergedPara())
83  , m_pNode(m_pMerged ? nullptr : rFrame.GetTextNodeFirst())
84  , m_CurrentExtent(0)
85  , m_CurrentHint(0)
86  {
87  }
88 
90  {
91  if (m_pMerged)
92  {
93  while (m_CurrentExtent < m_pMerged->extents.size())
94  {
95  sw::Extent const& rExtent(m_pMerged->extents[m_CurrentExtent]);
96  if (SwpHints const*const pHints = rExtent.pNode->GetpSwpHints())
97  {
98  while (m_CurrentHint < pHints->Count())
99  {
100  SwTextAttr *const pHint(pHints->Get(m_CurrentHint));
101  if (rExtent.nEnd < pHint->GetStart()
102  // <= if it has no end or isn't empty
103  || (rExtent.nEnd == pHint->GetStart()
104  && (!pHint->GetEnd()
105  || *pHint->GetEnd() != pHint->GetStart())))
106  {
107  break;
108  }
109  ++m_CurrentHint;
110  if (rExtent.nStart <= pHint->GetStart())
111  {
112  if (ppNode)
113  {
114  *ppNode = rExtent.pNode;
115  }
116  return pHint;
117  }
118  }
119  }
120  ++m_CurrentExtent;
121  if (m_CurrentExtent < m_pMerged->extents.size() &&
122  rExtent.pNode != m_pMerged->extents[m_CurrentExtent].pNode)
123  {
124  m_CurrentHint = 0; // reset
125  }
126  }
127  return nullptr;
128  }
129  else
130  {
131  SwpHints const*const pHints(m_pNode->GetpSwpHints());
132  if (pHints)
133  {
134  if (m_CurrentHint < pHints->Count())
135  {
136  SwTextAttr const*const pHint(pHints->Get(m_CurrentHint));
137  ++m_CurrentHint;
138  if (ppNode)
139  {
140  *ppNode = m_pNode;
141  }
142  return pHint;
143  }
144  }
145  return nullptr;
146  }
147  }
148 
150  : m_pNode(rFrame.GetMergedPara() ? nullptr : rFrame.GetTextNodeFirst())
151  , m_CurrentHint(0)
152  {
153  if (!m_pNode)
154  {
155  MergedAttrIterReverse iter(rFrame);
156  SwTextNode const* pNode(nullptr);
157  while (SwTextAttr const* pHint = iter.PrevAttr(&pNode))
158  {
159  m_Hints.emplace_back(pNode, pHint);
160  }
161  }
162  }
163 
165  {
166  if (m_pNode)
167  {
168  SwpHints const*const pHints(m_pNode->GetpSwpHints());
169  if (pHints)
170  {
171  if (m_CurrentHint < pHints->Count())
172  {
173  SwTextAttr const*const pHint(
174  pHints->GetSortedByEnd(m_CurrentHint));
175  ++m_CurrentHint;
176  rpNode = m_pNode;
177  return pHint;
178  }
179  }
180  return nullptr;
181  }
182  else
183  {
184  if (m_CurrentHint < m_Hints.size())
185  {
186  auto const ret = m_Hints[m_Hints.size() - m_CurrentHint - 1];
187  ++m_CurrentHint;
188  rpNode = ret.first;
189  return ret.second;
190  }
191  return nullptr;
192  }
193  }
194 
196  {
197  assert(0 < m_CurrentHint); // should only rewind as far as 0
198  --m_CurrentHint;
199  }
200 
202  : MergedAttrIterBase(rFrame)
203  {
204  if (m_pMerged)
205  {
207  SwpHints const*const pHints(0 < m_CurrentExtent
208  ? m_pMerged->extents[m_CurrentExtent-1].pNode->GetpSwpHints()
209  : nullptr);
210  if (pHints)
211  {
212  pHints->SortIfNeedBe();
213  m_CurrentHint = pHints->Count();
214  }
215  }
216  else
217  {
218  if (SwpHints const*const pHints = m_pNode->GetpSwpHints())
219  {
220  pHints->SortIfNeedBe();
221  m_CurrentHint = pHints->Count();
222  }
223  }
224  }
225 
227  {
228  if (m_pMerged)
229  {
230  while (0 < m_CurrentExtent)
231  {
232  sw::Extent const& rExtent(m_pMerged->extents[m_CurrentExtent-1]);
233  if (SwpHints const*const pHints = rExtent.pNode->GetpSwpHints())
234  {
235  while (0 < m_CurrentHint)
236  {
237  SwTextAttr *const pHint(
238  pHints->GetSortedByEnd(m_CurrentHint - 1));
239  if (pHint->GetAnyEnd() < rExtent.nStart
240  // <= if it has end and isn't empty
241  || (pHint->GetEnd()
242  && *pHint->GetEnd() != pHint->GetStart()
243  && *pHint->GetEnd() == rExtent.nStart))
244  {
245  break;
246  }
247  --m_CurrentHint;
248  if (pHint->GetAnyEnd() <= rExtent.nEnd)
249  {
250  if (ppNode)
251  {
252  *ppNode = rExtent.pNode;
253  }
254  return pHint;
255  }
256  }
257  }
258  --m_CurrentExtent;
259  if (0 < m_CurrentExtent &&
260  rExtent.pNode != m_pMerged->extents[m_CurrentExtent-1].pNode)
261  {
262  SwpHints const*const pHints(
263  m_pMerged->extents[m_CurrentExtent-1].pNode->GetpSwpHints());
264  m_CurrentHint = pHints ? pHints->Count() : 0; // reset
265  if (pHints)
266  pHints->SortIfNeedBe();
267  }
268  }
269  return nullptr;
270  }
271  else
272  {
273  SwpHints const*const pHints(m_pNode->GetpSwpHints());
274  if (pHints && 0 < m_CurrentHint)
275  {
276  SwTextAttr const*const pHint(pHints->GetSortedByEnd(m_CurrentHint - 1));
277  --m_CurrentHint;
278  if (ppNode)
279  {
280  *ppNode = m_pNode;
281  }
282  return pHint;
283  }
284  return nullptr;
285  }
286  }
287 
288  bool FrameContainsNode(SwContentFrame const& rFrame, sal_uLong const nNodeIndex)
289  {
290  if (rFrame.IsTextFrame())
291  {
292  SwTextFrame const& rTextFrame(static_cast<SwTextFrame const&>(rFrame));
293  if (sw::MergedPara const*const pMerged = rTextFrame.GetMergedPara())
294  {
295  sal_uLong const nFirst(pMerged->pFirstNode->GetIndex());
296  sal_uLong const nLast(pMerged->pLastNode->GetIndex());
297  return (nFirst <= nNodeIndex && nNodeIndex <= nLast);
298  }
299  else
300  {
301  return rTextFrame.GetTextNodeFirst()->GetIndex() == nNodeIndex;
302  }
303  }
304  else
305  {
306  assert(rFrame.IsNoTextFrame());
307  return static_cast<SwNoTextFrame const&>(rFrame).GetNode()->GetIndex() == nNodeIndex;
308  }
309  }
310 
311  bool IsParaPropsNode(SwRootFrame const& rLayout, SwTextNode const& rNode)
312  {
313  if (rLayout.HasMergedParas())
314  {
315  if (SwTextFrame const*const pFrame = static_cast<SwTextFrame*>(rNode.getLayoutFrame(&rLayout)))
316  {
317  sw::MergedPara const*const pMerged(pFrame->GetMergedPara());
318  if (pMerged && pMerged->pParaPropsNode != &rNode)
319  {
320  return false;
321  }
322  }
323  }
324  return true;
325  }
326 
327  SwTextNode *
328  GetParaPropsNode(SwRootFrame const& rLayout, SwNodeIndex const& rPos)
329  {
330  SwTextNode *const pTextNode(rPos.GetNode().GetTextNode());
331  if (pTextNode && !sw::IsParaPropsNode(rLayout, *pTextNode))
332  {
333  return static_cast<SwTextFrame*>(pTextNode->getLayoutFrame(&rLayout))->GetMergedPara()->pParaPropsNode;
334  }
335  else
336  {
337  return pTextNode;
338  }
339  }
340 
341  SwPosition
342  GetParaPropsPos(SwRootFrame const& rLayout, SwPosition const& rPos)
343  {
344  SwPosition pos(rPos);
345  SwTextNode const*const pNode(pos.nNode.GetNode().GetTextNode());
346  if (pNode)
347  {
348  pos.nNode = *sw::GetParaPropsNode(rLayout, *pNode);
349  pos.nContent.Assign(pos.nNode.GetNode().GetContentNode(), 0);
350  }
351  return pos;
352  }
353 
354  std::pair<SwTextNode *, SwTextNode *>
355  GetFirstAndLastNode(SwRootFrame const& rLayout, SwNodeIndex const& rPos)
356  {
357  SwTextNode *const pTextNode(rPos.GetNode().GetTextNode());
358  if (pTextNode && rLayout.HasMergedParas())
359  {
360  if (SwTextFrame const*const pFrame = static_cast<SwTextFrame*>(pTextNode->getLayoutFrame(&rLayout)))
361  {
362  if (sw::MergedPara const*const pMerged = pFrame->GetMergedPara())
363  {
364  return std::make_pair(pMerged->pFirstNode, const_cast<SwTextNode*>(pMerged->pLastNode));
365  }
366  }
367  }
368  return std::make_pair(pTextNode, pTextNode);
369  }
370 
371  SwTextNode const& GetAttrMerged(SfxItemSet & rFormatSet,
372  SwTextNode const& rNode, SwRootFrame const*const pLayout)
373  {
374  rNode.SwContentNode::GetAttr(rFormatSet);
375  if (pLayout && pLayout->HasMergedParas())
376  {
377  auto pFrame = static_cast<SwTextFrame*>(rNode.getLayoutFrame(pLayout));
378  if (sw::MergedPara const*const pMerged = pFrame ? pFrame->GetMergedPara() : nullptr)
379  {
380  if (pMerged->pFirstNode != &rNode)
381  {
382  rFormatSet.ClearItem(RES_PAGEDESC);
383  rFormatSet.ClearItem(RES_BREAK);
384  static_assert(RES_PAGEDESC + 1 == sal_uInt16(RES_BREAK),
385  "first-node items must be adjacent");
386  SfxItemSet firstSet(*rFormatSet.GetPool(),
387  svl::Items<RES_PAGEDESC, RES_BREAK>);
388  pMerged->pFirstNode->SwContentNode::GetAttr(firstSet);
389  rFormatSet.Put(firstSet);
390 
391  }
392  if (pMerged->pParaPropsNode != &rNode)
393  {
394  for (sal_uInt16 i = RES_PARATR_BEGIN; i != RES_FRMATR_END; ++i)
395  {
396  if (i != RES_PAGEDESC && i != RES_BREAK)
397  {
398  rFormatSet.ClearItem(i);
399  }
400  }
401  for (sal_uInt16 i = XATTR_FILL_FIRST; i <= XATTR_FILL_LAST; ++i)
402  {
403  rFormatSet.ClearItem(i);
404  }
405  SfxItemSet propsSet(*rFormatSet.GetPool(),
409  pMerged->pParaPropsNode->SwContentNode::GetAttr(propsSet);
410  rFormatSet.Put(propsSet);
411  return *pMerged->pParaPropsNode;
412  }
413  // keep all the CHRATR/UNKNOWNATR anyway...
414  }
415  }
416  return rNode;
417  }
418 
419 } // namespace sw
420 
423 {
424  {
426 
427  if ( ! mbIsSwapped )
428  {
429  const tools::Long nPrtOfstX = aPrt.Pos().X();
430  aPrt.Pos().setX( aPrt.Pos().Y() );
431 
432  if( IsVertLR() )
433  {
434  aPrt.Pos().setY( nPrtOfstX );
435  }
436  else
437  {
438  aPrt.Pos().setY( getFrameArea().Width() - ( nPrtOfstX + aPrt.Width() ) );
439  }
440  }
441  else
442  {
443  const tools::Long nPrtOfstY = aPrt.Pos().Y();
444  aPrt.Pos().setY( aPrt.Pos().X() );
445 
446  if( IsVertLR() )
447  {
448  aPrt.Pos().setX( nPrtOfstY );
449  }
450  else
451  {
452  aPrt.Pos().setX( getFrameArea().Height() - ( nPrtOfstY + aPrt.Height() ) );
453  }
454  }
455 
456  const tools::Long nPrtWidth = aPrt.Width();
457  aPrt.Width( aPrt.Height() );
458  aPrt.Height( nPrtWidth );
459  }
460 
461  {
462  const tools::Long nFrameWidth = getFrameArea().Width();
464  aFrm.Width( aFrm.Height() );
465  aFrm.Height( nFrameWidth );
466  }
467 
469 }
470 
476 {
477  // calc offset inside frame
478  tools::Long nOfstX, nOfstY;
479  if ( IsVertLR() )
480  {
481  if (IsVertLRBT())
482  {
483  // X and Y offsets here mean the position of the point that will be the top left corner
484  // after the switch.
485  nOfstX = rRect.Left() + rRect.Width() - getFrameArea().Left();
486  nOfstY = rRect.Top() - getFrameArea().Top();
487  }
488  else
489  {
490  nOfstX = rRect.Left() - getFrameArea().Left();
491  nOfstY = rRect.Top() - getFrameArea().Top();
492  }
493  }
494  else
495  {
496  nOfstX = rRect.Left() - getFrameArea().Left();
497  nOfstY = rRect.Top() + rRect.Height() - getFrameArea().Top();
498  }
499 
500  const tools::Long nWidth = rRect.Width();
501  const tools::Long nHeight = rRect.Height();
502 
503  if ( IsVertLR() )
504  {
505  rRect.Left(getFrameArea().Left() + nOfstY);
506  }
507  else
508  {
509  if ( mbIsSwapped )
510  rRect.Left( getFrameArea().Left() + getFrameArea().Height() - nOfstY );
511  else
512  // frame is rotated
513  rRect.Left( getFrameArea().Left() + getFrameArea().Width() - nOfstY );
514  }
515 
516  if (IsVertLRBT())
517  {
518  if (mbIsSwapped)
519  rRect.Top(getFrameArea().Top() + getFrameArea().Width() - nOfstX);
520  else
521  rRect.Top(getFrameArea().Top() + getFrameArea().Height() - nOfstX);
522  }
523  else
524  rRect.Top(getFrameArea().Top() + nOfstX);
525  rRect.Width( nHeight );
526  rRect.Height( nWidth );
527 }
528 
533 void SwTextFrame::SwitchHorizontalToVertical( Point& rPoint ) const
534 {
535  if (IsVertLRBT())
536  {
537  // The horizontal origo is the top left corner, the LRBT origo is the
538  // bottom left corner. Finally x and y has to be swapped.
539  SAL_WARN_IF(!mbIsSwapped, "sw.core",
540  "SwTextFrame::SwitchHorizontalToVertical, IsVertLRBT, not swapped");
541  Point aPoint(rPoint);
542  rPoint.setX(getFrameArea().Left() + (aPoint.Y() - getFrameArea().Top()));
543  // This would be bottom - x delta, but bottom is top + height, finally
544  // width (and not height), as it's swapped.
545  rPoint.setY(getFrameArea().Top() + getFrameArea().Width()
546  - (aPoint.X() - getFrameArea().Left()));
547  return;
548  }
549 
550  // calc offset inside frame
551  const tools::Long nOfstX = rPoint.X() - getFrameArea().Left();
552  const tools::Long nOfstY = rPoint.Y() - getFrameArea().Top();
553  if ( IsVertLR() )
554  rPoint.setX( getFrameArea().Left() + nOfstY );
555  else
556  {
557  if ( mbIsSwapped )
558  rPoint.setX( getFrameArea().Left() + getFrameArea().Height() - nOfstY );
559  else
560  // calc rotated coords
561  rPoint.setX( getFrameArea().Left() + getFrameArea().Width() - nOfstY );
562  }
563 
564  rPoint.setY( getFrameArea().Top() + nOfstX );
565 }
566 
572 {
573  Point aTmp( 0, nLimit );
575  return aTmp.X();
576 }
577 
583 {
584  tools::Long nOfstX;
585 
586  // calc offset inside frame
587  if ( IsVertLR() )
588  nOfstX = rRect.Left() - getFrameArea().Left();
589  else
590  {
591  if ( mbIsSwapped )
592  nOfstX = getFrameArea().Left() + getFrameArea().Height() - ( rRect.Left() + rRect.Width() );
593  else
594  nOfstX = getFrameArea().Left() + getFrameArea().Width() - ( rRect.Left() + rRect.Width() );
595  }
596 
597  tools::Long nOfstY;
598  if (IsVertLRBT())
599  {
600  // Note that mbIsSwapped only affects the frame area, not rRect, so rRect.Height() is used
601  // here unconditionally.
602  if (mbIsSwapped)
603  nOfstY = getFrameArea().Top() + getFrameArea().Width() - (rRect.Top() + rRect.Height());
604  else
605  nOfstY = getFrameArea().Top() + getFrameArea().Height() - (rRect.Top() + rRect.Height());
606  }
607  else
608  nOfstY = rRect.Top() - getFrameArea().Top();
609  const tools::Long nWidth = rRect.Height();
610  const tools::Long nHeight = rRect.Width();
611 
612  // calc rotated coords
613  rRect.Left( getFrameArea().Left() + nOfstY );
614  rRect.Top( getFrameArea().Top() + nOfstX );
615  rRect.Width( nWidth );
616  rRect.Height( nHeight );
617 }
618 
623 void SwTextFrame::SwitchVerticalToHorizontal( Point& rPoint ) const
624 {
625  tools::Long nOfstX;
626 
627  // calc offset inside frame
628  if ( IsVertLR() )
629  // X offset is Y - left.
630  nOfstX = rPoint.X() - getFrameArea().Left();
631  else
632  {
633  // X offset is right - X.
634  if ( mbIsSwapped )
635  nOfstX = getFrameArea().Left() + getFrameArea().Height() - rPoint.X();
636  else
637  nOfstX = getFrameArea().Left() + getFrameArea().Width() - rPoint.X();
638  }
639 
640  tools::Long nOfstY;
641  if (IsVertLRBT())
642  {
643  // Y offset is bottom - Y.
644  if (mbIsSwapped)
645  nOfstY = getFrameArea().Top() + getFrameArea().Width() - rPoint.Y();
646  else
647  nOfstY = getFrameArea().Top() + getFrameArea().Height() - rPoint.Y();
648  }
649  else
650  // Y offset is Y - top.
651  nOfstY = rPoint.Y() - getFrameArea().Top();
652 
653  // calc rotated coords
654  rPoint.setX( getFrameArea().Left() + nOfstY );
655  rPoint.setY( getFrameArea().Top() + nOfstX );
656 }
657 
663 {
664  Point aTmp( nLimit, 0 );
666  return aTmp.Y();
667 }
668 
669 SwFrameSwapper::SwFrameSwapper( const SwTextFrame* pTextFrame, bool bSwapIfNotSwapped )
670  : pFrame( pTextFrame ), bUndo( false )
671 {
672  if (pFrame->IsVertical() && bSwapIfNotSwapped != pFrame->IsSwapped())
673  {
674  bUndo = true;
675  const_cast<SwTextFrame*>(pFrame)->SwapWidthAndHeight();
676  }
677 }
678 
680 {
681  if ( bUndo )
682  const_cast<SwTextFrame*>(pFrame)->SwapWidthAndHeight();
683 }
684 
686 {
687  SwSwapIfNotSwapped swap(const_cast<SwTextFrame *>(this));
688 
689  tools::Long nWidth = rRect.Width();
690  rRect.Left( 2 * ( getFrameArea().Left() + getFramePrintArea().Left() ) +
691  getFramePrintArea().Width() - rRect.Right() - 1 );
692 
693  rRect.Width( nWidth );
694 }
695 
696 void SwTextFrame::SwitchLTRtoRTL( Point& rPoint ) const
697 {
698  SwSwapIfNotSwapped swap(const_cast<SwTextFrame *>(this));
699 
700  rPoint.setX( 2 * ( getFrameArea().Left() + getFramePrintArea().Left() ) + getFramePrintArea().Width() - rPoint.X() - 1 );
701 }
702 
704  m_rOut( rOutp ), m_nOldLayoutMode( rOutp.GetLayoutMode() )
705 {
706 }
707 
709 {
710  const_cast<OutputDevice&>(m_rOut).SetLayoutMode( m_nOldLayoutMode );
711 }
712 
713 void SwLayoutModeModifier::Modify( bool bChgToRTL )
714 {
715  const_cast<OutputDevice&>(m_rOut).SetLayoutMode( bChgToRTL ?
716  ComplexTextLayoutFlags::BiDiStrong | ComplexTextLayoutFlags::BiDiRtl :
717  ComplexTextLayoutFlags::BiDiStrong );
718 }
719 
721 {
722  const ComplexTextLayoutFlags nNewLayoutMode = m_nOldLayoutMode & ~ComplexTextLayoutFlags::BiDiStrong;
723  const_cast<OutputDevice&>(m_rOut).SetLayoutMode( nNewLayoutMode );
724 }
725 
727  rOut( rOutp ), nOldLanguageType( rOutp.GetDigitLanguage() )
728 {
729  LanguageType eLang = eCurLang;
731  eLang = LANGUAGE_ENGLISH_US;
732  else
733  {
734  const SvtCTLOptions::TextNumerals nTextNumerals = SW_MOD()->GetCTLOptions().GetCTLTextNumerals();
735 
736  if ( SvtCTLOptions::NUMERALS_HINDI == nTextNumerals )
738  else if ( SvtCTLOptions::NUMERALS_ARABIC == nTextNumerals )
739  eLang = LANGUAGE_ENGLISH;
740  else if ( SvtCTLOptions::NUMERALS_SYSTEM == nTextNumerals )
741  eLang = ::GetAppLanguage();
742  }
743 
744  const_cast<OutputDevice&>(rOut).SetDigitLanguage( eLang );
745 }
746 
748 {
749  const_cast<OutputDevice&>(rOut).SetDigitLanguage( nOldLanguageType );
750 }
751 
753 {
754  OSL_ENSURE( !IsLocked(), "+SwTextFrame::Init: this is locked." );
755  if( !IsLocked() )
756  {
757  ClearPara();
758  SetHasRotatedPortions(false);
759  // set flags directly to save a ResetPreps call,
760  // and thereby an unnecessary GetPara call
761  // don't set bOrphan, bLocked or bWait to false!
762  // bOrphan = bFlag7 = bFlag8 = false;
763  }
764 }
765 
767  sw::FrameMode const eMode)
768  : SwContentFrame( pNode, pSib )
769  , mnAllLines( 0 )
770  , mnThisLines( 0 )
771  , mnFlyAnchorOfst( 0 )
772  , mnFlyAnchorOfstNoWrap( 0 )
773  , mnFlyAnchorVertOfstNoWrap( 0 )
774  , mnFootnoteLine( 0 )
775  , mnHeightOfLastLine( 0 )
776  , mnAdditionalFirstLineOffset( 0 )
777  , mnOffset( 0 )
778  , mnCacheIndex( USHRT_MAX )
779  , mbLocked( false )
780  , mbWidow( false )
781  , mbJustWidow( false )
782  , mbEmpty( false )
783  , mbInFootnoteConnect( false )
784  , mbFootnote( false )
785  , mbRepaint( false )
786  , mbHasRotatedPortions( false )
787  , mbFieldFollow( false )
788  , mbHasAnimation( false )
789  , mbIsSwapped( false )
790  , mbFollowFormatAllowed( true )
791 {
793  // note: this may call SwClientNotify if it's in a list so do it last
794  // note: this may change this->pRegisteredIn to m_pMergedPara->listeners
795  m_pMergedPara = CheckParaRedlineMerge(*this, *pNode, eMode);
796 }
797 
798 namespace sw {
799 
800 SwTextFrame * MakeTextFrame(SwTextNode & rNode, SwFrame *const pSibling,
801  sw::FrameMode const eMode)
802 {
803  return new SwTextFrame(&rNode, pSibling, eMode);
804 }
805 
807  SwRootFrame const& rLayout, SwTextNode const& rTextNode,
808  std::vector<std::pair<sal_Int32, sal_Int32>> const*const pExtents)
809 {
810  if (pExtents && pExtents->empty())
811  {
812  return; // nothing to do
813  }
814  const SwFootnoteIdxs &rFootnoteIdxs = rTextNode.GetDoc().GetFootnoteIdxs();
815  size_t nPos = 0;
816  sal_uLong const nIndex = rTextNode.GetIndex();
817  rFootnoteIdxs.SeekEntry( rTextNode, &nPos );
818  if (nPos < rFootnoteIdxs.size())
819  {
820  while (nPos && &rTextNode == &(rFootnoteIdxs[ nPos ]->GetTextNode()))
821  --nPos;
822  if (nPos || &rTextNode != &(rFootnoteIdxs[ nPos ]->GetTextNode()))
823  ++nPos;
824  }
825  size_t iter(0);
826  for ( ; nPos < rFootnoteIdxs.size(); ++nPos)
827  {
828  SwTextFootnote* pTextFootnote = rFootnoteIdxs[ nPos ];
829  if (pTextFootnote->GetTextNode().GetIndex() > nIndex)
830  break;
831  if (pExtents)
832  {
833  while ((*pExtents)[iter].second <= pTextFootnote->GetStart())
834  {
835  ++iter;
836  if (iter == pExtents->size())
837  {
838  return;
839  }
840  }
841  if (pTextFootnote->GetStart() < (*pExtents)[iter].first)
842  {
843  continue;
844  }
845  }
846  pTextFootnote->DelFrames(&rLayout);
847  }
848 }
849 
850 } // namespace sw
851 
853 {
854  // Remove associated SwParaPortion from s_pTextCache
855  ClearPara();
856 
857  assert(!GetDoc().IsInDtor()); // this shouldn't be happening with ViewShell owning layout
858  if (!GetDoc().IsInDtor() && HasFootnote())
859  {
860  if (m_pMergedPara)
861  {
862  SwTextNode const* pNode(nullptr);
863  for (auto const& e : m_pMergedPara->extents)
864  {
865  if (e.pNode != pNode)
866  {
867  pNode = e.pNode;
868  // sw_redlinehide: not sure if it's necessary to check
869  // if the nodes are still alive here, which would require
870  // accessing WriterMultiListener::m_vDepends
871  sw::RemoveFootnotesForNode(*getRootFrame(), *pNode, nullptr);
872  }
873  }
874  }
875  else
876  {
877  SwTextNode *const pNode(static_cast<SwTextNode*>(GetDep()));
878  if (pNode)
879  {
880  sw::RemoveFootnotesForNode(*getRootFrame(), *pNode, nullptr);
881  }
882  }
883  }
884 
885  if (!GetDoc().IsInDtor())
886  {
887  if (SwView* pView = GetActiveView())
888  pView->GetEditWin().GetFrameControlsManager().RemoveControls(this);
889  }
890 
892 }
893 
895 {
896  RemoveFromCache();
897 }
898 
899 namespace sw {
900 
901 // 1. if real insert => correct nStart/nEnd for full nLen
902 // 2. if rl un-delete => do not correct nStart/nEnd but just include un-deleted
904  bool const isRealInsert,
905  SwTextNode const& rNode, sal_Int32 const nIndex, sal_Int32 const nLen)
906 {
907  assert(!isRealInsert || nLen); // can 0 happen? yes, for redline in empty node
908  assert(nIndex <= rNode.Len());
909  assert(nIndex + nLen <= rNode.Len());
910  assert(rMerged.pFirstNode->GetIndex() <= rNode.GetIndex() && rNode.GetIndex() <= rMerged.pLastNode->GetIndex());
911  if (!nLen)
912  {
913  return TextFrameIndex(0);
914  }
915  OUStringBuffer text(rMerged.mergedText);
916  sal_Int32 nTFIndex(0); // index used for insertion at the end
917  sal_Int32 nInserted(0);
918  bool bInserted(false);
919  bool bFoundNode(false);
920  auto itInsert(rMerged.extents.end());
921  for (auto it = rMerged.extents.begin(); it != rMerged.extents.end(); ++it)
922  {
923  if (it->pNode == &rNode)
924  {
925  if (isRealInsert)
926  {
927  bFoundNode = true;
928  if (it->nStart <= nIndex && nIndex <= it->nEnd)
929  { // note: this can happen only once
930  text.insert(nTFIndex + (nIndex - it->nStart),
931  rNode.GetText().subView(nIndex, nLen));
932  it->nEnd += nLen;
933  nInserted = nLen;
934  assert(!bInserted);
935  bInserted = true;
936  }
937  else if (nIndex < it->nStart)
938  {
939  if (itInsert == rMerged.extents.end())
940  {
941  itInsert = it;
942  }
943  it->nStart += nLen;
944  it->nEnd += nLen;
945  }
946  }
947  else
948  {
949  assert(it == rMerged.extents.begin() || (it-1)->pNode != &rNode || (it-1)->nEnd < nIndex);
950  if (nIndex + nLen < it->nStart)
951  {
952  itInsert = it;
953  break;
954  }
955  if (nIndex < it->nStart)
956  {
957  text.insert(nTFIndex,
958  rNode.GetText().subView(nIndex, it->nStart - nIndex));
959  nInserted += it->nStart - nIndex;
960  it->nStart = nIndex;
961  bInserted = true;
962  }
963  assert(it->nStart <= nIndex);
964  if (nIndex <= it->nEnd)
965  {
966  nTFIndex += it->nEnd - it->nStart;
967  while (it->nEnd < nIndex + nLen)
968  {
969  auto *const pNext(
970  (it+1) != rMerged.extents.end() && (it+1)->pNode == it->pNode
971  ? &*(it+1)
972  : nullptr);
973  if (pNext && pNext->nStart <= nIndex + nLen)
974  {
975  text.insert(nTFIndex,
976  rNode.GetText().subView(it->nEnd, pNext->nStart - it->nEnd));
977  nTFIndex += pNext->nStart - it->nEnd;
978  nInserted += pNext->nStart - it->nEnd;
979  pNext->nStart = it->nStart;
980  it = rMerged.extents.erase(it);
981  }
982  else
983  {
984  text.insert(nTFIndex,
985  rNode.GetText().subView(it->nEnd, nIndex + nLen - it->nEnd));
986  nTFIndex += nIndex + nLen - it->nEnd;
987  nInserted += nIndex + nLen - it->nEnd;
988  it->nEnd = nIndex + nLen;
989  }
990  }
991  bInserted = true;
992  break;
993  }
994  }
995  }
996  else if (rNode.GetIndex() < it->pNode->GetIndex() || bFoundNode)
997  {
998  if (itInsert == rMerged.extents.end())
999  {
1000  itInsert = it;
1001  }
1002  break;
1003  }
1004  if (itInsert == rMerged.extents.end())
1005  {
1006  nTFIndex += it->nEnd - it->nStart;
1007  }
1008  }
1009 // assert((bFoundNode || rMerged.extents.empty()) && "text node not found - why is it sending hints to us");
1010  if (!bInserted)
1011  { // must be in a gap
1012  rMerged.extents.emplace(itInsert, const_cast<SwTextNode*>(&rNode), nIndex, nIndex + nLen);
1013  text.insert(nTFIndex, rNode.GetText().subView(nIndex, nLen));
1014  nInserted = nLen;
1015  if (rMerged.extents.size() == 1 // also if it was empty!
1016  || rMerged.pParaPropsNode->GetIndex() < rNode.GetIndex())
1017  { // text inserted after current para-props node
1019  rMerged.pParaPropsNode = &const_cast<SwTextNode&>(rNode);
1020  rMerged.pParaPropsNode->AddToListRLHidden();
1021  }
1022  // called from SwRangeRedline::InvalidateRange()
1024  {
1025  const_cast<SwTextNode&>(rNode).SetRedlineMergeFlag(SwNode::Merge::NonFirst);
1026  }
1027  }
1028  rMerged.mergedText = text.makeStringAndClear();
1029  return TextFrameIndex(nInserted);
1030 }
1031 
1032 // 1. if real delete => correct nStart/nEnd for full nLen
1033 // 2. if rl delete => do not correct nStart/nEnd but just exclude deleted
1035  bool const isRealDelete,
1036  SwTextNode const& rNode, sal_Int32 nIndex, sal_Int32 const nLen)
1037 {
1038  assert(nIndex <= rNode.Len());
1039  assert(rMerged.pFirstNode->GetIndex() <= rNode.GetIndex() && rNode.GetIndex() <= rMerged.pLastNode->GetIndex());
1040  OUStringBuffer text(rMerged.mergedText);
1041  sal_Int32 nTFIndex(0);
1042  sal_Int32 nToDelete(nLen);
1043  sal_Int32 nDeleted(0);
1044  size_t nFoundNode(0);
1045  size_t nErased(0);
1046  auto it = rMerged.extents.begin();
1047  for (; it != rMerged.extents.end(); )
1048  {
1049  bool bErase(false);
1050  if (it->pNode == &rNode)
1051  {
1052  ++nFoundNode;
1053  if (nIndex + nToDelete < it->nStart)
1054  {
1055  nToDelete = 0;
1056  if (!isRealDelete)
1057  {
1058  break;
1059  }
1060  it->nStart -= nLen;
1061  it->nEnd -= nLen;
1062  }
1063  else
1064  {
1065  if (nIndex < it->nStart)
1066  {
1067  // do not adjust nIndex into the text frame index space!
1068  nToDelete -= it->nStart - nIndex;
1069  nIndex = it->nStart;
1070  // note: continue with the if check below, no else!
1071  }
1072  if (it->nStart <= nIndex && nIndex < it->nEnd)
1073  {
1074  sal_Int32 const nDeleteHere(nIndex + nToDelete <= it->nEnd
1075  ? nToDelete
1076  : it->nEnd - nIndex);
1077  text.remove(nTFIndex + (nIndex - it->nStart), nDeleteHere);
1078  bErase = nDeleteHere == it->nEnd - it->nStart;
1079  if (bErase)
1080  {
1081  ++nErased;
1082  assert(it->nStart == nIndex);
1083  it = rMerged.extents.erase(it);
1084  }
1085  else if (isRealDelete)
1086  { // adjust for deleted text
1087  it->nStart -= (nLen - nToDelete);
1088  it->nEnd -= (nLen - nToDelete + nDeleteHere);
1089  if (it != rMerged.extents.begin()
1090  && (it-1)->pNode == &rNode
1091  && (it-1)->nEnd == it->nStart)
1092  { // merge adjacent extents
1093  nTFIndex += it->nEnd - it->nStart;
1094  (it-1)->nEnd = it->nEnd;
1095  it = rMerged.extents.erase(it);
1096  bErase = true; // skip increment
1097  }
1098  }
1099  else
1100  { // exclude text marked as deleted
1101  if (nIndex + nDeleteHere == it->nEnd)
1102  {
1103  it->nEnd -= nDeleteHere;
1104  }
1105  else
1106  {
1107  if (nIndex == it->nStart)
1108  {
1109  it->nStart += nDeleteHere;
1110  }
1111  else
1112  {
1113  sal_Int32 const nOldEnd(it->nEnd);
1114  it->nEnd = nIndex;
1115  it = rMerged.extents.emplace(it+1,
1116  it->pNode, nIndex + nDeleteHere, nOldEnd);
1117  }
1118  assert(nDeleteHere == nToDelete);
1119  }
1120  }
1121  nDeleted += nDeleteHere;
1122  nToDelete -= nDeleteHere;
1123  nIndex += nDeleteHere;
1124  if (!isRealDelete && nToDelete == 0)
1125  {
1126  break;
1127  }
1128  }
1129  }
1130  }
1131  else if (nFoundNode != 0)
1132  {
1133  break;
1134  }
1135  if (!bErase)
1136  {
1137  nTFIndex += it->nEnd - it->nStart;
1138  ++it;
1139  }
1140  }
1141 // assert(nFoundNode != 0 && "text node not found - why is it sending hints to us");
1142  assert(nIndex <= rNode.Len() + nLen);
1143  // if there's a remaining deletion, it must be in gap at the end of the node
1144 // can't do: might be last one in node was erased assert(nLen == 0 || rMerged.empty() || (it-1)->nEnd <= nIndex);
1145  // note: if first node gets deleted then that must call DelFrames as
1146  // pFirstNode is never updated
1147  if (nErased && nErased == nFoundNode)
1148  { // all visible text from node was erased
1149 #if 1
1150  if (rMerged.pParaPropsNode == &rNode)
1151  {
1153  rMerged.pParaPropsNode = rMerged.extents.empty()
1154  ? const_cast<SwTextNode*>(rMerged.pLastNode)
1155  : rMerged.extents.front().pNode;
1156  rMerged.pParaPropsNode->AddToListRLHidden();
1157  }
1158 #endif
1159 // NOPE must listen on all non-hidden nodes; particularly on pLastNode rMerged.listener.EndListening(&const_cast<SwTextNode&>(rNode));
1160  }
1161  rMerged.mergedText = text.makeStringAndClear();
1162  return TextFrameIndex(nDeleted);
1163 }
1164 
1165 std::pair<SwTextNode*, sal_Int32>
1166 MapViewToModel(MergedPara const& rMerged, TextFrameIndex const i_nIndex)
1167 {
1168  sal_Int32 nIndex(i_nIndex);
1169  sw::Extent const* pExtent(nullptr);
1170  for (const auto& rExt : rMerged.extents)
1171  {
1172  pExtent = &rExt;
1173  if (nIndex < (pExtent->nEnd - pExtent->nStart))
1174  {
1175  return std::make_pair(pExtent->pNode, pExtent->nStart + nIndex);
1176  }
1177  nIndex = nIndex - (pExtent->nEnd - pExtent->nStart);
1178  }
1179  assert(nIndex == 0 && "view index out of bounds");
1180  return pExtent
1181  ? std::make_pair(pExtent->pNode, pExtent->nEnd) //1-past-the-end index
1182  : std::make_pair(const_cast<SwTextNode*>(rMerged.pLastNode), rMerged.pLastNode->Len());
1183 }
1184 
1185 TextFrameIndex MapModelToView(MergedPara const& rMerged, SwTextNode const*const pNode, sal_Int32 const nIndex)
1186 {
1187  assert(rMerged.pFirstNode->GetIndex() <= pNode->GetIndex()
1188  && pNode->GetIndex() <= rMerged.pLastNode->GetIndex());
1189  sal_Int32 nRet(0);
1190  bool bFoundNode(false);
1191  for (auto const& e : rMerged.extents)
1192  {
1193  if (pNode->GetIndex() < e.pNode->GetIndex())
1194  {
1195  return TextFrameIndex(nRet);
1196  }
1197  if (e.pNode == pNode)
1198  {
1199  if (e.nStart <= nIndex && nIndex <= e.nEnd)
1200  {
1201  return TextFrameIndex(nRet + (nIndex - e.nStart));
1202  }
1203  else if (nIndex < e.nStart)
1204  {
1205  // in gap before this extent => map to 0 here TODO???
1206  return TextFrameIndex(nRet);
1207  }
1208  bFoundNode = true;
1209  }
1210  else if (bFoundNode)
1211  {
1212  break;
1213  }
1214  nRet += e.nEnd - e.nStart;
1215  }
1216  if (bFoundNode)
1217  {
1218  // must be in a gap at the end of the node
1219  assert(nIndex <= pNode->Len());
1220  return TextFrameIndex(nRet);
1221  }
1222  else if (rMerged.extents.empty())
1223  {
1224  assert(nIndex <= pNode->Len());
1225  return TextFrameIndex(0);
1226  }
1227  return TextFrameIndex(rMerged.mergedText.getLength());
1228 }
1229 
1230 } // namespace sw
1231 
1232 std::pair<SwTextNode*, sal_Int32>
1234 {
1235 //nope assert(GetPara());
1236  sw::MergedPara const*const pMerged(GetMergedPara());
1237  if (pMerged)
1238  {
1239  return sw::MapViewToModel(*pMerged, nIndex);
1240  }
1241  else
1242  {
1243  return std::make_pair(static_cast<SwTextNode*>(const_cast<sw::BroadcastingModify*>(
1244  SwFrame::GetDep())), sal_Int32(nIndex));
1245  }
1246 }
1247 
1249 {
1250  std::pair<SwTextNode*, sal_Int32> const ret(MapViewToModel(nIndex));
1251  return SwPosition(*ret.first, ret.second);
1252 }
1253 
1254 TextFrameIndex SwTextFrame::MapModelToView(SwTextNode const*const pNode, sal_Int32 const nIndex) const
1255 {
1256 //nope assert(GetPara());
1257  sw::MergedPara const*const pMerged(GetMergedPara());
1258  if (pMerged)
1259  {
1260  return sw::MapModelToView(*pMerged, pNode, nIndex);
1261  }
1262  else
1263  {
1264  assert(static_cast<SwTextNode*>(const_cast<sw::BroadcastingModify*>(SwFrame::GetDep())) == pNode);
1265  return TextFrameIndex(nIndex);
1266  }
1267 }
1268 
1270 {
1271  SwTextNode const*const pNode(rPos.nNode.GetNode().GetTextNode());
1272  sal_Int32 const nIndex(rPos.nContent.GetIndex());
1273  return MapModelToView(pNode, nIndex);
1274 }
1275 
1276 void SwTextFrame::SetMergedPara(std::unique_ptr<sw::MergedPara> p)
1277 {
1278  SwTextNode *const pFirst(m_pMergedPara ? m_pMergedPara->pFirstNode : nullptr);
1279  m_pMergedPara = std::move(p);
1280  if (pFirst)
1281  {
1282  if (m_pMergedPara)
1283  {
1284  assert(pFirst == m_pMergedPara->pFirstNode);
1285  }
1286  else
1287  {
1288  pFirst->Add(this); // must register at node again
1289  }
1290  }
1291  // postcondition: frame must be listening somewhere
1292  assert(m_pMergedPara || GetDep());
1293 }
1294 
1295 const OUString& SwTextFrame::GetText() const
1296 {
1297 //nope assert(GetPara());
1298  sw::MergedPara const*const pMerged(GetMergedPara());
1299  if (pMerged)
1300  return pMerged->mergedText;
1301  else
1302  return static_cast<SwTextNode const*>(SwFrame::GetDep())->GetText();
1303 }
1304 
1306 {
1307  // FIXME can GetPara be 0 ? yes... this is needed in SwContentNotify::SwContentNotify() which is called before any formatting is started
1308 //nope assert(GetPara());
1309  sw::MergedPara const*const pMerged(GetMergedPara());
1310  if (pMerged)
1311  {
1312 // assert(pMerged->pFirstNode == pMerged->pParaPropsNode); // surprising news!
1313  return pMerged->pParaPropsNode;
1314  }
1315  else
1316  return static_cast<SwTextNode const*>(SwFrame::GetDep());
1317 }
1318 
1320 {
1321  sw::MergedPara const*const pMerged(GetMergedPara());
1322  if (pMerged)
1323  return pMerged->extents.empty()
1324  ? pMerged->pFirstNode
1325  : pMerged->extents.front().pNode;
1326  else
1327  return static_cast<SwTextNode const*>(SwFrame::GetDep());
1328 }
1329 
1331 {
1332 //nope assert(GetPara());
1333  sw::MergedPara const*const pMerged(GetMergedPara());
1334  if (pMerged)
1335  return pMerged->pFirstNode;
1336  else
1337  return static_cast<SwTextNode const*>(SwFrame::GetDep());
1338 }
1339 
1341 {
1342  return GetTextNodeFirst()->GetDoc();
1343 }
1344 
1346  sal_uInt16 const nScript, bool const bNoChar) const
1347 {
1348  // a single character can be mapped uniquely!
1349  std::pair<SwTextNode const*, sal_Int32> const pos(MapViewToModel(nIndex));
1350  return pos.first->GetLang(pos.second, bNoChar ? 0 : 1, nScript);
1351 }
1352 
1354 {
1355  if ( GetCacheIdx() != USHRT_MAX )
1356  {
1357  if (SwParaPortion *pPara = GetPara())
1358  pPara->ResetPreps();
1359  }
1360 }
1361 
1363 {
1364  SwFrameSwapper aSwapper( this, true );
1365 
1366  if( !getFrameArea().Width() && isFrameAreaDefinitionValid() && GetUpper()->isFrameAreaDefinitionValid() ) // invalid when stack overflows (StackHack)!
1367  {
1368 // OSL_FAIL( "SwTextFrame::IsHiddenNow: thin frame" );
1369  return true;
1370  }
1371 
1372  bool bHiddenCharsHidePara(false);
1373  bool bHiddenParaField(false);
1374  if (m_pMergedPara)
1375  {
1376  TextFrameIndex nHiddenStart(COMPLETE_STRING);
1377  TextFrameIndex nHiddenEnd(0);
1378  if (auto const pScriptInfo = GetScriptInfo())
1379  {
1380  pScriptInfo->GetBoundsOfHiddenRange(TextFrameIndex(0),
1381  nHiddenStart, nHiddenEnd);
1382  }
1383  else // ParaPortion is created in Format, but this is called earlier
1384  {
1385  SwScriptInfo aInfo;
1386  aInfo.InitScriptInfo(*m_pMergedPara->pFirstNode, m_pMergedPara.get(), IsRightToLeft());
1388  nHiddenStart, nHiddenEnd);
1389  }
1390  if (TextFrameIndex(0) == nHiddenStart &&
1391  TextFrameIndex(GetText().getLength()) <= nHiddenEnd)
1392  {
1393  bHiddenCharsHidePara = true;
1394  }
1395  sw::MergedAttrIter iter(*this);
1396  SwTextNode const* pNode(nullptr);
1397  int nNewResultWeight = 0;
1398  for (SwTextAttr const* pHint = iter.NextAttr(&pNode); pHint; pHint = iter.NextAttr(&pNode))
1399  {
1400  if (pHint->Which() == RES_TXTATR_FIELD)
1401  {
1402  // see also SwpHints::CalcHiddenParaField()
1403  const SwFormatField& rField = pHint->GetFormatField();
1404  int nCurWeight = pNode->GetDoc().FieldCanHideParaWeight(rField.GetField()->GetTyp()->Which());
1405  if (nCurWeight > nNewResultWeight)
1406  {
1407  nNewResultWeight = nCurWeight;
1408  bHiddenParaField = pNode->GetDoc().FieldHidesPara(*rField.GetField());
1409  }
1410  else if (nCurWeight == nNewResultWeight && bHiddenParaField)
1411  {
1412  // Currently, for both supported hiding types (HiddenPara, Database), "Don't hide"
1413  // takes precedence - i.e., if there's a "Don't hide" field of that weight, we only
1414  // care about fields of higher weight.
1415  bHiddenParaField = pNode->GetDoc().FieldHidesPara(*rField.GetField());
1416  }
1417  }
1418  }
1419  }
1420  else
1421  {
1422  bHiddenCharsHidePara = static_cast<SwTextNode const*>(SwFrame::GetDep())->HasHiddenCharAttribute( true );
1423  bHiddenParaField = static_cast<SwTextNode const*>(SwFrame::GetDep())->IsHiddenByParaField();
1424  }
1425  const SwViewShell* pVsh = getRootFrame()->GetCurrShell();
1426 
1427  if ( pVsh && ( bHiddenCharsHidePara || bHiddenParaField ) )
1428  {
1429 
1430  if (
1431  ( bHiddenParaField &&
1432  ( !pVsh->GetViewOptions()->IsShowHiddenPara() &&
1433  !pVsh->GetViewOptions()->IsFieldName() ) ) ||
1434  ( bHiddenCharsHidePara &&
1435  !pVsh->GetViewOptions()->IsShowHiddenChar() ) )
1436  {
1437  return true;
1438  }
1439  }
1440 
1441  return false;
1442 }
1443 
1446 {
1447  OSL_ENSURE( !GetFollow() && IsHiddenNow(),
1448  "HideHidden on visible frame of hidden frame has follow" );
1449 
1452 
1453  // format information is obsolete
1454  ClearPara();
1455 }
1456 
1458 {
1459  SwPageFrame *pPage = nullptr;
1460  sw::MergedAttrIter iter(*this);
1461  SwTextNode const* pNode(nullptr);
1462  for (SwTextAttr const* pHt = iter.NextAttr(&pNode); pHt; pHt = iter.NextAttr(&pNode))
1463  {
1464  if (pHt->Which() == RES_TXTATR_FTN)
1465  {
1466  TextFrameIndex const nIdx(MapModelToView(pNode, pHt->GetStart()));
1467  if (nEnd < nIdx)
1468  break;
1469  if (nStart <= nIdx)
1470  {
1471  if (!pPage)
1472  pPage = FindPageFrame();
1473  pPage->RemoveFootnote( this, static_cast<const SwTextFootnote*>(pHt) );
1474  }
1475  }
1476  }
1477 }
1478 
1488 bool sw_HideObj( const SwTextFrame& _rFrame,
1489  const RndStdIds _eAnchorType,
1490  SwPosition const& rAnchorPos,
1491  SwAnchoredObject* _pAnchoredObj )
1492 {
1493  bool bRet( true );
1494 
1495  if (_eAnchorType == RndStdIds::FLY_AT_CHAR)
1496  {
1497  const IDocumentSettingAccess *const pIDSA = &_rFrame.GetDoc().getIDocumentSettingAccess();
1502  _rFrame.IsInDocBody() && !_rFrame.FindNextCnt() )
1503  {
1504  SwTextNode const& rNode(*rAnchorPos.nNode.GetNode().GetTextNode());
1505  assert(FrameContainsNode(_rFrame, rNode.GetIndex()));
1506  sal_Int32 const nObjAnchorPos(rAnchorPos.nContent.GetIndex());
1507  const sal_Unicode cAnchorChar = nObjAnchorPos < rNode.Len()
1508  ? rNode.GetText()[nObjAnchorPos]
1509  : 0;
1510  if (cAnchorChar == CH_TXTATR_BREAKWORD)
1511  {
1512  const SwTextAttr* const pHint(
1513  rNode.GetTextAttrForCharAt(nObjAnchorPos, RES_TXTATR_FLYCNT));
1514  if ( pHint )
1515  {
1516  const SwFrameFormat* pFrameFormat =
1517  static_cast<const SwTextFlyCnt*>(pHint)->GetFlyCnt().GetFrameFormat();
1518  if ( pFrameFormat->Which() == RES_FLYFRMFMT )
1519  {
1520  SwNodeIndex nContentIndex = *(pFrameFormat->GetContent().GetContentIdx());
1521  ++nContentIndex;
1522  if ( nContentIndex.GetNode().IsNoTextNode() )
1523  {
1524  bRet = false;
1525  // set needed data structure values for object positioning
1526  SwRectFnSet aRectFnSet(&_rFrame);
1527  SwRect aLastCharRect( _rFrame.getFrameArea() );
1528  aRectFnSet.SetWidth( aLastCharRect, 1 );
1529  _pAnchoredObj->maLastCharRect = aLastCharRect;
1530  _pAnchoredObj->mnLastTopOfLine = aRectFnSet.GetTop(aLastCharRect);
1531  }
1532  }
1533  }
1534  }
1535  }
1536  }
1537 
1538  return bRet;
1539 }
1540 
1552 {
1553  if ( GetDrawObjs() )
1554  {
1555  if ( IsHiddenNow() )
1556  {
1557  // complete paragraph is hidden. Thus, hide all objects
1558  for (SwAnchoredObject* i : *GetDrawObjs())
1559  {
1560  SdrObject* pObj = i->DrawObj();
1561  SwContact* pContact = static_cast<SwContact*>(pObj->GetUserCall());
1562  // under certain conditions
1563  const RndStdIds eAnchorType( pContact->GetAnchorId() );
1564  if ((eAnchorType != RndStdIds::FLY_AT_CHAR) ||
1565  sw_HideObj(*this, eAnchorType, pContact->GetContentAnchor(),
1566  i ))
1567  {
1568  pContact->MoveObjToInvisibleLayer( pObj );
1569  }
1570  }
1571  }
1572  else
1573  {
1574  // paragraph is visible, but can contain hidden text portion.
1575  // first we check if objects are allowed to be hidden:
1576  const SwViewShell* pVsh = getRootFrame()->GetCurrShell();
1577  const bool bShouldBeHidden = !pVsh || !pVsh->GetWin() ||
1578  !pVsh->GetViewOptions()->IsShowHiddenChar();
1579 
1580  // Thus, show all objects, which are anchored at paragraph and
1581  // hide/show objects, which are anchored at/as character, according
1582  // to the visibility of the anchor character.
1583  for (SwAnchoredObject* i : *GetDrawObjs())
1584  {
1585  SdrObject* pObj = i->DrawObj();
1586  SwContact* pContact = static_cast<SwContact*>(pObj->GetUserCall());
1587  // Determine anchor type only once
1588  const RndStdIds eAnchorType( pContact->GetAnchorId() );
1589 
1590  if (eAnchorType == RndStdIds::FLY_AT_PARA)
1591  {
1592  pContact->MoveObjToVisibleLayer( pObj );
1593  }
1594  else if ((eAnchorType == RndStdIds::FLY_AT_CHAR) ||
1595  (eAnchorType == RndStdIds::FLY_AS_CHAR))
1596  {
1597  sal_Int32 nHiddenStart;
1598  sal_Int32 nHiddenEnd;
1599  const SwPosition& rAnchor = pContact->GetContentAnchor();
1601  *rAnchor.nNode.GetNode().GetTextNode(),
1602  rAnchor.nContent.GetIndex(), nHiddenStart, nHiddenEnd);
1603  // Under certain conditions
1604  if ( nHiddenStart != COMPLETE_STRING && bShouldBeHidden &&
1605  sw_HideObj(*this, eAnchorType, rAnchor, i))
1606  {
1607  pContact->MoveObjToInvisibleLayer( pObj );
1608  }
1609  else
1610  pContact->MoveObjToVisibleLayer( pObj );
1611  }
1612  else
1613  {
1614  OSL_FAIL( "<SwTextFrame::HideAndShowObjects()> - object not anchored at/inside paragraph!?" );
1615  }
1616  }
1617  }
1618  }
1619 
1620  if (IsFollow())
1621  {
1622  SwTextFrame *pMaster = FindMaster();
1623  OSL_ENSURE(pMaster, "SwTextFrame without master");
1624  if (pMaster)
1625  pMaster->HideAndShowObjects();
1626  }
1627 }
1628 
1635 TextFrameIndex SwTextFrame::FindBrk(const OUString &rText,
1636  const TextFrameIndex nStart,
1637  const TextFrameIndex nEnd)
1638 {
1639  sal_Int32 nFound = sal_Int32(nStart);
1640  const sal_Int32 nEndLine = std::min(sal_Int32(nEnd), rText.getLength() - 1);
1641 
1642  // Skip all leading blanks.
1643  while( nFound <= nEndLine && ' ' == rText[nFound] )
1644  {
1645  nFound++;
1646  }
1647 
1648  // A tricky situation with the TextAttr-Dummy-character (in this case "$"):
1649  // "Dr.$Meyer" at the beginning of the second line. Typing a blank after that
1650  // doesn't result in the word moving into first line, even though that would work.
1651  // For this reason we don't skip the dummy char.
1652  while( nFound <= nEndLine && ' ' != rText[nFound] )
1653  {
1654  nFound++;
1655  }
1656 
1657  return TextFrameIndex(nFound);
1658 }
1659 
1660 bool SwTextFrame::IsIdxInside(TextFrameIndex const nPos, TextFrameIndex const nLen) const
1661 {
1662 // Silence over-eager warning emitted at least by GCC trunk towards 6:
1663 #if defined __GNUC__ && !defined __clang__
1664 #pragma GCC diagnostic push
1665 #pragma GCC diagnostic ignored "-Wstrict-overflow"
1666 #endif
1667  if (nLen != TextFrameIndex(COMPLETE_STRING) && GetOffset() > nPos + nLen) // the range preceded us
1668 #if defined __GNUC__ && !defined __clang__
1669 #pragma GCC diagnostic pop
1670 #endif
1671  return false;
1672 
1673  if( !GetFollow() ) // the range doesn't precede us,
1674  return true; // nobody follows us.
1675 
1676  TextFrameIndex const nMax = GetFollow()->GetOffset();
1677 
1678  // either the range overlap or our text has been deleted
1679  // sw_redlinehide: GetText() should be okay here because it has already
1680  // been updated in the INS/DEL hint case
1681  if (nMax > nPos || nMax > TextFrameIndex(GetText().getLength()))
1682  return true;
1683 
1684  // changes made in the first line of a follow can modify the master
1685  const SwParaPortion* pPara = GetFollow()->GetPara();
1686  return pPara && ( nPos <= nMax + pPara->GetLen() );
1687 }
1688 
1689 inline void SwTextFrame::InvalidateRange(const SwCharRange &aRange, const tools::Long nD)
1690 {
1691  if ( IsIdxInside( aRange.Start(), aRange.Len() ) )
1692  InvalidateRange_( aRange, nD );
1693 }
1694 
1696 {
1697  if ( !HasPara() )
1698  { InvalidateSize();
1699  return;
1700  }
1701 
1702  SetWidow( false );
1703  SwParaPortion *pPara = GetPara();
1704 
1705  bool bInv = false;
1706  if( 0 != nD )
1707  {
1708  // In nDelta the differences between old and new
1709  // linelengths are being added, that's why it's negative
1710  // if chars have been added and positive, if chars have
1711  // deleted
1712  pPara->GetDelta() += nD;
1713  bInv = true;
1714  }
1715  SwCharRange &rReformat = pPara->GetReformat();
1716  if(aRange != rReformat) {
1717  if (TextFrameIndex(COMPLETE_STRING) == rReformat.Len())
1718  rReformat = aRange;
1719  else
1720  rReformat += aRange;
1721  bInv = true;
1722  }
1723  if(bInv)
1724  {
1725  InvalidateSize();
1726  }
1727 }
1728 
1730 {
1731  OSL_ENSURE( ! IsVertical() || ! IsSwapped(),
1732  "SwTextFrame::CalcLineSpace with swapped frame!" );
1733 
1734  if( IsLocked() || !HasPara() )
1735  return;
1736 
1737  if( GetDrawObjs() ||
1738  GetTextNodeForParaProps()->GetSwAttrSet().GetLRSpace().IsAutoFirst())
1739  {
1740  Init();
1741  return;
1742  }
1743 
1744  SwParaPortion *const pPara(GetPara());
1745  assert(pPara);
1746  if (pPara->IsFixLineHeight())
1747  {
1748  Init();
1749  return;
1750  }
1751 
1752  Size aNewSize( getFramePrintArea().SSize() );
1753 
1754  SwTextFormatInfo aInf( getRootFrame()->GetCurrShell()->GetOut(), this );
1755  SwTextFormatter aLine( this, &aInf );
1756  if( aLine.GetDropLines() )
1757  {
1758  Init();
1759  return;
1760  }
1761 
1762  aLine.Top();
1763  aLine.RecalcRealHeight();
1764 
1765  aNewSize.setHeight( (aLine.Y() - getFrameArea().Top()) + aLine.GetLineHeight() );
1766 
1767  SwTwips nDelta = aNewSize.Height() - getFramePrintArea().Height();
1768  // Underflow with free-flying frames
1769  if( aInf.GetTextFly().IsOn() )
1770  {
1771  SwRect aTmpFrame( getFrameArea() );
1772  if( nDelta < 0 )
1773  aTmpFrame.Height( getFramePrintArea().Height() );
1774  else
1775  aTmpFrame.Height( aNewSize.Height() );
1776  if( aInf.GetTextFly().Relax( aTmpFrame ) )
1777  {
1778  Init();
1779  return;
1780  }
1781  }
1782 
1783  if( !nDelta )
1784  return;
1785 
1786  SwTextFrameBreak aBreak( this );
1787  if( GetFollow() || aBreak.IsBreakNow( aLine ) )
1788  {
1789  // if there is a Follow() or if we need to break here, reformat
1790  Init();
1791  }
1792  else
1793  {
1794  // everything is business as usual...
1795  pPara->SetPrepAdjust();
1796  pPara->SetPrep();
1797  }
1798 }
1799 
1800 static void lcl_SetWrong( SwTextFrame& rFrame, SwTextNode const& rNode,
1801  sal_Int32 const nPos, sal_Int32 const nCnt, bool const bMove)
1802 {
1803  if ( !rFrame.IsFollow() )
1804  {
1805  SwTextNode* pTextNode = const_cast<SwTextNode*>(&rNode);
1806  IGrammarContact* pGrammarContact = getGrammarContact( *pTextNode );
1807  SwGrammarMarkUp* pWrongGrammar = pGrammarContact ?
1808  pGrammarContact->getGrammarCheck( *pTextNode, false ) :
1809  pTextNode->GetGrammarCheck();
1810  bool bGrammarProxy = pWrongGrammar != pTextNode->GetGrammarCheck();
1811  if( bMove )
1812  {
1813  if( pTextNode->GetWrong() )
1814  pTextNode->GetWrong()->Move( nPos, nCnt );
1815  if( pWrongGrammar )
1816  pWrongGrammar->MoveGrammar( nPos, nCnt );
1817  if( bGrammarProxy && pTextNode->GetGrammarCheck() )
1818  pTextNode->GetGrammarCheck()->MoveGrammar( nPos, nCnt );
1819  if( pTextNode->GetSmartTags() )
1820  pTextNode->GetSmartTags()->Move( nPos, nCnt );
1821  }
1822  else
1823  {
1824  if( pTextNode->GetWrong() )
1825  pTextNode->GetWrong()->Invalidate( nPos, nCnt );
1826  if( pWrongGrammar )
1827  pWrongGrammar->Invalidate( nPos, nCnt );
1828  if( pTextNode->GetSmartTags() )
1829  pTextNode->GetSmartTags()->Invalidate( nPos, nCnt );
1830  }
1831  const sal_Int32 nEnd = nPos + (nCnt > 0 ? nCnt : 1 );
1832  if ( !pTextNode->GetWrong() && !pTextNode->IsWrongDirty() )
1833  {
1834  pTextNode->SetWrong( std::make_unique<SwWrongList>( WRONGLIST_SPELL ) );
1835  pTextNode->GetWrong()->SetInvalid( nPos, nEnd );
1836  }
1837  if ( !pTextNode->GetSmartTags() && !pTextNode->IsSmartTagDirty() )
1838  {
1839  pTextNode->SetSmartTags( std::make_unique<SwWrongList>( WRONGLIST_SMARTTAG ) );
1840  pTextNode->GetSmartTags()->SetInvalid( nPos, nEnd );
1841  }
1843  pTextNode->SetGrammarCheckDirty( true );
1844  pTextNode->SetWordCountDirty( true );
1845  pTextNode->SetAutoCompleteWordDirty( true );
1846  pTextNode->SetSmartTagDirty( true );
1847  }
1848 
1849  SwRootFrame *pRootFrame = rFrame.getRootFrame();
1850  if (pRootFrame)
1851  {
1852  pRootFrame->SetNeedGrammarCheck( true );
1853  }
1854 
1855  SwPageFrame *pPage = rFrame.FindPageFrame();
1856  if( pPage )
1857  {
1858  pPage->InvalidateSpelling();
1859  pPage->InvalidateAutoCompleteWords();
1860  pPage->InvalidateWordCount();
1861  pPage->InvalidateSmartTags();
1862  }
1863 }
1864 
1865 static void lcl_SetScriptInval(SwTextFrame& rFrame, TextFrameIndex const nPos)
1866 {
1867  if( rFrame.GetPara() )
1868  rFrame.GetPara()->GetScriptInfo().SetInvalidityA( nPos );
1869 }
1870 
1871 // note: SwClientNotify will be called once for every frame => just fix own Ofst
1872 static void lcl_ModifyOfst(SwTextFrame & rFrame,
1873  TextFrameIndex const nPos, TextFrameIndex const nLen,
1874  TextFrameIndex (* op)(TextFrameIndex const&, TextFrameIndex const&))
1875 {
1876  assert(nLen != TextFrameIndex(COMPLETE_STRING));
1877  if (rFrame.IsFollow() && nPos < rFrame.GetOffset())
1878  {
1879  rFrame.ManipOfst( std::max(nPos, op(rFrame.GetOffset(), nLen)) );
1880  assert(sal_Int32(rFrame.GetOffset()) <= rFrame.GetText().getLength());
1881  }
1882 }
1883 
1884 namespace {
1885 
1886 void UpdateMergedParaForMove(sw::MergedPara & rMerged,
1887  SwTextFrame & rTextFrame,
1888  bool & o_rbRecalcFootnoteFlag,
1889  SwTextNode const& rDestNode,
1890  SwTextNode const& rNode,
1891  sal_Int32 const nDestStart,
1892  sal_Int32 const nSourceStart,
1893  sal_Int32 const nLen)
1894 {
1895  std::vector<std::pair<sal_Int32, sal_Int32>> deleted;
1896  sal_Int32 const nSourceEnd(nSourceStart + nLen);
1897  sal_Int32 nLastEnd(0);
1898  for (const auto& rExt : rMerged.extents)
1899  {
1900  if (rExt.pNode == &rNode)
1901  {
1902  sal_Int32 const nStart(std::max(nLastEnd, nSourceStart));
1903  sal_Int32 const nEnd(std::min(rExt.nStart, nSourceEnd));
1904  if (nStart < nEnd)
1905  {
1906  deleted.emplace_back(nStart, nEnd);
1907  }
1908  nLastEnd = rExt.nEnd;
1909  if (nSourceEnd <= rExt.nEnd)
1910  {
1911  break;
1912  }
1913  }
1914  else if (rNode.GetIndex() < rExt.pNode->GetIndex())
1915  {
1916  break;
1917  }
1918  }
1919  if (nLastEnd != rNode.Len()) // without nLen, string yet to be removed
1920  {
1921  if (nLastEnd < nSourceEnd)
1922  {
1923  deleted.emplace_back(std::max(nLastEnd, nSourceStart), nSourceEnd);
1924  }
1925  }
1926  if (deleted.empty())
1927  return;
1928 
1929  o_rbRecalcFootnoteFlag = true;
1930  for (auto const& it : deleted)
1931  {
1932  sal_Int32 const nStart(it.first - nSourceStart + nDestStart);
1933  TextFrameIndex const nDeleted = UpdateMergedParaForDelete(rMerged, false,
1934  rDestNode, nStart, it.second - it.first);
1935 //FIXME asserts valid for join - but if called from split, the new node isn't there yet and it will be added later... assert(nDeleted);
1936 // assert(nDeleted == it.second - it.first);
1937  if(nDeleted)
1938  {
1939  // InvalidateRange/lcl_SetScriptInval was called sufficiently for SwInsText
1940  lcl_SetWrong(rTextFrame, rDestNode, nStart, it.first - it.second, false);
1941  TextFrameIndex const nIndex(sw::MapModelToView(rMerged, &rDestNode, nStart));
1942  lcl_ModifyOfst(rTextFrame, nIndex, nDeleted, &o3tl::operator-<sal_Int32, Tag_TextFrameIndex>);
1943  }
1944  }
1945 }
1946 
1947 } // namespace
1948 
1953 static bool isA11yRelevantAttribute(sal_uInt16 nWhich)
1954 {
1955  return nWhich != RES_CHRATR_RSID;
1956 }
1957 
1958 static bool hasA11yRelevantAttribute( const std::vector<sal_uInt16>& rWhichFmtAttr )
1959 {
1960  for( sal_uInt16 nWhich : rWhichFmtAttr )
1961  if ( isA11yRelevantAttribute( nWhich ) )
1962  return true;
1963 
1964  return false;
1965 }
1966 
1967 // Note: for now this overrides SwClient::SwClientNotify; the intermediary
1968 // classes still override SwClient::Modify, which should continue to work
1969 // as their implementation of SwClientNotify is SwClient's which calls Modify.
1970 // Therefore we also don't need to call SwClient::SwClientNotify(rModify, rHint)
1971 // because that's all it does, and this implementation calls
1972 // SwContentFrame::SwClientNotify() when appropriate.
1973 void SwTextFrame::SwClientNotify(SwModify const& rModify, SfxHint const& rHint)
1974 {
1975  SfxPoolItem const* pOld(nullptr);
1976  SfxPoolItem const* pNew(nullptr);
1977  sw::MoveText const* pMoveText(nullptr);
1978  sw::RedlineDelText const* pRedlineDelText(nullptr);
1979  sw::RedlineUnDelText const* pRedlineUnDelText(nullptr);
1980 
1981  sal_uInt16 nWhich = 0;
1982  if (rHint.GetId() == SfxHintId::SwLegacyModify)
1983  {
1984  auto pHint = static_cast<const sw::LegacyModifyHint*>(&rHint);
1985  pOld = pHint->m_pOld;
1986  pNew = pHint->m_pNew;
1987  nWhich = pHint->GetWhich();
1988  }
1989  else if (auto const pHt = dynamic_cast<sw::MoveText const*>(&rHint))
1990  {
1991  pMoveText = pHt;
1992  }
1993  else if (auto const pHynt = dynamic_cast<sw::RedlineDelText const*>(&rHint))
1994  {
1995  pRedlineDelText = pHynt;
1996  }
1997  else if (auto const pHnt = dynamic_cast<sw::RedlineUnDelText const*>(&rHint))
1998  {
1999  pRedlineUnDelText = pHnt;
2000  }
2001  else
2002  {
2003  assert(!"unexpected hint");
2004  }
2005 
2006  if (m_pMergedPara)
2007  {
2008  assert(m_pMergedPara->listener.IsListeningTo(&rModify));
2009  }
2010 
2011  SwTextNode const& rNode(static_cast<SwTextNode const&>(rModify));
2012 
2013  // modifications concerning frame attributes are processed by the base class
2014  if( IsInRange( aFrameFormatSetRange, nWhich ) || RES_FMT_CHG == nWhich )
2015  {
2016  if (m_pMergedPara)
2017  { // ignore item set changes that don't apply
2018  SwTextNode const*const pAttrNode(
2019  (nWhich == RES_PAGEDESC || nWhich == RES_BREAK)
2020  ? m_pMergedPara->pFirstNode
2021  : m_pMergedPara->pParaPropsNode);
2022  if (pAttrNode != &rModify)
2023  {
2024  return;
2025  }
2026  }
2028  if( nWhich == RES_FMT_CHG && getRootFrame()->GetCurrShell() )
2029  {
2030  // collection has changed
2031  Prepare();
2032  InvalidatePrt_();
2033  lcl_SetWrong( *this, rNode, 0, COMPLETE_STRING, false );
2034  SetDerivedR2L( false );
2035  CheckDirChange();
2036  // Force complete paint due to existing indents.
2037  SetCompletePaint();
2039  }
2040  return;
2041  }
2042 
2043  if (m_pMergedPara && m_pMergedPara->pParaPropsNode != &rModify)
2044  {
2045  if (isPARATR(nWhich) || isPARATR_LIST(nWhich)) // FRMATR handled above
2046  {
2047  return; // ignore it
2048  }
2049  }
2050 
2051  Broadcast(SfxHint()); // notify SwAccessibleParagraph
2052 
2053  // while locked ignore all modifications
2054  if( IsLocked() )
2055  return;
2056 
2057  // save stack
2058  // warning: one has to ensure that all variables are set
2059  TextFrameIndex nPos;
2060  TextFrameIndex nLen;
2061  bool bSetFieldsDirty = false;
2062  bool bRecalcFootnoteFlag = false;
2063 
2064  if (pRedlineDelText)
2065  {
2066  if (m_pMergedPara)
2067  {
2068  sal_Int32 const nNPos = pRedlineDelText->nStart;
2069  sal_Int32 const nNLen = pRedlineDelText->nLen;
2070  nPos = MapModelToView(&rNode, nNPos);
2071  // update merged before doing anything else
2072  nLen = UpdateMergedParaForDelete(*m_pMergedPara, false, rNode, nNPos, nNLen);
2073  const sal_Int32 m = -nNLen;
2074  if (nLen && IsIdxInside(nPos, nLen))
2075  {
2076  InvalidateRange( SwCharRange(nPos, TextFrameIndex(1)), m );
2077  }
2078  lcl_SetWrong( *this, rNode, nNPos, m, false );
2079  if (nLen)
2080  {
2081  lcl_SetScriptInval( *this, nPos );
2082  bSetFieldsDirty = bRecalcFootnoteFlag = true;
2083  lcl_ModifyOfst(*this, nPos, nLen, &o3tl::operator-<sal_Int32, Tag_TextFrameIndex>);
2084  }
2085  }
2086  }
2087  else if (pRedlineUnDelText)
2088  {
2089  if (m_pMergedPara)
2090  {
2091  sal_Int32 const nNPos = pRedlineUnDelText->nStart;
2092  sal_Int32 const nNLen = pRedlineUnDelText->nLen;
2093  nPos = MapModelToView(&rNode, nNPos);
2094  nLen = UpdateMergedParaForInsert(*m_pMergedPara, false, rNode, nNPos, nNLen);
2095  if (IsIdxInside(nPos, nLen))
2096  {
2097  if (!nLen)
2098  {
2099  // Refresh NumPortions even when line is empty!
2100  if (nPos)
2101  InvalidateSize();
2102  else
2103  Prepare();
2104  }
2105  else
2106  InvalidateRange_( SwCharRange( nPos, nLen ), nNLen );
2107  }
2108  lcl_SetWrong( *this, rNode, nNPos, nNLen, false );
2109  lcl_SetScriptInval( *this, nPos );
2110  bSetFieldsDirty = true;
2111  lcl_ModifyOfst(*this, nPos, nLen, &o3tl::operator+<sal_Int32, Tag_TextFrameIndex>);
2112  }
2113  }
2114  else if (pMoveText)
2115  {
2116  if (m_pMergedPara
2117  && m_pMergedPara->pFirstNode->GetIndex() <= pMoveText->pDestNode->GetIndex()
2118  && pMoveText->pDestNode->GetIndex() <= m_pMergedPara->pLastNode->GetIndex())
2119  { // if it's not 2 nodes in merged frame, assume the target node doesn't have frames at all
2120  assert(std::abs(static_cast<tools::Long>(rNode.GetIndex()) - static_cast<tools::Long>(pMoveText->pDestNode->GetIndex())) == 1);
2121  UpdateMergedParaForMove(*m_pMergedPara,
2122  *this,
2123  bRecalcFootnoteFlag,
2124  *pMoveText->pDestNode, rNode,
2125  pMoveText->nDestStart,
2126  pMoveText->nSourceStart,
2127  pMoveText->nLen);
2128  }
2129  else
2130  {
2131  // there is a situation where this is okay: from JoinNext, which will then call CheckResetRedlineMergeFlag, which will then create merged from scratch for this frame
2132  // assert(!m_pMergedPara || !getRootFrame()->IsHideRedlines() || !pMoveText->pDestNode->getLayoutFrame(getRootFrame()));
2133  }
2134  }
2135  else switch (nWhich)
2136  {
2137  case RES_LINENUMBER:
2138  {
2139  assert(false); // should have been forwarded to SwContentFrame
2141  }
2142  break;
2143  case RES_INS_TXT:
2144  {
2145  sal_Int32 const nNPos = static_cast<const SwInsText*>(pNew)->nPos;
2146  sal_Int32 const nNLen = static_cast<const SwInsText*>(pNew)->nLen;
2147  nPos = MapModelToView(&rNode, nNPos);
2148  nLen = TextFrameIndex(nNLen);
2149  if (m_pMergedPara)
2150  {
2151  UpdateMergedParaForInsert(*m_pMergedPara, true, rNode, nNPos, nNLen);
2152  }
2153  if( IsIdxInside( nPos, nLen ) )
2154  {
2155  if( !nLen )
2156  {
2157  // Refresh NumPortions even when line is empty!
2158  if( nPos )
2159  InvalidateSize();
2160  else
2161  Prepare();
2162  }
2163  else
2164  InvalidateRange_( SwCharRange( nPos, nLen ), nNLen );
2165  }
2166  lcl_SetWrong( *this, rNode, nNPos, nNLen, true );
2167  lcl_SetScriptInval( *this, nPos );
2168  bSetFieldsDirty = true;
2169  lcl_ModifyOfst(*this, nPos, nLen, &o3tl::operator+<sal_Int32, Tag_TextFrameIndex>);
2170  }
2171  break;
2172  case RES_DEL_CHR:
2173  {
2174  sal_Int32 const nNPos = static_cast<const SwDelChr*>(pNew)->nPos;
2175  nPos = MapModelToView(&rNode, nNPos);
2176  if (m_pMergedPara)
2177  {
2178  nLen = UpdateMergedParaForDelete(*m_pMergedPara, true, rNode, nNPos, 1);
2179  }
2180  else
2181  {
2182  nLen = TextFrameIndex(1);
2183  }
2184  lcl_SetWrong( *this, rNode, nNPos, -1, true );
2185  if (nLen)
2186  {
2187  InvalidateRange( SwCharRange(nPos, nLen), -1 );
2188  lcl_SetScriptInval( *this, nPos );
2189  bSetFieldsDirty = bRecalcFootnoteFlag = true;
2190  lcl_ModifyOfst(*this, nPos, nLen, &o3tl::operator-<sal_Int32, Tag_TextFrameIndex>);
2191  }
2192  }
2193  break;
2194  case RES_DEL_TXT:
2195  {
2196  sal_Int32 const nNPos = static_cast<const SwDelText*>(pNew)->nStart;
2197  sal_Int32 const nNLen = static_cast<const SwDelText*>(pNew)->nLen;
2198  nPos = MapModelToView(&rNode, nNPos);
2199  if (m_pMergedPara)
2200  { // update merged before doing anything else
2201  nLen = UpdateMergedParaForDelete(*m_pMergedPara, true, rNode, nNPos, nNLen);
2202  }
2203  else
2204  {
2205  nLen = TextFrameIndex(nNLen);
2206  }
2207  const sal_Int32 m = -nNLen;
2208  if ((!m_pMergedPara || nLen) && IsIdxInside(nPos, nLen))
2209  {
2210  if( !nLen )
2211  InvalidateSize();
2212  else
2213  InvalidateRange( SwCharRange(nPos, TextFrameIndex(1)), m );
2214  }
2215  lcl_SetWrong( *this, rNode, nNPos, m, true );
2216  if (nLen)
2217  {
2218  lcl_SetScriptInval( *this, nPos );
2219  bSetFieldsDirty = bRecalcFootnoteFlag = true;
2220  lcl_ModifyOfst(*this, nPos, nLen, &o3tl::operator-<sal_Int32, Tag_TextFrameIndex>);
2221  }
2222  }
2223  break;
2224  case RES_UPDATE_ATTR:
2225  {
2226  const SwUpdateAttr* pNewUpdate = static_cast<const SwUpdateAttr*>(pNew);
2227 
2228  sal_Int32 const nNPos = pNewUpdate->getStart();
2229  sal_Int32 const nNLen = pNewUpdate->getEnd() - nNPos;
2230  nPos = MapModelToView(&rNode, nNPos);
2231  nLen = MapModelToView(&rNode, nNPos + nNLen) - nPos;
2232  if( IsIdxInside( nPos, nLen ) )
2233  {
2234  // We need to reformat anyways, even if the invalidated
2235  // range is empty.
2236  // E.g.: empty line, set 14 pt!
2237 
2238  // FootnoteNumbers need to be formatted
2239  if( !nLen )
2240  nLen = TextFrameIndex(1);
2241 
2242  InvalidateRange_( SwCharRange( nPos, nLen) );
2243  const sal_uInt16 nTmp = pNewUpdate->getWhichAttr();
2244 
2245  if( ! nTmp || RES_TXTATR_CHARFMT == nTmp || RES_TXTATR_INETFMT == nTmp || RES_TXTATR_AUTOFMT == nTmp ||
2246  RES_FMT_CHG == nTmp || RES_ATTRSET_CHG == nTmp )
2247  {
2248  lcl_SetWrong( *this, rNode, nNPos, nNPos + nNLen, false );
2249  lcl_SetScriptInval( *this, nPos );
2250  }
2251  }
2252 
2253  if( isA11yRelevantAttribute( pNewUpdate->getWhichAttr() ) &&
2254  hasA11yRelevantAttribute( pNewUpdate->getFmtAttrs() ) )
2255  {
2256  SwViewShell* pViewSh = getRootFrame() ? getRootFrame()->GetCurrShell() : nullptr;
2257  if ( pViewSh )
2258  {
2259  pViewSh->InvalidateAccessibleParaAttrs( *this );
2260  }
2261  }
2262  }
2263  break;
2264  case RES_OBJECTDYING:
2265  break;
2266 
2268  {
2269  CalcLineSpace();
2270  InvalidateSize();
2271  InvalidatePrt_();
2272  if( IsInSct() && !GetPrev() )
2273  {
2274  SwSectionFrame *pSect = FindSctFrame();
2275  if( pSect->ContainsAny() == this )
2276  pSect->InvalidatePrt();
2277  }
2278 
2279  // i#11859
2280  // (1) Also invalidate next frame on next page/column.
2281  // (2) Skip empty sections and hidden paragraphs
2282  // Thus, use method <InvalidateNextPrtArea()>
2284 
2285  SetCompletePaint();
2286  }
2287  break;
2288 
2289  case RES_TXTATR_FIELD:
2290  case RES_TXTATR_ANNOTATION:
2291  {
2292  sal_Int32 const nNPos = static_cast<const SwFormatField*>(pNew)->GetTextField()->GetStart();
2293  nPos = MapModelToView(&rNode, nNPos);
2294  if (IsIdxInside(nPos, TextFrameIndex(1)))
2295  {
2296  if( pNew == pOld )
2297  {
2298  // only repaint
2299  // opt: invalidate window?
2300  InvalidatePage();
2301  SetCompletePaint();
2302  }
2303  else
2305  }
2306  bSetFieldsDirty = true;
2307  // ST2
2308  if ( SwSmartTagMgr::Get().IsSmartTagsEnabled() )
2309  lcl_SetWrong( *this, rNode, nNPos, nNPos + 1, false );
2310  }
2311  break;
2312 
2313  case RES_TXTATR_FTN :
2314  {
2315  if (!IsInFootnote())
2316  { // the hint may be sent from the anchor node, or from a
2317  // node in the footnote; the anchor index is only valid in the
2318  // anchor node!
2319  assert(&rNode == &static_cast<const SwFormatFootnote*>(pNew)->GetTextFootnote()->GetTextNode());
2320  nPos = MapModelToView(&rNode,
2321  static_cast<const SwFormatFootnote*>(pNew)->GetTextFootnote()->GetStart());
2322  }
2323 #ifdef _MSC_VER
2324  else nPos = TextFrameIndex(42); // shut up MSVC 2017 spurious warning C4701
2325 #endif
2326  if (IsInFootnote() || IsIdxInside(nPos, TextFrameIndex(1)))
2327  Prepare( PrepareHint::FootnoteInvalidation, static_cast<const SwFormatFootnote*>(pNew)->GetTextFootnote() );
2328  break;
2329  }
2330 
2331  case RES_ATTRSET_CHG:
2332  {
2334 
2335  const SwAttrSet& rNewSet = *static_cast<const SwAttrSetChg*>(pNew)->GetChgSet();
2336  const SfxPoolItem* pItem = nullptr;
2337  int nClear = 0;
2338  sal_uInt16 nCount = rNewSet.Count();
2339 
2340  if( SfxItemState::SET == rNewSet.GetItemState( RES_TXTATR_FTN, false, &pItem ))
2341  {
2342  nPos = MapModelToView(&rNode,
2343  static_cast<const SwFormatFootnote*>(pItem)->GetTextFootnote()->GetStart());
2344  if (IsIdxInside(nPos, TextFrameIndex(1)))
2346  nClear = 0x01;
2347  --nCount;
2348  }
2349 
2350  if( SfxItemState::SET == rNewSet.GetItemState( RES_TXTATR_FIELD, false, &pItem ))
2351  {
2352  nPos = MapModelToView(&rNode,
2353  static_cast<const SwFormatField*>(pItem)->GetTextField()->GetStart());
2354  if (IsIdxInside(nPos, TextFrameIndex(1)))
2355  {
2356  const SfxPoolItem* pOldItem = pOld ?
2357  &(static_cast<const SwAttrSetChg*>(pOld)->GetChgSet()->Get(RES_TXTATR_FIELD)) : nullptr;
2358  if( pItem == pOldItem )
2359  {
2360  InvalidatePage();
2361  SetCompletePaint();
2362  }
2363  else
2365  }
2366  nClear |= 0x02;
2367  --nCount;
2368  }
2369  bool bLineSpace = SfxItemState::SET == rNewSet.GetItemState(
2370  RES_PARATR_LINESPACING, false ),
2371  bRegister = SfxItemState::SET == rNewSet.GetItemState(
2372  RES_PARATR_REGISTER, false );
2373  if ( bLineSpace || bRegister )
2374  {
2375  if (!m_pMergedPara || m_pMergedPara->pParaPropsNode == &rModify)
2376  {
2378  CalcLineSpace();
2379  InvalidateSize();
2380  InvalidatePrt_();
2381 
2382  // i#11859
2383  // (1) Also invalidate next frame on next page/column.
2384  // (2) Skip empty sections and hidden paragraphs
2385  // Thus, use method <InvalidateNextPrtArea()>
2387 
2388  SetCompletePaint();
2389  }
2390  nClear |= 0x04;
2391  if ( bLineSpace )
2392  {
2393  --nCount;
2394  if ((!m_pMergedPara || m_pMergedPara->pParaPropsNode == &rModify)
2395  && IsInSct() && !GetPrev())
2396  {
2397  SwSectionFrame *pSect = FindSctFrame();
2398  if( pSect->ContainsAny() == this )
2399  pSect->InvalidatePrt();
2400  }
2401  }
2402  if ( bRegister )
2403  --nCount;
2404  }
2405  if ( SfxItemState::SET == rNewSet.GetItemState( RES_PARATR_SPLIT,
2406  false ))
2407  {
2408  if (!m_pMergedPara || m_pMergedPara->pParaPropsNode == &rModify)
2409  {
2410  if (GetPrev())
2411  CheckKeep();
2412  Prepare();
2413  InvalidateSize();
2414  }
2415  nClear |= 0x08;
2416  --nCount;
2417  }
2418 
2419  if( SfxItemState::SET == rNewSet.GetItemState( RES_BACKGROUND, false)
2420  && (!m_pMergedPara || m_pMergedPara->pParaPropsNode == &rModify)
2421  && !IsFollow() && GetDrawObjs() )
2422  {
2423  SwSortedObjs *pObjs = GetDrawObjs();
2424  for ( size_t i = 0; GetDrawObjs() && i < pObjs->size(); ++i )
2425  {
2426  SwAnchoredObject* pAnchoredObj = (*pObjs)[i];
2427  if ( auto pFly = dynamic_cast<SwFlyFrame *>( pAnchoredObj ) )
2428  {
2429  if( !pFly->IsFlyInContentFrame() )
2430  {
2431  const SvxBrushItem &rBack =
2432  pFly->GetAttrSet()->GetBackground();
2433  // #GetTransChg#
2434  // following condition determines, if the fly frame
2435  // "inherites" the background color of text frame.
2436  // This is the case, if fly frame background
2437  // color is "no fill"/"auto fill" and if the fly frame
2438  // has no background graphic.
2439  // Thus, check complete fly frame background
2440  // color and *not* only its transparency value
2441  if ( (rBack.GetColor() == COL_TRANSPARENT) &&
2442  rBack.GetGraphicPos() == GPOS_NONE )
2443  {
2444  pFly->SetCompletePaint();
2445  pFly->InvalidatePage();
2446  }
2447  }
2448  }
2449  }
2450  }
2451 
2452  if ( SfxItemState::SET ==
2453  rNewSet.GetItemState( RES_TXTATR_CHARFMT, false ) )
2454  {
2455  lcl_SetWrong( *this, rNode, 0, COMPLETE_STRING, false );
2456  lcl_SetScriptInval( *this, TextFrameIndex(0) );
2457  }
2458  else if ( SfxItemState::SET ==
2459  rNewSet.GetItemState( RES_CHRATR_LANGUAGE, false ) ||
2460  SfxItemState::SET ==
2461  rNewSet.GetItemState( RES_CHRATR_CJK_LANGUAGE, false ) ||
2462  SfxItemState::SET ==
2463  rNewSet.GetItemState( RES_CHRATR_CTL_LANGUAGE, false ) )
2464  lcl_SetWrong( *this, rNode, 0, COMPLETE_STRING, false );
2465  else if ( SfxItemState::SET ==
2466  rNewSet.GetItemState( RES_CHRATR_FONT, false ) ||
2467  SfxItemState::SET ==
2468  rNewSet.GetItemState( RES_CHRATR_CJK_FONT, false ) ||
2469  SfxItemState::SET ==
2470  rNewSet.GetItemState( RES_CHRATR_CTL_FONT, false ) )
2471  lcl_SetScriptInval( *this, TextFrameIndex(0) );
2472  else if ( SfxItemState::SET ==
2473  rNewSet.GetItemState( RES_FRAMEDIR, false )
2474  && (!m_pMergedPara || m_pMergedPara->pParaPropsNode == &rModify))
2475  {
2476  SetDerivedR2L( false );
2477  CheckDirChange();
2478  // Force complete paint due to existing indents.
2479  SetCompletePaint();
2480  }
2481 
2482  if( nCount )
2483  {
2484  if( getRootFrame()->GetCurrShell() )
2485  {
2486  Prepare();
2487  InvalidatePrt_();
2488  }
2489 
2490  if (nClear || (m_pMergedPara &&
2491  (m_pMergedPara->pParaPropsNode != &rModify ||
2492  m_pMergedPara->pFirstNode != &rModify)))
2493  {
2494  assert(pOld);
2495  SwAttrSetChg aOldSet( *static_cast<const SwAttrSetChg*>(pOld) );
2496  SwAttrSetChg aNewSet( *static_cast<const SwAttrSetChg*>(pNew) );
2497 
2498  if (m_pMergedPara && m_pMergedPara->pParaPropsNode != &rModify)
2499  {
2500  for (sal_uInt16 i = RES_PARATR_BEGIN; i != RES_FRMATR_END; ++i)
2501  {
2502  if (i != RES_BREAK && i != RES_PAGEDESC)
2503  {
2504  aOldSet.ClearItem(i);
2505  aNewSet.ClearItem(i);
2506  }
2507  }
2508  for (sal_uInt16 i = XATTR_FILL_FIRST; i <= XATTR_FILL_LAST; ++i)
2509  {
2510  aOldSet.ClearItem(i);
2511  aNewSet.ClearItem(i);
2512  }
2513  }
2514  if (m_pMergedPara && m_pMergedPara->pFirstNode != &rModify)
2515  {
2516  aOldSet.ClearItem(RES_BREAK);
2517  aNewSet.ClearItem(RES_BREAK);
2518  aOldSet.ClearItem(RES_PAGEDESC);
2519  aNewSet.ClearItem(RES_PAGEDESC);
2520  }
2521 
2522  if( 0x01 & nClear )
2523  {
2524  aOldSet.ClearItem( RES_TXTATR_FTN );
2525  aNewSet.ClearItem( RES_TXTATR_FTN );
2526  }
2527  if( 0x02 & nClear )
2528  {
2529  aOldSet.ClearItem( RES_TXTATR_FIELD );
2530  aNewSet.ClearItem( RES_TXTATR_FIELD );
2531  }
2532  if ( 0x04 & nClear )
2533  {
2534  if ( bLineSpace )
2535  {
2536  aOldSet.ClearItem( RES_PARATR_LINESPACING );
2537  aNewSet.ClearItem( RES_PARATR_LINESPACING );
2538  }
2539  if ( bRegister )
2540  {
2541  aOldSet.ClearItem( RES_PARATR_REGISTER );
2542  aNewSet.ClearItem( RES_PARATR_REGISTER );
2543  }
2544  }
2545  if ( 0x08 & nClear )
2546  {
2547  aOldSet.ClearItem( RES_PARATR_SPLIT );
2548  aNewSet.ClearItem( RES_PARATR_SPLIT );
2549  }
2550  if (aOldSet.Count() || aNewSet.Count())
2551  {
2552  SwContentFrame::SwClientNotify(rModify, sw::LegacyModifyHint(&aOldSet, &aNewSet));
2553  }
2554  }
2555  else
2557  }
2558 
2559  if (isA11yRelevantAttribute(nWhich))
2560  {
2561  SwViewShell* pViewSh = getRootFrame() ? getRootFrame()->GetCurrShell() : nullptr;
2562  if ( pViewSh )
2563  {
2564  pViewSh->InvalidateAccessibleParaAttrs( *this );
2565  }
2566  }
2567  }
2568  break;
2569 
2570  // Process SwDocPosUpdate
2571  case RES_DOCPOS_UPDATE:
2572  {
2573  if( pOld && pNew )
2574  {
2575  const SwDocPosUpdate *pDocPos = static_cast<const SwDocPosUpdate*>(pOld);
2576  if( pDocPos->nDocPos <= getFrameArea().Top() )
2577  {
2578  const SwFormatField *pField = static_cast<const SwFormatField *>(pNew);
2579  TextFrameIndex const nIndex(MapModelToView(&rNode,
2580  pField->GetTextField()->GetStart()));
2582  }
2583  }
2584  break;
2585  }
2586  case RES_PARATR_SPLIT:
2587  if ( GetPrev() )
2588  CheckKeep();
2589  Prepare();
2590  bSetFieldsDirty = true;
2591  break;
2592  case RES_FRAMEDIR :
2593  assert(false); // should have been forwarded to SwContentFrame
2594  SetDerivedR2L( false );
2595  CheckDirChange();
2596  break;
2597  default:
2598  {
2599  Prepare();
2600  InvalidatePrt_();
2601  if ( !nWhich )
2602  {
2603  // is called by e. g. HiddenPara with 0
2604  SwFrame *pNxt = FindNext();
2605  if ( nullptr != pNxt )
2606  pNxt->InvalidatePrt();
2607  }
2608  }
2609  } // switch
2610 
2611  if( bSetFieldsDirty )
2612  GetDoc().getIDocumentFieldsAccess().SetFieldsDirty( true, &rNode, 1 );
2613 
2614  if ( bRecalcFootnoteFlag )
2615  CalcFootnoteFlag();
2616 }
2617 
2618 bool SwTextFrame::GetInfo( SfxPoolItem &rHint ) const
2619 {
2620  if ( RES_VIRTPAGENUM_INFO == rHint.Which() && IsInDocBody() && ! IsFollow() )
2621  {
2622  SwVirtPageNumInfo &rInfo = static_cast<SwVirtPageNumInfo&>(rHint);
2623  const SwPageFrame *pPage = FindPageFrame();
2624  if ( pPage )
2625  {
2626  if ( pPage == rInfo.GetOrigPage() && !GetPrev() )
2627  {
2628  // this should be the one
2629  // (could only differ temporarily; is that disturbing?)
2630  rInfo.SetInfo( pPage, this );
2631  return false;
2632  }
2633  if ( pPage->GetPhyPageNum() < rInfo.GetOrigPage()->GetPhyPageNum() &&
2634  (!rInfo.GetPage() || pPage->GetPhyPageNum() > rInfo.GetPage()->GetPhyPageNum()))
2635  {
2636  // this could be the one
2637  rInfo.SetInfo( pPage, this );
2638  }
2639  }
2640  }
2641  return true;
2642 }
2643 
2644 void SwTextFrame::PrepWidows( const sal_uInt16 nNeed, bool bNotify )
2645 {
2646  OSL_ENSURE(GetFollow() && nNeed, "+SwTextFrame::Prepare: lost all friends");
2647 
2648  SwParaPortion *pPara = GetPara();
2649  if ( !pPara )
2650  return;
2651  pPara->SetPrepWidows();
2652 
2653  sal_uInt16 nHave = nNeed;
2654 
2655  // We yield a few lines and shrink in CalcPreps()
2656  SwSwapIfNotSwapped swap( this );
2657 
2658  SwTextSizeInfo aInf( this );
2659  SwTextMargin aLine( this, &aInf );
2660  aLine.Bottom();
2661  TextFrameIndex nTmpLen = aLine.GetCurr()->GetLen();
2662  while( nHave && aLine.PrevLine() )
2663  {
2664  if( nTmpLen )
2665  --nHave;
2666  nTmpLen = aLine.GetCurr()->GetLen();
2667  }
2668 
2669  // If it's certain that we can yield lines, the Master needs
2670  // to check the widow rule
2671  if( !nHave )
2672  {
2673  bool bSplit = true;
2674  if( !IsFollow() ) // only a master decides about orphans
2675  {
2676  const WidowsAndOrphans aWidOrp( this );
2677  bSplit = ( aLine.GetLineNr() >= aWidOrp.GetOrphansLines() &&
2678  aLine.GetLineNr() >= aLine.GetDropLines() );
2679  }
2680 
2681  if( bSplit )
2682  {
2683  GetFollow()->SetOffset( aLine.GetEnd() );
2684  aLine.TruncLines( true );
2685  if( pPara->IsFollowField() )
2686  GetFollow()->SetFieldFollow( true );
2687  }
2688  }
2689  if ( bNotify )
2690  {
2691  InvalidateSize_();
2692  InvalidatePage();
2693  }
2694 }
2695 
2696 static bool lcl_ErgoVadis(SwTextFrame* pFrame, TextFrameIndex & rPos, const PrepareHint ePrep)
2697 {
2698  const SwFootnoteInfo &rFootnoteInfo = pFrame->GetDoc().GetFootnoteInfo();
2699  if( ePrep == PrepareHint::ErgoSum )
2700  {
2701  if( rFootnoteInfo.m_aErgoSum.isEmpty() )
2702  return false;
2703  rPos = pFrame->GetOffset();
2704  }
2705  else
2706  {
2707  if( rFootnoteInfo.m_aQuoVadis.isEmpty() )
2708  return false;
2709  if( pFrame->HasFollow() )
2710  rPos = pFrame->GetFollow()->GetOffset();
2711  else
2712  rPos = TextFrameIndex(pFrame->GetText().getLength());
2713  if( rPos )
2714  --rPos; // our last character
2715  }
2716  return true;
2717 }
2718 
2719 // Silence over-eager warning emitted at least by GCC 5.3.1
2720 #if defined __GNUC__ && !defined __clang__
2721 # pragma GCC diagnostic push
2722 # pragma GCC diagnostic ignored "-Wstrict-overflow"
2723 #endif
2724 bool SwTextFrame::Prepare( const PrepareHint ePrep, const void* pVoid,
2725  bool bNotify )
2726 {
2727  bool bParaPossiblyInvalid = false;
2728 
2729  SwFrameSwapper aSwapper( this, false );
2730 
2731  if ( IsEmpty() )
2732  {
2733  switch ( ePrep )
2734  {
2736  SetInvalidVert( true ); // Test
2737  [[fallthrough]];
2739  case PrepareHint::Widows:
2740  case PrepareHint::FootnoteInvalidationGone : return bParaPossiblyInvalid;
2741 
2743  {
2744  // We also need an InvalidateSize for Areas (with and without columns),
2745  // so that we format and bUndersized is set (if needed)
2746  if( IsInFly() || IsInSct() )
2747  {
2748  SwTwips nTmpBottom = GetUpper()->getFrameArea().Top() +
2750  if( nTmpBottom < getFrameArea().Bottom() )
2751  break;
2752  }
2753  // Are there any free-flying frames on this page?
2754  SwTextFly aTextFly( this );
2755  if( aTextFly.IsOn() )
2756  {
2757  // Does any free-flying frame overlap?
2758  if ( aTextFly.Relax() || IsUndersized() )
2759  break;
2760  }
2762  break;
2763 
2764  SwTextGridItem const*const pGrid(GetGridItem(FindPageFrame()));
2765  if (pGrid && GetTextNodeForParaProps()->GetSwAttrSet().GetParaGrid().GetValue())
2766  break;
2767 
2768  // i#28701 - consider anchored objects
2769  if ( GetDrawObjs() )
2770  break;
2771 
2772  return bParaPossiblyInvalid;
2773  }
2774  default:
2775  break;
2776  }
2777  }
2778 
2779  if( !HasPara() && PrepareHint::MustFit != ePrep )
2780  {
2781  SetInvalidVert( true ); // Test
2782  OSL_ENSURE( !IsLocked(), "SwTextFrame::Prepare: three of a perfect pair" );
2783  if ( bNotify )
2784  InvalidateSize();
2785  else
2786  InvalidateSize_();
2787  return bParaPossiblyInvalid;
2788  }
2789 
2790  // Get object from cache while locking
2791  SwTextLineAccess aAccess( this );
2792  SwParaPortion *pPara = aAccess.GetPara();
2793 
2794  switch( ePrep )
2795  {
2797  {
2799  aFrm.Height(0);
2800  }
2801 
2802  {
2804  aPrt.Height(0);
2805  }
2806 
2807  InvalidatePrt_();
2808  InvalidateSize_();
2809  [[fallthrough]];
2811  pPara->SetPrepAdjust();
2812  if( IsFootnoteNumFrame() != pPara->IsFootnoteNum() ||
2813  IsUndersized() )
2814  {
2816  if( GetOffset() && !IsFollow() )
2818  }
2819  break;
2820  case PrepareHint::MustFit :
2821  pPara->SetPrepMustFit(true);
2822  [[fallthrough]];
2824  pPara->SetPrepAdjust();
2825  break;
2826  case PrepareHint::Widows :
2827  // MustFit is stronger than anything else
2828  if( pPara->IsPrepMustFit() )
2829  return bParaPossiblyInvalid;
2830  // see comment in WidowsAndOrphans::FindOrphans and CalcPreps()
2831  PrepWidows( *static_cast<const sal_uInt16 *>(pVoid), bNotify );
2832  break;
2833 
2835  {
2836  SwTextFootnote const *pFootnote = static_cast<SwTextFootnote const *>(pVoid);
2837  if( IsInFootnote() )
2838  {
2839  // Am I the first TextFrame of a footnote?
2840  if( !GetPrev() )
2841  // So we're a TextFrame of the footnote, which has
2842  // to display the footnote number or the ErgoSum text
2844 
2845  if( !GetNext() )
2846  {
2847  // We're the last Footnote; we need to update the
2848  // QuoVadis texts now
2849  const SwFootnoteInfo &rFootnoteInfo = GetDoc().GetFootnoteInfo();
2850  if( !pPara->UpdateQuoVadis( rFootnoteInfo.m_aQuoVadis ) )
2851  {
2852  TextFrameIndex nPos = pPara->GetParLen();
2853  if( nPos )
2854  --nPos;
2856  }
2857  }
2858  }
2859  else
2860  {
2861  // We are the TextFrame _with_ the footnote
2862  TextFrameIndex const nPos = MapModelToView(
2863  &pFootnote->GetTextNode(), pFootnote->GetStart());
2865  }
2866  break;
2867  }
2869  {
2870  // Test
2871  {
2872  SetInvalidVert( false );
2873  bool bOld = IsVertical();
2874  SetInvalidVert( true );
2875  if( bOld != IsVertical() )
2877  }
2878 
2879  if( HasFollow() )
2880  {
2881  TextFrameIndex nNxtOfst = GetFollow()->GetOffset();
2882  if( nNxtOfst )
2883  --nNxtOfst;
2884  InvalidateRange(SwCharRange( nNxtOfst, TextFrameIndex(1)), 1);
2885  }
2886  if( IsInFootnote() )
2887  {
2888  TextFrameIndex nPos;
2889  if( lcl_ErgoVadis( this, nPos, PrepareHint::QuoVadis ) )
2891  if( lcl_ErgoVadis( this, nPos, PrepareHint::ErgoSum ) )
2893  }
2894  // If we have a page number field, we must invalidate those spots
2895  SwTextNode const* pNode(nullptr);
2896  sw::MergedAttrIter iter(*this);
2897  TextFrameIndex const nEnd = GetFollow()
2899  for (SwTextAttr const* pHt = iter.NextAttr(&pNode); pHt; pHt = iter.NextAttr(&pNode))
2900  {
2901  TextFrameIndex const nStart(MapModelToView(pNode, pHt->GetStart()));
2902  if (nStart >= GetOffset())
2903  {
2904  if (nStart >= nEnd)
2905  break;
2906 
2907  // If we're flowing back and own a Footnote, the Footnote also flows
2908  // with us. So that it doesn't obstruct us, we send ourselves
2909  // an ADJUST_FRM.
2910  // pVoid != 0 means MoveBwd()
2911  const sal_uInt16 nWhich = pHt->Which();
2912  if (RES_TXTATR_FIELD == nWhich ||
2913  (HasFootnote() && pVoid && RES_TXTATR_FTN == nWhich))
2914  InvalidateRange(SwCharRange(nStart, TextFrameIndex(1)), 1);
2915  }
2916  }
2917  // A new boss, a new chance for growing
2918  if( IsUndersized() )
2919  {
2920  InvalidateSize_();
2922  }
2923  break;
2924  }
2925 
2927  {
2928  if ( isFramePrintAreaValid() )
2929  {
2930  SwTextGridItem const*const pGrid(GetGridItem(FindPageFrame()));
2931  if (pGrid && GetTextNodeForParaProps()->GetSwAttrSet().GetParaGrid().GetValue())
2932  InvalidatePrt();
2933  }
2934 
2935  // If we don't overlap with anybody:
2936  // did any free-flying frame overlapped _before_ the position change?
2937  bool bFormat = pPara->HasFly();
2938  if( !bFormat )
2939  {
2940  if( IsInFly() )
2941  {
2942  SwTwips nTmpBottom = GetUpper()->getFrameArea().Top() +
2944  if( nTmpBottom < getFrameArea().Bottom() )
2945  bFormat = true;
2946  }
2947  if( !bFormat )
2948  {
2949  if ( GetDrawObjs() )
2950  {
2951  const size_t nCnt = GetDrawObjs()->size();
2952  for ( size_t i = 0; i < nCnt; ++i )
2953  {
2954  SwAnchoredObject* pAnchoredObj = (*GetDrawObjs())[i];
2955  // i#28701 - consider all
2956  // to-character anchored objects
2957  if ( pAnchoredObj->GetFrameFormat().GetAnchor().GetAnchorId()
2958  == RndStdIds::FLY_AT_CHAR )
2959  {
2960  bFormat = true;
2961  break;
2962  }
2963  }
2964  }
2965  if( !bFormat )
2966  {
2967  // Are there any free-flying frames on this page?
2968  SwTextFly aTextFly( this );
2969  if( aTextFly.IsOn() )
2970  {
2971  // Does any free-flying frame overlap?
2972  bFormat = aTextFly.Relax() || IsUndersized();
2973  }
2974  }
2975  }
2976  }
2977 
2978  if( bFormat )
2979  {
2980  if( !IsLocked() )
2981  {
2982  if( pPara->GetRepaint().HasArea() )
2983  SetCompletePaint();
2984  Init();
2985  pPara = nullptr;
2986  InvalidateSize_();
2987  }
2988  }
2989  else
2990  {
2991  if (GetTextNodeForParaProps()->GetSwAttrSet().GetRegister().GetValue())
2992  bParaPossiblyInvalid = Prepare( PrepareHint::Register, nullptr, bNotify );
2993  // The Frames need to be readjusted, which caused by changes
2994  // in position
2995  else if( HasFootnote() )
2996  {
2997  bParaPossiblyInvalid = Prepare( PrepareHint::AdjustSizeWithoutFormatting, nullptr, bNotify );
2998  InvalidateSize_();
2999  }
3000  else
3001  return bParaPossiblyInvalid; // So that there's no SetPrep()
3002 
3003  if (bParaPossiblyInvalid)
3004  {
3005  // It's possible that pPara was deleted above; retrieve it again
3006  pPara = aAccess.GetPara();
3007  }
3008 
3009  }
3010  break;
3011  }
3012  case PrepareHint::Register:
3013  if (GetTextNodeForParaProps()->GetSwAttrSet().GetRegister().GetValue())
3014  {
3015  pPara->SetPrepAdjust();
3016  CalcLineSpace();
3017 
3018  // It's possible that pPara was deleted above; retrieve it again
3019  bParaPossiblyInvalid = true;
3020  pPara = aAccess.GetPara();
3021 
3022  InvalidateSize();
3023  InvalidatePrt_();
3024  SwFrame* pNxt = GetIndNext();
3025  if ( nullptr != pNxt )
3026  {
3027  pNxt->InvalidatePrt_();
3028  if ( pNxt->IsLayoutFrame() )
3029  pNxt->InvalidatePage();
3030  }
3031  SetCompletePaint();
3032  }
3033  break;
3035  {
3036  // If a Follow is calling us, because a footnote is being deleted, our last
3037  // line has to be formatted, so that the first line of the Follow can flow up.
3038  // Which had flowed to the next page to be together with the footnote (this is
3039  // especially true for areas with columns)
3040  OSL_ENSURE( GetFollow(), "PrepareHint::FootnoteInvalidationGone may only be called by Follow" );
3041  TextFrameIndex nPos = GetFollow()->GetOffset();
3042  if( IsFollow() && GetOffset() == nPos ) // If we don't have a mass of text, we call our
3043  FindMaster()->Prepare( PrepareHint::FootnoteInvalidationGone ); // Master's Prepare
3044  if( nPos )
3045  --nPos; // The char preceding our Follow
3047  return bParaPossiblyInvalid;
3048  }
3049  case PrepareHint::ErgoSum:
3050  case PrepareHint::QuoVadis:
3051  {
3052  TextFrameIndex nPos;
3053  if( lcl_ErgoVadis( this, nPos, ePrep ) )
3055  }
3056  break;
3058  {
3059  if( pVoid )
3060  {
3061  TextFrameIndex const nWhere = CalcFlyPos( static_cast<SwFrameFormat const *>(pVoid) );
3062  OSL_ENSURE( TextFrameIndex(COMPLETE_STRING) != nWhere, "Prepare: Why me?" );
3064  return bParaPossiblyInvalid;
3065  }
3066  [[fallthrough]]; // else: continue with default case block
3067  }
3068  case PrepareHint::Clear:
3069  default:
3070  {
3071  if( IsLocked() )
3072  {
3073  if( PrepareHint::FlyFrameArrive == ePrep || PrepareHint::FlyFrameLeave == ePrep )
3074  {
3075  TextFrameIndex const nLen = (GetFollow()
3076  ? GetFollow()->GetOffset()
3078  - GetOffset();
3079  InvalidateRange( SwCharRange( GetOffset(), nLen ) );
3080  }
3081  }
3082  else
3083  {
3084  if( pPara->GetRepaint().HasArea() )
3085  SetCompletePaint();
3086  Init();
3087  pPara = nullptr;
3088  if( GetOffset() && !IsFollow() )
3089  SetOffset_( TextFrameIndex(0) );
3090  if ( bNotify )
3091  InvalidateSize();
3092  else
3093  InvalidateSize_();
3094  }
3095  return bParaPossiblyInvalid; // no SetPrep() happened
3096  }
3097  }
3098  if( pPara )
3099  {
3100  pPara->SetPrep();
3101  }
3102 
3103  return bParaPossiblyInvalid;
3104 }
3105 #if defined __GNUC__ && !defined __clang__
3106 # pragma GCC diagnostic pop
3107 #endif
3108 
3118 {
3122 public:
3123  SwTestFormat( SwTextFrame* pTextFrame, const SwFrame* pPrv, SwTwips nMaxHeight );
3124  ~SwTestFormat();
3125 };
3126 
3127 SwTestFormat::SwTestFormat( SwTextFrame* pTextFrame, const SwFrame* pPre, SwTwips nMaxHeight )
3128  : pFrame( pTextFrame )
3129 {
3132 
3133  SwRectFnSet aRectFnSet(pFrame);
3134  SwTwips nLower = aRectFnSet.GetBottomMargin(*pFrame);
3135 
3136  {
3137  // indeed, here the GetUpper()->getFramePrintArea() gets copied and manipulated
3140  aFrm += pFrame->GetUpper()->getFrameArea().Pos();
3141  aRectFnSet.SetHeight( aFrm, nMaxHeight );
3142 
3143  if( pFrame->GetPrev() )
3144  {
3145  aRectFnSet.SetPosY(
3146  aFrm,
3147  aRectFnSet.GetBottom(pFrame->GetPrev()->getFrameArea()) - ( aRectFnSet.IsVert() ? nMaxHeight + 1 : 0 ) );
3148  }
3149  }
3150 
3152  const SwBorderAttrs &rAttrs = *aAccess.Get();
3153 
3154  {
3156  aRectFnSet.SetPosX(aPrt, rAttrs.CalcLeft( pFrame ) );
3157  }
3158 
3159  if( pPre )
3160  {
3161  SwTwips nUpper = pFrame->CalcUpperSpace( &rAttrs, pPre );
3163  aRectFnSet.SetPosY(aPrt, nUpper );
3164  }
3165 
3166  {
3168  aRectFnSet.SetHeight( aPrt, std::max( tools::Long(0) , aRectFnSet.GetHeight(pFrame->getFrameArea()) - aRectFnSet.GetTop(aPrt) - nLower ) );
3169  aRectFnSet.SetWidth( aPrt, aRectFnSet.GetWidth(pFrame->getFrameArea()) - ( rAttrs.CalcLeft( pFrame ) + rAttrs.CalcRight( pFrame ) ) );
3170  }
3171 
3172  pOldPara = pFrame->HasPara() ? pFrame->GetPara() : nullptr;
3173  pFrame->SetPara( new SwParaPortion(), false );
3174  OSL_ENSURE( ! pFrame->IsSwapped(), "A frame is swapped before Format_" );
3175 
3176  if ( pFrame->IsVertical() )
3178 
3179  SwTextFormatInfo aInf( pFrame->getRootFrame()->GetCurrShell()->GetOut(), pFrame, false, true, true );
3180  SwTextFormatter aLine( pFrame, &aInf );
3181 
3182  pFrame->Format_( aLine, aInf );
3183 
3184  if ( pFrame->IsVertical() )
3186 
3187  OSL_ENSURE( ! pFrame->IsSwapped(), "A frame is swapped after Format_" );
3188 }
3189 
3191 {
3192  {
3194  aFrm.setSwRect(aOldFrame);
3195  }
3196 
3197  {
3199  aPrt.setSwRect(aOldPrt);
3200  }
3201 
3202  pFrame->SetPara( pOldPara );
3203 }
3204 
3205 bool SwTextFrame::TestFormat( const SwFrame* pPrv, SwTwips &rMaxHeight, bool &bSplit )
3206 {
3208 
3209  if( IsLocked() && GetUpper()->getFramePrintArea().Width() <= 0 )
3210  return false;
3211 
3212  SwTestFormat aSave( this, pPrv, rMaxHeight );
3213 
3214  return SwTextFrame::WouldFit( rMaxHeight, bSplit, true );
3215 }
3216 
3229 bool SwTextFrame::WouldFit( SwTwips &rMaxHeight, bool &bSplit, bool bTst )
3230 {
3231  OSL_ENSURE( ! IsVertical() || ! IsSwapped(),
3232  "SwTextFrame::WouldFit with swapped frame" );
3233  SwRectFnSet aRectFnSet(this);
3234 
3235  if( IsLocked() )
3236  return false;
3237 
3238  // it can happen that the IdleCollector removed the cached information
3239  if( !IsEmpty() )
3240  GetFormatted();
3241 
3242  // i#27801 - correction: 'short cut' for empty paragraph
3243  // can *not* be applied, if test format is in progress. The test format doesn't
3244  // adjust the frame and the printing area - see method <SwTextFrame::Format_(..)>,
3245  // which is called in <SwTextFrame::TestFormat(..)>
3246  if ( IsEmpty() && !bTst )
3247  {
3248  bSplit = false;
3249  SwTwips nHeight = aRectFnSet.IsVert() ? getFramePrintArea().SSize().Width() : getFramePrintArea().SSize().Height();
3250  if( rMaxHeight < nHeight )
3251  return false;
3252  else
3253  {
3254  rMaxHeight -= nHeight;
3255  return true;
3256  }
3257  }
3258 
3259  // GetPara can still be 0 in edge cases
3260  // We return true in order to be reformatted on the new Page
3261  OSL_ENSURE( HasPara() || IsHiddenNow(), "WouldFit: GetFormatted() and then !HasPara()" );
3262  if( !HasPara() || ( !aRectFnSet.GetHeight(getFrameArea()) && IsHiddenNow() ) )
3263  return true;
3264 
3265  // Because the Orphan flag only exists for a short moment, we also check
3266  // whether the Framesize is set to very huge by CalcPreps, in order to
3267  // force a MoveFwd
3268  if (IsWidow() || (aRectFnSet.IsVert()
3269  ? (0 == getFrameArea().Left())
3270  : (sw::WIDOW_MAGIC - 20000 < getFrameArea().Bottom())))
3271  {
3272  SetWidow(false);
3273  if ( GetFollow() )
3274  {
3275  // If we've ended up here due to a Widow request by our Follow, we check
3276  // whether there's a Follow with a real height at all.
3277  // Else (e.g. for newly created SctFrames) we ignore the IsWidow() and
3278  // still check if we can find enough room
3279  if (((!aRectFnSet.IsVert() && getFrameArea().Bottom() <= sw::WIDOW_MAGIC - 20000) ||
3280  ( aRectFnSet.IsVert() && 0 < getFrameArea().Left() ) ) &&
3281  ( GetFollow()->IsVertical() ?
3282  !GetFollow()->getFrameArea().Width() :
3283  !GetFollow()->getFrameArea().Height() ) )
3284  {
3285  SwTextFrame* pFoll = GetFollow()->GetFollow();
3286  while( pFoll &&
3287  ( pFoll->IsVertical() ?
3288  !pFoll->getFrameArea().Width() :
3289  !pFoll->getFrameArea().Height() ) )
3290  pFoll = pFoll->GetFollow();
3291  if( pFoll )
3292  return false;
3293  }
3294  else
3295  return false;
3296  }
3297  }
3298 
3299  SwSwapIfNotSwapped swap( this );
3300 
3301  SwTextSizeInfo aInf( this );
3302  SwTextMargin aLine( this, &aInf );
3303 
3304  WidowsAndOrphans aFrameBreak( this, rMaxHeight, bSplit );
3305 
3306  bool bRet = true;
3307 
3308  aLine.Bottom();
3309  // is breaking necessary?
3310  bSplit = !aFrameBreak.IsInside( aLine );
3311  if ( bSplit )
3312  bRet = !aFrameBreak.IsKeepAlways() && aFrameBreak.WouldFit( aLine, rMaxHeight, bTst );
3313  else
3314  {
3315  // we need the total height including the current line
3316  aLine.Top();
3317  do
3318  {
3319  rMaxHeight -= aLine.GetLineHeight();
3320  } while ( aLine.Next() );
3321  }
3322 
3323  return bRet;
3324 }
3325 
3326 sal_uInt32 SwTextFrame::GetParHeight() const
3327 {
3328  OSL_ENSURE( ! IsVertical() || ! IsSwapped(),
3329  "SwTextFrame::GetParHeight with swapped frame" );
3330 
3331  if( !HasPara() )
3332  { // For non-empty paragraphs this is a special case
3333  // For UnderSized we can simply just ask 1 Twip more
3334  sal_uInt16 nRet = o3tl::narrowing<sal_uInt16>(getFramePrintArea().SSize().Height());
3335  if( IsUndersized() )
3336  {
3337  if( IsEmpty() || GetText().isEmpty() )
3338  nRet = o3tl::narrowing<sal_uInt16>(EmptyHeight());
3339  else
3340  ++nRet;
3341  }
3342  return nRet;
3343  }
3344 
3345  // TODO: Refactor and improve code
3346  const SwLineLayout* pLineLayout = GetPara();
3347  sal_uInt32 nHeight = pLineLayout ? pLineLayout->GetRealHeight() : 0;
3348 
3349  // Is this paragraph scrolled? Our height until now is at least
3350  // one line height too low then
3351  if( GetOffset() && !IsFollow() )
3352  nHeight *= 2;
3353 
3354  while ( pLineLayout && pLineLayout->GetNext() )
3355  {
3356  pLineLayout = pLineLayout->GetNext();
3357  nHeight = nHeight + pLineLayout->GetRealHeight();
3358  }
3359 
3360  return nHeight;
3361 }
3362 
3366 SwTextFrame* SwTextFrame::GetFormatted( bool bForceQuickFormat )
3367 {
3368  vcl::RenderContext* pRenderContext = getRootFrame()->GetCurrShell()->GetOut();
3369  SwSwapIfSwapped swap( this );
3370 
3371  // In case the SwLineLayout was cleared out of the s_pTextCache, recreate it
3372  // Not for empty paragraphs
3373  if( !HasPara() && !(isFrameAreaDefinitionValid() && IsEmpty()) )
3374  {
3375  // Calc() must be called, because frame position can be wrong
3376  const bool bFormat = isFrameAreaSizeValid();
3377  Calc(pRenderContext); // calls Format() if invalid
3378 
3379  // If the flags were valid (hence bFormat=true), Calc did nothing,
3380  // so Format() must be called manually in order to recreate
3381  // the SwLineLayout that has been deleted from the
3382  // SwTextFrame::s_pTextCache (hence !HasPara() above).
3383  // Optimization with FormatQuick()
3384  if( bFormat && !FormatQuick( bForceQuickFormat ) )
3385  Format(getRootFrame()->GetCurrShell()->GetOut());
3386  }
3387 
3388  return this;
3389 }
3390 
3392 {
3393  // i#31490
3394  // If we are currently locked, we better return with a
3395  // fairly reasonable value:
3396  if ( IsLocked() )
3397  return getFramePrintArea().Width();
3398 
3399  SwParaPortion* pOldPara = GetPara();
3400  SwParaPortion *pDummy = new SwParaPortion();
3401  SetPara( pDummy, false );
3402  const SwPageFrame* pPage = FindPageFrame();
3403 
3404  const Point aOldFramePos = getFrameArea().Pos();
3405  const SwTwips nOldFrameWidth = getFrameArea().Width();
3406  const SwTwips nOldPrtWidth = getFramePrintArea().Width();
3407  const SwTwips nPageWidth = GetUpper()->IsVertical() ?
3408  pPage->getFramePrintArea().Height() :
3409  pPage->getFramePrintArea().Width();
3410 
3411  {
3413  aFrm.Width( nPageWidth );
3414  }
3415 
3416  {
3418  aPrt.Width( nPageWidth );
3419  }
3420 
3421  // i#25422 objects anchored as character in RTL
3422  if ( IsRightToLeft() )
3423  {
3425  aFrm.Pos().AdjustX(nOldFrameWidth - nPageWidth );
3426  }
3427 
3428  TextFrameLockGuard aLock( this );
3429 
3430  SwTextFormatInfo aInf( getRootFrame()->GetCurrShell()->GetOut(), this, false, true, true );
3431  aInf.SetIgnoreFly( true );
3432  SwTextFormatter aLine( this, &aInf );
3433  SwHookOut aHook( aInf );
3434 
3435  // i#54031 - assure minimum of MINLAY twips.
3436  const SwTwips nMax = std::max( SwTwips(MINLAY), aLine.CalcFitToContent_() + 1 );
3437 
3438  {
3440  aFrm.Width( nOldFrameWidth );
3441 
3442  // i#25422 objects anchored as character in RTL
3443  if ( IsRightToLeft() )
3444  {
3445  aFrm.Pos() = aOldFramePos;
3446  }
3447  }
3448 
3449  {
3451  aPrt.Width( nOldPrtWidth );
3452  }
3453 
3454  SetPara( pOldPara );
3455 
3456  return nMax;
3457 }
3458 
3466 {
3467  if ( IsLocked() )
3468  return;
3469 
3470  // reset additional first line offset
3472 
3473  const SwTextNode* pTextNode( GetTextNodeForParaProps() );
3474  // sw_redlinehide: check that pParaPropsNode is the correct one
3475  assert(pTextNode->IsNumbered(getRootFrame()) == pTextNode->IsNumbered(nullptr));
3476  if (!(pTextNode->IsNumbered(getRootFrame()) &&
3477  pTextNode->IsCountedInList() && pTextNode->GetNumRule()))
3478  return;
3479 
3480  int nListLevel = pTextNode->GetActualListLevel();
3481 
3482  if (nListLevel < 0)
3483  nListLevel = 0;
3484 
3485  if (nListLevel >= MAXLEVEL)
3486  nListLevel = MAXLEVEL - 1;
3487 
3488  const SwNumFormat& rNumFormat =
3489  pTextNode->GetNumRule()->Get( o3tl::narrowing<sal_uInt16>(nListLevel) );
3491  return;
3492 
3493  // keep current paragraph portion and apply dummy paragraph portion
3494  SwParaPortion* pOldPara = GetPara();
3495  SwParaPortion *pDummy = new SwParaPortion();
3496  SetPara( pDummy, false );
3497 
3498  // lock paragraph
3499  TextFrameLockGuard aLock( this );
3500 
3501  // simulate text formatting
3502  SwTextFormatInfo aInf( getRootFrame()->GetCurrShell()->GetOut(), this, false, true, true );
3503  aInf.SetIgnoreFly( true );
3504  SwTextFormatter aLine( this, &aInf );
3505  SwHookOut aHook( aInf );
3506  aLine.CalcFitToContent_();
3507 
3508  // determine additional first line offset
3509  const SwLinePortion* pFirstPortion = aLine.GetCurr()->GetFirstPortion();
3510  if ( pFirstPortion->InNumberGrp() && !pFirstPortion->IsFootnoteNumPortion() )
3511  {
3512  SwTwips nNumberPortionWidth( pFirstPortion->Width() );
3513 
3514  const SwLinePortion* pPortion = pFirstPortion->GetNextPortion();
3515  while ( pPortion &&
3516  pPortion->InNumberGrp() && !pPortion->IsFootnoteNumPortion())
3517  {
3518  nNumberPortionWidth += pPortion->Width();
3519  pPortion = pPortion->GetNextPortion();
3520  }
3521 
3522  if ( ( IsRightToLeft() &&
3523  rNumFormat.GetNumAdjust() == SvxAdjust::Left ) ||
3524  ( !IsRightToLeft() &&
3525  rNumFormat.GetNumAdjust() == SvxAdjust::Right ) )
3526  {
3527  mnAdditionalFirstLineOffset = -nNumberPortionWidth;
3528  }
3529  else if ( rNumFormat.GetNumAdjust() == SvxAdjust::Center )
3530  {
3531  mnAdditionalFirstLineOffset = -(nNumberPortionWidth/2);
3532  }
3533  }
3534 
3535  // restore paragraph portion
3536  SetPara( pOldPara );
3537 }
3538 
3551 void SwTextFrame::CalcHeightOfLastLine( const bool _bUseFont )
3552 {
3553  // i#71281
3554  // Invalidate printing area, if height of last line changes
3555  const SwTwips nOldHeightOfLastLine( mnHeightOfLastLine );
3556 
3557  // determine output device
3558  SwViewShell* pVsh = getRootFrame()->GetCurrShell();
3559  OSL_ENSURE( pVsh, "<SwTextFrame::_GetHeightOfLastLineForPropLineSpacing()> - no SwViewShell" );
3560 
3561  // i#78921
3562  // There could be no <SwViewShell> instance in the case of loading a binary
3563  // StarOffice file format containing an embedded Writer document.
3564  if ( !pVsh )
3565  {
3566  return;
3567  }
3568  OutputDevice* pOut = pVsh->GetOut();
3569  const IDocumentSettingAccess *const pIDSA = &GetDoc().getIDocumentSettingAccess();
3570  if ( !pVsh->GetViewOptions()->getBrowseMode() ||
3571  pVsh->GetViewOptions()->IsPrtFormat() )
3572  {
3574  }
3575  OSL_ENSURE( pOut, "<SwTextFrame::_GetHeightOfLastLineForPropLineSpacing()> - no OutputDevice" );
3576 
3577  if ( !pOut )
3578  {
3579  return;
3580  }
3581 
3582  // determine height of last line
3583  if ( _bUseFont || pIDSA->get(DocumentSettingId::OLD_LINE_SPACING ) )
3584  {
3585  // former determination of last line height for proportional line
3586  // spacing - take height of font set at the paragraph
3587  // FIXME actually... must the font match across all nodes?
3588  SwFont aFont( &GetTextNodeForParaProps()->GetSwAttrSet(), pIDSA );
3589 
3590  // we must ensure that the font is restored correctly on the OutputDevice
3591  // otherwise Last!=Owner could occur
3592  if ( pLastFont )
3593  {
3594  SwFntObj *pOldFont = pLastFont;
3595  pLastFont = nullptr;
3596  aFont.SetFntChg( true );
3597  aFont.ChgPhysFnt( pVsh, *pOut );
3598  mnHeightOfLastLine = aFont.GetHeight( pVsh, *pOut );
3599  assert(pLastFont && "coverity[var_deref_model] - pLastFont should be set in SwSubFont::ChgFnt");
3600  pLastFont->Unlock();
3601  pLastFont = pOldFont;
3602  pLastFont->SetDevFont( pVsh, *pOut );
3603  }
3604  else
3605  {
3606  vcl::Font aOldFont = pOut->GetFont();
3607  aFont.SetFntChg( true );
3608  aFont.ChgPhysFnt( pVsh, *pOut );
3609  mnHeightOfLastLine = aFont.GetHeight( pVsh, *pOut );
3610  assert(pLastFont && "coverity[var_deref_model] - pLastFont should be set in SwSubFont::ChgFnt");
3611  pLastFont->Unlock();
3612  pLastFont = nullptr;
3613  pOut->SetFont( aOldFont );
3614  }
3615  }
3616  else
3617  {
3618  // new determination of last line height - take actually height of last line
3619  // i#89000
3620  // assure same results, if paragraph is undersized
3621  if ( IsUndersized() )
3622  {
3623  mnHeightOfLastLine = 0;
3624  }
3625  else
3626  {
3627  bool bCalcHeightOfLastLine = true;
3628  if ( ( !HasPara() && IsEmpty( ) ) || GetText().isEmpty() )
3629  {
3631  bCalcHeightOfLastLine = false;
3632  }
3633 
3634  if ( bCalcHeightOfLastLine )
3635  {
3636  OSL_ENSURE( HasPara(),
3637  "<SwTextFrame::CalcHeightOfLastLine()> - missing paragraph portions." );
3638  const SwLineLayout* pLineLayout = GetPara();
3639  while ( pLineLayout && pLineLayout->GetNext() )
3640  {
3641  // iteration to last line
3642  pLineLayout = pLineLayout->GetNext();
3643  }
3644  if ( pLineLayout )
3645  {
3646  SwTwips nAscent, nDescent, nDummy1, nDummy2;
3647  // i#47162 - suppress consideration of
3648  // fly content portions and the line portion.
3649  pLineLayout->MaxAscentDescent( nAscent, nDescent,
3650  nDummy1, nDummy2,
3651  nullptr, true );
3652  // i#71281
3653  // Suppress wrong invalidation of printing area, if method is
3654  // called recursive.
3655  // Thus, member <mnHeightOfLastLine> is only set directly, if
3656  // no recursive call is needed.
3657  const SwTwips nNewHeightOfLastLine = nAscent + nDescent;
3658  // i#47162 - if last line only contains
3659  // fly content portions, <mnHeightOfLastLine> is zero.
3660  // In this case determine height of last line by the font
3661  if ( nNewHeightOfLastLine == 0 )
3662  {
3663  CalcHeightOfLastLine( true );
3664  }
3665  else
3666  {
3667  mnHeightOfLastLine = nNewHeightOfLastLine;
3668  }
3669  }
3670  }
3671  }
3672  }
3673  // i#71281
3674  // invalidate printing area, if height of last line changes
3675  if ( mnHeightOfLastLine != nOldHeightOfLastLine )
3676  {
3677  InvalidatePrt();
3678  }
3679 }
3680 
3690 tools::Long SwTextFrame::GetLineSpace( const bool _bNoPropLineSpace ) const
3691 {
3692  tools::Long nRet = 0;
3693 
3695 
3696  switch( rSpace.GetInterLineSpaceRule() )
3697  {
3698  case SvxInterLineSpaceRule::Prop:
3699  {
3700  if ( _bNoPropLineSpace )
3701  {
3702  break;
3703  }
3704 
3705  // i#11860 - adjust spacing implementation for object positioning
3706  // - compatibility to MS Word
3707  nRet = GetHeightOfLastLine();
3708 
3709  tools::Long nTmp = nRet;
3710  nTmp *= rSpace.GetPropLineSpace();
3711  nTmp /= 100;
3712  nTmp -= nRet;
3713  if ( nTmp > 0 )
3714  nRet = nTmp;
3715  else
3716  nRet = 0;
3717  }
3718  break;
3719  case SvxInterLineSpaceRule::Fix:
3720  {
3721  if ( rSpace.GetInterLineSpace() > 0 )
3722  nRet = rSpace.GetInterLineSpace();
3723  }
3724  break;
3725  default:
3726  break;
3727  }
3728  return nRet;
3729 }
3730 
3732 {
3733  if ( !HasPara() )
3734  {
3735  if( IsEmpty() && isFrameAreaDefinitionValid() )
3736  return IsVertical() ? o3tl::narrowing<sal_uInt16>(getFramePrintArea().Width()) : o3tl::narrowing<sal_uInt16>(getFramePrintArea().Height());
3737  return USHRT_MAX;
3738  }
3739  const SwParaPortion *pPara = GetPara();
3740  if ( !pPara )
3741  return USHRT_MAX;
3742 
3743  return pPara->Height();
3744 }
3745 
3747 {
3748  sal_uInt16 nRet = 0;
3749  SwTextFrame *pFrame = this;
3750  do
3751  {
3752  pFrame->GetFormatted();
3753  if( !pFrame->HasPara() )
3754  break;
3755  SwTextSizeInfo aInf( pFrame );
3756  SwTextMargin aLine( pFrame, &aInf );
3757  if (TextFrameIndex(COMPLETE_STRING) == nPos)
3758  aLine.Bottom();
3759  else
3760  aLine.CharToLine( nPos );
3761  nRet = nRet + aLine.GetLineNr();
3762  pFrame = pFrame->GetFollow();
3763  } while ( pFrame && pFrame->GetOffset() <= nPos );
3764  return nRet;
3765 }
3766 
3768 {
3769  // not necessary to format here (GetFormatted etc.), because we have to come from there!
3770  sal_uInt32 nNew = 0;
3771  const SwLineNumberInfo &rInf = GetDoc().GetLineNumberInfo();
3772  if ( !GetText().isEmpty() && HasPara() )
3773  {
3774  SwTextSizeInfo aInf( this );
3775  SwTextMargin aLine( this, &aInf );
3776  if ( rInf.IsCountBlankLines() )
3777  {
3778  aLine.Bottom();
3779  nNew = aLine.GetLineNr();
3780  }
3781  else
3782  {
3783  do
3784  {
3785  if( aLine.GetCurr()->HasContent() )
3786  ++nNew;
3787  } while ( aLine.NextLine() );
3788  }
3789  }
3790  else if ( rInf.IsCountBlankLines() )
3791  nNew = 1;
3792 
3793  if ( nNew == mnThisLines )
3794  return;
3795 
3797  {
3799  mnThisLines = nNew;
3801  SwFrame *pNxt = GetNextContentFrame();
3802  while( pNxt && pNxt->IsInTab() )
3803  {
3804  pNxt = pNxt->FindTabFrame();
3805  if( nullptr != pNxt )
3806  pNxt = pNxt->FindNextCnt();
3807  }
3808  if( pNxt )
3809  pNxt->InvalidateLineNum();
3810 
3811  // Extend repaint to the bottom.
3812  if ( HasPara() )
3813  {
3814  SwRepaint& rRepaint = GetPara()->GetRepaint();
3815  rRepaint.Bottom( std::max( rRepaint.Bottom(),
3817  }
3818  }
3819  else // Paragraphs which are not counted should not manipulate the AllLines.
3820  mnThisLines = nNew;
3821 }
3822 
3824 {
3825  ValidateLineNum();
3826 
3827  if ( IsInTab() )
3828  return;
3829 
3830  const sal_uLong nOld = GetAllLines();
3832  sal_uLong nNewNum;
3833  const bool bRestart = GetDoc().GetLineNumberInfo().IsRestartEachPage();
3834 
3835  if ( !IsFollow() && rLineNum.GetStartValue() && rLineNum.IsCount() )
3836  nNewNum = rLineNum.GetStartValue() - 1;
3837  // If it is a follow or not has not be considered if it is a restart at each page; the
3838  // restart should also take effect at follows.
3839  else if ( bRestart && FindPageFrame()->FindFirstBodyContent() == this )
3840  {
3841  nNewNum = 0;
3842  }
3843  else
3844  {
3846  while ( pPrv &&
3847  (pPrv->IsInTab() || pPrv->IsInDocBody() != IsInDocBody()) )
3848  pPrv = pPrv->GetPrevContentFrame();
3849 
3850  // i#78254 Restart line numbering at page change
3851  // First body content may be in table!
3852  if ( bRestart && pPrv && pPrv->FindPageFrame() != FindPageFrame() )
3853  pPrv = nullptr;
3854 
3855  nNewNum = pPrv ? static_cast<SwTextFrame*>(pPrv)->GetAllLines() : 0;
3856  }
3857  if ( rLineNum.IsCount() )
3858  nNewNum += GetThisLines();
3859 
3860  if ( nOld == nNewNum )
3861  return;
3862 
3863  mnAllLines = nNewNum;
3865  while ( pNxt &&
3866  (pNxt->IsInTab() || pNxt->IsInDocBody() != IsInDocBody()) )
3867  pNxt = pNxt->GetNextContentFrame();
3868  if ( pNxt )
3869  {
3870  if ( pNxt->GetUpper() != GetUpper() )
3871  pNxt->InvalidateLineNum();
3872  else
3873  pNxt->InvalidateLineNum_();
3874  }
3875 }
3876 
3878 {
3879  const SwParaPortion* pPara = isFrameAreaDefinitionValid() ? GetPara() : nullptr;
3880 
3881  if (pPara)
3882  {
3883  if ( IsFollow() )
3884  rPH.Skip( GetOffset() );
3885 
3886  const SwLineLayout* pLine = pPara;
3887  while ( pLine )
3888  {
3889  const SwLinePortion* pPor = pLine->GetFirstPortion();
3890  while ( pPor )
3891  {
3892  pPor->HandlePortion( rPH );
3893  pPor = pPor->GetNextPortion();
3894  }
3895 
3896  rPH.LineBreak(pLine->Width());
3897  pLine = pLine->GetNext();
3898  }
3899  }
3900 
3901  rPH.Finish();
3902 }
3903 
3905 {
3906  const SwParaPortion* pPara = GetPara();
3907  return pPara ? &pPara->GetScriptInfo() : nullptr;
3908 }
3909 
3913 static SwTwips lcl_CalcFlyBasePos( const SwTextFrame& rFrame, SwRect aFlyRect,
3914  SwTextFly const & rTextFly )
3915 {
3916  SwRectFnSet aRectFnSet(&rFrame);
3917  SwTwips nRet = rFrame.IsRightToLeft() ?
3918  aRectFnSet.GetRight(rFrame.getFrameArea()) :
3919  aRectFnSet.GetLeft(rFrame.getFrameArea());
3920 
3921  do
3922  {
3923  SwRect aRect = rTextFly.GetFrame( aFlyRect );
3924  if ( 0 != aRectFnSet.GetWidth(aRect) )
3925  {
3926  if ( rFrame.IsRightToLeft() )
3927  {
3928  if ( aRectFnSet.GetRight(aRect) -
3929  aRectFnSet.GetRight(aFlyRect) >= 0 )
3930  {
3931  aRectFnSet.SetRight(
3932 aFlyRect, aRectFnSet.GetLeft(aRect) );
3933  nRet = aRectFnSet.GetLeft(aRect);
3934  }
3935  else
3936  break;
3937  }
3938  else
3939  {
3940  if ( aRectFnSet.GetLeft(aFlyRect) -
3941  aRectFnSet.GetLeft(aRect) >= 0 )
3942  {
3943  aRectFnSet.SetLeft(
3944 aFlyRect, aRectFnSet.GetRight(aRect) + 1 );
3945  nRet = aRectFnSet.GetRight(aRect);
3946  }
3947  else
3948  break;
3949  }
3950  }
3951  else
3952  break;
3953  }
3954  while ( aRectFnSet.GetWidth(aFlyRect) > 0 );
3955 
3956  return nRet;
3957 }
3958 
3960 {
3961  OSL_ENSURE( !IsVertical() || !IsSwapped(),
3962  "SwTextFrame::CalcBasePosForFly with swapped frame!" );
3963 
3964  if (!GetDoc().getIDocumentSettingAccess().get(DocumentSettingId::ADD_FLY_OFFSETS))
3965  return;
3966 
3967  SwRectFnSet aRectFnSet(this);
3968 
3969  SwRect aFlyRect( getFrameArea().Pos() + getFramePrintArea().Pos(), getFramePrintArea().SSize() );
3970 
3971  // Get first 'real' line and adjust position and height of line rectangle.
3972  // Correct behaviour if no 'real' line exists
3973  // (empty paragraph with and without a dummy portion)
3974  SwTwips nFlyAnchorVertOfstNoWrap = 0;
3975  {
3976  SwTwips nTop = aRectFnSet.GetTop(aFlyRect);
3977  const SwLineLayout* pLay = GetPara();
3978  SwTwips nLineHeight = 200;
3979  while( pLay && pLay->IsDummy() && pLay->GetNext() )
3980  {
3981  nTop += pLay->Height();
3982  nFlyAnchorVertOfstNoWrap += pLay->Height();
3983  pLay = pLay->GetNext();
3984  }
3985  if ( pLay )
3986  {
3987  nLineHeight = pLay->Height();
3988  }
3989  aRectFnSet.SetTopAndHeight( aFlyRect, nTop, nLineHeight );
3990  }
3991 
3992  SwTextFly aTextFly( this );
3993  aTextFly.SetIgnoreCurrentFrame( true );
3994  aTextFly.SetIgnoreContour( true );
3995  // ignore objects in page header|footer for
3996  // text frames not in page header|footer
3997  aTextFly.SetIgnoreObjsInHeaderFooter( true );
3998  SwTwips nRet1 = lcl_CalcFlyBasePos( *this, aFlyRect, aTextFly );
3999  aTextFly.SetIgnoreCurrentFrame( false );
4000  SwTwips nRet2 = lcl_CalcFlyBasePos( *this, aFlyRect, aTextFly );
4001 
4002  // make values relative to frame start position
4003  SwTwips nLeft = IsRightToLeft() ?
4004  aRectFnSet.GetRight(getFrameArea()) :
4005  aRectFnSet.GetLeft(getFrameArea());
4006 
4007  mnFlyAnchorOfst = nRet1 - nLeft;
4008  mnFlyAnchorOfstNoWrap = nRet2 - nLeft;
4009 
4010  if (!GetDoc().getIDocumentSettingAccess().get(DocumentSettingId::ADD_VERTICAL_FLY_OFFSETS))
4011  return;
4012 
4013  if (mnFlyAnchorOfstNoWrap > 0)
4014  mnFlyAnchorVertOfstNoWrap = nFlyAnchorVertOfstNoWrap;
4015 }
4016 
4017 SwTwips SwTextFrame::GetBaseVertOffsetForFly(bool bIgnoreFlysAnchoredAtThisFrame) const
4018 {
4019  return bIgnoreFlysAnchoredAtThisFrame ? 0 : mnFlyAnchorVertOfstNoWrap;
4020 }
4021 
4026 {
4028  for( const SwTextFrame *pFrame = aIter.First(); pFrame; pFrame = aIter.Next() )
4029  {
4030  SwRect aRec( pFrame->GetPaintArea() );
4031  const SwRootFrame *pRootFrame = pFrame->getRootFrame();
4032  SwViewShell *pCurShell = pRootFrame ? pRootFrame->GetCurrShell() : nullptr;
4033  if( pCurShell )
4034  pCurShell->InvalidateWindows( aRec );
4035  }
4036 }
4037 
4039 {
4040  if (pWrtSh && pWrtSh->GetViewOptions()->IsShowOutlineContentVisibilityButton() &&
4042  {
4043  SwEditWin& rEditWin = pWrtSh->GetView().GetEditWin();
4044  SwFrameControlsManager& rMngr = rEditWin.GetFrameControlsManager();
4046  }
4047 }
4048 
4049 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void HideHidden()
Removes Textfrm's attachments, when it's hidden.
Definition: txtfrm.cxx:1445
void SetWordCountDirty(bool bNew) const
Definition: txtedt.cxx:2258
vcl::RenderContext * GetOut() const
Definition: viewsh.hxx:338
void SetHasRotatedPortions(bool bHasRotatedPortions)
Definition: txtftn.cxx:90
bool GetValue() const
SwFntObj * pLastFont
Definition: fntcache.cxx:67
void CalcAdditionalFirstLineOffset()
Simulate format for a list item paragraph, whose list level attributes are in LABEL_ALIGNMENT mode...
Definition: txtfrm.cxx:3465
void Init()
This is public, as it needs to be called by some methods in order to save the Prepare USE WITH CAUTIO...
Definition: txtfrm.cxx:752
bool HasContent() const
Definition: porlay.hxx:133
Base class for the following contact objects (frame + draw objects).
Definition: dcontact.hxx:66
Base class of the Writer layout elements.
Definition: frame.hxx:313
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:158
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(120)
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(93)
void SwitchVerticalToHorizontal(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from vertical to horizontal layout...
Definition: txtfrm.cxx:582
LanguageType nOldLanguageType
Definition: txtfrm.hxx:944
tools::Long GetRight(const SwRect &rRect) const
Definition: frame.hxx:1377
bool IsFootnoteNum() const
Definition: porlay.hxx:316
SwTwips GetBaseVertOffsetForFly(bool bIgnoreFlysAnchoredAtThisFrame) const
Definition: txtfrm.cxx:4017
sal_uLong GetIndex() const
Definition: node.hxx:291
void Right(const tools::Long nRight)
Definition: swrect.hxx:199
sal_Int32 nIndex
void Add(SwClient *pDepend)
Definition: calbck.cxx:173
bool IsFollow() const
Definition: flowfrm.hxx:166
const SwSortedObjs * GetDrawObjs() const
Definition: frame.hxx:563
sal_uInt16 GetPropLineSpace() const
void SetWrong(std::unique_ptr< SwWrongList > pNew)
Definition: txtedt.cxx:2173
void SetIgnoreCurrentFrame(bool bNew)
Definition: txtfly.hxx:361
SwTwips EmptyHeight() const
Definition: porrst.cxx:261
sal_uInt16 GetLineNr() const
Definition: itrtxt.hxx:87
Marks a position in the document model.
Definition: pam.hxx:35
SwTextNode const & GetAttrMerged(SfxItemSet &rFormatSet, SwTextNode const &rNode, SwRootFrame const *pLayout)
Definition: txtfrm.cxx:371
void SetPrepAdjust()
Definition: porlay.hxx:308
sal_uInt32 GetParHeight() const
Returns the sum of line height in pLine.
Definition: txtfrm.cxx:3326
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
SwContentFrame * GetNextContentFrame() const
Definition: cntfrm.hxx:115
const SwField * GetField() const
Definition: fmtfld.hxx:110
static SwTwips lcl_CalcFlyBasePos(const SwTextFrame &rFrame, SwRect aFlyRect, SwTextFly const &rTextFly)
Helper function for SwTextFrame::CalcBasePosForFly()
Definition: txtfrm.cxx:3913
SwContentNode * GetNode(SwPaM &rPam, bool &rbFirst, SwMoveFnCollection const &fnMove, bool const bInReadOnly, SwRootFrame const *const i_pLayout)
This function returns the next node in direction of search.
Definition: pam.cxx:823
bool IsInDocBody() const
Definition: frame.hxx:940
const SwPageFrame * GetOrigPage() const
Definition: hints.hxx:325
bool IsInFly() const
Definition: frame.hxx:958
virtual void Height(const sal_uInt32 nNew, const bool bText=true) override
Definition: porlay.cxx:202
bool IsInRange(const WhichRangesContainer &pRange, const sal_uInt16 nId)
check if ID is in range of attribute set IDs
Definition: swatrset.cxx:434
sal_Int32 nSourceStart
Definition: hints.hxx:112
void SetPosY(SwRect &rRect, tools::Long nNew) const
Definition: frame.hxx:1398
#define LANGUAGE_ARABIC_SAUDI_ARABIA
SwRect aOldPrt
Definition: txtfrm.cxx:3121
bool IsInSct() const
Definition: frame.hxx:964
LanguageType GetLangOfChar(TextFrameIndex nIndex, sal_uInt16 nScript, bool bNoChar=false) const
Definition: txtfrm.cxx:1345
const SwTwips WIDOW_MAGIC
Definition: txtfrm.hxx:1027
SwDigitModeModifier(const OutputDevice &rOutp, LanguageType eCurLang)
Definition: txtfrm.cxx:726
const OutputDevice & rOut
Definition: txtfrm.hxx:943
const SwLineNumberInfo & GetLineNumberInfo() const
Definition: lineinfo.cxx:49
#define LANGUAGE_ENGLISH_US
SwView * GetActiveView()
Definition: swmodul1.cxx:116
SwLineLayout * GetNext()
Definition: porlay.hxx:159
const OUString & GetText() const
Definition: ndtxt.hxx:215
bool IsSwapped() const
Definition: txtfrm.hxx:535
static constexpr auto Items
bool IsOutline() const
Returns if this text node is an outline.
Definition: ndtxt.cxx:3977
bool IsWrongDirty() const
Definition: txtedt.cxx:2284
const SwLineLayout * NextLine()
Definition: itrtxt.cxx:124
bool InNumberGrp() const
Definition: porlin.hxx:101
constexpr TypedWhichId< SwFormatChg > RES_FMT_CHG(162)
SwpHints * GetpSwpHints()
Definition: ndtxt.hxx:223
std::string GetValue
bool HasPara() const
Definition: txtfrm.hxx:819
IDocumentDeviceAccess const & getIDocumentDeviceAccess() const
Definition: doc.cxx:238
void CalcBaseOfstForFly()
Definition: txtfrm.cxx:3959
void InvalidateAccessibleParaAttrs(const SwTextFrame &rTextFrame)
invalidate attributes for paragraphs and paragraph's characters
Definition: viewsh.cxx:2509
void Move(sal_Int32 nPos, sal_Int32 nDiff)
Change all values after the given position.
Definition: wrong.cxx:266
void Left(const tools::Long nLeft)
Definition: swrect.hxx:194
SwNodeIndex nNode
Definition: pam.hxx:37
GPOS_NONE
virtual SwGrammarMarkUp * getGrammarCheck(SwTextNode &rTextNode, bool bCreate)=0
getGrammarCheck checks if the given text node is blocked by the current cursor if not...
void SetCompletePaint() const
Definition: frame.hxx:991
SwParaPortion * GetPara()
Definition: txtcache.cxx:50
bool IsInFootnote() const
Definition: frame.hxx:946
void SwitchHorizontalToVertical(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from horizontal to vertical layout...
Definition: txtfrm.cxx:475
static void repaintTextFrames(const SwTextNode &rNode)
Repaint all text frames of the given text node.
Definition: txtfrm.cxx:4025
void SetNeedGrammarCheck(bool bVal)
Definition: rootfrm.hxx:263
void setSwRect(const SwRect &rNew)
Definition: frame.hxx:197
void SetDerivedR2L(bool bNew)
Definition: frame.hxx:631
SwTwips CalcFitToContent()
Simulates a formatting as if there were not right margin or Flys or other obstacles and returns the w...
Definition: txtfrm.cxx:3391
virtual sal_Int32 Len() const override
Definition: ndtxt.cxx:276
sal_uIntPtr sal_uLong
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
long Long
constexpr::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
const SwRect & getFramePrintArea() const
Definition: frame.hxx:179
virtual bool Prepare(const PrepareHint ePrep=PrepareHint::Clear, const void *pVoid=nullptr, bool bNotify=true) override
SwContentFrame: the shortcut for the Frames If the void* casts wrongly, it's its own fault! The void*...
Definition: txtfrm.cxx:2724
virtual bool GetInfo(SfxPoolItem &) const override
Definition: txtfrm.cxx:2618
void InvalidateLineNum_()
Definition: frame.hxx:794
The SwPortionHandler interface implements a visitor for the layout engine's text portions.
#define MINLAY
Definition: swtypes.hxx:61
void SetInvalidityA(const TextFrameIndex nPos)
Definition: scriptinfo.hxx:113
SwRect aOldFrame
Definition: txtfrm.cxx:3121
SwTextFrame(SwTextNode *const, SwFrame *, sw::FrameMode eMode)
Definition: txtfrm.cxx:766
static SwCache & GetCache()
Definition: frame.hxx:520
SwTextNode const * GetTextNodeForFirstText() const
Definition: txtfrm.cxx:1319
constexpr TypedWhichId< SwRegisterItem > RES_PARATR_REGISTER(71)
tools::Long CalcRight(const SwFrame *pCaller) const
Definition: frmtool.cxx:2258
sw::MergedPara * GetMergedPara()
Definition: txtfrm.hxx:450
The purpose of this class is to be the universal interface between formatting/text output and the pos...
Definition: txtfly.hxx:119
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Definition: node.cxx:1213
void InvalidateSize_()
Definition: frame.hxx:770
Definition: doc.hxx:188
constexpr sal_uInt16 RES_FRMATR_END(133)
sal_uInt32 mnThisLines
Definition: txtfrm.hxx:176
TElementType * Next()
Definition: calbck.hxx:333
bool HasFollow() const
Definition: flowfrm.hxx:165
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:90
SwParaPortion * GetPara()
Definition: txtcache.cxx:90
SwTextAttr const * PrevAttr(SwTextNode const **ppNode=nullptr)
Definition: txtfrm.cxx:226
constexpr TypedWhichId< SwFormatFlyCnt > RES_TXTATR_FLYCNT(57)
void SetIgnoreFly(const bool bNew)
Definition: inftxt.hxx:570
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(94)
SwNode & GetNode() const
Definition: ndindex.hxx:119
void CharToLine(TextFrameIndex)
Definition: itrtxt.cxx:193
void Format_(vcl::RenderContext *pRenderContext, SwParaPortion *pPara)
Definition: frmform.cxx:1695
SwEditWin & GetEditWin()
Definition: view.hxx:416
bool IsVert() const
Definition: frame.hxx:1364
sal_Int32 nStart
Definition: hints.hxx:132
const SwLineLayout * Next()
Definition: itrtxt.cxx:107
bool IsSmartTagDirty() const
Definition: txtedt.cxx:2310
void HideAndShowObjects()
Hides respectively shows objects, which are anchored at paragraph, at/as a character of the paragraph...
Definition: txtfrm.cxx:1551
void Pos(const Point &rNew)
Definition: swrect.hxx:168
constexpr TypedWhichId< SwInsText > RES_INS_TXT(164)
bool WouldFit(SwTextMargin &rLine, SwTwips &rMaxHeight, bool bTest)
Definition: widorp.cxx:486
Dialog to specify the properties of date form field.
SwFrame * FindNext()
Definition: frame.hxx:1138
virtual void Calc(vcl::RenderContext *pRenderContext) const
Definition: trvlfrm.cxx:1788
void MaxAscentDescent(SwTwips &_orAscent, SwTwips &_orDescent, SwTwips &_orObjAscent, SwTwips &_orObjDescent, const SwLinePortion *_pDontConsiderPortion=nullptr, const bool _bNoFlyCntPorAndLinePor=false) const
determine ascent and descent for positioning of as-character anchored object
Definition: porlay.cxx:702
bool IsKeepAlways() const
Definition: widorp.hxx:38
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
Definition: txtfrm.cxx:1295
tools::Long GetWidth(const SwRect &rRect) const
Definition: frame.hxx:1378
bool IsShowHiddenPara() const
Definition: viewopt.hxx:397
bool IsCountBlankLines() const
Definition: lineinfo.hxx:83
SwTwips Y() const
Definition: itrtxt.hxx:90
void SetGrammarCheckDirty(bool bNew) const
Definition: txtedt.cxx:2289
constexpr TypedWhichId< SwFormatField > RES_TXTATR_ANNOTATION(59)
The root element of a Writer document layout.
Definition: rootfrm.hxx:82
SwTextNode * pNode
Definition: txtfrm.hxx:86
WhichRangesContainer const aFrameFormatSetRange(svl::Items< RES_FRMATR_BEGIN, RES_FRMATR_END-1, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, XATTR_FILL_FIRST, XATTR_FILL_LAST >)
Collection of SwLineLayout instances, represents the paragraph text in Writer layout.
Definition: porlay.hxx:247
sal_uInt16 GetOrphansLines() const
Definition: widorp.hxx:61
void SetPara(SwParaPortion *pNew, bool bDelete=true)
Definition: txtcache.cxx:129
const SwTwips nDocPos
Definition: hints.hxx:246
int GetActualListLevel() const
Returns the actual list level of this text node, when it is a list item.
Definition: ndtxt.cxx:4087
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
void ValidateLineNum()
Definition: frame.hxx:759
sal_uInt32 GetLineHeight() const
Definition: itrtxt.hxx:116
bool TestFormat(const SwFrame *pPrv, SwTwips &nMaxHeight, bool &bSplit)
The WouldFit equivalent for temporarily rewired TextFrames nMaxHeight returns the required size here ...
Definition: txtfrm.cxx:3205
SfxHintId GetId() const
bool isFrameAreaDefinitionValid() const
Definition: frame.hxx:170
TextFrameIndex & Start()
Definition: porlay.hxx:45
void SetOutlineContentVisibilityButton(const SwContentFrame *pContentFrame)
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: wsfrm.cxx:2343
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(156)
SwTextAttr const * NextAttr(SwTextNode const **ppNode=nullptr)
Definition: txtfrm.cxx:89
void CalcFootnoteFlag(TextFrameIndex nStop=TextFrameIndex(COMPLETE_STRING))
Does the Frame have a local footnote (in this Frame or Follow)?
Definition: txtftn.cxx:96
void CheckDirChange()
checks the layout direction and invalidates the lower frames recursively, if necessary.
Definition: ssfrm.cxx:192
bool IsVertLRBT() const
Definition: frame.hxx:980
virtual void Finish()=0
end of paragraph.
bool FormatQuick(bool bForceQuickFormat)
Definition: frmform.cxx:1983
sal_uInt16 GetPhyPageNum() const
Definition: pagefrm.hxx:204
bool IsHiddenNow() const
Hidden.
Definition: txtfrm.cxx:1362
tools::Long GetTop(const SwRect &rRect) const
Definition: frame.hxx:1374
Used by the UI to modify the document model.
Definition: wrtsh.hxx:93
void CalcLineSpace()
Definition: txtfrm.cxx:1729
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:357
#define CH_TXTATR_BREAKWORD
Definition: hintids.hxx:170
sal_Int32 nDestStart
Definition: hints.hxx:111
SwRect GetFrame(const SwRect &rPortion) const
Definition: txtfly.hxx:356
const SwRegisterItem & GetRegister(bool=true) const
Definition: paratr.hxx:198
bool IsFieldName() const
Definition: viewopt.hxx:269
SwTwips CalcUpperSpace(const SwBorderAttrs *pAttrs=nullptr, const SwFrame *pPr=nullptr, const bool _bConsiderGrid=true) const
method to determine the upper space hold by the frame
Definition: flowfrm.cxx:1446
IGrammarContact * getGrammarContact(const SwTextNode &rTextNode)
getGrammarContact() delivers the grammar contact of the document (for a given textnode) ...
Definition: docnew.cxx:804
sal_uInt16 sal_Unicode
void InvalidateNextPrtArea()
method to invalidate printing area of next frame #i11859#
Definition: findfrm.cxx:1282
wrapper class for the positioning of Writer fly frames and drawing objects
std::vector< std::pair< SwTextNode const *, SwTextAttr const * > > m_Hints
Definition: txtfrm.hxx:1009
bool IsRestartEachPage() const
Definition: lineinfo.hxx:89
sal_Int32 getEnd() const
Definition: hints.hxx:210
const SwScriptInfo * GetScriptInfo() const
Returns the script info stored at the paraportion.
Definition: txtfrm.cxx:3904
SvxGraphicPosition GetGraphicPos() const
void RemoveFromListRLHidden()
Definition: ndtxt.cxx:4317
const SwView & GetView() const
Definition: wrtsh.hxx:431
SwFrameControlsManager & GetFrameControlsManager()
Definition: edtwin.cxx:6615
void SortIfNeedBe() const
Trigger the sorting if necessary.
Definition: ndhints.hxx:176
const SwPageFrame * GetPage() const
Definition: hints.hxx:324
constexpr sal_uInt16 RES_PARATR_BEGIN(RES_TXTATR_END)
new delete redline is created
Definition: hints.hxx:119
constexpr TypedWhichId< SwDocPosUpdate > RES_DOCPOS_UPDATE(169)
SwIndex nContent
Definition: pam.hxx:38
const SwRect & getFrameArea() const
Definition: frame.hxx:178
const SwTextField * GetTextField() const
Definition: fmtfld.hxx:128
bool getBrowseMode() const
Definition: viewopt.hxx:472
size_t pos
const vcl::Font & GetFont() const
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
Definition: txatbase.hxx:41
sal_uLong GetThisLines() const
Definition: txtfrm.hxx:668
bool IsInTab() const
Definition: frame.hxx:952
std::unique_ptr< sw::MergedPara > CheckParaRedlineMerge(SwTextFrame &rFrame, SwTextNode &rTextNode, FrameMode eMode)
Definition: redlnitr.cxx:205
void SetInfo(const SwPageFrame *pPg, const SwFrame *pF)
Definition: hints.hxx:327
sal_Int32 nEnd
Definition: txtfrm.hxx:88
static bool IsFuzzing()
SwTestFormat(SwTextFrame *pTextFrame, const SwFrame *pPrv, SwTwips nMaxHeight)
Definition: txtfrm.cxx:3127
int nCount
bool IsTextFrame() const
Definition: frame.hxx:1231
sal_uInt16 GetCacheIdx() const
Definition: txtfrm.hxx:613
sal_Int32 GetStart() const
Definition: txatbase.hxx:86
void SetFntChg(const bool bNew)
Definition: swfont.hxx:207
TextFrameIndex UpdateMergedParaForDelete(MergedPara &rMerged, bool isRealDelete, SwTextNode const &rNode, sal_Int32 nIndex, sal_Int32 nLen)
Definition: txtfrm.cxx:1034
oslFileHandle & pOut
void InitScriptInfo(const SwTextNode &rNode, sw::MergedPara const *pMerged, bool bRTL)
Definition: porlay.cxx:1008
bool HasFly() const
Definition: porlay.hxx:299
void Width(tools::Long nNew)
Definition: swrect.hxx:186
const SwTextFrame * pFrame
Definition: txtfrm.hxx:923
const OutputDevice & m_rOut
Definition: txtfrm.hxx:932
virtual bool SetFieldsDirty(bool b, const SwNode *pChk, sal_uLong nLen)=0
virtual ~SwTextFrame() override
Definition: txtfrm.cxx:894
virtual void LineBreak(sal_Int32 nWidth)=0
line break.
sal_uLong GetStartValue() const
Definition: fmtline.hxx:57
constexpr TypedWhichId< SwFormatCharFormat > RES_TXTATR_CHARFMT(52)
Describes parts of multiple text nodes, which will form a text frame, even when redlines are hidden a...
Definition: txtfrm.hxx:956
SwContentFrame * GetPrevContentFrame() const
Definition: cntfrm.hxx:123
constexpr TypedWhichId< SwFormatAutoFormat > RES_TXTATR_AUTOFMT(50)
void ChgPhysFnt(SwViewShell const *pSh, OutputDevice &rOut)
Definition: swfont.cxx:942
tools::Long GetLeft(const SwRect &rRect) const
Definition: frame.hxx:1376
void SetWrongDirty(WrongState eNew) const
Definition: txtedt.cxx:2271
size_type size() const
sal_Int32 getStart() const
Definition: hints.hxx:205
constexpr TypedWhichId< SwFormatFootnote > RES_TXTATR_FTN(58)
virtual void MoveObjToVisibleLayer(SdrObject *_pDrawObj)
method to move drawing object to corresponding visible layer
Definition: dcontact.cxx:209
static void lcl_ModifyOfst(SwTextFrame &rFrame, TextFrameIndex const nPos, TextFrameIndex const nLen, TextFrameIndex(*op)(TextFrameIndex const &, TextFrameIndex const &))
Definition: txtfrm.cxx:1872
SwTextFrame * GetFollow()
Definition: txtfrm.hxx:855
TextFrameIndex GetOffset() const
Definition: txtfrm.hxx:438
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
FrameMode
Definition: txtfrm.hxx:103
void SetIgnoreObjsInHeaderFooter(const bool bNew)
Definition: txtfly.hxx:371
std::vector< Extent > extents
Definition: txtfrm.hxx:959
tools::Long & GetDelta()
Definition: porlay.hxx:286
bool IsFollowField() const
Definition: porlay.hxx:311
bool IsShowOutlineContentVisibilityButton() const
Definition: viewopt.cxx:99
static bool isA11yRelevantAttribute(sal_uInt16 nWhich)
Related: fdo#56031 filter out attribute changes that don't matter for humans/a11y to stop flooding th...
Definition: txtfrm.cxx:1953
void MoveGrammar(sal_Int32 nPos, sal_Int32 nDiff)
void PrepWidows(const sal_uInt16 nNeed, bool bNotify)
Definition: txtfrm.cxx:2644
exports com.sun.star. text
const Color & GetColor() const
bool IsEmpty() const
Definition: txtfrm.hxx:521
void ResetPreps()
Definition: txtfrm.cxx:1353
Describes a part of a single text node, which will be part of a text frame, even when redlines are hi...
Definition: txtfrm.hxx:84
void swap(cow_wrapper< T, P > &a, cow_wrapper< T, P > &b)
SwTextNode * GetTextNodeFirst()
Definition: txtfrm.hxx:457
void SetInvalidVert(bool bNew)
Definition: frame.hxx:629
bool FrameContainsNode(SwContentFrame const &rFrame, sal_uLong nNodeIndex)
Definition: txtfrm.cxx:288
bool IsInDtor() const
Definition: frame.hxx:889
SwTextNode const * GetTextNodeForParaProps() const
Definition: txtfrm.cxx:1305
void InvalidateAutoCompleteWords() const
Definition: pagefrm.hxx:393
SwTwips mnFlyAnchorOfst
Definition: txtfrm.hxx:180
delete redline is removed
Definition: hints.hxx:129
void SetIgnoreContour(bool bNew)
Definition: txtfly.hxx:366
SwTextFootnote * SeekEntry(const SwNodeIndex &rIdx, size_t *pPos=nullptr) const
Definition: ftnidx.cxx:409
constexpr TypedWhichId< SwFormatField > RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN)
bool IsFootnoteNumPortion() const
Definition: porlin.hxx:120
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
Style of a layout element.
Definition: frmfmt.hxx:58
bool IsWidow() const
Definition: txtfrm.hxx:519
SwTwips CalcFitToContent_()
Definition: itrform2.cxx:2061
PrepareHint
Definition: swtypes.hxx:193
void Bottom()
Definition: itrtxt.cxx:185
TextFrameIndex MapModelToViewPos(SwPosition const &rPos) const
Definition: txtfrm.cxx:1269
#define SW_MOD()
Definition: swmodule.hxx:256
constexpr TypedWhichId< SwUpdateAttr > RES_UPDATE_ATTR(167)
void InvalidateLineNum()
Definition: frame.hxx:1047
bool IsDummy() const
Definition: porlay.hxx:151
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void InvalidatePrt()
Definition: frame.hxx:1033
void InvalidateSpelling() const
Definition: pagefrm.hxx:384
sw::BroadcastingModify * GetDep()
use these so we can grep for SwFrame's GetRegisteredIn accesses beware that SwTextFrame may return sw...
Definition: frame.hxx:475
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
int i
void SetSmartTagDirty(bool bNew) const
Definition: txtedt.cxx:2302
Collection of SwLinePortion instances, representing one line of text.
Definition: porlay.hxx:78
SwDoc & GetDoc()
Definition: node.hxx:212
bool IsInside(SwTextMargin const &rLine) const
BP 18.6.93: Widows.
Definition: widorp.cxx:102
void Top()
Definition: itrtxt.hxx:99
SwFrame * GetIndNext()
Definition: frame.hxx:726
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Definition: edtwin.hxx:58
SwIndex & Assign(SwIndexReg *, sal_Int32)
Definition: index.cxx:206
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
static SwSmartTagMgr & Get()
size_t size() const
Definition: sortedobjs.cxx:43
SwTextFly & GetTextFly()
Definition: inftxt.hxx:383
ComplexTextLayoutFlags
Mutex aLock
tools::Long CalcLeft(const SwFrame *pCaller) const
Definition: frmtool.cxx:2320
SwPageFrame * FindPageFrame()
Definition: frame.hxx:679
sal_uLong GetAllLines() const
For displaying the line numbers.
Definition: txtfrm.hxx:667
Helper class which can be used instead of the macros if a function has too many returns.
Definition: txtfrm.hxx:921
SwCharRange & GetReformat()
Definition: porlay.hxx:284
RndStdIds GetAnchorId() const
Definition: dcontact.hxx:145
void RecalcRealHeight()
Definition: itrform2.cxx:1822
Count
TextFrameIndex MapModelToView(MergedPara const &, SwTextNode const *pNode, sal_Int32 nIndex)
Definition: txtfrm.cxx:1185
void UpdateOutlineContentVisibilityButton(SwWrtShell *pWrtSh) const
Definition: txtfrm.cxx:4038
SwContentFrame * FindNextCnt(const bool _bInSameFootnote=false)
Definition: findfrm.cxx:191
TElementType * First()
Definition: calbck.hxx:325
SwTextGridItem const * GetGridItem(SwPageFrame const *const)
Definition: pagechg.cxx:2574
void ManipOfst(TextFrameIndex const nNewOfst)
Definition: txtfrm.hxx:441
SwContentNode * GetContentNode()
Definition: node.hxx:616
void InvalidatePage(const SwPageFrame *pPage=nullptr) const
Invalidates the page in which the Frame is currently placed.
Definition: wsfrm.cxx:610
SwLinePortion * GetFirstPortion() const
Definition: porlay.cxx:771
tools::Long GetHeight(const SwRect &rRect) const
Definition: frame.hxx:1379
sal_uInt16 Count() const
void InvalidateRange(const SwCharRange &, const tools::Long=0)
Definition: txtfrm.cxx:1689
iterate SwTextAttr in potentially merged text frame
Definition: txtfrm.hxx:983
std::pair< SwTextNode *, sal_Int32 > MapViewToModel(MergedPara const &, TextFrameIndex nIndex)
Definition: txtfrm.cxx:1166
constexpr TypedWhichId< SwVirtPageNumInfo > RES_VIRTPAGENUM_INFO(180)
void SetAutoCompleteWordDirty(bool bNew) const
Definition: txtedt.cxx:2315
void SetRight(SwRect &rRect, tools::Long nNew) const
Definition: frame.hxx:1386
SwLayoutFrame * GetUpper()
Definition: frame.hxx:677
bool HasArea() const
Definition: swrect.hxx:287
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
bool Relax(const SwRect &rRect)
If there is no flying object frame standing in rRect (usually the current row), then we are turning o...
Definition: txtfly.hxx:318
void SetOffset_(TextFrameIndex nNewOfst)
Definition: frmform.cxx:756
void InvalidateSmartTags() const
Definition: pagefrm.hxx:389
constexpr TypedWhichId< SwAttrSetChg > RES_ATTRSET_CHG(163)
bool isFramePrintAreaValid() const
Definition: frame.hxx:167
SwGrammarMarkUp * GetGrammarCheck()
Definition: txtedt.cxx:2218
bool IsUndersized() const
Definition: flowfrm.hxx:158
SwTextNode * pParaPropsNode
most paragraph properties are taken from the first non-empty node
Definition: txtfrm.hxx:964
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
Definition: ndtxt.cxx:2798
virtual void HandlePortion(SwPortionHandler &rPH) const
Definition: porlin.cxx:315
void Invalidate(sal_Int32 nBegin, sal_Int32 nEnd)
Definition: wrong.cxx:425
Provides access to settings of a document.
bool IsNoTextNode() const
Definition: node.hxx:649
SvxInterLineSpaceRule GetInterLineSpaceRule() const
SwFrame * GetPrev()
Definition: frame.hxx:676
SwTextFrame * GetFormatted(bool bForceQuickFormat=false)
In case the SwLineLayout was cleared out of the s_pTextCache, recreate it.
Definition: txtfrm.cxx:3366
constexpr TypedWhichId< SvxLineSpacingItem > RES_PARATR_LINESPACING(RES_PARATR_BEGIN)
void SetSmartTags(std::unique_ptr< SwWrongList > pNew)
Definition: txtedt.cxx:2228
void RemoveFootnotesForNode(SwRootFrame const &rLayout, SwTextNode const &rTextNode, std::vector< std::pair< sal_Int32, sal_Int32 >> const *const pExtents)
Definition: txtfrm.cxx:806
void Modify(bool bChgToRTL)
Definition: txtfrm.cxx:713
SwWrongList * GetSmartTags()
Definition: txtedt.cxx:2248
Marks a node in the document model.
Definition: ndindex.hxx:31
SvxAdjust GetNumAdjust() const
sal_Int32 nLen
Definition: hints.hxx:113
void RecalcAllLines()
Definition: txtfrm.cxx:3823
void RemoveFromCache()
Removes this frame completely from the Cache.
Definition: txtcache.cxx:120
const SvxLineSpacingItem & GetLineSpacing(bool=true) const
Definition: paratr.hxx:192
text is moved into pDestNode
Definition: hints.hxx:107
void TruncLines(bool bNoteFollow=false)
Definition: itrtxt.cxx:323
OUString mergedText
note: cannot be const currently to avoid UB because SwTextGuess::Guess const_casts it and modifies it...
Definition: txtfrm.hxx:962
SwTextNode * pDestNode
Definition: hints.hxx:110
void SSize(const Size &rNew)
Definition: swrect.hxx:177
bool IsLocked() const
Definition: txtfrm.hxx:517
int FieldCanHideParaWeight(SwFieldIds eFieldId) const
Definition: doc.cxx:1333
TextFrameIndex GetParLen() const
Definition: porlay.cxx:2481
bool isFrameAreaSizeValid() const
Definition: frame.hxx:166
static void lcl_SetScriptInval(SwTextFrame &rFrame, TextFrameIndex const nPos)
Definition: txtfrm.cxx:1865
SvxNumPositionAndSpaceMode GetPositionAndSpaceMode() const
TextFrameIndex GetLen() const
Definition: porlin.hxx:73
void CalcHeightOfLastLine(const bool _bUseFont=false)
method to determine height of last line, needed for proportional line spacing
Definition: txtfrm.cxx:3551
A page of the document layout.
Definition: pagefrm.hxx:57
SfxItemPool * GetPool() const
SwTextFrame * MakeTextFrame(SwTextNode &rNode, SwFrame *, sw::FrameMode eMode)
Definition: txtfrm.cxx:800
std::pair< SwTextNode *, sal_Int32 > MapViewToModel(TextFrameIndex nIndex) const
map position in potentially merged text frame to SwPosition
Definition: txtfrm.cxx:1233
tools::Long SwTwips
Definition: swtypes.hxx:50
void InvalidateWindows(const SwRect &rRect)
Definition: viewsh.cxx:545
virtual void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr) override
Definition: frmform.cxx:1754
short GetInterLineSpace() const
sal_Int32 nStart
Definition: hints.hxx:122
< purpose of derivation from SwClient: character style for displaying the numbers.
Definition: lineinfo.hxx:37
SwBorderAttrs * Get()
Definition: frmtool.cxx:2630
SwTextNode * GetParaPropsNode(SwRootFrame const &rLayout, SwNodeIndex const &rNode)
Definition: txtfrm.cxx:328
bool isPARATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:488
SwFieldType * GetTyp() const
Definition: fldbas.hxx:392
void InvalidateSize()
Definition: frame.hxx:1026
SwSectionFrame * FindSctFrame()
Definition: frame.hxx:1112
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
MergedAttrIterByEnd(SwTextFrame const &rFrame)
Definition: txtfrm.cxx:149
constexpr TypedWhichId< SvxRsidItem > RES_CHRATR_RSID(39)
SwPosition GetParaPropsPos(SwRootFrame const &rLayout, SwPosition const &rPos)
Definition: txtfrm.cxx:342
bool RemoveFootnote(const SwContentFrame *, const SwTextFootnote *, bool bPrep=true)
Definition: ftnfrm.cxx:1724
void SwitchLTRtoRTL(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from LTR to RTL layout.
Definition: txtfrm.cxx:685
sal_uInt16 Which() const
for Querying of Writer-functions.
Definition: format.hxx:82
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:79
bool IsFootnoteNumFrame() const
Am I a FootnoteFrame, with a number at the start of the paragraph?
Definition: txtfrm.hxx:622
void SetTopAndHeight(SwRect &rRect, tools::Long nTop, tools::Long nHeight) const
Definition: frame.hxx:1425
sal_uInt16 Count() const
Definition: hints.hxx:305
void SetPosX(SwRect &rRect, tools::Long nNew) const
Definition: frame.hxx:1397
bool IsLayoutFrame() const
Definition: frame.hxx:1167
bool IsPrepMustFit() const
Definition: porlay.hxx:307
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void Bottom(const tools::Long nBottom)
Definition: swrect.hxx:208
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
void Broadcast(const SfxHint &rHint)
sal_uInt16 GetLineCount(TextFrameIndex nPos)
Determines the line count.
Definition: txtfrm.cxx:3746
void SetDevFont(const SwViewShell *pSh, OutputDevice &rOut)
Definition: fntcache.cxx:679
bool IsBreakNow(SwTextMargin &rLine)
Definition: widorp.cxx:176
#define LANGUAGE_ENGLISH
void SetWidth(SwRect &rRect, tools::Long nNew) const
Definition: frame.hxx:1387
bool IsVertLR() const
Definition: frame.hxx:976
An SwTextAttr container, stores all directly formatted text portions for a text node.
Definition: ndhints.hxx:67
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
tools::Long GetBottomMargin(const SwFrame &rFrame) const
Definition: frame.hxx:1401
SwTwips mnAdditionalFirstLineOffset
Definition: txtfrm.hxx:193
bool UpdateQuoVadis(std::u16string_view rQuo)
Is called in SwTextFrame::Prepare()
Definition: txtftn.cxx:1534
void CheckKeep()
Definition: flowfrm.cxx:147
void SetOffset(TextFrameIndex nNewOfst)
Definition: txtfrm.hxx:865
constexpr TypedWhichId< SvxFormatSplitItem > RES_PARATR_SPLIT(65)
virtual SwFrameFormat & GetFrameFormat()=0
#define SAL_WARN_IF(condition, area, stream)
SwTextFrame * FindMaster() const
Definition: flowfrm.cxx:738
constexpr tools::Long Height() const
bool IsNumbered(SwRootFrame const *pLayout=nullptr) const
Returns is this text node is numbered.
Definition: ndtxt.cxx:2866
SwRepaint & GetRepaint()
Definition: porlay.hxx:282
void ClearPara()
Removes the Line information from the Cache but retains the entry itself.
Definition: txtcache.cxx:104
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:423
vcl::Window * GetWin() const
Definition: viewsh.hxx:337
const SwFrame * ContainsAny(const bool _bInvestigateFootnoteForSections=false) const
Method doesn't investigate content of footnotes by default.
Definition: findfrm.cxx:126
void SetFont(const vcl::Font &rNewFont)
tools::Long GetLineSpace(const bool _bNoPropLineSpacing=false) const
Returns the additional line spacing for the next paragraph.
Definition: txtfrm.cxx:3690
SwTextNode const *const m_pNode
Definition: txtfrm.hxx:1010
MergedAttrIterBase(SwTextFrame const &rFrame)
Definition: txtfrm.cxx:81
static TextFrameIndex UpdateMergedParaForInsert(MergedPara &rMerged, bool const isRealInsert, SwTextNode const &rNode, sal_Int32 const nIndex, sal_Int32 const nLen)
Definition: txtfrm.cxx:903
void SetFieldFollow(const bool bNew)
Definition: txtfrm.hxx:248
TextFrameIndex MapModelToView(SwTextNode const *pNode, sal_Int32 nIndex) const
Definition: txtfrm.cxx:1254
sal_Int32 GetIndex() const
Definition: index.hxx:91
bool IsCountedInList() const
Definition: ndtxt.cxx:4225
void SetHeight(SwRect &rRect, tools::Long nNew) const
Definition: frame.hxx:1388
bool IsNoTextFrame() const
Definition: frame.hxx:1235
SwTwips GetHeightOfLastLine() const
Definition: txtfrm.hxx:767
void SetMergedPara(std::unique_ptr< sw::MergedPara > p)
Definition: txtfrm.cxx:1276
void SwapWidthAndHeight()
Swaps width and height of the text frame.
Definition: txtfrm.cxx:422
LanguageType GetAppLanguage()
Definition: init.cxx:722
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:176
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
sw::MergedPara const * m_pMerged
Definition: txtfrm.hxx:987
SwTwips mnFlyAnchorOfstNoWrap
Definition: txtfrm.hxx:182
bool IsRightToLeft() const
Definition: frame.hxx:984
std::unique_ptr< sw::MergedPara > m_pMergedPara
redline merge data
Definition: txtfrm.hxx:196
void Top(const tools::Long nTop)
Definition: swrect.hxx:203
bool FieldHidesPara(const SwField &rField) const
Definition: doc.cxx:1348
static TextFrameIndex FindBrk(const OUString &rText, TextFrameIndex nStart, TextFrameIndex nEnd)
Returns the first possible break point in the current line.
Definition: txtfrm.cxx:1635
sal_Int32 nLen
Definition: hints.hxx:123
Organizer of the contact between SwTextNodes and grammar checker.
SwFrameType mnFrameType
Definition: frame.hxx:413
sal_Int32 nStart
Definition: txtfrm.hxx:87
TextFrameIndex CalcFlyPos(SwFrameFormat const *pSearch)
Calculates the position of FlyInContentFrames.
Definition: porfly.cxx:184
SwWrongList * GetWrong()
Definition: txtedt.cxx:2190
virtual OutputDevice * getReferenceDevice(bool bCreate) const =0
Returns the current reference device.
MergedAttrIterReverse(SwTextFrame const &rFrame)
Definition: txtfrm.cxx:201
const SwLineLayout * PrevLine()
Definition: itrtxt.cxx:170
bool IsPrtFormat() const
Definition: viewopt.hxx:541
bool sw_HideObj(const SwTextFrame &_rFrame, const RndStdIds _eAnchorType, SwPosition const &rAnchorPos, SwAnchoredObject *_pAnchoredObj)
as-character anchored graphics, which are used for a graphic bullet list.
Definition: txtfrm.cxx:1488
SwScriptInfo & GetScriptInfo()
Definition: porlay.hxx:288
double getLength(const B2DPolygon &rCandidate)
const std::vector< sal_uInt16 > & getFmtAttrs() const
Definition: hints.hxx:220
void SetPrep()
Definition: porlay.hxx:302
bool IsParaPropsNode(SwRootFrame const &rLayout, SwTextNode const &rNode)
Definition: txtfrm.cxx:311
sal_Int32 nLen
Definition: hints.hxx:133
virtual void Skip(TextFrameIndex nLength)=0
skip characters.
virtual void MoveObjToInvisibleLayer(SdrObject *_pDrawObj)
method to move drawing object to corresponding invisible layer
Definition: dcontact.cxx:236
void SetWidow(const bool bNew)
Definition: txtfrm.hxx:245
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
void DelFrames(const SwRootFrame *)
Definition: atrftn.cxx:469
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
Definition: node.hxx:715
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
static void lcl_SetWrong(SwTextFrame &rFrame, SwTextNode const &rNode, sal_Int32 const nPos, sal_Int32 const nCnt, bool const bMove)
Definition: txtfrm.cxx:1800
SwParaPortion * pOldPara
Definition: txtfrm.cxx:3120
bool IsFixLineHeight() const
Definition: porlay.hxx:313
void Unlock()
Definition: swcache.cxx:481
static bool GetBoundsOfHiddenRange(const SwTextNode &rNode, sal_Int32 nPos, sal_Int32 &rnStartPos, sal_Int32 &rnEndPos, std::vector< sal_Int32 > *pList=nullptr)
Hidden text range information - static and non-version.
Definition: porlay.cxx:1864
constexpr sal_Int32 COMPLETE_STRING
Definition: swtypes.hxx:56
void SetPrepMustFit(const bool bNew)
Definition: porlay.hxx:306
void SetPrepWidows()
Definition: porlay.hxx:304
static bool lcl_ErgoVadis(SwTextFrame *pFrame, TextFrameIndex &rPos, const PrepareHint ePrep)
Definition: txtfrm.cxx:2696
void setHeight(tools::Long nHeight)
OUString m_aQuoVadis
Definition: ftninfo.hxx:95
const SwLineLayout * GetCurr() const
Definition: itrtxt.hxx:83
SwTextNode const * pLastNode
mainly for sanity checks
Definition: txtfrm.hxx:968
bool IsVertical() const
Definition: frame.hxx:970
tools::Long GetBottom(const SwRect &rRect) const
Definition: frame.hxx:1375
SwTextAttr const * NextAttr(SwTextNode const *&rpNode)
Definition: txtfrm.cxx:164
SwDocPosUpdate is sent to signal that only the frames from or to a specified document-global position...
Definition: hints.hxx:243
virtual void DestroyImpl() override
Definition: txtfrm.cxx:852
void InvalidatePrt_()
Definition: frame.hxx:778
SwFootnoteIdxs & GetFootnoteIdxs()
Definition: doc.hxx:634
void ClearItem(sal_uInt16 nWhichL)
Definition: hints.cxx:128
void AddToListRLHidden()
Definition: ndtxt.cxx:4286
void SetLeft(SwRect &rRect, tools::Long nNew) const
Definition: frame.hxx:1385
RndStdIds
SwDoc & GetDoc()
Definition: txtfrm.hxx:460
SwTwips mnHeightOfLastLine
Definition: txtfrm.hxx:188
virtual bool WouldFit(SwTwips &nMaxHeight, bool &bSplit, bool bTst) override
nMaxHeight is the required height bSplit indicates, that the paragraph has to be split bTst indicates...
Definition: txtfrm.cxx:3229
constexpr TypedWhichId< SwFormatLineNumber > RES_LINENUMBER(116)
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLBACKGROUND)
Small Helper class: Prepares a test format.
Definition: txtfrm.cxx:3117
bool HasMergedParas() const
Definition: rootfrm.hxx:426
bool IsOn() const
Definition: txtfly.hxx:313
static bool hasA11yRelevantAttribute(const std::vector< sal_uInt16 > &rWhichFmtAttr)
Definition: txtfrm.cxx:1958
Left
A container for the Header/Footer, PageBreak, and Outline Content Visibility controls.
SwTextNode *const pFirstNode
except break attributes, those are taken from the first node
Definition: txtfrm.hxx:966
bool IsShowHiddenChar(bool bHard=false) const
Definition: viewopt.hxx:321
sal_uInt16 getWhichAttr() const
Definition: hints.hxx:215
SwTwips mnFlyAnchorVertOfstNoWrap
The y position for wrap-through flys anchored at this paragraph.
Definition: txtfrm.hxx:184
constexpr TypedWhichId< SwDelChr > RES_DEL_CHR(165)
bool IsCount() const
Definition: fmtline.hxx:58
tuple m
TextFrameIndex GetEnd() const
Definition: itrtxt.hxx:89
sal_uInt16 GetDropLines() const
Definition: itrtxt.hxx:202
sal_uInt16 FirstLineHeight() const
Returns the first line height.
Definition: txtfrm.cxx:3731
sal_uInt32 Width() const
Definition: possiz.hxx:51
void VisitPortions(SwPortionHandler &rPH) const
Visit all portions for Accessibility.
Definition: txtfrm.cxx:3877
SwLinePortion * GetNextPortion() const
Definition: porlin.hxx:71
void InvalidateWordCount() const
Definition: pagefrm.hxx:397
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:207
void InvalidateRange_(const SwCharRange &, const tools::Long=0)
Definition: txtfrm.cxx:1695
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...
class for collecting anchored objects
Definition: sortedobjs.hxx:48
ComplexTextLayoutFlags m_nOldLayoutMode
Definition: txtfrm.hxx:933
void Height(tools::Long nNew)
Definition: swrect.hxx:190
constexpr TypedWhichId< SwDelText > RES_DEL_TXT(166)
SwPosition MapViewToModelPos(TextFrameIndex nIndex) const
Definition: txtfrm.cxx:1248
TextFrameIndex & Len()
Definition: porlay.hxx:49
SwFieldIds Which() const
Definition: fldbas.hxx:272
SdrObjUserCall * GetUserCall() const
bool IsIdxInside(TextFrameIndex nPos, TextFrameIndex nLen) const
Definition: txtfrm.cxx:1660
Merge GetRedlineMergeFlag() const
Definition: node.hxx:98
const SwPosition & GetContentAnchor() const
Definition: dcontact.hxx:152
const SwTextNode & GetTextNode() const
Definition: txtftn.hxx:70
tools::Long GetHeight() const
Definition: swfont.hxx:280
const SwFootnoteInfo & GetFootnoteInfo() const
Definition: doc.hxx:630
sal_uInt16 Which() const
SwRootFrame * getRootFrame()
Definition: frame.hxx:678
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
bool mbIsSwapped
Definition: txtfrm.hxx:234
OUString m_aErgoSum
Definition: ftninfo.hxx:96
void SetInvalid(sal_Int32 nBegin, sal_Int32 nEnd)
Definition: wrong.cxx:253
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_OBJECTDYING(RES_MSG_BEGIN)
Definition: view.hxx:144
void HideFootnotes(TextFrameIndex nStart, TextFrameIndex nEnd)
Definition: txtfrm.cxx:1457
sal_uInt16 nPos
virtual void SwClientNotify(SwModify const &rModify, SfxHint const &rHint) override
Definition: txtfrm.cxx:1973
std::pair< SwTextNode *, SwTextNode * > GetFirstAndLastNode(SwRootFrame const &rLayout, SwNodeIndex const &rPos)
Definition: txtfrm.cxx:355
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:850
virtual void DestroyImpl() override
Definition: ssfrm.cxx:422
bool isPARATR_LIST(const sal_uInt16 nWhich)
Definition: hintids.hxx:492
void ChgThisLines()
Definition: txtfrm.cxx:3767
#define PROTOCOL_ENTER(pFrame, nFunc, nAct, pPar)
Definition: dbg_lay.hxx:92
sal_uInt32 GetRealHeight() const
Definition: porlay.hxx:169
SwTabFrame * FindTabFrame()
Definition: frame.hxx:1096
SwTextFrame * pFrame
Definition: txtfrm.cxx:3119
SwFrameSwapper(const SwTextFrame *pFrame, bool bSwapIfNotSwapped)
Definition: txtfrm.cxx:669
SwFrame * GetNext()
Definition: frame.hxx:675
const SwFormatLineNumber & GetLineNumber(bool=true) const
Definition: fmtline.hxx:64
SwLayoutModeModifier(const OutputDevice &rOutp)
Definition: txtfrm.cxx:703
SwTextNode const * m_pNode
Definition: txtfrm.hxx:988
bool HasFootnote() const
Definition: txtfrm.hxx:522
sal_uInt32 mnAllLines
Definition: txtfrm.hxx:175