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