LibreOffice Module sw (master) 1
|
#include "swtable.hxx"
#include "swrect.hxx"
#include "swdllapi.h"
#include <o3tl/sorted_vector.hxx>
#include <memory>
#include <deque>
#include <vector>
Go to the source code of this file.
Classes | |
struct | CompareSwSelBoxes |
class | SwSelBoxes |
struct | o3tl::typed_flags< SwTableSearchType > |
class | SwSelUnion |
class | FndBox_ |
class | FndLine_ |
struct | FndPara |
Namespaces | |
namespace | o3tl |
Typedefs | |
typedef std::deque< SwCellFrame * > | SwCellFrames |
typedef std::vector< SwSelUnion > | SwSelUnions |
typedef std::vector< std::unique_ptr< FndBox_ > > | FndBoxes_t |
typedef std::vector< std::unique_ptr< FndLine_ > > | FndLines_t |
Enumerations | |
enum class | SwTableSearchType : sal_uInt16 { NONE = 0x01 , Row = 0x02 , Col = 0x03 , Protect = 0x08 , NoUnionCorrect = 0x10 } |
Functions | |
SW_DLLPUBLIC void | GetTableSel (const SwCursorShell &rShell, SwSelBoxes &rBoxes, const SwTableSearchType=SwTableSearchType::NONE) |
void | GetTableSel (const SwCursor &rCursor, SwSelBoxes &rBoxes, const SwTableSearchType=SwTableSearchType::NONE) |
void | GetTableSel (const SwLayoutFrame *pStart, const SwLayoutFrame *pEnd, SwSelBoxes &rBoxes, SwCellFrames *pCells, const SwTableSearchType=SwTableSearchType::NONE) |
void | GetTableSelCrs (const SwCursorShell &rShell, SwSelBoxes &rBoxes) |
void | GetTableSelCrs (const SwTableCursor &rTableCursor, SwSelBoxes &rBoxes) |
bool | GetAutoSumSel (const SwCursorShell &, SwCellFrames &) |
bool | HasProtectedCells (const SwSelBoxes &rBoxes) |
bool | ChkChartSel (const SwNode &rSttNd, const SwNode &rEndNd) |
bool | IsFrameInTableSel (const SwRect &rUnion, const SwFrame *pCell) |
void | GetMergeSel (const SwPaM &rPam, SwSelBoxes &rBoxes, SwTableBox **ppMergeBox, SwUndoTableMerge *pUndo) |
TableMergeErr | CheckMergeSel (const SwPaM &rPam) |
TableMergeErr | CheckMergeSel (const SwSelBoxes &rBoxes) |
bool | IsEmptyBox (const SwTableBox &rBox, SwPaM &rPam) |
bool | CheckSplitCells (const SwCursorShell &rShell, sal_uInt16 nDiv, const SwTableSearchType) |
bool | CheckSplitCells (const SwCursor &rCursor, sal_uInt16 nDiv, const SwTableSearchType) |
void | MakeSelUnions (SwSelUnions &, const SwLayoutFrame *pStart, const SwLayoutFrame *pEnd, const SwTableSearchType=SwTableSearchType::NONE) |
SW_DLLPUBLIC void | ForEach_FndLineCopyCol (SwTableLines &rLines, FndPara *pFndPara) |
This creates a structure mirroring the SwTable structure that contains all rows and non-leaf boxes (as pointers to SwTableBox/SwTableLine, not copies), plus the leaf boxes that are selected by pFndPara->rBoxes. More... | |
typedef std::vector<std::unique_ptr<FndBox_> > FndBoxes_t |
Definition at line 154 of file tblsel.hxx.
typedef std::vector<std::unique_ptr<FndLine_> > FndLines_t |
Definition at line 155 of file tblsel.hxx.
typedef std::deque< SwCellFrame* > SwCellFrames |
Definition at line 43 of file tblsel.hxx.
typedef std::vector<SwSelUnion> SwSelUnions |
Definition at line 138 of file tblsel.hxx.
|
strong |
Enumerator | |
---|---|
NONE | |
Row | |
Col | |
Protect | |
NoUnionCorrect |
Definition at line 58 of file tblsel.hxx.
TableMergeErr CheckMergeSel | ( | const SwPaM & | rPam | ) |
Definition at line 1446 of file tblsel.cxx.
References CheckMergeSel(), IDocumentLayoutAccess::GetCurrentLayout(), SwNode::GetDoc(), SwDoc::getIDocumentLayoutAccess(), SwContentNode::getLayoutFrame(), SwPaM::GetMarkContentNode(), SwPaM::GetPointContentNode(), GetTableSel(), and SwFrame::GetUpper().
Referenced by CheckMergeSel(), and SwDoc::MergeTable().
TableMergeErr CheckMergeSel | ( | const SwSelBoxes & | rBoxes | ) |
Definition at line 1467 of file tblsel.cxx.
References o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::empty(), ForEach_FndLineCopyCol(), FndLine_::GetBoxes(), FndBox_::GetLines(), SwTableNode::GetTable(), SwTable::GetTabLines(), lcl_CheckCol(), lcl_CheckRow(), NoSelection, Ok, FndPara::rBoxes, and TooComplex.
bool CheckSplitCells | ( | const SwCursor & | rCursor, |
sal_uInt16 | nDiv, | ||
const | SwTableSearchType | ||
) |
Definition at line 1958 of file tblsel.cxx.
References SwLayoutFrame::FirstCell(), IDocumentLayoutAccess::GetCurrentLayout(), SwNode::GetDoc(), SwTabFrame::GetFirstNonHeadlineRow(), SwFrameAreaDefinition::getFrameArea(), SwDoc::getIDocumentLayoutAccess(), SwContentNode::getLayoutFrame(), SwPaM::GetMarkContentNode(), SwShellCursor::GetMkPos(), SwFrame::GetNext(), SwPaM::GetPointContentNode(), SwShellCursor::GetPtPos(), SwTabFrame::GetTable(), SwFrame::GetUpper(), SwRectFnSet::GetWidth(), SwLayoutFrame::IsAnLower(), SwFrame::IsCellFrame(), IsFrameInTableSel(), SwFrame::IsRowFrame(), lcl_FindNextCellFrame(), SwLayoutFrame::Lower(), MakeSelUnions(), MINLAY, and SwRect::Overlaps().
bool CheckSplitCells | ( | const SwCursorShell & | rShell, |
sal_uInt16 | nDiv, | ||
const | SwTableSearchType | ||
) |
Definition at line 1949 of file tblsel.cxx.
References CheckSplitCells(), SwCursorShell::GetCursor(), SwCursorShell::getShellCursor(), and SwCursorShell::IsTableMode().
Referenced by CheckSplitCells(), SwDoc::InsertCol(), SwFEShell::InsertCol(), and SwFEShell::SplitTab().
Definition at line 426 of file tblsel.cxx.
References SwRect::Bottom(), SwFrame::Calc(), SwNode::FindTableNode(), SwLayoutFrame::FirstCell(), SwNode::GetContentNode(), IDocumentLayoutAccess::GetCurrentLayout(), SwRootFrame::GetCurrShell(), SwNode::GetDoc(), SwTabFrame::GetFirstNonHeadlineRow(), SwTabFrame::GetFollow(), SwFrameAreaDefinition::getFrameArea(), SwRectFnSet::GetHeight(), SwDoc::getIDocumentLayoutAccess(), SwContentNode::getLayoutFrame(), SwRectFnSet::GetLeft(), SwFrame::GetNext(), SwNodeIndex::GetNode(), SwNodeIndex::GetNodes(), SwViewShell::GetOut(), SwRectFnSet::GetRight(), SwFrame::getRootFrame(), SwSelUnion::GetTable(), SwTabFrame::GetTable(), SwRectFnSet::GetTop(), SwSelUnion::GetUnion(), SwFrame::GetUpper(), SwRectFnSet::GetWidth(), SwNodes::GoNextSection(), i, SwFrame::InvalidatePos(), SwLayoutFrame::IsAnLower(), SwFrame::IsCellFrame(), SwFrameAreaDefinition::isFrameAreaDefinitionValid(), SwFrame::IsRightToLeft(), SwFrame::IsRowFrame(), SwRectFnSet::IsVert(), lcl_FindNextCellFrame(), SwRect::Left(), LONG_MAX, SwLayoutFrame::Lower(), MakeSelUnions(), n, NoUnionCorrect, SwRect::Overlaps(), SwRect::Right(), SwFrame::SetCompletePaint(), SwTabFrame::SetONECalcLowers(), and SwRect::Top().
Referenced by SwTable::IsTableComplexForChart().
SW_DLLPUBLIC void ForEach_FndLineCopyCol | ( | SwTableLines & | rLines, |
FndPara * | pFndPara | ||
) |
This creates a structure mirroring the SwTable structure that contains all rows and non-leaf boxes (as pointers to SwTableBox/SwTableLine, not copies), plus the leaf boxes that are selected by pFndPara->rBoxes.
Definition at line 2090 of file tblsel.cxx.
References SwTableLines::begin(), SwTableLines::end(), and FndLineCopyCol().
Referenced by CheckMergeSel(), SwTable::CopyHeadlineIntoTable(), SwFEShell::DeleteRow(), SwDoc::DeleteRow(), FndBoxCopyCol(), SwDoc::GetTableAutoFormat(), SwTable::InsertCol(), SwTable::InsertRow_(), SwTable::InsNewTable(), SwTable::InsTable(), lcl_CollectLines(), lcl_GetSelTable(), SwTable::MakeCopy(), SwTable::OldMerge(), SwDoc::SetTableAutoFormat(), and SwDoc::SortTable().
bool GetAutoSumSel | ( | const SwCursorShell & | rShell, |
SwCellFrames & | rBoxes | ||
) |
Definition at line 157 of file tblsel.cxx.
void GetMergeSel | ( | const SwPaM & | rPam, |
SwSelBoxes & | rBoxes, | ||
SwTableBox ** | ppMergeBox, | ||
SwUndoTableMerge * | pUndo | ||
) |
Definition at line 927 of file tblsel.cxx.
References SwUndoTableMerge::AddNewBox(), SwPosition::Adjust(), IDocumentContentOperations::AppendTextNode(), SwPosition::Assign(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::begin(), SwRect::Bottom(), SwTableBox::ClaimFrameFormat(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::clear(), COLFUZZY, DEFAULT, SwNodes::Delete(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::empty(), SwNode::EndOfSectionIndex(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::erase(), SwLayoutFrame::FirstCell(), SwFormat::GetAttrSet(), SvxBoxItem::GetBottom(), SwFormat::GetBox(), SwTableLine::GetBoxPos(), IDocumentLayoutAccess::GetCurrentLayout(), SwNode::GetDoc(), SwFormat::GetDoc(), SwTabFrame::GetFirstNonHeadlineRow(), SwLayoutFrame::GetFormat(), SwFrameAreaDefinition::getFrameArea(), SwTableBox::GetFrameFormat(), SwFormat::GetFrameSize(), SwDoc::getIDocumentContentOperations(), SwDoc::getIDocumentLayoutAccess(), SwDoc::GetIDocumentUndoRedo(), SfxItemSet::GetItemIfSet(), SwContentNode::getLayoutFrame(), SvxBoxItem::GetLeft(), SwPaM::GetMarkContentNode(), SwFrame::GetNext(), SwNodeIndex::GetNode(), SwPosition::GetNode(), SwDoc::GetNodes(), SwPaM::GetPoint(), SwPaM::GetPointContentNode(), SwRectFnSet::GetPos(), SvxBoxItem::GetRight(), SwTableBox::GetSttIdx(), SwTableLine::GetTabBoxes(), SwTabFrame::GetTable(), SwTable::GetTabSortBoxes(), SwTextNode::GetText(), SwNode::GetTextNode(), SvxBoxItem::GetTop(), SwRect::GetUnion(), SwTableBox::GetUpper(), SwFrame::GetUpper(), SvxSizeItem::GetWidth(), i, o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::insert(), SwLayoutFrame::IsAnLower(), SwFrame::IsCellFrame(), IsEmptyBox(), SwFrame::IsRowFrame(), SwRectFnSet::IsVert(), lcl_FindNextCellFrame(), lcl_InsTableBox(), SwRect::Left(), SwContentNode::Len(), SwLayoutFrame::Lower(), MakeSelUnions(), SwUndoTableMerge::MoveBoxContent(), IDocumentContentOperations::MoveNodeRange(), n, SwRect::Overlaps(), RES_BOX(), SwRect::Right(), sal_False, sal_True, SwUndoTableMerge::SaveCollection(), SwPosition::SetContent(), SwFormat::SetFormatAttr(), SvxBoxItem::SetLine(), SvxSizeItem::SetWidth(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::size(), SwRect::Top(), Variable, SwRect::Width(), and Y.
Referenced by SwTable::PrepareMerge().
void GetTableSel | ( | const SwCursor & | rCursor, |
SwSelBoxes & | rBoxes, | ||
const | SwTableSearchType = SwTableSearchType::NONE |
||
) |
Definition at line 159 of file tblsel.cxx.
References Col, SwTable::CreateSelection(), SwNode::FindTableNode(), SwNode::GetContentNode(), IDocumentLayoutAccess::GetCurrentLayout(), SwNode::GetDoc(), SwTableBox::GetFrameFormat(), SwDoc::getIDocumentLayoutAccess(), SwContentNode::getLayoutFrame(), SwPaM::GetMarkContentNode(), SwPaM::GetMarkNode(), SwShellCursor::GetMkPos(), SwPaM::GetPointContentNode(), SwPaM::GetPointNode(), SwTableLines::GetPos(), SwFormat::GetProtect(), SwShellCursor::GetPtPos(), SwTableLine::GetTabBoxes(), SwTableNode::GetTable(), SwTable::GetTableBox(), GetTableSel(), SwTable::GetTabLines(), SwTableBox::GetUpper(), SwFrame::GetUpper(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::insert(), SvxProtectItem::IsContentProtected(), SwTable::IsNewModel(), SwTable::IsTableComplex(), n, Protect, Row, SwTable::SEARCH_COL, SwTable::SEARCH_NONE, SwTable::SEARCH_ROW, and SwNode::StartOfSectionIndex().
SW_DLLPUBLIC void GetTableSel | ( | const SwCursorShell & | rShell, |
SwSelBoxes & | rBoxes, | ||
const | SwTableSearchType = SwTableSearchType::NONE |
||
) |
Definition at line 149 of file tblsel.cxx.
References SwCursorShell::GetCursor(), SwCursorShell::getShellCursor(), GetTableSel(), and SwCursorShell::IsTableMode().
Referenced by CheckMergeSel(), SwFEShell::Copy(), SwEditShell::CopySelToDoc(), SwFEShell::DeleteCol(), SwDoc::DeleteCol(), SwFEShell::DeleteRow(), SwDoc::DeleteRow(), SwTableShell::Execute(), SwTableFormula::GetBoxes(), SwTableShell::GetState(), GetTableSel(), SwDoc::GetTabRows(), SwDoc::InsertCol(), SwFEShell::InsertCol(), SwDoc::InsertRow(), SwFEShell::InsertRow(), lcl_GetSelTable(), SwFEShell::NewFlyFrame(), SwFEShell::Paste(), SwCursorShell::SelTableRowOrCol(), SwFEShell::Sort(), SwFEShell::SplitTab(), and SwWriter::Write().
void GetTableSel | ( | const SwLayoutFrame * | pStart, |
const SwLayoutFrame * | pEnd, | ||
SwSelBoxes & | rBoxes, | ||
SwCellFrames * | pCells, | ||
const | SwTableSearchType = SwTableSearchType::NONE |
||
) |
Definition at line 245 of file tblsel.cxx.
References SwRect::BottomLeft(), SwRect::BottomRight(), SwFrame::Calc(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::clear(), SwFrame::FindTabFrame(), SwLayoutFrame::FirstCell(), SwRootFrame::GetCurrShell(), SwTabFrame::GetFirstNonHeadlineRow(), SwTabFrame::GetFollow(), SwFrameAreaDefinition::getFrameArea(), SwTableBox::GetFrameFormat(), SwFrame::GetNext(), SwViewShell::GetOut(), SwFormat::GetProtect(), SwFrame::getRootFrame(), SwSelUnion::GetTable(), SwTabFrame::GetTable(), SwSelUnion::GetUnion(), Point::getX(), Point::getY(), SwDeletionChecker::HasBeenDeleted(), i, o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::insert(), SwFrame::InvalidatePos(), SwLayoutFrame::IsAnLower(), SwFrame::IsCellFrame(), SvxProtectItem::IsContentProtected(), SwFrameAreaDefinition::isFrameAreaDefinitionValid(), IsFrameInTableSel(), SwFrame::IsRowFrame(), lcl_FindNextCellFrame(), LONG_MAX, SwLayoutFrame::Lower(), MakeSelUnions(), SwRect::Overlaps(), Protect, SwFrame::SetCompletePaint(), SwTabFrame::SetONECalcLowers(), SwRect::TopLeft(), and SwRect::TopRight().
void GetTableSelCrs | ( | const SwCursorShell & | rShell, |
SwSelBoxes & | rBoxes | ||
) |
Definition at line 124 of file tblsel.cxx.
References o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::clear(), SwTableCursor::GetSelectedBoxes(), SwCursorShell::GetTableCursor(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::insert(), SwCursorShell::IsTableMode(), and SwCursorShell::UpdateTableSelBoxes().
Referenced by SwFEShell::CanUnProtectCells(), SwFEShell::DeleteTableSel(), SwFEShell::GetTableAutoFormat(), SwEditShell::GetTableBoxFormulaAttrs(), SwFEShell::HasWholeTabSelection(), SwFEShell::IsAdjustCellWidthAllowed(), lcl_GetBoxSel(), SwEditShell::SetTableBoxFormulaAttrs(), SwFEShell::UnProtectCells(), and SwFEShell::UpdateTableStyleFormatting().
void GetTableSelCrs | ( | const SwTableCursor & | rTableCursor, |
SwSelBoxes & | rBoxes | ||
) |
Definition at line 133 of file tblsel.cxx.
References o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::clear(), IDocumentLayoutAccess::GetCurrentLayout(), SwPaM::GetDoc(), SwDoc::getIDocumentLayoutAccess(), SwTableCursor::GetSelectedBoxes(), SwTableCursor::GetSelectedBoxesCount(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::insert(), SwTableCursor::IsChgd(), and SwRootFrame::MakeTableCursors().
bool HasProtectedCells | ( | const SwSelBoxes & | rBoxes | ) |
Definition at line 854 of file tblsel.cxx.
References n, and o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::size().
Referenced by SwFEShell::CanUnProtectCells(), SwDoc::DeleteCol(), SwDoc::DeleteRow(), SwDoc::DeleteRowCol(), and SwTableShell::GetState().
bool IsEmptyBox | ( | const SwTableBox & | rBox, |
SwPaM & | rPam | ||
) |
Definition at line 891 of file tblsel.cxx.
References SwPosition::Assign(), SwNode::EndOfSectionIndex(), SwNode::EndOfSectionNode(), fnMoveBackward, fnMoveForward, SwFormatAnchor::GetAnchorId(), SwFormatAnchor::GetAnchorNode(), SwPaM::GetDoc(), SwNode::GetIndex(), SwPaM::GetMark(), SwPosition::GetNodeIndex(), SwPaM::GetPoint(), SwDoc::GetSpzFrameFormats(), SwTableBox::GetSttNd(), GoInContent(), SwPaM::Move(), and SwPaM::SetMark().
Referenced by GetMergeSel(), and SwTable::PrepareMerge().
Definition at line 668 of file tblsel.cxx.
References SwRect::Bottom(), SwFrame::FindTabFrame(), SwFrameAreaDefinition::getFrameArea(), SwFrame::IsCellFrame(), SwFrame::IsVertical(), SwRect::Left(), SwRect::Right(), and SwRect::Top().
Referenced by CheckSplitCells(), GetTableSel(), lcl_CalcColValues(), MakeSelUnions(), and SwRootFrame::MakeTableCursors().
void MakeSelUnions | ( | SwSelUnions & | rUnions, |
const SwLayoutFrame * | pStart, | ||
const SwLayoutFrame * | pEnd, | ||
const | SwTableSearchType = SwTableSearchType::NONE |
||
) |
Definition at line 1765 of file tblsel.cxx.
References Col, SwTabFrame::FindLastContentOrTable(), SwFrame::FindTabFrame(), SwLayoutFrame::FirstCell(), SwRectFnSet::GetBottom(), SwTabFrame::GetFirstNonHeadlineRow(), SwTabFrame::GetFollow(), SwLayoutFrame::GetFormat(), SwFrameAreaDefinition::getFrameArea(), SwFrameAreaDefinition::getFramePrintArea(), SwFormat::GetFrameSize(), SwRectFnSet::GetLeft(), SwFrame::GetNext(), SwFrame::GetPrevLayoutLeaf(), SwRectFnSet::GetPrtLeft(), SwRectFnSet::GetTop(), SwFrame::GetUpper(), SvxSizeItem::GetWidth(), SwRectFnSet::GetWidth(), SwLayoutFrame::IsAnLower(), SwFrame::IsCellFrame(), IsFrameInTableSel(), SwFrame::IsInFollowFlowRow(), SwFrame::IsRowFrame(), SwRectFnSet::IsVert(), SwRect::Justify(), lcl_CalcWish(), lcl_FindCellFrame(), lcl_FindNextCellFrame(), lcl_FindStartEndCol(), lcl_FindStartEndRow(), Lower, SwLayoutFrame::Lower(), NoUnionCorrect, SwRect::Overlaps(), Protect, Row, SwRect::Union(), SwRect::Width(), Point::X(), and Point::Y().
Referenced by CheckSplitCells(), ChkChartSel(), GetMergeSel(), SwDoc::GetTabBorders(), GetTableSel(), lcl_CalcColValues(), SwRootFrame::MakeTableCursors(), SwDoc::SetTabBorders(), and SwDoc::SetTabLineStyle().