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 (const 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
 

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
 
void LayoutTableWidth (::tools::Rectangle &rArea, bool bFit)
 
void LayoutTableHeight (::tools::Rectangle &rArea, bool bFit)
 
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 69 of file tablelayouter.hxx.

Member Typedef Documentation

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

Definition at line 158 of file tablelayouter.hxx.

Constructor & Destructor Documentation

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

Definition at line 57 of file tablelayouter.cxx.

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

Definition at line 63 of file tablelayouter.cxx.

References ClearBorderLayout().

Member Function Documentation

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

Definition at line 175 of file tablelayouter.cxx.

References getCell(), isValidColumn(), and maRows.

Referenced by DistributeColumns().

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

Definition at line 1022 of file tablelayouter.cxx.

References maHorizontalBorders, and maVerticalBorders.

Referenced by ResizeBorderLayout(), and ~TableLayouter().

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

Definition at line 1028 of file tablelayouter.cxx.

References svx::nColCount.

sal_Int32 sdr::table::TableLayouter::distribute ( LayoutVector rLayouts,
sal_Int32  nDistribute 
)
staticprivate
void sdr::table::TableLayouter::DistributeColumns ( ::tools::Rectangle rArea,
sal_Int32  nFirstCol,
sal_Int32  nLastCol,
const bool  bOptimize,
const bool  bMinimize 
)
void sdr::table::TableLayouter::DistributeRows ( ::tools::Rectangle rArea,
sal_Int32  nFirstRow,
sal_Int32  nLastRow,
const bool  bOptimize,
const bool  bMinimize 
)
void sdr::table::TableLayouter::dumpAsXml ( xmlTextWriterPtr  pWriter) const

Definition at line 1289 of file tablelayouter.cxx.

References maColumns, and maRows.

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 233 of file tablelayouter.cxx.

References maHorizontalBorders, maVerticalBorders, and size.

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

CellRef sdr::table::TableLayouter::getCell ( const CellPos rPos) const
private
bool sdr::table::TableLayouter::getCellArea ( const CellRef xCell,
const CellPos rPos,
basegfx::B2IRectangle rArea 
) const
basegfx::B2ITuple sdr::table::TableLayouter::getCellSize ( const CellRef xCell,
const CellPos rPos 
) const
private
::sal_Int32 sdr::table::TableLayouter::getColumnCount ( ) const
inline
sal_Int32 sdr::table::TableLayouter::getColumnWidth ( sal_Int32  nColumn) const

Definition at line 167 of file tablelayouter.cxx.

References isValidColumn(), and maColumns.

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

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

Definition at line 286 of file tablelayouter.cxx.

References getRowCount(), and maRows.

Referenced by getHorizontalEdges().

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

Definition at line 254 of file tablelayouter.cxx.

References getHorizontalEdge(), i, and maRows.

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

Definition at line 490 of file tablelayouter.cxx.

References isValidColumn(), and maColumns.

Referenced by getVerticalEdge().

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

Definition at line 158 of file tablelayouter.cxx.

References isValidRow(), and maRows.

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

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

Definition at line 316 of file tablelayouter.cxx.

References getColumnCount(), getMinimumColumnWidth(), maColumns, mxTable, and svx::nColCount.

Referenced by getVerticalEdges().

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

Definition at line 270 of file tablelayouter.cxx.

References getVerticalEdge(), i, and maColumns.

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

???

Definition at line 960 of file tablelayouter.cxx.

Referenced by SetBorder().

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 214 of file tablelayouter.cxx.

References maHorizontalBorders, maVerticalBorders, and size.

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

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

Definition at line 135 of file tablelayouter.hxx.

References maColumns.

Referenced by calcPreferredColumnWidth(), getColumnWidth(), getMinimumColumnWidth(), and isValid().

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

Definition at line 136 of file tablelayouter.hxx.

References maRows.

Referenced by getRowHeight(), and isValid().

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 886 of file tablelayouter.cxx.

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

Referenced by DistributeColumns(), and DistributeRows().

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

Definition at line 1049 of file tablelayouter.cxx.

References ClearBorderLayout(), maHorizontalBorders, and maVerticalBorders.

Referenced by UpdateBorderLayout().

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

Definition at line 1057 of file tablelayouter.cxx.

References getColumnCount(), getRowCount(), svx::nColCount, and size.

void sdr::table::TableLayouter::SetBorder ( sal_Int32  nCol,
sal_Int32  nRow,
bool  bHorizontal,
const editeng::SvxBorderLine pLine 
)
private
void sdr::table::TableLayouter::UpdateBorderLayout ( )
void sdr::table::TableLayouter::updateCells ( ::tools::Rectangle const &  rRectangle)

Member Data Documentation

LayoutVector sdr::table::TableLayouter::maColumns
private
BorderLineMap sdr::table::TableLayouter::maHorizontalBorders
private
LayoutVector sdr::table::TableLayouter::maRows
private
BorderLineMap sdr::table::TableLayouter::maVerticalBorders
private
TableModelRef sdr::table::TableLayouter::mxTable
private

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