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