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 <pam.hxx>
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  maRelPos(),
76  maLastCharRect(),
77  mnLastTopOfLine( 0 ),
78  mpVertPosOrientFrame( nullptr ),
79  // --> #i28701#
80  mbPositioningInProgress( false ),
81  mbConsiderForTextWrap( false ),
82  mbPositionLocked( false ),
83  // --> #i40147#
84  mbKeepPositionLockedForSection( false ),
85  mbRestartLayoutProcess( false ),
86  // --> #i35911#
87  mbClearedEnvironment( false ),
88  // --> #i3317#
89  mbTmpConsiderWrapInfluence( false ),
90  // --> #i68520#
91  maObjRectWithSpaces(),
92  mbObjRectWithSpacesValid( false ),
93  maLastObjRect()
94 {
95 }
96 
98 {
100  {
101  const_cast<SwLayoutFrame*>(mpVertPosOrientFrame)->ClearVertPosOrientFrameFor(this);
102  mpVertPosOrientFrame = nullptr;
103  }
104 }
105 
107 {
109 }
110 
112 {
113  mpDrawObj = &_rDrawObj;
114 }
115 
116 
117 void SwAnchoredObject::ChgAnchorFrame( SwFrame* _pNewAnchorFrame )
118 {
119  mpAnchorFrame = _pNewAnchorFrame;
120 
121  if ( mpAnchorFrame )
122  {
124  }
125 }
126 
136 {
137  SwFrame* pAnchorFrameContainingAnchPos = FindAnchorCharFrame();
138  if ( !pAnchorFrameContainingAnchPos )
139  {
140  pAnchorFrameContainingAnchPos = AnchorFrame();
141  }
142 
143  return pAnchorFrameContainingAnchPos;
144 }
145 
146 
148 {
149  if ( mpPageFrame != _pNewPageFrame )
150  {
151  // clear member, which denotes the layout frame at which the vertical
152  // position is oriented at, if it doesn't fit to the new page frame.
153  if ( GetVertPosOrientFrame() &&
154  ( !_pNewPageFrame ||
155  _pNewPageFrame != GetVertPosOrientFrame()->FindPageFrame() ) )
156  {
158  }
159 
160  // assign new page frame
161  mpPageFrame = _pNewPageFrame;
162  }
163 }
164 
165 
167 {
168  return maLastCharRect.Left() - pFrame->getFrameArea().Left();
169 }
170 
172 {
173  return maLastCharRect.Bottom() - pFrame->getFrameArea().Top();
174 }
175 
177 {
178  maLastCharRect.Pos().AdjustY(nDiff );
179 }
180 
182 {
183  maLastCharRect.Height( 0 );
184 }
185 
186 void SwAnchoredObject::SetVertPosOrientFrame( const SwLayoutFrame& _rVertPosOrientFrame )
187 {
189 
190  mpVertPosOrientFrame = &_rVertPosOrientFrame;
191  const_cast<SwLayoutFrame*>(mpVertPosOrientFrame)->SetVertPosOrientFrameFor(this);
192 
193  // #i28701# - take over functionality of deleted method
194  // <SwFlyAtContentFrame::AssertPage()>: assure for at-paragraph and at-character
195  // an anchored object, that it is registered at the correct page frame
197 }
198 
199 
200 // #i28701# - follow-up of #i22341#
202 {
203  mnLastTopOfLine += _nDiff;
204 }
205 
217  const bool _bCheckForParaPorInf )
218 {
219  if ( GetAnchorFrame() &&
220  GetAnchorFrame()->IsTextFrame() )
221  {
222  const SwFormatAnchor& rAnch = GetFrameFormat().GetAnchor();
223  if ( (rAnch.GetAnchorId() == RndStdIds::FLY_AT_CHAR) &&
224  rAnch.GetContentAnchor() )
225  {
226  // --> if requested, assure that anchor frame,
227  // which contains the anchor character, has a paragraph portion information.
228  // The paragraph portion information is needed to determine the
229  // anchor character rectangle respectively the top of the line.
230  // Thus, a format of this frame is avoided to determine the
231  // paragraph portion information.
232  // --> #i26945# - use new method <FindAnchorCharFrame()>
233  const SwTextFrame& aAnchorCharFrame = *(FindAnchorCharFrame());
234  if ( !_bCheckForParaPorInf || aAnchorCharFrame.HasPara() )
235  {
236  CheckCharRect( rAnch, aAnchorCharFrame );
237  CheckTopOfLine( rAnch, aAnchorCharFrame );
238  }
239  }
240  }
241 }
242 
254  const SwTextFrame& _rAnchorCharFrame )
255 {
256  // determine rectangle of anchor character. If not exist, abort operation
257  SwRect aCharRect;
258  if ( !_rAnchorCharFrame.GetAutoPos( aCharRect, *_rAnch.GetContentAnchor() ) )
259  {
260  return;
261  }
262  // check, if anchor character rectangle has changed
263  if ( aCharRect != maLastCharRect )
264  {
265  // check positioning and alignment for invalidation of position
266  {
267  SwRectFnSet aRectFnSet(&_rAnchorCharFrame);
268  // determine positioning and alignment
269  SwFormatVertOrient aVert( GetFrameFormat().GetVertOrient() );
270  SwFormatHoriOrient aHori( GetFrameFormat().GetHoriOrient() );
271  // check for anchor character rectangle changes for certain
272  // positionings and alignments
273  // add condition to invalidate position,
274  // if vertical aligned at frame/page area and vertical position
275  // of anchor character has changed.
276  const sal_Int16 eVertRelOrient = aVert.GetRelationOrient();
277  if ( ( aHori.GetRelationOrient() == text::RelOrientation::CHAR &&
278  aRectFnSet.GetLeft(aCharRect) != aRectFnSet.GetLeft(maLastCharRect) ) ||
279  ( eVertRelOrient == text::RelOrientation::CHAR &&
280  ( aRectFnSet.GetTop(aCharRect) != aRectFnSet.GetTop(maLastCharRect) ||
281  aRectFnSet.GetHeight(aCharRect) != aRectFnSet.GetHeight(maLastCharRect) ) ) ||
282  ( ( ( eVertRelOrient == text::RelOrientation::FRAME ) ||
283  ( eVertRelOrient == text::RelOrientation::PRINT_AREA ) ||
284  ( eVertRelOrient == text::RelOrientation::PAGE_FRAME ) ||
285  ( eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA ) ) &&
286  ( aRectFnSet.GetTop(aCharRect) != aRectFnSet.GetTop(maLastCharRect) ) ) )
287  {
288  // #i26945#, #i35911# - unlock position of
289  // anchored object, if it isn't registered at the page,
290  // where its anchor character frame is on.
291  if ( GetPageFrame() != _rAnchorCharFrame.FindPageFrame() )
292  {
293  UnlockPosition();
294  }
296  }
297  }
298  // keep new anchor character rectangle
299  maLastCharRect = aCharRect;
300  }
301 }
302 
314  const SwTextFrame& _rAnchorCharFrame )
315 {
316  SwTwips nTopOfLine = 0;
317  if ( _rAnchorCharFrame.GetTopOfLine( nTopOfLine, *_rAnch.GetContentAnchor() ) )
318  {
319  if ( nTopOfLine != mnLastTopOfLine )
320  {
321  // check alignment for invalidation of position
322  if ( GetFrameFormat().GetVertOrient().GetRelationOrient() == text::RelOrientation::TEXT_LINE )
323  {
324  // #i26945#, #i35911# - unlock position of
325  // anchored object, if it isn't registered at the page,
326  // where its anchor character frame is on.
327  if ( GetPageFrame() != _rAnchorCharFrame.FindPageFrame() )
328  {
329  UnlockPosition();
330  }
332  }
333  // keep new top of line value
334  mnLastTopOfLine = nTopOfLine;
335  }
336  }
337 }
338 
340 {
342  mnLastTopOfLine = 0;
343 }
344 
346 {
347  maRelPos = _aRelPos;
348 }
349 
351 {
352  // default behaviour:
353  // update layout direction, the anchored object is assigned to
354  UpdateLayoutDir();
355 }
356 
365 {
367  const SwFrame* pAnchorFrame = GetAnchorFrame();
368  if ( pAnchorFrame )
369  {
370  const bool bVert = pAnchorFrame->IsVertical();
371  const bool bR2L = pAnchorFrame->IsRightToLeft();
372  if ( bVert )
373  {
374  nLayoutDir = SwFrameFormat::VERT_R2L;
375  }
376  else if ( bR2L )
377  {
378  nLayoutDir = SwFrameFormat::HORI_R2L;
379  }
380  }
381  GetFrameFormat().SetLayoutDir( nLayoutDir );
382 }
383 
391 {
393  {
394  // indicate that object has not to be considered for text wrap
395  SetConsiderForTextWrap( false );
396  // unlock position
397  UnlockPosition();
398  // invalidate position
400  // invalidate 'background'
402  }
403 }
404 
413 {
414  bool bRet( false );
415 
416  const SwFrameFormat& rObjFormat = GetFrameFormat();
417 
418  // --> #i3317# - add condition <IsTmpConsiderWrapInfluence()>
419  // --> #i55204#
420  // - correction: wrapping style influence has been considered, if condition
421  // <IsTmpConsiderWrapInfluence()> is hold, regardless of its anchor type
422  // or its wrapping style.
424  {
425  bRet = true;
426  }
428  {
429  const SwFormatAnchor& rAnchor = rObjFormat.GetAnchor();
430  if ( ((rAnchor.GetAnchorId() == RndStdIds::FLY_AT_CHAR) ||
431  (rAnchor.GetAnchorId() == RndStdIds::FLY_AT_PARA)) &&
432  rObjFormat.GetSurround().GetSurround() != css::text::WrapTextMode_THROUGH )
433  {
434  // --> #i34520# - text also wraps around anchored
435  // objects in the layer Hell - see the text formatting.
436  // Thus, it hasn't to be checked here.
437  bRet = true;
438  }
439  }
440 
441  return bRet;
442 }
443 
450 {
451  bool bRet( false );
452 
453  const SwSortedObjs* pObjs = GetAnchorFrame()->GetDrawObjs();
454  if ( pObjs->size() > 1 )
455  {
456  for (SwAnchoredObject* pAnchoredObj : *pObjs)
457  {
458  if ( pAnchoredObj != this &&
459  pAnchoredObj->ConsiderObjWrapInfluenceOnObjPos() )
460  {
461  bRet = true;
462  break;
463  }
464  }
465  }
466 
467  return bRet;
468 }
469 
471 {
473  return mbConsiderForTextWrap;
474  else
475  return true;
476 }
477 
478 void SwAnchoredObject::SetConsiderForTextWrap( const bool _bConsiderForTextWrap )
479 {
480  mbConsiderForTextWrap = _bConsiderForTextWrap;
481 }
482 
484 {
486  return mbPositionLocked;
487  else
488  return false;
489 }
490 
492 {
494  return mbRestartLayoutProcess;
495  else
496  return false;
497 }
498 
499 void SwAnchoredObject::SetRestartLayoutProcess( const bool _bRestartLayoutProcess )
500 {
501  mbRestartLayoutProcess = _bRestartLayoutProcess;
502 }
503 
504 // --> #i35911#
506 {
508  return mbClearedEnvironment;
509  else
510  return false;
511 }
512 void SwAnchoredObject::SetClearedEnvironment( const bool _bClearedEnvironment )
513 {
514  mbClearedEnvironment = _bClearedEnvironment;
515 }
516 
523 {
524  bool bHasClearedEnvironment( false );
525 
526  // --> #i43913# - layout frame, vertical position is orient at, has to be set.
527  OSL_ENSURE( GetVertPosOrientFrame(),
528  "<SwAnchoredObject::HasClearedEnvironment()> - layout frame missing, at which the vertical position is oriented at." );
529  if ( GetVertPosOrientFrame() &&
530  GetAnchorFrame()->IsTextFrame() &&
531  !static_cast<const SwTextFrame*>(GetAnchorFrame())->IsFollow() &&
532  static_cast<const SwTextFrame*>(GetAnchorFrame())->FindPageFrame()->GetPhyPageNum() >=
533  GetPageFrame()->GetPhyPageNum() )
534  {
535  const SwFrame* pTmpFrame = GetVertPosOrientFrame()->Lower();
536  while ( pTmpFrame && pTmpFrame->IsLayoutFrame() && !pTmpFrame->IsTabFrame() )
537  {
538  pTmpFrame = static_cast<const SwLayoutFrame*>(pTmpFrame)->Lower();
539  }
540  if ( !pTmpFrame )
541  {
542  bHasClearedEnvironment = true;
543  }
544  else if ( pTmpFrame->IsTextFrame() && !pTmpFrame->GetNext() )
545  {
546  const SwTextFrame* pTmpTextFrame = static_cast<const SwTextFrame*>(pTmpFrame);
547  if ( pTmpTextFrame->IsUndersized() ||
548  ( pTmpTextFrame->GetFollow() &&
549  pTmpTextFrame->GetFollow()->GetOfst() == TextFrameIndex(0)))
550  {
551  bHasClearedEnvironment = true;
552  }
553  }
554  }
555 
556  return bHasClearedEnvironment;
557 }
558 
565 {
568  {
569  OSL_FAIL( "<SwAnchoredObject::GetObjRectWithSpaces> - cache for object rectangle inclusive spaces marked as valid, but it couldn't be. Missing invalidation of cache." );
571  }
573  {
575  const SwFrameFormat& rFormat = GetFrameFormat();
576  const SvxULSpaceItem& rUL = rFormat.GetULSpace();
577  const SvxLRSpaceItem& rLR = rFormat.GetLRSpace();
578  {
579  maObjRectWithSpaces.Top ( std::max( maObjRectWithSpaces.Top() - long(rUL.GetUpper()), 0L ));
580  maObjRectWithSpaces.Left( std::max( maObjRectWithSpaces.Left()- rLR.GetLeft(), 0L ));
581  maObjRectWithSpaces.SSize().AdjustHeight(rUL.GetLower() );
582  maObjRectWithSpaces.SSize().AdjustWidth(rLR.GetRight() );
583  }
584 
587  }
588 
589  return maObjRectWithSpaces;
590 }
591 
592 // --> #i68520#
594 {
595  const bool bTopChanged( SetObjTop_( _nTop ) );
596  if ( bTopChanged )
597  {
598  mbObjRectWithSpacesValid = false;
599  }
600 }
601 
603 {
604  const bool bLeftChanged( SetObjLeft_( _nLeft ) );
605  if ( bLeftChanged )
606  {
607  mbObjRectWithSpacesValid = false;
608  }
609 }
610 
620 {
621  if ( GetAnchorFrame() )
622  {
623  if ( GetFrameFormat().getIDocumentSettingAccess().get(DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION) )
624  {
625  // invalidate position of all anchored objects at anchor frame
626  if ( GetAnchorFrame()->GetDrawObjs() )
627  {
628  const SwSortedObjs* pObjs = GetAnchorFrame()->GetDrawObjs();
629  // determine start index
630  for (auto it = pObjs->begin(); it != pObjs->end(); ++it)
631  {
632  SwAnchoredObject* pAnchoredObj = *it;
633  if ( pAnchoredObj->ConsiderObjWrapInfluenceOnObjPos() )
635  else
636  pAnchoredObj->InvalidateObjPos();
637  }
638  }
639  // invalidate all following anchored objects on the page frame
640  if ( GetPageFrame() && GetPageFrame()->GetSortedObjs() )
641  {
642  const SwSortedObjs* pObjs = GetPageFrame()->GetSortedObjs();
643  // determine start index
644  for ( size_t i = pObjs->ListPosOf( *this ) + 1; i < pObjs->size(); ++i )
645  {
646  SwAnchoredObject* pAnchoredObj = (*pObjs)[i];
647  if ( pAnchoredObj->ConsiderObjWrapInfluenceOnObjPos() )
649  else
650  pAnchoredObj->InvalidateObjPos();
651  }
652  }
653  }
654  // update its position in the sorted object list of its anchor frame
655  AnchorFrame()->GetDrawObjs()->Update( *this );
656  // update its position in the sorted object list of its page frame
657  // note: as-character anchored object aren't registered at a page frame
658  if ( GetFrameFormat().GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR )
659  {
660  GetPageFrame()->GetSortedObjs()->Update( *this );
661  }
662  }
663 }
664 
670 {
671  // --> Check, if page frame layout is in progress,
672  // isn't needed, because of anchored object, whose are moved forward.
673  return !PositionLocked();
674 }
675 
687 {
688  SwPageFrame* pRetPageFrame = nullptr;
689 
690  // --> #i44339# - check, if anchor frame exists.
691  if ( mpAnchorFrame )
692  {
693  // --> #i26945# - use new method <GetAnchorFrameContainingAnchPos()>
694  pRetPageFrame = GetAnchorFrameContainingAnchPos()->FindPageFrame();
695  }
696 
697  return pRetPageFrame;
698 }
699 
710 {
711  SwTextFrame* pAnchorCharFrame( nullptr );
712 
713  // --> #i44339# - check, if anchor frame exists.
714  if ( mpAnchorFrame )
715  {
716  const SwFormatAnchor& rAnch = GetFrameFormat().GetAnchor();
717  if ((rAnch.GetAnchorId() == RndStdIds::FLY_AT_CHAR) ||
718  (rAnch.GetAnchorId() == RndStdIds::FLY_AS_CHAR))
719  {
720  SwTextFrame *const pFrame(static_cast<SwTextFrame*>(AnchorFrame()));
721  TextFrameIndex const nOffset(pFrame->MapModelToViewPos(*rAnch.GetContentAnchor()));
722  pAnchorCharFrame = &pFrame->GetFrameAtOfst(nOffset);
723  }
724  }
725 
726  return pAnchorCharFrame;
727 }
728 
736 {
738 }
739 
740 // --> #i3317#
741 void SwAnchoredObject::SetTmpConsiderWrapInfluence( const bool _bTmpConsiderWrapInfluence )
742 {
743  mbTmpConsiderWrapInfluence = _bTmpConsiderWrapInfluence;
744  // --> #i35911#
746  {
748  *this );
749  }
750 }
751 
753 {
755  mbClearedEnvironment = false;
756  SetClearedEnvironment( false );
758  *this );
759 }
761 {
762  const SwSortedObjs* pObjs = GetAnchorFrame()->GetDrawObjs();
763  if ( pObjs->size() > 1 )
764  {
765  for (SwAnchoredObject* pAnchoredObj : *pObjs)
766  {
767  if ( pAnchoredObj != this )
768  {
769  pAnchoredObj->SetTmpConsiderWrapInfluence( true/*bTmpConsiderWrapInfluence*/ );
770  }
771  }
772  }
773 }
774 
785 {
786  bool bOverlapsPrevColumn( false );
787 
789  {
790  const SwFrame* pColFrame = mpAnchorFrame->FindColFrame();
791  if ( pColFrame && pColFrame->GetPrev() )
792  {
793  const SwFrame* pTmpColFrame = pColFrame->GetPrev();
794  SwRect aChkRect;
795  while ( pTmpColFrame )
796  {
797  aChkRect.Union( pTmpColFrame->getFrameArea() );
798  pTmpColFrame = pTmpColFrame->GetPrev();
799  }
800  bOverlapsPrevColumn = GetObjRect().IsOver( aChkRect );
801  }
802  }
803 
804  return bOverlapsPrevColumn;
805 }
806 
814 {
815  Point aRelPos;
816 
817  assert(GetAnchorFrame());
818  aRelPos = GetObjRect().Pos();
819  aRelPos -= GetAnchorFrame()->getFrameArea().Pos();
820 
821  return aRelPos;
822 }
823 
835 Point SwAnchoredObject::GetRelPosToPageFrame( const bool _bFollowTextFlow,
836  bool& _obRelToTableCell ) const
837 {
838  Point aRelPos;
839  _obRelToTableCell = false;
840 
841  assert(GetAnchorFrame());
842  assert(GetAnchorFrame()->FindPageFrame());
843 
844  aRelPos = GetObjRect().Pos();
845  // --> #i33818# - search for cell frame, if object has to
846  // follow the text flow.
847  const SwFrame* pFrame( nullptr );
848  if ( _bFollowTextFlow && !GetAnchorFrame()->IsPageFrame() )
849  {
850  pFrame = GetAnchorFrame()->GetUpper();
851  while ( !pFrame->IsCellFrame() && !pFrame->IsPageFrame() )
852  {
853  pFrame = pFrame->GetUpper();
854  }
855  }
856  else
857  {
858  pFrame = GetAnchorFrame()->FindPageFrame();
859  }
860  if ( pFrame->IsCellFrame() )
861  {
862  aRelPos -= pFrame->getFrameArea().Pos() + pFrame->getFramePrintArea().Pos();
863  _obRelToTableCell = true;
864  }
865  else
866  {
867  aRelPos -= pFrame->getFrameArea().Pos();
868  }
869 
870  return aRelPos;
871 }
872 
880 {
881  Point aRelPos = GetObjRect().Pos();
882  aRelPos -= GetLastCharRect().Pos();
883 
884  return aRelPos;
885 }
886 
894 {
895  Point aRelPos = GetObjRect().Pos();
896  aRelPos.AdjustY( -(GetLastTopOfLine()) );
897 
898  return aRelPos;
899 }
900 
901 /* 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:176
static void InsertObjForTmpConsiderWrapInfluence(const SwDoc &_rDoc, SwAnchoredObject &_rAnchoredObj)
Definition: layouter.cxx:391
virtual SwRect GetObjBoundRect() const =0
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:187
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:100
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
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:2759
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