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);
179 void GatherFormulas(std::vector<SwTableBoxFormula*>& rvFormulas);
184 void SetHTMLTableLayout(std::shared_ptr<SwHTMLTableLayout>
const& r);
213 bool bHidden =
false,
bool bCurRowOnly =
false )
const;
219 const SearchType eSearchType,
bool bProtect )
const;
220 void CreateSelection(
const SwNode* pStart,
const SwNode* pEnd,
221 SwSelBoxes& rBoxes,
const SearchType eSearchType,
bool bProtect )
const;
222 void ExpandSelection(
SwSelBoxes& rBoxes )
const;
228 std::unique_ptr<SwSaveRowSpan> CleanUpTopRowSpan( sal_uInt16 nSplitLine );
232 void CleanUpBottomRowSpan( sal_uInt16 nDelLines );
240 return m_bNewModel ? NewMerge( pDoc, rBoxes, rMerged, pUndo ) :
241 OldMerge( pDoc, rBoxes, pMergeBox, pUndo );
246 return m_bNewModel ? NewSplitRow( rDoc, rBoxes, nCnt, bSameHeight ) :
247 OldSplitRow( rDoc, rBoxes, nCnt, bSameHeight );
255 sal_uInt16 nCnt,
bool bBehind );
257 sal_uInt16 nCnt,
bool bBehind );
258 void PrepareDelBoxes(
const SwSelBoxes& rBoxes );
260 SwUndo* pUndo,
const bool bDelMakeFrames,
const bool bCorrBorder );
261 bool SplitCol(
SwDoc& rDoc,
const SwSelBoxes& rBoxes, sal_uInt16 nCnt );
264 { FindSuperfluousRows_( rBoxes,
nullptr,
nullptr ); }
265 void CheckRowSpan(
SwTableLine* &rpLine,
bool bUp )
const;
274 static sal_uInt16 GetBoxNum( OUString& rStr,
276 const bool bPerformValidCheck =
false );
283 const SwTableBox* GetTableBox(
const OUString& rName,
284 const bool bPerformValidCheck =
false )
const;
287 bool bCpyName =
false,
const OUString& rStyleName =
"" )
const;
296 void CopyHeadlineIntoTable(
SwTableNode& rTableNd );
301 {
return const_cast<SwTable*
>(
this)->GetTableBox( nSttIdx ); }
304 bool IsTableComplex()
const;
307 bool IsTableComplexForChart( std::u16string_view aSel )
const;
336 void UpdateCharts()
const;
342 SwTwips nAbsDiff,
SwTwips nRelDiff, std::unique_ptr<SwUndo>* ppUndo );
344 SwTwips nAbsDiff,
SwTwips nRelDiff, std::unique_ptr<SwUndo>* ppUndo );
345 void RegisterToFormat(
SwFormat& rFormat );
347 void CheckConsistency()
const;
350 bool HasLayout()
const;
352 bool CanConvertSubtables()
const;
353 void ConvertSubtables();
356 bool IsDeleted()
const;
358 bool HasDeletedRowOrCell()
const;
361 bool IsEmpty()
const;
369 void Split(OUString sNewTableName, sal_uInt16 nSplitLine,
SwHistory* pHistory);
390 SwTableBoxes::const_iterator it = std::find(m_aBoxes.begin(), m_aBoxes.end(), pBox);
391 return it == m_aBoxes.end() ? USHRT_MAX : it - m_aBoxes.begin();
407 bool bOvrTableLns=
true )
const;
409 bool bOvrTableLns=
true )
const;
411 SwTwips GetTableLineHeight(
bool& bLayoutAvailable )
const;
413 bool hasSoftPageBreak()
const;
417 bool IsEmpty()
const;
492 void ChgFrameFormat(
SwTableBoxFormat *pNewFormat,
bool bNeedToReregister =
true );
494 void RemoveFromTable();
500 bool IsEmpty(
bool bWithRemainingNestedTable =
true )
const;
504 bool bOvrTableLns=
true )
const;
514 Point GetCoordinates()
const;
516 bool IsInHeadline(
const SwTable* pTable )
const;
519 bool HasNumContent(
double& rNum, sal_uInt32& rFormatIndex,
520 bool& rIsEmptyTextNd )
const;
521 SwNodeOffset IsValidNumTextNd(
bool bCheckAttr =
true )
const;
524 bool IsNumberChanged()
const;
529 sal_uInt16 IsFormulaOrValueBox()
const;
532 void ActualiseValueBox();
541 void setRowSpan( sal_Int32 nNewRowSpan );
542 bool getDummyFlag()
const;
543 void setDummyFlag(
bool bDummy );
545 SwTableBox& FindStartOfRowSpan(
const SwTable&, sal_uInt16 nMaxStep = USHRT_MAX );
547 sal_uInt16 nMaxStep = USHRT_MAX )
const
548 {
return const_cast<SwTableBox*
>(
this)->FindStartOfRowSpan( rTable, nMaxStep ); }
552 sal_uInt16 nMaxStep )
const
553 {
return const_cast<SwTableBox*
>(
this)->FindEndOfRowSpan( rTable, nMaxStep ); }
554 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)
void SwitchFormulasToExternalRepresentation()
SwTableFormat * GetFrameFormat()
void SetTableStyleName(const OUString &rName)
Set the new table style name for this table.
TableChgMode m_eTableChgMode
const SwTableLines & GetTabLines() const
void SwitchFormulasToInternalRepresentation()
void SwitchFormulasToRelativeRepresentation()
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
struct _xmlTextWriter * xmlTextWriterPtr
virtual OUString GetName() const override
TableFormulaUpdateFlags
SwTableFormulaUpdate is sent when the table has to be newly calculated or when a table itself is merg...
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)