19#ifndef INCLUDED_SW_INC_SWTABLE_HXX
20#define INCLUDED_SW_INC_SWTABLE_HXX
68 typedef std::vector<SwTableLine*>::size_type
size_type;
69 typedef std::vector<SwTableLine*>::iterator
iterator;
87 template<
typename TInputIterator>
90 m_vLines.insert( aIt, aFirst, aLast );
101 return it ==
end() ? USHRT_MAX : it -
begin();
168 std::optional<SwBoxSelection> CollectBoxSelection(
const SwPaM& rPam )
const;
169 void InsertSpannedRow(
SwDoc& rDoc, sal_uInt16 nIdx, sal_uInt16 nCnt );
170 bool InsertRow_(
SwDoc*,
const SwSelBoxes&, sal_uInt16 nCnt,
bool bBehind );
171 bool NewInsertCol(
SwDoc&,
const SwSelBoxes& rBoxes, sal_uInt16 nCnt,
bool );
176 void ConvertSubtableBox(sal_uInt16
const nRow, sal_uInt16
const nBox);
182 void SetHTMLTableLayout(std::shared_ptr<SwHTMLTableLayout>
const& r);
211 bool bHidden =
false,
bool bCurRowOnly =
false )
const;
217 const SearchType eSearchType,
bool bProtect )
const;
218 void CreateSelection(
const SwNode* pStart,
const SwNode* pEnd,
219 SwSelBoxes& rBoxes,
const SearchType eSearchType,
bool bProtect )
const;
220 void ExpandSelection(
SwSelBoxes& rBoxes )
const;
226 std::unique_ptr<SwSaveRowSpan> CleanUpTopRowSpan( sal_uInt16 nSplitLine );
230 void CleanUpBottomRowSpan( sal_uInt16 nDelLines );
238 return m_bNewModel ? NewMerge( pDoc, rBoxes, rMerged, pUndo ) :
239 OldMerge( pDoc, rBoxes, pMergeBox, pUndo );
244 return m_bNewModel ? NewSplitRow( rDoc, rBoxes, nCnt, bSameHeight ) :
245 OldSplitRow( rDoc, rBoxes, nCnt, bSameHeight );
253 sal_uInt16 nCnt,
bool bBehind );
255 sal_uInt16 nCnt,
bool bBehind );
256 void PrepareDelBoxes(
const SwSelBoxes& rBoxes );
258 SwUndo* pUndo,
const bool bDelMakeFrames,
const bool bCorrBorder );
259 bool SplitCol(
SwDoc& rDoc,
const SwSelBoxes& rBoxes, sal_uInt16 nCnt );
262 { FindSuperfluousRows_( rBoxes,
nullptr,
nullptr ); }
263 void CheckRowSpan(
SwTableLine* &rpLine,
bool bUp )
const;
272 static sal_uInt16 GetBoxNum( OUString& rStr,
274 const bool bPerformValidCheck =
false );
281 const SwTableBox* GetTableBox(
const OUString& rName,
282 const bool bPerformValidCheck =
false )
const;
285 bool bCpyName =
false,
const OUString& rStyleName =
"" )
const;
294 void CopyHeadlineIntoTable(
SwTableNode& rTableNd );
299 {
return const_cast<SwTable*
>(
this)->GetTableBox( nSttIdx ); }
302 bool IsTableComplex()
const;
305 bool IsTableComplexForChart( std::u16string_view aSel )
const;
334 void UpdateCharts()
const;
340 SwTwips nAbsDiff,
SwTwips nRelDiff, std::unique_ptr<SwUndo>* ppUndo );
342 SwTwips nAbsDiff,
SwTwips nRelDiff, std::unique_ptr<SwUndo>* ppUndo );
343 void RegisterToFormat(
SwFormat& rFormat );
345 void CheckConsistency()
const;
348 bool HasLayout()
const;
350 bool CanConvertSubtables()
const;
351 void ConvertSubtables();
354 bool IsDeleted()
const;
356 bool HasDeletedRow()
const;
359 bool IsEmpty()
const;
378 SwTableBoxes::const_iterator it = std::find(m_aBoxes.begin(), m_aBoxes.end(), pBox);
379 return it == m_aBoxes.end() ? USHRT_MAX : it - m_aBoxes.begin();
395 bool bOvrTableLns=
true )
const;
397 bool bOvrTableLns=
true )
const;
399 SwTwips GetTableLineHeight(
bool& bLayoutAvailable )
const;
401 bool hasSoftPageBreak()
const;
405 bool IsEmpty()
const;
475 void ChgFrameFormat(
SwTableBoxFormat *pNewFormat,
bool bNeedToReregister =
true );
477 void RemoveFromTable();
483 bool IsEmpty(
bool bWithRemainingNestedTable =
true )
const;
487 bool bOvrTableLns=
true )
const;
497 Point GetCoordinates()
const;
499 bool IsInHeadline(
const SwTable* pTable )
const;
502 bool HasNumContent(
double& rNum, sal_uInt32& rFormatIndex,
503 bool& rIsEmptyTextNd )
const;
504 SwNodeOffset IsValidNumTextNd(
bool bCheckAttr =
true )
const;
507 bool IsNumberChanged()
const;
512 sal_uInt16 IsFormulaOrValueBox()
const;
515 void ActualiseValueBox();
524 void setRowSpan( sal_Int32 nNewRowSpan );
525 bool getDummyFlag()
const;
526 void setDummyFlag(
bool bDummy );
528 SwTableBox& FindStartOfRowSpan(
const SwTable&, sal_uInt16 nMaxStep = USHRT_MAX );
530 sal_uInt16 nMaxStep = USHRT_MAX )
const
531 {
return const_cast<SwTableBox*
>(
this)->FindStartOfRowSpan( rTable, nMaxStep ); }
535 sal_uInt16 nMaxStep )
const
536 {
return const_cast<SwTableBox*
>(
this)->FindEndOfRowSpan( rTable, nMaxStep ); }
537 void RegisterToFormat(
SwFormat& rFormat ) ;
SwBoxSelection is a small helperclass (structure) to handle selections of cells (boxes) between table...
SwCellFrame is one table cell in the document layout.
const SwModify * GetRegisteredIn() const
virtual void SwClientNotify(const SwModify &, const SfxHint &rHint) override
virtual bool GetInfo(SfxPoolItem &) const
Marks a node in the document model.
Base class of the Writer document model elements.
PaM is Point and Mark: a selection of the document model.
Of course Writer needs its own rectangles.
vector_type::size_type size_type
Starts a section of nodes in the document model.
SwTableBox is one table cell in the document model.
void SetUpper(SwTableLine *pNew)
void SetSaveUserColor(std::optional< Color > p)
const SwTableLine * GetUpper() const
SwTableBox & operator=(const SwTableBox &)=delete
sal_Int32 getRowSpan() const
const SwTableBox & FindStartOfRowSpan(const SwTable &rTable, sal_uInt16 nMaxStep=USHRT_MAX) const
const std::optional< Color > & GetSaveUserColor() const
SwFrameFormat * GetFrameFormat() const
const SwStartNode * m_pStartNode
std::optional< Color > mxUserColor
void SetSaveNumFormatColor(std::optional< Color > p)
SwFrameFormat * GetFrameFormat()
SwTableLines & GetTabLines()
void SetDirectFormatting(bool bDirect)
Set that this table box contains formatting that is not set by the table style.
bool HasDirectFormatting() const
Do we contain any direct formatting (ie. something not affected by the table style)?
const SwTableBox & FindEndOfRowSpan(const SwTable &rTable, sal_uInt16 nMaxStep) const
std::optional< Color > mxNumFormatColor
bool mbDirectFormatting
Do we contain any direct formatting?
const std::optional< Color > & GetSaveNumFormatColor() const
const SwStartNode * GetSttNd() const
const SwTableLines & GetTabLines() const
SwTableBox(const SwTableBox &)=delete
std::unique_ptr< Impl > m_pImpl
SwTableCellInfo(SwTableCellInfo const &)=delete
SwTableCellInfo & operator=(SwTableCellInfo const &)=delete
SwTableLine is one table row in the document model.
SwFrameFormat * GetFrameFormat()
const SwTableBoxes & GetTabBoxes() const
void SetRedlineType(RedlineType eType)
SwTableBoxes & GetTabBoxes()
RedlineType m_eRedlineType
SwFrameFormat * GetFrameFormat() const
sal_uInt16 GetBoxPos(const SwTableBox *pBox) const
void SetUpper(SwTableBox *pNew)
const SwTableBox * GetUpper() const
std::vector< SwTableLine * >::const_iterator const_iterator
std::vector< SwTableLine * >::iterator iterator
SwTableLine * back() const
iterator erase(iterator aIt)
SwTableLine *& operator[](size_type nPos)
const_iterator begin() const
SwTableLine * front() const
void push_back(SwTableLine *pLine)
iterator erase(iterator aFirst, iterator aLast)
iterator insert(iterator aIt, SwTableLine *pLine)
void reserve(size_type nSize)
std::vector< SwTableLine * >::size_type size_type
sal_uInt16 GetPos(const SwTableLine *pBox) const
void insert(iterator aIt, TInputIterator aFirst, TInputIterator aLast)
const_iterator end() const
SwTableLine * operator[](size_type nPos) const
std::vector< SwTableLine * > m_vLines
SwTable is one table in the document model, containing rows (which contain cells).
SwTableFormat * GetFrameFormat() const
const SwHTMLTableLayout * GetHTMLTableLayout() const
std::shared_ptr< SwHTMLTableLayout > m_xHTMLLayout
virtual const SwTable * DynCastTable() const override
SwTableSortBoxes m_TabSortContentBoxes
void SetTableModel(bool bNew)
OUString maTableStyleName
Name of the table style to be applied on this table.
SwServerObject * GetObject()
const OUString & GetTableStyleName() const
Return the table style name of this table.
bool Merge(SwDoc *pDoc, const SwSelBoxes &rBoxes, const SwSelBoxes &rMerged, SwTableBox *pMergeBox, SwUndoTableMerge *pUndo)
sal_uInt16 m_nRowsToRepeat
const SwServerObject * GetObject() const
void SetRowsToRepeat(sal_uInt16 nNumOfRows)
SwTableNode * m_pTableNode
SwTableLines & GetTabLines()
void FindSuperfluousRows(SwSelBoxes &rBoxes)
SwTableFormat * GetFrameFormat()
void SetTableStyleName(const OUString &rName)
Set the new table style name for this table.
TableChgMode m_eTableChgMode
const SwTableLines & GetTabLines() const
void SetTableChgMode(TableChgMode eMode)
sal_uInt16 DecGrfsThatResize()
sal_uInt16 IncGrfsThatResize()
SwHTMLTableLayout * GetHTMLTableLayout()
sal_uInt16 GetRowsToRepeat() const
SwTableSortBoxes & GetTabSortBoxes()
const SwTableBox * GetTableBox(SwNodeOffset nSttIdx) const
tools::SvRef< SwServerObject > m_xRefObj
const SwTableSortBoxes & GetTabSortBoxes() const
void SetTableNode(SwTableNode *pNode)
TableChgMode GetTableChgMode() const
bool SplitRow(SwDoc &rDoc, const SwSelBoxes &rBoxes, sal_uInt16 nCnt, bool bSameHeight)
sal_uInt16 m_nGraphicsThatResize
WriterListener & operator=(WriterListener const &)=delete
virtual OUString GetName() const override
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
Marks a position in the document model.
This structure is needed by Undo to restore row span attributes when a table has been split into two ...
void DelBoxNode(SwTableSortBoxes const &rSortCntBoxes)
std::vector< SwTableBox * > SwTableBoxes
void sw_GetTableBoxColStr(sal_uInt16 nCol, OUString &rNm)