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  return;
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 
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  return;
221 
222  const SwFormatAnchor& rAnch = GetFrameFormat().GetAnchor();
223  if ( !((rAnch.GetAnchorId() == RndStdIds::FLY_AT_CHAR) &&
224  rAnch.GetContentAnchor()) )
225  return;
226 
227  // --> if requested, assure that anchor frame,
228  // which contains the anchor character, has a paragraph portion information.
229  // The paragraph portion information is needed to determine the
230  // anchor character rectangle respectively the top of the line.
231  // Thus, a format of this frame is avoided to determine the
232  // paragraph portion information.
233  // --> #i26945# - use new method <FindAnchorCharFrame()>
234  const SwTextFrame& aAnchorCharFrame = *(FindAnchorCharFrame());
235  if ( !_bCheckForParaPorInf || aAnchorCharFrame.HasPara() )
236  {
237  CheckCharRect( rAnch, aAnchorCharFrame );
238  CheckTopOfLine( rAnch, aAnchorCharFrame );
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  return;
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 
313  const SwTextFrame& _rAnchorCharFrame )
314 {
315  SwTwips nTopOfLine = 0;
316  if ( !_rAnchorCharFrame.GetTopOfLine( nTopOfLine, *_rAnch.GetContentAnchor() ) )
317  return;
318 
319  if ( nTopOfLine == mnLastTopOfLine )
320  return;
321 
322  // check alignment for invalidation of position
323  if ( GetFrameFormat().GetVertOrient().GetRelationOrient() == text::RelOrientation::TEXT_LINE )
324  {
325  // #i26945#, #i35911# - unlock position of
326  // anchored object, if it isn't registered at the page,
327  // where its anchor character frame is on.
328  if ( GetPageFrame() != _rAnchorCharFrame.FindPageFrame() )
329  {
330  UnlockPosition();
331  }
333  }
334  // keep new top of line value
335  mnLastTopOfLine = nTopOfLine;
336 }
337 
339 {
341  mnLastTopOfLine = 0;
342 }
343 
344 void SwAnchoredObject::SetCurrRelPos( Point _aRelPos )
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()->GetOffset() == 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() - tools::Long(rUL.GetUpper()), 0L ));
579  maObjRectWithSpaces.Left( std::max( maObjRectWithSpaces.Left()- rLR.GetLeft(), 0L ));
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  return;
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 
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 
740 {
741  OSL_ASSERT(pFrameFormat);
742  const bool bDisablePositioning = pFrameFormat->getIDocumentSettingAccess().get(DocumentSettingId::DISABLE_OFF_PAGE_POSITIONING);
743  const bool bIsWrapThrough = pFrameFormat->GetSurround().GetSurround() == text::WrapTextMode::WrapTextMode_THROUGH;
744 
745  return bDisablePositioning && bIsWrapThrough;
746 }
747 
748 // --> #i3317#
749 void SwAnchoredObject::SetTmpConsiderWrapInfluence( const bool _bTmpConsiderWrapInfluence )
750 {
751  mbTmpConsiderWrapInfluence = _bTmpConsiderWrapInfluence;
752  // --> #i35911#
754  {
756  *this );
757  }
758 }
759 
761 {
763  mbClearedEnvironment = false;
764  SetClearedEnvironment( false );
766  *this );
767 }
769 {
770  const SwSortedObjs* pObjs = GetAnchorFrame()->GetDrawObjs();
771  if ( pObjs->size() > 1 )
772  {
773  for (SwAnchoredObject* pAnchoredObj : *pObjs)
774  {
775  if ( pAnchoredObj != this )
776  {
777  pAnchoredObj->SetTmpConsiderWrapInfluence( true/*bTmpConsiderWrapInfluence*/ );
778  }
779  }
780  }
781 }
782 
793 {
794  bool bOverlapsPrevColumn( false );
795 
797  {
798  const SwFrame* pColFrame = mpAnchorFrame->FindColFrame();
799  if ( pColFrame && pColFrame->GetPrev() )
800  {
801  const SwFrame* pTmpColFrame = pColFrame->GetPrev();
802  SwRect aChkRect;
803  while ( pTmpColFrame )
804  {
805  aChkRect.Union( pTmpColFrame->getFrameArea() );
806  pTmpColFrame = pTmpColFrame->GetPrev();
807  }
808  bOverlapsPrevColumn = GetObjRect().IsOver( aChkRect );
809  }
810  }
811 
812  return bOverlapsPrevColumn;
813 }
814 
822 {
823  Point aRelPos;
824 
826  aRelPos = GetObjRect().Pos();
827  aRelPos -= GetAnchorFrame()->getFrameArea().Pos();
828 
829  return aRelPos;
830 }
831 
843 Point SwAnchoredObject::GetRelPosToPageFrame( const bool _bFollowTextFlow,
844  bool& _obRelToTableCell ) const
845 {
846  Point aRelPos;
847  _obRelToTableCell = false;
848 
850  assert(GetAnchorFrame()->FindPageFrame());
851 
852  aRelPos = GetObjRect().Pos();
853  // --> #i33818# - search for cell frame, if object has to
854  // follow the text flow.
855  const SwFrame* pFrame( nullptr );
856  if ( _bFollowTextFlow && !GetAnchorFrame()->IsPageFrame() )
857  {
858  pFrame = GetAnchorFrame()->GetUpper();
859  while ( !pFrame->IsCellFrame() && !pFrame->IsPageFrame() )
860  {
861  pFrame = pFrame->GetUpper();
862  }
863  }
864  else
865  {
866  pFrame = GetAnchorFrame()->FindPageFrame();
867  }
868  if ( pFrame->IsCellFrame() )
869  {
870  aRelPos -= pFrame->getFrameArea().Pos() + pFrame->getFramePrintArea().Pos();
871  _obRelToTableCell = true;
872  }
873  else
874  {
875  aRelPos -= pFrame->getFrameArea().Pos();
876  }
877 
878  return aRelPos;
879 }
880 
888 {
889  Point aRelPos = GetObjRect().Pos();
890  aRelPos -= GetLastCharRect().Pos();
891 
892  return aRelPos;
893 }
894 
902 {
903  Point aRelPos = GetObjRect().Pos();
904  aRelPos.AdjustY( -(GetLastTopOfLine()) );
905 
906  return aRelPos;
907 }
908 
909 /* 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:297
const SwRect & GetLastCharRect() const
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:151
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:545
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:810
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:178
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:252
void AddLastCharY(tools::Long nDiff)
long SwTwips
Definition: swtypes.hxx:49
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:1204
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:391
virtual SwRect GetObjBoundRect() const =0
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:155
tools::Long GetTop(const SwRect &rRect) const
Definition: frame.hxx:1355
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:177
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:1212
static void RemoveObjForTmpConsiderWrapInfluence(const SwDoc &_rDoc, SwAnchoredObject &_rAnchoredObj)
Definition: layouter.cxx:409
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:1357
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:846
TextFrameIndex GetOffset() const
Definition: txtfrm.hxx:429
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:1259
const SdrObject * GetDrawObj() const
void CheckTopOfLine(const SwFormatAnchor &_rAnch, const SwTextFrame &_rAnchorCharFrame)
check top of line
const SwSortedObjs * GetSortedObjs() const
Definition: pagefrm.hxx:119
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:42
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
SwPageFrame * FindPageFrame()
Definition: frame.hxx:660
const SwFrame * Lower() const
Definition: layfrm.hxx:101
tools::Long GetHeight(const SwRect &rRect) const
Definition: frame.hxx:1360
FlyAnchors.
Definition: fmtanchr.hxx:34
tools::Long GetLeft() const
const SwFrame * mpAnchorFrame
bool IsTmpConsiderWrapInfluence() const
SwLayoutFrame * GetUpper()
Definition: frame.hxx:658
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:657
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:119
const IDocumentSettingAccess & getIDocumentSettingAccess() const
Provides access to the document settings interface.
Definition: format.cxx:759
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
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:366
bool IsLayoutFrame() const
Definition: frame.hxx:1148
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:1196
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:965
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:1156
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:276
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
void SetObjLeft(const SwTwips _nLeft)
bool IsVertical() const
Definition: frame.hxx:951
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:2812
sal_uInt16 GetUpper() const
void AddLastTopOfLineY(SwTwips _nDiff)
virtual ~SwAnchoredObject()
SwFrame * GetNext()
Definition: frame.hxx:656
const SvxLRSpaceItem & GetLRSpace(bool=true) const
Definition: frmatr.hxx:74
SwFrame * mpAnchorFrame