LibreOffice Module svx (master) 1
Classes | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
sdr::table::TableLayouter Class Referencefinal

#include <tablelayouter.hxx>

Collaboration diagram for sdr::table::TableLayouter:
[legend]

Classes

struct  Layout
 

Public Member Functions

 TableLayouter (TableModelRef xTableModel)
 
 ~TableLayouter ()
 
void LayoutTable (::tools::Rectangle &rRectangle, bool bFitWidth, bool bFitHeight)
 try to fit the table into the given rectangle. More...
 
void UpdateBorderLayout ()
 
bool getCellArea (const CellRef &xCell, const CellPos &rPos, basegfx::B2IRectangle &rArea) const
 
::sal_Int32 getRowCount () const
 
::sal_Int32 getColumnCount () const
 
sal_Int32 getRowHeight (sal_Int32 nRow) const
 
sal_Int32 getColumnWidth (sal_Int32 nColumn) const
 
sal_Int32 calcPreferredColumnWidth (sal_Int32 nColumn, Size aSize) const
 
sal_Int32 getMinimumColumnWidth (sal_Int32 nColumn)
 
bool isEdgeVisible (sal_Int32 nEdgeX, sal_Int32 nEdgeY, bool bHorizontal) const
 checks if the given edge is visible. More...
 
editeng::SvxBorderLinegetBorderLine (sal_Int32 nEdgeX, sal_Int32 nEdgeY, bool bHorizontal) const
 returns the requested borderline in rpBorderLine or a null pointer if there is no border at this edge More...
 
void updateCells (::tools::Rectangle const &rRectangle)
 
std::vector< EdgeInfogetHorizontalEdges ()
 
sal_Int32 getHorizontalEdge (int nEdgeY, sal_Int32 *pnMin, sal_Int32 *pnMax)
 
std::vector< EdgeInfogetVerticalEdges ()
 
sal_Int32 getVerticalEdge (int nEdgeX, sal_Int32 *pnMin, sal_Int32 *pnMax)
 
void DistributeColumns (::tools::Rectangle &rArea, sal_Int32 nFirstCol, sal_Int32 nLastCol, const bool bOptimize, const bool bMinimize)
 
void DistributeRows (::tools::Rectangle &rArea, sal_Int32 nFirstRow, sal_Int32 nLastRow, const bool bOptimize, const bool bMinimize)
 
void dumpAsXml (xmlTextWriterPtr pWriter) const
 
void LayoutTableWidth (::tools::Rectangle &rArea, bool bFit)
 
void LayoutTableHeight (::tools::Rectangle &rArea, bool bFit)
 

Private Types

typedef std::vector< LayoutLayoutVector
 

Private Member Functions

CellRef getCell (const CellPos &rPos) const
 
basegfx::B2ITuple getCellSize (const CellRef &xCell, const CellPos &rPos) const
 
bool isValidColumn (sal_Int32 nColumn) const
 
bool isValidRow (sal_Int32 nRow) const
 
bool isValid (const CellPos &rPos) const
 
void ClearBorderLayout ()
 
void ResizeBorderLayout ()
 
void ResizeBorderLayout (BorderLineMap &rMap)
 
void SetBorder (sal_Int32 nCol, sal_Int32 nRow, bool bHorizontal, const editeng::SvxBorderLine *pLine)
 

Static Private Member Functions

static void ClearBorderLayout (BorderLineMap &rMap)
 
static bool HasPriority (const editeng::SvxBorderLine *pThis, const editeng::SvxBorderLine *pOther)
 
static sal_Int32 distribute (LayoutVector &rLayouts, sal_Int32 nDistribute)
 

Private Attributes

TableModelRef mxTable
 
LayoutVector maRows
 
LayoutVector maColumns
 
BorderLineMap maHorizontalBorders
 
BorderLineMap maVerticalBorders
 

Detailed Description

Definition at line 67 of file tablelayouter.hxx.

Member Typedef Documentation

◆ LayoutVector

typedef std::vector< Layout > sdr::table::TableLayouter::LayoutVector
private

Definition at line 156 of file tablelayouter.hxx.

Constructor & Destructor Documentation

◆ TableLayouter()

sdr::table::TableLayouter::TableLayouter ( TableModelRef  xTableModel)
explicit

