LibreOffice Module sw (master) 1
anchoredobject.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 <txtfrm.hxx>
21#include <frmatr.hxx>
22#include <fmtornt.hxx>
23#include <doc.hxx>
26#include <fmtsrnd.hxx>
27#include <dcontact.hxx>
28#include <editeng/ulspitem.hxx>
29#include <editeng/lrspitem.hxx>
30#include <sortedobjs.hxx>
31#include <pagefrm.hxx>
32#include <layouter.hxx>
33#include <osl/diagnose.h>
34#include <flyfrms.hxx>
35
36using namespace ::com::sun::star;
37
38// --> #i28701# -
39// implementation of helper class <SwObjPositioningInProgress>
40
42 mpAnchoredObj( nullptr ),
43 // --> #i52904#
44 mbOldObjPositioningInProgress( false )
45{
46 mpAnchoredObj = ::GetUserCall( &_rSdrObj )->GetAnchoredObj( &_rSdrObj );
47 // --> #i52904#
50}
52 mpAnchoredObj( &_rAnchoredObj ),
53 // --> #i52904#
54 mbOldObjPositioningInProgress( false )
55{
56 // --> #i52904#
59}
60
62{
63 if ( mpAnchoredObj )
64 {
65 // --> #i52904#
67 }
68}
69
70
72 mpAnchorFrame( nullptr ),
73 // --> #i28701#
74 mpPageFrame( nullptr ),
75 mnLastTopOfLine( 0 ),
76 mpVertPosOrientFrame( nullptr ),
77 // --> #i28701#
78 mbPositioningInProgress( false ),
79 mbConsiderForTextWrap( false ),
80 mbPositionLocked( false ),
81 // --> #i40147#
82 mbKeepPositionLockedForSection( false ),
83 mbRestartLayoutProcess( false ),
84 // --> #i35911#
85 mbClearedEnvironment( false ),
86 // --> #i3317#
87 mbTmpConsiderWrapInfluence( false ),
88 mbObjRectWithSpacesValid( false )
89{
90}
91
93{
95 {
96 const_cast<SwLayoutFrame*>(mpVertPosOrientFrame)->ClearVertPosOrientFrameFor(this);
97 mpVertPosOrientFrame = nullptr;
98 }
99}
100
102{
104}
105
107{
108 mpDrawObj = &_rDrawObj;
109}
110
111
113{
114 mpAnchorFrame = _pNewAnchorFrame;
115
116 if ( mpAnchorFrame )
117 {
119 }
120}
121
131{
132 SwFrame* pAnchorFrameContainingAnchPos = FindAnchorCharFrame();
133 if ( !pAnchorFrameContainingAnchPos )
134 {
135 pAnchorFrameContainingAnchPos = AnchorFrame();
136 }
137
138 return pAnchorFrameContainingAnchPos;
139}
140
141
143{
144 if ( mpPageFrame == _pNewPageFrame )
145 return;
146
147 // clear member, which denotes the layout frame at which the vertical
148 // position is oriented at, if it doesn't fit to the new page frame.
149 if ( GetVertPosOrientFrame() &&
150 ( !_pNewPageFrame ||
151 _pNewPageFrame != GetVertPosOrientFrame()->FindPageFrame() ) )
152 {
154 }
155
156 // assign new page frame
157 mpPageFrame = _pNewPageFrame;
158}
159
160
162{
163 return maLastCharRect.Left() - pFrame->getFrameArea().Left();
164}
165
167{
168 return maLastCharRect.Bottom() - pFrame->getFrameArea().Top();
169}
170
172{
173 maLastCharRect.Pos().AdjustY(nDiff );
174}
175
177{
179}
180
182{
184
185 mpVertPosOrientFrame = &_rVertPosOrientFrame;
186 const_cast<SwLayoutFrame*>(mpVertPosOrientFrame)->SetVertPosOrientFrameFor(this);
187
188 // #i28701# - take over functionality of deleted method
189 // <SwFlyAtContentFrame::AssertPage()>: assure for at-paragraph and at-character
190 // an anchored object, that it is registered at the correct page frame
192}
193
194
195// #i28701# - follow-up of #i22341#
197{
198 mnLastTopOfLine += _nDiff;
199}
200
212 const bool _bCheckForParaPorInf )
213{
214 if ( !(GetAnchorFrame() &&
215 GetAnchorFrame()->IsTextFrame()) )
216 return;
217
218 const SwFormatAnchor& rAnch = GetFrameFormat().GetAnchor();
219 if ( !((rAnch.GetAnchorId() == RndStdIds::FLY_AT_CHAR) &&
220 rAnch.GetAnchorNode()) )
221 return;
222
223 // --> if requested, assure that anchor frame,
224 // which contains the anchor character, has a paragraph portion information.
225 // The paragraph portion information is needed to determine the
226 // anchor character rectangle respectively the top of the line.
227 // Thus, a format of this frame is avoided to determine the
228 // paragraph portion information.
229 // --> #i26945# - use new method <FindAnchorCharFrame()>
230 const SwTextFrame& aAnchorCharFrame = *(FindAnchorCharFrame());
231 if ( !_bCheckForParaPorInf || aAnchorCharFrame.HasPara() )
232 {
233 CheckCharRect( rAnch, aAnchorCharFrame );
234 CheckTopOfLine( rAnch, aAnchorCharFrame );
235 }
236}
237
249 const SwTextFrame& _rAnchorCharFrame )
250{
251 // determine rectangle of anchor character. If not exist, abort operation
252 SwRect aCharRect;
253 if ( !_rAnchorCharFrame.GetAutoPos( aCharRect, *_rAnch.GetContentAnchor() ) )
254 {
255 return;
256 }
257 // check, if anchor character rectangle has changed
258 if ( aCharRect == maLastCharRect )
259 return;
260
261 // check positioning and alignment for invalidation of position
262 {
263 SwRectFnSet aRectFnSet(&_rAnchorCharFrame);
264 // determine positioning and alignment
265 SwFormatVertOrient aVert( GetFrameFormat().GetVertOrient() );
266 SwFormatHoriOrient aHori( GetFrameFormat().GetHoriOrient() );
267 // check for anchor character rectangle changes for certain
268 // positionings and alignments
269 // add condition to invalidate position,
270 // if vertical aligned at frame/page area and vertical position
271 // of anchor character has changed.
272 const sal_Int16 eVertRelOrient = aVert.GetRelationOrient();
273 if ( ( aHori.GetRelationOrient() == text::RelOrientation::CHAR &&
274 aRectFnSet.GetLeft(aCharRect) != aRectFnSet.GetLeft(maLastCharRect) ) ||
275 ( eVertRelOrient == text::RelOrientation::CHAR &&
276 ( aRectFnSet.GetTop(aCharRect) != aRectFnSet.GetTop(maLastCharRect) ||
277 aRectFnSet.GetHeight(aCharRect) != aRectFnSet.GetHeight(maLastCharRect) ) ) ||
278 ( ( ( eVertRelOrient == text::RelOrientation::FRAME ) ||
279 ( eVertRelOrient == text::RelOrientation::PRINT_AREA ) ||
280 ( eVertRelOrient == text::RelOrientation::PAGE_FRAME ) ||
281 ( eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA ) ) &&
282 ( aRectFnSet.GetTop(aCharRect) != aRectFnSet.GetTop(maLastCharRect) ) ) )
283 {
284 // #i26945#, #i35911# - unlock position of
285 // anchored object, if it isn't registered at the page,
286 // where its anchor character frame is on.
287 if ( GetPageFrame() != _rAnchorCharFrame.FindPageFrame() )
288 {
290 }
292 }
293 }
294 // keep new anchor character rectangle
295 maLastCharRect = aCharRect;
296}
297
309 const SwTextFrame& _rAnchorCharFrame )
310{
311 SwTwips nTopOfLine = 0;
312 if ( !_rAnchorCharFrame.GetTopOfLine( nTopOfLine, *_rAnch.GetContentAnchor() ) )
313 return;
314
315 if ( nTopOfLine == mnLastTopOfLine )
316 return;
317
318 // check alignment for invalidation of position
319 if ( GetFrameFormat().GetVertOrient().GetRelationOrient() == text::RelOrientation::TEXT_LINE )
320 {
321 // #i26945#, #i35911# - unlock position of
322 // anchored object, if it isn't registered at the page,
323 // where its anchor character frame is on.
324 if ( GetPageFrame() != _rAnchorCharFrame.FindPageFrame() )
325 {
327 }
329 }
330 // keep new top of line value
331 mnLastTopOfLine = nTopOfLine;
332}
333
335{
337 mnLastTopOfLine = 0;
338}
339
341{
342 maRelPos = _aRelPos;
343}
344
346{
347 // default behaviour:
348 // update layout direction, the anchored object is assigned to
350}
351
360{
362 const SwFrame* pAnchorFrame = GetAnchorFrame();
363 if ( pAnchorFrame )
364 {
365 const bool bVert = pAnchorFrame->IsVertical();
366 const bool bR2L = pAnchorFrame->IsRightToLeft();
367 if ( bVert )
368 {
369 nLayoutDir = SwFrameFormat::VERT_R2L;
370 }
371 else if ( bR2L )
372 {
373 nLayoutDir = SwFrameFormat::HORI_R2L;
374 }
375 }
376 GetFrameFormat().SetLayoutDir( nLayoutDir );
377}
378
386{
388 {
389 // indicate that object has not to be considered for text wrap
390 SetConsiderForTextWrap( false );
391 // unlock position
393 // invalidate position
395 // invalidate 'background'
397 }
398}
399
408{
409 bool bRet( false );
410
411 const SwFrameFormat& rObjFormat = GetFrameFormat();
412
413 // --> #i3317# - add condition <IsTmpConsiderWrapInfluence()>
414 // --> #i55204#
415 // - correction: wrapping style influence has been considered, if condition
416 // <IsTmpConsiderWrapInfluence()> is hold, regardless of its anchor type
417 // or its wrapping style.
419 {
420 bRet = true;
421 }
423 {
424 const SwFormatAnchor& rAnchor = rObjFormat.GetAnchor();
425 if ( ((rAnchor.GetAnchorId() == RndStdIds::FLY_AT_CHAR) ||
426 (rAnchor.GetAnchorId() == RndStdIds::FLY_AT_PARA)) &&
427 rObjFormat.GetSurround().GetSurround() != css::text::WrapTextMode_THROUGH )
428 {
429 // --> #i34520# - text also wraps around anchored
430 // objects in the layer Hell - see the text formatting.
431 // Thus, it hasn't to be checked here.
432 bRet = true;
433 }
434 }
435
436 return bRet;
437}
438
445{
446 bool bRet( false );
447
448 const SwSortedObjs* pObjs = GetAnchorFrame()->GetDrawObjs();
449 if ( pObjs->size() > 1 )
450 {
451 for (SwAnchoredObject* pAnchoredObj : *pObjs)
452 {
453 if ( pAnchoredObj != this &&
454 pAnchoredObj->ConsiderObjWrapInfluenceOnObjPos() )
455 {
456 bRet = true;
457 break;
458 }
459 }
460 }
461
462 return bRet;
463}
464
466{
469 else
470 return true;
471}
472
473void SwAnchoredObject::SetConsiderForTextWrap( const bool _bConsiderForTextWrap )
474{
475 mbConsiderForTextWrap = _bConsiderForTextWrap;
476}
477
479{
481 return mbPositionLocked;
482 else
483 return false;
484}
485
487{
490 else
491 return false;
492}
493
494void SwAnchoredObject::SetRestartLayoutProcess( const bool _bRestartLayoutProcess )
495{
496 mbRestartLayoutProcess = _bRestartLayoutProcess;
497}
498
499// --> #i35911#
501{
504 else
505 return false;
506}
507void SwAnchoredObject::SetClearedEnvironment( const bool _bClearedEnvironment )
508{
509 mbClearedEnvironment = _bClearedEnvironment;
510}
511
518{
519 bool bHasClearedEnvironment( false );
520
521 // --> #i43913# - layout frame, vertical position is orient at, has to be set.
522 OSL_ENSURE( GetVertPosOrientFrame(),
523 "<SwAnchoredObject::HasClearedEnvironment()> - layout frame missing, at which the vertical position is oriented at." );
524 if ( GetVertPosOrientFrame() &&
525 GetAnchorFrame()->IsTextFrame() &&
526 !static_cast<const SwTextFrame*>(GetAnchorFrame())->IsFollow() &&
527 static_cast<const SwTextFrame*>(GetAnchorFrame())->FindPageFrame()->GetPhyPageNum() >=
528 GetPageFrame()->GetPhyPageNum() )
529 {
530 const SwFrame* pTmpFrame = GetVertPosOrientFrame()->Lower();
531 while ( pTmpFrame && pTmpFrame->IsLayoutFrame() && !pTmpFrame->IsTabFrame() )
532 {
533 pTmpFrame = static_cast<const SwLayoutFrame*>(pTmpFrame)->Lower();
534 }
535 if ( !pTmpFrame )
536 {
537 bHasClearedEnvironment = true;
538 }
539 else if ( pTmpFrame->IsTextFrame() && !pTmpFrame->GetNext() )
540 {
541 const SwTextFrame* pTmpTextFrame = static_cast<const SwTextFrame*>(pTmpFrame);
542 if ( pTmpTextFrame->IsUndersized() ||
543 ( pTmpTextFrame->GetFollow() &&
544 pTmpTextFrame->GetFollow()->GetOffset() == TextFrameIndex(0)))
545 {
546 bHasClearedEnvironment = true;
547 }
548 }
549 }
550
551 return bHasClearedEnvironment;
552}
553
560{
563 {
564 OSL_FAIL( "<SwAnchoredObject::GetObjRectWithSpaces> - cache for object rectangle inclusive spaces marked as valid, but it couldn't be. Missing invalidation of cache." );
566 }
568 {
570 const SwFrameFormat& rFormat = GetFrameFormat();
571 const SvxULSpaceItem& rUL = rFormat.GetULSpace();
572 const SvxLRSpaceItem& rLR = rFormat.GetLRSpace();
573 {
578 }
579
582 }
583
584 return maObjRectWithSpaces;
585}
586
587// --> #i68520#
589{
590 const bool bTopChanged( SetObjTop_( _nTop ) );
591 if ( bTopChanged )
592 {
594 }
595}
596
598{
599 const bool bLeftChanged( SetObjLeft_( _nLeft ) );
600 if ( bLeftChanged )
601 {
603 }
604}
605
616{
617 if(!GetAnchorFrame())
618 return;
619
621 {
622 // invalidate position of all anchored objects at anchor frame
623 if ( GetAnchorFrame()->GetDrawObjs() )
624 {
625 const SwSortedObjs* pObjs = GetAnchorFrame()->GetDrawObjs();
626 for(auto it = pObjs->begin(); it != pObjs->end(); ++it)
627 {
628 SwAnchoredObject* pAnchoredObj = *it;
629 if(pAnchoredObj->ConsiderObjWrapInfluenceOnObjPos())
631 else
632 pAnchoredObj->InvalidateObjPos();
633 }
634 }
635 // invalidate all following anchored objects on the page frame
636 if ( GetPageFrame() && GetPageFrame()->GetSortedObjs() )
637 {
638 const SwSortedObjs* pObjs = GetPageFrame()->GetSortedObjs();
639 // determine start index
640 for ( size_t i = pObjs->ListPosOf( *this ) + 1; i < pObjs->size(); ++i )
641 {
642 SwAnchoredObject* pAnchoredObj = (*pObjs)[i];
643 if ( pAnchoredObj->ConsiderObjWrapInfluenceOnObjPos() )
645 else
646 pAnchoredObj->InvalidateObjPos();
647 }
648 }
649 }
650 // update its position in the sorted object list of its anchor frame
651 AnchorFrame()->GetDrawObjs()->Update( *this );
652 // update its position in the sorted object list of its page frame
653 // note: as-character anchored object aren't registered at a page frame
654 if ( GetPageFrame() && GetPageFrame()->GetSortedObjs() &&
655 GetFrameFormat().GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR )
656 {
657 GetPageFrame()->GetSortedObjs()->Update( *this );
658 }
659}
660
666{
667 // --> Check, if page frame layout is in progress,
668 // isn't needed, because of anchored object, whose are moved forward.
669 return !PositionLocked();
670}
671
683{
684 SwPageFrame* pRetPageFrame = nullptr;
685
686 // --> #i44339# - check, if anchor frame exists.
687 if ( mpAnchorFrame )
688 {
689 // --> #i26945# - use new method <GetAnchorFrameContainingAnchPos()>
691 }
692
693 return pRetPageFrame;
694}
695
706{
707 SwTextFrame* pAnchorCharFrame( nullptr );
708
709 // --> #i44339# - check, if anchor frame exists.
710 if ( mpAnchorFrame )
711 {
712 const SwFormatAnchor& rAnch = GetFrameFormat().GetAnchor();
713 if ((rAnch.GetAnchorId() == RndStdIds::FLY_AT_CHAR) ||
714 (rAnch.GetAnchorId() == RndStdIds::FLY_AS_CHAR))
715 {
716 SwTextFrame *const pFrame(static_cast<SwTextFrame*>(AnchorFrame()));
717 TextFrameIndex const nOffset(pFrame->MapModelToViewPos(*rAnch.GetContentAnchor()));
718 pAnchorCharFrame = &pFrame->GetFrameAtOfst(nOffset);
719 }
720 else if (SwFlyFrame* pFlyFrame = DynCastFlyFrame())
721 {
722 // See if this fly is split. If so, then the anchor is also split. All anchors are
723 // empty, except the last follow.
724 if (pFlyFrame->IsFlySplitAllowed())
725 {
726 auto pFlyAtContentFrame = static_cast<SwFlyAtContentFrame*>(pFlyFrame);
727 SwFlyAtContentFrame* pFly = pFlyAtContentFrame;
728 SwTextFrame* pAnchor = static_cast<SwTextFrame*>(AnchorFrame());
729 // If we have to jump back N frames to find the master fly, then we have to step N
730 // frames from the master anchor to reach the correct follow anchor.
731 while (pFly->GetPrecede())
732 {
733 pFly = pFly->GetPrecede();
734 if (!pAnchor)
735 {
736 SAL_WARN("sw.layout", "SwAnchoredObject::FindAnchorCharFrame: fly chain "
737 "length is longer then anchor chain length");
738 break;
739 }
740 pAnchor = pAnchor->GetFollow();
741 }
742 if (pAnchor)
743 {
744 pAnchorCharFrame = pAnchor;
745 }
746 }
747 }
748 }
749
750 return pAnchorCharFrame;
751}
752
760{
762}
763
765{
766 OSL_ASSERT(pFrameFormat);
767 const bool bDisablePositioning = pFrameFormat->getIDocumentSettingAccess().get(DocumentSettingId::DISABLE_OFF_PAGE_POSITIONING);
768 const bool bIsWrapThrough = pFrameFormat->GetSurround().GetSurround() == text::WrapTextMode::WrapTextMode_THROUGH;
769
770 return bDisablePositioning && bIsWrapThrough;
771}
772
773// --> #i3317#
774void SwAnchoredObject::SetTmpConsiderWrapInfluence( const bool _bTmpConsiderWrapInfluence )
775{
776 mbTmpConsiderWrapInfluence = _bTmpConsiderWrapInfluence;
777 // --> #i35911#
779 {
781 *this );
782 }
783}
784
786{
788 mbClearedEnvironment = false;
789 SetClearedEnvironment( false );
791 *this );
792}
794{
795 const SwSortedObjs* pObjs = GetAnchorFrame()->GetDrawObjs();
796 if ( pObjs->size() > 1 )
797 {
798 for (SwAnchoredObject* pAnchoredObj : *pObjs)
799 {
800 if ( pAnchoredObj != this )
801 {
802 pAnchoredObj->SetTmpConsiderWrapInfluence( true/*bTmpConsiderWrapInfluence*/ );
803 }
804 }
805 }
806}
807
818{
819 bool bOverlapsPrevColumn( false );
820
822 {
823 const SwFrame* pColFrame = mpAnchorFrame->FindColFrame();
824 if ( pColFrame && pColFrame->GetPrev() )
825 {
826 const SwFrame* pTmpColFrame = pColFrame->GetPrev();
827 SwRect aChkRect;
828 while ( pTmpColFrame )
829 {
830 aChkRect.Union( pTmpColFrame->getFrameArea() );
831 pTmpColFrame = pTmpColFrame->GetPrev();
832 }
833 bOverlapsPrevColumn = GetObjRect().Overlaps( aChkRect );
834 }
835 }
836
837 return bOverlapsPrevColumn;
838}
839
847{
848 Point aRelPos;
849
850 assert(GetAnchorFrame());
851 aRelPos = GetObjRect().Pos();
852 aRelPos -= GetAnchorFrame()->getFrameArea().Pos();
853
854 return aRelPos;
855}
856
869 bool& _obRelToTableCell ) const
870{
871 Point aRelPos;
872 _obRelToTableCell = false;
873
874 assert(GetAnchorFrame());
875 assert(GetAnchorFrame()->FindPageFrame());
876
877 aRelPos = GetObjRect().Pos();
878 // --> #i33818# - search for cell frame, if object has to
879 // follow the text flow.
880 const SwFrame* pFrame( nullptr );
881 if ( _bFollowTextFlow && !GetAnchorFrame()->IsPageFrame() )
882 {
883 pFrame = GetAnchorFrame()->GetUpper();
884 while ( !pFrame->IsCellFrame() && !pFrame->IsPageFrame() )
885 {
886 pFrame = pFrame->GetUpper();
887 }
888 }
889 else
890 {
891 pFrame = GetAnchorFrame()->FindPageFrame();
892 }
893 if ( pFrame->IsCellFrame() )
894 {
895 aRelPos -= pFrame->getFrameArea().Pos() + pFrame->getFramePrintArea().Pos();
896 _obRelToTableCell = true;
897 }
898 else
899 {
900 aRelPos -= pFrame->getFrameArea().Pos();
901 }
902
903 return aRelPos;
904}
905
913{
914 Point aRelPos = GetObjRect().Pos();
915 aRelPos -= GetLastCharRect().Pos();
916
917 return aRelPos;
918}
919
927{
928 Point aRelPos = GetObjRect().Pos();
929 aRelPos.AdjustY( -(GetLastTopOfLine()) );
930
931 return aRelPos;
932}
933
935{
936 return nullptr;
937}
938
940{
941 return nullptr;
942}
943
944/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@ CONSIDER_WRAP_ON_OBJECT_POSITION
const SwFrame * mpAnchorFrame
o3tl::strong_int< sal_Int32, struct Tag_TextFrameIndex > TextFrameIndex
Denotes a character index in a text frame at a layout level, after extent mapping from a text node at...
virtual bool IsVisibleLayerId(SdrLayerID _nLayerId) const =0
method to determine, if a layer ID belongs to the visible ones.
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
tools::Long AdjustY(tools::Long nVertMove)
tools::Long GetRight() const
tools::Long GetLeft() const
sal_uInt16 GetUpper() const
sal_uInt16 GetLower() const
wrapper class for the positioning of Writer fly frames and drawing objects
void SetTmpConsiderWrapInfluenceOfOtherObjs()
method to apply temporary consideration of wrapping style influence to the anchored objects,...
void ClearTmpConsiderWrapInfluence()
const SwFrame * GetAnchorFrame() const
bool ConsiderForTextWrap() const
void CheckTopOfLine(const SwFormatAnchor &_rAnch, const SwTextFrame &_rAnchorCharFrame)
check top of line
void SetObjTop(const SwTwips _nTop)
bool InvalidationOfPosAllowed() const
method to determine, if invalidation of position is allowed
bool PositionLocked() const
Point GetRelPosToLine() const
method to determine position of anchored object relative to top of line
void SetClearedEnvironment(const bool _bClearedEnvironment)
SwTwips GetRelCharY(const SwFrame *pFrame) const
void ChgAnchorFrame(SwFrame *_pNewAnchorFrame)
SwTextFrame * FindAnchorCharFrame()
get frame, which contains the anchor character, if the object is anchored at-character or as-characte...
virtual SwRect GetObjBoundRect() const =0
void CheckCharRectAndTopOfLine(const bool _bCheckForParaPorInf)
check anchor character rectangle and top of line
void SetPageFrame(SwPageFrame *_pNewPageFrame)
virtual void ObjectAttachedToAnchorFrame()
method to indicate, that anchored object is attached to an anchor frame
virtual void NotifyBackground(SwPageFrame *_pPageFrame, const SwRect &_rRect, PrepareHint _eHint)=0
method to trigger notification of 'background'
rtl::Reference< SdrObject > mpDrawObj
void AddLastCharY(tools::Long nDiff)
void ResetLastCharRectHeight()
SwFrame * AnchorFrame()
void AddLastTopOfLineY(SwTwips _nDiff)
const SwLayoutFrame * mpVertPosOrientFrame
virtual void RegisterAtCorrectPage()=0
method to assure that anchored object is registered at the correct page frame
void SetVertPosOrientFrame(const SwLayoutFrame &_rVertPosOrientFrame)
SwFrame * GetAnchorFrameContainingAnchPos()
determine anchor frame containing the anchor position
virtual bool SetObjLeft_(const SwTwips _nLeft)=0
void ClearCharRectAndTopOfLine()
reset members <maLastCharRect> and <mnLastTopOfLine>
const SwLayoutFrame * GetVertPosOrientFrame() const
void SetTmpConsiderWrapInfluence(const bool _bTmpConsiderWrapInfluence)
void InvalidateObjPosForConsiderWrapInfluence()
method to perform necessary invalidations for the positioning of objects, for whose the wrapping styl...
void SetCurrRelPos(Point _aRelPos)
void SetObjLeft(const SwTwips _nLeft)
bool RestartLayoutProcess() const
bool OverlapsPrevColumn() const
method to determine, if the anchored object is overlapping with a previous column
void SetDrawObj(SdrObject &_rDrawObj)
bool ConsiderObjWrapInfluenceOnObjPos() const
method to determine, if wrapping style influence of the anchored object has to be considered on the o...
virtual ~SwAnchoredObject()
virtual SwFrameFormat & GetFrameFormat()=0
SwTwips GetRelCharX(const SwFrame *pFrame) const
virtual bool SetObjTop_(const SwTwips _nTop)=0
Point GetRelPosToChar() const
method to determine position of anchored object relative to anchor character
SwPageFrame * GetPageFrame()
SwPageFrame * FindPageFrameOfAnchor()
method to determine the page frame, on which the 'anchor' of the given anchored object is.
bool HasClearedEnvironment() const
method to determine, if due to anchored object size and wrapping style, its layout environment is cle...
bool IsTmpConsiderWrapInfluence() const
void ClearVertPosOrientFrame()
const SwRect & GetLastCharRect() const
void CheckCharRect(const SwFormatAnchor &_rAnch, const SwTextFrame &_rAnchorCharFrame)
check anchor character rectangle
void SetConsiderForTextWrap(const bool _bConsiderForTextWrap)
const SwRect & GetObjRectWithSpaces() const
method to determine object area inclusive its spacing
SwTwips GetLastTopOfLine() const
virtual void InvalidateObjPos()=0
method to invalidate position of the anchored object
virtual const SwFlyFrame * DynCastFlyFrame() const
Point GetRelPosToPageFrame(const bool _bFollowTextFlow, bool &_obRelToTableCell) const
method to determine position of anchored object relative to page frame
virtual void UpdateLayoutDir()
method update layout direction the layout direction, the anchored object is assigned to
void InvalidateObjRectWithSpaces() const
static bool IsDraggingOffPageAllowed(const SwFrameFormat *)
method to determine if dragging objects off page is allowed
SwPageFrame * mpPageFrame
bool ConsiderObjWrapInfluenceOfOtherObjs() const
method to determine, if other anchored objects, also attached at to the anchor frame,...
const SdrObject * GetDrawObj() const
void SetPositioningInProgress(const bool _bPosInProgress)
virtual SwRect GetObjRect() const =0
virtual bool IsFormatPossible() const
method to determine, if a format on the anchored object is possible
Point GetRelPosToAnchorFrame() const
method to determine position of anchored object relative to anchor frame
void UpdateObjInSortedList()
method to update anchored object in the <SwSortedObjs> lists
SwFrame * mpAnchorFrame
Frame the object is anchored at.
void SetRestartLayoutProcess(const bool _bRestartLayoutProcess)
bool IsPositioningInProgress() const
is positioning of anchored object in progress
bool ClearedEnvironment() const
virtual const SwAnchoredObject * GetAnchoredObj(const SdrObject *_pSdrObj) const =0
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:169
Flys that are anchored to content (at-para, at-char) but not in content (as-char).
Definition: flyfrms.hxx:163
const SwFlyAtContentFrame * GetPrecede() const
Definition: flycnt.cxx:1677
general base class for all free-flowing frames
Definition: flyfrm.hxx:79
FlyAnchors.
Definition: fmtanchr.hxx:37
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:67
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:74
SwNode * GetAnchorNode() const
Definition: atrfrm.cxx:1614
Defines the horizontal position of a fly frame.
Definition: fmtornt.hxx:73
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:95
css::text::WrapTextMode GetSurround() const
Definition: fmtsrnd.hxx:51
Defines the vertical position of a fly frame.
Definition: fmtornt.hxx:37
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:58
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:139
const SvxLRSpaceItem & GetLRSpace(bool=true) const
Definition: frmatr.hxx:98
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:88
const SwFormatSurround & GetSurround(bool=true) const
Definition: fmtsrnd.hxx:66
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
const SwRect & getFramePrintArea() const
Definition: frame.hxx:180
Style of a layout element.
Definition: frmfmt.hxx:72
virtual void SetLayoutDir(const SwFrameFormat::tLayoutDir _eLayoutDir)
Definition: atrfrm.cxx:2872
Base class of the Writer layout elements.
Definition: frame.hxx:315
bool IsCellFrame() const
Definition: frame.hxx:1232
bool IsTextFrame() const
Definition: frame.hxx:1240
SwFrame * GetNext()
Definition: frame.hxx:682
bool IsPageFrame() const
Definition: frame.hxx:1184
bool IsTabFrame() const
Definition: frame.hxx:1224
const SwSortedObjs * GetDrawObjs() const
Definition: frame.hxx:568
bool IsRightToLeft() const
Definition: frame.hxx:993
SwLayoutFrame * GetUpper()
Definition: frame.hxx:684
bool IsVertical() const
Definition: frame.hxx:979
SwFrame * GetPrev()
Definition: frame.hxx:683
SwFrame * FindColFrame()
Definition: findfrm.cxx:615
SwPageFrame * FindPageFrame()
Definition: frame.hxx:686
bool IsLayoutFrame() const
Definition: frame.hxx:1176
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame.
Definition: layfrm.hxx:36
const SwFrame * Lower() const
Definition: layfrm.hxx:101
static void RemoveObjForTmpConsiderWrapInfluence(const SwDoc &_rDoc, SwAnchoredObject &_rAnchoredObj)
Definition: layouter.cxx:406
static void InsertObjForTmpConsiderWrapInfluence(const SwDoc &_rDoc, SwAnchoredObject &_rAnchoredObj)
Definition: layouter.cxx:388
SwObjPositioningInProgress(SdrObject &_rSdrObj)
SwAnchoredObject * mpAnchoredObj
A page of the document layout.
Definition: pagefrm.hxx:60
const SwSortedObjs * GetSortedObjs() const
Definition: pagefrm.hxx:136
tools::Long GetHeight(const SwRect &rRect) const
Definition: frame.hxx:1387
tools::Long GetTop(const SwRect &rRect) const
Definition: frame.hxx:1382
tools::Long GetLeft(const SwRect &rRect) const
Definition: frame.hxx:1384
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
void Height(tools::Long nNew)
Definition: swrect.hxx:193
SwRect & Union(const SwRect &rRect)
Definition: swrect.cxx:35
void Top(const tools::Long nTop)
Definition: swrect.hxx:206
void Clear()
Definition: swrect.hxx:308
void Bottom(const tools::Long nBottom)
Definition: swrect.hxx:211
void Pos(const Point &rNew)
Definition: swrect.hxx:171
void AddHeight(const tools::Long nAdd)
Definition: swrect.cxx:124
bool Overlaps(const SwRect &rRect) const
Definition: swrect.hxx:374
void AddWidth(const tools::Long nAdd)
Definition: swrect.cxx:123
void Left(const tools::Long nLeft)
Definition: swrect.hxx:197
class for collecting anchored objects
Definition: sortedobjs.hxx:49
const_iterator begin() const
Definition: sortedobjs.hxx:66
const_iterator end() const
Definition: sortedobjs.hxx:68
size_t size() const
Definition: sortedobjs.cxx:43
void Update(SwAnchoredObject &_rAnchoredObj)
method to update the position of the given anchored object in the sorted list
Definition: sortedobjs.cxx:253
size_t ListPosOf(const SwAnchoredObject &_rAnchoredObj) const
Position of object <_rAnchoredObj> in sorted list.
Definition: sortedobjs.cxx:277
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:168
SwTextFrame * GetFollow()
Definition: txtfrm.hxx:889
TextFrameIndex GetOffset() const
Definition: txtfrm.hxx:453
bool HasPara() const
Definition: txtfrm.hxx:853
bool GetAutoPos(SwRect &, const SwPosition &) const
A slimmer version of GetCharRect for autopositioning Frames.
Definition: frmcrsr.cxx:366
bool GetTopOfLine(SwTwips &_onTopOfLine, const SwPosition &_rPos) const
Determine top of line for given position in the text frame.
Definition: frmcrsr.cxx:453
TextFrameIndex MapModelToViewPos(SwPosition const &rPos) const
Definition: txtfrm.cxx:1354
SwTextFrame & GetFrameAtOfst(TextFrameIndex nOfst)
Definition: frmcrsr.cxx:143
SwContact * GetUserCall(const SdrObject *pObj)
Returns the UserCall if applicable from the group object.
Definition: dcontact.cxx:172
#define SAL_WARN(area, stream)
size
int i
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
long Long
tools::Long SwTwips
Definition: swtypes.hxx:51