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