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;
55 * pEnd = _pStartCursor->
End();
56 if( !bCheckEmpty || ( pStt != pEnd && *pStt != *pEnd ))
68 rList.push_back(std::move(pNew));
82 }
while( 30 > rList.size() && *aPam.
GetPoint() < *pEnd );
84 if( 30 <= rList.size() )
86 _pStartCursor = _pStartCursor->
GetNext();
87 }
while( _pStartCursor != _pStartCursor2 );
97 SwRubyList::size_type nListEntry = 0;
100 *_pStartCursor2 = _pStartCursor;
101 bool bCheckEmpty = &rPam != _pStartCursor;
104 * pEnd = _pStartCursor->
End();
105 if( !bCheckEmpty || ( pStt != pEnd && *pStt != *pEnd ))
132 if( !pEntry->
GetText().isEmpty() &&
167 }
while( nListEntry < rList.size() && *aPam.
GetPoint() < *pEnd );
169 if( 30 <= rList.size() )
171 _pStartCursor = _pStartCursor->
GetNext();
172 }
while( _pStartCursor != _pStartCursor2 );
182 OUString
const& rText = pTNd->
GetText();
184 sal_Int32 nEnd = rText.getLength();
186 bool bHasMark = rPam.
HasMark();
206 for(
size_t nHtIdx = 0; nHtIdx < pHts->
Count(); ++nHtIdx )
215 if( !bHasMark && nStart > pAttr->
GetStart() )
226 if( !bHasMark && nStart && ( !pAttr || nStart != pAttr->
GetStart()) )
232 WordType::ANYWORD_IGNOREWHITESPACES,
234 if (nWordStt < nStart && nWordStt >= 0)
241 bool bAlphaNum =
false;
242 sal_Int32 nWordEnd = nEnd;
244 while( nStart < nEnd )
246 if( pAttr && nStart == pAttr->
GetStart() )
260 sal_Int32 nChType = rCC.
getType(rText, nStart);
261 bool bIgnoreChar =
false, bIsAlphaNum =
false, bChkNxtWrd =
false;
264 case UnicodeType::UPPERCASE_LETTER:
265 case UnicodeType::LOWERCASE_LETTER:
266 case UnicodeType::TITLECASE_LETTER:
267 case UnicodeType::DECIMAL_DIGIT_NUMBER:
268 bChkNxtWrd = bIsAlphaNum =
true;
271 case UnicodeType::SPACE_SEPARATOR:
272 case UnicodeType::CONTROL:
273 case UnicodeType::PRIVATE_USE:
274 case UnicodeType::START_PUNCTUATION:
275 case UnicodeType::END_PUNCTUATION:
279 case UnicodeType::OTHER_LETTER:
289 if( bIgnoreChar || bIsAlphaNum != bAlphaNum || nStart >= nWordEnd )
292 else if( !bIgnoreChar )
295 bAlphaNum = bIsAlphaNum;
302 WordType::ANYWORD_IGNOREWHITESPACES,
304 if( 0 > nWordEnd || nWordEnd > nEnd || nWordEnd == nStart )
313 rEntry.
SetText( rText.copy( nStart,
Marks a position in the document model.
static sal_uInt16 FillRubyList(const SwPaM &rPam, SwRubyList &rList)
bool GoNext(SwIndex *, sal_uInt16 nMode) const
const OUString & GetText() const
SwpHints * GetpSwpHints()
static bool SelectNextRubyChars(SwPaM &rPam, SwRubyListEntry &rRubyEntry)
std::vector< std::unique_ptr< SwRubyListEntry >> SwRubyList
const SwPosition * GetMark() const
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
void SetRubyAttr(const SwFormatRuby &rAttr)
IDocumentUndoRedo & GetIDocumentUndoRedo()
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
void SetRubyList(const SwPaM &rPam, const SwRubyList &rList)
sal_Int32 GetAnyEnd() const
end (if available), else start
IDocumentContentOperations const & getIDocumentContentOperations() const
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.
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
sal_Int32 GetStart() const
constexpr TypedWhichId< SwFormatRuby > RES_TXTATR_CJK_RUBY(53)
PaM is Point and Mark: a selection of the document model.
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
virtual bool InsertString(const SwPaM &rRg, const OUString &, const SwInsertFlags nInsertMode=SwInsertFlags::EMPTYEXPAND)=0
Insert string into existing text node at position rRg.Point().
virtual SwUndoId StartUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Opens undo block.
SwTextAttr * Get(size_t nPos) const
bool GoInNode(SwPaM &rPam, SwMoveFnCollection const &fnMove)
const SwPosition * GetPoint() const
sal_Int16 getType(const OUString &rStr, sal_Int32 nPos) const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
void SetText(const OUString &rStr)
virtual bool ReplaceRange(SwPaM &rPam, const OUString &rNewStr, const bool bRegExReplace)=0
Replace selected range in a TextNode with string.
const SwPosition * Start() const
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() const
const SwFormatRuby & GetRubyAttr() const
const css::lang::Locale & GetLocale(const LanguageType aLang)
SwTextNode is a paragraph in the document model.
An SwTextAttr container, stores all directly formatted text portions for a text node.
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
sal_Int32 GetIndex() const
const SwPosition * End() const
LanguageType GetLang(const sal_Int32 nBegin, const sal_Int32 nLen=0, sal_uInt16 nScript=0) const
const sal_uInt16 CRSR_SKIP_CHARS
const OUString & GetText() const
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
CharClass & GetAppCharClass()
const SwFormatRuby & GetRuby() const
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
bool m_bDetectedRangeSegmentation false