Definition at line 53 of file tablelayouter.cxx.

◆ ~TableLayouter()

sdr::table::TableLayouter::~TableLayouter ( )

Definition at line 59 of file tablelayouter.cxx.

References ClearBorderLayout().

Member Function Documentation

◆ calcPreferredColumnWidth()

sal_Int32 sdr::table::TableLayouter::calcPreferredColumnWidth ( sal_Int32  nColumn,
Size  aSize 
) const

◆ ClearBorderLayout() [1/2]

void sdr::table::TableLayouter::ClearBorderLayout ( )
private

◆ ClearBorderLayout() [2/2]

void sdr::table::TableLayouter::ClearBorderLayout ( BorderLineMap rMap)
staticprivate

Definition at line 1015 of file tablelayouter.cxx.

References sdr::table::gEmptyBorder.

◆ distribute()

sal_Int32 sdr::table::TableLayouter::distribute ( LayoutVector rLayouts,
sal_Int32  nDistribute 
)
staticprivate

◆ DistributeColumns()

void sdr::table::TableLayouter::DistributeColumns ( ::tools::Rectangle rArea,
sal_Int32  nFirstCol,
sal_Int32  nLastCol,
const bool  bOptimize,
const bool  bMinimize 
)

◆ DistributeRows()

void sdr::table::TableLayouter::DistributeRows ( ::tools::Rectangle rArea,
sal_Int32  nFirstRow,
sal_Int32  nLastRow,
const bool  bOptimize,
const bool  bMinimize 
)

◆ dumpAsXml()

void sdr::table::TableLayouter::dumpAsXml ( xmlTextWriterPtr  pWriter) const

Definition at line 1282 of file tablelayouter.cxx.

References maColumns, and maRows.

◆ getBorderLine()

SvxBorderLine * sdr::table::TableLayouter::getBorderLine ( sal_Int32  nEdgeX,
sal_Int32  nEdgeY,
bool  bHorizontal 
) const

returns the requested borderline in rpBorderLine or a null pointer if there is no border at this edge

Definition at line 229 of file tablelayouter.cxx.

References sdr::table::gEmptyBorder, maHorizontalBorders, and maVerticalBorders.

Referenced by sdr::table::SdrTableObj::AddToHdlList(), and sdr::contact::impGetLineStyle().

◆ getCell()

CellRef sdr::table::TableLayouter::getCell ( const CellPos rPos) const
private

◆ getCellArea()

bool sdr::table::TableLayouter::getCellArea ( const CellRef xCell,
const CellPos rPos,
basegfx::B2IRectangle rArea 
) const

◆ getCellSize()

basegfx::B2ITuple sdr::table::TableLayouter::getCellSize ( const CellRef xCell,
const CellPos rPos 
) const
private

◆ getColumnCount()

::sal_Int32 sdr::table::TableLayouter::getColumnCount ( ) const
inline

◆ getColumnWidth()

sal_Int32 sdr::table::TableLayouter::getColumnWidth ( sal_Int32  nColumn) const

◆ getHorizontalEdge()

sal_Int32 sdr::table::TableLayouter::getHorizontalEdge ( int  nEdgeY,
sal_Int32 *  pnMin,
sal_Int32 *  pnMax 
)

Definition at line 282 of file tablelayouter.cxx.

References getRowCount(), and maRows.

Referenced by getHorizontalEdges().

◆ getHorizontalEdges()

std::vector< EdgeInfo > sdr::table::TableLayouter::getHorizontalEdges ( )

Definition at line 250 of file tablelayouter.cxx.

References getHorizontalEdge(), i, and maRows.

◆ getMinimumColumnWidth()

sal_Int32 sdr::table::TableLayouter::getMinimumColumnWidth ( sal_Int32  nColumn)

Definition at line 486 of file tablelayouter.cxx.

References isValidColumn(), and maColumns.

Referenced by getVerticalEdge().

◆ getRowCount()

::sal_Int32 sdr::table::TableLayouter::getRowCount ( ) const
inline

◆ getRowHeight()

sal_Int32 sdr::table::TableLayouter::getRowHeight ( sal_Int32  nRow) const

◆ getVerticalEdge()

sal_Int32 sdr::table::TableLayouter::getVerticalEdge ( int  nEdgeX,
sal_Int32 *  pnMin,
sal_Int32 *  pnMax 
)

