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