31#include <osl/diagnose.h>
52 if ( _nIndex >=
size() )
54 OSL_FAIL(
"<SwSortedObjs::operator[]> - index out of range" );
68 if (eAnchor == RndStdIds::FLY_AT_CHAR)
70 if (eAnchor == RndStdIds::FLY_AS_CHAR)
89 if ((pAnchorListed->
GetAnchorId() == RndStdIds::FLY_AT_PAGE) &&
90 (pAnchorNew ->GetAnchorId() != RndStdIds::FLY_AT_PAGE))
94 else if ((pAnchorListed->
GetAnchorId() != RndStdIds::FLY_AT_PAGE) &&
95 (pAnchorNew ->GetAnchorId() == RndStdIds::FLY_AT_PAGE))
99 else if ((pAnchorListed->
GetAnchorId() == RndStdIds::FLY_AT_PAGE) &&
100 (pAnchorNew ->GetAnchorId() == RndStdIds::FLY_AT_PAGE))
107 if ((pAnchorListed->
GetAnchorId() == RndStdIds::FLY_AT_FLY) &&
108 (pAnchorNew ->GetAnchorId() != RndStdIds::FLY_AT_FLY))
112 else if ((pAnchorListed->
GetAnchorId() != RndStdIds::FLY_AT_FLY) &&
113 (pAnchorNew ->GetAnchorId() == RndStdIds::FLY_AT_FLY))
117 else if ((pAnchorListed->
GetAnchorId() == RndStdIds::FLY_AT_FLY) &&
118 (pAnchorNew ->GetAnchorId() == RndStdIds::FLY_AT_FLY))
127 if ( pContentAnchorListed && pContentAnchorNew &&
128 *pContentAnchorListed != *pContentAnchorNew )
130 return *pContentAnchorListed < *pContentAnchorNew;
137 if (pContentAnchorListed && pContentAnchorNew)
139 sal_Int32 nListedIndex = pAnchorListed->
GetAnchorId() != RndStdIds::FLY_AT_PARA ?
141 sal_Int32 nNewIndex = pAnchorNew->
GetAnchorId() != RndStdIds::FLY_AT_PARA ?
143 if (nListedIndex != nNewIndex)
145 return nListedIndex < nNewIndex;
149 int nAnchorListedWeight = GetAnchorWeight(pAnchorListed->
GetAnchorId());
150 int nAnchorNewWeight = GetAnchorWeight(pAnchorNew->
GetAnchorId());
151 if (nAnchorListedWeight != nAnchorNewWeight)
153 return nAnchorListedWeight < nAnchorNewWeight;
162 const bool bWrapThroughOrHellListed =
166 const bool bWrapThroughOrHellNew =
170 if ( bWrapThroughOrHellListed != bWrapThroughOrHellNew )
172 return !bWrapThroughOrHellListed;
174 else if ( bWrapThroughOrHellListed && bWrapThroughOrHellNew )
191 == text::WrapInfluenceOnPosition::ONCE_SUCCESSIVE;
214 OSL_FAIL(
"<SwSortedObjs::Insert()> - already contains object" );
219 std::vector< SwAnchoredObject* >::iterator aInsPosIter =
221 &_rAnchoredObj, ObjAnchorOrder() );
231 std::vector< SwAnchoredObject* >::iterator aDelPosIter =
237 OSL_FAIL(
"<SwSortedObjs::Remove()> - object not found" );
247 std::vector< SwAnchoredObject* >::const_iterator aIter =
258 OSL_FAIL(
"<SwSortedObjs::Update(..) - sorted list doesn't contain given anchored object" );
279 std::vector< SwAnchoredObject* >::const_iterator aIter =
285 std::vector< SwAnchoredObject* >::difference_type
nPos =
287 return static_cast<size_t>(
nPos );
virtual SdrLayerID GetHellId() const =0
virtual SdrLayerID GetInvisibleHellId() const =0
virtual SdrLayerID GetLayer() const
wrapper class for the positioning of Writer fly frames and drawing objects
virtual SwFrameFormat & GetFrameFormat()=0
const SdrObject * GetDrawObj() const
Base class of the Writer document model elements.
bool Contains(const SwAnchoredObject &_rAnchoredObj) const
bool Insert(SwAnchoredObject &_rAnchoredObj)
std::vector< SwAnchoredObject * > maSortedObjLst
SwAnchoredObject * operator[](size_t _nIndex) const
direct access to the entries
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.
void Remove(SwAnchoredObject &_rAnchoredObj)