LibreOffice Module sw (master) 1
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
SwXMLTableContext Class Reference

#include <xmltbli.hxx>

Inheritance diagram for SwXMLTableContext:
[legend]
Collaboration diagram for SwXMLTableContext:
[legend]

Classes

struct  ColumnWidthInfo
 Holds basic information about a column's width. More...
 

Public Member Functions

 SwXMLTableContext (SwXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
 if set, call pBox->LockModify() and return old lock status More...
 
 SwXMLTableContext (SwXMLImport &rImport, SwXMLTableContext *pTable)
 
virtual ~SwXMLTableContext () override
 
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext (sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
 
SwXMLImportGetSwImport ()
 
void InsertColumn (sal_Int32 nWidth, bool bRelWidth, const OUString *pDfltCellStyleName=nullptr)
 
sal_Int32 GetColumnWidth (sal_uInt32 nCol, sal_uInt32 nColSpan) const
 
OUString GetColumnDefaultCellStyleName (sal_uInt32 nCol) const
 
sal_uInt32 GetColumnCount () const
 
bool IsInsertCellPossible () const
 
bool IsInsertCoveredCellPossible () const
 Determines if it's OK to insert a covered cell, given the total column count. More...
 
bool IsInsertColPossible () const
 
bool IsInsertRowPossible () const
 
bool IsValid () const
 
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)
 
void InsertCoveredCell (const OUString &rStyleName)
 Sets formatting of an already created covered cell. More...
 
void InsertRow (const OUString &rStyleName, const OUString &rDfltCellStyleName, bool bInHead)
 
void FinishRow ()
 
void InsertRepRows (sal_uInt32 nCount)
 
const SwXMLTableCell_ImplGetCell (sal_uInt32 nRow, sal_uInt32 nCol) const
 
SwXMLTableCell_ImplGetCell (sal_uInt32 nRow, sal_uInt32 nCol)
 
const SwStartNodeInsertTableSection (const SwStartNode *pPrevSttNd=nullptr, OUString const *pStringValueStyleName=nullptr)
 
virtual void SAL_CALL endFastElement (sal_Int32 nElement) override
 
void SetHasSubTables (bool bNew)
 
- Public Member Functions inherited from XMLTextTableContext
 XMLTextTableContext (SvXMLImport &rImport)
 
virtual ~XMLTextTableContext () override
 
- Public Member Functions inherited from SvXMLImportContext
 SvXMLImportContext (SvXMLImport &rImport)
 
virtual ~SvXMLImportContext ()
 
virtual void SAL_CALL startFastElement (sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
 
virtual void SAL_CALL startUnknownElement (const OUString &Namespace, const OUString &Name, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
 
virtual void SAL_CALL endFastElement (sal_Int32 Element) override
 
virtual void SAL_CALL endUnknownElement (const OUString &Namespace, const OUString &Name) override
 
virtual css::uno::Reference< XFastContextHandler > SAL_CALL createFastChildContext (sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
 
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createUnknownChildContext (const OUString &Namespace, const OUString &Name, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
 
virtual void SAL_CALL characters (const OUString &aChars) override
 
virtual css::uno::Any SAL_CALL queryInterface (const css::uno::Type &aType) final override
 
virtual void SAL_CALL acquire () noexcept final override
 
virtual void SAL_CALL release () noexcept final override
 
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () final override
 
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () final override
 

Private Types

typedef std::unordered_map< TableBoxIndex, SwTableBoxFormat *, TableBoxIndexHashermap_BoxFormat
 

Private Member Functions

SwTableBoxNewTableBox (const SwStartNode *pStNd, SwTableLine *pUpper)
 
SwTableBoxMakeTableBox (SwTableLine *pUpper, const SwXMLTableCell_Impl *pStartNode, sal_uInt32 nLeftCol, sal_uInt32 nRightCol)
 
SwTableBoxMakeTableBox (SwTableLine *pUpper, sal_uInt32 nTopRow, sal_uInt32 nLeftCol, sal_uInt32 nBottomRow, sal_uInt32 nRightCol)
 
SwTableLineMakeTableLine (SwTableBox *pUpper, sal_uInt32 nTopRow, sal_uInt32 nLeftCol, sal_uInt32 nBottomRow, sal_uInt32 nRightCol)
 
void MakeTable_ (SwTableBox *pBox=nullptr)
 
void MakeTable (SwTableBox *pBox, sal_Int32 nWidth)
 
void MakeTable ()
 
SwXMLTableContextGetParentTable () const
 
const SwStartNodeGetPrevStartNode (sal_uInt32 nRow, sal_uInt32 nCol) const
 
const SwStartNodeGetLastStartNode () const
 
void FixRowSpan (sal_uInt32 nRow, sal_uInt32 nCol, sal_uInt32 nColSpan)
 
void ReplaceWithEmptyCell (sal_uInt32 nRow, sal_uInt32 nCol, bool bRows)
 
SwTableBoxFormatGetSharedBoxFormat (SwTableBox *pBox, const OUString &rStyleName, sal_Int32 nColumnWidth, bool bProtected, bool bMayShare, bool &bNew, bool *pModifyLocked)
 sets the appropriate SwTableBoxFormat at pBox. More...
 

Private Attributes

OUString m_aStyleName
 
OUString m_aDfltCellStyleName
 
OUString m_aTemplateName
 
std::vector< ColumnWidthInfom_aColumnWidths
 
std::optional< std::vector< OUString > > m_xColumnDefaultCellStyleNames
 
css::uno::Reference< css::text::XTextCursor > m_xOldCursor
 
css::uno::Reference< css::text::XTextContent > m_xTextContent
 
std::unique_ptr< SwXMLTableRows_Implm_pRows
 
SwTableNodem_pTableNode
 
SwTableBoxm_pBox1
 
bool m_bOwnsBox1
 
const SwStartNodem_pSttNd1
 
SwTableBoxFormatm_pBoxFormat
 
SwTableLineFormatm_pLineFormat
 
std::unique_ptr< map_BoxFormatm_pSharedBoxFormats
 
SvXMLImportContextRef m_xParentTable
 
rtl::Reference< SwXMLDDETableContext_Implm_xDDESource
 
bool m_bFirstSection: 1
 
bool m_bRelWidth: 1
 
bool m_bHasSubTables: 1
 
sal_uInt16 m_nHeaderRows
 
sal_uInt32 m_nCurRow
 
sal_uInt32 m_nCurCol
 
sal_uInt32 m_nNonMergedCurCol
 Same as m_nCurCol, but not incremented multiple times for table cells with row span. More...
 
sal_Int32 m_nWidth
 

Static Private Attributes

static constexpr sal_Int32 MAX_WIDTH = SAL_MAX_UINT16
 

Additional Inherited Members

- Protected Member Functions inherited from SvXMLImportContext
SvXMLImportGetImport ()
 
const SvXMLImportGetImport () const
 

Detailed Description

Definition at line 50 of file xmltbli.hxx.

Member Typedef Documentation

◆ map_BoxFormat

Definition at line 81 of file xmltbli.hxx.

Constructor & Destructor Documentation

◆ SwXMLTableContext() [1/2]

SwXMLTableContext::SwXMLTableContext ( SwXMLImport rImport,
const css::uno::Reference< css::xml::sax::XFastAttributeList > &  xAttrList 
)

if set, call pBox->LockModify() and return old lock status

◆ SwXMLTableContext() [2/2]

SwXMLTableContext::SwXMLTableContext ( SwXMLImport rImport,
SwXMLTableContext pTable 
)

Definition at line 1257 of file xmltbli.cxx.

◆ ~SwXMLTableContext()

SwXMLTableContext::~SwXMLTableContext ( )
overridevirtual

Member Function Documentation

◆ createFastChildContext()

css::uno::Reference< css::xml::sax::XFastContextHandler > SwXMLTableContext::createFastChildContext ( sal_Int32  Element,
const css::uno::Reference< css::xml::sax::XFastAttributeList > &  xAttrList 
)
overridevirtual

◆ endFastElement()

void SwXMLTableContext::endFastElement ( sal_Int32  nElement)
overridevirtual

Reimplemented from SvXMLImportContext.

Definition at line 2742 of file xmltbli.cxx.

References SvXMLImportContext::GetImport(), IsValid(), m_xOldCursor, m_xParentTable, and MakeTable().

◆ FinishRow()

void SwXMLTableContext::FinishRow ( )

Definition at line 1582 of file xmltbli.cxx.

References GetColumnCount(), InsertCell(), InsertTableSection(), m_nCurCol, and m_nCurRow.

Referenced by InsertRepRows().

◆ FixRowSpan()

void SwXMLTableContext::FixRowSpan ( sal_uInt32  nRow,
sal_uInt32  nCol,
sal_uInt32  nColSpan 
)
private

◆ GetCell() [1/2]

SwXMLTableCell_Impl * SwXMLTableContext::GetCell ( sal_uInt32  nRow,
sal_uInt32  nCol 
)

Definition at line 1109 of file xmltbli.cxx.

References m_pRows.

◆ GetCell() [2/2]

const SwXMLTableCell_Impl * SwXMLTableContext::GetCell ( sal_uInt32  nRow,
sal_uInt32  nCol 
) const

◆ GetColumnCount()

sal_uInt32 SwXMLTableContext::GetColumnCount ( ) const
inline

◆ GetColumnDefaultCellStyleName()

OUString SwXMLTableContext::GetColumnDefaultCellStyleName ( sal_uInt32  nCol) const

Definition at line 1382 of file xmltbli.cxx.

References m_xColumnDefaultCellStyleNames, and size.

Referenced by InsertCell().

◆ GetColumnWidth()

sal_Int32 SwXMLTableContext::GetColumnWidth ( sal_uInt32  nCol,
sal_uInt32  nColSpan 
) const

Definition at line 1368 of file xmltbli.cxx.

References i, and m_aColumnWidths.

Referenced by MakeTableBox().

◆ GetLastStartNode()

const SwStartNode * SwXMLTableContext::GetLastStartNode ( ) const
inlineprivate

Definition at line 207 of file xmltbli.hxx.

References GetColumnCount(), GetPrevStartNode(), and UL.

Referenced by GetPrevStartNode().

◆ GetParentTable()

SwXMLTableContext * SwXMLTableContext::GetParentTable ( ) const
inlineprivate

Definition at line 197 of file xmltbli.hxx.

References m_xParentTable.

Referenced by MakeTable().

◆ GetPrevStartNode()

const SwStartNode * SwXMLTableContext::GetPrevStartNode ( sal_uInt32  nRow,
sal_uInt32  nCol 
) const
private

◆ GetSharedBoxFormat()

SwTableBoxFormat * SwXMLTableContext::GetSharedBoxFormat ( SwTableBox pBox,
const OUString &  rStyleName,
sal_Int32  nColumnWidth,
bool  bProtected,
bool  bMayShare,
bool &  bNew,
bool *  pModifyLocked 
)
private

sets the appropriate SwTableBoxFormat at pBox.

Parameters
rStyleNamethe table box
nColumnWidthXML style name
bProtectedwidth of column
bMayShareis cell protected?
bNewmay the format be shared (no value, formula...)
pModifyLockedtrue, if the format it not from the cache

Definition at line 1694 of file xmltbli.cxx.

References SwTableBox::ChgFrameFormat(), SwTableBox::ClaimFrameFormat(), SwFormat::GetFillOrder(), m_pSharedBoxFormats, SwFormat::ResetAllFormatAttr(), and SwFormat::SetFormatAttr().

Referenced by MakeTableBox().

◆ GetSwImport()

SwXMLImport & SwXMLTableContext::GetSwImport ( )
inline

◆ InsertCell()

void SwXMLTableContext::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 
)

◆ InsertColumn()

void SwXMLTableContext::InsertColumn ( sal_Int32  nWidth,
bool  bRelWidth,
const OUString *  pDfltCellStyleName = nullptr 
)

Definition at line 1337 of file xmltbli.cxx.

References m_aColumnWidths, m_nCurCol, m_xColumnDefaultCellStyleNames, MAX_WIDTH, MINLAY, and nCount.

Referenced by InsertRow().

◆ InsertCoveredCell()

void SwXMLTableContext::InsertCoveredCell ( const OUString &  rStyleName)

Sets formatting of an already created covered cell.

Definition at line 1503 of file xmltbli.cxx.

References GetCell(), m_nCurRow, m_nNonMergedCurCol, and SwXMLTableCell_Impl::SetStyleName().

◆ InsertRepRows()

void SwXMLTableContext::InsertRepRows ( sal_uInt32  nCount)

◆ InsertRow()

void SwXMLTableContext::InsertRow ( const OUString &  rStyleName,
const OUString &  rDfltCellStyleName,
bool  bInHead 
)

◆ InsertTableSection()

const SwStartNode * SwXMLTableContext::InsertTableSection ( const SwStartNode pPrevSttNd = nullptr,
OUString const *  pStringValueStyleName = nullptr 
)

◆ IsInsertCellPossible()

bool SwXMLTableContext::IsInsertCellPossible ( ) const
inline

Definition at line 160 of file xmltbli.hxx.

References GetColumnCount(), and m_nCurCol.

◆ IsInsertColPossible()

bool SwXMLTableContext::IsInsertColPossible ( ) const
inline

Definition at line 165 of file xmltbli.hxx.

References m_nCurCol.

Referenced by createFastChildContext().

◆ IsInsertCoveredCellPossible()

bool SwXMLTableContext::IsInsertCoveredCellPossible ( ) const
inline

Determines if it's OK to insert a covered cell, given the total column count.

Definition at line 163 of file xmltbli.hxx.

References GetColumnCount(), and m_nNonMergedCurCol.

◆ IsInsertRowPossible()

bool SwXMLTableContext::IsInsertRowPossible ( ) const
inline

Definition at line 166 of file xmltbli.hxx.

References m_nCurRow.

Referenced by createFastChildContext(), and InsertRepRows().

◆ IsValid()

bool SwXMLTableContext::IsValid ( ) const
inline

Definition at line 167 of file xmltbli.hxx.

References m_pTableNode.

Referenced by createFastChildContext(), and endFastElement().

◆ MakeTable() [1/2]

void SwXMLTableContext::MakeTable ( )
private

◆ MakeTable() [2/2]

void SwXMLTableContext::MakeTable ( SwTableBox pBox,
sal_Int32  nWidth 
)
private

Definition at line 2655 of file xmltbli.cxx.

References GetParentTable(), m_bRelWidth, m_nWidth, m_pBoxFormat, m_pLineFormat, m_pRows, and MakeTable_().

Referenced by MakeTableBox().

◆ MakeTable_()

void SwXMLTableContext::MakeTable_ ( SwTableBox pBox = nullptr)
private

◆ MakeTableBox() [1/2]

SwTableBox * SwXMLTableContext::MakeTableBox ( SwTableLine pUpper,
const SwXMLTableCell_Impl pStartNode,
sal_uInt32  nLeftCol,
sal_uInt32  nRightCol 
)
private

◆ MakeTableBox() [2/2]

SwTableBox * SwXMLTableContext::MakeTableBox ( SwTableLine pUpper,
sal_uInt32  nTopRow,
sal_uInt32  nLeftCol,
sal_uInt32  nBottomRow,
sal_uInt32  nRightCol 
)
private

◆ MakeTableLine()

SwTableLine * SwXMLTableContext::MakeTableLine ( SwTableBox pUpper,
sal_uInt32  nTopRow,
sal_uInt32  nLeftCol,
sal_uInt32  nBottomRow,
sal_uInt32  nRightCol 
)
private

◆ NewTableBox()

SwTableBox * SwXMLTableContext::NewTableBox ( const SwStartNode pStNd,
SwTableLine pUpper 
)
private

◆ ReplaceWithEmptyCell()

void SwXMLTableContext::ReplaceWithEmptyCell ( sal_uInt32  nRow,
sal_uInt32  nCol,
bool  bRows 
)
private

◆ SetHasSubTables()

void SwXMLTableContext::SetHasSubTables ( bool  bNew)
inline

Definition at line 194 of file xmltbli.hxx.

References m_bHasSubTables.

Member Data Documentation

◆ m_aColumnWidths

std::vector<ColumnWidthInfo> SwXMLTableContext::m_aColumnWidths
private

Definition at line 62 of file xmltbli.hxx.

Referenced by GetColumnCount(), GetColumnWidth(), InsertCell(), InsertColumn(), and MakeTable_().

◆ m_aDfltCellStyleName

OUString SwXMLTableContext::m_aDfltCellStyleName
private

Definition at line 53 of file xmltbli.hxx.

Referenced by InsertCell().

◆ m_aStyleName

OUString SwXMLTableContext::m_aStyleName
private

Definition at line 52 of file xmltbli.hxx.

Referenced by MakeTable().

◆ m_aTemplateName

OUString SwXMLTableContext::m_aTemplateName
private

Definition at line 54 of file xmltbli.hxx.

Referenced by MakeTable().

◆ m_bFirstSection

bool SwXMLTableContext::m_bFirstSection
private

Definition at line 88 of file xmltbli.hxx.

Referenced by InsertTableSection().

◆ m_bHasSubTables

bool SwXMLTableContext::m_bHasSubTables
private

Definition at line 90 of file xmltbli.hxx.

Referenced by MakeTable(), MakeTable_(), MakeTableLine(), and SetHasSubTables().

◆ m_bOwnsBox1

bool SwXMLTableContext::m_bOwnsBox1
private

Definition at line 72 of file xmltbli.hxx.

Referenced by MakeTable(), NewTableBox(), and ~SwXMLTableContext().

◆ m_bRelWidth

bool SwXMLTableContext::m_bRelWidth
private

Definition at line 89 of file xmltbli.hxx.

Referenced by MakeTable(), and MakeTable_().

◆ m_nCurCol

sal_uInt32 SwXMLTableContext::m_nCurCol
private

◆ m_nCurRow

sal_uInt32 SwXMLTableContext::m_nCurRow
private

◆ m_nHeaderRows

sal_uInt16 SwXMLTableContext::m_nHeaderRows
private

Definition at line 92 of file xmltbli.hxx.

Referenced by InsertRow(), and MakeTable().

◆ m_nNonMergedCurCol

sal_uInt32 SwXMLTableContext::m_nNonMergedCurCol
private

Same as m_nCurCol, but not incremented multiple times for table cells with row span.

Definition at line 96 of file xmltbli.hxx.

Referenced by InsertCell(), InsertCoveredCell(), InsertRow(), and IsInsertCoveredCellPossible().

◆ m_nWidth

sal_Int32 SwXMLTableContext::m_nWidth
private

Definition at line 97 of file xmltbli.hxx.

Referenced by MakeTable(), and MakeTable_().

◆ m_pBox1

SwTableBox* SwXMLTableContext::m_pBox1
private

Definition at line 71 of file xmltbli.hxx.

Referenced by InsertTableSection(), MakeTable(), NewTableBox(), and ~SwXMLTableContext().

◆ m_pBoxFormat

SwTableBoxFormat* SwXMLTableContext::m_pBoxFormat
private

Definition at line 75 of file xmltbli.hxx.

Referenced by MakeTable(), MakeTableBox(), and NewTableBox().

◆ m_pLineFormat

SwTableLineFormat* SwXMLTableContext::m_pLineFormat
private

Definition at line 76 of file xmltbli.hxx.

Referenced by MakeTable(), and MakeTableLine().

◆ m_pRows

std::unique_ptr<SwXMLTableRows_Impl> SwXMLTableContext::m_pRows
private

◆ m_pSharedBoxFormats

std::unique_ptr<map_BoxFormat> SwXMLTableContext::m_pSharedBoxFormats
private

Definition at line 82 of file xmltbli.hxx.

Referenced by GetSharedBoxFormat(), and ~SwXMLTableContext().

◆ m_pSttNd1

const SwStartNode* SwXMLTableContext::m_pSttNd1
private

Definition at line 73 of file xmltbli.hxx.

Referenced by MakeTable().

◆ m_pTableNode

SwTableNode* SwXMLTableContext::m_pTableNode
private

Definition at line 70 of file xmltbli.hxx.

Referenced by InsertTableSection(), IsValid(), MakeTable(), MakeTable_(), and MakeTableLine().

◆ m_xColumnDefaultCellStyleNames

std::optional<std::vector<OUString> > SwXMLTableContext::m_xColumnDefaultCellStyleNames
private

◆ m_xDDESource

rtl::Reference<SwXMLDDETableContext_Impl> SwXMLTableContext::m_xDDESource
private

Definition at line 86 of file xmltbli.hxx.

Referenced by createFastChildContext(), and MakeTable().

◆ m_xOldCursor

css::uno::Reference< css::text::XTextCursor > SwXMLTableContext::m_xOldCursor
private

Definition at line 65 of file xmltbli.hxx.

Referenced by endFastElement().

◆ m_xParentTable

SvXMLImportContextRef SwXMLTableContext::m_xParentTable
private

Definition at line 84 of file xmltbli.hxx.

Referenced by endFastElement(), GetParentTable(), InsertTableSection(), and NewTableBox().

◆ m_xTextContent

css::uno::Reference< css::text::XTextContent > SwXMLTableContext::m_xTextContent
private

Definition at line 66 of file xmltbli.hxx.

◆ MAX_WIDTH

constexpr sal_Int32 SwXMLTableContext::MAX_WIDTH = SAL_MAX_UINT16
staticconstexprprivate

Definition at line 102 of file xmltbli.hxx.

Referenced by InsertColumn(), MakeTable(), and MakeTable_().


The documentation for this class was generated from the following files: