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 
35 using 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  mpDrawObj( nullptr ),
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 
112 void SwAnchoredObject::ChgAnchorFrame( SwFrame* _pNewAnchorFrame )
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 {
178  maLastCharRect.Height( 0 );
179 }
180 
181 void SwAnchoredObject::SetVertPosOrientFrame( const SwLayoutFrame& _rVertPosOrientFrame )
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.GetContentAnchor()) )
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  {
289  UnlockPosition();
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  {
326  UnlockPosition();
327  }
329  }
330  // keep new top of line value
331  mnLastTopOfLine = nTopOfLine;
332 }
333 
335 {
337  mnLastTopOfLine = 0;
338 }
339 
340 void SwAnchoredObject::SetCurrRelPos( Point _aRelPos )
341 {
342  maRelPos = _aRelPos;
343 }
344 
346 {
347  // default behaviour:
348  // update layout direction, the anchored object is assigned to
349  UpdateLayoutDir();
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
392  UnlockPosition();
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 {
468  return mbConsiderForTextWrap;
469  else
470  return true;
471 }
472 
473 void SwAnchoredObject::SetConsiderForTextWrap( const bool _bConsiderForTextWrap )
474 {
475  mbConsiderForTextWrap = _bConsiderForTextWrap;
476 }
477 
479 {
481  return mbPositionLocked;
482  else
483  return false;
484 }
485 
487 {
489  return mbRestartLayoutProcess;
490  else
491  return false;
492 }
493 
494 void SwAnchoredObject::SetRestartLayoutProcess( const bool _bRestartLayoutProcess )
495 {
496  mbRestartLayoutProcess = _bRestartLayoutProcess;
497 }
498 
499 // --> #i35911#
501 {
503  return mbClearedEnvironment;
504  else
505  return false;
506 }
507 void 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  {
593  mbObjRectWithSpacesValid = false;
594  }
595 }
596 
598 {
599  const bool bLeftChanged( SetObjLeft_( _nLeft ) );
600  if ( bLeftChanged )
601  {
602  mbObjRectWithSpacesValid = false;
603  }
604 }
605 
616 {
617  if(!GetAnchorFrame())
618  return;
619 
620  if ( GetFrameFormat().getIDocumentSettingAccess().get(DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION) )
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 ( 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()>
689  pRetPageFrame = GetAnchorFrameContainingAnchPos()->FindPageFrame();
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#
745 void 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 
839 Point SwAnchoredObject::GetRelPosToPageFrame( const bool _bFollowTextFlow,
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: */
void CheckCharRectAndTopOfLine(const bool _bCheckForParaPorInf)
check anchor character rectangle and top of line
Base class of the Writer layout elements.
Definition: frame.hxx:315
const SwRect & GetLastCharRect() const
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:159
virtual SwRect GetObjRect() const =0
bool OverlapsPrevColumn() const
method to determine, if the anchored object is overlapping with a previous column ...
const SwSortedObjs * GetDrawObjs() const
Definition: frame.hxx:565
void SetClearedEnvironment(const bool _bClearedEnvironment)
SwRect & Union(const SwRect &rRect)
Definition: swrect.cxx:35
const SwLayoutFrame * mpVertPosOrientFrame
sal_uInt16 GetLower() const
bool HasPara() const
Definition: txtfrm.hxx:820
const SwFormatVertOrient & GetVertOrient(bool=true) const
Definition: fmtornt.hxx:106
void Left(const tools::Long nLeft)
Definition: swrect.hxx:197
virtual bool SetObjTop_(const SwTwips _nTop)=0
virtual void UpdateLayoutDir()
method update layout direction the layout direction, the anchored object is assigned to ...
bool ClearedEnvironment() const
long Long
tools::Long GetRight() const
const SwRect & getFramePrintArea() const
Definition: frame.hxx:181
void SetConsiderForTextWrap(const bool _bConsiderForTextWrap)
SdrObject * mpDrawObj
void ChgAnchorFrame(SwFrame *_pNewAnchorFrame)
void Update(SwAnchoredObject &_rAnchoredObj)
method to update the position of the given anchored object in the sorted list
Definition: sortedobjs.cxx:253
void AddLastCharY(tools::Long nDiff)
void Pos(const Point &rNew)
Definition: swrect.hxx:171
void SetTmpConsiderWrapInfluenceOfOtherObjs()
method to apply temporary consideration of wrapping style influence to the anchored objects...
bool IsCellFrame() const
Definition: frame.hxx:1227
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
Point GetRelPosToChar() const
method to determine position of anchored object relative to anchor character
void ClearCharRectAndTopOfLine()
reset members and
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:55
SwContact * GetUserCall(const SdrObject *pObj)
Returns the UserCall if applicable from the group object.
Definition: dcontact.cxx:171
static void InsertObjForTmpConsiderWrapInfluence(const SwDoc &_rDoc, SwAnchoredObject &_rAnchoredObj)
Definition: layouter.cxx:392
virtual SwRect GetObjBoundRect() const =0
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:155
tools::Long GetTop(const SwRect &rRect) const
Definition: frame.hxx:1378
void InvalidateObjPosForConsiderWrapInfluence()
method to perform necessary invalidations for the positioning of objects, for whose the wrapping styl...
SwTextFrame * FindAnchorCharFrame()
get frame, which contains the anchor character, if the object is anchored at-character or as-characte...
void SetDrawObj(SdrObject &_rDrawObj)
wrapper class for the positioning of Writer fly frames and drawing objects
virtual bool IsVisibleLayerId(SdrLayerID _nLayerId) const =0
method to determine, if a layer ID belongs to the visible ones.
void SetCurrRelPos(Point _aRelPos)
const SwRect & getFrameArea() const
Definition: frame.hxx:180
SwTwips GetRelCharX(const SwFrame *pFrame) const
Point GetRelPosToPageFrame(const bool _bFollowTextFlow, bool &_obRelToTableCell) const
method to determine position of anchored object relative to page frame
void SetTmpConsiderWrapInfluence(const bool _bTmpConsiderWrapInfluence)
bool IsTextFrame() const
Definition: frame.hxx:1235
static void RemoveObjForTmpConsiderWrapInfluence(const SwDoc &_rDoc, SwAnchoredObject &_rAnchoredObj)
Definition: layouter.cxx:410
const SwFormatSurround & GetSurround(bool=true) const
Definition: fmtsrnd.hxx:66
virtual void ObjectAttachedToAnchorFrame()
method to indicate, that anchored object is attached to an anchor frame
tools::Long GetLeft(const SwRect &rRect) const
Definition: frame.hxx:1380
static bool IsDraggingOffPageAllowed(const SwFrameFormat *)
method to determine if dragging objects off page is allowed
SwAnchoredObject * mpAnchoredObj
virtual bool SetObjLeft_(const SwTwips _nLeft)=0
SwFrame * AnchorFrame()
SwTextFrame * GetFollow()
Definition: txtfrm.hxx:856
TextFrameIndex GetOffset() const
Definition: txtfrm.hxx:439
void SetObjTop(const SwTwips _nTop)
bool ConsiderForTextWrap() const
SwObjPositioningInProgress(SdrObject &_rSdrObj)
Style of a layout element.
Definition: frmfmt.hxx:59
void CheckCharRect(const SwFormatAnchor &_rAnch, const SwTextFrame &_rAnchorCharFrame)
check anchor character rectangle
Point GetRelPosToLine() const
method to determine position of anchored object relative to top of line
TextFrameIndex MapModelToViewPos(SwPosition const &rPos) const
Definition: txtfrm.cxx:1268
const SdrObject * GetDrawObj() const
void CheckTopOfLine(const SwFormatAnchor &_rAnch, const SwTextFrame &_rAnchorCharFrame)
check top of line
const SwSortedObjs * GetSortedObjs() const
Definition: pagefrm.hxx:132
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
int i
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
size_t size() const
Definition: sortedobjs.cxx:43
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
SwPageFrame * FindPageFrame()
Definition: frame.hxx:681
const SwFrame * Lower() const
Definition: layfrm.hxx:101
tools::Long GetHeight(const SwRect &rRect) const
Definition: frame.hxx:1383
FlyAnchors.
Definition: fmtanchr.hxx:34
tools::Long GetLeft() const
const SwFrame * mpAnchorFrame
bool IsTmpConsiderWrapInfluence() const
virtual const SwFlyFrame * DynCastFlyFrame() const
SwLayoutFrame * GetUpper()
Definition: frame.hxx:679
SwTextFrame & GetFrameAtOfst(TextFrameIndex nOfst)
Definition: frmcrsr.cxx:143
void AddHeight(const tools::Long nAdd)
Definition: swrect.cxx:124
const SwRect & GetObjRectWithSpaces() const
method to determine object area inclusive its spacing
void UpdateObjInSortedList()
method to update anchored object in the lists
bool IsUndersized() const
Definition: flowfrm.hxx:158
void ClearVertPosOrientFrame()
css::text::WrapTextMode GetSurround() const
Definition: fmtsrnd.hxx:51
SwFrame * GetPrev()
Definition: frame.hxx:678
SwPageFrame * mpPageFrame
void AddWidth(const tools::Long nAdd)
Definition: swrect.cxx:123
bool GetTopOfLine(SwTwips &_onTopOfLine, const SwPosition &_rPos) const
Determine top of line for given position in the text frame.
Definition: frmcrsr.cxx:453
virtual void InvalidateObjPos()=0
method to invalidate position of the anchored object
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:123
const IDocumentSettingAccess & getIDocumentSettingAccess() const
Provides access to the document settings interface.
Definition: format.cxx:717
virtual const SwAnchoredObject * GetAnchoredObj(const SdrObject *_pSdrObj) const =0
A page of the document layout.
Definition: pagefrm.hxx:57
SwFrame * GetAnchorFrameContainingAnchPos()
determine anchor frame containing the anchor position
tools::Long SwTwips
Definition: swtypes.hxx:52
bool RestartLayoutProcess() const
SwFrame * FindColFrame()
Definition: findfrm.cxx:530
bool GetAutoPos(SwRect &, const SwPosition &) const
A slimmer version of GetCharRect for autopositioning Frames.
Definition: frmcrsr.cxx:366
bool IsLayoutFrame() const
Definition: frame.hxx:1171
void Bottom(const tools::Long nBottom)
Definition: swrect.hxx:211
const SwLayoutFrame * GetVertPosOrientFrame() const
const SvxULSpaceItem & GetULSpace(bool=true) const
Definition: frmatr.hxx:76
virtual bool IsFormatPossible() const
method to determine, if a format on the anchored object is possible
void SetPositioningInProgress(const bool _bPosInProgress)
bool ConsiderObjWrapInfluenceOnObjPos() const
method to determine, if wrapping style influence of the anchored object has to be considered on the o...
bool IsTabFrame() const
Definition: frame.hxx:1219
general base class for all free-flowing frames
Definition: flyfrm.hxx:78
bool InvalidationOfPosAllowed() const
method to determine, if invalidation of position is allowed
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:88
virtual SwFrameFormat & GetFrameFormat()=0
SwPageFrame * FindPageFrameOfAnchor()
method to determine the page frame, on which the 'anchor' of the given anchored object is...
SwPageFrame * GetPageFrame()
bool HasClearedEnvironment() const
method to determine, if due to anchored object size and wrapping style, its layout environment is cle...
void SetPageFrame(SwPageFrame *_pNewPageFrame)
Point GetRelPosToAnchorFrame() const
method to determine position of anchored object relative to anchor frame
void ClearTmpConsiderWrapInfluence()
SwTwips GetLastTopOfLine() const
bool IsRightToLeft() const
Definition: frame.hxx:988
void Top(const tools::Long nTop)
Definition: swrect.hxx:206
const_iterator begin() const
Definition: sortedobjs.hxx:66
void InvalidateObjRectWithSpaces() const
bool IsPageFrame() const
Definition: frame.hxx:1179
bool ConsiderObjWrapInfluenceOfOtherObjs() const
method to determine, if other anchored objects, also attached at to the anchor frame, have to consider its wrap influence.
virtual void RegisterAtCorrectPage()=0
method to assure that anchored object is registered at the correct page frame
size_t ListPosOf(const SwAnchoredObject &_rAnchoredObj) const
Position of object <_rAnchoredObj> in sorted list.
Definition: sortedobjs.cxx:277
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
void SetObjLeft(const SwTwips _nLeft)
bool IsVertical() const
Definition: frame.hxx:974
SwTwips GetRelCharY(const SwFrame *pFrame) const
virtual void NotifyBackground(SwPageFrame *_pPageFrame, const SwRect &_rRect, PrepareHint _eHint)=0
method to trigger notification of 'background'
const_iterator end() const
Definition: sortedobjs.hxx:68
void Clear()
Definition: swrect.hxx:308
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame...
Definition: layfrm.hxx:35
const SwFrame * GetAnchorFrame() const
void SetVertPosOrientFrame(const SwLayoutFrame &_rVertPosOrientFrame)
bool PositionLocked() const
bool IsPositioningInProgress() const
is positioning of anchored object in progress
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...
class for collecting anchored objects
Definition: sortedobjs.hxx:48
void ResetLastCharRectHeight()
void SetRestartLayoutProcess(const bool _bRestartLayoutProcess)
void Height(tools::Long nNew)
Definition: swrect.hxx:193
bool Overlaps(const SwRect &rRect) const
Definition: swrect.hxx:374
virtual void SetLayoutDir(const SwFrameFormat::tLayoutDir _eLayoutDir)
Definition: atrfrm.cxx:2846
sal_uInt16 GetUpper() const
void AddLastTopOfLineY(SwTwips _nDiff)
virtual ~SwAnchoredObject()
SwFrame * GetNext()
Definition: frame.hxx:677
const SvxLRSpaceItem & GetLRSpace(bool=true) const
Definition: frmatr.hxx:74
SwFrame * mpAnchorFrame
Frame the object is anchored at.