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);
216 for(
size_t i = 0;
i <
Count(); ++
i )
222 CHECK_ERR( 0xFF != *
reinterpret_cast<unsigned char const *
>(pHt),
"HintsCheck: start ptr was deleted" );
226 CHECK_ERR( nIdx >= nLastStart,
"HintsCheck: starts are unsorted" );
239 CHECK_ERR( 0xFF != *
reinterpret_cast<unsigned char const *
>(pHtEnd),
"HintsCheck: end ptr was deleted" );
243 CHECK_ERR( nIdx >= nLastEnd,
"HintsCheck: ends are unsorted" );
267 sal_uInt16 nWhich = pHt->
Which();
269 "HintsCheck: Character attribute in start array" );
272 nWhich = pHtEnd->
Which();
274 "HintsCheck: Character attribute in end array" );
286 && (*pHtThis->
End() == *pHtLast->
End())
293 || (static_txtattr_cast<const SwTextCharFormat *>(pHtThis)
295 static_txtattr_cast<const SwTextCharFormat *>(pHtLast)
300 "HintsCheck: Portion inconsistency. "
301 "This can be temporarily ok during undo operations" );
312 bool const bNoLength(pHt->
GetStart() == *pHt->
End());
314 bool bForbidContinuation(!bNoLength && !bNeedContinuation);
317 if (RsidOnlyAutoFormats.
find(pHt) != RsidOnlyAutoFormats.
end())
320 bNeedContinuation =
false;
324 if (bNeedContinuation || bForbidContinuation)
327 for (
size_t j =
i + 1; j <
Count(); ++j)
343 if (bNeedContinuation)
348 else if (bForbidContinuation &&
349 (RsidOnlyAutoFormats.
find(pOther) ==
350 RsidOnlyAutoFormats.
end()))
357 if (bNeedContinuation)
373 for (
size_t j = 0; j <
i; ++j)
383 "HintsCheck: overlapping nesting hints!!!" );
391 for (
size_t j = 0; j <
i; ++j )
397 "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