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 );
849 if (!(aStart == *pShellCursor->
Start() && aEnd == *pShellCursor->
End()))
900 std::pair<Point, bool> tmp(rPt,
false);
917 std::pair<Point, bool> tmp(pShellCursor->
GetPtPos(),
false);
930 std::pair<Point, bool> tmp(pShellCursor->
GetPtPos(),
false);
954 bool bRet = pTmpCursor->
MovePara( fnWhichPara, fnPosPara );
965 if (!pTmpCursor->
MovePara(fnWhichPara, fnPosPara))
979 bool bRet = pTmpCursor->
MoveSection( fnWhichSect, fnPosSect );
994 std::pair<Point, bool> tmp(rPt,
false);
998 pFrame = pContentFrame ? pContentFrame->
GetUpper() :
nullptr;
1010 if( pFrame && pbInHeader )
1012 return nullptr != pFrame;
1070 if( aPos == *pCursor->
GetPoint() &&
1071 bOldInFrontOfLabel == bNewInFrontOfLabel )
1108 rCurrentCursorPt = aPt;
1112 if ( bNewInFrontOfLabel || bOldInFrontOfLabel )
1119 bRet &= ~CRSR_POSOLD;
1131 bRet &= ~CRSR_POSOLD;
1140 if(
GetDoc()->GetDocShell() )
1198 std::vector<SwPaM*> vCursors;
1201 vCursors.push_back(&rCursor);
1202 for(
auto pCursor : vCursors)
1262 if ( !
GetLayout()->GetModelPositionForViewPoint( &aPtPos, aPt, &aTmpState ) && bTstHit )
1269 if (pCmp->
HasMark() && *pCmp->
Start() <= aPtPos && *pCmp->
End() > aPtPos)
1311 const SwPosition *pFirst =
nullptr, *pSecond =
nullptr;
1316 pFirst = pStack->GetMark();
1319 if( !pFirst || !pSecond )
1321 else if( *pFirst < *pSecond )
1323 else if( *pFirst == *pSecond )
1401 "text node expected");
1419 aRet = rDocPos - pCurrentPage->getFrameArea().TopLeft();
1443void collectUIInformation(
const OUString& aPage)
1446 aDescription.
aAction =
"GOTO";
1448 aDescription.
aID =
"writer_edit";
1449 aDescription.
aKeyWord =
"SwEditWinUIObject";
1450 aDescription.
aParent =
"MainWindow";
1467 collectUIInformation(OUString::number(nPage));
1478 bool bAtCursorPos,
const bool bCalcFrame )
1485 if( !bAtCursorPos ||
nullptr == (pCFrame =
GetCurrFrame( bCalcFrame )) ||
1504 if (pCFrame ==
nullptr ||
nullptr == (pPg = pCFrame->
FindPageFrame()))
1511 sal_uInt16 nPageNo = 0;
1570 OUStringBuffer
aBuf;
1573 aBuf.append(OUString::number(pFrame->getFrameArea().Left())
1575 + OUString::number(pFrame->getFrameArea().Top())
1577 + OUString::number(pFrame->getFrameArea().Width())
1579 + OUString::number(pFrame->getFrameArea().Height())
1582 if (!
aBuf.isEmpty())
1583 aBuf.setLength(
aBuf.getLength() - 2);
1584 return aBuf.makeStringAndClear();
1590 if (pView->GetTextEditObject())
1593 EditView& rEditView = pView->GetTextEditOutlinerView()->GetEditView();
1601 if (
OutlinerView* pOutlinerView = pView->GetTextEditOutlinerView())
1603 OString sRect = pOutlinerView->GetOutputArea().toString();
1620 pView->AdjustMarkHdl(pOtherShell);
1706 pCurrentCursor->
Show(
nullptr);
1718 bVis = !pPostItMgr->HasActiveSidebarWin();
1795 bOk = pFrameNd !=
nullptr;
1796 SAL_WARN_IF(!bOk,
"sw.core",
"found no Node with Frames");
1797 rPos.
Assign( *(bOk ? pFrameNd : pSectNd) );
1817 rPos.
Assign( *pTextNd, 0 );
1820#if !ENABLE_WASM_STRIP_ACCESSIBILITY
1825class SwNotifyAccAboutInvalidTextSelections
1831 explicit SwNotifyAccAboutInvalidTextSelections(
SwCursorShell& _rCursorSh )
1832 : mrCursorSh( _rCursorSh )
1835 ~SwNotifyAccAboutInvalidTextSelections() COVERITY_NOEXCEPT_FALSE
1856#if !ENABLE_WASM_STRIP_ACCESSIBILITY
1857 SwNotifyAccAboutInvalidTextSelections aInvalidateTextSelections( *
this );
1897 std::pair<Point, bool>
const tmp(aTmpPt,
false);
1899 getLayoutFrame(
GetLayout(), pPos, &tmp);
1901 OSL_ENSURE( pTableFrame,
"Table Cursor not in Content ??" );
1910 bool bInRepeatedHeadline = pTab->IsFollow() && pTab->
IsInHeadline( *pTableFrame );
1913 if ( !bInRepeatedHeadline )
1915 std::pair<Point, bool>
const tmp1(aTmpMk,
false);
1918 OSL_ENSURE( pMarkTableFrame,
"Table Cursor not in Content ??" );
1920 if ( pMarkTableFrame )
1923 OSL_ENSURE( pMarkTab,
"Table Cursor not in Content ??" );
1928 bInRepeatedHeadline = pMarkTab->IsFollow() && pMarkTab->
IsInHeadline( *pMarkTableFrame );
1934 if ( bInRepeatedHeadline )
1936 pTableFrame =
nullptr;
1958 if( pTab && pTableFrame )
1972 "this should not happen, but better lose the selection "
1973 "rather than crashing");
1987 bool const bResult =
1989 OSL_ENSURE( bResult,
"GetCharRect failed." );
1999 SwFrame* pBoxFrame = pTableFrame;
2026#if !ENABLE_WASM_STRIP_ACCESSIBILITY
2051 bool bChgState =
true;
2056 ( !
mxDoc->GetDocShell() ||
2060 0 ==
Imp()->
GetDrawView()->GetMarkedObjectList().GetMarkCount()))
2070 if(
GetDoc()->GetDocShell() )
2083 if( bWasAllProtect &&
GetDoc()->GetDocShell() &&
2084 GetDoc()->GetDocShell()->IsReadOnlyUI() )
2102 bool bPointIsStart = ( rCmp.Start() == rCmp.GetPoint() );
2105 if( ! rCmp.GetPoint()->GetNode().IsContentNode() )
2110 if( rCmp.HasMark() )
2112 if( ! rCmp.GetMark()->GetNode().IsContentNode() )
2132 std::pair<Point, bool>
const tmp1(pShellCursor->
GetPtPos(),
false);
2142 std::pair<Point, bool>
const tmp(pShellCursor->
GetPtPos(),
false);
2147 else if (
Imp()->IsIdleAction() )
2155 (!
mxDoc->GetDocShell() ||
2159 bool bChgState =
true;
2161 0 ==
Imp()->
GetDrawView()->GetMarkedObjectList().GetMarkCount()))
2170 if(
GetDoc()->GetDocShell() )
2183 if( bWasAllProtect &&
GetDoc()->GetDocShell() &&
2184 GetDoc()->GetDocShell()->IsReadOnlyUI() )
2193 }
while( bAgainst );
2220 if( !pShellCursor->
HasMark() )
2237 OSL_ENSURE(
false,
"endless loop? CharRect != OldCharRect ");
2291 pNxt->SwSelPaintRects::Show();
2300#if !ENABLE_WASM_STRIP_ACCESSIBILITY
2307 GetCursorBlinkTime();
2350 auto columnsNode = aJsonWriter.
startNode(
"columns");
2354 const int nColumnOffset = aTabCols.
GetLeftMin() + rPageRect.
Left();
2358 aJsonWriter.
put(
"tableOffset",
static_cast<sal_Int64
>(nColumnOffset));
2361 auto entriesNode = aJsonWriter.
startArray(
"entries");
2362 for (
size_t i = 0;
i < aTabCols.
Count(); ++
i)
2365 auto const & rEntry = aTabCols.
GetEntry(
i);
2366 aJsonWriter.
put(
"position", rEntry.nPos);
2367 aJsonWriter.
put(
"min", rEntry.nMin);
2368 aJsonWriter.
put(
"max", rEntry.nMax);
2369 aJsonWriter.
put(
"hidden", rEntry.bHidden);
2375 auto rowsNode = aJsonWriter.
startNode(
"rows");
2379 const int nRowOffset = aTabRows.
GetLeftMin() + rPageRect.
Top();
2383 aJsonWriter.
put(
"tableOffset",
static_cast<sal_Int64
>(nRowOffset));
2386 auto entriesNode = aJsonWriter.
startArray(
"entries");
2387 for (
size_t i = 0;
i < aTabRows.
Count(); ++
i)
2390 auto const & rEntry = aTabRows.
GetEntry(
i);
2391 aJsonWriter.
put(
"position", rEntry.nPos);
2392 aJsonWriter.
put(
"min", rEntry.nMin);
2393 aJsonWriter.
put(
"max", rEntry.nMax);
2394 aJsonWriter.
put(
"hidden", rEntry.bHidden);
2409 std::pair<Point, bool>
const tmp(aPt,
false);
2430 SwRect aRect( aMk, aPt );
2434 if( !
GetLayout()->FillSelection( aSelList, aRect ) )
2444 std::list<SwPaM*>::iterator pStart = aSelList.
getStart();
2445 std::list<SwPaM*>::iterator pPam = aSelList.
getEnd();
2446 OSL_ENSURE( pPam != pStart,
"FillSelection should deliver at least one PaM" );
2451 if( pPam == pStart )
2454 if( (*pPam)->HasMark() )
2470 if( (*pPam)->HasMark() )
2476 while( pPam != pStart )
2486 if( (*pPam)->HasMark() )
2502 pPam = aSelList.
getEnd();
2505 if( (*pPam)->HasMark() )
2542 std::optional<SwCallLink> aLink(std::in_place, *
this);
2543 return Pop(eDelete, aLink);
2547 [[maybe_unused]] std::optional<SwCallLink>& roLink)
2575 const Point& rPoint = pOldStack->GetPtPos();
2583 if( pOldStack->HasMark() )
2662 pCurrentCursor->
Hide();
2672 pCurrentCursor->
Show(
nullptr);
2779 if (rHint.
GetId() != SfxHintId::SwLegacyModify)
2859 nStart, nEnd - nStart,
false,
false,
false,
2864 aText = buf.makeStringAndClear();
2898 const OUString& rStr = pTextNd->
GetText();
2901 if (((
nPos+nOffset) >= 0 ) && (
nPos+nOffset) < rStr.getLength())
2902 cCh = rStr[
nPos + nOffset];
2971 std::pair<Point, bool>
const tmp(aPt,
true);
2973 if (
Imp()->IsIdleAction() )
3030 if( bAll || ( pTmp->
HasMark() &&
3087 auto [pStt, pEnd] = pDelRg->
StartEnd();
3089 SwPaM *pTmpDel =
nullptr, *pTmp = *ppDelRing;
3098 auto [pTmpStt, pTmpEnd] = pTmp->
StartEnd();
3101 if( *pStt <= *pTmpStt )
3103 if( *pEnd > *pTmpStt ||
3104 ( *pEnd == *pTmpStt && *pEnd == *pTmpEnd ))
3108 if( *pStt < *pTmpEnd )
3114 bool bDelete =
true;
3115 if( *ppDelRing == pTmpDel )
3132 if (pTmp == pTmpDel)
3143 if( bGoNext && pTmp )
3146 }
while( !bGoNext || *ppDelRing != pTmp );
3158 const SwNode *pNode = &rIdx;
3187 if (pSh->m_pStackCursor)
3188 pSh->ParkPams(&aNew, &pSh->m_pStackCursor);
3190 pSh->ParkPams( &aNew, &pSh->m_pCurrentCursor );
3191 if( pSh->m_pTableCursor )
3195 SwPaM* pTCursor = pSh->GetTableCrs();
3201 pSh->m_pCurrentCursor->GetPoint()->Assign( *pTableNd );
3215 ,
sw::BroadcastingModify()
3216 , m_pStackCursor( nullptr )
3217 , m_pBlockCursor( nullptr )
3218 , m_pTableCursor( nullptr )
3219 , m_pBoxIdx( nullptr )
3220 , m_pBoxPtr( nullptr )
3222 , m_nLeftFramePos(0)
3224 , m_nCurrentContent(0)
3226 , m_nCursorMove( 0 )
3228 , m_eEnhancedTableSel(
SwTable::SEARCH_NONE)
3229 , m_nMarkedListLevel( 0 )
3230 , m_oldColFrame(nullptr)
3252 ,
sw::BroadcastingModify()
3253 , m_pStackCursor( nullptr )
3254 , m_pBlockCursor( nullptr )
3255 , m_pTableCursor( nullptr )
3256 , m_pBoxIdx( nullptr )
3257 , m_pBoxPtr( nullptr )
3259 , m_nLeftFramePos(0)
3261 , m_nCurrentContent(0)
3263 , m_nCursorMove( 0 )
3265 , m_eEnhancedTableSel(
SwTable::SEARCH_NONE)
3266 , m_nMarkedListLevel( 0 )
3267 , m_oldColFrame(nullptr)
3362 OSL_ENSURE(
m_bHasFocus,
"no focus but cursor should be made visible?" );
3400 assert(!
"Did not remove table selection!");
3406 GetDoc()->GetDocShell()->IsReadOnlyUI() )
3429 bool bFirst =
false;
3446 rNdPos.
Assign(
mxDoc->GetNodes().GetEndOfExtras() );
3447 mxDoc->GetNodes().GoNext( &rNdPos );
3492 bool bGoNextSection =
true;
3493 for(
int nLoopCnt = 0; !bOk && nLoopCnt < 2; ++nLoopCnt )
3506 if ( pCNd ==
nullptr)
break;
3537 if (
nullptr == pFrame ||
3546 }
while( bContinue );
3551 bGoNextSection =
false;
3559 const sal_Int32 nContent = rNdPos.
GetNodeIndex() < nNdIdx ? pCNd->
Len() : 0;
3586 if( pFrame && pFrame->
IsInFly() &&
3587 (pFly = pFrame->
FindFlyFrame())->GetFormat()->GetEditInReadonly().GetValue() &&
3590 !
GetDrawView()->GetMarkedObjectList().GetMarkCount() )
3595 else if ( pFrame && pFrame->
IsInSct() &&
3615 if( (!
GetDoc()->GetDocShell() ||
3656 if (rCursor.HasReadonlySel(
GetViewOptions()->IsFormView(), isReplace))
3688 if (rCursor.HasHiddenSections())
3709 std::swap( nStt, nEnd );
3711 bRet = pCNd && !nStt && nEnd == pCNd->
Len();
3728 return mxDoc->GetTextDirection( aPos, &aPt );
3734 return SvxFrameDirection::Vertical_RL_TB == nDir || SvxFrameDirection::Vertical_LR_TB == nDir
3735 || nDir == SvxFrameDirection::Vertical_LR_BT;
3743 return SvxFrameDirection::Vertical_LR_TB == nDir || SvxFrameDirection::Horizontal_RL_TB == nDir;
3760 sal_Int32 nHiddenStart;
3761 sal_Int32 nHiddenEnd;
3780 bool bSearchInNotes,
3793 if( nRet || bCancel )
3817 bool bNoCollections,
3830 bCancel, eRng, pSearchOpt, rReplSet,
GetLayout());
3841 if(rCursor.
GetNext() != &rCursor)
3853 }
while( (_pStartCursor = _pStartCursor->
GetNext()) != &rCursor );
3907 bool bChanged =
false;
3911 while (pCursor != pStartCursor)
3913 pTmpCursor = pCursor->
GetNext();
3919 pCursor = pTmpCursor;
3935 SwPaM aTmpPam(*pNode);
3936 *pStartCursor = aTmpPam;
3948 pNode = aNodes.
GoNext( &aIdx );
3955 pNode = aNodes.
GoNext( &aIdx );
3958 bool bFound = (pNode !=
nullptr);
3964 SwPaM aTmpPam(*pNode);
3965 *pStartCursor = aTmpPam;
3982 aResult +=
SwResId(STR_MULTISEL);
3991 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwCursorShell"));
3995 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"m_pCurrentCursor"));
3997 rPaM.dumpAsXml(pWriter);
3998 (void)xmlTextWriterEndElement(pWriter);
4000 (void)xmlTextWriterEndElement(pWriter);
4004 uno::Sequence< uno::Reference< container::XStringKeyMap > >& rStringKeyMaps,
4005 const SwWrongList& rSmartTagList, sal_Int32 nCurrent )
4008 std::vector< uno::Reference< container::XStringKeyMap > > aStringKeyMaps;
4010 for ( sal_uInt16
i = 0;
i < rSmartTagList.
Count(); ++
i )
4012 const sal_Int32 nSTPos = rSmartTagList.
Pos(
i );
4013 const sal_Int32 nSTLen = rSmartTagList.
Len(
i );
4015 if ( nSTPos <= nCurrent && nCurrent < nSTPos + nSTLen )
4020 rSmartTagTypes.push_back( pArea->
maType );
4026 if ( !rSmartTagTypes.empty() )
4033 SwTextNode& rNode, sal_Int32 nBegin, sal_Int32 nLen )
4047 uno::Sequence< uno::Reference< container::XStringKeyMap > >& rStringKeyMaps,
4048 uno::Reference< text::XTextRange>& rRange )
const
4060 if ( !pSmartTagList )
4064 sal_Int32 nBegin = nCurrent;
4074 pSmartTagList = pSubList;
4094 if( !
GetLayout()->GetModelPositionForViewPoint( &aPos, aPt, &eTmpState ) )
4100 if( !pSmartTagList )
4112 OUString aText( pNode->
GetText().copy(nBegin, nLen) );
4127 sal_Int32 nLeft = 0;
4130 pChar = aText.getLength() ? aText.getStr() + aText.getLength() - 1 :
nullptr;
4131 sal_Int32 nRight = 0;
4141 const sal_Int32 nWordStart = (nBegin + nLeft) < nLineStart ? nLineStart : nBegin + nLeft;
4144 const sal_Int32 nWordEnd =
std::min(nBegin + nLen - nLeft - nRight, nLineEnd);
4153 std::pair<Point, bool>
const tmp(rPt,
false);
4161 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
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.
SwNode const * ExtendedSelectedAll() const
If ExtendedSelectAll() was called and selection didn't change since then.
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.
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
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()
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
SwTabFrame is one table in the document layout, containing rows (which contain cells).
const SwTable * GetTable() const
bool IsInHeadline(const SwFrame &rFrame) const
bool HasReadOnlyBoxSel() const
bool HasHiddenBoxSel() const
bool IsCursorMovedUpdate()
SwCursor * MakeBoxSels(SwCursor *pCurrentCursor)
void ActualizeSelection(const SwSelBoxes &rBoxes)
const SwSelBoxes & GetSelectedBoxes() const
size_t GetSelectedBoxesCount() const
void ParkCursor()
park table cursor on the boxes' start node
const SwTable & GetTable() const
SwTable is one table in the document model, containing rows (which contain cells).
void CreateSelection(const SwPaM &rPam, SwSelBoxes &rBoxes, const SearchType eSearchType, bool bProtect) const
void SwTable::CreateSelection(..) fills the selection structure with table cells for a given SwPaM,...
sal_uInt16 GetRowsToRepeat() const
Represents the style of a paragraph.
Represents the visualization of a paragraph.
TextFrameIndex MapModelToViewPos(SwPosition const &rPos) const
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
SwTextNode is a paragraph in the document model.
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|ExpandMode::HideFieldmarkCommands) const
add 4th optional parameter <bAddSpaceAfterListLabelStr> indicating, when <bWithNum = true> that a spa...