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 
34 using namespace ::com::sun::star;
35 
36 // --> #i28701# -
37 // implementation of helper class <SwObjPositioningInProgress>
38 
40  mpAnchoredObj( nullptr ),
41  // --> #i52904#
42  mbOldObjPositioningInProgress( false )
43 {
44  mpAnchoredObj = ::GetUserCall( &_rSdrObj )->GetAnchoredObj( &_rSdrObj );
45  // --> #i52904#
48 }
50  mpAnchoredObj( &_rAnchoredObj ),
51  // --> #i52904#
52  mbOldObjPositioningInProgress( false )
53 {
54  // --> #i52904#
57 }
58 
60 {
61  if ( mpAnchoredObj )
62  {
63  // --> #i52904#
65  }
66 }
67 
68 
70  mpDrawObj( nullptr ),
71  mpAnchorFrame( nullptr ),
72  // --> #i28701#
73  mpPageFrame( nullptr ),
74  maRelPos(),
75  maLastCharRect(),
76  mnLastTopOfLine( 0 ),
77  mpVertPosOrientFrame( nullptr ),
78  // --> #i28701#
79  mbPositioningInProgress( false ),
80  mbConsiderForTextWrap( false ),
81  mbPositionLocked( false ),
82  // --> #i40147#
83  mbKeepPositionLockedForSection( false ),
84  mbRestartLayoutProcess( false ),
85  // --> #i35911#
86  mbClearedEnvironment( false ),
87  // --> #i3317#
88  mbTmpConsiderWrapInfluence( false ),
89  // --> #i68520#
90  maObjRectWithSpaces(),
91  mbObjRectWithSpacesValid( false ),
92  maLastObjRect()
93 {
94 }
95 
97 {
99  {
100  const_cast<SwLayoutFrame*>(mpVertPosOrientFrame)->ClearVertPosOrientFrameFor(this);
101  mpVertPosOrientFrame = nullptr;
102  }
103 }
104 
106 {
108 }
109 
111 {
112  mpDrawObj = &_rDrawObj;
113 }
114 
115 
116 void SwAnchoredObject::ChgAnchorFrame( SwFrame* _pNewAnchorFrame )
117 {
118  mpAnchorFrame = _pNewAnchorFrame;
119 
120  if ( mpAnchorFrame )
121  {
123  }
124 }
125 
135 {
136  SwFrame* pAnchorFrameContainingAnchPos = FindAnchorCharFrame();
137  if ( !pAnchorFrameContainingAnchPos )
138  {
139  pAnchorFrameContainingAnchPos = AnchorFrame();
140  }
141 
142  return pAnchorFrameContainingAnchPos;
143 }
144 
145 
147 {
148  if ( mpPageFrame != _pNewPageFrame )
149  {
150  // clear member, which denotes the layout frame at which the vertical
151  // position is oriented at, if it doesn't fit to the new page frame.
152  if ( GetVertPosOrientFrame() &&
153  ( !_pNewPageFrame ||
154  _pNewPageFrame != GetVertPosOrientFrame()->FindPageFrame() ) )
155  {
157  }
158 
159  // assign new page frame
160  mpPageFrame = _pNewPageFrame;
161  }
162 }
163 
164 
166 {
167  return maLastCharRect.Left() - pFrame->getFrameArea().Left();
168 }
169 
171 {
172  return maLastCharRect.Bottom() - pFrame->getFrameArea().Top();
173 }
174 
176 {
177  maLastCharRect.Pos().AdjustY(nDiff );
178 }
179 
181 {
182  maLastCharRect.Height( 0 );
183 }
184 
185 void SwAnchoredObject::SetVertPosOrientFrame( const SwLayoutFrame& _rVertPosOrientFrame )
186 {
188 
189  mpVertPosOrientFrame = &_rVertPosOrientFrame;
190  const_cast<SwLayoutFrame*>(mpVertPosOrientFrame)->SetVertPosOrientFrameFor(this);
191 
192  // #i28701# - take over functionality of deleted method
193  // <SwFlyAtContentFrame::AssertPage()>: assure for at-paragraph and at-character
194  // an anchored object, that it is registered at the correct page frame
196 }
197 
198 
199 // #i28701# - follow-up of #i22341#
201 {
202  mnLastTopOfLine += _nDiff;
203 }
204 
216  const bool _bCheckForParaPorInf )
217 {
218  if ( GetAnchorFrame() &&
219  GetAnchorFrame()->IsTextFrame() )
220  {
221  const SwFormatAnchor& rAnch = GetFrameFormat().GetAnchor();
222  if ( (rAnch.GetAnchorId() == RndStdIds::FLY_AT_CHAR) &&
223  rAnch.GetContentAnchor() )
224  {
225  // --> if requested, assure that anchor frame,
226  // which contains the anchor character, has a paragraph portion information.
227  // The paragraph portion information is needed to determine the
228  // anchor character rectangle respectively the top of the line.
229  // Thus, a format of this frame is avoided to determine the
230  // paragraph portion information.
231  // --> #i26945# - use new method <FindAnchorCharFrame()>
232  const SwTextFrame& aAnchorCharFrame = *(FindAnchorCharFrame());
233  if ( !_bCheckForParaPorInf || aAnchorCharFrame.HasPara() )
234  {
235  CheckCharRect( rAnch, aAnchorCharFrame );
236  CheckTopOfLine( rAnch, aAnchorCharFrame );
237  }
238  }
239  }
240 }
241 
253  const SwTextFrame& _rAnchorCharFrame )
254 {
255  // determine rectangle of anchor character. If not exist, abort operation
256  SwRect aCharRect;
257  if ( !_rAnchorCharFrame.GetAutoPos( aCharRect, *_rAnch.GetContentAnchor() ) )
258  {
259  return;
260  }
261  // check, if anchor character rectangle has changed
262  if ( aCharRect != maLastCharRect )
263  {
264  // check positioning and alignment for invalidation of position
265  {
266  SwRectFnSet aRectFnSet(&_rAnchorCharFrame);
267  // determine positioning and alignment
268  SwFormatVertOrient aVert( GetFrameFormat().GetVertOrient() );
269  SwFormatHoriOrient aHori( GetFrameFormat().GetHoriOrient() );
270  // check for anchor character rectangle changes for certain
271  // positionings and alignments
272  // add condition to invalidate position,
273  // if vertical aligned at frame/page area and vertical position
274  // of anchor character has changed.
275  const sal_Int16 eVertRelOrient = aVert.GetRelationOrient();
276  if ( ( aHori.GetRelationOrient() == text::RelOrientation::CHAR &&
277  aRectFnSet.GetLeft(aCharRect) != aRectFnSet.GetLeft(maLastCharRect) ) ||
278  ( eVertRelOrient == text::RelOrientation::CHAR &&
279  ( aRectFnSet.GetTop(aCharRect) != aRectFnSet.GetTop(maLastCharRect) ||
280  aRectFnSet.GetHeight(aCharRect) != aRectFnSet.GetHeight(maLastCharRect) ) ) ||
281  ( ( ( eVertRelOrient == text::RelOrientation::FRAME ) ||
282  ( eVertRelOrient == text::RelOrientation::PRINT_AREA ) ||
283  ( eVertRelOrient == text::RelOrientation::PAGE_FRAME ) ||
284  ( eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA ) ) &&
285  ( aRectFnSet.GetTop(aCharRect) != aRectFnSet.GetTop(maLastCharRect) ) ) )
286  {
287  // #i26945#, #i35911# - unlock position of
288  // anchored object, if it isn't registered at the page,
289  // where its anchor character frame is on.
290  if ( GetPageFrame() != _rAnchorCharFrame.FindPageFrame() )
291  {
292  UnlockPosition();
293  }
295  }
296  }
297  // keep new anchor character rectangle
298  maLastCharRect = aCharRect;
299  }
300 }
301 
313  const SwTextFrame& _rAnchorCharFrame )
314 {
315  SwTwips nTopOfLine = 0;
316  if ( _rAnchorCharFrame.GetTopOfLine( nTopOfLine, *_rAnch.GetContentAnchor() ) )
317  {
318  if ( nTopOfLine != mnLastTopOfLine )
319  {
320  // check alignment for invalidation of position
321  if ( GetFrameFormat().GetVertOrient().GetRelationOrient() == text::RelOrientation::TEXT_LINE )
322  {
323  // #i26945#, #i35911# - unlock position of
324  // anchored object, if it isn't registered at the page,
325  // where its anchor character frame is on.
326  if ( GetPageFrame() != _rAnchorCharFrame.FindPageFrame() )
327  {
328  UnlockPosition();
329  }
331  }
332  // keep new top of line value
333  mnLastTopOfLine = nTopOfLine;
334  }
335  }
336 }
337 
339 {
341  mnLastTopOfLine = 0;
342 }
343 
345 {
346  maRelPos = _aRelPos;
347 }
348 
350 {
351  // default behaviour:
352  // update layout direction, the anchored object is assigned to
353  UpdateLayoutDir();
354 }
355 
364 {
366  const SwFrame* pAnchorFrame = GetAnchorFrame();
367  if ( pAnchorFrame )
368  {
369  const bool bVert = pAnchorFrame->IsVertical();
370  const bool bR2L = pAnchorFrame->IsRightToLeft();
371  if ( bVert )
372  {
373  nLayoutDir = SwFrameFormat::VERT_R2L;
374  }
375  else if ( bR2L )
376  {
377  nLayoutDir = SwFrameFormat::HORI_R2L;
378  }
379  }
380  GetFrameFormat().SetLayoutDir( nLayoutDir );
381 }
382 
390 {
392  {
393  // indicate that object has not to be considered for text wrap
394  SetConsiderForTextWrap( false );
395  // unlock position
396  UnlockPosition();
397  // invalidate position
399  // invalidate 'background'
401  }
402 }
403 
412 {
413  bool bRet( false );
414 
415  const SwFrameFormat& rObjFormat = GetFrameFormat();
416 
417  // --> #i3317# - add condition <IsTmpConsiderWrapInfluence()>
418  // --> #i55204#
419  // - correction: wrapping style influence has been considered, if condition
420  // <IsTmpConsiderWrapInfluence()> is hold, regardless of its anchor type
421  // or its wrapping style.
423  {
424  bRet = true;
425  }
427  {
428  const SwFormatAnchor& rAnchor = rObjFormat.GetAnchor();
429  if ( ((rAnchor.GetAnchorId() == RndStdIds::FLY_AT_CHAR) ||
430  (rAnchor.GetAnchorId() == RndStdIds::FLY_AT_PARA)) &&
431  rObjFormat.GetSurround().GetSurround() != css::text::WrapTextMode_THROUGH )
432  {
433  // --> #i34520# - text also wraps around anchored
434  // objects in the layer Hell - see the text formatting.
435  // Thus, it hasn't to be checked here.
436  bRet = true;
437  }
438  }
439 
440  return bRet;
441 }
442 
449 {
450  bool bRet( false );
451 
452  const SwSortedObjs* pObjs = GetAnchorFrame()->GetDrawObjs();
453  if ( pObjs->size() > 1 )
454  {
455  for (SwAnchoredObject* pAnchoredObj : *pObjs)
456  {
457  if ( pAnchoredObj != this &&
458  pAnchoredObj->ConsiderObjWrapInfluenceOnObjPos() )
459  {
460  bRet = true;
461  break;
462  }
463  }
464  }
465 
466  return bRet;
467 }
468 
470 {
472  return mbConsiderForTextWrap;
473  else
474  return true;
475 }
476 
477 void SwAnchoredObject::SetConsiderForTextWrap( const bool _bConsiderForTextWrap )
478 {
479  mbConsiderForTextWrap = _bConsiderForTextWrap;
480 }
481 
483 {
485  return mbPositionLocked;
486  else
487  return false;
488 }
489 
491 {
493  return mbRestartLayoutProcess;
494  else
495  return false;
496 }
497 
498 void SwAnchoredObject::SetRestartLayoutProcess( const bool _bRestartLayoutProcess )
499 {
500  mbRestartLayoutProcess = _bRestartLayoutProcess;
501 }
502 
503 // --> #i35911#
505 {
507  return mbClearedEnvironment;
508  else
509  return false;
510 }
511 void SwAnchoredObject::SetClearedEnvironment( const bool _bClearedEnvironment )
512 {
513  mbClearedEnvironment = _bClearedEnvironment;
514 }
515 
522 {
523  bool bHasClearedEnvironment( false );
524 
525  // --> #i43913# - layout frame, vertical position is orient at, has to be set.
526  OSL_ENSURE( GetVertPosOrientFrame(),
527  "<SwAnchoredObject::HasClearedEnvironment()> - layout frame missing, at which the vertical position is oriented at." );
528  if ( GetVertPosOrientFrame() &&
529  GetAnchorFrame()->IsTextFrame() &&
530  !static_cast<const SwTextFrame*>(GetAnchorFrame())->IsFollow() &&
531  static_cast<const SwTextFrame*>(GetAnchorFrame())->FindPageFrame()->GetPhyPageNum() >=
532  GetPageFrame()->GetPhyPageNum() )
533  {
534  const SwFrame* pTmpFrame = GetVertPosOrientFrame()->Lower();
535  while ( pTmpFrame && pTmpFrame->IsLayoutFrame() && !pTmpFrame->IsTabFrame() )
536  {
537  pTmpFrame = static_cast<const SwLayoutFrame*>(pTmpFrame)->Lower();
538  }
539  if ( !pTmpFrame )
540  {
541  bHasClearedEnvironment = true;
542  }
543  else if ( pTmpFrame->IsTextFrame() && !pTmpFrame->GetNext() )
544  {
545  const SwTextFrame* pTmpTextFrame = static_cast<const SwTextFrame*>(pTmpFrame);
546  if ( pTmpTextFrame->IsUndersized() ||
547  ( pTmpTextFrame->GetFollow() &&
548  pTmpTextFrame->GetFollow()->GetOfst() == TextFrameIndex(0)))
549  {
550  bHasClearedEnvironment = true;
551  }
552  }
553  }
554 
555  return bHasClearedEnvironment;
556 }
557 
564 {
567  {
568  OSL_FAIL( "<SwAnchoredObject::GetObjRectWithSpaces> - cache for object rectangle inclusive spaces marked as valid, but it couldn't be. Missing invalidation of cache." );
570  }
572  {
574  const SwFrameFormat& rFormat = GetFrameFormat();
575  const SvxULSpaceItem& rUL = rFormat.GetULSpace();
576  const SvxLRSpaceItem& rLR = rFormat.GetLRSpace();
577  {
578  maObjRectWithSpaces.Top ( std::max( maObjRectWithSpaces.Top() - long(rUL.GetUpper()), 0L ));
579  maObjRectWithSpaces.Left( std::max( maObjRectWithSpaces.Left()- rLR.GetLeft(), 0L ));
580  maObjRectWithSpaces.SSize().AdjustHeight(rUL.GetLower() );
581  maObjRectWithSpaces.SSize().AdjustWidth(rLR.GetRight() );
582  }
583 
586  }
587 
588  return maObjRectWithSpaces;
589 }
590 
591 // --> #i68520#
593 {
594  const bool bTopChanged( SetObjTop_( _nTop ) );
595  if ( bTopChanged )
596  {
597  mbObjRectWithSpacesValid = false;
598  }
599 }
600 
602 {
603  const bool bLeftChanged( SetObjLeft_( _nLeft ) );
604  if ( bLeftChanged )
605  {
606  mbObjRectWithSpacesValid = false;
607  }
608 }
609 
619 {
620  if ( GetAnchorFrame() )
621  {
622  if ( GetFrameFormat().getIDocumentSettingAccess().get(DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION) )
623  {
624  // invalidate position of all anchored objects at anchor frame
625  if ( GetAnchorFrame()->GetDrawObjs() )
626  {
627  const SwSortedObjs* pObjs = GetAnchorFrame()->GetDrawObjs();
628  // determine start index
629  for (auto it = pObjs->begin(); it != pObjs->end(); ++it)
630  {
631  SwAnchoredObject* pAnchoredObj = *it;
632  if ( pAnchoredObj->ConsiderObjWrapInfluenceOnObjPos() )
634  else
635  pAnchoredObj->InvalidateObjPos();
636  }
637  }
638  // invalidate all following anchored objects on the page frame
639  if ( GetPageFrame() && GetPageFrame()->GetSortedObjs() )
640  {
641  const SwSortedObjs* pObjs = GetPageFrame()->GetSortedObjs();
642  // determine start index
643  for ( size_t i = pObjs->ListPosOf( *this ) + 1; i < pObjs->size(); ++i )
644  {
645  SwAnchoredObject* pAnchoredObj = (*pObjs)[i];
646  if ( pAnchoredObj->ConsiderObjWrapInfluenceOnObjPos() )
648  else
649  pAnchoredObj->InvalidateObjPos();
650  }
651  }
652  }
653  // update its position in the sorted object list of its anchor frame
654  AnchorFrame()->GetDrawObjs()->Update( *this );
655  // update its position in the sorted object list of its page frame
656  // note: as-character anchored object aren't registered at a page frame
657  if ( GetFrameFormat().GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR )
658  {
659  GetPageFrame()->GetSortedObjs()->Update( *this );
660  }
661  }
662 }
663 
669 {
670  // --> Check, if page frame layout is in progress,
671  // isn't needed, because of anchored object, whose are moved forward.
672  return !PositionLocked();
673 }
674 
686 {
687  SwPageFrame* pRetPageFrame = nullptr;
688 
689  // --> #i44339# - check, if anchor frame exists.
690  if ( mpAnchorFrame )
691  {
692  // --> #i26945# - use new method <GetAnchorFrameContainingAnchPos()>
693  pRetPageFrame = GetAnchorFrameContainingAnchPos()->FindPageFrame();
694  }
695 
696  return pRetPageFrame;
697 }
698 
709 {
710  SwTextFrame* pAnchorCharFrame( nullptr );
711 
712  // --> #i44339# - check, if anchor frame exists.
713  if ( mpAnchorFrame )
714  {
715  const SwFormatAnchor& rAnch = GetFrameFormat().GetAnchor();
716  if ((rAnch.GetAnchorId() == RndStdIds::FLY_AT_CHAR) ||
717  (rAnch.GetAnchorId() == RndStdIds::FLY_AS_CHAR))
718  {
719  SwTextFrame *const pFrame(static_cast<SwTextFrame*>(AnchorFrame()));
720  TextFrameIndex const nOffset(pFrame->MapModelToViewPos(*rAnch.GetContentAnchor()));
721  pAnchorCharFrame = &pFrame->GetFrameAtOfst(nOffset);
722  }
723  }
724 
725  return pAnchorCharFrame;
726 }
727 
735 {
737 }
738 
739 // --> #i3317#
740 void SwAnchoredObject::SetTmpConsiderWrapInfluence( const bool _bTmpConsiderWrapInfluence )
741 {
742  mbTmpConsiderWrapInfluence = _bTmpConsiderWrapInfluence;
743  // --> #i35911#
745  {
747  *this );
748  }
749 }
750 
752 {
754  mbClearedEnvironment = false;
755  SetClearedEnvironment( false );
757  *this );
758 }
760 {
761  const SwSortedObjs* pObjs = GetAnchorFrame()->GetDrawObjs();
762  if ( pObjs->size() > 1 )
763  {
764  for (SwAnchoredObject* pAnchoredObj : *pObjs)
765  {
766  if ( pAnchoredObj != this )
767  {
768  pAnchoredObj->SetTmpConsiderWrapInfluence( true/*bTmpConsiderWrapInfluence*/ );
769  }
770  }
771  }
772 }
773 
784 {
785  bool bOverlapsPrevColumn( false );
786 
788  {
789  const SwFrame* pColFrame = mpAnchorFrame->FindColFrame();
790  if ( pColFrame && pColFrame->GetPrev() )
791  {
792  const SwFrame* pTmpColFrame = pColFrame->GetPrev();
793  SwRect aChkRect;
794  while ( pTmpColFrame )
795  {
796  aChkRect.Union( pTmpColFrame->getFrameArea() );
797  pTmpColFrame = pTmpColFrame->GetPrev();
798  }
799  bOverlapsPrevColumn = GetObjRect().IsOver( aChkRect );
800  }
801  }
802 
803  return bOverlapsPrevColumn;
804 }
805 
813 {
814  Point aRelPos;
815 
816  assert(GetAnchorFrame());
817  aRelPos = GetObjRect().Pos();
818  aRelPos -= GetAnchorFrame()->getFrameArea().Pos();
819 
820  return aRelPos;
821 }
822 
834 Point SwAnchoredObject::GetRelPosToPageFrame( const bool _bFollowTextFlow,
835  bool& _obRelToTableCell ) const
836 {
837  Point aRelPos;
838  _obRelToTableCell = false;
839 
840  assert(GetAnchorFrame());
841  assert(GetAnchorFrame()->FindPageFrame());
842 
843  aRelPos = GetObjRect().Pos();
844  // --> #i33818# - search for cell frame, if object has to
845  // follow the text flow.
846  const SwFrame* pFrame( nullptr );
847  if ( _bFollowTextFlow && !GetAnchorFrame()->IsPageFrame() )
848  {
849  pFrame = GetAnchorFrame()->GetUpper();
850  while ( !pFrame->IsCellFrame() && !pFrame->IsPageFrame() )
851  {
852  pFrame = pFrame->GetUpper();
853  }
854  }
855  else
856  {
857  pFrame = GetAnchorFrame()->FindPageFrame();
858  }
859  if ( pFrame->IsCellFrame() )
860  {
861  aRelPos -= pFrame->getFrameArea().Pos() + pFrame->getFramePrintArea().Pos();
862  _obRelToTableCell = true;
863  }
864  else
865  {
866  aRelPos -= pFrame->getFrameArea().Pos();
867  }
868 
869  return aRelPos;
870 }
871 
879 {
880  Point aRelPos = GetObjRect().Pos();
881  aRelPos -= GetLastCharRect().Pos();
882 
883  return aRelPos;
884 }
885 
893 {
894  Point aRelPos = GetObjRect().Pos();
895  aRelPos.AdjustY( -(GetLastTopOfLine()) );
896 
897  return aRelPos;
898 }
899 
900 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
long GetLeft() const
void CheckCharRectAndTopOfLine(const bool _bCheckForParaPorInf)
check anchor character rectangle and top of line
Base class of the Writer layout elements.
Definition: frame.hxx:295
const SwRect & GetLastCharRect() const
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:149
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:543
void SetClearedEnvironment(const bool _bClearedEnvironment)
SwRect & Union(const SwRect &rRect)
Definition: swrect.cxx:39
const SwLayoutFrame * mpVertPosOrientFrame
sal_uInt16 GetLower() const
bool HasPara() const
Definition: txtfrm.hxx:808
const SwFormatVertOrient & GetVertOrient(bool=true) const
Definition: fmtornt.hxx:106
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
const SwRect & getFramePrintArea() const
Definition: frame.hxx:176
void SetConsiderForTextWrap(const bool _bConsiderForTextWrap)
SdrObject * mpDrawObj
void Height(long nNew)
Definition: swrect.hxx:189
void ChgAnchorFrame(SwFrame *_pNewAnchorFrame)
TextFrameIndex GetOfst() const
Definition: txtfrm.hxx:426
void Update(SwAnchoredObject &_rAnchoredObj)
method to update the position of the given anchored object in the sorted list
Definition: sortedobjs.cxx:251
long SwTwips
Definition: swtypes.hxx:49
void Pos(const Point &rNew)
Definition: swrect.hxx:167
void SetTmpConsiderWrapInfluenceOfOtherObjs()
method to apply temporary consideration of wrapping style influence to the anchored objects...
bool IsCellFrame() const
Definition: frame.hxx:1202
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:170
static void InsertObjForTmpConsiderWrapInfluence(const SwDoc &_rDoc, SwAnchoredObject &_rAnchoredObj)
Definition: layouter.cxx:391
virtual SwRect GetObjBoundRect() const =0
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:154
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)
void Top(const long nTop)
Definition: swrect.hxx:202
const SwRect & getFrameArea() const
Definition: frame.hxx:175
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:1210
static void RemoveObjForTmpConsiderWrapInfluence(const SwDoc &_rDoc, SwAnchoredObject &_rAnchoredObj)
Definition: layouter.cxx:409
const SwFormatSurround & GetSurround(bool=true) const
Definition: fmtsrnd.hxx:66
long GetLeft(const SwRect &rRect) const
Definition: frame.hxx:1355
virtual void ObjectAttachedToAnchorFrame()
method to indicate, that anchored object is attached to an anchor frame
SwAnchoredObject * mpAnchoredObj
virtual bool SetObjLeft_(const SwTwips _nLeft)=0
SwFrame * AnchorFrame()
SwTextFrame * GetFollow()
Definition: txtfrm.hxx:844
void SetObjTop(const SwTwips _nTop)
bool ConsiderForTextWrap() const
SwObjPositioningInProgress(SdrObject &_rSdrObj)
Style of a layout element.
Definition: frmfmt.hxx:57
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:1266
const SdrObject * GetDrawObj() const
void CheckTopOfLine(const SwFormatAnchor &_rAnch, const SwTextFrame &_rAnchorCharFrame)
check top of line
const SwSortedObjs * GetSortedObjs() const
Definition: pagefrm.hxx:118
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
long AdjustY(long nVertMove)
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
size_t size() const
Definition: sortedobjs.cxx:42
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
SwPageFrame * FindPageFrame()
Definition: frame.hxx:658
const SwFrame * Lower() const
Definition: layfrm.hxx:101
int i
FlyAnchors.
Definition: fmtanchr.hxx:34
bool IsTmpConsiderWrapInfluence() const
SwLayoutFrame * GetUpper()
Definition: frame.hxx:656
SwTextFrame & GetFrameAtOfst(TextFrameIndex nOfst)
Definition: frmcrsr.cxx:144
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:655
SwPageFrame * mpPageFrame
bool GetTopOfLine(SwTwips &_onTopOfLine, const SwPosition &_rPos) const
Determine top of line for given position in the text frame.
Definition: frmcrsr.cxx:454
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:119
const IDocumentSettingAccess & getIDocumentSettingAccess() const
Provides access to the document settings interface.
Definition: format.cxx:757
void SSize(const Size &rNew)
Definition: swrect.hxx:176
virtual const SwAnchoredObject * GetAnchoredObj(const SdrObject *_pSdrObj) const =0
A page of the document layout.
Definition: pagefrm.hxx:40
SwFrame * GetAnchorFrameContainingAnchPos()
determine anchor frame containing the anchor position
bool RestartLayoutProcess() const
SwFrame * FindColFrame()
Definition: findfrm.cxx:529
bool GetAutoPos(SwRect &, const SwPosition &) const
A slimmer version of GetCharRect for autopositioning Frames.
Definition: frmcrsr.cxx:367
bool IsLayoutFrame() const
Definition: frame.hxx:1146
void Left(const long nLeft)
Definition: swrect.hxx:193
void Bottom(const long nBottom)
Definition: swrect.hxx:207
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:1194
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:963
const_iterator begin() const
Definition: sortedobjs.hxx:66
void InvalidateObjRectWithSpaces() const
bool IsPageFrame() const
Definition: frame.hxx:1154
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
long GetHeight(const SwRect &rRect) const
Definition: frame.hxx:1358
size_t ListPosOf(const SwAnchoredObject &_rAnchoredObj) const
Position of object <_rAnchoredObj> in sorted list.
Definition: sortedobjs.cxx:275
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
long GetRight() const
void SetObjLeft(const SwTwips _nLeft)
bool IsVertical() const
Definition: frame.hxx:949
long GetTop(const SwRect &rRect) const
Definition: frame.hxx:1353
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:298
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 IsOver(const SwRect &rRect) const
Definition: swrect.cxx:125
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)
virtual void SetLayoutDir(const SwFrameFormat::tLayoutDir _eLayoutDir)
Definition: atrfrm.cxx:2773
void AddLastCharY(long nDiff)
sal_uInt16 GetUpper() const
void AddLastTopOfLineY(SwTwips _nDiff)
virtual ~SwAnchoredObject()
SwFrame * GetNext()
Definition: frame.hxx:654
const SvxLRSpaceItem & GetLRSpace(bool=true) const
Definition: frmatr.hxx:74
SwFrame * mpAnchorFrame