33#include <osl/diagnose.h>
42 mpAnchoredObj( nullptr ),
44 mbOldObjPositioningInProgress( false )
52 mpAnchoredObj( &_rAnchoredObj ),
54 mbOldObjPositioningInProgress( false )
74 mpPageFrame( nullptr ),
76 mpVertPosOrientFrame( nullptr ),
78 mbPositioningInProgress( false ),
79 mbConsiderForTextWrap( false ),
80 mbPositionLocked( false ),
82 mbKeepPositionLockedForSection( false ),
83 mbRestartLayoutProcess( false ),
85 mbClearedEnvironment( false ),
87 mbTmpConsiderWrapInfluence( false ),
88 mbObjRectWithSpacesValid( false )
133 if ( !pAnchorFrameContainingAnchPos )
138 return pAnchorFrameContainingAnchPos;
212 const bool _bCheckForParaPorInf )
219 if ( !((rAnch.
GetAnchorId() == RndStdIds::FLY_AT_CHAR) &&
231 if ( !_bCheckForParaPorInf || aAnchorCharFrame.
HasPara() )
275 ( eVertRelOrient == text::RelOrientation::CHAR &&
278 ( ( ( eVertRelOrient == text::RelOrientation::FRAME ) ||
279 ( eVertRelOrient == text::RelOrientation::PRINT_AREA ) ||
280 ( eVertRelOrient == text::RelOrientation::PAGE_FRAME ) ||
281 ( eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA ) ) &&
319 if (
GetFrameFormat().GetVertOrient().GetRelationOrient() == text::RelOrientation::TEXT_LINE )
365 const bool bVert = pAnchorFrame->
IsVertical();
425 if ( ((rAnchor.
GetAnchorId() == RndStdIds::FLY_AT_CHAR) ||
426 (rAnchor.
GetAnchorId() == RndStdIds::FLY_AT_PARA)) &&
449 if ( pObjs->
size() > 1 )
453 if ( pAnchoredObj !=
this &&
454 pAnchoredObj->ConsiderObjWrapInfluenceOnObjPos() )
519 bool bHasClearedEnvironment(
false );
523 "<SwAnchoredObject::HasClearedEnvironment()> - layout frame missing, at which the vertical position is oriented at." );
537 bHasClearedEnvironment =
true;
542 if ( pTmpTextFrame->IsUndersized() ||
546 bHasClearedEnvironment =
true;
551 return bHasClearedEnvironment;
564 OSL_FAIL(
"<SwAnchoredObject::GetObjRectWithSpaces> - cache for object rectangle inclusive spaces marked as valid, but it couldn't be. Missing invalidation of cache." );
590 const bool bTopChanged(
SetObjTop_( _nTop ) );
626 for(
auto it = pObjs->
begin(); it != pObjs->
end(); ++it)
640 for (
size_t i = pObjs->
ListPosOf( *
this ) + 1; i < pObjs->
size(); ++
i )
655 GetFrameFormat().GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR )
693 return pRetPageFrame;
713 if ((rAnch.
GetAnchorId() == RndStdIds::FLY_AT_CHAR) ||
724 if (pFlyFrame->IsFlySplitAllowed())
736 SAL_WARN(
"sw.layout",
"SwAnchoredObject::FindAnchorCharFrame: fly chain "
737 "length is longer then anchor chain length");
744 pAnchorCharFrame = pAnchor;
750 return pAnchorCharFrame;
766 OSL_ASSERT(pFrameFormat);
768 const bool bIsWrapThrough = pFrameFormat->
GetSurround().
GetSurround() == text::WrapTextMode::WrapTextMode_THROUGH;
770 return bDisablePositioning && bIsWrapThrough;
796 if ( pObjs->
size() > 1 )
800 if ( pAnchoredObj !=
this )
802 pAnchoredObj->SetTmpConsiderWrapInfluence(
true );
819 bool bOverlapsPrevColumn(
false );
824 if ( pColFrame && pColFrame->
GetPrev() )
828 while ( pTmpColFrame )
831 pTmpColFrame = pTmpColFrame->
GetPrev();
837 return bOverlapsPrevColumn;
869 bool& _obRelToTableCell )
const
872 _obRelToTableCell =
false;
880 const SwFrame* pFrame(
nullptr );
896 _obRelToTableCell =
true;
@ CONSIDER_WRAP_ON_OBJECT_POSITION
@ DISABLE_OFF_PAGE_POSITIONING
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...
virtual bool IsVisibleLayerId(SdrLayerID _nLayerId) const =0
method to determine, if a layer ID belongs to the visible ones.
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
tools::Long AdjustY(tools::Long nVertMove)
tools::Long GetRight() const
tools::Long GetLeft() const
sal_uInt16 GetUpper() const
sal_uInt16 GetLower() const
wrapper class for the positioning of Writer fly frames and drawing objects
void SetTmpConsiderWrapInfluenceOfOtherObjs()
method to apply temporary consideration of wrapping style influence to the anchored objects,...
void ClearTmpConsiderWrapInfluence()
const SwFrame * GetAnchorFrame() const
bool ConsiderForTextWrap() const
void CheckTopOfLine(const SwFormatAnchor &_rAnch, const SwTextFrame &_rAnchorCharFrame)
check top of line
void SetObjTop(const SwTwips _nTop)
bool InvalidationOfPosAllowed() const
method to determine, if invalidation of position is allowed
bool PositionLocked() const
Point GetRelPosToLine() const
method to determine position of anchored object relative to top of line
void SetClearedEnvironment(const bool _bClearedEnvironment)
SwTwips GetRelCharY(const SwFrame *pFrame) const
void ChgAnchorFrame(SwFrame *_pNewAnchorFrame)
SwTextFrame * FindAnchorCharFrame()
get frame, which contains the anchor character, if the object is anchored at-character or as-characte...
virtual SwRect GetObjBoundRect() const =0
void CheckCharRectAndTopOfLine(const bool _bCheckForParaPorInf)
check anchor character rectangle and top of line
void SetPageFrame(SwPageFrame *_pNewPageFrame)
virtual void ObjectAttachedToAnchorFrame()
method to indicate, that anchored object is attached to an anchor frame
virtual void NotifyBackground(SwPageFrame *_pPageFrame, const SwRect &_rRect, PrepareHint _eHint)=0
method to trigger notification of 'background'
rtl::Reference< SdrObject > mpDrawObj
void AddLastCharY(tools::Long nDiff)
void ResetLastCharRectHeight()
void AddLastTopOfLineY(SwTwips _nDiff)
const SwLayoutFrame * mpVertPosOrientFrame
virtual void RegisterAtCorrectPage()=0
method to assure that anchored object is registered at the correct page frame
void SetVertPosOrientFrame(const SwLayoutFrame &_rVertPosOrientFrame)
SwFrame * GetAnchorFrameContainingAnchPos()
determine anchor frame containing the anchor position
virtual bool SetObjLeft_(const SwTwips _nLeft)=0
bool mbConsiderForTextWrap
void ClearCharRectAndTopOfLine()
reset members <maLastCharRect> and <mnLastTopOfLine>
const SwLayoutFrame * GetVertPosOrientFrame() const
void SetTmpConsiderWrapInfluence(const bool _bTmpConsiderWrapInfluence)
void InvalidateObjPosForConsiderWrapInfluence()
method to perform necessary invalidations for the positioning of objects, for whose the wrapping styl...
void SetCurrRelPos(Point _aRelPos)
void SetObjLeft(const SwTwips _nLeft)
bool RestartLayoutProcess() const
bool OverlapsPrevColumn() const
method to determine, if the anchored object is overlapping with a previous column
void SetDrawObj(SdrObject &_rDrawObj)
bool ConsiderObjWrapInfluenceOnObjPos() const
method to determine, if wrapping style influence of the anchored object has to be considered on the o...
virtual ~SwAnchoredObject()
virtual SwFrameFormat & GetFrameFormat()=0
bool mbObjRectWithSpacesValid
SwTwips GetRelCharX(const SwFrame *pFrame) const
virtual bool SetObjTop_(const SwTwips _nTop)=0
Point GetRelPosToChar() const
method to determine position of anchored object relative to anchor character
bool mbClearedEnvironment
SwPageFrame * GetPageFrame()
SwPageFrame * FindPageFrameOfAnchor()
method to determine the page frame, on which the 'anchor' of the given anchored object is.
SwRect maObjRectWithSpaces
bool HasClearedEnvironment() const
method to determine, if due to anchored object size and wrapping style, its layout environment is cle...
bool mbRestartLayoutProcess
bool IsTmpConsiderWrapInfluence() const
void ClearVertPosOrientFrame()
const SwRect & GetLastCharRect() const
void CheckCharRect(const SwFormatAnchor &_rAnch, const SwTextFrame &_rAnchorCharFrame)
check anchor character rectangle
void SetConsiderForTextWrap(const bool _bConsiderForTextWrap)
const SwRect & GetObjRectWithSpaces() const
method to determine object area inclusive its spacing
SwTwips GetLastTopOfLine() const
virtual void InvalidateObjPos()=0
method to invalidate position of the anchored object
virtual const SwFlyFrame * DynCastFlyFrame() const
Point GetRelPosToPageFrame(const bool _bFollowTextFlow, bool &_obRelToTableCell) const
method to determine position of anchored object relative to page frame
virtual void UpdateLayoutDir()
method update layout direction the layout direction, the anchored object is assigned to
void InvalidateObjRectWithSpaces() const
static bool IsDraggingOffPageAllowed(const SwFrameFormat *)
method to determine if dragging objects off page is allowed
SwPageFrame * mpPageFrame
bool ConsiderObjWrapInfluenceOfOtherObjs() const
method to determine, if other anchored objects, also attached at to the anchor frame,...
const SdrObject * GetDrawObj() const
void SetPositioningInProgress(const bool _bPosInProgress)
virtual SwRect GetObjRect() const =0
virtual bool IsFormatPossible() const
method to determine, if a format on the anchored object is possible
Point GetRelPosToAnchorFrame() const
method to determine position of anchored object relative to anchor frame
void UpdateObjInSortedList()
method to update anchored object in the <SwSortedObjs> lists
SwFrame * mpAnchorFrame
Frame the object is anchored at.
bool mbTmpConsiderWrapInfluence
void SetRestartLayoutProcess(const bool _bRestartLayoutProcess)
bool IsPositioningInProgress() const
is positioning of anchored object in progress
bool ClearedEnvironment() const
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Flys that are anchored to content (at-para, at-char) but not in content (as-char).
const SwFlyAtContentFrame * GetPrecede() const
general base class for all free-flowing frames
const SwRect & getFrameArea() const
const SwRect & getFramePrintArea() const
Base class of the Writer layout elements.
const SwSortedObjs * GetDrawObjs() const
bool IsRightToLeft() const
SwLayoutFrame * GetUpper()
SwPageFrame * FindPageFrame()
bool IsLayoutFrame() const
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame.
const SwFrame * Lower() const
static void RemoveObjForTmpConsiderWrapInfluence(const SwDoc &_rDoc, SwAnchoredObject &_rAnchoredObj)
static void InsertObjForTmpConsiderWrapInfluence(const SwDoc &_rDoc, SwAnchoredObject &_rAnchoredObj)
bool mbOldObjPositioningInProgress
SwObjPositioningInProgress(SdrObject &_rSdrObj)
SwAnchoredObject * mpAnchoredObj
~SwObjPositioningInProgress()
A page of the document layout.
const SwSortedObjs * GetSortedObjs() const
tools::Long GetHeight(const SwRect &rRect) const
tools::Long GetTop(const SwRect &rRect) const
tools::Long GetLeft(const SwRect &rRect) const
Of course Writer needs its own rectangles.
void Height(tools::Long nNew)
SwRect & Union(const SwRect &rRect)
void Top(const tools::Long nTop)
void Bottom(const tools::Long nBottom)
void Pos(const Point &rNew)
void AddHeight(const tools::Long nAdd)
bool Overlaps(const SwRect &rRect) const
void AddWidth(const tools::Long nAdd)
void Left(const tools::Long nLeft)
class for collecting anchored objects
const_iterator begin() const
const_iterator end() const
void Update(SwAnchoredObject &_rAnchoredObj)
method to update the position of the given anchored object in the sorted list
size_t ListPosOf(const SwAnchoredObject &_rAnchoredObj) const
Position of object <_rAnchoredObj> in sorted list.
Represents the visualization of a paragraph.
SwTextFrame * GetFollow()
TextFrameIndex GetOffset() const
bool GetAutoPos(SwRect &, const SwPosition &) const
A slimmer version of GetCharRect for autopositioning Frames.
bool GetTopOfLine(SwTwips &_onTopOfLine, const SwPosition &_rPos) const
Determine top of line for given position in the text frame.
TextFrameIndex MapModelToViewPos(SwPosition const &rPos) const
SwTextFrame & GetFrameAtOfst(TextFrameIndex nOfst)
#define SAL_WARN(area, stream)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)