29#include <osl/diagnose.h>
80 const std::unique_ptr<SwWait> m_pWait;
82 static const size_t our_kLineLimit = 20;
83 static bool ShouldWait(
size_t nCnt,
SwFrame *pFrame,
size_t nCnt2)
87 : m_pWait( ShouldWait(nCnt, pFrame, nCnt2) ?
std::make_unique<
SwWait>( rDocShell, true ) : nullptr )
97 OSL_ENSURE(pSwCursor,
"no SwCursor");
109 if (*pPt < aStartPos)
115 if (*pMk < aStartPos)
130 SwCursor aTmpCursor( aEndPos,
nullptr );
131 *pSwCursor = aTmpCursor;
144 SwCursor aTmpCursor( aStartPos,
nullptr );
145 *pSwCursor = aTmpCursor;
150 SwCursor aTmpCursor( aEndPos,
nullptr );
151 *pSwCursor = aTmpCursor;
162 SwCursor aTmpCursor( aEndPos,
nullptr );
163 *pSwCursor = aTmpCursor;
168 SwCursor aTmpCursor( aStartPos,
nullptr );
169 *pSwCursor = aTmpCursor;
179 if( !pFrame || !pFrame->
IsInTab() )
185 DialogMask::MessageInfo | DialogMask::ButtonsOk );
205 TableWait aWait( nCnt, pFrame, *
GetDoc()->GetDocShell(), aBoxes.
size() );
207 if ( !aBoxes.
empty() )
217 if( !pFrame || !pFrame->
IsInTab() )
223 DialogMask::MessageInfo | DialogMask::ButtonsOk );
232 DialogMask::MessageInfo | DialogMask::ButtonsOk );
241 TableWait aWait( nCnt, pFrame, *
GetDoc()->GetDocShell(), aBoxes.
size() );
243 if( !aBoxes.
empty() )
254 bool bResult =
false;
270 if( !pFrame || !pFrame->
IsInTab() )
276 DialogMask::MessageInfo | DialogMask::ButtonsOk );
284 if (
GetDoc()->GetDocShell()->IsChangeRecording() )
290 pWrtShell->SelectTableCol();
296 TableWait aWait( 20, pFrame, *
GetDoc()->GetDocShell(), aBoxes.
size() );
298 for (
size_t i = 0;
i < aBoxes.
size(); ++
i)
353 if ( !aBoxes.
empty() )
355 TableWait aWait( aBoxes.
size(), pFrame, *
GetDoc()->GetDocShell() );
386 if( !pFrame || !pFrame->
IsInTab() )
392 DialogMask::MessageInfo | DialogMask::ButtonsOk );
399 bool bRecordAndHideChanges = bRecordChanges &&
406 if ( bRecordChanges )
413 if ( bRecordChanges )
419 pWrtShell->SelectTableRow();
422 if ( !bRecordAndHideChanges )
425 pEditShell->Delete(
false);
439 if( !aBoxes.
empty() )
441 TableWait aWait( aBoxes.
size(), pFrame, *
GetDoc()->GetDocShell() );
450 ?
static_cast<SwTextFrame*
>(pFrame)->GetTextNodeFirst()->FindTableNode()
454 FndBox_ aFndBox(
nullptr,
nullptr );
456 FndPara aPara( aBoxes, &aFndBox );
469 while( 1 == pFndBox->
GetLines().size() &&
470 1 == pFndBox->
GetLines().front()->GetBoxes().size())
472 FndBox_ *
const pTmp = pFndBox->
GetLines().front()->GetBoxes()[0].get();
488 if ( bRecordAndHideChanges )
503 pDelLine = pFndBox->
GetLines().front()->GetLine();
506 pDelBox = pDelBox->
GetTabLines()[0]->GetTabBoxes()[0];
510 if ( bRecordAndHideChanges )
528 if ( bRecordAndHideChanges )
535 pWrtShell->SelectTableRow();
537 auto pStt = aBoxes[0];
538 auto pEnd = aBoxes.
back();
542 pTableCursor->
GetPoint()->
Assign( *pEnd->GetSttNd()->EndOfSectionNode() );
545 pTableCursor->
GetPoint()->
Assign( *pStt->GetSttNd()->EndOfSectionNode() );
547 pWrtShell->UpdateCursor();
551 pEditShell->
Delete(
false);
566 if ( bRecordAndHideChanges )
585 pWrtShell->UpdateCursor();
626 DialogMask::MessageInfo | DialogMask::ButtonsOk );
651 if( !pFrame || !pFrame->
IsInTab() )
657 DialogMask::MessageInfo | DialogMask::ButtonsOk );
666 DialogMask::MessageInfo | DialogMask::ButtonsOk );
673 if( !aBoxes.
empty() )
675 TableWait aWait( nCnt, pFrame, *
GetDoc()->GetDocShell(), aBoxes.
size() );
719 m_pColumnCache->pLastCols->GetLeftMin () == o3tl::narrowing<sal_uInt16>(nLeftMin) &&
772 m_pRowCache->pLastCols->GetLeftMin () == nLeftMin &&
775 m_pRowCache->pLastCols->GetRightMax() == nRightMax )
800 if( !pBox || !pBox->
IsInTab() )
818 if( !pFrame || !pFrame->
IsInTab() )
835 if( !pFrame || !pFrame->
IsInTab() )
851 if( !pBox || !pBox->
IsInTab() )
949 pColor, bSetLine, pBorderLine );
968 std::unique_ptr<SfxPoolItem> aTemp = std::move(rToFill);
970 rToFill.reset(
static_cast<SvxBrushItem*
>(aTemp.release()));
984 std::unique_ptr<SfxPoolItem> aTemp = std::move(rToFill);
1006 if( !pFrame || !pFrame->
IsInTab() )
1019 if( pFrame && pFrame->
IsInTab() )
1030 if( !aBoxes.
empty() )
1058 ( pNd = &pPam->
GetPointNode())->StartOfSectionIndex() &&
1068 assert(pCNd &&
"no ContentNode in box ??");
1123 if( !aBoxes.
empty() )
1138 bool* pFullTableProtection )
1141 pFullTableProtection );
1146 bool bUnProtectAvailable =
false;
1148 if( pTableNd && !pTableNd->
IsProtect() )
1165 if( !aBoxes.
empty() )
1168 return bUnProtectAvailable;
1201 std::pair<Point, bool>
const tmp(aTmpPt,
false);
1203 if(
nullptr != pNd )
1218 sal_uInt16 nRet = USHRT_MAX;
1235 sal_uInt16 nRet = 0;
1241 nRet = 0 == nPtLine ? 1 : 0;
1247 if ( ( nPtLine == 0 && nMkLine != USHRT_MAX ) ||
1248 ( nMkLine == 0 && nPtLine != USHRT_MAX ) )
1250 nRet = std::max( nPtLine, nMkLine ) + 1;
1277 bRet = pTab->IsFollow() && pTab->
IsInHeadline( *pFrame );
1296 TableWait aWait(std::numeric_limits<size_t>::max(),
nullptr,
1297 *
GetDoc()->GetDocShell());
1308 if( !pFrame || !pFrame->
IsInTab() )
1315 return aBoxes.
size() > 1;
1317 if ( aBoxes.
empty() )
1332 for (
size_t i = 0;
i < aBoxes.
size(); ++
i)
1344 if (!pCNd->
GetText().isEmpty())
1384 bool bResetDirect, OUString
const*
const pStyleName)
1393 OUString
const aTableStyleName(pStyleName
1408 for (
size_t n = 0;
n < rTBoxes.
size(); ++
n)
1416 if( !aBoxes.
empty() )
1421 aBoxes, *pTableStyle, bResetDirect, pStyleName !=
nullptr);
1447 for (
size_t n = 0;
n < rTBoxes.
size(); ++
n)
1461 if( !pFrame || !pFrame->
IsInTab() )
1467 DialogMask::MessageInfo | DialogMask::ButtonsOk );
1478 if( !aBoxes.
empty() )
1480 TableWait aWait( aBoxes.
size(), pFrame, *
GetDoc()->GetDocShell() );
1503 OSL_ENSURE( pFrame,
"Cursor parked?" );
1506 if (!pFrame || !pFrame->
IsInTab())
1537 nX = nRight - nX + aTabCols.
GetLeft();
1538 for (
size_t i = 0;
i < aTabCols.
Count(); ++
i )
1555 for (
size_t i = 0;
i < aTabCols.
Count(); ++
i )
1556 if (
::IsSame( nX, nLeft + aTabCols[
i] ) )
1570 while( pFrame && pLay->
IsAnLower( pFrame ) )
1591 SwTwips nFuzzy,
bool* pbRow,
bool* pbCol )
1597 const bool bMouseMoveRowCols =
nullptr == pbCol;
1599 bool bCloseToRow =
false;
1600 bool bCloseToCol =
false;
1603 const SwFrame* pRet =
nullptr;
1610 pFrame =
const_cast<SwFrame*
>(pFrame)->ImplFindTabFrame();
1618 bool bSearchForFrameInTab =
true;
1621 if ( !bMouseMoveRowCols )
1629 OSL_ENSURE( pFrame,
"Nested table frame without outer table" );
1644 const SwTwips nXDiff = aRectFnSet.
XDiff( nLeft, rPointX ) * ( bRTL ? -1 : 1 );
1645 const SwTwips nYDiff = aRectFnSet.
YDiff( nTop, rPointY );
1647 bCloseToRow = nXDiff >= 0 && nXDiff < nFuzzy;
1648 bCloseToCol = nYDiff >= 0 && nYDiff < nFuzzy;
1650 if ( bCloseToCol && 2 * nYDiff > nFuzzy )
1660 bCloseToCol =
false;
1668 if ( bCloseToRow && bCloseToCol )
1670 else if ( bCloseToRow )
1672 else if ( bCloseToCol )
1675 if ( !bCloseToRow && !bCloseToCol )
1676 bSearchForFrameInTab =
false;
1683 const SwFrame* pTmp = bSearchForFrameInTab ?
1695 }
while ( pFrame && pLay->
IsAnLower( pFrame ) );
1704 if ( bMouseMoveRowCols )
1724 if ( !bMouseMoveRowCols )
1727 OSL_ENSURE( pbCol && pbRow,
"pbCol or pbRow missing" );
1729 if ( bCloseToRow || bCloseToCol )
1731 *pbRow = bCloseToRow;
1732 *pbCol = bCloseToCol;
1750 if ( !
::IsSame( nTabTop, nMouseTop ) )
1755 if ( pbRow ) *pbRow =
false;
1762 if ( pbRow ) *pbRow =
true;
1775 OSL_ENSURE( !pRet || pRet->
IsCellFrame(),
"lcl_FindFrame() is supposed to find a cell frame!" );
1782#define ENHANCED_TABLE_SELECTION_FUZZY 10
1793 Size aTmp( nSize, nSize );
1795 nFuzzy = aTmp.
Width();
1817 pFrame =
lcl_FindFrame( pFlyFrame, rPt, nFuzzy, pbRow, pbCol );
1822 while ( pLay && !pFrame )
1839 const double nDot1 = aBC.
scalar( aAB );
1847 const double nDot2 = aAC.
scalar( aBA );
1854 nRet = nDiv ? aAB.
cross( aAC ) / nDiv : 0;
1864 Point aRet( rPoint );
1866 const bool bVert = pCurrentTab->
IsVertical();
1881 bool bRight =
false;
1885 if ( bVert || bRTL )
1899 while ( pCurrentTab )
1925 if ( nDist < nMin || -1 == nMin )
1936 if ( bLeft || bRight )
1941 else if ( aRet.
getY() < aMin1.
getY() )
1949 else if ( aRet.
getX() < aMin1.
getX() )
1965 Point paPt [2] = { rPt, aEndPt };
1966 bool pbRow[2] = {
false,
false };
1967 bool pbCol[2] = {
false,
false };
1970 for ( sal_uInt16
i = 0;
i < ( pEnd ? 2 : 1 ); ++
i )
2000 if ( 1 ==
i || !ppPos[0] || !pEnd || !pFrame )
2005 if ( pCurrentTab->IsFollow() )
2006 pCurrentTab = pCurrentTab->
FindMaster(
true );
2009 paPt[1] = aProjection;
2024 bool bNewSelection =
true;
2028 if ( ppPos[1]->
GetNode().StartOfSectionNode() !=
2039 bNewSelection =
false;
2045 bNewSelection =
false;
2049 if ( bNewSelection )
2056 if ( pbRow[0] && pbCol[0] )
2058 else if ( pbRow[0] )
2060 else if ( pbCol[0] )
2079 bool bSelect =
false;
2167 bool bResult =
false;
2173 if ((nMaxOffset >= 0 && aContentAtPos.
nDist <= nMaxOffset) ||
2184 const Point& _rDocPos )
2192 case SvxFrameDirection::Unknown:
2193 case SvxFrameDirection::Horizontal_RL_TB:
2194 case SvxFrameDirection::Horizontal_LR_TB:
2199 case SvxFrameDirection::Vertical_LR_TB:
2200 case SvxFrameDirection::Vertical_RL_TB:
2242 OSL_ENSURE( pFrame,
"Table not found" );
2255 for (
size_t i = 0;
i < aTabCols.
Count(); ++
i )
2256 if (
::IsSame( nX, nLeft + aTabCols[
i] ) )
2273 if (
auto const pFE =
dynamic_cast<SwFEShell *
>(&rCurrentShell))
2275 pFE->ClearColumnRowCache(pFrame);
2285 if (pFrame ==
nullptr || pFrame ==
m_pColumnCache->pLastTabFrame)
2292 if (pFrame ==
nullptr || pFrame ==
m_pRowCache->pLastTabFrame)
2302 if( pFrame && pFrame->
IsInTab() )
2309 if( pFrame && pFrame->
IsInTab() )
2325 if( !pFrame || !pFrame->
IsInTab() )
2346 nPrtWidth != rTableFrameSz.
GetWidth() )
2355 nLogDiff /= nPrtWidth;
2360 eType, nDiff, nLogDiff );
2372 for (
size_t nSelBoxes = aBoxes.
size(); nSelBoxes; )
2376 if( std::none_of(rCells.begin(), rCells.end(), [&pBox](
SwCellFrame* pFrame) { return pFrame->GetTabBox() == pBox; }) )
2396 for(
size_t n = aCells.size();
n; )
2405 if( USHRT_MAX == nBoxW )
2411 GetTabBox()->GetFrameFormat()->GetTableBoxFormula(), aCells))
2415 for(
size_t i = aCells.size();
n+1 <
i; )
2417 sFields =
"|<" + aCells[--
i]->GetTabBox()->GetName() +
">"
2429 GetTabBox()->GetFrameFormat()->GetTableBoxFormula(), aCells ))
2431 else if( USHRT_MAX != nBoxW )
2432 sFields = OUStringChar(
cListDelim) + sFields;
2443 GetTabBox()->GetFrameFormat()->GetTableBoxFormula(), aCells ))
2450 for(
size_t i = aCells.size();
n+1 <
i; )
2452 sFields =
"|<" + aCells[--
i]->GetTabBox()->GetName() +
">"
2457 sFields = OUStringChar(
cListDelim) + sFields;
2459 else if( USHRT_MAX == nBoxW )
2473 rFormula = OUString::createFromAscii(
sCalc_Sum );
2474 if (!sFields.isEmpty())
2476 rFormula +=
"(" + sFields +
")";
2493 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
Text operation/manipulation interface.
virtual bool DeleteAndJoin(SwPaM &, SwDeleteFlags flags=SwDeleteFlags::Default)=0
complete delete of a given PaM
virtual bool InsertString(const SwPaM &rRg, const OUString &, const SwInsertFlags nInsertMode=SwInsertFlags::EMPTYEXPAND)=0
Insert string into existing text node at position rRg.Point().
virtual const SwRootFrame * GetCurrentLayout() const =0
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
virtual void SetRedlineFlags_intern(RedlineFlags eMode)=0
Set a new redline mode.
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
virtual void SetModified()=0
Must be called manually at changes of format.
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long X() const
constexpr tools::Long getX() const
constexpr tools::Long getY() const
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
Check if Point of current cursor is placed within a table.
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.
SwShellCursor * getShellCursor(bool bBlock)
Delivers the current shell cursor.
bool GetContentAtPos(const Point &rPt, SwContentAtPos &rContentAtPos, bool bSetCursor=false, SwRect *pFieldRect=nullptr)
::std::optional<::std::pair< SwNode const *, ::std::vector< SwTableNode * > > > ExtendedSelectedAll() const
If ExtendedSelectAll() was called and selection didn't change since then.
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.
IDocumentContentOperations const & getIDocumentContentOperations() const
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...
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
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.
SwRedlineTable::size_type GetRedlineCount() const
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.
bool IsEmpty(bool bWithRemainingNestedTable=true) const
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)
#define CH_TXT_TRACKED_DUMMY_CHAR
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::@21 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.
void SetContent(sal_Int32 nContentIndex)
Set content index, only valid to call this if the position points to a SwContentNode subclass.
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