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