LibreOffice Module sw (master)  1
flylay.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <pagefrm.hxx>
21 #include <rootfrm.hxx>
22 #include <cntfrm.hxx>
23 #include <dflyobj.hxx>
24 #include <dcontact.hxx>
25 #include <ftnfrm.hxx>
26 #include <frmatr.hxx>
27 #include <frmtool.hxx>
28 #include <hints.hxx>
29 #include <sectfrm.hxx>
30 #include <notxtfrm.hxx>
31 #include <txtfly.hxx>
32 
33 #include <svx/svdpage.hxx>
34 #include <editeng/ulspitem.hxx>
35 #include <fmtornt.hxx>
36 #include <fmtfsize.hxx>
37 #include <ndole.hxx>
38 #include <tabfrm.hxx>
39 #include <flyfrms.hxx>
40 #include <fmtfollowtextflow.hxx>
42 #include <sortedobjs.hxx>
43 #include <viewimp.hxx>
46 #include <pam.hxx>
47 #include <ndindex.hxx>
50 #include <osl/diagnose.h>
51 
52 using namespace ::com::sun::star;
53 
55 : SwFlyFrame( pFormat, pSib, pAnch ),
56  // #i34753#
57  mbNoMakePos( false ),
58  // #i37068#
59  mbNoMoveOnCheckClip( false )
60 {
61 }
62 
64 {
65  // #i28701# - use new method <GetPageFrame()>
66  if( GetPageFrame() )
67  {
68  if( GetFormat()->GetDoc()->IsInDtor() )
69  {
70  // #i29879# - remove also to-frame anchored Writer
71  // fly frame from page.
72  const bool bRemoveFromPage =
74  ( IsFlyAtContentFrame() ||
76  if ( bRemoveFromPage )
77  {
78  GetPageFrame()->GetSortedObjs()->Remove( *this );
79  }
80  }
81  else
82  {
83  SwRect aTmp( GetObjRectWithSpaces() );
85  }
86  }
87 
89 }
90 
92 {
93 #if 0
94  // we are possibly in ContourCache, make sure we vanish
96 #endif
97 }
98 
99 // #i28701#
107  const SwRect& rRect, PrepareHint eHint )
108 {
109  ::Notify_Background( GetVirtDrawObj(), pPageFrame, rRect, eHint, true );
110 }
111 
113 {
114  if ( !GetFormat()->GetDoc()->getIDocumentDrawModelAccess().IsVisibleLayerId( GetVirtDrawObj()->GetLayer() ) )
115  {
116  return;
117  }
118 
119  if ( !GetAnchorFrame() || IsLocked() || IsColLocked() )
120  {
121  return;
122  }
123 
124  // #i28701# - use new method <GetPageFrame()>
125  if( !GetPageFrame() && GetAnchorFrame()->IsInFly() )
126  {
127  SwFlyFrame* pFly = AnchorFrame()->FindFlyFrame();
128  SwPageFrame *pPageFrame = pFly ? pFly->FindPageFrame() : nullptr;
129  if( pPageFrame )
130  pPageFrame->AppendFlyToPage( this );
131  }
132 
133  if( !GetPageFrame() )
134  {
135  return;
136  }
137 
138  Lock(); // The curtain drops
139 
140  // takes care of the notification in the dtor
141  const SwFlyNotify aNotify( this );
142 
143  if ( IsClipped() )
144  {
145  setFrameAreaSizeValid(false);
147  // no invalidation of position,
148  // if anchored object is anchored inside a Writer fly frame,
149  // its position is already locked, and it follows the text flow.
150  // #i34753# - add condition:
151  // no invalidation of position, if no direct move is requested in <CheckClip(..)>
152  if ( !IsNoMoveOnCheckClip() &&
153  !( PositionLocked() &&
154  GetAnchorFrame()->IsInFly() &&
155  GetFrameFormat().GetFollowTextFlow().GetValue() ) )
156  {
158  }
159  }
160 
161  // #i81146# new loop control
162  int nLoopControlRuns = 0;
163  const int nLoopControlMax = 10;
164 
165  // RotateFlyFrame3 - outer frame
166  const double fRotation(getLocalFrameRotation());
167  const bool bRotated(!basegfx::fTools::equalZero(fRotation));
168 
169  if(bRotated)
170  {
171  // Re-layout may be partially (see all isFrameAreaDefinitionValid() flags),
172  // so resetting the local SwFrame(s) in the local SwFrameAreaDefinition is
173  // needed. Reset to BoundAreas will be done below automatically
175  {
177  }
178  }
179 
181  {
182  SwRectFnSet aRectFnSet(this);
183  const SwFormatFrameSize *pSz;
184  { // Additional scope, so aAccess will be destroyed before the check!
185 
186  SwBorderAttrAccess aAccess( SwFrame::GetCache(), this );
187  const SwBorderAttrs &rAttrs = *aAccess.Get();
188  pSz = &rAttrs.GetAttrSet().GetFrameSize();
189 
190  // Only set when the flag is set!
191  if ( !isFrameAreaSizeValid() )
192  {
193  setFramePrintAreaValid(false);
194  }
195 
196  if ( !isFramePrintAreaValid() )
197  {
198  MakePrtArea( rAttrs );
199  m_bValidContentPos = false;
200  }
201 
203  {
204  setFrameAreaSizeValid(false);
205  Format( getRootFrame()->GetCurrShell()->GetOut(), &rAttrs );
206  m_bFormatHeightOnly = false;
207  }
208  }
209 
210  if ( !isFrameAreaPositionValid() )
211  {
212  const Point aOldPos( aRectFnSet.GetPos(getFrameArea()) );
213  // #i26791# - use new method <MakeObjPos()>
214  // #i34753# - no positioning, if requested.
215  if ( IsNoMakePos() )
216  {
218  }
219  else
220  // #i26791# - use new method <MakeObjPos()>
221  MakeObjPos();
222  if( aOldPos == aRectFnSet.GetPos(getFrameArea()) )
223  {
226  {
228  }
229  }
230  else
231  {
232  setFrameAreaSizeValid(false);
233  }
234  }
235 
236  if ( !m_bValidContentPos )
237  {
238  SwBorderAttrAccess aAccess( SwFrame::GetCache(), this );
239  const SwBorderAttrs &rAttrs = *aAccess.Get();
240  MakeContentPos( rAttrs );
241  }
242 
244  {
245  ++nLoopControlRuns;
246 
247  OSL_ENSURE( nLoopControlRuns < nLoopControlMax, "LoopControl in SwFlyFreeFrame::MakeAll" );
248 
249  if ( nLoopControlRuns < nLoopControlMax )
250  CheckClip( *pSz );
251  }
252  else
253  nLoopControlRuns = 0;
254  }
255 
256  // RotateFlyFrame3 - outer frame
257  // Do not refresh transforms/Areas self here, this will be done
258  // when inner and outer frame are layouted, in SwNoTextFrame::MakeAll
259  if(bRotated)
260  {
261  // RotateFlyFrame3: Safe changes locally
262  // get center from outer frame (layout frame) to be on the safe side
263  const Point aCenter(getFrameArea().Center());
264  const basegfx::B2DPoint aB2DCenter(aCenter.X(), aCenter.Y());
265 
267  {
269  }
270 
272  fRotation,
273  aB2DCenter);
275  }
276  else
277  {
278  // RotateFlyFrame3: Also need to clear ContourCache (if used),
279  // usually done in SwFlyFrame::NotifyDrawObj, but there relies on
280  // being in transform mode which is already reset then
282  {
284  }
285 
286  // reset transformations to show that they are not used
287  mpTransformableSwFrame.reset();
288  }
289 
290  Unlock();
291 
292 #if OSL_DEBUG_LEVEL > 0
293  SwRectFnSet aRectFnSet(this);
294  OSL_ENSURE( m_bHeightClipped || ( aRectFnSet.GetHeight(getFrameArea()) > 0 &&
295  aRectFnSet.GetHeight(getFramePrintArea()) > 0),
296  "SwFlyFreeFrame::Format(), flipping Fly." );
297 
298 #endif
299 }
300 
302 {
303  static bool bOverrideHandleContourToAlwaysOff(true); // loplugin:constvars:ignore
304 
305  // RotateFlyFrameFix: For LO6.0 we need to deactivate the AutoContour feature again, it is simply
306  // not clear how/if to use and save/load it in ODF. This has to be discussed.
307  // The reason not to remove is that this may be used as-is now, using a new switch.
308  // Even when not, the detection if it is possible will be needed in any case later.
309  if(bOverrideHandleContourToAlwaysOff)
310  {
311  return false;
312  }
313 
315  {
316  // support only when transformed, else there is no free space
317  return false;
318  }
319 
320  // Check for Borders. If we have Borders, do (currently) not support,
321  // since borders do not transform with the object.
322  // (Will need to be enhanced to take into account if we have Borders and if these
323  // transform with the object)
324  SwBorderAttrAccess aAccess(SwFrame::GetCache(), this);
325  const SwBorderAttrs &rAttrs(*aAccess.Get());
326 
327  if(rAttrs.IsLine())
328  {
329  return false;
330  }
331 
332  // Check for Padding. Do not support when padding is used, this will
333  // produce a covered space around the object (filled with fill defines)
334  const SfxPoolItem* pItem(nullptr);
335 
336  if(GetFormat() && SfxItemState::SET == GetFormat()->GetItemState(RES_BOX, false, &pItem))
337  {
338  const SvxBoxItem& rBox = *static_cast< const SvxBoxItem* >(pItem);
339 
340  if(rBox.HasBorder(/*bTreatPaddingAsBorder*/true))
341  {
342  return false;
343  }
344  }
345 
346  // check for Fill - if we have fill, it will fill the gaps and we will not
347  // support AutoContour
349  {
351 
352  if(aFillAttributes && aFillAttributes->isUsed())
353  {
354  return false;
355  }
356  }
357  else
358  {
359  const std::unique_ptr<SvxBrushItem> aBack(GetFormat()->makeBackgroundBrushItem());
360 
361  if(aBack && aBack->isUsed())
362  {
363  return false;
364  }
365  }
366 
367  // else, support
368  return true;
369 }
370 
371 // RotateFlyFrame3 - Support for Transformations - outer frame
373 {
375  {
376  // use pre-created transformation
378  }
379 
380  // call parent
382 }
383 
385 {
387  {
388  // use pre-created transformation
390  }
391 
392  // call parent
394 }
395 
396 // RotateFlyFrame3 - Support for Transformations
397 void SwFlyFreeFrame::transform_translate(const Point& rOffset)
398 {
399  // call parent - this will do the basic transform for SwRect(s)
400  // in the SwFrameAreaDefinition
402 
403  // check if the Transformations need to be adapted
405  {
406  const basegfx::B2DHomMatrix aTransform(
408  rOffset.X(), rOffset.Y()));
409 
410  // transform using TransformableSwFrame
411  getTransformableSwFrame()->transform(aTransform);
412  }
413 }
414 
415 // RotateFlyFrame3 - outer frame
417 {
418  return rNoTextFrame.getLocalFrameRotation();
419 }
420 
422 {
423  // SwLayoutFrame::Lower() != SwFrame::GetLower(), but SwFrame::GetLower()
424  // calls SwLayoutFrame::Lower() when it's a SwLayoutFrame - so use GetLower()
425  const SwNoTextFrame* pSwNoTextFrame(dynamic_cast< const SwNoTextFrame* >(GetLower()));
426 
427  if(nullptr != pSwNoTextFrame)
428  {
429  return getLocalFrameRotation_from_SwNoTextFrame(*pSwNoTextFrame);
430  }
431 
432  // no rotation
433  return 0.0;
434 }
435 
447 {
448  bool bRetVal = false;
449 
450  const SwFrame* pToBeCheckedFrame = GetAnchorFrame();
451  while ( pToBeCheckedFrame &&
452  !pToBeCheckedFrame->IsPageFrame() )
453  {
454  if ( pToBeCheckedFrame->IsHeaderFrame() ||
455  pToBeCheckedFrame->IsFooterFrame() ||
456  pToBeCheckedFrame->IsRowFrame() ||
457  pToBeCheckedFrame->IsFlyFrame() )
458  {
459  bRetVal = SwFrameSize::Fixed !=
460  pToBeCheckedFrame->GetAttrSet()->GetFrameSize().GetHeightSizeType();
461  break;
462  }
463  else
464  {
465  pToBeCheckedFrame = pToBeCheckedFrame->GetUpper();
466  }
467  }
468 
469  return bRetVal;
470 }
471 
473 {
474  // It's probably time now to take appropriate measures, if the Fly
475  // doesn't fit into its surrounding.
476  // First, the Fly gives up its position, then it's formatted.
477  // Only if it still doesn't fit after giving up its position, the
478  // width or height are given up as well. The frame will be squeezed
479  // as much as needed.
480 
481  const SwVirtFlyDrawObj *pObj = GetVirtDrawObj();
482  SwRect aClip, aTmpStretch;
483  ::CalcClipRect( pObj, aClip );
484  ::CalcClipRect( pObj, aTmpStretch, false );
485  aClip.Intersection_( aTmpStretch );
486 
487  const tools::Long nBot = getFrameArea().Top() + getFrameArea().Height();
488  const tools::Long nRig = getFrameArea().Left() + getFrameArea().Width();
489  const tools::Long nClipBot = aClip.Top() + aClip.Height();
490  const tools::Long nClipRig = aClip.Left() + aClip.Width();
491 
492  const bool bBot = nBot > nClipBot;
493  const bool bRig = nRig > nClipRig;
494  if (( bBot || bRig ) && !IsDraggingOffPageAllowed(FindFrameFormat(GetDrawObj())))
495  {
496  bool bAgain = false;
497  // #i37068# - no move, if it's requested
498  if ( bBot && !IsNoMoveOnCheckClip() &&
499  !GetDrawObjs() && !GetAnchorFrame()->IsInTab() )
500  {
501  SwFrame* pHeader = FindFooterOrHeader();
502  // In a header, correction of the position is no good idea.
503  // If the fly moves, some paragraphs have to be formatted, this
504  // could cause a change of the height of the headerframe,
505  // now the flyframe can change its position and so on ...
506  if ( !pHeader || !pHeader->IsHeaderFrame() )
507  {
508  const tools::Long nOld = getFrameArea().Top();
509 
510  // tdf#112443 disable positioning if content is completely off page
512  if ( !bDisableOffPagePositioning || nOld <= nClipBot)
513  {
515  aFrm.Pos().setY( std::max( aClip.Top(), nClipBot - aFrm.Height() ) );
516  }
517 
518  if ( getFrameArea().Top() != nOld )
519  {
520  bAgain = true;
521  }
522 
523  m_bHeightClipped = true;
524  }
525  }
526  if ( bRig )
527  {
528  const tools::Long nOld = getFrameArea().Left();
529 
530  // tdf#112443 disable positioning if content is completely off page
532  if ( !bDisableOffPagePositioning || nOld <= nClipRig )
533  {
535  aFrm.Pos().setX( std::max( aClip.Left(), nClipRig - aFrm.Width() ) );
536  }
537 
538  if ( getFrameArea().Left() != nOld )
539  {
540  const SwFormatHoriOrient &rH = GetFormat()->GetHoriOrient();
541  // Left-aligned ones may not be moved to the left when they
542  // are avoiding another one.
543  if( rH.GetHoriOrient() == text::HoriOrientation::LEFT )
544  {
546  aFrm.Pos().setX( nOld );
547  }
548  else
549  {
550  bAgain = true;
551  }
552  }
553  m_bWidthClipped = true;
554  }
555  if ( bAgain )
556  {
557  setFrameAreaSizeValid(false);
558  }
559  else
560  {
561  // If we reach this branch, the Frame protrudes into forbidden
562  // areas, and correcting the position is not allowed or not
563  // possible or not required.
564 
565  // For Flys with OLE objects as lower, we make sure that
566  // we always resize proportionally
567  Size aOldSize( getFrameArea().SSize() );
568 
569  // First, setup the FrameRect, then transfer it to the Frame.
570  SwRect aFrameRect( getFrameArea() );
571 
572  if ( bBot )
573  {
574  tools::Long nDiff = nClipBot;
575  nDiff -= aFrameRect.Top(); // nDiff represents the available distance
576  nDiff = aFrameRect.Height() - nDiff;
577  aFrameRect.Height( aFrameRect.Height() - nDiff );
578  m_bHeightClipped = true;
579  }
580  if ( bRig )
581  {
582  tools::Long nDiff = nClipRig;
583  nDiff -= aFrameRect.Left();// nDiff represents the available distance
584  nDiff = aFrameRect.Width() - nDiff;
585  aFrameRect.Width( aFrameRect.Width() - nDiff );
586  m_bWidthClipped = true;
587  }
588 
589  // #i17297# - no proportional
590  // scaling of graphics in environments, which determines its size
591  // by its content ('auto' size). Otherwise layout loops can occur and
592  // layout sizes of the environment can be incorrect.
593  // Such environment are:
594  // (1) header and footer frames with 'auto' size
595  // (2) table row frames with 'auto' size
596  // (3) fly frames with 'auto' size
597  // Note: section frames seems to be not critical - didn't found
598  // any critical layout situation so far.
599  if ( Lower() && Lower()->IsNoTextFrame() &&
600  (static_cast<SwNoTextFrame*>(Lower())->GetNode()->GetOLENode() ||
602  {
603  // If width and height got adjusted, then the bigger
604  // change is relevant.
605  if ( aFrameRect.Width() != aOldSize.Width() &&
606  aFrameRect.Height()!= aOldSize.Height() )
607  {
608  if ( (aOldSize.Width() - aFrameRect.Width()) >
609  (aOldSize.Height()- aFrameRect.Height()) )
610  aFrameRect.Height( aOldSize.Height() );
611  else
612  aFrameRect.Width( aOldSize.Width() );
613  }
614 
615  // Adjusted the width? change height proportionally
616  if( aFrameRect.Width() != aOldSize.Width() )
617  {
618  aFrameRect.Height( aFrameRect.Width() * aOldSize.Height() /
619  aOldSize.Width() );
620  m_bHeightClipped = true;
621  }
622  // Adjusted the height? change width proportionally
623  else if( aFrameRect.Height() != aOldSize.Height() )
624  {
625  aFrameRect.Width( aFrameRect.Height() * aOldSize.Width() /
626  aOldSize.Height() );
627  m_bWidthClipped = true;
628  }
629 
630  // #i17297# - reactivate change
631  // of size attribute for fly frames containing an ole object.
632 
633  // Added the aFrameRect.HasArea() hack, because
634  // the environment of the ole object does not have to be valid
635  // at this moment, or even worse, it does not have to have a
636  // reasonable size. In this case we do not want to change to
637  // attributes permanently. Maybe one day somebody dares to remove
638  // this code.
639  if ( aFrameRect.HasArea() &&
640  static_cast<SwNoTextFrame*>(Lower())->GetNode()->GetOLENode() &&
642  {
643  SwFlyFrameFormat *pFormat = GetFormat();
644  pFormat->LockModify();
645  SwFormatFrameSize aFrameSize( rSz );
646  aFrameSize.SetWidth( aFrameRect.Width() );
647  aFrameSize.SetHeight( aFrameRect.Height() );
648  pFormat->SetFormatAttr( aFrameSize );
649  pFormat->UnlockModify();
650  }
651  }
652 
653  // Now change the Frame; for columns, we put the new values into the attributes,
654  // otherwise we'll end up with unwanted side-effects/oscillations
655  const tools::Long nPrtHeightDiff = getFrameArea().Height() - getFramePrintArea().Height();
656  const tools::Long nPrtWidthDiff = getFrameArea().Width() - getFramePrintArea().Width();
658 
659  {
661  aFrm.Height( aFrameRect.Height() );
662  aFrm.Width ( std::max( tools::Long(MINLAY), aFrameRect.Width() ) );
663  }
664 
665  if ( Lower() && Lower()->IsColumnFrame() )
666  {
667  ColLock(); //lock grow/shrink
668  const Size aTmpOldSize( getFramePrintArea().SSize() );
669 
670  {
672  aPrt.Height( getFrameArea().Height() - nPrtHeightDiff );
673  aPrt.Width ( getFrameArea().Width() - nPrtWidthDiff );
674  }
675 
676  ChgLowersProp( aTmpOldSize );
677  SwFrame *pLow = Lower();
678  do
679  {
680  pLow->Calc(getRootFrame()->GetCurrShell()->GetOut());
681  // also calculate the (Column)BodyFrame
682  static_cast<SwLayoutFrame*>(pLow)->Lower()->Calc(getRootFrame()->GetCurrShell()->GetOut());
683  pLow = pLow->GetNext();
684  } while ( pLow );
685  ::CalcContent( this );
686  ColUnlock();
687 
689  {
690  setFrameAreaSizeValid(true);
691  m_bFormatHeightOnly = true;
692  }
693  }
694  else
695  {
697  aPrt.Height( getFrameArea().Height() - nPrtHeightDiff );
698  aPrt.Width ( getFrameArea().Width() - nPrtWidthDiff );
699  }
700  }
701  }
702 
703  // #i26945#
704  OSL_ENSURE( getFrameArea().Height() >= 0,
705  "<SwFlyFreeFrame::CheckClip(..)> - fly frame has negative height now." );
706 }
707 
712 {
713  return SwFlyFrame::IsFormatPossible() &&
714  ( GetPageFrame() ||
715  ( GetAnchorFrame() && GetAnchorFrame()->IsInFly() ) );
716 }
717 
719  SwFlyFreeFrame( pFormat, pSib, pAnch )
720 {
721  m_bLayout = true;
722 }
723 
724 // #i28701#
725 
726 void SwFlyLayFrame::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
727 {
728  if (rHint.GetId() != SfxHintId::SwLegacyModify)
729  return;
730  auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
731  if(!pLegacy->m_pNew)
732  return;
733  const auto pAnch = GetAnchorFromPoolItem(*pLegacy->m_pNew);
734 
735  if(!pAnch)
736  {
737  SwFlyFrame::SwClientNotify(rMod, rHint);
738  return;
739  }
740  SAL_WARN_IF(pAnch->GetAnchorId() == GetFormat()->GetAnchor().GetAnchorId(), "sw.core", "Invalid change of anchor type.");
741 
742  // Unregister, get hold of the page, attach to the corresponding LayoutFrame.
744  // #i28701# - use new method <GetPageFrame()>
745  SwPageFrame* pOldPage = GetPageFrame();
746  AnchorFrame()->RemoveFly(this);
747 
748  if(RndStdIds::FLY_AT_PAGE == pAnch->GetAnchorId())
749  {
750  SwRootFrame* pRoot = getRootFrame();
751  SwPageFrame* pTmpPage = static_cast<SwPageFrame*>(pRoot->Lower());
752  sal_uInt16 nPagesToFlip = pAnch->GetPageNum()-1;
753  while(pTmpPage && nPagesToFlip)
754  {
755  pTmpPage = static_cast<SwPageFrame*>(pTmpPage->GetNext());
756  --nPagesToFlip;
757  }
758  if(pTmpPage && !nPagesToFlip)
759  {
760  // #i50432# - adjust synopsis of <PlaceFly(..)>
761  pTmpPage->PlaceFly(this, nullptr);
762  }
763  if(!pTmpPage)
764  {
765  pRoot->SetAssertFlyPages();
766  pRoot->AssertFlyPages();
767  }
768  }
769  else
770  {
771  SwNodeIndex aIdx(pAnch->GetContentAnchor()->nNode);
772  SwContentFrame* pContent = GetFormat()->GetDoc()->GetNodes().GoNext(&aIdx)->
773  GetContentNode()->getLayoutFrame(getRootFrame(), nullptr, nullptr);
774  if(pContent)
775  {
776  SwFlyFrame *pTmp = pContent->FindFlyFrame();
777  if(pTmp)
778  pTmp->AppendFly(this);
779  }
780  }
781  // #i28701# - use new method <GetPageFrame()>
782  if ( pOldPage && pOldPage != GetPageFrame() )
783  NotifyBackground( pOldPage, aOld, PrepareHint::FlyFrameLeave );
785  InvalidateAll();
786  SetNotifyBack();
787 }
788 
790 {
791  if ( !pNew->GetVirtDrawObj()->IsInserted() )
793  static_cast<SdrObject*>(pNew->GetVirtDrawObj()),
795 
800 
801  if ( GetUpper() )
802  {
803  static_cast<SwRootFrame*>(GetUpper())->SetIdleFlags();
804  static_cast<SwRootFrame*>(GetUpper())->InvalidateBrowseWidth();
805  }
806 
807  SdrObject* pObj = pNew->GetVirtDrawObj();
808  OSL_ENSURE( pNew->GetAnchorFrame(), "Fly without Anchor" );
809  SwFlyFrame* pFly = const_cast<SwFlyFrame*>(pNew->GetAnchorFrame()->FindFlyFrame());
810  if ( pFly && pObj->GetOrdNum() < pFly->GetVirtDrawObj()->GetOrdNum() )
811  {
812  //#i119945# set pFly's OrdNum to _rNewObj's. So when pFly is removed by Undo, the original OrdNum will not be changed.
813  sal_uInt32 nNewNum = pObj->GetOrdNumDirect();
814  if ( pObj->getSdrPageFromSdrObject() )
815  pObj->getSdrPageFromSdrObject()->SetObjectOrdNum( pFly->GetVirtDrawObj()->GetOrdNumDirect(), nNewNum );
816  else
817  pFly->GetVirtDrawObj()->SetOrdNum( nNewNum );
818  }
819 
820  // Don't look further at Flys that sit inside the Content.
821  if ( pNew->IsFlyInContentFrame() )
823  else
824  {
826 
827  if ( !m_pSortedObjs )
828  {
829  m_pSortedObjs.reset(new SwSortedObjs());
830  }
831 
832  const bool bSuccessInserted = m_pSortedObjs->Insert( *pNew );
833  OSL_ENSURE( bSuccessInserted, "Fly not inserted in Sorted." );
834 
835  // #i87493#
836  OSL_ENSURE( pNew->GetPageFrame() == nullptr || pNew->GetPageFrame() == this,
837  "<SwPageFrame::AppendFlyToPage(..)> - anchored fly frame seems to be registered at another page frame. Serious defect." );
838  // #i28701# - use new method <SetPageFrame(..)>
839  pNew->SetPageFrame( this );
840  pNew->InvalidatePage( this );
841  // #i28701#
842  pNew->UnlockPosition();
843  // needed to reposition at-page anchored flys moved from different page
844  pNew->InvalidateObjPos();
845 
846  // Notify accessible layout. That's required at this place for
847  // frames only where the anchor is moved. Creation of new frames
848  // is additionally handled by the SwFrameNotify class.
849  if( GetUpper() &&
850  static_cast< SwRootFrame * >( GetUpper() )->IsAnyShellAccessible() &&
851  static_cast< SwRootFrame * >( GetUpper() )->GetCurrShell() )
852  {
853  static_cast< SwRootFrame * >( GetUpper() )->GetCurrShell()->Imp()
854  ->AddAccessibleFrame( pNew );
855  }
856  }
857 
858  // #i28701# - correction: consider also drawing objects
859  if ( !pNew->GetDrawObjs() )
860  return;
861 
862  SwSortedObjs &rObjs = *pNew->GetDrawObjs();
863  for (SwAnchoredObject* pTmpObj : rObjs)
864  {
865  if ( auto pTmpFly = pTmpObj->DynCastFlyFrame() )
866  {
867  // #i28701# - use new method <GetPageFrame()>
868  if ( pTmpFly->IsFlyFreeFrame() && !pTmpFly->GetPageFrame() )
869  AppendFlyToPage( pTmpFly );
870  }
871  else if ( dynamic_cast<const SwAnchoredDrawObject*>( pTmpObj) != nullptr )
872  {
873  // #i87493#
874  if ( pTmpObj->GetPageFrame() != this )
875  {
876  if ( pTmpObj->GetPageFrame() != nullptr )
877  {
878  pTmpObj->GetPageFrame()->RemoveDrawObjFromPage( *pTmpObj );
879  }
880  AppendDrawObjToPage( *pTmpObj );
881  }
882  }
883  }
884 }
885 
887 {
888  const sal_uInt32 nOrdNum = pToRemove->GetVirtDrawObj()->GetOrdNum();
889  getRootFrame()->GetDrawPage()->RemoveObject( nOrdNum );
890  pToRemove->GetVirtDrawObj()->ReferencedObj().SetOrdNum( nOrdNum );
891 
892  if ( GetUpper() )
893  {
894  if ( !pToRemove->IsFlyInContentFrame() )
895  static_cast<SwRootFrame*>(GetUpper())->SetSuperfluous();
896  static_cast<SwRootFrame*>(GetUpper())->InvalidateBrowseWidth();
897  }
898 
899  // Don't look further at Flys that sit inside the Content.
900  if ( pToRemove->IsFlyInContentFrame() )
901  return;
902 
903  // Don't delete collections just yet. This will happen at the end of the
904  // action in the RemoveSuperfluous of the page, kicked off by a method of
905  // the same name in the root.
906  // The FlyColl might be gone already, because the page's dtor is being
907  // executed.
908  // Remove it _before_ disposing accessible frames to avoid accesses to
909  // the Frame from event handlers.
910  if (m_pSortedObjs)
911  {
912  m_pSortedObjs->Remove(*pToRemove);
913  if (!m_pSortedObjs->size())
914  {
915  m_pSortedObjs.reset();
916  }
917  }
918 
919  // Notify accessible layout. That's required at this place for
920  // frames only where the anchor is moved. Creation of new frames
921  // is additionally handled by the SwFrameNotify class.
922  if( GetUpper() &&
923  static_cast< SwRootFrame * >( GetUpper() )->IsAnyShellAccessible() &&
924  static_cast< SwRootFrame * >( GetUpper() )->GetCurrShell() )
925  {
926  static_cast< SwRootFrame * >( GetUpper() )->GetCurrShell()->Imp()
927  ->DisposeAccessibleFrame( pToRemove, true );
928  }
929 
930  // #i28701# - use new method <SetPageFrame(..)>
931  pToRemove->SetPageFrame( nullptr );
932 }
933 
935 {
936  // Invalidations
937  if ( GetUpper() )
938  {
939  static_cast<SwRootFrame*>(GetUpper())->SetIdleFlags();
940  if ( !pToMove->IsFlyInContentFrame() && pDest->GetPhyPageNum() < GetPhyPageNum() )
941  static_cast<SwRootFrame*>(GetUpper())->SetSuperfluous();
942  }
943 
944  pDest->InvalidateSpelling();
945  pDest->InvalidateSmartTags();
947  pDest->InvalidateWordCount();
948 
949  if ( pToMove->IsFlyInContentFrame() )
950  {
951  pDest->InvalidateFlyInCnt();
952  return;
953  }
954 
955  // Notify accessible layout. That's required at this place for
956  // frames only where the anchor is moved. Creation of new frames
957  // is additionally handled by the SwFrameNotify class.
958  if( GetUpper() &&
959  static_cast< SwRootFrame * >( GetUpper() )->IsAnyShellAccessible() &&
960  static_cast< SwRootFrame * >( GetUpper() )->GetCurrShell() )
961  {
962  static_cast< SwRootFrame * >( GetUpper() )->GetCurrShell()->Imp()
963  ->DisposeAccessibleFrame( pToMove, true );
964  }
965 
966  // The FlyColl might be gone already, because the page's dtor is being executed.
967  if ( m_pSortedObjs )
968  {
969  m_pSortedObjs->Remove( *pToMove );
970  if ( !m_pSortedObjs->size() )
971  {
972  m_pSortedObjs.reset();
973  }
974  }
975 
976  // Register
977  if ( !pDest->GetSortedObjs() )
978  pDest->m_pSortedObjs.reset(new SwSortedObjs());
979 
980  const bool bSuccessInserted = pDest->GetSortedObjs()->Insert( *pToMove );
981  OSL_ENSURE( bSuccessInserted, "Fly not inserted in Sorted." );
982 
983  // #i28701# - use new method <SetPageFrame(..)>
984  pToMove->SetPageFrame( pDest );
985  pToMove->InvalidatePage( pDest );
986  pToMove->SetNotifyBack();
987  pDest->InvalidateFlyContent();
988  // #i28701#
989  pToMove->UnlockPosition();
990 
991  // Notify accessible layout. That's required at this place for
992  // frames only where the anchor is moved. Creation of new frames
993  // is additionally handled by the SwFrameNotify class.
994  if( GetUpper() &&
995  static_cast< SwRootFrame * >( GetUpper() )->IsAnyShellAccessible() &&
996  static_cast< SwRootFrame * >( GetUpper() )->GetCurrShell() )
997  {
998  static_cast< SwRootFrame * >( GetUpper() )->GetCurrShell()->Imp()
999  ->AddAccessibleFrame( pToMove );
1000  }
1001 
1002  // #i28701# - correction: move lowers of Writer fly frame
1003  if ( !pToMove->GetDrawObjs() )
1004  return;
1005 
1006  SwSortedObjs &rObjs = *pToMove->GetDrawObjs();
1007  for (SwAnchoredObject* pObj : rObjs)
1008  {
1009  if ( auto pFly = pObj->DynCastFlyFrame() )
1010  {
1011  if ( pFly->IsFlyFreeFrame() )
1012  {
1013  // #i28701# - use new method <GetPageFrame()>
1014  SwPageFrame* pPageFrame = pFly->GetPageFrame();
1015  if ( pPageFrame )
1016  pPageFrame->MoveFly( pFly, pDest );
1017  else
1018  pDest->AppendFlyToPage( pFly );
1019  }
1020  }
1021  else if ( dynamic_cast<const SwAnchoredDrawObject*>( pObj) != nullptr )
1022  {
1023  RemoveDrawObjFromPage( *pObj );
1024  pDest->AppendDrawObjToPage( *pObj );
1025  }
1026  }
1027 }
1028 
1030 {
1031  if ( dynamic_cast<const SwAnchoredDrawObject*>( &_rNewObj) == nullptr )
1032  {
1033  OSL_FAIL( "SwPageFrame::AppendDrawObjToPage(..) - anchored object of unexpected type -> object not appended" );
1034  return;
1035  }
1036 
1037  if ( GetUpper() )
1038  {
1039  static_cast<SwRootFrame*>(GetUpper())->InvalidateBrowseWidth();
1040  }
1041 
1042  assert(_rNewObj.GetAnchorFrame());
1043  SwFlyFrame* pFlyFrame = const_cast<SwFlyFrame*>(_rNewObj.GetAnchorFrame()->FindFlyFrame());
1044  if ( pFlyFrame &&
1045  _rNewObj.GetDrawObj()->GetOrdNum() < pFlyFrame->GetVirtDrawObj()->GetOrdNum() )
1046  {
1047  //#i119945# set pFly's OrdNum to _rNewObj's. So when pFly is removed by Undo, the original OrdNum will not be changed.
1048  sal_uInt32 nNewNum = _rNewObj.GetDrawObj()->GetOrdNumDirect();
1049  if ( _rNewObj.GetDrawObj()->getSdrPageFromSdrObject() )
1050  _rNewObj.DrawObj()->getSdrPageFromSdrObject()->SetObjectOrdNum( pFlyFrame->GetVirtDrawObj()->GetOrdNumDirect(), nNewNum );
1051  else
1052  pFlyFrame->GetVirtDrawObj()->SetOrdNum( nNewNum );
1053  }
1054 
1055  if ( RndStdIds::FLY_AS_CHAR == _rNewObj.GetFrameFormat().GetAnchor().GetAnchorId() )
1056  {
1057  return;
1058  }
1059 
1060  if ( !m_pSortedObjs )
1061  {
1062  m_pSortedObjs.reset(new SwSortedObjs());
1063  }
1064  if ( !m_pSortedObjs->Insert( _rNewObj ) )
1065  {
1066  OSL_ENSURE( m_pSortedObjs->Contains( _rNewObj ),
1067  "Drawing object not appended into list <pSortedObjs>." );
1068  }
1069  // #i87493#
1070  OSL_ENSURE( _rNewObj.GetPageFrame() == nullptr || _rNewObj.GetPageFrame() == this,
1071  "<SwPageFrame::AppendDrawObjToPage(..)> - anchored draw object seems to be registered at another page frame. Serious defect." );
1072  _rNewObj.SetPageFrame( this );
1073 
1074  // invalidate page in order to force a reformat of object layout of the page.
1076 }
1077 
1079 {
1080  if ( dynamic_cast<const SwAnchoredDrawObject*>( &_rToRemoveObj) == nullptr )
1081  {
1082  OSL_FAIL( "SwPageFrame::RemoveDrawObjFromPage(..) - anchored object of unexpected type -> object not removed" );
1083  return;
1084  }
1085 
1086  if ( m_pSortedObjs )
1087  {
1088  m_pSortedObjs->Remove( _rToRemoveObj );
1089  if ( !m_pSortedObjs->size() )
1090  {
1091  m_pSortedObjs.reset();
1092  }
1093  if ( GetUpper() )
1094  {
1095  if (RndStdIds::FLY_AS_CHAR !=
1096  _rToRemoveObj.GetFrameFormat().GetAnchor().GetAnchorId())
1097  {
1098  static_cast<SwRootFrame*>(GetUpper())->SetSuperfluous();
1099  InvalidatePage();
1100  }
1101  static_cast<SwRootFrame*>(GetUpper())->InvalidateBrowseWidth();
1102  }
1103  }
1104  _rToRemoveObj.SetPageFrame( nullptr );
1105 }
1106 
1107 // #i50432# - adjust method description and synopsis.
1109 {
1110  // #i50432# - consider the case that page is an empty page:
1111  // In this case append the fly frame at the next page
1112  OSL_ENSURE( !IsEmptyPage() || GetNext(),
1113  "<SwPageFrame::PlaceFly(..)> - empty page with no next page! -> fly frame appended at empty page" );
1114  if ( IsEmptyPage() && GetNext() )
1115  {
1116  static_cast<SwPageFrame*>(GetNext())->PlaceFly( pFly, pFormat );
1117  }
1118  else
1119  {
1120  // If we received a Fly, we use that one. Otherwise, create a new
1121  // one using the Format.
1122  if ( pFly )
1123  AppendFly( pFly );
1124  else
1125  {
1126  OSL_ENSURE( pFormat, ":-( No Format given for Fly." );
1127  pFly = new SwFlyLayFrame( pFormat, this, this );
1128  AppendFly( pFly );
1129  ::RegistFlys( this, pFly );
1130  }
1131  }
1132 }
1133 
1134 // #i18732# - adjustments for following text flow or not
1135 // AND alignment at 'page areas' for to paragraph/to character anchored objects
1136 // #i22305# - adjustment for following text flow for to frame anchored objects
1137 // #i29778# - Because calculating the floating screen object's position
1138 // (Writer fly frame or drawing object) doesn't perform a calculation on its
1139 // upper frames and its anchor frame, a calculation of the upper frames in this
1140 // method is no longer sensible.
1141 // #i28701# - if document compatibility option 'Consider wrapping style influence
1142 // on object positioning' is ON, the clip area corresponds to the one as the
1143 // object doesn't follow the text flow.
1144 bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove )
1145 {
1146  bool bRet = true;
1147  if ( auto pVirtFlyDrawObj = dynamic_cast<const SwVirtFlyDrawObj*>(pSdrObj) )
1148  {
1149  const SwFlyFrame* pFly = pVirtFlyDrawObj->GetFlyFrame();
1150  const bool bFollowTextFlow = pFly->GetFormat()->GetFollowTextFlow().GetValue();
1151  // #i28701#
1152  const bool bConsiderWrapOnObjPos =
1154  const SwFormatVertOrient &rV = pFly->GetFormat()->GetVertOrient();
1155  if( pFly->IsFlyLayFrame() )
1156  {
1157  const SwFrame* pClip;
1158  // #i22305#
1159  // #i28701#
1160  if ( !bFollowTextFlow || bConsiderWrapOnObjPos )
1161  {
1162  pClip = pFly->GetAnchorFrame()->FindPageFrame();
1163  }
1164  else
1165  {
1166  pClip = pFly->GetAnchorFrame();
1167  }
1168 
1169  rRect = pClip->getFrameArea();
1170  SwRectFnSet aRectFnSet(pClip);
1171 
1172  // vertical clipping: Top and Bottom, also to PrtArea if necessary
1174  rV.GetRelationOrient() == text::RelOrientation::PRINT_AREA )
1175  {
1176  aRectFnSet.SetTop( rRect, aRectFnSet.GetPrtTop(*pClip) );
1177  aRectFnSet.SetBottom( rRect, aRectFnSet.GetPrtBottom(*pClip) );
1178  }
1179  // horizontal clipping: Top and Bottom, also to PrtArea if necessary
1180  const SwFormatHoriOrient &rH = pFly->GetFormat()->GetHoriOrient();
1182  rH.GetRelationOrient() == text::RelOrientation::PRINT_AREA )
1183  {
1184  aRectFnSet.SetLeft( rRect, aRectFnSet.GetPrtLeft(*pClip) );
1185  aRectFnSet.SetRight(rRect, aRectFnSet.GetPrtRight(*pClip));
1186  }
1187  }
1188  else if( pFly->IsFlyAtContentFrame() )
1189  {
1190  // #i18732# - consider following text flow or not
1191  // AND alignment at 'page areas'
1192  const SwFrame* pVertPosOrientFrame = pFly->GetVertPosOrientFrame();
1193  if ( !pVertPosOrientFrame )
1194  {
1195  OSL_FAIL( "::CalcClipRect(..) - frame, vertical position is oriented at, is missing .");
1196  pVertPosOrientFrame = pFly->GetAnchorFrame();
1197  }
1198 
1199  if ( !bFollowTextFlow || bConsiderWrapOnObjPos )
1200  {
1201  const SwLayoutFrame* pClipFrame = pVertPosOrientFrame->FindPageFrame();
1202  if (!pClipFrame)
1203  {
1204  OSL_FAIL("!pClipFrame: "
1205  "if you can reproduce this please file a bug");
1206  return false;
1207  }
1208  rRect = bMove ? pClipFrame->GetUpper()->getFrameArea()
1209  : pClipFrame->getFrameArea();
1210  // #i26945# - consider that a table, during
1211  // its format, can exceed its upper printing area bottom.
1212  // Thus, enlarge the clip rectangle, if such a case occurred
1213  if ( pFly->GetAnchorFrame()->IsInTab() )
1214  {
1215  const SwTabFrame* pTabFrame = const_cast<SwFlyFrame*>(pFly)
1216  ->GetAnchorFrameContainingAnchPos()->FindTabFrame();
1217  SwRect aTmp( pTabFrame->getFramePrintArea() );
1218  aTmp += pTabFrame->getFrameArea().Pos();
1219  rRect.Union( aTmp );
1220  // #i43913# - consider also the cell frame
1221  const SwFrame* pCellFrame = const_cast<SwFlyFrame*>(pFly)
1222  ->GetAnchorFrameContainingAnchPos()->GetUpper();
1223  while ( pCellFrame && !pCellFrame->IsCellFrame() )
1224  {
1225  pCellFrame = pCellFrame->GetUpper();
1226  }
1227  if ( pCellFrame )
1228  {
1229  aTmp = pCellFrame->getFramePrintArea();
1230  aTmp += pCellFrame->getFrameArea().Pos();
1231  rRect.Union( aTmp );
1232  }
1233  }
1234  }
1235  else if ( rV.GetRelationOrient() == text::RelOrientation::PAGE_FRAME ||
1236  rV.GetRelationOrient() == text::RelOrientation::PAGE_PRINT_AREA )
1237  {
1238  // new class <SwEnvironmentOfAnchoredObject>
1240  aEnvOfObj( bFollowTextFlow );
1241  const SwLayoutFrame& rVertClipFrame =
1242  aEnvOfObj.GetVertEnvironmentLayoutFrame( *pVertPosOrientFrame );
1243  if ( rV.GetRelationOrient() == text::RelOrientation::PAGE_FRAME )
1244  {
1245  rRect = rVertClipFrame.getFrameArea();
1246  }
1247  else if ( rV.GetRelationOrient() == text::RelOrientation::PAGE_PRINT_AREA )
1248  {
1249  if ( rVertClipFrame.IsPageFrame() )
1250  {
1251  rRect = static_cast<const SwPageFrame&>(rVertClipFrame).PrtWithoutHeaderAndFooter();
1252  }
1253  else
1254  {
1255  rRect = rVertClipFrame.getFrameArea();
1256  }
1257  }
1258  const SwLayoutFrame* pHoriClipFrame =
1259  pFly->GetAnchorFrame()->FindPageFrame()->GetUpper();
1260  SwRectFnSet aRectFnSet(pFly->GetAnchorFrame());
1261  aRectFnSet.SetLeft( rRect, aRectFnSet.GetLeft(pHoriClipFrame->getFrameArea()) );
1262  aRectFnSet.SetRight(rRect, aRectFnSet.GetRight(pHoriClipFrame->getFrameArea()));
1263  }
1264  else
1265  {
1266  // #i26945#
1267  const SwFrame *pClip =
1268  const_cast<SwFlyFrame*>(pFly)->GetAnchorFrameContainingAnchPos();
1269  SwRectFnSet aRectFnSet(pClip);
1270  const SwLayoutFrame *pUp = pClip->GetUpper();
1271  const SwFrame *pCell = pUp->IsCellFrame() ? pUp : nullptr;
1272  const SwFrameType nType = bMove
1277 
1278  while ( !(pUp->GetType() & nType) || pUp->IsColBodyFrame() )
1279  {
1280  pUp = pUp->GetUpper();
1281  if ( !pCell && pUp->IsCellFrame() )
1282  pCell = pUp;
1283  }
1284  if ( bMove && pUp->IsRootFrame() )
1285  {
1286  rRect = pUp->getFramePrintArea();
1287  rRect += pUp->getFrameArea().Pos();
1288  pUp = nullptr;
1289  }
1290  if ( pUp )
1291  {
1292  if ( pUp->GetType() & SwFrameType::Body )
1293  {
1294  const SwPageFrame *pPg;
1295  if ( pUp->GetUpper() != (pPg = pFly->FindPageFrame()) )
1296  pUp = pPg->FindBodyCont();
1297  if (pUp)
1298  {
1299  rRect = pUp->GetUpper()->getFrameArea();
1300  aRectFnSet.SetTop( rRect, aRectFnSet.GetPrtTop(*pUp) );
1301  aRectFnSet.SetBottom(rRect, aRectFnSet.GetPrtBottom(*pUp));
1302  }
1303  }
1304  else
1305  {
1306  if( ( pUp->GetType() & (SwFrameType::Fly | SwFrameType::Ftn ) ) &&
1307  !pUp->getFrameArea().IsInside( pFly->getFrameArea().Pos() ) )
1308  {
1309  if( pUp->IsFlyFrame() )
1310  {
1311  const SwFlyFrame *pTmpFly = static_cast<const SwFlyFrame*>(pUp);
1312  while( pTmpFly->GetNextLink() )
1313  {
1314  pTmpFly = pTmpFly->GetNextLink();
1315  if( pTmpFly->getFrameArea().IsInside( pFly->getFrameArea().Pos() ) )
1316  break;
1317  }
1318  pUp = pTmpFly;
1319  }
1320  else if( pUp->IsInFootnote() )
1321  {
1322  const SwFootnoteFrame *pTmp = pUp->FindFootnoteFrame();
1323  while( pTmp->GetFollow() )
1324  {
1325  pTmp = pTmp->GetFollow();
1326  if( pTmp->getFrameArea().IsInside( pFly->getFrameArea().Pos() ) )
1327  break;
1328  }
1329  pUp = pTmp;
1330  }
1331  }
1332  rRect = pUp->getFramePrintArea();
1333  rRect.Pos() += pUp->getFrameArea().Pos();
1334  if ( pUp->GetType() & (SwFrameType::Header | SwFrameType::Footer) )
1335  {
1336  rRect.Left ( pUp->GetUpper()->getFrameArea().Left() );
1337  rRect.Width( pUp->GetUpper()->getFrameArea().Width());
1338  }
1339  else if ( pUp->IsCellFrame() ) //MA_FLY_HEIGHT
1340  {
1341  const SwFrame *pTab = pUp->FindTabFrame();
1342  aRectFnSet.SetBottom( rRect, aRectFnSet.GetPrtBottom(*pTab->GetUpper()) );
1343  // expand to left and right cell border
1344  rRect.Left ( pUp->getFrameArea().Left() );
1345  rRect.Width( pUp->getFrameArea().Width() );
1346  }
1347  }
1348  }
1349  if ( pCell )
1350  {
1351  // CellFrames might also sit in unallowed areas. In this case,
1352  // the Fly is allowed to do so as well
1353  SwRect aTmp( pCell->getFramePrintArea() );
1354  aTmp += pCell->getFrameArea().Pos();
1355  rRect.Union( aTmp );
1356  }
1357  }
1358  }
1359  else
1360  {
1361  const SwFrame *pUp = pFly->GetAnchorFrame()->GetUpper();
1362  SwRectFnSet aRectFnSet(pFly->GetAnchorFrame());
1363  while( pUp->IsColumnFrame() || pUp->IsSctFrame() || pUp->IsColBodyFrame())
1364  pUp = pUp->GetUpper();
1365  rRect = pUp->getFrameArea();
1366  if( !pUp->IsBodyFrame() )
1367  {
1368  rRect += pUp->getFramePrintArea().Pos();
1369  rRect.SSize( pUp->getFramePrintArea().SSize() );
1370  if ( pUp->IsCellFrame() )
1371  {
1372  const SwFrame *pTab = pUp->FindTabFrame();
1373  aRectFnSet.SetBottom( rRect, aRectFnSet.GetPrtBottom(*pTab->GetUpper()) );
1374  }
1375  }
1376  else if ( pUp->GetUpper()->IsPageFrame() )
1377  {
1378  // Objects anchored as character may exceed right margin
1379  // of body frame:
1380  aRectFnSet.SetRight( rRect, aRectFnSet.GetRight(pUp->GetUpper()->getFrameArea()) );
1381  }
1382  tools::Long nHeight = (9*aRectFnSet.GetHeight(rRect))/10;
1383  tools::Long nTop;
1384  const SwFormat *pFormat = GetUserCall(pSdrObj)->GetFormat();
1385  const SvxULSpaceItem &rUL = pFormat->GetULSpace();
1386  if( bMove )
1387  {
1388  nTop = aRectFnSet.IsVert() ? static_cast<const SwFlyInContentFrame*>(pFly)->GetRefPoint().X() :
1389  static_cast<const SwFlyInContentFrame*>(pFly)->GetRefPoint().Y();
1390  nTop = aRectFnSet.YInc( nTop, -nHeight );
1391  tools::Long nWidth = aRectFnSet.GetWidth(pFly->getFrameArea());
1392  aRectFnSet.SetLeftAndWidth( rRect, aRectFnSet.IsVert() ?
1393  static_cast<const SwFlyInContentFrame*>(pFly)->GetRefPoint().Y() :
1394  static_cast<const SwFlyInContentFrame*>(pFly)->GetRefPoint().X(), nWidth );
1395  nHeight = 2*nHeight - rUL.GetLower() - rUL.GetUpper();
1396  }
1397  else
1398  {
1399  nTop = aRectFnSet.YInc( aRectFnSet.GetBottom(pFly->getFrameArea()),
1400  rUL.GetLower() - nHeight );
1401  nHeight = 2*nHeight - aRectFnSet.GetHeight(pFly->getFrameArea())
1402  - rUL.GetLower() - rUL.GetUpper();
1403  }
1404  aRectFnSet.SetTopAndHeight( rRect, nTop, nHeight );
1405  }
1406  }
1407  else
1408  {
1409  const SwDrawContact *pC = static_cast<const SwDrawContact*>(GetUserCall(pSdrObj));
1410  const SwFrameFormat *pFormat = pC->GetFormat();
1411  const SwFormatAnchor &rAnch = pFormat->GetAnchor();
1412  if ( RndStdIds::FLY_AS_CHAR == rAnch.GetAnchorId() )
1413  {
1414  const SwFrame* pAnchorFrame = pC->GetAnchorFrame( pSdrObj );
1415  if( !pAnchorFrame )
1416  {
1417  OSL_FAIL( "<::CalcClipRect(..)> - missing anchor frame." );
1418  const_cast<SwDrawContact*>(pC)->ConnectToLayout();
1419  pAnchorFrame = pC->GetAnchorFrame();
1420  }
1421  const SwFrame* pUp = pAnchorFrame->GetUpper();
1422  rRect = pUp->getFramePrintArea();
1423  rRect += pUp->getFrameArea().Pos();
1424  SwRectFnSet aRectFnSet(pAnchorFrame);
1425  tools::Long nHeight = (9*aRectFnSet.GetHeight(rRect))/10;
1426  tools::Long nTop;
1427  const SvxULSpaceItem &rUL = pFormat->GetULSpace();
1428  SwRect aSnapRect( pSdrObj->GetSnapRect() );
1429  tools::Long nTmpH = 0;
1430  if( bMove )
1431  {
1432  nTop = aRectFnSet.YInc( aRectFnSet.IsVert() ? pSdrObj->GetAnchorPos().X() :
1433  pSdrObj->GetAnchorPos().Y(), -nHeight );
1434  tools::Long nWidth = aRectFnSet.GetWidth(aSnapRect);
1435  aRectFnSet.SetLeftAndWidth( rRect, aRectFnSet.IsVert() ?
1436  pSdrObj->GetAnchorPos().Y() :
1437  pSdrObj->GetAnchorPos().X(), nWidth );
1438  }
1439  else
1440  {
1441  // #i26791# - value of <nTmpH> is needed to
1442  // calculate value of <nTop>.
1443  nTmpH = aRectFnSet.IsVert() ? pSdrObj->GetCurrentBoundRect().GetWidth() :
1444  pSdrObj->GetCurrentBoundRect().GetHeight();
1445  nTop = aRectFnSet.YInc( aRectFnSet.GetTop(aSnapRect),
1446  rUL.GetLower() + nTmpH - nHeight );
1447  }
1448  nHeight = 2*nHeight - nTmpH - rUL.GetLower() - rUL.GetUpper();
1449  aRectFnSet.SetTopAndHeight( rRect, nTop, nHeight );
1450  }
1451  else
1452  {
1453  // restrict clip rectangle for drawing
1454  // objects in header/footer to the page frame.
1455  // #i26791#
1456  const SwFrame* pAnchorFrame = pC->GetAnchorFrame( pSdrObj );
1457  if ( pAnchorFrame && pAnchorFrame->FindFooterOrHeader() )
1458  {
1459  // clip frame is the page frame the header/footer is on.
1460  const SwFrame* pClipFrame = pAnchorFrame->FindPageFrame();
1461  rRect = pClipFrame->getFrameArea();
1462  }
1463  else
1464  {
1465  bRet = false;
1466  }
1467  }
1468  }
1469  return bRet;
1470 }
1471 
1472 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool GetValue() const
SwFrame * FindFooterOrHeader()
Definition: findfrm.cxx:548
void SetTop(SwRect &rRect, tools::Long nNew) const
Definition: frame.hxx:1387
void transform(const basegfx::B2DHomMatrix &aTransform)
Definition: wsfrm.cxx:286
const SwVirtFlyDrawObj * GetVirtDrawObj() const
Definition: fly.cxx:2783
Base class of the Writer layout elements.
Definition: frame.hxx:315
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: flylay.cxx:726
virtual bool IsFormatPossible() const override
method to determine if a format on the Writer fly frame is possible
Definition: fly.cxx:2864
virtual void SwClientNotify(const SwModify &rMod, const SfxHint &rHint) override
Definition: fly.cxx:661
bool IsFlyLayFrame() const
Definition: flyfrm.hxx:217
Point GetPos(const SwRect &rRect) const
Definition: frame.hxx:1384
virtual const SwFlyFrameFormat * GetFormat() const override
Definition: fly.cxx:2877
void SetNotifyBack()
Definition: flyfrm.hxx:225
const SwSortedObjs * GetDrawObjs() const
Definition: frame.hxx:565
double getLocalFrameRotation() const
Definition: flylay.cxx:421
SdrObject & ReferencedObj()
virtual const tools::Rectangle & GetCurrentBoundRect() const
SwContentNode * GetNode(SwPaM &rPam, bool &rbFirst, SwMoveFnCollection const &fnMove, bool const bInReadOnly, SwRootFrame const *const i_pLayout)
This function returns the next node in direction of search.
Definition: pam.cxx:823
tools::Long GetPrtRight(const SwFrame &rFrame) const
Definition: frame.hxx:1413
bool IsInFly() const
Definition: frame.hxx:962
SwRect & Union(const SwRect &rRect)
Definition: swrect.cxx:41
bool IsRootFrame() const
Definition: frame.hxx:1175
sal_uInt16 GetLower() const
bool IsInSct() const
Definition: frame.hxx:968
void SetHeight(tools::Long n)
drawinglayer::attribute::SdrAllFillAttributesHelperPtr getSdrAllFillAttributesHelper() const
Definition: findfrm.cxx:694
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
Definition: ndole.hxx:161
const SwLayoutFrame & GetVertEnvironmentLayoutFrame(const SwFrame &_rVertOrientFrame) const
determine environment layout frame for possible vertical object positions respectively for alignments...
TransformableSwFrame * getTransformableSwFrame()
Definition: flyfrms.hxx:132
SwRect maUnclippedFrame
Definition: flyfrms.hxx:43
virtual basegfx::B2DHomMatrix getFrameAreaTransformation() const override
Definition: flylay.cxx:372
std::string GetValue
bool IsColLocked() const
Definition: frame.hxx:887
static SwContentNode * GetContentNode(SwDoc &rDoc, SwNodeIndex &rIdx, bool bNext)
Definition: fltshell.cxx:53
virtual bool IsFormatPossible() const override
method to determine, if a format on the Writer fly frame is possible
Definition: flylay.cxx:711
bool equalZero(const T &rfVal)
void MakeContentPos(const SwBorderAttrs &rAttrs)
Definition: fly.cxx:1767
virtual void NotifyBackground(SwPageFrame *pPage, const SwRect &rRect, PrepareHint eHint) override
Notifies the background (all ContentFrames that currently are overlapping).
Definition: flylay.cxx:106
const SwFormatVertOrient & GetVertOrient(bool=true) const
Definition: fmtornt.hxx:106
void Left(const tools::Long nLeft)
Definition: swrect.hxx:194
virtual void InvalidateObjPos() override
method to invalidate position of the anchored object
Definition: fly.cxx:2795
void SetCompletePaint() const
Definition: frame.hxx:995
bool IsInFootnote() const
Definition: frame.hxx:950
SwFrameType GetType() const
Definition: frame.hxx:520
bool IsNoMoveOnCheckClip() const
Definition: flyfrms.hxx:88
virtual basegfx::B2DHomMatrix getFramePrintAreaTransformation() const
Definition: wsfrm.cxx:134
long Long
const SdrPage * GetDrawPage() const
Definition: rootfrm.hxx:227
const SwRect & getFramePrintArea() const
Definition: frame.hxx:181
#define MINLAY
Definition: swtypes.hxx:63
static SwCache & GetCache()
Definition: frame.hxx:522
SwTabFrame is one table in the document layout, containing rows (which contain cells).
Definition: tabfrm.hxx:46
void RemoveDrawObjFromPage(SwAnchoredObject &_rToRemoveObj)
Definition: flylay.cxx:1078
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Definition: node.cxx:1213
bool IsInserted() const
void Unlock()
Definition: flyfrm.hxx:146
bool IsVert() const
Definition: frame.hxx:1368
void Pos(const Point &rNew)
Definition: swrect.hxx:168
RotateFlyFrame3: Helper class when you want to make your SwFrame derivate transformable.
Definition: frame.hxx:236
virtual void Calc(vcl::RenderContext *pRenderContext) const
Definition: trvlfrm.cxx:1788
bool IsCellFrame() const
Definition: frame.hxx:1227
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
void AssertFlyPages()
Ensures that enough pages exist, so that all page bound frames and draw objects can be placed...
Definition: pagechg.cxx:1541
tools::Long GetWidth(const SwRect &rRect) const
Definition: frame.hxx:1382
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:55
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Center
void Notify_Background(const SdrObject *pObj, SwPageFrame *pPage, const SwRect &rRect, const PrepareHint eHint, const bool bInva)
Definition: frmtool.cxx:3351
The root element of a Writer document layout.
Definition: rootfrm.hxx:82
virtual basegfx::B2DHomMatrix getFrameAreaTransformation() const
Definition: wsfrm.cxx:124
SwContact * GetUserCall(const SdrObject *pObj)
Returns the UserCall if applicable from the group object.
Definition: dcontact.cxx:171
void InvalidateFlyInCnt() const
Definition: pagefrm.hxx:372
SwFlyLayFrame(SwFlyFrameFormat *, SwFrame *, SwFrame *pAnchor)
Definition: flylay.cxx:718
SfxHintId GetId() const
bool isFrameAreaDefinitionValid() const
Definition: frame.hxx:172
double getLocalFrameRotation() const
Definition: notxtfrm.cxx:630
bool m_bWidthClipped
Definition: flyfrm.hxx:123
virtual SwFrameFormat & GetFrameFormat() override
Definition: fly.cxx:2802
virtual const tools::Rectangle & GetSnapRect() const
sal_uInt16 GetPhyPageNum() const
Definition: pagefrm.hxx:204
bool IsFlyAtContentFrame() const
Definition: flyfrm.hxx:218
tools::Long GetTop(const SwRect &rRect) const
Definition: frame.hxx:1378
SwRect & Intersection_(const SwRect &rRect)
Definition: swrect.cxx:80
constexpr tools::Long Width() const
void RemoveFlyFromPage(SwFlyFrame *pToRemove)
Definition: flylay.cxx:886
bool IsFlyFrame() const
Definition: frame.hxx:1211
virtual void DestroyImpl() override
Definition: flylay.cxx:63
void ChgLowersProp(const Size &rOldSize)
Change size of lowers proportionally.
Definition: wsfrm.cxx:3012
void SetBottom(SwRect &rRect, tools::Long nNew) const
Definition: frame.hxx:1388
wrapper class for the positioning of Writer fly frames and drawing objects
void AppendFly(SwFlyFrame *pNew)
Definition: fly.cxx:2180
SdrPage * getSdrPageFromSdrObject() const
void restoreFrameAreas()
Definition: wsfrm.cxx:268
const SwFrame * GetAnchorFrame(const SdrObject *_pDrawObj=nullptr) const
Definition: dcontact.cxx:803
const SwRect & getFrameArea() const
Definition: frame.hxx:180
bool IsEmptyPage() const
Definition: pagefrm.hxx:157
bool isTransformableSwFrame() const
Definition: flyfrms.hxx:131
bool IsInTab() const
Definition: frame.hxx:956
void CheckClip(const SwFormatFrameSize &rSz)
Definition: flylay.cxx:472
std::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr
Definition: format.hxx:41
void InvalidateFlyContent() const
Definition: pagefrm.hxx:368
constexpr tools::Long GetWidth() const
tools::Long GetPrtLeft(const SwFrame &rFrame) const
Definition: frame.hxx:1412
void Width(tools::Long nNew)
Definition: swrect.hxx:186
void Lock()
Definition: flyfrm.hxx:145
void setFramePrintAreaValid(bool bNew)
Definition: wsfrm.cxx:99
const SdrObject & GetReferencedObj() const
bool IsSctFrame() const
Definition: frame.hxx:1215
SwFlyFrame * FindFlyFrame()
Definition: frame.hxx:1112
SwFrameFormat * FindFrameFormat(SdrObject *pObj)
The Get reverse way: seeks the format to the specified object.
Definition: dcontact.cxx:120
static bool IsDraggingOffPageAllowed(const SwFrameFormat *)
method to determine if dragging objects off page is allowed
SdrObject * DrawObj()
bool IsFlyInContentFrame() const
Definition: flyfrm.hxx:215
virtual void transform_translate(const Point &rOffset) override
Definition: flylay.cxx:397
SwFrame * AnchorFrame()
sal_uInt32 GetOrdNumDirect() const
bool CalcClipRect(const SdrObject *pSdrObj, SwRect &rRect, bool bMove)
calculate rectangle in that the object can be moved or rather be resized
Definition: flylay.cxx:1144
const SwAttrSet * GetAttrSet() const
WARNING: this may not return correct RES_PAGEDESC/RES_BREAK items for SwTextFrame, use GetBreakItem()/GetPageDescItem() instead.
Definition: findfrm.cxx:677
Base class for various Writer styles.
Definition: format.hxx:46
void PlaceFly(SwFlyFrame *pFly, SwFlyFrameFormat *pFormat)
Definition: flylay.cxx:1108
double getLocalFrameRotation_from_SwNoTextFrame(const SwNoTextFrame &rNoTextFrame)
Definition: flylay.cxx:416
bool IsColumnFrame() const
Definition: frame.hxx:1183
SwFootnoteFrame * FindFootnoteFrame()
Definition: frame.hxx:1108
virtual ~SwFlyFreeFrame() override
Definition: flylay.cxx:91
bool IsInDtor() const
Definition: frame.hxx:893
bool m_bLayout
RndStdIds::FLY_AT_PAGE, RndStdIds::FLY_AT_FLY, at page or at frame.
Definition: flyfrm.hxx:131
void InvalidateAutoCompleteWords() const
Definition: pagefrm.hxx:393
const SwFormatFollowTextFlow & GetFollowTextFlow(bool=true) const
void CalcContent(SwLayoutFrame *pLay, bool bNoColl=false)
Definition: fly.cxx:1411
Style of a layout element.
Definition: frmfmt.hxx:59
PrepareHint
Definition: swtypes.hxx:194
void RemoveFly(SwFlyFrame *pToRemove)
Definition: fly.cxx:2198
std::unique_ptr< TransformableSwFrame > mpTransformableSwFrame
Definition: flyfrms.hxx:46
const SdrObject * GetDrawObj() const
const SwSortedObjs * GetSortedObjs() const
Definition: pagefrm.hxx:132
void MakePrtArea(const SwBorderAttrs &rAttrs)
Definition: fly.cxx:1752
void InvalidateSpelling() const
Definition: pagefrm.hxx:384
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
tools::Long GetPrtBottom(const SwFrame &rFrame) const
Definition: frame.hxx:1411
void SetAssertFlyPages()
Makes sure that all requested page-bound Flys find a Page.
Definition: rootfrm.hxx:278
SwFrameType
Definition: frame.hxx:75
void Remove(SwAnchoredObject &_rAnchoredObj)
Definition: sortedobjs.cxx:229
bool Insert(SwAnchoredObject &_rAnchoredObj)
Definition: sortedobjs.cxx:208
SwFrameFormat * GetFormat()
Definition: dcontact.hxx:112
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
const SwFormatHoriOrient & GetHoriOrient(bool=true) const
Definition: fmtornt.hxx:108
void ColUnlock()
Definition: frame.hxx:450
SwPageFrame * FindPageFrame()
Definition: frame.hxx:681
tools::Long YInc(tools::Long n1, tools::Long n2) const
Definition: frame.hxx:1426
void AppendDrawObjToPage(SwAnchoredObject &_rNewObj)
Definition: flylay.cxx:1029
const SwFrame * Lower() const
Definition: layfrm.hxx:101
void InvalidatePage(const SwPageFrame *pPage=nullptr) const
Invalidates the page in which the Frame is currently placed.
Definition: wsfrm.cxx:607
tools::Long GetHeight(const SwRect &rRect) const
Definition: frame.hxx:1383
FlyAnchors.
Definition: fmtanchr.hxx:34
void SetRight(SwRect &rRect, tools::Long nNew) const
Definition: frame.hxx:1390
SwLayoutFrame * GetUpper()
Definition: frame.hxx:679
bool HasArea() const
Definition: swrect.hxx:280
void InvalidateSmartTags() const
Definition: pagefrm.hxx:389
virtual void DestroyImpl() override
Definition: fly.cxx:259
const SwRect & GetObjRectWithSpaces() const
method to determine object area inclusive its spacing
bool isFramePrintAreaValid() const
Definition: frame.hxx:169
void UnlockModify()
Definition: calbck.hxx:210
bool HasEnvironmentAutoSize() const
determines, if direct environment of fly frame has 'auto' size
Definition: flylay.cxx:446
sal_Int16 GetHoriOrient() const
Definition: fmtornt.hxx:87
bool IsRowFrame() const
Definition: frame.hxx:1223
sal_uInt32 GetOrdNum() const
tools::Long GetPrtTop(const SwFrame &rFrame) const
Definition: frame.hxx:1410
void LockModify()
Definition: calbck.hxx:209
virtual basegfx::B2DHomMatrix getFramePrintAreaTransformation() const override
Definition: flylay.cxx:384
bool m_bValidContentPos
Definition: flyfrm.hxx:139
const SwAttrSet & GetAttrSet() const
Definition: frmtool.hxx:386
virtual const IDocumentDrawModelAccess & getIDocumentDrawModelAccess() override
Definition: fly.cxx:304
Marks a node in the document model.
Definition: ndindex.hxx:31
bool isFrameAreaPositionValid() const
Definition: frame.hxx:167
void MoveFly(SwFlyFrame *pToMove, SwPageFrame *pDest)
Definition: flylay.cxx:934
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:123
const IDocumentSettingAccess & getIDocumentSettingAccess() const
Provides access to the document settings interface.
Definition: format.cxx:717
void SSize(const Size &rNew)
Definition: swrect.hxx:177
bool isFrameAreaSizeValid() const
Definition: frame.hxx:168
bool IsNoMakePos() const
Definition: flyfrms.hxx:100
void InvalidateFlyLayout() const
Validate, invalidate and query the Page status Layout/Content and Fly/non-Fly respectively are inspec...
Definition: pagefrm.hxx:364
A page of the document layout.
Definition: pagefrm.hxx:57
virtual SdrObject * RemoveObject(size_t nObjNum)
virtual void MakeAll(vcl::RenderContext *pRenderContext) override
Definition: flylay.cxx:112
Frame cannot be moved in Var-direction.
virtual void MakeObjPos() override
method to determine position for the object and set the position at the object
Definition: fly.cxx:1723
SwBorderAttrs * Get()
Definition: frmtool.cxx:2643
void SetWidth(tools::Long n)
SwSectionFrame * FindSctFrame()
Definition: frame.hxx:1116
SwLayoutFrame * FindBodyCont()
Searches the first ContentFrame in BodyText below the page.
Definition: findfrm.cxx:43
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:450
bool m_bHeightClipped
Definition: flyfrm.hxx:122
void setFrameAreaPositionValid(bool bNew)
Definition: wsfrm.cxx:83
void SetTopAndHeight(SwRect &rRect, tools::Long nTop, tools::Long nHeight) const
Definition: frame.hxx:1429
const SwLayoutFrame * GetVertPosOrientFrame() const
const SvxULSpaceItem & GetULSpace(bool=true) const
Definition: frmatr.hxx:76
bool HasBorder(bool bTreatPaddingAsBorder) const
general base class for all free-flowing frames
Definition: flyfrm.hxx:78
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:88
virtual SwFrameFormat & GetFrameFormat()=0
#define SAL_WARN_IF(condition, area, stream)
bool IsLocked() const
Definition: flyfrm.hxx:213
constexpr tools::Long Height() const
SwPageFrame * GetPageFrame()
void ClrContourCache(const SdrObject *pObj)
Definition: txtfly.cxx:134
bool supportsAutoContour() const
Definition: flylay.cxx:301
void SetOrdNum(sal_uInt32 nNum)
bool m_bFormatHeightOnly
Definition: flyfrm.hxx:126
void SetPageFrame(SwPageFrame *_pNewPageFrame)
bool IsInside(const Point &rPOINT) const
Definition: swrect.cxx:105
bool IsNoTextFrame() const
Definition: frame.hxx:1239
const SwFootnoteFrame * GetFollow() const
Definition: ftnfrm.hxx:116
SwNodes & GetNodes()
Definition: doc.hxx:409
bool IsClipped() const
Definition: flyfrm.hxx:228
void Top(const tools::Long nTop)
Definition: swrect.hxx:203
bool IsColBodyFrame() const
These SwFrame inlines are here, so that frame.hxx does not need to include layfrm.hxx.
Definition: layfrm.hxx:209
void setFrameAreaSizeValid(bool bNew)
Definition: wsfrm.cxx:91
SwFlyFrame * GetNextLink() const
Definition: flyfrm.hxx:195
SwFrame * GetLower()
Definition: findfrm.cxx:170
bool IsPageFrame() const
Definition: frame.hxx:1179
QPRO_FUNC_TYPE nType
const basegfx::B2DHomMatrix & getLocalFrameAreaTransformation() const
Definition: frame.hxx:256
static const SwFormatAnchor * GetAnchorFromPoolItem(const SfxPoolItem &rItem)
Definition: fly.cxx:2948
virtual bool supportsFullDrawingLayerFillAttributeSet() const override
Definition: atrfrm.cxx:2593
sal_Int16 GetVertOrient() const
Definition: fmtornt.hxx:54
void AppendFlyToPage(SwFlyFrame *pNew)
Definition: flylay.cxx:789
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
const Point & GetAnchorPos() const
constexpr TypedWhichId< SvxBoxItem > RES_BOX(106)
virtual void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr) override
"Formats" the Frame; Frame and PrtArea.
Definition: fly.cxx:1239
void SetLeft(SwRect &rRect, tools::Long nNew) const
Definition: frame.hxx:1389
void InvalidateAll()
Definition: frame.hxx:1056
virtual SdrObject * SetObjectOrdNum(size_t nOldObjNum, size_t nNewObjNum)
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame...
Definition: layfrm.hxx:35
void RegistFlys(SwPageFrame *, const SwLayoutFrame *)
Definition: frmtool.cxx:3188
const SwFrame * GetAnchorFrame() const
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
void adaptFrameAreasToTransformations()
Definition: wsfrm.cxx:233
void InvalidateWordCount() const
Definition: pagefrm.hxx:397
bool PositionLocked() const
bool IsBodyFrame() const
Definition: frame.hxx:1207
void SetLeftAndWidth(SwRect &rRect, tools::Long nLeft, tools::Long nWidth) const
Definition: frame.hxx:1428
class for collecting anchored objects
Definition: sortedobjs.hxx:48
void ColLock()
Definition: frame.hxx:449
void Height(tools::Long nNew)
Definition: swrect.hxx:190
void createFrameAreaTransformations(double fRotation, const basegfx::B2DPoint &rCenter)
Definition: wsfrm.cxx:213
const basegfx::B2DHomMatrix & getLocalFramePrintAreaTransformation() const
Definition: frame.hxx:262
SwContentNode * GoNext(SwNodeIndex *) const
Definition: nodes.cxx:1293
bool IsFooterFrame() const
Definition: frame.hxx:1195
SwRootFrame * getRootFrame()
Definition: frame.hxx:680
virtual void transform_translate(const Point &rOffset)
Definition: wsfrm.cxx:147
std::unique_ptr< SwSortedObjs > m_pSortedObjs
Definition: pagefrm.hxx:61
SwFlyFreeFrame(SwFlyFrameFormat *, SwFrame *, SwFrame *pAnchor)
Definition: flylay.cxx:54
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:101
sal_uInt16 GetUpper() const
bool IsHeaderFrame() const
Definition: frame.hxx:1191
constexpr tools::Long GetHeight() const
SwFrameSize GetHeightSizeType() const
Definition: fmtfsize.hxx:80
SwTabFrame * FindTabFrame()
Definition: frame.hxx:1100
SwFrame * GetNext()
Definition: frame.hxx:677