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  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  return;
151 
152  // clear member, which denotes the layout frame at which the vertical
153  // position is oriented at, if it doesn't fit to the new page frame.
154  if ( GetVertPosOrientFrame() &&
155  ( !_pNewPageFrame ||
156  _pNewPageFrame != GetVertPosOrientFrame()->FindPageFrame() ) )
157  {
159  }
160 
161  // assign new page frame
162  mpPageFrame = _pNewPageFrame;
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  return;
222 
223  const SwFormatAnchor& rAnch = GetFrameFormat().GetAnchor();
224  if ( !((rAnch.GetAnchorId() == RndStdIds::FLY_AT_CHAR) &&
225  rAnch.GetContentAnchor()) )
226  return;
227 
228  // --> if requested, assure that anchor frame,
229  // which contains the anchor character, has a paragraph portion information.
230  // The paragraph portion information is needed to determine the
231  // anchor character rectangle respectively the top of the line.
232  // Thus, a format of this frame is avoided to determine the
233  // paragraph portion information.
234  // --> #i26945# - use new method <FindAnchorCharFrame()>
235  const SwTextFrame& aAnchorCharFrame = *(FindAnchorCharFrame());
236  if ( !_bCheckForParaPorInf || aAnchorCharFrame.HasPara() )
237  {
238  CheckCharRect( rAnch, aAnchorCharFrame );
239  CheckTopOfLine( rAnch, aAnchorCharFrame );
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  return;
265 
266  // check positioning and alignment for invalidation of position
267  {
268  SwRectFnSet aRectFnSet(&_rAnchorCharFrame);
269  // determine positioning and alignment
270  SwFormatVertOrient aVert( GetFrameFormat().GetVertOrient() );
271  SwFormatHoriOrient aHori( GetFrameFormat().GetHoriOrient() );
272  // check for anchor character rectangle changes for certain
273  // positionings and alignments
274  // add condition to invalidate position,
275  // if vertical aligned at frame/page area and vertical position
276  // of anchor character has changed.
277  const sal_Int16 eVertRelOrient = aVert.GetRelationOrient();
278  if ( ( aHori.GetRelationOrient() == text::RelOrientation::CHAR &&
279  aRectFnSet.GetLeft(aCharRect) != aRectFnSet.GetLeft(maLastCharRect) ) ||
280  ( eVertRelOrient == text::RelOrientation::CHAR &&
281  ( aRectFnSet.GetTop(aCharRect) != aRectFnSet.GetTop(maLastCharRect) ||
282  aRectFnSet.GetHeight(aCharRect) != aRectFnSet.GetHeight(maLastCharRect) ) ) ||
283  ( ( ( eVertRelOrient == text::RelOrientation::FRAME ) ||
284  ( eVertRelOrient == text::RelOrientation::PRINT_AREA ) ||
285  ( eVertRelOrient == text::RelOrientation::PAGE_FRAME ) ||
286  ( eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA ) ) &&
287  ( aRectFnSet.GetTop(aCharRect) != aRectFnSet.GetTop(maLastCharRect) ) ) )
288  {
289  // #i26945#, #i35911# - unlock position of
290  // anchored object, if it isn't registered at the page,
291  // where its anchor character frame is on.
292  if ( GetPageFrame() != _rAnchorCharFrame.FindPageFrame() )
293  {
294  UnlockPosition();
295  }
297  }
298  }
299  // keep new anchor character rectangle
300  maLastCharRect = aCharRect;
301 }
302 
314  const SwTextFrame& _rAnchorCharFrame )
315 {
316  SwTwips nTopOfLine = 0;
317  if ( !_rAnchorCharFrame.GetTopOfLine( nTopOfLine, *_rAnch.GetContentAnchor() ) )
318  return;
319 
320  if ( nTopOfLine == mnLastTopOfLine )
321  return;
322 
323  // check alignment for invalidation of position
324  if ( GetFrameFormat().GetVertOrient().GetRelationOrient() == text::RelOrientation::TEXT_LINE )
325  {
326  // #i26945#, #i35911# - unlock position of
327  // anchored object, if it isn't registered at the page,
328  // where its anchor character frame is on.
329  if ( GetPageFrame() != _rAnchorCharFrame.FindPageFrame() )
330  {
331  UnlockPosition();
332  }
334  }
335  // keep new top of line value
336  mnLastTopOfLine = nTopOfLine;
337 }
338 
340 {
342  mnLastTopOfLine = 0;
343 }
344 
345 void SwAnchoredObject::SetCurrRelPos( Point _aRelPos )
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()->GetOffset() == 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  {
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 
621 {
622  if(!GetAnchorFrame())
623  return;
624 
625  if ( GetFrameFormat().getIDocumentSettingAccess().get(DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION) )
626  {
627  // invalidate position of all anchored objects at anchor frame
628  if ( GetAnchorFrame()->GetDrawObjs() )
629  {
630  const SwSortedObjs* pObjs = GetAnchorFrame()->GetDrawObjs();
631  for(auto it = pObjs->begin(); it != pObjs->end(); ++it)
632  {
633  SwAnchoredObject* pAnchoredObj = *it;
634  if(pAnchoredObj->ConsiderObjWrapInfluenceOnObjPos())
636  else
637  pAnchoredObj->InvalidateObjPos();
638  }
639  }
640  // invalidate all following anchored objects on the page frame
641  if ( GetPageFrame() && GetPageFrame()->GetSortedObjs() )
642  {
643  const SwSortedObjs* pObjs = GetPageFrame()->GetSortedObjs();
644  // determine start index
645  for ( size_t i = pObjs->ListPosOf( *this ) + 1; i < pObjs->size(); ++i )
646  {
647  SwAnchoredObject* pAnchoredObj = (*pObjs)[i];
648  if ( pAnchoredObj->ConsiderObjWrapInfluenceOnObjPos() )
650  else
651  pAnchoredObj->InvalidateObjPos();
652  }
653  }
654  }
655  // update its position in the sorted object list of its anchor frame
656  AnchorFrame()->GetDrawObjs()->Update( *this );
657  // update its position in the sorted object list of its page frame
658  // note: as-character anchored object aren't registered at a page frame
659  if ( GetFrameFormat().GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR )
660  {
661  GetPageFrame()->GetSortedObjs()->Update( *this );
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 
741 {
742  OSL_ASSERT(pFrameFormat);
743  const bool bDisablePositioning = pFrameFormat->getIDocumentSettingAccess().get(DocumentSettingId::DISABLE_OFF_PAGE_POSITIONING);
744  const bool bIsWrapThrough = pFrameFormat->GetSurround().GetSurround() == text::WrapTextMode::WrapTextMode_THROUGH;
745 
746  return bDisablePositioning && bIsWrapThrough;
747 }
748 
749 // --> #i3317#
750 void SwAnchoredObject::SetTmpConsiderWrapInfluence( const bool _bTmpConsiderWrapInfluence )
751 {
752  mbTmpConsiderWrapInfluence = _bTmpConsiderWrapInfluence;
753  // --> #i35911#
755  {
757  *this );
758  }
759 }
760 
762 {
764  mbClearedEnvironment = false;
765  SetClearedEnvironment( false );
767  *this );
768 }
770 {
771  const SwSortedObjs* pObjs = GetAnchorFrame()->GetDrawObjs();
772  if ( pObjs->size() > 1 )
773  {
774  for (SwAnchoredObject* pAnchoredObj : *pObjs)
775  {
776  if ( pAnchoredObj != this )
777  {
778  pAnchoredObj->SetTmpConsiderWrapInfluence( true/*bTmpConsiderWrapInfluence*/ );
779  }
780  }
781  }
782 }
783 
794 {
795  bool bOverlapsPrevColumn( false );
796 
798  {
799  const SwFrame* pColFrame = mpAnchorFrame->FindColFrame();
800  if ( pColFrame && pColFrame->GetPrev() )
801  {
802  const SwFrame* pTmpColFrame = pColFrame->GetPrev();
803  SwRect aChkRect;
804  while ( pTmpColFrame )
805  {
806  aChkRect.Union( pTmpColFrame->getFrameArea() );
807  pTmpColFrame = pTmpColFrame->GetPrev();
808  }
809  bOverlapsPrevColumn = GetObjRect().IsOver( aChkRect );
810  }
811  }
812 
813  return bOverlapsPrevColumn;
814 }
815 
823 {
824  Point aRelPos;
825 
827  aRelPos = GetObjRect().Pos();
828  aRelPos -= GetAnchorFrame()->getFrameArea().Pos();
829 
830  return aRelPos;
831 }
832 
844 Point SwAnchoredObject::GetRelPosToPageFrame( const bool _bFollowTextFlow,
845  bool& _obRelToTableCell ) const
846 {
847  Point aRelPos;
848  _obRelToTableCell = false;
849 
851  assert(GetAnchorFrame()->FindPageFrame());
852 
853  aRelPos = GetObjRect().Pos();
854  // --> #i33818# - search for cell frame, if object has to
855  // follow the text flow.
856  const SwFrame* pFrame( nullptr );
857  if ( _bFollowTextFlow && !GetAnchorFrame()->IsPageFrame() )
858  {
859  pFrame = GetAnchorFrame()->GetUpper();
860  while ( !pFrame->IsCellFrame() && !pFrame->IsPageFrame() )
861  {
862  pFrame = pFrame->GetUpper();
863  }
864  }
865  else
866  {
867  pFrame = GetAnchorFrame()->FindPageFrame();
868  }
869  if ( pFrame->IsCellFrame() )
870  {
871  aRelPos -= pFrame->getFrameArea().Pos() + pFrame->getFramePrintArea().Pos();
872  _obRelToTableCell = true;
873  }
874  else
875  {
876  aRelPos -= pFrame->getFrameArea().Pos();
877  }
878 
879  return aRelPos;
880 }
881 
889 {
890  Point aRelPos = GetObjRect().Pos();
891  aRelPos -= GetLastCharRect().Pos();
892 
893  return aRelPos;
894 }
895 
903 {
904  Point aRelPos = GetObjRect().Pos();
905  aRelPos.AdjustY( -(GetLastTopOfLine()) );
906 
907  return aRelPos;
908 }
909 
910 /* 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:298
const SwRect & GetLastCharRect() const
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:157
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:548
void SetClearedEnvironment(const bool _bClearedEnvironment)
SwRect & Union(const SwRect &rRect)
Definition: swrect.cxx:41
const SwLayoutFrame * mpVertPosOrientFrame
sal_uInt16 GetLower() const
bool HasPara() const
Definition: txtfrm.hxx:816
const SwFormatVertOrient & GetVertOrient(bool=true) const
Definition: fmtornt.hxx:106
void Left(const tools::Long nLeft)
Definition: swrect.hxx:195
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:179
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:169
void SetTmpConsiderWrapInfluenceOfOtherObjs()
method to apply temporary consideration of wrapping style influence to the anchored objects...
bool IsCellFrame() const
Definition: frame.hxx:1207
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
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:1358
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:178
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
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:1215
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:1360
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:852
TextFrameIndex GetOffset() const
Definition: txtfrm.hxx:435
void SetObjTop(const SwTwips _nTop)
bool ConsiderForTextWrap() const
SwObjPositioningInProgress(SdrObject &_rSdrObj)
Style of a layout element.
Definition: frmfmt.hxx:58
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:1259
const SdrObject * GetDrawObj() const
void CheckTopOfLine(const SwFormatAnchor &_rAnch, const SwTextFrame &_rAnchorCharFrame)
check top of line
const SwSortedObjs * GetSortedObjs() const
Definition: pagefrm.hxx:116
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:663
const SwFrame * Lower() const
Definition: layfrm.hxx:101
tools::Long GetHeight(const SwRect &rRect) const
Definition: frame.hxx:1363
FlyAnchors.
Definition: fmtanchr.hxx:34
tools::Long GetLeft() const
const SwFrame * mpAnchorFrame
bool IsTmpConsiderWrapInfluence() const
SwLayoutFrame * GetUpper()
Definition: frame.hxx:661
SwTextFrame & GetFrameAtOfst(TextFrameIndex nOfst)
Definition: frmcrsr.cxx:143
void AddHeight(const tools::Long nAdd)
Definition: swrect.cxx:161
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:660
SwPageFrame * mpPageFrame
void AddWidth(const tools::Long nAdd)
Definition: swrect.cxx:160
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:41
SwFrame * GetAnchorFrameContainingAnchPos()
determine anchor frame containing the anchor position
tools::Long SwTwips
Definition: swtypes.hxx:49
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:1151
void Bottom(const tools::Long nBottom)
Definition: swrect.hxx:209
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:1199
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:968
void Top(const tools::Long nTop)
Definition: swrect.hxx:204
const_iterator begin() const
Definition: sortedobjs.hxx:66
void InvalidateObjRectWithSpaces() const
bool IsPageFrame() const
Definition: frame.hxx:1159
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:954
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:296
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:123
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:191
virtual void SetLayoutDir(const SwFrameFormat::tLayoutDir _eLayoutDir)
Definition: atrfrm.cxx:2786
sal_uInt16 GetUpper() const
void AddLastTopOfLineY(SwTwips _nDiff)
virtual ~SwAnchoredObject()
SwFrame * GetNext()
Definition: frame.hxx:659
const SvxLRSpaceItem & GetLRSpace(bool=true) const
Definition: frmatr.hxx:74
SwFrame * mpAnchorFrame