21 #include <com/sun/star/text/XTextRange.hpp>
31 #include <viewimp.hxx>
46 #include <section.hxx>
59 #include <strings.hrc>
61 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
75 #include <boost/property_tree/json_parser.hpp>
90 SwPaM *pTmpDel =
nullptr,
91 *pTmp = pCurrentCursor->
GetNext();
94 while( pTmp != pCurrentCursor )
97 *pTmpEnd = pTmp->GetPoint() == pTmpStt ?
98 pTmp->GetMark() : pTmp->GetPoint();
99 if( *pStt <= *pTmpStt )
101 if( *pEnd > *pTmpStt ||
102 ( *pEnd == *pTmpStt && *pEnd == *pTmpEnd ))
106 if( *pStt < *pTmpEnd )
140 m_pCurrentCursor->DeleteMark();
157 if(!m_pCurrentCursor->IsMultiSelection())
161 SwCursor* pNextCursor =
static_cast<SwCursor*
>(m_pCurrentCursor->GetNext());
162 delete m_pCurrentCursor;
163 m_pCurrentCursor =
dynamic_cast<SwShellCursor*
>(pNextCursor);
176 (
void) CreateCursor();
198 if( bMakeTableCursor && m_pTableCursor->IsCursorMovedUpdate() )
201 if( m_pTableCursor->GetPoint()->nNode.GetIndex() &&
202 m_pTableCursor->GetMark()->nNode.GetIndex() )
211 GetLayout()->MakeTableCursors( *pTC );
217 if( m_pTableCursor->IsChgd() )
220 dynamic_cast<SwShellCursor*>(m_pTableCursor->MakeBoxSels( m_pCurrentCursor ));
223 return m_pCurrentCursor;
231 const SwNode& rNd = m_pCurrentCursor->GetPoint()->nNode.GetNode();
233 m_nCurrentContent = m_pCurrentCursor->GetPoint()->nContent.GetIndex();
246 bool bVis = m_bSVCursorVis;
249 if( bIdleEnd && Imp()->GetRegion() )
251 m_pCurrentCursor->Hide();
255 if( 1 == mnStartAction )
256 GetDoc()->UpdateNumRule();
260 bool bSavSVCursorVis = m_bSVCursorVis;
261 m_bSVCursorVis =
false;
265 m_bSVCursorVis = bSavSVCursorVis;
270 m_pVisibleCursor->Show();
279 UpdateCursor( eFlags, bIdleEnd );
288 if( !m_nCursorMove ||
289 ( 1 == m_nCursorMove && m_bInCMvVisportChgd ) )
291 ShowCursors( m_bSVCursorVis );
294 if( m_bCallChgLnk && m_bChgCallFlag && m_aChgLnk.IsSet() )
296 m_aChgLnk.Call(
nullptr);
297 m_bChgCallFlag =
false;
304 OSL_ENSURE( m_nCursorMove <
USHRT_MAX,
"Too many nested CursorMoves." );
313 OSL_ENSURE( m_nCursorMove,
"EndCursorMove() without SttCursorMove()." );
319 m_bInCMvVisportChgd =
false;
324 bool bVisualAllowed )
327 return bLeft ? GoPrevCell() : GoNextCell();
336 m_pBlockCursor->clearPoints();
343 SetInFrontOfLabel(
false );
358 SetInFrontOfLabel(
true );
364 const bool bSkipHidden = !GetViewOptions()->IsShowHiddenChar();
368 const bool bResetOfInFrontOfLabel = SetInFrontOfLabel(
false );
369 bRet = pShellCursor->
LeftRight( bLeft, nCnt, nMode, bVisualAllowed,
370 bSkipHidden, !IsOverwriteCursor(),
372 GetViewOptions()->IsFieldName());
373 if ( !bRet && bLeft && bResetOfInFrontOfLabel )
376 SetInFrontOfLabel(
true );
389 const int nListLevel )
391 if (sListId == m_sMarkedListId && nListLevel == m_nMarkedListLevel)
394 if ( !m_sMarkedListId.isEmpty() )
395 mxDoc->MarkListLevel( m_sMarkedListId, m_nMarkedListLevel,
false );
397 if ( !sListId.isEmpty() )
399 mxDoc->MarkListLevel( sListId, nListLevel,
true );
402 m_sMarkedListId = sListId;
403 m_nMarkedListLevel = nListLevel;
409 GetCursor_()->GetPoint()->nNode);
416 m_pCurrentCursor->SetInFrontOfLabel_(
false );
417 MarkListLevel( OUString(), 0 );
419 else if ( m_pCurrentCursor->IsInFrontOfLabel() )
431 MarkListLevel( OUString(), 0 );
437 #ifdef ACCESSIBLE_LAYOUT
438 if( Imp()->IsAccessible() )
439 Imp()->FirePageChangeEvent( nOldPage, nNewPage );
448 #ifdef ACCESSIBLE_LAYOUT
449 if( Imp()->IsAccessible() )
450 Imp()->FireColumnChangeEvent( nOldColumn, nNewColumn);
459 #ifdef ACCESSIBLE_LAYOUT
460 if( Imp()->IsAccessible() )
461 Imp()->FireSectionChangeEvent( nOldSection, nNewSection );
470 SwFrame* pCurrFrame = GetCurrFrame(
false);
472 if (pCurrFrame ==
nullptr)
479 while(pCurrCol==
nullptr && pCurrFrame!=
nullptr )
484 pCurrCol=
static_cast<SwFrame*
>(pParent)->FindColFrame();
485 pCurrFrame = pParent;
493 if(m_oldColFrame == pCurrCol)
497 m_oldColFrame = pCurrCol;
507 bool bTableMode = IsTableMode();
510 bool bRet = pTmpCursor->
UpDown( bUp, nCnt );
512 bRet |= SetInFrontOfLabel(
false);
515 m_pBlockCursor->clearPoints();
524 eUpdateMode =
static_cast<CursorFlag>(eUpdateMode
526 UpdateCursor( static_cast<sal_uInt16>(eUpdateMode) );
538 const bool bTableMode = IsTableMode();
542 m_pBlockCursor->clearPoints();
544 const bool bWasAtLM = GetCursor_()->IsAtLeftRightMargin(*GetLayout(),
true, bAPI);
548 if ( bLeft && !bTableMode && bRet && bWasAtLM && !GetCursor_()->HasMark() )
553 SetInFrontOfLabel(
true );
557 bRet = SetInFrontOfLabel(
false ) || bRet;
577 SwShellCursor* pTmpCursor = m_pBlockCursor ? &m_pBlockCursor->getShellCursor() : m_pCurrentCursor;
578 bool bRet = pTmpCursor->
SttEndDoc( bStt );
585 m_pBlockCursor->clearPoints();
586 RefreshBlockCursor();
596 SwNodes& rNodes = GetDoc()->GetNodes();
597 SwPosition* pPos = m_pCurrentCursor->GetPoint();
600 pPos = m_pCurrentCursor->GetMark();
608 SwNodes& rNodes = GetDoc()->GetNodes();
622 return aStart == *pShellCursor->Start() && aEnd == *pShellCursor->End();
627 SwNodes& rNodes = GetDoc()->GetNodes();
638 if( !m_pCurrentCursor->HasMark() || !m_pCurrentCursor->IsNoContent() )
644 Point& rPt = m_pCurrentCursor->GetPtPos();
645 std::pair<Point, bool> tmp(rPt,
false);
647 getLayoutFrame(GetLayout(), m_pCurrentCursor->GetPoint(), &tmp);
648 if( pFrame &&
GetFrameInPage( pFrame, fnWhichPage, fnPosPage, m_pCurrentCursor ) &&
662 std::pair<Point, bool> tmp(pShellCursor->
GetPtPos(),
false);
666 return !pFrame || (pFrame->IsTextFrame() &&
static_cast<SwTextFrame*
>(pFrame)->IsHiddenNow());
675 std::pair<Point, bool> tmp(pShellCursor->
GetPtPos(),
false);
678 if (!pFrame || !pFrame->IsTextFrame())
682 SwTextFrame const& rTextFrame(static_cast<SwTextFrame const&>(*pFrame));
699 bool bRet = pTmpCursor->
MovePara( fnWhichPara, fnPosPara );
707 while (isInHiddenTextFrame(pTmpCursor)
710 if (!pTmpCursor->
MovePara(fnWhichPara, fnPosPara))
723 SwCursor* pTmpCursor = getShellCursor(
true );
724 bool bRet = pTmpCursor->
MoveSection( fnWhichSect, fnPosSect );
739 std::pair<Point, bool> tmp(rPt,
false);
743 pFrame = pContentFrame ? pContentFrame->
GetUpper() :
nullptr;
755 if( pFrame && pbInHeader )
757 return nullptr != pFrame;
774 if ( pTextNd && !IsTableMode() &&
787 ( GetLayout()->GetModelPositionForViewPoint( &aPos, aPt, &aTmpState )
790 const bool bOldInFrontOfLabel = IsInFrontOfLabel();
799 if( IsTableMode() && !pFrame && aPos.nNode.GetNode().StartOfSectionNode() ==
804 if( m_pBlockCursor && bBlock )
806 m_pBlockCursor->setEndPoint( rLPt );
808 m_pBlockCursor->setStartPoint( rLPt );
809 else if( !m_pBlockCursor->getStartPoint() )
810 m_pBlockCursor->setStartPoint( pCursor->
GetMkPos() );
816 bOldInFrontOfLabel == bNewInFrontOfLabel )
823 else if( aPos.nNode.GetNode().IsContentNode() )
826 std::pair<Point, bool> tmp(m_aCharRect.Pos(),
false);
828 GetLayout(),
nullptr, &tmp);
831 GetLayout(),
nullptr, &tmp);
853 rCurrentCursorPt = aPt;
857 if ( bNewInFrontOfLabel || bOldInFrontOfLabel )
858 m_pCurrentCursor->SetInFrontOfLabel_( !bNewInFrontOfLabel );
859 SetInFrontOfLabel( bNewInFrontOfLabel );
866 else if( bOnlyText && !m_pCurrentCursor->HasMark() )
868 if( FindValidContentNode( bOnlyText ) )
882 m_pVisibleCursor->Hide();
884 m_bAllProtect =
true;
885 if( GetDoc()->GetDocShell() )
887 GetDoc()->GetDocShell()->SetReadOnlyUI();
898 delete m_pTableCursor;
899 m_pTableCursor =
nullptr;
905 if( m_pBlockCursor && !HasSelection() )
907 SwPaM& rPam = m_pBlockCursor->getShellCursor();
909 *m_pCurrentCursor->GetPoint() = *rPam.
GetPoint();
911 *m_pCurrentCursor->GetMark() = *rPam.
GetMark();
913 m_pCurrentCursor->DeleteMark();
915 delete m_pBlockCursor;
916 m_pBlockCursor =
nullptr;
921 if( !m_pBlockCursor )
923 SwPosition aPos( *m_pCurrentCursor->GetPoint() );
926 rBlock.
GetPtPos() = m_pCurrentCursor->GetPtPos();
927 if( m_pCurrentCursor->HasMark() )
930 *rBlock.
GetMark() = *m_pCurrentCursor->GetMark();
931 rBlock.
GetMkPos() = m_pCurrentCursor->GetMkPos();
934 m_pBlockCursor->clearPoints();
935 RefreshBlockCursor();
943 std::vector<SwPaM*> vCursors;
944 for(
auto& rCursor : m_pCurrentCursor->GetRingContainer())
945 if(&rCursor != m_pCurrentCursor)
946 vCursors.push_back(&rCursor);
947 for(
auto pCursor : vCursors)
949 m_pTableCursor->DeleteMark();
951 m_pCurrentCursor->DeleteMark();
953 *m_pCurrentCursor->GetPoint() = *m_pTableCursor->GetPoint();
954 m_pCurrentCursor->GetPtPos() = m_pTableCursor->GetPtPos();
955 delete m_pTableCursor;
956 m_pTableCursor =
nullptr;
957 m_pCurrentCursor->SwSelPaintRects::Show();
961 if( !m_pCurrentCursor->HasMark() )
963 m_pCurrentCursor->DeleteMark();
965 m_pCurrentCursor->SwSelPaintRects::Show();
972 m_pCurrentCursor->Normalize(bPointFirst);
978 m_pCurrentCursor->Exchange();
998 return m_pTableCursor->IsInside( rPt );
1002 SwPosition aPtPos( *m_pCurrentCursor->GetPoint() );
1007 if ( !GetLayout()->GetModelPositionForViewPoint( &aPtPos, aPt, &aTmpState ) && bTstHit )
1014 if (pCmp->
HasMark() && *pCmp->
Start() <= aPtPos && *pCmp->
End() > aPtPos)
1017 }
while (m_pCurrentCursor != pCmp);
1024 if( !m_pTableCursor && !m_pBlockCursor && !m_pCurrentCursor->IsMultiSelection() )
1027 while( m_pCurrentCursor->GetNext() != m_pCurrentCursor )
1028 delete m_pCurrentCursor->GetNext();
1029 m_pCurrentCursor->SetColumnSelection(
false );
1031 if( m_pTableCursor )
1034 m_pCurrentCursor->DeleteMark();
1035 *m_pCurrentCursor->GetPoint() = *m_pTableCursor->GetPoint();
1036 m_pCurrentCursor->GetPtPos() = m_pTableCursor->GetPtPos();
1037 delete m_pTableCursor;
1038 m_pTableCursor =
nullptr;
1040 else if( m_pBlockCursor )
1043 m_pCurrentCursor->DeleteMark();
1046 m_pCurrentCursor->GetPtPos() = rBlock.
GetPtPos();
1048 m_pBlockCursor->clearPoints();
1056 const SwPosition *pFirst =
nullptr, *pSecond =
nullptr;
1057 const SwPaM *pCur = GetCursor(), *pStack = m_pStackCursor;
1061 pFirst = pStack->GetMark();
1064 if( !pFirst || !pSecond )
1066 else if( *pFirst < *pSecond )
1068 else if( *pFirst == *pSecond )
1077 if (m_pCurrentCursor->IsMultiSelection())
1081 if (m_pCurrentCursor->GetPoint()->nNode == m_pCurrentCursor->GetMark()->nNode)
1085 if (GetLayout()->HasMergedParas())
1088 auto const n(m_pCurrentCursor->GetMark()->nNode.GetIndex());
1096 if (GetLayout()->HasMergedParas())
1098 SwTextNode const*
const pNode(m_pCurrentCursor->GetPoint()->nNode.GetNode().GetTextNode());
1101 SwTextFrame const*
const pFrame(static_cast<SwTextFrame*>(
1102 pNode->getLayoutFrame(GetLayout())));
1110 return m_pCurrentCursor->GetPoint()->nContent == 0;
1115 if (GetLayout()->HasMergedParas())
1117 SwTextNode const*
const pNode(m_pCurrentCursor->GetPoint()->nNode.GetNode().GetTextNode());
1120 SwTextFrame const*
const pFrame(static_cast<SwTextFrame*>(
1121 pNode->getLayoutFrame(GetLayout())));
1129 return m_pCurrentCursor->GetPoint()->nContent == m_pCurrentCursor->GetContentNode()->Len();
1134 if (IsTableMode() || IsBlockMode() || !IsEndPara())
1138 SwTableNode const*
const pTableNode( IsCursorInTable() );
1145 SAL_WARN_IF(!lastNode.GetNode().GetTextNode(),
"sw.core",
1146 "text node expected");
1147 return (lastNode == m_pCurrentCursor->GetPoint()->nNode);
1152 SwStartNodeType aStartNodeType = m_pCurrentCursor->GetNode().StartOfSectionNode()->GetStartNodeType();
1158 return m_pCurrentCursor->IsInFrontOfLabel();
1163 if ( bNew != IsInFrontOfLabel() )
1165 m_pCurrentCursor->SetInFrontOfLabel_( bNew );
1166 UpdateMarkedListLevel();
1174 void collectUIInformation(
const OUString& aPage)
1177 aDescription.
aAction =
"GOTO";
1179 aDescription.
aID =
"writer_edit";
1180 aDescription.
aKeyWord =
"SwEditWinUIObject";
1181 aDescription.
aParent =
"MainWindow";
1192 bool bRet = GetLayout()->SetCurrPage( m_pCurrentCursor, nPage ) &&
1198 collectUIInformation(OUString::number(nPage));
1209 bool bAtCursorPos,
const bool bCalcFrame )
1216 if( !bAtCursorPos ||
nullptr == (pCFrame = GetCurrFrame( bCalcFrame )) ||
1219 pPg = Imp()->GetFirstVisPage(GetOut());
1221 pPg = static_cast<const SwPageFrame *>(pPg->
GetNext());
1235 if (pCFrame ==
nullptr ||
nullptr == (pPg = pCFrame->
FindPageFrame()))
1237 pPg = Imp()->GetFirstVisPage(GetOut());
1239 pPg = static_cast<const SwPageFrame*>(pPg->
GetNext());
1242 sal_uInt16 nPageNo = 0;
1256 const SwPageFrame *pPg = Imp()->GetFirstVisPage(GetOut());
1271 pPg = static_cast<const SwPageFrame *>(pPg->
GetNext());
1283 pPg = static_cast<const SwPageFrame *>(pPg->
GetPrev());
1294 return GetLayout()->GetPageNum();
1301 OUStringBuffer
aBuf;
1304 aBuf.append(pFrame->getFrameArea().Left());
1306 aBuf.append(pFrame->getFrameArea().Top());
1308 aBuf.append(pFrame->getFrameArea().Width());
1310 aBuf.append(pFrame->getFrameArea().Height());
1313 if (!aBuf.isEmpty())
1314 aBuf.setLength( aBuf.getLength() - 2);
1315 return aBuf.makeStringAndClear();
1320 auto pView =
const_cast<SdrView*
>(GetDrawView());
1321 if (pView->GetTextEditObject())
1324 EditView& rEditView = pView->GetTextEditOutlinerView()->GetEditView();
1332 if (
OutlinerView* pOutlinerView = pView->GetTextEditOutlinerView())
1334 OString sRect = pOutlinerView->GetOutputArea().toString();
1341 m_pVisibleCursor->SetPosAndShow(pOtherShell);
1343 if (GetSfxViewShell() != pOtherShell)
1345 OString aPayload = OString::boolean(m_bSVCursorVis);
1349 m_pCurrentCursor->Show(pOtherShell);
1351 pView->AdjustMarkHdl(pOtherShell);
1358 if( !m_pCurrentCursor->IsMultiSelection() )
1363 m_pCurrentCursor = m_pCurrentCursor->GetNext();
1369 m_pCurrentCursor->Show(
nullptr);
1377 if( !m_pCurrentCursor->IsMultiSelection() )
1382 m_pCurrentCursor = m_pCurrentCursor->GetPrev();
1388 m_pCurrentCursor->Show(
nullptr);
1397 if( !m_pCurrentCursor->IsMultiSelection() )
1399 if( !m_pCurrentCursor->HasMark() )
1404 return bNext ? GoNextCursor() : GoPrevCursor();
1417 if( m_pVisibleCursor->IsVisible() && !aRect.
IsOver( m_aCharRect ) )
1420 m_pVisibleCursor->Hide();
1426 if( m_bHasFocus && !m_bBasicHideCursor )
1428 SwShellCursor* pCurrentCursor = m_pTableCursor ? m_pTableCursor : m_pCurrentCursor;
1434 pCurrentCursor->
Show(
nullptr);
1446 bVis = !pPostItMgr->HasActiveSidebarWin();
1449 if( m_bSVCursorVis && bVis )
1450 m_pVisibleCursor->Show();
1459 bVis = m_pVisibleCursor->IsVisible();
1461 m_pVisibleCursor->Hide();
1463 m_bVisPortChgd =
true;
1464 m_aOldRBPos.setX(VisArea().
Right());
1465 m_aOldRBPos.setY(VisArea().
Bottom());
1472 if( m_bSVCursorVis && bVis )
1473 m_pVisibleCursor->Show();
1476 m_bInCMvVisportChgd =
true;
1478 m_bVisPortChgd =
false;
1492 Size aOldSz( GetDocSize() );
1494 if( isInHiddenTextFrame(pShellCursor) )
1498 GetLayout()->GetModelPositionForViewPoint( pShellCursor->
GetPoint(), pShellCursor->
GetPtPos(),
1502 IGrammarContact *pGrammarContact = GetDoc() ? GetDoc()->getGrammarContact() :
nullptr;
1503 if( pGrammarContact )
1506 if( aOldSz != GetDocSize() )
1520 bOk = pFrameNd !=
nullptr;
1521 SAL_WARN_IF(!bOk,
"sw.core",
"found no Node with Frames");
1549 class SwNotifyAccAboutInvalidTextSelections
1555 explicit SwNotifyAccAboutInvalidTextSelections(
SwCursorShell& _rCursorSh )
1556 : mrCursorSh( _rCursorSh )
1559 ~SwNotifyAccAboutInvalidTextSelections() COVERITY_NOEXCEPT_FALSE
1575 m_bIgnoreReadonly =
true;
1579 SwNotifyAccAboutInvalidTextSelections aInvalidateTextSelections( *
this );
1581 if ( m_bIgnoreReadonly )
1583 m_bIgnoreReadonly =
false;
1591 CheckTableBoxContent();
1595 SwPaM* pTstCursor = getShellCursor(
true );
1596 if( pTstCursor->
HasMark() && !m_pBlockCursor &&
1612 if ( !GetViewOptions()->IsShowHiddenChar() )
1618 std::pair<Point, bool>
const tmp(aTmpPt,
false);
1619 SwContentFrame *pTableFrame = pPos->nNode.GetNode().GetContentNode()->
1620 getLayoutFrame( GetLayout(), pPos, &tmp);
1622 OSL_ENSURE( pTableFrame,
"Table Cursor not in Content ??" );
1634 if ( !bInRepeatedHeadline )
1636 std::pair<Point, bool>
const tmp1(aTmpMk,
false);
1638 getLayoutFrame(GetLayout(), pITmpCursor->
GetMark(), &tmp1);
1639 OSL_ENSURE( pMarkTableFrame,
"Table Cursor not in Content ??" );
1641 if ( pMarkTableFrame )
1644 OSL_ENSURE( pMarkTab,
"Table Cursor not in Content ??" );
1655 if ( bInRepeatedHeadline )
1657 pTableFrame =
nullptr;
1664 if( m_pTableCursor )
1666 m_pCurrentCursor->SetMark();
1667 *m_pCurrentCursor->GetMark() = *m_pTableCursor->GetMark();
1668 m_pCurrentCursor->GetMkPos() = m_pTableCursor->GetMkPos();
1669 m_pTableCursor->DeleteMark();
1670 m_pTableCursor->SwSelPaintRects::Hide();
1673 *m_pCurrentCursor->GetPoint() = *m_pCurrentCursor->GetMark();
1679 if( pTab && pTableFrame )
1681 if( !m_pTableCursor )
1684 *m_pCurrentCursor->GetMark(), m_pCurrentCursor->GetMkPos(),
1687 m_pCurrentCursor->SwSelPaintRects::Hide();
1689 CheckTableBoxContent();
1693 "this should not happen, but better lose the selection "
1694 "rather than crashing");
1703 if (!pTableFrame->
GetCharRect( m_aCharRect, *m_pTableCursor->GetPoint(), &aTmpState))
1705 Point aCentrPt( m_aCharRect.Center() );
1708 bool const bResult =
1709 pTableFrame->
GetCharRect(m_aCharRect, *m_pTableCursor->GetPoint());
1710 OSL_ENSURE( bResult,
"GetCharRect failed." );
1714 m_pVisibleCursor->Hide();
1718 !IsCursorReadonly()) )
1720 SwFrame* pBoxFrame = pTableFrame;
1726 MakeVisible( m_aCharRect );
1730 if( m_pTableCursor->IsCursorMovedUpdate() )
1731 GetLayout()->MakeTableCursors( *m_pTableCursor );
1732 if( m_bHasFocus && !m_bBasicHideCursor )
1733 m_pTableCursor->Show(
nullptr);
1736 m_pTableCursor->GetPtPos().setX(m_aCharRect.Left());
1737 m_pTableCursor->GetPtPos().setY(m_aCharRect.Top());
1739 if( m_bSVCursorVis )
1741 m_aCursorHeight.setX(0);
1743 -m_aCharRect.Width() : m_aCharRect.Height());
1744 m_pVisibleCursor->Show();
1747 if (Imp()->IsAccessible())
1748 Imp()->InvalidateAccessibleCursorPosition( pTableFrame );
1753 if( m_pTableCursor )
1756 while( m_pCurrentCursor->GetNext() != m_pCurrentCursor )
1757 delete m_pCurrentCursor->GetNext();
1758 m_pCurrentCursor->DeleteMark();
1759 *m_pCurrentCursor->GetPoint() = *m_pTableCursor->GetPoint();
1760 m_pCurrentCursor->GetPtPos() = m_pTableCursor->GetPtPos();
1761 delete m_pTableCursor;
1762 m_pTableCursor =
nullptr;
1765 m_pVisibleCursor->Hide();
1770 bool bChgState =
true;
1773 ( !IsReadOnlyAvailable() &&
1775 ( !mxDoc->GetDocShell() ||
1776 !mxDoc->GetDocShell()->IsReadOnly() || m_bAllProtect )) ) )
1778 if( !FindValidContentNode( !HasDrawView() ||
1779 0 == Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount()))
1782 if( m_bAllProtect && !IsReadOnlyAvailable() &&
1788 m_bAllProtect =
true;
1789 if( GetDoc()->GetDocShell() )
1791 GetDoc()->GetDocShell()->SetReadOnlyUI();
1800 bool bWasAllProtect = m_bAllProtect;
1801 m_bAllProtect =
false;
1802 if( bWasAllProtect && GetDoc()->GetDocShell() &&
1803 GetDoc()->GetDocShell()->IsReadOnlyUI() )
1805 GetDoc()->GetDocShell()->SetReadOnlyUI(
false );
1821 bool bPointIsStart = ( rCmp.Start() == rCmp.GetPoint() );
1824 if( ! rCmp.GetPoint()->nNode.GetNode().IsContentNode() )
1829 if( rCmp.HasMark() )
1831 if( ! rCmp.GetMark()->nNode.GetNode().IsContentNode() )
1841 SwRect aOld( m_aCharRect );
1851 std::pair<Point, bool>
const tmp1(pShellCursor->
GetPtPos(),
false);
1861 std::pair<Point, bool>
const tmp(pShellCursor->
GetPtPos(),
false);
1863 GetLayout(), pShellCursor->
GetPoint(), &tmp);
1866 else if ( Imp()->IsIdleAction() )
1871 if( !IsReadOnlyAvailable() && pFrame->IsProtected() &&
1872 ( !Imp()->GetDrawView() ||
1873 !Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() ) &&
1874 (!mxDoc->GetDocShell() ||
1875 !mxDoc->GetDocShell()->IsReadOnly() || m_bAllProtect ) )
1878 bool bChgState =
true;
1879 if( !FindValidContentNode(!HasDrawView() ||
1880 0 == Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount()))
1888 m_bAllProtect =
true;
1889 if( GetDoc()->GetDocShell() )
1891 GetDoc()->GetDocShell()->SetReadOnlyUI();
1900 bool bWasAllProtect = m_bAllProtect;
1901 m_bAllProtect =
false;
1902 if( bWasAllProtect && GetDoc()->GetDocShell() &&
1903 GetDoc()->GetDocShell()->IsReadOnlyUI() )
1905 GetDoc()->GetDocShell()->SetReadOnlyUI(
false );
1908 m_bAllProtect =
false;
1912 }
while( bAgainst );
1933 rPt = m_aCharRect.Center();
1939 if( !pShellCursor->
HasMark() )
1943 m_aCursorHeight.setX(0);
1945 -m_aCharRect.Width() : m_aCharRect.Height());
1948 if( !bFirst && aOld == m_aCharRect )
1956 OSL_ENSURE(
false,
"endless loop? CharRect != OldCharRect ");
1963 pShellCursor->
GetPtPos().setX(m_aCharRect.Left());
1964 pShellCursor->
GetPtPos().setY(m_aCharRect.Top());
1969 pFrame->
Calc(GetOut());
1978 !IsCursorReadonly() || GetViewOptions()->IsSelectionInReadonly()) )
1982 bool bSav = m_bSVCursorVis;
1983 m_bSVCursorVis =
false;
1985 m_bSVCursorVis = bSav;
1992 if( m_pBlockCursor )
1993 RefreshBlockCursor();
1998 if( !bIdleEnd && bCheckFocus && !m_bBasicHideCursor )
2000 if( m_pTableCursor )
2001 m_pTableCursor->SwSelPaintRects::Show();
2004 m_pCurrentCursor->SwSelPaintRects::Show();
2005 if( m_pBlockCursor )
2008 while( pNxt && pNxt != m_pCurrentCursor )
2010 pNxt->SwSelPaintRects::Show();
2019 if (Imp()->IsAccessible())
2020 Imp()->InvalidateAccessibleCursorPosition( pFrame );
2023 const sal_uInt64 nBlinkTime = GetOut()->GetSettings().GetStyleSettings().
2024 GetCursorBlinkTime();
2026 if ( (IsCursorReadonly() && GetViewOptions()->IsSelectionInReadonly()) ==
2027 ( nBlinkTime != STYLE_CURSOR_NOBLINKTIME ) )
2037 GetOut()->SetSettings( aSettings );
2040 if( m_bSVCursorVis )
2041 m_pVisibleCursor->Show();
2044 sendLOKCursorUpdates();
2046 getIDocumentMarkAccess()->NotifyCursorUpdate(*
this);
2051 SwWrtShell* pShell = GetDoc()->GetDocShell()->GetWrtShell();
2055 SwFrame* pCurrentFrame = GetCurrFrame();
2058 boost::property_tree::ptree aRootTree;
2064 boost::property_tree::ptree aTableColumns;
2069 const int nColumnOffset = aTabCols.
GetLeftMin() + rPageRect.
Left();
2071 aTableColumns.put(
"left", aTabCols.
GetLeft());
2072 aTableColumns.put(
"right", aTabCols.
GetRight());
2073 aTableColumns.put(
"tableOffset", nColumnOffset);
2075 boost::property_tree::ptree
aEntries;
2076 for (
size_t i = 0;
i < aTabCols.
Count(); ++
i)
2078 auto const & rEntry = aTabCols.
GetEntry(
i);
2079 boost::property_tree::ptree aTableColumnEntry;
2080 aTableColumnEntry.put(
"position", rEntry.nPos);
2081 aTableColumnEntry.put(
"min", rEntry.nMin);
2082 aTableColumnEntry.put(
"max", rEntry.nMax);
2083 aTableColumnEntry.put(
"hidden", rEntry.bHidden);
2084 aEntries.push_back(std::make_pair(
"", aTableColumnEntry));
2086 aTableColumns.push_back(std::make_pair(
"entries", aEntries));
2089 boost::property_tree::ptree aTableRows;
2094 const int nRowOffset = aTabRows.
GetLeftMin() + rPageRect.
Top();
2096 aTableRows.put(
"left", aTabRows.
GetLeft());
2097 aTableRows.put(
"right", aTabRows.
GetRight());
2098 aTableRows.put(
"tableOffset", nRowOffset);
2100 boost::property_tree::ptree
aEntries;
2101 for (
size_t i = 0;
i < aTabRows.
Count(); ++
i)
2103 auto const & rEntry = aTabRows.
GetEntry(
i);
2104 boost::property_tree::ptree aTableRowEntry;
2105 aTableRowEntry.put(
"position", rEntry.nPos);
2106 aTableRowEntry.put(
"min", rEntry.nMin);
2107 aTableRowEntry.put(
"max", rEntry.nMax);
2108 aTableRowEntry.put(
"hidden", rEntry.bHidden);
2109 aEntries.push_back(std::make_pair(
"", aTableRowEntry));
2111 aTableRows.push_back(std::make_pair(
"entries", aEntries));
2114 aRootTree.add_child(
"columns", aTableColumns);
2115 aRootTree.add_child(
"rows", aTableRows);
2118 std::stringstream aStream;
2119 boost::property_tree::write_json(aStream, aRootTree);
2120 GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_TABLE_SELECTED, aStream.str().c_str());
2128 std::pair<Point, bool>
const tmp(aPt,
false);
2130 GetLayout(), rBlock.
GetPoint(), &tmp);
2132 if( m_pBlockCursor->getEndPoint() && m_pBlockCursor->getStartPoint() )
2134 aPt = *m_pBlockCursor->getStartPoint();
2135 aMk = *m_pBlockCursor->getEndPoint();
2149 SwRect aRect( aMk, aPt );
2153 if( !GetLayout()->FillSelection( aSelList, aRect ) )
2157 while( pNxt != m_pCurrentCursor )
2160 pNxt =
static_cast<SwCursor*
>(m_pCurrentCursor->GetNext());
2163 std::list<SwPaM*>::iterator pStart = aSelList.
getStart();
2164 std::list<SwPaM*>::iterator pPam = aSelList.
getEnd();
2165 OSL_ENSURE( pPam != pStart,
"FillSelection should deliver at least one PaM" );
2166 m_pCurrentCursor->SetMark();
2170 if( pPam == pStart )
2172 *m_pCurrentCursor->GetPoint() = *(*pPam)->GetPoint();
2173 if( (*pPam)->HasMark() )
2174 *m_pCurrentCursor->GetMark() = *(*pPam)->GetMark();
2176 m_pCurrentCursor->DeleteMark();
2178 m_pCurrentCursor->SetColumnSelection(
false );
2188 *m_pCurrentCursor->GetPoint() = *(*pPam)->GetPoint();
2189 if( (*pPam)->HasMark() )
2190 *m_pCurrentCursor->GetMark() = *(*pPam)->GetMark();
2192 m_pCurrentCursor->DeleteMark();
2194 m_pCurrentCursor->SetColumnSelection(
true );
2195 while( pPam != pStart )
2200 pNew->insert( pNew->begin(), m_pCurrentCursor->begin(), m_pCurrentCursor->end());
2201 m_pCurrentCursor->clear();
2204 *m_pCurrentCursor->GetPoint() = *(*pPam)->GetPoint();
2205 if( (*pPam)->HasMark() )
2207 m_pCurrentCursor->SetMark();
2208 *m_pCurrentCursor->GetMark() = *(*pPam)->GetMark();
2211 m_pCurrentCursor->DeleteMark();
2212 m_pCurrentCursor->SetColumnSelection(
true );
2217 pNew->insert( pNew->begin(), m_pCurrentCursor->begin(), m_pCurrentCursor->end() );
2218 m_pCurrentCursor->clear();
2221 pPam = aSelList.
getEnd();
2223 *m_pCurrentCursor->GetPoint() = *(*pPam)->GetPoint();
2224 if( (*pPam)->HasMark() )
2226 m_pCurrentCursor->SetMark();
2227 *m_pCurrentCursor->GetMark() = *(*pPam)->GetMark();
2230 m_pCurrentCursor->DeleteMark();
2231 m_pCurrentCursor->SetColumnSelection(
true );
2242 SwShellCursor *
const pCurrent(m_pTableCursor ? m_pTableCursor : m_pCurrentCursor);
2244 pCurrent->
GetPtPos(), m_pStackCursor );
2249 *m_pStackCursor->GetMark() = *pCurrent->
GetMark();
2264 if (
nullptr == m_pStackCursor)
2270 if (m_pStackCursor->GetNext() != m_pStackCursor)
2272 pTmp = m_pStackCursor->
GetNext();
2275 if (PopMode::DeleteStack == eDelete)
2276 delete m_pStackCursor;
2278 m_pStackCursor = pTmp;
2280 if (PopMode::DeleteCurrent == eDelete)
2285 const Point& rPoint = pOldStack->GetPtPos();
2286 if (rPoint == m_pCurrentCursor->GetPtPos() || rPoint == m_pCurrentCursor->GetMkPos())
2289 m_pCurrentCursor->insert( m_pCurrentCursor->begin(), pOldStack->begin(), pOldStack->end() );
2293 if( pOldStack->HasMark() )
2295 m_pCurrentCursor->SetMark();
2296 *m_pCurrentCursor->GetMark() = *pOldStack->GetMark();
2297 m_pCurrentCursor->GetMkPos() = pOldStack->GetMkPos();
2301 m_pCurrentCursor->DeleteMark();
2302 *m_pCurrentCursor->GetPoint() = *pOldStack->GetPoint();
2303 m_pCurrentCursor->GetPtPos() = pOldStack->GetPtPos();
2306 if( !m_pCurrentCursor->IsInProtectTable(
true ) &&
2313 m_pTableCursor->SetChgd();
2327 if (
nullptr == m_pStackCursor)
2335 assert(!m_pStackCursor->HasMark() ||
2337 m_pCurrentCursor->GetPoint()->nNode,
true));
2338 *m_pStackCursor->GetPoint() = *m_pCurrentCursor->GetPoint();
2339 m_pStackCursor->GetPtPos() = m_pCurrentCursor->GetPtPos();
2342 if (m_pStackCursor->GetNext() != m_pStackCursor)
2344 pTmp = m_pStackCursor->
GetNext();
2346 delete m_pCurrentCursor;
2347 m_pCurrentCursor = m_pStackCursor;
2348 m_pStackCursor->
MoveTo(
nullptr);
2349 m_pStackCursor = pTmp;
2350 if( !m_pCurrentCursor->IsInProtectTable(
true ) &&
2360 if( !m_bHasFocus || m_bBasicHideCursor )
2364 if( m_pVisibleCursor->IsVisible() )
2367 m_pVisibleCursor->Hide();
2370 SwShellCursor* pCurrentCursor = m_pTableCursor ? m_pTableCursor : m_pCurrentCursor;
2371 pCurrentCursor->
Hide();
2376 if( !m_bHasFocus || m_bAllProtect || m_bBasicHideCursor )
2380 SwShellCursor* pCurrentCursor = m_pTableCursor ? m_pTableCursor : m_pCurrentCursor;
2381 pCurrentCursor->
Show(
nullptr);
2383 if( m_bSVCursorVis && bCursorVis )
2384 m_pVisibleCursor->Show();
2389 if( m_bBasicHideCursor )
2392 m_bSVCursorVis =
true;
2393 m_pCurrentCursor->SetShowTextInputFieldOverlay(
true );
2397 const OString aPayload = OString::boolean(m_bSVCursorVis);
2398 GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE, aPayload.getStr());
2407 if( m_bBasicHideCursor )
2410 m_bSVCursorVis =
false;
2413 m_pCurrentCursor->SetShowTextInputFieldOverlay(
false );
2414 m_pVisibleCursor->Hide();
2418 OString aPayload = OString::boolean(m_bSVCursorVis);
2419 GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE, aPayload.getStr());
2426 if( !m_bBasicHideCursor )
2428 m_bHasFocus =
false;
2436 if( !m_bBasicHideCursor && VisArea().
Width() )
2439 ShowCursors( m_bSVCursorVis );
2446 CurrShell aCurr( const_cast<SwCursorShell*>(
this) );
2453 sal_uInt16* pST =
const_cast<sal_uInt16*
>(&mnStartAction);
2455 const Size aOldSz( GetDocSize() );
2456 std::pair<Point, bool>
const tmp(m_pCurrentCursor->GetPtPos(),
true);
2457 pRet = pNd->
getLayoutFrame(GetLayout(), m_pCurrentCursor->GetPoint(), &tmp);
2459 if( aOldSz != GetDocSize() )
2460 const_cast<SwCursorShell*>(
this)->SizeChgNotify();
2464 std::pair<Point, bool>
const tmp(m_pCurrentCursor->GetPtPos(),
false);
2465 pRet = pNd->
getLayoutFrame(GetLayout(), m_pCurrentCursor->GetPoint(), &tmp);
2479 if(dynamic_cast<const sw::PostGraphicArrivedHint*>(&rHint) && m_aGrfArrivedLnk.IsSet())
2481 m_aGrfArrivedLnk.Call(*
this);
2490 if( m_bCallChgLnk &&
2491 ( nWhich < RES_MSG_BEGIN || nWhich >=
RES_MSG_END ||
2505 if(m_aGrfArrivedLnk.IsSet())
2506 m_aGrfArrivedLnk.Call(*
this);
2517 const SwPaM* pCursor = getShellCursor(
true );
2518 return IsTableMode()
2529 m_bChgCallFlag =
true;
2530 else if( m_aChgLnk.IsSet() )
2533 m_aChgLnk.Call(
nullptr);
2534 m_bChgCallFlag =
false;
2542 if (GetLayout()->HasMergedParas())
2548 SwPosition const*
const pStart(m_pCurrentCursor->Start());
2549 SwPosition const*
const pEnd(m_pCurrentCursor->End());
2550 for (
sal_uLong i = pStart->nNode.GetIndex();
i <= pEnd->nNode.GetIndex(); ++
i)
2552 SwNode const& rNode(*pStart->nNode.GetNodes()[
i]);
2553 assert(!rNode.IsEndNode());
2554 if (rNode.IsStartNode())
2556 i = rNode.EndOfSectionIndex();
2558 else if (rNode.IsTextNode())
2560 sal_Int32
const nStart(
i == pStart->nNode.GetIndex()
2561 ? pStart->nContent.GetIndex()
2563 sal_Int32
const nEnd(
i == pEnd->nNode.GetIndex()
2564 ? pEnd->nContent.GetIndex()
2565 : rNode.GetTextNode()->Len());
2566 buf.append(rNode.GetTextNode()->GetExpandText(
2568 nStart, nEnd - nStart,
false,
false,
false,
2573 aText = buf.makeStringAndClear();
2576 else if( m_pCurrentCursor->GetPoint()->nNode.GetIndex() ==
2577 m_pCurrentCursor->GetMark()->nNode.GetIndex() )
2582 const sal_Int32 nStt = m_pCurrentCursor->Start()->nContent.
GetIndex();
2584 m_pCurrentCursor->End()->nContent.GetIndex() - nStt );
2600 const SwPosition* pPos = !m_pCurrentCursor->HasMark() ? m_pCurrentCursor->GetPoint()
2601 : bEnd ? m_pCurrentCursor->End() : m_pCurrentCursor->Start();
2607 const OUString& rStr = pTextNd->
GetText();
2610 if (((nPos+nOffset) >= 0 ) && (nPos+nOffset) < rStr.getLength())
2611 cCh = rStr[nPos + nOffset];
2623 if( !m_pCurrentCursor->HasMark() || IsTableMode() )
2626 SwPosition* pPos = bEnd ? m_pCurrentCursor->End() : m_pCurrentCursor->Start();
2633 if ((nPos + nCount) <= pTextNd->
GetText().getLength())
2634 nPos = nPos + nCount;
2638 else if( nPos >= nCount )
2639 nPos = nPos - nCount;
2660 SwPosition aPos( *m_pCurrentCursor->GetPoint() );
2662 aTmpState.m_bSetInReadOnly = IsReadOnlyAvailable();
2663 aTmpState.m_bRealHeight =
true;
2665 const bool bRet = GetLayout()->GetModelPositionForViewPoint( &aPos, aPt );
2667 SetInFrontOfLabel(
false );
2676 ( !IsReadOnlyAvailable() &&
2680 std::pair<Point, bool>
const tmp(aPt,
true);
2682 if ( Imp()->IsIdleAction() )
2684 SwRect aTmp( m_aCharRect );
2686 pFrame->
GetCharRect( m_aCharRect, aPos, &aTmpState );
2689 if( aTmp == m_aCharRect && m_pVisibleCursor->IsVisible() )
2692 m_pVisibleCursor->Hide();
2695 MakeVisible( m_aCharRect );
2696 m_pCurrentCursor->Show(
nullptr);
2700 if( aTmpState.m_bRealHeight )
2701 m_aCursorHeight = aTmpState.m_aRealHeight;
2704 m_aCursorHeight.setX(0);
2705 m_aCursorHeight.setY(m_aCharRect.Height());
2708 m_pVisibleCursor->SetDragCursor();
2709 m_pVisibleCursor->Show();
2716 return m_pVisibleCursor;
2722 SwPaM aPam( *m_pCurrentCursor->GetPoint() );
2723 GetLayout()->GetModelPositionForViewPoint( aPam.GetPoint(), aPt );
2735 sal_uInt16
n = (bAll || ( m_pCurrentCursor->HasMark() &&
2736 *m_pCurrentCursor->GetPoint() != *m_pCurrentCursor->GetMark())) ? 1 : 0;
2737 while( pTmp != m_pCurrentCursor )
2739 if( bAll || ( pTmp->
HasMark() &&
2749 if( m_pCurrentCursor->GetPoint()->nContent.GetIndex() )
2753 SwNodeIndex aIdx( GetDoc()->GetNodes().GetEndOfExtras(), 2 );
2755 GetDoc()->GetNodes().GoNext( &aIdx );
2756 return aIdx == m_pCurrentCursor->GetPoint()->nNode;
2761 SwNodeIndex aIdx( GetDoc()->GetNodes().GetEndOfContent(), -1 );
2766 return aIdx == m_pCurrentCursor->GetPoint()->nNode &&
2767 pCNd->
Len() == m_pCurrentCursor->GetPoint()->nContent.GetIndex();
2779 if( !m_pTableCursor )
2782 m_pTableCursor->ParkCursor();
2784 while( m_pCurrentCursor->GetNext() != m_pCurrentCursor )
2785 delete m_pCurrentCursor->GetNext();
2788 m_pCurrentCursor->DeleteMark();
2789 *m_pCurrentCursor->GetPoint() = *m_pTableCursor->GetPoint();
2799 SwPaM *pTmpDel =
nullptr, *pTmp = *ppDelRing;
2809 *pTmpEnd = pTmp->GetPoint() == pTmpStt ?
2810 pTmp->GetMark() : pTmp->GetPoint();
2813 if( *pStt <= *pTmpStt )
2815 if( *pEnd > *pTmpStt ||
2816 ( *pEnd == *pTmpStt && *pEnd == *pTmpEnd ))
2820 if( *pStt < *pTmpEnd )
2826 bool bDelete =
true;
2827 if( *ppDelRing == pTmpDel )
2829 if( *ppDelRing == m_pCurrentCursor )
2831 bDelete = GoNextCursor();
2835 pTmp = pTmp->GetNext();
2844 if (pTmp == pTmpDel)
2856 if( bGoNext && pTmp )
2859 }
while( !bGoNext || *ppDelRing != pTmp );
2874 std::unique_ptr<SwPaM> pNew(
new SwPaM( *GetCursor()->GetPoint() ) );
2898 if(
auto pSh = dynamic_cast<SwCursorShell *>(&rTmp))
2900 if (pSh->m_pStackCursor)
2901 pSh->ParkPams(pNew.get(), &pSh->m_pStackCursor);
2903 pSh->ParkPams( pNew.get(), &pSh->m_pCurrentCursor );
2904 if( pSh->m_pTableCursor )
2908 SwPaM* pTCursor = pSh->GetTableCrs();
2915 pSh->m_pCurrentCursor->GetPoint()->nNode = *pTableNd;
2929 ,
sw::BroadcastingModify()
2930 , m_pStackCursor( nullptr )
2931 , m_pBlockCursor( nullptr )
2932 , m_pTableCursor( nullptr )
2933 , m_pBoxIdx( nullptr )
2934 , m_pBoxPtr( nullptr )
2936 , m_nLeftFramePos(0)
2938 , m_nCurrentContent(0)
2940 , m_nCursorMove( 0 )
2942 , m_eEnhancedTableSel(
SwTable::SEARCH_NONE)
2944 , m_nMarkedListLevel( 0 )
2945 , m_oldColFrame(nullptr)
2966 ,
sw::BroadcastingModify()
2967 , m_pStackCursor( nullptr )
2968 , m_pBlockCursor( nullptr )
2969 , m_pTableCursor( nullptr )
2970 , m_pBoxIdx( nullptr )
2971 , m_pBoxPtr( nullptr )
2973 , m_nLeftFramePos(0)
2975 , m_nCurrentContent(0)
2977 , m_nCursorMove( 0 )
2979 , m_eEnhancedTableSel(
SwTable::SEARCH_NONE)
2981 , m_nMarkedListLevel( 0 )
2982 , m_oldColFrame(nullptr)
3076 OSL_ENSURE(
m_bHasFocus,
"no focus but cursor should be made visible?" );
3114 assert(!
"Did not remove table selection!");
3120 GetDoc()->GetDocShell()->IsReadOnlyUI() )
3143 bool bFirst =
false;
3160 rNdIdx =
mxDoc->GetNodes().GetEndOfExtras();
3179 while( aPam.GetNode().IsProtect() &&
3184 if( aPam.GetNode().IsProtect() )
3188 while( aPam.GetNode().IsProtect() &&
3194 if( ! aPam.GetNode().IsProtect() )
3207 bool bGoNextSection =
true;
3208 for(
int nLoopCnt = 0; !bOk && nLoopCnt < 2; ++nLoopCnt )
3221 if ( pCNd ==
nullptr)
break;
3252 if (
nullptr == pFrame ||
3261 }
while( bContinue );
3266 bGoNextSection =
false;
3274 const sal_Int32 nContent = rNdIdx.
GetIndex() < nNdIdx ? pCNd->
Len() : 0;
3301 if( pFrame && pFrame->
IsInFly() &&
3302 (pFly = pFrame->
FindFlyFrame())->GetFormat()->GetEditInReadonly().GetValue() &&
3310 else if ( pFrame && pFrame->
IsInSct() &&
3330 if( (!
GetDoc()->GetDocShell() ||
3331 dynamic_cast<const SwGlobalDocShell*>(
GetDoc()->GetDocShell()) ==
nullptr ) &&
3384 sal_Int32 nTmp = nStt;
3389 bRet = pCNd && !nStt && nEnd == pCNd->
Len();
3406 return mxDoc->GetTextDirection( aPos, &aPt );
3412 return SvxFrameDirection::Vertical_RL_TB == nDir || SvxFrameDirection::Vertical_LR_TB == nDir
3413 || nDir == SvxFrameDirection::Vertical_LR_BT;
3421 return SvxFrameDirection::Vertical_LR_TB == nDir || SvxFrameDirection::Horizontal_RL_TB == nDir;
3438 sal_Int32 nHiddenStart;
3439 sal_Int32 nHiddenEnd;
3455 bool bSearchInNotes,
3468 if( nRet || bCancel )
3492 bool bNoCollections,
3505 bCancel, eRng, pSearchOpt, rReplSet,
GetLayout());
3516 if(rCursor.
GetNext() != &rCursor)
3528 }
while( (_pStartCursor = _pStartCursor->
GetNext()) != &rCursor );
3582 bool bChanged =
false;
3586 while (pCursor != pStartCursor)
3588 pTmpCursor = pCursor->
GetNext();
3594 pCursor = pTmpCursor;
3616 pNode = aNodes.
GoNext( &aIdx );
3618 bool bFound = (pNode !=
nullptr);
3624 SwPaM aTmpPam(*pNode);
3625 *pStartCursor = aTmpPam;
3642 aResult +=
SwResId(STR_MULTISEL);
3651 (
void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwCursorShell"));
3655 (
void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"m_pCurrentCursor"));
3657 rPaM.dumpAsXml(pWriter);
3658 (
void)xmlTextWriterEndElement(pWriter);
3660 (
void)xmlTextWriterEndElement(pWriter);
3664 uno::Sequence< uno::Reference< container::XStringKeyMap > >& rStringKeyMaps,
3665 const SwWrongList& rSmartTagList, sal_Int32 nCurrent )
3668 std::vector< uno::Reference< container::XStringKeyMap > > aStringKeyMaps;
3670 for ( sal_uInt16
i = 0;
i < rSmartTagList.
Count(); ++
i )
3672 const sal_Int32 nSTPos = rSmartTagList.
Pos(
i );
3673 const sal_Int32 nSTLen = rSmartTagList.
Len(
i );
3675 if ( nSTPos <= nCurrent && nCurrent < nSTPos + nSTLen )
3680 rSmartTagTypes.push_back( pArea->
maType );
3685 if ( !rSmartTagTypes.empty() )
3692 SwTextNode& rNode, sal_Int32 nBegin, sal_Int32 nLen )
3702 const uno::Reference<text::XTextRange> xRange =
3709 uno::Sequence< uno::Reference< container::XStringKeyMap > >& rStringKeyMaps,
3710 uno::Reference< text::XTextRange>& rRange )
const
3718 if ( !pNode || pNode->IsInProtectSect() )
3721 const SwWrongList *pSmartTagList = pNode->GetSmartTags();
3722 if ( !pSmartTagList )
3725 sal_Int32 nCurrent = aPos.nContent.GetIndex();
3726 sal_Int32 nBegin = nCurrent;
3729 if (!pSmartTagList->
InWrongWord(nBegin, nLen) || pNode->IsSymbolAt(nBegin))
3736 pSmartTagList = pSubList;
3756 if( !
GetLayout()->GetModelPositionForViewPoint( &aPos, aPt, &eTmpState ) )
3762 if( !pSmartTagList )
3767 sal_Int32 nBegin = aPos.nContent.GetIndex();
3774 OUString aText( pNode->
GetText().copy(nBegin, nLen) );
3789 sal_Int32 nLeft = 0;
3792 pChar = aText.getLength() ? aText.getStr() + aText.getLength() - 1 :
nullptr;
3793 sal_Int32 nRight = 0;
3797 aPos.nContent = nBegin + nLeft;
3803 const sal_Int32 nWordStart = (nBegin + nLeft) < nLineStart ? nLineStart : nBegin + nLeft;
3806 const sal_Int32 nWordEnd = std::min(nBegin + nLen - nLeft - nRight, nLineEnd);
3810 rContent = nWordStart;
3815 std::pair<Point, bool>
const tmp(rPt,
false);
3820 rContent = nWordEnd - 1;
3823 rSelectRect = aStartRect.
Union( aEndRect );
SAL_DLLPRIVATE void MarkListLevel(const OUString &sListId, const int nLevel)
Mark a certain list level of a certain list.
bool SttEndDoc(bool bSttDoc)
sal_Int32 Pos(sal_uInt16 nIdx) const
bool m_bSVCursorVis
SV-Cursor visible/invisible.
SwSectionNode * FindSectionNode()
Search section node, in which it is.
const SwEndNode * EndOfSectionNode() const
Starts a section of nodes in the document model.
bool GotoPage(sal_uInt16 nPage)
bool MovePara(SwWhichPara, SwMoveFnCollection const &)
SwVisibleCursor * m_pVisibleCursor
the visible cursor
Base class of the Writer layout elements.
Represents the visualization of a paragraph.
virtual sal_Int32 Len() const
static void notifyOtherViews(const SfxViewShell *pThisView, int nType, std::string_view rKey, const OString &rPayload)
virtual SwPaM & CreateNewShellCursor() override
Create and return a new shell cursor.
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
SwMoveFnCollection const & fnParaEnd
sal_uLong GetIndex() const
SAL_DLLPRIVATE void UpdateCursor(sal_uInt16 eFlags=SwCursorShell::SCROLLWIN|SwCursorShell::CHKRANGE, bool bIdleEnd=false)
SwNode & GetNode(bool bPoint=true) const
SwNode & GetEndOfAutotext() const
Section for all Flys/Header/Footers.
SwShellCursor * m_pCurrentCursor
current cursor
bool GoInContent(SwPaM &rPam, SwMoveFnCollection const &fnMove)
void Add(SwClient *pDepend)
sal_uLong Find_Text(const i18nutil::SearchOptions2 &rSearchOpt, bool bSearchInNotes, SwDocPositions eStart, SwDocPositions eEnd, bool &bCancel, FindRanges eRng, bool bReplace=false)
static void lcl_CheckHiddenPara(SwPosition &rPos)
Try to set the cursor to the next visible content node.
Represents the style of a paragraph.
bool IsInVerticalText(const Point *pPt=nullptr) const
size_t GetMarkCount() const
Marks a position in the document model.
bool m_bHasFocus
Shell is "active" in a window.
bool IsInProtectTable(bool bMove=false, bool bChgCursor=true)
bool IsSectionNode() const
sal_uInt16 GetWhich() const
bool IsMultiSelection() const
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.
SwRect & Union(const SwRect &rRect)
SwPaM * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
static SwFrame * lcl_IsInHeaderFooter(const SwNodeIndex &rIdx, Point &rPt)
SAL_DLLPRIVATE bool UpDown(bool, sal_uInt16)
bool m_bRealHeight
should the real height be calculated?
const OUString & GetText() const
OUString getPageRectangles()
Implementation of lok::Document::getPartPageRectangles() for Writer.
virtual const SwRootFrame * GetCurrentLayout() const =0
static const SwStartNode * lcl_NodeContext(const SwNode &rNode)
bool MoveSection(SwWhichSection, SwMoveFnCollection const &)
sal_uInt16 GetNextPrevPageNum(bool bNext=true)
bool GoNextCursor()
go to the next SSelection
bool SttEndDoc(bool bStt)
bool m_bInCMvVisportChgd
Flag for CursorMoves.
constexpr TypedWhichId< SwFormatChg > RES_FMT_CHG(162)
void ClearTableBoxContent()
static void lcl_FillRecognizerData(std::vector< OUString > &rSmartTagTypes, uno::Sequence< uno::Reference< container::XStringKeyMap > > &rStringKeyMaps, const SwWrongList &rSmartTagList, sal_Int32 nCurrent)
constexpr TypedWhichId< SwMsgPoolItem > RES_GRAPHIC_SWAPIN(186)
void SetStyleSettings(const StyleSettings &rSet)
bool IsCursorInFootnote() const
const SwTable * GetTable() const
bool IsAtLeftRightMargin(SwRootFrame const &rLayout, bool bLeftMargin, bool bAPI) const
void Left(const tools::Long nLeft)
SwVisibleCursor * GetVisibleCursor() const
SwShellCursor & getShellCursor()
Access to the shell cursor.
void UpdateCursorPos()
Set the cursor back into content.
const SwRect & GetAnyCurRect(CurRectType eType, const Point *pPt=nullptr, const css::uno::Reference< css::embed::XEmbeddedObject > &=css::uno::Reference< css::embed::XEmbeddedObject >()) const
SwShellCursor * getShellCursor(bool bBlock)
Delivers the current shell cursor.
bool IsStartOfDoc() const
void NotifyCursor(SfxViewShell *pViewShell) const
See SwView::NotifyCursor().
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
bool IsEditInReadonlyFlag() const
const SwPosition * GetMark() const
void ShowCursor(bool bGotoCursor=true, bool bForceVisCursor=true, bool bActivate=false)
tools::Long GetLeft() const
SwTabFrame is one table in the document layout, containing rows (which contain cells).
bool m_bAllProtect
Flag for areas.
sal_uInt8 m_nCursorBidiLevel
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
OUString GetListId() const
virtual void SetMark() override
Unless this is called, the getter method of Mark will return Point.
bool m_bRealWidth
Calculation of the width required.
virtual bool IsSelOvr(SwCursorSelOverFlags eFlags=SwCursorSelOverFlags::CheckNodeSection|SwCursorSelOverFlags::Toggle|SwCursorSelOverFlags::ChangePos)
SwShellCursor * m_pStackCursor
stack for the cursor
static SwContentNode * GoPrevSection(SwNodeIndex *, bool bSkipHidden=true, bool bSkipProtect=true)
void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
SwMoveFnCollection const & fnParaStart
void GetTabRows(SwTabCols &rToFill) const
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 void MakeSelVisible()
show the current selected "object"
void GetPageNum(sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum, bool bAtCursorPos=true, const bool bCalcFrame=true)
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
void GetSmartTagRect(const Point &rPt, SwRect &rSelectRect)
static SwContentNode * GoPrevious(SwNodeIndex *)
std::list< SwPaM * >::iterator getEnd()
End of the container for the selected text portions.
sal_Unicode GetChar(bool bEnd=true, tools::Long nOffset=0)
get the nth character of the current SSelection
bool IsSelFullPara() const
void DestroyCursor()
transform TableCursor to normal cursor, nullify Tablemode
This class is used as parameter for creation of a block cursor selection.
virtual void VisPortChgd(const SwRect &)
sal_uInt16 GetRowsToRepeat() const
void ExtendedSelectAll(bool bFootnotes=true)
bool m_bVisPortChgd
in VisPortChg-Call
Dialog to specify the properties of date form field.
SwNode & GetEndOfPostIts() const
A still empty section.
virtual void Calc(vcl::RenderContext *pRenderContext) const
Of course Writer needs its own rectangles.
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
forward all attribute/format changes at the current node to the Link
OUString GetCursorDescr() const
Returns textual description of the current selection.
The root element of a Writer document layout.
int GetActualListLevel() const
Returns the actual list level of this text node, when it is a list item.
void MoveTo(value_type *pDestRing)
Removes this item from its current ring container and adds it to another ring container.
constexpr sal_uInt16 RES_MSG_BEGIN(RES_FMT_END)
const SwTabColsEntry & GetEntry(size_t nPos) const
bool HasSelection() const
Does the current cursor create a selection?
bool IsSymbolAt(sal_Int32 nBegin) const
in ndcopy.cxx
not in repeated headlines
sal_uInt16 GetPhyPageNum() const
SwBlockCursor * m_pBlockCursor
interface of cursor for block (=rectangular) selection
const SwSection & GetSection() const
SwContentNode * GetContentNode(bool bPoint=true) const
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const
Used by the UI to modify the document model.
static UITestLogger & getInstance()
bool IsInFrontOfLabel() const
void logEvent(const EventDescription &rDescription)
bool SelectHiddenRange()
If the current cursor position is inside a hidden range, the hidden range is selected.
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
Primary passes the call to the first page.
SwWrongList * SubList(sal_uInt16 nIdx) const
SwNodeType GetNodeType() const
rtl::Reference< SwDoc > mxDoc
The document; never 0.
const SwRect & getFrameArea() const
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
void NormalizePam(bool bPointFirst=true)
Ensure point and mark of the current PaM are in a specific order.
tools::Long GetLeftMin() const
bool HasHiddenCharAttribute(bool bWholePara) const
Hidden Paragraph Field:
sal_uLong GetIndex() const
void RegisterOtherShell(OutlinerViewShell *pOtherShell)
SAL_DLLPRIVATE bool isInHiddenTextFrame(SwShellCursor *pShellCursor)
bool FindValidContentNode(bool bOnlyText)
search a valid content position (not protected/hidden)
bool m_bChgCallFlag
attribute change inside Start- and EndAction
int SetCursor(const Point &rPt, bool bOnlyText=false, bool bBlock=true)
bool CheckNodesRange(const SwNodeIndex &rStt, const SwNodeIndex &rEnd, bool bChkSection)
Check if the given range is inside one of the defined top-level sections.
bool IsProtectFlag() const
constexpr sal_uInt16 RES_MSG_END(190)
#define STYLE_CURSOR_NOBLINKTIME
SwFlyFrame * FindFlyFrame()
void Show(SfxViewShell const *pViewShell)
void Invalidate(const SwRect &rRect)
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
SwShellTableCursor * m_pTableCursor
table Cursor; only in tables when the selection lays over 2 columns
bool m_bCallChgLnk
flag for derived classes
std::list< SwPaM * >::iterator getStart()
Start of the container for the selected text portions.
bool MovePage(SwWhichPage, SwPosPage)
void GetCharRectAt(SwRect &rRect, const SwPosition *pPos)
virtual bool GetCharRect(SwRect &, const SwPosition &, SwCursorMoveState *=nullptr, bool bAllowFarAway=true) const
static void CheckRange(SwCursor *pCurrentCursor)
Check if pCurrentCursor points into already existing ranges and delete those.
void MakeVisible(const SwRect &)
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
static OUString GetPaMDescr(const SwPaM &rPaM)
Returns a textual description of a PaM.
bool LeftRight(bool, sal_uInt16, sal_uInt16, bool)
void EndCursorMove(const bool bIdleEnd=false)
sal_uInt16 GetVirtPageNum() const
void SetCursorBlinkTime(sal_uInt64 nBlinkTime)
bool IsContentNode() const
PaM is Point and Mark: a selection of the document model.
bool MovePara(SwWhichPara, SwMoveFnCollection const &)
struct _xmlTextWriter * xmlTextWriterPtr
bool FrameContainsNode(SwContentFrame const &rFrame, sal_uLong nNodeIndex)
bool ShouldWait() const
Should WaitPtr be switched on for the clipboard?
bool ExtendedSelectedAll()
If ExtendedSelectAll() was called and selection didn't change since then.
static void FireColumnChangeEvent(sal_uInt16 nOldColumn, sal_uInt16 nNewColumn)
static void lcl_FillTextRange(uno::Reference< text::XTextRange > &rRange, SwTextNode &rNode, sal_Int32 nBegin, sal_Int32 nLen)
virtual SwPaM & GetCurrentShellCursor() override
Return the current shell cursor.
bool ParkTableCursor()
Invalidate cursors.
bool IsInRightToLeftText() const
A helper class to save cursor state (position).
TextFrameIndex MapModelToViewPos(SwPosition const &rPos) const
constexpr TypedWhichId< SwUpdateAttr > RES_UPDATE_ATTR(167)
bool(* SwWhichPara)(SwPaM &, SwMoveFnCollection const &)
SwPaM * CreateCursor()
delete the current cursor and make the following into the current
static bool lcl_CursorOk(SwPaM &aPam)
Checks if a PaM is valid.
const SwRect & VisArea() const
const SwStartNode * StartOfSectionNode() const
const SwPosition * GetPoint() const
bool IsOverReadOnlyPos(const Point &rPt) const
SwIndex & Assign(SwIndexReg *, sal_Int32)
static SwSmartTagMgr & Get()
bool UpDown(bool bUp, sal_uInt16 nCnt)
SAL_DLLPRIVATE void UpdateMarkedListLevel()
Updates the marked list level according to the cursor.
SAL_DLLPRIVATE void sendLOKCursorUpdates()
SwPageFrame * FindPageFrame()
void Push()
store a copy of the current cursor on the cursor stack
size_t UpdateTableSelBoxes()
void ParkCursor(const SwNodeIndex &rIdx)
Remove selections and additional cursors of all shells.
bool IsEndOfTable() const
at the very last SwPosition inside a table
SwLayoutFrame *(* SwWhichPage)(const SwLayoutFrame *)
bool GoNextPrevCursorSetSearchLabel(const bool bNext)
const SwFrame * Lower() const
bool IsHiddenFlag() const
static void FireSectionChangeEvent(sal_uInt16 nOldSection, sal_uInt16 nNewSection)
SwContentNode * GetContentNode()
void BlockCursorToCursor()
const SdrMarkList & GetMarkedObjectList() const
sal_uInt16 GetPageNumSeqNonEmpty()
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
friend class SwVisibleCursor
SwLayoutFrame * GetUpper()
void ShowCursors(bool bCursorVis)
void AddHeight(const tools::Long nAdd)
sal_Int32 Len(sal_uInt16 nIdx) const
constexpr TypedWhichId< SwAttrSetChg > RES_ATTRSET_CHG(163)
bool RightMargin(bool bAPI=false)
Marks a character position inside a document model node.
void SetSelection(const SwPaM &rCursor)
::rtl::Reference< Content > pContent
bool IsCursorReadonly() const
bool m_bSetCursorInReadOnly
SAL_DLLPRIVATE SvxFrameDirection GetTextDirection(const Point *pPt=nullptr) const
bool IsNoTextNode() const
const Point & GetMkPos() const
void DrawSelectionXOR(OutlinerViewShell *pOtherShell)
sal_uInt16 GetCursorCnt(bool bAll=true) const
Get the number of elements in the ring of cursors.
bool GoCurrSection(SwPaM &rPam, SwMoveFnCollection const &fnMove)
void AddWidth(const tools::Long nAdd)
SwWrongList * GetSmartTags()
Marks a node in the document model.
void GetTabCols(SwTabCols &rToFill) const
Info about columns and margins.
ring_container GetRingContainer()
static tools::Long getLayoutFrame(const SwRootFrame *, SwTextNode const &rNd, sal_Int32 nCntPos, bool bCalcFrame)
sal_uLong FindFormat(const SwTextFormatColl &rFormatColl, SwDocPositions eStart, SwDocPositions eEnd, bool &bCancel, FindRanges eRng, const SwTextFormatColl *pReplFormat)
OUString SwResId(const char *pId)
SwStartNodeType GetStartNodeType() const
bool m_bInFrontOfLabel
cursor in front of label
bool HasReadonlySel() const
Point m_aRealHeight
contains then the position/height of the cursor
SwStartNode * GetStartNode()
bool IsProtect() const
Is node in something that is protected (range, frame, table cells ...
A page of the document layout.
void TableCursorToCursor()
enter block mode, change normal cursor into block cursor
stay with the cursor inside text
static void SetSearchLabel(const SearchLabel &rSL)
bool MakeTableCursors(SwTableCursor &)
Calculates the cells included from the current selection.
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
SwTable is one table in the document model, containing rows (which contain cells).
const SwPosition * Start() const
CursorFlag
for calling UpdateCursor
SAL_DLLPRIVATE bool IsAtLRMargin(bool, bool bAPI=false) const
SwTextNode * GetParaPropsNode(SwRootFrame const &rLayout, SwNodeIndex const &rNode)
bool IsInProtectSect() const
Is node in a protected area?
SwSectionFrame * FindSctFrame()
void EndAction(const bool bIdleEnd=false)
bool MoveSection(SwWhichSection, SwMoveFnCollection const &)
bool IsMacroExecAllowed() const
SwTextNode is a paragraph in the document model.
bool LeftRightMargin(SwRootFrame const &rLayout, bool bLeftMargin, bool bAPI)
bool IsMultiSelection() const
bool IsReadOnlyAvailable() const
static void FirePageChangeEvent(sal_uInt16 nOldPage, sal_uInt16 nNewPage)
SwContentFrame *(* SwPosPage)(const SwLayoutFrame *)
OUString GetExpandText(SwRootFrame const *pLayout, const sal_Int32 nIdx=0, const sal_Int32 nLen=-1, const bool bWithNum=false, const bool bAddSpaceAfterListLabelStr=false, const bool bWithSpacesForLevel=false, const ExpandMode eAdditionalMode=ExpandMode::ExpandFootnote) const
add 4th optional parameter indicating, when that a spa...
std::deque< AttacherIndex_Impl > aIndex
general base class for all free-flowing frames
Point m_aCursorHeight
height & offset from visible Cursor
virtual void VisPortChgd(const SwRect &) override
bool TestCurrPam(const Point &rPt, bool bTstHit=false)
Search in the selected area for a Selection that covers the given point.
sal_uInt64 GetCursorBlinkTime() const
SwContentFrame * GetCurrFrame(const bool bCalcFrame=true) const
Get current frame in which the cursor is positioned.
void Combine()
Combine two cursors.
#define SAL_WARN_IF(condition, area, stream)
void CursorToBlockCursor()
leave block mode, change block cursor into normal cursor
sal_uLong 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
const SwNodes & GetNodes() const
void GetSmartTagTerm(std::vector< OUString > &rSmartTagTypes, css::uno::Sequence< css::uno::Reference< css::container::XStringKeyMap > > &rStringKeyMaps, css::uno::Reference< css::text::XTextRange > &rRange) const
bool IsNumbered(SwRootFrame const *pLayout=nullptr) const
Returns is this text node is numbered.
const SwViewOption * GetViewOptions() const
sal_uLong Find_Text(const i18nutil::SearchOptions2 &rSearchOpt, bool bSearchInNotes, SwDocPositions nStart, SwDocPositions nEnd, bool &bCancel, FindRanges, bool bReplace=false, SwRootFrame const *const pLayout=nullptr)
bool ExtendSelection(bool bEnd=true, sal_Int32 nCount=1)
extend current SSelection by n characters
SwMoveFnCollection const & fnSectionEnd
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
sal_uInt16 GetWrongPos(sal_Int32 nValue) const
Find the first position that is greater or equal to the given value.
OUString GetSelText() const
get selected text of a node at current cursor
SwShellCursor * GetNext()
sal_Int32 GetIndex() const
bool InWrongWord(sal_Int32 &rChk, sal_Int32 &rLn) const
If a word is incorrectly selected, this method returns begin and length of it.
bool IsInside(const Point &rPOINT) const
bool IsNoTextFrame() const
bool StartsWithTable()
If document body starts with a table.
bool GoPrevCursor()
go to the previous SSelection
size_t GetSelectedBoxesCount() const
const SwPosition * End() const
void SetCursorBidiLevel(sal_uInt8 nNewLevel)
bool GetFrameInPage(const SwContentFrame *, SwWhichPage, SwPosPage, SwPaM *)
Returns the first/last Contentframe (controlled using the parameter fnPosPage) of the current/previou...
void Top(const tools::Long nTop)
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
const SwWrongArea * GetElement(sal_uInt16 nIdx) const
int CompareCursorStackMkCurrPt() const
const Point & GetPtPos() const
bool HasReadonlySel(bool bFormView) const
Is in something protected (readonly) or selection contains something protected.
SwSpecialPos * m_pSpecialPos
for positions inside fields
SAL_DLLPRIVATE bool LRMargin(bool, bool bAPI=false)
bool CheckTableBoxContent(const SwPosition *pPos=nullptr)
static bool IsAtStartOrEndOfFrame(SwCursorShell const *const pShell, SwShellCursor const *const pShellCursor, SwMoveFnCollection const &fnPosPara)
bool IsScrollMDI(SwViewShell const *pVwSh, const SwRect &rRect)
SwMoveFnCollection const & fnSectionStart
SwMoveFnCollection const & fnMoveBackward
SwTableNode * FindTableNode()
Search table node, in which it is.
void InvalidateAccessibleParaTextSelection()
invalidate text selection for paragraphs
static bool GetBoundsOfHiddenRange(const SwTextNode &rNode, sal_Int32 nPos, sal_Int32 &rnStartPos, sal_Int32 &rnEndPos, std::vector< sal_Int32 > *pList=nullptr)
Hidden text range information - static and non-version.
static bool IsIgnoreProtectedArea()
sal_uLong FindAttrs(const SfxItemSet &rSet, bool bNoCollections, SwDocPositions eStart, SwDocPositions eEnd, bool &bCancel, FindRanges eRng, const i18nutil::SearchOptions2 *pSearchOpt, const SfxItemSet *rReplSet)
ScXMLEditAttributeMap::Entry const aEntries[]
SAL_DLLPRIVATE void ParkPams(SwPaM *pDelRg, SwShellCursor **ppDelRing)
SwSPExtendRange nExtendRange
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!!!).
#define SAL_WARN(area, stream)
make visible in spite of Readonly
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame...
Ends a section of nodes in the document model.
bool IsFlySelectedByCursor(SwDoc const &rDoc, SwPosition const &rStart, SwPosition const &rEnd)
check at-char and at-para flys in rDoc
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
static bool lcl_CheckHiddenSection(SwNodeIndex &rIdx)
bool Pop(PopMode)
delete cursor
bool HasVisibleNumberingOrBullet() const
Returns if the paragraph has a visible numbering or bullet.
std::map< OUString, OUString > aParameters
SwRect m_aCharRect
Char-SRectangle on which the cursor is located.
tools::Long m_nLeftFramePos
const SwIndexReg * GetIdxReg() const
bool IsOver(const SwRect &rRect) const
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
SelectionType GetSelectionType() const
sal_uLong FindFormat(const SwTextFormatColl &rFormatColl, SwDocPositions nStart, SwDocPositions nEnd, bool &bCancel, FindRanges, const SwTextFormatColl *pReplFormat, SwRootFrame const *const pLayout=nullptr)
search for Format-Collections
bool IsInHeaderFooter(bool *pbInHeader=nullptr) const
bool IsSelOnePara() const
SwRootFrame * GetLayout() const
void swapContent(SwSelPaintRects &rSwap)
void RefreshBlockCursor()
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 HasReadOnlyBoxSel() const
void Height(tools::Long nNew)
tools::Long GetRight() const
SwCursorShell(SwDoc &rDoc, vcl::Window *pWin, const SwViewOption *pOpt)
default constructor
SwNode * FindPrvNxtFrameNode(SwNodeIndex &rFrameIdx, const SwNode *pEnd) const
Search previous / next content node or table node with frames.
SwContentNode * GoNext(SwNodeIndex *) const
bool sw_PosOk(const SwPosition &aPos)
Checks if a position is valid.
Access to the block cursor.
bool IsFooterFrame() const
const sal_Int32 COMPLETE_STRING
bool(* SwWhichSection)(SwPaM &, SwMoveFnCollection const &)
void SetReadOnlyAvailable(bool bFlag)
is the cursor allowed to enter ReadOnly sections?
virtual ~SwCursorShell() override
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_OBJECTDYING(RES_MSG_BEGIN)
static void notifyOtherView(const SfxViewShell *pThisView, SfxViewShell const *pOtherView, int nType, std::string_view rKey, const OString &rPayload)
bool SetVisibleCursor(const Point &rPt)
Move visible cursor to given position in document.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
bool SetInFrontOfLabel(bool bNew)
bool IsHeaderFrame() const
bool IsInHeadline(const SwFrame &rFrame) const
void EndAction(const bool bIdleEnd=false)
bool IsInFrontOfLabel() const
bool IsProtected() const
Is the Frame or rather the Section in which it lies protected?
SwTabFrame * FindTabFrame()
Base class of the Writer document model elements.
bool CursorInsideInputField() const