Definition at line 312 of file tablelayouter.cxx.

References getColumnCount(), getMinimumColumnWidth(), maColumns, and mxTable.

Referenced by getVerticalEdges().

◆ getVerticalEdges()

std::vector< EdgeInfo > sdr::table::TableLayouter::getVerticalEdges ( )

Definition at line 266 of file tablelayouter.cxx.

References getVerticalEdge(), i, and maColumns.

◆ HasPriority()

bool sdr::table::TableLayouter::HasPriority ( const editeng::SvxBorderLine pThis,
const editeng::SvxBorderLine pOther 
)
staticprivate

???

Definition at line 947 of file tablelayouter.cxx.

References sdr::table::gEmptyBorder.

Referenced by SetBorder().

◆ isEdgeVisible()

bool sdr::table::TableLayouter::isEdgeVisible ( sal_Int32  nEdgeX,
sal_Int32  nEdgeY,
bool  bHorizontal 
) const

checks if the given edge is visible.

Edges between merged cells are not visible.

Definition at line 210 of file tablelayouter.cxx.

References maHorizontalBorders, and maVerticalBorders.

Referenced by sdr::table::SdrTableObj::AddToHdlList().

◆ isValid()

bool sdr::table::TableLayouter::isValid ( const CellPos rPos) const
inlineprivate

◆ isValidColumn()

bool sdr::table::TableLayouter::isValidColumn ( sal_Int32  nColumn) const
inlineprivate

◆ isValidRow()

bool sdr::table::TableLayouter::isValidRow ( sal_Int32  nRow) const
inlineprivate

Definition at line 134 of file tablelayouter.hxx.

References o3tl::make_unsigned(), and maRows.

Referenced by getRowHeight(), and isValid().

◆ LayoutTable()

void sdr::table::TableLayouter::LayoutTable ( ::tools::Rectangle rRectangle,
bool  bFitWidth,
bool  bFitHeight 
)

try to fit the table into the given rectangle.

If the rectangle is too small, it will be grown to fit the table.

if bFitWidth or bFitHeight is set, the layouter tries to scale the rows and/or columns to the given area. The result my be bigger to fulfill constrains.

if bFitWidth or bFitHeight is set, the model is changed.

If the rectangle is too small, it will be grown to fit the table.

Definition at line 873 of file tablelayouter.cxx.

References getColumnCount(), getRowCount(), LayoutTableHeight(), LayoutTableWidth(), maColumns, maRows, mxTable, and UpdateBorderLayout().

Referenced by DistributeColumns(), and DistributeRows().

◆ LayoutTableHeight()

void sdr::table::TableLayouter::LayoutTableHeight ( ::tools::Rectangle rArea,
bool  bFit 
)

◆ LayoutTableWidth()

void sdr::table::TableLayouter::LayoutTableWidth ( ::tools::Rectangle rArea,
bool  bFit 
)

◆ ResizeBorderLayout() [1/2]

void sdr::table::TableLayouter::ResizeBorderLayout ( )
private

◆ ResizeBorderLayout() [2/2]

void sdr::table::TableLayouter::ResizeBorderLayout ( BorderLineMap rMap)
private

Definition at line 1044 of file tablelayouter.cxx.

References getColumnCount(), getRowCount(), and size.

◆ SetBorder()

void sdr::table::TableLayouter::SetBorder ( sal_Int32  nCol,
sal_Int32  nRow,
bool  bHorizontal,
const editeng::SvxBorderLine pLine 
)
private

◆ UpdateBorderLayout()

void sdr::table::TableLayouter::UpdateBorderLayout ( )

◆ updateCells()

void sdr::table::TableLayouter::updateCells ( ::tools::Rectangle const &  rRectangle)

Member Data Documentation

◆ maColumns

LayoutVector sdr::table::TableLayouter::maColumns
private

◆ maHorizontalBorders

BorderLineMap sdr::table::TableLayouter::maHorizontalBorders
private

◆ maRows

LayoutVector sdr::table::TableLayouter::maRows
private

◆ maVerticalBorders

BorderLineMap sdr::table::TableLayouter::maVerticalBorders
private

◆ mxTable

TableModelRef sdr::table::TableLayouter::mxTable
private

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