29#include <osl/diagnose.h>
78 const std::unique_ptr<SwWait> m_pWait;
80 static const size_t our_kLineLimit = 20;
81 static bool ShouldWait(
size_t nCnt,
SwFrame *pFrame,
size_t nCnt2)
85 : m_pWait( ShouldWait(nCnt, pFrame, nCnt2) ?
std::make_unique<
SwWait>( rDocShell, true ) : nullptr )
95 OSL_ENSURE(pSwCursor,
"no SwCursor");
107 if (*pPt < aStartPos)
113 if (*pMk < aStartPos)
128 SwCursor aTmpCursor( aEndPos,
nullptr );
129 *pSwCursor = aTmpCursor;
142 SwCursor aTmpCursor( aStartPos,
nullptr );
143 *pSwCursor = aTmpCursor;
148 SwCursor aTmpCursor( aEndPos,
nullptr );
149 *pSwCursor = aTmpCursor;
160 SwCursor aTmpCursor( aEndPos,
nullptr );
161 *pSwCursor = aTmpCursor;
166 SwCursor aTmpCursor( aStartPos,
nullptr );
167 *pSwCursor = aTmpCursor;
177 if( !pFrame || !pFrame->
IsInTab() )
183 DialogMask::MessageInfo | DialogMask::ButtonsOk );
203 TableWait aWait( nCnt, pFrame, *
GetDoc()->GetDocShell(), aBoxes.
size() );
205 if ( !aBoxes.
empty() )
215 if( !pFrame || !pFrame->
IsInTab() )
221 DialogMask::MessageInfo | DialogMask::ButtonsOk );
230 DialogMask::MessageInfo | DialogMask::ButtonsOk );
239 TableWait aWait( nCnt, pFrame, *
GetDoc()->GetDocShell(), aBoxes.
size() );
241 if( !aBoxes.
empty() )
252 bool bResult =
false;
268 if( !pFrame || !pFrame->
IsInTab() )
274 DialogMask::MessageInfo | DialogMask::ButtonsOk );
293 if ( !aBoxes.
empty() )
295 TableWait aWait( aBoxes.
size(), pFrame, *
GetDoc()->GetDocShell() );
326 if( !pFrame || !pFrame->
IsInTab() )
332 DialogMask::MessageInfo | DialogMask::ButtonsOk );
339 bool bRecordAndHideChanges = bRecordChanges &&
346 if ( bRecordChanges )
353 if ( bRecordChanges )
359 pWrtShell->SelectTableRow();
362 if ( !bRecordAndHideChanges )
365 pEditShell->Delete(
false);
379 if( !aBoxes.
empty() )
381 TableWait aWait( aBoxes.
size(), pFrame, *
GetDoc()->GetDocShell() );
390 ?
static_cast<SwTextFrame*
>(pFrame)->GetTextNodeFirst()->FindTableNode()
394 FndBox_ aFndBox(
nullptr,
nullptr );
396 FndPara aPara( aBoxes, &aFndBox );
409 while( 1 == pFndBox->
GetLines().size() &&
410 1 == pFndBox->
GetLines().front()->GetBoxes().size())
412 FndBox_ *
const pTmp = pFndBox->
GetLines().front()->GetBoxes()[0].get();
428 if ( bRecordAndHideChanges )
443 pDelLine = pFndBox->
GetLines().front()->GetLine();
446 pDelBox = pDelBox->
GetTabLines()[0]->GetTabBoxes()[0];
450 if ( bRecordAndHideChanges )
468 if ( bRecordAndHideChanges )
475 pWrtShell->SelectTableRow();
477 auto pStt = aBoxes[0];
478 auto pEnd = aBoxes.
back();
482 pTableCursor->
GetPoint()->
Assign( *pEnd->GetSttNd()->EndOfSectionNode() );
485 pTableCursor->
GetPoint()->
Assign( *pStt->GetSttNd()->EndOfSectionNode() );
487 pWrtShell->UpdateCursor();
491 pEditShell->
Delete(
false);
506 if ( bRecordAndHideChanges )
525 pWrtShell->UpdateCursor();
566 DialogMask::MessageInfo | DialogMask::ButtonsOk );
591 if( !pFrame || !pFrame->
IsInTab() )
597 DialogMask::MessageInfo | DialogMask::ButtonsOk );
606 DialogMask::MessageInfo | DialogMask::ButtonsOk );
613 if( !aBoxes.
empty() )
615 TableWait aWait( nCnt, pFrame, *
GetDoc()->GetDocShell(), aBoxes.
size() );
659 m_pColumnCache->pLastCols->GetLeftMin () == o3tl::narrowing<sal_uInt16>(nLeftMin) &&
712 m_pRowCache->pLastCols->GetLeftMin () == nLeftMin &&
715 m_pRowCache->pLastCols->GetRightMax() == nRightMax )
740 if( !pBox || !pBox->
IsInTab() )
758 if( !pFrame || !pFrame->
IsInTab() )
775 if( !pFrame || !pFrame->
IsInTab() )
791 if( !pBox || !pBox->
IsInTab() )
889 pColor, bSetLine, pBorderLine );
908 std::unique_ptr<SfxPoolItem> aTemp = std::move(rToFill);
910 rToFill.reset(
static_cast<SvxBrushItem*
>(aTemp.release()));
924 std::unique_ptr<SfxPoolItem> aTemp = std::move(rToFill);
946 if( !pFrame || !pFrame->
IsInTab() )
959 if( pFrame && pFrame->
IsInTab() )
970 if( !aBoxes.
empty() )
998 ( pNd = &pPam->
GetPointNode())->StartOfSectionIndex() &&
1008 assert(pCNd &&
"no ContentNode in box ??");
1063 if( !aBoxes.
empty() )
1078 bool* pFullTableProtection )
1081 pFullTableProtection );
1086 bool bUnProtectAvailable =
false;
1088 if( pTableNd && !pTableNd->
IsProtect() )
1105 if( !aBoxes.
empty() )
1108 return bUnProtectAvailable;
1141 std::pair<Point, bool>
const tmp(aTmpPt,
false);
1143 if(
nullptr != pNd )
1158 sal_uInt16 nRet = USHRT_MAX;
1175 sal_uInt16 nRet = 0;
1181 nRet = 0 == nPtLine ? 1 : 0;
1187 if ( ( nPtLine == 0 && nMkLine != USHRT_MAX ) ||
1188 ( nMkLine == 0 && nPtLine != USHRT_MAX ) )
1190 nRet = std::max( nPtLine, nMkLine ) + 1;
1217 bRet = pTab->IsFollow() && pTab->
IsInHeadline( *pFrame );
1236 TableWait aWait(std::numeric_limits<size_t>::max(),
nullptr,
1237 *
GetDoc()->GetDocShell());
1248 if( !pFrame || !pFrame->
IsInTab() )
1255 return aBoxes.
size() > 1;
1257 if ( aBoxes.
empty() )
1272 for (
size_t i = 0;
i < aBoxes.
size(); ++
i)
1284 if (!pCNd->
GetText().isEmpty())
1324 bool bResetDirect, OUString
const*
const pStyleName)
1333 OUString
const aTableStyleName(pStyleName
1348 for (
size_t n = 0;
n < rTBoxes.
size(); ++
n)
1356 if( !aBoxes.
empty() )
1361 aBoxes, *pTableStyle, bResetDirect, pStyleName !=
nullptr);
1387 for (
size_t n = 0;
n < rTBoxes.
size(); ++
n)
1401 if( !pFrame || !pFrame->
IsInTab() )
1407 DialogMask::MessageInfo | DialogMask::ButtonsOk );
1418 if( !aBoxes.
empty() )
1420 TableWait aWait( aBoxes.
size(), pFrame, *
GetDoc()->GetDocShell() );
1443 OSL_ENSURE( pFrame,
"Cursor parked?" );
1446 if (!pFrame || !pFrame->
IsInTab())
1477 nX = nRight - nX + aTabCols.
GetLeft();
1478 for (
size_t i = 0;
i < aTabCols.
Count(); ++
i )
1495 for (
size_t i = 0;
i < aTabCols.
Count(); ++
i )
1496 if (
::IsSame( nX, nLeft + aTabCols[
i] ) )
1510 while( pFrame && pLay->
IsAnLower( pFrame ) )
1531 SwTwips nFuzzy,
bool* pbRow,
bool* pbCol )
1537 const bool bMouseMoveRowCols =
nullptr == pbCol;
1539 bool bCloseToRow =
false;
1540 bool bCloseToCol =
false;
1543 const SwFrame* pRet =
nullptr;
1550 pFrame =
const_cast<SwFrame*
>(pFrame)->ImplFindTabFrame();
1558 bool bSearchForFrameInTab =
true;
1561 if ( !bMouseMoveRowCols )
1569 OSL_ENSURE( pFrame,
"Nested table frame without outer table" );
1581 SwTwips const rPointX = aRectFnSet.
IsVert() ? aPt.Y() : aPt.X();
1582 SwTwips const rPointY = aRectFnSet.
IsVert() ? aPt.X() : aPt.Y();
1584 const SwTwips nXDiff = aRectFnSet.
XDiff( nLeft, rPointX ) * ( bRTL ? -1 : 1 );
1585 const SwTwips nYDiff = aRectFnSet.
YDiff( nTop, rPointY );
1587 bCloseToRow = nXDiff >= 0 && nXDiff < nFuzzy;
1588 bCloseToCol = nYDiff >= 0 && nYDiff < nFuzzy;
1590 if ( bCloseToCol && 2 * nYDiff > nFuzzy )
1600 bCloseToCol =
false;
1608 if ( bCloseToRow && bCloseToCol )
1610 else if ( bCloseToRow )
1611 aRectFnSet.
IsVert() ? aPt.setY(nLeft) : aPt.setX(nLeft);
1612 else if ( bCloseToCol )
1613 aRectFnSet.
IsVert() ? aPt.setX(nTop) : aPt.setY(nTop);
1615 if ( !bCloseToRow && !bCloseToCol )
1616 bSearchForFrameInTab =
false;
1623 const SwFrame* pTmp = bSearchForFrameInTab ?
1635 }
while ( pFrame && pLay->
IsAnLower( pFrame ) );
1644 if ( bMouseMoveRowCols )
1664 if ( !bMouseMoveRowCols )
1667 OSL_ENSURE( pbCol && pbRow,
"pbCol or pbRow missing" );
1669 if ( bCloseToRow || bCloseToCol )
1671 *pbRow = bCloseToRow;
1672 *pbCol = bCloseToCol;
1687 const SwTwips nMouseTop = aRectFnSet.
IsVert() ? rPt.X() : rPt.Y();
1690 if ( !
::IsSame( nTabTop, nMouseTop ) )
1695 if ( pbRow ) *pbRow =
false;
1702 if ( pbRow ) *pbRow =
true;
1715 OSL_ENSURE( !pRet || pRet->
IsCellFrame(),
"lcl_FindFrame() is supposed to find a cell frame!" );
1722#define ENHANCED_TABLE_SELECTION_FUZZY 10
1733 Size aTmp( nSize, nSize );
1735 nFuzzy = aTmp.
Width();
1757 pFrame =
lcl_FindFrame( pFlyFrame, rPt, nFuzzy, pbRow, pbCol );
1762 while ( pLay && !pFrame )
1779 const double nDot1 = aBC.
scalar( aAB );
1787 const double nDot2 = aAC.
scalar( aBA );
1794 nRet = nDiv ? aAB.
cross( aAC ) / nDiv : 0;
1804 Point aRet( rPoint );
1806 const bool bVert = pCurrentTab->
IsVertical();
1821 bool bRight =
false;
1825 if ( bVert || bRTL )
1839 while ( pCurrentTab )
1865 if ( nDist < nMin || -1 == nMin )
1876 if ( bLeft || bRight )
1878 aRet.setX(aMin1.getX());
1879 if ( aRet.getY() > aMin2.getY() )
1880 aRet.setY(aMin2.getY());
1881 else if ( aRet.getY() < aMin1.getY() )
1882 aRet.setY(aMin1.getY());
1886 aRet.setY(aMin1.getY());
1887 if ( aRet.getX() > aMin2.getX() )
1888 aRet.setX(aMin2.getX());
1889 else if ( aRet.getX() < aMin1.getX() )
1890 aRet.setX(aMin1.getX());
1905 Point paPt [2] = { rPt, aEndPt };
1906 bool pbRow[2] = {
false,
false };
1907 bool pbCol[2] = {
false,
false };
1910 for ( sal_uInt16
i = 0;
i < ( pEnd ? 2 : 1 ); ++
i )
1940 if ( 1 ==
i || !ppPos[0] || !pEnd || !pFrame )
1945 if ( pCurrentTab->IsFollow() )
1946 pCurrentTab = pCurrentTab->
FindMaster(
true );
1949 paPt[1] = aProjection;
1964 bool bNewSelection =
true;
1968 if ( ppPos[1]->
GetNode().StartOfSectionNode() !=
1979 bNewSelection =
false;
1985 bNewSelection =
false;
1989 if ( bNewSelection )
1996 if ( pbRow[0] && pbCol[0] )
1998 else if ( pbRow[0] )
2000 else if ( pbCol[0] )
2019 bool bSelect =
false;
2107 bool bResult =
false;
2113 if ((nMaxOffset >= 0 && aContentAtPos.
nDist <= nMaxOffset) ||
2124 const Point& _rDocPos )
2132 case SvxFrameDirection::Unknown:
2133 case SvxFrameDirection::Horizontal_RL_TB:
2134 case SvxFrameDirection::Horizontal_LR_TB:
2139 case SvxFrameDirection::Vertical_LR_TB:
2140 case SvxFrameDirection::Vertical_RL_TB:
2182 OSL_ENSURE( pFrame,
"Table not found" );
2195 for (
size_t i = 0;
i < aTabCols.
Count(); ++
i )
2196 if (
::IsSame( nX, nLeft + aTabCols[
i] ) )
2213 if (
auto const pFE =
dynamic_cast<SwFEShell *
>(&rCurrentShell))
2215 pFE->ClearColumnRowCache(pFrame);
2225 if (pFrame ==
nullptr || pFrame ==
m_pColumnCache->pLastTabFrame)
2232 if (pFrame ==
nullptr || pFrame ==
m_pRowCache->pLastTabFrame)
2242 if( pFrame && pFrame->
IsInTab() )
2249 if( pFrame && pFrame->
IsInTab() )
2265 if( !pFrame || !pFrame->
IsInTab() )
2286 nPrtWidth != rTableFrameSz.
GetWidth() )
2295 nLogDiff /= nPrtWidth;
2300 eType, nDiff, nLogDiff );
2312 for (
size_t nSelBoxes = aBoxes.
size(); nSelBoxes; )
2316 if( std::none_of(rCells.begin(), rCells.end(), [&pBox](
SwCellFrame* pFrame) { return pFrame->GetTabBox() == pBox; }) )
2336 for(
size_t n = aCells.size();
n; )
2345 if( USHRT_MAX == nBoxW )
2351 GetTabBox()->GetFrameFormat()->GetTableBoxFormula(), aCells))
2355 for(
size_t i = aCells.size();
n+1 <
i; )
2357 sFields =
"|<" + aCells[--
i]->GetTabBox()->GetName() +
">"
2369 GetTabBox()->GetFrameFormat()->GetTableBoxFormula(), aCells ))
2371 else if( USHRT_MAX != nBoxW )
2372 sFields = OUStringChar(
cListDelim) + sFields;
2383 GetTabBox()->GetFrameFormat()->GetTableBoxFormula(), aCells ))
2390 for(
size_t i = aCells.size();
n+1 <
i; )
2392 sFields =
"|<" + aCells[--
i]->GetTabBox()->GetName() +
">"
2397 sFields = OUStringChar(
cListDelim) + sFields;
2399 else if( USHRT_MAX == nBoxW )
2413 rFormula = OUString::createFromAscii(
sCalc_Sum );
2414 if (!sFields.isEmpty())
2416 rFormula +=
"(" + sFields +
")";
2433 OSL_ENSURE( pTabFrame,
"Table not found" );
o3tl::strong_int< sal_Int32, struct Tag_TextFrameIndex > TextFrameIndex
Denotes a character index in a text frame at a layout level, after extent mapping from a text node at...
const sal_Unicode cListDelim
static DialogMask HandleError(ErrCode nId, weld::Window *pParent=nullptr, DialogMask nMask=DialogMask::MAX)
const FndLines_t & GetLines() const
const SwTableBox * GetBox() const
virtual const SwRootFrame * GetCurrentLayout() const =0
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
virtual void SetModified()=0
Must be called manually at changes of format.
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
constexpr tools::Long Width() const
void SetContentProtect(bool bNew)
bool IsContentProtected() const
tools::Long GetWidth() const
void SetWidth(tools::Long n)
wrapper class for the positioning of Writer fly frames and drawing objects
virtual const SwFlyFrame * DynCastFlyFrame() const
SwCellFrame is one table cell in the document layout.
const SwTableBox * GetTabBox() const
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
SvxFrameDirection GetTextDirection(const SwPosition &rPos, const Point *pPt) const
determines the text direction for a certain position.
virtual sal_Int32 Len() const
A helper class to save cursor state (position).
const SwTableNode * IsCursorInTable() const
SwShellCursor * GetCursor_()
friend bool GetAutoSumSel(const SwCursorShell &, SwCellFrames &)
void ParkCursor(const SwNode &rIdx)
Remove selections and additional cursors of all shells.
StartsWith StartsWith_()
If document body starts with a table or starts/ends with hidden paragraph.
bool SelTableRowOrCol(bool bRow, bool bRowSimple=false)
bool IsCursorReadonly() const
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
void TableCursorToCursor()
enter block mode, change normal cursor into block cursor
const SwShellTableCursor * GetTableCursor() const
SwContentFrame * GetCurrFrame(const bool bCalcFrame=true) const
Get current frame in which the cursor is positioned.
bool ExtendedSelectedAll()
If ExtendedSelectAll() was called and selection didn't change since then.
SwShellCursor * getShellCursor(bool bBlock)
Delivers the current shell cursor.
bool GetContentAtPos(const Point &rPt, SwContentAtPos &rContentAtPos, bool bSetCursor=false, SwRect *pFieldRect=nullptr)
void RestoreSavePos()
Restore cursor state to the one saved by SwCursorSaveState.
bool GoNextCell(sal_uInt16 nCnt=1)
bool IsInProtectTable(bool bMove=false, bool bChgCursor=true)
bool GoPrevCell(sal_uInt16 nCnt=1)
virtual bool IsChangeRecording() const override
passwword protection for Writer (derived from SfxObjectShell) see also: FN_REDLINE_ON,...
bool GetTableAutoFormat(const SwSelBoxes &rBoxes, SwTableAutoFormat &rGet)
Find out who has the Attributes.
void InsertCol(const SwCursor &rCursor, sal_uInt16 nCnt=1, bool bBehind=true)
Inserting Columns/Rows.
void SetRowHeight(const SwCursor &rCursor, const SwFormatFrameSize &rNew)
void SetTabLineStyle(const SwCursor &rCursor, const Color *pColor, bool bSetLine, const editeng::SvxBorderLine *pBorderLine)
static sal_uInt16 GetBoxAlign(const SwCursor &rCursor)
void SetRowSplit(const SwCursor &rCursor, const SwFormatRowSplit &rNew)
IDocumentState const & getIDocumentState() const
TableMergeErr MergeTable(SwPaM &rPam)
bool BalanceRowHeight(const SwCursor &rCursor, bool bTstOnly, const bool bOptimize)
Adjustment of Rowheights.
static bool GetRowBackground(const SwCursor &rCursor, std::unique_ptr< SvxBrushItem > &rToFill)
static bool GetBoxAttr(const SwCursor &rCursor, std::unique_ptr< SfxPoolItem > &rToFill)
Retrieves a box attribute from the given cursor.
static void GetTabRows(SwTabCols &rFill, const SwCellFrame *pBoxFrame)
void SetAttr(const SfxPoolItem &, SwFormat &)
Set attribute in given format.1y If Undo is enabled, the old values is added to the Undo history.
static std::unique_ptr< SwFormatFrameSize > GetRowHeight(const SwCursor &rCursor)
void SetRowNotTracked(const SwCursor &rCursor, const SvxPrintItem &rNotTracked, bool bAll=false, bool bIns=false)
rNotTracked = false means that the row was deleted or inserted with its tracked cell content bAll: de...
SwEditShell const * GetEditShell() const
static std::unique_ptr< SwFormatRowSplit > GetRowSplit(const SwCursor &rCursor)
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
void SetTabCols(const SwTabCols &rNew, bool bCurRowOnly, const SwCellFrame *pBoxFrame)
void InsertRow(const SwCursor &rCursor, sal_uInt16 nCnt=1, bool bBehind=true)
void SetTabRows(const SwTabCols &rNew, bool bCurColOnly, const SwCellFrame *pBoxFrame)
static void GetTabCols(SwTabCols &rFill, const SwCellFrame *pBoxFrame)
void UnProtectTables(const SwPaM &rPam)
bool SplitTable(const SwSelBoxes &rBoxes, bool bVert, sal_uInt16 nCnt, bool bSameHeight=false)
Split up/merge Boxes in the Table.
void SetTabBorders(const SwCursor &rCursor, const SfxItemSet &rSet)
void SetBoxAlign(const SwCursor &rCursor, sal_uInt16 nAlign)
bool DeleteRowCol(const SwSelBoxes &rBoxes, RowColMode eMode=RowColMode::DeleteRow)
void AdjustCellWidth(const SwCursor &rCursor, const bool bBalance, const bool bNoShrink)
Adjusts selected cell widths in such a way, that their content does not need to be wrapped (if possib...
bool HasTableAnyProtection(const SwPosition *pPos, const OUString *pTableName, bool *pFullTableProtection)
static bool HasRowNotTracked(const SwCursor &rCursor)
don't call SetRowNotTracked() for rows with tracked row change
void SetRowsToRepeat(SwTable &rTable, sal_uInt16 nSet)
void SetBoxAttr(const SwCursor &rCursor, const SfxPoolItem &rNew)
SwTableAutoFormatTable & GetTableStyles()
Return the available table styles.
void SetColRowWidthHeight(SwTableBox &rCurrentBox, TableChgWidthHeightType eType, SwTwips nAbsDiff, SwTwips nRelDiff)
SwDocShell * GetDocShell()
void SetRowBackground(const SwCursor &rCursor, const SvxBrushItem &rNew)
void UnProtectCells(const OUString &rTableName)
static void GetTabBorders(const SwCursor &rCursor, SfxItemSet &rSet)
bool SetTableAutoFormat(const SwSelBoxes &rBoxes, const SwTableAutoFormat &rNew, bool bResetDirect=false, bool isSetStyleName=false)
AutoFormat for table/table selection.
void StartAllAction()
For all views of this document.
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
bool Delete(bool isArtificialSelection=false)
Delete content of all ranges.
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
void GetTableAttr(SfxItemSet &) const
void SetTabCols(const SwTabCols &rNew, bool bCurRowOnly)
void GetAutoSum(OUString &rFormula) const
void InsertCol(sal_uInt16 nCnt, bool bBehind)
std::unique_ptr< SwColCache > m_pColumnCache
bool BalanceRowHeight(bool bTstOnly, const bool bOptimize=false)
void SetTabRows(const SwTabCols &rNew, bool bCurColOnly)
SwTextNode * GetNumRuleNodeAtPos(const Point &rPot)
bool GetRowBackground(std::unique_ptr< SvxBrushItem > &rToFill) const
FALSE ambiguous.
bool HasTableAnyProtection(const OUString *pTableName, bool *pFullTableProtection)
bool IsNumLabel(const Point &rPt, int nMaxOffset=-1)
sal_uInt16 GetRowsToRepeat() const
bool HasBoxSelection() const
Is content of a table cell or at least a table cell completely selected?
void SetBoxAlign(sal_uInt16 nOrient)
SAL_DLLPRIVATE const SwFrame * GetBox(const Point &rPt, bool *pbRow=nullptr, bool *pbCol=nullptr) const
Used for mouse operations on a table:
void SetBoxBackground(const SvxBrushItem &rNew)
std::unique_ptr< SwColCache > m_pRowCache
void SetRowSplit(const SwFormatRowSplit &rSz)
void SetTableStyle(const OUString &rStyleName)
Set table style of the current table.
void SetMouseTabRows(const SwTabCols &rNew, bool bCurColOnly, const Point &rPt)
void GetTabCols(SwTabCols &rToFill) const
Info about columns and margins.
void SetRowBackground(const SvxBrushItem &rNew)
void SetRowHeight(const SwFormatFrameSize &rSz)
bool IsTableVertical() const
bool IsLastCellInRow() const
void SetMouseTabCols(const SwTabCols &rNew, bool bCurRowOnly, const Point &rPt)
SAL_DLLPRIVATE void GetTabCols_(SwTabCols &rToFill, const SwFrame *pBox) const
SAL_DLLPRIVATE void GetTabRows_(SwTabCols &rToFill, const SwFrame *pBox) const
bool GetBoxBackground(std::unique_ptr< SvxBrushItem > &rToFill) const
FALSE ambiguous.
sal_uInt16 GetRowSelectionFromTop() const
void InsertRow(sal_uInt16 nCnt, bool bBehind)
bool IsAdjustCellWidthAllowed(bool bBalance=false) const
Not allowed if only empty cells are selected.
SAL_DLLPRIVATE void EndAllActionAndCall()
Terminate actions for all shells and call ChangeLink.
std::unique_ptr< SwFormatRowSplit > GetRowSplit() const
SAL_DLLPRIVATE void ClearColumnRowCache(SwTabFrame const *)
bool DeleteTableSel()
Current selection, may be whole table.
void SetRowsToRepeat(sal_uInt16 nNumOfRows)
void UnProtectTables()
Unprotect all tables in selection.
void SetTabBorders(const SfxItemSet &rSet)
static SAL_DLLPRIVATE sal_uInt16 GetCurColNum_(const SwFrame *pFrame, SwGetCurColNumPara *pPara)
bool CanUnProtectCells() const
void UnProtectCells()
Refers to table selection.
bool GetTableAutoFormat(SwTableAutoFormat &rGet)
void GetTabRows(SwTabCols &rToFill) const
SwTab WhichMouseTabCol(const Point &rPt) const
void SetTabBackground(const SvxBrushItem &rNew)
bool IsMouseTableRightToLeft(const Point &rPt) const
void GetMouseTabCols(SwTabCols &rToFill, const Point &rPt) const
void SetTabLineStyle(const Color *pColor, bool bSetLine=false, const editeng::SvxBorderLine *pBorderLine=nullptr)
void SplitTab(bool bVert, sal_uInt16 nCnt, bool bSameHeight)
Split cell vertically or horizontally.
void AdjustCellWidth(const bool bBalance, const bool bNoShrink)
bool DeleteRow(bool bCompleteTable=false)
void ProtectCells()
If a table selection exists it is destroyed in case cursor is not allowed in readonly.
void GetTabBorders(SfxItemSet &rSet) const
bool HasWholeTabSelection() const
bool UpdateTableStyleFormatting(SwTableNode *pTableNode=nullptr, bool bResetDirect=false, OUString const *pStyleName=nullptr)
Update the direct formatting according to the current table style.
sal_uInt16 GetCurMouseColNum(const Point &rPt) const
bool SelTableRowCol(const Point &rPt, const Point *pEnd, bool bRowDrag)
pEnd will be used during MouseMove
size_t GetCurMouseTabColNum(const Point &rPt) const
void SetColRowWidthHeight(TableChgWidthHeightType eType, sal_uInt16 nDiff)
std::unique_ptr< SwFormatFrameSize > GetRowHeight() const
Pointer must be destroyed by caller != 0.
size_t GetCurTabColNum() const
static bool IsVerticalModeAtNdAndPos(const SwTextNode &_rTextNode, const Point &_rDocPos)
sal_uInt16 GetBoxAlign() const
USHRT_MAX if ambiguous.
void GetTabBackground(std::unique_ptr< SvxBrushItem > &rToFill) const
bool GetBoxDirection(std::unique_ptr< SvxFrameDirectionItem > &rToFill) const
FALSE ambiguous.
void GetMouseTabRows(SwTabCols &rToFill, const Point &rPt) const
SAL_DLLPRIVATE bool CheckHeadline(bool bRepeat) const
bool IsTableRightToLeft() const
void SetTableAttr(const SfxItemSet &)
TableMergeErr MergeTab()
Merge selected parts of table.
void SetBoxDirection(const SvxFrameDirectionItem &rNew)
const SwRect & getFrameArea() const
const SwRect & getFramePrintArea() const
Base class of the Writer layout elements.
tools::Long GetPrtLeft() const
SwTabFrame * FindTabFrame()
SwTabFrame * ImplFindTabFrame()
bool IsRightToLeft() const
SwLayoutFrame * GetUpper()
tools::Long GetPrtTop() const
SwContentFrame * FindNextCnt(const bool _bInSameFootnote=false)
SwPageFrame * FindPageFrame()
bool IsLayoutFrame() const
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame.
bool IsAnLower(const SwFrame *) const
virtual const SwFrameFormat * GetFormat() const
const SwContentFrame * ContainsContent() const
Checks if the frame contains one or more ContentFrame's anywhere in his subsidiary structure; if so t...
const SwFrame * Lower() const
Marks a node in the document model.
Base class of the Writer document model elements.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodeOffset GetIndex() const
bool IsProtect() const
Is node in something that is protected (range, frame, table cells ... including anchor in case of fra...
bool IsInProtectSect() const
Is node in a protected area?
SwNodeOffset StartOfSectionIndex() const
SwTableNode * FindTableNode()
Search table node, in which it is.
const SwStartNode * StartOfSectionNode() const
SwNodeOffset EndOfSectionIndex() const
SwContentNode * GetContentNode()
const SwEndNode * EndOfSectionNode() const
static SwContentNode * GoPrevious(SwNodeIndex *)
SwContentNode * GoNext(SwNodeIndex *) const
PaM is Point and Mark: a selection of the document model.
const SwPosition * GetMark() const
SwNode & GetPointNode() const
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
const SwPosition * End() const
const SwPosition * GetPoint() const
const SwPosition * Start() const
A page of the document layout.
const SwSortedObjs * GetSortedObjs() const
tools::Long GetHeight(const SwRect &rRect) const
tools::Long GetWidth(const SwRect &rRect) const
tools::Long GetTop(const SwRect &rRect) const
tools::Long XDiff(tools::Long n1, tools::Long n2) const
Point GetPos(const SwRect &rRect) const
tools::Long YDiff(tools::Long n1, tools::Long n2) const
tools::Long GetLeft(const SwRect &rRect) const
tools::Long GetRight(const SwRect &rRect) const
Of course Writer needs its own rectangles.
void Top(const tools::Long nTop)
void Right(const tools::Long nRight)
void Bottom(const tools::Long nBottom)
bool IsNear(const Point &rPoint, tools::Long nTolerance) const
void Pos(const Point &rNew)
bool Contains(const Point &rPOINT) const
Point BottomRight() const
void Left(const tools::Long nLeft)
void Width(tools::Long nNew)
vector_type::size_type size_type
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding).
SwRowFrame is one table row in the document layout.
Represents the current text cursor of one opened edit window.
const Point & GetPtPos() const
virtual void SetMark() override
Unless this is called, the getter method of Mark will return Point.
virtual void SetMark() override
Unless this is called, the getter method of Mark will return Point.
tools::Long GetLeft() const
tools::Long GetLeftMin() const
tools::Long GetRight() const
SwTabFrame is one table in the document layout, containing rows (which contain cells).
SwTabFrame * FindMaster(bool bFirstMaster=false) const
const SwTabFrame * GetFollow() const
const SwTable * GetTable() const
bool IsInHeadline(const SwFrame &rFrame) const
SwTableBox is one table cell in the document model.
sal_uInt16 IsFormulaOrValueBox() const
SwNodeOffset GetSttIdx() const
SwFrameFormat * GetFrameFormat()
SwTableLines & GetTabLines()
SwTableBox * FindPreviousBox(const SwTable &, const SwTableBox *) const
const SwStartNode * GetSttNd() const
SwTableBox * FindNextBox(const SwTable &, const SwTableBox *, bool bOvrTableLns=true) const
size_t GetSelectedBoxesCount() const
SwTableLine is one table row in the document model.
SwTableBoxes & GetTabBoxes()
bool IsDeleted(SwRedlineTable::size_type &rRedlinePos) const
SwTableBox * FindPreviousBox(const SwTable &, const SwTableBox *=nullptr, bool bOvrTableLns=true) const
SwTableBox * FindNextBox(const SwTable &, const SwTableBox *=nullptr, bool bOvrTableLns=true) const
SwTableLine * back() const
const SwTable & GetTable() const
void MakeOwnFrames(SwPosition *pIdxBehind=nullptr)
Creates the frms for the table node (i.e.
void DelFrames(SwRootFrame const *pLayout=nullptr)
Method deletes all views of document for the node.
SwTable is one table in the document model, containing rows (which contain cells).
void SetHTMLTableLayout(std::shared_ptr< SwHTMLTableLayout > const &r)
const OUString & GetTableStyleName() const
Return the table style name of this table.
SwTableLines & GetTabLines()
bool IsTableComplex() const
sal_uInt16 GetRowsToRepeat() const
SwTableSortBoxes & GetTabSortBoxes()
void GetTabCols(SwTabCols &rToFill, const SwTableBox *pStart, bool bHidden=false, bool bCurRowOnly=false) const
TableChgMode GetTableChgMode() const
Represents the visualization of a paragraph.
SwTextNode is a paragraph in the document model.
const OUString & GetText() const
const SwNodes & GetNodes() const
SwRootFrame * GetLayout() const
vcl::Window * GetWin() const
Used by the UI to modify the document model.
double scalar(const B2DVector &rVec) const
double cross(const B2DVector &rVec) const
const Value & back() const
std::pair< const_iterator, bool > insert(Value &&x)
ring_container GetRingContainer()
Point PixelToLogic(const Point &rDevicePt) const
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
static Point lcl_ProjectOntoClosestTableFrame(const SwTabFrame &rTab, const Point &rPoint, bool bRowDrag)
static bool IsSame(tools::Long nA, tools::Long nB)
static const SwCellFrame * lcl_FindFrame(const SwLayoutFrame *pLay, const Point &rPt, SwTwips nFuzzy, bool *pbRow, bool *pbCol)
#define ENHANCED_TABLE_SELECTION_FUZZY
static sal_uInt16 lcl_GetRowNumber(const SwPosition &rPos)
static bool lcl_IsFormulaSelBoxes(const SwTable &rTable, const SwTableBoxFormula &rFormula, SwCellFrames &rCells)
void ClearFEShellTabCols(SwDoc &rDoc, SwTabFrame const *const pFrame)
static double lcl_DistancePoint2Segment(const Point &rA, const Point &rB, const Point &rC)
static const SwFrame * lcl_FindFrameInTab(const SwLayoutFrame *pLay, const Point &rPt, SwTwips nFuzzy)
constexpr TypedWhichId< SwTableBoxValue > RES_BOXATR_VALUE(158)
constexpr TypedWhichId< SwTableBoxFormula > RES_BOXATR_FORMULA(157)
constexpr TypedWhichId< SvxProtectItem > RES_PROTECT(106)
constexpr TypedWhichId< SvxPrintItem > RES_PRINT(104)
SwNodeOffset abs(const SwNodeOffset &a)
SwContentNode * GetNode(SwPaM &rPam, bool &rbFirst, SwMoveFnCollection const &fnMove, bool const bInReadOnly, SwRootFrame const *const i_pLayout)
This function returns the next node in direction of search.
bool GoInContent(SwPaM &rPam, SwMoveFnCollection const &fnMove)
SwMoveFnCollection const & fnMoveBackward
constexpr auto RULER_MOUSE_MARGINWIDTH
union SwContentAtPos::@24 aFnd
Marks a position in the document model.
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
SwNodeOffset GetNodeIndex() const
sal_Int32 GetContentIndex() const
#define ERR_TBLINSCOL_ERROR
#define ERR_TBLDDECHG_ERROR
#define ERR_TBLSPLIT_ERROR
constexpr TableChgWidthHeightType extractPosition(TableChgWidthHeightType e)
void ForEach_FndLineCopyCol(SwTableLines &rLines, FndPara *pFndPara)
This creates a structure mirroring the SwTable structure that contains all rows and non-leaf boxes (a...
void GetTableSelCrs(const SwCursorShell &rShell, SwSelBoxes &rBoxes)
void GetTableSel(const SwCursorShell &rShell, SwSelBoxes &rBoxes, const SwTableSearchType eSearchType)
bool CheckSplitCells(const SwCursorShell &rShell, sal_uInt16 nDiv, const SwTableSearchType eSearchType)
bool HasProtectedCells(const SwSelBoxes &rBoxes)
std::deque< SwCellFrame * > SwCellFrames