23#include <com/sun/star/i18n/UnicodeType.hpp>
24#include <com/sun/star/i18n/WordType.hpp>
25#include <com/sun/star/i18n/XBreakIterator.hpp>
51 *_pStartCursor2 = _pStartCursor;
52 bool bCheckEmpty = &rPam != _pStartCursor;
54 auto [pStt, pEnd] = _pStartCursor->
StartEnd();
55 if( !bCheckEmpty || ( pStt != pEnd && *pStt != *pEnd ))
67 rList.push_back(std::move(pNew));
81 }
while( 30 > rList.size() && *aPam.
GetPoint() < *pEnd );
83 if( 30 <= rList.size() )
85 _pStartCursor = _pStartCursor->
GetNext();
86 }
while( _pStartCursor != _pStartCursor2 );
96 SwRubyList::size_type nListEntry = 0;
99 *_pStartCursor2 = _pStartCursor;
100 bool bCheckEmpty = &rPam != _pStartCursor;
102 auto [pStt, pEnd] = _pStartCursor->
StartEnd();
103 if( !bCheckEmpty || ( pStt != pEnd && *pStt != *pEnd ))
130 if( !pEntry->
GetText().isEmpty() &&
165 }
while( nListEntry < rList.size() && *aPam.
GetPoint() < *pEnd );
167 if( 30 <= rList.size() )
169 _pStartCursor = _pStartCursor->
GetNext();
170 }
while( _pStartCursor != _pStartCursor2 );
180 OUString
const& rText = pTNd->
GetText();
182 sal_Int32 nEnd = rText.getLength();
184 bool bHasMark = rPam.
HasMark();
204 for(
size_t nHtIdx = 0; nHtIdx < pHts->
Count(); ++nHtIdx )
213 if( !bHasMark && nStart > pAttr->
GetStart() )
224 if( !bHasMark && nStart && ( !pAttr || nStart != pAttr->
GetStart()) )
230 WordType::ANYWORD_IGNOREWHITESPACES,
232 if (nWordStt < nStart && nWordStt >= 0)
239 bool bAlphaNum =
false;
240 sal_Int32 nWordEnd = nEnd;
242 while( nStart < nEnd )
244 if( pAttr && nStart == pAttr->
GetStart() )
258 sal_Int32 nChType = rCC.
getType(rText, nStart);
259 bool bIgnoreChar =
false, bIsAlphaNum =
false, bChkNxtWrd =
false;
262 case UnicodeType::UPPERCASE_LETTER:
263 case UnicodeType::LOWERCASE_LETTER:
264 case UnicodeType::TITLECASE_LETTER:
265 case UnicodeType::DECIMAL_DIGIT_NUMBER:
266 bChkNxtWrd = bIsAlphaNum =
true;
269 case UnicodeType::SPACE_SEPARATOR:
270 case UnicodeType::CONTROL:
271 case UnicodeType::PRIVATE_USE:
272 case UnicodeType::START_PUNCTUATION:
273 case UnicodeType::END_PUNCTUATION:
277 case UnicodeType::OTHER_LETTER:
287 if( bIgnoreChar || bIsAlphaNum != bAlphaNum || nStart >= nWordEnd )
290 else if( !bIgnoreChar )
293 bAlphaNum = bIsAlphaNum;
300 WordType::ANYWORD_IGNOREWHITESPACES,
302 if( 0 > nWordEnd || nWordEnd > nEnd || nWordEnd == nStart )
311 rEntry.
SetText( rText.copy( nStart,
sal_Int16 getType(const OUString &rStr, sal_Int32 nPos) const
virtual bool ReplaceRange(SwPaM &rPam, const OUString &rNewStr, const bool bRegExReplace)=0
Replace selected range in a TextNode with string.
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
virtual bool InsertString(const SwPaM &rRg, const OUString &, const SwInsertFlags nInsertMode=SwInsertFlags::EMPTYEXPAND)=0
Insert string into existing text node at position rRg.Point().
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() const
const css::lang::Locale & GetLocale(const LanguageType aLang)
bool GoNext(SwContentIndex *, SwCursorSkipMode nMode) const
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
void ResetAttrs(const SwPaM &rRg, bool bTextAttr=true, const o3tl::sorted_vector< sal_uInt16 > &rAttrs=o3tl::sorted_vector< sal_uInt16 >(), const bool bSendDataChangedEvents=true, SwRootFrame const *pLayout=nullptr)
Reset attributes.
static sal_uInt16 FillRubyList(const SwPaM &rPam, SwRubyList &rList)
static bool SelectNextRubyChars(SwPaM &rPam, SwRubyListEntry &rRubyEntry)
void SetRubyList(const SwPaM &rPam, const SwRubyList &rList)
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
PaM is Point and Mark: a selection of the document model.
const SwPosition * GetMark() const
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
std::pair< const SwPosition *, const SwPosition * > StartEnd() const
Because sometimes the cost of the operator<= can add up.
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
const SwPosition * GetPoint() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
void SetText(const OUString &rStr)
void SetRubyAttr(const SwFormatRuby &rAttr)
const OUString & GetText() const
const SwFormatRuby & GetRubyAttr() const
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
sal_Int32 GetAnyEnd() const
end (if available), else start
sal_Int32 GetStart() const
const SwFormatRuby & GetRuby() const
SwTextNode is a paragraph in the document model.
SwpHints * GetpSwpHints()
const OUString & GetText() const
LanguageType GetLang(const sal_Int32 nBegin, const sal_Int32 nLen=0, sal_uInt16 nScript=0) const
An SwTextAttr container, stores all directly formatted text portions for a text node.
SwTextAttr * Get(size_t nPos) const
std::vector< std::unique_ptr< SwRubyListEntry > > SwRubyList
constexpr TypedWhichId< SwFormatRuby > RES_TXTATR_CJK_RUBY(53)
CharClass & GetAppCharClass()
bool GoInNode(SwPaM &rPam, SwMoveFnCollection const &fnMove)
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
Marks a position in the document model.
void SetContent(sal_Int32 nContentIndex)
Set content index, only valid to call this if the position points to a SwContentNode subclass.
sal_Int32 GetContentIndex() const
void AdjustContent(sal_Int32 nDelta)
Adjust content index, only valid to call this if the position points to a SwContentNode subclass.