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