LibreOffice Module sw (master) 1
flylay.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 <pagefrm.hxx>
23#include <rootfrm.hxx>
24#include <cntfrm.hxx>
25#include <dflyobj.hxx>
26#include <dcontact.hxx>
27#include <ftnfrm.hxx>
28#include <frmatr.hxx>
29#include <frmtool.hxx>
30#include <sectfrm.hxx>
31#include <notxtfrm.hxx>
32#include <txtfly.hxx>
33
34#include <svx/svdpage.hxx>
35#include <editeng/ulspitem.hxx>
36#include <fmtornt.hxx>
37#include <fmtfsize.hxx>
38#include <ndole.hxx>
39#include <tabfrm.hxx>
40#include <flyfrms.hxx>
41#include <fmtfollowtextflow.hxx>
43#include <sortedobjs.hxx>
44#include <viewimp.hxx>
47#include <pam.hxx>
48#include <ndindex.hxx>
51#include <osl/diagnose.h>
52
53using namespace ::com::sun::star;
54
55SwFlyFreeFrame::SwFlyFreeFrame( SwFlyFrameFormat *pFormat, SwFrame* pSib, SwFrame *pAnch, bool bFollow )
56: SwFlyFrame( pFormat, pSib, pAnch, bFollow ),
57 // #i34753#
58 mbNoMakePos( false ),
59 // #i37068#
60 mbNoMoveOnCheckClip( false )
61{
62}
63
65{
66 // #i28701# - use new method <GetPageFrame()>
67 if( GetPageFrame() )
68 {
69 if( GetFormat()->GetDoc()->IsInDtor() )
70 {
71 // #i29879# - remove also to-frame anchored Writer
72 // fly frame from page.
73 const bool bRemoveFromPage =
77 if ( bRemoveFromPage )
78 {
79 GetPageFrame()->GetSortedObjs()->Remove( *this );
80 }
81 }
82 else
83 {
86 }
87 }
88
90}
91
93{
94#if 0
95 // we are possibly in ContourCache, make sure we vanish
97#endif
98}
99
100// #i28701#
108 const SwRect& rRect, PrepareHint eHint )
109{
110 ::Notify_Background( GetVirtDrawObj(), pPageFrame, rRect, eHint, true );
111}
112
114{
115 if ( !GetFormat()->GetDoc()->getIDocumentDrawModelAccess().IsVisibleLayerId( GetVirtDrawObj()->GetLayer() ) )
116 {
117 return;
118 }
119
120 if ( !GetAnchorFrame() || IsLocked() || IsColLocked() )
121 {
122 return;
123 }
124
125 // #i28701# - use new method <GetPageFrame()>
126 if( !GetPageFrame() && GetAnchorFrame()->IsInFly() )
127 {
129 SwPageFrame *pPageFrame = pFly ? pFly->FindPageFrame() : nullptr;
130 if( pPageFrame )
131 pPageFrame->AppendFlyToPage( this );
132 }
133
134 if( !GetPageFrame() )
135 {
136 return;
137 }
138
139 Lock(); // The curtain drops
140
141 // takes care of the notification in the dtor
142 const SwFlyNotify aNotify( this );
143
144 if ( IsClipped() )
145 {
148 // no invalidation of position,
149 // if anchored object is anchored inside a Writer fly frame,
150 // its position is already locked, and it follows the text flow.
151 // #i34753# - add condition:
152 // no invalidation of position, if no direct move is requested in <CheckClip(..)>
153 if ( !IsNoMoveOnCheckClip() &&
154 !( PositionLocked() &&
155 GetAnchorFrame()->IsInFly() &&
156 GetFrameFormat().GetFollowTextFlow().GetValue() ) )
157 {
159 }
160 }
161
162 // #i81146# new loop control
163 int nLoopControlRuns = 0;
164 const int nLoopControlMax = 10;
165
166 // RotateFlyFrame3 - outer frame
167 const double fRotation(getLocalFrameRotation());
168 const bool bRotated(!basegfx::fTools::equalZero(fRotation));
169
170 if(bRotated)
171 {
172 // Re-layout may be partially (see all isFrameAreaDefinitionValid() flags),
173 // so resetting the local SwFrame(s) in the local SwFrameAreaDefinition is
174 // needed. Reset to BoundAreas will be done below automatically
176 {
178 }
179 }
180
182 {
183 SwRectFnSet aRectFnSet(this);
184 const SwFormatFrameSize *pSz;
185 { // Additional scope, so aAccess will be destroyed before the check!
186
187 SwBorderAttrAccess aAccess( SwFrame::GetCache(), this );
188 const SwBorderAttrs &rAttrs = *aAccess.Get();
189 pSz = &rAttrs.GetAttrSet().GetFrameSize();
190
191 // Only set when the flag is set!
192 if ( !isFrameAreaSizeValid() )
193 {
195 }
196
197 if ( !isFramePrintAreaValid() )
198 {
199 MakePrtArea( rAttrs );
200 m_bValidContentPos = false;
201 }
202
204 {
206 Format( getRootFrame()->GetCurrShell()->GetOut(), &rAttrs );
207 m_bFormatHeightOnly = false;
208 }
209 }
210
212 {
213 const Point aOldPos( aRectFnSet.GetPos(getFrameArea()) );
214 // #i26791# - use new method <MakeObjPos()>
215 // #i34753# - no positioning, if requested.
216 if ( IsNoMakePos() )
217 {
219 }
220 else
221 // #i26791# - use new method <MakeObjPos()>
222 MakeObjPos();
223 if (!IsForceNotifyNewBackground() && aOldPos == aRectFnSet.GetPos(getFrameArea()))
224 {
227 {
229 }
230 }
231 else
232 {
234 }
235 }
236
237 if ( !m_bValidContentPos )
238 {
239 SwBorderAttrAccess aAccess( SwFrame::GetCache(), this );
240 const SwBorderAttrs &rAttrs = *aAccess.Get();
241 MakeContentPos( rAttrs );
242 }
243
245 {
246 ++nLoopControlRuns;
247
248 OSL_ENSURE( nLoopControlRuns < nLoopControlMax, "LoopControl in SwFlyFreeFrame::MakeAll" );
249
250 if ( nLoopControlRuns < nLoopControlMax )
251 CheckClip( *pSz );
252 }
253 else
254 nLoopControlRuns = 0;
255 }
256
257 // RotateFlyFrame3 - outer frame
258 // Do not refresh transforms/Areas self here, this will be done
259 // when inner and outer frame are layouted, in SwNoTextFrame::MakeAll
260 if(bRotated)
261 {
262 // RotateFlyFrame3: Safe changes locally
263 // get center from outer frame (layout frame) to be on the safe side
264 const Point aCenter(getFrameArea().Center());
265 const basegfx::B2DPoint aB2DCenter(aCenter.X(), aCenter.Y());
266
268 {
270 }
271
273 fRotation,
274 aB2DCenter);
276 }
277 else
278 {
279 // RotateFlyFrame3: Also need to clear ContourCache (if used),
280 // usually done in SwFlyFrame::NotifyDrawObj, but there relies on
281 // being in transform mode which is already reset then
283 {
285 }
286
287 // reset transformations to show that they are not used
289 }
290
291 Unlock();
292
293#if OSL_DEBUG_LEVEL > 0
294 SwRectFnSet aRectFnSet(this);
295 OSL_ENSURE( m_bHeightClipped || ( aRectFnSet.GetHeight(getFrameArea()) > 0 &&
296 aRectFnSet.GetHeight(getFramePrintArea()) > 0),
297 "SwFlyFreeFrame::Format(), flipping Fly." );
298
299#endif
300}
301
303{
304 static bool bOverrideHandleContourToAlwaysOff(true); // loplugin:constvars:ignore
305
306 // RotateFlyFrameFix: For LO6.0 we need to deactivate the AutoContour feature again, it is simply
307 // not clear how/if to use and save/load it in ODF. This has to be discussed.
308 // The reason not to remove is that this may be used as-is now, using a new switch.
309 // Even when not, the detection if it is possible will be needed in any case later.
310 if(bOverrideHandleContourToAlwaysOff)
311 {
312 return false;
313 }
314
316 {
317 // support only when transformed, else there is no free space
318 return false;
319 }
320
321 // Check for Borders. If we have Borders, do (currently) not support,
322 // since borders do not transform with the object.
323 // (Will need to be enhanced to take into account if we have Borders and if these
324 // transform with the object)
325 SwBorderAttrAccess aAccess(SwFrame::GetCache(), this);
326 const SwBorderAttrs &rAttrs(*aAccess.Get());
327
328 if(rAttrs.IsLine())
329 {
330 return false;
331 }
332
333 // Check for Padding. Do not support when padding is used, this will
334 // produce a covered space around the object (filled with fill defines)
335 const SvxBoxItem* pBoxItem(nullptr);
336
337 if(GetFormat() && (pBoxItem = GetFormat()->GetItemIfSet(RES_BOX, false)))
338 {
339 if(pBoxItem->HasBorder(/*bTreatPaddingAsBorder*/true))
340 {
341 return false;
342 }
343 }
344
345 // check for Fill - if we have fill, it will fill the gaps and we will not
346 // support AutoContour
348 {
350
351 if(aFillAttributes && aFillAttributes->isUsed())
352 {
353 return false;
354 }
355 }
356 else
357 {
358 const std::unique_ptr<SvxBrushItem> aBack(GetFormat()->makeBackgroundBrushItem());
359
360 if(aBack->isUsed())
361 {
362 return false;
363 }
364 }
365
366 // else, support
367 return true;
368}
369
370// RotateFlyFrame3 - Support for Transformations - outer frame
372{
374 {
375 // use pre-created transformation
377 }
378
379 // call parent
381}
382
384{
386 {
387 // use pre-created transformation
389 }
390
391 // call parent
393}
394
395// RotateFlyFrame3 - Support for Transformations
397{
398 // call parent - this will do the basic transform for SwRect(s)
399 // in the SwFrameAreaDefinition
401
402 // check if the Transformations need to be adapted
404 {
405 const basegfx::B2DHomMatrix aTransform(
407 rOffset.X(), rOffset.Y()));
408
409 // transform using TransformableSwFrame
410 getTransformableSwFrame()->transform(aTransform);
411 }
412}
413
414// RotateFlyFrame3 - outer frame
416{
417 return rNoTextFrame.getLocalFrameRotation();
418}
419
421{
422 // SwLayoutFrame::Lower() != SwFrame::GetLower(), but SwFrame::GetLower()
423 // calls SwLayoutFrame::Lower() when it's a SwLayoutFrame - so use GetLower()
424 const SwNoTextFrame* pSwNoTextFrame(dynamic_cast< const SwNoTextFrame* >(GetLower()));
425
426 if(nullptr != pSwNoTextFrame)
427 {
428 return getLocalFrameRotation_from_SwNoTextFrame(*pSwNoTextFrame);
429 }
430
431 // no rotation
432 return 0.0;
433}
434
446{
447 bool bRetVal = false;
448
449 const SwFrame* pToBeCheckedFrame = GetAnchorFrame();
450 while ( pToBeCheckedFrame &&
451 !pToBeCheckedFrame->IsPageFrame() )
452 {
453 if ( pToBeCheckedFrame->IsHeaderFrame() ||
454 pToBeCheckedFrame->IsFooterFrame() ||
455 pToBeCheckedFrame->IsRowFrame() ||
456 pToBeCheckedFrame->IsFlyFrame() )
457 {
458 bRetVal = SwFrameSize::Fixed !=
459 pToBeCheckedFrame->GetAttrSet()->GetFrameSize().GetHeightSizeType();
460 break;
461 }
462 else
463 {
464 pToBeCheckedFrame = pToBeCheckedFrame->GetUpper();
465 }
466 }
467
468 return bRetVal;
469}
470
472{
473 // It's probably time now to take appropriate measures, if the Fly
474 // doesn't fit into its surrounding.
475 // First, the Fly gives up its position, then it's formatted.
476 // Only if it still doesn't fit after giving up its position, the
477 // width or height are given up as well. The frame will be squeezed
478 // as much as needed.
479
480 const SwVirtFlyDrawObj *pObj = GetVirtDrawObj();
481 SwRect aClip, aTmpStretch;
482 ::CalcClipRect( pObj, aClip );
483 ::CalcClipRect( pObj, aTmpStretch, false );
484 aClip.Intersection_( aTmpStretch );
485
486 const tools::Long nBot = getFrameArea().Top() + getFrameArea().Height();
487 const tools::Long nRig = getFrameArea().Left() + getFrameArea().Width();
488 const tools::Long nClipBot = aClip.Top() + aClip.Height();
489 const tools::Long nClipRig = aClip.Left() + aClip.Width();
490
491 const bool bBot = nBot > nClipBot;
492 const bool bRig = nRig > nClipRig;
493 if (( bBot || bRig ) && !IsDraggingOffPageAllowed(FindFrameFormat(GetDrawObj())))
494 {
495 bool bAgain = false;
496 // #i37068# - no move, if it's requested
497 if ( bBot && !IsNoMoveOnCheckClip() &&
499 {
500 SwFrame* pHeader = FindFooterOrHeader();
501 // In a header, correction of the position is no good idea.
502 // If the fly moves, some paragraphs have to be formatted, this
503 // could cause a change of the height of the headerframe,
504 // now the flyframe can change its position and so on ...
505 if ( !pHeader || !pHeader->IsHeaderFrame() )
506 {
507 const tools::Long nOld = getFrameArea().Top();
508
509 // tdf#112443 disable positioning if content is completely off page
511 if ( !bDisableOffPagePositioning || nOld <= nClipBot)
512 {
514 aFrm.Pos().setY( std::max( aClip.Top(), nClipBot - aFrm.Height() ) );
515 }
516
517 if ( getFrameArea().Top() != nOld )
518 {
519 bAgain = true;
520 }
521
522 m_bHeightClipped = true;
523 }
524 }
525 if ( bRig )
526 {
527 const tools::Long nOld = getFrameArea().Left();
528
529 // tdf#112443 disable positioning if content is completely off page
531 if ( !bDisableOffPagePositioning || nOld <= nClipRig )
532 {
534 aFrm.Pos().setX( std::max( aClip.Left(), nClipRig - aFrm.Width() ) );
535 }
536
537 if ( getFrameArea().Left() != nOld )
538 {
540 // Left-aligned ones may not be moved to the left when they
541 // are avoiding another one.
542 if( rH.GetHoriOrient() == text::HoriOrientation::LEFT )
543 {
545 aFrm.Pos().setX( nOld );
546 }
547 else
548 {
549 bAgain = true;
550 }
551 }
552 m_bWidthClipped = true;
553 }
554 if ( bAgain )
555 {
557 }
558 else
559 {
560 // If we reach this branch, the Frame protrudes into forbidden
561 // areas, and correcting the position is not allowed or not
562 // possible or not required.
563
564 // For Flys with OLE objects as lower, we make sure that
565 // we always resize proportionally
566 Size aOldSize( getFrameArea().SSize() );
567
568 // First, setup the FrameRect, then transfer it to the Frame.
569 SwRect aFrameRect( getFrameArea() );
570
571 if ( bBot )
572 {
573 tools::Long nDiff = nClipBot;
574 nDiff -= aFrameRect.Top(); // nDiff represents the available distance
575 nDiff = aFrameRect.Height() - nDiff;
576 aFrameRect.Height( aFrameRect.Height() - nDiff );
577 m_bHeightClipped = true;
578 }
579 if ( bRig )
580 {
581 tools::Long nDiff = nClipRig;
582 nDiff -= aFrameRect.Left();// nDiff represents the available distance
583 nDiff = aFrameRect.Width() - nDiff;
584 aFrameRect.Width( aFrameRect.Width() - nDiff );
585 m_bWidthClipped = true;
586 }
587
588 // #i17297# - no proportional
589 // scaling of graphics in environments, which determines its size
590 // by its content ('auto' size). Otherwise layout loops can occur and
591 // layout sizes of the environment can be incorrect.
592 // Such environment are:
593 // (1) header and footer frames with 'auto' size
594 // (2) table row frames with 'auto' size
595 // (3) fly frames with 'auto' size
596 // Note: section frames seems to be not critical - didn't found
597 // any critical layout situation so far.
598 if ( Lower() && Lower()->IsNoTextFrame() &&
599 (static_cast<SwNoTextFrame*>(Lower())->GetNode()->GetOLENode() ||
601 {
602 // If width and height got adjusted, then the bigger
603 // change is relevant.
604 if ( aFrameRect.Width() != aOldSize.Width() &&
605 aFrameRect.Height()!= aOldSize.Height() )
606 {
607 if ( (aOldSize.Width() - aFrameRect.Width()) >
608 (aOldSize.Height()- aFrameRect.Height()) )
609 aFrameRect.Height( aOldSize.Height() );
610 else
611 aFrameRect.Width( aOldSize.Width() );
612 }
613
614 // Adjusted the width? change height proportionally
615 if( aFrameRect.Width() != aOldSize.Width() )
616 {
617 aFrameRect.Height( aFrameRect.Width() * aOldSize.Height() /
618 aOldSize.Width() );
619 m_bHeightClipped = true;
620 }
621 // Adjusted the height? change width proportionally
622 else if( aFrameRect.Height() != aOldSize.Height() )
623 {
624 aFrameRect.Width( aFrameRect.Height() * aOldSize.Width() /
625 aOldSize.Height() );
626 m_bWidthClipped = true;
627 }
628
629 // #i17297# - reactivate change
630 // of size attribute for fly frames containing an ole object.
631
632 // Added the aFrameRect.HasArea() hack, because
633 // the environment of the ole object does not have to be valid
634 // at this moment, or even worse, it does not have to have a
635 // reasonable size. In this case we do not want to change to
636 // attributes permanently. Maybe one day somebody dares to remove
637 // this code.
638 if ( aFrameRect.HasArea() &&
639 static_cast<SwNoTextFrame*>(Lower())->GetNode()->GetOLENode() &&
641 {
642 SwFlyFrameFormat *pFormat = GetFormat();
643 pFormat->LockModify();
644 SwFormatFrameSize aFrameSize( rSz );
645 aFrameSize.SetWidth( aFrameRect.Width() );
646 aFrameSize.SetHeight( aFrameRect.Height() );
647 pFormat->SetFormatAttr( aFrameSize );
648 pFormat->UnlockModify();
649 }
650 }
651
652 // Now change the Frame; for columns, we put the new values into the attributes,
653 // otherwise we'll end up with unwanted side-effects/oscillations
654 const tools::Long nPrtHeightDiff = getFrameArea().Height() - getFramePrintArea().Height();
655 const tools::Long nPrtWidthDiff = getFrameArea().Width() - getFramePrintArea().Width();
657
658 {
660 aFrm.Height( aFrameRect.Height() );
661 aFrm.Width ( std::max( tools::Long(MINLAY), aFrameRect.Width() ) );
662 }
663
664 if ( Lower() && Lower()->IsColumnFrame() )
665 {
666 ColLock(); //lock grow/shrink
667 const Size aTmpOldSize( getFramePrintArea().SSize() );
668
669 {
671 aPrt.Height( getFrameArea().Height() - nPrtHeightDiff );
672 aPrt.Width ( getFrameArea().Width() - nPrtWidthDiff );
673 }
674
675 ChgLowersProp( aTmpOldSize );
676 SwFrame *pLow = Lower();
677 do
678 {
679 pLow->Calc(getRootFrame()->GetCurrShell()->GetOut());
680 // also calculate the (Column)BodyFrame
681 static_cast<SwLayoutFrame*>(pLow)->Lower()->Calc(getRootFrame()->GetCurrShell()->GetOut());
682 pLow = pLow->GetNext();
683 } while ( pLow );
684 ::CalcContent( this );
685 ColUnlock();
686
688 {
690 m_bFormatHeightOnly = true;
691 }
692 }
693 else
694 {
696 aPrt.Height( getFrameArea().Height() - nPrtHeightDiff );
697 aPrt.Width ( getFrameArea().Width() - nPrtWidthDiff );
698 }
699 }
700 }
701
702 // #i26945#
703 OSL_ENSURE( getFrameArea().Height() >= 0,
704 "<SwFlyFreeFrame::CheckClip(..)> - fly frame has negative height now." );
705}
706
711{
713 ( GetPageFrame() ||
714 ( GetAnchorFrame() && GetAnchorFrame()->IsInFly() ) );
715}
716
718 SwFlyFreeFrame( pFormat, pSib, pAnch )
719{
720 m_bLayout = true;
721}
722
724{
725 assert(GetPageFrame() != &rPageFrame);
726 if (GetPageFrame())
727 {
728 GetPageFrame()->MoveFly( this, &rPageFrame );
729 }
730 else
731 {
732 rPageFrame.AppendFlyToPage( this );
733 }
734}
735
736// #i28701#
737
738void SwFlyLayFrame::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
739{
740 if (rHint.GetId() != SfxHintId::SwLegacyModify)
741 return;
742 auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
743 if(!pLegacy->m_pNew)
744 return;
745 const auto pAnch = GetAnchorFromPoolItem(*pLegacy->m_pNew);
746
747 if(!pAnch)
748 {
749 SwFlyFrame::SwClientNotify(rMod, rHint);
750 return;
751 }
752 SAL_WARN_IF(pAnch->GetAnchorId() == GetFormat()->GetAnchor().GetAnchorId(), "sw.core", "Invalid change of anchor type.");
753
754 // Unregister, get hold of the page, attach to the corresponding LayoutFrame.
756 // #i28701# - use new method <GetPageFrame()>
757 SwPageFrame* pOldPage = GetPageFrame();
758 AnchorFrame()->RemoveFly(this);
759
760 if(RndStdIds::FLY_AT_PAGE == pAnch->GetAnchorId())
761 {
762 SwRootFrame* pRoot = getRootFrame();
763 SwPageFrame* pTmpPage = static_cast<SwPageFrame*>(pRoot->Lower());
764 sal_uInt16 nPagesToFlip = pAnch->GetPageNum()-1;
765 while(pTmpPage && nPagesToFlip)
766 {
767 pTmpPage = static_cast<SwPageFrame*>(pTmpPage->GetNext());
768 --nPagesToFlip;
769 }
770 if(pTmpPage && !nPagesToFlip)
771 {
772 // #i50432# - adjust synopsis of <PlaceFly(..)>
773 pTmpPage->PlaceFly(this, nullptr);
774 }
775 if(!pTmpPage)
776 {
777 pRoot->SetAssertFlyPages();
778 pRoot->AssertFlyPages();
779 }
780 }
781 else
782 {
783 SwNodeIndex aIdx(*pAnch->GetAnchorNode());
784 SwContentFrame* pContent = GetFormat()->GetDoc()->GetNodes().GoNext(&aIdx)->
785 GetContentNode()->getLayoutFrame(getRootFrame(), nullptr, nullptr);
786 if(pContent)
787 {
788 SwFlyFrame *pTmp = pContent->FindFlyFrame();
789 if(pTmp)
790 pTmp->AppendFly(this);
791 }
792 }
793 // #i28701# - use new method <GetPageFrame()>
794 if ( pOldPage && pOldPage != GetPageFrame() )
799}
800
802{
803 if ( !pNew->GetVirtDrawObj()->IsInserted() )
805 static_cast<SdrObject*>(pNew->GetVirtDrawObj()),
807
812
813 if ( GetUpper() )
814 {
815 static_cast<SwRootFrame*>(GetUpper())->SetIdleFlags();
816 static_cast<SwRootFrame*>(GetUpper())->InvalidateBrowseWidth();
817 }
818
819 SdrObject* pObj = pNew->GetVirtDrawObj();
820 OSL_ENSURE( pNew->GetAnchorFrame(), "Fly without Anchor" );
821 SwFlyFrame* pFly = const_cast<SwFlyFrame*>(pNew->GetAnchorFrame()->FindFlyFrame());
822 if ( pFly && pObj->GetOrdNum() < pFly->GetVirtDrawObj()->GetOrdNum() )
823 {
824 //#i119945# set pFly's OrdNum to _rNewObj's. So when pFly is removed by Undo, the original OrdNum will not be changed.
825 sal_uInt32 nNewNum = pObj->GetOrdNumDirect();
826 SdrObject* pDrawObj = nullptr;
827 if (auto pFormat = pFly->GetFormat())
828 if (auto pShapeFormat = SwTextBoxHelper::getOtherTextBoxFormat(pFormat, RES_FLYFRMFMT))
829 pDrawObj = pShapeFormat->FindRealSdrObject();
830
831 if (pDrawObj)
832 {
833 if (auto pPage = pDrawObj->getSdrPageFromSdrObject())
834 pPage->SetObjectOrdNum(pDrawObj->GetOrdNumDirect(), nNewNum);
835 else
836 pDrawObj->SetOrdNum(nNewNum);
837 }
838
839 if ( pObj->getSdrPageFromSdrObject() )
840 pObj->getSdrPageFromSdrObject()->SetObjectOrdNum( pFly->GetVirtDrawObj()->GetOrdNumDirect(), nNewNum + (pDrawObj ? 1 : 0) );
841 else
842 pFly->GetVirtDrawObj()->SetOrdNum( nNewNum + (pDrawObj ? 1 : 0));
843 }
844
845 // Don't look further at Flys that sit inside the Content.
846 if ( pNew->IsFlyInContentFrame() )
848 else
849 {
851
852 if ( !m_pSortedObjs )
853 {
854 m_pSortedObjs.reset(new SwSortedObjs());
855 }
856
857 const bool bSuccessInserted = m_pSortedObjs->Insert( *pNew );
858 OSL_ENSURE( bSuccessInserted, "Fly not inserted in Sorted." );
859
860 // #i87493#
861 OSL_ENSURE( pNew->GetPageFrame() == nullptr || pNew->GetPageFrame() == this,
862 "<SwPageFrame::AppendFlyToPage(..)> - anchored fly frame seems to be registered at another page frame. Serious defect." );
863 // #i28701# - use new method <SetPageFrame(..)>
864 pNew->SetPageFrame( this );
865 pNew->InvalidatePage( this );
866 // #i28701#
867 pNew->UnlockPosition();
868 // needed to reposition at-page anchored flys moved from different page
869 pNew->InvalidateObjPos();
870
871 // Notify accessible layout. That's required at this place for
872 // frames only where the anchor is moved. Creation of new frames
873 // is additionally handled by the SwFrameNotify class.
874#if !ENABLE_WASM_STRIP_ACCESSIBILITY
875 if( GetUpper() &&
876 static_cast< SwRootFrame * >( GetUpper() )->IsAnyShellAccessible() &&
877 static_cast< SwRootFrame * >( GetUpper() )->GetCurrShell() )
878 {
879 static_cast< SwRootFrame * >( GetUpper() )->GetCurrShell()->Imp()
880 ->AddAccessibleFrame( pNew );
881 }
882#endif
883 }
884
885 // #i28701# - correction: consider also drawing objects
886 if ( !pNew->GetDrawObjs() )
887 return;
888
889 SwSortedObjs &rObjs = *pNew->GetDrawObjs();
890 for (SwAnchoredObject* pTmpObj : rObjs)
891 {
892 if ( auto pTmpFly = pTmpObj->DynCastFlyFrame() )
893 {
894 // #i28701# - use new method <GetPageFrame()>
895 if ( pTmpFly->IsFlyFreeFrame() && !pTmpFly->GetPageFrame() )
896 AppendFlyToPage( pTmpFly );
897 }
898 else if ( dynamic_cast<const SwAnchoredDrawObject*>( pTmpObj) != nullptr )
899 {
900 // #i87493#
901 if ( pTmpObj->GetPageFrame() != this )
902 {
903 pTmpObj->RegisterAtPage(*this);
904 }
905 }
906 }
907}
908
910{
911 const sal_uInt32 nOrdNum = pToRemove->GetVirtDrawObj()->GetOrdNum();
912 getRootFrame()->GetDrawPage()->RemoveObject( nOrdNum );
913 pToRemove->GetVirtDrawObj()->ReferencedObj().SetOrdNum( nOrdNum );
914
915 if ( GetUpper() )
916 {
917 if ( !pToRemove->IsFlyInContentFrame() )
918 static_cast<SwRootFrame*>(GetUpper())->SetSuperfluous();
919 static_cast<SwRootFrame*>(GetUpper())->InvalidateBrowseWidth();
920 }
921
922 // Don't look further at Flys that sit inside the Content.
923 if ( pToRemove->IsFlyInContentFrame() )
924 return;
925
926 // Don't delete collections just yet. This will happen at the end of the
927 // action in the RemoveSuperfluous of the page, kicked off by a method of
928 // the same name in the root.
929 // The FlyColl might be gone already, because the page's dtor is being
930 // executed.
931 // Remove it _before_ disposing accessible frames to avoid accesses to
932 // the Frame from event handlers.
933 if (m_pSortedObjs)
934 {
935 m_pSortedObjs->Remove(*pToRemove);
936 if (!m_pSortedObjs->size())
937 {
938 m_pSortedObjs.reset();
939 }
940 }
941
942 // Notify accessible layout. That's required at this place for
943 // frames only where the anchor is moved. Creation of new frames
944 // is additionally handled by the SwFrameNotify class.
945#if !ENABLE_WASM_STRIP_ACCESSIBILITY
946 if( GetUpper() &&
947 static_cast< SwRootFrame * >( GetUpper() )->IsAnyShellAccessible() &&
948 static_cast< SwRootFrame * >( GetUpper() )->GetCurrShell() )
949 {
950 static_cast< SwRootFrame * >( GetUpper() )->GetCurrShell()->Imp()
951 ->DisposeAccessibleFrame( pToRemove, true );
952 }
953#endif
954
955 // #i28701# - use new method <SetPageFrame(..)>
956 pToRemove->SetPageFrame( nullptr );
957}
958
960{
961 // Invalidations
962 if ( GetUpper() )
963 {
964 static_cast<SwRootFrame*>(GetUpper())->SetIdleFlags();
965 if ( !pToMove->IsFlyInContentFrame() && pDest->GetPhyPageNum() < GetPhyPageNum() )
966 static_cast<SwRootFrame*>(GetUpper())->SetSuperfluous();
967 }
968
969 pDest->InvalidateSpelling();
970 pDest->InvalidateSmartTags();
972 pDest->InvalidateWordCount();
973
974 if ( pToMove->IsFlyInContentFrame() )
975 {
976 pDest->InvalidateFlyInCnt();
977 return;
978 }
979
980 // Notify accessible layout. That's required at this place for
981 // frames only where the anchor is moved. Creation of new frames
982 // is additionally handled by the SwFrameNotify class.
983#if !ENABLE_WASM_STRIP_ACCESSIBILITY
984 if( GetUpper() &&
985 static_cast< SwRootFrame * >( GetUpper() )->IsAnyShellAccessible() &&
986 static_cast< SwRootFrame * >( GetUpper() )->GetCurrShell() )
987 {
988 static_cast< SwRootFrame * >( GetUpper() )->GetCurrShell()->Imp()
989 ->DisposeAccessibleFrame( pToMove, true );
990 }
991#endif
992
993 // The FlyColl might be gone already, because the page's dtor is being executed.
994 if ( m_pSortedObjs )
995 {
996 m_pSortedObjs->Remove( *pToMove );
997 if ( !m_pSortedObjs->size() )
998 {
999 m_pSortedObjs.reset();
1000 }
1001
1002 // Removing a fly from the page affects the margin of tables, so update the frame print area
1003 // of the lowers of my body frame.
1004 SwFrame* pBodyFrame = FindBodyCont();
1005 if (pBodyFrame)
1006 {
1007 for (SwFrame* pFrame = pBodyFrame->GetLower(); pFrame; pFrame = pFrame->GetNext())
1008 {
1009 if (!pFrame->IsTabFrame())
1010 {
1011 // This is meant to match SwTabFrame::CalcFlyOffsets(), so not relevant for
1012 // other frame types.
1013 continue;
1014 }
1015
1016 pFrame->InvalidatePrt();
1017 }
1018 }
1019 }
1020
1021 // Register
1022 if ( !pDest->GetSortedObjs() )
1023 pDest->m_pSortedObjs.reset(new SwSortedObjs());
1024
1025 const bool bSuccessInserted = pDest->GetSortedObjs()->Insert( *pToMove );
1026 OSL_ENSURE( bSuccessInserted, "Fly not inserted in Sorted." );
1027
1028 // #i28701# - use new method <SetPageFrame(..)>
1029 pToMove->SetPageFrame( pDest );
1030 pToMove->InvalidatePage( pDest );
1031 pToMove->SetNotifyBack();
1032 pDest->InvalidateFlyContent();
1033 // #i28701#
1034 pToMove->UnlockPosition();
1035
1036 // Notify accessible layout. That's required at this place for
1037 // frames only where the anchor is moved. Creation of new frames
1038 // is additionally handled by the SwFrameNotify class.
1039#if !ENABLE_WASM_STRIP_ACCESSIBILITY
1040 if( GetUpper() &&
1041 static_cast< SwRootFrame * >( GetUpper() )->IsAnyShellAccessible() &&
1042 static_cast< SwRootFrame * >( GetUpper() )->GetCurrShell() )
1043 {
1044 static_cast< SwRootFrame * >( GetUpper() )->GetCurrShell()->Imp()
1045 ->AddAccessibleFrame( pToMove );
1046 }
1047#endif
1048
1049 // #i28701# - correction: move lowers of Writer fly frame
1050 if ( !pToMove->GetDrawObjs() )
1051 return;
1052
1053 SwSortedObjs &rObjs = *pToMove->GetDrawObjs();
1054 for (SwAnchoredObject* pObj : rObjs)
1055 {
1056 pObj->RegisterAtPage(*pDest);
1057 }
1058}
1059
1061{
1062 if ( dynamic_cast<const SwAnchoredDrawObject*>( &_rNewObj) == nullptr )
1063 {
1064 OSL_FAIL( "SwPageFrame::AppendDrawObjToPage(..) - anchored object of unexpected type -> object not appended" );
1065 return;
1066 }
1067
1068 if ( GetUpper() )
1069 {
1070 static_cast<SwRootFrame*>(GetUpper())->InvalidateBrowseWidth();
1071 }
1072
1073 assert(_rNewObj.GetAnchorFrame());
1074 SwFlyFrame* pFlyFrame = const_cast<SwFlyFrame*>(_rNewObj.GetAnchorFrame()->FindFlyFrame());
1075 if ( pFlyFrame &&
1076 _rNewObj.GetDrawObj()->GetOrdNum() < pFlyFrame->GetVirtDrawObj()->GetOrdNum() )
1077 {
1078 //#i119945# set pFly's OrdNum to _rNewObj's. So when pFly is removed by Undo, the original OrdNum will not be changed.
1079 sal_uInt32 nNewNum = _rNewObj.GetDrawObj()->GetOrdNumDirect();
1080 if ( _rNewObj.GetDrawObj()->getSdrPageFromSdrObject() )
1081 _rNewObj.DrawObj()->getSdrPageFromSdrObject()->SetObjectOrdNum( pFlyFrame->GetVirtDrawObj()->GetOrdNumDirect(), nNewNum );
1082 else
1083 pFlyFrame->GetVirtDrawObj()->SetOrdNum( nNewNum );
1084 }
1085
1086 if ( RndStdIds::FLY_AS_CHAR == _rNewObj.GetFrameFormat().GetAnchor().GetAnchorId() )
1087 {
1088 return;
1089 }
1090
1091 if ( !m_pSortedObjs )
1092 {
1093 m_pSortedObjs.reset(new SwSortedObjs());
1094 }
1095 if ( !m_pSortedObjs->Insert( _rNewObj ) )
1096 {
1097 OSL_ENSURE( m_pSortedObjs->Contains( _rNewObj ),
1098 "Drawing object not appended into list <pSortedObjs>." );
1099 }
1100 // #i87493#
1101 OSL_ENSURE( _rNewObj.GetPageFrame() == nullptr || _rNewObj.GetPageFrame() == this,
1102 "<SwPageFrame::AppendDrawObjToPage(..)> - anchored draw object seems to be registered at another page frame. Serious defect." );
1103 _rNewObj.SetPageFrame( this );
1104
1105 // invalidate page in order to force a reformat of object layout of the page.
1107}
1108
1110{
1111 if ( dynamic_cast<const SwAnchoredDrawObject*>( &_rToRemoveObj) == nullptr )
1112 {
1113 OSL_FAIL( "SwPageFrame::RemoveDrawObjFromPage(..) - anchored object of unexpected type -> object not removed" );
1114 return;
1115 }
1116
1117 if ( m_pSortedObjs )
1118 {
1119 m_pSortedObjs->Remove( _rToRemoveObj );
1120 if ( !m_pSortedObjs->size() )
1121 {
1122 m_pSortedObjs.reset();
1123 }
1124 if ( GetUpper() )
1125 {
1126 if (RndStdIds::FLY_AS_CHAR !=
1127 _rToRemoveObj.GetFrameFormat().GetAnchor().GetAnchorId())
1128 {
1129 static_cast<SwRootFrame*>(GetUpper())->SetSuperfluous();
1131 }
1132 static_cast<SwRootFrame*>(GetUpper())->InvalidateBrowseWidth();
1133 }
1134 }
1135 _rToRemoveObj.SetPageFrame( nullptr );
1136}
1137
1138// #i50432# - adjust method description and synopsis.
1140{
1141 // #i50432# - consider the case that page is an empty page:
1142 // In this case append the fly frame at the next page
1143 OSL_ENSURE( !IsEmptyPage() || GetNext(),
1144 "<SwPageFrame::PlaceFly(..)> - empty page with no next page! -> fly frame appended at empty page" );
1145 if ( IsEmptyPage() && GetNext() )
1146 {
1147 static_cast<SwPageFrame*>(GetNext())->PlaceFly( pFly, pFormat );
1148 }
1149 else
1150 {
1151 // If we received a Fly, we use that one. Otherwise, create a new
1152 // one using the Format.
1153 if ( pFly )
1154 AppendFly( pFly );
1155 else
1156 {
1157 OSL_ENSURE( pFormat, ":-( No Format given for Fly." );
1158 pFly = new SwFlyLayFrame( pFormat, this, this );
1159 AppendFly( pFly );
1160 ::RegistFlys( this, pFly );
1161 }
1162 }
1163}
1164
1165// #i18732# - adjustments for following text flow or not
1166// AND alignment at 'page areas' for to paragraph/to character anchored objects
1167// #i22305# - adjustment for following text flow for to frame anchored objects
1168// #i29778# - Because calculating the floating screen object's position
1169// (Writer fly frame or drawing object) doesn't perform a calculation on its
1170// upper frames and its anchor frame, a calculation of the upper frames in this
1171// method is no longer sensible.
1172// #i28701# - if document compatibility option 'Consider wrapping style influence
1173// on object positioning' is ON, the clip area corresponds to the one as the
1174// object doesn't follow the text flow.
1175bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove )
1176{
1177 bool bRet = true;
1178 if ( auto pVirtFlyDrawObj = dynamic_cast<const SwVirtFlyDrawObj*>(pSdrObj) )
1179 {
1180 const SwFlyFrame* pFly = pVirtFlyDrawObj->GetFlyFrame();
1181 const bool bFollowTextFlow = pFly->GetFormat()->GetFollowTextFlow().GetValue();
1182 // #i28701#
1183 const bool bConsiderWrapOnObjPos =
1185 const SwFormatVertOrient &rV = pFly->GetFormat()->GetVertOrient();
1186 if( pFly->IsFlyLayFrame() )
1187 {
1188 const SwFrame* pClip;
1189 // #i22305#
1190 // #i28701#
1191 if ( !bFollowTextFlow || bConsiderWrapOnObjPos )
1192 {
1193 pClip = pFly->GetAnchorFrame()->FindPageFrame();
1194 }
1195 else
1196 {
1197 pClip = pFly->GetAnchorFrame();
1198 }
1199
1200 rRect = pClip->getFrameArea();
1201 SwRectFnSet aRectFnSet(pClip);
1202
1203 // vertical clipping: Top and Bottom, also to PrtArea if necessary
1205 rV.GetRelationOrient() == text::RelOrientation::PRINT_AREA )
1206 {
1207 aRectFnSet.SetTop( rRect, aRectFnSet.GetPrtTop(*pClip) );
1208 aRectFnSet.SetBottom( rRect, aRectFnSet.GetPrtBottom(*pClip) );
1209 }
1210 // horizontal clipping: Top and Bottom, also to PrtArea if necessary
1211 const SwFormatHoriOrient &rH = pFly->GetFormat()->GetHoriOrient();
1213 rH.GetRelationOrient() == text::RelOrientation::PRINT_AREA )
1214 {
1215 aRectFnSet.SetLeft( rRect, aRectFnSet.GetPrtLeft(*pClip) );
1216 aRectFnSet.SetRight(rRect, aRectFnSet.GetPrtRight(*pClip));
1217 }
1218 }
1219 else if( pFly->IsFlyAtContentFrame() )
1220 {
1221 // #i18732# - consider following text flow or not
1222 // AND alignment at 'page areas'
1223 const SwFrame* pVertPosOrientFrame = pFly->GetVertPosOrientFrame();
1224 if ( !pVertPosOrientFrame )
1225 {
1226 OSL_FAIL( "::CalcClipRect(..) - frame, vertical position is oriented at, is missing .");
1227 pVertPosOrientFrame = pFly->GetAnchorFrame();
1228 }
1229
1230 if ( !bFollowTextFlow || bConsiderWrapOnObjPos )
1231 {
1232 const SwLayoutFrame* pClipFrame = pVertPosOrientFrame->FindPageFrame();
1233 if (!pClipFrame)
1234 {
1235 OSL_FAIL("!pClipFrame: "
1236 "if you can reproduce this please file a bug");
1237 return false;
1238 }
1239 rRect = bMove ? pClipFrame->GetUpper()->getFrameArea()
1240 : pClipFrame->getFrameArea();
1241 // #i26945# - consider that a table, during
1242 // its format, can exceed its upper printing area bottom.
1243 // Thus, enlarge the clip rectangle, if such a case occurred
1244 if ( pFly->GetAnchorFrame()->IsInTab() )
1245 {
1246 const SwTabFrame* pTabFrame = const_cast<SwFlyFrame*>(pFly)
1247 ->GetAnchorFrameContainingAnchPos()->FindTabFrame();
1248 SwRect aTmp( pTabFrame->getFramePrintArea() );
1249 aTmp += pTabFrame->getFrameArea().Pos();
1250 rRect.Union( aTmp );
1251 // #i43913# - consider also the cell frame
1252 const SwFrame* pCellFrame = const_cast<SwFlyFrame*>(pFly)
1253 ->GetAnchorFrameContainingAnchPos()->GetUpper();
1254 while ( pCellFrame && !pCellFrame->IsCellFrame() )
1255 {
1256 pCellFrame = pCellFrame->GetUpper();
1257 }
1258 if ( pCellFrame )
1259 {
1260 aTmp = pCellFrame->getFramePrintArea();
1261 aTmp += pCellFrame->getFrameArea().Pos();
1262 rRect.Union( aTmp );
1263 }
1264 }
1265 }
1266 else if ( rV.GetRelationOrient() == text::RelOrientation::PAGE_FRAME ||
1267 rV.GetRelationOrient() == text::RelOrientation::PAGE_PRINT_AREA )
1268 {
1269 // new class <SwEnvironmentOfAnchoredObject>
1271 aEnvOfObj( bFollowTextFlow );
1272 const SwLayoutFrame& rVertClipFrame =
1273 aEnvOfObj.GetVertEnvironmentLayoutFrame( *pVertPosOrientFrame );
1274 if ( rV.GetRelationOrient() == text::RelOrientation::PAGE_FRAME )
1275 {
1276 rRect = rVertClipFrame.getFrameArea();
1277 }
1278 else if ( rV.GetRelationOrient() == text::RelOrientation::PAGE_PRINT_AREA )
1279 {
1280 if ( rVertClipFrame.IsPageFrame() )
1281 {
1282 rRect = static_cast<const SwPageFrame&>(rVertClipFrame).PrtWithoutHeaderAndFooter();
1283 }
1284 else
1285 {
1286 rRect = rVertClipFrame.getFrameArea();
1287 }
1288 }
1289 const SwLayoutFrame* pHoriClipFrame =
1291 SwRectFnSet aRectFnSet(pFly->GetAnchorFrame());
1292 aRectFnSet.SetLeft( rRect, aRectFnSet.GetLeft(pHoriClipFrame->getFrameArea()) );
1293 aRectFnSet.SetRight(rRect, aRectFnSet.GetRight(pHoriClipFrame->getFrameArea()));
1294 }
1295 else
1296 {
1297 // #i26945#
1298 const SwFrame *pClip =
1299 const_cast<SwFlyFrame*>(pFly)->GetAnchorFrameContainingAnchPos();
1300 SwRectFnSet aRectFnSet(pClip);
1301 const SwLayoutFrame *pUp = pClip->GetUpper();
1302 const SwFrame *pCell = pUp->IsCellFrame() ? pUp : nullptr;
1303 const SwFrameType nType = bMove
1308
1309 while ( !(pUp->GetType() & nType) || pUp->IsColBodyFrame() )
1310 {
1311 pUp = pUp->GetUpper();
1312 if ( !pCell && pUp->IsCellFrame() )
1313 pCell = pUp;
1314 }
1315 if ( bMove && pUp->IsRootFrame() )
1316 {
1317 rRect = pUp->getFramePrintArea();
1318 rRect += pUp->getFrameArea().Pos();
1319 pUp = nullptr;
1320 }
1321 if ( pUp )
1322 {
1323 if ( pUp->GetType() & SwFrameType::Body )
1324 {
1325 const SwPageFrame *pPg;
1326 if ( pUp->GetUpper() != (pPg = pFly->FindPageFrame()) )
1327 pUp = pPg->FindBodyCont();
1328 if (pUp)
1329 {
1330 rRect = pUp->GetUpper()->getFrameArea();
1331 aRectFnSet.SetTop( rRect, aRectFnSet.GetPrtTop(*pUp) );
1332 aRectFnSet.SetBottom(rRect, aRectFnSet.GetPrtBottom(*pUp));
1333 }
1334 }
1335 else
1336 {
1337 if( ( pUp->GetType() & (SwFrameType::Fly | SwFrameType::Ftn ) ) &&
1338 !pUp->getFrameArea().Contains( pFly->getFrameArea().Pos() ) )
1339 {
1340 if( pUp->IsFlyFrame() )
1341 {
1342 const SwFlyFrame *pTmpFly = static_cast<const SwFlyFrame*>(pUp);
1343 while( pTmpFly->GetNextLink() )
1344 {
1345 pTmpFly = pTmpFly->GetNextLink();
1346 if( pTmpFly->getFrameArea().Contains( pFly->getFrameArea().Pos() ) )
1347 break;
1348 }
1349 pUp = pTmpFly;
1350 }
1351 else if( pUp->IsInFootnote() )
1352 {
1353 const SwFootnoteFrame *pTmp = pUp->FindFootnoteFrame();
1354 while( pTmp->GetFollow() )
1355 {
1356 pTmp = pTmp->GetFollow();
1357 if( pTmp->getFrameArea().Contains( pFly->getFrameArea().Pos() ) )
1358 break;
1359 }
1360 pUp = pTmp;
1361 }
1362 }
1363 rRect = pUp->getFramePrintArea();
1364 rRect.Pos() += pUp->getFrameArea().Pos();
1366 {
1367 rRect.Left ( pUp->GetUpper()->getFrameArea().Left() );
1368 rRect.Width( pUp->GetUpper()->getFrameArea().Width());
1369 }
1370 else if ( pUp->IsCellFrame() ) //MA_FLY_HEIGHT
1371 {
1372 const SwFrame *pTab = pUp->FindTabFrame();
1373 aRectFnSet.SetBottom( rRect, aRectFnSet.GetPrtBottom(*pTab->GetUpper()) );
1374 // expand to left and right cell border
1375 rRect.Left ( pUp->getFrameArea().Left() );
1376 rRect.Width( pUp->getFrameArea().Width() );
1377 }
1378 }
1379 }
1380 if ( pCell )
1381 {
1382 // CellFrames might also sit in unallowed areas. In this case,
1383 // the Fly is allowed to do so as well
1384 SwRect aTmp( pCell->getFramePrintArea() );
1385 aTmp += pCell->getFrameArea().Pos();
1386 rRect.Union( aTmp );
1387 }
1388 }
1389 }
1390 else
1391 {
1392 const SwFrame *pUp = pFly->GetAnchorFrame()->GetUpper();
1393 SwRectFnSet aRectFnSet(pFly->GetAnchorFrame());
1394 while( pUp->IsColumnFrame() || pUp->IsSctFrame() || pUp->IsColBodyFrame())
1395 pUp = pUp->GetUpper();
1396 rRect = pUp->getFrameArea();
1397 if( !pUp->IsBodyFrame() )
1398 {
1399 rRect += pUp->getFramePrintArea().Pos();
1400 rRect.SSize( pUp->getFramePrintArea().SSize() );
1401 if ( pUp->IsCellFrame() )
1402 {
1403 const SwFrame *pTab = pUp->FindTabFrame();
1404 aRectFnSet.SetBottom( rRect, aRectFnSet.GetPrtBottom(*pTab->GetUpper()) );
1405 }
1406 }
1407 else if ( pUp->GetUpper()->IsPageFrame() )
1408 {
1409 // Objects anchored as character may exceed right margin
1410 // of body frame:
1411 aRectFnSet.SetRight( rRect, aRectFnSet.GetRight(pUp->GetUpper()->getFrameArea()) );
1412 }
1413 tools::Long nHeight = (9*aRectFnSet.GetHeight(rRect))/10;
1414 tools::Long nTop;
1415 const SwFormat *pFormat = GetUserCall(pSdrObj)->GetFormat();
1416 const SvxULSpaceItem &rUL = pFormat->GetULSpace();
1417 if( bMove )
1418 {
1419 nTop = aRectFnSet.IsVert() ? static_cast<const SwFlyInContentFrame*>(pFly)->GetRefPoint().X() :
1420 static_cast<const SwFlyInContentFrame*>(pFly)->GetRefPoint().Y();
1421 nTop = aRectFnSet.YInc( nTop, -nHeight );
1422 tools::Long nWidth = aRectFnSet.GetWidth(pFly->getFrameArea());
1423 aRectFnSet.SetLeftAndWidth( rRect, aRectFnSet.IsVert() ?
1424 static_cast<const SwFlyInContentFrame*>(pFly)->GetRefPoint().Y() :
1425 static_cast<const SwFlyInContentFrame*>(pFly)->GetRefPoint().X(), nWidth );
1426 nHeight = 2*nHeight - rUL.GetLower() - rUL.GetUpper();
1427 }
1428 else
1429 {
1430 nTop = aRectFnSet.YInc( aRectFnSet.GetBottom(pFly->getFrameArea()),
1431 rUL.GetLower() - nHeight );
1432 nHeight = 2*nHeight - aRectFnSet.GetHeight(pFly->getFrameArea())
1433 - rUL.GetLower() - rUL.GetUpper();
1434 }
1435 aRectFnSet.SetTopAndHeight( rRect, nTop, nHeight );
1436 }
1437 }
1438 else
1439 {
1440 const SwDrawContact *pC = static_cast<const SwDrawContact*>(GetUserCall(pSdrObj));
1441 const SwFrameFormat *pFormat = pC->GetFormat();
1442 const SwFormatAnchor &rAnch = pFormat->GetAnchor();
1443 if ( RndStdIds::FLY_AS_CHAR == rAnch.GetAnchorId() )
1444 {
1445 const SwFrame* pAnchorFrame = pC->GetAnchorFrame( pSdrObj );
1446 if( !pAnchorFrame )
1447 {
1448 OSL_FAIL( "<::CalcClipRect(..)> - missing anchor frame." );
1449 const_cast<SwDrawContact*>(pC)->ConnectToLayout();
1450 pAnchorFrame = pC->GetAnchorFrame();
1451 }
1452 const SwFrame* pUp = pAnchorFrame->GetUpper();
1453 rRect = pUp->getFramePrintArea();
1454 rRect += pUp->getFrameArea().Pos();
1455 SwRectFnSet aRectFnSet(pAnchorFrame);
1456 tools::Long nHeight = (9*aRectFnSet.GetHeight(rRect))/10;
1457 tools::Long nTop;
1458 const SvxULSpaceItem &rUL = pFormat->GetULSpace();
1459 SwRect aSnapRect( pSdrObj->GetSnapRect() );
1460 tools::Long nTmpH = 0;
1461 if( bMove )
1462 {
1463 nTop = aRectFnSet.YInc( aRectFnSet.IsVert() ? pSdrObj->GetAnchorPos().X() :
1464 pSdrObj->GetAnchorPos().Y(), -nHeight );
1465 tools::Long nWidth = aRectFnSet.GetWidth(aSnapRect);
1466 aRectFnSet.SetLeftAndWidth( rRect, aRectFnSet.IsVert() ?
1467 pSdrObj->GetAnchorPos().Y() :
1468 pSdrObj->GetAnchorPos().X(), nWidth );
1469 }
1470 else
1471 {
1472 // #i26791# - value of <nTmpH> is needed to
1473 // calculate value of <nTop>.
1474 nTmpH = aRectFnSet.IsVert() ? pSdrObj->GetCurrentBoundRect().GetWidth() :
1475 pSdrObj->GetCurrentBoundRect().GetHeight();
1476 nTop = aRectFnSet.YInc( aRectFnSet.GetTop(aSnapRect),
1477 rUL.GetLower() + nTmpH - nHeight );
1478 }
1479 nHeight = 2*nHeight - nTmpH - rUL.GetLower() - rUL.GetUpper();
1480 aRectFnSet.SetTopAndHeight( rRect, nTop, nHeight );
1481 }
1482 else
1483 {
1484 // restrict clip rectangle for drawing
1485 // objects in header/footer to the page frame.
1486 // #i26791#
1487 const SwFrame* pAnchorFrame = pC->GetAnchorFrame( pSdrObj );
1488 if ( pAnchorFrame && pAnchorFrame->FindFooterOrHeader() )
1489 {
1490 // clip frame is the page frame the header/footer is on.
1491 const SwFrame* pClipFrame = pAnchorFrame->FindPageFrame();
1492 rRect = pClipFrame->getFrameArea();
1493 }
1494 else
1495 {
1496 bRet = false;
1497 }
1498 }
1499 }
1500 return bRet;
1501}
1502
1503/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@ CONSIDER_WRAP_ON_OBJECT_POSITION
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
constexpr tools::Long Y() const
constexpr tools::Long X() const
virtual SdrObject * SetObjectOrdNum(size_t nOldObjNum, size_t nNewObjNum)
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
virtual rtl::Reference< SdrObject > RemoveObject(size_t nObjNum)
sal_uInt32 GetOrdNumDirect() const
const Point & GetAnchorPos() const
sal_uInt32 GetOrdNum() const
virtual const tools::Rectangle & GetCurrentBoundRect() const
virtual const tools::Rectangle & GetSnapRect() const
void SetOrdNum(sal_uInt32 nNum)
SdrPage * getSdrPageFromSdrObject() const
bool IsInserted() const
const SdrObject & GetReferencedObj() const
SdrObject & ReferencedObj()
bool GetValue() const
SfxHintId GetId() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
bool HasBorder(bool bTreatPaddingAsBorder) const
void SetHeight(tools::Long n)
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
const SwFrame * GetAnchorFrame() const
bool PositionLocked() const
void SetPageFrame(SwPageFrame *_pNewPageFrame)
SwFrame * AnchorFrame()
const SwLayoutFrame * GetVertPosOrientFrame() const
virtual SwFrameFormat & GetFrameFormat()=0
SwPageFrame * GetPageFrame()
bool IsForceNotifyNewBackground()
const SwRect & GetObjRectWithSpaces() const
method to determine object area inclusive its spacing
static bool IsDraggingOffPageAllowed(const SwFrameFormat *)
method to determine if dragging objects off page is allowed
const SdrObject * GetDrawObj() const
SdrObject * DrawObj()
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:101
SwBorderAttrs * Get()
Definition: frmtool.cxx:2696
const SwAttrSet & GetAttrSet() const
Definition: frmtool.hxx:397
bool IsLine() const
Definition: frmtool.hxx:554
SwFrameFormat * GetFormat()
Definition: dcontact.hxx:112
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
Definition: cntfrm.hxx:59
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Definition: node.cxx:1223
SwNodes & GetNodes()
Definition: doc.hxx:422
ContactObject for connection of formats as representatives of draw objects in SwClient and the object...
Definition: dcontact.hxx:305
const SwFrame * GetAnchorFrame(const SdrObject *_pDrawObj=nullptr) const
Definition: dcontact.cxx:804
general base class for all free-flowing frames
Definition: flyfrm.hxx:79
const SwVirtFlyDrawObj * GetVirtDrawObj() const
Definition: fly.cxx:3025
virtual void DestroyImpl() override
Definition: fly.cxx:327
void MakeContentPos(const SwBorderAttrs &rAttrs)
Definition: fly.cxx:1940
virtual bool IsFormatPossible() const override
method to determine if a format on the Writer fly frame is possible
Definition: fly.cxx:3106
virtual const SwFlyFrameFormat * GetFormat() const override
Definition: fly.cxx:3119
bool IsFlyAtContentFrame() const
Definition: flyfrm.hxx:220
static const SwFormatAnchor * GetAnchorFromPoolItem(const SfxPoolItem &rItem)
Definition: fly.cxx:3217
void SetNotifyBack()
Definition: flyfrm.hxx:227
virtual void InvalidateObjPos() override
method to invalidate position of the anchored object
Definition: fly.cxx:3037
virtual SwFrameFormat & GetFrameFormat() override
Definition: fly.cxx:3044
virtual void SwClientNotify(const SwModify &rMod, const SfxHint &rHint) override
Definition: fly.cxx:765
virtual void MakeObjPos() override
method to determine position for the object and set the position at the object
Definition: fly.cxx:1896
SwFlyFrame * GetNextLink() const
Definition: flyfrm.hxx:194
bool m_bWidthClipped
Definition: flyfrm.hxx:123
bool IsLocked() const
Definition: flyfrm.hxx:215
void Lock()
Definition: flyfrm.hxx:145
bool IsFlyInContentFrame() const
Definition: flyfrm.hxx:217
virtual void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr) override
"Formats" the Frame; Frame and PrtArea.
Definition: fly.cxx:1358
bool IsFlyLayFrame() const
Definition: flyfrm.hxx:219
void MakePrtArea(const SwBorderAttrs &rAttrs)
Definition: fly.cxx:1925
bool m_bFormatHeightOnly
Definition: flyfrm.hxx:126
void Unlock()
Definition: flyfrm.hxx:146
virtual const IDocumentDrawModelAccess & getIDocumentDrawModelAccess() override
Definition: fly.cxx:374
bool m_bValidContentPos
Definition: flyfrm.hxx:139
bool m_bLayout
RndStdIds::FLY_AT_PAGE, RndStdIds::FLY_AT_FLY, at page or at frame.
Definition: flyfrm.hxx:131
bool m_bHeightClipped
Definition: flyfrm.hxx:122
bool IsClipped() const
Definition: flyfrm.hxx:230
bool HasEnvironmentAutoSize() const
determines, if direct environment of fly frame has 'auto' size
Definition: flylay.cxx:445
virtual void MakeAll(vcl::RenderContext *pRenderContext) override
Definition: flylay.cxx:113
virtual ~SwFlyFreeFrame() override
Definition: flylay.cxx:92
bool isTransformableSwFrame() const
Definition: flyfrms.hxx:134
std::unique_ptr< TransformableSwFrame > mpTransformableSwFrame
Definition: flyfrms.hxx:49
SwRect maUnclippedFrame
Definition: flyfrms.hxx:46
virtual void DestroyImpl() override
Definition: flylay.cxx:64
virtual basegfx::B2DHomMatrix getFrameAreaTransformation() const override
Definition: flylay.cxx:371
double getLocalFrameRotation() const
Definition: flylay.cxx:420
bool IsNoMakePos() const
Definition: flyfrms.hxx:103
bool supportsAutoContour() const
Definition: flylay.cxx:302
virtual void NotifyBackground(SwPageFrame *pPage, const SwRect &rRect, PrepareHint eHint) override
Notifies the background (all ContentFrames that currently are overlapping).
Definition: flylay.cxx:107
bool IsNoMoveOnCheckClip() const
Definition: flyfrms.hxx:91
SwFlyFreeFrame(SwFlyFrameFormat *, SwFrame *, SwFrame *pAnchor, bool bFollow=false)
Definition: flylay.cxx:55
void CheckClip(const SwFormatFrameSize &rSz)
Definition: flylay.cxx:471
virtual basegfx::B2DHomMatrix getFramePrintAreaTransformation() const override
Definition: flylay.cxx:383
virtual void transform_translate(const Point &rOffset) override
Definition: flylay.cxx:396
virtual bool IsFormatPossible() const override
method to determine, if a format on the Writer fly frame is possible
Definition: flylay.cxx:710
TransformableSwFrame * getTransformableSwFrame()
Definition: flyfrms.hxx:135
Flys that are anchored as a character in the content.
Definition: flyfrms.hxx:210
Flys that are bound to layout frames (to-frame) and not to/as content.
Definition: flyfrms.hxx:151
virtual void RegisterAtPage(SwPageFrame &) override
Definition: flylay.cxx:723
SwFlyLayFrame(SwFlyFrameFormat *, SwFrame *, SwFrame *pAnchor)
Definition: flylay.cxx:717
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: flylay.cxx:738
SwLayoutFrame * FindBodyCont()
Searches the first ContentFrame in BodyText below the page.
Definition: findfrm.cxx:48
Represents one footnote or endnote in the layout.
Definition: ftnfrm.hxx:84
const SwFootnoteFrame * GetFollow() const
Definition: ftnfrm.hxx:120
FlyAnchors.
Definition: fmtanchr.hxx:37
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:67
SwFrameSize GetHeightSizeType() const
Definition: fmtfsize.hxx:80
Defines the horizontal position of a fly frame.
Definition: fmtornt.hxx:73
sal_Int16 GetHoriOrient() const
Definition: fmtornt.hxx:94
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:95
Defines the vertical position of a fly frame.
Definition: fmtornt.hxx:37
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:58
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 SwFormatVertOrient & GetVertOrient(bool=true) const
Definition: fmtornt.hxx:113
const SwFormatFollowTextFlow & GetFollowTextFlow(bool=true) const
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:88
const SwFormatHoriOrient & GetHoriOrient(bool=true) const
Definition: fmtornt.hxx:115
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:447
const SvxULSpaceItem & GetULSpace(bool=true) const
Definition: frmatr.hxx:100
const IDocumentSettingAccess & getIDocumentSettingAccess() const
Provides access to the document settings interface.
Definition: format.cxx:711
const SwRect & getFrameArea() const
Definition: frame.hxx:179
bool isFrameAreaDefinitionValid() const
Definition: frame.hxx:171
virtual basegfx::B2DHomMatrix getFrameAreaTransformation() const
Definition: wsfrm.cxx:127
bool isFrameAreaPositionValid() const
Definition: frame.hxx:166
const SwRect & getFramePrintArea() const
Definition: frame.hxx:180
void setFramePrintAreaValid(bool bNew)
Definition: wsfrm.cxx:102
void setFrameAreaPositionValid(bool bNew)
Definition: wsfrm.cxx:86
virtual void transform_translate(const Point &rOffset)
Definition: wsfrm.cxx:150
bool isFramePrintAreaValid() const
Definition: frame.hxx:168
bool isFrameAreaSizeValid() const
Definition: frame.hxx:167
virtual basegfx::B2DHomMatrix getFramePrintAreaTransformation() const
Definition: wsfrm.cxx:137
void setFrameAreaSizeValid(bool bNew)
Definition: wsfrm.cxx:94
Style of a layout element.
Definition: frmfmt.hxx:72
Base class of the Writer layout elements.
Definition: frame.hxx:315
bool IsRowFrame() const
Definition: frame.hxx:1228
bool IsCellFrame() const
Definition: frame.hxx:1232
void RemoveFly(SwFlyFrame *pToRemove)
Definition: fly.cxx:2429
bool IsInDtor() const
Definition: frame.hxx:898
void InvalidateAll()
Definition: frame.hxx:1061
SwFlyFrame * FindFlyFrame()
Definition: frame.hxx:1117
SwSectionFrame * FindSctFrame()
Definition: frame.hxx:1121
SwTabFrame * FindTabFrame()
Definition: frame.hxx:1105
SwFrame * GetNext()
Definition: frame.hxx:682
bool supportsFullDrawingLayerFillAttributeSet() const
Definition: findfrm.cxx:795
bool IsPageFrame() const
Definition: frame.hxx:1184
bool IsColLocked() const
Definition: frame.hxx:892
bool IsColumnFrame() const
Definition: frame.hxx:1188
void ColUnlock()
Definition: frame.hxx:449
SwFrameType GetType() const
Definition: frame.hxx:521
bool IsInFootnote() const
Definition: frame.hxx:955
bool IsHeaderFrame() const
Definition: frame.hxx:1196
virtual void Calc(vcl::RenderContext *pRenderContext) const
Definition: trvlfrm.cxx:1799
const SwSortedObjs * GetDrawObjs() const
Definition: frame.hxx:568
bool IsInTab() const
Definition: frame.hxx:961
static SwCache & GetCache()
Definition: frame.hxx:523
SwFrame * GetLower()
Definition: findfrm.cxx:196
bool IsInFly() const
Definition: frame.hxx:967
void AppendFly(SwFlyFrame *pNew)
Definition: fly.cxx:2411
const SwAttrSet * GetAttrSet() const
WARNING: this may not return correct RES_PAGEDESC/RES_BREAK items for SwTextFrame,...
Definition: findfrm.cxx:762
void ColLock()
Definition: frame.hxx:448
bool IsRootFrame() const
Definition: frame.hxx:1180
bool IsFooterFrame() const
Definition: frame.hxx:1200
SwLayoutFrame * GetUpper()
Definition: frame.hxx:684
void InvalidatePage(const SwPageFrame *pPage=nullptr) const
Invalidates the page in which the Frame is currently placed.
Definition: wsfrm.cxx:618
SwRootFrame * getRootFrame()
Definition: frame.hxx:685
bool IsNoTextFrame() const
Definition: frame.hxx:1244
void SetCompletePaint() const
Definition: frame.hxx:1000
bool IsFlyFrame() const
Definition: frame.hxx:1216
bool IsSctFrame() const
Definition: frame.hxx:1220
SwPageFrame * FindPageFrame()
Definition: frame.hxx:686
drawinglayer::attribute::SdrAllFillAttributesHelperPtr getSdrAllFillAttributesHelper() const
Definition: findfrm.cxx:779
SwFrame * FindFooterOrHeader()
Definition: findfrm.cxx:633
SwFootnoteFrame * FindFootnoteFrame()
Definition: frame.hxx:1113
bool IsBodyFrame() const
Definition: frame.hxx:1212
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:973
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:3067
const SwFrame * Lower() const
Definition: layfrm.hxx:101
double getLocalFrameRotation() const
Definition: notxtfrm.cxx:629
Marks a node in the document model.
Definition: ndindex.hxx:31
SwContentNode * GoNext(SwNodeIndex *) const
Definition: nodes.cxx:1299
A page of the document layout.
Definition: pagefrm.hxx:60
void AppendFlyToPage(SwFlyFrame *pNew)
Definition: flylay.cxx:801
void PlaceFly(SwFlyFrame *pFly, SwFlyFrameFormat *pFormat)
Definition: flylay.cxx:1139
void InvalidateWordCount() const
Definition: pagefrm.hxx:406
void InvalidateFlyLayout() const
Validate, invalidate and query the Page status Layout/Content and Fly/non-Fly respectively are inspec...
Definition: pagefrm.hxx:373
void InvalidateAutoCompleteWords() const
Definition: pagefrm.hxx:402
sal_uInt16 GetPhyPageNum() const
Definition: pagefrm.hxx:209
void RemoveFlyFromPage(SwFlyFrame *pToRemove)
Definition: flylay.cxx:909
void InvalidateFlyInCnt() const
Definition: pagefrm.hxx:381
const SwSortedObjs * GetSortedObjs() const
Definition: pagefrm.hxx:136
void InvalidateSmartTags() const
Definition: pagefrm.hxx:398
bool IsEmptyPage() const
Definition: pagefrm.hxx:161
void MoveFly(SwFlyFrame *pToMove, SwPageFrame *pDest)
Definition: flylay.cxx:959
void RemoveDrawObjFromPage(SwAnchoredObject &_rToRemoveObj)
Definition: flylay.cxx:1109
void InvalidateSpelling() const
Definition: pagefrm.hxx:393
void InvalidateFlyContent() const
Definition: pagefrm.hxx:377
void AppendDrawObjToPage(SwAnchoredObject &_rNewObj)
Definition: flylay.cxx:1060
std::unique_ptr< SwSortedObjs > m_pSortedObjs
Definition: pagefrm.hxx:63
bool IsVert() const
Definition: frame.hxx:1372
tools::Long GetHeight(const SwRect &rRect) const
Definition: frame.hxx:1387
tools::Long YInc(tools::Long n1, tools::Long n2) const
Definition: frame.hxx:1430
void SetLeftAndWidth(SwRect &rRect, tools::Long nLeft, tools::Long nWidth) const
Definition: frame.hxx:1432
void SetBottom(SwRect &rRect, tools::Long nNew) const
Definition: frame.hxx:1392
void SetRight(SwRect &rRect, tools::Long nNew) const
Definition: frame.hxx:1394
tools::Long GetWidth(const SwRect &rRect) const
Definition: frame.hxx:1386
tools::Long GetTop(const SwRect &rRect) const
Definition: frame.hxx:1382
tools::Long GetPrtRight(const SwFrame &rFrame) const
Definition: frame.hxx:1417
Point GetPos(const SwRect &rRect) const
Definition: frame.hxx:1388
void SetTopAndHeight(SwRect &rRect, tools::Long nTop, tools::Long nHeight) const
Definition: frame.hxx:1433
tools::Long GetLeft(const SwRect &rRect) const
Definition: frame.hxx:1384
tools::Long GetPrtTop(const SwFrame &rFrame) const
Definition: frame.hxx:1414
tools::Long GetPrtLeft(const SwFrame &rFrame) const
Definition: frame.hxx:1416
tools::Long GetBottom(const SwRect &rRect) const
Definition: frame.hxx:1383
void SetTop(SwRect &rRect, tools::Long nNew) const
Definition: frame.hxx:1391
tools::Long GetRight(const SwRect &rRect) const
Definition: frame.hxx:1385
tools::Long GetPrtBottom(const SwFrame &rFrame) const
Definition: frame.hxx:1415
void SetLeft(SwRect &rRect, tools::Long nNew) const
Definition: frame.hxx:1393
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
SwRect & Intersection_(const SwRect &rRect)
Definition: swrect.cxx:81
void Pos(const Point &rNew)
Definition: swrect.hxx:171
void SSize(const Size &rNew)
Definition: swrect.hxx:180
bool Contains(const Point &rPOINT) const
Definition: swrect.hxx:356
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:85
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:215
const SdrPage * GetDrawPage() const
Definition: rootfrm.hxx:235
void SetAssertFlyPages()
Makes sure that all requested page-bound Flys find a Page.
Definition: rootfrm.hxx:286
void AssertFlyPages()
Ensures that enough pages exist, so that all page bound frames and draw objects can be placed.
Definition: pagechg.cxx:1566
class for collecting anchored objects
Definition: sortedobjs.hxx:49
bool Insert(SwAnchoredObject &_rAnchoredObj)
Definition: sortedobjs.cxx:208
void Remove(SwAnchoredObject &_rAnchoredObj)
Definition: sortedobjs.cxx:229
SwTabFrame is one table in the document layout, containing rows (which contain cells).
Definition: tabfrm.hxx:49
static SwFrameFormat * getOtherTextBoxFormat(const SwFrameFormat *pFormat, sal_uInt16 nType, const SdrObject *pObject=nullptr)
If we have an associated TextFrame, then return that.
vcl::RenderContext * GetOut() const
Definition: viewsh.hxx:365
RotateFlyFrame3: Helper class when you want to make your SwFrame derivate transformable.
Definition: frame.hxx:236
void adaptFrameAreasToTransformations()
Definition: wsfrm.cxx:236
void restoreFrameAreas()
Definition: wsfrm.cxx:271
const basegfx::B2DHomMatrix & getLocalFrameAreaTransformation() const
Definition: frame.hxx:255
void transform(const basegfx::B2DHomMatrix &aTransform)
Definition: wsfrm.cxx:289
const basegfx::B2DHomMatrix & getLocalFramePrintAreaTransformation() const
Definition: frame.hxx:261
void createFrameAreaTransformations(double fRotation, const basegfx::B2DPoint &rCenter)
Definition: wsfrm.cxx:216
const SwLayoutFrame & GetVertEnvironmentLayoutFrame(const SwFrame &_rVertOrientFrame) const
determine environment layout frame for possible vertical object positions respectively for alignments...
constexpr tools::Long GetWidth() const
constexpr tools::Long GetHeight() const
SwFrameFormat * FindFrameFormat(SdrObject *pObj)
The Get reverse way: seeks the format to the specified object.
Definition: dcontact.cxx:121
SwContact * GetUserCall(const SdrObject *pObj)
Returns the UserCall if applicable from the group object.
Definition: dcontact.cxx:172
static SwContentNode * GetContentNode(SwDoc &rDoc, SwPosition &rPos, bool bNext)
Definition: fltshell.cxx:54
double getLocalFrameRotation_from_SwNoTextFrame(const SwNoTextFrame &rNoTextFrame)
Definition: flylay.cxx:415
bool CalcClipRect(const SdrObject *pSdrObj, SwRect &rRect, bool bMove)
calculate rectangle in that the object can be moved or rather be resized
Definition: flylay.cxx:1175
@ Fixed
Frame cannot be moved in Var-direction.
SwFrameType
Definition: frame.hxx:75
void Notify_Background(const SdrObject *pObj, SwPageFrame *pPage, const SwRect &rRect, const PrepareHint eHint, const bool bInva)
Definition: frmtool.cxx:3412
void RegistFlys(SwPageFrame *, const SwLayoutFrame *)
Definition: frmtool.cxx:3238
void CalcContent(SwLayoutFrame *pLay, bool bNoColl=false)
Definition: fly.cxx:1550
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(162)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(112)
#define SAL_WARN_IF(condition, area, stream)
bool equalZero(const T &rfVal)
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
std::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr
Definition: format.hxx:41
long Long
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:1043
QPRO_FUNC_TYPE nType
#define MINLAY
Definition: swtypes.hxx:62
PrepareHint
Definition: swtypes.hxx:206
Left
Center
void ClrContourCache(const SdrObject *pObj)
Definition: txtfly.cxx:137