20#ifndef INCLUDED_SW_SOURCE_FILTER_XML_XMLTBLI_HXX
21#define INCLUDED_SW_SOURCE_FILTER_XML_XMLTBLI_HXX
28#include <unordered_map>
46 namespace text {
class XTextContent; }
47 namespace text {
class XTextCursor; }
68 std::unique_ptr<SwXMLTableRows_Impl>
m_pRows;
108 sal_uInt32 nLeftCol, sal_uInt32 nRightCol );
110 sal_uInt32 nTopRow, sal_uInt32 nLeftCol,
111 sal_uInt32 nBottomRow, sal_uInt32 nRightCol );
113 sal_uInt32 nTopRow, sal_uInt32 nLeftCol,
114 sal_uInt32 nBottomRow, sal_uInt32 nRightCol );
123 sal_uInt32 nCol )
const;
125 void FixRowSpan( sal_uInt32 nRow, sal_uInt32 nCol, sal_uInt32 nColSpan );
131 const OUString& rStyleName,
132 sal_Int32 nColumnWidth,
136 bool* pModifyLocked );
142 const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList );
150 const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList )
override;
155 const OUString *pDfltCellStyleName =
nullptr );
156 sal_Int32
GetColumnWidth( sal_uInt32 nCol, sal_uInt32 nColSpan )
const;
170 sal_uInt32 nRowSpan, sal_uInt32 nColSpan,
173 bool bIsProtected =
false,
174 const OUString *pFormula=
nullptr,
175 bool bHasValue =
false,
177 OUString
const*
const pStringValue =
nullptr);
182 void InsertRow(
const OUString& rStyleName,
183 const OUString& rDfltCellStyleName,
190 OUString
const* pStringValueStyleName =
nullptr);
192 virtual void SAL_CALL
endFastElement(sal_Int32 nElement)
override;
SvXMLImport & GetImport()
Starts a section of nodes in the document model.
SwTableBox is one table cell in the document model.
SwTableLine is one table row in the document model.
std::unique_ptr< SwXMLTableRows_Impl > m_pRows
const SwXMLTableCell_Impl * GetCell(sal_uInt32 nRow, sal_uInt32 nCol) const
sal_uInt32 GetColumnCount() const
std::unique_ptr< map_BoxFormat > m_pSharedBoxFormats
std::vector< ColumnWidthInfo > m_aColumnWidths
void InsertCoveredCell(const OUString &rStyleName)
Sets formatting of an already created covered cell.
void FixRowSpan(sal_uInt32 nRow, sal_uInt32 nCol, sal_uInt32 nColSpan)
bool IsInsertCoveredCellPossible() const
Determines if it's OK to insert a covered cell, given the total column count.
SwTableBoxFormat * m_pBoxFormat
void InsertColumn(sal_Int32 nWidth, bool bRelWidth, const OUString *pDfltCellStyleName=nullptr)
sal_uInt32 m_nNonMergedCurCol
Same as m_nCurCol, but not incremented multiple times for table cells with row span.
SwTableBox * NewTableBox(const SwStartNode *pStNd, SwTableLine *pUpper)
void InsertCell(const OUString &rStyleName, sal_uInt32 nRowSpan, sal_uInt32 nColSpan, const SwStartNode *pStNd, SwXMLTableContext *pTable=nullptr, bool bIsProtected=false, const OUString *pFormula=nullptr, bool bHasValue=false, double fValue=0.0, OUString const *const pStringValue=nullptr)
std::optional< std::vector< OUString > > m_xColumnDefaultCellStyleNames
const SwStartNode * GetPrevStartNode(sal_uInt32 nRow, sal_uInt32 nCol) const
css::uno::Reference< css::text::XTextContent > m_xTextContent
SwTableBoxFormat * GetSharedBoxFormat(SwTableBox *pBox, const OUString &rStyleName, sal_Int32 nColumnWidth, bool bProtected, bool bMayShare, bool &bNew, bool *pModifyLocked)
sets the appropriate SwTableBoxFormat at pBox.
const SwStartNode * InsertTableSection(const SwStartNode *pPrevSttNd=nullptr, OUString const *pStringValueStyleName=nullptr)
void ReplaceWithEmptyCell(sal_uInt32 nRow, sal_uInt32 nCol, bool bRows)
const SwStartNode * GetLastStartNode() const
SwXMLImport & GetSwImport()
void MakeTable_(SwTableBox *pBox=nullptr)
SvXMLImportContextRef m_xParentTable
std::unordered_map< TableBoxIndex, SwTableBoxFormat *, TableBoxIndexHasher > map_BoxFormat
virtual ~SwXMLTableContext() override
bool IsInsertCellPossible() const
rtl::Reference< SwXMLDDETableContext_Impl > m_xDDESource
SwXMLTableContext * GetParentTable() const
css::uno::Reference< css::text::XTextCursor > m_xOldCursor
bool IsInsertColPossible() const
SwTableLine * MakeTableLine(SwTableBox *pUpper, sal_uInt32 nTopRow, sal_uInt32 nLeftCol, sal_uInt32 nBottomRow, sal_uInt32 nRightCol)
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
sal_Int32 GetColumnWidth(sal_uInt32 nCol, sal_uInt32 nColSpan) const
bool IsInsertRowPossible() const
SwTableNode * m_pTableNode
void InsertRepRows(sal_uInt32 nCount)
const SwStartNode * m_pSttNd1
OUString m_aDfltCellStyleName
void InsertRow(const OUString &rStyleName, const OUString &rDfltCellStyleName, bool bInHead)
SwXMLTableContext(SwXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
if set, call pBox->LockModify() and return old lock status
void SetHasSubTables(bool bNew)
SwTableLineFormat * m_pLineFormat
OUString GetColumnDefaultCellStyleName(sal_uInt32 nCol) const
static constexpr sal_Int32 MAX_WIDTH
SwTableBox * MakeTableBox(SwTableLine *pUpper, const SwXMLTableCell_Impl *pStartNode, sal_uInt32 nLeftCol, sal_uInt32 nRightCol)
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Holds basic information about a column's width.
ColumnWidthInfo(sal_uInt16 wdth, bool isRel)
bool isRelative
True for a relative width, false for absolute.
sal_uInt16 width
Column width (absolute or relative).
std::vector< std::unique_ptr< SwXMLTableRow_Impl > > SwXMLTableRows_Impl