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