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 )
362 if (pFrame !=
nullptr)
368 bGoNxt ? 0 : pTextFrame->GetText().getLength()));
380 const sal_Int32 nTmpPos = bGoNxt ? 0 : pCNd->
Len();
444 if ( pInputFieldTextAttrAtPoint != pInputFieldTextAttrAtMark )
450 const sal_Int32 nRefContentIdx =
454 const bool bIsForwardSelection =
459 if ( pInputFieldTextAttrAtPoint !=
nullptr )
461 const sal_Int32 nNewPointPos =
462 bIsForwardSelection ? *(pInputFieldTextAttrAtPoint->
End()) : pInputFieldTextAttrAtPoint->
GetStart();
466 if ( pInputFieldTextAttrAtMark !=
nullptr )
468 const sal_Int32 nNewMarkPos =
469 bIsForwardSelection ? pInputFieldTextAttrAtMark->
GetStart() : *(pInputFieldTextAttrAtMark->
End());
478 if( ( !pMrkNd && !pPtNd ) || pPtNd == pMrkNd )
503 nSttEndTable = rNds[ nSEIdx ]->StartOfSectionIndex() - 1;
513 : rNds.GoNextSection(
GetPoint(),true,false );
516 if (
nullptr == pMyNd)
532 pMyNd = pOuterTableNd;
574 bool bInCoveredCell =
false;
576 OSL_ENSURE( pTmpSttNode,
"In table, therefore I expect to get a SwTableBoxStartNode" );
579 bInCoveredCell =
true;
582 if ( !bInCoveredCell )
727 if( !bCursorInReadOnly && pNd->
IsProtect() )
756 bool bInReadOnly,
bool& bCancel )
761 sal_Int32 nFound = 0;
763 SwPaM *pTmpCursor = pCurrentCursor, *pSaveCursor = pCurrentCursor;
764 std::unique_ptr<SvxSearchItem> xSearchItem;
767 bool bIsUnoCursor =
dynamic_cast<SwUnoCursor*
>(pCurrentCursor) !=
nullptr;
768 std::unique_ptr<PercentHdl> pPHdl;
769 sal_uInt16 nCursorCnt = 0;
772 while( pCurrentCursor != ( pTmpCursor = pTmpCursor->
GetNext() ))
774 if( nCursorCnt && !bIsUnoCursor )
775 pPHdl.reset(
new PercentHdl( 0, nCursorCnt, rDoc.
GetDocShell() ));
778 pSaveCursor = pSaveCursor->
GetPrev();
787 *pSttPos = *pTmpCursor->
Start();
788 *pEndPos = *pTmpCursor->
End();
792 if( !nCursorCnt && !pPHdl && !bIsUnoCursor )
793 pPHdl.reset(
new PercentHdl( aRegion ));
796 while( *pSttPos <= *pEndPos )
798 nFndRet = rParas.
DoFind(*pCurrentCursor, fnMove, aRegion, bInReadOnly, xSearchItem);
846 *pEndPos = *pCurrentCursor->
Start();
849 *pSttPos = *pCurrentCursor->
End();
851 if( *pSttPos == *pEndPos )
855 if( !nCursorCnt && pPHdl )
857 pPHdl->NextPos( *aRegion.
GetMark() );
864 pTmpCursor = pTmpCursor->
GetNext();
865 if( nCursorCnt && pPHdl )
867 pPHdl->NextPos( ++pPHdl->nActPos );
870 }
while( pTmpCursor != pSaveCursor && pTmpCursor->
GetNext() != pTmpCursor);
872 if( nFound && !pFndRing )
873 pFndRing = pCurrentCursor->
Create();
880 SwPaM& rPam,
bool bFirst )
912 SwPaM& rPam,
bool bFirst )
955 sal_Int32 nFound = 0;
958 std::unique_ptr<SvxSearchItem> xSearchItem;
969 pFndRing, aRegion, eFndRngs,
970 bInReadOnly, bCancel );
1003 aRegion, eFndRngs, bInReadOnly, bCancel );
1055 aRegion, eFndRngs, bInReadOnly, bCancel );
1087 nFound = rParas.
DoFind(*
this, fnMove, aRegion, bInReadOnly, xSearchItem) ? 1 : 0;
1088 if (0 != nFound && bMarkPos)
1099 bool bIsStart =
true;
1107 pCNd = rNds.
GoNext( &rPos );
1116 pCNd = rNds.
GoNext( &rPos );
1127 if( pCNd && !bIsStart )
1143 OUString
const* m_pText;
1145 sal_Int32 m_nPtIndex;
1150 sal_Int32 & m_rPtPos;
1153 SwTextNode *& rpTextNode, sal_Int32 & rPtPos,
1154 OUString
const*
const pFilteredNodeText =
nullptr)
1155 : m_pText(pFilteredNodeText)
1157 , m_rpTextNode(rpTextNode)
1163 m_pText = &m_pFrame->
GetText();
1164 m_nPtIndex = sal_Int32(m_pFrame->
MapModelToView(rpTextNode, rPtPos));
1170 m_pText = &rpTextNode->
GetText();
1172 m_nPtIndex = rPtPos;
1177 AssignBack(m_rpTextNode, m_rPtPos);
1179 void AssignBack(
SwTextNode *& rpTextNode, sal_Int32 & rPtPos)
1181 if (0 <= m_nPtIndex && m_pFrame)
1183 std::pair<SwTextNode*, sal_Int32>
const pos(
1185 rpTextNode =
pos.first;
1186 rPtPos =
pos.second;
1190 rPtPos = m_nPtIndex;
1199 return SelectWordWT( pViewShell, WordType::ANYWORD_IGNOREWHITESPACES, pPt );
1210 HideWrapper
w(pLayout, pTextNd, nPtPos);
1213 *
w.m_pText,
w.m_nPtIndex,
1228 HideWrapper
w(pLayout, pTextNd, nPtPos);
1231 *
w.m_pText,
w.m_nPtIndex,
1248 HideWrapper
w(pLayout, pTextNd, nPtPos);
1251 *
w.m_pText,
w.m_nPtIndex,
1256 bRet = aBoundary.startPos != aBoundary.endPos &&
1257 aBoundary.startPos <=
w.m_nPtIndex &&
1258 w.m_nPtIndex <= aBoundary.endPos;
1259 w.m_nPtIndex = aBoundary.startPos;
1281 bRet = aOrigPos == *aCursor.
GetPoint();
1296 HideWrapper
w(pLayout, pTextNd, nPtPos);
1299 *
w.m_pText,
w.m_nPtIndex,
1325 HideWrapper
w(pLayout, pTextNd, nPtPos);
1328 *
w.m_pText,
w.m_nPtIndex,
1335 GetPoint()->GetContentIndex() != nPtPos )
1355 HideWrapper
w(pLayout, pTextNd, nPtPos);
1358 *
w.m_pText,
w.m_nPtIndex,
1360 nWordType ).startPos;
1383 HideWrapper
w(pLayout, pTextNd, nPtPos);
1385 const sal_Int32 nPtStart =
w.m_nPtIndex;
1389 w.AssignBack(pTextNd, nPtPos);
1393 *
w.m_pText, nPtStart,
1395 nWordType ).startPos;
1415 if( pPt &&
nullptr != pLayout )
1434 const SwPosition& rEnd = pMark->GetMarkEnd();
1436 assert(pMark->GetMarkEnd() != *
GetPoint());
1445 bool bForward =
true;
1448 HideWrapper
w(pViewShell->
GetLayout(), pTextNd, nPtPos);
1451 *
w.m_pText,
w.m_nPtIndex,
1460 w.AssignBack(pTextNd, nPtPos);
1463 *
w.m_pText,
w.m_nPtIndex,
1471 sal_Int32 nStartIndex;
1472 w.m_nPtIndex = aBndry.startPos;
1473 w.AssignBack(pStartNode, nStartIndex);
1476 sal_Int32 nEndIndex;
1477 w.m_nPtIndex = aBndry.endPos;
1478 w.AssignBack(pEndNode, nEndIndex);
1480 if( aBndry.startPos != aBndry.endPos )
1492 bool bStartMatch =
GetMark()->
GetNode() == pAnnotationMark->GetMarkStart().GetNode() &&
1494 bool bEndMatch =
GetPoint()->
GetNode() == pAnnotationMark->GetMarkEnd().GetNode() &&
1496 if (bStartMatch && bEndMatch)
1520 OUString sNodeText(pTextNd->
GetText());
1532 if( RedlineType::Delete == pRed->
GetType() )
1534 sal_Int32 nStart, nEnd;
1537 while ( nStart < nEnd && nStart < sNodeText.getLength() )
1538 sNodeText = sNodeText.replaceAt( nStart++, 1, rtl::OUStringChar(
CH_TXTATR_INWORD) );
1559 HideWrapper
w(pLayout, pTextNd, nPtPos, &sNodeText);
1561 switch ( eMoveType )
1565 *
w.m_pText,
w.m_nPtIndex,
1570 *
w.m_pText,
w.m_nPtIndex,
1576 *
w.m_pText,
w.m_nPtIndex,
1578 if (
w.m_nPtIndex >= 0 &&
w.m_nPtIndex <
w.m_pText->getLength())
1584 while (
w.m_nPtIndex <
w.m_pText->getLength()
1585 && (*
w.m_pText)[
w.m_nPtIndex] ==
' ');
1591 *
w.m_pText,
w.m_nPtIndex,
1594 if (
w.m_nPtIndex == 0)
1596 if (
w.m_nPtIndex > 0)
1599 *
w.m_pText,
w.m_nPtIndex - 1,
1622 if (!pStartNd || !pEndNd)
1636 HideWrapper
w(pLayout, pStartNd, nStartPos, &sStartText);
1639 *
w.m_pText,
w.m_nPtIndex,
1643 HideWrapper
w(pLayout, pEndNd, nEndPos, &sEndText);
1646 *
w.m_pText,
w.m_nPtIndex,
1663 bool ,
bool ,
bool ,
1673 bool & io_rbLeft,
bool bVisualAllowed,
bool bInsertCursor)
1692 std::pair<Point, bool>
const tmp(aPt,
true);
1694 GetDoc().getIDocumentLayoutAccess().GetCurrentLayout(),
1699 bool bForward = ! io_rbLeft;
1704 bForward, bInsertCursor );
1707 io_rbLeft = ! bForward;
1716 const sal_Int32 nMoveOverPos = io_rbLeft ?
1728 bool bVisualAllowed,
bool bSkipHidden,
bool bInsertCursor,
1729 SwRootFrame const*
const pLayout,
bool isFieldNames)
1752 while (pFrame->GetPrecede())
1754 pFrame =
static_cast<SwTextFrame const*
>(pFrame->GetPrecede());
1783 if ( !
Move( fnMove, fnGo ) )
1806 while (pNewFrame->GetPrecede())
1808 pNewFrame =
static_cast<SwTextFrame const*
>(pNewFrame->GetPrecede());
1812 if (pFrame == pNewFrame || !pNewFrame)
1822 assert(!pFrame->IsAnFollow(pNewFrame) && !pNewFrame->IsAnFollow(pFrame));
1864 const bool bCellChanged = pOldTabSttNode && pNewTabSttNode &&
1865 pOldTabSttNode == pNewTabSttNode &&
1866 pOldTabBoxSttNode && pNewTabBoxSttNode &&
1867 pOldTabBoxSttNode != pNewTabBoxSttNode;
1873 if ( pTableBox && pTableBox->
getRowSpan() > 1 )
1880 rPtPos.
Assign( aNewIdx );
1889 if ( !
Move( fnMove, fnGo ) )
1900 if ( pTableBoxStartNode )
1903 if ( pTableBox && pTableBox->
getRowSpan() < 1 )
1913 rPtPos.
Assign( aNewIdx );
1930 if ( &rTmpNode != &rNode && rTmpNode.
IsTextNode() )
1933 std::pair<Point, bool>
const tmp(aPt,
true);
1935 GetDoc().getIDocumentLayoutAccess().GetCurrentLayout(),
1977 if ( nCurrLevel % 2 != nPrevLevel % 2 )
1991 bool bAdjustTableCursor =
false;
2000 bAdjustTableCursor =
true;
2007 std::pair<Point, bool>
const temp(aPt,
true);
2018 aPt = aTmpRect.
Pos();
2030 if ( bAdjustTableCursor && !bUp )
2037 OSL_ENSURE( pTableNd,
"pTableCursor without SwTableNode?" );
2044 std::pair<Point, bool>
const tmp(aPt,
true);
2050 (bUp ? pFrame->
UnitUp(
this, nUpDownX, bInReadOnly )
2051 : pFrame->
UnitDown(
this, nUpDownX, bInReadOnly ) ) &&
2054 std::pair<Point, bool>
const tmp(aPt,
true);
2067 std::pair<Point, bool>
const tmp(aPt,
true);
2075 aPt.setX(aTmpRect.
Center().getX());
2081 aPt.setY(aTmpRect.
Center().getY());
2093 sal_Int32 nOffset = 0;
2100 nOffset = pTextNd->
GetText().getLength();
2109 pSh->UpdateCursor();
2129 std::pair<Point, bool>
const tmp(aPt,
true);
2147 std::pair<Point, bool>
const tmp(aPt,
true);
2199 if ( pTableBox && pTableBox->
getRowSpan() > 1 )
2209 const SwNode* pTmpNode = bNext ?
2213 SwNodeIndex aCellIdx( *pTmpNode, bNext ? 1 : -1 );
2219 rPtPos.
Assign( aCellIdx );
2225 if ( pTableBox && pTableBox->
getRowSpan() < 1 )
2258 GetSttNd()->FindTableNode() );
2274 if( pTableBox && pTableBox->
GetSttNd() &&
2291 bool bShortCut =
false;
2301 const sal_Int32 nSttEnd = &fnPosPara == &
fnMoveForward ? 0 : pContentNd->
Len();
2302 if (
GetPoint()->GetContentIndex() != nSttEnd )
2315 return (*fnWhichPara)( *
this, fnPosPara );
2320 return (*fnWhichPara)( *
this, fnPosPara ) &&
2330 return (*fnWhichSect)( *
this, fnPosSect ) &&
2342 "SwCursor::RestoreSavePos: invalid node: "
2343 "probably something was deleted; consider using SwUnoCursor instead");
2357 OSL_FAIL(
"SwCursor::RestoreSavePos: invalid content index");
2382 size_t nO = rTmp.
size();
2389 size_t nM = nU + ( nO - nU ) / 2;
2390 if( rTmp[ nM ]->GetSttNd() == pSrch )
2395 else if( rTmp[ nM ]->GetSttIdx() < nIdx )
2434 if( !pCur->
HasMark() || !pSttNd ||
2456 if (pNd && pNd != &pPos->
GetNode())
2470 pCurrentCursor = pDel->
GetPrev();
2472 if( pDel == pCurrentCursor )
2477 }
while ( pCurrentCursor != pCur );
2481 pSttNd = aTmp[
nPos ]->GetSttNd();
2492 : pCurrentCursor->
Create( pCurrentCursor );
2505 return pCurrentCursor;
2526 if( pStart && pEnd )
2544 size_t nOld = 0, nNew = 0;
2549 if( pPOld == pPNew )
2571 for ( ; nNew < rNew.
size(); ++nNew )
2612 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 * getFieldmarkFor(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.
bool IsReadOnlyUI() const
CursorMovement GetCTLCursorMovement() const
bool IsCTLFontEnabled() const
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...
SwContentFrame * GetPrevContentFrame() const
virtual bool UnitUp(SwPaM *, const SwTwips nOffset, bool bSetInReadOnly) const
SwContentFrame * GetNextContentFrame() 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
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
virtual bool GetCharRect(SwRect &, const SwPosition &, SwCursorMoveState *=nullptr, bool bAllowFarAway=true) const
Marks a node in the document model.
SwNodeIndex & Assign(SwNodes const &rNds, SwNodeOffset)
const SwNodes & GetNodes() const
SwNodeOffset GetIndex() const
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 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 &)
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)