22#include <com/sun/star/util/SearchFlags.hpp>
23#include <com/sun/star/util/SearchResult.hpp>
26#include <rtl/ustrbuf.hxx>
29#include <sfx2/sfxsids.hrc>
31#include <osl/diagnose.h>
80 explicit AmbiguousIndex(sal_Int32
const value
90 sal_Int32 & GetAnyIndex() {
return m_value; }
91 sal_Int32
const& GetAnyIndex()
const {
return m_value; }
94 assert(m_tag != tags::Model);
97 sal_Int32 GetModelIndex()
const
99 assert(m_tag != tags::Frame);
109 void SetModelIndex(sal_Int32
const value)
117 bool operator ==(AmbiguousIndex
const& rOther)
const
119 assert(m_tag == tags::Any || rOther.m_tag == tags::Any || m_tag == rOther.m_tag);
120 return m_value == rOther.m_value;
122 bool operator <=(AmbiguousIndex
const& rOther)
const
124 assert(m_tag == tags::Any || rOther.m_tag == tags::Any || m_tag == rOther.m_tag);
125 return m_value <= rOther.m_value;
127 bool operator < (AmbiguousIndex
const& rOther)
const
129 assert(m_tag == tags::Any || rOther.m_tag == tags::Any || m_tag == rOther.m_tag);
130 return m_value < rOther.m_value;
132 AmbiguousIndex
operator - (AmbiguousIndex
const& rOther)
const
134 assert(m_tag == tags::Any || rOther.m_tag == tags::Any || m_tag == rOther.m_tag);
135 return AmbiguousIndex(m_value - rOther.m_value
137 , std::max(m_tag, rOther.m_tag)
145 std::optional<sw::MergedAttrIter> m_oMergedIter;
156 m_oMergedIter.emplace(*pFrame);
164 return m_oMergedIter->NextAttr(&rpNode);
168 if (m_HintIndex < pHints->
Count())
171 return pHints->Get(m_HintIndex++);
184 AmbiguousIndex
const nStart, AmbiguousIndex & rEnd,
185 std::vector<AmbiguousIndex> &rArr,
186 bool const bRemoveSoftHyphen,
bool const bRemoveCommentAnchors)
191 MaybeMergedIter iter(pLayout ? pFrame :
nullptr, pLayout ?
nullptr : &rNd);
193 AmbiguousIndex nSoftHyphen = nStart;
194 AmbiguousIndex nHintStart;
195 bool bNewHint =
true;
196 bool bNewSoftHyphen =
true;
197 const AmbiguousIndex nEnd = rEnd;
198 std::vector<AmbiguousIndex> aReplaced;
200 SwTextAttr const* pNextHint(iter.NextAttr(pNextHintNode));
208 nHintStart.SetFrameIndex(pNextHint
214 nHintStart.SetModelIndex(pNextHint ? pNextHint->
GetStart() : -1);
218 if ( bNewSoftHyphen )
228 nSoftHyphen.SetModelIndex(bRemoveSoftHyphen
235 bNewSoftHyphen =
false;
239 if (0 <= nHintStart.GetAnyIndex()
240 && (-1 == nSoftHyphen.GetAnyIndex() || nHintStart < nSoftHyphen)
241 && nHintStart < nEnd )
247 else if ( -1 != nSoftHyphen.GetAnyIndex()
248 && (-1 == nHintStart.GetAnyIndex() || nSoftHyphen < nHintStart)
249 && nSoftHyphen < nEnd)
252 bNewSoftHyphen =
true;
255 else if (-1 != nSoftHyphen.GetAnyIndex() && nSoftHyphen == nHintStart)
259 bNewSoftHyphen =
true;
264 AmbiguousIndex nCurrent(nStt);
265 nCurrent.GetAnyIndex() -= rArr.size();
269 if (pNextHint && pNextHint->
HasDummyChar() && (nStart <= nStt))
271 switch (pNextHint->
Which())
288 || (static_txtattr_cast<SwTextField const*>(pNextHint)->GetFormatField().GetField()->ExpandField(
true, pLayout).isEmpty());
289 if ( bEmpty && nStart == nCurrent )
291 rArr.push_back( nCurrent );
292 if (rEnd.GetAnyIndex() > nCurrent.GetAnyIndex())
294 --rEnd.GetAnyIndex();
296 buf.remove(nCurrent.GetAnyIndex(), 1);
301 aReplaced.push_back( nCurrent );
302 buf[nCurrent.GetAnyIndex()] =
'\x7f';
308 if( bRemoveCommentAnchors )
310 rArr.push_back( nCurrent );
311 if (rEnd.GetAnyIndex() > nCurrent.GetAnyIndex())
313 --rEnd.GetAnyIndex();
315 buf.remove( nCurrent.GetAnyIndex(), 1 );
320 OSL_FAIL(
"unknown case in lcl_CleanStr" );
324 pNextHint = iter.NextAttr(pNextHintNode);
327 if ( bNewSoftHyphen )
329 rArr.push_back( nCurrent );
333 if (rEnd.GetAnyIndex() > nCurrent.GetAnyIndex())
335 --rEnd.GetAnyIndex();
338 buf.remove(nCurrent.GetAnyIndex(), 1);
339 ++nSoftHyphen.GetAnyIndex();
344 for (
auto i = aReplaced.size();
i; )
346 const AmbiguousIndex nTmp = aReplaced[ --
i ];
347 if (nTmp.GetAnyIndex() == buf.getLength() - 1)
349 buf.truncate(nTmp.GetAnyIndex());
350 rArr.push_back( nTmp );
351 --rEnd.GetAnyIndex();
355 return buf.makeStringAndClear();
361 bool bSrchForward,
bool bRegSearch,
bool bChkEmptyPara,
bool bChkParaEnd,
362 AmbiguousIndex & nStart, AmbiguousIndex & nEnd, AmbiguousIndex nTextLen,
374 std::unique_ptr<SvxSearchItem>& xSearchItem)
379 std::optional<SwPaM> oPam;
390 const bool bRegSearch = SearchAlgorithms2::REGEXP == rSearchOpt.
AlgorithmType2;
391 const bool bChkEmptyPara = bRegSearch && 2 == rSearchOpt.
searchString.getLength() &&
394 const bool bChkParaEnd = bRegSearch && rSearchOpt.
searchString ==
"$";
399 xSearchItem->SetSearchOptions(rSearchOpt);
400 xSearchItem->SetBackward(!bSrchForward);
404 while (
nullptr != (pNode =
::GetNode(*oPam, bFirst, fnMove, bInReadOnly, pLayout)))
412 assert(!pLayout || pFrame);
413 AmbiguousIndex nTextLen;
420 nTextLen.SetModelIndex(rTextNode.
GetText().getLength());
425 : rPtPos.
GetNode() == oPam->GetMark()->GetNode())
433 nEnd.SetModelIndex(oPam->GetMark()->GetContentIndex());
450 nEnd.SetModelIndex(0);
454 AmbiguousIndex nStart;
468 MaybeMergedIter iter(pLayout ? pFrame :
nullptr, pLayout ?
nullptr : &rTextNode);
471 std::vector<std::pair<SwTextAttr const*, AmbiguousIndex>> postits;
476 std::swap(nStart, nEnd);
480 while (
SwTextAttr const*
const pTextAttr = iter.NextAttr(pTemp))
485 aPos.SetModelIndex(pTextAttr->GetStart());
488 aPos.SetFrameIndex(pFrame->
MapModelToView(pTemp, aPos.GetModelIndex()));
490 if ((nStart <= aPos) && (aPos <= nEnd))
492 postits.emplace_back(pTextAttr, aPos);
499 std::swap(nStart, nEnd);
509 bool bEndedTextEdit =
false;
519 const SwNode* pAnchorNode = pFrameFormat->GetAnchor().GetAnchorNode();
520 if (!pAnchorNode || (pLayout
538 bEndedTextEdit =
true;
553 if (!bEndedTextEdit && !(pSearchItem && pSearchItem->
GetCommand() == SvxSearchCmd::FIND_ALL))
583 const SwNode* pAnchorNode = pFrameFormat->GetAnchor().GetAnchorNode();
603 if (!postits.empty())
607 postits.erase(postits.begin());
627 if (!postits.empty())
630 AmbiguousIndex nStartInside;
631 AmbiguousIndex nEndInside;
632 sal_Int32 aLoop = bSrchForward ? 0 : postits.size();
640 nStartInside = nStart;
644 nStartInside.SetFrameIndex(postits[aLoop - 1].second.GetFrameIndex() +
TextFrameIndex(1));
648 nStartInside.SetModelIndex(postits[aLoop - 1].second.GetModelIndex() + 1);
650 nEndInside =
static_cast<size_t>(aLoop) == postits.size()
652 : postits[aLoop].second;
653 nTextLen = nEndInside - nStartInside;
657 nStartInside =
static_cast<size_t>(aLoop) == postits.size()
659 : postits[aLoop].second;
666 nEndInside.SetFrameIndex(postits[aLoop - 1].second.GetFrameIndex() +
TextFrameIndex(1));
670 nEndInside.SetModelIndex(postits[aLoop - 1].second.GetModelIndex() + 1);
672 nTextLen = nStartInside - nEndInside;
676 rSearchOpt, rSText, fnMove, bSrchForward,
677 bRegSearch, bChkEmptyPara, bChkParaEnd,
678 nStartInside, nEndInside, nTextLen,
680 oPam ? &*oPam :
nullptr );
687 ? (
static_cast<size_t>(aLoop) != postits.size())
690 const SwTextAttr *
const pTextAttr = bSrchForward
691 ? postits[aLoop].first
692 : postits[aLoop - 1].first;
694 static_txtattr_cast<SwTextField const*>(pTextAttr)->GetFormatField(),rSearchOpt,bSrchForward))
701 aLoop = bSrchForward ? aLoop+1 : aLoop-1;
709 rSearchOpt, rSText, fnMove, bSrchForward,
710 bRegSearch, bChkEmptyPara, bChkParaEnd,
711 nStart, nEnd, nTextLen,
713 oPam ? &*oPam :
nullptr );
727 bool bChkEmptyPara,
bool bChkParaEnd,
728 AmbiguousIndex & nStart, AmbiguousIndex & nEnd, AmbiguousIndex
const nTextLen,
735 std::vector<AmbiguousIndex> aFltArr;
739 bool bRemoveSoftHyphens =
true;
750 || -1 != rSearchOpt.
searchString.indexOf(
"\\N{SOFT HYPHEN}"))
752 bRemoveSoftHyphens =
false;
759 bRemoveSoftHyphens =
false;
763 sCleanStr =
lcl_CleanStr(*pNode, pFrame, pLayout, nStart, nEnd,
764 aFltArr, bRemoveSoftHyphens, bRemoveCommentAnchors);
766 sCleanStr =
lcl_CleanStr(*pNode, pFrame, pLayout, nEnd, nStart,
767 aFltArr, bRemoveSoftHyphens, bRemoveCommentAnchors);
769 std::unique_ptr<SwScriptIterator> pScriptIter;
770 sal_uInt16 nSearchScript = 0;
771 sal_uInt16 nCurrScript = 0;
775 pScriptIter.reset(
new SwScriptIterator(sCleanStr, nStart.GetAnyIndex(), bSrchForward));
779 const AmbiguousIndex nStringEnd = nEnd;
780 bool bZeroMatch =
false;
781 while ( ((bSrchForward && nStart < nStringEnd) ||
782 (!bSrchForward && nStringEnd < nStart)) && !bZeroMatch )
789 nEnd.GetAnyIndex() = pScriptIter->GetScriptChgPos();
790 nCurrScript = pScriptIter->GetCurrScript();
791 if ( nSearchScript == nCurrScript )
795 ? nStart.GetFrameIndex()
796 : nEnd.GetFrameIndex(),
799 ? nStart.GetModelIndex()
800 : nEnd.GetModelIndex());
802 if ( eCurrLang != eLastLang )
804 const lang::Locale aLocale(
807 eLastLang = eCurrLang;
812 AmbiguousIndex nProxyStart = nStart;
813 AmbiguousIndex nProxyEnd = nEnd;
814 if( nSearchScript == nCurrScript &&
815 (rSText.*fnMove.
fnSearch)( sCleanStr, &nProxyStart.GetAnyIndex(), &nProxyEnd.GetAnyIndex(),
nullptr) &&
816 !(bZeroMatch = (nProxyStart == nProxyEnd)))
818 nStart = nProxyStart;
825 if( !aFltArr.empty() )
828 if (!bSrchForward) { std::swap(nStart, nEnd); }
830 AmbiguousIndex nNew = nStart;
831 for (
size_t n = 0;
n < aFltArr.size() && aFltArr[
n ] <= nStart; ++
n )
833 ++nNew.GetAnyIndex();
838 for(
size_t n = 0;
n < aFltArr.size() && aFltArr[
n ] < nEnd; ++
n )
840 ++nNew.GetAnyIndex();
845 if( !bSrchForward ) { std::swap(nStart, nEnd); }
875 else if ((bChkEmptyPara && !nStart.GetAnyIndex() && !nTextLen.GetAnyIndex())
889 const SwNode *
const pSttNd = bSrchForward
895 if( (bSrchForward || pSttNd != &rPtPos.
GetNode()) &&
920 bool m_bSearchInNotes;
924 : m_rSearchOpt( rOpt )
925 , m_rCursor( rCursor )
928 , m_bReplace( bRepl )
929 , m_bSearchInNotes( bSearchInNotes )
933 virtual ~SwFindParaText();
938SwFindParaText::~SwFindParaText()
943 const SwPaM & rRegion,
bool bInReadOnly,
944 std::unique_ptr<SvxSearchItem>& xSearchItem)
946 if( bInReadOnly && m_bReplace )
950 m_aSText, fnMove, rRegion, bInReadOnly, m_pLayout, xSearchItem);
952 if( bFnd && m_bReplace )
955 const bool bRegExp(SearchAlgorithms2::REGEXP == m_rSearchOpt.AlgorithmType2);
958 SwPaM* pPrev(
nullptr);
961 pPrev =
const_cast<SwPaM&
>(rRegion).GetPrev();
962 const_cast<SwPaM&
>(rRegion).GetRingContainer().merge( m_rCursor.GetRingContainer() );
965 std::optional<OUString> xRepl;
969 xRepl ? *xRepl : m_rSearchOpt.replaceString,
970 bRegExp, m_rCursor.GetDoc(), m_pLayout);
972 m_rCursor.SaveTableBoxContent( rCursor.
GetPoint() );
981 pNext =
p->GetNext();
982 p->MoveTo(
const_cast<SwPaM*
>(&rRegion));
983 }
while( p != pPrev );
985 if (bRegExp && !bReplaced)
999bool SwFindParaText::IsReplaceMode()
const
1006 bool& bCancel,
FindRanges eFndRngs,
bool bReplace,
1020 bool bSearchSel = 0 != (rSearchOpt.
searchFlag & SearchFlags::REG_NOT_BEGINOFLINE);
1023 SwFindParaText aSwFindParaText(rSearchOpt, bSearchInNotes, bReplace, *
this, pLayout);
1024 sal_Int32 nRet =
FindAll( aSwFindParaText, nStart, nEnd, eFndRngs, bCancel );
1026 if( nRet && bReplace )
1042 OUString
const& rReplacement,
1047 bool bReplaced(
true);
1051 std::vector<std::shared_ptr<SwUnoCursor>> ranges;
1057 bReplaced = rIDCO.
ReplaceRange(rCursor, rReplacement, bRegExp);
1061 assert(!ranges.empty());
1062 assert(ranges.front()->GetPoint()->GetNode() == ranges.front()->GetMark()->GetNode());
1063 bReplaced = rIDCO.
ReplaceRange(*ranges.front(), rReplacement, bRegExp);
1064 for (
auto it = ranges.begin() + 1; it != ranges.end(); ++it)
1080 if (*rCursor.
End() <= *pRedline->
Start())
1084 if (*pRedline->
End() <= *rCursor.
Start())
1089 if (pRedline->
GetType() == RedlineType::Delete)
1091 assert(*pRedline->
Start() != *pRedline->
End());
1093 assert(*rCursor.
Start() <= *pRedline->
Start() && *pRedline->
End() <= *rCursor.
End());
1094 SwPaM pam(*pRedline,
nullptr);
1103 bReplaced &= rIDCO.
ReplaceRange(rCursor, rReplacement, bRegExp);
1111 std::optional<OUString> xRet;
1112 if( pPam && pPam->
HasMark() &&
1118 || !pMarkTextNode || !pMarkTextNode->
IsTextNode())
1126 if (bParaEnd || (pLayout
1128 : pTextNode == pMarkTextNode))
1131 SearchResult aResult;
1135 static constexpr OUStringLiteral
aStr(
u"\\n");
1136 aResult.subRegExpressions = 1;
1137 aResult.startOffset = { 0 };
1138 aResult.endOffset = {
aStr.getLength() };
1144 AmbiguousIndex nStart;
1145 AmbiguousIndex nEnd;
1156 std::vector<AmbiguousIndex> aFltArr;
1158 nStart, nEnd, aFltArr,
false,
false);
1159 if (aSText.
SearchForward(
aStr, &nStart.GetAnyIndex(), &nEnd.GetAnyIndex(), &aResult))
@ ShowDelete
show all deletes
o3tl::strong_int< sal_Int32, struct Tag_TextFrameIndex > TextFrameIndex
Denotes a character index in a text frame at a layout level, after extent mapping from a text node at...
SwRewriter MakeUndoReplaceRewriter(sal_uLong const occurrences, OUString const &sOld, OUString const &sNew)
Text operation/manipulation interface.
virtual bool DeleteAndJoin(SwPaM &, SwDeleteFlags flags=SwDeleteFlags::Default)=0
complete delete of a given PaM
virtual bool ReplaceRange(SwPaM &rPam, const OUString &rNewStr, const bool bRegExReplace)=0
Replace selected range in a TextNode with string.
virtual bool Search(const SwPaM &rPaM, const SvxSearchItem &rSearchItem)=0
Searches text in shapes anchored inside rPaM.
static bool IsRedlineOn(const RedlineFlags eM)
virtual const SwRedlineTable & GetRedlineTable() const =0
virtual const SwRangeRedline * GetRedline(const SwPosition &rPos, SwRedlineTable::size_type *pFndPos) const =0
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
virtual void SetModified()=0
Must be called manually at changes of format.
sal_Int32 StartSearchAndReplace(const SvxSearchItem &rSearchItem)
const tools::Rectangle & GetAllMarkedRect() const
SdrTextObj * GetTextEditObject() const
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false)
const OutlinerView * GetTextEditOutlinerView() const
SvxSearchCmd GetCommand() const
const css::lang::Locale & GetLocale(const LanguageType aLang)
sal_uInt16 GetRealScriptOfText(const OUString &rText, sal_Int32 nPos) const
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
sal_Int32 Find_Text(const i18nutil::SearchOptions2 &rSearchOpt, bool bSearchInNotes, SwDocPositions nStart, SwDocPositions nEnd, bool &bCancel, FindRanges, bool bReplace=false, SwRootFrame const *const pLayout=nullptr)
sal_Int32 FindAll(SwFindParas &, SwDocPositions, SwDocPositions, FindRanges, bool &bCancel)
SwWrtShell * GetWrtShell()
Access to the SwWrtShell belonging to SwView.
IDocumentState const & getIDocumentState() const
void SetOle2Link(const Link< bool, void > &rLink)
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
const Link< bool, void > & GetOle2Link() const
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
SwDocShell * GetDocShell()
Base class of the Writer document model elements.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodeOffset GetIndex() const
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
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.
SwContentNode * GetPointContentNode() const
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
const SwPosition * End() const
SwContentNode * GetMarkContentNode() const
const SwPosition * GetPoint() const
const SwPosition * Start() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
sal_uInt16 SearchReplace(const SwFormatField &pField, const i18nutil::SearchOptions2 &rSearchOptions, bool bSrchForward)
void SetActiveSidebarWin(sw::annotation::SwAnnotationWin *p)
sal_uInt16 FinishSearchReplace(const i18nutil::SearchOptions2 &rSearchOptions, bool bSrchForward)
SW_DLLPUBLIC bool HasActiveSidebarWin() const
RedlineType GetType(sal_uInt16 nPos=0) const
vector_type::size_type size_type
The root element of a Writer document layout.
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding).
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
sal_Int32 GetStart() const
bool HasDummyChar() const
Represents the visualization of a paragraph.
SwPosition MapViewToModelPos(TextFrameIndex nIndex) const
LanguageType GetLangOfChar(TextFrameIndex nIndex, sal_uInt16 nScript, bool bNoChar=false) const
sw::MergedPara * GetMergedPara()
TextFrameIndex MapModelToView(SwTextNode const *pNode, sal_Int32 nIndex) const
TextFrameIndex MapModelToViewPos(SwPosition const &rPos) const
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
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
const SwPostItMgr * GetPostItMgr() const
static SvxSearchItem * GetSearchItem()
Used by the UI to modify the document model.
tools::Long CallSetCursor(const Point *pPt, bool bProp)
An SwTextAttr container, stores all directly formatted text portions for a text node.
bool SearchForward(const OUString &rStr, sal_Int32 *pStart, sal_Int32 *pEnd, css::util::SearchResult *pRes=nullptr)
void ReplaceBackReferences(OUString &rReplaceStr, std::u16string_view rStr, const css::util::SearchResult &rResult) const
void SetLocale(const i18nutil::SearchOptions2 &rOpt, const css::lang::Locale &rLocale)
@ InSel
Find in selections.
EmbeddedObjectRef * pObject
static OUString lcl_CleanStr(const SwTextNode &rNd, SwTextFrame const *const pFrame, SwRootFrame const *const pLayout, AmbiguousIndex const nStart, AmbiguousIndex &rEnd, std::vector< AmbiguousIndex > &rArr, bool const bRemoveSoftHyphen, bool const bRemoveCommentAnchors)
static bool DoSearch(SwPaM &rSearchPam, const i18nutil::SearchOptions2 &rSearchOpt, utl::TextSearch &rSText, SwMoveFnCollection const &fnMove, bool bSrchForward, bool bRegSearch, bool bChkEmptyPara, bool bChkParaEnd, AmbiguousIndex &nStart, AmbiguousIndex &nEnd, AmbiguousIndex nTextLen, SwTextNode const *pNode, SwTextFrame const *pTextFrame, SwRootFrame const *pLayout, SwPaM *pPam)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_ANNOTATION(60)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN)
constexpr TypedWhichId< SwFormatFlyCnt > RES_TXTATR_FLYCNT(58)
constexpr TypedWhichId< SwFormatMeta > RES_TXTATR_METAFIELD(49)
constexpr TypedWhichId< SwFormatRefMark > RES_TXTATR_REFMARK(RES_TXTATR_WITHEND_BEGIN)
constexpr TypedWhichId< SwFormatMeta > RES_TXTATR_META(48)
constexpr TypedWhichId< SwTOXMark > RES_TXTATR_TOXMARK(47)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
Dialog to specify the properties of date form field.
bool FindTextImpl(SwPaM &rSearchPam, const i18nutil::SearchOptions2 &rSearchOpt, bool bSearchInNotes, utl::TextSearch &rSText, SwMoveFnCollection const &fnMove, const SwPaM &rRegion, bool bInReadOnly, SwRootFrame const *const pLayout, std::unique_ptr< SvxSearchItem > &xSearchItem)
Search.
std::optional< OUString > ReplaceBackReferences(const i18nutil::SearchOptions2 &rSearchOpt, SwPaM *const pPam, SwRootFrame const *const pLayout)
Helperfunction to resolve backward references in regular expressions.
void MakeRegion(SwMoveFnCollection const &fnMove, const SwPaM &rOrigRg, std::optional< SwPaM > &rPam)
make a new region
bool FrameContainsNode(SwContentFrame const &rFrame, SwNodeOffset nNodeIndex)
bool GetRanges(std::vector< std::shared_ptr< SwUnoCursor > > &rRanges, SwDoc &rDoc, SwPaM const &rDelPam)
bool ReplaceImpl(SwPaM &rCursor, OUString const &rReplacement, bool const bRegExp, SwDoc &rDoc, SwRootFrame const *const pLayout)
std::enable_if< std::is_signed< T >::value, SwNodeOffset >::type operator-(SwNodeOffset a, T n)
SwNodeOffset abs(const SwNodeOffset &a)
bool GoPrevPara(SwPaM &rPam, SwMoveFnCollection const &aPosPara)
SwContentNode * GetNode(SwPaM &rPam, bool &rbFirst, SwMoveFnCollection const &fnMove, bool const bInReadOnly, SwRootFrame const *const i_pLayout)
This function returns the next node in direction of search.
bool GoNextPara(SwPaM &rPam, SwMoveFnCollection const &aPosPara)
bool GoInContent(SwPaM &rPam, SwMoveFnCollection const &fnMove)
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
virtual bool IsReplaceMode() const =0
virtual int DoFind(SwPaM &, SwMoveFnCollection const &, const SwPaM &, bool, std::unique_ptr< SvxSearchItem > &xSearchItem)=0
Marks a position in the document model.
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
void SetContent(sal_Int32 nContentIndex)
Set content index, only valid to call this if the position points to a SwContentNode subclass.
SwNodeOffset GetNodeIndex() const
sal_Int32 GetContentIndex() const
SwTextNode const * pLastNode
mainly for sanity checks
bool operator<(const wwFont &r1, const wwFont &r2)