LibreOffice Module sw (master)  1
fly.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 <svl/itemiter.hxx>
21 #include <vcl/imap.hxx>
22 #include <tools/helpers.hxx>
23 #include <editeng/protitem.hxx>
24 #include <editeng/opaqitem.hxx>
25 #include <editeng/ulspitem.hxx>
26 #include <editeng/frmdiritem.hxx>
27 #include <editeng/outlobj.hxx>
28 #include <fmtfsize.hxx>
29 #include <fmtclds.hxx>
30 #include <fmtcntnt.hxx>
31 #include <fmturl.hxx>
32 #include <fmtsrnd.hxx>
33 #include <fmtornt.hxx>
34 #include <fmtcnct.hxx>
35 #include <ndgrf.hxx>
37 #include <fmtfollowtextflow.hxx>
38 #include <sortedobjs.hxx>
39 #include <objectformatter.hxx>
40 #include <ndole.hxx>
41 #include <swtable.hxx>
42 #include <svx/svdoashp.hxx>
43 #include <layouter.hxx>
44 #include <pagefrm.hxx>
45 #include <rootfrm.hxx>
46 #include <viewimp.hxx>
47 #include <viewopt.hxx>
48 #include <dcontact.hxx>
49 #include <dflyobj.hxx>
50 #include <dview.hxx>
51 #include <frmatr.hxx>
52 #include <frmtool.hxx>
53 #include <hints.hxx>
54 #include <tabfrm.hxx>
55 #include <txtfrm.hxx>
56 #include <notxtfrm.hxx>
57 #include <flyfrms.hxx>
58 #include <sectfrm.hxx>
59 #include <vcl/svapp.hxx>
60 #include <calbck.hxx>
64 #include <textboxhelper.hxx>
65 #include <txtfly.hxx>
66 #include <ndindex.hxx>
68 
69 #include <wrtsh.hxx>
70 #include <view.hxx>
71 #include <edtwin.hxx>
72 #include <bodyfrm.hxx>
73 #include <FrameControlsManager.hxx>
74 #include <ndtxt.hxx>
75 #include <officecfg/Office/Compatibility.hxx>
76 
77 using namespace ::com::sun::star;
78 
79 static SwTwips lcl_CalcAutoWidth( const SwLayoutFrame& rFrame );
80 
82  SwLayoutFrame( pFormat, pSib ),
83  SwAnchoredObject(), // #i26791#
84  m_pPrevLink( nullptr ),
85  m_pNextLink( nullptr ),
86  m_bInCnt( false ),
87  m_bAtCnt( false ),
88  m_bLayout( false ),
89  m_bAutoPosition( false ),
90  m_bValidContentPos( false )
91 {
93 
94  m_bInvalid = m_bNotifyBack = true;
97 
98  // Size setting: Fixed size is always the width
99  const SwFormatFrameSize &rFrameSize = pFormat->GetFrameSize();
100  const SvxFrameDirection nDir = pFormat->GetFormatAttr( RES_FRAMEDIR ).GetValue();
101  if( SvxFrameDirection::Environment == nDir )
102  {
103  mbDerivedVert = true;
104  mbDerivedR2L = true;
105  }
106  else
107  {
108  mbInvalidVert = false;
109  mbDerivedVert = false;
110  mbDerivedR2L = false;
111  if( SvxFrameDirection::Horizontal_LR_TB == nDir || SvxFrameDirection::Horizontal_RL_TB == nDir )
112  {
113  mbVertLR = false;
114  mbVertical = false;
115  }
116  else
117  {
118  const SwViewShell *pSh = getRootFrame() ? getRootFrame()->GetCurrShell() : nullptr;
119  if( pSh && pSh->GetViewOptions()->getBrowseMode() )
120  {
121  mbVertLR = false;
122  mbVertical = false;
123  }
124  else
125  {
126  mbVertical = true;
127 
128  if ( SvxFrameDirection::Vertical_LR_TB == nDir )
129  mbVertLR = true;
130  else if (nDir == SvxFrameDirection::Vertical_LR_BT)
131  {
132  mbVertLR = true;
133  mbVertLRBT = true;
134  }
135  else
136  mbVertLR = false;
137  }
138  }
139 
140  mbInvalidR2L = false;
141  if( SvxFrameDirection::Horizontal_RL_TB == nDir )
142  mbRightToLeft = true;
143  else
144  mbRightToLeft = false;
145  }
146 
147  {
149  aFrm.Width( rFrameSize.GetWidth() );
150  aFrm.Height( rFrameSize.GetHeightSizeType() == SwFrameSize::Variable ? MINFLY : rFrameSize.GetHeight() );
151  }
152 
153  // Fixed or variable Height?
154  if ( rFrameSize.GetHeightSizeType() == SwFrameSize::Minimum )
155  m_bMinHeight = true;
156  else if ( rFrameSize.GetHeightSizeType() == SwFrameSize::Fixed )
157  mbFixSize = true;
158 
159  // insert columns, if necessary
160  InsertColumns();
161 
162  // First the Init, then the Content:
163  // This is due to the fact that the Content may have Objects/Frames,
164  // which are then registered
165  InitDrawObj();
166 
167  Chain( pAnch );
168 
169  InsertCnt();
170 
171  // Put it somewhere outside so that out document is not formatted unnecessarily often
173  aFrm.Pos().setX(FAR_AWAY);
174  aFrm.Pos().setY(FAR_AWAY);
175 }
176 
177 void SwFlyFrame::Chain( SwFrame* _pAnch )
178 {
179  // Connect to chain neighbours.
180  // No problem, if a neighbor doesn't exist - the construction of the
181  // neighbor will make the connection
182  const SwFormatChain& rChain = GetFormat()->GetChain();
183  if ( !(rChain.GetPrev() || rChain.GetNext()) )
184  return;
185 
186  if ( rChain.GetNext() )
187  {
188  SwFlyFrame* pFollow = FindChainNeighbour( *rChain.GetNext(), _pAnch );
189  if ( pFollow )
190  {
191  OSL_ENSURE( !pFollow->GetPrevLink(), "wrong chain detected" );
192  if ( !pFollow->GetPrevLink() )
193  SwFlyFrame::ChainFrames( this, pFollow );
194  }
195  }
196  if ( rChain.GetPrev() )
197  {
198  SwFlyFrame *pMaster = FindChainNeighbour( *rChain.GetPrev(), _pAnch );
199  if ( pMaster )
200  {
201  OSL_ENSURE( !pMaster->GetNextLink(), "wrong chain detected" );
202  if ( !pMaster->GetNextLink() )
203  SwFlyFrame::ChainFrames( pMaster, this );
204  }
205  }
206 }
207 
209 {
210  if ( GetPrevLink() )
211  return;
212 
213  const SwFormatContent& rContent = GetFormat()->GetContent();
214  OSL_ENSURE( rContent.GetContentIdx(), ":-( no content prepared." );
215  sal_uLong nIndex = rContent.GetContentIdx()->GetIndex();
216  // Lower() means SwColumnFrame; the Content then needs to be inserted into the (Column)BodyFrame
217  ::InsertCnt_( Lower() ? static_cast<SwLayoutFrame*>(static_cast<SwLayoutFrame*>(Lower())->Lower()) : static_cast<SwLayoutFrame*>(this),
218  GetFormat()->GetDoc(), nIndex );
219 
220  // NoText always have a fixed height.
221  if ( Lower() && Lower()->IsNoTextFrame() )
222  {
223  mbFixSize = true;
224  m_bMinHeight = false;
225  }
226 }
227 
229 {
230  // #i97379#
231  // Check, if column are allowed.
232  // Columns are not allowed for fly frames, which represent graphics or embedded objects.
233  const SwFormatContent& rContent = GetFormat()->GetContent();
234  OSL_ENSURE( rContent.GetContentIdx(), "<SwFlyFrame::InsertColumns()> - no content prepared." );
235  SwNodeIndex aFirstContent( *(rContent.GetContentIdx()), 1 );
236  if ( aFirstContent.GetNode().IsNoTextNode() )
237  {
238  return;
239  }
240 
241  const SwFormatCol &rCol = GetFormat()->GetCol();
242  if ( rCol.GetNumCols() <= 1 )
243  return;
244 
245  // Start off PrtArea to be as large as Frame, so that we can put in the columns
246  // properly. It'll adjust later on.
247  {
249  aPrt.Width( getFrameArea().Width() );
250  aPrt.Height( getFrameArea().Height() );
251  }
252 
253  const SwFormatCol aOld; // ChgColumns() also needs an old value passed
254  ChgColumns( aOld, rCol );
255 }
256 
258 {
259  // Accessible objects for fly frames will be destroyed in this destructor.
260  // For frames bound as char or frames that don't have an anchor we have
261  // to do that ourselves. For any other frame the call RemoveFly at the
262  // anchor will do that.
264  {
265  SwRootFrame *pRootFrame = getRootFrame();
266  if( pRootFrame && pRootFrame->IsAnyShellAccessible() )
267  {
268  SwViewShell *pVSh = pRootFrame->GetCurrShell();
269  if( pVSh && pVSh->Imp() )
270  {
271  // Lowers aren't disposed already, so we have to do a recursive
272  // dispose
273  pVSh->Imp()->DisposeAccessibleFrame( this, true );
274  }
275  }
276  }
277 
278  if( GetFormat() && !GetFormat()->GetDoc()->IsInDtor() )
279  {
280  ClearTmpConsiderWrapInfluence(); // remove this from SwLayouter
281 
282  Unchain();
283 
284  DeleteCnt();
285 
286  if ( GetAnchorFrame() )
287  AnchorFrame()->RemoveFly( this );
288  }
289 
290  FinitDrawObj();
291 
293 
294  SwWrtShell* pWrtSh = dynamic_cast<SwWrtShell*>(getRootFrame()->GetCurrShell());
295  UpdateUnfloatButton(pWrtSh, false);
296 }
297 
299 {
300 }
301 
303 {
305 }
306 
308 {
309  if ( GetPrevLink() )
310  UnchainFrames( GetPrevLink(), this );
311  if ( GetNextLink() )
312  UnchainFrames( this, GetNextLink() );
313 }
314 
316 {
317  SwFrame* pFrame = m_pLower;
318  while ( pFrame )
319  {
320  while ( pFrame->GetDrawObjs() && pFrame->GetDrawObjs()->size() )
321  {
322  SwAnchoredObject *pAnchoredObj = (*pFrame->GetDrawObjs())[0];
323  if ( dynamic_cast<const SwFlyFrame*>( pAnchoredObj) != nullptr )
324  {
325  SwFrame::DestroyFrame(static_cast<SwFlyFrame*>(pAnchoredObj));
326  }
327  else if ( dynamic_cast<const SwAnchoredDrawObject*>( pAnchoredObj) != nullptr )
328  {
329  // consider 'virtual' drawing objects
330  SdrObject* pObj = pAnchoredObj->DrawObj();
331  if ( dynamic_cast<const SwDrawVirtObj*>( pObj) != nullptr )
332  {
333  SwDrawVirtObj* pDrawVirtObj = static_cast<SwDrawVirtObj*>(pObj);
334  pDrawVirtObj->RemoveFromWriterLayout();
335  pDrawVirtObj->RemoveFromDrawingPage();
336  }
337  else
338  {
339  SwDrawContact* pContact =
340  static_cast<SwDrawContact*>(::GetUserCall( pObj ));
341  if ( pContact )
342  {
343  pContact->DisconnectFromLayout();
344  }
345  }
346  }
347  }
348 
349  pFrame->RemoveFromLayout();
350  SwFrame::DestroyFrame(pFrame);
351  pFrame = m_pLower;
352  }
353 
354  InvalidatePage();
355 }
356 
358 {
360 
361  // Set the right Layer
363  SdrLayerID nHeavenId = rIDDMA.GetHeavenId();
364  SdrLayerID nHellId = rIDDMA.GetHellId();
365  GetVirtDrawObj()->SetLayer( GetFormat()->GetOpaque().GetValue()
366  ? nHeavenId
367  : nHellId );
368 }
369 
371 {
372  if(!GetVirtDrawObj() )
373  return;
374  SwFormat* pFormat = GetFormat();
375  // Deregister from SdrPageViews if the Objects is still selected there.
376  if(!pFormat->GetDoc()->IsInDtor())
377  {
379  if(p1St)
380  {
381  for(SwViewShell& rCurrentShell : p1St->GetRingContainer())
382  { // At the moment the Drawing can do just do an Unmark on everything,
383  // as the Object was already removed
384  if(rCurrentShell.HasDrawView() )
385  rCurrentShell.Imp()->GetDrawView()->UnmarkAll();
386  }
387  }
388  }
389 
390  // Else calls delete of the ContactObj
391  GetVirtDrawObj()->SetUserCall(nullptr);
392 
393  // Deregisters itself at the Master
394  // always use SdrObject::Free(...) for SdrObjects (!)
395  SdrObject* pTemp(GetVirtDrawObj());
396  SdrObject::Free(pTemp);
397 }
398 
400 {
401  OSL_ENSURE( pMaster && pFollow, "incomplete chain" );
402  OSL_ENSURE( !pMaster->GetNextLink(), "link can not be changed" );
403  OSL_ENSURE( !pFollow->GetPrevLink(), "link can not be changed" );
404 
405  pMaster->m_pNextLink = pFollow;
406  pFollow->m_pPrevLink = pMaster;
407 
408  if ( pMaster->ContainsContent() )
409  {
410  // To get a text flow we need to invalidate
411  SwFrame *pInva = pMaster->FindLastLower();
412  SwRectFnSet aRectFnSet(pMaster);
413  const long nBottom = aRectFnSet.GetPrtBottom(*pMaster);
414  while ( pInva )
415  {
416  if( aRectFnSet.BottomDist( pInva->getFrameArea(), nBottom ) <= 0 )
417  {
418  pInva->InvalidateSize();
419  pInva->Prepare();
420  pInva = pInva->FindPrev();
421  }
422  else
423  pInva = nullptr;
424  }
425  }
426 
427  if ( pFollow->ContainsContent() )
428  {
429  // There's only the content from the Masters left; the content from the Follow
430  // does not have any Frames left (should always be exactly one empty TextNode).
431  SwFrame *pFrame = pFollow->ContainsContent();
432  OSL_ENSURE( !pFrame->IsTabFrame() && !pFrame->FindNext(), "follow in chain contains content" );
433  pFrame->Cut();
434  SwFrame::DestroyFrame(pFrame);
435  }
436 
437  // invalidate accessible relation set (accessibility wrapper)
438  SwViewShell* pSh = pMaster->getRootFrame()->GetCurrShell();
439  if( pSh )
440  {
441  SwRootFrame* pLayout = pMaster->getRootFrame();
442  if( pLayout && pLayout->IsAnyShellAccessible() )
443  pSh->Imp()->InvalidateAccessibleRelationSet( pMaster, pFollow );
444  }
445 }
446 
448 {
449  pMaster->m_pNextLink = nullptr;
450  pFollow->m_pPrevLink = nullptr;
451 
452  if ( pFollow->ContainsContent() )
453  {
454  // The Master sucks up the content of the Follow
455  SwLayoutFrame *pUpper = pMaster;
456  if ( pUpper->Lower()->IsColumnFrame() )
457  {
458  pUpper = static_cast<SwLayoutFrame*>(pUpper->GetLastLower());
459  pUpper = static_cast<SwLayoutFrame*>(pUpper->Lower()); // The (Column)BodyFrame
460  OSL_ENSURE( pUpper && pUpper->IsColBodyFrame(), "Missing ColumnBody" );
461  }
462  SwFlyFrame *pFoll = pFollow;
463  while ( pFoll )
464  {
465  SwFrame *pTmp = ::SaveContent( pFoll );
466  if ( pTmp )
467  ::RestoreContent( pTmp, pUpper, pMaster->FindLastLower() );
468  pFoll->SetCompletePaint();
469  pFoll->InvalidateSize();
470  pFoll = pFoll->GetNextLink();
471  }
472  }
473 
474  // The Follow needs his own content to be served
475  const SwFormatContent &rContent = pFollow->GetFormat()->GetContent();
476  OSL_ENSURE( rContent.GetContentIdx(), ":-( No content prepared." );
477  sal_uLong nIndex = rContent.GetContentIdx()->GetIndex();
478  // Lower() means SwColumnFrame: this one contains another SwBodyFrame
479  ::InsertCnt_( pFollow->Lower() ? const_cast<SwLayoutFrame*>(static_cast<const SwLayoutFrame*>(static_cast<const SwLayoutFrame*>(pFollow->Lower())->Lower()))
480  : static_cast<SwLayoutFrame*>(pFollow),
481  pFollow->GetFormat()->GetDoc(), ++nIndex );
482 
483  // invalidate accessible relation set (accessibility wrapper)
484  SwViewShell* pSh = pMaster->getRootFrame()->GetCurrShell();
485  if( pSh )
486  {
487  SwRootFrame* pLayout = pMaster->getRootFrame();
488  if( pLayout && pLayout->IsAnyShellAccessible() )
489  pSh->Imp()->InvalidateAccessibleRelationSet( pMaster, pFollow );
490  }
491 }
492 
494 {
495  // We look for the Fly that's in the same Area.
496  // Areas can for now only be Head/Footer or Flys.
497 
498  if ( !pAnch ) // If an Anchor was passed along, that one counts (ctor!)
499  pAnch = AnchorFrame();
500 
501  SwLayoutFrame *pLay;
502  if ( pAnch->IsInFly() )
503  pLay = pAnch->FindFlyFrame();
504  else
505  {
506  // FindFooterOrHeader is not appropriate here, as we may not have a
507  // connection to the Anchor yet.
508  pLay = pAnch->GetUpper();
509  while ( pLay && !(pLay->GetType() & (SwFrameType::Header|SwFrameType::Footer)) )
510  pLay = pLay->GetUpper();
511  }
512 
513  SwIterator<SwFlyFrame,SwFormat> aIter( rChain );
514  SwFlyFrame *pFly = aIter.First();
515  if ( pLay )
516  {
517  while ( pFly )
518  {
519  if ( pFly->GetAnchorFrame() )
520  {
521  if ( pFly->GetAnchorFrame()->IsInFly() )
522  {
523  if ( pFly->AnchorFrame()->FindFlyFrame() == pLay )
524  break;
525  }
526  else if ( pLay == pFly->FindFooterOrHeader() )
527  break;
528  }
529  pFly = aIter.Next();
530  }
531  }
532  else if ( pFly )
533  {
534  OSL_ENSURE( !aIter.Next(), "chain with more than one instance" );
535  }
536  return pFly;
537 }
538 
540 {
541  SwFrame *pRet = ContainsAny();
542  if ( pRet && pRet->IsInTab() )
543  pRet = pRet->FindTabFrame();
544  SwFrame *pNxt = pRet;
545  while ( pNxt && IsAnLower( pNxt ) )
546  { pRet = pNxt;
547  pNxt = pNxt->FindNext();
548  }
549  return pRet;
550 }
551 
553 {
554  bool bRet = false;
555  SwTwips nDiffHeight = getFrameArea().Height();
556  if ( rFrameSize.GetHeightSizeType() == SwFrameSize::Variable )
557  mbFixSize = m_bMinHeight = false;
558  else
559  {
560  if ( rFrameSize.GetHeightSizeType() == SwFrameSize::Fixed )
561  {
562  mbFixSize = true;
563  m_bMinHeight = false;
564  }
565  else if ( rFrameSize.GetHeightSizeType() == SwFrameSize::Minimum )
566  {
567  mbFixSize = false;
568  m_bMinHeight = true;
569  }
570  nDiffHeight -= rFrameSize.GetHeight();
571  }
572  // If the Fly contains columns, we already need to set the Fly
573  // and the Columns to the required value or else we run into problems.
574  if ( Lower() )
575  {
576  if ( Lower()->IsColumnFrame() )
577  {
578  const SwRect aOld( GetObjRectWithSpaces() );
579  const Size aOldSz( getFramePrintArea().SSize() );
580  const SwTwips nDiffWidth = getFrameArea().Width() - rFrameSize.GetWidth();
581 
582  {
584  aFrm.Height( aFrm.Height() - nDiffHeight );
585  aFrm.Width ( aFrm.Width() - nDiffWidth );
586  }
587 
588  // #i68520#
590 
591  {
593  aPrt.Height( aPrt.Height() - nDiffHeight );
594  aPrt.Width ( aPrt.Width() - nDiffWidth );
595  }
596 
597  ChgLowersProp( aOldSz );
598  ::Notify( this, FindPageFrame(), aOld );
600  bRet = true;
601  }
602  else if ( Lower()->IsNoTextFrame() )
603  {
604  mbFixSize = true;
605  m_bMinHeight = false;
606  }
607  }
608  return bRet;
609 }
610 
611 void SwFlyFrame::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
612 {
613  SwFrame::SwClientNotify(rMod, rHint);
614  if (auto pGetZOrdnerHint = dynamic_cast<const sw::GetZOrderHint*>(&rHint))
615  {
616  const auto& rFormat(dynamic_cast<const SwFrameFormat&>(rMod));
617  if (rFormat.Which() == RES_FLYFRMFMT && rFormat.getIDocumentLayoutAccess().GetCurrentViewShell()) // #i11176#
618  pGetZOrdnerHint->m_rnZOrder = GetVirtDrawObj()->GetOrdNum();
619  }
620  else if (auto pConnectedHint = dynamic_cast<const sw::GetObjectConnectedHint*>(&rHint))
621  {
622  const auto& rFormat(dynamic_cast<const SwFrameFormat&>(rMod));
623  if (!pConnectedHint->m_risConnected && rFormat.Which() == RES_FLYFRMFMT && (!pConnectedHint->m_pRoot || pConnectedHint->m_pRoot == getRootFrame()))
624  pConnectedHint->m_risConnected = true;
625  }
626 }
627 
628 void SwFlyFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
629 {
630  sal_uInt8 nInvFlags = 0;
631 
632  if (pNew && pOld && RES_ATTRSET_CHG == pNew->Which())
633  {
634  SfxItemIter aNIter( *static_cast<const SwAttrSetChg*>(pNew)->GetChgSet() );
635  SfxItemIter aOIter( *static_cast<const SwAttrSetChg*>(pOld)->GetChgSet() );
636  const SfxPoolItem* pNItem = aNIter.GetCurItem();
637  const SfxPoolItem* pOItem = aOIter.GetCurItem();
638  SwAttrSetChg aOldSet( *static_cast<const SwAttrSetChg*>(pOld) );
639  SwAttrSetChg aNewSet( *static_cast<const SwAttrSetChg*>(pNew) );
640  do
641  {
642  UpdateAttr_(pOItem, pNItem, nInvFlags, &aOldSet, &aNewSet);
643  pNItem = aNIter.NextItem();
644  pOItem = aOIter.NextItem();
645  } while (pNItem);
646  if ( aOldSet.Count() || aNewSet.Count() )
647  SwLayoutFrame::Modify( &aOldSet, &aNewSet );
648  }
649  else
650  UpdateAttr_( pOld, pNew, nInvFlags );
651 
652  if ( nInvFlags == 0 )
653  return;
654 
655  Invalidate_();
656  if ( nInvFlags & 0x01 )
657  {
658  InvalidatePos_();
659  // #i68520#
661  }
662  if ( nInvFlags & 0x02 )
663  {
664  InvalidateSize_();
665  // #i68520#
667  }
668  if ( nInvFlags & 0x04 )
669  InvalidatePrt_();
670  if ( nInvFlags & 0x08 )
671  SetNotifyBack();
672  if ( nInvFlags & 0x10 )
674  if ( ( nInvFlags & 0x40 ) && Lower() && Lower()->IsNoTextFrame() )
676  SwRootFrame *pRoot;
677  if ( nInvFlags & 0x20 && nullptr != (pRoot = getRootFrame()) )
678  pRoot->InvalidateBrowseWidth();
679  // #i28701#
680  if ( nInvFlags & 0x80 )
681  {
682  // update sorted object lists, the Writer fly frame is registered at.
684  }
685 
686  // #i87645# - reset flags for the layout process (only if something has been invalidated)
688 
689 }
690 
691 void SwFlyFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
692  sal_uInt8 &rInvFlags,
693  SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet )
694 {
695  bool bClear = true;
696  const sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
698  switch( nWhich )
699  {
700  case RES_VERT_ORIENT:
701  case RES_HORI_ORIENT:
702  // #i18732# - consider new option 'follow text flow'
704  {
705  // ATTENTION: Always also change Action in ChgRePos()!
706  rInvFlags |= 0x09;
707  }
708  break;
709  // #i28701# - consider new option 'wrap influence on position'
711  {
712  rInvFlags |= 0x89;
713  }
714  break;
715  case RES_SURROUND:
716  {
717  //#i28701# - invalidate position on change of
718  // wrapping style.
719  //rInvFlags |= 0x40;
720  rInvFlags |= 0x41;
721  // The background needs to be messaged and invalidated
722  const SwRect aTmp( GetObjRectWithSpaces() );
724 
725  // By changing the flow of frame-bound Frames, a vertical alignment
726  // can be activated/deactivated => MakeFlyPos
727  if( RndStdIds::FLY_AT_FLY == GetFormat()->GetAnchor().GetAnchorId() )
728  rInvFlags |= 0x09;
729 
730  // Delete contour in the Node if necessary
731  if ( Lower() && Lower()->IsNoTextFrame() &&
732  !GetFormat()->GetSurround().IsContour() )
733  {
734  SwNoTextNode *pNd = static_cast<SwNoTextNode*>(static_cast<SwNoTextFrame*>(Lower())->GetNode());
735  if ( pNd->HasContour() )
736  pNd->SetContour( nullptr );
737  }
738  // #i28701# - perform reorder of object lists
739  // at anchor frame and at page frame.
740  rInvFlags |= 0x80;
741  }
742  break;
743 
744  case RES_PROTECT:
745  if (pNew)
746  {
747  const SvxProtectItem *pP = static_cast<const SvxProtectItem*>(pNew);
750  if( pSh )
751  {
752  SwRootFrame* pLayout = getRootFrame();
753  if( pLayout && pLayout->IsAnyShellAccessible() )
754  pSh->Imp()->InvalidateAccessibleEditableState( true, this );
755  }
756  }
757  break;
758  case RES_COL:
759  if (pOld && pNew)
760  {
761  ChgColumns( *static_cast<const SwFormatCol*>(pOld), *static_cast<const SwFormatCol*>(pNew) );
762  const SwFormatFrameSize &rNew = GetFormat()->GetFrameSize();
763  if ( FrameSizeChg( rNew ) )
764  NotifyDrawObj();
765  rInvFlags |= 0x1A;
766  }
767  break;
768 
769  case RES_FRM_SIZE:
770  case RES_FMT_CHG:
771  {
772  const SwFormatFrameSize &rNew = GetFormat()->GetFrameSize();
773  if ( FrameSizeChg( rNew ) )
774  NotifyDrawObj();
775  rInvFlags |= 0x7F;
776  if (pOld && RES_FMT_CHG == nWhich)
777  {
778  SwRect aNew( GetObjRectWithSpaces() );
779  SwRect aOld( getFrameArea() );
780  const SvxULSpaceItem &rUL = static_cast<const SwFormatChg*>(pOld)->pChangedFormat->GetULSpace();
781  aOld.Top( std::max( aOld.Top() - long(rUL.GetUpper()), 0L ) );
782  aOld.AddHeight(rUL.GetLower() );
783  const SvxLRSpaceItem &rLR = static_cast<const SwFormatChg*>(pOld)->pChangedFormat->GetLRSpace();
784  aOld.Left ( std::max( aOld.Left() - rLR.GetLeft(), 0L ) );
785  aOld.AddWidth(rLR.GetRight() );
786  aNew.Union( aOld );
788 
789  // Special case:
790  // When assigning a template we cannot rely on the old column
791  // attribute. As there need to be at least enough for ChgColumns,
792  // we need to create a temporary attribute.
793  SwFormatCol aCol;
794  if ( Lower() && Lower()->IsColumnFrame() )
795  {
796  sal_uInt16 nCol = 0;
797  SwFrame *pTmp = Lower();
798  do
799  { ++nCol;
800  pTmp = pTmp->GetNext();
801  } while ( pTmp );
802  aCol.Init( nCol, 0, 1000 );
803  }
804  ChgColumns( aCol, GetFormat()->GetCol() );
805  }
806 
807  SwFormatURL aURL( GetFormat()->GetURL() );
808 
809  SwFormatFrameSize *pNewFormatFrameSize = nullptr;
810  SwFormatChg *pOldFormatChg = nullptr;
811  if (nWhich == RES_FRM_SIZE)
812  pNewFormatFrameSize = const_cast<SwFormatFrameSize*>(static_cast<const SwFormatFrameSize*>(pNew));
813  else
814  pOldFormatChg = const_cast<SwFormatChg*>(static_cast<const SwFormatChg*>(pOld));
815 
816  if (aURL.GetMap() && (pNewFormatFrameSize || pOldFormatChg))
817  {
818  const SwFormatFrameSize &rOld = pNewFormatFrameSize ?
819  *pNewFormatFrameSize :
820  pOldFormatChg->pChangedFormat->GetFrameSize();
821  //#35091# Can be "times zero", when loading the template
822  if ( rOld.GetWidth() && rOld.GetHeight() )
823  {
824 
825  Fraction aScaleX( rOld.GetWidth(), rNew.GetWidth() );
826  Fraction aScaleY( rOld.GetHeight(), rOld.GetHeight() );
827  aURL.GetMap()->Scale( aScaleX, aScaleY );
828  SwFrameFormat *pFormat = GetFormat();
829  pFormat->LockModify();
830  pFormat->SetFormatAttr( aURL );
831  pFormat->UnlockModify();
832  }
833  }
834  const SvxProtectItem &rP = GetFormat()->GetProtect();
837 
838  if ( pSh )
841  const SdrLayerID nId = GetFormat()->GetOpaque().GetValue() ?
842  rIDDMA.GetHeavenId() :
843  rIDDMA.GetHellId();
844  GetVirtDrawObj()->SetLayer( nId );
845 
846  if ( Lower() )
847  {
848  // Delete contour in the Node if necessary
849  if( Lower()->IsNoTextFrame() &&
850  !GetFormat()->GetSurround().IsContour() )
851  {
852  SwNoTextNode *pNd = static_cast<SwNoTextNode*>(static_cast<SwNoTextFrame*>(Lower())->GetNode());
853  if ( pNd->HasContour() )
854  pNd->SetContour( nullptr );
855  }
856  else if( !Lower()->IsColumnFrame() )
857  {
858  SwFrame* pFrame = GetLastLower();
859  if( pFrame->IsTextFrame() && static_cast<SwTextFrame*>(pFrame)->IsUndersized() )
861  }
862  }
863 
864  // #i28701# - perform reorder of object lists
865  // at anchor frame and at page frame.
866  rInvFlags |= 0x80;
867 
868  break;
869  }
870  case RES_UL_SPACE:
871  case RES_LR_SPACE:
872  {
873  rInvFlags |= 0x41;
874  if( pSh && pSh->GetViewOptions()->getBrowseMode() )
876  SwRect aNew( GetObjRectWithSpaces() );
877  SwRect aOld( getFrameArea() );
878  if (pNew)
879  {
880  if ( RES_UL_SPACE == nWhich )
881  {
882  const SvxULSpaceItem &rUL = *static_cast<const SvxULSpaceItem*>(pNew);
883  aOld.Top( std::max( aOld.Top() - long(rUL.GetUpper()), 0L ) );
884  aOld.AddHeight(rUL.GetLower() );
885  }
886  else
887  {
888  const SvxLRSpaceItem &rLR = *static_cast<const SvxLRSpaceItem*>(pNew);
889  aOld.Left ( std::max( aOld.Left() - rLR.GetLeft(), 0L ) );
890  aOld.AddWidth(rLR.GetRight() );
891  }
892  }
893  aNew.Union( aOld );
895  }
896  break;
897 
899  {
901  rInvFlags |= 0x10;
902  }
903  break;
904 
905  case RES_BOX:
906  case RES_SHADOW:
907  rInvFlags |= 0x17;
908  break;
909 
910  case RES_FRAMEDIR :
911  SetDerivedVert( false );
912  SetDerivedR2L( false );
913  CheckDirChange();
914  break;
915 
916  case RES_OPAQUE:
917  {
918  if ( pSh )
920 
922  const SdrLayerID nId = static_cast<const SvxOpaqueItem*>(pNew)->GetValue() ?
923  rIDDMA.GetHeavenId() :
924  rIDDMA.GetHellId();
925  GetVirtDrawObj()->SetLayer( nId );
926  if( pSh )
927  {
928  SwRootFrame* pLayout = getRootFrame();
929  if( pLayout && pLayout->IsAnyShellAccessible() )
930  {
931  pSh->Imp()->DisposeAccessibleFrame( this );
932  pSh->Imp()->AddAccessibleFrame( this );
933  }
934  }
935  // #i28701# - perform reorder of object lists
936  // at anchor frame and at page frame.
937  rInvFlags |= 0x80;
938  }
939  break;
940 
941  case RES_URL:
942  // The interface changes the frame size when interacting with text frames,
943  // the Map, however, needs to be relative to FrameSize().
944  if ( (!Lower() || !Lower()->IsNoTextFrame()) && pNew && pOld &&
945  static_cast<const SwFormatURL*>(pNew)->GetMap() && static_cast<const SwFormatURL*>(pOld)->GetMap() )
946  {
947  const SwFormatFrameSize &rSz = GetFormat()->GetFrameSize();
948  if ( rSz.GetHeight() != getFrameArea().Height() ||
949  rSz.GetWidth() != getFrameArea().Width() )
950  {
951  SwFormatURL aURL( GetFormat()->GetURL() );
952  Fraction aScaleX( getFrameArea().Width(), rSz.GetWidth() );
953  Fraction aScaleY( getFrameArea().Height(), rSz.GetHeight() );
954  aURL.GetMap()->Scale( aScaleX, aScaleY );
955  SwFrameFormat *pFormat = GetFormat();
956  pFormat->LockModify();
957  pFormat->SetFormatAttr( aURL );
958  pFormat->UnlockModify();
959  }
960  }
961  // No invalidation necessary
962  break;
963 
964  case RES_CHAIN:
965  if (pNew)
966  {
967  const SwFormatChain *pChain = static_cast<const SwFormatChain*>(pNew);
968  if ( pChain->GetNext() )
969  {
970  SwFlyFrame *pFollow = FindChainNeighbour( *pChain->GetNext() );
971  if ( GetNextLink() && pFollow != GetNextLink() )
973  if ( pFollow )
974  {
975  if ( pFollow->GetPrevLink() &&
976  pFollow->GetPrevLink() != this )
978  pFollow );
979  if ( !GetNextLink() )
980  SwFlyFrame::ChainFrames( this, pFollow );
981  }
982  }
983  else if ( GetNextLink() )
985  if ( pChain->GetPrev() )
986  {
987  SwFlyFrame *pMaster = FindChainNeighbour( *pChain->GetPrev() );
988  if ( GetPrevLink() && pMaster != GetPrevLink() )
990  if ( pMaster )
991  {
992  if ( pMaster->GetNextLink() &&
993  pMaster->GetNextLink() != this )
994  SwFlyFrame::UnchainFrames( pMaster,
995  pMaster->GetNextLink() );
996  if ( !GetPrevLink() )
997  SwFlyFrame::ChainFrames( pMaster, this );
998  }
999  }
1000  else if ( GetPrevLink() )
1002  }
1003  [[fallthrough]];
1004  default:
1005  bClear = false;
1006  }
1007  if ( bClear )
1008  {
1009  if ( pOldSet || pNewSet )
1010  {
1011  if ( pOldSet )
1012  pOldSet->ClearItem( nWhich );
1013  if ( pNewSet )
1014  pNewSet->ClearItem( nWhich );
1015  }
1016  else
1017  SwLayoutFrame::Modify( pOld, pNew );
1018  }
1019 }
1020 
1022 bool SwFlyFrame::GetInfo( SfxPoolItem & rInfo ) const
1023 {
1024  if( RES_AUTOFMT_DOCNODE == rInfo.Which() )
1025  return false; // There's a FlyFrame, so use it
1026  return true; // Continue searching
1027 }
1028 
1030 {
1031  InvalidatePage( pPage );
1032  m_bNotifyBack = m_bInvalid = true;
1033 
1034  SwFlyFrame *pFrame;
1035  if ( GetAnchorFrame() && nullptr != (pFrame = AnchorFrame()->FindFlyFrame()) )
1036  {
1037  // Very bad case: If the Fly is bound within another Fly which
1038  // contains columns, the Format should be from that one.
1039  if ( !pFrame->IsLocked() && !pFrame->IsColLocked() &&
1040  pFrame->Lower() && pFrame->Lower()->IsColumnFrame() )
1041  pFrame->InvalidateSize();
1042  }
1043 
1044  // #i85216#
1045  // if vertical position is oriented at a layout frame inside a ghost section,
1046  // assure that the position is invalidated and that the information about
1047  // the vertical position oriented frame is cleared
1049  {
1050  const SwSectionFrame* pSectFrame( GetVertPosOrientFrame()->FindSctFrame() );
1051  if ( pSectFrame && pSectFrame->GetSection() == nullptr )
1052  {
1053  InvalidatePos();
1055  }
1056  }
1057 }
1058 
1063 void SwFlyFrame::ChgRelPos( const Point &rNewPos )
1064 {
1065  if ( GetCurrRelPos() == rNewPos )
1066  return;
1067 
1068  SwFrameFormat *pFormat = GetFormat();
1069  const bool bVert = GetAnchorFrame()->IsVertical();
1070  const SwTwips nNewY = bVert ? rNewPos.X() : rNewPos.Y();
1071  SwTwips nTmpY = nNewY == LONG_MAX ? 0 : nNewY;
1072  if( bVert )
1073  nTmpY = -nTmpY;
1074  SfxItemSet aSet( pFormat->GetDoc()->GetAttrPool(),
1076 
1077  SwFormatVertOrient aVert( pFormat->GetVertOrient() );
1078  const SwTextFrame *pAutoFrame = nullptr;
1079  // #i34948# - handle also at-page and at-fly anchored
1080  // Writer fly frames
1081  const RndStdIds eAnchorType = GetFrameFormat().GetAnchor().GetAnchorId();
1082  if ( eAnchorType == RndStdIds::FLY_AT_PAGE )
1083  {
1084  aVert.SetVertOrient( text::VertOrientation::NONE );
1085  aVert.SetRelationOrient( text::RelOrientation::PAGE_FRAME );
1086  }
1087  else if ( eAnchorType == RndStdIds::FLY_AT_FLY )
1088  {
1089  aVert.SetVertOrient( text::VertOrientation::NONE );
1090  aVert.SetRelationOrient( text::RelOrientation::FRAME );
1091  }
1092  else if ( IsFlyAtContentFrame() || text::VertOrientation::NONE != aVert.GetVertOrient() )
1093  {
1094  if( text::RelOrientation::CHAR == aVert.GetRelationOrient() && IsAutoPos() )
1095  {
1096  if( LONG_MAX != nNewY )
1097  {
1098  aVert.SetVertOrient( text::VertOrientation::NONE );
1100  pAutoFrame = static_cast<const SwTextFrame*>(GetAnchorFrame());
1101  TextFrameIndex const nOfs(pAutoFrame->MapModelToViewPos(
1102  *pFormat->GetAnchor().GetContentAnchor()));
1103  while( pAutoFrame->GetFollow() &&
1104  pAutoFrame->GetFollow()->GetOffset() <= nOfs )
1105  {
1106  if( pAutoFrame == GetAnchorFrame() )
1107  nTmpY += pAutoFrame->GetRelPos().Y();
1108  nTmpY -= pAutoFrame->GetUpper()->getFramePrintArea().Height();
1109  pAutoFrame = pAutoFrame->GetFollow();
1110  }
1111  nTmpY = static_cast<SwFlyAtContentFrame*>(this)->GetRelCharY(pAutoFrame)-nTmpY;
1112  }
1113  else
1114  aVert.SetVertOrient( text::VertOrientation::CHAR_BOTTOM );
1115  }
1116  else
1117  {
1118  aVert.SetVertOrient( text::VertOrientation::NONE );
1119  aVert.SetRelationOrient( text::RelOrientation::FRAME );
1120  }
1121  }
1122  aVert.SetPos( nTmpY );
1123  aSet.Put( aVert );
1124 
1125  // For Flys in the Cnt, the horizontal orientation is of no interest,
1126  // as it's always 0
1127  if ( !IsFlyInContentFrame() )
1128  {
1129  const SwTwips nNewX = bVert ? rNewPos.Y() : rNewPos.X();
1130  SwTwips nTmpX = nNewX == LONG_MAX ? 0 : nNewX;
1131  SwFormatHoriOrient aHori( pFormat->GetHoriOrient() );
1132  // #i34948# - handle also at-page and at-fly anchored
1133  // Writer fly frames
1134  if ( eAnchorType == RndStdIds::FLY_AT_PAGE )
1135  {
1137  aHori.SetRelationOrient( text::RelOrientation::PAGE_FRAME );
1138  aHori.SetPosToggle( false );
1139  }
1140  else if ( eAnchorType == RndStdIds::FLY_AT_FLY )
1141  {
1142  aHori.SetHoriOrient( text::HoriOrientation::NONE );
1143  aHori.SetRelationOrient( text::RelOrientation::FRAME );
1144  aHori.SetPosToggle( false );
1145  }
1146  else if ( IsFlyAtContentFrame() || text::HoriOrientation::NONE != aHori.GetHoriOrient() )
1147  {
1148  aHori.SetHoriOrient( text::HoriOrientation::NONE );
1149  if( text::RelOrientation::CHAR == aHori.GetRelationOrient() && IsAutoPos() )
1150  {
1151  if( LONG_MAX != nNewX )
1152  {
1153  if( !pAutoFrame )
1154  {
1156  pAutoFrame = static_cast<const SwTextFrame*>(GetAnchorFrame());
1157  TextFrameIndex const nOfs(pAutoFrame->MapModelToViewPos(
1158  *pFormat->GetAnchor().GetContentAnchor()));
1159  while( pAutoFrame->GetFollow() &&
1160  pAutoFrame->GetFollow()->GetOffset() <= nOfs )
1161  pAutoFrame = pAutoFrame->GetFollow();
1162  }
1163  nTmpX -= static_cast<SwFlyAtContentFrame*>(this)->GetRelCharX(pAutoFrame);
1164  }
1165  }
1166  else
1167  aHori.SetRelationOrient( text::RelOrientation::FRAME );
1168  aHori.SetPosToggle( false );
1169  }
1170  aHori.SetPos( nTmpX );
1171  aSet.Put( aHori );
1172  }
1173  SetCurrRelPos( rNewPos );
1174  pFormat->GetDoc()->SetAttr( aSet, *pFormat );
1175 
1176 }
1177 
1182 void SwFlyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderAttrs *pAttrs )
1183 {
1184  OSL_ENSURE( pAttrs, "FlyFrame::Format, pAttrs is 0." );
1185 
1186  ColLock();
1187 
1188  if ( !isFrameAreaSizeValid() )
1189  {
1190  if ( getFrameArea().Top() == FAR_AWAY && getFrameArea().Left() == FAR_AWAY )
1191  {
1192  // Remove safety switch (see SwFrame::CTor)
1193  {
1195  aFrm.Pos().setX(0);
1196  aFrm.Pos().setY(0);
1197  }
1198 
1199  // #i68520#
1201  }
1202 
1203  // Check column width and set it if needed
1204  if ( Lower() && Lower()->IsColumnFrame() )
1205  AdjustColumns( nullptr, false );
1206 
1207  setFrameAreaSizeValid(true);
1208 
1209  const SwTwips nUL = pAttrs->CalcTopLine() + pAttrs->CalcBottomLine();
1210  const SwTwips nLR = pAttrs->CalcLeftLine() + pAttrs->CalcRightLine();
1211  const SwFormatFrameSize &rFrameSz = GetFormat()->GetFrameSize();
1212  Size aRelSize( CalcRel( rFrameSz ) );
1213 
1214  OSL_ENSURE( pAttrs->GetSize().Height() != 0 || rFrameSz.GetHeightPercent(), "FrameAttr height is 0." );
1215  OSL_ENSURE( pAttrs->GetSize().Width() != 0 || rFrameSz.GetWidthPercent(), "FrameAttr width is 0." );
1216 
1217  SwRectFnSet aRectFnSet(this);
1218  if( !HasFixSize() )
1219  {
1220  long nMinHeight = 0;
1221  if( IsMinHeight() )
1222  nMinHeight = aRectFnSet.IsVert() ? aRelSize.Width() : aRelSize.Height();
1223 
1224  SwTwips nRemaining = CalcContentHeight(pAttrs, nMinHeight, nUL);
1225  if( IsMinHeight() && (nRemaining + nUL) < nMinHeight )
1226  nRemaining = nMinHeight - nUL;
1227  // Because the Grow/Shrink of the Flys does not directly
1228  // set the size - only indirectly by triggering a Format()
1229  // via Invalidate() - the sizes need to be set here.
1230  // Notification is running along already.
1231  // As we already got a lot of zeros per attribute, we block them
1232  // from now on.
1233 
1234  if ( nRemaining < MINFLY )
1235  nRemaining = MINFLY;
1236 
1237  {
1239  aRectFnSet.SetHeight( aPrt, nRemaining );
1240  }
1241 
1242  nRemaining -= aRectFnSet.GetHeight(getFrameArea());
1243 
1244  {
1246  aRectFnSet.AddBottom( aFrm, nRemaining + nUL );
1247  }
1248 
1249  // #i68520#
1250  if ( nRemaining + nUL != 0 )
1251  {
1253  }
1254 
1255  setFrameAreaSizeValid(true);
1256 
1258  {
1259  // This fly is a textbox of a draw shape.
1260  SdrObject* pShape = pShapeFormat->FindSdrObject();
1261  if (SdrObjCustomShape* pCustomShape = dynamic_cast<SdrObjCustomShape*>( pShape) )
1262  {
1263  // The shape is a customshape: then inform it about the calculated fly size.
1264  Size aSize(getFrameArea().Width(), getFrameArea().Height());
1265  pCustomShape->SuggestTextFrameSize(aSize);
1266  // Do the calculations normally done after touching editeng text of the shape.
1267  pCustomShape->NbcSetOutlinerParaObjectForText(nullptr, nullptr);
1268  }
1269  }
1270  }
1271  else
1272  {
1273  // Fixed Frames do not Format itself
1274  setFrameAreaSizeValid(true);
1275 
1276  // Flys set their size using the attr
1277  SwTwips nNewSize = aRectFnSet.IsVert() ? aRelSize.Width() : aRelSize.Height();
1278  nNewSize -= nUL;
1279  if( nNewSize < MINFLY )
1280  nNewSize = MINFLY;
1281 
1282  {
1284  aRectFnSet.SetHeight( aPrt, nNewSize );
1285  }
1286 
1287  nNewSize += nUL - aRectFnSet.GetHeight(getFrameArea());
1288 
1289  {
1291  aRectFnSet.AddBottom( aFrm, nNewSize );
1292  }
1293 
1294  // #i68520#
1295  if ( nNewSize != 0 )
1296  {
1298  }
1299  }
1300 
1301  if ( !m_bFormatHeightOnly )
1302  {
1303  OSL_ENSURE( aRelSize == CalcRel( rFrameSz ), "SwFlyFrame::Format CalcRel problem" );
1304  SwTwips nNewSize = aRectFnSet.IsVert() ? aRelSize.Height() : aRelSize.Width();
1305 
1306  if ( rFrameSz.GetWidthSizeType() != SwFrameSize::Fixed )
1307  {
1308  // #i9046# Autowidth for fly frames
1309  const SwTwips nAutoWidth = lcl_CalcAutoWidth( *this );
1310  if ( nAutoWidth )
1311  {
1312  if( SwFrameSize::Minimum == rFrameSz.GetWidthSizeType() )
1313  nNewSize = std::max( nNewSize - nLR, nAutoWidth );
1314  else
1315  nNewSize = nAutoWidth;
1316  }
1317  }
1318  else
1319  nNewSize -= nLR;
1320 
1321  if( nNewSize < MINFLY )
1322  nNewSize = MINFLY;
1323 
1324  {
1326  aRectFnSet.SetWidth( aPrt, nNewSize );
1327  }
1328 
1329  nNewSize += nLR - aRectFnSet.GetWidth(getFrameArea());
1330 
1331  {
1333  aRectFnSet.AddRight( aFrm, nNewSize );
1334  }
1335 
1336  // #i68520#
1337  if ( nNewSize != 0 )
1338  {
1340  }
1341  }
1342  }
1343  ColUnlock();
1344 }
1345 
1346 // #i11760# - change parameter <bNoColl>: type <bool>;
1347 // add new parameter <bNoCalcFollow> with
1348 // new parameter <bNoCalcFollow> was used by method
1349 // <FormatWidthCols(..)> to avoid follow formatting
1350 // for text frames. But, unformatted follows causes
1351 // problems in method <SwContentFrame::WouldFit_(..)>,
1352 // which assumes that the follows are formatted.
1353 // Thus, <bNoCalcFollow> no longer used by <FormatWidthCols(..)>.
1354 void CalcContent( SwLayoutFrame *pLay, bool bNoColl )
1355 {
1356  vcl::RenderContext* pRenderContext = pLay->getRootFrame()->GetCurrShell()->GetOut();
1357  SwSectionFrame* pSect;
1358  bool bCollect = false;
1359  if( pLay->IsSctFrame() )
1360  {
1361  pSect = static_cast<SwSectionFrame*>(pLay);
1362  if( pSect->IsEndnAtEnd() && !bNoColl )
1363  {
1364  bCollect = true;
1365  SwLayouter::CollectEndnotes( pLay->GetFormat()->GetDoc(), pSect );
1366  }
1367  pSect->CalcFootnoteContent();
1368  }
1369  else
1370  pSect = nullptr;
1371  SwFrame *pFrame = pLay->ContainsAny();
1372  if ( !pFrame )
1373  {
1374  if( pSect )
1375  {
1376  if( pSect->HasFollow() )
1377  pFrame = pSect->GetFollow()->ContainsAny();
1378  if( !pFrame )
1379  {
1380  if( pSect->IsEndnAtEnd() )
1381  {
1382  if( bCollect )
1384  InsertEndnotes( pSect );
1385  bool bLock = pSect->IsFootnoteLock();
1386  pSect->SetFootnoteLock( true );
1387  pSect->CalcFootnoteContent();
1388  pSect->CalcFootnoteContent();
1389  pSect->SetFootnoteLock( bLock );
1390  }
1391  return;
1392  }
1393  pFrame->InvalidatePos_();
1394  }
1395  else
1396  return;
1397  }
1398  pFrame->InvalidatePage();
1399 
1400  do
1401  {
1402  // local variables to avoid loops caused by anchored object positioning
1403  SwAnchoredObject* pAgainObj1 = nullptr;
1404  SwAnchoredObject* pAgainObj2 = nullptr;
1405 
1406  // FME 2007-08-30 #i81146# new loop control
1407  int nLoopControlRuns = 0;
1408  const int nLoopControlMax = 20;
1409  const SwFrame* pLoopControlCond = nullptr;
1410 
1411  SwFrame* pLast;
1412  do
1413  {
1414  pLast = pFrame;
1415  if( pFrame->IsVertical() ?
1416  ( pFrame->GetUpper()->getFramePrintArea().Height() != pFrame->getFrameArea().Height() )
1417  : ( pFrame->GetUpper()->getFramePrintArea().Width() != pFrame->getFrameArea().Width() ) )
1418  {
1420  pFrame->InvalidateSize_();
1421  }
1422 
1423  if ( pFrame->IsTabFrame() )
1424  {
1425  static_cast<SwTabFrame*>(pFrame)->m_bCalcLowers = true;
1426  // #i18103# - lock move backward of follow table,
1427  // if no section content is formatted or follow table belongs
1428  // to the section, which content is formatted.
1429  if ( static_cast<SwTabFrame*>(pFrame)->IsFollow() &&
1430  ( !pSect || pSect == pFrame->FindSctFrame() ) )
1431  {
1432  static_cast<SwTabFrame*>(pFrame)->m_bLockBackMove = true;
1433  }
1434  }
1435 
1436  {
1437  SwFrameDeleteGuard aDeletePageGuard(pSect ? pSect->FindPageFrame() : nullptr);
1438  SwFrameDeleteGuard aDeleteGuard(pSect);
1439  pFrame->Calc(pRenderContext);
1440  }
1441 
1442  // #i11760# - reset control flag for follow format.
1443  if ( pFrame->IsTextFrame() )
1444  {
1445  static_cast<SwTextFrame*>(pFrame)->AllowFollowFormat();
1446  }
1447 
1448  // The keep-attribute can cause the position
1449  // of the prev to be invalid:
1450  // Do not consider invalid previous frame
1451  // due to its keep-attribute, if current frame is a follow or is locked.
1452  // #i44049# - do not consider invalid previous
1453  // frame due to its keep-attribute, if it can't move forward.
1454  // #i57765# - do not consider invalid previous
1455  // frame, if current frame has a column/page break before attribute.
1456  SwFrame* pTmpPrev = pFrame->FindPrev();
1457  SwFlowFrame* pTmpPrevFlowFrame = pTmpPrev && pTmpPrev->IsFlowFrame() ? SwFlowFrame::CastFlowFrame(pTmpPrev) : nullptr;
1458  SwFlowFrame* pTmpFlowFrame = pFrame->IsFlowFrame() ? SwFlowFrame::CastFlowFrame(pFrame) : nullptr;
1459 
1460  bool bPrevInvalid = pTmpPrevFlowFrame && pTmpFlowFrame &&
1461  !pTmpFlowFrame->IsFollow() &&
1462  !StackHack::IsLocked() && // #i76382#
1463  !pTmpFlowFrame->IsJoinLocked() &&
1464  !pTmpPrev->isFrameAreaPositionValid() &&
1465  pLay->IsAnLower( pTmpPrev ) &&
1466  pTmpPrevFlowFrame->IsKeep(pTmpPrev->GetAttrSet()->GetKeep(), pTmpPrev->GetBreakItem()) &&
1467  pTmpPrevFlowFrame->IsKeepFwdMoveAllowed();
1468 
1469  // format floating screen objects anchored to the frame.
1470  if ( !bPrevInvalid && pFrame->GetDrawObjs() && pLay->IsAnLower( pFrame ) )
1471  {
1472  bool bAgain = false;
1473  bool bRestartLayoutProcess = false;
1474  SwPageFrame* pPageFrame = pFrame->FindPageFrame();
1475  size_t nCnt = pFrame->GetDrawObjs()->size();
1476  size_t i = 0;
1477  while ( i < nCnt )
1478  {
1479  // #i28701#
1480  SwAnchoredObject* pAnchoredObj = (*pFrame->GetDrawObjs())[i];
1481  assert(pAnchoredObj);
1482 
1483  // determine if anchored object has to be
1484  // formatted and, in case, format it
1485  if ( !pAnchoredObj->PositionLocked() && pAnchoredObj->IsFormatPossible() )
1486  {
1487  // #i43737# - no invalidation of
1488  // anchored object needed - causes loops for as-character
1489  // anchored objects.
1490  //pAnchoredObj->InvalidateObjPos();
1491  SwRect aRect( pAnchoredObj->GetObjRect() );
1492  if ( !SwObjectFormatter::FormatObj( *pAnchoredObj, pFrame, pPageFrame ) )
1493  {
1494  bRestartLayoutProcess = true;
1495  break;
1496  }
1497  // #i3317# - restart layout process,
1498  // if the position of the anchored object is locked now.
1499  if ( pAnchoredObj->PositionLocked() )
1500  {
1501  bRestartLayoutProcess = true;
1502  break;
1503  }
1504 
1505  if ( aRect != pAnchoredObj->GetObjRect() )
1506  {
1507  bAgain = true;
1508  if ( pAgainObj2 == pAnchoredObj )
1509  {
1510  OSL_FAIL( "::CalcContent(..) - loop detected, perform attribute changes to avoid the loop" );
1511  // Prevent oscillation
1512  SwFrameFormat& rFormat = pAnchoredObj->GetFrameFormat();
1513  SwFormatSurround aAttr( rFormat.GetSurround() );
1514  if( css::text::WrapTextMode_THROUGH != aAttr.GetSurround() )
1515  {
1516  // When on auto position, we can only set it to
1517  // flow through
1518  if ((rFormat.GetAnchor().GetAnchorId() ==
1519  RndStdIds::FLY_AT_CHAR) &&
1520  (css::text::WrapTextMode_PARALLEL ==
1521  aAttr.GetSurround()))
1522  {
1523  aAttr.SetSurround( css::text::WrapTextMode_THROUGH );
1524  }
1525  else
1526  {
1527  aAttr.SetSurround( css::text::WrapTextMode_PARALLEL );
1528  }
1529  rFormat.LockModify();
1530  rFormat.SetFormatAttr( aAttr );
1531  rFormat.UnlockModify();
1532  }
1533  }
1534  else
1535  {
1536  if ( pAgainObj1 == pAnchoredObj )
1537  pAgainObj2 = pAnchoredObj;
1538  pAgainObj1 = pAnchoredObj;
1539  }
1540  }
1541 
1542  if ( !pFrame->GetDrawObjs() )
1543  break;
1544  if ( pFrame->GetDrawObjs()->size() < nCnt )
1545  {
1546  --nCnt;
1547  // Do not increment index, in this case
1548  continue;
1549  }
1550  }
1551  ++i;
1552  }
1553 
1554  // #i28701# - restart layout process, if
1555  // requested by floating screen object formatting
1556  if ( bRestartLayoutProcess )
1557  {
1558  pFrame = pLay->ContainsAny();
1559  pAgainObj1 = nullptr;
1560  pAgainObj2 = nullptr;
1561  continue;
1562  }
1563 
1564  // #i28701# - format anchor frame after its objects
1565  // are formatted, if the wrapping style influence has to be considered.
1567  {
1568  pFrame->Calc(pRenderContext);
1569  }
1570 
1571  if ( bAgain )
1572  {
1573  pFrame = pLay->ContainsContent();
1574  if ( pFrame && pFrame->IsInTab() )
1575  pFrame = pFrame->FindTabFrame();
1576  if( pFrame && pFrame->IsInSct() )
1577  {
1578  SwSectionFrame* pTmp = pFrame->FindSctFrame();
1579  if( pTmp != pLay && pLay->IsAnLower( pTmp ) )
1580  pFrame = pTmp;
1581  }
1582 
1583  if ( pFrame == pLoopControlCond )
1584  ++nLoopControlRuns;
1585  else
1586  {
1587  nLoopControlRuns = 0;
1588  pLoopControlCond = pFrame;
1589  }
1590 
1591  if ( nLoopControlRuns < nLoopControlMax )
1592  continue;
1593 
1594  OSL_FAIL( "LoopControl in CalcContent" );
1595  }
1596  }
1597  if ( pFrame->IsTabFrame() )
1598  {
1599  if ( static_cast<SwTabFrame*>(pFrame)->IsFollow() )
1600  static_cast<SwTabFrame*>(pFrame)->m_bLockBackMove = false;
1601  }
1602 
1603  pFrame = bPrevInvalid ? pTmpPrev : pFrame->FindNext();
1604  if( !bPrevInvalid && pFrame && pFrame->IsSctFrame() && pSect )
1605  {
1606  // Empty SectionFrames could be present here
1607  while( pFrame && pFrame->IsSctFrame() && !static_cast<SwSectionFrame*>(pFrame)->GetSection() )
1608  pFrame = pFrame->FindNext();
1609 
1610  // If FindNext returns the Follow of the original Area, we want to
1611  // continue with this content as long as it flows back.
1612  if( pFrame && pFrame->IsSctFrame() && ( pFrame == pSect->GetFollow() ||
1613  static_cast<SwSectionFrame*>(pFrame)->IsAnFollow( pSect ) ) )
1614  {
1615  pFrame = static_cast<SwSectionFrame*>(pFrame)->ContainsAny();
1616  if( pFrame )
1617  pFrame->InvalidatePos_();
1618  }
1619  }
1620  // Stay in the pLay
1621  // Except for SectionFrames with Follow: the first ContentFrame of the Follow
1622  // will be formatted, so that it gets a chance to load in the pLay.
1623  // As long as these Frames are loading in pLay, we continue
1624  } while ( pFrame &&
1625  ( pLay->IsAnLower( pFrame ) ||
1626  ( pSect &&
1627  ( ( pSect->HasFollow() &&
1628  ( pLay->IsAnLower( pLast ) ||
1629  ( pLast->IsInSct() &&
1630  pLast->FindSctFrame()->IsAnFollow(pSect) ) ) &&
1631  pSect->GetFollow()->IsAnLower( pFrame ) ) ||
1632  ( pFrame->IsInSct() &&
1633  pFrame->FindSctFrame()->IsAnFollow( pSect ) ) ) ) ) );
1634  if( pSect )
1635  {
1636  if( bCollect )
1637  {
1639  pSect->CalcFootnoteContent();
1640  }
1641  if( pSect->HasFollow() )
1642  {
1643  SwSectionFrame* pNxt = pSect->GetFollow();
1644  while( pNxt && !pNxt->ContainsContent() )
1645  pNxt = pNxt->GetFollow();
1646  if( pNxt )
1647  pNxt->CalcFootnoteContent();
1648  }
1649  if( bCollect )
1650  {
1651  pFrame = pLay->ContainsAny();
1652  bCollect = false;
1653  if( pFrame )
1654  continue;
1655  }
1656  }
1657  break;
1658  }
1659  while( true );
1660 }
1661 
1663 {
1664  if ( isFrameAreaPositionValid() )
1665  return;
1666 
1667  vcl::RenderContext* pRenderContext = getRootFrame()->GetCurrShell()->GetOut();
1669 
1670  // use new class to position object
1671  GetAnchorFrame()->Calc(pRenderContext);
1673  aObjPositioning( *GetVirtDrawObj() );
1674  aObjPositioning.CalcPosition();
1675 
1676  // #i58280#
1677  // update relative position
1678  SetCurrRelPos( aObjPositioning.GetRelPos() );
1679 
1680  {
1681  SwRectFnSet aRectFnSet(GetAnchorFrame());
1683  aFrm.Pos( aObjPositioning.GetRelPos() );
1684  aFrm.Pos() += aRectFnSet.GetPos(GetAnchorFrame()->getFrameArea());
1685  }
1686 
1687  // #i69335#
1689 }
1690 
1692 {
1693  if ( !isFramePrintAreaValid() )
1694  {
1695  setFramePrintAreaValid(true);
1696 
1697  // consider vertical layout
1698  SwRectFnSet aRectFnSet(this);
1699  aRectFnSet.SetXMargins( *this, rAttrs.CalcLeftLine(),
1700  rAttrs.CalcRightLine() );
1701  aRectFnSet.SetYMargins( *this, rAttrs.CalcTopLine(),
1702  rAttrs.CalcBottomLine() );
1703  }
1704 }
1705 
1707 {
1708  if ( m_bValidContentPos )
1709  return;
1710 
1711  m_bValidContentPos = true;
1712 
1713  const SwTwips nUL = rAttrs.CalcTopLine() + rAttrs.CalcBottomLine();
1714  Size aRelSize( CalcRel( GetFormat()->GetFrameSize() ) );
1715 
1716  SwRectFnSet aRectFnSet(this);
1717  long nMinHeight = 0;
1718  if( IsMinHeight() )
1719  nMinHeight = aRectFnSet.IsVert() ? aRelSize.Width() : aRelSize.Height();
1720 
1721  Point aNewContentPos = getFramePrintArea().Pos();
1722  const SdrTextVertAdjust nAdjust = GetFormat()->GetTextVertAdjust().GetValue();
1723 
1724  if( nAdjust != SDRTEXTVERTADJUST_TOP )
1725  {
1726  const SwTwips nContentHeight = CalcContentHeight(&rAttrs, nMinHeight, nUL);
1727  SwTwips nDiff = 0;
1728 
1729  if( nContentHeight != 0)
1730  nDiff = aRectFnSet.GetHeight(getFramePrintArea()) - nContentHeight;
1731 
1732  if( nDiff > 0 )
1733  {
1734  if( nAdjust == SDRTEXTVERTADJUST_CENTER )
1735  {
1736  if( aRectFnSet.IsVertL2R() )
1737  aNewContentPos.setX(aNewContentPos.getX() + nDiff/2);
1738  else if( aRectFnSet.IsVert() )
1739  aNewContentPos.setX(aNewContentPos.getX() - nDiff/2);
1740  else
1741  aNewContentPos.setY(aNewContentPos.getY() + nDiff/2);
1742  }
1743  else if( nAdjust == SDRTEXTVERTADJUST_BOTTOM )
1744  {
1745  if( aRectFnSet.IsVertL2R() )
1746  aNewContentPos.setX(aNewContentPos.getX() + nDiff);
1747  else if( aRectFnSet.IsVert() )
1748  aNewContentPos.setX(aNewContentPos.getX() - nDiff);
1749  else
1750  aNewContentPos.setY(aNewContentPos.getY() + nDiff);
1751  }
1752  }
1753  }
1754  if( aNewContentPos != ContentPos() )
1755  {
1756  ContentPos() = aNewContentPos;
1757  for( SwFrame *pFrame = Lower(); pFrame; pFrame = pFrame->GetNext())
1758  {
1759  pFrame->InvalidatePos();
1760  }
1761  }
1762 
1763 }
1764 
1766 {
1767  m_bValidContentPos = false;
1768  Invalidate_();
1769 }
1770 
1772 {
1773  SwWrtShell* pWrtSh = dynamic_cast< SwWrtShell* >(pShell);
1774  if (pWrtSh == nullptr)
1775  return;
1776 
1777  UpdateUnfloatButton(pWrtSh, IsShowUnfloatButton(pWrtSh));
1778 }
1779 
1781 {
1782  if (pWrtSh == nullptr)
1783  return false;
1784 
1785  // In read only mode we don't allow unfloat operation
1786  if (pWrtSh->GetViewOptions()->IsReadonly())
1787  return false;
1788 
1789  const SdrObject *pObj = GetFrameFormat().FindRealSdrObject();
1790  if (pObj == nullptr)
1791  return false;
1792 
1793  // SwFlyFrame itself can mean images, ole objects, etc, but we interested in actual text frames
1794  if (SwFEShell::GetObjCntType(*pObj) != OBJCNT_FLY)
1795  return false;
1796 
1797  // We show the button only for the selected text frame
1798  SwDrawView *pView = pWrtSh->Imp()->GetDrawView();
1799  if (pView == nullptr)
1800  return false;
1801 
1802  // Fly frame can be selected only alone
1803  if (pView->GetMarkedObjectList().GetMarkCount() != 1)
1804  return false;
1805 
1806  if(!pView->IsObjMarked(pObj))
1807  return false;
1808 
1809  // A frame is a floating table if there is only one table (and maybe some whitespaces) inside it
1810  int nTableCount = 0;
1811  const SwFrame* pLower = GetLower();
1812  const SwTabFrame* pTable = nullptr;
1813  while (pLower)
1814  {
1815  if (pLower->IsTabFrame())
1816  {
1817  pTable = static_cast<const SwTabFrame*>(pLower);
1818  ++nTableCount;
1819  if (nTableCount > 1 || pTable == nullptr)
1820  return false;
1821  }
1822 
1823  if (pLower->IsTextFrame())
1824  {
1825  const SwTextFrame* pTextFrame = static_cast<const SwTextFrame*>(pLower);
1826  if (!pTextFrame->GetText().trim().isEmpty())
1827  return false;
1828  }
1829  pLower = pLower->GetNext();
1830  }
1831 
1832  if (nTableCount != 1 || pTable == nullptr)
1833  return false;
1834 
1835  // Show the unfold button only for multipage tables
1836  const SwBodyFrame *pBody = GetAnchorFrame()->FindBodyFrame();
1837  if (pBody == nullptr)
1838  return false;
1839 
1840  long nBodyHeight = pBody->getFrameArea().Height();
1841  long nTableHeight = pTable->getFrameArea().Height();
1842  long nFrameOffset = std::abs(GetAnchorFrame()->getFrameArea().Top() - pBody->getFrameArea().Top());
1843 
1844  return nBodyHeight < nTableHeight + nFrameOffset;
1845 }
1846 
1848 {
1849  SwEditWin& rEditWin = pWrtSh->GetView().GetEditWin();
1850  SwFrameControlsManager& rMngr = rEditWin.GetFrameControlsManager();
1852  if (pControl || pControl->GetWindow())
1853  {
1854  pControl->GetWindow()->MouseButtonDown(MouseEvent());
1855  }
1856 }
1857 
1858 void SwFlyFrame::UpdateUnfloatButton(SwWrtShell* pWrtSh, bool bShow) const
1859 {
1860  if (pWrtSh == nullptr)
1861  return;
1862 
1863  SwEditWin& rEditWin = pWrtSh->GetView().GetEditWin();
1864  SwFrameControlsManager& rMngr = rEditWin.GetFrameControlsManager();
1865  Point aTopRightPixel = rEditWin.LogicToPixel( getFrameArea().TopRight() );
1866  rMngr.SetUnfloatTableButton(this, bShow, aTopRightPixel);
1867 }
1868 
1869 SwTwips SwFlyFrame::Grow_( SwTwips nDist, bool bTst )
1870 {
1871  SwRectFnSet aRectFnSet(this);
1872  if ( Lower() && !IsColLocked() && !HasFixSize() )
1873  {
1874  SwTwips nSize = aRectFnSet.GetHeight(getFrameArea());
1875  if( nSize > 0 && nDist > ( LONG_MAX - nSize ) )
1876  nDist = LONG_MAX - nSize;
1877 
1878  if ( nDist <= 0 )
1879  return 0;
1880 
1881  if ( Lower()->IsColumnFrame() )
1882  { // If it's a Column Frame, the Format takes control of the
1883  // resizing (due to the adjustment).
1884  if ( !bTst )
1885  {
1886  // #i28701# - unlock position of Writer fly frame
1887  UnlockPosition();
1888  InvalidatePos_();
1889  InvalidateSize();
1890  }
1891  return 0;
1892  }
1893 
1894  if ( !bTst )
1895  {
1896  const SwRect aOld( GetObjRectWithSpaces() );
1897  InvalidateSize_();
1898  const bool bOldLock = m_bLocked;
1899  Unlock();
1900  if ( IsFlyFreeFrame() )
1901  {
1902  // #i37068# - no format of position here
1903  // and prevent move in method <CheckClip(..)>.
1904  // This is needed to prevent layout loop caused by nested
1905  // Writer fly frames - inner Writer fly frames format its
1906  // anchor, which grows/shrinks the outer Writer fly frame.
1907  // Note: position will be invalidated below.
1909 
1910  // #i55416#
1911  // Suppress format of width for autowidth frame, because the
1912  // format of the width would call <SwTextFrame::CalcFitToContent()>
1913  // for the lower frame, which initiated this grow.
1914  const bool bOldFormatHeightOnly = m_bFormatHeightOnly;
1915  const SwFormatFrameSize& rFrameSz = GetFormat()->GetFrameSize();
1916  if ( rFrameSz.GetWidthSizeType() != SwFrameSize::Fixed )
1917  {
1918  m_bFormatHeightOnly = true;
1919  }
1921  if (pSh)
1922  {
1923  static_cast<SwFlyFreeFrame*>(this)->SetNoMoveOnCheckClip( true );
1924  static_cast<SwFlyFreeFrame*>(this)->SwFlyFreeFrame::MakeAll(pSh->GetOut());
1925  static_cast<SwFlyFreeFrame*>(this)->SetNoMoveOnCheckClip( false );
1926  }
1927  // #i55416#
1928  if ( rFrameSz.GetWidthSizeType() != SwFrameSize::Fixed )
1929  {
1930  m_bFormatHeightOnly = bOldFormatHeightOnly;
1931  }
1932  }
1933  else
1934  MakeAll(getRootFrame()->GetCurrShell()->GetOut());
1935  InvalidateSize_();
1936  InvalidatePos();
1937  if ( bOldLock )
1938  Lock();
1939  const SwRect aNew( GetObjRectWithSpaces() );
1940  if ( aOld != aNew )
1941  ::Notify( this, FindPageFrame(), aOld );
1942  return aRectFnSet.GetHeight(aNew)-aRectFnSet.GetHeight(aOld);
1943  }
1944  return nDist;
1945  }
1946  return 0;
1947 }
1948 
1950 {
1951  if( Lower() && !IsColLocked() && !HasFixSize() )
1952  {
1953  SwRectFnSet aRectFnSet(this);
1954  SwTwips nHeight = aRectFnSet.GetHeight(getFrameArea());
1955  if ( nDist > nHeight )
1956  nDist = nHeight;
1957 
1958  SwTwips nVal = nDist;
1959  if ( IsMinHeight() )
1960  {
1961  const SwFormatFrameSize& rFormatSize = GetFormat()->GetFrameSize();
1962  SwTwips nFormatHeight = aRectFnSet.IsVert() ? rFormatSize.GetWidth() : rFormatSize.GetHeight();
1963 
1964  nVal = std::min( nDist, nHeight - nFormatHeight );
1965  }
1966 
1967  if ( nVal <= 0 )
1968  return 0;
1969 
1970  if ( Lower()->IsColumnFrame() )
1971  { // If it's a Column Frame, the Format takes control of the
1972  // resizing (due to the adjustment).
1973  if ( !bTst )
1974  {
1975  SwRect aOld( GetObjRectWithSpaces() );
1976 
1977  {
1979  aRectFnSet.SetHeight( aFrm, nHeight - nVal );
1980  }
1981 
1982  // #i68520#
1983  if ( nHeight - nVal != 0 )
1984  {
1986  }
1987 
1988  nHeight = aRectFnSet.GetHeight(getFramePrintArea());
1989 
1990  {
1992  aRectFnSet.SetHeight( aPrt, nHeight - nVal );
1993  }
1994 
1995  InvalidatePos_();
1996  InvalidateSize();
1997  ::Notify( this, FindPageFrame(), aOld );
1998  NotifyDrawObj();
1999  if ( GetAnchorFrame()->IsInFly() )
2000  AnchorFrame()->FindFlyFrame()->Shrink( nDist, bTst );
2001  }
2002  return 0;
2003  }
2004 
2005  if ( !bTst )
2006  {
2007  const SwRect aOld( GetObjRectWithSpaces() );
2008  InvalidateSize_();
2009  const bool bOldLocked = m_bLocked;
2010  Unlock();
2011  if ( IsFlyFreeFrame() )
2012  {
2013  // #i37068# - no format of position here
2014  // and prevent move in method <CheckClip(..)>.
2015  // This is needed to prevent layout loop caused by nested
2016  // Writer fly frames - inner Writer fly frames format its
2017  // anchor, which grows/shrinks the outer Writer fly frame.
2018  // Note: position will be invalidated below.
2020 
2021  // #i55416#
2022  // Suppress format of width for autowidth frame, because the
2023  // format of the width would call <SwTextFrame::CalcFitToContent()>
2024  // for the lower frame, which initiated this shrink.
2025  const bool bOldFormatHeightOnly = m_bFormatHeightOnly;
2026  const SwFormatFrameSize& rFrameSz = GetFormat()->GetFrameSize();
2027  if ( rFrameSz.GetWidthSizeType() != SwFrameSize::Fixed )
2028  {
2029  m_bFormatHeightOnly = true;
2030  }
2031  static_cast<SwFlyFreeFrame*>(this)->SetNoMoveOnCheckClip( true );
2033  static_cast<SwFlyFreeFrame*>(this)->SetNoMoveOnCheckClip( false );
2034  // #i55416#
2035  if ( rFrameSz.GetWidthSizeType() != SwFrameSize::Fixed )
2036  {
2037  m_bFormatHeightOnly = bOldFormatHeightOnly;
2038  }
2039  }
2040  else
2041  MakeAll(getRootFrame()->GetCurrShell()->GetOut());
2042  InvalidateSize_();
2043  InvalidatePos();
2044  if ( bOldLocked )
2045  Lock();
2046  const SwRect aNew( GetObjRectWithSpaces() );
2047  if ( aOld != aNew )
2048  {
2049  ::Notify( this, FindPageFrame(), aOld );
2050  if ( GetAnchorFrame()->IsInFly() )
2051  AnchorFrame()->FindFlyFrame()->Shrink( nDist, bTst );
2052  }
2053  return aRectFnSet.GetHeight(aOld) -
2054  aRectFnSet.GetHeight(aNew);
2055  }
2056  return nVal;
2057  }
2058  return 0;
2059 }
2060 
2061 Size SwFlyFrame::ChgSize( const Size& aNewSize )
2062 {
2063  // #i53298#
2064  // If the fly frame anchored at-paragraph or at-character contains an OLE
2065  // object, assure that the new size fits into the current clipping area
2066  // of the fly frame
2067  Size aAdjustedNewSize( aNewSize );
2068  {
2069  if ( dynamic_cast<SwFlyAtContentFrame*>(this) &&
2070  Lower() && dynamic_cast<SwNoTextFrame*>(Lower()) &&
2071  static_cast<SwNoTextFrame*>(Lower())->GetNode()->GetOLENode() )
2072  {
2073  SwRect aClipRect;
2074  ::CalcClipRect( GetVirtDrawObj(), aClipRect, false );
2075  if ( aAdjustedNewSize.Width() > aClipRect.Width() )
2076  {
2077  aAdjustedNewSize.setWidth( aClipRect.Width() );
2078  }
2079  if ( aAdjustedNewSize.Height() > aClipRect.Height() )
2080  {
2081  aAdjustedNewSize.setWidth( aClipRect.Height() );
2082  }
2083  }
2084  }
2085 
2086  if ( aAdjustedNewSize != getFrameArea().SSize() )
2087  {
2088  SwFrameFormat *pFormat = GetFormat();
2089  SwFormatFrameSize aSz( pFormat->GetFrameSize() );
2090  aSz.SetWidth( aAdjustedNewSize.Width() );
2091  aSz.SetHeight( aAdjustedNewSize.Height() );
2092  // go via the Doc for UNDO
2093  pFormat->GetDoc()->SetAttr( aSz, *pFormat );
2094  return aSz.GetSize();
2095  }
2096  else
2097  return getFrameArea().SSize();
2098 }
2099 
2100 bool SwFlyFrame::IsLowerOf( const SwLayoutFrame* pUpperFrame ) const
2101 {
2102  OSL_ENSURE( GetAnchorFrame(), "8-( Fly is lost in Space." );
2103  const SwFrame* pFrame = GetAnchorFrame();
2104  do
2105  {
2106  if ( pFrame == pUpperFrame )
2107  return true;
2108  pFrame = pFrame->IsFlyFrame()
2109  ? static_cast<const SwFlyFrame*>(pFrame)->GetAnchorFrame()
2110  : pFrame->GetUpper();
2111  } while ( pFrame );
2112  return false;
2113 }
2114 
2116 {
2117 }
2118 
2120 {
2121  if (!m_pDrawObjs)
2122  {
2123  m_pDrawObjs.reset(new SwSortedObjs());
2124  }
2125  m_pDrawObjs->Insert( *pNew );
2126  pNew->ChgAnchorFrame( this );
2127 
2128  // Register at the page
2129  // If there's none present, register via SwPageFrame::PreparePage
2130  SwPageFrame* pPage = FindPageFrame();
2131  if ( pPage != nullptr )
2132  {
2133  pPage->AppendFlyToPage( pNew );
2134  }
2135 }
2136 
2137 void SwFrame::RemoveFly( SwFlyFrame *pToRemove )
2138 {
2139  // Deregister from the page
2140  // Could already have happened, if the page was already destructed
2141  SwPageFrame *pPage = pToRemove->FindPageFrame();
2142  if ( pPage && pPage->GetSortedObjs() )
2143  {
2144  pPage->RemoveFlyFromPage( pToRemove );
2145  }
2146  // #i73201#
2147  else
2148  {
2149  if ( pToRemove->IsAccessibleFrame() &&
2150  pToRemove->GetFormat() &&
2151  !pToRemove->IsFlyInContentFrame() )
2152  {
2153  SwRootFrame *pRootFrame = getRootFrame();
2154  if( pRootFrame && pRootFrame->IsAnyShellAccessible() )
2155  {
2156  SwViewShell *pVSh = pRootFrame->GetCurrShell();
2157  if( pVSh && pVSh->Imp() )
2158  {
2159  pVSh->Imp()->DisposeAccessibleFrame( pToRemove );
2160  }
2161  }
2162  }
2163  }
2164 
2165  m_pDrawObjs->Remove(*pToRemove);
2166  if (!m_pDrawObjs->size())
2167  {
2168  m_pDrawObjs.reset();
2169  }
2170 
2171  pToRemove->ChgAnchorFrame( nullptr );
2172 
2173  if ( !pToRemove->IsFlyInContentFrame() && GetUpper() && IsInTab() )//MA_FLY_HEIGHT
2174  GetUpper()->InvalidateSize();
2175 }
2176 
2178 {
2179  assert(!m_pDrawObjs || m_pDrawObjs->is_sorted());
2180 
2181  if ( dynamic_cast<const SwAnchoredDrawObject*>( &_rNewObj) == nullptr )
2182  {
2183  OSL_FAIL( "SwFrame::AppendDrawObj(..) - anchored object of unexpected type -> object not appended" );
2184  return;
2185  }
2186 
2187  if ( dynamic_cast<const SwDrawVirtObj*>(_rNewObj.GetDrawObj()) == nullptr &&
2188  _rNewObj.GetAnchorFrame() && _rNewObj.GetAnchorFrame() != this )
2189  {
2190  assert(!m_pDrawObjs || m_pDrawObjs->is_sorted());
2191  // perform disconnect from layout, if 'master' drawing object is appended
2192  // to a new frame.
2193  static_cast<SwDrawContact*>(::GetUserCall( _rNewObj.GetDrawObj() ))->
2194  DisconnectFromLayout( false );
2195  assert(!m_pDrawObjs || m_pDrawObjs->is_sorted());
2196  }
2197 
2198  if ( _rNewObj.GetAnchorFrame() != this )
2199  {
2200  if (!m_pDrawObjs)
2201  {
2202  m_pDrawObjs.reset(new SwSortedObjs());
2203  }
2204  m_pDrawObjs->Insert(_rNewObj);
2205  _rNewObj.ChgAnchorFrame( this );
2206  }
2207 
2208  // #i113730#
2209  // Assure the control objects and group objects containing controls are on the control layer
2210  if ( ::CheckControlLayer( _rNewObj.DrawObj() ) )
2211  {
2213  const SdrLayerID aCurrentLayer(_rNewObj.DrawObj()->GetLayer());
2214  const SdrLayerID aControlLayerID(rIDDMA.GetControlsId());
2215  const SdrLayerID aInvisibleControlLayerID(rIDDMA.GetInvisibleControlsId());
2216 
2217  if(aCurrentLayer != aControlLayerID && aCurrentLayer != aInvisibleControlLayerID)
2218  {
2219  if ( aCurrentLayer == rIDDMA.GetInvisibleHellId() ||
2220  aCurrentLayer == rIDDMA.GetInvisibleHeavenId() )
2221  {
2222  _rNewObj.DrawObj()->SetLayer(aInvisibleControlLayerID);
2223  }
2224  else
2225  {
2226  _rNewObj.DrawObj()->SetLayer(aControlLayerID);
2227  }
2228  //The layer is part of the key used to sort the obj, so update
2229  //its position if the layer changed.
2230  m_pDrawObjs->Update(_rNewObj);
2231  }
2232  }
2233 
2234  // no direct positioning needed, but invalidate the drawing object position
2235  _rNewObj.InvalidateObjPos();
2236 
2237  // register at page frame
2238  SwPageFrame* pPage = FindPageFrame();
2239  if ( pPage )
2240  {
2241  pPage->AppendDrawObjToPage( _rNewObj );
2242  }
2243 
2244  // Notify accessible layout.
2246  if( pSh )
2247  {
2248  SwRootFrame* pLayout = getRootFrame();
2249  if( pLayout && pLayout->IsAnyShellAccessible() )
2250  {
2251  pSh->Imp()->AddAccessibleObj( _rNewObj.GetDrawObj() );
2252  }
2253  }
2254 
2255  assert(!m_pDrawObjs || m_pDrawObjs->is_sorted());
2256 }
2257 
2259 {
2260  // Notify accessible layout.
2262  if( pSh )
2263  {
2264  SwRootFrame* pLayout = getRootFrame();
2265  if (pLayout && pLayout->IsAnyShellAccessible())
2266  pSh->Imp()->DisposeAccessibleObj(_rToRemoveObj.GetDrawObj(), false);
2267  }
2268 
2269  // deregister from page frame
2270  SwPageFrame* pPage = _rToRemoveObj.GetPageFrame();
2271  if ( pPage && pPage->GetSortedObjs() )
2272  pPage->RemoveDrawObjFromPage( _rToRemoveObj );
2273 
2274  m_pDrawObjs->Remove(_rToRemoveObj);
2275  if (!m_pDrawObjs->size())
2276  {
2277  m_pDrawObjs.reset();
2278  }
2279  _rToRemoveObj.ChgAnchorFrame( nullptr );
2280 
2281  assert(!m_pDrawObjs || m_pDrawObjs->is_sorted());
2282 }
2283 
2284 void SwFrame::InvalidateObjs( const bool _bNoInvaOfAsCharAnchoredObjs )
2285 {
2286  if ( !GetDrawObjs() )
2287  return;
2288 
2289  // #i26945# - determine page the frame is on,
2290  // in order to check, if anchored object is registered at the same
2291  // page.
2292  const SwPageFrame* pPageFrame = FindPageFrame();
2293  // #i28701# - re-factoring
2294  for (SwAnchoredObject* pAnchoredObj : *GetDrawObjs())
2295  {
2296  if ( _bNoInvaOfAsCharAnchoredObjs &&
2297  (pAnchoredObj->GetFrameFormat().GetAnchor().GetAnchorId()
2298  == RndStdIds::FLY_AS_CHAR) )
2299  {
2300  continue;
2301  }
2302  // #i26945# - no invalidation, if anchored object
2303  // isn't registered at the same page and instead is registered at
2304  // the page, where its anchor character text frame is on.
2305  if ( pAnchoredObj->GetPageFrame() &&
2306  pAnchoredObj->GetPageFrame() != pPageFrame )
2307  {
2308  SwTextFrame* pAnchorCharFrame = pAnchoredObj->FindAnchorCharFrame();
2309  if ( pAnchorCharFrame &&
2310  pAnchoredObj->GetPageFrame() == pAnchorCharFrame->FindPageFrame() )
2311  {
2312  continue;
2313  }
2314  // #115759# - unlock its position, if anchored
2315  // object isn't registered at the page, where its anchor
2316  // character text frame is on, respectively if it has no
2317  // anchor character text frame.
2318  else
2319  {
2320  pAnchoredObj->UnlockPosition();
2321  }
2322  }
2323  // #i51474# - reset flag, that anchored object
2324  // has cleared environment, and unlock its position, if the anchored
2325  // object is registered at the same page as the anchor frame is on.
2326  if ( pAnchoredObj->ClearedEnvironment() &&
2327  pAnchoredObj->GetPageFrame() &&
2328  pAnchoredObj->GetPageFrame() == pPageFrame )
2329  {
2330  pAnchoredObj->UnlockPosition();
2331  pAnchoredObj->SetClearedEnvironment( false );
2332  }
2333  // distinguish between writer fly frames and drawing objects
2334  if ( dynamic_cast<const SwFlyFrame*>( pAnchoredObj) != nullptr )
2335  {
2336  SwFlyFrame* pFly = static_cast<SwFlyFrame*>(pAnchoredObj);
2337  pFly->Invalidate_();
2338  pFly->InvalidatePos_();
2339  }
2340  else
2341  {
2342  pAnchoredObj->InvalidateObjPos();
2343  }
2344  } // end of loop on objects, which are connected to the frame
2345 }
2346 
2347 // #i26945# - correct check, if anchored object is a lower
2348 // of the layout frame. E.g., anchor character text frame can be a follow text
2349 // frame.
2350 // #i44016# - add parameter <_bUnlockPosOfObjs> to
2351 // force an unlockposition call for the lower objects.
2352 void SwLayoutFrame::NotifyLowerObjs( const bool _bUnlockPosOfObjs )
2353 {
2354  // invalidate lower floating screen objects
2355  SwPageFrame* pPageFrame = FindPageFrame();
2356  if ( !(pPageFrame && pPageFrame->GetSortedObjs()) )
2357  return;
2358 
2359  SwSortedObjs& rObjs = *(pPageFrame->GetSortedObjs());
2360  for (SwAnchoredObject* pObj : rObjs)
2361  {
2362  // #i26945# - check, if anchored object is a lower
2363  // of the layout frame is changed to check, if its anchor frame
2364  // is a lower of the layout frame.
2365  // determine the anchor frame - usually it's the anchor frame,
2366  // for at-character/as-character anchored objects the anchor character
2367  // text frame is taken.
2368  const SwFrame* pAnchorFrame = pObj->GetAnchorFrameContainingAnchPos();
2369  if ( dynamic_cast<const SwFlyFrame*>( pObj) != nullptr )
2370  {
2371  SwFlyFrame* pFly = static_cast<SwFlyFrame*>(pObj);
2372 
2373  if ( pFly->getFrameArea().Left() == FAR_AWAY )
2374  continue;
2375 
2376  if ( pFly->IsAnLower( this ) )
2377  continue;
2378 
2379  // #i26945# - use <pAnchorFrame> to check, if
2380  // fly frame is lower of layout frame resp. if fly frame is
2381  // at a different page registered as its anchor frame is on.
2382  const bool bLow = IsAnLower( pAnchorFrame );
2383  if ( bLow || pAnchorFrame->FindPageFrame() != pPageFrame )
2384  {
2385  pFly->Invalidate_( pPageFrame );
2386  if ( !bLow || pFly->IsFlyAtContentFrame() )
2387  {
2388  // #i44016#
2389  if ( _bUnlockPosOfObjs )
2390  {
2391  pFly->UnlockPosition();
2392  }
2393  pFly->InvalidatePos_();
2394  }
2395  else
2396  pFly->InvalidatePrt_();
2397  }
2398  }
2399  else
2400  {
2401  OSL_ENSURE( dynamic_cast<const SwAnchoredDrawObject*>( pObj) != nullptr,
2402  "<SwLayoutFrame::NotifyFlys() - anchored object of unexpected type" );
2403  // #i26945# - use <pAnchorFrame> to check, if
2404  // fly frame is lower of layout frame resp. if fly frame is
2405  // at a different page registered as its anchor frame is on.
2406  if ( IsAnLower( pAnchorFrame ) ||
2407  pAnchorFrame->FindPageFrame() != pPageFrame )
2408  {
2409  // #i44016#
2410  if ( _bUnlockPosOfObjs )
2411  {
2412  pObj->UnlockPosition();
2413  }
2414  pObj->InvalidateObjPos();
2415  }
2416  }
2417  }
2418 }
2419 
2421 {
2422  SwVirtFlyDrawObj* pObj = GetVirtDrawObj();
2423  pObj->SetRect();
2424  pObj->SetRectsDirty();
2425  pObj->SetChanged();
2426  pObj->BroadcastObjectChange();
2427 
2428  if ( GetFormat()->GetSurround().IsContour() )
2429  {
2430  ClrContourCache( pObj );
2431  }
2432  else if(IsFlyFreeFrame() && static_cast< const SwFlyFreeFrame* >(this)->supportsAutoContour())
2433  {
2434  // RotateFlyFrame3: Also need to clear when changes happen
2435  // Caution: isTransformableSwFrame is already reset when resetting rotation, so
2436  // *additionally* reset in SwFlyFreeFrame::MakeAll when no more rotation
2437  ClrContourCache( pObj );
2438  }
2439 }
2440 
2442 {
2443  Size aRet( rSz.GetSize() );
2444 
2445  const SwFrame *pRel = IsFlyLayFrame() ? GetAnchorFrame() : GetAnchorFrame()->GetUpper();
2446  if( pRel ) // LAYER_IMPL
2447  {
2448  long nRelWidth = LONG_MAX, nRelHeight = LONG_MAX;
2449  const SwViewShell *pSh = getRootFrame()->GetCurrShell();
2450  if ( ( pRel->IsBodyFrame() || pRel->IsPageFrame() ) &&
2451  pSh && pSh->GetViewOptions()->getBrowseMode() &&
2452  pSh->VisArea().HasArea() )
2453  {
2454  nRelWidth = pSh->GetBrowseWidth();
2455  nRelHeight = pSh->VisArea().Height();
2456  Size aBorder = pSh->GetOut()->PixelToLogic( pSh->GetBrowseBorder() );
2457  nRelWidth = std::min( nRelWidth, pRel->getFramePrintArea().Width() );
2458  nRelHeight -= 2*aBorder.Height();
2459  nRelHeight = std::min( nRelHeight, pRel->getFramePrintArea().Height() );
2460  }
2461 
2462  // At the moment only the "== PAGE_FRAME" and "!= PAGE_FRAME" cases are handled.
2463  // When size is a relative to page size, ignore size of SwBodyFrame.
2464  if (rSz.GetWidthPercentRelation() != text::RelOrientation::PAGE_FRAME)
2465  nRelWidth = std::min( nRelWidth, pRel->getFramePrintArea().Width() );
2466  else if ( pRel->IsPageFrame() )
2467  nRelWidth = std::min( nRelWidth, pRel->getFrameArea().Width() );
2468 
2469  if (rSz.GetHeightPercentRelation() != text::RelOrientation::PAGE_FRAME)
2470  nRelHeight = std::min( nRelHeight, pRel->getFramePrintArea().Height() );
2471  else if ( pRel->IsPageFrame() )
2472  nRelHeight = std::min( nRelHeight, pRel->getFrameArea().Height() );
2473 
2474  if( !pRel->IsPageFrame() )
2475  {
2476  const SwPageFrame* pPage = FindPageFrame();
2477  if( pPage )
2478  {
2479  if (rSz.GetWidthPercentRelation() == text::RelOrientation::PAGE_FRAME)
2480  // Ignore margins of pPage.
2481  nRelWidth = std::min( nRelWidth, pPage->getFrameArea().Width() );
2482  else
2483  nRelWidth = std::min( nRelWidth, pPage->getFramePrintArea().Width() );
2484  if (rSz.GetHeightPercentRelation() == text::RelOrientation::PAGE_FRAME)
2485  // Ignore margins of pPage.
2486  nRelHeight = std::min( nRelHeight, pPage->getFrameArea().Height() );
2487  else
2488  nRelHeight = std::min( nRelHeight, pPage->getFramePrintArea().Height() );
2489  }
2490  }
2491 
2493  aRet.setWidth( nRelWidth * rSz.GetWidthPercent() / 100 );
2495  aRet.setHeight( nRelHeight * rSz.GetHeightPercent() / 100 );
2496 
2498  {
2499  aRet.setWidth( aRet.Width() * ( aRet.Height()) );
2500  aRet.setWidth( aRet.Width() / ( rSz.GetHeight()) );
2501  }
2502  else if ( rSz.GetHeightPercent() == SwFormatFrameSize::SYNCED )
2503  {
2504  aRet.setHeight( aRet.Height() * ( aRet.Width()) );
2505  aRet.setHeight( aRet.Height() / ( rSz.GetWidth()) );
2506  }
2507  }
2508  return aRet;
2509 }
2510 
2511 static SwTwips lcl_CalcAutoWidth( const SwLayoutFrame& rFrame )
2512 {
2513  SwTwips nRet = 0;
2514  SwTwips nMin = 0;
2515  const SwFrame* pFrame = rFrame.Lower();
2516 
2517  // No autowidth defined for columned frames
2518  if ( !pFrame || pFrame->IsColumnFrame() )
2519  return nRet;
2520  // tdf#124423 In Microsoft compatibility mode: widen the frame to max (PrintArea of the frame it anchored to) if it contains at least 2 paragraphs.
2522  {
2523  const SwFrame* pFrameRect = rFrame.IsFlyFrame() ? static_cast<const SwFlyFrame*>(&rFrame)->GetAnchorFrame() : pFrame->FindPageFrame();
2524  return rFrame.IsVertical() ? pFrameRect->getFramePrintArea().Height() : pFrameRect->getFramePrintArea().Width();
2525  }
2526 
2527  while ( pFrame )
2528  {
2529  if ( pFrame->IsSctFrame() )
2530  {
2531  nMin = lcl_CalcAutoWidth( *static_cast<const SwSectionFrame*>(pFrame) );
2532  }
2533  if ( pFrame->IsTextFrame() )
2534  {
2535  nMin = const_cast<SwTextFrame*>(static_cast<const SwTextFrame*>(pFrame))->CalcFitToContent();
2536  const SvxLRSpaceItem &rSpace =
2537  static_cast<const SwTextFrame*>(pFrame)->GetTextNodeForParaProps()->GetSwAttrSet().GetLRSpace();
2538  if (!static_cast<const SwTextFrame*>(pFrame)->IsLocked())
2539  nMin += rSpace.GetRight() + rSpace.GetTextLeft() + rSpace.GetTextFirstLineOffset();
2540  }
2541  else if ( pFrame->IsTabFrame() )
2542  {
2543  const SwFormatFrameSize& rTableFormatSz = static_cast<const SwTabFrame*>(pFrame)->GetTable()->GetFrameFormat()->GetFrameSize();
2544  if ( USHRT_MAX == rTableFormatSz.GetSize().Width() ||
2545  text::HoriOrientation::NONE == static_cast<const SwTabFrame*>(pFrame)->GetFormat()->GetHoriOrient().GetHoriOrient() )
2546  {
2547  const SwPageFrame* pPage = rFrame.FindPageFrame();
2548  // auto width table
2549  nMin = pFrame->GetUpper()->IsVertical() ?
2550  pPage->getFramePrintArea().Height() :
2551  pPage->getFramePrintArea().Width();
2552  }
2553  else
2554  {
2555  nMin = rTableFormatSz.GetSize().Width();
2556  }
2557  }
2558 
2559  if ( nMin > nRet )
2560  nRet = nMin;
2561 
2562  pFrame = pFrame->GetNext();
2563  }
2564 
2565  return nRet;
2566 }
2567 
2571  const bool _bForPaint ) const
2572 {
2573  vcl::RenderContext* pRenderContext = getRootFrame()->GetCurrShell()->GetOut();
2574  bool bRet = false;
2575  const bool bIsCandidate(Lower() && Lower()->IsNoTextFrame());
2576 
2577  if(bIsCandidate)
2578  {
2579  if(GetFormat()->GetSurround().IsContour())
2580  {
2581  SwNoTextNode *pNd = const_cast<SwNoTextNode*>(static_cast<const SwNoTextNode*>(static_cast<const SwNoTextFrame*>(Lower())->GetNode()));
2582  // #i13147# - determine <GraphicObject> instead of <Graphic>
2583  // in order to avoid load of graphic, if <SwNoTextNode> contains a graphic
2584  // node and method is called for paint.
2585  std::unique_ptr<GraphicObject> xTmpGrfObj;
2586  const GraphicObject* pGrfObj = nullptr;
2587  const SwGrfNode* pGrfNd = pNd->GetGrfNode();
2588  if ( pGrfNd && _bForPaint )
2589  {
2590  pGrfObj = &(pGrfNd->GetGrfObj());
2591  }
2592  else
2593  {
2594  xTmpGrfObj.reset(new GraphicObject(pNd->GetGraphic()));
2595  pGrfObj = xTmpGrfObj.get();
2596  }
2597  assert(pGrfObj && "SwFlyFrame::GetContour() - No Graphic/GraphicObject found at <SwNoTextNode>.");
2598  if (pGrfObj->GetType() != GraphicType::NONE)
2599  {
2600  if( !pNd->HasContour() )
2601  {
2602  //#i13147# - no <CreateContour> for a graphic
2603  // during paint. Thus, return (value of <bRet> should be <false>).
2604  if ( pGrfNd && _bForPaint )
2605  {
2606  OSL_FAIL( "SwFlyFrame::GetContour() - No Contour found at <SwNoTextNode> during paint." );
2607  return bRet;
2608  }
2609  pNd->CreateContour();
2610  }
2611  pNd->GetContour( rContour );
2612  // The Node holds the Polygon matching the original size of the graphic
2613  // We need to include the scaling here
2614  SwRect aClip;
2615  SwRect aOrig;
2616  Lower()->Calc(pRenderContext);
2617  static_cast<const SwNoTextFrame*>(Lower())->GetGrfArea( aClip, &aOrig );
2618  // #i13147# - copy method code <SvxContourDlg::ScaleContour(..)>
2619  // in order to avoid that graphic has to be loaded for contour scale.
2620  //SvxContourDlg::ScaleContour( rContour, aGrf, MapUnit::MapTwip, aOrig.SSize() );
2621  {
2623  const MapMode aDispMap( MapUnit::MapTwip );
2624  const MapMode aGrfMap( pGrfObj->GetPrefMapMode() );
2625  const Size aGrfSize( pGrfObj->GetPrefSize() );
2626  Size aOrgSize;
2627  Point aNewPoint;
2628  bool bPixelMap = aGrfMap.GetMapUnit() == MapUnit::MapPixel;
2629 
2630  if ( bPixelMap )
2631  aOrgSize = pOutDev->PixelToLogic( aGrfSize, aDispMap );
2632  else
2633  aOrgSize = OutputDevice::LogicToLogic( aGrfSize, aGrfMap, aDispMap );
2634 
2635  if ( aOrgSize.Width() && aOrgSize.Height() )
2636  {
2637  double fScaleX = static_cast<double>(aOrig.Width()) / aOrgSize.Width();
2638  double fScaleY = static_cast<double>(aOrig.Height()) / aOrgSize.Height();
2639 
2640  for ( sal_uInt16 j = 0, nPolyCount = rContour.Count(); j < nPolyCount; j++ )
2641  {
2642  tools::Polygon& rPoly = rContour[ j ];
2643 
2644  for ( sal_uInt16 i = 0, nCount = rPoly.GetSize(); i < nCount; i++ )
2645  {
2646  if ( bPixelMap )
2647  aNewPoint = pOutDev->PixelToLogic( rPoly[ i ], aDispMap );
2648  else
2649  aNewPoint = OutputDevice::LogicToLogic( rPoly[ i ], aGrfMap, aDispMap );
2650 
2651  rPoly[ i ] = Point( FRound( aNewPoint.getX() * fScaleX ), FRound( aNewPoint.getY() * fScaleY ) );
2652  }
2653  }
2654  }
2655  }
2656  // destroy created <GraphicObject>.
2657  xTmpGrfObj.reset();
2658  rContour.Move( aOrig.Left(), aOrig.Top() );
2659  if( !aClip.Width() )
2660  aClip.Width( 1 );
2661  if( !aClip.Height() )
2662  aClip.Height( 1 );
2663  rContour.Clip( aClip.SVRect() );
2664  rContour.Optimize(PolyOptimizeFlags::CLOSE);
2665  bRet = true;
2666  }
2667  }
2668  else
2669  {
2670  const SwFlyFreeFrame* pSwFlyFreeFrame(dynamic_cast< const SwFlyFreeFrame* >(this));
2671 
2672  if(nullptr != pSwFlyFreeFrame &&
2673  pSwFlyFreeFrame->supportsAutoContour() &&
2674  // isTransformableSwFrame already used in supportsAutoContour(), but
2675  // better check twice when it may get changed there...
2676  pSwFlyFreeFrame->isTransformableSwFrame())
2677  {
2678  // RotateFlyFrame: use untransformed SwFrame to allow text floating around.
2679  // Will be transformed below
2680  const TransformableSwFrame* pTransformableSwFrame(pSwFlyFreeFrame->getTransformableSwFrame());
2681  const SwRect aFrameArea(pTransformableSwFrame->getUntransformedFrameArea());
2682  rContour = tools::PolyPolygon(tools::Polygon(aFrameArea.SVRect()));
2683  bRet = (0 != rContour.Count());
2684  }
2685  }
2686 
2687  if(bRet && 0 != rContour.Count())
2688  {
2689  const SwFlyFreeFrame* pSwFlyFreeFrame(dynamic_cast< const SwFlyFreeFrame* >(this));
2690 
2691  if(nullptr != pSwFlyFreeFrame && pSwFlyFreeFrame->isTransformableSwFrame())
2692  {
2693  // Need to adapt contour to transformation
2694  basegfx::B2DVector aScale, aTranslate;
2695  double fRotate, fShearX;
2696  getFrameAreaTransformation().decompose(aScale, aTranslate, fRotate, fShearX);
2697 
2698  if(!basegfx::fTools::equalZero(fRotate))
2699  {
2700  basegfx::B2DPolyPolygon aSource(rContour.getB2DPolyPolygon());
2701  const basegfx::B2DPoint aCenter(getFrameAreaTransformation() * basegfx::B2DPoint(0.5, 0.5));
2702  const basegfx::B2DHomMatrix aRotateAroundCenter(
2704  aCenter.getX(),
2705  aCenter.getY(),
2706  fRotate));
2707  aSource.transform(aRotateAroundCenter);
2708  rContour = tools::PolyPolygon(aSource);
2709  }
2710  }
2711  }
2712  }
2713 
2714  return bRet;
2715 }
2716 
2717 
2719 {
2720  return static_cast<const SwVirtFlyDrawObj*>(GetDrawObj());
2721 }
2723 {
2724  return static_cast<SwVirtFlyDrawObj*>(DrawObj());
2725 }
2726 
2727 // implementation of pure virtual method declared in
2728 // base class <SwAnchoredObject>
2729 
2731 {
2732  InvalidatePos();
2733  // #i68520#
2735 }
2736 
2738 {
2739  OSL_ENSURE( GetFormat(),
2740  "<SwFlyFrame::GetFrameFormat()> - missing frame format -> crash." );
2741  return *GetFormat();
2742 }
2744 {
2745  OSL_ENSURE( GetFormat(),
2746  "<SwFlyFrame::GetFrameFormat()> - missing frame format -> crash." );
2747  return *GetFormat();
2748 }
2749 
2751 {
2752  return getFrameArea();
2753 }
2754 
2755 // #i70122#
2756 // for Writer fly frames the bounding rectangle equals the object rectangles
2758 {
2759  return GetObjRect();
2760 }
2761 
2762 // #i68520#
2763 bool SwFlyFrame::SetObjTop_( const SwTwips _nTop )
2764 {
2765  const bool bChanged( getFrameArea().Pos().getY() != _nTop );
2767  aFrm.Pos().setY(_nTop);
2768 
2769  return bChanged;
2770 }
2771 bool SwFlyFrame::SetObjLeft_( const SwTwips _nLeft )
2772 {
2773  const bool bChanged( getFrameArea().Pos().getX() != _nLeft );
2775  aFrm.Pos().setX(_nLeft);
2776 
2777  return bChanged;
2778 }
2779 
2786 {
2787  // default behaviour is to do nothing.
2788 }
2789 
2795 {
2797  !IsLocked() && !IsColLocked();
2798 }
2799 
2800 void SwFlyFrame::GetAnchoredObjects( std::vector<SwAnchoredObject*>& aVector, const SwFormat& rFormat )
2801 {
2802  SwIterator<SwFlyFrame,SwFormat> aIter( rFormat );
2803  for( SwFlyFrame* pFlyFrame = aIter.First(); pFlyFrame; pFlyFrame = aIter.Next() )
2804  aVector.push_back( pFlyFrame );
2805 }
2806 
2808 {
2809  return static_cast< const SwFlyFrameFormat * >( GetDep() );
2810 }
2811 
2813 {
2814  return static_cast< SwFlyFrameFormat * >( GetDep() );
2815 }
2816 
2817 void SwFlyFrame::Calc(vcl::RenderContext* pRenderContext) const
2818 {
2819  if ( !m_bValidContentPos )
2820  const_cast<SwFlyFrame*>(this)->PrepareMake(pRenderContext);
2821  else
2822  SwLayoutFrame::Calc(pRenderContext);
2823 }
2824 
2825 SwTwips SwFlyFrame::CalcContentHeight(const SwBorderAttrs *pAttrs, const SwTwips nMinHeight, const SwTwips nUL)
2826 {
2827  SwRectFnSet aRectFnSet(this);
2828  SwTwips nHeight = 0;
2829  if ( Lower() )
2830  {
2831  if ( Lower()->IsColumnFrame() )
2832  {
2833  FormatWidthCols( *pAttrs, nUL, nMinHeight );
2834  nHeight = aRectFnSet.GetHeight(Lower()->getFrameArea());
2835  }
2836  else
2837  {
2838  SwFrame *pFrame = Lower();
2839  while ( pFrame )
2840  {
2841  nHeight += aRectFnSet.GetHeight(pFrame->getFrameArea());
2842  if( pFrame->IsTextFrame() && static_cast<SwTextFrame*>(pFrame)->IsUndersized() )
2843  // This TextFrame would like to be a bit larger
2844  nHeight += static_cast<SwTextFrame*>(pFrame)->GetParHeight()
2845  - aRectFnSet.GetHeight(pFrame->getFramePrintArea());
2846  else if( pFrame->IsSctFrame() && static_cast<SwSectionFrame*>(pFrame)->IsUndersized() )
2847  nHeight += static_cast<SwSectionFrame*>(pFrame)->Undersize();
2848  pFrame = pFrame->GetNext();
2849  }
2850  }
2851  if ( GetDrawObjs() )
2852  {
2853  const size_t nCnt = GetDrawObjs()->size();
2854  SwTwips nTop = aRectFnSet.GetTop(getFrameArea());
2855  SwTwips nBorder = aRectFnSet.GetHeight(getFrameArea()) -
2856  aRectFnSet.GetHeight(getFramePrintArea());
2857  for ( size_t i = 0; i < nCnt; ++i )
2858  {
2859  SwAnchoredObject* pAnchoredObj = (*GetDrawObjs())[i];
2860  if ( dynamic_cast<const SwFlyFrame*>( pAnchoredObj) != nullptr )
2861  {
2862  SwFlyFrame* pFly = static_cast<SwFlyFrame*>(pAnchoredObj);
2863  // consider only Writer fly frames, which follow the text flow.
2864  if ( pFly->IsFlyLayFrame() &&
2865  pFly->getFrameArea().Top() != FAR_AWAY &&
2866  pFly->GetFormat()->GetFollowTextFlow().GetValue() )
2867  {
2868  SwTwips nDist = -aRectFnSet.BottomDist( pFly->getFrameArea(), nTop );
2869  if( nDist > nBorder + nHeight )
2870  nHeight = nDist - nBorder;
2871  }
2872  }
2873  }
2874  }
2875  }
2876  return nHeight;
2877 }
2878 
2879 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 Count() const
long GetLeft() const
bool IsAnLower(const SwFrame *) const
Definition: findfrm.cxx:206
vcl::RenderContext * GetOut() const
Definition: viewsh.hxx:339
bool GetValue() const
Graphic GetGraphic() const
Definition: ndnotxt.cxx:228
long Width() const
void SetFootnoteLock(bool bNew)
Definition: sectfrm.hxx:156
SwFrame * FindFooterOrHeader()
Definition: findfrm.cxx:547
bool IsKeepFwdMoveAllowed(bool bIgnoreMyOwnKeepValue=false)
Definition: flowfrm.cxx:123
constexpr TypedWhichId< SvxProtectItem > RES_PROTECT(100)
sal_uInt16 CalcBottomLine() const
Definition: frmtool.hxx:505
const SwVirtFlyDrawObj * GetVirtDrawObj() const
Definition: fly.cxx:2718
Base class of the Writer layout elements.
Definition: frame.hxx:297
Base class that provides the general functionalities for frames that are allowed at page breaks (flow...
Definition: flowfrm.hxx:58
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:151
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(120)
virtual bool SetObjLeft_(const SwTwips _nLeft) override
Definition: fly.cxx:2771
virtual SwRect GetObjRect() const =0
void NotifyDrawObj()
Definition: fly.cxx:2420
long BottomDist(const SwRect &rRect, long nPos) const
Definition: frame.hxx:1392
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(101)
void InsertCnt()
Definition: fly.cxx:208
URL aURL
virtual bool IsFormatPossible() const override
method to determine if a format on the Writer fly frame is possible
Definition: fly.cxx:2794
SDRTEXTVERTADJUST_TOP
void InvalidateAccessibleRelationSet(const SwFlyFrame *pMaster, const SwFlyFrame *pFollow)
Invalidate frame's relation set (for chained frames)
Definition: viewimp.cxx:365
virtual void SwClientNotify(const SwModify &rMod, const SfxHint &rHint) override
Definition: fly.cxx:611
bool IsFlyLayFrame() const
Definition: flyfrm.hxx:195
sal_Int32 nIndex
bool IsFollow() const
Definition: flowfrm.hxx:166
Point GetPos(const SwRect &rRect) const
Definition: frame.hxx:1361
virtual const SwFlyFrameFormat * GetFormat() const override
Definition: fly.cxx:2807
void SetNotifyBack()
Definition: flyfrm.hxx:199
const SwSortedObjs * GetDrawObjs() const
Definition: frame.hxx:545
const SwFormatCol & GetCol(bool=true) const
Definition: fmtclds.hxx:168
void InvalidateContentPos()
Definition: fly.cxx:1765
size_t GetMarkCount() const
void InsertCnt_(SwLayoutFrame *pLay, SwDoc *pDoc, sal_uLong nIndex, bool bPages=false, sal_uLong nEndIndex=0, SwFrame *pPrv=nullptr, sw::FrameMode eMode=sw::FrameMode::New)
Definition: frmtool.cxx:1416
bool IsEndnAtEnd() const
Definition: sectfrm.hxx:148
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:816
bool IsInFly() const
Definition: frame.hxx:939
SwRect & Union(const SwRect &rRect)
Definition: swrect.cxx:41
bool IsInSct() const
Definition: frame.hxx:945
sal_uInt16 GetLower() const
bool CheckControlLayer(const SdrObject *pObj)
Definition: dcontact.cxx:658
void SetResizeProtect(bool bProt)
void InsertColumns()
Definition: fly.cxx:228
long FRound(double fVal)
bool IsAnyShellAccessible() const
Definition: rootfrm.hxx:385
SwViewShellImp * Imp()
Definition: viewsh.hxx:183
TransformableSwFrame * getTransformableSwFrame()
Definition: flyfrms.hxx:132
bool IsLowerOf(const SwLayoutFrame *pUpper) const
Definition: fly.cxx:2100
bool mbInvalidVert
Definition: frame.hxx:403
void DisconnectFromLayout(bool _bMoveMasterToInvisibleLayer=true)
Definition: dcontact.cxx:1594
bool m_bLocked
Definition: flyfrm.hxx:86
void AddAccessibleFrame(const SwFrame *pFrame)
Add a frame in the accessible view.
Definition: viewimp.hxx:294
std::string GetValue
bool IsColLocked() const
Definition: frame.hxx:864
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
constexpr TypedWhichId< SwFormatCol > RES_COL(109)
long Height() const
void MakeContentPos(const SwBorderAttrs &rAttrs)
Definition: fly.cxx:1706
bool IsKeep(SvxFormatKeepItem const &rKeep, SvxFormatBreakItem const &rBreak, bool bBreakCheck=false) const
method to determine if a Keep needs to be considered (Breaks!)
Definition: flowfrm.cxx:179
const SwFormatVertOrient & GetVertOrient(bool=true) const
Definition: fmtornt.hxx:106
virtual void InvalidateObjPos() override
method to invalidate position of the anchored object
Definition: fly.cxx:2730
virtual void RegisterAtCorrectPage() override
method to assure that anchored object is registered at the correct page frame
Definition: fly.cxx:2785
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
void SetCompletePaint() const
Definition: frame.hxx:972
virtual bool Prepare(const PrepareHint ePrep=PrepareHint::Clear, const void *pVoid=nullptr, bool bNotify=true)
Definition: wsfrm.cxx:587
long GetWidth() const
SwModify * GetDep()
use these so we can grep for SwFrame's GetRegisteredIn accesses beware that SwTextFrame may return sw...
Definition: frame.hxx:459
virtual SdrLayerID GetInvisibleControlsId() const =0
void FormatWidthCols(const SwBorderAttrs &, const SwTwips nBorder, const SwTwips nMinHeight)
Called by Format for Frames and Areas with columns.
Definition: wsfrm.cxx:3627
SwFrameType GetType() const
Definition: frame.hxx:500
constexpr TypedWhichId< SdrTextVertAdjustItem > RES_TEXT_VERT_ADJUST(130)
void SetDerivedR2L(bool bNew)
Definition: frame.hxx:612
SwTwips CalcFitToContent()
Simulates a formatting as if there were not right margin or Flys or other obstacles and returns the w...
Definition: txtfrm.cxx:3379
#define MINFLY
Definition: swtypes.hxx:65
sal_uIntPtr sal_uLong
const SwRect & getFramePrintArea() const
Definition: frame.hxx:178
void AddAccessibleObj(const SdrObject *pObj)
Definition: viewimp.hxx:300
virtual SdrLayerID GetHeavenId() const =0
SwTabFrame is one table in the document layout, containing rows (which contain cells).
Definition: tabfrm.hxx:30
virtual void Modify(const SfxPoolItem *, const SfxPoolItem *) override
Definition: wsfrm.cxx:474
void RemoveDrawObjFromPage(SwAnchoredObject &_rToRemoveObj)
Definition: flylay.cxx:1095
void SetRect() const
Definition: dflyobj.cxx:549
void InvalidateSize_()
Definition: frame.hxx:751
SwFrame * FindPrev()
Definition: frame.hxx:1133
virtual SdrLayerID GetControlsId() const =0
void Unlock()
Definition: flyfrm.hxx:124
TElementType * Next()
Definition: calbck.hxx:351
bool HasFollow() const
Definition: flowfrm.hxx:165
void Height(long nNew)
Definition: swrect.hxx:191
sal_Int16 nId
void ChgAnchorFrame(SwFrame *_pNewAnchorFrame)
void InvalidatePos()
Definition: frame.hxx:1021
void Invalidate_(SwPageFrame const *pPage=nullptr)
Definition: fly.cxx:1029
const SwBodyFrame * FindBodyFrame() const
Definition: frame.hxx:1098
long SwTwips
Definition: swtypes.hxx:49
void SetSurround(css::text::WrapTextMode eNew)
Definition: fmtsrnd.hxx:55
const SdrTextVertAdjustItem & GetTextVertAdjust(bool=true) const
Definition: frmatr.hxx:96
Content, content of frame (header, footer, fly).
Definition: fmtcntnt.hxx:31
SwEditWin & GetEditWin()
Definition: view.hxx:401
sal_uInt16 CalcTopLine() const
Definition: frmtool.hxx:499
SvxFrameDirection
bool IsVert() const
Definition: frame.hxx:1345
constexpr TypedWhichId< SvxOpaqueItem > RES_OPAQUE(99)
static void DestroyFrame(SwFrame *const pFrame)
this is the only way to delete a SwFrame instance
Definition: ssfrm.cxx:382
virtual SwRect GetObjBoundRect() const override
Definition: fly.cxx:2757
void Pos(const Point &rNew)
Definition: swrect.hxx:169
RotateFlyFrame3: Helper class when you want to make your SwFrame derivate transformable.
Definition: frame.hxx:233
SwFrame * FindNext()
Definition: frame.hxx:1119
virtual void Calc(vcl::RenderContext *pRenderContext) const
Definition: trvlfrm.cxx:1787
virtual void SwClientNotify(const SwModify &, const SfxHint &rHint) override
Definition: calbck.cxx:108
bool CalcClipRect(const SdrObject *pSdrObj, SwRect &rRect, bool bMove=true)
calculate rectangle in that the object can be moved or rather be resized
Definition: flylay.cxx:1161
bool IsSizeProtected() const
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
virtual const SvxFormatBreakItem & GetBreakItem() const
Definition: findfrm.cxx:654
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
Definition: txtfrm.cxx:1283
void FinitDrawObj()
Definition: fly.cxx:370
static void Free(SdrObject *&_rpObject)
static SwFlowFrame * CastFlowFrame(SwFrame *pFrame)
Definition: flowfrm.cxx:2639
bool mbVertLR
Definition: frame.hxx:407
void Chain(SwFrame *_pAnchor)
Definition: fly.cxx:177
The root element of a Writer document layout.
Definition: rootfrm.hxx:80
virtual basegfx::B2DHomMatrix getFrameAreaTransformation() const
Definition: wsfrm.cxx:122
SwContact * GetUserCall(const SdrObject *pObj)
Returns the UserCall if applicable from the group object.
Definition: dcontact.cxx:171
static SwFrameFormat * getOtherTextBoxFormat(const SwFrameFormat *pFormat, sal_uInt16 nType)
If we have an associated TextFrame, then return that.
sal_Int32 GetBrowseWidth() const
Definition: viewsh.cxx:1998
void DeleteCnt()
Definition: fly.cxx:315
Value in Var-direction gives minimum (can be exceeded but not be less).
void InitDrawObj()
Definition: fly.cxx:357
SwFlyFrame * m_pPrevLink
Definition: flyfrm.hxx:77
bool m_bWidthClipped
Definition: flyfrm.hxx:104
SwFlyFrame(SwFlyFrameFormat *, SwFrame *, SwFrame *pAnchor)
Definition: fly.cxx:81
virtual SwFrameFormat & GetFrameFormat() override
Definition: fly.cxx:2737
bool m_bNotifyBack
Definition: flyfrm.hxx:89
void CheckDirChange()
checks the layout direction and invalidates the lower frames recursively, if necessary.
Definition: ssfrm.cxx:190
const tools::PolyPolygon * HasContour() const
Definition: ndnotxt.cxx:104
void PrepareMake(vcl::RenderContext *pRenderContext)
Prepares the Frame for "formatting" (MakeAll()).
Definition: calcmove.cxx:241
static OutputDevice * GetDefaultDevice()
bool IsFlyAtContentFrame() const
Definition: flyfrm.hxx:196
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
bool mbVertLRBT
Definition: frame.hxx:408
void RemoveFlyFromPage(SwFlyFrame *pToRemove)
Definition: flylay.cxx:902
void SetDrawObj(SdrObject &_rDrawObj)
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(102)
void InvalidateObjs(const bool _bNoInvaOfAsCharAnchoredObjs=true)
Definition: fly.cxx:2284
bool IsFlyFrame() const
Definition: frame.hxx:1188
sal_uInt16 CalcLeftLine() const
Definition: frmtool.hxx:511
const SfxPoolItem * NextItem()
void ChgLowersProp(const Size &rOldSize)
Change size of lowers proportionally.
Definition: wsfrm.cxx:2961
wrapper class for the positioning of Writer fly frames and drawing objects
friend SwFrame * SaveContent(SwLayoutFrame *, SwFrame *)
Definition: frmtool.cxx:2723
bool IsReadonly() const
Definition: viewopt.hxx:445
SwTwips Shrink_(SwTwips, bool bTst)
Definition: fly.cxx:1949
long GetPrtBottom(const SwFrame &rFrame) const
Definition: frame.hxx:1388
const SwView & GetView() const
Definition: wrtsh.hxx:428
void AppendFly(SwFlyFrame *pNew)
Definition: fly.cxx:2119
SwFrameControlsManager & GetFrameControlsManager()
Definition: edtwin.cxx:6624
void SetCurrRelPos(Point _aRelPos)
void Top(const long nTop)
Definition: swrect.hxx:204
const Point & ContentPos() const
Definition: flyfrm.hxx:267
void SetHoriOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:89
Size CalcRel(const SwFormatFrameSize &rSz) const
Definition: fly.cxx:2441
static SwVirtFlyDrawObj * CreateNewRef(SwFlyFrame *pFly, SwFlyFrameFormat *pFormat)
Definition: dcontact.cxx:504
void RemoveDrawObj(SwAnchoredObject &_rToRemoveObj)
Definition: fly.cxx:2258
constexpr TypedWhichId< SwFormatHoriOrient > RES_HORI_ORIENT(103)
const SwRect & getFrameArea() const
Definition: frame.hxx:177
SwFlyFrame * GetPrevLink() const
Definition: flyfrm.hxx:172
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
SwTwips GetRelCharX(const SwFrame *pFrame) const
bool getBrowseMode() const
Definition: viewopt.hxx:454
void CreateContour()
Definition: ndnotxt.cxx:95
void DisposeAccessibleObj(const SdrObject *pObj, bool bCanSkipInvisible)
Definition: viewimp.hxx:283
bool isTransformableSwFrame() const
Definition: flyfrms.hxx:131
bool IsInTab() const
Definition: frame.hxx:933
void SetAttr(const SfxPoolItem &, SwFormat &)
Set attribute in given format.1y If Undo is enabled, the old values is added to the Undo history...
Definition: docfmt.cxx:450
int nCount
sal_uLong GetIndex() const
Definition: ndindex.hxx:152
bool IsTextFrame() const
Definition: frame.hxx:1212
constexpr TypedWhichId< SwAttrSetChg > RES_ATTRSET_CHG(161)
constexpr TypedWhichId< SwFormatChg > RES_FMT_CHG(160)
void Lock()
Definition: flyfrm.hxx:123
void setFramePrintAreaValid(bool bNew)
Definition: wsfrm.cxx:97
Size GetPrefSize() const
const SwFormatSurround & GetSurround(bool=true) const
Definition: fmtsrnd.hxx:66
void InvalidateBrowseWidth()
Definition: rootfrm.hxx:428
bool IsSctFrame() const
Definition: frame.hxx:1192
SwFlyFrame * FindFlyFrame()
Definition: frame.hxx:1089
virtual void DestroyImpl() override
Definition: ssfrm.cxx:473
void UnmarkAll()
void SetMoveProtect(bool bProt)
SdrObject * DrawObj()
bool IsFlyInContentFrame() const
Definition: flyfrm.hxx:193
bool IsFlowFrame() const
Definition: frame.hxx:1220
constexpr TypedWhichId< SwFormatWrapInfluenceOnObjPos > RES_WRAP_INFLUENCE_ON_OBJPOS(125)
const SvxFormatKeepItem & GetKeep(bool=true) const
Definition: frmatr.hxx:56
SwFrame * AnchorFrame()
MapMode GetPrefMapMode() const
const SwAttrSet * GetAttrSet() const
WARNING: this may not return correct RES_PAGEDESC/RES_BREAK items for SwTextFrame, use GetBreakItem()/GetPageDescItem() instead.
Definition: findfrm.cxx:674
void Move(long nHorzMove, long nVertMove)
void SetWidth(long n)
SwFrame * FindLastLower()
Definition: fly.cxx:539
Base class for various Writer styles.
Definition: format.hxx:43
virtual SdrLayerID GetInvisibleHellId() const =0
bool IsFootnoteLock() const
Definition: sectfrm.hxx:157
virtual void Cut()=0
bool IsColumnFrame() const
Definition: frame.hxx:1160
void SetHeight(SwRect &rRect, long nNew) const
Definition: frame.hxx:1369
void UpdateUnfloatButton(SwWrtShell *pWrtSh, bool bShow) const
Definition: fly.cxx:1858
void Optimize(PolyOptimizeFlags nOptimizeFlags)
SDRTEXTVERTADJUST_BOTTOM
bool IsInDtor() const
Definition: frame.hxx:870
static void UnchainFrames(SwFlyFrame *pMaster, SwFlyFrame *pFollow)
Definition: fly.cxx:447
void ActiveUnfloatButton(SwWrtShell *pWrtSh)
Definition: fly.cxx:1847
void SetDerivedVert(bool bNew)
Definition: frame.hxx:609
virtual void SetLayer(SdrLayerID nLayer)
bool IsMinHeight() const
Definition: flyfrm.hxx:190
const SwFormatFollowTextFlow & GetFollowTextFlow(bool=true) const
SwTwips Grow_(SwTwips, bool bTst)
Definition: fly.cxx:1869
Style of a layout element.
Definition: frmfmt.hxx:57
static SwTwips lcl_CalcAutoWidth(const SwLayoutFrame &rFrame)
Definition: fly.cxx:2511
void RemoveFly(SwFlyFrame *pToRemove)
Definition: fly.cxx:2137
const SdrObject * GetDrawObj() const
const SwSortedObjs * GetSortedObjs() const
Definition: pagefrm.hxx:119
void MakePrtArea(const SwBorderAttrs &rAttrs)
Definition: fly.cxx:1691
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
int i
const SwRect & VisArea() const
Definition: viewsh.cxx:560
const SwFrame * GetLastLower() const
Definition: findfrm.cxx:1828
static void GetAnchoredObjects(std::vector< SwAnchoredObject * > &, const SwFormat &rFormat)
Definition: fly.cxx:2800
bool decompose(B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Definition: edtwin.hxx:58
const SwSectionFrame * GetFollow() const
Definition: sectfrm.hxx:160
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
const SwFormatHoriOrient & GetHoriOrient(bool=true) const
Definition: fmtornt.hxx:108
size_t size() const
Definition: sortedobjs.cxx:42
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
void ColUnlock()
Definition: frame.hxx:432
SwPageFrame * FindPageFrame()
Definition: frame.hxx:660
SwFrame * m_pLower
Definition: layfrm.hxx:53
void AddWidth(const long nAdd)
Definition: swrect.cxx:160
constexpr TypedWhichId< SwFormatURL > RES_URL(111)
void AppendDrawObjToPage(SwAnchoredObject &_rNewObj)
Definition: flylay.cxx:1046
const SwFrame * Lower() const
Definition: layfrm.hxx:101
TElementType * First()
Definition: calbck.hxx:343
virtual SwLayouter * GetLayouter()=0
void BroadcastObjectChange() const
void InvalidatePage(const SwPageFrame *pPage=nullptr) const
Invalidates the page in which the Frame is currently placed.
Definition: wsfrm.cxx:597
void SelectionHasChanged(SwFEShell *pShell)
Definition: fly.cxx:1771
SwSection * GetSection()
Definition: sectfrm.hxx:84
const SdrMarkList & GetMarkedObjectList() const
bool IsJoinLocked() const
Definition: flowfrm.hxx:175
void ChgColumns(const SwFormatCol &rOld, const SwFormatCol &rNew, const bool bChgFootnote=false)
add or remove columns from a layoutframe.
Definition: colfrm.cxx:187
sal_uInt8 GetHeightPercent() const
Definition: fmtfsize.hxx:88
bool mbInvalidR2L
Definition: frame.hxx:400
SwLayoutFrame * GetUpper()
Definition: frame.hxx:658
static bool equalZero(const double &rfVal)
bool HasArea() const
Definition: swrect.hxx:288
bool mbVertical
Definition: frame.hxx:405
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:166
void UnlockModify()
Definition: calbck.hxx:214
void UpdateObjInSortedList()
method to update anchored object in the lists
void AddHeight(const long nAdd)
Definition: swrect.cxx:161
SwFrameSize GetWidthSizeType() const
Definition: fmtfsize.hxx:83
void ClearVertPosOrientFrame()
sal_uInt32 GetOrdNum() const
long const nBorder
void LockModify()
Definition: calbck.hxx:213
friend void RestoreContent(SwFrame *, SwLayoutFrame *, SwFrame *pSibling)
Definition: frmtool.cxx:2886
short GetTextFirstLineOffset() const
bool m_bValidContentPos
Definition: flyfrm.hxx:117
virtual const IDocumentDrawModelAccess & getIDocumentDrawModelAccess() override
Definition: fly.cxx:302
sal_uInt16 GetSize() const
Connection (text flow) between two FlyFrames.
Definition: fmtcnct.hxx:31
bool mbDerivedR2L
Definition: frame.hxx:401
Marks a node in the document model.
Definition: ndindex.hxx:31
bool isFrameAreaPositionValid() const
Definition: frame.hxx:164
ring_container GetRingContainer()
Definition: ring.hxx:240
virtual void InvalidateObjPos()=0
method to invalidate position of the anchored object
void SetUserCall(SdrObjUserCall *pUser)
void SetYMargins(SwFrame &rFrame, long nTop, long nBottom) const
Definition: frame.hxx:1386
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:119
void GetContour(tools::PolyPolygon &rPoly) const
Definition: ndnotxt.cxx:163
sal_uInt8 GetWidthPercent() const
Definition: fmtfsize.hxx:91
const IDocumentSettingAccess & getIDocumentSettingAccess() const
Provides access to the document settings interface.
Definition: format.cxx:757
void SSize(const Size &rNew)
Definition: swrect.hxx:178
bool HasFixSize() const
Definition: frame.hxx:650
bool isFrameAreaSizeValid() const
Definition: frame.hxx:165
virtual ~SwFlyFrame() override
Definition: fly.cxx:298
void InvalidatePos_()
Definition: frame.hxx:767
A page of the document layout.
Definition: pagefrm.hxx:41
const GraphicObject & GetGrfObj(bool bWait=false) const
Definition: ndgrf.cxx:369
virtual void MakeAll(vcl::RenderContext *pRenderContext) override
Definition: flylay.cxx:114
Frame cannot be moved in Var-direction.
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:404
void InvalidateWindows(const SwRect &rRect)
Definition: viewsh.cxx:541
GraphicType GetType() const
const long LONG_MAX
virtual void MakeObjPos() override
method to determine position for the object and set the position at the object
Definition: fly.cxx:1662
SwFlyFrameFormat * GetNext() const
Definition: fmtcnct.hxx:54
bool m_bInvalid
Definition: flyfrm.hxx:96
SwTwips Shrink(SwTwips, bool bTst=false, bool bInfo=false)
Definition: wsfrm.cxx:1514
friend void Notify(SwFlyFrame *, SwPageFrame *pOld, const SwRect &rOld, const SwRect *pOldPrt)
Notify the background based on the difference between old and new rectangle.
Definition: frmtool.cxx:3107
void InvalidateSize()
Definition: frame.hxx:1007
virtual SdrLayerID GetHellId() const =0
SwSectionFrame * FindSctFrame()
Definition: frame.hxx:1093
virtual SdrLayerID GetLayer() const
sal_Int16 GetHeightPercentRelation() const
Definition: fmtfsize.hxx:89
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
SwFormat * pChangedFormat
Definition: hints.hxx:67
Point PixelToLogic(const Point &rDevicePt) const
Point LogicToPixel(const Point &rLogicPt) const
void Clip(const tools::Rectangle &rRect)
const ImageMap * GetMap() const
Definition: fmturl.hxx:68
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:458
void InsertEndnotes(SwSectionFrame const *pSect)
Definition: layouter.cxx:229
bool m_bHeightClipped
Definition: flyfrm.hxx:103
void setFrameAreaPositionValid(bool bNew)
Definition: wsfrm.cxx:81
void Scale(const Fraction &rFractX, const Fraction &rFracY)
sal_uInt16 Count() const
Definition: hints.hxx:245
virtual bool SetObjTop_(const SwTwips _nTop) override
Definition: fly.cxx:2763
bool IsLayoutFrame() const
Definition: frame.hxx:1148
void Left(const long nLeft)
Definition: swrect.hxx:195
const SwLayoutFrame * GetVertPosOrientFrame() const
bool mbDerivedVert
Definition: frame.hxx:404
virtual bool IsFormatPossible() const
method to determine, if a format on the anchored object is possible
constexpr TypedWhichId< SwFormatChain > RES_CHAIN(114)
void SetXMargins(SwFrame &rFrame, long nLeft, long nRight) const
Definition: frame.hxx:1385
const Point & GetCurrRelPos() const
tools::Rectangle SVRect() const
Definition: swrect.hxx:280
const SwFormatChain & GetChain(bool=true) const
Definition: fmtcnct.hxx:70
const SvxOpaqueItem & GetOpaque(bool=true) const
Definition: frmatr.hxx:80
bool IsTabFrame() const
Definition: frame.hxx:1196
bool m_bMinHeight
Definition: flyfrm.hxx:100
SwDrawView * GetDrawView()
Definition: viewimp.hxx:154
general base class for all free-flowing frames
Definition: flyfrm.hxx:60
::basegfx::B2DPolyPolygon getB2DPolyPolygon() const
bool mbFixSize
Definition: frame.hxx:411
virtual SwFrameFormat & GetFrameFormat()=0
SwTwips CalcContentHeight(const SwBorderAttrs *pAttrs, const SwTwips nMinHeight, const SwTwips nUL)
Definition: fly.cxx:2825
virtual SdrLayerID GetInvisibleHeavenId() const =0
bool IsLocked() const
Definition: flyfrm.hxx:191
unsigned char sal_uInt8
SwPageFrame * GetPageFrame()
void ClrContourCache(const SdrObject *pObj)
Definition: txtfly.cxx:133
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:424
bool supportsAutoContour() const
Definition: flylay.cxx:303
static bool FormatObj(SwAnchoredObject &_rAnchoredObj, SwFrame *_pAnchorFrame=nullptr, const SwPageFrame *_pPageFrame=nullptr)
method to format a given floating screen object
void Width(long nNew)
Definition: swrect.hxx:187
virtual void Modify(const SfxPoolItem *, const SfxPoolItem *) override
Definition: fly.cxx:628
const SwFrame * ContainsAny(const bool _bInvestigateFootnoteForSections=false) const
Method doesn't investigate content of footnotes by default.
Definition: findfrm.cxx:125
bool m_bFormatHeightOnly
Definition: flyfrm.hxx:107
void NotifyLowerObjs(const bool _bUnlockPosOfObjs=false)
force an unlockposition call for the lower objects.
Definition: fly.cxx:2352
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:254
void UpdateAttr_(const SfxPoolItem *, const SfxPoolItem *, sal_uInt8 &, SwAttrSetChg *pa=nullptr, SwAttrSetChg *pb=nullptr)
Definition: fly.cxx:691
B2DHomMatrix createRotateAroundPoint(double fPointX, double fPointY, double fRadiant)
virtual Size ChgSize(const Size &aNewSize) override
Definition: fly.cxx:2061
bool IsNoTextFrame() const
Definition: frame.hxx:1216
void RemoveFromLayout()
Definition: wsfrm.cxx:997
bool IsFlyFreeFrame() const
Definition: flyfrm.hxx:194
bool IsShowUnfloatButton(SwWrtShell *pWrtSh) const
Definition: fly.cxx:1780
void RemoveFromDrawingPage()
Definition: dcontact.cxx:2249
void ClearTmpConsiderWrapInfluence()
virtual const IDocumentDrawModelAccess & getIDocumentDrawModelAccess()
Definition: wsfrm.cxx:325
new class for re-direct methods calls at a 'virtual' drawing object to its referenced object...
Definition: dcontact.hxx:210
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:89
void InvalidateObjRectWithSpaces() const
bool IsVertL2R() const
Definition: frame.hxx:1346
SwFlyFrame * GetNextLink() const
Definition: flyfrm.hxx:173
SwFrame * GetLower()
Definition: findfrm.cxx:169
SwFrameType mnFrameType
Definition: frame.hxx:397
static void ChainFrames(SwFlyFrame *pMaster, SwFlyFrame *pFollow)
Definition: fly.cxx:399
SwFrameControlPtr GetControl(FrameControlType eType, const SwFrame *pFrame)
const Size & GetBrowseBorder() const
Definition: viewsh.cxx:1993
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:377
constexpr TypedWhichId< SwAutoFormatGetDocNode > RES_AUTOFMT_DOCNODE(171)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
void AppendFlyToPage(SwFlyFrame *pNew)
Definition: flylay.cxx:804
long GetHeight(const SwRect &rRect) const
Definition: frame.hxx:1360
void Unchain()
Definition: fly.cxx:307
bool FrameSizeChg(const SwFormatFrameSize &)
Definition: fly.cxx:552
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
SwFlyFrame * m_pNextLink
Definition: flyfrm.hxx:77
bool IsAnFollow(const SwFlowFrame *pFlow) const
Definition: flowfrm.cxx:670
#define FAR_AWAY
Definition: frmtool.hxx:52
static bool IsLocked()
Definition: frmtool.hxx:467
constexpr TypedWhichId< SvxBoxItem > RES_BOX(106)
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:104
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(154)
const Size & GetSize() const
Definition: frmtool.hxx:400
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
long GetRight() const
virtual void SetRectsDirty(bool bNotMyself=false, bool bRecursive=true)
void CalcFootnoteContent()
Definition: sectfrm.cxx:2813
void AppendDrawObj(SwAnchoredObject &_rNewObj)
Definition: fly.cxx:2177
virtual void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr) override
"Formats" the Frame; Frame and PrtArea.
Definition: fly.cxx:1182
void InvalidateAccessibleEditableState(bool bAllShells, const SwFrame *pFrame=nullptr)
Invalidate editable state for all accessible frames.
Definition: viewimp.cxx:348
void RemoveFromWriterLayout()
Definition: dcontact.cxx:2210
bool mbRightToLeft
Definition: frame.hxx:402
virtual bool GetInfo(SfxPoolItem &) const override
Gets information from the Modify.
Definition: fly.cxx:1022
bool IsVertical() const
Definition: frame.hxx:951
sal_uInt16 GetNumCols() const
Definition: fmtclds.hxx:114
bool IsInDtor() const
Definition: doc.hxx:398
virtual void Calc(vcl::RenderContext *pRenderContext) const override
Definition: fly.cxx:2817
long GetTop(const SwRect &rRect) const
Definition: frame.hxx:1355
SwTwips GetRelCharY(const SwFrame *pFrame) const
bool IsAccessibleFrame() const
Definition: frame.hxx:1228
void InvalidatePrt_()
Definition: frame.hxx:759
virtual void NotifyBackground(SwPageFrame *_pPageFrame, const SwRect &_rRect, PrepareHint _eHint)=0
method to trigger notification of 'background'
void ClearItem(sal_uInt16 nWhichL)
Definition: hints.cxx:128
RndStdIds
const SvxProtectItem & GetProtect(bool=true) const
Definition: frmatr.hxx:82
void AdjustColumns(const SwFormatCol *pCol, bool bAdjustAttributes)
Definition: colfrm.cxx:297
bool GetContour(tools::PolyPolygon &rContour, const bool _bForPaint=false) const
#i13147# - If called for paint and the contains a graphic, load of intrinsic graphic ...
Definition: fly.cxx:2570
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame...
Definition: layfrm.hxx:35
Left
void SetUnfloatTableButton(const SwFlyFrame *pFlyFrame, bool bShow, Point aTopRightPixel=Point())
A container for the Header/Footer, or PageBreak controls.
SwFlyFrame * FindChainNeighbour(SwFrameFormat const &rFormat, SwFrame *pAnch=nullptr)
Definition: fly.cxx:493
static ObjCntType GetObjCntType(const SdrObject &rObj)
Definition: fefly1.cxx:1645
const SwFrame * GetAnchorFrame() const
SwGrfNode * GetGrfNode()
Definition: ndgrf.hxx:153
virtual void Cut() override
Definition: fly.cxx:2115
void ResetLayoutProcessBools()
Frame is variable in Var-direction.
std::shared_ptr< SwFrameControl > SwFrameControlPtr
virtual void SetChanged()
void Init(sal_uInt16 nNumCols, sal_uInt16 nGutterWidth, sal_uInt16 nAct)
This function allows to (repeatedly) initialize the columns.
Definition: atrfrm.cxx:984
constexpr TypedWhichId< SwFormatFollowTextFlow > RES_FOLLOW_TEXT_FLOW(123)
virtual void CalcPosition() override
calculate position for object
const SwContentFrame * ContainsContent() const
Checks if the frame contains one or more ContentFrame's anywhere in his subsidiary structure; if so t...
Definition: findfrm.cxx:66
void CalcContent(SwLayoutFrame *pLay, bool bNoColl)
Definition: fly.cxx:1354
long GetHeight() const
SwFlyFrameFormat * GetPrev() const
Definition: fmtcnct.hxx:53
bool PositionLocked() const
long GetTextLeft() const
virtual void MakeAll(vcl::RenderContext *pRenderContext) override
Definition: calcmove.cxx:951
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:205
class for collecting anchored objects
Definition: sortedobjs.hxx:48
void ColLock()
Definition: frame.hxx:431
void setWidth(long nWidth)
void ChgRelPos(const Point &rAbsPos)
Change the relative position.
Definition: fly.cxx:1063
Container of body content (i.e.
Definition: bodyfrm.hxx:28
std::unique_ptr< SwSortedObjs > m_pDrawObjs
Definition: frame.hxx:396
static void CollectEndnotes(SwDoc *pDoc, SwSectionFrame *pSect)
Definition: layouter.cxx:266
sal_Int16 GetWidthPercentRelation() const
Definition: fmtfsize.hxx:92
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
sal_uInt16 Which() const
SdrTextVertAdjust
SwRootFrame * getRootFrame()
Definition: frame.hxx:659
const Point & GetRelPos() const
calculated relative position for object
SdrObject * FindRealSdrObject()
Definition: atrfrm.cxx:2739
constexpr TypedWhichId< SvxShadowItem > RES_SHADOW(107)
virtual SwRect GetObjRect() const override
Definition: fly.cxx:2750
const Size & GetSize() const
bool IsAutoPos() const
Definition: flyfrm.hxx:192
const SfxPoolItem * GetCurItem() const
void SetContour(const tools::PolyPolygon *pPoly, bool bAutomatic=false)
Definition: ndnotxt.cxx:84
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1315
bool IsPosProtected() const
sal_uInt16 GetUpper() const
SDRTEXTVERTADJUST_CENTER
const IDocumentDrawModelAccess & getIDocumentDrawModelAccess() const
Provides access to the document draw model interface.
Definition: format.cxx:758
void DisposeAccessibleFrame(const SwFrame *pFrame, bool bRecursive=false)
Definition: viewimp.hxx:277
virtual const SwFrameFormat * GetFormat() const
Definition: ssfrm.cxx:393
SwFrameSize GetHeightSizeType() const
Definition: fmtfsize.hxx:80
SwTabFrame * FindTabFrame()
Definition: frame.hxx:1077
sal_uInt16 CalcRightLine() const
Definition: frmtool.hxx:517
SwFrame * GetNext()
Definition: frame.hxx:656
bool IsObjMarked(SdrObject const *pObj) const