43 const sal_uInt16 nWhich1 = rHt1.
Which();
44 const sal_uInt16 nWhich2 = rHt2.
Which();
45 if ( nWhich1 == nWhich2 )
49 const sal_uInt16 nS1 =
50 static_txtattr_cast<const SwTextCharFormat&>(rHt1).GetSortNumber();
51 const sal_uInt16 nS2 =
52 static_txtattr_cast<const SwTextCharFormat&>(rHt2).GetSortNumber();
57 return reinterpret_cast<sal_IntPtr
>(&rHt1) <
reinterpret_cast<sal_IntPtr
>(&rHt2);
60 return ( nWhich1 > nWhich2 );
62 return ( nHt1 > nHt2 );
70 return lhs->
Which() < nWhich;
76 const sal_uInt16 nWhich1 = rHt1.
Which();
77 const sal_uInt16 nWhich2 = rHt2.
Which();
78 if ( nWhich1 < nWhich2 )
80 if ( nWhich1 > nWhich2 )
88 const sal_uInt16 nS1 =
89 static_txtattr_cast<const SwTextCharFormat&>(rHt1).GetSortNumber();
90 const sal_uInt16 nS2 =
91 static_txtattr_cast<const SwTextCharFormat&>(rHt2).GetSortNumber();
101 return reinterpret_cast<sal_IntPtr
>(&rHt1) <
reinterpret_cast<sal_IntPtr
>(&rHt2);
120 const sal_uInt16 nWhich1 = rHt1.
Which();
121 const sal_uInt16 nWhich2 = rHt2.
Which();
122 if ( nWhich1 == nWhich2 )
126 const sal_uInt16 nS1 =
127 static_txtattr_cast<const SwTextCharFormat&>(rHt1).GetSortNumber();
128 const sal_uInt16 nS2 =
129 static_txtattr_cast<const SwTextCharFormat&>(rHt2).GetSortNumber();
134 return reinterpret_cast<sal_IntPtr
>(&rHt1) >
reinterpret_cast<sal_IntPtr
>(&rHt2);
137 return ( nWhich1 < nWhich2 );
142 return ( nHt1 < nHt2 );
180#define CHECK_ERR(cond, text) \
183 SAL_WARN("sw.core", text); \
192 "HintsCheck: wrong sizes" );
193 sal_Int32 nLastStart = 0;
194 sal_Int32 nLastEnd = 0;
201 for (
size_t i = 0;
i <
Count(); ++
i)
206 std::shared_ptr<SfxItemSet>
const & pSet(
210 RsidOnlyAutoFormats.
insert(pHint);
220 CHECK_ERR( tmpHintsByEnd ==
m_HintsByStart,
"HintsCheck: the two arrays do not contain the same set of pointers" );
222 for(
size_t i = 0;
i <
Count(); ++
i )
228 CHECK_ERR( 0xFF != *
reinterpret_cast<unsigned char const *
>(pHt),
"HintsCheck: start ptr was deleted" );
232 CHECK_ERR( nIdx >= nLastStart,
"HintsCheck: starts are unsorted" );
245 CHECK_ERR( 0xFF != *
reinterpret_cast<unsigned char const *
>(pHtEnd),
"HintsCheck: end ptr was deleted" );
249 CHECK_ERR( nIdx >= nLastEnd,
"HintsCheck: ends are unsorted" );
261 sal_uInt16 nWhich = pHt->
Which();
263 "HintsCheck: Character attribute in start array" );
266 nWhich = pHtEnd->
Which();
268 "HintsCheck: Character attribute in end array" );
280 && (*pHtThis->
End() == *pHtLast->
End())
287 || (static_txtattr_cast<const SwTextCharFormat *>(pHtThis)
289 static_txtattr_cast<const SwTextCharFormat *>(pHtLast)
294 "HintsCheck: Portion inconsistency. "
295 "This can be temporarily ok during undo operations" );
306 bool const bNoLength(pHt->
GetStart() == *pHt->
End());
308 bool bForbidContinuation(!bNoLength && !bNeedContinuation);
311 if (RsidOnlyAutoFormats.
find(pHt) != RsidOnlyAutoFormats.
end())
314 bNeedContinuation =
false;
318 if (bNeedContinuation || bForbidContinuation)
321 for (
size_t j =
i + 1; j <
Count(); ++j)
337 if (bNeedContinuation)
342 else if (bForbidContinuation &&
343 (RsidOnlyAutoFormats.
find(pOther) ==
344 RsidOnlyAutoFormats.
end()))
351 if (bNeedContinuation)
367 for (
size_t j = 0; j <
i; ++j)
377 "HintsCheck: overlapping nesting hints!!!" );
385 for (
size_t j = 0; j <
i; ++j )
391 "HintsCheck: multiple hints claim same CH_TXTATR!");
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
sal_Int32 GetAnyEnd() const
end (if available), else start
bool IsFormatIgnoreStart() const
const sal_Int32 * End() const
sal_Int32 GetStart() const
const SwFormatAutoFormat & GetAutoFormat() const
bool HasDummyChar() const
bool IsFormatIgnoreEnd() const
An SwTextAttr container, stores all directly formatted text portions for a text node.
SW_DLLPUBLIC void ResortWhichMap() const
std::vector< SwTextAttr * > m_HintsByWhichAndStart
std::vector< SwTextAttr * > m_HintsByEnd
bool m_bEndMapNeedsSorting
size_t GetFirstPosSortedByWhichAndStart(sal_uInt16 nWhich) const
bool Contains(const SwTextAttr *pHt) const
size_t GetIndexOf(const SwTextAttr *pHt) const
SW_DLLPUBLIC void Resort() const
int GetLastPosSortedByEnd(sal_Int32 nEndPos) const
void Insert(SwTextAttr *pHt)
bool m_bWhichMapNeedsSorting
std::vector< SwTextAttr * > m_HintsByStart
bool m_bStartMapNeedsSorting
SW_DLLPUBLIC void ResortStartMap() const
SW_DLLPUBLIC void ResortEndMap() const
const_iterator find(const Value &x) const
const_iterator end() const
std::pair< const_iterator, bool > insert(Value &&x)
bool isCHRATR(const sal_uInt16 nWhich)
constexpr TypedWhichId< SwFormatAutoFormat > RES_TXTATR_AUTOFMT(50)
constexpr TypedWhichId< SwFormatCharFormat > RES_TXTATR_CHARFMT(52)
constexpr TypedWhichId< SvxRsidItem > RES_CHRATR_RSID(39)
#define CHECK_ERR(cond, text)
static bool CompareSwpHtStart(const SwTextAttr *lhs, const SwTextAttr *rhs)
sort order: Start, End (reverse), Which (reverse), (char style: sort number), at last the pointer
SwComparePosition ComparePosition(const T &rStt1, const T &rEnd1, const T &rStt2, const T &rEnd2)
@ OverlapBehind
Pos1 overlaps Pos2 at the end.
@ OverlapBefore
Pos1 overlaps Pos2 at the beginning.
bool operator()(sal_Int32 nEndPos, const SwTextAttr *rhs) const
sort order: End, Start(reverse), Which (char style: sort number), at last the pointer(reverse)
bool operator()(const SwTextAttr *lhs, const sal_uInt16 nWhich) const
sort order: Which, Start, End(reverse) at last the pointer
constexpr sal_Int32 COMPLETE_STRING