27#include <com/sun/star/util/SearchFlags.hpp>
45 sal_uInt32 nPara = rCursor.
GetPara();
50 if ( nMatchIndex != std::wstring::npos )
52 if ( ( nMatchIndex % 2 ) == 0 )
58 sal_Int32 nCur =
nPos+1;
59 sal_uInt16 nLevel = 1;
60 while ( nLevel && ( nPara < nParas ) )
63 while ( nCur <
aStr.getLength() )
65 if (
aStr[nCur] == nSC )
67 else if (
aStr[nCur] == nEC )
94 sal_Int32 nCur = rCursor.
GetIndex()-1;
95 sal_uInt16 nLevel = 1;
103 if (
aStr[nCur] == nSC )
109 else if (
aStr[nCur] == nEC )
145 bool bSearchInSelection = (0 != (rSearchOptions.
searchFlag & util::SearchFlags::REG_NOT_BEGINOFLINE) );
148 if ( aSel.
HasRange() && ( ( bSearchInSelection && bForward ) || ( !bSearchInSelection && !bForward ) ) )
156 if ( bSearchInSelection )
161 const sal_uInt32 nStartNode = aStartPaM.
GetPara();
168 for ( sal_uInt32 nNode = nStartNode;
169 bForward ? ( nNode <= nEndNode) : ( nNode >= nEndNode );
170 bForward ? nNode++ : nNode-- )
172 OUString aText =
GetText( nNode );
173 sal_Int32 nStartPos = 0;
174 sal_Int32 nEndPos = aText.getLength();
175 if ( nNode == nStartNode )
182 if ( ( nNode == nEndNode ) && bSearchInSelection )
191 bFound = aSearcher.
SearchForward( aText, &nStartPos, &nEndPos );
220 if ( !bForward && !nNode )
const LanguageTag & GetLanguageTag() const
static const AllSettings & GetSettings()
Gets the application's settings.
bool Search(TextSelection &rSel, const i18nutil::SearchOptions2 &rSearchOptions, bool bForward=true) const
TextSelection MatchGroup(const TextPaM &rCursor) const
virtual ~ExtTextEngine() override
const css::lang::Locale & getLocale(bool bResolveSystem=true) const
sal_Int32 GetTextLen() const
OUString GetText(LineEnd aSeparator=LINEEND_LF) const
sal_uInt32 GetParagraphCount() const
sal_uInt32 GetPara() const
sal_Int32 GetIndex() const
const TextPaM & GetStart() const
const TextPaM & GetEnd() const
bool SearchForward(const OUString &rStr, sal_Int32 *pStart, sal_Int32 *pEnd, css::util::SearchResult *pRes=nullptr)
bool SearchBackward(const OUString &rStr, sal_Int32 *pStart, sal_Int32 *pEnd, css::util::SearchResult *pRes=nullptr)
const std::wstring gaGroupChars