20#include <com/sun/star/lang/Locale.hpp>
21#include <com/sun/star/util/SearchAlgorithms2.hpp>
22#include <com/sun/star/util/SearchFlags.hpp>
25#include <osl/diagnose.h>
57 switch( rItem1.
Which() )
68 if (oNumOffset1 != oNumOffset2)
73 return rItem1 == rItem2;
77 sal_Int32 nContentPos )
79 while( rPos < rHtsArr.
Count() )
83 if( pTextHt->
GetStart() >= nContentPos )
90 sal_Int32 nContentPos )
96 if( pTextHt->
GetStart() < nContentPos )
103 const bool bSaveMark )
105 sal_Int32 nContentPos;
118 if( bTstEnd && *pEnd > nContentPos )
168 SwSrchChrAttr(): nWhich(0), nStt(0), nEnd(0) {}
171 sal_Int32 nStart, sal_Int32 nAnyEnd )
172 : nWhich( rItem.Which() ), nStt( nStart ), nEnd( nAnyEnd )
178 SwSrchChrAttr *m_pFindArr, *m_pStackArr;
179 sal_Int32 m_nNodeStart;
180 sal_Int32 m_nNodeEnd;
181 sal_uInt16 m_nArrStart, m_nArrLen;
182 sal_uInt16 m_nFound, m_nStackCount;
188 SwAttrCheckArr(
const SfxItemSet& rSet,
bool bForward,
bool bNoCollections );
194 sal_uInt16
Count()
const {
return m_aComapeSet.
Count(); }
195 bool Found()
const {
return m_nFound == m_aComapeSet.
Count(); }
198 sal_Int32
Start()
const;
199 sal_Int32
End()
const;
201 sal_Int32 GetNdStt()
const {
return m_nNodeStart; }
202 sal_Int32 GetNdEnd()
const {
return m_nNodeEnd; }
210SwAttrCheckArr::SwAttrCheckArr(
const SfxItemSet& rSet,
bool bFwd,
211 bool bNoCollections )
217 , m_bNoColls(bNoCollections)
220 m_aComapeSet.
Put( rSet,
false );
224 m_nArrStart = m_aComapeSet.
GetWhichByPos( aIter.GetFirstPos() );
225 m_nArrLen = m_aComapeSet.
GetWhichByPos( aIter.GetLastPos() ) - m_nArrStart+1;
227 char* pFndChar =
new char[ m_nArrLen *
sizeof(SwSrchChrAttr) ];
228 char* pStackChar =
new char[ m_nArrLen *
sizeof(SwSrchChrAttr) ];
230 m_pFindArr =
reinterpret_cast<SwSrchChrAttr*
>(pFndChar);
231 m_pStackArr =
reinterpret_cast<SwSrchChrAttr*
>(pStackChar);
234SwAttrCheckArr::~SwAttrCheckArr()
236 delete[]
reinterpret_cast<char*
>(m_pFindArr);
237 delete[]
reinterpret_cast<char*
>(m_pStackArr);
240void SwAttrCheckArr::SetNewSet(
const SwTextNode& rTextNd,
const SwPaM& rPam )
242 std::fill(m_pFindArr, m_pFindArr + m_nArrLen, SwSrchChrAttr());
243 std::fill(m_pStackArr, m_pStackArr + m_nArrLen, SwSrchChrAttr());
252 : rTextNd.
GetText().getLength();
280 if( SfxItemState::SET ==
rSet.
GetItemState( nWhich, !m_bNoColls, &pFndItem )
283 m_pFindArr[ nWhich - m_nArrStart ] =
284 SwSrchChrAttr( *pFndItem, m_nNodeStart, m_nNodeEnd );
290 nWhich = pItem->
Which();
296 m_pFindArr[ nWhich - m_nArrStart ] =
297 SwSrchChrAttr( *pItem, m_nNodeStart, m_nNodeEnd );
302 pItem = aIter.NextItem();
308 SwSrchChrAttr
const& rTmp)
316 return ((nNdEnd == nNdStart)
317 ? ((rTmp.nEnd < nNdStart) || (nNdEnd < rTmp.nStt))
318 : ((rTmp.nEnd <= nNdStart) || (nNdEnd <= rTmp.nStt)));
321bool SwAttrCheckArr::SetAttrFwd(
const SwTextAttr& rAttr )
333 sal_uInt16 nWhch = rAttr.
Which();
334 std::optional<SfxWhichIter> oIter;
345 oIter.emplace( *pSet );
346 nWhch = oIter->FirstWhich();
348 SfxItemState::SET != oIter->GetItemState(
true, &pTmpItem ) )
349 nWhch = oIter->NextWhich();
360 if( SfxItemState::DONTCARE == eState || SfxItemState::SET == eState )
366 SwSrchChrAttr* pArrPtr;
368 for( pArrPtr = m_pFindArr, n = 0;
n < m_nArrLen;
370 if( pArrPtr->nWhich && pArrPtr->nEnd <= aTmp.nStt )
380 for( pArrPtr = m_pStackArr, n=0;
n < m_nArrLen; ++
n, ++pArrPtr )
382 if( !pArrPtr->nWhich )
385 if( pArrPtr->nEnd <= aTmp.nStt )
388 if( !--m_nStackCount )
391 else if( pArrPtr->nStt <= aTmp.nStt )
393 pCmp = &m_pFindArr[
n ];
396 if( pCmp->nEnd < pArrPtr->nEnd )
397 pCmp->nEnd = pArrPtr->nEnd;
405 if( !--m_nStackCount )
410 bool bContinue =
false;
412 if( SfxItemState::DONTCARE == eState )
419 pCmp = &m_pFindArr[ nWhch - m_nArrStart ];
425 else if( pCmp->nEnd < aTmp.nEnd )
426 pCmp->nEnd = aTmp.nEnd;
432 else if(
CmpAttr( *pItem, *pTmpItem ) )
434 m_pFindArr[ nWhch - m_nArrStart ] = aTmp;
442 pCmp = &m_pFindArr[ nWhch - m_nArrStart ];
446 if( pCmp->nEnd > aTmp.nEnd )
448 OSL_ENSURE( !m_pStackArr[ nWhch - m_nArrStart ].nWhich,
449 "slot on stack is still in use" );
451 if( aTmp.nStt <= pCmp->nStt )
452 pCmp->nStt = aTmp.nEnd;
454 pCmp->nEnd = aTmp.nStt;
456 m_pStackArr[ nWhch - m_nArrStart ] = *pCmp;
466 assert(pSet &&
"otherwise no oIter");
467 nWhch = oIter->NextWhich();
469 SfxItemState::SET != oIter->GetItemState(
true, &pTmpItem ) )
470 nWhch = oIter->NextWhich();
481bool SwAttrCheckArr::SetAttrBwd(
const SwTextAttr& rAttr )
493 sal_uInt16 nWhch = rAttr.
Which();
494 std::optional<SfxWhichIter> oIter;
505 oIter.emplace( *pSet );
506 nWhch = oIter->FirstWhich();
508 SfxItemState::SET != oIter->GetItemState(
true, &pTmpItem ) )
509 nWhch = oIter->NextWhich();
520 if( SfxItemState::DONTCARE == eState || SfxItemState::SET == eState )
526 SwSrchChrAttr* pArrPtr;
528 for( pArrPtr = m_pFindArr, n = 0;
n < m_nArrLen; ++
n, ++pArrPtr )
529 if( pArrPtr->nWhich && pArrPtr->nStt >= aTmp.nEnd )
539 for( pArrPtr = m_pStackArr, n = 0;
n < m_nArrLen; ++
n, ++pArrPtr )
541 if( !pArrPtr->nWhich )
544 if( pArrPtr->nStt >= aTmp.nEnd )
547 if( !--m_nStackCount )
550 else if( pArrPtr->nEnd >= aTmp.nEnd )
552 pCmp = &m_pFindArr[
n ];
555 if( pCmp->nStt > pArrPtr->nStt )
556 pCmp->nStt = pArrPtr->nStt;
564 if( !--m_nStackCount )
569 bool bContinue =
false;
570 if( SfxItemState::DONTCARE == eState )
577 pCmp = &m_pFindArr[ nWhch - m_nArrStart ];
583 else if( pCmp->nStt > aTmp.nStt )
584 pCmp->nStt = aTmp.nStt;
590 else if(
CmpAttr( *pItem, *pTmpItem ))
592 m_pFindArr[ nWhch - m_nArrStart ] = aTmp;
600 pCmp = &m_pFindArr[ nWhch - m_nArrStart ];
604 if( pCmp->nStt < aTmp.nStt )
606 OSL_ENSURE( !m_pStackArr[ nWhch - m_nArrStart ].nWhich,
607 "slot on stack is still in use" );
609 if( aTmp.nEnd <= pCmp->nEnd )
610 pCmp->nEnd = aTmp.nStt;
612 pCmp->nStt = aTmp.nEnd;
614 m_pStackArr[ nWhch - m_nArrStart ] = *pCmp;
624 assert(pSet &&
"otherwise no oIter");
625 nWhch = oIter->NextWhich();
627 SfxItemState::SET != oIter->GetItemState(
true, &pTmpItem ) )
628 nWhch = oIter->NextWhich();
639sal_Int32 SwAttrCheckArr::Start()
const
641 sal_Int32 nStart = m_nNodeStart;
642 SwSrchChrAttr* pArrPtr = m_pFindArr;
643 for( sal_uInt16 n = 0;
n < m_nArrLen; ++
n, ++pArrPtr )
644 if( pArrPtr->nWhich && pArrPtr->nStt > nStart )
645 nStart = pArrPtr->nStt;
650sal_Int32 SwAttrCheckArr::End()
const
652 SwSrchChrAttr* pArrPtr = m_pFindArr;
653 sal_Int32 nEnd = m_nNodeEnd;
654 for( sal_uInt16 n = 0;
n < m_nArrLen; ++
n, ++pArrPtr )
655 if( pArrPtr->nWhich && pArrPtr->nEnd < nEnd )
656 nEnd = pArrPtr->nEnd;
661bool SwAttrCheckArr::CheckStack()
667 const sal_Int32 nSttPos =
Start();
668 const sal_Int32 nEndPos =
End();
669 SwSrchChrAttr* pArrPtr;
670 for( pArrPtr = m_pStackArr, n = 0;
n < m_nArrLen; ++
n, ++pArrPtr )
672 if( !pArrPtr->nWhich )
675 if( m_bForward ? pArrPtr->nEnd <= nSttPos : pArrPtr->nStt >= nEndPos )
678 if( !--m_nStackCount )
679 return m_nFound == m_aComapeSet.
Count();
681 else if( m_bForward ? pArrPtr->nStt < nEndPos : pArrPtr->nEnd > nSttPos )
684 OSL_ENSURE( !m_pFindArr[ n ].nWhich,
"slot in array is already in use" );
685 m_pFindArr[
n ] = *pArrPtr;
688 if( !--m_nStackCount )
689 return m_nFound == m_aComapeSet.
Count();
692 return m_nFound == m_aComapeSet.
Count();
699 rCmpArr.SetNewSet( rTextNd, rPam );
702 if( !rCmpArr.Found() )
704 nEndPos = rCmpArr.GetNdEnd();
714 if( rCmpArr.Found() )
719 if( !rCmpArr.SetAttrFwd( *pAttr ) )
721 if( rCmpArr.GetNdStt() < pAttr->
GetStart() )
734 if(
nPos == rHtArr.
Count() && rCmpArr.Found() )
737 nEndPos = rCmpArr.GetNdEnd();
747 if( rCmpArr.SetAttrFwd( *pAttr ) )
754 if( nSttPos != pAttr->
GetStart() || !rCmpArr.SetAttrFwd( *pAttr ) )
758 if( !rCmpArr.Found() )
762 nSttPos = rCmpArr.Start();
763 nEndPos = rCmpArr.End();
764 if( nSttPos > nEndPos )
772 if( !rCmpArr.CheckStack() )
774 nSttPos = rCmpArr.Start();
775 nEndPos = rCmpArr.End();
776 if( nSttPos > nEndPos )
787 rCmpArr.SetNewSet( rTextNd, rPam );
790 if( !rCmpArr.Found() )
792 nEndPos = rCmpArr.GetNdEnd();
803 if( rCmpArr.Found() )
808 if( !rCmpArr.SetAttrBwd( *pAttr ) )
811 if( nSttPos < rCmpArr.GetNdEnd() )
814 nEndPos = rCmpArr.GetNdEnd();
824 if( !
nPos && rCmpArr.Found() )
827 nEndPos = rCmpArr.GetNdEnd();
836 if( rCmpArr.SetAttrBwd( *pAttr ) )
845 if( nEndPos != pAttr->
GetAnyEnd() || !rCmpArr.SetAttrBwd( *pAttr ) )
849 if( !rCmpArr.Found() )
853 nSttPos = rCmpArr.Start();
854 nEndPos = rCmpArr.
End();
855 if( nSttPos > nEndPos )
863 if( !rCmpArr.CheckStack() )
865 nSttPos = rCmpArr.Start();
866 nEndPos = rCmpArr.End();
867 if( nSttPos > nEndPos )
891 if( SfxItemState::SET != rNdSet.
GetItemState( nWhich, !bNoColls, &pNdItem )
897 nWhich = pItem->
Which();
899 if( !
CmpAttr( rNdSet.
Get( nWhich, !bNoColls ), *pItem ))
912 const SwPaM & rRegion,
bool bInReadOnly,
916 const sal_uInt16 nWhich = rAttr.
Which();
920 std::optional<SwPaM> oPam;
930 ? oPam->GetPoint()->GetContentIndex() == oPam->GetPointContentNode()->Len()
931 : !oPam->GetPoint()->GetContentIndex() )
933 if( !(*fnMove.
fnPos)( oPam->GetPoint(),
false ))
938 oPam->GetPoint()->SetContent( bSrchForward ? 0 : pNd->
Len() );
941 while (
nullptr != (pNode =
::GetNode(*oPam, bFirst, fnMove, bInReadOnly, pLayout)))
963 && (pAttrNode->
GetIndex() < oPam->GetPoint()->GetNodeIndex()
964 || (pAttrNode->
GetIndex() == oPam->GetPoint()->GetNodeIndex()
965 && pAttr->
GetStart() < oPam->GetPoint()->GetContentIndex())
966 || pAttr->
Which() != nWhich));
976 && (oPam->GetPoint()->GetNodeIndex() < pAttrNode->
GetIndex()
977 || (oPam->GetPoint()->GetNodeIndex() == pAttrNode->
GetIndex()
978 && oPam->GetPoint()->GetContentIndex() <= pAttr->
GetStart())
979 || pAttr->
Which() != nWhich));
984 oPam->GetPoint()->Assign(*pAttrNode);
999 *rSearchPam.
GetPoint() = *oPam->GetPoint();
1000 *rSearchPam.
GetMark() = *oPam->GetMark();
1012 if( !aFormatArr.insert( pTmpFormat ).second )
1022 *rSearchPam.
GetPoint() = *pPam->GetPoint();
1032 if( bFound && !bSrchForward )
1044 const SwPaM & rRegion,
bool bInReadOnly,
bool bMoveFirst,
1047 std::optional<SwPaM> oPam;
1050 bool bFound =
false;
1057 SwAttrCheckArr aCmpArr(
rSet, bSrchForward, bNoColls );
1059 aOtherSet.Put(
rSet,
false );
1068 ? oPam->GetPoint()->GetContentIndex() == oPam->GetPointContentNode()->Len()
1069 : !oPam->GetPoint()->GetContentIndex() ) )
1071 if( !(*fnMove.
fnPos)( oPam->GetPoint(),
false ))
1076 oPam->GetPoint()->SetContent( bSrchForward ? 0 : pNd->
Len() );
1079 while (
nullptr != (pNode =
::GetNode(*oPam, bFirst, fnMove, bInReadOnly, pLayout)))
1084 assert(!pLayout || !pNode->
IsTextNode() || pFrame);
1091 if( aCmpArr.Count() )
1096 if (aOtherSet.Count() &&
1097 !
lcl_Search(rPropsNode, aOtherSet, bNoColls))
1108 if (pMergedPara->
extents.empty())
1113 SwPaM tmp(rPropsNode, 0, rPropsNode, 0);
1114 bFound = (*fnSearch)(*pNode->
GetTextNode(), aCmpArr, tmp);
1126 for (
size_t i = 0;
i < pMergedPara->
extents.size(); ++
i)
1128 auto const rExtent(pMergedPara->
extents[bSrchForward
1130 : pMergedPara->
extents.size() -
i - 1]);
1136 sal_Int32
const nStart(rExtent.pNode == &rStart.
GetNode()
1139 if (rExtent.nEnd <= nStart)
1143 sal_Int32
const nEnd(rExtent.pNode == &rEnd.
GetNode()
1145 : rExtent.pNode->Len());
1146 if (nEnd < rExtent.nStart
1147 || (nStart != nEnd && nEnd == rExtent.nStart))
1151 SwPaM tmp(*rExtent.pNode, std::max(nStart, rExtent.nStart),
1152 *rExtent.pNode,
std::min(nEnd, rExtent.nEnd));
1154 bFound = (*fnSearch)(*rExtent.pNode, aCmpArr, tmp);
1165 bFound = (*fnSearch)(*pNode->
GetTextNode(), aCmpArr, *oPam);
1171 *rSearchPam.
GetPoint() = *oPam->GetPoint();
1172 *rSearchPam.
GetMark() = *oPam->GetMark();
1178 if( !aOtherSet.Count() )
1186 if( !aFormatArr.
insert( pTmpFormat ).second )
1190 if (
lcl_Search(rPropsNode, aOtherSet, bNoColls))
1196 *rSearchPam.
GetPoint() = *oPam->GetPoint();
1203 *rSearchPam.
GetPoint() = *oPam->GetPoint();
1234 bool m_bNoCollection;
1239 std::unique_ptr<utl::TextSearch> pSText;
1241 SwFindParaAttr(
const SfxItemSet& rSet,
bool bNoCollection,
1244 : m_bNoCollection(bNoCollection)
1247 , pSearchOpt( pOpt )
1248 , m_rCursor(rCursor)
1249 , m_pLayout(pLayout)
1252 virtual ~SwFindParaAttr() {}
1255 std::unique_ptr<SvxSearchItem>& xSearchItem)
override;
1262 const SwPaM & rRegion,
bool bInReadOnly,
1263 std::unique_ptr<SvxSearchItem>& xSearchItem)
1266 bool bReplaceText = pSearchOpt && ( !pSearchOpt->replaceString.isEmpty() ||
1268 bool bReplaceAttr = pReplSet && pReplSet->Count();
1269 bool bMoveFirst = !bReplaceAttr;
1270 if( bInReadOnly && (bReplaceAttr || bReplaceText ))
1271 bInReadOnly =
false;
1276 SwPaM* pTextRegion = &aRegion;
1284 if (!
FindAttrsImpl(aSrchPam, *pSet, m_bNoCollection, fnMove, aRegion, bInReadOnly, bMoveFirst, m_pLayout))
1291 pTextRegion = &aSrchPam;
1293 else if( !pSearchOpt )
1302 aTmp.searchFlag |= (SearchFlags::REG_NOT_BEGINOFLINE |
1303 SearchFlags::REG_NOT_ENDOFLINE);
1313 if (
sw::FindTextImpl(aSrchPam, *pSearchOpt,
false, *pSText, fnMove, *pTextRegion, bInReadOnly, m_pLayout, xSearchItem) &&
1314 *aSrchPam.GetMark() != *aSrchPam.GetPoint() )
1316 else if( !pSet->
Count() )
1319 *aRegion.GetMark() = *aSrchPam.GetPoint();
1322 *rCursor.
GetPoint() = *aSrchPam.GetPoint();
1324 *rCursor.
GetMark() = *aSrchPam.GetMark();
1330 SearchAlgorithms2::REGEXP == pSearchOpt->AlgorithmType2);
1335 SwPaM* pPrevRing(
nullptr);
1338 pPrevRing =
const_cast<SwPaM &
>(rRegion).GetPrev();
1339 const_cast<SwPaM &
>(rRegion).GetRingContainer().merge( m_rCursor.GetRingContainer() );
1342 std::optional<OUString> xRepl;
1346 xRepl ? *xRepl : pSearchOpt->replaceString, bRegExp,
1347 m_rCursor.GetDoc(), m_pLayout);
1349 m_rCursor.SaveTableBoxContent( rCursor.
GetPoint() );
1358 pNext =
p->GetNext();
1359 p->MoveTo(
const_cast<SwPaM*
>(&rRegion));
1360 }
while( p != pPrevRing );
1370 if( !pSet->
Count() )
1378 SfxItemSet aSet( *pPool, pReplSet->GetRanges() );
1386 pReplSet->GetItemState( pItem->
Which(),
false ))
1389 pItem = aIter.NextItem();
1391 aSet.Put( *pReplSet );
1402bool SwFindParaAttr::IsReplaceMode()
const
1404 return ( pSearchOpt && !pSearchOpt->replaceString.isEmpty() ) ||
1405 ( pReplSet && pReplSet->Count() );
1421 bool bReplace = ( pSearchOpt && ( !pSearchOpt->
replaceString.isEmpty() ||
1423 (pReplSet && pReplSet->
Count());
1430 SwFindParaAttr aSwFindParaAttr(
rSet, bNoCollections, pSearchOpt,
1431 pReplSet, *
this, pLayout );
1433 sal_Int32 nRet =
FindAll( aSwFindParaAttr, nStart, nEnd, eFndRngs, bCancel );
1435 if( nRet && bReplace )
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...
virtual void InsertItemSet(const SwPaM &rRg, const SfxItemSet &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr)=0
virtual void SetModified()=0
Must be called manually at changes of format.
const css::lang::Locale & getLocale(bool bResolveSystem=true) const
const SfxPoolItem * GetCurItem() const
sal_uInt16 GetCurPos() const
const SfxPoolItem * NextItem()
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
SfxItemPool * GetPool() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
sal_uInt16 GetWhichByPos(sal_uInt16 nPos) const
T & StaticWhichCast(TypedWhichId< T > nId)
const LanguageTag & GetLanguageTag() const
SwFormatColl * GetFormatColl() const
bool HasSwAttrSet() const
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
virtual sal_Int32 Len() const
sal_Int32 FindAttrs(const SfxItemSet &rSet, bool bNoCollections, SwDocPositions nStart, SwDocPositions nEnd, bool &bCancel, FindRanges, const i18nutil::SearchOptions2 *pSearchOpt, const SfxItemSet *rReplSet=nullptr, SwRootFrame const *const pLayout=nullptr)
search for attributes
sal_Int32 FindAll(SwFindParas &, SwDocPositions, SwDocPositions, FindRanges, bool &bCancel)
IDocumentState const & getIDocumentState() const
void SetOle2Link(const Link< bool, void > &rLink)
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
const Link< bool, void > & GetOle2Link() const
const SwAttrPool & GetAttrPool() const
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodeOffset GetIndex() const
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.
void Normalize(bool bPointFirst=true)
Normalizes PaM, i.e.
const SwPosition * GetPoint() const
const SwPosition * Start() const
The root element of a Writer document layout.
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
const SfxPoolItem & GetAttr() const
sal_Int32 GetAnyEnd() const
end (if available), else start
const sal_Int32 * End() const
sal_Int32 GetStart() const
Represents the visualization of a paragraph.
SwPosition MapViewToModelPos(TextFrameIndex nIndex) const
sw::MergedPara * GetMergedPara()
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
SwTextNode const * GetTextNodeForParaProps() const
SwTextNode is a paragraph in the document model.
SwpHints & GetSwpHints()
getters for SwpHints
const OUString & GetText() const
An SwTextAttr container, stores all directly formatted text portions for a text node.
SwTextAttr * Get(size_t nPos) const
SwTextAttr * GetSortedByEnd(size_t nPos) const
std::pair< const_iterator, bool > insert(Value &&x)
SwTextAttr const * PrevAttr(SwTextNode const **ppNode=nullptr)
SwTextAttr const * NextAttr(SwTextNode const **ppNode=nullptr)
bool(* FnSearchAttr)(const SwTextNode &, SwAttrCheckArr &, SwPaM &)
static void lcl_SetAttrPam(SwPaM &rPam, sal_Int32 nStart, const sal_Int32 *pEnd, const bool bSaveMark)
const SwTextAttr * GetBkwrdTextHint(const SwpHints &rHtsArr, size_t &rPos, sal_Int32 nContentPos)
static bool CmpAttr(const SfxPoolItem &rItem1, const SfxPoolItem &rItem2)
static bool FindAttrsImpl(SwPaM &rSearchPam, const SfxItemSet &rSet, bool bNoColls, SwMoveFnCollection const &fnMove, const SwPaM &rRegion, bool bInReadOnly, bool bMoveFirst, SwRootFrame const *const pLayout)
static bool lcl_SearchBackward(const SwTextNode &rTextNd, SwAttrCheckArr &rCmpArr, SwPaM &rPam)
static bool lcl_Search(const SwContentNode &rCNd, const SfxItemSet &rCmpSet, bool bNoColls)
static bool lcl_SearchAttr(const SwTextNode &rTextNd, SwPaM &rPam, const SfxPoolItem &rCmpItem, SwMoveFnCollection const &fnMove)
search for a text attribute
static bool lcl_IsAttributeIgnorable(sal_Int32 const nNdStart, sal_Int32 const nNdEnd, SwSrchChrAttr const &rTmp)
const SwTextAttr * GetFrwrdTextHint(const SwpHints &rHtsArr, size_t &rPos, sal_Int32 nContentPos)
static bool lcl_SearchForward(const SwTextNode &rTextNd, SwAttrCheckArr &rCmpArr, SwPaM &rPam)
bool isTXTATR(const sal_uInt16 nWhich)
bool isCHRATR(const sal_uInt16 nWhich)
constexpr sal_uInt16 RES_PARATR_BEGIN(RES_TXTATR_END)
constexpr TypedWhichId< SwFormatAutoFormat > RES_TXTATR_AUTOFMT(50)
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(99)
constexpr sal_uInt16 RES_CHRATR_BEGIN(HINT_BEGIN)
constexpr TypedWhichId< SwFormatCharFormat > RES_TXTATR_CHARFMT(52)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
constexpr sal_uInt16 RES_GRFATR_END(156)
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
constexpr sal_uInt16 RES_TXTATR_END(RES_TXTATR_NOEND_END)
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 FindAttrImpl(SwPaM &rSearchPam, const SfxPoolItem &rAttr, SwMoveFnCollection const &fnMove, const SwPaM &rRegion, bool bInReadOnly, SwRootFrame const *const pLayout)
bool ReplaceImpl(SwPaM &rCursor, OUString const &rReplacement, bool const bRegExp, SwDoc &rDoc, SwRootFrame const *const pLayout)
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
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.
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
bool IsInvalidItem(const SfxPoolItem *pItem)
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 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
Describes parts of multiple text nodes, which will form a text frame, even when redlines are hidden a...
std::vector< Extent > extents