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
35using namespace ::com::sun::star;
36
37// --> #i28701# -
38// implementation of helper class <SwObjPositioningInProgress>
39
41 mpAnchoredObj( nullptr ),
42 // --> #i52904#
43 mbOldObjPositioningInProgress( false )
44{
45 mpAnchoredObj = ::GetUserCall( &_rSdrObj )->GetAnchoredObj( &_rSdrObj );
46 // --> #i52904#
49}
51 mpAnchoredObj( &_rAnchoredObj ),
52 // --> #i52904#
53 mbOldObjPositioningInProgress( false )
54{
55 // --> #i52904#
58}
59
61{
62 if ( mpAnchoredObj )
63 {
64 // --> #i52904#
66 }
67}
68
69
71 mpAnchorFrame( nullptr ),
72 // --> #i28701#
73 mpPageFrame( nullptr ),
74 mnLastTopOfLine( 0 ),
75 mpVertPosOrientFrame( nullptr ),
76 // --> #i28701#
77 mbPositioningInProgress( false ),
78 mbConsiderForTextWrap( false ),
79 mbPositionLocked( false ),
80 // --> #i40147#
81 mbKeepPositionLockedForSection( false ),
82 mbRestartLayoutProcess( false ),
83 // --> #i35911#
84 mbClearedEnvironment( false ),
85 // --> #i3317#
86 mbTmpConsiderWrapInfluence( false ),
87 mbObjRectWithSpacesValid( false )
88{
89}
90
92{
94 {
95 const_cast<SwLayoutFrame*>(mpVertPosOrientFrame)->ClearVertPosOrientFrameFor(this);
96 mpVertPosOrientFrame = nullptr;
97 }
98}
99
101{
103}
104
106{
107 mpDrawObj = &_rDrawObj;
108}
109
110
112{
113 mpAnchorFrame = _pNewAnchorFrame;
114
115 if ( mpAnchorFrame )
116 {
118 }
119}
120
130{
131 SwFrame* pAnchorFrameContainingAnchPos = FindAnchorCharFrame();
132 if ( !pAnchorFrameContainingAnchPos )
133 {
134 pAnchorFrameContainingAnchPos = AnchorFrame();
135 }
136
137 return pAnchorFrameContainingAnchPos;
138}
139
140
142{
143 if ( mpPageFrame == _pNewPageFrame )
144 return;
145
146 // clear member, which denotes the layout frame at which the vertical
147 // position is oriented at, if it doesn't fit to the new page frame.
148 if ( GetVertPosOrientFrame() &&
149 ( !_pNewPageFrame ||
150 _pNewPageFrame != GetVertPosOrientFrame()->FindPageFrame() ) )
151 {
153 }
154
155 // assign new page frame
156 mpPageFrame = _pNewPageFrame;
157}
158
159
161{
162 return maLastCharRect.Left() - pFrame->getFrameArea().Left();
163}
164
166{
167 return maLastCharRect.Bottom() - pFrame->getFrameArea().Top();
168}
169
171{
172 maLastCharRect.Pos().AdjustY(nDiff );
173}
174
176{
178}
179
181{
183
184 mpVertPosOrientFrame = &_rVertPosOrientFrame;
185 const_cast<SwLayoutFrame*>(mpVertPosOrientFrame)->SetVertPosOrientFrameFor(this);
186
187 // #i28701# - take over functionality of deleted method
188 // <SwFlyAtContentFrame::AssertPage()>: assure for at-paragraph and at-character
189 // an anchored object, that it is registered at the correct page frame
191}
192
193
194// #i28701# - follow-up of #i22341#
196{
197 mnLastTopOfLine += _nDiff;
198}
199
211 const bool _bCheckForParaPorInf )
212{
213 if ( !(GetAnchorFrame() &&
214 GetAnchorFrame()->IsTextFrame()) )
215 return;
216
217 const SwFormatAnchor& rAnch = GetFrameFormat().GetAnchor();
218 if ( !((rAnch.GetAnchorId() == RndStdIds::FLY_AT_CHAR) &&
219 rAnch.GetContentAnchor()) )
220 return;
221
222 // --> if requested, assure that anchor frame,
223 // which contains the anchor character, has a paragraph portion information.
224 // The paragraph portion information is needed to determine the
225 // anchor character rectangle respectively the top of the line.
226 // Thus, a format of this frame is avoided to determine the
227 // paragraph portion information.
228 // --> #i26945# - use new method <FindAnchorCharFrame()>
229 const SwTextFrame& aAnchorCharFrame = *(FindAnchorCharFrame());
230 if ( !_bCheckForParaPorInf || aAnchorCharFrame.HasPara() )
231 {
232 CheckCharRect( rAnch, aAnchorCharFrame );
233 CheckTopOfLine( rAnch, aAnchorCharFrame );
234 }
235}
236
248 const SwTextFrame& _rAnchorCharFrame )
249{
250 // determine rectangle of anchor character. If not exist, abort operation
251 SwRect aCharRect;
252 if ( !_rAnchorCharFrame.GetAutoPos( aCharRect, *_rAnch.GetContentAnchor() ) )
253 {
254 return;
255 }
256 // check, if anchor character rectangle has changed
257 if ( aCharRect == maLastCharRect )
258 return;
259
260 // check positioning and alignment for invalidation of position
261 {
262 SwRectFnSet aRectFnSet(&_rAnchorCharFrame);
263 // determine positioning and alignment
264 SwFormatVertOrient aVert( GetFrameFormat().GetVertOrient() );
265 SwFormatHoriOrient aHori( GetFrameFormat().GetHoriOrient() );
266 // check for anchor character rectangle changes for certain
267 // positionings and alignments
268 // add condition to invalidate position,
269 // if vertical aligned at frame/page area and vertical position
270 // of anchor character has changed.
271 const sal_Int16 eVertRelOrient = aVert.GetRelationOrient();
272 if ( ( aHori.GetRelationOrient() == text::RelOrientation::CHAR &&
273 aRectFnSet.GetLeft(aCharRect) != aRectFnSet.GetLeft(maLastCharRect) ) ||
274 ( eVertRelOrient == text::RelOrientation::CHAR &&
275 ( aRectFnSet.GetTop(aCharRect) != aRectFnSet.GetTop(maLastCharRect) ||
276 aRectFnSet.GetHeight(aCharRect) != aRectFnSet.GetHeight(maLastCharRect) ) ) ||
277 ( ( ( eVertRelOrient == text::RelOrientation::FRAME ) ||
278 ( eVertRelOrient == text::RelOrientation::PRINT_AREA ) ||
279 ( eVertRelOrient == text::RelOrientation::PAGE_FRAME ) ||
280 ( eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA ) ) &&
281 ( aRectFnSet.GetTop(aCharRect) != aRectFnSet.GetTop(maLastCharRect) ) ) )
282 {
283 // #i26945#, #i35911# - unlock position of
284 // anchored object, if it isn't registered at the page,
285 // where its anchor character frame is on.
286 if ( GetPageFrame() != _rAnchorCharFrame.FindPageFrame() )
287 {
289 }
291 }
292 }
293 // keep new anchor character rectangle
294 maLastCharRect = aCharRect;
295}
296
308 const SwTextFrame& _rAnchorCharFrame )
309{
310 SwTwips nTopOfLine = 0;
311 if ( !_rAnchorCharFrame.GetTopOfLine( nTopOfLine, *_rAnch.GetContentAnchor() ) )
312 return;
313
314 if ( nTopOfLine == mnLastTopOfLine )
315 return;
316
317 // check alignment for invalidation of position
318 if ( GetFrameFormat().GetVertOrient().GetRelationOrient() == text::RelOrientation::TEXT_LINE )
319 {
320 // #i26945#, #i35911# - unlock position of
321 // anchored object, if it isn't registered at the page,
322 // where its anchor character frame is on.
323 if ( GetPageFrame() != _rAnchorCharFrame.FindPageFrame() )
324 {
326 }
328 }
329 // keep new top of line value
330 mnLastTopOfLine = nTopOfLine;
331}
332
334{
336 mnLastTopOfLine = 0;
337}
338
340{
341 maRelPos = _aRelPos;
342}
343
345{
346 // default behaviour:
347 // update layout direction, the anchored object is assigned to
349}
350
359{
361 const SwFrame* pAnchorFrame = GetAnchorFrame();
362 if ( pAnchorFrame )
363 {
364 const bool bVert = pAnchorFrame->IsVertical();
365 const bool bR2L = pAnchorFrame->IsRightToLeft();
366 if ( bVert )
367 {
368 nLayoutDir = SwFrameFormat::VERT_R2L;
369 }
370 else if ( bR2L )
371 {
372 nLayoutDir = SwFrameFormat::HORI_R2L;
373 }
374 }
375 GetFrameFormat().SetLayoutDir( nLayoutDir );
376}
377
385{
387 {
388 // indicate that object has not to be considered for text wrap
389 SetConsiderForTextWrap( false );
390 // unlock position
392 // invalidate position
394 // invalidate 'background'
396 }
397}
398
407{
408 bool bRet( false );
409
410 const SwFrameFormat& rObjFormat = GetFrameFormat();
411
412 // --> #i3317# - add condition <IsTmpConsiderWrapInfluence()>
413 // --> #i55204#
414 // - correction: wrapping style influence has been considered, if condition
415 // <IsTmpConsiderWrapInfluence()> is hold, regardless of its anchor type
416 // or its wrapping style.
418 {
419 bRet = true;
420 }
422 {
423 const SwFormatAnchor& rAnchor = rObjFormat.GetAnchor();
424 if ( ((rAnchor.GetAnchorId() == RndStdIds::FLY_AT_CHAR) ||
425 (rAnchor.GetAnchorId() == RndStdIds::FLY_AT_PARA)) &&
426 rObjFormat.GetSurround().GetSurround() != css::text::WrapTextMode_THROUGH )
427 {
428 // --> #i34520# - text also wraps around anchored
429 // objects in the layer Hell - see the text formatting.
430 // Thus, it hasn't to be checked here.
431 bRet = true;
432 }
433 }
434
435 return bRet;
436}
437
444{
445 bool bRet( false );
446
447 const SwSortedObjs* pObjs = GetAnchorFrame()->GetDrawObjs();
448 if ( pObjs->size() > 1 )
449 {
450 for (SwAnchoredObject* pAnchoredObj : *pObjs)
451 {
452 if ( pAnchoredObj != this &&
453 pAnchoredObj->ConsiderObjWrapInfluenceOnObjPos() )
454 {
455 bRet = true;
456 break;
457 }
458 }
459 }
460
461 return bRet;
462}
463
465{
468 else
469 return true;
470}
471
472void SwAnchoredObject::SetConsiderForTextWrap( const bool _bConsiderForTextWrap )
473{
474 mbConsiderForTextWrap = _bConsiderForTextWrap;
475}
476
478{
480 return mbPositionLocked;
481 else
482 return false;
483}
484
486{
489 else
490 return false;
491}
492
493void SwAnchoredObject::SetRestartLayoutProcess( const bool _bRestartLayoutProcess )
494{
495 mbRestartLayoutProcess = _bRestartLayoutProcess;
496}
497
498// --> #i35911#
500{
503 else
504 return false;
505}
506void SwAnchoredObject::SetClearedEnvironment( const bool _bClearedEnvironment )
507{
508 mbClearedEnvironment = _bClearedEnvironment;
509}
510
517{
518 bool bHasClearedEnvironment( false );
519
520 // --> #i43913# - layout frame, vertical position is orient at, has to be set.
521 OSL_ENSURE( GetVertPosOrientFrame(),
522 "<SwAnchoredObject::HasClearedEnvironment()> - layout frame missing, at which the vertical position is oriented at." );
523 if ( GetVertPosOrientFrame() &&
524 GetAnchorFrame()->IsTextFrame() &&
525 !static_cast<const SwTextFrame*>(GetAnchorFrame())->IsFollow() &&
526 static_cast<const SwTextFrame*>(GetAnchorFrame())->FindPageFrame()->GetPhyPageNum() >=
527 GetPageFrame()->GetPhyPageNum() )
528 {
529 const SwFrame* pTmpFrame = GetVertPosOrientFrame()->Lower();
530 while ( pTmpFrame && pTmpFrame->IsLayoutFrame() && !pTmpFrame->IsTabFrame() )
531 {
532 pTmpFrame = static_cast<const SwLayoutFrame*>(pTmpFrame)->Lower();
533 }
534 if ( !pTmpFrame )
535 {
536 bHasClearedEnvironment = true;
537 }
538 else if ( pTmpFrame->IsTextFrame() && !pTmpFrame->GetNext() )
539 {
540 const SwTextFrame* pTmpTextFrame = static_cast<const SwTextFrame*>(pTmpFrame);
541 if ( pTmpTextFrame->IsUndersized() ||
542 ( pTmpTextFrame->GetFollow() &&
543 pTmpTextFrame->GetFollow()->GetOffset() == TextFrameIndex(0)))
544 {
545 bHasClearedEnvironment = true;
546 }
547 }
548 }
549
550 return bHasClearedEnvironment;
551}
552
559{
562 {
563 OSL_FAIL( "<SwAnchoredObject::GetObjRectWithSpaces> - cache for object rectangle inclusive spaces marked as valid, but it couldn't be. Missing invalidation of cache." );
565 }
567 {
569 const SwFrameFormat& rFormat = GetFrameFormat();
570 const SvxULSpaceItem& rUL = rFormat.GetULSpace();
571 const SvxLRSpaceItem& rLR = rFormat.GetLRSpace();
572 {
577 }
578
581 }
582
583 return maObjRectWithSpaces;
584}
585
586// --> #i68520#
588{
589 const bool bTopChanged( SetObjTop_( _nTop ) );
590 if ( bTopChanged )
591 {
593 }
594}
595
597{
598 const bool bLeftChanged( SetObjLeft_( _nLeft ) );
599 if ( bLeftChanged )
600 {
602 }
603}
604
615{
616 if(!GetAnchorFrame())
617 return;
618
620 {
621 // invalidate position of all anchored objects at anchor frame
622 if ( GetAnchorFrame()->GetDrawObjs() )
623 {
624 const SwSortedObjs* pObjs = GetAnchorFrame()->GetDrawObjs();
625 for(auto it = pObjs->begin(); it != pObjs->end(); ++it)
626 {
627 SwAnchoredObject* pAnchoredObj = *it;
628 if(pAnchoredObj->ConsiderObjWrapInfluenceOnObjPos())
630 else
631 pAnchoredObj->InvalidateObjPos();
632 }
633 }
634 // invalidate all following anchored objects on the page frame
635 if ( GetPageFrame() && GetPageFrame()->GetSortedObjs() )
636 {
637 const SwSortedObjs* pObjs = GetPageFrame()->GetSortedObjs();
638 // determine start index
639 for ( size_t i = pObjs->ListPosOf( *this ) + 1; i < pObjs->size(); ++i )
640 {
641 SwAnchoredObject* pAnchoredObj = (*pObjs)[i];
642 if ( pAnchoredObj->ConsiderObjWrapInfluenceOnObjPos() )
644 else
645 pAnchoredObj->InvalidateObjPos();
646 }
647 }
648 }
649 // update its position in the sorted object list of its anchor frame
650 AnchorFrame()->GetDrawObjs()->Update( *this );
651 // update its position in the sorted object list of its page frame
652 // note: as-character anchored object aren't registered at a page frame
653 if ( GetPageFrame() && GetPageFrame()->GetSortedObjs() &&
654 GetFrameFormat().GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR )
655 {
656 GetPageFrame()->GetSortedObjs()->Update( *this );
657 }
658}
659
665{
666 // --> Check, if page frame layout is in progress,
667 // isn't needed, because of anchored object, whose are moved forward.
668 return !PositionLocked();
669}
670
682{
683 SwPageFrame* pRetPageFrame = nullptr;
684
685 // --> #i44339# - check, if anchor frame exists.
686 if ( mpAnchorFrame )
687 {
688 // --> #i26945# - use new method <GetAnchorFrameContainingAnchPos()>
690 }
691
692 return pRetPageFrame;
693}
694
705{
706 SwTextFrame* pAnchorCharFrame( nullptr );
707
708 // --> #i44339# - check, if anchor frame exists.
709 if ( mpAnchorFrame )
710 {
711 const SwFormatAnchor& rAnch = GetFrameFormat().GetAnchor();
712 if ((rAnch.GetAnchorId() == RndStdIds::FLY_AT_CHAR) ||
713 (rAnch.GetAnchorId() == RndStdIds::FLY_AS_CHAR))
714 {
715 SwTextFrame *const pFrame(static_cast<SwTextFrame*>(AnchorFrame()));
716 TextFrameIndex const nOffset(pFrame->MapModelToViewPos(*rAnch.GetContentAnchor()));
717 pAnchorCharFrame = &pFrame->GetFrameAtOfst(nOffset);
718 }
719 }
720
721 return pAnchorCharFrame;
722}
723
731{
733}
734
736{
737 OSL_ASSERT(pFrameFormat);
738 const bool bDisablePositioning = pFrameFormat->getIDocumentSettingAccess().get(DocumentSettingId::DISABLE_OFF_PAGE_POSITIONING);
739 const bool bIsWrapThrough = pFrameFormat->GetSurround().GetSurround() == text::WrapTextMode::WrapTextMode_THROUGH;
740
741 return bDisablePositioning && bIsWrapThrough;
742}
743
744// --> #i3317#
745void SwAnchoredObject::SetTmpConsiderWrapInfluence( const bool _bTmpConsiderWrapInfluence )
746{
747 mbTmpConsiderWrapInfluence = _bTmpConsiderWrapInfluence;
748 // --> #i35911#
750 {
752 *this );
753 }
754}
755
757{
759 mbClearedEnvironment = false;
760 SetClearedEnvironment( false );
762 *this );
763}
765{
766 const SwSortedObjs* pObjs = GetAnchorFrame()->GetDrawObjs();
767 if ( pObjs->size() > 1 )
768 {
769 for (SwAnchoredObject* pAnchoredObj : *pObjs)
770 {
771 if ( pAnchoredObj != this )
772 {
773 pAnchoredObj->SetTmpConsiderWrapInfluence( true/*bTmpConsiderWrapInfluence*/ );
774 }
775 }
776 }
777}
778
789{
790 bool bOverlapsPrevColumn( false );
791
793 {
794 const SwFrame* pColFrame = mpAnchorFrame->FindColFrame();
795 if ( pColFrame && pColFrame->GetPrev() )
796 {
797 const SwFrame* pTmpColFrame = pColFrame->GetPrev();
798 SwRect aChkRect;
799 while ( pTmpColFrame )
800 {
801 aChkRect.Union( pTmpColFrame->getFrameArea() );
802 pTmpColFrame = pTmpColFrame->GetPrev();
803 }
804 bOverlapsPrevColumn = GetObjRect().Overlaps( aChkRect );
805 }
806 }
807
808 return bOverlapsPrevColumn;
809}
810
818{
819 Point aRelPos;
820
821 assert(GetAnchorFrame());
822 aRelPos = GetObjRect().Pos();
823 aRelPos -= GetAnchorFrame()->getFrameArea().Pos();
824
825 return aRelPos;
826}
827
840 bool& _obRelToTableCell ) const
841{
842 Point aRelPos;
843 _obRelToTableCell = false;
844
845 assert(GetAnchorFrame());
846 assert(GetAnchorFrame()->FindPageFrame());
847
848 aRelPos = GetObjRect().Pos();
849 // --> #i33818# - search for cell frame, if object has to
850 // follow the text flow.
851 const SwFrame* pFrame( nullptr );
852 if ( _bFollowTextFlow && !GetAnchorFrame()->IsPageFrame() )
853 {
854 pFrame = GetAnchorFrame()->GetUpper();
855 while ( !pFrame->IsCellFrame() && !pFrame->IsPageFrame() )
856 {
857 pFrame = pFrame->GetUpper();
858 }
859 }
860 else
861 {
862 pFrame = GetAnchorFrame()->FindPageFrame();
863 }
864 if ( pFrame->IsCellFrame() )
865 {
866 aRelPos -= pFrame->getFrameArea().Pos() + pFrame->getFramePrintArea().Pos();
867 _obRelToTableCell = true;
868 }
869 else
870 {
871 aRelPos -= pFrame->getFrameArea().Pos();
872 }
873
874 return aRelPos;
875}
876
884{
885 Point aRelPos = GetObjRect().Pos();
886 aRelPos -= GetLastCharRect().Pos();
887
888 return aRelPos;
889}
890
898{
899 Point aRelPos = GetObjRect().Pos();
900 aRelPos.AdjustY( -(GetLastTopOfLine()) );
901
902 return aRelPos;
903}
904
906{
907 return nullptr;
908}
909
911{
912 return nullptr;
913}
914
915/* 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 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:156
bool IsUndersized() const
Definition: flowfrm.hxx:159
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:69
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:88
css::text::WrapTextMode GetSurround() const
Definition: fmtsrnd.hxx:51
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:55
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:74
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:83
const SwFormatSurround & GetSurround(bool=true) const
Definition: fmtsrnd.hxx:66
const SvxULSpaceItem & GetULSpace(bool=true) const
Definition: frmatr.hxx:76
const IDocumentSettingAccess & getIDocumentSettingAccess() const
Provides access to the document settings interface.
Definition: format.cxx:713
const SwRect & getFrameArea() const
Definition: frame.hxx:179
const SwRect & getFramePrintArea() const
Definition: frame.hxx:180
Style of a layout element.
Definition: frmfmt.hxx:62
virtual void SetLayoutDir(const SwFrameFormat::tLayoutDir _eLayoutDir)
Definition: atrfrm.cxx:2844
Base class of the Writer layout elements.
Definition: frame.hxx:315
bool IsCellFrame() const
Definition: frame.hxx:1226
bool IsTextFrame() const
Definition: frame.hxx:1234
SwFrame * GetNext()
Definition: frame.hxx:676
bool IsPageFrame() const
Definition: frame.hxx:1178
bool IsTabFrame() const
Definition: frame.hxx:1218
const SwSortedObjs * GetDrawObjs() const
Definition: frame.hxx:564
bool IsRightToLeft() const
Definition: frame.hxx:987
SwLayoutFrame * GetUpper()
Definition: frame.hxx:678
bool IsVertical() const
Definition: frame.hxx:973
SwFrame * GetPrev()
Definition: frame.hxx:677
SwFrame * FindColFrame()
Definition: findfrm.cxx:584
SwPageFrame * FindPageFrame()
Definition: frame.hxx:680
bool IsLayoutFrame() const
Definition: frame.hxx:1170
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:410
static void InsertObjForTmpConsiderWrapInfluence(const SwDoc &_rDoc, SwAnchoredObject &_rAnchoredObj)
Definition: layouter.cxx:392
SwObjPositioningInProgress(SdrObject &_rSdrObj)
SwAnchoredObject * mpAnchoredObj
A page of the document layout.
Definition: pagefrm.hxx:58
const SwSortedObjs * GetSortedObjs() const
Definition: pagefrm.hxx:132
tools::Long GetHeight(const SwRect &rRect) const
Definition: frame.hxx:1381
tools::Long GetTop(const SwRect &rRect) const
Definition: frame.hxx:1376
tools::Long GetLeft(const SwRect &rRect) const
Definition: frame.hxx:1378
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:165
SwTextFrame * GetFollow()
Definition: txtfrm.hxx:861
TextFrameIndex GetOffset() const
Definition: txtfrm.hxx:444
bool HasPara() const
Definition: txtfrm.hxx:825
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:1267
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
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