22#include <com/sun/star/i18n/WordType.hpp>
23#include <com/sun/star/i18n/XBreakIterator.hpp>
32#include <bookmark.hxx>
75 : pDSh(pSh), nActPos(nStt), bBack(
false), bNodeIdx(
false)
77 bBack = (nStt > nEnd);
79 std::swap( nStt, nEnd );
83 explicit PercentHdl(
const SwPaM& rPam )
100 bBack = (nStt > nEnd );
102 std::swap( nStt, nEnd );
125 :
SwPaM( rPos, pRing )
126 , m_nRowSpanOffset(0)
127 , m_nCursorBidiLevel(0)
128 , m_bColumnSelection(false)
134 :
SwPaM( rCpy, pRing )
135 , m_nRowSpanOffset(rCpy.m_nRowSpanOffset)
136 , m_nCursorBidiLevel(rCpy.m_nCursorBidiLevel)
137 , m_bColumnSelection(rCpy.m_bColumnSelection)
255 sal_Int32 nContentPos =
m_vSavePos.back().nContent;
258 ? rNds.
GoNextSection( &rPtPos, bSkipOverHiddenSections, bSkipOverProtectSections)
263 pCNd = bGoNxt ? rNds.
GoNextSection( &rPtPos, bSkipOverHiddenSections, bSkipOverProtectSections)
267 bool bIsValidPos =
nullptr != pCNd;
268 const bool bValidNodesRange = bIsValidPos &&
270 if( !bValidNodesRange )
284 pCNd = rNds.
GoNext( &rPtPos );
290 const sal_Int32 nTmpPos = bIsValidPos ? (bGoNxt ? 0 : pCNd->
Len()) : nContentPos;
292 if( !bIsValidPos || !bValidNodesRange ||
298 if(
HasMark() && bSkipOverProtectSections)
302 if( nEndIdx <= nSttIdx )
303 std::swap( nSttIdx, nEndIdx );
315 if( nSttIdx <= nIdx && nEndIdx >= nIdx )
361 if (pFrame !=
nullptr)
367 bGoNxt ? 0 : pTextFrame->GetText().getLength()));
379 const sal_Int32 nTmpPos = bGoNxt ? 0 : pCNd->
Len();
443 if ( pInputFieldTextAttrAtPoint != pInputFieldTextAttrAtMark )
449 const sal_Int32 nRefContentIdx =
453 const bool bIsForwardSelection =
458 if ( pInputFieldTextAttrAtPoint !=
nullptr )
460 const sal_Int32 nNewPointPos =
461 bIsForwardSelection ? *(pInputFieldTextAttrAtPoint->
End()) : pInputFieldTextAttrAtPoint->
GetStart();
465 if ( pInputFieldTextAttrAtMark !=
nullptr )
467 const sal_Int32 nNewMarkPos =
468 bIsForwardSelection ? pInputFieldTextAttrAtMark->
GetStart() : *(pInputFieldTextAttrAtMark->
End());
477 if( ( !pMrkNd && !pPtNd ) || pPtNd == pMrkNd )
502 nSttEndTable = rNds[ nSEIdx ]->StartOfSectionIndex() - 1;
512 : rNds.GoNextSection(
GetPoint(),true,false );
515 if (
nullptr == pMyNd)
531 pMyNd = pOuterTableNd;
573 bool bInCoveredCell =
false;
575 OSL_ENSURE( pTmpSttNode,
"In table, therefore I expect to get a SwTableBoxStartNode" );
578 bInCoveredCell =
true;
581 if ( !bInCoveredCell )
732 if( !bCursorInReadOnly && pNd->
IsProtect() )
761 bool bInReadOnly,
bool& bCancel )
766 sal_Int32 nFound = 0;
768 SwPaM *pTmpCursor = pCurrentCursor, *pSaveCursor = pCurrentCursor;
769 std::unique_ptr<SvxSearchItem> xSearchItem;
772 bool bIsUnoCursor =
dynamic_cast<SwUnoCursor*
>(pCurrentCursor) !=
nullptr;
773 std::unique_ptr<PercentHdl> pPHdl;
774 sal_uInt16 nCursorCnt = 0;
777 while( pCurrentCursor != ( pTmpCursor = pTmpCursor->
GetNext() ))
779 if( nCursorCnt && !bIsUnoCursor )
780 pPHdl.reset(
new PercentHdl( 0, nCursorCnt, rDoc.
GetDocShell() ));
783 pSaveCursor = pSaveCursor->
GetPrev();
792 *pSttPos = *pTmpCursor->
Start();
793 *pEndPos = *pTmpCursor->
End();
797 if( !nCursorCnt && !pPHdl && !bIsUnoCursor )
798 pPHdl.reset(
new PercentHdl( aRegion ));
801 while( *pSttPos <= *pEndPos )
803 nFndRet = rParas.
DoFind(*pCurrentCursor, fnMove, aRegion, bInReadOnly, xSearchItem);
851 *pEndPos = *pCurrentCursor->
Start();
854 *pSttPos = *pCurrentCursor->
End();
856 if( *pSttPos == *pEndPos )
860 if( !nCursorCnt && pPHdl )
862 pPHdl->NextPos( *aRegion.
GetMark() );
869 pTmpCursor = pTmpCursor->
GetNext();
870 if( nCursorCnt && pPHdl )
872 pPHdl->NextPos( ++pPHdl->nActPos );
875 }
while( pTmpCursor != pSaveCursor && pTmpCursor->
GetNext() != pTmpCursor);
877 if( nFound && !pFndRing )
878 pFndRing = pCurrentCursor->
Create();
885 SwPaM& rPam,
bool bFirst )
917 SwPaM& rPam,
bool bFirst )
960 sal_Int32 nFound = 0;
963 std::unique_ptr<SvxSearchItem> xSearchItem;
974 pFndRing, aRegion, eFndRngs,
975 bInReadOnly, bCancel );
1008 aRegion, eFndRngs, bInReadOnly, bCancel );
1060 aRegion, eFndRngs, bInReadOnly, bCancel );
1092 nFound = rParas.
DoFind(*
this, fnMove, aRegion, bInReadOnly, xSearchItem) ? 1 : 0;
1093 if (0 != nFound && bMarkPos)
1104 bool bIsStart =
true;
1112 pCNd = rNds.
GoNext( &rPos );
1121 pCNd = rNds.
GoNext( &rPos );
1132 if( pCNd && !bIsStart )
1148 OUString
const* m_pText;
1150 sal_Int32 m_nPtIndex;
1155 sal_Int32 & m_rPtPos;
1158 SwTextNode *& rpTextNode, sal_Int32 & rPtPos,
1159 OUString
const*
const pFilteredNodeText =
nullptr)
1160 : m_pText(pFilteredNodeText)
1162 , m_rpTextNode(rpTextNode)
1168 m_pText = &m_pFrame->
GetText();
1169 m_nPtIndex = sal_Int32(m_pFrame->
MapModelToView(rpTextNode, rPtPos));
1175 m_pText = &rpTextNode->
GetText();
1177 m_nPtIndex = rPtPos;
1182 AssignBack(m_rpTextNode, m_rPtPos);
1184 void AssignBack(
SwTextNode *& rpTextNode, sal_Int32 & rPtPos)
1186 if (0 <= m_nPtIndex && m_pFrame)
1188 std::pair<SwTextNode*, sal_Int32>
const pos(
1190 rpTextNode =
pos.first;
1191 rPtPos =
pos.second;
1195 rPtPos = m_nPtIndex;
1204 return SelectWordWT( pViewShell, WordType::ANYWORD_IGNOREWHITESPACES, pPt );
1215 HideWrapper
w(pLayout, pTextNd, nPtPos);
1218 *
w.m_pText,
w.m_nPtIndex,
1233 HideWrapper
w(pLayout, pTextNd, nPtPos);
1236 *
w.m_pText,
w.m_nPtIndex,
1253 HideWrapper
w(pLayout, pTextNd, nPtPos);
1256 *
w.m_pText,
w.m_nPtIndex,
1261 bRet = aBoundary.startPos != aBoundary.endPos &&
1262 aBoundary.startPos <=
w.m_nPtIndex &&
1263 w.m_nPtIndex <= aBoundary.endPos;
1264 w.m_nPtIndex = aBoundary.startPos;
1286 bRet = aOrigPos == *aCursor.
GetPoint();
1301 HideWrapper
w(pLayout, pTextNd, nPtPos);
1304 *
w.m_pText,
w.m_nPtIndex,
1330 HideWrapper
w(pLayout, pTextNd, nPtPos);
1333 *
w.m_pText,
w.m_nPtIndex,
1340 GetPoint()->GetContentIndex() != nPtPos )
1360 HideWrapper
w(pLayout, pTextNd, nPtPos);
1363 *
w.m_pText,
w.m_nPtIndex,
1365 nWordType ).startPos;
1388 HideWrapper
w(pLayout, pTextNd, nPtPos);
1390 const sal_Int32 nPtStart =
w.m_nPtIndex;
1394 w.AssignBack(pTextNd, nPtPos);
1398 *
w.m_pText, nPtStart,
1400 nWordType ).startPos;
1420 if( pPt &&
nullptr != pLayout )
1439 const SwPosition& rEnd = pMark->GetMarkEnd();
1441 assert(pMark->GetMarkEnd() != *
GetPoint());
1450 bool bForward =
true;
1453 HideWrapper
w(pViewShell->
GetLayout(), pTextNd, nPtPos);
1456 *
w.m_pText,
w.m_nPtIndex,
1465 w.AssignBack(pTextNd, nPtPos);
1468 *
w.m_pText,
w.m_nPtIndex,
1476 sal_Int32 nStartIndex;
1477 w.m_nPtIndex = aBndry.startPos;
1478 w.AssignBack(pStartNode, nStartIndex);
1481 sal_Int32 nEndIndex;
1482 w.m_nPtIndex = aBndry.endPos;
1483 w.AssignBack(pEndNode, nEndIndex);
1485 if( aBndry.startPos != aBndry.endPos )
1497 bool bStartMatch =
GetMark()->
GetNode() == pAnnotationMark->GetMarkStart().GetNode() &&
1499 bool bEndMatch =
GetPoint()->
GetNode() == pAnnotationMark->GetMarkEnd().GetNode() &&
1501 if (bStartMatch && bEndMatch)
1525 OUString sNodeText(pTextNd->
GetText());
1537 if( RedlineType::Delete == pRed->
GetType() )
1539 sal_Int32 nStart, nEnd;
1542 while ( nStart < nEnd && nStart < sNodeText.getLength() )
1543 sNodeText = sNodeText.replaceAt( nStart++, 1, rtl::OUStringChar(
CH_TXTATR_INWORD) );
1564 HideWrapper
w(pLayout, pTextNd, nPtPos, &sNodeText);
1566 switch ( eMoveType )
1570 *
w.m_pText,
w.m_nPtIndex,
1575 *
w.m_pText,
w.m_nPtIndex,
1581 *
w.m_pText,
w.m_nPtIndex,
1583 if (
w.m_nPtIndex >= 0 &&
w.m_nPtIndex <
w.m_pText->getLength())
1589 while (
w.m_nPtIndex <
w.m_pText->getLength()
1590 && (*
w.m_pText)[
w.m_nPtIndex] ==
' ');
1596 *
w.m_pText,
w.m_nPtIndex,
1599 if (
w.m_nPtIndex == 0)
1601 if (
w.m_nPtIndex > 0)
1604 *
w.m_pText,
w.m_nPtIndex - 1,
1627 if (!pStartNd || !pEndNd)
1641 HideWrapper
w(pLayout, pStartNd, nStartPos, &sStartText);
1644 *
w.m_pText,
w.m_nPtIndex,
1648 HideWrapper
w(pLayout, pEndNd, nEndPos, &sEndText);
1651 *
w.m_pText,
w.m_nPtIndex,
1668 bool ,
bool ,
bool ,
1678 bool & io_rbLeft,
bool bVisualAllowed,
bool bInsertCursor)
1695 std::pair<Point, bool>
const tmp(aPt,
true);
1697 GetDoc().getIDocumentLayoutAccess().GetCurrentLayout(),
1702 bool bForward = ! io_rbLeft;
1707 bForward, bInsertCursor );
1710 io_rbLeft = ! bForward;
1719 const sal_Int32 nMoveOverPos = io_rbLeft ?
1731 bool bVisualAllowed,
bool bSkipHidden,
bool bInsertCursor,
1732 SwRootFrame const*
const pLayout,
bool isFieldNames)
1755 while (pFrame->GetPrecede())
1757 pFrame =
static_cast<SwTextFrame const*
>(pFrame->GetPrecede());
1786 if ( !
Move( fnMove, fnGo ) )
1809 while (pNewFrame->GetPrecede())
1811 pNewFrame =
static_cast<SwTextFrame const*
>(pNewFrame->GetPrecede());
1815 if (pFrame == pNewFrame || !pNewFrame)
1825 assert(!pFrame->IsAnFollow(pNewFrame) && !pNewFrame->IsAnFollow(pFrame));
1867 const bool bCellChanged = pOldTabSttNode && pNewTabSttNode &&
1868 pOldTabSttNode == pNewTabSttNode &&
1869 pOldTabBoxSttNode && pNewTabBoxSttNode &&
1870 pOldTabBoxSttNode != pNewTabBoxSttNode;
1876 if ( pTableBox && pTableBox->
getRowSpan() > 1 )
1883 rPtPos.
Assign( aNewIdx );
1892 if ( !
Move( fnMove, fnGo ) )
1903 if ( pTableBoxStartNode )
1906 if ( pTableBox && pTableBox->
getRowSpan() < 1 )
1916 rPtPos.
Assign( aNewIdx );
1933 if ( &rTmpNode != &rNode && rTmpNode.
IsTextNode() )
1936 std::pair<Point, bool>
const tmp(aPt,
true);
1938 GetDoc().getIDocumentLayoutAccess().GetCurrentLayout(),
1980 if ( nCurrLevel % 2 != nPrevLevel % 2 )
1994 bool bAdjustTableCursor =
false;
2003 bAdjustTableCursor =
true;
2010 std::pair<Point, bool>
const temp(aPt,
true);
2021 aPt = aTmpRect.
Pos();
2033 if ( bAdjustTableCursor && !bUp )
2040 OSL_ENSURE( pTableNd,
"pTableCursor without SwTableNode?" );
2047 std::pair<Point, bool>
const tmp(aPt,
true);
2053 (bUp ? pFrame->
UnitUp(
this, nUpDownX, bInReadOnly )
2054 : pFrame->
UnitDown(
this, nUpDownX, bInReadOnly ) ) &&
2057 std::pair<Point, bool>
const tmp(aPt,
true);
2070 std::pair<Point, bool>
const tmp(aPt,
true);
2096 sal_Int32 nOffset = 0;
2103 nOffset = pTextNd->
GetText().getLength();
2112 pSh->UpdateCursor();
2132 std::pair<Point, bool>
const tmp(aPt,
true);
2150 std::pair<Point, bool>
const tmp(aPt,
true);
2202 if ( pTableBox && pTableBox->
getRowSpan() > 1 )
2212 const SwNode* pTmpNode = bNext ?
2216 SwNodeIndex aCellIdx( *pTmpNode, bNext ? 1 : -1 );
2222 rPtPos.
Assign( aCellIdx );
2228 if ( pTableBox && pTableBox->
getRowSpan() < 1 )
2261 GetSttNd()->FindTableNode() );
2277 if( pTableBox && pTableBox->
GetSttNd() &&
2294 bool bShortCut =
false;
2304 const sal_Int32 nSttEnd = &fnPosPara == &
fnMoveForward ? 0 : pContentNd->
Len();
2305 if (
GetPoint()->GetContentIndex() != nSttEnd )
2318 return (*fnWhichPara)( *
this, fnPosPara );
2323 return (*fnWhichPara)( *
this, fnPosPara ) &&
2333 return (*fnWhichSect)( *
this, fnPosSect ) &&
2345 "SwCursor::RestoreSavePos: invalid node: "
2346 "probably something was deleted; consider using SwUnoCursor instead");
2360 OSL_FAIL(
"SwCursor::RestoreSavePos: invalid content index");
2385 size_t nO = rTmp.
size();
2392 size_t nM = nU + ( nO - nU ) / 2;
2393 if( rTmp[ nM ]->GetSttNd() == pSrch )
2398 else if( rTmp[ nM ]->GetSttIdx() < nIdx )
2437 if( !pCur->
HasMark() || !pSttNd ||
2459 if (pNd && pNd != &pPos->
GetNode())
2473 pCurrentCursor = pDel->
GetPrev();
2475 if( pDel == pCurrentCursor )
2480 }
while ( pCurrentCursor != pCur );
2484 pSttNd = aTmp[
nPos ]->GetSttNd();
2495 : pCurrentCursor->
Create( pCurrentCursor );
2508 return pCurrentCursor;
2529 if( pStart && pEnd )
2547 size_t nOld = 0, nNew = 0;
2552 if( pPOld == pPNew )
2574 for ( ; nNew < rNew.
size(); ++nNew )
2615 if (
m_SelectedBoxes[--
n]->GetFrameFormat()->GetProtect().IsContentProtected())
css::chart::ChartAxisLabelPosition ePos
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...
bool isLetterNumeric(const OUString &rStr, sal_Int32 nPos) const
helper class to disable creation of an action by a callback event in particular, change event from a ...
virtual const SwRootFrame * GetCurrentLayout() const =0
Provides access to the marks of a document.
virtual sw::mark::IMark * getAnnotationMarkFor(const SwPosition &rPosition) const =0
virtual ::sw::mark::IFieldmark * getFieldmarkAt(const SwPosition &rPos) const =0
get Fieldmark for CH_TXT_ATR_FIELDSTART/CH_TXT_ATR_FIELDEND at rPos
virtual sw::mark::IFieldmark * getInnerFieldmarkFor(const SwPosition &pos) const =0
static SW_DLLPUBLIC MarkType GetType(const ::sw::mark::IMark &rMark)
Returns the MarkType used to create the mark.
static bool IsShowChanges(const RedlineFlags eM)
virtual SwRedlineTable::size_type GetRedlinePos(const SwNode &rNode, RedlineType nType) const =0
virtual const SwRedlineTable & GetRedlineTable() const =0
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long getX() const
constexpr tools::Long getY() const
bool IsReadOnlyUI() const
static bool IsCTLFontEnabled()
static CursorMovement GetCTLCursorMovement()
bool IsContentProtected() const
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() const
const css::lang::Locale & GetLocale(const LanguageType aLang)
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
virtual bool UnitUp(SwPaM *, const SwTwips nOffset, bool bSetInReadOnly) const
virtual bool UnitDown(SwPaM *, const SwTwips nOffset, bool bSetInReadOnly) const
virtual bool LeftMargin(SwPaM *) const =0
virtual bool RightMargin(SwPaM *, bool bAPI=false) const =0
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
virtual sal_Int32 Len() const
A helper class to save cursor state (position).
SwMoveFnCollection const & MakeFindRange(SwDocPositions, SwDocPositions, SwPaM *) const
set range for search in document
void RestoreSavePos()
Restore cursor state to the one saved by SwCursorSaveState.
bool MoveSection(SwWhichSection, SwMoveFnCollection const &)
bool SelectWord(SwViewShell const *pViewShell, const Point *pPt)
bool IsNoContent() const
determine if point is outside of the node-array's content area
virtual short MaxReplaceArived()
virtual bool IsAtValidPos(bool bPoint=true) const
Return <true> if cursor can be set to this position.
sal_uInt8 GetCursorBidiLevel() const
bool LeftRightMargin(SwRootFrame const &rLayout, bool bLeftMargin, bool bAPI)
std::vector< SwCursor_SavePos > m_vSavePos
bool GoPrevNextCell(bool bNext, sal_uInt16 nCnt)
bool GoNextWordWT(sal_Int16 nWordType, SwRootFrame const *pLayout=nullptr)
virtual bool IsSelOvrCheck(SwCursorSelOverFlags eFlags)
bool GoPrevWordWT(sal_Int16 nWordType, SwRootFrame const *pLayout=nullptr)
bool GoNextCell(sal_uInt16 nCnt=1)
virtual void DoSetBidiLevelUpDown()
virtual bool IsSelOvr(SwCursorSelOverFlags eFlags=SwCursorSelOverFlags::CheckNodeSection|SwCursorSelOverFlags::Toggle|SwCursorSelOverFlags::ChangePos)
SwCursor(SwCursor const &rPaM)=delete
bool IsEndWordWT(sal_Int16 nWordType, SwRootFrame const *pLayout=nullptr) const
void ExpandToSentenceBorders(SwRootFrame const *pLayout)
bool IsInProtectTable(bool bMove=false, bool bChgCursor=true)
bool IsInWordWT(sal_Int16 nWordType, SwRootFrame const *pLayout=nullptr) const
bool MovePara(SwWhichPara, SwMoveFnCollection const &)
bool IsStartEndSentence(bool bEnd, SwRootFrame const *pLayout) const
bool GotoTableBox(const OUString &rName)
bool GoPrevCell(sal_uInt16 nCnt=1)
virtual bool GotoTable(const OUString &rName)
bool SttEndDoc(bool bSttDoc)
bool SelectWordWT(SwViewShell const *pViewShell, sal_Int16 nWordType, const Point *pPt)
void SetCursorBidiLevel(sal_uInt8 nNewLevel)
virtual ~SwCursor() override
bool GoEndWordWT(sal_Int16 nWordType, SwRootFrame const *pLayout=nullptr)
sal_Int32 m_nRowSpanOffset
virtual SwCursor * Create(SwPaM *pRing=nullptr) const
virtual const SwContentFrame * DoSetBidiLevelLeftRight(bool &io_rbLeft, bool bVisualAllowed, bool bInsertCursor)
virtual bool IsReadOnlyAvailable() const
bool GoStartWordWT(sal_Int16 nWordType, SwRootFrame const *pLayout=nullptr)
virtual bool LeftRight(bool bLeft, sal_uInt16 nCnt, SwCursorSkipMode nMode, bool bAllowVisual, bool bSkipHidden, bool bInsertCursor, SwRootFrame const *pLayout, bool isFieldNames)
sal_Int32 FindAll(SwFindParas &, SwDocPositions, SwDocPositions, FindRanges, bool &bCancel)
virtual bool IsSkipOverHiddenSections() const
virtual void SaveTableBoxContent(const SwPosition *pPos)
virtual bool IsSkipOverProtectSections() const
bool UpDown(bool bUp, sal_uInt16 nCnt, Point const *pPt, tools::Long nUpDownX, SwRootFrame &rLayout)
bool IsStartWordWT(sal_Int16 nWordType, SwRootFrame const *pLayout=nullptr) const
bool GoSentence(SentenceMoveType eMoveType, SwRootFrame const *pLayout=nullptr)
void FillFindPos(SwDocPositions ePos, SwPosition &rPos) const
const SwCursor_SavePos * GetSavePos() const
bool IsAtLeftRightMargin(SwRootFrame const &rLayout, bool bLeftMargin, bool bAPI) const
SwSectionFormats & GetSections()
IDocumentUndoRedo & GetIDocumentUndoRedo()
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
SwEditShell const * GetEditShell() const
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
IDocumentMarkAccess * getIDocumentMarkAccess()
SwDocShell * GetDocShell()
Content, content of frame (header, footer, fly).
const SwNodeIndex * GetContentIdx() const
const SwRect & getFrameArea() const
bool isFrameAreaDefinitionValid() const
SwContentFrame * FindPrevCnt()
bool IsInFootnote() const
virtual void Calc(vcl::RenderContext *pRenderContext) const
bool IsRightToLeft() const
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const
bool IsNoTextFrame() const
SwContentFrame * FindNextCnt(const bool _bInSameFootnote=false)
virtual bool GetCharRect(SwRect &, const SwPosition &, SwCursorMoveState *=nullptr, bool bAllowFarAway=true) const
Marks a node in the document model.
const SwNodes & GetNodes() const
SwNodeOffset GetIndex() const
SwNodeIndex & Assign(SwNodes const &rNds, SwNodeOffset nIdx)
Base class of the Writer document model elements.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodeOffset GetIndex() const
const SwStartNode * FindTableBoxStartNode() const
bool IsProtect() const
Is node in something that is protected (range, frame, table cells ... including anchor in case of fra...
SwNodes & GetNodes()
Node is in which nodes-array/doc?
SwTableBox * GetTableBox() const
If node is in a table return the respective table box.
bool IsContentNode() const
bool IsSectionNode() const
SwTableNode * FindTableNode()
Search table node, in which it is.
SwSectionNode * FindSectionNode()
Search section node, in which it is.
const SwStartNode * StartOfSectionNode() const
SwNodeOffset EndOfSectionIndex() const
SwContentNode * GetContentNode()
SwTableNode * GetTableNode()
const SwEndNode * EndOfSectionNode() const
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
static SwContentNode * GoPrevious(SwNodeIndex *)
SwContentNode * GoNext(SwNodeIndex *) const
SwContentNode * GoNextSection(SwNodeIndex *, bool bSkipHidden=true, bool bSkipProtect=true) const
Go to next content-node that is not protected or hidden (Both set FALSE ==> GoNext/GoPrevious!...
SwNode & GetEndOfPostIts() const
A still empty section.
static SwContentNode * GoPrevSection(SwNodeIndex *, bool bSkipHidden=true, bool bSkipProtect=true)
PaM is Point and Mark: a selection of the document model.
const SwPosition * GetMark() const
SwNode & GetPointNode() const
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
bool IsMultiSelection() const
SwContentNode * GetPointContentNode() const
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
const SwPosition * End() const
SwNode & GetMarkNode() const
const SwPosition * GetPoint() const
const SwPosition * Start() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
void CalcStartEnd(SwNodeOffset nNdIdx, sal_Int32 &rStart, sal_Int32 &rEnd) const
Calculates the intersection with text node number nNdIdx.
RedlineType GetType(sal_uInt16 nPos=0) const
Of course Writer needs its own rectangles.
void Height(tools::Long nNew)
void Top(const tools::Long nTop)
void Pos(const Point &rNew)
void Left(const tools::Long nLeft)
vector_type::size_type size_type
The root element of a Writer document layout.
SwViewShell * GetCurrShell() const
bool HasMergedParas() const
sw::FieldmarkMode GetFieldmarkMode() const
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
Primary passes the call to the first page.
sal_uInt8 DirType(const TextFrameIndex nPos) const
static SwScriptInfo * GetScriptInfo(const SwTextNode &rNode, SwTextFrame const **o_pFrame=nullptr, bool bAllowInvalid=false)
return a frame for the node, ScriptInfo is its member... (many clients need both frame and SI,...
A section node represents the start of a section on the UI, i.e.
const SwSection & GetSection() const
bool IsProtectFlag() const
bool IsHiddenFlag() const
SectionType GetType() const
Represents the current text cursor of one opened edit window.
Starts a section of nodes in the document model.
SwTableBox is one table cell in the document model.
sal_Int32 getRowSpan() const
SwTableBox & FindStartOfRowSpan(const SwTable &, sal_uInt16 nMaxStep=USHRT_MAX)
SwTableBox::FindStartOfRowSpan(..) returns the "master" cell, the cell which overlaps the given cell,...
SwNodeOffset GetSttIdx() const
SwFrameFormat * GetFrameFormat()
const SwStartNode * GetSttNd() const
SwTableBox & FindEndOfRowSpan(const SwTable &, sal_uInt16 nMaxStep)
SwTableBox::FindEndOfRowSpan(..) returns the last overlapped cell if there is any.
bool HasReadOnlyBoxSel() const
bool HasHiddenBoxSel() const
bool IsCursorMovedUpdate()
void DeleteBox(size_t nPos)
virtual bool LeftRight(bool bLeft, sal_uInt16 nCnt, SwCursorSkipMode nMode, bool bAllowVisual, bool bSkipHidden, bool bInsertCursor, SwRootFrame const *, bool) override
SwSelBoxes m_SelectedBoxes
SwCursor * MakeBoxSels(SwCursor *pCurrentCursor)
virtual bool IsSelOvrCheck(SwCursorSelOverFlags eFlags) override
SwNodeOffset m_nTableMkNd
SwTableCursor(const SwPosition &rPos)
void ActualizeSelection(const SwSelBoxes &rBoxes)
bool IsCursorMoved() const
SwNodeOffset m_nTablePtNd
void InsertBox(const SwTableBox &rTableBox)
virtual bool GotoTable(const OUString &rName) override
void ParkCursor()
park table cursor on the boxes' start node
virtual ~SwTableCursor() override
const SwTable & GetTable() const
SwTable is one table in the document model, containing rows (which contain cells).
void CreateSelection(const SwPaM &rPam, SwSelBoxes &rBoxes, const SearchType eSearchType, bool bProtect) const
void SwTable::CreateSelection(..) fills the selection structure with table cells for a given SwPaM,...
const SwTableBox * GetTableBox(const OUString &rName, const bool bPerformValidCheck=false) const
static SwTable * FindTable(SwFrameFormat const *const pFormat)
SwTableSortBoxes & GetTabSortBoxes()
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
const sal_Int32 * End() const
sal_Int32 GetStart() const
Represents the visualization of a paragraph.
void PrepareVisualMove(TextFrameIndex &nPos, sal_uInt8 &nCursorLevel, bool &bRight, bool bInsertCursor)
Prepares the cursor position for a visual cursor move (BiDi).
SwPosition MapViewToModelPos(TextFrameIndex nIndex) const
std::pair< SwTextNode *, sal_Int32 > MapViewToModel(TextFrameIndex nIndex) const
map position in potentially merged text frame to SwPosition
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.
virtual sal_Int32 Len() const override
SwTextAttr * GetTextAttrAt(sal_Int32 const nIndex, sal_uInt16 const nWhich, ::sw::GetTextAttrMode const eMode=::sw::GetTextAttrMode::Default) const
get the innermost text attribute covering position nIndex.
const OUString & GetText() const
LanguageType GetLang(const sal_Int32 nBegin, const sal_Int32 nLen=0, sal_uInt16 nScript=0) const
std::vector< SwSectionFormat * >::size_type size_type
bool IsShowOutlineContentVisibilityButton() const
vcl::RenderContext * GetOut() const
const SwViewOption * GetViewOptions() const
SwRootFrame * GetLayout() const
const_iterator begin() const
size_type erase(const Value &x)
std::pair< const_iterator, bool > insert(Value &&x)
void merge(RingContainer< value_type > aDestRing)
Merges two ring containers.
ring_container GetRingContainer()
bool(* SwWhichPara)(SwPaM &, SwMoveFnCollection const &)
@ InSel
Find in selections.
@ InBodyOnly
Find only in body - only in combination with FindRanges::InSelAll !!!
@ InSelAll
All (only in non-body and selections).
@ InOther
Find "all" in Footer/Header/Fly...
@ InBody
Find "one" only in body text.
bool(* SwWhichSection)(SwPaM &, SwMoveFnCollection const &)
constexpr OUStringLiteral IsHidden(u"IsHidden")
static SwContentNode * GetContentNode(SwDoc &rDoc, SwPosition &rPos, bool bNext)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_INPUTFIELD(55)
#define CH_TXT_ATR_FIELDEND
#define CH_TXT_ATR_FIELDSTART
CharClass & GetAppCharClass()
void StartProgress(TranslateId pMessResId, tools::Long nStartValue, tools::Long nEndValue, SwDocShell *pDocShell)
void EndProgress(SwDocShell const *pDocShell)
void SetProgressState(tools::Long nPosition, SwDocShell const *pDocShell)
double getLength(const B2DPolygon &rCandidate)
SwPosition FindFieldSep(IFieldmark const &rMark)
return position of the CH_TXT_ATR_FIELDSEP for rMark
@ Parent
EXPAND : (Start < nIndex <= End)
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
bool GoCurrPara(SwPaM &rPam, SwMoveFnCollection const &aPosPara)
bool GoInContentSkipHidden(SwPaM &rPam, SwMoveFnCollection const &fnMove)
bool GoInContentCells(SwPaM &rPam, SwMoveFnCollection const &fnMove)
bool GoInNode(SwPaM &rPam, SwMoveFnCollection const &fnMove)
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 GoInDoc(SwPaM &rPam, SwMoveFnCollection const &fnMove)
bool GoInContentCellsSkipHidden(SwPaM &rPam, SwMoveFnCollection const &fnMove)
bool CheckNodesRange(const SwNode &rStt, const SwNode &rEnd, bool bChkSection)
Check if the given range is inside one of the defined top-level sections.
bool GoNextPara(SwPaM &rPam, SwMoveFnCollection const &aPosPara)
bool GoInContent(SwPaM &rPam, SwMoveFnCollection const &fnMove)
auto(*)(SwPaM &rPam, SwMoveFnCollection const &fnMove) -> bool SwGoInDoc
SwMoveFnCollection const & fnMoveBackward
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
bool m_bSetInReadOnly
ReadOnly areas may be entered.
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 Adjust(SwNodeOffset nDelta)
Adjust node position, and resets content position to zero.
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
void AssignEndIndex(const SwContentNode &rNd)
Set nNode to rNd, and nContent to the end of rNd.
void SetContent(sal_Int32 nContentIndex)
Set content index, only valid to call this if the position points to a SwContentNode subclass.
SwNodeOffset GetNodeIndex() const
void AssignStartIndex(const SwContentNode &rNd)
Set nNode to rNd, and nContent to the beginning of rNd.
sal_Int32 GetContentIndex() const
void AdjustContent(sal_Int32 nDelta)
Adjust content index, only valid to call this if the position points to a SwContentNode subclass.
static bool lcl_SeekEntry(const SwSelBoxes &rTmp, SwStartNode const *const pSrch, size_t &o_rFndPos)
static bool lcl_MakeSelBkwrd(const SwNode &rSttNd, const SwNode &rEndNd, SwPaM &rPam, bool bFirst)
static OUString lcl_MaskDeletedRedlines(const SwTextNode *pTextNd)
static bool lcl_MakeSelFwrd(const SwNode &rSttNd, const SwNode &rEndNd, SwPaM &rPam, bool bFirst)
const sal_uInt16 coSrchRplcThreshold
static sal_Int32 lcl_FindSelection(SwFindParas &rParas, SwCursor *pCurrentCursor, SwMoveFnCollection const &fnMove, SwCursor *&pFndRing, SwPaM &aRegion, FindRanges eFndRngs, bool bInReadOnly, bool &bCancel)