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