38 : m_pContentNode( rIdx.m_pContentNode )
47 : m_nIndex( rIdx.m_nIndex )
48 , m_pContentNode( rIdx.m_pContentNode )
93 if (!pPrv || pPrv->
m_nIndex <= nNewValue)
117 if (!pNxt || pNxt->
m_nIndex >= nNewValue)
136 else if( pFnd !=
this )
227SwContentIndexReg::SwContentIndexReg()
228 : m_pFirst( nullptr ), m_pLast( nullptr )
232SwContentIndexReg::~SwContentIndexReg()
234 assert(!m_pFirst && !m_pLast &&
"There are still indices registered");
237void SwContentIndexReg::Update(
239 const sal_Int32 nDiff,
240 UpdateMode
const eMode)
243 const sal_Int32 nNewVal = rIdx.
m_nIndex;
244 if (eMode & UpdateMode::Negative)
246 const sal_Int32 nLast = rIdx.
m_nIndex + nDiff;
249 while (pStt && pStt->
m_nIndex == nNewVal)
251 while (pStt && pStt->
m_nIndex <= nLast)
264 while (pStt && pStt->
m_nIndex == nNewVal)
273 if (!pStt->
m_pMark ||
nullptr ==
dynamic_cast<
285 if (!(
this != &rArr && m_pFirst))
307 "SwContentIndex::operator++() wraps around" );
316 "SwContentIndex::operator--(int) wraps around" );
318 const sal_Int32 nOldIndex =
m_nIndex;
326 "SwContentIndex::operator--() wraps around" );
332 SAL_WARN_IF( !(nVal > 0 ? m_nIndex <= SAL_MAX_INT32 - nVal : m_nIndex >= nVal),
"sw.core",
333 "SwContentIndex SwContentIndex::operator+=(sal_Int32) wraps around" );
340 "SwContentIndex::operator-=(sal_Int32) wraps around" );
384 return s <<
"SwContentIndex offset (" <<
index.GetIndex() <<
")";
389 return s << sal_Int32(
index);
Marks a character position inside a document model content node (SwContentNode)
sal_Int32 operator+=(sal_Int32 const)
bool operator>(const SwContentIndex &) const
const sw::mark::IMark * m_pMark
Pointer to a mark that owns this position to allow fast lookup of marks of an SwContentIndexReg.
void Init(sal_Int32 const nIdx)
SwContentNode * m_pContentNode
void SetMark(const sw::mark::IMark *pMark)
SwContentIndex(const SwContentNode *pContentNode, sal_Int32 const nIdx=0)
SwContentIndex & operator=(sal_Int32 const)
bool operator<=(const SwContentIndex &) const
SwContentIndex & ChgValue(const SwContentIndex &rIdx, sal_Int32 nNewValue)
bool operator>=(const SwContentIndex &) const
bool operator<(const SwContentIndex &) const
sal_Int32 GetIndex() const
SwContentIndex & Assign(const SwContentNode *, sal_Int32)
sal_Int32 operator-=(sal_Int32 const)
std::ostream & operator<<(std::ostream &s, const SwContentIndex &index)
#define SAL_WARN_IF(condition, area, stream)