20#include <config_wasm_strip.h>
22#include <com/sun/star/text/XTextRange.hpp>
63#include <LibreOfficeKit/LibreOfficeKitEnums.h>
90 auto [pStt, pEnd] = pCurrentCursor->
StartEnd();
92 SwPaM *pTmpDel =
nullptr,
93 *pTmp = pCurrentCursor->
GetNext();
96 while( pTmp != pCurrentCursor )
98 auto [pTmpStt, pTmpEnd] = pTmp->
StartEnd();
99 if( *pStt <= *pTmpStt )
101 if( *pEnd > *pTmpStt ||
102 ( *pEnd == *pTmpStt && *pEnd == *pTmpEnd ))
106 if( *pStt < *pTmpEnd )
249 if( bIdleEnd &&
Imp()->HasPaintRegion() )
304 OSL_ENSURE(
m_nCursorMove < USHRT_MAX,
"Too many nested CursorMoves." );
313 OSL_ENSURE(
m_nCursorMove,
"EndCursorMove() without SttCursorMove()." );
324 bool bVisualAllowed )
369 bRet = pShellCursor->
LeftRight( bLeft, nCnt, nMode, bVisualAllowed,
373 if ( !bRet && bLeft && bResetOfInFrontOfLabel )
389 const int nListLevel )
404 if ( !sListId.isEmpty() )
405 mxDoc->MarkListLevel( sListId, nListLevel,
true );
443#ifdef ACCESSIBLE_LAYOUT
444 if(
Imp()->IsAccessible() )
445 Imp()->FirePageChangeEvent( nOldPage, nNewPage );
454#ifdef ACCESSIBLE_LAYOUT
455 if(
Imp()->IsAccessible() )
456 Imp()->FireColumnChangeEvent( nOldColumn, nNewColumn);
465#ifdef ACCESSIBLE_LAYOUT
466 if(
Imp()->IsAccessible() )
467 Imp()->FireSectionChangeEvent( nOldSection, nNewSection );
478 if (pCurrFrame ==
nullptr)
485 while(pCurrCol==
nullptr && pCurrFrame!=
nullptr )
490 pCurrCol=
static_cast<SwFrame*
>(pParent)->FindColFrame();
491 pCurrFrame = pParent;
516 bool bRet = pTmpCursor->
UpDown( bUp, nCnt );
530 eUpdateMode =
static_cast<CursorFlag>(eUpdateMode
532 UpdateCursor( o3tl::narrowing<sal_uInt16>(eUpdateMode) );
584 bool bRet = pTmpCursor->
SttEndDoc( bStt );
822::std::optional<::std::pair<SwNode const*, ::std::vector<SwTableNode*>>>
850 if (!(aStart == *pShellCursor->
Start() && aEnd == *pShellCursor->
End()))
855 auto const ends(::EndsWith(*pStartNode));
862 ::std::vector<SwTableNode*> tablesAtEnd;
872 pLastNode = rNodes[pNode->
GetIndex() - 1];
876 pLastNode = rNodes[pLastNode->
GetIndex() - 1];
879 assert(!tablesAtEnd.empty());
892 return ::std::make_pair(rNodes[pStartNode->
GetIndex() + 1], tablesAtEnd);
932 std::pair<Point, bool> tmp(rPt,
false);
949 std::pair<Point, bool> tmp(pShellCursor->
GetPtPos(),
false);
962 std::pair<Point, bool> tmp(pShellCursor->
GetPtPos(),
false);
986 bool bRet = pTmpCursor->
MovePara( fnWhichPara, fnPosPara );
997 if (!pTmpCursor->
MovePara(fnWhichPara, fnPosPara))
1011 bool bRet = pTmpCursor->
MoveSection( fnWhichSect, fnPosSect );
1026 std::pair<Point, bool> tmp(rPt,
false);
1030 pFrame = pContentFrame ? pContentFrame->
GetUpper() :
nullptr;
1042 if( pFrame && pbInHeader )
1044 return nullptr != pFrame;
1102 if( aPos == *pCursor->
GetPoint() &&
1103 bOldInFrontOfLabel == bNewInFrontOfLabel )
1140 rCurrentCursorPt = aPt;
1144 if ( bNewInFrontOfLabel || bOldInFrontOfLabel )
1151 bRet &= ~CRSR_POSOLD;
1163 bRet &= ~CRSR_POSOLD;
1172 if(
GetDoc()->GetDocShell() )
1230 std::vector<SwPaM*> vCursors;
1233 vCursors.push_back(&rCursor);
1234 for(
auto pCursor : vCursors)
1294 if ( !
GetLayout()->GetModelPositionForViewPoint( &aPtPos, aPt, &aTmpState ) && bTstHit )
1301 if (pCmp->
HasMark() && *pCmp->
Start() <= aPtPos && *pCmp->
End() > aPtPos)
1343 const SwPosition *pFirst =
nullptr, *pSecond =
nullptr;
1348 pFirst = pStack->GetMark();
1351 if( !pFirst || !pSecond )
1353 else if( *pFirst < *pSecond )
1355 else if( *pFirst == *pSecond )
1433 "text node expected");
1451 aRet = rDocPos - pCurrentPage->getFrameArea().TopLeft();
1475void collectUIInformation(
const OUString& aPage)
1478 aDescription.
aAction =
"GOTO";
1480 aDescription.
aID =
"writer_edit";
1481 aDescription.
aKeyWord =
"SwEditWinUIObject";
1482 aDescription.
aParent =
"MainWindow";
1499 collectUIInformation(OUString::number(nPage));
1510 bool bAtCursorPos,
const bool bCalcFrame )
1517 if( !bAtCursorPos ||
nullptr == (pCFrame =
GetCurrFrame( bCalcFrame )) ||
1536 if (pCFrame ==
nullptr ||
nullptr == (pPg = pCFrame->
FindPageFrame()))
1543 sal_uInt16 nPageNo = 0;
1602 OUStringBuffer
aBuf;
1605 aBuf.append(OUString::number(pFrame->getFrameArea().Left())
1607 + OUString::number(pFrame->getFrameArea().Top())
1609 + OUString::number(pFrame->getFrameArea().Width())
1611 + OUString::number(pFrame->getFrameArea().Height())
1614 if (!
aBuf.isEmpty())
1615 aBuf.setLength(
aBuf.getLength() - 2);
1616 return aBuf.makeStringAndClear();
1622 if (pView->GetTextEditObject())
1625 EditView& rEditView = pView->GetTextEditOutlinerView()->GetEditView();
1633 if (
OutlinerView* pOutlinerView = pView->GetTextEditOutlinerView())
1635 OString sRect = pOutlinerView->GetOutputArea().toString();
1652 pView->AdjustMarkHdl(pOtherShell);
1738 pCurrentCursor->
Show(
nullptr);
1750 bVis = !pPostItMgr->HasActiveSidebarWin();
1827 bOk = pFrameNd !=
nullptr;
1828 SAL_WARN_IF(!bOk,
"sw.core",
"found no Node with Frames");
1829 rPos.
Assign( *(bOk ? pFrameNd : pSectNd) );
1849 rPos.
Assign( *pTextNd, 0 );
1852#if !ENABLE_WASM_STRIP_ACCESSIBILITY
1857class SwNotifyAccAboutInvalidTextSelections
1863 explicit SwNotifyAccAboutInvalidTextSelections(
SwCursorShell& _rCursorSh )
1864 : mrCursorSh( _rCursorSh )
1867 ~SwNotifyAccAboutInvalidTextSelections() COVERITY_NOEXCEPT_FALSE
1888#if !ENABLE_WASM_STRIP_ACCESSIBILITY
1889 SwNotifyAccAboutInvalidTextSelections aInvalidateTextSelections( *
this );
1929 std::pair<Point, bool>
const tmp(aTmpPt,
false);
1931 getLayoutFrame(
GetLayout(), pPos, &tmp);
1933 OSL_ENSURE( pTableFrame,
"Table Cursor not in Content ??" );
1942 bool bInRepeatedHeadline = pTab->IsFollow() && pTab->
IsInHeadline( *pTableFrame );
1945 if ( !bInRepeatedHeadline )
1947 std::pair<Point, bool>
const tmp1(aTmpMk,
false);
1950 OSL_ENSURE( pMarkTableFrame,
"Table Cursor not in Content ??" );
1952 if ( pMarkTableFrame )
1955 OSL_ENSURE( pMarkTab,
"Table Cursor not in Content ??" );
1960 bInRepeatedHeadline = pMarkTab->IsFollow() && pMarkTab->
IsInHeadline( *pMarkTableFrame );
1966 if ( bInRepeatedHeadline )
1968 pTableFrame =
nullptr;
1990 if( pTab && pTableFrame )
2004 "this should not happen, but better lose the selection "
2005 "rather than crashing");
2019 bool const bResult =
2021 OSL_ENSURE( bResult,
"GetCharRect failed." );
2031 SwFrame* pBoxFrame = pTableFrame;
2058#if !ENABLE_WASM_STRIP_ACCESSIBILITY
2083 bool bChgState =
true;
2088 ( !
mxDoc->GetDocShell() ||
2092 0 ==
Imp()->
GetDrawView()->GetMarkedObjectList().GetMarkCount()))
2102 if(
GetDoc()->GetDocShell() )
2115 if( bWasAllProtect &&
GetDoc()->GetDocShell() &&
2116 GetDoc()->GetDocShell()->IsReadOnlyUI() )
2134 bool bPointIsStart = ( rCmp.Start() == rCmp.GetPoint() );
2137 if( ! rCmp.GetPoint()->GetNode().IsContentNode() )
2142 if( rCmp.HasMark() )
2144 if( ! rCmp.GetMark()->GetNode().IsContentNode() )
2164 std::pair<Point, bool>
const tmp1(pShellCursor->
GetPtPos(),
false);
2174 std::pair<Point, bool>
const tmp(pShellCursor->
GetPtPos(),
false);
2179 else if (
Imp()->IsIdleAction() )
2187 (!
mxDoc->GetDocShell() ||
2191 bool bChgState =
true;
2193 0 ==
Imp()->
GetDrawView()->GetMarkedObjectList().GetMarkCount()))
2202 if(
GetDoc()->GetDocShell() )
2215 if( bWasAllProtect &&
GetDoc()->GetDocShell() &&
2216 GetDoc()->GetDocShell()->IsReadOnlyUI() )
2225 }
while( bAgainst );
2252 if( !pShellCursor->
HasMark() )
2269 OSL_ENSURE(
false,
"endless loop? CharRect != OldCharRect ");
2323 pNxt->SwSelPaintRects::Show();
2332#if !ENABLE_WASM_STRIP_ACCESSIBILITY
2339 GetCursorBlinkTime();
2382 auto columnsNode = aJsonWriter.
startNode(
"columns");
2386 const int nColumnOffset = aTabCols.
GetLeftMin() + rPageRect.
Left();
2390 aJsonWriter.
put(
"tableOffset",
static_cast<sal_Int64
>(nColumnOffset));
2393 auto entriesNode = aJsonWriter.
startArray(
"entries");
2394 for (
size_t i = 0;
i < aTabCols.
Count(); ++
i)
2397 auto const & rEntry = aTabCols.
GetEntry(
i);
2398 aJsonWriter.
put(
"position", rEntry.nPos);
2399 aJsonWriter.
put(
"min", rEntry.nMin);
2400 aJsonWriter.
put(
"max", rEntry.nMax);
2401 aJsonWriter.
put(
"hidden", rEntry.bHidden);
2407 auto rowsNode = aJsonWriter.
startNode(
"rows");
2411 const int nRowOffset = aTabRows.
GetLeftMin() + rPageRect.
Top();
2415 aJsonWriter.
put(
"tableOffset",
static_cast<sal_Int64
>(nRowOffset));
2418 auto entriesNode = aJsonWriter.
startArray(
"entries");
2419 for (
size_t i = 0;
i < aTabRows.
Count(); ++
i)
2422 auto const & rEntry = aTabRows.
GetEntry(
i);
2423 aJsonWriter.
put(
"position", rEntry.nPos);
2424 aJsonWriter.
put(
"min", rEntry.nMin);
2425 aJsonWriter.
put(
"max", rEntry.nMax);
2426 aJsonWriter.
put(
"hidden", rEntry.bHidden);
2441 std::pair<Point, bool>
const tmp(aPt,
false);
2462 SwRect aRect( aMk, aPt );
2466 if( !
GetLayout()->FillSelection( aSelList, aRect ) )
2476 std::list<SwPaM*>::iterator pStart = aSelList.
getStart();
2477 std::list<SwPaM*>::iterator pPam = aSelList.
getEnd();
2478 OSL_ENSURE( pPam != pStart,
"FillSelection should deliver at least one PaM" );
2483 if( pPam == pStart )
2486 if( (*pPam)->HasMark() )
2502 if( (*pPam)->HasMark() )
2508 while( pPam != pStart )
2518 if( (*pPam)->HasMark() )
2534 pPam = aSelList.
getEnd();
2537 if( (*pPam)->HasMark() )
2574 std::optional<SwCallLink> aLink(std::in_place, *
this);
2575 return Pop(eDelete, aLink);
2579 [[maybe_unused]] std::optional<SwCallLink>& roLink)
2607 const Point& rPoint = pOldStack->GetPtPos();
2615 if( pOldStack->HasMark() )
2694 pCurrentCursor->
Hide();
2704 pCurrentCursor->
Show(
nullptr);
2811 if (rHint.
GetId() != SfxHintId::SwLegacyModify)
2891 nStart, nEnd - nStart,
false,
false,
false,
2896 aText = buf.makeStringAndClear();
2930 const OUString& rStr = pTextNd->
GetText();
2933 if (((
nPos+nOffset) >= 0 ) && (
nPos+nOffset) < rStr.getLength())
2934 cCh = rStr[
nPos + nOffset];
3003 std::pair<Point, bool>
const tmp(aPt,
true);
3005 if (
Imp()->IsIdleAction() )
3062 if( bAll || ( pTmp->
HasMark() &&
3119 auto [pStt, pEnd] = pDelRg->
StartEnd();
3121 SwPaM *pTmpDel =
nullptr, *pTmp = *ppDelRing;
3130 auto [pTmpStt, pTmpEnd] = pTmp->
StartEnd();
3133 if( *pStt <= *pTmpStt )
3135 if( *pEnd > *pTmpStt ||
3136 ( *pEnd == *pTmpStt && *pEnd == *pTmpEnd ))
3140 if( *pStt < *pTmpEnd )
3146 bool bDelete =
true;
3147 if( *ppDelRing == pTmpDel )
3164 if (pTmp == pTmpDel)
3175 if( bGoNext && pTmp )
3178 }
while( !bGoNext || *ppDelRing != pTmp );
3190 const SwNode *pNode = &rIdx;
3219 if (pSh->m_pStackCursor)
3220 pSh->ParkPams(&aNew, &pSh->m_pStackCursor);
3222 pSh->ParkPams( &aNew, &pSh->m_pCurrentCursor );
3223 if( pSh->m_pTableCursor )
3227 SwPaM* pTCursor = pSh->GetTableCrs();
3233 pSh->m_pCurrentCursor->GetPoint()->Assign( *pTableNd );
3247 ,
sw::BroadcastingModify()
3248 , m_pStackCursor( nullptr )
3249 , m_pBlockCursor( nullptr )
3250 , m_pTableCursor( nullptr )
3251 , m_pBoxIdx( nullptr )
3252 , m_pBoxPtr( nullptr )
3254 , m_nLeftFramePos(0)
3256 , m_nCurrentContent(0)
3258 , m_nCursorMove( 0 )
3260 , m_eEnhancedTableSel(
SwTable::SEARCH_NONE)
3261 , m_nMarkedListLevel( 0 )
3262 , m_oldColFrame(nullptr)
3284 ,
sw::BroadcastingModify()
3285 , m_pStackCursor( nullptr )
3286 , m_pBlockCursor( nullptr )
3287 , m_pTableCursor( nullptr )
3288 , m_pBoxIdx( nullptr )
3289 , m_pBoxPtr( nullptr )
3291 , m_nLeftFramePos(0)
3293 , m_nCurrentContent(0)
3295 , m_nCursorMove( 0 )
3297 , m_eEnhancedTableSel(
SwTable::SEARCH_NONE)
3298 , m_nMarkedListLevel( 0 )
3299 , m_oldColFrame(nullptr)
3394 OSL_ENSURE(
m_bHasFocus,
"no focus but cursor should be made visible?" );
3432 assert(!
"Did not remove table selection!");
3438 GetDoc()->GetDocShell()->IsReadOnlyUI() )
3461 bool bFirst =
false;
3478 rNdPos.
Assign(
mxDoc->GetNodes().GetEndOfExtras() );
3479 mxDoc->GetNodes().GoNext( &rNdPos );
3524 bool bGoNextSection =
true;
3525 for(
int nLoopCnt = 0; !bOk && nLoopCnt < 2; ++nLoopCnt )
3538 if ( pCNd ==
nullptr)
break;
3569 if (
nullptr == pFrame ||
3578 }
while( bContinue );
3583 bGoNextSection =
false;
3591 const sal_Int32 nContent = rNdPos.
GetNodeIndex() < nNdIdx ? pCNd->
Len() : 0;
3618 if( pFrame && pFrame->
IsInFly() &&
3619 (pFly = pFrame->
FindFlyFrame())->GetFormat()->GetEditInReadonly().GetValue() &&
3622 !
GetDrawView()->GetMarkedObjectList().GetMarkCount() )
3627 else if ( pFrame && pFrame->
IsInSct() &&
3647 if( (!
GetDoc()->GetDocShell() ||
3688 if (rCursor.HasReadonlySel(
GetViewOptions()->IsFormView(), isReplace))
3720 if (rCursor.HasHiddenSections())
3741 std::swap( nStt, nEnd );
3743 bRet = pCNd && !nStt && nEnd == pCNd->
Len();
3760 return mxDoc->GetTextDirection( aPos, &aPt );
3766 return SvxFrameDirection::Vertical_RL_TB == nDir || SvxFrameDirection::Vertical_LR_TB == nDir
3767 || nDir == SvxFrameDirection::Vertical_LR_BT;
3775 return SvxFrameDirection::Vertical_LR_TB == nDir || SvxFrameDirection::Horizontal_RL_TB == nDir;
3792 sal_Int32 nHiddenStart;
3793 sal_Int32 nHiddenEnd;
3812 bool bSearchInNotes,
3825 if( nRet || bCancel )
3849 bool bNoCollections,
3862 bCancel, eRng, pSearchOpt, rReplSet,
GetLayout());
3873 if(rCursor.
GetNext() != &rCursor)
3885 }
while( (_pStartCursor = _pStartCursor->
GetNext()) != &rCursor );
3939 bool bChanged =
false;
3943 while (pCursor != pStartCursor)
3945 pTmpCursor = pCursor->
GetNext();
3951 pCursor = pTmpCursor;
3967 SwPaM aTmpPam(*pNode);
3968 *pStartCursor = aTmpPam;
3980 pNode = aNodes.
GoNext( &aIdx );
3987 pNode = aNodes.
GoNext( &aIdx );
3990 bool bFound = (pNode !=
nullptr);
3996 SwPaM aTmpPam(*pNode);
3997 *pStartCursor = aTmpPam;
4014 aResult +=
SwResId(STR_MULTISEL);
4023 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwCursorShell"));
4027 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"m_pCurrentCursor"));
4029 rPaM.dumpAsXml(pWriter);
4030 (void)xmlTextWriterEndElement(pWriter);
4032 (void)xmlTextWriterEndElement(pWriter);
4036 uno::Sequence< uno::Reference< container::XStringKeyMap > >& rStringKeyMaps,
4037 const SwWrongList& rSmartTagList, sal_Int32 nCurrent )
4040 std::vector< uno::Reference< container::XStringKeyMap > > aStringKeyMaps;
4042 for ( sal_uInt16
i = 0;
i < rSmartTagList.
Count(); ++
i )
4044 const sal_Int32 nSTPos = rSmartTagList.
Pos(
i );
4045 const sal_Int32 nSTLen = rSmartTagList.
Len(
i );
4047 if ( nSTPos <= nCurrent && nCurrent < nSTPos + nSTLen )
4052 rSmartTagTypes.push_back( pArea->
maType );
4058 if ( !rSmartTagTypes.empty() )
4065 SwTextNode& rNode, sal_Int32 nBegin, sal_Int32 nLen )
4079 uno::Sequence< uno::Reference< container::XStringKeyMap > >& rStringKeyMaps,
4080 uno::Reference< text::XTextRange>& rRange )
const
4092 if ( !pSmartTagList )
4096 sal_Int32 nBegin = nCurrent;
4106 pSmartTagList = pSubList;
4126 if( !
GetLayout()->GetModelPositionForViewPoint( &aPos, aPt, &eTmpState ) )
4132 if( !pSmartTagList )
4144 OUString aText( pNode->
GetText().copy(nBegin, nLen) );
4159 sal_Int32 nLeft = 0;
4162 pChar = aText.getLength() ? aText.getStr() + aText.getLength() - 1 :
nullptr;
4163 sal_Int32 nRight = 0;
4173 const sal_Int32 nWordStart = (nBegin + nLeft) < nLineStart ? nLineStart : nBegin + nLeft;
4176 const sal_Int32 nWordEnd =
std::min(nBegin + nLen - nLeft - nRight, nLineEnd);
4185 std::pair<Point, bool>
const tmp(rPt,
false);
4193 rSelectRect = aStartRect.
Union( aEndRect );
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...
const StyleSettings & GetStyleSettings() const
void SetStyleSettings(const StyleSettings &rSet)
static const AllSettings & GetSettings()
helper class to disable creation of an action by a callback event in particular, change event from a ...
void DrawSelectionXOR(OutlinerViewShell *pOtherShell)
void RegisterOtherShell(OutlinerViewShell *pOtherShell)
void ShowCursor(bool bGotoCursor=true, bool bForceVisCursor=true, bool bActivate=false)
virtual const SwRootFrame * GetCurrentLayout() const =0
virtual void NotifyCursorUpdate(const SwCursorShell &rCursorShell)=0
virtual void SetSettings(const AllSettings &rSettings)
const AllSettings & GetSettings() const
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long getX() const
constexpr tools::Long getY() const
static void notifyOtherView(const SfxViewShell *pThisView, SfxViewShell const *pOtherView, int nType, std::string_view rKey, const OString &rPayload)
static void notifyOtherViews(const SfxViewShell *pThisView, int nType, std::string_view rKey, const OString &rPayload)
void SetReadOnlyUI(bool bReadOnly=true)
virtual void libreOfficeKitViewCallback(int nType, const OString &pPayload) const override
void SetCursorBlinkTime(sal_uInt64 nBlinkTime)
sal_uInt64 GetCursorBlinkTime() const
static void SetSearchLabel(const SearchLabel &rSL)
Access to the block cursor.
SwShellCursor & getShellCursor()
Access to the shell cursor.
std::optional< Point > const & getStartPoint() const
The document coordinates where the block selection has been started.
void clearPoints()
Deletion of the mouse created rectangle.
void setEndPoint(const Point &rPt)
Defines the ending vertex of the block selection.
std::optional< Point > const & getEndPoint() const
The document coordinates where the block selection ends (at the moment)
void setStartPoint(const Point &rPt)
Defines the starting vertex of the block selection.
static tools::Long getLayoutFrame(const SwRootFrame *, SwTextNode const &rNd, sal_Int32 nCntPos, bool bCalcFrame)
tools::Long m_nLeftFramePos
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
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).
tools::Long m_nLeftFramePos
void ExtendedSelectAll(bool bFootnotes=true)
bool Pop(PopMode, ::std::optional< SwCallLink > &roLink)
SAL_DLLPRIVATE void UpdateCursor(sal_uInt16 eFlags=SwCursorShell::SCROLLWIN|SwCursorShell::CHKRANGE, bool bIdleEnd=false)
tools::Long GetUpDownX() const
SwVisibleCursor * GetVisibleCursor() const
static void FireSectionChangeEvent(sal_uInt16 nOldSection, sal_uInt16 nNewSection)
SAL_DLLPRIVATE void MarkListLevel(const OUString &sListId, const int nLevel)
Mark a certain list level of a certain list.
bool m_bSetCursorInReadOnly
OUString GetCursorDescr() const
Returns textual description of the current selection.
void Push()
store a copy of the current cursor on the cursor stack
SAL_DLLPRIVATE void ParkPams(SwPaM *pDelRg, SwShellCursor **ppDelRing)
void ShowCursors(bool bCursorVis)
bool IsSelOnePara() const
bool IsReadOnlyAvailable() const
void ClearTableBoxContent()
const SwTableNode * IsCursorInTable() const
Check if Point of current cursor is placed within a table.
bool TrySelectOuterTable()
bool m_bInCMvVisportChgd
Flag for CursorMoves.
friend class SwVisibleCursor
bool IsEndOfTable() const
at the very last SwPosition inside a table
sal_uInt16 GetNextPrevPageNum(bool bNext=true)
bool IsInVerticalText(const Point *pPt=nullptr) const
bool GoPrevCursor()
go to the previous SSelection
bool m_bSendAccessibleCursorEvents
void BlockCursorToCursor()
SwShellCursor * GetCursor_()
static void FirePageChangeEvent(sal_uInt16 nOldPage, sal_uInt16 nNewPage)
sal_uInt16 GetCursorCnt(bool bAll=true) const
Get the number of elements in the ring of cursors.
bool IsMacroExecAllowed() const
Point & GetCursorDocPos() const
void ParkCursor(const SwNode &rIdx)
Remove selections and additional cursors of all shells.
Point m_aOldRBPos
Right/Bottom of last VisArea.
virtual SwCursor & CreateNewShellCursor() override
Create and return a new shell cursor.
StartsWith StartsWith_()
If document body starts with a table or starts/ends with hidden paragraph.
bool IsInHiddenRange(const bool bSelect)
If the current cursor position is inside a hidden range true is returned.
static void FireColumnChangeEvent(sal_uInt16 nOldColumn, sal_uInt16 nNewColumn)
tools::Long m_nUpDownX
try to move the cursor on up/down always in the same column
bool m_bChgCallFlag
attribute change inside Start- and EndAction
void SetSelection(const SwPaM &rCursor)
int SetCursor(const Point &rPt, bool bOnlyText=false, bool bBlock=true)
bool HasSelection() const
Does the current cursor create a selection?
bool IsMultiSelection() const
CursorMoveState m_eMvState
Status for Cursor-Travelling - GetModelPositionForViewPoint.
bool SttEndDoc(bool bStt)
Point m_aCursorHeight
height & offset from visible Cursor
void SetReadOnlyAvailable(bool bFlag)
is the cursor allowed to enter ReadOnly sections?
virtual SwCursor & GetCurrentShellCursor() override
Return the current shell cursor.
void NormalizePam(bool bPointFirst=true)
Ensure point and mark of the current PaM are in a specific order.
SwBlockCursor * m_pBlockCursor
interface of cursor for block (=rectangular) selection
bool MovePara(SwWhichPara, SwMoveFnCollection const &)
bool m_bAllProtect
Flag for areas.
bool IsCursorReadonly() const
bool RightMargin(bool bAPI=false)
int CompareCursorStackMkCurrPt() 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 ParkTableCursor()
Invalidate cursors.
void GetSmartTagRect(const Point &rPt, SwRect &rSelectRect)
bool GotoPage(sal_uInt16 nPage)
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
OUString GetSelText() const
get selected text of a node at current cursor
void TableCursorToCursor()
enter block mode, change normal cursor into block cursor
bool ExtendSelection(bool bEnd=true, sal_Int32 nCount=1)
extend current SSelection by n characters
void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
bool m_bCallChgLnk
flag for derived classes
bool IsOverReadOnlyPos(const Point &rPt) const
bool ShouldWait() const
Should WaitPtr be switched on for the clipboard?
bool GoNextCursor()
go to the next SSelection
void CursorToBlockCursor()
leave block mode, change block cursor into normal cursor
bool LeftRight(bool, sal_uInt16, SwCursorSkipMode, bool)
bool CursorInsideInputField() const
void Combine()
Combine two cursors.
bool CheckTableBoxContent(const SwPosition *pPos=nullptr)
SwPaM * CreateCursor()
delete the current cursor and make the following into the current
bool SetVisibleCursor(const Point &rPt)
Move visible cursor to given position in document.
void GetPageNum(sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum, bool bAtCursorPos=true, const bool bCalcFrame=true)
SAL_DLLPRIVATE bool IsAtLRMargin(bool, bool bAPI=false) const
bool IsSelFullPara() const
SAL_DLLPRIVATE SvxFrameDirection GetTextDirection(const Point *pPt=nullptr) const
bool IsStartOfDoc() const
void EndAction(const bool bIdleEnd=false)
SwCursorShell(SwDoc &rDoc, vcl::Window *pWin, const SwViewOption *pOpt)
default constructor
Point GetCursorPagePos() const
virtual ~SwCursorShell() override
SAL_DLLPRIVATE bool UpDown(bool, sal_uInt16)
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
forward all attribute/format changes at the current node to the Link
sal_Int32 FindFormat(const SwTextFormatColl &rFormatColl, SwDocPositions eStart, SwDocPositions eEnd, bool &bCancel, FindRanges eRng, const SwTextFormatColl *pReplFormat)
bool TestCurrPam(const Point &rPt, bool bTstHit=false)
Search in the selected area for a Selection that covers the given point.
bool MovePage(SwWhichPage, SwPosPage)
bool Right(sal_uInt16 nCnt, SwCursorSkipMode nMode, bool bAllowVisual=false)
SwContentFrame * GetCurrFrame(const bool bCalcFrame=true) const
Get current frame in which the cursor is positioned.
SwVisibleCursor * m_pVisibleCursor
the visible cursor
SwShellCursor * m_pStackCursor
stack for the cursor
SAL_DLLPRIVATE bool LRMargin(bool, bool bAPI=false)
virtual void VisPortChgd(const SwRect &) override
sal_Int32 Find_Text(const i18nutil::SearchOptions2 &rSearchOpt, bool bSearchInNotes, SwDocPositions eStart, SwDocPositions eEnd, bool &bCancel, FindRanges eRng, bool bReplace=false)
virtual void MakeSelVisible()
show the current selected "object"
SAL_DLLPRIVATE bool isInHiddenTextFrame(SwShellCursor *pShellCursor)
bool IsInRightToLeftText() const
bool SetInFrontOfLabel(bool bNew)
Link< SwCursorShell &, void > m_aGrfArrivedLnk
Link calls to UI if a graphic is arrived.
SwNodeType m_nCurrentNdTyp
sal_Int32 FindAttrs(const SfxItemSet &rSet, bool bNoCollections, SwDocPositions eStart, SwDocPositions eEnd, bool &bCancel, FindRanges eRng, const i18nutil::SearchOptions2 *pSearchOpt, const SfxItemSet *rReplSet)
bool IsOverwriteCursor() const
bool m_bSVCursorVis
SV-Cursor visible/invisible.
SwShellCursor * getShellCursor(bool bBlock)
Delivers the current shell cursor.
void DestroyCursor()
transform TableCursor to normal cursor, nullify Tablemode
OUString m_sMarkedListId
table rows or columns selected by not cell by cell
bool MoveSection(SwWhichSection, SwMoveFnCollection const &)
SwRect m_aCharRect
Char-SRectangle on which the cursor is located.
SAL_DLLPRIVATE void UpdateMarkedListLevel()
Updates the marked list level according to the cursor.
SwShellTableCursor * m_pTableCursor
table Cursor; only in tables when the selection lays over 2 columns
CursorFlag
for calling UpdateCursor
@ READONLY
make visible in spite of Readonly
@ CHKRANGE
check overlapping PaMs
@ UPDOWN
keep Up/Down on columns
void GetCharRectAt(SwRect &rRect, const SwPosition *pPos)
void RefreshBlockCursor()
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
SwNodeOffset m_nCurrentNode
sal_uInt16 GetPageNumSeqNonEmpty()
Link< LinkParamNone *, void > m_aChgLnk
link will be called by every attribute/ format changes at cursor position.
void GoNextPrevCursorSetSearchLabel(const bool bNext)
bool m_bHasFocus
Shell is "active" in a window.
bool HasReadonlySel(bool isReplace=false) const
SwShellCursor * m_pCurrentCursor
current cursor
bool IsInHeaderFooter(bool *pbInHeader=nullptr) const
size_t UpdateTableSelBoxes()
void UpdateCursorPos()
Set the cursor back into content.
SAL_DLLPRIVATE void sendLOKCursorUpdates()
bool IsInFrontOfLabel() const
bool IsCursorInFootnote() const
void EndCursorMove(const bool bIdleEnd=false)
sal_Int32 m_nCurrentContent
bool GoNextCell(bool bAppendLine=true)
set cursor into next/previous cell
bool HasHiddenSections() const
sal_Unicode GetChar(bool bEnd=true, tools::Long nOffset=0)
get the nth character of the current SSelection
OUString getPageRectangles()
Implementation of lok::Document::getPartPageRectangles() for Writer.
::std::optional<::std::pair< SwNode const *, ::std::vector< SwTableNode * > > > ExtendedSelectedAll() const
If ExtendedSelectAll() was called and selection didn't change since then.
bool FindValidContentNode(bool bOnlyText)
search a valid content position (not protected/hidden)
void NotifyCursor(SfxViewShell *pViewShell) const
See SwView::NotifyCursor().
bool m_bVisPortChgd
in VisPortChg-Call
bool MoveSection(SwWhichSection, SwMoveFnCollection const &)
bool IsNoContent() const
determine if point is outside of the node-array's content area
sal_uInt8 GetCursorBidiLevel() const
bool LeftRightMargin(SwRootFrame const &rLayout, bool bLeftMargin, bool bAPI)
virtual bool IsSelOvr(SwCursorSelOverFlags eFlags=SwCursorSelOverFlags::CheckNodeSection|SwCursorSelOverFlags::Toggle|SwCursorSelOverFlags::ChangePos)
sal_Int32 FindAttrs(const SfxItemSet &rSet, bool bNoCollections, SwDocPositions nStart, SwDocPositions nEnd, bool &bCancel, FindRanges, const i18nutil::SearchOptions2 *pSearchOpt, const SfxItemSet *rReplSet=nullptr, SwRootFrame const *const pLayout=nullptr)
search for attributes
sal_Int32 Find_Text(const i18nutil::SearchOptions2 &rSearchOpt, bool bSearchInNotes, SwDocPositions nStart, SwDocPositions nEnd, bool &bCancel, FindRanges, bool bReplace=false, SwRootFrame const *const pLayout=nullptr)
bool IsInProtectTable(bool bMove=false, bool bChgCursor=true)
bool MovePara(SwWhichPara, SwMoveFnCollection const &)
sal_Int32 FindFormat(const SwTextFormatColl &rFormatColl, SwDocPositions nStart, SwDocPositions nEnd, bool &bCancel, FindRanges, const SwTextFormatColl *pReplFormat, SwRootFrame const *const pLayout=nullptr)
search for Format-Collections
bool SttEndDoc(bool bSttDoc)
void SetCursorBidiLevel(sal_uInt8 nNewLevel)
virtual bool LeftRight(bool bLeft, sal_uInt16 nCnt, SwCursorSkipMode nMode, bool bAllowVisual, bool bSkipHidden, bool bInsertCursor, SwRootFrame const *pLayout, bool isFieldNames)
void SetColumnSelection(bool bNew)
bool IsAtLeftRightMargin(SwRootFrame const &rLayout, bool bLeftMargin, bool bAPI) const
SwWrtShell * GetWrtShell()
Access to the SwWrtShell belonging to SwView.
static SwTableNode * IsInTable(const SwNode &)
static OUString GetPaMDescr(const SwPaM &rPaM)
Returns a textual description of a PaM.
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
SwDocShell * GetDocShell()
Ends a section of nodes in the document model.
void GetTabCols(SwTabCols &rToFill) const
Info about columns and margins.
void GetTabRows(SwTabCols &rToFill) const
const SwRect & GetAnyCurRect(CurRectType eType, const Point *pPt=nullptr, const css::uno::Reference< css::embed::XEmbeddedObject > &=css::uno::Reference< css::embed::XEmbeddedObject >()) const
general base class for all free-flowing frames
const SwRect & getFrameArea() const
Base class of the Writer layout elements.
sal_uInt16 GetVirtPageNum() const
SwFlyFrame * FindFlyFrame()
SwSectionFrame * FindSctFrame()
SwTabFrame * FindTabFrame()
bool IsHeaderFrame() const
virtual void Calc(vcl::RenderContext *pRenderContext) const
bool IsProtected() const
Is the Frame or rather the Section in which it lies protected?
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const
bool IsFooterFrame() const
SwLayoutFrame * GetUpper()
bool IsNoTextFrame() const
SwPageFrame * FindPageFrame()
virtual bool GetCharRect(SwRect &, const SwPosition &, SwCursorMoveState *=nullptr, bool bAllowFarAway=true) const
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame.
const SwFrame * Lower() const
Marks a node in the document model.
const SwNodes & GetNodes() const
SwNodeOffset GetIndex() const
Base class of the Writer document model elements.
SwStartNode * GetStartNode()
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...
bool IsNoTextNode() const
SwNodes & GetNodes()
Node is in which nodes-array/doc?
bool IsInProtectSect() const
Is node in a protected area?
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()
SwNodeType GetNodeType() const
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.
SwNode * FindPrvNxtFrameNode(const SwNode &rFrameNd, const SwNode *pEnd, SwRootFrame const *pLayout=nullptr) const
Search previous / next content node or table node with frames.
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
void SetInFrontOfLabel_(bool bNew)
SwNode & GetPointNode() const
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
bool IsInFrontOfLabel() const
void Normalize(bool bPointFirst=true)
Normalizes PaM, i.e.
std::pair< const SwPosition *, const SwPosition * > StartEnd() const
Because sometimes the cost of the operator<= can add up.
bool IsMultiSelection() const
SwContentNode * GetPointContentNode() const
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
const SwPosition * End() const
SwContentNode * GetMarkContentNode() const
SwNode & GetMarkNode() const
bool HasReadonlySel(bool bFormView, bool isReplace) const
Is in something protected (readonly) or selection contains something protected.
const SwPosition * GetPoint() const
bool HasHiddenSections() const
Is there hidden sections in the selected area.
const SwPosition * Start() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
A page of the document layout.
sal_uInt16 GetPhyPageNum() const
Of course Writer needs its own rectangles.
void Height(tools::Long nNew)
SwRect & Union(const SwRect &rRect)
void Top(const tools::Long nTop)
void Pos(const Point &rNew)
bool Contains(const Point &rPOINT) const
void AddHeight(const tools::Long nAdd)
bool Overlaps(const SwRect &rRect) const
void AddWidth(const tools::Long nAdd)
void Left(const tools::Long nLeft)
void Width(tools::Long nNew)
The root element of a Writer document layout.
sal_uInt16 GetPageNum() const
sal_uInt16 SetCurrPage(SwCursor *, sal_uInt16 nPageNum)
Returns a PaM which sits at the beginning of the requested page.
bool MakeTableCursors(SwTableCursor &)
Calculates the cells included from the current selection.
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
Primary passes the call to the first page.
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.
A section node represents the start of a section on the UI, i.e.
const SwSection & GetSection() const
bool IsProtectFlag() const
bool IsHiddenFlag() const
bool IsEditInReadonlyFlag() const
void SetShowContentControlOverlay(const bool bShow)
void swapContent(SwSelPaintRects &rSwap)
void SetShowTextInputFieldOverlay(const bool bShow)
This class is used as parameter for creation of a block cursor selection.
std::list< SwPaM * >::iterator getStart()
Start of the container for the selected text portions.
std::list< SwPaM * >::iterator getEnd()
End of the container for the selected text portions.
Represents the current text cursor of one opened edit window.
bool UpDown(bool bUp, sal_uInt16 nCnt)
void Show(SfxViewShell const *pViewShell)
void Invalidate(const SwRect &rRect)
SwShellCursor * GetNext()
const Point & GetPtPos() const
SwShellCursor * GetPrev()
virtual void SetMark() override
Unless this is called, the getter method of Mark will return Point.
const Point & GetMkPos() const
bool Contains(const Point &rPt) const
static SwSmartTagMgr & Get()
Starts a section of nodes in the document model.
SwStartNodeType GetStartNodeType() const
const SwTabColsEntry & GetEntry(size_t nPos) const
tools::Long GetLeft() const
tools::Long GetLeftMin() const
tools::Long GetRight() const
Definition:<