35#include <osl/diagnose.h>
65 pTableBoxStartNode = pTableBox->
GetSttNd();
75 if( pCursor->
HasMark() || !bAppendLine )
83 StartOfSectionIndex() );
85 OSL_ENSURE( pTableBox,
"Box is not in this table" );
135 const SwTabFrame* pMasterTabFrame = pTabFrame->IsFollow() ? pTabFrame->
FindMaster(
true ) : pTabFrame;
148 if( bCheckProtected )
159 pEnd = aBoxes.
back();
166 pTable->
CreateSelection( *pCursor, aBoxes, eSearchType, bCheckProtected );
171 pEnd = aBoxes.
back();
178 const SwFrame* pStartFrame = pFrame;
180 std::pair<Point, bool>
const tmp(pCursor->
GetMkPos(),
true);
181 const SwFrame* pEndFrame = pCNd
191 if ( !pStartFrame || !pEndFrame )
201 const bool bSelectUp = ( bVert && !bRow ) ||
206 aBoxes, bSelectUp ?
nullptr : &aCells,
eType );
208 if( aBoxes.
empty() || ( !bSelectUp && 4 != aCells.size() ) )
214 pEnd = aBoxes.
back();
219 pStt = aCells[bVert ? 0 : (bRow ? 2 : 1)]->GetTabBox();
221 pEnd = aCells[bVert ? 3 : (bRow ? 1 : 2)]->GetTabBox();
261 const SwTabFrame* pMasterTabFrame = pTableFrame->IsFollow() ? pTableFrame->
FindMaster(
true ) : pTableFrame;
295#if OSL_DEBUG_LEVEL > 0
300 OSL_ENSURE( !pFrame->
IsInTab() == !(pStartNode !=
nullptr),
301 "Schroedinger's table: We're in a box, and also we aren't." );
303 if( pStartNode ==
nullptr )
356 OSL_FAIL(
"lcl_FindNextCell not celled with table start node!" );
367 pCNd = rNds.
GoNext( &aTmp );
375 if (
nullptr == pFrame || pCNd->
FindTableNode() != pTableNd ||
397 if(
nullptr == pCNd )
398 pCNd = rNds.
GoNext( &aTmp );
407 if (
nullptr != pFrame && pCNd->
FindTableNode() == pTableNd &&
433 OSL_FAIL(
"lcl_FindPrevCell not celled with table start node!" );
447 if(
nullptr == pFrame || pCNd->
FindTableNode() != pTableNd ||
460 if(
nullptr == pCNd )
468 if(
nullptr != pFrame && pCNd->
FindTableNode() == pTableNd &&
499 if( pInnerTableNd == pTableNd )
500 aIdx.
Assign( *pTableNd, -1 );
510 if ( aIdx == aOldIdx )
531 aIdx.
Assign( *pTableNd, -1 );
541 aIdx.
Assign( *pTableNd, -1 );
578 if ( aIdx == aOldIdx )
669 if( pTableCursor || !
HasMark() )
687 sal_Int32 nPtCnt = 0;
706 bRet = pCursor->
MoveTable( fnWhichTable, fnPosTable );
760 OSL_ENSURE( pFrame,
"no frame for this box" );
765 sNm =
static_cast<SwCellFrame*
>(pFrame)->GetTabBox()->GetName() +
":";
786 sNm +=
static_cast<SwCellFrame*
>(pFrame)->GetTabBox()->GetName();
833 if( !pPos && !pChkBox )
837 if( pChkBox && !pPos &&
847 pSttNd->
GetIndex() + 1 ]->GetTextNode();
864 return nullptr != pChkBox;
877 bool bCheckBox =
false;
918 if(
auto pCursorShell =
dynamic_cast<SwCursorShell *
>(&rSh) )
919 bRet |= pCursorShell->CheckTableBoxContent(
920 pCursorShell->m_pCurrentCursor->GetPoint() );
virtual const SwRootFrame * GetCurrentLayout() const =0
static void SetSearchLabel(const SearchLabel &rSL)
SwCellFrame is one table cell in the document layout.
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
A helper class to save cursor state (position).
SAL_DLLPRIVATE void UpdateCursor(sal_uInt16 eFlags=SwCursorShell::SCROLLWIN|SwCursorShell::CHKRANGE, bool bIdleEnd=false)
bool IsTableComplexForChart()
bool EndAllTableBoxEdit()
bool IsReadOnlyAvailable() const
OUString GetBoxNms() const
void ClearTableBoxContent()
const SwTableNode * IsCursorInTable() const
Check if Point of current cursor is placed within a table.
SwShellCursor * GetCursor_()
SwTable::SearchType m_eEnhancedTableSel
bool SelTableRowOrCol(bool bRow, bool bRowSimple=false)
SwNodeIndex * m_pBoxIdx
for recognizing of the changed
bool GotoTable(const OUString &rName)
bool IsSelTableCells() const
bool MoveTable(SwWhichTable, SwMoveFnCollection const &)
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
SwTableBox * m_pBoxPtr
table row
bool CheckTableBoxContent(const SwPosition *pPos=nullptr)
void EndAction(const bool bIdleEnd=false)
SwContentFrame * GetCurrFrame(const bool bCalcFrame=true) const
Get current frame in which the cursor is positioned.
bool IsAutoUpdateCells() const
SwShellTableCursor * m_pTableCursor
table Cursor; only in tables when the selection lays over 2 columns
@ READONLY
make visible in spite of Readonly
@ CHKRANGE
check overlapping PaMs
SwShellCursor * m_pCurrentCursor
current cursor
bool GoNextCell(bool bAppendLine=true)
set cursor into next/previous cell
void SaveTableBoxContent(const SwPosition *pPos=nullptr)
sal_Int32 GetCursorRowSpanOffset() const
bool GoNextCell(sal_uInt16 nCnt=1)
bool MoveTable(SwWhichTable, SwMoveFnCollection const &)
virtual bool IsSelOvr(SwCursorSelOverFlags eFlags=SwCursorSelOverFlags::CheckNodeSection|SwCursorSelOverFlags::Toggle|SwCursorSelOverFlags::ChangePos)
bool GoPrevCell(sal_uInt16 nCnt=1)
virtual bool GotoTable(const OUString &rName)
virtual bool IsReadOnlyAvailable() const
void ChkBoxNumFormat(SwTableBox &rCurrentBox, bool bCallUpdate)
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
const SwRect & getFrameArea() const
Base class of the Writer layout elements.
SwTabFrame * FindTabFrame()
SwTabFrame * ImplFindTabFrame()
bool IsProtected() const
Is the Frame or rather the Section in which it lies protected?
SwLayoutFrame * GetUpper()
Marks a node in the document model.
SwNodeOffset GetIndex() const
SwNodeIndex & Assign(SwNodes const &rNds, SwNodeOffset nIdx)
Base class of the Writer document model elements.
SwStartNode * GetStartNode()
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodeOffset GetIndex() const
const SwStartNode * FindTableBoxStartNode() const
SwNodes & GetNodes()
Node is in which nodes-array/doc?
SwTableBox * GetTableBox() const
If node is in a table return the respective table box.
SwTableNode * FindTableNode()
Search table node, in which it is.
SwStartNode * FindSttNodeByType(SwStartNodeType eTyp)
const SwStartNode * StartOfSectionNode() const
SwNodeOffset EndOfSectionIndex() const
SwContentNode * GetContentNode()
SwTableNode * GetTableNode()
const SwEndNode * EndOfSectionNode() const
static SwContentNode * GoPrevious(SwNodeIndex *)
SwContentNode * GoNext(SwNodeIndex *) const
SwNodeOffset Count() const
PaM is Point and Mark: a selection of the document model.
const SwPosition * GetMark() const
SwNode & GetPointNode() const
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
const SwPosition * End() const
SwContentNode * GetMarkContentNode() const
const SwPosition * GetPoint() const
const SwPosition * Start() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Represents the current text cursor of one opened edit window.
SwShellCursor * GetNext()
const Point & GetPtPos() const
const Point & GetMkPos() const
virtual void SetMark() override
Unless this is called, the getter method of Mark will return Point.
Starts a section of nodes in the document model.
SwStartNodeType GetStartNodeType() const
SwTabFrame is one table in the document layout, containing rows (which contain cells).
SwTabFrame * FindMaster(bool bFirstMaster=false) const
const SwTable * GetTable() const
SwTableBox is one table cell in the document model.
sal_Int32 getRowSpan() const
SwFrameFormat * GetFrameFormat()
const SwStartNode * GetSttNd() const
SwTableBox & FindEndOfRowSpan(const SwTable &, sal_uInt16 nMaxStep)
SwTableBox::FindEndOfRowSpan(..) returns the last overlapped cell if there is any.
const SwTable & GetTable() const
SwTable is one table in the document model, containing rows (which contain cells).
SwTableNode * GetTableNode() const
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,...
bool IsTableComplexForChart(std::u16string_view aSel) const
const SwTableBox * GetTableBox(const OUString &rName, const bool bPerformValidCheck=false) const
static SwSelBoxes & SelLineFromBox(const SwTableBox *pBox, SwSelBoxes &rBoxes, bool bToTop=true)
SwTextNode is a paragraph in the document model.
virtual sal_Int32 Len() const override
const OUString & GetText() const
rtl::Reference< SwDoc > mxDoc
The document; never 0.
static ShellResource * GetShellRes()
SwRootFrame * GetLayout() const
const Value & back() const
ring_container GetRingContainer()
bool(* SwWhichTable)(SwPaM &, SwMoveFnCollection const &, bool bInReadOnly)
constexpr TypedWhichId< SwTableBoxFormula > RES_BOXATR_FORMULA(157)
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
bool GoInNode(SwPaM &rPam, SwMoveFnCollection const &fnMove)
bool GoInContent(SwPaM &rPam, SwMoveFnCollection const &fnMove)
SwMoveFnCollection const & fnMoveBackward
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
Marks a position in the document model.
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
SwNodeOffset GetNodeIndex() const
sal_Int32 GetContentIndex() const
void GetTableSel(const SwCursorShell &rShell, SwSelBoxes &rBoxes, const SwTableSearchType eSearchType)
std::deque< SwCellFrame * > SwCellFrames
bool GotoNextTable(SwPaM &rCurrentCursor, SwMoveFnCollection const &fnPosTable, bool bInReadOnly)
bool GotoCurrTable(SwPaM &rCurrentCursor, SwMoveFnCollection const &fnPosTable, bool bInReadOnly)
static bool lcl_FindPrevCell(SwNodeIndex &rIdx, bool bInReadOnly)
see lcl_FindNextCell()
static const SwFrame * lcl_FindMostUpperCellFrame(const SwFrame *pFrame)
static bool lcl_FindNextCell(SwNodeIndex &rIdx, bool bInReadOnly)
get the next non-protected cell inside a table
bool GotoPrevTable(SwPaM &rCurrentCursor, SwMoveFnCollection const &fnPosTable, bool bInReadOnly)