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 
51 using namespace ::com::sun::star;
52 
54 : SwFlyFrame( pFormat, pSib, pAnch ),
55  // #i34753#
56  mbNoMakePos( false ),
57  // #i37068#
58  mbNoMoveOnCheckClip( false ),
59  maUnclippedFrame(),
60  // RotateFlyFrame3
61  mpTransformableSwFrame()
62 {
63 }
64 
66 {
67  // #i28701# - use new method <GetPageFrame()>
68  if( GetPageFrame() )
69  {
70  if( GetFormat()->GetDoc()->IsInDtor() )
71  {
72  // #i29879# - remove also to-frame anchored Writer
73  // fly frame from page.
74  const bool bRemoveFromPage =
76  ( IsFlyAtContentFrame() ||
78  if ( bRemoveFromPage )
79  {
80  GetPageFrame()->GetSortedObjs()->Remove( *this );
81  }
82  }
83  else
84  {
85  SwRect aTmp( GetObjRectWithSpaces() );
87  }
88  }
89 
91 }
92 
94 {
95 #if 0
96  // we are possibly in ContourCache, make sure we vanish
98 #endif
99 }
100 
101 // #i28701#
109  const SwRect& rRect, PrepareHint eHint )
110 {
111  ::Notify_Background( GetVirtDrawObj(), pPageFrame, rRect, eHint, true );
112 }
113 
115 {
116  if ( !GetFormat()->GetDoc()->getIDocumentDrawModelAccess().IsVisibleLayerId( GetVirtDrawObj()->GetLayer() ) )
117  {
118  return;
119  }
120 
121  if ( !GetAnchorFrame() || IsLocked() || IsColLocked() )
122  {
123  return;
124  }
125 
126  // #i28701# - use new method <GetPageFrame()>
127  if( !GetPageFrame() && GetAnchorFrame()->IsInFly() )
128  {
129  SwFlyFrame* pFly = AnchorFrame()->FindFlyFrame();
130  SwPageFrame *pPageFrame = pFly ? pFly->FindPageFrame() : nullptr;
131  if( pPageFrame )
132  pPageFrame->AppendFlyToPage( this );
133  }
134 
135  if( !GetPageFrame() )
136  {
137  return;
138  }
139 
140  Lock(); // The curtain drops
141 
142  // takes care of the notification in the dtor
143  const SwFlyNotify aNotify( this );
144 
145  if ( IsClipped() )
146  {
147  setFrameAreaSizeValid(false);
149  // no invalidation of position,
150  // if anchored object is anchored inside a Writer fly frame,
151  // its position is already locked, and it follows the text flow.
152  // #i34753# - add condition:
153  // no invalidation of position, if no direct move is requested in <CheckClip(..)>
154  if ( !IsNoMoveOnCheckClip() &&
155  !( PositionLocked() &&
156  GetAnchorFrame()->IsInFly() &&
157  GetFrameFormat().GetFollowTextFlow().GetValue() ) )
158  {
160  }
161  }
162 
163  // #i81146# new loop control
164  int nLoopControlRuns = 0;
165  const int nLoopControlMax = 10;
166 
167  // RotateFlyFrame3 - outer frame
168  const double fRotation(getLocalFrameRotation());
169  const bool bRotated(!basegfx::fTools::equalZero(fRotation));
170 
171  if(bRotated)
172  {
173  // Re-layout may be partially (see all isFrameAreaDefinitionValid() flags),
174  // so resetting the local SwFrame(s) in the local SwFrameAreaDefinition is
175  // needed. Reset to BoundAreas will be done below automatically
177  {
179  }
180  }
181 
183  {
184  SwRectFnSet aRectFnSet(this);
185  const SwFormatFrameSize *pSz;
186  { // Additional scope, so aAccess will be destroyed before the check!
187 
188  SwBorderAttrAccess aAccess( SwFrame::GetCache(), this );
189  const SwBorderAttrs &rAttrs = *aAccess.Get();
190  pSz = &rAttrs.GetAttrSet().GetFrameSize();
191 
192  // Only set when the flag is set!
193  if ( !isFrameAreaSizeValid() )
194  {
195  setFramePrintAreaValid(false);
196  }
197 
198  if ( !isFramePrintAreaValid() )
199  {
200  MakePrtArea( rAttrs );
201  m_bValidContentPos = false;
202  }
203 
205  {
206  setFrameAreaSizeValid(false);
207  Format( getRootFrame()->GetCurrShell()->GetOut(), &rAttrs );
208  m_bFormatHeightOnly = false;
209  }
210  }
211 
212  if ( !isFrameAreaPositionValid() )
213  {
214  const Point aOldPos( aRectFnSet.GetPos(getFrameArea()) );
215  // #i26791# - use new method <MakeObjPos()>
216  // #i34753# - no positioning, if requested.
217  if ( IsNoMakePos() )
218  {
220  }
221  else
222  // #i26791# - use new method <MakeObjPos()>
223  MakeObjPos();
224  if( aOldPos == aRectFnSet.GetPos(getFrameArea()) )
225  {
228  {
230  }
231  }
232  else
233  {
234  setFrameAreaSizeValid(false);
235  }
236  }
237 
238  if ( !m_bValidContentPos )
239  {
240  SwBorderAttrAccess aAccess( SwFrame::GetCache(), this );
241  const SwBorderAttrs &rAttrs = *aAccess.Get();
242  MakeContentPos( rAttrs );
243  }
244 
246  {
247  ++nLoopControlRuns;
248 
249  OSL_ENSURE( nLoopControlRuns < nLoopControlMax, "LoopControl in SwFlyFreeFrame::MakeAll" );
250 
251  if ( nLoopControlRuns < nLoopControlMax )
252  CheckClip( *pSz );
253  }
254  else
255  nLoopControlRuns = 0;
256  }
257 
258  // RotateFlyFrame3 - outer frame
259  // Do not refresh transforms/Areas self here, this will be done
260  // when inner and outer frame are layouted, in SwNoTextFrame::MakeAll
261  if(bRotated)
262  {
263  // RotateFlyFrame3: Safe changes locally
264  // get center from outer frame (layout frame) to be on the safe side
265  const Point aCenter(getFrameArea().Center());
266  const basegfx::B2DPoint aB2DCenter(aCenter.X(), aCenter.Y());
267 
269  {
271  }
272 
274  fRotation,
275  aB2DCenter);
277  }
278  else
279  {
280  // RotateFlyFrame3: Also need to clear ContourCache (if used),
281  // usually done in SwFlyFrame::NotifyDrawObj, but there relies on
282  // being in transform mode which is already reset then
284  {
286  }
287 
288  // reset transformations to show that they are not used
289  mpTransformableSwFrame.reset();
290  }
291 
292  Unlock();
293 
294 #if OSL_DEBUG_LEVEL > 0
295  SwRectFnSet aRectFnSet(this);
296  OSL_ENSURE( m_bHeightClipped || ( aRectFnSet.GetHeight(getFrameArea()) > 0 &&
297  aRectFnSet.GetHeight(getFramePrintArea()) > 0),
298  "SwFlyFreeFrame::Format(), flipping Fly." );
299 
300 #endif
301 }
302 
304 {
305  static bool bOverrideHandleContourToAlwaysOff(true); // loplugin:constvars:ignore
306 
307  // RotateFlyFrameFix: For LO6.0 we need to deactivate the AutoContour feature again, it is simply
308  // not clear how/if to use and save/load it in ODF. This has to be discussed.
309  // The reason not to remove is that this may be used as-is now, using a new switch.
310  // Even when not, the detection if it is possible will be needed in any case later.
311  if(bOverrideHandleContourToAlwaysOff)
312  {
313  return false;
314  }
315 
317  {
318  // support only when transformed, else there is no free space
319  return false;
320  }
321 
322  // Check for Borders. If we have Borders, do (currently) not support,
323  // since borders do not transform with the object.
324  // (Will need to be enhanced to take into account if we have Borders and if these
325  // transform with the object)
326  SwBorderAttrAccess aAccess(SwFrame::GetCache(), this);
327  const SwBorderAttrs &rAttrs(*aAccess.Get());
328 
329  if(rAttrs.IsLine())
330  {
331  return false;
332  }
333 
334  // Check for Padding. Do not support when padding is used, this will
335  // produce a covered space around the object (filled with fill defines)
336  const SfxPoolItem* pItem(nullptr);
337 
338  if(GetFormat() && SfxItemState::SET == GetFormat()->GetItemState(RES_BOX, false, &pItem))
339  {
340  const SvxBoxItem& rBox = *static_cast< const SvxBoxItem* >(pItem);
341 
342  if(rBox.HasBorder(/*bTreatPaddingAsBorder*/true))
343  {
344  return false;
345  }
346  }
347 
348  // check for Fill - if we have fill, it will fill the gaps and we will not
349  // support AutoContour
351  {
353 
354  if(aFillAttributes && aFillAttributes->isUsed())
355  {
356  return false;
357  }
358  }
359  else
360  {
361  const std::unique_ptr<SvxBrushItem> aBack(GetFormat()->makeBackgroundBrushItem());
362 
363  if(aBack && aBack->isUsed())
364  {
365  return false;
366  }
367  }
368 
369  // else, support
370  return true;
371 }
372 
373 // RotateFlyFrame3 - Support for Transformations - outer frame
375 {
377  {
378  // use pre-created transformation
380  }
381 
382  // call parent
384 }
385 
387 {
389  {
390  // use pre-created transformation
392  }
393 
394  // call parent
396 }
397 
398 // RotateFlyFrame3 - Support for Transformations
399 void SwFlyFreeFrame::transform_translate(const Point& rOffset)
400 {
401  // call parent - this will do the basic transform for SwRect(s)
402  // in the SwFrameAreaDefinition
404 
405  // check if the Transformations need to be adapted
407  {
408  const basegfx::B2DHomMatrix aTransform(
410  rOffset.X(), rOffset.Y()));
411 
412  // transform using TransformableSwFrame
413  getTransformableSwFrame()->transform(aTransform);
414  }
415 }
416 
417 // RotateFlyFrame3 - outer frame
419 {
420  return rNoTextFrame.getLocalFrameRotation();
421 }
422 
424 {
425  // SwLayoutFrame::Lower() != SwFrame::GetLower(), but SwFrame::GetLower()
426  // calls SwLayoutFrame::Lower() when it's a SwLayoutFrame - so use GetLower()
427  const SwNoTextFrame* pSwNoTextFrame(dynamic_cast< const SwNoTextFrame* >(GetLower()));
428 
429  if(nullptr != pSwNoTextFrame)
430  {
431  return getLocalFrameRotation_from_SwNoTextFrame(*pSwNoTextFrame);
432  }
433 
434  // no rotation
435  return 0.0;
436 }
437 
449 {
450  bool bRetVal = false;
451 
452  const SwFrame* pToBeCheckedFrame = GetAnchorFrame();
453  while ( pToBeCheckedFrame &&
454  !pToBeCheckedFrame->IsPageFrame() )
455  {
456  if ( pToBeCheckedFrame->IsHeaderFrame() ||
457  pToBeCheckedFrame->IsFooterFrame() ||
458  pToBeCheckedFrame->IsRowFrame() ||
459  pToBeCheckedFrame->IsFlyFrame() )
460  {
461  bRetVal = SwFrameSize::Fixed !=
462  pToBeCheckedFrame->GetAttrSet()->GetFrameSize().GetHeightSizeType();
463  break;
464  }
465  else
466  {
467  pToBeCheckedFrame = pToBeCheckedFrame->GetUpper();
468  }
469  }
470 
471  return bRetVal;
472 }
473 
475 {
476  // It's probably time now to take appropriate measures, if the Fly
477  // doesn't fit into its surrounding.
478  // First, the Fly gives up its position, then it's formatted.
479  // Only if it still doesn't fit after giving up its position, the
480  // width or height are given up as well. The frame will be squeezed
481  // as much as needed.
482 
483  const SwVirtFlyDrawObj *pObj = GetVirtDrawObj();
484  SwRect aClip, aTmpStretch;
485  ::CalcClipRect( pObj, aClip );
486  ::CalcClipRect( pObj, aTmpStretch, false );
487  aClip.Intersection_( aTmpStretch );
488 
489  const tools::Long nBot = getFrameArea().Top() + getFrameArea().Height();
490  const tools::Long nRig = getFrameArea().Left() + getFrameArea().Width();
491  const tools::Long nClipBot = aClip.Top() + aClip.Height();
492  const tools::Long nClipRig = aClip.Left() + aClip.Width();
493 
494  const bool bBot = nBot > nClipBot;
495  const bool bRig = nRig > nClipRig;
496  if (( bBot || bRig ) && !IsDraggingOffPageAllowed(FindFrameFormat(GetDrawObj())))
497  {
498  bool bAgain = false;
499  // #i37068# - no move, if it's requested
500  if ( bBot && !IsNoMoveOnCheckClip() &&
501  !GetDrawObjs() && !GetAnchorFrame()->IsInTab() )
502  {
503  SwFrame* pHeader = FindFooterOrHeader();
504  // In a header, correction of the position is no good idea.
505  // If the fly moves, some paragraphs have to be formatted, this
506  // could cause a change of the height of the headerframe,
507  // now the flyframe can change its position and so on ...
508  if ( !pHeader || !pHeader->IsHeaderFrame() )
509  {
510  const tools::Long nOld = getFrameArea().Top();
511 
512  // tdf#112443 disable positioning if content is completely off page
514  if ( !bDisableOffPagePositioning || nOld <= nClipBot)
515  {
517  aFrm.Pos().setY( std::max( aClip.Top(), nClipBot - aFrm.Height() ) );
518  }
519 
520  if ( getFrameArea().Top() != nOld )
521  {
522  bAgain = true;
523  }
524 
525  m_bHeightClipped = true;
526  }
527  }
528  if ( bRig )
529  {
530  const tools::Long nOld = getFrameArea().Left();
531 
532  // tdf#112443 disable positioning if content is completely off page
534  if ( !bDisableOffPagePositioning || nOld <= nClipRig )
535  {
537  aFrm.Pos().setX( std::max( aClip.Left(), nClipRig - aFrm.Width() ) );
538  }
539 
540  if ( getFrameArea().Left() != nOld )
541  {
542  const SwFormatHoriOrient &rH = GetFormat()->GetHoriOrient();
543  // Left-aligned ones may not be moved to the left when they
544  // are avoiding another one.
545  if( rH.GetHoriOrient() == text::HoriOrientation::LEFT )
546  {
548  aFrm.Pos().setX( nOld );
549  }
550  else
551  {
552  bAgain = true;
553  }
554  }
555  m_bWidthClipped = true;
556  }
557  if ( bAgain )
558  {
559  setFrameAreaSizeValid(false);
560  }
561  else
562  {
563  // If we reach this branch, the Frame protrudes into forbidden
564  // areas, and correcting the position is not allowed or not
565  // possible or not required.
566 
567  // For Flys with OLE objects as lower, we make sure that
568  // we always resize proportionally
569  Size aOldSize( getFrameArea().SSize() );
570 
571  // First, setup the FrameRect, then transfer it to the Frame.
572  SwRect aFrameRect( getFrameArea() );
573 
574  if ( bBot )
575  {
576  tools::Long nDiff = nClipBot;
577  nDiff -= aFrameRect.Top(); // nDiff represents the available distance
578  nDiff = aFrameRect.Height() - nDiff;
579  aFrameRect.Height( aFrameRect.Height() - nDiff );
580  m_bHeightClipped = true;
581  }
582  if ( bRig )
583  {
584  tools::Long nDiff = nClipRig;
585  nDiff -= aFrameRect.Left();// nDiff represents the available distance
586  nDiff = aFrameRect.Width() - nDiff;
587  aFrameRect.Width( aFrameRect.Width() - nDiff );
588  m_bWidthClipped = true;
589  }
590 
591  // #i17297# - no proportional
592  // scaling of graphics in environments, which determines its size
593  // by its content ('auto' size). Otherwise layout loops can occur and
594  // layout sizes of the environment can be incorrect.
595  // Such environment are:
596  // (1) header and footer frames with 'auto' size
597  // (2) table row frames with 'auto' size
598  // (3) fly frames with 'auto' size
599  // Note: section frames seems to be not critical - didn't found
600  // any critical layout situation so far.
601  if ( Lower() && Lower()->IsNoTextFrame() &&
602  (static_cast<SwNoTextFrame*>(Lower())->GetNode()->GetOLENode() ||
604  {
605  // If width and height got adjusted, then the bigger
606  // change is relevant.
607  if ( aFrameRect.Width() != aOldSize.Width() &&
608  aFrameRect.Height()!= aOldSize.Height() )
609  {
610  if ( (aOldSize.Width() - aFrameRect.Width()) >
611  (aOldSize.Height()- aFrameRect.Height()) )
612  aFrameRect.Height( aOldSize.Height() );
613  else
614  aFrameRect.Width( aOldSize.Width() );
615  }
616 
617  // Adjusted the width? change height proportionally
618  if( aFrameRect.Width() != aOldSize.Width() )
619  {
620  aFrameRect.Height( aFrameRect.Width() * aOldSize.Height() /
621  aOldSize.Width() );
622  m_bHeightClipped = true;
623  }
624  // Adjusted the height? change width proportionally
625  else if( aFrameRect.Height() != aOldSize.Height() )
626  {
627  aFrameRect.Width( aFrameRect.Height() * aOldSize.Width() /
628  aOldSize.Height() );
629  m_bWidthClipped = true;
630  }
631 
632  // #i17297# - reactivate change
633  // of size attribute for fly frames containing an ole object.
634 
635  // Added the aFrameRect.HasArea() hack, because
636  // the environment of the ole object does not have to be valid
637  // at this moment, or even worse, it does not have to have a
638  // reasonable size. In this case we do not want to change to
639  // attributes permanently. Maybe one day somebody dares to remove
640  // this code.
641  if ( aFrameRect.HasArea() &&
642  static_cast<SwNoTextFrame*>(Lower())->GetNode()->GetOLENode() &&
644  {
645  SwFlyFrameFormat *pFormat = GetFormat();
646  pFormat->LockModify();
647  SwFormatFrameSize aFrameSize( rSz );
648  aFrameSize.SetWidth( aFrameRect.Width() );
649  aFrameSize.SetHeight( aFrameRect.Height() );
650  pFormat->SetFormatAttr( aFrameSize );
651  pFormat->UnlockModify();
652  }
653  }
654 
655  // Now change the Frame; for columns, we put the new values into the attributes,
656  // otherwise we'll end up with unwanted side-effects/oscillations
657  const tools::Long nPrtHeightDiff = getFrameArea().Height() - getFramePrintArea().Height();
658  const tools::Long nPrtWidthDiff = getFrameArea().Width() - getFramePrintArea().Width();
660 
661  {
663  aFrm.Height( aFrameRect.Height() );
664  aFrm.Width ( std::max( tools::Long(MINLAY), aFrameRect.Width() ) );
665  }
666 
667  if ( Lower() && Lower()->IsColumnFrame() )
668  {
669  ColLock(); //lock grow/shrink
670  const Size aTmpOldSize( getFramePrintArea().SSize() );
671 
672  {
674  aPrt.Height( getFrameArea().Height() - nPrtHeightDiff );
675  aPrt.Width ( getFrameArea().Width() - nPrtWidthDiff );
676  }
677 
678  ChgLowersProp( aTmpOldSize );
679  SwFrame *pLow = Lower();
680  do
681  {
682  pLow->Calc(getRootFrame()->GetCurrShell()->GetOut());
683  // also calculate the (Column)BodyFrame
684  static_cast<SwLayoutFrame*>(pLow)->Lower()->Calc(getRootFrame()->GetCurrShell()->GetOut());
685  pLow = pLow->GetNext();
686  } while ( pLow );
687  ::CalcContent( this );
688  ColUnlock();
689 
691  {
692  setFrameAreaSizeValid(true);
693  m_bFormatHeightOnly = true;
694  }
695  }
696  else
697  {
699  aPrt.Height( getFrameArea().Height() - nPrtHeightDiff );
700  aPrt.Width ( getFrameArea().Width() - nPrtWidthDiff );
701  }
702  }
703  }
704 
705  // #i26945#
706  OSL_ENSURE( getFrameArea().Height() >= 0,
707  "<SwFlyFreeFrame::CheckClip(..)> - fly frame has negative height now." );
708 }
709 
714 {
715  return SwFlyFrame::IsFormatPossible() &&
716  ( GetPageFrame() ||
717  ( GetAnchorFrame() && GetAnchorFrame()->IsInFly() ) );
718 }
719 
721  SwFlyFreeFrame( pFormat, pSib, pAnch )
722 {
723  m_bLayout = true;
724 }
725 
726 // #i28701#
727 
728 void SwFlyLayFrame::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
729 {
730  auto pLegacy = dynamic_cast<const sw::LegacyModifyHint*>(&rHint);
731  if(!pLegacy || !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);
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 = dynamic_cast<SwFlyFrame*>( pTmpObj) )
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 = dynamic_cast<SwFlyFrame*>( pObj) )
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:1367
void transform(const basegfx::B2DHomMatrix &aTransform)
Definition: wsfrm.cxx:286
const SwVirtFlyDrawObj * GetVirtDrawObj() const
Definition: fly.cxx:2769
Base class of the Writer layout elements.
Definition: frame.hxx:298
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: flylay.cxx:728
virtual bool IsFormatPossible() const override
method to determine if a format on the Writer fly frame is possible
Definition: fly.cxx:2845
virtual void SwClientNotify(const SwModify &rMod, const SfxHint &rHint) override
Definition: fly.cxx:658
bool IsFlyLayFrame() const
Definition: flyfrm.hxx:196
Point GetPos(const SwRect &rRect) const
Definition: frame.hxx:1364
virtual const SwFlyFrameFormat * GetFormat() const override
Definition: fly.cxx:2858
void SetNotifyBack()
Definition: flyfrm.hxx:200
const SwSortedObjs * GetDrawObjs() const
Definition: frame.hxx:548
double getLocalFrameRotation() const
Definition: flylay.cxx:423
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:821
tools::Long GetPrtRight(const SwFrame &rFrame) const
Definition: frame.hxx:1393
bool IsInFly() const
Definition: frame.hxx:942
SwRect & Union(const SwRect &rRect)
Definition: swrect.cxx:41
bool IsRootFrame() const
Definition: frame.hxx:1155
sal_uInt16 GetLower() const
bool IsInSct() const
Definition: frame.hxx:948
void SetHeight(tools::Long n)
drawinglayer::attribute::SdrAllFillAttributesHelperPtr getSdrAllFillAttributesHelper() const
Definition: findfrm.cxx:692
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:374
std::string GetValue
bool IsColLocked() const
Definition: frame.hxx:867
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:713
void MakeContentPos(const SwBorderAttrs &rAttrs)
Definition: fly.cxx:1752
virtual void NotifyBackground(SwPageFrame *pPage, const SwRect &rRect, PrepareHint eHint) override
Notifies the background (all ContentFrames that currently are overlapping).
Definition: flylay.cxx:108
const SwFormatVertOrient & GetVertOrient(bool=true) const
Definition: fmtornt.hxx:106
void Left(const tools::Long nLeft)
Definition: swrect.hxx:195
virtual void InvalidateObjPos() override
method to invalidate position of the anchored object
Definition: fly.cxx:2781
void SetCompletePaint() const
Definition: frame.hxx:975
bool IsInFootnote() const
Definition: frame.hxx:930
SwFrameType GetType() const
Definition: frame.hxx:503
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:228
const SwRect & getFramePrintArea() const
Definition: frame.hxx:179
#define MINLAY
Definition: swtypes.hxx:66
static SwCache & GetCache()
Definition: frame.hxx:505
SwTabFrame is one table in the document layout, containing rows (which contain cells).
Definition: tabfrm.hxx:30
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:1208
bool IsInserted() const
void Unlock()
Definition: flyfrm.hxx:126
tools::Long GetWidth() const
bool IsVert() const
Definition: frame.hxx:1348
void Pos(const Point &rNew)
Definition: swrect.hxx:169
RotateFlyFrame3: Helper class when you want to make your SwFrame derivate transformable.
Definition: frame.hxx:234
virtual void Calc(vcl::RenderContext *pRenderContext) const
Definition: trvlfrm.cxx:1787
bool IsCellFrame() const
Definition: frame.hxx:1207
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
void AssertFlyPages()
Ensures that enough pages exist, so that all page bound frames and draw objects can be placed...
Definition: pagechg.cxx:1539
tools::Long GetWidth(const SwRect &rRect) const
Definition: frame.hxx:1362
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:3280
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:356
SwFlyLayFrame(SwFlyFrameFormat *, SwFrame *, SwFrame *pAnchor)
Definition: flylay.cxx:720
bool isFrameAreaDefinitionValid() const
Definition: frame.hxx:170
double getLocalFrameRotation() const
Definition: notxtfrm.cxx:633
bool m_bWidthClipped
Definition: flyfrm.hxx:105
virtual SwFrameFormat & GetFrameFormat() override
Definition: fly.cxx:2788
virtual const tools::Rectangle & GetSnapRect() const
sal_uInt16 GetPhyPageNum() const
Definition: pagefrm.hxx:188
bool IsFlyAtContentFrame() const
Definition: flyfrm.hxx:197
tools::Long GetTop(const SwRect &rRect) const
Definition: frame.hxx:1358
SwRect & Intersection_(const SwRect &rRect)
Definition: swrect.cxx:80
void RemoveFlyFromPage(SwFlyFrame *pToRemove)
Definition: flylay.cxx:886
bool IsFlyFrame() const
Definition: frame.hxx:1191
virtual void DestroyImpl() override
Definition: flylay.cxx:65
void ChgLowersProp(const Size &rOldSize)
Change size of lowers proportionally.
Definition: wsfrm.cxx:2988
void SetBottom(SwRect &rRect, tools::Long nNew) const
Definition: frame.hxx:1368
wrapper class for the positioning of Writer fly frames and drawing objects
void AppendFly(SwFlyFrame *pNew)
Definition: fly.cxx:2165
SdrPage * getSdrPageFromSdrObject() const
void restoreFrameAreas()
Definition: wsfrm.cxx:268
const SwFrame * GetAnchorFrame(const SdrObject *_pDrawObj=nullptr) const
Definition: dcontact.cxx:783
const SwRect & getFrameArea() const
Definition: frame.hxx:178
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
bool IsEmptyPage() const
Definition: pagefrm.hxx:141
bool isTransformableSwFrame() const
Definition: flyfrms.hxx:131
bool IsInTab() const
Definition: frame.hxx:936
void CheckClip(const SwFormatFrameSize &rSz)
Definition: flylay.cxx:474
std::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr
Definition: format.hxx:39
void InvalidateFlyContent() const
Definition: pagefrm.hxx:352
tools::Long GetPrtLeft(const SwFrame &rFrame) const
Definition: frame.hxx:1392
void Width(tools::Long nNew)
Definition: swrect.hxx:187
void Lock()
Definition: flyfrm.hxx:125
void setFramePrintAreaValid(bool bNew)
Definition: wsfrm.cxx:99
const SdrObject & GetReferencedObj() const
bool IsSctFrame() const
Definition: frame.hxx:1195
SwFlyFrame * FindFlyFrame()
Definition: frame.hxx:1092
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:194
virtual void transform_translate(const Point &rOffset) override
Definition: flylay.cxx:399
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:675
Base class for various Writer styles.
Definition: format.hxx:44
void PlaceFly(SwFlyFrame *pFly, SwFlyFrameFormat *pFormat)
Definition: flylay.cxx:1108
double getLocalFrameRotation_from_SwNoTextFrame(const SwNoTextFrame &rNoTextFrame)
Definition: flylay.cxx:418
bool IsColumnFrame() const
Definition: frame.hxx:1163
SwFootnoteFrame * FindFootnoteFrame()
Definition: frame.hxx:1088
virtual ~SwFlyFreeFrame() override
Definition: flylay.cxx:93
bool IsInDtor() const
Definition: frame.hxx:873
bool m_bLayout
RndStdIds::FLY_AT_PAGE, RndStdIds::FLY_AT_FLY, at page or at frame.
Definition: flyfrm.hxx:113
void InvalidateAutoCompleteWords() const
Definition: pagefrm.hxx:377
const SwFormatFollowTextFlow & GetFollowTextFlow(bool=true) const
void CalcContent(SwLayoutFrame *pLay, bool bNoColl=false)
Definition: fly.cxx:1400
Style of a layout element.
Definition: frmfmt.hxx:58
PrepareHint
Definition: swtypes.hxx:196
void RemoveFly(SwFlyFrame *pToRemove)
Definition: fly.cxx:2183
std::unique_ptr< TransformableSwFrame > mpTransformableSwFrame
Definition: flyfrms.hxx:46
const SdrObject * GetDrawObj() const
const SwSortedObjs * GetSortedObjs() const
Definition: pagefrm.hxx:116
void MakePrtArea(const SwBorderAttrs &rAttrs)
Definition: fly.cxx:1737
void InvalidateSpelling() const
Definition: pagefrm.hxx:368
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
tools::Long GetPrtBottom(const SwFrame &rFrame) const
Definition: frame.hxx:1391
void SetAssertFlyPages()
Makes sure that all requested page-bound Flys find a Page.
Definition: rootfrm.hxx:279
SwFrameType
Definition: frame.hxx:73
void Remove(SwAnchoredObject &_rAnchoredObj)
Definition: sortedobjs.cxx:228
bool Insert(SwAnchoredObject &_rAnchoredObj)
Definition: sortedobjs.cxx:207
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:433
SwPageFrame * FindPageFrame()
Definition: frame.hxx:663
tools::Long YInc(tools::Long n1, tools::Long n2) const
Definition: frame.hxx:1406
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:602
tools::Long GetHeight(const SwRect &rRect) const
Definition: frame.hxx:1363
FlyAnchors.
Definition: fmtanchr.hxx:34
void SetRight(SwRect &rRect, tools::Long nNew) const
Definition: frame.hxx:1370
SwLayoutFrame * GetUpper()
Definition: frame.hxx:661
static bool equalZero(const double &rfVal)
bool HasArea() const
Definition: swrect.hxx:288
tools::Long Width() const
void InvalidateSmartTags() const
Definition: pagefrm.hxx:373
virtual void DestroyImpl() override
Definition: fly.cxx:256
const SwRect & GetObjRectWithSpaces() const
method to determine object area inclusive its spacing
bool isFramePrintAreaValid() const
Definition: frame.hxx:167
::rtl::Reference< Content > pContent
void UnlockModify()
Definition: calbck.hxx:204
bool HasEnvironmentAutoSize() const
determines, if direct environment of fly frame has 'auto' size
Definition: flylay.cxx:448
sal_Int16 GetHoriOrient() const
Definition: fmtornt.hxx:87
bool IsRowFrame() const
Definition: frame.hxx:1203
sal_uInt32 GetOrdNum() const
tools::Long GetPrtTop(const SwFrame &rFrame) const
Definition: frame.hxx:1390
void LockModify()
Definition: calbck.hxx:203
virtual basegfx::B2DHomMatrix getFramePrintAreaTransformation() const override
Definition: flylay.cxx:386
bool m_bValidContentPos
Definition: flyfrm.hxx:119
const SwAttrSet & GetAttrSet() const
Definition: frmtool.hxx:383
virtual const IDocumentDrawModelAccess & getIDocumentDrawModelAccess() override
Definition: fly.cxx:301
Marks a node in the document model.
Definition: ndindex.hxx:31
bool isFrameAreaPositionValid() const
Definition: frame.hxx:165
void MoveFly(SwFlyFrame *pToMove, SwPageFrame *pDest)
Definition: flylay.cxx:934
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:140
const IDocumentSettingAccess & getIDocumentSettingAccess() const
Provides access to the document settings interface.
Definition: format.cxx:742
void SSize(const Size &rNew)
Definition: swrect.hxx:178
bool isFrameAreaSizeValid() const
Definition: frame.hxx:166
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:348
A page of the document layout.
Definition: pagefrm.hxx:41
virtual SdrObject * RemoveObject(size_t nObjNum)
virtual void MakeAll(vcl::RenderContext *pRenderContext) override
Definition: flylay.cxx:114
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:1708
SwBorderAttrs * Get()
Definition: frmtool.cxx:2572
void SetWidth(tools::Long n)
SwSectionFrame * FindSctFrame()
Definition: frame.hxx:1096
SwLayoutFrame * FindBodyCont()
Searches the first ContentFrame in BodyText below the page.
Definition: findfrm.cxx:43
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:464
bool m_bHeightClipped
Definition: flyfrm.hxx:104
void setFrameAreaPositionValid(bool bNew)
Definition: wsfrm.cxx:83
void SetTopAndHeight(SwRect &rRect, tools::Long nTop, tools::Long nHeight) const
Definition: frame.hxx:1409
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:60
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:192
SwPageFrame * GetPageFrame()
void ClrContourCache(const SdrObject *pObj)
Definition: txtfly.cxx:134
bool supportsAutoContour() const
Definition: flylay.cxx:303
void SetOrdNum(sal_uInt32 nNum)
bool m_bFormatHeightOnly
Definition: flyfrm.hxx:108
void SetPageFrame(SwPageFrame *_pNewPageFrame)
bool IsInside(const Point &rPOINT) const
Definition: swrect.cxx:105
bool IsNoTextFrame() const
Definition: frame.hxx:1219
const SwFootnoteFrame * GetFollow() const
Definition: ftnfrm.hxx:116
SwNodes & GetNodes()
Definition: doc.hxx:407
bool IsClipped() const
Definition: flyfrm.hxx:203
void Top(const tools::Long nTop)
Definition: swrect.hxx:204
bool IsColBodyFrame() const
These SwFrame inlines are here, so that frame.hxx does not need to include layfrm.hxx.
Definition: layfrm.hxx:209
tools::Long Height() const
void setFrameAreaSizeValid(bool bNew)
Definition: wsfrm.cxx:91
SwFlyFrame * GetNextLink() const
Definition: flyfrm.hxx:174
SwFrame * GetLower()
Definition: findfrm.cxx:170
bool IsPageFrame() const
Definition: frame.hxx:1159
QPRO_FUNC_TYPE nType
const basegfx::B2DHomMatrix & getLocalFrameAreaTransformation() const
Definition: frame.hxx:254
static const SwFormatAnchor * GetAnchorFromPoolItem(const SfxPoolItem &rItem)
Definition: fly.cxx:2929
virtual bool supportsFullDrawingLayerFillAttributeSet() const override
Definition: atrfrm.cxx:2532
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:1228
tools::Long GetHeight() const
void SetLeft(SwRect &rRect, tools::Long nNew) const
Definition: frame.hxx:1369
void InvalidateAll()
Definition: frame.hxx:1036
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:3117
const SwFrame * GetAnchorFrame() const
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
void adaptFrameAreasToTransformations()
Definition: wsfrm.cxx:233
void InvalidateWordCount() const
Definition: pagefrm.hxx:381
bool PositionLocked() const
bool IsBodyFrame() const
Definition: frame.hxx:1187
void SetLeftAndWidth(SwRect &rRect, tools::Long nLeft, tools::Long nWidth) const
Definition: frame.hxx:1408
class for collecting anchored objects
Definition: sortedobjs.hxx:48
void ColLock()
Definition: frame.hxx:432
void Height(tools::Long nNew)
Definition: swrect.hxx:191
void createFrameAreaTransformations(double fRotation, const basegfx::B2DPoint &rCenter)
Definition: wsfrm.cxx:213
const basegfx::B2DHomMatrix & getLocalFramePrintAreaTransformation() const
Definition: frame.hxx:260
SwContentNode * GoNext(SwNodeIndex *) const
Definition: nodes.cxx:1284
bool IsFooterFrame() const
Definition: frame.hxx:1175
SwRootFrame * getRootFrame()
Definition: frame.hxx:662
virtual void transform_translate(const Point &rOffset)
Definition: wsfrm.cxx:147
std::unique_ptr< SwSortedObjs > m_pSortedObjs
Definition: pagefrm.hxx:45
SwFlyFreeFrame(SwFlyFrameFormat *, SwFrame *, SwFrame *pAnchor)
Definition: flylay.cxx:53
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:101
sal_uInt16 GetUpper() const
bool IsHeaderFrame() const
Definition: frame.hxx:1171
SwFrameSize GetHeightSizeType() const
Definition: fmtfsize.hxx:80
SwTabFrame * FindTabFrame()
Definition: frame.hxx:1080
SwFrame * GetNext()
Definition: frame.hxx:659