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 = pStt == _pStartCursor->
GetPoint()
58 if( !bCheckEmpty || ( pStt != pEnd && *pStt != *pEnd ))
70 rList.push_back(std::move(pNew));
84 }
while( 30 > rList.size() && *aPam.
GetPoint() < *pEnd );
86 if( 30 <= rList.size() )
88 _pStartCursor = _pStartCursor->
GetNext();
89 }
while( _pStartCursor != _pStartCursor2 );
99 SwRubyList::size_type nListEntry = 0;
102 *_pStartCursor2 = _pStartCursor;
103 bool bCheckEmpty = &rPam != _pStartCursor;
106 * pEnd = pStt == _pStartCursor->
GetPoint()
109 if( !bCheckEmpty || ( pStt != pEnd && *pStt != *pEnd ))
136 if( !pEntry->
GetText().isEmpty() &&
171 }
while( nListEntry < rList.size() && *aPam.
GetPoint() < *pEnd );
173 if( 30 <= rList.size() )
175 _pStartCursor = _pStartCursor->
GetNext();
176 }
while( _pStartCursor != _pStartCursor2 );
186 OUString
const& rText = pTNd->
GetText();
188 sal_Int32 nEnd = rText.getLength();
190 bool bHasMark = rPam.
HasMark();
210 for(
size_t nHtIdx = 0; nHtIdx < pHts->
Count(); ++nHtIdx )
219 if( !bHasMark && nStart > pAttr->
GetStart() )
230 if( !bHasMark && nStart && ( !pAttr || nStart != pAttr->
GetStart()) )
236 WordType::ANYWORD_IGNOREWHITESPACES,
238 if (nWordStt < nStart && nWordStt >= 0)
245 bool bAlphaNum =
false;
246 sal_Int32 nWordEnd = nEnd;
248 while( nStart < nEnd )
250 if( pAttr && nStart == pAttr->
GetStart() )
264 sal_Int32 nChType = rCC.
getType(rText, nStart);
265 bool bIgnoreChar =
false, bIsAlphaNum =
false, bChkNxtWrd =
false;
268 case UnicodeType::UPPERCASE_LETTER:
269 case UnicodeType::LOWERCASE_LETTER:
270 case UnicodeType::TITLECASE_LETTER:
271 case UnicodeType::DECIMAL_DIGIT_NUMBER:
272 bChkNxtWrd = bIsAlphaNum =
true;
275 case UnicodeType::SPACE_SEPARATOR:
276 case UnicodeType::CONTROL:
277 case UnicodeType::PRIVATE_USE:
278 case UnicodeType::START_PUNCTUATION:
279 case UnicodeType::END_PUNCTUATION:
283 case UnicodeType::OTHER_LETTER:
293 if( bIgnoreChar || bIsAlphaNum != bAlphaNum || nStart >= nWordEnd )
296 else if( !bIgnoreChar )
299 bAlphaNum = bIsAlphaNum;
306 WordType::ANYWORD_IGNOREWHITESPACES,
308 if( 0 > nWordEnd || nWordEnd > nEnd || nWordEnd == nStart )
317 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()
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.
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.
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, bool bExpandCharToPara=false, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
sal_Int32 GetIndex() 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.