LibreOffice Module svx (master) 1
|
#include <tablelayouter.hxx>
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::SvxBorderLine * | 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 More... | |
void | updateCells (::tools::Rectangle const &rRectangle) |
std::vector< EdgeInfo > | getHorizontalEdges () |
sal_Int32 | getHorizontalEdge (int nEdgeY, sal_Int32 *pnMin, sal_Int32 *pnMax) |
std::vector< EdgeInfo > | getVerticalEdges () |
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< Layout > | LayoutVector |
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 |
Definition at line 67 of file tablelayouter.hxx.
|
private |
Definition at line 156 of file tablelayouter.hxx.
|
explicit |
Definition at line 53 of file tablelayouter.cxx.
sdr::table::TableLayouter::~TableLayouter | ( | ) |
Definition at line 59 of file tablelayouter.cxx.
References ClearBorderLayout().
sal_Int32 sdr::table::TableLayouter::calcPreferredColumnWidth | ( | sal_Int32 | nColumn, |
Size | aSize | ||
) | const |
Definition at line 171 of file tablelayouter.cxx.
References calcPreferredColumnWidth(), getCell(), isValidColumn(), and maRows.
Referenced by calcPreferredColumnWidth(), and DistributeColumns().
|
private |
Definition at line 1009 of file tablelayouter.cxx.
References ClearBorderLayout(), maHorizontalBorders, and maVerticalBorders.
Referenced by ClearBorderLayout(), ResizeBorderLayout(), and ~TableLayouter().
|
staticprivate |
Definition at line 1015 of file tablelayouter.cxx.
References sdr::table::gEmptyBorder.
|
staticprivate |
Definition at line 500 of file tablelayouter.cxx.
References o3tl::checked_add(), o3tl::checked_multiply(), o3tl::checked_sub(), sdr::table::TableLayouter::Layout::mnMinSize, mnSize, sdr::table::TableLayouter::Layout::mnSize, n, nCount, nIndex, and o3tl::saturating_add().
Referenced by LayoutTableHeight(), and LayoutTableWidth().
void sdr::table::TableLayouter::DistributeColumns | ( | ::tools::Rectangle & | rArea, |
sal_Int32 | nFirstCol, | ||
sal_Int32 | nLastCol, | ||
const bool | bOptimize, | ||
const bool | bMinimize | ||
) |
Definition at line 1102 of file tablelayouter.cxx.
References Any, calcPreferredColumnWidth(), Exception, getColumnCount(), getColumnWidth(), sdr::table::gsSize(), LayoutTable(), mxTable, nIndex, and TOOLS_WARN_EXCEPTION.
void sdr::table::TableLayouter::DistributeRows | ( | ::tools::Rectangle & | rArea, |
sal_Int32 | nFirstRow, | ||
sal_Int32 | nLastRow, | ||
const bool | bOptimize, | ||
const bool | bMinimize | ||
) |
Definition at line 1199 of file tablelayouter.cxx.
References tools::Rectangle::AdjustBottom(), Any, Exception, getRowHeight(), sdr::table::gsSize(), LayoutTable(), maRows, mnSize, mxTable, and TOOLS_WARN_EXCEPTION.
void sdr::table::TableLayouter::dumpAsXml | ( | xmlTextWriterPtr | pWriter | ) | const |
Definition at line 1282 of file tablelayouter.cxx.
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().
Definition at line 932 of file tablelayouter.cxx.
References Exception, sdr::table::CellPos::mnCol, sdr::table::CellPos::mnRow, mxTable, and TOOLS_WARN_EXCEPTION.
Referenced by calcPreferredColumnWidth(), LayoutTableHeight(), LayoutTableWidth(), UpdateBorderLayout(), and updateCells().
bool sdr::table::TableLayouter::getCellArea | ( | const CellRef & | xCell, |
const CellPos & | rPos, | ||
basegfx::B2IRectangle & | rArea | ||
) | const |
For RTL Table Calculate the Right End of cell instead of Left
Definition at line 108 of file tablelayouter.cxx.
References o3tl::checked_add(), o3tl::checked_sub(), Exception, getCellSize(), basegfx::Tuple2D< typename TYPE >::getX(), basegfx::Tuple2D< typename TYPE >::getY(), isValid(), maColumns, maRows, sdr::table::CellPos::mnCol, sdr::table::CellPos::mnRow, mxTable, TOOLS_WARN_EXCEPTION, x, and y.
Referenced by sdr::contact::createPrimitive2DSequenceImpl(), and updateCells().
|
private |
Definition at line 65 of file tablelayouter.cxx.
References Exception, getColumnCount(), getRowCount(), maColumns, maRows, sdr::table::CellPos::mnCol, sdr::table::CellPos::mnRow, o3tl::saturating_add(), and TOOLS_WARN_EXCEPTION.
Referenced by getCellArea().
|
inline |
Definition at line 89 of file tablelayouter.hxx.
References maColumns.
Referenced by DistributeColumns(), getCellSize(), getVerticalEdge(), LayoutTable(), LayoutTableHeight(), LayoutTableWidth(), ResizeBorderLayout(), UpdateBorderLayout(), and updateCells().
sal_Int32 sdr::table::TableLayouter::getColumnWidth | ( | sal_Int32 | nColumn | ) | const |
Definition at line 163 of file tablelayouter.cxx.
References isValidColumn(), and maColumns.
Referenced by sdr::table::SdrTableObj::AddToHdlList(), sdr::contact::createPrimitive2DSequenceImpl(), and DistributeColumns().
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().
std::vector< EdgeInfo > sdr::table::TableLayouter::getHorizontalEdges | ( | ) |
Definition at line 250 of file tablelayouter.cxx.
References getHorizontalEdge(), i, and maRows.
sal_Int32 sdr::table::TableLayouter::getMinimumColumnWidth | ( | sal_Int32 | nColumn | ) |
Definition at line 486 of file tablelayouter.cxx.
References isValidColumn(), and maColumns.
Referenced by getVerticalEdge().
|
inline |
Definition at line 88 of file tablelayouter.hxx.
References maRows.
Referenced by getCellSize(), getHorizontalEdge(), LayoutTable(), LayoutTableHeight(), LayoutTableWidth(), ResizeBorderLayout(), UpdateBorderLayout(), and updateCells().
sal_Int32 sdr::table::TableLayouter::getRowHeight | ( | sal_Int32 | nRow | ) | const |
Definition at line 154 of file tablelayouter.cxx.
References isValidRow(), and maRows.
Referenced by sdr::table::SdrTableObj::AddToHdlList(), sdr::contact::createPrimitive2DSequenceImpl(), and DistributeRows().
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().
std::vector< EdgeInfo > sdr::table::TableLayouter::getVerticalEdges | ( | ) |
Definition at line 266 of file tablelayouter.cxx.
References getVerticalEdge(), i, and maColumns.
|
staticprivate |
???
Definition at line 947 of file tablelayouter.cxx.
References sdr::table::gEmptyBorder.
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 210 of file tablelayouter.cxx.
References maHorizontalBorders, and maVerticalBorders.
Referenced by sdr::table::SdrTableObj::AddToHdlList().
|
inlineprivate |
Definition at line 135 of file tablelayouter.hxx.
References isValidColumn(), isValidRow(), sdr::table::CellPos::mnCol, and sdr::table::CellPos::mnRow.
Referenced by getCellArea().
|
inlineprivate |
Definition at line 133 of file tablelayouter.hxx.
References maColumns, and o3tl::make_unsigned().
Referenced by calcPreferredColumnWidth(), getColumnWidth(), getMinimumColumnWidth(), and isValid().
|
inlineprivate |
Definition at line 134 of file tablelayouter.hxx.
References o3tl::make_unsigned(), and 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 873 of file tablelayouter.cxx.
References getColumnCount(), getRowCount(), LayoutTableHeight(), LayoutTableWidth(), maColumns, maRows, mxTable, and UpdateBorderLayout().
Referenced by DistributeColumns(), and DistributeRows().
void sdr::table::TableLayouter::LayoutTableHeight | ( | ::tools::Rectangle & | rArea, |
bool | bFit | ||
) |
Definition at line 725 of file tablelayouter.cxx.
References Any, DBG_ASSERT, distribute(), getCell(), getColumnCount(), tools::Rectangle::getOpenHeight(), getRowCount(), tools::Rectangle::GetWidth(), sdr::table::gsSize(), maRows, mnSize, mxTable, o3tl::saturating_add(), tools::Rectangle::SetSize(), u, and updateCells().
Referenced by LayoutTable().
void sdr::table::TableLayouter::LayoutTableWidth | ( | ::tools::Rectangle & | rArea, |
bool | bFit | ||
) |
Definition at line 576 of file tablelayouter.cxx.
References Any, DBG_ASSERT, distribute(), getCell(), getColumnCount(), tools::Rectangle::GetHeight(), tools::Rectangle::getOpenWidth(), getRowCount(), sdr::table::gsSize(), maColumns, mnSize, mxTable, sdr::table::RangeIterator< T >::next(), o3tl::saturating_add(), tools::Rectangle::SetSize(), u, and updateCells().
Referenced by LayoutTable().
|
private |
Definition at line 1036 of file tablelayouter.cxx.
References ClearBorderLayout(), maHorizontalBorders, maVerticalBorders, and ResizeBorderLayout().
Referenced by ResizeBorderLayout(), and UpdateBorderLayout().
|
private |
Definition at line 1044 of file tablelayouter.cxx.
References getColumnCount(), getRowCount(), and size.
|
private |
Definition at line 981 of file tablelayouter.cxx.
References sdr::table::gEmptyBorder, HasPriority(), maHorizontalBorders, and maVerticalBorders.
Referenced by UpdateBorderLayout().
void sdr::table::TableLayouter::UpdateBorderLayout | ( | ) |
Definition at line 1060 of file tablelayouter.cxx.
References SvxBoxItem::GetBottom(), getCell(), getColumnCount(), SvxBoxItem::GetLeft(), SvxBoxItem::GetRight(), getRowCount(), SvxBoxItem::GetTop(), sdr::table::CellPos::mnCol, sdr::table::CellPos::mnRow, ResizeBorderLayout(), SDRATTR_TABLE_BORDER(), and SetBorder().
Referenced by LayoutTable().
void sdr::table::TableLayouter::updateCells | ( | ::tools::Rectangle const & | rRectangle | ) |
Definition at line 902 of file tablelayouter.cxx.
References getCell(), getCellArea(), getColumnCount(), basegfx::Range2D< typename TYPE, typename TRAITS >::getMaxX(), basegfx::Range2D< typename TYPE, typename TRAITS >::getMaxY(), basegfx::Range2D< typename TYPE, typename TRAITS >::getMinX(), basegfx::Range2D< typename TYPE, typename TRAITS >::getMinY(), getRowCount(), tools::Rectangle::Left(), sdr::table::CellPos::mnCol, sdr::table::CellPos::mnRow, tools::Rectangle::Move(), tools::Rectangle::SetBottom(), tools::Rectangle::SetLeft(), tools::Rectangle::SetRight(), tools::Rectangle::SetTop(), and tools::Rectangle::Top().
Referenced by LayoutTableHeight(), and LayoutTableWidth().
|
private |
Definition at line 162 of file tablelayouter.hxx.
Referenced by dumpAsXml(), getCellArea(), getCellSize(), getColumnCount(), getColumnWidth(), getMinimumColumnWidth(), getVerticalEdge(), getVerticalEdges(), isValidColumn(), LayoutTable(), and LayoutTableWidth().
|
private |
Definition at line 164 of file tablelayouter.hxx.
Referenced by ClearBorderLayout(), getBorderLine(), isEdgeVisible(), ResizeBorderLayout(), and SetBorder().
|
private |
Definition at line 161 of file tablelayouter.hxx.
Referenced by calcPreferredColumnWidth(), DistributeRows(), dumpAsXml(), getCellArea(), getCellSize(), getHorizontalEdge(), getHorizontalEdges(), getRowCount(), getRowHeight(), isValidRow(), LayoutTable(), and LayoutTableHeight().
|
private |
Definition at line 165 of file tablelayouter.hxx.
Referenced by ClearBorderLayout(), getBorderLine(), isEdgeVisible(), ResizeBorderLayout(), and SetBorder().
|
private |
Definition at line 160 of file tablelayouter.hxx.
Referenced by DistributeColumns(), DistributeRows(), getCell(), getCellArea(), getVerticalEdge(), LayoutTable(), LayoutTableHeight(), and LayoutTableWidth().