LibreOffice Module sw (master)  1
flycnt.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 <sal/log.hxx>
21 #include <svx/swframetypes.hxx>
22 #include <pagefrm.hxx>
23 #include <txtfrm.hxx>
24 #include <notxtfrm.hxx>
25 #include <doc.hxx>
26 #include <pam.hxx>
27 #include <IDocumentUndoRedo.hxx>
30 #include <frmtool.hxx>
31 #include <dflyobj.hxx>
32 #include <hints.hxx>
33 #include <fmtanchr.hxx>
34 #include <fmtornt.hxx>
35 #include <fmtfsize.hxx>
36 #include <fmtsrnd.hxx>
37 #include <txatbase.hxx>
38 
39 #include <tabfrm.hxx>
40 #include <flyfrms.hxx>
41 #include <crstate.hxx>
42 #include <sectfrm.hxx>
43 
45 #include <sortedobjs.hxx>
46 #include <layouter.hxx>
48 #include <HandleAnchorNodeChg.hxx>
49 #include <ndtxt.hxx>
50 
51 using namespace ::com::sun::star;
52 
53 namespace
54 {
55 
56 SwTwips lcl_GetTopForObjPos(const SwContentFrame* pCnt, const bool bVert, const bool bVertL2R)
57 {
58  if ( bVert )
59  {
60  SwTwips aResult = pCnt->getFrameArea().Left();
61  if ( bVertL2R )
63  else
65  return aResult;
66  }
67  else
69 }
70 
71 }
72 
74  SwFlyFreeFrame( pFormat, pSib, pAnch )
75 {
76  m_bAtCnt = true;
77  m_bAutoPosition = (RndStdIds::FLY_AT_CHAR == pFormat->GetAnchor().GetAnchorId());
78 }
79 
80 // #i28701#
81 
82 void SwFlyAtContentFrame::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
83 {
84  auto pLegacy = dynamic_cast<const sw::LegacyModifyHint*>(&rHint);
85  if(!pLegacy)
86  return;
87  const SwFormatAnchor* pAnch = pLegacy->m_pNew ? GetAnchorFromPoolItem(*pLegacy->m_pNew) : nullptr;
88  if(!pAnch)
89  {
90  SwFlyFrame::SwClientNotify(rMod, rHint);
91  return;
92  }
93  OSL_ENSURE(pAnch->GetAnchorId() == GetFormat()->GetAnchor().GetAnchorId(),
94  "Illegal change of anchor type.");
95 
96  //Unregister, get hold of a new anchor and attach it
98  SwPageFrame* pOldPage = FindPageFrame();
99  const SwFrame* pOldAnchor = GetAnchorFrame();
100  SwContentFrame* pContent = const_cast<SwContentFrame*>(static_cast<const SwContentFrame*>(GetAnchorFrame()));
101  AnchorFrame()->RemoveFly(this);
102 
103  const bool bBodyFootnote = (pContent->IsInDocBody() || pContent->IsInFootnote());
104 
105  // Search the new anchor using the NodeIdx; the relation between old
106  // and new NodeIdx determines the search direction
107  const SwNodeIndex aNewIdx(pAnch->GetContentAnchor()->nNode);
108  SwNodeIndex aOldIdx(pContent->IsTextFrame()
109  // sw_redlinehide: can pick any node here, the compare with
110  // FrameContainsNode should catch it
111  ? *static_cast<SwTextFrame *>(pContent)->GetTextNodeFirst()
112  : *static_cast<SwNoTextFrame *>(pContent)->GetNode());
113 
114  //fix: depending on which index was smaller, searching in the do-while
115  //loop previously was done forward or backwards respectively. This however
116  //could lead to an infinite loop. To at least avoid the loop, searching
117  //is now done in only one direction. Getting hold of a frame from the node
118  //is still possible if the new anchor could not be found. Chances are
119  //good that this will be the correct one.
120  // consider the case that at found anchor frame candidate already a
121  // fly frame of the given fly format is registered.
122  // consider, that <pContent> is the already
123  // the new anchor frame.
124  bool bFound(FrameContainsNode(*pContent, aNewIdx.GetIndex()));
125  const bool bNext = !bFound && aOldIdx < aNewIdx;
126  while(pContent && !bFound)
127  {
128  do
129  {
130  if(bNext)
131  pContent = pContent->GetNextContentFrame();
132  else
133  pContent = pContent->GetPrevContentFrame();
134  } while(pContent &&
135  (bBodyFootnote != (pContent->IsInDocBody() || pContent->IsInFootnote())));
136  if(pContent)
137  bFound = FrameContainsNode(*pContent, aNewIdx.GetIndex());
138 
139  // check, if at found anchor frame candidate already a fly frame
140  // of the given fly frame format is registered.
141  if(bFound && pContent && pContent->GetDrawObjs())
142  {
143  SwFrameFormat* pMyFlyFrameFormat(&GetFrameFormat());
144  SwSortedObjs &rObjs = *pContent->GetDrawObjs();
145  for(SwAnchoredObject* rObj : rObjs)
146  {
147  SwFlyFrame* pFlyFrame = dynamic_cast<SwFlyFrame*>(rObj);
148  if (pFlyFrame &&
149  &(pFlyFrame->GetFrameFormat()) == pMyFlyFrameFormat)
150  {
151  bFound = false;
152  break;
153  }
154  }
155  }
156  }
157  if(!pContent)
158  {
159  SwContentNode *pNode = aNewIdx.GetNode().GetContentNode();
160  std::pair<Point, bool> const tmp(pOldAnchor->getFrameArea().Pos(), false);
161  pContent = pNode->getLayoutFrame(getRootFrame(), nullptr, &tmp);
162  OSL_ENSURE(pContent, "New anchor not found");
163  }
164  //Flys are never attached to a follow, but always on the master which
165  //we are going to search now.
166  SwContentFrame* pFlow = pContent;
167  while(pFlow->IsFollow())
168  pFlow = pFlow->FindMaster();
169  pContent = pFlow;
170 
171  //and *puff* it's attached...
172  pContent->AppendFly( this );
173  if(pOldPage && pOldPage != FindPageFrame())
175 
176  //Fix(3495)
177  InvalidatePos_();
178  InvalidatePage();
179  SetNotifyBack();
180  // #i28701# - reset member <maLastCharRect> and
181  // <mnLastTopOfLine> for to-character anchored objects.
183 }
184 
185 //We need some helper classes to monitor the oscillation and a few functions
186 //to not get lost.
187 
188 namespace {
189 
190 // #i3317# - re-factoring of the position stack
191 class SwOszControl
192 {
193  static const SwFlyFrame* s_pStack1;
194  static const SwFlyFrame* s_pStack2;
195  static const SwFlyFrame* s_pStack3;
196  static const SwFlyFrame* s_pStack4;
197  static const SwFlyFrame* s_pStack5;
198 
199  const SwFlyFrame* m_pFly;
200  std::vector<Point> maObjPositions;
201 
202 public:
203  explicit SwOszControl( const SwFlyFrame *pFrame );
204  ~SwOszControl();
205  bool ChkOsz();
206  static bool IsInProgress( const SwFlyFrame *pFly );
207 };
208 
209 }
210 
211 const SwFlyFrame* SwOszControl::s_pStack1 = nullptr;
212 const SwFlyFrame* SwOszControl::s_pStack2 = nullptr;
213 const SwFlyFrame* SwOszControl::s_pStack3 = nullptr;
214 const SwFlyFrame* SwOszControl::s_pStack4 = nullptr;
215 const SwFlyFrame* SwOszControl::s_pStack5 = nullptr;
216 
217 SwOszControl::SwOszControl(const SwFlyFrame* pFrame)
218  : m_pFly(pFrame)
219 {
220  if (!SwOszControl::s_pStack1)
221  SwOszControl::s_pStack1 = m_pFly;
222  else if (!SwOszControl::s_pStack2)
223  SwOszControl::s_pStack2 = m_pFly;
224  else if (!SwOszControl::s_pStack3)
225  SwOszControl::s_pStack3 = m_pFly;
226  else if (!SwOszControl::s_pStack4)
227  SwOszControl::s_pStack4 = m_pFly;
228  else if (!SwOszControl::s_pStack5)
229  SwOszControl::s_pStack5 = m_pFly;
230 }
231 
232 SwOszControl::~SwOszControl()
233 {
234  if (SwOszControl::s_pStack1 == m_pFly)
235  SwOszControl::s_pStack1 = nullptr;
236  else if (SwOszControl::s_pStack2 == m_pFly)
237  SwOszControl::s_pStack2 = nullptr;
238  else if (SwOszControl::s_pStack3 == m_pFly)
239  SwOszControl::s_pStack3 = nullptr;
240  else if (SwOszControl::s_pStack4 == m_pFly)
241  SwOszControl::s_pStack4 = nullptr;
242  else if (SwOszControl::s_pStack5 == m_pFly)
243  SwOszControl::s_pStack5 = nullptr;
244  // #i3317#
245  maObjPositions.clear();
246 }
247 
248 bool SwOszControl::IsInProgress( const SwFlyFrame *pFly )
249 {
250  if (SwOszControl::s_pStack1 && !pFly->IsLowerOf(SwOszControl::s_pStack1))
251  return true;
252  if (SwOszControl::s_pStack2 && !pFly->IsLowerOf(SwOszControl::s_pStack2))
253  return true;
254  if (SwOszControl::s_pStack3 && !pFly->IsLowerOf(SwOszControl::s_pStack3))
255  return true;
256  if (SwOszControl::s_pStack4 && !pFly->IsLowerOf(SwOszControl::s_pStack4))
257  return true;
258  if (SwOszControl::s_pStack5 && !pFly->IsLowerOf(SwOszControl::s_pStack5))
259  return true;
260  return false;
261 }
262 
263 bool SwOszControl::ChkOsz()
264 {
265  bool bOscillationDetected = false;
266 
267  if ( maObjPositions.size() == 20 )
268  {
269  // #i3317# position stack is full -> oscillation
270  bOscillationDetected = true;
271  }
272  else
273  {
274  Point aNewObjPos = m_pFly->GetObjRect().Pos();
275  for ( auto const & pt : maObjPositions )
276  {
277  if ( aNewObjPos == pt )
278  {
279  // position already occurred -> oscillation
280  bOscillationDetected = true;
281  break;
282  }
283  }
284  if ( !bOscillationDetected )
285  {
286  maObjPositions.push_back( aNewObjPos );
287  }
288  }
289 
290  return bOscillationDetected;
291 }
292 
310 {
311  if ( !GetFormat()->GetDoc()->getIDocumentDrawModelAccess().IsVisibleLayerId( GetVirtDrawObj()->GetLayer() ) )
312  {
313  return;
314  }
315 
316  if ( SwOszControl::IsInProgress( this ) || IsLocked() || IsColLocked() )
317  return;
318 
319  // #i28701# - use new method <GetPageFrame()>
320  if( !GetPageFrame() && GetAnchorFrame() && GetAnchorFrame()->IsInFly() )
321  {
322  SwFlyFrame* pFly = AnchorFrame()->FindFlyFrame();
323  SwPageFrame *pTmpPage = pFly ? pFly->FindPageFrame() : nullptr;
324  if( pTmpPage )
325  pTmpPage->AppendFlyToPage( this );
326  }
327  // #i28701# - use new method <GetPageFrame()>
328  if( !GetPageFrame() )
329  return;
330 
332  {
333  SwFlyFrameFormat *pFormat = GetFormat();
334  const SwFormatFrameSize &rFrameSz = GetFormat()->GetFrameSize();
335  if( rFrameSz.GetHeightPercent() != SwFormatFrameSize::SYNCED &&
336  rFrameSz.GetHeightPercent() >= 100 )
337  {
338  pFormat->LockModify();
339  SwFormatSurround aMain( pFormat->GetSurround() );
340  if ( aMain.GetSurround() == css::text::WrapTextMode_NONE )
341  {
342  aMain.SetSurround( css::text::WrapTextMode_THROUGH );
343  pFormat->SetFormatAttr( aMain );
344  }
345  pFormat->UnlockModify();
346  }
347  }
348 
349  SwOszControl aOszCntrl( this );
350 
351  // #i43255#
352  // #i50356# - format the anchor frame, which
353  // contains the anchor position. E.g., for at-character anchored
354  // object this can be the follow frame of the anchor frame.
355  const bool bFormatAnchor =
356  !static_cast<const SwTextFrame*>( GetAnchorFrameContainingAnchPos() )->IsAnyJoinLocked() &&
359 
360  const SwFrame* pFooter = GetAnchorFrame()->FindFooterOrHeader();
361  if( pFooter && !pFooter->IsFooterFrame() )
362  pFooter = nullptr;
363  bool bOsz = false;
364  bool bExtra = Lower() && Lower()->IsColumnFrame();
365  // #i3317# - boolean, to apply temporarily the
366  // 'straightforward positioning process' for the frame due to its
367  // overlapping with a previous column.
368  bool bConsiderWrapInfluenceDueToOverlapPrevCol( false );
369  // #i35911# - boolean, to apply temporarily the
370  // 'straightforward positioning process' for the frame due to fact
371  // that it causes the complete content of its layout environment
372  // to move forward.
373  // #i40444# - extend usage of this boolean:
374  // apply temporarily the 'straightforward positioning process' for
375  // the frame due to the fact that the frame clears the area for
376  // the anchor frame, thus it has to move forward.
377  bool bConsiderWrapInfluenceDueToMovedFwdAnchor( false );
378  do {
379  SwRectFnSet aRectFnSet(this);
380  Point aOldPos( aRectFnSet.GetPos(getFrameArea()) );
381  SwFlyFreeFrame::MakeAll(pRenderContext);
382  const bool bPosChgDueToOwnFormat =
383  aOldPos != aRectFnSet.GetPos(getFrameArea());
384  // #i3317#
387  {
388  bConsiderWrapInfluenceDueToOverlapPrevCol = true;
389  }
390  // #i28701# - no format of anchor frame, if
391  // wrapping style influence is considered on object positioning
392  if ( bFormatAnchor )
393  {
394  SwTextFrame& rAnchPosAnchorFrame =
395  dynamic_cast<SwTextFrame&>(*GetAnchorFrameContainingAnchPos());
396  // #i58182# - For the usage of new method
397  // <SwObjectFormatterTextFrame::CheckMovedFwdCondition(..)>
398  // to check move forward of anchor frame due to the object
399  // positioning it's needed to know, if the object is anchored
400  // at the master frame before the anchor frame is formatted.
401  const bool bAnchoredAtMaster(!rAnchPosAnchorFrame.IsFollow());
402 
403  // #i56300#
404  // perform complete format of anchor text frame and its
405  // previous frames, which have become invalid due to the
406  // fly frame format.
408  // #i35911#
409  // #i40444#
410  // #i58182# - usage of new method
411  // <SwObjectFormatterTextFrame::CheckMovedFwdCondition(..)>
412  sal_uInt32 nToPageNum( 0 );
413  bool bDummy( false );
415  *this, GetPageFrame()->GetPhyPageNum(),
416  bAnchoredAtMaster, nToPageNum, bDummy ) )
417  {
418  bConsiderWrapInfluenceDueToMovedFwdAnchor = true;
419  // mark anchor text frame
420  // directly, that it is moved forward by object positioning.
421  SwTextFrame* pAnchorTextFrame( static_cast<SwTextFrame*>(AnchorFrame()) );
422  bool bInsert( true );
423  sal_uInt32 nAnchorFrameToPageNum( 0 );
424  const SwDoc& rDoc = *(GetFrameFormat().GetDoc());
426  rDoc, *pAnchorTextFrame, nAnchorFrameToPageNum ) )
427  {
428  if ( nAnchorFrameToPageNum < nToPageNum )
429  SwLayouter::RemoveMovedFwdFrame( rDoc, *pAnchorTextFrame );
430  else
431  bInsert = false;
432  }
433  if ( bInsert )
434  {
435  SwLayouter::InsertMovedFwdFrame( rDoc, *pAnchorTextFrame,
436  nToPageNum );
437  }
438  }
439  }
440 
441  if ( aOldPos != aRectFnSet.GetPos(getFrameArea()) ||
443  ( pFooter || bPosChgDueToOwnFormat ) ) )
444  {
445  bOsz = aOszCntrl.ChkOsz();
446 
447  // special loop prevention for dedicated document:
448  if ( bOsz &&
449  HasFixSize() && IsClipped() &&
451  {
452  SwFrameFormat* pFormat = GetFormat();
453  const SwFormatFrameSize& rFrameSz = pFormat->GetFrameSize();
454  if ( rFrameSz.GetWidthPercent() &&
456  {
457  SwFormatSurround aSurround( pFormat->GetSurround() );
458  if ( aSurround.GetSurround() == css::text::WrapTextMode_NONE )
459  {
460  pFormat->LockModify();
461  aSurround.SetSurround( css::text::WrapTextMode_THROUGH );
462  pFormat->SetFormatAttr( aSurround );
463  pFormat->UnlockModify();
464  bOsz = false;
465  OSL_FAIL( "<SwFlyAtContentFrame::MakeAll()> - special loop prevention for dedicated document of b6403541 applied" );
466  }
467  }
468  }
469  }
470 
471  if ( bExtra && Lower() && !Lower()->isFrameAreaPositionValid() )
472  {
473  // If a multi column frame leaves invalid columns because of
474  // a position change, we loop once more and format
475  // our content using FormatWidthCols again.
476  InvalidateSize_();
477  bExtra = false; // Ensure only one additional loop run
478  }
479  } while ( !isFrameAreaDefinitionValid() && !bOsz &&
480  // #i3317#
481  !bConsiderWrapInfluenceDueToOverlapPrevCol &&
482  // #i40444#
483  !bConsiderWrapInfluenceDueToMovedFwdAnchor &&
484  GetFormat()->GetDoc()->getIDocumentDrawModelAccess().IsVisibleLayerId( GetVirtDrawObj()->GetLayer() ) );
485 
486  // #i3317# - instead of attribute change apply
487  // temporarily the 'straightforward positioning process'.
488  // #i80924#
489  // handle special case during splitting of table rows
490  if ( bConsiderWrapInfluenceDueToMovedFwdAnchor &&
491  GetAnchorFrame()->IsInTab() &&
493  {
494  const SwFrame* pCellFrame = GetAnchorFrame();
495  while ( pCellFrame && !pCellFrame->IsCellFrame() )
496  {
497  pCellFrame = pCellFrame->GetUpper();
498  }
499  if ( pCellFrame )
500  {
501  SwRectFnSet aRectFnSet(pCellFrame);
502  if ( aRectFnSet.GetTop(pCellFrame->getFrameArea()) == 0 &&
503  aRectFnSet.GetHeight(pCellFrame->getFrameArea()) == 0 )
504  {
505  bConsiderWrapInfluenceDueToMovedFwdAnchor = false;
506  }
507  }
508  }
509  if ( bOsz || bConsiderWrapInfluenceDueToOverlapPrevCol ||
510  // #i40444#
511  bConsiderWrapInfluenceDueToMovedFwdAnchor )
512  {
514  SetRestartLayoutProcess( true );
516  }
518 }
519 
525 {
527  !SwOszControl::IsInProgress( this );
528 }
529 
530 namespace {
531 
532 class SwDistance
533 {
534 public:
535  SwTwips m_nMain, m_nSub;
536  SwDistance()
537  : m_nMain(0)
538  , m_nSub(0)
539  {
540  }
541  bool operator<( const SwDistance& rTwo ) const
542  {
543  return m_nMain < rTwo.m_nMain
544  || (m_nMain == rTwo.m_nMain && m_nSub && rTwo.m_nSub && m_nSub < rTwo.m_nSub);
545  }
546  bool operator<=( const SwDistance& rTwo ) const
547  {
548  return m_nMain < rTwo.m_nMain
549  || (m_nMain == rTwo.m_nMain
550  && (!m_nSub || !rTwo.m_nSub || m_nSub <= rTwo.m_nSub));
551  }
552 };
553 
554 }
555 
556 static const SwFrame * lcl_CalcDownDist( SwDistance &rRet,
557  const Point &rPt,
558  const SwContentFrame *pCnt )
559 {
560  rRet.m_nSub = 0;
561  //If the point stays inside the Cnt everything is clear already; the Content
562  //automatically has a distance of 0.
563  if ( pCnt->getFrameArea().IsInside( rPt ) )
564  {
565  rRet.m_nMain = 0;
566  return pCnt;
567  }
568  else
569  {
570  const SwLayoutFrame *pUp = pCnt->IsInTab() ? pCnt->FindTabFrame()->GetUpper() : pCnt->GetUpper();
571  // single column sections need to interconnect to their upper
572  while( pUp->IsSctFrame() )
573  pUp = pUp->GetUpper();
574  const bool bVert = pUp->IsVertical();
575 
576  const bool bVertL2R = pUp->IsVertLR();
577 
578  //Follow the text flow.
579  // #i70582#
580  // --> OD 2009-03-05 - adopted for Support for Classical Mongolian Script
581  const SwTwips nTopForObjPos = lcl_GetTopForObjPos(pCnt, bVert, bVertL2R);
582  if ( pUp->getFrameArea().IsInside( rPt ) )
583  {
584  // <rPt> point is inside environment of given content frame
585  // #i70582#
586  if( bVert )
587  {
588  if ( bVertL2R )
589  rRet.m_nMain = rPt.X() - nTopForObjPos;
590  else
591  rRet.m_nMain = nTopForObjPos - rPt.X();
592  }
593  else
594  rRet.m_nMain = rPt.Y() - nTopForObjPos;
595  return pCnt;
596  }
597  else if ( rPt.Y() <= pUp->getFrameArea().Top() )
598  {
599  // <rPt> point is above environment of given content frame
600  // correct for vertical layout?
601  rRet.m_nMain = LONG_MAX;
602  }
603  else if( rPt.X() < pUp->getFrameArea().Left() &&
604  rPt.Y() <= ( bVert ? pUp->getFrameArea().Top() : pUp->getFrameArea().Bottom() ) )
605  {
606  // <rPt> point is left of environment of given content frame
607  // seems not to be correct for vertical layout!?
608  const SwFrame *pLay = pUp->GetLeaf( MAKEPAGE_NONE, false, pCnt );
609  if( !pLay ||
610  (bVert && (pLay->getFrameArea().Top() + pLay->getFramePrintArea().Bottom()) <rPt.Y())||
611  (!bVert && (pLay->getFrameArea().Left() + pLay->getFramePrintArea().Right())<rPt.X()) )
612  {
613  // <rPt> point is in left border of environment
614  // #i70582#
615  if( bVert )
616  {
617  if ( bVertL2R )
618  rRet.m_nMain = rPt.X() - nTopForObjPos;
619  else
620  rRet.m_nMain = nTopForObjPos - rPt.X();
621  }
622  else
623  rRet.m_nMain = rPt.Y() - nTopForObjPos;
624  return pCnt;
625  }
626  else
627  rRet.m_nMain = LONG_MAX;
628  }
629  else
630  {
631  rRet.m_nMain
632  = bVert ? (bVertL2R
633  ? ((pUp->getFrameArea().Left() + pUp->getFramePrintArea().Right())
634  - nTopForObjPos)
635  : (nTopForObjPos
636  - (pUp->getFrameArea().Left() + pUp->getFramePrintArea().Left())))
637  : ((pUp->getFrameArea().Top() + pUp->getFramePrintArea().Bottom())
638  - nTopForObjPos);
639 
640  const SwFrame *pPre = pCnt;
641  const SwFrame *pLay = pUp->GetLeaf( MAKEPAGE_NONE, true, pCnt );
642  SwTwips nFrameTop = 0;
643  SwTwips nPrtHeight = 0;
644  bool bSct = false;
645  const SwSectionFrame *pSect = pUp->FindSctFrame();
646  if( pSect )
647  {
648  rRet.m_nSub = rRet.m_nMain;
649  rRet.m_nMain = 0;
650  }
651  if( pSect && !pSect->IsAnLower( pLay ) )
652  {
653  bSct = false;
654  const SwSectionFrame* pNxtSect = pLay ? pLay->FindSctFrame() : nullptr;
655  if (pSect->IsAnFollow(pNxtSect) && pLay)
656  {
657  if( pLay->IsVertical() )
658  {
659  if ( pLay->IsVertLR() )
660  nFrameTop = pLay->getFrameArea().Left();
661  else
662  nFrameTop = pLay->getFrameArea().Left() + pLay->getFrameArea().Width();
663  nPrtHeight = pLay->getFramePrintArea().Width();
664  }
665  else
666  {
667  nFrameTop = pLay->getFrameArea().Top();
668  nPrtHeight = pLay->getFramePrintArea().Height();
669  }
670  pSect = pNxtSect;
671  }
672  else
673  {
674  pLay = pSect->GetUpper();
675  if( pLay->IsVertical() )
676  {
677  if ( pLay->IsVertLR() )
678  {
679  nFrameTop = pSect->getFrameArea().Right();
680  nPrtHeight = pLay->getFrameArea().Left() + pLay->getFramePrintArea().Left()
681  + pLay->getFramePrintArea().Width() - pSect->getFrameArea().Left()
682  - pSect->getFrameArea().Width();
683  }
684  else
685  {
686  nFrameTop = pSect->getFrameArea().Left();
687  nPrtHeight = pSect->getFrameArea().Left() - pLay->getFrameArea().Left()
688  - pLay->getFramePrintArea().Left();
689  }
690  }
691  else
692  {
693  nFrameTop = pSect->getFrameArea().Bottom();
694  nPrtHeight = pLay->getFrameArea().Top() + pLay->getFramePrintArea().Top()
695  + pLay->getFramePrintArea().Height() - pSect->getFrameArea().Top()
696  - pSect->getFrameArea().Height();
697  }
698  pSect = nullptr;
699  }
700  }
701  else if( pLay )
702  {
703  if( pLay->IsVertical() )
704  {
705  if ( pLay->IsVertLR() )
706  {
707  nFrameTop = pLay->getFrameArea().Left();
708  nPrtHeight = pLay->getFramePrintArea().Width();
709  }
710  else
711  {
712  nFrameTop = pLay->getFrameArea().Left() + pLay->getFrameArea().Width();
713  nPrtHeight = pLay->getFramePrintArea().Width();
714  }
715  }
716  else
717  {
718  nFrameTop = pLay->getFrameArea().Top();
719  nPrtHeight = pLay->getFramePrintArea().Height();
720  }
721  bSct = nullptr != pSect;
722  }
723  while ( pLay && !pLay->getFrameArea().IsInside( rPt ) &&
724  ( pLay->getFrameArea().Top() <= rPt.Y() || pLay->IsInFly() ||
725  ( pLay->IsInSct() &&
726  pLay->FindSctFrame()->GetUpper()->getFrameArea().Top() <= rPt.Y())) )
727  {
728  if ( pLay->IsFootnoteContFrame() )
729  {
730  if ( !static_cast<const SwLayoutFrame*>(pLay)->Lower() )
731  {
732  SwFrame *pDel = const_cast<SwFrame*>(pLay);
733  pDel->Cut();
734  SwFrame::DestroyFrame(pDel);
735  return pPre;
736  }
737  return nullptr;
738  }
739  else
740  {
741  if( bSct || pSect )
742  rRet.m_nSub += nPrtHeight;
743  else
744  rRet.m_nMain += nPrtHeight;
745  pPre = pLay;
746  pLay = pLay->GetLeaf( MAKEPAGE_NONE, true, pCnt );
747  if( pSect && !pSect->IsAnLower( pLay ) )
748  { // If we're leaving a SwSectionFrame, the next Leaf-Frame
749  // is the part of the upper below the SectionFrame.
750  const SwSectionFrame* pNxtSect = pLay ?
751  pLay->FindSctFrame() : nullptr;
752  bSct = false;
753  if (pLay && pSect->IsAnFollow(pNxtSect))
754  {
755  pSect = pNxtSect;
756  if( pLay->IsVertical() )
757  {
758  if ( pLay->IsVertLR() )
759  {
760  nFrameTop = pLay->getFrameArea().Left();
761  nPrtHeight = pLay->getFramePrintArea().Width();
762  }
763  else
764  {
765  nFrameTop = pLay->getFrameArea().Left() + pLay->getFrameArea().Width();
766  nPrtHeight = pLay->getFramePrintArea().Width();
767  }
768  }
769  else
770  {
771  nFrameTop = pLay->getFrameArea().Top();
772  nPrtHeight = pLay->getFramePrintArea().Height();
773  }
774  }
775  else
776  {
777  pLay = pSect->GetUpper();
778  if( pLay->IsVertical() )
779  {
780  if ( pLay->IsVertLR() )
781  {
782  nFrameTop = pSect->getFrameArea().Right();
783  nPrtHeight = pLay->getFrameArea().Left()+pLay->getFramePrintArea().Left()
784  + pLay->getFramePrintArea().Width() - pSect->getFrameArea().Left()
785  - pSect->getFrameArea().Width();
786  }
787  else
788  {
789  nFrameTop = pSect->getFrameArea().Left();
790  nPrtHeight = pSect->getFrameArea().Left() -
791  pLay->getFrameArea().Left() - pLay->getFramePrintArea().Left();
792  }
793  }
794  else
795  {
796  nFrameTop = pSect->getFrameArea().Bottom();
797  nPrtHeight = pLay->getFrameArea().Top()+pLay->getFramePrintArea().Top()
798  + pLay->getFramePrintArea().Height() - pSect->getFrameArea().Top()
799  - pSect->getFrameArea().Height();
800  }
801  pSect = nullptr;
802  }
803  }
804  else if( pLay )
805  {
806  if( pLay->IsVertical() )
807  {
808  if ( pLay->IsVertLR() )
809  {
810  nFrameTop = pLay->getFrameArea().Left();
811  nPrtHeight = pLay->getFramePrintArea().Width();
812  }
813  else
814  {
815  nFrameTop = pLay->getFrameArea().Left() + pLay->getFrameArea().Width();
816  nPrtHeight = pLay->getFramePrintArea().Width();
817  }
818  }
819  else
820  {
821  nFrameTop = pLay->getFrameArea().Top();
822  nPrtHeight = pLay->getFramePrintArea().Height();
823  }
824  bSct = nullptr != pSect;
825  }
826  }
827  }
828  if ( pLay )
829  {
830  if ( pLay->getFrameArea().IsInside( rPt ) )
831  {
832  SwTwips nDiff = pLay->IsVertical() ? ( pLay->IsVertLR() ? ( rPt.X() - nFrameTop ) : ( nFrameTop - rPt.X() ) )
833  : ( rPt.Y() - nFrameTop );
834  if( bSct || pSect )
835  rRet.m_nSub += nDiff;
836  else
837  rRet.m_nMain += nDiff;
838  }
839  if ( pLay->IsFootnoteContFrame() && !static_cast<const SwLayoutFrame*>(pLay)->Lower() )
840  {
841  SwFrame *pDel = const_cast<SwFrame*>(pLay);
842  pDel->Cut();
843  SwFrame::DestroyFrame(pDel);
844  return nullptr;
845  }
846  return pLay;
847  }
848  else
849  rRet.m_nMain = LONG_MAX;
850  }
851  }
852  return nullptr;
853 }
854 
855 static sal_uInt64 lcl_FindCntDiff( const Point &rPt, const SwLayoutFrame *pLay,
856  const SwContentFrame *& rpCnt,
857  const bool bBody, const bool bFootnote )
858 {
859  // Searches below pLay the nearest Cnt to the point. The reference point of
860  //the Contents is always the left upper corner.
861  //The Cnt should preferably be above the point.
862 
863  rpCnt = nullptr;
864  sal_uInt64 nDistance = SAL_MAX_UINT64;
865  sal_uInt64 nNearest = SAL_MAX_UINT64;
866  const SwContentFrame *pCnt = pLay ? pLay->ContainsContent() : nullptr;
867 
868  while ( pCnt && (bBody != pCnt->IsInDocBody() || bFootnote != pCnt->IsInFootnote()))
869  {
870  pCnt = pCnt->GetNextContentFrame();
871  if ( !pLay->IsAnLower( pCnt ) )
872  pCnt = nullptr;
873  }
874  const SwContentFrame *pNearest = pCnt;
875  if ( pCnt )
876  {
877  do
878  {
879  //Calculate the distance between those two points.
880  //'delta' X^2 + 'delta' Y^2 = 'distance'^2
881  sal_uInt64 dX = std::max( pCnt->getFrameArea().Left(), rPt.X() ) -
882  std::min( pCnt->getFrameArea().Left(), rPt.X() ),
883  dY = std::max( pCnt->getFrameArea().Top(), rPt.Y() ) -
884  std::min( pCnt->getFrameArea().Top(), rPt.Y() );
885  // square of the difference will do fine here
886  const sal_uInt64 nDiff = (dX * dX) + (dY * dY);
887  if ( pCnt->getFrameArea().Top() <= rPt.Y() )
888  {
889  if ( nDiff < nDistance )
890  {
891  //This one is the nearer one
892  nDistance = nNearest = nDiff;
893  rpCnt = pNearest = pCnt;
894  }
895  }
896  else if ( nDiff < nNearest )
897  {
898  nNearest = nDiff;
899  pNearest = pCnt;
900  }
901  pCnt = pCnt->GetNextContentFrame();
902  while ( pCnt &&
903  (bBody != pCnt->IsInDocBody() || bFootnote != pCnt->IsInFootnote()))
904  pCnt = pCnt->GetNextContentFrame();
905 
906  } while ( pCnt && pLay->IsAnLower( pCnt ) );
907  }
908  if (nDistance == SAL_MAX_UINT64)
909  { rpCnt = pNearest;
910  return nNearest;
911  }
912  return nDistance;
913 }
914 
915 static const SwContentFrame * lcl_FindCnt( const Point &rPt, const SwContentFrame *pCnt,
916  const bool bBody, const bool bFootnote )
917 {
918  //Starting from pCnt searches the ContentFrame whose left upper corner is the
919  //nearest to the point.
920  //Always returns a ContentFrame.
921 
922  //First the nearest Content inside the page which contains the Content is
923  //searched. Starting from this page the pages in both directions need to
924  //be considered. If possible a Content is returned whose Y-position is
925  //above the point.
926  const SwContentFrame *pRet, *pNew;
927  const SwLayoutFrame *pLay = pCnt->FindPageFrame();
928  sal_uInt64 nDist; // not sure if a sal_Int32 would be enough?
929 
930  nDist = ::lcl_FindCntDiff( rPt, pLay, pNew, bBody, bFootnote );
931  if ( pNew )
932  pRet = pNew;
933  else
934  { pRet = pCnt;
935  nDist = SAL_MAX_UINT64;
936  }
937  const SwContentFrame *pNearest = pRet;
938  sal_uInt64 nNearest = nDist;
939 
940  if ( pLay )
941  {
942  const SwLayoutFrame *pPge = pLay;
943  sal_uInt64 nOldNew = SAL_MAX_UINT64;
944  for ( int i = 0; pPge->GetPrev() && (i < 3); ++i )
945  {
946  pPge = static_cast<const SwLayoutFrame*>(pPge->GetPrev());
947  const sal_uInt64 nNew = ::lcl_FindCntDiff( rPt, pPge, pNew, bBody, bFootnote );
948  if ( nNew < nDist )
949  {
950  if ( pNew->getFrameArea().Top() <= rPt.Y() )
951  {
952  pRet = pNearest = pNew;
953  nDist = nNearest = nNew;
954  }
955  else if ( nNew < nNearest )
956  {
957  pNearest = pNew;
958  nNearest = nNew;
959  }
960  }
961  else if (nOldNew != SAL_MAX_UINT64 && nNew > nOldNew)
962  break;
963  else
964  nOldNew = nNew;
965 
966  }
967  pPge = pLay;
968  nOldNew = SAL_MAX_UINT64;
969  for ( int j = 0; pPge->GetNext() && (j < 3); ++j )
970  {
971  pPge = static_cast<const SwLayoutFrame*>(pPge->GetNext());
972  const sal_uInt64 nNew = ::lcl_FindCntDiff( rPt, pPge, pNew, bBody, bFootnote );
973  if ( nNew < nDist )
974  {
975  if ( pNew->getFrameArea().Top() <= rPt.Y() )
976  {
977  pRet = pNearest = pNew;
978  nDist = nNearest = nNew;
979  }
980  else if ( nNew < nNearest )
981  {
982  pNearest = pNew;
983  nNearest = nNew;
984  }
985  }
986  else if (nOldNew != SAL_MAX_UINT64 && nNew > nOldNew)
987  break;
988  else
989  nOldNew = nNew;
990  }
991  }
992  if ( pRet->getFrameArea().Top() > rPt.Y() )
993  return pNearest;
994  else
995  return pRet;
996 }
997 
998 static void lcl_PointToPrt( Point &rPoint, const SwFrame *pFrame )
999 {
1000  SwRect aTmp( pFrame->getFramePrintArea() );
1001  aTmp += pFrame->getFrameArea().Pos();
1002  if ( rPoint.getX() < aTmp.Left() )
1003  rPoint.setX(aTmp.Left());
1004  else if ( rPoint.getX() > aTmp.Right() )
1005  rPoint.setX(aTmp.Right());
1006  if ( rPoint.getY() < aTmp.Top() )
1007  rPoint.setY(aTmp.Top());
1008  else if ( rPoint.getY() > aTmp.Bottom() )
1009  rPoint.setY(aTmp.Bottom());
1010 
1011 }
1012 
1018 const SwContentFrame *FindAnchor( const SwFrame *pOldAnch, const Point &rNew,
1019  const bool bBodyOnly )
1020 {
1021  //Search the nearest Cnt around the given document position in the text
1022  //flow. The given anchor is the starting Frame.
1023  const SwContentFrame* pCnt;
1024  if ( pOldAnch->IsContentFrame() )
1025  {
1026  pCnt = static_cast<const SwContentFrame*>(pOldAnch);
1027  }
1028  else
1029  {
1030  Point aTmp( rNew );
1031  const SwLayoutFrame *pTmpLay = static_cast<const SwLayoutFrame*>(pOldAnch);
1032  if( pTmpLay->IsRootFrame() )
1033  {
1034  SwRect aTmpRect( aTmp, Size(0,0) );
1035  pTmpLay = static_cast<const SwLayoutFrame*>(::FindPage( aTmpRect, pTmpLay->Lower() ));
1036  }
1037  pCnt = pTmpLay->GetContentPos( aTmp, false, bBodyOnly );
1038  }
1039 
1040  //Take care to use meaningful ranges during search. This means to not enter
1041  //or leave header/footer in this case.
1042  const bool bBody = pCnt->IsInDocBody() || bBodyOnly;
1043  const bool bFootnote = !bBodyOnly && pCnt->IsInFootnote();
1044 
1045  Point aNew( rNew );
1046  if ( bBody )
1047  {
1048  //#38848 drag from page margin into the body.
1049  const SwFrame *pPage = pCnt->FindPageFrame();
1050  ::lcl_PointToPrt( aNew, pPage->GetUpper() );
1051  SwRect aTmp( aNew, Size( 0, 0 ) );
1052  pPage = ::FindPage( aTmp, pPage );
1053  ::lcl_PointToPrt( aNew, pPage );
1054  }
1055 
1056  if ( pCnt->IsInDocBody() == bBody && pCnt->getFrameArea().IsInside( aNew ) )
1057  return pCnt;
1058  else if ( pOldAnch->IsInDocBody() || pOldAnch->IsPageFrame() )
1059  {
1060  // Maybe the selected anchor is on the same page as the current anchor.
1061  // With this we won't run into problems with the columns.
1062  Point aTmp( aNew );
1063  const SwContentFrame *pTmp = pCnt->FindPageFrame()->
1064  GetContentPos( aTmp, false, true );
1065  if ( pTmp && pTmp->getFrameArea().IsInside( aNew ) )
1066  return pTmp;
1067  }
1068 
1069  //Starting from the anchor we now search in both directions until we found
1070  //the nearest one respectively.
1071  //Not the direct distance is relevant but the distance which needs to be
1072  //traveled through the text flow.
1073  const SwContentFrame *pUpLst;
1074  const SwContentFrame *pUpFrame = pCnt;
1075  SwDistance nUp, nUpLst;
1076  ::lcl_CalcDownDist( nUp, aNew, pUpFrame );
1077  SwDistance nDown = nUp;
1078  bool bNegAllowed = true;// Make it possible to leave the negative section once.
1079  do
1080  {
1081  pUpLst = pUpFrame; nUpLst = nUp;
1082  pUpFrame = pUpLst->GetPrevContentFrame();
1083  while ( pUpFrame &&
1084  (bBody != pUpFrame->IsInDocBody() || bFootnote != pUpFrame->IsInFootnote()))
1085  pUpFrame = pUpFrame->GetPrevContentFrame();
1086  if ( pUpFrame )
1087  {
1088  ::lcl_CalcDownDist( nUp, aNew, pUpFrame );
1089  //It makes sense to search further, if the distance grows inside
1090  //a table.
1091  if ( pUpLst->IsInTab() && pUpFrame->IsInTab() )
1092  {
1093  while ( pUpFrame && ((nUpLst < nUp && pUpFrame->IsInTab()) ||
1094  bBody != pUpFrame->IsInDocBody()) )
1095  {
1096  pUpFrame = pUpFrame->GetPrevContentFrame();
1097  if ( pUpFrame )
1098  ::lcl_CalcDownDist( nUp, aNew, pUpFrame );
1099  }
1100  }
1101  }
1102  if ( !pUpFrame )
1103  nUp.m_nMain = LONG_MAX;
1104  if (nUp.m_nMain >= 0 && LONG_MAX != nUp.m_nMain)
1105  {
1106  bNegAllowed = false;
1107  if (nUpLst.m_nMain < 0) //don't take the wrong one, if the value
1108  //just changed from negative to positive.
1109  { pUpLst = pUpFrame;
1110  nUpLst = nUp;
1111  }
1112  }
1113  } while (pUpFrame && ((bNegAllowed && nUp.m_nMain < 0) || (nUp <= nUpLst)));
1114 
1115  const SwContentFrame *pDownLst;
1116  const SwContentFrame *pDownFrame = pCnt;
1117  SwDistance nDownLst;
1118  if (nDown.m_nMain < 0)
1119  nDown.m_nMain = LONG_MAX;
1120  do
1121  {
1122  pDownLst = pDownFrame; nDownLst = nDown;
1123  pDownFrame = pDownLst->GetNextContentFrame();
1124  while ( pDownFrame &&
1125  (bBody != pDownFrame->IsInDocBody() || bFootnote != pDownFrame->IsInFootnote()))
1126  pDownFrame = pDownFrame->GetNextContentFrame();
1127  if ( pDownFrame )
1128  {
1129  ::lcl_CalcDownDist( nDown, aNew, pDownFrame );
1130  if (nDown.m_nMain < 0)
1131  nDown.m_nMain = LONG_MAX;
1132  //It makes sense to search further, if the distance grows inside
1133  //a table.
1134  if ( pDownLst->IsInTab() && pDownFrame->IsInTab() )
1135  {
1136  while (pDownFrame
1137  && ((nDown.m_nMain != LONG_MAX && pDownFrame->IsInTab())
1138  || bBody != pDownFrame->IsInDocBody()))
1139  {
1140  pDownFrame = pDownFrame->GetNextContentFrame();
1141  if ( pDownFrame )
1142  ::lcl_CalcDownDist( nDown, aNew, pDownFrame );
1143  if (nDown.m_nMain < 0)
1144  nDown.m_nMain = LONG_MAX;
1145  }
1146  }
1147  }
1148  if ( !pDownFrame )
1149  nDown.m_nMain = LONG_MAX;
1150 
1151  } while (pDownFrame && nDown <= nDownLst && nDown.m_nMain != LONG_MAX
1152  && nDownLst.m_nMain != LONG_MAX);
1153 
1154  //If we couldn't find one in both directions, we'll search the Content whose
1155  //left upper corner is the nearest to the point. Such a situation may
1156  //happen, if the point doesn't lay in the text flow but in any margin.
1157  if (nDownLst.m_nMain == LONG_MAX && nUpLst.m_nMain == LONG_MAX)
1158  {
1159  // If an OLE objects, which is contained in a fly frame
1160  // is resized in inplace mode and the new Position is outside the
1161  // fly frame, we do not want to leave our fly frame.
1162  if ( pCnt->IsInFly() )
1163  return pCnt;
1164 
1165  return ::lcl_FindCnt( aNew, pCnt, bBody, bFootnote );
1166  }
1167  else
1168  return nDownLst < nUpLst ? pDownLst : pUpLst;
1169 }
1170 
1171 void SwFlyAtContentFrame::SetAbsPos( const Point &rNew )
1172 {
1173  SwPageFrame *pOldPage = FindPageFrame();
1174  const SwRect aOld( GetObjRectWithSpaces() );
1175  Point aNew( rNew );
1176 
1178  aNew.setX(aNew.getX() + getFrameArea().Width());
1179  SwContentFrame *pCnt = const_cast<SwContentFrame*>(::FindAnchor( GetAnchorFrame(), aNew ));
1180  if( pCnt->IsProtected() )
1181  pCnt = const_cast<SwContentFrame*>(static_cast<const SwContentFrame*>(GetAnchorFrame()));
1182 
1183  SwPageFrame *pTmpPage = nullptr;
1184  const bool bVert = pCnt->IsVertical();
1185 
1186  const bool bVertL2R = pCnt->IsVertLR();
1187  const bool bRTL = pCnt->IsRightToLeft();
1188 
1189  if( ( !bVert != !GetAnchorFrame()->IsVertical() ) ||
1190  ( !bRTL != !GetAnchorFrame()->IsRightToLeft() ) )
1191  {
1192  if( bVert || bRTL )
1193  aNew.setX(aNew.getX() + getFrameArea().Width());
1194  else
1195  aNew.setX(aNew.getX() - getFrameArea().Width());
1196  }
1197 
1198  if ( pCnt->IsInDocBody() )
1199  {
1200  //#38848 drag from page margin into the body.
1201  pTmpPage = pCnt->FindPageFrame();
1202  ::lcl_PointToPrt( aNew, pTmpPage->GetUpper() );
1203  SwRect aTmp( aNew, Size( 0, 0 ) );
1204  pTmpPage = const_cast<SwPageFrame*>(static_cast<const SwPageFrame*>(::FindPage( aTmp, pTmpPage )));
1205  ::lcl_PointToPrt( aNew, pTmpPage );
1206  }
1207 
1208  //Setup RelPos, only invalidate if requested.
1209  //rNew is an absolute position. We need to calculate the distance from rNew
1210  //to the anchor inside the text flow to correctly set RelPos.
1212  const SwFrame *pFrame = nullptr;
1213  SwTwips nY;
1214  if ( pCnt->getFrameArea().IsInside( aNew ) )
1215  {
1216  // #i70582#
1217  if ( bVert )
1218  {
1219  nY = pCnt->getFrameArea().Left() - rNew.X();
1220  if ( bVertL2R )
1221  nY = -nY;
1222  else
1223  nY += pCnt->getFrameArea().Width() - getFrameArea().Width();
1225  }
1226  else
1227  nY = rNew.Y() - pCnt->getFrameArea().Top() - pCnt->GetUpperSpaceAmountConsideredForPrevFrameAndPageGrid();
1228  }
1229  else
1230  {
1231  SwDistance aDist;
1232  pFrame = ::lcl_CalcDownDist( aDist, aNew, pCnt );
1233  nY = aDist.m_nMain + aDist.m_nSub;
1234  }
1235 
1236  SwTwips nX = 0;
1237 
1238  if ( pCnt->IsFollow() )
1239  {
1240  // Flys are never attached to the follow but always to the master,
1241  // which we're going to search now.
1242  const SwContentFrame *pOriginal = pCnt;
1243  const SwContentFrame *pFollow = pCnt;
1244  while ( pCnt->IsFollow() )
1245  {
1246  do
1247  {
1248  SwContentFrame* pPrev = pCnt->GetPrevContentFrame();
1249  if (!pPrev)
1250  {
1251  SAL_WARN("sw.core", "very unexpected missing PrevContentFrame");
1252  break;
1253  }
1254  pCnt = pPrev;
1255  }
1256  while ( pCnt->GetFollow() != pFollow );
1257  pFollow = pCnt;
1258  }
1259  SwTwips nDiff = 0;
1260  do
1261  { const SwFrame *pUp = pFollow->GetUpper();
1262  if( pUp->IsVertical() )
1263  {
1264  if ( pUp->IsVertLR() )
1265  nDiff += pUp->getFramePrintArea().Width() - pFollow->GetRelPos().getX();
1266  else
1267  nDiff += pFollow->getFrameArea().Left() + pFollow->getFrameArea().Width()
1268  - pUp->getFrameArea().Left() - pUp->getFramePrintArea().Left();
1269  }
1270  else
1271  nDiff += pUp->getFramePrintArea().Height() - pFollow->GetRelPos().Y();
1272  pFollow = pFollow->GetFollow();
1273  } while ( pFollow != pOriginal );
1274  nY += nDiff;
1275  if( bVert )
1276  nX = pCnt->getFrameArea().Top() - pOriginal->getFrameArea().Top();
1277  else
1278  nX = pCnt->getFrameArea().Left() - pOriginal->getFrameArea().Left();
1279  }
1280 
1281  if ( nY == LONG_MAX )
1282  {
1283  // #i70582#
1284  const SwTwips nTopForObjPos = lcl_GetTopForObjPos(pCnt, bVert, bVertL2R);
1285  if( bVert )
1286  {
1287  if ( bVertL2R )
1288  nY = rNew.X() - nTopForObjPos;
1289  else
1290  nY = nTopForObjPos - rNew.X();
1291  }
1292  else
1293  {
1294  nY = rNew.Y() - nTopForObjPos;
1295  }
1296  }
1297 
1298  SwFlyFrameFormat *pFormat = GetFormat();
1299 
1300  if( bVert )
1301  {
1302  if( !pFrame )
1303  nX += rNew.Y() - pCnt->getFrameArea().Top();
1304  else
1305  nX = rNew.Y() - pFrame->getFrameArea().Top();
1306  }
1307  else
1308  {
1309  if( !pFrame )
1310  {
1311  if ( pCnt->IsRightToLeft() )
1312  nX += pCnt->getFrameArea().Right() - rNew.X() - getFrameArea().Width();
1313  else
1314  nX += rNew.X() - pCnt->getFrameArea().Left();
1315  }
1316  else
1317  {
1318  if ( pFrame->IsRightToLeft() )
1319  nX += pFrame->getFrameArea().Right() - rNew.X() - getFrameArea().Width();
1320  else
1321  nX = rNew.X() - pFrame->getFrameArea().Left();
1322  }
1323  }
1325 
1326  if( pCnt != GetAnchorFrame() || ( IsAutoPos() && pCnt->IsTextFrame() &&
1328  {
1329  //Set the anchor attribute according to the new Cnt.
1330  SwFormatAnchor aAnch( pFormat->GetAnchor() );
1331  SwPosition pos = *aAnch.GetContentAnchor();
1332  if( IsAutoPos() && pCnt->IsTextFrame() )
1333  {
1334  SwTextFrame const*const pTextFrame(static_cast<SwTextFrame const*>(pCnt));
1336  Point aPt( rNew );
1337  if( pCnt->GetModelPositionForViewPoint( &pos, aPt, &eTmpState )
1338  && FrameContainsNode(*pTextFrame, pos.nNode.GetIndex()))
1339  {
1340  const SwTextAttr *const pTextInputField =
1341  pos.nNode.GetNode().GetTextNode()->GetTextAttrAt(
1342  pos.nContent.GetIndex(), RES_TXTATR_INPUTFIELD, SwTextNode::PARENT );
1343  if (pTextInputField != nullptr)
1344  {
1345  pos.nContent = pTextInputField->GetStart();
1346  }
1348  if( text::RelOrientation::CHAR == pFormat->GetVertOrient().GetRelationOrient() )
1349  nY = LONG_MAX;
1350  if( text::RelOrientation::CHAR == pFormat->GetHoriOrient().GetRelationOrient() )
1351  nX = LONG_MAX;
1352  }
1353  else
1354  {
1355  pos = pTextFrame->MapViewToModelPos(TextFrameIndex(0));
1356  }
1357  }
1358  else if (pCnt->IsTextFrame())
1359  {
1360  pos = static_cast<SwTextFrame const*>(pCnt)->MapViewToModelPos(TextFrameIndex(0));
1361  }
1362  else // is that even possible? maybe if there was a change of anchor type from AT_FLY or something?
1363  {
1364  assert(pCnt->IsNoTextFrame());
1365  pos.nNode = *static_cast<SwNoTextFrame*>(pCnt)->GetNode();
1366  pos.nContent.Assign(static_cast<SwNoTextFrame*>(pCnt)->GetNode(), 0);
1367  }
1368  aAnch.SetAnchor( &pos );
1369 
1370  // handle change of anchor node:
1371  // if count of the anchor frame also change, the fly frames have to be
1372  // re-created. Thus, delete all fly frames except the <this> before the
1373  // anchor attribute is change and re-create them afterwards.
1374  {
1375  SwHandleAnchorNodeChg aHandleAnchorNodeChg( *pFormat, aAnch, this );
1376  pFormat->GetDoc()->SetAttr( aAnch, *pFormat );
1377  }
1378  }
1379  else if ( pTmpPage && pTmpPage != GetPageFrame() )
1380  GetPageFrame()->MoveFly( this, pTmpPage );
1381 
1382  const Point aRelPos = bVert ? Point( -nY, nX ) : Point( nX, nY );
1383  ChgRelPos( aRelPos );
1385 
1386  if ( pOldPage != FindPageFrame() )
1387  ::Notify_Background( GetVirtDrawObj(), pOldPage, aOld, PrepareHint::FlyFrameLeave, false );
1388 }
1389 
1397 {
1398  SwPageFrame* pPageFrame( nullptr );
1399  if ( GetVertPosOrientFrame() )
1400  {
1401  pPageFrame = const_cast<SwPageFrame*>(GetVertPosOrientFrame()->FindPageFrame());
1402  }
1403  if ( pPageFrame && GetPageFrame() != pPageFrame )
1404  {
1405  if ( GetPageFrame() )
1406  GetPageFrame()->MoveFly( this, pPageFrame );
1407  else
1408  pPageFrame->AppendFlyToPage( this );
1409  }
1410 }
1411 
1412 // #i26791#
1414 {
1415  // if fly frame position is valid, nothing is to do. Thus, return
1416  if ( isFrameAreaPositionValid() )
1417  {
1418  return;
1419  }
1420 
1421  // #i26791# - validate position flag here.
1423 
1424  // #i35911# - no calculation of new position, if
1425  // anchored object is marked that it clears its environment and its
1426  // environment is already cleared.
1427  // before checking for cleared environment
1428  // check, if member <mpVertPosOrientFrame> is set.
1429  if ( GetVertPosOrientFrame() &&
1431  {
1432  return;
1433  }
1434 
1435  // use new class to position object
1437  aObjPositioning( *GetVirtDrawObj() );
1438  aObjPositioning.CalcPosition();
1439 
1440  SetVertPosOrientFrame ( aObjPositioning.GetVertPosOrientFrame() );
1441 }
1442 
1443 // #i28701#
1445 {
1446  bool bAllowed( SwFlyFreeFrame::InvalidationAllowed( _nInvalid ) );
1447 
1448  // forbiddance of base instance can't be over ruled.
1449  if ( bAllowed )
1450  {
1451  if ( _nInvalid == INVALID_POS ||
1452  _nInvalid == INVALID_ALL )
1453  {
1454  bAllowed = InvalidationOfPosAllowed();
1455  }
1456  }
1457 
1458  return bAllowed;
1459 }
1460 
1461 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool IsAnLower(const SwFrame *) const
Definition: findfrm.cxx:207
static bool CheckMovedFwdCondition(SwAnchoredObject &_rAnchoredObj, const sal_uInt32 _nFromPageNum, const bool _bAnchoredAtMasterBeforeFormatAnchor, sal_uInt32 &_noToPageNum, bool &_boInFollow)
method to check the conditions, if 'anchor is moved forward'
SwFrame * FindFooterOrHeader()
Definition: findfrm.cxx:548
const SwVirtFlyDrawObj * GetVirtDrawObj() const
Definition: fly.cxx:2769
Base class of the Writer layout elements.
Definition: frame.hxx:298
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:151
bool OverlapsPrevColumn() const
method to determine, if the anchored object is overlapping with a previous column ...
bool operator<(const SwTextGlyphsKey &l, const SwTextGlyphsKey &r)
Definition: fntcache.cxx:128
void Right(const tools::Long nRight)
Definition: swrect.hxx:200
virtual void SwClientNotify(const SwModify &rMod, const SfxHint &rHint) override
Definition: fly.cxx:658
bool IsFollow() const
Definition: flowfrm.hxx:166
Point GetPos(const SwRect &rRect) const
Definition: frame.hxx:1364
virtual const SwFlyFrameFormat * GetFormat() const override
Definition: fly.cxx:2858
void SetNotifyBack()
Definition: flyfrm.hxx:200
const SwSortedObjs * GetDrawObjs() const
Definition: frame.hxx:548
Marks a position in the document model.
Definition: pam.hxx:35
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:821
bool IsInDocBody() const
Definition: frame.hxx:924
bool IsInFly() const
Definition: frame.hxx:942
bool IsRootFrame() const
Definition: frame.hxx:1155
bool IsInSct() const
Definition: frame.hxx:948
bool IsLowerOf(const SwLayoutFrame *pUpper) const
Definition: fly.cxx:2146
const SwContentFrame * FindAnchor(const SwFrame *pOldAnch, const Point &rNew, const bool bBodyOnly)
Searches an anchor for paragraph bound objects starting from pOldAnch.
Definition: flycnt.cxx:1018
static sal_uInt64 lcl_FindCntDiff(const Point &rPt, const SwLayoutFrame *pLay, const SwContentFrame *&rpCnt, const bool bBody, const bool bFootnote)
Definition: flycnt.cxx:855
bool IsColLocked() const
Definition: frame.hxx:867
virtual bool IsFormatPossible() const override
method to determine, if a format on the Writer fly frame is possible
Definition: flylay.cxx:713
virtual void NotifyBackground(SwPageFrame *pPage, const SwRect &rRect, PrepareHint eHint) override
Notifies the background (all ContentFrames that currently are overlapping).
Definition: flylay.cxx:108
const SwFormatVertOrient & GetVertOrient(bool=true) const
Definition: fmtornt.hxx:106
void Left(const tools::Long nLeft)
Definition: swrect.hxx:195
SwNodeIndex nNode
Definition: pam.hxx:37
bool IsInFootnote() const
Definition: frame.hxx:930
bool ClearedEnvironment() const
const SwFrame * FindPage(const SwRect &rRect, const SwFrame *pPage)
Definition: frmtool.cxx:3619
const SwRect & getFramePrintArea() const
Definition: frame.hxx:179
void SetAbsPos(const Point &rNew)
Definition: flycnt.cxx:1171
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Definition: node.cxx:1208
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
void InvalidateSize_()
Definition: frame.hxx:754
Definition: doc.hxx:186
virtual bool InvalidationAllowed(const InvalidationType _nInvalid) const
method to determine, if an invalidation is allowed.
Definition: wsfrm.cxx:1932
void SetSurround(css::text::WrapTextMode eNew)
Definition: fmtsrnd.hxx:55
bool operator<=(const BigInt &rVal1, const BigInt &rVal2)
static void DestroyFrame(SwFrame *const pFrame)
this is the only way to delete a SwFrame instance
Definition: ssfrm.cxx:383
void Pos(const Point &rNew)
Definition: swrect.hxx:169
void SetTmpConsiderWrapInfluenceOfOtherObjs()
method to apply temporary consideration of wrapping style influence to the anchored objects...
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:144
bool IsCellFrame() const
Definition: frame.hxx:1207
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
void ClearCharRectAndTopOfLine()
reset members and
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:55
void Notify_Background(const SdrObject *pObj, SwPageFrame *pPage, const SwRect &rRect, const PrepareHint eHint, const bool bInva)
Definition: frmtool.cxx:3280
bool isFrameAreaDefinitionValid() const
Definition: frame.hxx:170
static bool bFootnote
Definition: insfnote.cxx:33
virtual SwFrameFormat & GetFrameFormat() override
Definition: fly.cxx:2788
bool bSetCompletePaintOnInvalidate
Definition: frmtool.cxx:83
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const
Definition: unusedf.cxx:47
tools::Long GetTop(const SwRect &rRect) const
Definition: frame.hxx:1358
virtual void MakeObjPos() override
method to determine position for the object and set the position at the object
Definition: flycnt.cxx:1413
wrapper class for the positioning of Writer fly frames and drawing objects
void AppendFly(SwFlyFrame *pNew)
Definition: fly.cxx:2165
const SwRect & getFrameArea() const
Definition: frame.hxx:178
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
size_t pos
bool IsInTab() const
Definition: frame.hxx:936
void SetAttr(const SfxPoolItem &, SwFormat &)
Set attribute in given format.1y If Undo is enabled, the old values is added to the Undo history...
Definition: docfmt.cxx:451
virtual void RegisterAtCorrectPage() override
method to assure that anchored object is registered at the correct page frame
Definition: flycnt.cxx:1396
void SetTmpConsiderWrapInfluence(const bool _bTmpConsiderWrapInfluence)
bool IsTextFrame() const
Definition: frame.hxx:1215
sal_Int32 GetStart() const
Definition: txatbase.hxx:82
void Width(tools::Long nNew)
Definition: swrect.hxx:187
const SwFormatSurround & GetSurround(bool=true) const
Definition: fmtsrnd.hxx:66
bool m_bAtCnt
RndStdIds::FLY_AT_PARA, anchored at paragraph or RndStdIds::FLY_AT_CHAR.
Definition: flyfrm.hxx:111
SwContentFrame * GetPrevContentFrame() const
Definition: cntfrm.hxx:106
bool IsSctFrame() const
Definition: frame.hxx:1195
SwFlyFrame * FindFlyFrame()
Definition: frame.hxx:1092
SwFrame * AnchorFrame()
virtual void MakeAll(vcl::RenderContext *pRenderContext) override
|* With a paragraph-anchored fly it's absolutely possible that |* the anchor reacts to changes of the...
Definition: flycnt.cxx:309
virtual void Cut()=0
bool IsColumnFrame() const
Definition: frame.hxx:1163
bool FrameContainsNode(SwContentFrame const &rFrame, sal_uLong nNodeIndex)
Definition: txtfrm.cxx:284
Point GetRelPos() const
Definition: trvlfrm.cxx:1795
virtual void CalcPosition() override
calculate position of object
Style of a layout element.
Definition: frmfmt.hxx:58
virtual SwUndoId StartUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Opens undo block.
bool IsContentFrame() const
Definition: frame.hxx:1211
const SwContentFrame * GetFollow() const
Definition: cntfrm.hxx:114
void RemoveFly(SwFlyFrame *pToRemove)
Definition: fly.cxx:2183
#define SAL_MAX_UINT64
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
int i
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
const SwFormatHoriOrient & GetHoriOrient(bool=true) const
Definition: fmtornt.hxx:108
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
SwPageFrame * FindPageFrame()
Definition: frame.hxx:663
static void RemoveMovedFwdFrame(const SwDoc &_rDoc, const SwTextFrame &_rTextFrame)
Definition: layouter.cxx:332
const SwFrame * Lower() const
Definition: layfrm.hxx:101
SwContentNode * GetContentNode()
Definition: node.hxx:618
void InvalidatePage(const SwPageFrame *pPage=nullptr) const
Invalidates the page in which the Frame is currently placed.
Definition: wsfrm.cxx:602
tools::Long GetHeight(const SwRect &rRect) const
Definition: frame.hxx:1363
FlyAnchors.
Definition: fmtanchr.hxx:34
sal_uInt8 GetHeightPercent() const
Definition: fmtfsize.hxx:88
SwLayoutFrame * GetUpper()
Definition: frame.hxx:661
const SwRect & GetObjRectWithSpaces() const
method to determine object area inclusive its spacing
::rtl::Reference< Content > pContent
void UnlockModify()
Definition: calbck.hxx:204
SwTwips GetUpperSpaceAmountConsideredForPrevFrameAndPageGrid() const
method to determine the upper space amount, which is considered for the previous frame and the page g...
Definition: flowfrm.cxx:1724
void LockModify()
Definition: calbck.hxx:203
SwFrame * GetPrev()
Definition: frame.hxx:660
const SwRowFrame * IsInFollowFlowRow() const
Definition: findfrm.cxx:1786
virtual const IDocumentDrawModelAccess & getIDocumentDrawModelAccess() override
Definition: fly.cxx:301
Marks a node in the document model.
Definition: ndindex.hxx:31
bool isFrameAreaPositionValid() const
Definition: frame.hxx:165
void MoveFly(SwFlyFrame *pToMove, SwPageFrame *pDest)
Definition: flylay.cxx:934
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:140
sal_uInt8 GetWidthPercent() const
Definition: fmtfsize.hxx:91
const IDocumentSettingAccess & getIDocumentSettingAccess() const
Provides access to the document settings interface.
Definition: format.cxx:742
bool HasFixSize() const
Definition: frame.hxx:653
void InvalidatePos_()
Definition: frame.hxx:770
virtual bool IsFormatPossible() const override
method to determine, if a format on the Writer fly frame is possible
Definition: flycnt.cxx:524
A page of the document layout.
Definition: pagefrm.hxx:41
virtual void MakeAll(vcl::RenderContext *pRenderContext) override
Definition: flylay.cxx:114
stay with the cursor inside text
SwFrame * GetAnchorFrameContainingAnchPos()
determine anchor frame containing the anchor position
static const SwContentFrame * lcl_FindCnt(const Point &rPt, const SwContentFrame *pCnt, const bool bBody, const bool bFootnote)
Definition: flycnt.cxx:915
tools::Long SwTwips
Definition: swtypes.hxx:49
const long LONG_MAX
EXPAND : (Start < nIndex <= End)
Definition: ndtxt.hxx:364
SwSectionFrame * FindSctFrame()
Definition: frame.hxx:1096
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:464
void setFrameAreaPositionValid(bool bNew)
Definition: wsfrm.cxx:83
void Bottom(const tools::Long nBottom)
Definition: swrect.hxx:209
const SwLayoutFrame * GetVertPosOrientFrame() const
bool m_bAutoPosition
RndStdIds::FLY_AT_CHAR, anchored at character.
Definition: flyfrm.hxx:114
bool IsVertLR() const
Definition: frame.hxx:960
SwLayoutFrame * GetLeaf(MakePageType eMakePage, bool bFwd)
Definition: flowfrm.cxx:842
bool ConsiderObjWrapInfluenceOnObjPos() const
method to determine, if wrapping style influence of the anchored object has to be considered on the o...
general base class for all free-flowing frames
Definition: flyfrm.hxx:60
bool InvalidationOfPosAllowed() const
method to determine, if invalidation of position is allowed
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:88
bool IsLocked() const
Definition: flyfrm.hxx:192
SwTextFrame * FindMaster() const
Definition: flowfrm.cxx:737
SwPageFrame * GetPageFrame()
sal_uInt16 GetPhyPageNum() const
Definition: trvlfrm.cxx:1694
bool HasClearedEnvironment() const
method to determine, if due to anchored object size and wrapping style, its layout environment is cle...
bool IsInside(const Point &rPOINT) const
Definition: swrect.cxx:105
bool IsNoTextFrame() const
Definition: frame.hxx:1219
bool IsRightToLeft() const
Definition: frame.hxx:968
bool IsClipped() const
Definition: flyfrm.hxx:203
void Top(const tools::Long nTop)
Definition: swrect.hxx:204
bool IsPageFrame() const
Definition: frame.hxx:1159
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: flycnt.cxx:82
static const SwFormatAnchor * GetAnchorFromPoolItem(const SfxPoolItem &rItem)
Definition: fly.cxx:2929
bool ConsiderObjWrapInfluenceOfOtherObjs() const
method to determine, if other anchored objects, also attached at to the anchor frame, have to consider its wrap influence.
void AppendFlyToPage(SwFlyFrame *pNew)
Definition: flylay.cxx:789
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
bool IsAnFollow(const SwFlowFrame *pFlow) const
Definition: flowfrm.cxx:726
constexpr TypedWhichId< SwFormatField > RES_TXTATR_INPUTFIELD(55)
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:104
bool IsVertical() const
Definition: frame.hxx:954
#define SAL_WARN(area, stream)
static void lcl_PointToPrt(Point &rPoint, const SwFrame *pFrame)
Definition: flycnt.cxx:998
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame...
Definition: layfrm.hxx:35
const SwFrame * GetAnchorFrame() const
void SetVertPosOrientFrame(const SwLayoutFrame &_rVertPosOrientFrame)
static bool FrameMovedFwdByObjPos(const SwDoc &_rDoc, const SwTextFrame &_rTextFrame, sal_uInt32 &_ornToPageNum)
Definition: layouter.cxx:342
bool IsFootnoteContFrame() const
Definition: frame.hxx:1179
SwFlyAtContentFrame(SwFlyFrameFormat *, SwFrame *, SwFrame *pAnchor)
Definition: flycnt.cxx:73
static void FormatAnchorFrameAndItsPrevs(SwTextFrame &_rAnchorTextFrame)
method to format given anchor text frame and its previous frames
virtual bool InvalidationAllowed(const InvalidationType _nInvalid) const override
method to determine, if an invalidation is allowed.
Definition: flycnt.cxx:1444
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:67
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
const SwContentFrame * GetContentPos(Point &rPoint, const bool bDontLeave, const bool bBodyOnly=false, SwCursorMoveState *pCMS=nullptr, const bool bDefaultExpand=true) const
Finds the closest Content for the SPoint Is used for Pages, Flys and Cells if GetModelPositionForView...
Definition: trvlfrm.cxx:1185
void ResetLastCharRectHeight()
void ChgRelPos(const Point &rAbsPos)
Change the relative position.
Definition: fly.cxx:1109
void SetRestartLayoutProcess(const bool _bRestartLayoutProcess)
void Height(tools::Long nNew)
Definition: swrect.hxx:191
static const SwFrame * lcl_CalcDownDist(SwDistance &rRet, const Point &rPt, const SwContentFrame *pCnt)
Definition: flycnt.cxx:556
SwPosition MapViewToModelPos(TextFrameIndex nIndex) const
Definition: txtfrm.cxx:1238
InvalidationType
enumeration for the different invalidations #i28701#
Definition: frame.hxx:472
bool IsFooterFrame() const
Definition: frame.hxx:1175
SwRootFrame * getRootFrame()
Definition: frame.hxx:662
const SwLayoutFrame & GetVertPosOrientFrame() const
frame, at which the vertical position is oriented at
bool IsAutoPos() const
Definition: flyfrm.hxx:193
static void InsertMovedFwdFrame(const SwDoc &_rDoc, const SwTextFrame &_rMovedFwdFrameByObjPos, const sal_uInt32 _nToPageNum)
Definition: layouter.cxx:312
bool IsProtected() const
Is the Frame or rather the Section in which it lies protected?
Definition: trvlfrm.cxx:1627
SwTabFrame * FindTabFrame()
Definition: frame.hxx:1080
SwFrame * GetNext()
Definition: frame.hxx:659