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