22 #include <com/sun/star/i18n/WordType.hpp>
23 #include <com/sun/star/i18n/XBreakIterator.hpp>
32 #include <bookmark.hxx>
39 #include <section.hxx>
52 #include <strings.hrc>
75 : pDSh(pSh), nActPos(nStt), bBack(
false), bNodeIdx(
false)
77 bBack = (nStt > nEnd);
85 explicit PercentHdl(
const SwPaM& rPam )
102 bBack = (nStt > nEnd );
129 :
SwPaM( rPos, pRing )
130 , m_nRowSpanOffset(0)
131 , m_nCursorBidiLevel(0)
132 , m_bColumnSelection(
false)
138 :
SwPaM( rCpy, pRing )
139 , m_nRowSpanOffset(rCpy.m_nRowSpanOffset)
140 , m_nCursorBidiLevel(rCpy.m_nCursorBidiLevel)
141 , m_bColumnSelection(rCpy.m_bColumnSelection)
259 sal_Int32 nContentPos =
m_vSavePos.back().nContent;
262 ? rNds.
GoNextSection( &rPtIdx, bSkipOverHiddenSections, bSkipOverProtectSections)
267 pCNd = bGoNxt ? rNds.
GoNextSection( &rPtIdx, bSkipOverHiddenSections, bSkipOverProtectSections)
271 bool bIsValidPos =
nullptr != pCNd;
272 const bool bValidNodesRange = bIsValidPos &&
274 if( !bValidNodesRange )
288 pCNd = rNds.
GoNext( &rPtIdx );
294 const sal_Int32 nTmpPos = bIsValidPos ? (bGoNxt ? 0 : pCNd->
Len()) : nContentPos;
296 if( !bIsValidPos || !bValidNodesRange ||
302 if(
HasMark() && bSkipOverProtectSections)
306 if( nEndIdx <= nSttIdx )
323 if( nSttIdx <= nIdx && nEndIdx >= nIdx )
370 if (pFrame !=
nullptr)
374 SwTextFrame const*
const pTextFrame(static_cast<SwTextFrame const*>(pFrame));
376 bGoNxt ? 0 : pTextFrame->
GetText().getLength()));
388 const sal_Int32 nTmpPos = bGoNxt ? 0 : pCNd->Len();
440 && !dynamic_cast<SwUnoCursor*>(
this) )
452 if ( pInputFieldTextAttrAtPoint != pInputFieldTextAttrAtMark )
458 const sal_Int32 nRefContentIdx =
462 const bool bIsForwardSelection =
467 if ( pInputFieldTextAttrAtPoint !=
nullptr )
469 const sal_Int32 nNewPointPos =
470 bIsForwardSelection ? *(pInputFieldTextAttrAtPoint->
End()) : pInputFieldTextAttrAtPoint->
GetStart();
475 if ( pInputFieldTextAttrAtMark !=
nullptr )
477 const sal_Int32 nNewMarkPos =
478 bIsForwardSelection ? pInputFieldTextAttrAtMark->
GetStart() : *(pInputFieldTextAttrAtMark->
End());
488 if( ( !pMrkNd && !pPtNd ) || pPtNd == pMrkNd )
513 nSttEndTable = rNds[ nSEIdx ]->StartOfSectionIndex() - 1;
526 if (
nullptr == pMyNd)
542 pMyNd = pOuterTableNd;
584 bool bInCoveredCell =
false;
586 OSL_ENSURE( pTmpSttNode,
"In table, therefore I expect to get a SwTableBoxStartNode" );
589 bInCoveredCell =
true;
592 if ( !bInCoveredCell )
727 !dynamic_cast<const SwUnoCursor*>(
this) )
737 if( !bCursorInReadOnly && pNd->
IsProtect() )
766 bool bInReadOnly,
bool& bCancel )
773 SwPaM *pTmpCursor = pCurrentCursor, *pSaveCursor = pCurrentCursor;
774 std::unique_ptr<SvxSearchItem> xSearchItem;
777 bool bIsUnoCursor =
dynamic_cast<SwUnoCursor*
>(pCurrentCursor) !=
nullptr;
778 std::unique_ptr<PercentHdl> pPHdl;
779 sal_uInt16 nCursorCnt = 0;
782 while( pCurrentCursor != ( pTmpCursor = pTmpCursor->
GetNext() ))
784 if( nCursorCnt && !bIsUnoCursor )
785 pPHdl.reset(
new PercentHdl( 0, nCursorCnt, rDoc.
GetDocShell() ));
788 pSaveCursor = pSaveCursor->
GetPrev();
797 *pSttPos = *pTmpCursor->
Start();
798 *pEndPos = *pTmpCursor->
End();
802 if( !nCursorCnt && !pPHdl && !bIsUnoCursor )
803 pPHdl.reset(
new PercentHdl( aRegion ));
806 while( *pSttPos <= *pEndPos )
808 nFndRet = rParas.
DoFind(*pCurrentCursor, fnMove, aRegion, bInReadOnly, xSearchItem);
856 *pEndPos = *pCurrentCursor->
Start();
859 *pSttPos = *pCurrentCursor->
End();
861 if( *pSttPos == *pEndPos )
865 if( !nCursorCnt && pPHdl )
867 pPHdl->NextPos( *aRegion.
GetMark() );
874 pTmpCursor = pTmpCursor->
GetNext();
875 if( nCursorCnt && pPHdl )
877 pPHdl->NextPos( ++pPHdl->nActPos );
880 }
while( pTmpCursor != pSaveCursor && pTmpCursor->
GetNext() != pTmpCursor);
882 if( nFound && !pFndRing )
883 pFndRing = pCurrentCursor->
Create();
890 SwPaM& rPam,
bool bFirst )
922 SwPaM& rPam,
bool bFirst )
968 std::unique_ptr<SvxSearchItem> xSearchItem;
979 pFndRing, aRegion, eFndRngs,
980 bInReadOnly, bCancel );
1013 aRegion, eFndRngs, bInReadOnly, bCancel );
1065 aRegion, eFndRngs, bInReadOnly, bCancel );
1097 nFound = rParas.
DoFind(*
this, fnMove, aRegion, bInReadOnly, xSearchItem) ? 1 : 0;
1098 if (0 != nFound && bMarkPos)
1109 bool bIsStart =
true;
1153 OUString
const* m_pText;
1155 sal_Int32 m_nPtIndex;
1160 sal_Int32 & m_rPtPos;
1163 SwTextNode *& rpTextNode, sal_Int32 & rPtPos,
1164 OUString
const*
const pFilteredNodeText =
nullptr)
1165 : m_pText(pFilteredNodeText)
1167 , m_rpTextNode(rpTextNode)
1173 m_pText = &m_pFrame->
GetText();
1174 m_nPtIndex = sal_Int32(m_pFrame->
MapModelToView(rpTextNode, rPtPos));
1180 m_pText = &rpTextNode->
GetText();
1182 m_nPtIndex = rPtPos;
1187 AssignBack(m_rpTextNode, m_rPtPos);
1189 void AssignBack(
SwTextNode *& rpTextNode, sal_Int32 & rPtPos)
1191 if (0 <= m_nPtIndex && m_pFrame)
1193 std::pair<SwTextNode*, sal_Int32>
const pos(
1195 rpTextNode =
pos.first;
1196 rPtPos =
pos.second;
1200 rPtPos = m_nPtIndex;
1209 return SelectWordWT( pViewShell, WordType::ANYWORD_IGNOREWHITESPACES, pPt );
1220 HideWrapper
w(pLayout, pTextNd, nPtPos);
1223 *w.m_pText, w.m_nPtIndex,
1238 HideWrapper
w(pLayout, pTextNd, nPtPos);
1241 *w.m_pText, w.m_nPtIndex,
1258 HideWrapper
w(pLayout, pTextNd, nPtPos);
1261 *w.m_pText, w.m_nPtIndex,
1266 bRet = aBoundary.startPos != aBoundary.endPos &&
1267 aBoundary.startPos <= w.m_nPtIndex &&
1268 w.m_nPtIndex <= aBoundary.endPos;
1269 w.m_nPtIndex = aBoundary.startPos;
1291 bRet = aOrigPos == *aCursor.
GetPoint();
1306 HideWrapper
w(pLayout, pTextNd, nPtPos);
1309 *w.m_pText, w.m_nPtIndex,
1315 if (nPtPos < pTextNd->
GetText().getLength() && nPtPos >= 0)
1335 HideWrapper
w(pLayout, pTextNd, nPtPos);
1338 *w.m_pText, w.m_nPtIndex,
1344 if (nPtPos <= pTextNd->
GetText().getLength() && nPtPos >= 0 &&
1365 HideWrapper
w(pLayout, pTextNd, nPtPos);
1368 *w.m_pText, w.m_nPtIndex,
1370 nWordType ).startPos;
1373 if (nPtPos <= pTextNd->
GetText().getLength() && nPtPos >= 0)
1393 HideWrapper
w(pLayout, pTextNd, nPtPos);
1395 const sal_Int32 nPtStart = w.m_nPtIndex;
1399 w.AssignBack(pTextNd, nPtPos);
1403 *w.m_pText, nPtStart,
1405 nWordType ).startPos;
1408 if (nPtPos < pTextNd->
GetText().getLength() && nPtPos >= 0)
1425 if( pPt &&
nullptr != pLayout )
1444 const SwPosition& rEnd = pMark->GetMarkEnd();
1446 assert(pMark->GetMarkEnd() != *
GetPoint());
1456 bool bForward =
true;
1459 HideWrapper
w(pViewShell->
GetLayout(), pTextNd, nPtPos);
1462 *
w.m_pText,
w.m_nPtIndex,
1471 w.AssignBack(pTextNd, nPtPos);
1474 *
w.m_pText,
w.m_nPtIndex,
1482 sal_Int32 nStartIndex;
1483 w.m_nPtIndex = aBndry.startPos;
1484 w.AssignBack(pStartNode, nStartIndex);
1487 sal_Int32 nEndIndex;
1488 w.m_nPtIndex = aBndry.endPos;
1489 w.AssignBack(pEndNode, nEndIndex);
1491 if( aBndry.startPos != aBndry.endPos )
1503 bool bStartMatch =
GetMark()->
nNode == pAnnotationMark->GetMarkStart().nNode &&
1505 bool bEndMatch =
GetPoint()->
nNode == pAnnotationMark->GetMarkEnd().nNode &&
1507 if (bStartMatch && bEndMatch)
1531 OUString sNodeText(pTextNd->
GetText());
1537 for ( ; nAct < rDoc.getIDocumentRedlineAccess().GetRedlineTable().size(); nAct++ )
1539 const SwRangeRedline* pRed = rDoc.getIDocumentRedlineAccess().GetRedlineTable()[ nAct ];
1543 if( RedlineType::Delete == pRed->
GetType() )
1545 sal_Int32 nStart, nEnd;
1548 while ( nStart < nEnd && nStart < sNodeText.getLength() )
1549 sNodeText = sNodeText.replaceAt( nStart++, 1, rtl::OUStringChar(
CH_TXTATR_INWORD) );
1570 HideWrapper
w(pLayout, pTextNd, nPtPos, &sNodeText);
1572 switch ( eMoveType )
1576 *w.m_pText, w.m_nPtIndex,
1581 *w.m_pText, w.m_nPtIndex,
1587 *w.m_pText, w.m_nPtIndex,
1589 if (w.m_nPtIndex >= 0 && w.m_nPtIndex < w.m_pText->getLength())
1595 while (w.m_nPtIndex < w.m_pText->getLength()
1596 && (*w.m_pText)[w.m_nPtIndex] ==
' ');
1602 *w.m_pText, w.m_nPtIndex,
1605 if (w.m_nPtIndex == 0)
1607 if (w.m_nPtIndex > 0)
1610 *w.m_pText, w.m_nPtIndex - 1,
1619 if (nPtPos <= pTextNd->
GetText().getLength() && nPtPos >= 0)
1633 if (!pStartNd || !pEndNd)
1647 HideWrapper
w(pLayout, pStartNd, nStartPos, &sStartText);
1650 *w.m_pText, w.m_nPtIndex,
1654 HideWrapper
w(pLayout, pEndNd, nEndPos, &sEndText);
1657 *w.m_pText, w.m_nPtIndex,
1663 if (nStartPos <= pStartNd->
GetText().getLength() && nStartPos >= 0)
1674 bool ,
bool ,
bool ,
1684 bool & io_rbLeft,
bool bVisualAllowed,
bool bInsertCursor)
1704 std::pair<Point, bool>
const tmp(aPt,
true);
1706 GetDoc().getIDocumentLayoutAccess().GetCurrentLayout(),
1711 bool bForward = ! io_rbLeft;
1713 static_cast<const SwTextFrame*>(pSttFrame)));
1716 bForward, bInsertCursor );
1719 io_rbLeft = ! bForward;
1728 const sal_Int32 nMoveOverPos = io_rbLeft ?
1729 ( nPos ? nPos - 1 : 0 ) :
1740 bool bVisualAllowed,
bool bSkipHidden,
bool bInsertCursor,
1741 SwRootFrame const*
const pLayout,
bool isFieldNames)
1795 if ( !
Move( fnMove, fnGo ) )
1812 SwTextFrame const* pNewFrame(static_cast<SwTextFrame const*>(
1813 GetPoint()->nNode.GetNode().GetContentNode()->getLayoutFrame(pLayout)));
1822 if (pFrame == pNewFrame || !pNewFrame)
1855 SwTextAttr const*
const pInputField(pNode->GetTextAttrAt(
1874 const bool bCellChanged = pOldTabSttNode && pNewTabSttNode &&
1875 pOldTabSttNode == pNewTabSttNode &&
1876 pOldTabBoxSttNode && pNewTabBoxSttNode &&
1877 pOldTabBoxSttNode != pNewTabBoxSttNode;
1883 if ( pTableBox && pTableBox->
getRowSpan() > 1 )
1886 pOldTabSttNode->GetTable(),
1899 if ( !
Move( fnMove, fnGo ) )
1910 if ( pTableBoxStartNode )
1913 if ( pTableBox && pTableBox->
getRowSpan() < 1 )
1940 if ( &rTmpNode != &rNode && rTmpNode.
IsTextNode() )
1943 std::pair<Point, bool>
const tmp(aPt,
true);
1945 GetDoc().getIDocumentLayoutAccess().GetCurrentLayout(),
1988 if ( nCurrLevel % 2 != nPrevLevel % 2 )
2002 bool bAdjustTableCursor =
false;
2011 bAdjustTableCursor =
true;
2018 std::pair<Point, bool>
const temp(aPt,
true);
2029 aPt = aTmpRect.
Pos();
2041 if ( bAdjustTableCursor && !bUp )
2048 OSL_ENSURE( pTableNd,
"pTableCursor without SwTableNode?" );
2055 std::pair<Point, bool>
const tmp(aPt,
true);
2061 (bUp ? pFrame->
UnitUp(
this, nUpDownX, bInReadOnly )
2062 : pFrame->
UnitDown(
this, nUpDownX, bInReadOnly ) ) &&
2065 std::pair<Point, bool>
const tmp(aPt,
true);
2078 std::pair<Point, bool>
const tmp(aPt,
true);
2086 aPt.setX(aTmpRect.
Center().getX());
2092 aPt.setY(aTmpRect.
Center().getY());
2102 sal_Int32 nOffset = 0;
2109 nOffset = pTextNd->
GetText().getLength();
2135 std::pair<Point, bool>
const tmp(aPt,
true);
2153 std::pair<Point, bool>
const tmp(aPt,
true);
2205 if ( pTableBox && pTableBox->
getRowSpan() > 1 )
2216 const SwNode* pTmpNode = bNext ?
2220 SwNodeIndex aCellIdx( *pTmpNode, bNext ? 1 : -1 );
2232 if ( pTableBox && pTableBox->
getRowSpan() < 1 )
2266 GetSttNd()->FindTableNode();
2282 if( pTableBox && pTableBox->
GetSttNd() &&
2299 bool bShortCut =
false;
2309 const sal_Int32 nSttEnd = &fnPosPara == &
fnMoveForward ? 0 : pContentNd->
Len();
2310 if (
GetPoint()->nContent.GetIndex() != nSttEnd )
2323 return (*fnWhichPara)( *
this, fnPosPara );
2328 return (*fnWhichPara)( *
this, fnPosPara ) &&
2338 return (*fnWhichSect)( *
this, fnPosSect ) &&
2350 "SwCursor::RestoreSavePos: invalid node: "
2351 "probably something was deleted; consider using SwUnoCursor instead");
2365 OSL_FAIL(
"SwCursor::RestoreSavePos: invalid content index");
2390 size_t nO = rTmp.
size();
2397 size_t nM = nU + ( nO - nU ) / 2;
2398 if( rTmp[ nM ]->GetSttNd() == pSrch )
2403 else if( rTmp[ nM ]->GetSttIdx() < nIdx )
2437 SwPaM* pCur = pCurrentCursor;
2442 if( !pCur->
HasMark() || !pSttNd ||
2456 pPos->
nContent.
Assign( const_cast<SwContentNode*>(static_cast<const SwContentNode*>(pNd)), 0 );
2466 pPos->
nContent.
Assign(const_cast<SwContentNode*>(static_cast<const SwContentNode*>(pNd)), pNd ? static_cast<const SwContentNode*>(pNd)->Len() : 0);
2478 if( pDel == pCurrentCursor )
2483 }
while ( pCurrentCursor != pCur );
2487 pSttNd = aTmp[
nPos ]->GetSttNd();
2498 : pCurrentCursor->
Create( pCurrentCursor );
2509 pPos->
nContent.
Assign(static_cast<SwContentNode*>(pNd), pNd ? static_cast<SwContentNode*>(pNd)->Len() : 0);
2512 return pCurrentCursor;
2533 if( pStart && pEnd )
2551 size_t nOld = 0, nNew = 0;
2556 if( pPOld == pPNew )
2578 for ( ; nNew < rNew.
size(); ++nNew )
2621 if (
m_SelectedBoxes[--
n]->GetFrameFormat()->GetProtect().IsContentProtected())
bool SttEndDoc(bool bSttDoc)
vcl::RenderContext * GetOut() const
bool GoSentence(SentenceMoveType eMoveType, SwRootFrame const *pLayout=nullptr)
SwSectionNode * FindSectionNode()
Search section node, in which it is.
const SwEndNode * EndOfSectionNode() const
Starts a section of nodes in the document model.
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
bool MovePara(SwWhichPara, SwMoveFnCollection const &)
bool IsCursorMoved() const
void merge(RingContainer< value_type > aDestRing)
Merges two ring containers.
Represents the visualization of a paragraph.
virtual sal_Int32 Len() const
static bool lcl_SeekEntry(const SwSelBoxes &rTmp, SwStartNode const *const pSrch, size_t &o_rFndPos)
virtual int DoFind(SwPaM &, SwMoveFnCollection const &, const SwPaM &, bool, std::unique_ptr< SvxSearchItem > &xSearchItem)=0
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...
SAL_DLLPRIVATE void UpdateCursor(sal_uInt16 eFlags=SwCursorShell::SCROLLWIN|SwCursorShell::CHKRANGE, bool bIdleEnd=false)
void InsertBox(const SwTableBox &rTableBox)
SwNode & GetNode(bool bPoint=true) const
bool GoInContent(SwPaM &rPam, SwMoveFnCollection const &fnMove)
SwTableCursor(const SwPosition &rPos)
bool IsStartEndSentence(bool bEnd, SwRootFrame const *pLayout) const
SwNodeOffset EndOfSectionIndex() const
virtual ::sw::mark::IFieldmark * getFieldmarkAt(const SwPosition &rPos) const =0
get Fieldmark for CH_TXT_ATR_FIELDSTART/CH_TXT_ATR_FIELDEND at rPos
Marks a position in the document model.
bool IsInProtectTable(bool bMove=false, bool bChgCursor=true)
bool IsSectionNode() const
SwContentFrame * GetNextContentFrame() const
bool IsMultiSelection() const
void FillFindPos(SwDocPositions ePos, SwPosition &rPos) const
const SwTableBox * GetTableBox(const OUString &rName, const bool bPerformValidCheck=false) const
SwTableBox * GetTableBox() const
If node is in a table return the respective table box.
bool GoEndWordWT(sal_Int16 nWordType, SwRootFrame const *pLayout=nullptr)
bool GoPrevCell(sal_uInt16 nCnt=1)
const OUString & GetText() const
virtual const SwRootFrame * GetCurrentLayout() const =0
bool MoveSection(SwWhichSection, SwMoveFnCollection const &)
SwDocShell * GetDocShell()
bool GoCurrPara(SwPaM &rPam, SwMoveFnCollection const &aPosPara)
virtual short MaxReplaceArived()
bool IsAtLeftRightMargin(SwRootFrame const &rLayout, bool bLeftMargin, bool bAPI) const
void Left(const tools::Long nLeft)
bool IsInFootnote() const
static SW_DLLPUBLIC MarkType GetType(const ::sw::mark::IMark &rMark)
Returns the MarkType used to create the mark.
const SwPosition * GetMark() const
Find "all" in Footer/Header/Fly...
bool IsEndWordWT(sal_Int16 nWordType, SwRootFrame const *pLayout=nullptr) const
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Provides access to the marks of a document.
virtual bool IsSelOvr(SwCursorSelOverFlags eFlags=SwCursorSelOverFlags::CheckNodeSection|SwCursorSelOverFlags::Toggle|SwCursorSelOverFlags::ChangePos)
static SwContentNode * GoPrevSection(SwNodeIndex *, bool bSkipHidden=true, bool bSkipProtect=true)
void CalcStartEnd(SwNodeOffset nNdIdx, sal_Int32 &rStart, sal_Int32 &rEnd) const
Calculates the intersection with text node number nNdIdx.
helper class to disable creation of an action by a callback event in particular, change event from a ...
bool m_bSetInReadOnly
ReadOnly areas may be entered.
virtual SwCursor * Create(SwPaM *pRing=nullptr) 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...
SwPosition FindFieldSep(IFieldmark const &rMark)
return position of the CH_TXT_ATR_FIELDSEP for rMark
virtual bool LeftRight(bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode, bool bAllowVisual, bool bSkipHidden, bool bInsertCursor, SwRootFrame const *pLayout, bool isFieldNames)
sal_uInt8 GetCursorBidiLevel() const
static SwContentNode * GoPrevious(SwNodeIndex *)
SwCursor * MakeBoxSels(SwCursor *pCurrentCursor)
Content, content of frame (header, footer, fly).
void EndProgress(SwDocShell const *pDocShell)
void Pos(const Point &rNew)
IDocumentMarkAccess * getIDocumentMarkAccess()
IDocumentUndoRedo & GetIDocumentUndoRedo()
SwNode & GetEndOfPostIts() const
A still empty section.
virtual void Calc(vcl::RenderContext *pRenderContext) const
Of course Writer needs its own rectangles.
virtual ~SwCursor() override
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
SwTextAttr * GetTextAttrAt(sal_Int32 const nIndex, sal_uInt16 const nWhich, enum GetTextAttrMode const eMode=DEFAULT) const
get the innermost text attribute covering position nIndex.
bool IsCTLFontEnabled() const
void StartProgress(TranslateId pMessResId, tools::Long nStartValue, tools::Long nEndValue, SwDocShell *pDocShell)
virtual bool LeftMargin(SwPaM *) const =0
The root element of a Writer document layout.
bool IsReadOnlyUI() const
sal_uInt8 DirType(const TextFrameIndex nPos) const
SwNodeOffset m_nTableMkNd
bool isFrameAreaDefinitionValid() const
SwNodeOffset GetSttIdx() const
bool SelectWord(SwViewShell const *pViewShell, const Point *pPt)
static bool IsShowChanges(const RedlineFlags eM)
virtual bool IsSkipOverHiddenSections() const
sal_Int32 getRowSpan() const
const SwSection & GetSection() const
SwContentNode * GetContentNode(bool bPoint=true) const
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const
bool isLetterNumeric(const OUString &rStr, sal_Int32 nPos) const
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
Primary passes the call to the first page.
virtual bool IsSelOvrCheck(SwCursorSelOverFlags eFlags)
SwTableNode * GetTableNode()
const SwRect & getFrameArea() const
auto(*)(SwPaM &rPam, SwMoveFnCollection const &fnMove) -> bool SwGoInDoc
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
virtual ::sw::mark::IFieldmark * getFieldmarkFor(const SwPosition &pos) const =0
static OUString lcl_MaskDeletedRedlines(const SwTextNode *pTextNd)
bool GoPrevWordWT(sal_Int16 nWordType, SwRootFrame const *pLayout=nullptr)
static sal_uLong lcl_FindSelection(SwFindParas &rParas, SwCursor *pCurrentCursor, SwMoveFnCollection const &fnMove, SwCursor *&pFndRing, SwPaM &aRegion, FindRanges eFndRngs, bool bInReadOnly, bool &bCancel)
virtual void DelAllUndoObj()=0
Delete all Undo actions.
virtual bool GotoTable(const OUString &rName) override
sal_Int32 GetStart() const
virtual bool UnitUp(SwPaM *, const SwTwips nOffset, bool bSetInReadOnly) const
virtual void DoUndo(bool const bDoUndo)=0
Enable/Disable Undo.
bool IsCursorMovedUpdate()
virtual void DoSetBidiLevelUpDown()
std::vector< SwCursor_SavePos > m_vSavePos
CursorMovement GetCTLCursorMovement() const
bool CheckNodesRange(const SwNodeIndex &rStt, const SwNodeIndex &rEnd, bool bChkSection)
Check if the given range is inside one of the defined top-level sections.
const SwTable & GetTable() const
bool SelectWordWT(SwViewShell const *pViewShell, sal_Int16 nWordType, const Point *pPt)
bool IsProtectFlag() const
SwNodeOffset GetIndex() const
SwContentFrame * GetPrevContentFrame() const
SwMoveFnCollection const & MakeFindRange(SwDocPositions, SwDocPositions, SwPaM *) const
set range for search in document
virtual bool UnitDown(SwPaM *, const SwTwips nOffset, bool bSetInReadOnly) const
virtual bool DoesUndo() const =0
Is Undo enabled?
const SwCursor_SavePos * GetSavePos() const
virtual bool GotoTable(const OUString &rName)
virtual bool GetCharRect(SwRect &, const SwPosition &, SwCursorMoveState *=nullptr, bool bAllowFarAway=true) const
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
bool GoNextCell(sal_uInt16 nCnt=1)
bool IsShowOutlineContentVisibilityButton() const
SwTableSortBoxes & GetTabSortBoxes()
bool IsContentNode() const
PaM is Point and Mark: a selection of the document model.
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
static SwTable * FindTable(SwFrameFormat const *const pFormat)
virtual bool IsReplaceMode() const =0
SwNodeIndex & Assign(SwNodes const &rNds, SwNodeOffset)
A helper class to save cursor state (position).
TextFrameIndex MapModelToViewPos(SwPosition const &rPos) const
sal_uLong FindAll(SwFindParas &, SwDocPositions, SwDocPositions, FindRanges, bool &bCancel)
bool(* SwWhichPara)(SwPaM &, SwMoveFnCollection const &)
bool GoInNode(SwPaM &rPam, SwMoveFnCollection const &fnMove)
const SwStartNode * StartOfSectionNode() const
const SwPosition * GetPoint() const
std::vector< SwSectionFormat * >::size_type size_type
bool GoInContentCells(SwPaM &rPam, SwMoveFnCollection const &fnMove)
SwIndex & Assign(SwIndexReg *, sal_Int32)
SwEditShell const * GetEditShell() const
sw::FieldmarkMode GetFieldmarkMode() const
bool GoNextWordWT(sal_Int16 nWordType, SwRootFrame const *pLayout=nullptr)
bool IsInWordWT(sal_Int16 nWordType, SwRootFrame const *pLayout=nullptr) const
bool GoInContentCellsSkipHidden(SwPaM &rPam, SwMoveFnCollection const &fnMove)
tools::Long m_nRowSpanOffset
bool IsHiddenFlag() const
SwContentNode * GetContentNode()
SwNodeOffset GetIndex() const
vector_type::size_type size_type
void MakeStartIndex(SwIndex *pIdx)
void ExpandToSentenceBorders(SwRootFrame const *pLayout)
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
All (only in non-body and selections).
Marks a character position inside a document model node.
#define CH_TXT_ATR_FIELDSTART
bool IsNoContent() const
determine if point is outside of the node-array's content area
bool IsContentProtected() const
Marks a node in the document model.
SwFrameFormat * GetFrameFormat()
bool UpDown(bool bUp, sal_uInt16 nCnt, Point const *pPt, tools::Long nUpDownX, SwRootFrame &rLayout)
SwNodes & GetNodes()
Node is in which nodes-array/doc?
bool GoInDoc(SwPaM &rPam, SwMoveFnCollection const &fnMove)
ring_container GetRingContainer()
const sal_uInt16 coSrchRplcThreshold
virtual bool RightMargin(SwPaM *, bool bAPI=false) const =0
static bool lcl_MakeSelBkwrd(const SwNode &rSttNd, const SwNode &rEndNd, SwPaM &rPam, bool bFirst)
bool IsProtect() const
Is node in something that is protected (range, frame, table cells ...
std::pair< SwTextNode *, sal_Int32 > MapViewToModel(TextFrameIndex nIndex) const
map position in potentially merged text frame to SwPosition
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
SwTable is one table in the document model, containing rows (which contain cells).
const SwPosition * Start() const
virtual bool IsSkipOverProtectSections() const
virtual const SwContentFrame * DoSetBidiLevelLeftRight(bool &io_rbLeft, bool bVisualAllowed, bool bInsertCursor)
EXPAND : (Start < nIndex <= End)
Find only in body - only in combination with FindRanges::InSelAll !!!
const SwNodeIndex * GetContentIdx() const
const_iterator begin() const
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() const
bool GoInContentSkipHidden(SwPaM &rPam, SwMoveFnCollection const &fnMove)
virtual bool IsReadOnlyAvailable() const
const sal_uInt16 CRSR_SKIP_CELLS
const css::lang::Locale & GetLocale(const LanguageType aLang)
SwTextNode is a paragraph in the document model.
bool LeftRightMargin(SwRootFrame const &rLayout, bool bLeftMargin, bool bAPI)
SwSelBoxes m_SelectedBoxes
virtual sw::mark::IMark * getAnnotationMarkFor(const SwPosition &rPosition) const =0
bool GotoTableBox(const OUString &rName)
const SwFlowFrame * GetPrecede() const
const SwStartNode * GetSttNd() const
SwTableBox & FindStartOfRowSpan(const SwTable &, sal_uInt16 nMaxStep=USHRT_MAX)
SwTableBox::FindStartOfRowSpan(..) returns the "master" cell, the cell which overlaps the given cell...
SwNodeOffset m_nTablePtNd
const SwNodes & GetNodes() const
const SwViewOption * GetViewOptions() const
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
TextFrameIndex MapModelToView(SwTextNode const *pNode, sal_Int32 nIndex) const
sal_Int32 GetIndex() const
void SetProgressState(tools::Long nPosition, SwDocShell const *pDocShell)
bool IsNoTextFrame() const
const SwPosition * End() const
void SetCursorBidiLevel(sal_uInt8 nNewLevel)
virtual bool LeftRight(bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode, bool bAllowVisual, bool bSkipHidden, bool bInsertCursor, SwRootFrame const *, bool) override
bool IsRightToLeft() const
void Top(const tools::Long nTop)
LanguageType GetLang(const sal_Int32 nBegin, const sal_Int32 nLen=0, sal_uInt16 nScript=0) const
SwCursor(SwCursor const &rPaM)=delete
SwTableBox & FindEndOfRowSpan(const SwTable &, sal_uInt16 nMaxStep)
SwTableBox::FindEndOfRowSpan(..) returns the last overlapped cell if there is any.
bool GoNextPara(SwPaM &rPam, SwMoveFnCollection const &aPosPara)
bool GoPrevNextCell(bool bNext, sal_uInt16 nCnt)
RedlineType GetType(sal_uInt16 nPos=0) const
const sal_Int32 * End() const
SwTableBox is one table cell in the document model.
virtual ~SwTableCursor() override
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
double getLength(const B2DPolygon &rCandidate)
bool IsAnFollow(const SwFlowFrame *pFlow) const
constexpr TypedWhichId< SwFormatField > RES_TXTATR_INPUTFIELD(55)
void PrepareVisualMove(TextFrameIndex &nPos, sal_uInt8 &nCursorLevel, bool &bRight, bool bInsertCursor)
Prepares the cursor position for a visual cursor move (BiDi).
#define CH_TXT_ATR_FIELDEND
void ParkCursor()
park table cursor on the boxes' start node
const SwStartNode * FindTableBoxStartNode() const
SwMoveFnCollection const & fnMoveBackward
SwTableNode * FindTableNode()
Search table node, in which it is.
Find "one" only in body text.
virtual bool IsAtValidPos(bool bPoint=true) const
Return if cursor can be set to this position.
virtual bool IsSelOvrCheck(SwCursorSelOverFlags eFlags) override
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!!!).
void ActualizeSelection(const SwSelBoxes &rBoxes)
bool HasMergedParas() const
static bool lcl_MakeSelFwrd(const SwNode &rSttNd, const SwNode &rEndNd, SwPaM &rPam, bool bFirst)
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
SectionType GetType() const
void DeleteBox(size_t nPos)
std::pair< const_iterator, bool > insert(Value &&x)
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
SwRootFrame * GetLayout() const
SwViewShell * GetCurrShell() const
SwSectionFormats & GetSections()
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...
CharClass & GetAppCharClass()
bool HasReadOnlyBoxSel() const
void Height(tools::Long nNew)
SwPosition MapViewToModelPos(TextFrameIndex nIndex) const
virtual void SaveTableBoxContent(const SwPosition *pPos)
SwContentNode * GoNext(SwNodeIndex *) const
void MakeEndIndex(SwIndex *pIdx)
bool(* SwWhichSection)(SwPaM &, SwMoveFnCollection const &)
bool IsStartWordWT(sal_Int16 nWordType, SwRootFrame const *pLayout=nullptr) const
bool GoStartWordWT(sal_Int16 nWordType, SwRootFrame const *pLayout=nullptr)
void RestoreSavePos()
Restore cursor state to the one saved by SwCursorSaveState.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
size_type erase(const Value &x)
bool m_bDetectedRangeSegmentation false
Base class of the Writer document model elements.