LibreOffice Module sw (master) 1
|
#include <swtable.hxx>
#include <swcrsr.hxx>
#include <tblsel.hxx>
#include <tblrwcl.hxx>
#include <ndtxt.hxx>
#include <ndole.hxx>
#include <node.hxx>
#include <UndoTable.hxx>
#include <pam.hxx>
#include <frmfmt.hxx>
#include <frmatr.hxx>
#include <cellfrm.hxx>
#include <fmtfsize.hxx>
#include <doc.hxx>
#include <IDocumentUndoRedo.hxx>
#include <IDocumentContentOperations.hxx>
#include <IDocumentFieldsAccess.hxx>
#include <IDocumentLayoutAccess.hxx>
#include <IDocumentRedlineAccess.hxx>
#include <cstdlib>
#include <vector>
#include <set>
#include <list>
#include <memory>
#include <editeng/boxitem.hxx>
#include <editeng/protitem.hxx>
#include <swtblfmt.hxx>
#include <calbck.hxx>
#include <sal/log.hxx>
#include <osl/diagnose.h>
Go to the source code of this file.
Classes | |
class | SwBoxSelection |
SwBoxSelection is a small helperclass (structure) to handle selections of cells (boxes) between table functions. More... | |
Macros | |
#define | CHECK_TABLE(t) (t).CheckConsistency(); |
Typedefs | |
typedef std::pair< sal_uInt16, sal_uInt16 > | SwLineOffset |
typedef std::vector< SwLineOffset > | SwLineOffsetArray |
typedef std::set< SwTwips > | SwSplitLines |
Functions | |
static void | lcl_CheckMinMax (tools::Long &rMin, tools::Long &rMax, const SwTableLine &rLine, size_t nCheck, bool bSet) |
lcl_CheckMinMax helps evaluating (horizontal) min/max of boxes More... | |
static tools::Long | lcl_Box2LeftBorder (const SwTableBox &rBox) |
lcl_Box2LeftBorder(..) delivers the left (logical) border of a table box More... | |
static SwTableBox * | lcl_LeftBorder2Box (tools::Long nLeft, const SwTableLine *pLine) |
lcl_LeftBorder2Box delivers the box to a given left border More... | |
static void | lcl_ChangeRowSpan (const SwTable &rTable, const tools::Long nDiff, sal_uInt16 nRowIdx, const bool bSingle) |
lcl_ChangeRowSpan corrects row span after insertion/deletion of rows More... | |
static void | lcl_InvalidateCellFrame (const SwTableBox &rBox) |
lcl_InvalidateCellFrame(..) invalidates all layout representations of a given cell to initiate a reformatting More... | |
static tools::Long | lcl_InsertPosition (SwTable &rTable, std::vector< sal_uInt16 > &rInsPos, const SwSelBoxes &rBoxes, bool bBehind) |
lcl_InsertPosition(..) evaluates the insert positions in every table line, when a selection of cells is given and returns the average cell widths More... | |
static void | lcl_getAllMergedBoxes (const SwTable &rTable, SwSelBoxes &rBoxes, SwTableBox &rBox) |
lcl_getAllMergedBoxes(..) collects all overlapped boxes to a given (master) box More... | |
static void | lcl_UnMerge (const SwTable &rTable, SwTableBox &rBox, size_t nCnt, bool bSameHeight) |
lcl_UnMerge(..) manipulates the row span attribute of a given master cell and its overlapped cells to split them into several pieces. More... | |
static void | lcl_FillSelBoxes (SwSelBoxes &rBoxes, SwTableLine &rLine) |
lcl_FillSelBoxes(..) puts all boxes of a given line into the selection structure More... | |
static void | lcl_SophisticatedFillLineIndices (SwLineOffsetArray &rArr, const SwTable &rTable, const SwSelBoxes &rBoxes, sal_uInt16 nCnt) |
static sal_uInt16 | lcl_CalculateSplitLineHeights (SwSplitLines &rCurr, SwSplitLines &rNew, const SwTable &rTable, const SwSelBoxes &rBoxes, sal_uInt16 nCnt) |
lcl_CalculateSplitLineHeights(..) delivers all y-positions where table rows have to be split to fulfill the requested "split same height" More... | |
static sal_uInt16 | lcl_LineIndex (const SwTable &rTable, const SwSelBoxes &rBoxes, bool bBehind) |
lcl_LineIndex(..) delivers the line index of the line behind or above the box selection. More... | |
static void | lcl_SearchSelBox (const SwTable &rTable, SwSelBoxes &rBoxes, tools::Long nMin, tools::Long nMax, SwTableLine &rLine, bool bChkProtected, bool bColumn) |
lcl_SearchSelBox(..) adds cells of a given table row to the selection structure if it overlaps with the given x-position range More... | |
Definition at line 52 of file swnewtable.cxx.
typedef std::pair< sal_uInt16, sal_uInt16 > SwLineOffset |
Definition at line 1221 of file swnewtable.cxx.
typedef std::vector< SwLineOffset > SwLineOffsetArray |
Definition at line 1222 of file swnewtable.cxx.
typedef std::set< SwTwips > SwSplitLines |
Definition at line 1319 of file swnewtable.cxx.
|
static |
lcl_Box2LeftBorder(..) delivers the left (logical) border of a table box
The left logical border of a table box is the sum of the cell width before this box.
rBox | is the requested table box |
Definition at line 164 of file swnewtable.cxx.
References SwTableBox::GetFrameFormat(), SwFormat::GetFrameSize(), SwTableLine::GetTabBoxes(), SwTableBox::GetUpper(), SvxSizeItem::GetWidth(), and nCount.
Referenced by SwTableBox::FindEndOfRowSpan(), SwTableBox::FindStartOfRowSpan(), lcl_getAllMergedBoxes(), SwTable::PrepareDelBoxes(), and SwTable::RestoreRowSpan().
|
static |
lcl_CalculateSplitLineHeights(..) delivers all y-positions where table rows have to be split to fulfill the requested "split same height"
Definition at line 1325 of file swnewtable.cxx.
References SwTableLines::GetPos(), SwTableBox::getRowSpan(), SwTable::GetTabLines(), SwTableBox::GetUpper(), i, SwTableLines::insert(), and o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::size().
Referenced by SwTable::NewSplitRow().
|
static |
lcl_ChangeRowSpan corrects row span after insertion/deletion of rows
lcl_ChangeRowSpan(..) has to be called after an insertion or deletion of rows to adjust the row spans of previous rows accordingly. If rows are deleted, the previous rows with row spans into the deleted area have to be decremented by the number of overlapped inserted rows. If rows are inserted, the previous rows with row span into the inserted area have to be incremented by the number of inserted rows. For those row spans which ends exactly above the inserted area it has to be decided by the parameter bSingle if they have to be expanded or not.
rTable | the table to manipulate (has to be a new model table) |
nDiff | the number of rows which has been inserted (nDiff > 0) or deleted (nDiff < 0) |
nRowIdx | the index of the first row which has to be checked |
bSingle | true if the new inserted row should not extend row spans which ends in the row above this is for rows inserted by UI "insert row" false if all cells of an inserted row has to be overlapped by the previous row this is for rows inserted by "split row" false is also needed for deleted rows |
Definition at line 259 of file swnewtable.cxx.
References SwTableLine::GetTabBoxes(), SwTable::GetTabLines(), and SwTableLines::size().
Referenced by SwTable::CleanUpBottomRowSpan(), SwTable::ConvertSubtableBox(), SwTable::InsertRow(), and SwTable::InsertSpannedRow().
|
static |
lcl_CheckMinMax helps evaluating (horizontal) min/max of boxes
lcl_CheckMinMax(..) compares the left border and the right border of a given cell with the given range and sets it accordingly.
rMin | will be decremented if necessary to the left border of the cell |
rMax | will be incremented if necessary to the right border of the cell |
rLine | the row (table line) of the interesting box |
nCheck | the index of the box in the table box array of the given row |
bSet | if bSet is false, rMin and rMax will be manipulated if necessary if bSet is true, rMin and rMax will be set to the left and right border of the box |
Definition at line 126 of file swnewtable.cxx.
References SwTableBox::GetFrameFormat(), SwFormat::GetFrameSize(), SwTableLine::GetTabBoxes(), and SvxSizeItem::GetWidth().
Referenced by SwTable::CollectBoxSelection(), SwTable::CreateSelection(), and SwTable::ExpandColumnSelection().
|
static |
lcl_FillSelBoxes(..) puts all boxes of a given line into the selection structure
Definition at line 1176 of file swnewtable.cxx.
References SwTableLine::GetTabBoxes(), i, and o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::insert().
Referenced by SwTable::InsertRow(), and SwTable::InsertSpannedRow().
|
static |
lcl_getAllMergedBoxes(..) collects all overlapped boxes to a given (master) box
Definition at line 1100 of file swnewtable.cxx.
References SwTableBox::FindStartOfRowSpan(), SwTableLines::GetPos(), SwTableBox::getRowSpan(), SwTable::GetTabLines(), SwTableBox::GetUpper(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::insert(), lcl_Box2LeftBorder(), lcl_LeftBorder2Box(), nCount, and SwTableLines::size().
Referenced by SwTable::ExpandSelection(), lcl_SearchSelBox(), and lcl_UnMerge().
|
static |
lcl_InsertPosition(..) evaluates the insert positions in every table line, when a selection of cells is given and returns the average cell widths
Definition at line 610 of file swnewtable.cxx.
References SwTableLine::GetBoxPos(), SwTableLines::GetPos(), SwTable::GetTabLines(), SwTableBox::GetUpper(), nCount, and o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::size().
Referenced by SwTable::NewInsertCol().
|
static |
lcl_InvalidateCellFrame(..) invalidates all layout representations of a given cell to initiate a reformatting
Definition at line 591 of file swnewtable.cxx.
References SwIterator< TElementType, TSource, eMode >::First(), SwTableBox::GetFrameFormat(), SwFrame::GetLower(), SwFrame::InvalidateSize_(), and SwIterator< TElementType, TSource, eMode >::Next().
Referenced by lcl_UnMerge(), and SwTable::PrepareDelBoxes().
|
static |
lcl_LeftBorder2Box delivers the box to a given left border
It's used to find the master/follow table boxes in previous/next rows. Don't call this function to check if there is such a box, call it if you know there has to be such box.
nLeft | the left border (logical x-value) of the demanded box |
rLine | the row (table line) to be scanned |
Definition at line 199 of file swnewtable.cxx.
References abs(), SwTableBox::GetFrameFormat(), SwFormat::GetFrameSize(), SwTableLine::GetTabBoxes(), SvxSizeItem::GetWidth(), nCount, and SAL_WARN.
Referenced by SwTableBox::FindEndOfRowSpan(), SwTableBox::FindStartOfRowSpan(), lcl_getAllMergedBoxes(), SwTable::PrepareDelBoxes(), and SwTable::RestoreRowSpan().
|
static |
lcl_LineIndex(..) delivers the line index of the line behind or above the box selection.
Definition at line 1387 of file swnewtable.cxx.
References SwTableLines::GetPos(), SwTableBox::getRowSpan(), SwTable::GetTabLines(), i, nPos, and o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::size().
Referenced by SwTable::InsertRow().
|
static |
lcl_SearchSelBox(..) adds cells of a given table row to the selection structure if it overlaps with the given x-position range
Definition at line 1642 of file swnewtable.cxx.
References SwTableBox::FindStartOfRowSpan(), SwTableBox::GetFrameFormat(), SwFormat::GetFrameSize(), SwFormat::GetProtect(), SwTableBox::getRowSpan(), SwTableLine::GetTabBoxes(), SvxSizeItem::GetWidth(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::insert(), SvxProtectItem::IsContentProtected(), lcl_getAllMergedBoxes(), nCount, and o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::size().
Referenced by SwTable::CreateSelection().
|
static |
Definition at line 1235 of file swnewtable.cxx.
References SwTableLines::GetPos(), SwTableBox::getRowSpan(), SwTable::GetTabLines(), SwTableBox::GetUpper(), i, and o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::size().
Referenced by SwTable::NewSplitRow().
|
static |
lcl_UnMerge(..) manipulates the row span attribute of a given master cell and its overlapped cells to split them into several pieces.
Definition at line 1123 of file swnewtable.cxx.
References SwTableLine::GetFrameFormat(), SwFormat::GetFrameSize(), SvxSizeItem::GetHeight(), i, lcl_getAllMergedBoxes(), lcl_InvalidateCellFrame(), nCount, and o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::size().
Referenced by SwTable::NewSplitRow().