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, sal_uInt16 nPrfx, const OUString &rLName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList)
 if set, call pBox->LockModify() and return old lock status More...
 
 SwXMLTableContext (SwXMLImport &rImport, sal_uInt16 nPrfx, const OUString &rLName, SwXMLTableContext *pTable)
 
virtual ~SwXMLTableContext () override
 
virtual SvXMLImportContextRef CreateChildContext (sal_uInt16 nPrefix, const OUString &rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > &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 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 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 EndElement () override
 
void SetHasSubTables (bool bNew)
 
- Public Member Functions inherited from XMLTextTableContext
 XMLTextTableContext (SvXMLImport &rImport, sal_uInt16 nPrfx, const OUString &rLName)
 
virtual ~XMLTextTableContext () override
 
- Public Member Functions inherited from SvXMLImportContext
sal_uInt16 GetPrefix () const
 
const OUString & GetLocalName () const
 
 SvXMLImportContext (SvXMLImport &rImport, sal_uInt16 nPrfx, const OUString &rLName)
 
 SvXMLImportContext (SvXMLImport &rImport)
 
virtual ~SvXMLImportContext () override
 
virtual void StartElement (const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList)
 
virtual void Characters (const OUString &rChars)
 
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
 

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::unique_ptr< std::vector< OUString > > m_pColumnDefaultCellStyleNames
 
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_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 48 of file xmltbli.hxx.

Member Typedef Documentation

Definition at line 79 of file xmltbli.hxx.

Constructor & Destructor Documentation

SwXMLTableContext::SwXMLTableContext ( SwXMLImport rImport,
sal_uInt16  nPrfx,
const OUString &  rLName,
const css::uno::Reference< css::xml::sax::XAttributeList > &  xAttrList 
)

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

SwXMLTableContext::SwXMLTableContext ( SwXMLImport rImport,
sal_uInt16  nPrfx,
const OUString &  rLName,
SwXMLTableContext pTable 
)

Definition at line 1359 of file xmltbli.cxx.

SwXMLTableContext::~SwXMLTableContext ( )
overridevirtual

Member Function Documentation

SvXMLImportContextRef SwXMLTableContext::CreateChildContext ( sal_uInt16  nPrefix,
const OUString &  rLocalName,
const css::uno::Reference< css::xml::sax::XAttributeList > &  xAttrList 
)
overridevirtual
void SwXMLTableContext::EndElement ( )
overridevirtual
void SwXMLTableContext::FinishRow ( )
void SwXMLTableContext::FixRowSpan ( sal_uInt32  nRow,
sal_uInt32  nCol,
sal_uInt32  nColSpan 
)
private
const SwXMLTableCell_Impl * SwXMLTableContext::GetCell ( sal_uInt32  nRow,
sal_uInt32  nCol 
) const
SwXMLTableCell_Impl * SwXMLTableContext::GetCell ( sal_uInt32  nRow,
sal_uInt32  nCol 
)

Definition at line 1213 of file xmltbli.cxx.

References m_pRows.

sal_uInt32 SwXMLTableContext::GetColumnCount ( ) const
inline
OUString SwXMLTableContext::GetColumnDefaultCellStyleName ( sal_uInt32  nCol) const

Definition at line 1493 of file xmltbli.cxx.

References m_pColumnDefaultCellStyleNames, and size.

Referenced by InsertCell().

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

Definition at line 1479 of file xmltbli.cxx.

References i, and m_aColumnWidths.

Referenced by MakeTableBox().

const SwStartNode * SwXMLTableContext::GetLastStartNode ( ) const
inlineprivate

Definition at line 197 of file xmltbli.hxx.

References GetColumnCount(), and GetPrevStartNode().

Referenced by GetPrevStartNode().

SwXMLTableContext * SwXMLTableContext::GetParentTable ( ) const
inlineprivate

Definition at line 187 of file xmltbli.hxx.

References m_xParentTable.

Referenced by MakeTable().

const SwStartNode * SwXMLTableContext::GetPrevStartNode ( sal_uInt32  nRow,
sal_uInt32  nCol 
) const
private
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 1791 of file xmltbli.cxx.

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

Referenced by MakeTableBox().

SwXMLImport& SwXMLTableContext::GetSwImport ( )
inline
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 
)
void SwXMLTableContext::InsertColumn ( sal_Int32  nWidth,
bool  bRelWidth,
const OUString *  pDfltCellStyleName = nullptr 
)
void SwXMLTableContext::InsertRepRows ( sal_uInt32  nCount)
void SwXMLTableContext::InsertRow ( const OUString &  rStyleName,
const OUString &  rDfltCellStyleName,
bool  bInHead 
)
const SwStartNode * SwXMLTableContext::InsertTableSection ( const SwStartNode pPrevSttNd = nullptr,
OUString const *  pStringValueStyleName = nullptr 
)
bool SwXMLTableContext::IsInsertCellPossible ( ) const
inline

Definition at line 158 of file xmltbli.hxx.

References GetColumnCount().

bool SwXMLTableContext::IsInsertColPossible ( ) const
inline

Definition at line 159 of file xmltbli.hxx.

References USHRT_MAX.

Referenced by CreateChildContext().

bool SwXMLTableContext::IsInsertRowPossible ( ) const
inline

