LibreOffice Module sw (master)  1
findfrm.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 <pagefrm.hxx>
21 #include <rootfrm.hxx>
22 #include <cellfrm.hxx>
23 #include <rowfrm.hxx>
24 #include <swtable.hxx>
25 #include <notxtfrm.hxx>
26 #include <tabfrm.hxx>
27 #include <sectfrm.hxx>
28 #include <frmatr.hxx>
29 #include <flyfrm.hxx>
30 #include <ftnfrm.hxx>
31 #include <txtftn.hxx>
32 #include <fmtftn.hxx>
33 #include <fmtpdsc.hxx>
34 #include <txtfrm.hxx>
35 #include <bodyfrm.hxx>
36 #include <calbck.hxx>
37 #include <viewopt.hxx>
38 #include <ndtxt.hxx>
39 #include <sal/log.hxx>
40 
43 {
44  SwFrame *pLay = Lower();
45  while ( pLay && !pLay->IsBodyFrame() )
46  pLay = pLay->GetNext();
47  return static_cast<SwLayoutFrame*>(pLay);
48 }
49 
52 {
54  SwContentFrame *pNxt = pRet;
55  while ( pNxt && pNxt->IsInDocBody() && IsAnLower( pNxt ) )
56  { pRet = pNxt;
57  pNxt = pNxt->FindNextCnt();
58  }
59  return pRet;
60 }
61 
67 {
68  //Search downwards the layout leaf and if there is no content, jump to the
69  //next leaf until content is found or we leave "this".
70  //Sections: Content next to sections would not be found this way (empty
71  //sections directly next to ContentFrame) therefore we need to recursively
72  //search for them even if it's more complex.
73 
74  const SwLayoutFrame *pLayLeaf = this;
75  do
76  {
77  while ( (!pLayLeaf->IsSctFrame() || pLayLeaf == this ) &&
78  pLayLeaf->Lower() && pLayLeaf->Lower()->IsLayoutFrame() )
79  pLayLeaf = static_cast<const SwLayoutFrame*>(pLayLeaf->Lower());
80 
81  if( pLayLeaf->IsSctFrame() && pLayLeaf != this )
82  {
83  const SwContentFrame *pCnt = pLayLeaf->ContainsContent();
84  if( pCnt )
85  return pCnt;
86  if( pLayLeaf->GetNext() )
87  {
88  if( pLayLeaf->GetNext()->IsLayoutFrame() )
89  {
90  pLayLeaf = static_cast<const SwLayoutFrame*>(pLayLeaf->GetNext());
91  continue;
92  }
93  else
94  return static_cast<const SwContentFrame*>(pLayLeaf->GetNext());
95  }
96  }
97  else if ( pLayLeaf->Lower() )
98  return static_cast<const SwContentFrame*>(pLayLeaf->Lower());
99 
100  pLayLeaf = pLayLeaf->GetNextLayoutLeaf();
101  if( !IsAnLower( pLayLeaf) )
102  return nullptr;
103  } while( pLayLeaf );
104  return nullptr;
105 }
106 
113 {
114  const SwFrame* pCnt = ContainsAny();
115  while( pCnt && !pCnt->IsCellFrame() )
116  pCnt = pCnt->GetUpper();
117  return static_cast<const SwCellFrame*>(pCnt);
118 }
119 
125 const SwFrame *SwLayoutFrame::ContainsAny( const bool _bInvestigateFootnoteForSections ) const
126 {
127  //Search downwards the layout leaf and if there is no content, jump to the
128  //next leaf until content is found, we leave "this" or until we found
129  //a SectionFrame or a TabFrame.
130 
131  const SwLayoutFrame *pLayLeaf = this;
132  const bool bNoFootnote = IsSctFrame() && !_bInvestigateFootnoteForSections;
133  do
134  {
135  while ( ( (!pLayLeaf->IsSctFrame() && !pLayLeaf->IsTabFrame())
136  || pLayLeaf == this ) &&
137  pLayLeaf->Lower() && pLayLeaf->Lower()->IsLayoutFrame() )
138  pLayLeaf = static_cast<const SwLayoutFrame*>(pLayLeaf->Lower());
139 
140  if( ( pLayLeaf->IsTabFrame() || pLayLeaf->IsSctFrame() )
141  && pLayLeaf != this )
142  {
143  // Now we also return "deleted" SectionFrames so they can be
144  // maintained on SaveContent and RestoreContent
145  return pLayLeaf;
146  }
147  else if ( pLayLeaf->Lower() )
148  return static_cast<const SwContentFrame*>(pLayLeaf->Lower());
149 
150  pLayLeaf = pLayLeaf->GetNextLayoutLeaf();
151  if( bNoFootnote && pLayLeaf && pLayLeaf->IsInFootnote() )
152  {
153  do
154  {
155  pLayLeaf = pLayLeaf->GetNextLayoutLeaf();
156  } while( pLayLeaf && pLayLeaf->IsInFootnote() );
157  }
158  if( !IsAnLower( pLayLeaf) )
159  return nullptr;
160  } while( pLayLeaf );
161  return nullptr;
162 }
163 
165 {
166  return IsLayoutFrame() ? static_cast<const SwLayoutFrame*>(this)->Lower() : nullptr;
167 }
168 
170 {
171  return IsLayoutFrame() ? static_cast<SwLayoutFrame*>(this)->Lower() : nullptr;
172 }
173 
175 {
176  if ( GetPrev() && GetPrev()->IsContentFrame() )
177  return static_cast<SwContentFrame*>(GetPrev());
178  else
179  return FindPrevCnt_();
180 }
181 
183 {
184  if ( GetPrev() && GetPrev()->IsContentFrame() )
185  return static_cast<const SwContentFrame*>(GetPrev());
186  else
187  return const_cast<SwFrame*>(this)->FindPrevCnt_();
188 }
189 
190 SwContentFrame *SwFrame::FindNextCnt( const bool _bInSameFootnote )
191 {
192  if ( mpNext && mpNext->IsContentFrame() )
193  return static_cast<SwContentFrame*>(mpNext);
194  else
195  return FindNextCnt_( _bInSameFootnote );
196 }
197 
198 const SwContentFrame *SwFrame::FindNextCnt( const bool _bInSameFootnote ) const
199 {
200  if ( mpNext && mpNext->IsContentFrame() )
201  return static_cast<SwContentFrame*>(mpNext);
202  else
203  return const_cast<SwFrame*>(this)->FindNextCnt_( _bInSameFootnote );
204 }
205 
206 bool SwLayoutFrame::IsAnLower( const SwFrame *pAssumed ) const
207 {
208  const SwFrame *pUp = pAssumed;
209  while ( pUp )
210  {
211  if ( pUp == this )
212  return true;
213  if ( pUp->IsFlyFrame() )
214  pUp = static_cast<const SwFlyFrame*>(pUp)->GetAnchorFrame();
215  else
216  pUp = pUp->GetUpper();
217  }
218  return false;
219 }
220 
233 bool SwLayoutFrame::IsBefore( const SwLayoutFrame* _pCheckRefLayFrame ) const
234 {
235  OSL_ENSURE( !IsRootFrame() , "<IsBefore> called at a <SwRootFrame>.");
236  OSL_ENSURE( !_pCheckRefLayFrame->IsRootFrame() , "<IsBefore> called with a <SwRootFrame>.");
237 
238  bool bReturn;
239 
240  // check, if on different pages
241  const SwPageFrame *pMyPage = FindPageFrame();
242  const SwPageFrame *pCheckRefPage = _pCheckRefLayFrame->FindPageFrame();
243  if( pMyPage != pCheckRefPage )
244  {
245  // being on different page as check reference
246  bReturn = pMyPage->GetPhyPageNum() < pCheckRefPage->GetPhyPageNum();
247  }
248  else
249  {
250  // being on same page as check reference
251  // --> search my supreme parent <pUp>, which doesn't contain check reference.
252  const SwLayoutFrame* pUp = this;
253  while ( pUp->GetUpper() &&
254  !pUp->GetUpper()->IsAnLower( _pCheckRefLayFrame )
255  )
256  pUp = pUp->GetUpper();
257  if( !pUp->GetUpper() )
258  {
259  // can occur, if <this> is a fly frm
260  bReturn = false;
261  }
262  else
263  {
264  // travel through the next's of <pUp> and check if one of these
265  // contain the check reference.
266  const SwLayoutFrame* pUpNext = static_cast<const SwLayoutFrame*>(pUp->GetNext());
267  while ( pUpNext &&
268  !pUpNext->IsAnLower( _pCheckRefLayFrame ) )
269  {
270  pUpNext = static_cast<const SwLayoutFrame*>(pUpNext->GetNext());
271  }
272  bReturn = pUpNext != nullptr;
273  }
274  }
275 
276  return bReturn;
277 }
278 
279 // Local helper functions for GetNextLayoutLeaf
280 
281 static const SwFrame* lcl_FindLayoutFrame( const SwFrame* pFrame, bool bNext )
282 {
283  const SwFrame* pRet = nullptr;
284  if ( pFrame->IsFlyFrame() )
285  pRet = bNext ? static_cast<const SwFlyFrame*>(pFrame)->GetNextLink() : static_cast<const SwFlyFrame*>(pFrame)->GetPrevLink();
286  else
287  pRet = bNext ? pFrame->GetNext() : pFrame->GetPrev();
288 
289  return pRet;
290 }
291 
292 static const SwFrame* lcl_GetLower( const SwFrame* pFrame, bool bFwd )
293 {
294  if ( !pFrame->IsLayoutFrame() )
295  return nullptr;
296 
297  return bFwd ?
298  static_cast<const SwLayoutFrame*>(pFrame)->Lower() :
299  static_cast<const SwLayoutFrame*>(pFrame)->GetLastLower();
300 }
301 
310 {
311  const SwFrame *pFrame = this;
312  const SwLayoutFrame *pLayoutFrame = nullptr;
313  const SwFrame *p = nullptr;
314  bool bGoingUp = !bFwd; // false for forward, true for backward
315  do {
316 
317  bool bGoingFwdOrBwd = false;
318 
319  bool bGoingDown = !bGoingUp;
320  if (bGoingDown)
321  {
322  p = lcl_GetLower( pFrame, bFwd );
323  bGoingDown = nullptr != p;
324  }
325  if ( !bGoingDown )
326  {
327  // I cannot go down, because either I'm currently going up or
328  // because the is no lower.
329  // I'll try to go forward:
330  p = lcl_FindLayoutFrame( pFrame, bFwd );
331  bGoingFwdOrBwd = nullptr != p;
332  if ( !bGoingFwdOrBwd )
333  {
334  // I cannot go forward, because there is no next frame.
335  // I'll try to go up:
336  p = pFrame->GetUpper();
337  bGoingUp = nullptr != p;
338  if ( !bGoingUp )
339  {
340  // I cannot go up, because there is no upper frame.
341  return nullptr;
342  }
343  }
344  }
345 
346  // If I could not go down or forward, I'll have to go up
347  bGoingUp = !bGoingFwdOrBwd && !bGoingDown;
348 
349  pFrame = p;
350  p = lcl_GetLower( pFrame, true );
351 
352  } while( ( p && !p->IsFlowFrame() ) ||
353  pFrame == this ||
354  nullptr == ( pLayoutFrame = pFrame->IsLayoutFrame() ? static_cast<const SwLayoutFrame*>(pFrame) : nullptr ) ||
355  pLayoutFrame->IsAnLower( this ) );
356 
357  return pLayoutFrame;
358 }
359 
371 {
372  const SwFrame *pFrame = this;
373  const SwContentFrame *pContentFrame = nullptr;
374  bool bGoingUp = false;
375  do {
376  const SwFrame *p = nullptr;
377  bool bGoingFwdOrBwd = false;
378 
379  bool bGoingDown = !bGoingUp;
380  if (bGoingDown)
381  {
382  p = lcl_GetLower( pFrame, true ) ;
383  bGoingDown = nullptr != p;
384  }
385  if ( !bGoingDown )
386  {
387  p = lcl_FindLayoutFrame( pFrame, bFwd );
388  bGoingFwdOrBwd = nullptr != p;
389  if ( !bGoingFwdOrBwd )
390  {
391  p = pFrame->GetUpper();
392  bGoingUp = nullptr != p;
393  if ( !bGoingUp )
394  {
395  return nullptr;
396  }
397  }
398  }
399 
400  bGoingUp = !(bGoingFwdOrBwd || bGoingDown);
401  assert(p);
402  if (!bFwd && bGoingDown)
403  {
404  while ( p->GetNext() )
405  p = p->GetNext();
406  }
407 
408  pFrame = p;
409  } while ( nullptr == (pContentFrame = (pFrame->IsContentFrame() ? static_cast<const SwContentFrame*>(pFrame) : nullptr) ));
410 
411  return pContentFrame;
412 }
413 
415 {
416  SwFrame *pRet = this;
417  while ( pRet && !pRet->IsPageFrame() )
418  {
419  if ( pRet->GetUpper() )
420  pRet = pRet->GetUpper();
421  else if ( pRet->IsFlyFrame() )
422  {
423  // #i28701# - use new method <GetPageFrame()>
424  const auto pFly(static_cast<SwFlyFrame*>(pRet));
425  pRet = pFly->GetPageFrame();
426  if (pRet == nullptr)
427  pRet = pFly->AnchorFrame();
428  }
429  else
430  return nullptr;
431  }
432  return static_cast<SwPageFrame*>(pRet);
433 }
434 
436 {
437  SwFrame *pRet = this;
438  // Footnote bosses can't exist inside a table; also sections with columns
439  // don't contain footnote texts there
440  if( pRet->IsInTab() )
441  pRet = pRet->FindTabFrame();
442  while ( pRet && !pRet->IsFootnoteBossFrame() )
443  {
444  if ( pRet->GetUpper() )
445  pRet = pRet->GetUpper();
446  else if ( pRet->IsFlyFrame() )
447  {
448  // #i28701# - use new method <GetPageFrame()>
449  if ( static_cast<SwFlyFrame*>(pRet)->GetPageFrame() )
450  pRet = static_cast<SwFlyFrame*>(pRet)->GetPageFrame();
451  else
452  pRet = static_cast<SwFlyFrame*>(pRet)->AnchorFrame();
453  }
454  else
455  return nullptr;
456  }
457  if( bFootnotes && pRet && pRet->IsColumnFrame() &&
458  !pRet->GetNext() && !pRet->GetPrev() )
459  {
460  SwSectionFrame* pSct = pRet->FindSctFrame();
461  OSL_ENSURE( pSct, "FindFootnoteBossFrame: Single column outside section?" );
462  if( !pSct->IsFootnoteAtEnd() )
463  return pSct->FindFootnoteBossFrame( true );
464  }
465  return static_cast<SwFootnoteBossFrame*>(pRet);
466 }
467 
469 {
470  SwFrame *pRet = this;
471  while ( !pRet->IsTabFrame() )
472  {
473  pRet = pRet->GetUpper();
474  if ( !pRet )
475  return nullptr;
476  }
477  return static_cast<SwTabFrame*>(pRet);
478 }
479 
481 {
482  SwFrame *pRet = this;
483  while ( !pRet->IsSctFrame() )
484  {
485  pRet = pRet->GetUpper();
486  if ( !pRet )
487  return nullptr;
488  }
489  return static_cast<SwSectionFrame*>(pRet);
490 }
491 
493 {
494  const SwFrame *pRet = this;
495  while ( !pRet->IsBodyFrame() )
496  {
497  pRet = pRet->GetUpper();
498  if ( !pRet )
499  return nullptr;
500  }
501  return static_cast<const SwBodyFrame*>(pRet);
502 }
503 
505 {
506  SwFrame *pRet = this;
507  while ( !pRet->IsFootnoteFrame() )
508  {
509  pRet = pRet->GetUpper();
510  if ( !pRet )
511  return nullptr;
512  }
513  return static_cast<SwFootnoteFrame*>(pRet);
514 }
515 
517 {
518  SwFrame *pRet = this;
519  do
520  {
521  if ( pRet->IsFlyFrame() )
522  return static_cast<SwFlyFrame*>(pRet);
523  else
524  pRet = pRet->GetUpper();
525  } while ( pRet );
526  return nullptr;
527 }
528 
530 {
531  SwFrame *pFrame = this;
532  do
533  { pFrame = pFrame->GetUpper();
534  } while ( pFrame && !pFrame->IsColumnFrame() );
535  return pFrame;
536 }
537 
539 {
540  SwFrame *pFrame = this;
541  do
542  { pFrame = pFrame->GetUpper();
543  } while ( pFrame && !pFrame->IsRowFrame() );
544  return dynamic_cast< SwRowFrame* >( pFrame );
545 }
546 
548 {
549  SwFrame* pRet = this;
550  do
551  {
552  if (pRet->GetType() & FRM_HEADFOOT) //header and footer
553  return pRet;
554  else if ( pRet->GetUpper() )
555  pRet = pRet->GetUpper();
556  else if ( pRet->IsFlyFrame() )
557  pRet = static_cast<SwFlyFrame*>(pRet)->AnchorFrame();
558  else
559  return nullptr;
560  } while ( pRet );
561  return pRet;
562 }
563 
565 {
566  const SwFootnoteFrame* pRet = static_cast<const SwFootnoteFrame*>(Lower());
567  if( pRet && !pRet->GetAttr()->GetFootnote().IsEndNote() )
568  return pRet;
569  return nullptr;
570 }
571 
572 const SwPageFrame* SwRootFrame::GetPageAtPos( const Point& rPt, const Size* pSize, bool bExtend ) const
573 {
574  const SwPageFrame* pRet = nullptr;
575 
576  SwRect aRect;
577  if ( pSize )
578  {
579  aRect.Pos() = rPt;
580  aRect.SSize( *pSize );
581  }
582 
583  const SwFrame* pPage = Lower();
584 
585  if ( !bExtend )
586  {
587  if( !getFrameArea().IsInside( rPt ) )
588  return nullptr;
589 
590  // skip pages above point:
591  while( pPage && rPt.Y() > pPage->getFrameArea().Bottom() )
592  pPage = pPage->GetNext();
593  }
594 
595  OSL_ENSURE( GetPageNum() <= maPageRects.size(), "number of pages differs from page rect array size" );
596  size_t nPageIdx = 0;
597 
598  while ( pPage && !pRet )
599  {
600  const SwRect& rBoundRect = bExtend ? maPageRects[ nPageIdx++ ] : pPage->getFrameArea();
601 
602  if ( (!pSize && rBoundRect.IsInside(rPt)) ||
603  (pSize && rBoundRect.IsOver(aRect)) )
604  {
605  pRet = static_cast<const SwPageFrame*>(pPage);
606  }
607 
608  pPage = pPage->GetNext();
609  }
610 
611  return pRet;
612 }
613 
614 bool SwRootFrame::IsBetweenPages(const Point& rPt) const
615 {
616  if (!getFrameArea().IsInside(rPt))
617  return false;
618 
619  // top visible page
620  const SwFrame* pPage = Lower();
621  if (pPage == nullptr)
622  return false;
623 
624  // skip pages above point:
625  while (pPage && rPt.Y() > pPage->getFrameArea().Bottom())
626  pPage = pPage->GetNext();
627 
628  if (pPage &&
629  rPt.X() >= pPage->getFrameArea().Left() &&
630  rPt.X() <= pPage->getFrameArea().Right())
631  {
632  // Trivial case when we're right in between.
633  if (!pPage->getFrameArea().IsInside(rPt))
634  return true;
635 
636  // In normal mode the gap is large enough and
637  // header/footer mouse interaction competes with
638  // handling hide-whitespace within them.
639  // In hide-whitespace, however, the gap is too small
640  // for convenience and there are no headers/footers.
641  const SwViewShell *pSh = GetCurrShell();
642  if (pSh && pSh->GetViewOptions()->IsWhitespaceHidden())
643  {
644  // If we are really close to the bottom or top of a page.
645  const auto toEdge = std::min(std::abs(pPage->getFrameArea().Top() - rPt.Y()),
646  std::abs(pPage->getFrameArea().Bottom() - rPt.Y()));
647  return toEdge <= MmToTwips(2.0);
648  }
649  }
650 
651  return false;
652 }
653 
655 {
656  return GetAttrSet()->GetBreak();
657 }
658 
660 {
661  return GetAttrSet()->GetPageDesc();
662 }
663 
665 {
666  return GetTextNodeFirst()->GetSwAttrSet().GetBreak();
667 }
668 
670 {
672 }
673 
675 {
676  if (IsTextFrame())
677  {
678  return &static_cast<const SwTextFrame*>(this)->GetTextNodeForParaProps()->GetSwAttrSet();
679  }
680  else if (IsNoTextFrame())
681  {
682  return &static_cast<const SwNoTextFrame*>(this)->GetNode()->GetSwAttrSet();
683  }
684  else
685  {
687  return &static_cast<const SwLayoutFrame*>(this)->GetFormat()->GetAttrSet();
688  }
689 }
690 
692 {
693  if (IsTextFrame())
694  {
695  return static_cast<const SwTextFrame*>(this)->GetTextNodeForParaProps()->getSdrAllFillAttributesHelper();
696  }
697  else if (IsNoTextFrame())
698  {
699  return static_cast<const SwNoTextFrame*>(this)->GetNode()->getSdrAllFillAttributesHelper();
700  }
701  else
702  {
703  return static_cast< const SwLayoutFrame* >(this)->GetFormat()->getSdrAllFillAttributesHelper();
704  }
705 }
706 
708 {
709  if (IsContentFrame())
710  {
711  return true;
712  }
713  else
714  {
715  return static_cast< const SwLayoutFrame* >(this)->GetFormat()->supportsFullDrawingLayerFillAttributeSet();
716  }
717 }
718 
719 /*
720  * SwFrame::FindNext_(), FindPrev_(), InvalidateNextPos()
721  * FindNextCnt_() visits tables and sections and only returns SwContentFrames.
722  *
723  * Description Invalidates the position of the next frame.
724  * This is the direct successor or in case of ContentFrames the next
725  * ContentFrame which sits in the same flow as I do:
726  * - body,
727  * - footnote,
728  * - in headers/footers the notification only needs to be forwarded
729  * inside the section
730  * - same for Flys
731  * - Contents in tabs remain only inside their cell
732  * - in principle tables behave exactly like the Contents
733  * - sections also
734  */
735 // This helper function is an equivalent to the ImplGetNextContentFrame() method,
736 // besides ContentFrames this function also returns TabFrames and SectionFrames.
737 static SwFrame* lcl_NextFrame( SwFrame* pFrame )
738 {
739  SwFrame *pRet = nullptr;
740  bool bGoingUp = false;
741  do {
742  SwFrame *p = nullptr;
743 
744  bool bGoingFwd = false;
745  bool bGoingDown = !bGoingUp && pFrame->IsLayoutFrame();
746  if (bGoingDown)
747  {
748  p = static_cast<SwLayoutFrame*>(pFrame)->Lower();
749  bGoingDown = nullptr != p;
750  }
751  if( !bGoingDown )
752  {
753  p = pFrame->IsFlyFrame() ? static_cast<SwFlyFrame*>(pFrame)->GetNextLink() : pFrame->GetNext();
754  bGoingFwd = nullptr != p;
755  if ( !bGoingFwd )
756  {
757  p = pFrame->GetUpper();
758  bGoingUp = nullptr != p;
759  if ( !bGoingUp )
760  {
761  return nullptr;
762  }
763  }
764  }
765  bGoingUp = !(bGoingFwd || bGoingDown);
766  pFrame = p;
767  } while ( nullptr == (pRet = ( ( pFrame->IsContentFrame() || ( !bGoingUp &&
768  ( pFrame->IsTabFrame() || pFrame->IsSctFrame() ) ) )? pFrame : nullptr ) ) );
769  return pRet;
770 }
771 
773 {
774  bool bIgnoreTab = false;
775  SwFrame *pThis = this;
776 
777  if ( IsTabFrame() )
778  {
779  //The last Content of the table gets picked up and his follower is
780  //returned. To be able to deactivate the special case for tables
781  //(see below) bIgnoreTab will be set.
782  if ( static_cast<SwTabFrame*>(this)->GetFollow() )
783  return static_cast<SwTabFrame*>(this)->GetFollow();
784 
785  pThis = static_cast<SwTabFrame*>(this)->FindLastContentOrTable();
786  if ( !pThis )
787  pThis = this;
788  bIgnoreTab = true;
789  }
790  else if ( IsSctFrame() )
791  {
792  //The last Content of the section gets picked and his follower is returned.
793  if ( static_cast<SwSectionFrame*>(this)->GetFollow() )
794  return static_cast<SwSectionFrame*>(this)->GetFollow();
795 
796  pThis = static_cast<SwSectionFrame*>(this)->FindLastContent();
797  if ( !pThis )
798  pThis = this;
799  }
800  else if ( IsContentFrame() )
801  {
802  if( static_cast<SwContentFrame*>(this)->GetFollow() )
803  return static_cast<SwContentFrame*>(this)->GetFollow();
804  }
805  else if ( IsRowFrame() )
806  {
807  SwFrame* pMyUpper = GetUpper();
808  if ( pMyUpper->IsTabFrame() && static_cast<SwTabFrame*>(pMyUpper)->GetFollow() )
809  return static_cast<SwTabFrame*>(pMyUpper)->GetFollow()->GetLower();
810  else return nullptr;
811  }
812  else
813  return nullptr;
814 
815  SwFrame* pRet = nullptr;
816  const bool bFootnote = pThis->IsInFootnote();
817  if ( !bIgnoreTab && pThis->IsInTab() )
818  {
819  SwLayoutFrame *pUp = pThis->GetUpper();
820  while (pUp && !pUp->IsCellFrame())
821  pUp = pUp->GetUpper();
822  assert(pUp && "Content flag says it's in table but it's not in cell.");
823  SwFrame* pNxt = pUp ? static_cast<SwCellFrame*>(pUp)->GetFollowCell() : nullptr;
824  if ( pNxt )
825  pNxt = static_cast<SwCellFrame*>(pNxt)->ContainsContent();
826  if ( !pNxt )
827  {
828  pNxt = lcl_NextFrame( pThis );
829  if (pUp && pUp->IsAnLower(pNxt))
830  pRet = pNxt;
831  }
832  else
833  pRet = pNxt;
834  }
835  else
836  {
837  const bool bBody = pThis->IsInDocBody();
838  SwFrame *pNxtCnt = lcl_NextFrame( pThis );
839  if ( pNxtCnt )
840  {
841  if ( bBody || bFootnote )
842  {
843  while ( pNxtCnt )
844  {
845  // OD 02.04.2003 #108446# - check for endnote, only if found
846  // next content isn't contained in a section, that collect its
847  // endnotes at its end.
848  bool bEndn = IsInSct() && !IsSctFrame() &&
849  ( !pNxtCnt->IsInSct() ||
850  !pNxtCnt->FindSctFrame()->IsEndnAtEnd()
851  );
852  if ( ( bBody && pNxtCnt->IsInDocBody() ) ||
853  ( pNxtCnt->IsInFootnote() &&
854  ( bFootnote ||
855  ( bEndn && pNxtCnt->FindFootnoteFrame()->GetAttr()->GetFootnote().IsEndNote() )
856  )
857  )
858  )
859  {
860  pRet = pNxtCnt->IsInTab() ? pNxtCnt->FindTabFrame()
861  : pNxtCnt;
862  break;
863  }
864  pNxtCnt = lcl_NextFrame( pNxtCnt );
865  }
866  }
867  else if ( pThis->IsInFly() )
868  {
869  pRet = pNxtCnt->IsInTab() ? pNxtCnt->FindTabFrame()
870  : pNxtCnt;
871  }
872  else //footer-/or header section
873  {
874  const SwFrame *pUp = pThis->GetUpper();
875  const SwFrame *pCntUp = pNxtCnt->GetUpper();
876  while ( pUp && pUp->GetUpper() &&
877  !pUp->IsHeaderFrame() && !pUp->IsFooterFrame() )
878  pUp = pUp->GetUpper();
879  while ( pCntUp && pCntUp->GetUpper() &&
880  !pCntUp->IsHeaderFrame() && !pCntUp->IsFooterFrame() )
881  pCntUp = pCntUp->GetUpper();
882  if ( pCntUp == pUp )
883  {
884  pRet = pNxtCnt->IsInTab() ? pNxtCnt->FindTabFrame()
885  : pNxtCnt;
886  }
887  }
888  }
889  }
890  if( pRet && pRet->IsInSct() )
891  {
892  SwSectionFrame* pSct = pRet->FindSctFrame();
893  //Footnotes in frames with columns must not return the section which
894  //contains the footnote
895  if( !pSct->IsAnLower( this ) &&
896  (!bFootnote || pSct->IsInFootnote() ) )
897  return pSct;
898  }
899  return pRet;
900 }
901 
902 // #i27138# - add parameter <_bInSameFootnote>
903 SwContentFrame *SwFrame::FindNextCnt_( const bool _bInSameFootnote )
904 {
905  SwFrame *pThis = this;
906 
907  if ( IsTabFrame() )
908  {
909  if ( static_cast<SwTabFrame*>(this)->GetFollow() )
910  {
911  pThis = static_cast<SwTabFrame*>(this)->GetFollow()->ContainsContent();
912  if( pThis )
913  return static_cast<SwContentFrame*>(pThis);
914  }
915  pThis = static_cast<SwTabFrame*>(this)->FindLastContentOrTable();
916  if ( !pThis )
917  return nullptr;
918  }
919  else if ( IsSctFrame() )
920  {
921  if ( static_cast<SwSectionFrame*>(this)->GetFollow() )
922  {
923  pThis = static_cast<SwSectionFrame*>(this)->GetFollow()->ContainsContent();
924  if( pThis )
925  return static_cast<SwContentFrame*>(pThis);
926  }
927  pThis = static_cast<SwSectionFrame*>(this)->FindLastContent();
928  if ( !pThis )
929  return nullptr;
930  }
931  else if ( IsContentFrame() && static_cast<SwContentFrame*>(this)->GetFollow() )
932  return static_cast<SwContentFrame*>(this)->GetFollow();
933 
934  if ( pThis->IsContentFrame() )
935  {
936  const bool bBody = pThis->IsInDocBody();
937  const bool bFootnote = pThis->IsInFootnote();
938  SwContentFrame *pNxtCnt = static_cast<SwContentFrame*>(pThis)->GetNextContentFrame();
939  if ( pNxtCnt )
940  {
941  // #i27138#
942  if ( bBody || ( bFootnote && !_bInSameFootnote ) )
943  {
944  // handling for environments 'footnotes' and 'document body frames':
945  while ( pNxtCnt )
946  {
947  if ( (bBody && pNxtCnt->IsInDocBody()) ||
948  (bFootnote && pNxtCnt->IsInFootnote()) )
949  return pNxtCnt;
950  pNxtCnt = pNxtCnt->GetNextContentFrame();
951  }
952  }
953  // #i27138#
954  else if ( bFootnote && _bInSameFootnote )
955  {
956  // handling for environments 'each footnote':
957  // Assure that found next content frame belongs to the same footnotes
958  const SwFootnoteFrame* pFootnoteFrameOfNext( pNxtCnt->FindFootnoteFrame() );
959  const SwFootnoteFrame* pFootnoteFrameOfCurr( pThis->FindFootnoteFrame() );
960  OSL_ENSURE( pFootnoteFrameOfCurr,
961  "<SwFrame::FindNextCnt_() - unknown layout situation: current frame has to have an upper footnote frame." );
962  if ( pFootnoteFrameOfNext == pFootnoteFrameOfCurr )
963  {
964  return pNxtCnt;
965  }
966  else if ( pFootnoteFrameOfCurr->GetFollow() )
967  {
968  // next content frame has to be the first content frame
969  // in the follow footnote, which contains a content frame.
970  SwFootnoteFrame* pFollowFootnoteFrameOfCurr(
971  const_cast<SwFootnoteFrame*>(pFootnoteFrameOfCurr) );
972  pNxtCnt = nullptr;
973  do {
974  pFollowFootnoteFrameOfCurr = pFollowFootnoteFrameOfCurr->GetFollow();
975  pNxtCnt = pFollowFootnoteFrameOfCurr->ContainsContent();
976  } while ( !pNxtCnt && pFollowFootnoteFrameOfCurr->GetFollow() );
977  return pNxtCnt;
978  }
979  else
980  {
981  // current content frame is the last content frame in the
982  // footnote - no next content frame exists.
983  return nullptr;
984  }
985  }
986  else if ( pThis->IsInFly() )
987  // handling for environments 'unlinked fly frame' and
988  // 'group of linked fly frames':
989  return pNxtCnt;
990  else
991  {
992  // handling for environments 'page header' and 'page footer':
993  const SwFrame *pUp = pThis->GetUpper();
994  const SwFrame *pCntUp = pNxtCnt->GetUpper();
995  while ( pUp && pUp->GetUpper() &&
996  !pUp->IsHeaderFrame() && !pUp->IsFooterFrame() )
997  pUp = pUp->GetUpper();
998  while ( pCntUp && pCntUp->GetUpper() &&
999  !pCntUp->IsHeaderFrame() && !pCntUp->IsFooterFrame() )
1000  pCntUp = pCntUp->GetUpper();
1001  if ( pCntUp == pUp )
1002  return pNxtCnt;
1003  }
1004  }
1005  }
1006  return nullptr;
1007 }
1008 
1015 {
1016  if ( !IsFlowFrame() )
1017  {
1018  // nothing to do, if current frame isn't a flow frame.
1019  return nullptr;
1020  }
1021 
1022  SwContentFrame* pPrevContentFrame( nullptr );
1023 
1024  // Because method <SwContentFrame::GetPrevContentFrame()> is used to travel
1025  // through the layout, a content frame, at which the travel starts, is needed.
1026  SwContentFrame* pCurrContentFrame = dynamic_cast<SwContentFrame*>(this);
1027 
1028  // perform shortcut, if current frame is a follow, and
1029  // determine <pCurrContentFrame>, if current frame is a table or section frame
1030  if ( pCurrContentFrame && pCurrContentFrame->IsFollow() )
1031  {
1032  // previous content frame is its master content frame
1033  pPrevContentFrame = pCurrContentFrame->FindMaster();
1034  }
1035  else if ( IsTabFrame() )
1036  {
1037  SwTabFrame* pTabFrame( static_cast<SwTabFrame*>(this) );
1038  if ( pTabFrame->IsFollow() )
1039  {
1040  // previous content frame is the last content of its master table frame
1041  pPrevContentFrame = pTabFrame->FindMaster()->FindLastContent();
1042  }
1043  else
1044  {
1045  // start content frame for the search is the first content frame of
1046  // the table frame.
1047  pCurrContentFrame = pTabFrame->ContainsContent();
1048  }
1049  }
1050  else if ( IsSctFrame() )
1051  {
1052  SwSectionFrame* pSectFrame( static_cast<SwSectionFrame*>(this) );
1053  if ( pSectFrame->IsFollow() )
1054  {
1055  // previous content frame is the last content of its master section frame
1056  pPrevContentFrame = pSectFrame->FindMaster()->FindLastContent();
1057  }
1058  else
1059  {
1060  // start content frame for the search is the first content frame of
1061  // the section frame.
1062  pCurrContentFrame = pSectFrame->ContainsContent();
1063  }
1064  }
1065 
1066  // search for next content frame, depending on the environment, in which
1067  // the current frame is in.
1068  if ( !pPrevContentFrame && pCurrContentFrame )
1069  {
1070  pPrevContentFrame = pCurrContentFrame->GetPrevContentFrame();
1071  if ( pPrevContentFrame )
1072  {
1073  if ( pCurrContentFrame->IsInFly() )
1074  {
1075  // handling for environments 'unlinked fly frame' and
1076  // 'group of linked fly frames':
1077  // Nothing to do, <pPrevContentFrame> is the one
1078  }
1079  else
1080  {
1081  const bool bInDocBody = pCurrContentFrame->IsInDocBody();
1082  const bool bInFootnote = pCurrContentFrame->IsInFootnote();
1083  if ( bInDocBody )
1084  {
1085  // handling for environments 'footnotes' and 'document body frames':
1086  // Assure that found previous frame is also in one of these
1087  // environments. Otherwise, travel further
1088  while ( pPrevContentFrame )
1089  {
1090  if ( ( bInDocBody && pPrevContentFrame->IsInDocBody() ) ||
1091  ( bInFootnote && pPrevContentFrame->IsInFootnote() ) )
1092  {
1093  break;
1094  }
1095  pPrevContentFrame = pPrevContentFrame->GetPrevContentFrame();
1096  }
1097  }
1098  else if ( bInFootnote )
1099  {
1100  // handling for environments 'each footnote':
1101  // Assure that found next content frame belongs to the same footnotes
1102  const SwFootnoteFrame* pFootnoteFrameOfPrev( pPrevContentFrame->FindFootnoteFrame() );
1103  const SwFootnoteFrame* pFootnoteFrameOfCurr( pCurrContentFrame->FindFootnoteFrame() );
1104  if ( pFootnoteFrameOfPrev != pFootnoteFrameOfCurr )
1105  {
1106  if ( pFootnoteFrameOfCurr->GetMaster() )
1107  {
1108  SwFootnoteFrame* pMasterFootnoteFrameOfCurr(
1109  const_cast<SwFootnoteFrame*>(pFootnoteFrameOfCurr) );
1110  pPrevContentFrame = nullptr;
1111  // correct wrong loop-condition
1112  do {
1113  pMasterFootnoteFrameOfCurr = pMasterFootnoteFrameOfCurr->GetMaster();
1114  pPrevContentFrame = pMasterFootnoteFrameOfCurr->FindLastContent();
1115  } while ( !pPrevContentFrame &&
1116  pMasterFootnoteFrameOfCurr->GetMaster() );
1117  }
1118  else
1119  {
1120  // current content frame is the first content in the
1121  // footnote - no previous content exists.
1122  pPrevContentFrame = nullptr;
1123  }
1124  }
1125  }
1126  else
1127  {
1128  // handling for environments 'page header' and 'page footer':
1129  // Assure that found previous frame is also in the same
1130  // page header respectively page footer as <pCurrContentFrame>
1131  // Note: At this point it's clear that <pCurrContentFrame> has
1132  // to be inside a page header or page footer and that
1133  // neither <pCurrContentFrame> nor <pPrevContentFrame> are
1134  // inside a fly frame.
1135  // Thus, method <FindFooterOrHeader()> can be used.
1136  OSL_ENSURE( pCurrContentFrame->FindFooterOrHeader(),
1137  "<SwFrame::FindPrevCnt_()> - unknown layout situation: current frame should be in page header or page footer" );
1138  OSL_ENSURE( !pPrevContentFrame->IsInFly(),
1139  "<SwFrame::FindPrevCnt_()> - unknown layout situation: found previous frame should *not* be inside a fly frame." );
1140  if ( pPrevContentFrame->FindFooterOrHeader() !=
1141  pCurrContentFrame->FindFooterOrHeader() )
1142  {
1143  pPrevContentFrame = nullptr;
1144  }
1145  }
1146  }
1147  }
1148  }
1149 
1150  return pPrevContentFrame;
1151 }
1152 
1154 {
1155  bool bIgnoreTab = false;
1156  SwFrame *pThis = this;
1157 
1158  if ( IsTabFrame() )
1159  {
1160  //The first Content of the table gets picked up and his predecessor is
1161  //returned. To be able to deactivate the special case for tables
1162  //(see below) bIgnoreTab will be set.
1163  if ( static_cast<SwTabFrame*>(this)->IsFollow() )
1164  return static_cast<SwTabFrame*>(this)->FindMaster();
1165  else
1166  pThis = static_cast<SwTabFrame*>(this)->ContainsContent();
1167  bIgnoreTab = true;
1168  }
1169 
1170  if ( pThis && pThis->IsContentFrame() )
1171  {
1172  SwContentFrame *pPrvCnt = static_cast<SwContentFrame*>(pThis)->GetPrevContentFrame();
1173  if( !pPrvCnt )
1174  return nullptr;
1175  if ( !bIgnoreTab && pThis->IsInTab() )
1176  {
1177  SwLayoutFrame *pUp = pThis->GetUpper();
1178  while (pUp && !pUp->IsCellFrame())
1179  pUp = pUp->GetUpper();
1180  assert(pUp && "Content flag says it's in table but it's not in cell.");
1181  if (pUp && pUp->IsAnLower(pPrvCnt))
1182  return pPrvCnt;
1183  }
1184  else
1185  {
1186  SwFrame* pRet;
1187  const bool bBody = pThis->IsInDocBody();
1188  const bool bFootnote = !bBody && pThis->IsInFootnote();
1189  if ( bBody || bFootnote )
1190  {
1191  while ( pPrvCnt )
1192  {
1193  if ( (bBody && pPrvCnt->IsInDocBody()) ||
1194  (bFootnote && pPrvCnt->IsInFootnote()) )
1195  {
1196  pRet = pPrvCnt->IsInTab() ? pPrvCnt->FindTabFrame()
1197  : static_cast<SwFrame*>(pPrvCnt);
1198  return pRet;
1199  }
1200  pPrvCnt = pPrvCnt->GetPrevContentFrame();
1201  }
1202  }
1203  else if ( pThis->IsInFly() )
1204  {
1205  pRet = pPrvCnt->IsInTab() ? pPrvCnt->FindTabFrame()
1206  : static_cast<SwFrame*>(pPrvCnt);
1207  return pRet;
1208  }
1209  else // footer or header or Fly
1210  {
1211  const SwFrame *pUp = pThis->GetUpper();
1212  const SwFrame *pCntUp = pPrvCnt->GetUpper();
1213  while ( pUp && pUp->GetUpper() &&
1214  !pUp->IsHeaderFrame() && !pUp->IsFooterFrame() )
1215  pUp = pUp->GetUpper();
1216  while ( pCntUp && pCntUp->GetUpper() )
1217  pCntUp = pCntUp->GetUpper();
1218  if ( pCntUp == pUp )
1219  {
1220  pRet = pPrvCnt->IsInTab() ? pPrvCnt->FindTabFrame()
1221  : static_cast<SwFrame*>(pPrvCnt);
1222  return pRet;
1223  }
1224  }
1225  }
1226  }
1227  return nullptr;
1228 }
1229 
1230 void SwFrame::ImplInvalidateNextPos( bool bNoFootnote )
1231 {
1232  SwFrame *pFrame = FindNext_();
1233  if ( nullptr == pFrame )
1234  return;
1235 
1236  if( pFrame->IsSctFrame() )
1237  {
1238  while( pFrame && pFrame->IsSctFrame() )
1239  {
1240  if( static_cast<SwSectionFrame*>(pFrame)->GetSection() )
1241  {
1242  SwFrame* pTmp = static_cast<SwSectionFrame*>(pFrame)->ContainsAny();
1243  if( pTmp )
1244  pTmp->InvalidatePos();
1245  else if( !bNoFootnote )
1246  static_cast<SwSectionFrame*>(pFrame)->InvalidateFootnotePos();
1247  if( !IsInSct() || FindSctFrame()->GetFollow() != pFrame )
1248  pFrame->InvalidatePos();
1249  return;
1250  }
1251  pFrame = pFrame->FindNext();
1252  }
1253  if( pFrame )
1254  {
1255  if ( pFrame->IsSctFrame())
1256  {
1257  // We need to invalidate the section's content so it gets
1258  // the chance to flow to a different page.
1259  SwFrame* pTmp = static_cast<SwSectionFrame*>(pFrame)->ContainsAny();
1260  if( pTmp )
1261  pTmp->InvalidatePos();
1262  if( !IsInSct() || FindSctFrame()->GetFollow() != pFrame )
1263  pFrame->InvalidatePos();
1264  }
1265  else
1266  pFrame->InvalidatePos();
1267  }
1268  }
1269  else
1270  pFrame->InvalidatePos();
1271 }
1272 
1280 {
1281  // determine next frame
1282  SwFrame* pNextFrame = FindNext();
1283  // skip empty section frames and hidden text frames
1284  {
1285  while ( pNextFrame &&
1286  ( ( pNextFrame->IsSctFrame() &&
1287  !static_cast<SwSectionFrame*>(pNextFrame)->GetSection() ) ||
1288  ( pNextFrame->IsTextFrame() &&
1289  static_cast<SwTextFrame*>(pNextFrame)->IsHiddenNow() ) ) )
1290  {
1291  pNextFrame = pNextFrame->FindNext();
1292  }
1293  }
1294 
1295  // Invalidate printing area of found next frame
1296  if ( !pNextFrame )
1297  return;
1298 
1299  if ( pNextFrame->IsSctFrame() )
1300  {
1301  // Invalidate printing area of found section frame, if
1302  // (1) this text frame isn't in a section OR
1303  // (2) found section frame isn't a follow of the section frame this
1304  // text frame is in.
1305  if ( !IsInSct() || FindSctFrame()->GetFollow() != pNextFrame )
1306  {
1307  pNextFrame->InvalidatePrt();
1308  }
1309 
1310  // Invalidate printing area of first content in found section.
1311  SwFrame* pFstContentOfSctFrame =
1312  static_cast<SwSectionFrame*>(pNextFrame)->ContainsAny();
1313  if ( pFstContentOfSctFrame )
1314  {
1315  pFstContentOfSctFrame->InvalidatePrt();
1316  }
1317  }
1318  else
1319  {
1320  pNextFrame->InvalidatePrt();
1321  }
1322 }
1323 
1326 static bool lcl_IsInSectionDirectly( const SwFrame *pUp )
1327 {
1328  bool bSeenColumn = false;
1329 
1330  while( pUp )
1331  {
1332  if( pUp->IsColumnFrame() )
1333  bSeenColumn = true;
1334  else if( pUp->IsSctFrame() )
1335  {
1336  auto pSection = static_cast<const SwSectionFrame*>(pUp);
1337  const SwFrame* pHeaderFooter = pSection->FindFooterOrHeader();
1338  // When the section frame is not in header/footer:
1339  // Allow move of frame in case our only column is not growable.
1340  // Also allow if there is a previous section frame (to move back).
1341  bool bAllowOutsideHeaderFooter = !pSection->Growable() || pSection->GetPrecede();
1342  return bSeenColumn || (!pHeaderFooter && bAllowOutsideHeaderFooter);
1343  }
1344  else if( pUp->IsTabFrame() )
1345  return false;
1346  pUp = pUp->GetUpper();
1347  }
1348  return false;
1349 }
1350 
1359 bool SwFrame::IsMoveable( const SwLayoutFrame* _pLayoutFrame ) const
1360 {
1361  bool bRetVal = false;
1362 
1363  if ( !_pLayoutFrame )
1364  {
1365  _pLayoutFrame = GetUpper();
1366  }
1367 
1368  if ( _pLayoutFrame && IsFlowFrame() )
1369  {
1370  if ( _pLayoutFrame->IsInSct() && lcl_IsInSectionDirectly( _pLayoutFrame ) )
1371  {
1372  bRetVal = true;
1373  }
1374  else if ( _pLayoutFrame->IsInFly() ||
1375  _pLayoutFrame->IsInDocBody() ||
1376  _pLayoutFrame->IsInFootnote() )
1377  {
1378  // If IsMovable() is called before a MoveFwd() the method
1379  // may return false if there is no NextCellLeaf. If
1380  // IsMovable() is called before a MoveBwd() the method may
1381  // return false if there is no PrevCellLeaf.
1382  if ( _pLayoutFrame->IsInTab() && !IsTabFrame() &&
1383  ( !IsContentFrame() || (!const_cast<SwFrame*>(this)->GetNextCellLeaf()
1384  && !const_cast<SwFrame*>(this)->GetPrevCellLeaf()) )
1385  )
1386  {
1387  bRetVal = false;
1388  }
1389  else
1390  {
1391  if ( _pLayoutFrame->IsInFly() )
1392  {
1393  // if fly frame has a follow (next linked fly frame),
1394  // frame is moveable.
1395  if ( const_cast<SwLayoutFrame*>(_pLayoutFrame)->FindFlyFrame()->GetNextLink() )
1396  {
1397  bRetVal = true;
1398  }
1399  else
1400  {
1401  // if environment is columned, frame is moveable, if
1402  // it isn't in last column.
1403  // search for column frame
1404  const SwFrame* pCol = _pLayoutFrame;
1405  while ( pCol && !pCol->IsColumnFrame() )
1406  {
1407  pCol = pCol->GetUpper();
1408  }
1409  // frame is moveable, if found column frame isn't last one.
1410  if ( pCol && pCol->GetNext() )
1411  {
1412  bRetVal = true;
1413  }
1414  }
1415  }
1416  else if (!(_pLayoutFrame->IsInFootnote() && (IsTabFrame() || IsInTab())))
1417  {
1418  bRetVal = true;
1419  }
1420  }
1421  }
1422  }
1423 
1424  return bRetVal;
1425 }
1426 
1428 {
1429  if ( !IsFlyFrame() && !GetUpper() ) //not yet pasted, no information available
1430  return;
1431 
1433 
1434  SwFrame *pFrame = this;
1435  if( IsFootnoteContFrame() )
1436  mbInfFootnote = true;
1437  do
1438  {
1439  // mbInfBody is only set in the page body, but not in the column body
1440  if ( pFrame->IsBodyFrame() && !mbInfFootnote && pFrame->GetUpper()
1441  && pFrame->GetUpper()->IsPageFrame() )
1442  mbInfBody = true;
1443  else if ( pFrame->IsTabFrame() || pFrame->IsCellFrame() )
1444  {
1445  mbInfTab = true;
1446  }
1447  else if ( pFrame->IsFlyFrame() )
1448  mbInfFly = true;
1449  else if ( pFrame->IsSctFrame() )
1450  mbInfSct = true;
1451  else if ( pFrame->IsFootnoteFrame() )
1452  mbInfFootnote = true;
1453 
1454  pFrame = pFrame->GetUpper();
1455 
1456  } while ( pFrame && !pFrame->IsPageFrame() ); //there is nothing above the page
1457 }
1458 
1464 void SwFrame::SetDirFlags( bool bVert )
1465 {
1466  if( bVert )
1467  {
1468  // OD 2004-01-21 #114969# - if derived, valid vertical flag only if
1469  // vertical flag of upper/anchor is valid.
1470  if( mbDerivedVert )
1471  {
1472  const SwFrame* pAsk = IsFlyFrame() ?
1473  static_cast<SwFlyFrame*>(this)->GetAnchorFrame() : GetUpper();
1474 
1475  OSL_ENSURE( pAsk != this, "Autsch! Stack overflow is about to happen" );
1476 
1477  if( pAsk )
1478  {
1479  mbVertical = pAsk->IsVertical();
1480  mbVertLR = pAsk->IsVertLR();
1481  mbVertLRBT = pAsk->IsVertLRBT();
1482 
1483  if ( !pAsk->mbInvalidVert )
1484  mbInvalidVert = false;
1485 
1486  if ( IsCellFrame() )
1487  {
1488  SwCellFrame* pPrv = static_cast<SwCellFrame*>(this)->GetPreviousCell();
1489  if ( pPrv && !mbVertical && pPrv->IsVertical() )
1490  {
1491  mbVertical = pPrv->IsVertical();
1492  mbVertLR = pPrv->IsVertLR();
1493  mbVertLRBT = pPrv->IsVertLRBT();
1494  }
1495  }
1496  }
1497  }
1498  else
1499  CheckDirection( bVert );
1500  }
1501  else
1502  {
1503  bool bInv = false;
1504  if( !mbDerivedR2L ) // CheckDirection is able to set bDerivedR2L!
1505  CheckDirection( bVert );
1506  if( mbDerivedR2L )
1507  {
1508  const SwFrame* pAsk = IsFlyFrame() ?
1509  static_cast<SwFlyFrame*>(this)->GetAnchorFrame() : GetUpper();
1510 
1511  OSL_ENSURE( pAsk != this, "Oops! Stack overflow is about to happen" );
1512 
1513  if( pAsk )
1514  mbRightToLeft = pAsk->IsRightToLeft();
1515  if( !pAsk || pAsk->mbInvalidR2L )
1516  bInv = mbInvalidR2L;
1517  }
1518  mbInvalidR2L = bInv;
1519  }
1520 }
1521 
1523 {
1524  SwFrame* pTmpFrame = this;
1525  while (pTmpFrame && !pTmpFrame->IsCellFrame())
1526  pTmpFrame = pTmpFrame->GetUpper();
1527 
1528  SAL_WARN_IF(!pTmpFrame, "sw.core", "SwFrame::GetNextCellLeaf() without cell");
1529  return pTmpFrame ? static_cast<SwCellFrame*>(pTmpFrame)->GetFollowCell() : nullptr;
1530 }
1531 
1533 {
1534  SwFrame* pTmpFrame = this;
1535  while (pTmpFrame && !pTmpFrame->IsCellFrame())
1536  pTmpFrame = pTmpFrame->GetUpper();
1537 
1538  SAL_WARN_IF(!pTmpFrame, "sw.core", "SwFrame::GetNextPreviousLeaf() without cell");
1539  return pTmpFrame ? static_cast<SwCellFrame*>(pTmpFrame)->GetPreviousCell() : nullptr;
1540 }
1541 
1543  const SwCellFrame& rOrigCell,
1544  const SwRowFrame& rCorrRow,
1545  bool bInFollow )
1546 {
1547  SwCellFrame* pRet = nullptr;
1548  const SwCellFrame* pCell = static_cast<const SwCellFrame*>(rOrigRow.Lower());
1549  SwCellFrame* pCorrCell = const_cast<SwCellFrame*>(static_cast<const SwCellFrame*>(rCorrRow.Lower()));
1550 
1551  while ( pCell != &rOrigCell && !pCell->IsAnLower( &rOrigCell ) )
1552  {
1553  pCell = static_cast<const SwCellFrame*>(pCell->GetNext());
1554  pCorrCell = static_cast<SwCellFrame*>(pCorrCell->GetNext());
1555  }
1556 
1557  assert(pCell && pCorrCell && "lcl_FindCorrespondingCellFrame does not work");
1558 
1559  if ( pCell != &rOrigCell )
1560  {
1561  // rOrigCell must be a lower of pCell. We need to recurse into the rows:
1562  assert(pCell->Lower() && pCell->Lower()->IsRowFrame() &&
1563  "lcl_FindCorrespondingCellFrame does not work");
1564 
1565  const SwRowFrame* pRow = static_cast<const SwRowFrame*>(pCell->Lower());
1566  while ( !pRow->IsAnLower( &rOrigCell ) )
1567  pRow = static_cast<const SwRowFrame*>(pRow->GetNext());
1568 
1569  SwRowFrame* pCorrRow = nullptr;
1570  if ( bInFollow )
1571  pCorrRow = pRow->GetFollowRow();
1572  else
1573  {
1574  SwRowFrame* pTmpRow = static_cast<SwRowFrame*>(pCorrCell->GetLastLower());
1575 
1576  if ( pTmpRow && pTmpRow->GetFollowRow() == pRow )
1577  pCorrRow = pTmpRow;
1578  }
1579 
1580  if ( pCorrRow )
1581  pRet = lcl_FindCorrespondingCellFrame( *pRow, rOrigCell, *pCorrRow, bInFollow );
1582  }
1583  else
1584  pRet = pCorrCell;
1585 
1586  return pRet;
1587 }
1588 
1589 // VERSION OF GetFollowCell() that assumes that we always have a follow flow line:
1591 {
1592  SwCellFrame* pRet = nullptr;
1593 
1594  // NEW TABLES
1595  // Covered cells do not have follow cells!
1596  const long nRowSpan = GetLayoutRowSpan();
1597  if ( nRowSpan < 1 )
1598  return nullptr;
1599 
1600  // find most upper row frame
1601  const SwFrame* pRow = GetUpper();
1602 
1603  while (pRow && (!pRow->IsRowFrame() || !pRow->GetUpper()->IsTabFrame()))
1604  pRow = pRow->GetUpper();
1605 
1606  if (!pRow)
1607  return nullptr;
1608 
1609  const SwTabFrame* pTabFrame = static_cast<const SwTabFrame*>(pRow->GetUpper());
1610  if (!pTabFrame || !pTabFrame->GetFollow() || !pTabFrame->HasFollowFlowLine())
1611  return nullptr;
1612 
1613  const SwCellFrame* pThisCell = this;
1614 
1615  // Get last cell of the current table frame that belongs to the rowspan:
1616  if ( nRowSpan > 1 )
1617  {
1618  // optimization: Will end of row span be in last row or exceed row?
1619  long nMax = 0;
1620  while ( pRow->GetNext() && ++nMax < nRowSpan )
1621  pRow = pRow->GetNext();
1622 
1623  if ( !pRow->GetNext() )
1624  {
1625  pThisCell = &pThisCell->FindStartEndOfRowSpanCell( false );
1626  pRow = pThisCell->GetUpper();
1627  }
1628  }
1629 
1630  const SwRowFrame* pFollowRow = nullptr;
1631  if ( !pRow->GetNext() &&
1632  nullptr != ( pFollowRow = pRow->IsInSplitTableRow() ) &&
1633  ( !pFollowRow->IsRowSpanLine() || nRowSpan > 1 ) )
1634  pRet = lcl_FindCorrespondingCellFrame( *static_cast<const SwRowFrame*>(pRow), *pThisCell, *pFollowRow, true );
1635 
1636  return pRet;
1637 }
1638 
1639 // VERSION OF GetPreviousCell() THAT ASSUMES THAT WE ALWAYS HAVE A FFL
1641 {
1642  SwCellFrame* pRet = nullptr;
1643 
1644  // NEW TABLES
1645  // Covered cells do not have previous cells!
1646  if ( GetLayoutRowSpan() < 1 )
1647  return nullptr;
1648 
1649  // find most upper row frame
1650  const SwFrame* pRow = GetUpper();
1651  while( !pRow->IsRowFrame() || (pRow->GetUpper() && !pRow->GetUpper()->IsTabFrame()) )
1652  pRow = pRow->GetUpper();
1653 
1654  OSL_ENSURE( pRow->GetUpper() && pRow->GetUpper()->IsTabFrame(), "GetPreviousCell without Table" );
1655 
1656  const SwTabFrame* pTab = static_cast<const SwTabFrame*>(pRow->GetUpper());
1657 
1658  if ( pTab && pTab->IsFollow() )
1659  {
1660  const SwFrame* pTmp = pTab->GetFirstNonHeadlineRow();
1661  const bool bIsInFirstLine = ( pTmp == pRow );
1662 
1663  if ( bIsInFirstLine )
1664  {
1665  SwTabFrame *pMaster = pTab->FindMaster();
1666  if ( pMaster && pMaster->HasFollowFlowLine() )
1667  {
1668  SwRowFrame* pMasterRow = static_cast<SwRowFrame*>(pMaster->GetLastLower());
1669  if ( pMasterRow )
1670  pRet = lcl_FindCorrespondingCellFrame( *static_cast<const SwRowFrame*>(pRow), *this, *pMasterRow, false );
1671  if ( pRet && pRet->GetTabBox()->getRowSpan() < 1 )
1672  pRet = &const_cast<SwCellFrame&>(pRet->FindStartEndOfRowSpanCell( true ));
1673  }
1674  }
1675  }
1676 
1677  return pRet;
1678 }
1679 
1680 // --> NEW TABLES
1682 {
1683  const SwTabFrame* pTableFrame = dynamic_cast<const SwTabFrame*>(GetUpper()->GetUpper());
1684 
1685  if ( !bStart && pTableFrame && pTableFrame->IsFollow() && pTableFrame->IsInHeadline( *this ) )
1686  return *this;
1687 
1688  OSL_ENSURE( pTableFrame &&
1689  ( (bStart && GetTabBox()->getRowSpan() < 1) ||
1690  (!bStart && GetLayoutRowSpan() > 1) ),
1691  "SwCellFrame::FindStartRowSpanCell: No rowspan, no table, no cookies" );
1692 
1693  if ( pTableFrame )
1694  {
1695  const SwTable* pTable = pTableFrame->GetTable();
1696 
1697  sal_uInt16 nMax = USHRT_MAX;
1698  const SwFrame* pCurrentRow = GetUpper();
1699  const bool bDoNotEnterHeadline = bStart && pTableFrame->IsFollow() &&
1700  !pTableFrame->IsInHeadline( *pCurrentRow );
1701 
1702  // check how many rows we are allowed to go up or down until we reach the end of
1703  // the current table frame:
1704  nMax = 0;
1705  while ( bStart ? pCurrentRow->GetPrev() : pCurrentRow->GetNext() )
1706  {
1707  if ( bStart )
1708  {
1709  // do not enter a repeated headline:
1710  if ( bDoNotEnterHeadline && pTableFrame->IsFollow() &&
1711  pTableFrame->IsInHeadline( *pCurrentRow->GetPrev() ) )
1712  break;
1713 
1714  pCurrentRow = pCurrentRow->GetPrev();
1715  }
1716  else
1717  pCurrentRow = pCurrentRow->GetNext();
1718 
1719  ++nMax;
1720  }
1721 
1722  // By passing the nMax value for Find*OfRowSpan (in case of bCurrentTableOnly
1723  // is set) we assure that we find a rMasterBox that has a SwCellFrame in
1724  // the current table frame:
1725  const SwTableBox& rMasterBox = bStart ?
1726  GetTabBox()->FindStartOfRowSpan( *pTable, nMax ) :
1727  GetTabBox()->FindEndOfRowSpan( *pTable, nMax );
1728 
1729  SwIterator<SwCellFrame,SwFormat> aIter( *rMasterBox.GetFrameFormat() );
1730 
1731  for ( SwCellFrame* pMasterCell = aIter.First(); pMasterCell; pMasterCell = aIter.Next() )
1732  {
1733  if ( pMasterCell->GetTabBox() == &rMasterBox )
1734  {
1735  const SwTabFrame* pMasterTable = static_cast<const SwTabFrame*>(pMasterCell->GetUpper()->GetUpper());
1736 
1737  if ( pMasterTable == pTableFrame )
1738  {
1739  return *pMasterCell;
1740  }
1741  }
1742  }
1743  }
1744 
1745  SAL_WARN("sw.core", "SwCellFrame::FindStartRowSpanCell: No result");
1746 
1747  return *this;
1748 }
1749 
1750 // <-- NEW TABLES
1751 
1753 {
1754  OSL_ENSURE( IsInTab(), "IsInSplitTableRow should only be called for frames in tables" );
1755 
1756  const SwFrame* pRow = this;
1757 
1758  // find most upper row frame
1759  while( pRow && ( !pRow->IsRowFrame() || !pRow->GetUpper()->IsTabFrame() ) )
1760  pRow = pRow->GetUpper();
1761 
1762  if ( !pRow ) return nullptr;
1763 
1764  OSL_ENSURE( pRow->GetUpper()->IsTabFrame(), "Confusion in table layout" );
1765 
1766  const SwTabFrame* pTab = static_cast<const SwTabFrame*>(pRow->GetUpper());
1767 
1768  // If most upper row frame is a headline row, the current frame
1769  // can't be in a split table row. Thus, add corresponding condition.
1770  if ( pRow->GetNext() ||
1771  pTab->GetTable()->IsHeadline(
1772  *(static_cast<const SwRowFrame*>(pRow)->GetTabLine()) ) ||
1773  !pTab->HasFollowFlowLine() ||
1774  !pTab->GetFollow() )
1775  return nullptr;
1776 
1777  // skip headline
1778  const SwRowFrame* pFollowRow = pTab->GetFollow()->GetFirstNonHeadlineRow();
1779 
1780  OSL_ENSURE( pFollowRow, "SwFrame::IsInSplitTableRow() does not work" );
1781 
1782  return pFollowRow;
1783 }
1784 
1786 {
1787  OSL_ENSURE( IsInTab(), "IsInSplitTableRow should only be called for frames in tables" );
1788 
1789  // find most upper row frame
1790  const SwFrame* pRow = this;
1791  while( pRow && ( !pRow->IsRowFrame() || !pRow->GetUpper()->IsTabFrame() ) )
1792  pRow = pRow->GetUpper();
1793 
1794  if ( !pRow ) return nullptr;
1795 
1796  OSL_ENSURE( pRow->GetUpper()->IsTabFrame(), "Confusion in table layout" );
1797 
1798  const SwTabFrame* pTab = static_cast<const SwTabFrame*>(pRow->GetUpper());
1799 
1800  const SwTabFrame* pMaster = pTab->IsFollow() ? pTab->FindMaster() : nullptr;
1801 
1802  if ( !pMaster || !pMaster->HasFollowFlowLine() )
1803  return nullptr;
1804 
1805  const SwFrame* pTmp = pTab->GetFirstNonHeadlineRow();
1806  const bool bIsInFirstLine = ( pTmp == pRow );
1807 
1808  if ( !bIsInFirstLine )
1809  return nullptr;
1810 
1811  const SwRowFrame* pMasterRow = static_cast<const SwRowFrame*>(pMaster->GetLastLower());
1812  return pMasterRow;
1813 }
1814 
1816 {
1817  bool bRet = false;
1818 
1819  if ( IsInSct() )
1820  {
1821  const SwSectionFrame* pSectionFrame = FindSctFrame();
1822  if ( pSectionFrame )
1823  bRet = pSectionFrame->IsBalancedSection();
1824  }
1825  return bRet;
1826 }
1827 
1829 {
1830  const SwFrame* pRet = Lower();
1831  if ( !pRet )
1832  return nullptr;
1833  while ( pRet->GetNext() )
1834  pRet = pRet->GetNext();
1835  return pRet;
1836 }
1837 
1838 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool IsAnLower(const SwFrame *) const
Definition: findfrm.cxx:206
SwFrame * FindFooterOrHeader()
Definition: findfrm.cxx:547
SwSectionFrame * FindMaster() const
Definition: flowfrm.cxx:697
Base class of the Writer layout elements.
Definition: frame.hxx:297
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:151
bool mbInfFootnote
Definition: frame.hxx:424
static bool lcl_IsInSectionDirectly(const SwFrame *pUp)
Definition: findfrm.cxx:1326
bool IsFollow() const
Definition: flowfrm.hxx:166
SwFrame * mpNext
Definition: frame.hxx:321
bool IsEndnAtEnd() const
Definition: sectfrm.hxx:148
SwContentFrame * GetNextContentFrame() const
Definition: cntfrm.hxx:98
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:816
bool IsInDocBody() const
Definition: frame.hxx:921
const SwPageFrame * GetPageAtPos(const Point &rPt, const Size *pSize=nullptr, bool bExtend=false) const
Point rPt: The point that should be used to find the page Size pSize: If given, we return the (first)...
Definition: findfrm.cxx:572
bool IsInFly() const
Definition: frame.hxx:939
bool IsRootFrame() const
Definition: frame.hxx:1152
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
Definition: fmtpdsc.hxx:35
bool IsInSct() const
Definition: frame.hxx:945
drawinglayer::attribute::SdrAllFillAttributesHelperPtr getSdrAllFillAttributesHelper() const
Definition: findfrm.cxx:691
bool mbInvalidVert
Definition: frame.hxx:403
SwFootnoteFrame * ImplFindFootnoteFrame()
Definition: findfrm.cxx:504
const SwBodyFrame * ImplFindBodyFrame() const
Definition: findfrm.cxx:492
bool IsBefore(const SwLayoutFrame *_pCheckRefLayFrame) const
method to check relative position of layout frame to a given layout frame.
Definition: findfrm.cxx:233
const SwTable * GetTable() const
Definition: tabfrm.hxx:144
bool IsInFootnote() const
Definition: frame.hxx:927
SwFrameType GetType() const
Definition: frame.hxx:500
SwTabFrame is one table in the document layout, containing rows (which contain cells).
Definition: tabfrm.hxx:30
constexpr T MmToTwips(const double mm)
Definition: swtypes.hxx:57
void InvalidatePos()
Definition: frame.hxx:1021
static const SwFrame * lcl_GetLower(const SwFrame *pFrame, bool bFwd)
Definition: findfrm.cxx:292
void Pos(const Point &rNew)
Definition: swrect.hxx:169
bool IsEndNote() const
Definition: fmtftn.hxx:74
const SwCellFrame & FindStartEndOfRowSpanCell(bool bStart) const
Definition: findfrm.cxx:1681
SwFrame * FindNext()
Definition: frame.hxx:1119
bool IsCellFrame() const
Definition: frame.hxx:1204
bool supportsFullDrawingLayerFillAttributeSet() const
Definition: findfrm.cxx:707
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
virtual const SvxFormatBreakItem & GetBreakItem() const
Definition: findfrm.cxx:654
SwContentFrame * FindFirstBodyContent()
Definition: pagefrm.hxx:337
virtual const SwFormatPageDesc & GetPageDescItem() const
Definition: findfrm.cxx:659
bool mbInfBody
Definition: frame.hxx:421
bool mbVertLR
Definition: frame.hxx:407
bool IsFootnoteFrame() const
Definition: frame.hxx:1180
static bool bFootnote
Definition: insfnote.cxx:33
bool IsVertLRBT() const
Definition: frame.hxx:961
sal_uInt16 GetPhyPageNum() const
Definition: pagefrm.hxx:191
SwSectionFrame * ImplFindSctFrame()
Definition: findfrm.cxx:480
std::vector< SwRect > maPageRects
Definition: rootfrm.hxx:92
bool mbVertLRBT
Definition: frame.hxx:408
bool IsFlyFrame() const
Definition: frame.hxx:1188
void InvalidateNextPrtArea()
method to invalidate printing area of next frame #i11859#
Definition: findfrm.cxx:1279
const SvxFormatBreakItem & GetBreak(bool=true) const
Definition: frmatr.hxx:62
void Top(const long nTop)
Definition: swrect.hxx:204
bool IsMoveable(const SwLayoutFrame *_pLayoutFrame=nullptr) const
determine, if frame is moveable in given environment
Definition: findfrm.cxx:1359
const SwTableBox * GetTabBox() const
Definition: cellfrm.hxx:52
const SwRect & getFrameArea() const
Definition: frame.hxx:177
bool mbInfTab
Definition: frame.hxx:422
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
bool IsInTab() const
Definition: frame.hxx:933
static const SwFrame * lcl_FindLayoutFrame(const SwFrame *pFrame, bool bNext)
Definition: findfrm.cxx:281
SwCellFrame * GetPreviousCell() const
Definition: findfrm.cxx:1640
const SwRowFrame * IsInSplitTableRow() const
Definition: findfrm.cxx:1752
bool IsTextFrame() const
Definition: frame.hxx:1212
std::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr
Definition: format.hxx:38
SwRowFrame * FindRowFrame()
Definition: findfrm.cxx:538
bool mbInfInvalid
Definition: frame.hxx:420
const SwContentFrame * ImplGetNextContentFrame(bool bFwd) const
Walk back inside the tree: grab the subordinate Frame if one exists and the last step was not moving ...
Definition: findfrm.cxx:370
SwContentFrame * GetPrevContentFrame() const
Definition: cntfrm.hxx:106
bool IsSctFrame() const
Definition: frame.hxx:1192
SwFrame * FindPrev_()
Definition: findfrm.cxx:1153
void Right(const long nRight)
Definition: swrect.hxx:200
bool IsFlowFrame() const
Definition: frame.hxx:1220
SwLayoutFrame * GetNextCellLeaf()
Definition: findfrm.cxx:1522
const SwAttrSet * GetAttrSet() const
WARNING: this may not return correct RES_PAGEDESC/RES_BREAK items for SwTextFrame, use GetBreakItem()/GetPageDescItem() instead.
Definition: findfrm.cxx:674
bool IsRowSpanLine() const
Definition: rowfrm.hxx:104
bool IsColumnFrame() const
Definition: frame.hxx:1160
SwContentFrame * FindLastContent()
Definition: tabfrm.cxx:3481
SwFootnoteFrame * FindFootnoteFrame()
Definition: frame.hxx:1085
SwTextNode * GetTextNodeFirst()
Definition: txtfrm.hxx:448
SwTabFrame * ImplFindTabFrame()
Definition: findfrm.cxx:468
void SetDirFlags(bool bVert)
Updates the vertical or the righttoleft-flags.
Definition: findfrm.cxx:1464
bool IsBalancedSection() const
Definition: sectfrm.cxx:2906
SwTabFrame * FindMaster(bool bFirstMaster=false) const
Definition: flowfrm.cxx:717
bool IsContentFrame() const
Definition: frame.hxx:1208
void InvalidatePrt()
Definition: frame.hxx:1014
#define FRM_HEADFOOT
Definition: frame.hxx:106
const SwFrame * GetLastLower() const
Definition: findfrm.cxx:1828
SwFrame * FindNext_()
Definition: findfrm.cxx:772
const SwSectionFrame * GetFollow() const
Definition: sectfrm.hxx:160
SwPageFrame * FindPageFrame()
Definition: frame.hxx:660
const SwLayoutFrame * ImplGetNextLayoutLeaf(bool bFwd) const
Finds the next layout leaf.
Definition: findfrm.cxx:309
const SwFrame * Lower() const
Definition: layfrm.hxx:101
SwContentFrame * FindNextCnt(const bool _bInSameFootnote=false)
Definition: findfrm.cxx:190
bool IsInBalancedSection() const
Definition: findfrm.cxx:1815
bool mbInvalidR2L
Definition: frame.hxx:400
SwLayoutFrame * GetUpper()
Definition: frame.hxx:658
bool mbVertical
Definition: frame.hxx:405
static SwCellFrame * lcl_FindCorrespondingCellFrame(const SwRowFrame &rOrigRow, const SwCellFrame &rOrigCell, const SwRowFrame &rCorrRow, bool bInFollow)
Definition: findfrm.cxx:1542
bool IsRowFrame() const
Definition: frame.hxx:1200
SwFlyFrame * ImplFindFlyFrame()
Definition: findfrm.cxx:516
SwFootnoteBossFrame * FindFootnoteBossFrame(bool bFootnotes=false)
Definition: findfrm.cxx:435
SwFrame * GetPrev()
Definition: frame.hxx:657
const SwRowFrame * IsInFollowFlowRow() const
Definition: findfrm.cxx:1785
bool mbDerivedR2L
Definition: frame.hxx:401
void ImplInvalidateNextPos(bool bNoFootnote)
Definition: findfrm.cxx:1230
SwFrameFormat * GetFrameFormat()
Definition: swtable.hxx:425
SwRowFrame * GetFollowRow() const
Definition: rowfrm.hxx:77
void SSize(const Size &rNew)
Definition: swrect.hxx:178
SwContentFrame * FindLastContent(SwFindMode nMode=SwFindMode::None)
Definition: sectfrm.cxx:907
SwCellFrame * GetFollowCell() const
Definition: findfrm.cxx:1590
A page of the document layout.
Definition: pagefrm.hxx:41
const SwFormatFootnote & GetFootnote() const
Definition: txatbase.hxx:200
virtual const SvxFormatBreakItem & GetBreakItem() const override
Definition: findfrm.cxx:664
SwTable is one table in the document model, containing rows (which contain cells).
Definition: swtable.hxx:110
virtual const SwFormatPageDesc & GetPageDescItem() const override
Definition: findfrm.cxx:669
SwContentFrame * FindNextCnt_(const bool _bInSameFootnote)
method to determine next content frame in the same environment for a flow frame (content frame...
Definition: findfrm.cxx:903
SwSectionFrame * FindSctFrame()
Definition: frame.hxx:1093
SwLayoutFrame * FindBodyCont()
Searches the first ContentFrame in BodyText below the page.
Definition: findfrm.cxx:42
const SwFootnoteFrame * GetMaster() const
Definition: ftnfrm.hxx:119
SwFrame * FindColFrame()
Definition: findfrm.cxx:529
const SwCellFrame * FirstCell() const
Calls ContainsAny first to reach the innermost cell.
Definition: findfrm.cxx:112
bool mbInfSct
Definition: frame.hxx:425
virtual void CheckDirection(bool bVert)
Definition: wsfrm.cxx:389
const SwFootnoteFrame * FindFootNote() const
Definition: findfrm.cxx:564
bool IsLayoutFrame() const
Definition: frame.hxx:1148
void Left(const long nLeft)
Definition: swrect.hxx:195
void Bottom(const long nBottom)
Definition: swrect.hxx:209
bool mbDerivedVert
Definition: frame.hxx:404
SwContentFrame * FindLastBodyContent()
Searches the last ContentFrame in BodyText below the page.
Definition: findfrm.cxx:51
bool IsVertLR() const
Definition: frame.hxx:957
SwContentFrame * FindPrevCnt_()
method to determine previous content frame in the same environment for a flow frame (content frame...
Definition: findfrm.cxx:1014
bool IsTabFrame() const
Definition: frame.hxx:1196
general base class for all free-flowing frames
Definition: flyfrm.hxx:60
SwTableBox & FindStartOfRowSpan(const SwTable &, sal_uInt16 nMaxStep=USHRT_MAX)
SwTableBox::FindStartOfRowSpan(..) returns the "master" cell, the cell which overlaps the given cell...
long getRowSpan() const
Definition: swtable.cxx:100
#define SAL_WARN_IF(condition, area, stream)
SwTextFrame * FindMaster() const
Definition: flowfrm.cxx:681
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:423
const SwFrame * ContainsAny(const bool _bInvestigateFootnoteForSections=false) const
Method doesn't investigate content of footnotes by default.
Definition: findfrm.cxx:125
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:254
bool IsInside(const Point &rPOINT) const
Definition: swrect.cxx:105
const SwFormatPageDesc & GetPageDesc(bool=true) const
Definition: fmtpdsc.hxx:76
bool IsNoTextFrame() const
Definition: frame.hxx:1216
const SwFootnoteFrame * GetFollow() const
Definition: ftnfrm.hxx:116
SwLayoutFrame * GetPrevCellLeaf()
Definition: findfrm.cxx:1532
bool IsRightToLeft() const
Definition: frame.hxx:965
SwTableBox & FindEndOfRowSpan(const SwTable &, sal_uInt16 nMaxStep)
SwTableBox::FindEndOfRowSpan(..) returns the last overlapped cell if there is any.
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:386
SwFrame * GetLower()
Definition: findfrm.cxx:169
bool IsPageFrame() const
Definition: frame.hxx:1156
void * p
const SwTextFootnote * GetAttr() const
Definition: ftnfrm.hxx:122
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
Definition: node.hxx:723
void SetInfFlags()
Definition: findfrm.cxx:1427
const SwTabFrame * GetFollow() const
Definition: tabfrm.hxx:243
bool mbRightToLeft
Definition: frame.hxx:402
bool IsVertical() const
Definition: frame.hxx:951
virtual drawinglayer::attribute::SdrAllFillAttributesHelperPtr getSdrAllFillAttributesHelper() const
Definition: node.cxx:2100
#define SAL_WARN(area, stream)
bool IsFootnoteAtEnd() const
Definition: sectfrm.hxx:147
SwContentFrame * FindPrevCnt()
Definition: findfrm.cxx:174
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame...
Definition: layfrm.hxx:35
bool IsFootnoteBossFrame() const
Definition: frame.hxx:1164
const SwLayoutFrame * GetNextLayoutLeaf() const
Definition: frame.hxx:998
long GetLayoutRowSpan() const
Definition: tabfrm.cxx:5398
bool IsFootnoteContFrame() const
Definition: frame.hxx:1176
SwPageFrame * ImplFindPageFrame()
Definition: findfrm.cxx:414
bool IsOver(const SwRect &rRect) const
Definition: swrect.cxx:123
bool IsWhitespaceHidden() const
Definition: viewopt.hxx:470
const SwContentFrame * ContainsContent() const
Checks if the frame contains one or more ContentFrame's anywhere in his subsidiary structure; if so t...
Definition: findfrm.cxx:66
bool IsBodyFrame() const
Definition: frame.hxx:1184
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:205
static SwFrame * lcl_NextFrame(SwFrame *pFrame)
Definition: findfrm.cxx:737
Container of body content (i.e.
Definition: bodyfrm.hxx:28
bool HasFollowFlowLine() const
Definition: tabfrm.hxx:160
bool mbInfFly
Definition: frame.hxx:423
sal_uInt16 GetPageNum() const
Definition: rootfrm.hxx:308
bool IsFooterFrame() const
Definition: frame.hxx:1172
SwCellFrame is one table cell in the document layout.
Definition: cellfrm.hxx:30
bool IsBetweenPages(const Point &rPt) const
Point rPt: The point to test.
Definition: findfrm.cxx:614
SwRowFrame is one table row in the document layout.
Definition: rowfrm.hxx:28
bool IsHeaderFrame() const
Definition: frame.hxx:1168
bool IsInHeadline(const SwFrame &rFrame) const
Definition: tabfrm.cxx:5444
SwTabFrame * FindTabFrame()
Definition: frame.hxx:1077
SwFrame * GetNext()
Definition: frame.hxx:656
SwContentFrame * FindLastContent()
search for last content in the current footnote frame
Definition: ftnfrm.cxx:2928