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
56: SwFlyFrame( pFormat, pSib, pAnch ),
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( 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
396void SwFlyFreeFrame::transform_translate(const Point& rOffset)
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
723// #i28701#
724
725void SwFlyLayFrame::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
726{
727 if (rHint.GetId() != SfxHintId::SwLegacyModify)
728 return;
729 auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
730 if(!pLegacy->m_pNew)
731 return;
732 const auto pAnch = GetAnchorFromPoolItem(*pLegacy->m_pNew);
733
734 if(!pAnch)
735 {
736 SwFlyFrame::SwClientNotify(rMod, rHint);
737 return;
738 }
739 SAL_WARN_IF(pAnch->GetAnchorId() == GetFormat()->GetAnchor().GetAnchorId(), "sw.core", "Invalid change of anchor type.");
740
741 // Unregister, get hold of the page, attach to the corresponding LayoutFrame.
743 // #i28701# - use new method <GetPageFrame()>
744 SwPageFrame* pOldPage = GetPageFrame();
745 AnchorFrame()->RemoveFly(this);
746
747 if(RndStdIds::FLY_AT_PAGE == pAnch->GetAnchorId())
748 {
749 SwRootFrame* pRoot = getRootFrame();
750 SwPageFrame* pTmpPage = static_cast<SwPageFrame*>(pRoot->Lower());
751 sal_uInt16 nPagesToFlip = pAnch->GetPageNum()-1;
752 while(pTmpPage && nPagesToFlip)
753 {
754 pTmpPage = static_cast<SwPageFrame*>(pTmpPage->GetNext());
755 --nPagesToFlip;
756 }
757 if(pTmpPage && !nPagesToFlip)
758 {
759 // #i50432# - adjust synopsis of <PlaceFly(..)>
760 pTmpPage->PlaceFly(this, nullptr);
761 }
762 if(!pTmpPage)
763 {
764 pRoot->SetAssertFlyPages();
765 pRoot->AssertFlyPages();
766 }
767 }
768 else
769 {
770 SwNodeIndex aIdx(*pAnch->GetAnchorNode());
771 SwContentFrame* pContent = GetFormat()->GetDoc()->GetNodes().GoNext(&aIdx)->
772 GetContentNode()->getLayoutFrame(getRootFrame(), nullptr, nullptr);
773 if(pContent)
774 {
775 SwFlyFrame *pTmp = pContent->FindFlyFrame();
776 if(pTmp)
777 pTmp->AppendFly(this);
778 }
779 }
780 // #i28701# - use new method <GetPageFrame()>
781 if ( pOldPage && pOldPage != GetPageFrame() )
786}
787
789{
790 if ( !pNew->GetVirtDrawObj()->IsInserted() )
792 static_cast<SdrObject*>(pNew->GetVirtDrawObj()),
794
799
800 if ( GetUpper() )
801 {
802 static_cast<SwRootFrame*>(GetUpper())->SetIdleFlags();
803 static_cast<SwRootFrame*>(GetUpper())->InvalidateBrowseWidth();
804 }
805
806 SdrObject* pObj = pNew->GetVirtDrawObj();
807 OSL_ENSURE( pNew->GetAnchorFrame(), "Fly without Anchor" );
808 SwFlyFrame* pFly = const_cast<SwFlyFrame*>(pNew->GetAnchorFrame()->FindFlyFrame());
809 if ( pFly && pObj->GetOrdNum() < pFly->GetVirtDrawObj()->GetOrdNum() )
810 {
811 //#i119945# set pFly's OrdNum to _rNewObj's. So when pFly is removed by Undo, the original OrdNum will not be changed.
812 sal_uInt32 nNewNum = pObj->GetOrdNumDirect();
813 SdrObject* pDrawObj = nullptr;
814 if (auto pFormat = pFly->GetFormat())
815 if (auto pShapeFormat = SwTextBoxHelper::getOtherTextBoxFormat(pFormat, RES_FLYFRMFMT))
816 pDrawObj = pShapeFormat->FindRealSdrObject();
817
818 if (pDrawObj)
819 {
820 if (auto pPage = pDrawObj->getSdrPageFromSdrObject())
821 pPage->SetObjectOrdNum(pDrawObj->GetOrdNumDirect(), nNewNum);
822 else
823 pDrawObj->SetOrdNum(nNewNum);
824 }
825
826 if ( pObj->getSdrPageFromSdrObject() )
827 pObj->getSdrPageFromSdrObject()->SetObjectOrdNum( pFly->GetVirtDrawObj()->GetOrdNumDirect(), nNewNum + (pDrawObj ? 1 : 0) );
828 else
829 pFly->GetVirtDrawObj()->SetOrdNum( nNewNum + (pDrawObj ? 1 : 0));
830 }
831
832 // Don't look further at Flys that sit inside the Content.
833 if ( pNew->IsFlyInContentFrame() )
835 else
836 {
838
839 if ( !m_pSortedObjs )
840 {
841 m_pSortedObjs.reset(new SwSortedObjs());
842 }
843
844 const bool bSuccessInserted = m_pSortedObjs->Insert( *pNew );
845 OSL_ENSURE( bSuccessInserted, "Fly not inserted in Sorted." );
846
847 // #i87493#
848 OSL_ENSURE( pNew->GetPageFrame() == nullptr || pNew->GetPageFrame() == this,
849 "<SwPageFrame::AppendFlyToPage(..)> - anchored fly frame seems to be registered at another page frame. Serious defect." );
850 // #i28701# - use new method <SetPageFrame(..)>
851 pNew->SetPageFrame( this );
852 pNew->InvalidatePage( this );
853 // #i28701#
854 pNew->UnlockPosition();
855 // needed to reposition at-page anchored flys moved from different page
856 pNew->InvalidateObjPos();
857
858 // Notify accessible layout. That's required at this place for
859 // frames only where the anchor is moved. Creation of new frames
860 // is additionally handled by the SwFrameNotify class.
861#if !ENABLE_WASM_STRIP_ACCESSIBILITY
862 if( GetUpper() &&
863 static_cast< SwRootFrame * >( GetUpper() )->IsAnyShellAccessible() &&
864 static_cast< SwRootFrame * >( GetUpper() )->GetCurrShell() )
865 {
866 static_cast< SwRootFrame * >( GetUpper() )->GetCurrShell()->Imp()
867 ->AddAccessibleFrame( pNew );
868 }
869#endif
870 }
871
872 // #i28701# - correction: consider also drawing objects
873 if ( !pNew->GetDrawObjs() )
874 return;
875
876 SwSortedObjs &rObjs = *pNew->GetDrawObjs();
877 for (SwAnchoredObject* pTmpObj : rObjs)
878 {
879 if ( auto pTmpFly = pTmpObj->DynCastFlyFrame() )
880 {
881 // #i28701# - use new method <GetPageFrame()>
882 if ( pTmpFly->IsFlyFreeFrame() && !pTmpFly->GetPageFrame() )
883 AppendFlyToPage( pTmpFly );
884 }
885 else if ( dynamic_cast<const SwAnchoredDrawObject*>( pTmpObj) != nullptr )
886 {
887 // #i87493#
888 if ( pTmpObj->GetPageFrame() != this )
889 {
890 if ( pTmpObj->GetPageFrame() != nullptr )
891 {
892 pTmpObj->GetPageFrame()->RemoveDrawObjFromPage( *pTmpObj );
893 }
894 AppendDrawObjToPage( *pTmpObj );
895 }
896 }
897 }
898}
899
901{
902 const sal_uInt32 nOrdNum = pToRemove->GetVirtDrawObj()->GetOrdNum();
903 getRootFrame()->GetDrawPage()->RemoveObject( nOrdNum );
904 pToRemove->GetVirtDrawObj()->ReferencedObj().SetOrdNum( nOrdNum );
905
906 if ( GetUpper() )
907 {
908 if ( !pToRemove->IsFlyInContentFrame() )
909 static_cast<SwRootFrame*>(GetUpper())->SetSuperfluous();
910 static_cast<SwRootFrame*>(GetUpper())->InvalidateBrowseWidth();
911 }
912
913 // Don't look further at Flys that sit inside the Content.
914 if ( pToRemove->IsFlyInContentFrame() )
915 return;
916
917 // Don't delete collections just yet. This will happen at the end of the
918 // action in the RemoveSuperfluous of the page, kicked off by a method of
919 // the same name in the root.
920 // The FlyColl might be gone already, because the page's dtor is being
921 // executed.
922 // Remove it _before_ disposing accessible frames to avoid accesses to
923 // the Frame from event handlers.
924 if (m_pSortedObjs)
925 {
926 m_pSortedObjs->Remove(*pToRemove);
927 if (!m_pSortedObjs->size())
928 {
929 m_pSortedObjs.reset();
930 }
931 }
932
933 // Notify accessible layout. That's required at this place for
934 // frames only where the anchor is moved. Creation of new frames
935 // is additionally handled by the SwFrameNotify class.
936#if !ENABLE_WASM_STRIP_ACCESSIBILITY
937 if( GetUpper() &&
938 static_cast< SwRootFrame * >( GetUpper() )->IsAnyShellAccessible() &&
939 static_cast< SwRootFrame * >( GetUpper() )->GetCurrShell() )
940 {
941 static_cast< SwRootFrame * >( GetUpper() )->GetCurrShell()->Imp()
942 ->DisposeAccessibleFrame( pToRemove, true );
943 }
944#endif
945
946 // #i28701# - use new method <SetPageFrame(..)>
947 pToRemove->SetPageFrame( nullptr );
948}
949
951{
952 // Invalidations
953 if ( GetUpper() )
954 {
955 static_cast<SwRootFrame*>(GetUpper())->SetIdleFlags();
956 if ( !pToMove->IsFlyInContentFrame() && pDest->GetPhyPageNum() < GetPhyPageNum() )
957 static_cast<SwRootFrame*>(GetUpper())->SetSuperfluous();
958 }
959
960 pDest->InvalidateSpelling();
961 pDest->InvalidateSmartTags();
963 pDest->InvalidateWordCount();
964
965 if ( pToMove->IsFlyInContentFrame() )
966 {
967 pDest->InvalidateFlyInCnt();
968 return;
969 }
970
971 // Notify accessible layout. That's required at this place for
972 // frames only where the anchor is moved. Creation of new frames
973 // is additionally handled by the SwFrameNotify class.
974#if !ENABLE_WASM_STRIP_ACCESSIBILITY
975 if( GetUpper() &&
976 static_cast< SwRootFrame * >( GetUpper() )->IsAnyShellAccessible() &&
977 static_cast< SwRootFrame * >( GetUpper() )->GetCurrShell() )
978 {
979 static_cast< SwRootFrame * >( GetUpper() )->GetCurrShell()->Imp()
980 ->DisposeAccessibleFrame( pToMove, true );
981 }
982#endif
983
984 // The FlyColl might be gone already, because the page's dtor is being executed.
985 if ( m_pSortedObjs )
986 {
987 m_pSortedObjs->Remove( *pToMove );
988 if ( !m_pSortedObjs->size() )
989 {
990 m_pSortedObjs.reset();
991 }
992 }
993
994 // Register
995 if ( !pDest->GetSortedObjs() )
996 pDest->m_pSortedObjs.reset(new SwSortedObjs());
997
998 const bool bSuccessInserted = pDest->GetSortedObjs()->Insert( *pToMove );
999 OSL_ENSURE( bSuccessInserted, "Fly not inserted in Sorted." );
1000
1001 // #i28701# - use new method <SetPageFrame(..)>
1002 pToMove->SetPageFrame( pDest );
1003 pToMove->InvalidatePage( pDest );
1004 pToMove->SetNotifyBack();
1005 pDest->InvalidateFlyContent();
1006 // #i28701#
1007 pToMove->UnlockPosition();
1008
1009 // Notify accessible layout. That's required at this place for
1010 // frames only where the anchor is moved. Creation of new frames
1011 // is additionally handled by the SwFrameNotify class.
1012#if !ENABLE_WASM_STRIP_ACCESSIBILITY
1013 if( GetUpper() &&
1014 static_cast< SwRootFrame * >( GetUpper() )->IsAnyShellAccessible() &&
1015 static_cast< SwRootFrame * >( GetUpper() )->GetCurrShell() )
1016 {
1017 static_cast< SwRootFrame * >( GetUpper() )->GetCurrShell()->Imp()
1018 ->AddAccessibleFrame( pToMove );
1019 }
1020#endif
1021
1022 // #i28701# - correction: move lowers of Writer fly frame
1023 if ( !pToMove->GetDrawObjs() )
1024 return;
1025
1026 SwSortedObjs &rObjs = *pToMove->GetDrawObjs();
1027 for (SwAnchoredObject* pObj : rObjs)
1028 {
1029 if ( auto pFly = pObj->DynCastFlyFrame() )
1030 {
1031 if ( pFly->IsFlyFreeFrame() )
1032 {
1033 // #i28701# - use new method <GetPageFrame()>
1034 SwPageFrame* pPageFrame = pFly->GetPageFrame();
1035 if ( pPageFrame )
1036 pPageFrame->MoveFly( pFly, pDest );
1037 else
1038 pDest->AppendFlyToPage( pFly );
1039 }
1040 }
1041 else if ( dynamic_cast<const SwAnchoredDrawObject*>( pObj) != nullptr )
1042 {
1043 RemoveDrawObjFromPage( *pObj );
1044 pDest->AppendDrawObjToPage( *pObj );
1045 }
1046 }
1047}
1048
1050{
1051 if ( dynamic_cast<const SwAnchoredDrawObject*>( &_rNewObj) == nullptr )
1052 {
1053 OSL_FAIL( "SwPageFrame::AppendDrawObjToPage(..) - anchored object of unexpected type -> object not appended" );
1054 return;
1055 }
1056
1057 if ( GetUpper() )
1058 {
1059 static_cast<SwRootFrame*>(GetUpper())->InvalidateBrowseWidth();
1060 }
1061
1062 assert(_rNewObj.GetAnchorFrame());
1063 SwFlyFrame* pFlyFrame = const_cast<SwFlyFrame*>(_rNewObj.GetAnchorFrame()->FindFlyFrame());
1064 if ( pFlyFrame &&
1065 _rNewObj.GetDrawObj()->GetOrdNum() < pFlyFrame->GetVirtDrawObj()->GetOrdNum() )
1066 {
1067 //#i119945# set pFly's OrdNum to _rNewObj's. So when pFly is removed by Undo, the original OrdNum will not be changed.
1068 sal_uInt32 nNewNum = _rNewObj.GetDrawObj()->GetOrdNumDirect();
1069 if ( _rNewObj.GetDrawObj()->getSdrPageFromSdrObject() )
1070 _rNewObj.DrawObj()->getSdrPageFromSdrObject()->SetObjectOrdNum( pFlyFrame->GetVirtDrawObj()->GetOrdNumDirect(), nNewNum );
1071 else
1072 pFlyFrame->GetVirtDrawObj()->SetOrdNum( nNewNum );
1073 }
1074
1075 if ( RndStdIds::FLY_AS_CHAR == _rNewObj.GetFrameFormat().GetAnchor().GetAnchorId() )
1076 {
1077 return;
1078 }
1079
1080 if ( !m_pSortedObjs )
1081 {
1082 m_pSortedObjs.reset(new SwSortedObjs());
1083 }
1084 if ( !m_pSortedObjs->Insert( _rNewObj ) )
1085 {
1086 OSL_ENSURE( m_pSortedObjs->Contains( _rNewObj ),
1087 "Drawing object not appended into list <pSortedObjs>." );
1088 }
1089 // #i87493#
1090 OSL_ENSURE( _rNewObj.GetPageFrame() == nullptr || _rNewObj.GetPageFrame() == this,
1091 "<SwPageFrame::AppendDrawObjToPage(..)> - anchored draw object seems to be registered at another page frame. Serious defect." );
1092 _rNewObj.SetPageFrame( this );
1093
1094 // invalidate page in order to force a reformat of object layout of the page.
1096}
1097
1099{
1100 if ( dynamic_cast<const SwAnchoredDrawObject*>( &_rToRemoveObj) == nullptr )
1101 {
1102 OSL_FAIL( "SwPageFrame::RemoveDrawObjFromPage(..) - anchored object of unexpected type -> object not removed" );
1103 return;
1104 }
1105
1106 if ( m_pSortedObjs )
1107 {
1108 m_pSortedObjs->Remove( _rToRemoveObj );
1109 if ( !m_pSortedObjs->size() )
1110 {
1111 m_pSortedObjs.reset();
1112 }
1113 if ( GetUpper() )
1114 {
1115 if (RndStdIds::FLY_AS_CHAR !=
1116 _rToRemoveObj.GetFrameFormat().GetAnchor().GetAnchorId())
1117 {
1118 static_cast<SwRootFrame*>(GetUpper())->SetSuperfluous();
1120 }
1121 static_cast<SwRootFrame*>(GetUpper())->InvalidateBrowseWidth();
1122 }
1123 }
1124 _rToRemoveObj.SetPageFrame( nullptr );
1125}
1126
1127// #i50432# - adjust method description and synopsis.
1129{
1130 // #i50432# - consider the case that page is an empty page:
1131 // In this case append the fly frame at the next page
1132 OSL_ENSURE( !IsEmptyPage() || GetNext(),
1133 "<SwPageFrame::PlaceFly(..)> - empty page with no next page! -> fly frame appended at empty page" );
1134 if ( IsEmptyPage() && GetNext() )
1135 {
1136 static_cast<SwPageFrame*>(GetNext())->PlaceFly( pFly, pFormat );
1137 }
1138 else
1139 {
1140 // If we received a Fly, we use that one. Otherwise, create a new
1141 // one using the Format.
1142 if ( pFly )
1143 AppendFly( pFly );
1144 else
1145 {
1146 OSL_ENSURE( pFormat, ":-( No Format given for Fly." );
1147 pFly = new SwFlyLayFrame( pFormat, this, this );
1148 AppendFly( pFly );
1149 ::RegistFlys( this, pFly );
1150 }
1151 }
1152}
1153
1154// #i18732# - adjustments for following text flow or not
1155// AND alignment at 'page areas' for to paragraph/to character anchored objects
1156// #i22305# - adjustment for following text flow for to frame anchored objects
1157// #i29778# - Because calculating the floating screen object's position
1158// (Writer fly frame or drawing object) doesn't perform a calculation on its
1159// upper frames and its anchor frame, a calculation of the upper frames in this
1160// method is no longer sensible.
1161// #i28701# - if document compatibility option 'Consider wrapping style influence
1162// on object positioning' is ON, the clip area corresponds to the one as the
1163// object doesn't follow the text flow.
1164bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove )
1165{
1166 bool bRet = true;
1167 if ( auto pVirtFlyDrawObj = dynamic_cast<const SwVirtFlyDrawObj*>(pSdrObj) )
1168 {
1169 const SwFlyFrame* pFly = pVirtFlyDrawObj->GetFlyFrame();
1170 const bool bFollowTextFlow = pFly->GetFormat()->GetFollowTextFlow().GetValue();
1171 // #i28701#
1172 const bool bConsiderWrapOnObjPos =
1174 const SwFormatVertOrient &rV = pFly->GetFormat()->GetVertOrient();
1175 if( pFly->IsFlyLayFrame() )
1176 {
1177 const SwFrame* pClip;
1178 // #i22305#
1179 // #i28701#
1180 if ( !bFollowTextFlow || bConsiderWrapOnObjPos )
1181 {
1182 pClip = pFly->GetAnchorFrame()->FindPageFrame();
1183 }
1184 else
1185 {
1186 pClip = pFly->GetAnchorFrame();
1187 }
1188
1189 rRect = pClip->getFrameArea();
1190 SwRectFnSet aRectFnSet(pClip);
1191
1192 // vertical clipping: Top and Bottom, also to PrtArea if necessary
1194 rV.GetRelationOrient() == text::RelOrientation::PRINT_AREA )
1195 {
1196 aRectFnSet.SetTop( rRect, aRectFnSet.GetPrtTop(*pClip) );
1197 aRectFnSet.SetBottom( rRect, aRectFnSet.GetPrtBottom(*pClip) );
1198 }
1199 // horizontal clipping: Top and Bottom, also to PrtArea if necessary
1200 const SwFormatHoriOrient &rH = pFly->GetFormat()->GetHoriOrient();
1202 rH.GetRelationOrient() == text::RelOrientation::PRINT_AREA )
1203 {
1204 aRectFnSet.SetLeft( rRect, aRectFnSet.GetPrtLeft(*pClip) );
1205 aRectFnSet.SetRight(rRect, aRectFnSet.GetPrtRight(*pClip));
1206 }
1207 }
1208 else if( pFly->IsFlyAtContentFrame() )
1209 {
1210 // #i18732# - consider following text flow or not
1211 // AND alignment at 'page areas'
1212 const SwFrame* pVertPosOrientFrame = pFly->GetVertPosOrientFrame();
1213 if ( !pVertPosOrientFrame )
1214 {
1215 OSL_FAIL( "::CalcClipRect(..) - frame, vertical position is oriented at, is missing .");
1216 pVertPosOrientFrame = pFly->GetAnchorFrame();
1217 }
1218
1219 if ( !bFollowTextFlow || bConsiderWrapOnObjPos )
1220 {
1221 const SwLayoutFrame* pClipFrame = pVertPosOrientFrame->FindPageFrame();
1222 if (!pClipFrame)
1223 {
1224 OSL_FAIL("!pClipFrame: "
1225 "if you can reproduce this please file a bug");
1226 return false;
1227 }
1228 rRect = bMove ? pClipFrame->GetUpper()->getFrameArea()
1229 : pClipFrame->getFrameArea();
1230 // #i26945# - consider that a table, during
1231 // its format, can exceed its upper printing area bottom.
1232 // Thus, enlarge the clip rectangle, if such a case occurred
1233 if ( pFly->GetAnchorFrame()->IsInTab() )
1234 {
1235 const SwTabFrame* pTabFrame = const_cast<SwFlyFrame*>(pFly)
1236 ->GetAnchorFrameContainingAnchPos()->FindTabFrame();
1237 SwRect aTmp( pTabFrame->getFramePrintArea() );
1238 aTmp += pTabFrame->getFrameArea().Pos();
1239 rRect.Union( aTmp );
1240 // #i43913# - consider also the cell frame
1241 const SwFrame* pCellFrame = const_cast<SwFlyFrame*>(pFly)
1242 ->GetAnchorFrameContainingAnchPos()->GetUpper();
1243 while ( pCellFrame && !pCellFrame->IsCellFrame() )
1244 {
1245 pCellFrame = pCellFrame->GetUpper();
1246 }
1247 if ( pCellFrame )
1248 {
1249 aTmp = pCellFrame->getFramePrintArea();
1250 aTmp += pCellFrame->getFrameArea().Pos();
1251 rRect.Union( aTmp );
1252 }
1253 }
1254 }
1255 else if ( rV.GetRelationOrient() == text::RelOrientation::PAGE_FRAME ||
1256 rV.GetRelationOrient() == text::RelOrientation::PAGE_PRINT_AREA )
1257 {
1258 // new class <SwEnvironmentOfAnchoredObject>
1260 aEnvOfObj( bFollowTextFlow );
1261 const SwLayoutFrame& rVertClipFrame =
1262 aEnvOfObj.GetVertEnvironmentLayoutFrame( *pVertPosOrientFrame );
1263 if ( rV.GetRelationOrient() == text::RelOrientation::PAGE_FRAME )
1264 {
1265 rRect = rVertClipFrame.getFrameArea();
1266 }
1267 else if ( rV.GetRelationOrient() == text::RelOrientation::PAGE_PRINT_AREA )
1268 {
1269 if ( rVertClipFrame.IsPageFrame() )
1270 {
1271 rRect = static_cast<const SwPageFrame&>(rVertClipFrame).PrtWithoutHeaderAndFooter();
1272 }
1273 else
1274 {
1275 rRect = rVertClipFrame.getFrameArea();
1276 }
1277 }
1278 const SwLayoutFrame* pHoriClipFrame =
1280 SwRectFnSet aRectFnSet(pFly->GetAnchorFrame());
1281 aRectFnSet.SetLeft( rRect, aRectFnSet.GetLeft(pHoriClipFrame->getFrameArea()) );
1282 aRectFnSet.SetRight(rRect, aRectFnSet.GetRight(pHoriClipFrame->getFrameArea()));
1283 }
1284 else
1285 {
1286 // #i26945#
1287 const SwFrame *pClip =
1288 const_cast<SwFlyFrame*>(pFly)->GetAnchorFrameContainingAnchPos();
1289 SwRectFnSet aRectFnSet(pClip);
1290 const SwLayoutFrame *pUp = pClip->GetUpper();
1291 const SwFrame *pCell = pUp->IsCellFrame() ? pUp : nullptr;
1292 const SwFrameType nType = bMove
1297
1298 while ( !(pUp->GetType() & nType) || pUp->IsColBodyFrame() )
1299 {
1300 pUp = pUp->GetUpper();
1301 if ( !pCell && pUp->IsCellFrame() )
1302 pCell = pUp;
1303 }
1304 if ( bMove && pUp->IsRootFrame() )
1305 {
1306 rRect = pUp->getFramePrintArea();
1307 rRect += pUp->getFrameArea().Pos();
1308 pUp = nullptr;
1309 }
1310 if ( pUp )
1311 {
1312 if ( pUp->GetType() & SwFrameType::Body )
1313 {
1314 const SwPageFrame *pPg;
1315 if ( pUp->GetUpper() != (pPg = pFly->FindPageFrame()) )
1316 pUp = pPg->FindBodyCont();
1317 if (pUp)
1318 {
1319 rRect = pUp->GetUpper()->getFrameArea();
1320 aRectFnSet.SetTop( rRect, aRectFnSet.GetPrtTop(*pUp) );
1321 aRectFnSet.SetBottom(rRect, aRectFnSet.GetPrtBottom(*pUp));
1322 }
1323 }
1324 else
1325 {
1326 if( ( pUp->GetType() & (SwFrameType::Fly | SwFrameType::Ftn ) ) &&
1327 !pUp->getFrameArea().Contains( pFly->getFrameArea().Pos() ) )
1328 {
1329 if( pUp->IsFlyFrame() )
1330 {
1331 const SwFlyFrame *pTmpFly = static_cast<const SwFlyFrame*>(pUp);
1332 while( pTmpFly->GetNextLink() )
1333 {
1334 pTmpFly = pTmpFly->GetNextLink();
1335 if( pTmpFly->getFrameArea().Contains( pFly->getFrameArea().Pos() ) )
1336 break;
1337 }
1338 pUp = pTmpFly;
1339 }
1340 else if( pUp->IsInFootnote() )
1341 {
1342 const SwFootnoteFrame *pTmp = pUp->FindFootnoteFrame();
1343 while( pTmp->GetFollow() )
1344 {
1345 pTmp = pTmp->GetFollow();
1346 if( pTmp->getFrameArea().Contains( pFly->getFrameArea().Pos() ) )
1347 break;
1348 }
1349 pUp = pTmp;
1350 }
1351 }
1352 rRect = pUp->getFramePrintArea();
1353 rRect.Pos() += pUp->getFrameArea().Pos();
1355 {
1356 rRect.Left ( pUp->GetUpper()->getFrameArea().Left() );
1357 rRect.Width( pUp->GetUpper()->getFrameArea().Width());
1358 }
1359 else if ( pUp->IsCellFrame() ) //MA_FLY_HEIGHT
1360 {
1361 const SwFrame *pTab = pUp->FindTabFrame();
1362 aRectFnSet.SetBottom( rRect, aRectFnSet.GetPrtBottom(*pTab->GetUpper()) );
1363 // expand to left and right cell border
1364 rRect.Left ( pUp->getFrameArea().Left() );
1365 rRect.Width( pUp->getFrameArea().Width() );
1366 }
1367 }
1368 }
1369 if ( pCell )
1370 {
1371 // CellFrames might also sit in unallowed areas. In this case,
1372 // the Fly is allowed to do so as well
1373 SwRect aTmp( pCell->getFramePrintArea() );
1374 aTmp += pCell->getFrameArea().Pos();
1375 rRect.Union( aTmp );
1376 }
1377 }
1378 }
1379 else
1380 {
1381 const SwFrame *pUp = pFly->GetAnchorFrame()->GetUpper();
1382 SwRectFnSet aRectFnSet(pFly->GetAnchorFrame());
1383 while( pUp->IsColumnFrame() || pUp->IsSctFrame() || pUp->IsColBodyFrame())
1384 pUp = pUp->GetUpper();
1385 rRect = pUp->getFrameArea();
1386 if( !pUp->IsBodyFrame() )
1387 {
1388 rRect += pUp->getFramePrintArea().Pos();
1389 rRect.SSize( pUp->getFramePrintArea().SSize() );
1390 if ( pUp->IsCellFrame() )
1391 {
1392 const SwFrame *pTab = pUp->FindTabFrame();
1393 aRectFnSet.SetBottom( rRect, aRectFnSet.GetPrtBottom(*pTab->GetUpper()) );
1394 }
1395 }
1396 else if ( pUp->GetUpper()->IsPageFrame() )
1397 {
1398 // Objects anchored as character may exceed right margin
1399 // of body frame:
1400 aRectFnSet.SetRight( rRect, aRectFnSet.GetRight(pUp->GetUpper()->getFrameArea()) );
1401 }
1402 tools::Long nHeight = (9*aRectFnSet.GetHeight(rRect))/10;
1403 tools::Long nTop;
1404 const SwFormat *pFormat = GetUserCall(pSdrObj)->GetFormat();
1405 const SvxULSpaceItem &rUL = pFormat->GetULSpace();
1406 if( bMove )
1407 {
1408 nTop = aRectFnSet.IsVert() ? static_cast<const SwFlyInContentFrame*>(pFly)->GetRefPoint().X() :
1409 static_cast<const SwFlyInContentFrame*>(pFly)->GetRefPoint().Y();
1410 nTop = aRectFnSet.YInc( nTop, -nHeight );
1411 tools::Long nWidth = aRectFnSet.GetWidth(pFly->getFrameArea());
1412 aRectFnSet.SetLeftAndWidth( rRect, aRectFnSet.IsVert() ?
1413 static_cast<const SwFlyInContentFrame*>(pFly)->GetRefPoint().Y() :
1414 static_cast<const SwFlyInContentFrame*>(pFly)->GetRefPoint().X(), nWidth );
1415 nHeight = 2*nHeight - rUL.GetLower() - rUL.GetUpper();
1416 }
1417 else
1418 {
1419 nTop = aRectFnSet.YInc( aRectFnSet.GetBottom(pFly->getFrameArea()),
1420 rUL.GetLower() - nHeight );
1421 nHeight = 2*nHeight - aRectFnSet.GetHeight(pFly->getFrameArea())
1422 - rUL.GetLower() - rUL.GetUpper();
1423 }
1424 aRectFnSet.SetTopAndHeight( rRect, nTop, nHeight );
1425 }
1426 }
1427 else
1428 {
1429 const SwDrawContact *pC = static_cast<const SwDrawContact*>(GetUserCall(pSdrObj));
1430 const SwFrameFormat *pFormat = pC->GetFormat();
1431 const SwFormatAnchor &rAnch = pFormat->GetAnchor();
1432 if ( RndStdIds::FLY_AS_CHAR == rAnch.GetAnchorId() )
1433 {
1434 const SwFrame* pAnchorFrame = pC->GetAnchorFrame( pSdrObj );
1435 if( !pAnchorFrame )
1436 {
1437 OSL_FAIL( "<::CalcClipRect(..)> - missing anchor frame." );
1438 const_cast<SwDrawContact*>(pC)->ConnectToLayout();
1439 pAnchorFrame = pC->GetAnchorFrame();
1440 }
1441 const SwFrame* pUp = pAnchorFrame->GetUpper();
1442 rRect = pUp->getFramePrintArea();
1443 rRect += pUp->getFrameArea().Pos();
1444 SwRectFnSet aRectFnSet(pAnchorFrame);
1445 tools::Long nHeight = (9*aRectFnSet.GetHeight(rRect))/10;
1446 tools::Long nTop;
1447 const SvxULSpaceItem &rUL = pFormat->GetULSpace();
1448 SwRect aSnapRect( pSdrObj->GetSnapRect() );
1449 tools::Long nTmpH = 0;
1450 if( bMove )
1451 {
1452 nTop = aRectFnSet.YInc( aRectFnSet.IsVert() ? pSdrObj->GetAnchorPos().X() :
1453 pSdrObj->GetAnchorPos().Y(), -nHeight );
1454 tools::Long nWidth = aRectFnSet.GetWidth(aSnapRect);
1455 aRectFnSet.SetLeftAndWidth( rRect, aRectFnSet.IsVert() ?
1456 pSdrObj->GetAnchorPos().Y() :
1457 pSdrObj->GetAnchorPos().X(), nWidth );
1458 }
1459 else
1460 {
1461 // #i26791# - value of <nTmpH> is needed to
1462 // calculate value of <nTop>.
1463 nTmpH = aRectFnSet.IsVert() ? pSdrObj->GetCurrentBoundRect().GetWidth() :
1464 pSdrObj->GetCurrentBoundRect().GetHeight();
1465 nTop = aRectFnSet.YInc( aRectFnSet.GetTop(aSnapRect),
1466 rUL.GetLower() + nTmpH - nHeight );
1467 }
1468 nHeight = 2*nHeight - nTmpH - rUL.GetLower() - rUL.GetUpper();
1469 aRectFnSet.SetTopAndHeight( rRect, nTop, nHeight );
1470 }
1471 else
1472 {
1473 // restrict clip rectangle for drawing
1474 // objects in header/footer to the page frame.
1475 // #i26791#
1476 const SwFrame* pAnchorFrame = pC->GetAnchorFrame( pSdrObj );
1477 if ( pAnchorFrame && pAnchorFrame->FindFooterOrHeader() )
1478 {
1479 // clip frame is the page frame the header/footer is on.
1480 const SwFrame* pClipFrame = pAnchorFrame->FindPageFrame();
1481 rRect = pClipFrame->getFrameArea();
1482 }
1483 else
1484 {
1485 bRet = false;
1486 }
1487 }
1488 }
1489 return bRet;
1490}
1491
1492/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@ CONSIDER_WRAP_ON_OBJECT_POSITION
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
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()
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:2682
const SwAttrSet & GetAttrSet() const
Definition: frmtool.hxx:395
bool IsLine() const
Definition: frmtool.hxx:552
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:58
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Definition: node.cxx:1230
SwNodes & GetNodes()
Definition: doc.hxx:417
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:2811
virtual void DestroyImpl() override
Definition: fly.cxx:261
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
void SetNotifyBack()
Definition: flyfrm.hxx:225
virtual void InvalidateObjPos() override
method to invalidate position of the anchored object
Definition: fly.cxx:2823
virtual SwFrameFormat & GetFrameFormat() override
Definition: fly.cxx:2830
virtual void SwClientNotify(const SwModify &rMod, const SfxHint &rHint) override
Definition: fly.cxx:668
virtual void MakeObjPos() override
method to determine position for the object and set the position at the object
Definition: fly.cxx:1745
SwFlyFrame * GetNextLink() const
Definition: flyfrm.hxx:195
bool m_bWidthClipped
Definition: flyfrm.hxx:123
bool IsLocked() const
Definition: flyfrm.hxx:213
void Lock()
Definition: flyfrm.hxx:145
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
void MakePrtArea(const SwBorderAttrs &rAttrs)
Definition: fly.cxx:1774
bool m_bFormatHeightOnly
Definition: flyfrm.hxx:126
void Unlock()
Definition: flyfrm.hxx:146
virtual const IDocumentDrawModelAccess & getIDocumentDrawModelAccess() override
Definition: fly.cxx:308
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:228
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
SwFlyFreeFrame(SwFlyFrameFormat *, SwFrame *, SwFrame *pAnchor)
Definition: flylay.cxx:55
virtual ~SwFlyFreeFrame() override
Definition: flylay.cxx:92
bool isTransformableSwFrame() const
Definition: flyfrms.hxx:131
std::unique_ptr< TransformableSwFrame > mpTransformableSwFrame
Definition: flyfrms.hxx:46
SwRect maUnclippedFrame
Definition: flyfrms.hxx:43
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:100
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:88
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:132
SwFlyLayFrame(SwFlyFrameFormat *, SwFrame *, SwFrame *pAnchor)
Definition: flylay.cxx:717
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: flylay.cxx:725
SwLayoutFrame * FindBodyCont()
Searches the first ContentFrame in BodyText below the page.
Definition: findfrm.cxx:46
const SwFootnoteFrame * GetFollow() const
Definition: ftnfrm.hxx:116
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:76
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: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
virtual void transform_translate(const Point &rOffset)
Definition: wsfrm.cxx:148
bool isFramePrintAreaValid() const
Definition: frame.hxx:168
bool isFrameAreaSizeValid() const
Definition: frame.hxx:167
virtual basegfx::B2DHomMatrix getFramePrintAreaTransformation() const
Definition: wsfrm.cxx:135
void setFrameAreaSizeValid(bool bNew)
Definition: wsfrm.cxx:92
Style of a layout element.
Definition: frmfmt.hxx:62
Base class of the Writer layout elements.
Definition: frame.hxx:315
bool IsRowFrame() const
Definition: frame.hxx:1222
bool IsCellFrame() const
Definition: frame.hxx:1226
void RemoveFly(SwFlyFrame *pToRemove)
Definition: fly.cxx:2220
bool IsInDtor() const
Definition: frame.hxx:892
void InvalidateAll()
Definition: frame.hxx:1055
SwFlyFrame * FindFlyFrame()
Definition: frame.hxx:1111
SwSectionFrame * FindSctFrame()
Definition: frame.hxx:1115
SwTabFrame * FindTabFrame()
Definition: frame.hxx:1099
SwFrame * GetNext()
Definition: frame.hxx:676
bool supportsFullDrawingLayerFillAttributeSet() const
Definition: findfrm.cxx:764
bool IsPageFrame() const
Definition: frame.hxx:1178
bool IsColLocked() const
Definition: frame.hxx:886
bool IsColumnFrame() const
Definition: frame.hxx:1182
void ColUnlock()
Definition: frame.hxx:449
SwFrameType GetType() const
Definition: frame.hxx:519
bool IsInFootnote() const
Definition: frame.hxx:949
bool IsHeaderFrame() const
Definition: frame.hxx:1190
virtual void Calc(vcl::RenderContext *pRenderContext) const
Definition: trvlfrm.cxx:1799
const SwSortedObjs * GetDrawObjs() const
Definition: frame.hxx:564
bool IsInTab() const
Definition: frame.hxx:955
static SwCache & GetCache()
Definition: frame.hxx:521
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 ColLock()
Definition: frame.hxx:448
bool IsRootFrame() const
Definition: frame.hxx:1174
bool IsFooterFrame() const
Definition: frame.hxx:1194
SwLayoutFrame * GetUpper()
Definition: frame.hxx:678
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
void SetCompletePaint() const
Definition: frame.hxx:994
bool IsFlyFrame() const
Definition: frame.hxx:1210
bool IsSctFrame() const
Definition: frame.hxx:1214
SwPageFrame * FindPageFrame()
Definition: frame.hxx:680
drawinglayer::attribute::SdrAllFillAttributesHelperPtr getSdrAllFillAttributesHelper() const
Definition: findfrm.cxx:748
SwFrame * FindFooterOrHeader()
Definition: findfrm.cxx:602
SwFootnoteFrame * FindFootnoteFrame()
Definition: frame.hxx:1107
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
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
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:1294
A page of the document layout.
Definition: pagefrm.hxx:58
void AppendFlyToPage(SwFlyFrame *pNew)
Definition: flylay.cxx:788
void PlaceFly(SwFlyFrame *pFly, SwFlyFrameFormat *pFormat)
Definition: flylay.cxx:1128
void InvalidateWordCount() const
Definition: pagefrm.hxx:397
void InvalidateFlyLayout() const
Validate, invalidate and query the Page status Layout/Content and Fly/non-Fly respectively are inspec...
Definition: pagefrm.hxx:364
void InvalidateAutoCompleteWords() const
Definition: pagefrm.hxx:393
sal_uInt16 GetPhyPageNum() const
Definition: pagefrm.hxx:204
void RemoveFlyFromPage(SwFlyFrame *pToRemove)
Definition: flylay.cxx:900
void InvalidateFlyInCnt() const
Definition: pagefrm.hxx:372
const SwSortedObjs * GetSortedObjs() const
Definition: pagefrm.hxx:132
void InvalidateSmartTags() const
Definition: pagefrm.hxx:389
bool IsEmptyPage() const
Definition: pagefrm.hxx:157
void MoveFly(SwFlyFrame *pToMove, SwPageFrame *pDest)
Definition: flylay.cxx:950
void RemoveDrawObjFromPage(SwAnchoredObject &_rToRemoveObj)
Definition: flylay.cxx:1098
void InvalidateSpelling() const
Definition: pagefrm.hxx:384
void InvalidateFlyContent() const
Definition: pagefrm.hxx:368
void AppendDrawObjToPage(SwAnchoredObject &_rNewObj)
Definition: flylay.cxx:1049
std::unique_ptr< SwSortedObjs > m_pSortedObjs
Definition: pagefrm.hxx:61
bool IsVert() const
Definition: frame.hxx:1366
tools::Long GetHeight(const SwRect &rRect) const
Definition: frame.hxx:1381
tools::Long YInc(tools::Long n1, tools::Long n2) const
Definition: frame.hxx:1424
void SetLeftAndWidth(SwRect &rRect, tools::Long nLeft, tools::Long nWidth) const
Definition: frame.hxx:1426
void SetBottom(SwRect &rRect, tools::Long nNew) const
Definition: frame.hxx:1386
void SetRight(SwRect &rRect, tools::Long nNew) const
Definition: frame.hxx:1388
tools::Long GetWidth(const SwRect &rRect) const
Definition: frame.hxx:1380
tools::Long GetTop(const SwRect &rRect) const
Definition: frame.hxx:1376
tools::Long GetPrtRight(const SwFrame &rFrame) const
Definition: frame.hxx:1411
Point GetPos(const SwRect &rRect) const
Definition: frame.hxx:1382
void SetTopAndHeight(SwRect &rRect, tools::Long nTop, tools::Long nHeight) const
Definition: frame.hxx:1427
tools::Long GetLeft(const SwRect &rRect) const
Definition: frame.hxx:1378
tools::Long GetPrtTop(const SwFrame &rFrame) const
Definition: frame.hxx:1408
tools::Long GetPrtLeft(const SwFrame &rFrame) const
Definition: frame.hxx:1410
tools::Long GetBottom(const SwRect &rRect) const
Definition: frame.hxx:1377
void SetTop(SwRect &rRect, tools::Long nNew) const
Definition: frame.hxx:1385
tools::Long GetRight(const SwRect &rRect) const
Definition: frame.hxx:1379
tools::Long GetPrtBottom(const SwFrame &rFrame) const
Definition: frame.hxx:1409
void SetLeft(SwRect &rRect, tools::Long nNew) const
Definition: frame.hxx:1387
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:82
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:206
const SdrPage * GetDrawPage() const
Definition: rootfrm.hxx:226
void SetAssertFlyPages()
Makes sure that all requested page-bound Flys find a Page.
Definition: rootfrm.hxx:277
void AssertFlyPages()
Ensures that enough pages exist, so that all page bound frames and draw objects can be placed.
Definition: pagechg.cxx:1557
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:47
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:347
RotateFlyFrame3: Helper class when you want to make your SwFrame derivate transformable.
Definition: frame.hxx:236
void adaptFrameAreasToTransformations()
Definition: wsfrm.cxx:234
void restoreFrameAreas()
Definition: wsfrm.cxx:269
const basegfx::B2DHomMatrix & getLocalFrameAreaTransformation() const
Definition: frame.hxx:255
void transform(const basegfx::B2DHomMatrix &aTransform)
Definition: wsfrm.cxx:287
const basegfx::B2DHomMatrix & getLocalFramePrintAreaTransformation() const
Definition: frame.hxx:261
void createFrameAreaTransformations(double fRotation, const basegfx::B2DPoint &rCenter)
Definition: wsfrm.cxx:214
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:1164
@ 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:3390
void RegistFlys(SwPageFrame *, const SwLayoutFrame *)
Definition: frmtool.cxx:3227
void CalcContent(SwLayoutFrame *pLay, bool bNoColl=false)
Definition: fly.cxx:1423
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(156)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(106)
#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:1019
QPRO_FUNC_TYPE nType
#define MINLAY
Definition: swtypes.hxx:62
PrepareHint
Definition: swtypes.hxx:204
Left
Center
void ClrContourCache(const SdrObject *pObj)
Definition: txtfly.cxx:137