Definition at line 160 of file xmltbli.hxx.

References USHRT_MAX.

Referenced by CreateChildContext(), and InsertRepRows().

bool SwXMLTableContext::IsValid ( ) const
inline

Definition at line 161 of file xmltbli.hxx.

Referenced by CreateChildContext(), and EndElement().

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

Definition at line 2765 of file xmltbli.cxx.

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

Referenced by MakeTableBox().

void SwXMLTableContext::MakeTable ( )
private
void SwXMLTableContext::MakeTable_ ( SwTableBox pBox = nullptr)
private
SwTableBox * SwXMLTableContext::MakeTableBox ( SwTableLine pUpper,
const SwXMLTableCell_Impl pStartNode,
sal_uInt32  nLeftCol,
sal_uInt32  nRightCol 
)
private
SwTableBox * SwXMLTableContext::MakeTableBox ( SwTableLine pUpper,
sal_uInt32  nTopRow,
sal_uInt32  nLeftCol,
sal_uInt32  nBottomRow,
sal_uInt32  nRightCol 
)
private
SwTableLine * SwXMLTableContext::MakeTableLine ( SwTableBox pUpper,
sal_uInt32  nTopRow,
sal_uInt32  nLeftCol,
sal_uInt32  nBottomRow,
sal_uInt32  nRightCol 
)
private
SwTableBox * SwXMLTableContext::NewTableBox ( const SwStartNode pStNd,
SwTableLine pUpper 
)
private
void SwXMLTableContext::ReplaceWithEmptyCell ( sal_uInt32  nRow,
sal_uInt32  nCol,
bool  bRows 
)
private
void SwXMLTableContext::SetHasSubTables ( bool  bNew)
inline

Definition at line 184 of file xmltbli.hxx.

References m_bHasSubTables.

Referenced by SwXMLTableCellContext_Impl::CreateChildContext().

Member Data Documentation

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

Definition at line 60 of file xmltbli.hxx.

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

OUString SwXMLTableContext::m_aDfltCellStyleName
private

Definition at line 51 of file xmltbli.hxx.

Referenced by InsertCell().

OUString SwXMLTableContext::m_aStyleName
private

Definition at line 50 of file xmltbli.hxx.

Referenced by MakeTable().

OUString SwXMLTableContext::m_aTemplateName
private

Definition at line 52 of file xmltbli.hxx.

Referenced by MakeTable().

bool SwXMLTableContext::m_bFirstSection
private

Definition at line 86 of file xmltbli.hxx.

Referenced by InsertTableSection().

bool SwXMLTableContext::m_bHasSubTables
private

Definition at line 88 of file xmltbli.hxx.

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

bool SwXMLTableContext::m_bOwnsBox1
private

Definition at line 70 of file xmltbli.hxx.

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

bool SwXMLTableContext::m_bRelWidth
private

Definition at line 87 of file xmltbli.hxx.

Referenced by MakeTable(), and MakeTable_().

sal_uInt32 SwXMLTableContext::m_nCurCol
private

Definition at line 92 of file xmltbli.hxx.

Referenced by FinishRow(), InsertCell(), InsertColumn(), InsertRepRows(), and InsertRow().

sal_uInt32 SwXMLTableContext::m_nCurRow
private

Definition at line 91 of file xmltbli.hxx.

Referenced by FinishRow(), InsertCell(), InsertRepRows(), InsertRow(), and MakeTable_().

sal_uInt16 SwXMLTableContext::m_nHeaderRows
private

Definition at line 90 of file xmltbli.hxx.

Referenced by InsertRow(), and MakeTable().

sal_Int32 SwXMLTableContext::m_nWidth
private

Definition at line 93 of file xmltbli.hxx.

Referenced by MakeTable(), and MakeTable_().

SwTableBox* SwXMLTableContext::m_pBox1
private

Definition at line 69 of file xmltbli.hxx.

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

SwTableBoxFormat* SwXMLTableContext::m_pBoxFormat
private

Definition at line 73 of file xmltbli.hxx.

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

std::unique_ptr<std::vector<OUString> > SwXMLTableContext::m_pColumnDefaultCellStyleNames
private
SwTableLineFormat* SwXMLTableContext::m_pLineFormat
private

Definition at line 74 of file xmltbli.hxx.

Referenced by MakeTable(), and MakeTableLine().

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

Definition at line 80 of file xmltbli.hxx.

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

const SwStartNode* SwXMLTableContext::m_pSttNd1
private

Definition at line 71 of file xmltbli.hxx.

Referenced by MakeTable().

SwTableNode* SwXMLTableContext::m_pTableNode
private

Definition at line 68 of file xmltbli.hxx.

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

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

Definition at line 84 of file xmltbli.hxx.

Referenced by CreateChildContext(), and MakeTable().

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

Definition at line 63 of file xmltbli.hxx.

Referenced by EndElement().

SvXMLImportContextRef SwXMLTableContext::m_xParentTable
private

Definition at line 82 of file xmltbli.hxx.

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

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

Definition at line 64 of file xmltbli.hxx.

constexpr sal_Int32 SwXMLTableContext::MAX_WIDTH = SAL_MAX_UINT16
staticprivate

Definition at line 98 of file xmltbli.hxx.

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


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