20#include <libxml/xmlwriter.h>
21#include <config_wasm_strip.h>
42#include <UndoManager.hxx>
97#include <osl/diagnose.h>
100#define CHECK_TABLE(t) (t).CheckConsistency();
102#define CHECK_TABLE(t)
105using ::editeng::SvxBorderLine;
112 bool bTop =
false, bBottom =
false, bLeft =
false, bRight =
false;
115 case 0: bTop = bBottom = bLeft =
true;
break;
116 case 1: bTop = bBottom = bLeft = bRight =
true;
break;
117 case 2: bBottom = bLeft =
true;
break;
118 case 3: bBottom = bLeft = bRight =
true;
break;
127 aLine.SetBorderLineStyle(SvxBorderLineStyle::DOUBLE);
132 aBox.
SetLine( &aLine, SvxBoxItemLine::TOP );
134 aBox.
SetLine( &aLine, SvxBoxItemLine::BOTTOM );
136 aBox.
SetLine( &aLine, SvxBoxItemLine::LEFT );
138 aBox.
SetLine( &aLine, SvxBoxItemLine::RIGHT );
153 rBoxFormatArr[
nId ] = pMap;
158 DfltBoxAttrMap_t::iterator
const iter(pMap->find(pBoxFrameFormat));
159 if (pMap->end() != iter)
161 pNewTableBoxFormat = iter->second;
171 pAutoFormat->UpdateToSet(
nId,
false,
false,
178 (*pMap)[pBoxFrameFormat] = pNewTableBoxFormat;
186 if ( !rBoxFormatArr[
nId] )
189 if( USHRT_MAX != nCols )
191 USHRT_MAX / nCols, 0 ));
193 rBoxFormatArr[
nId ] = pBoxFormat;
195 return rBoxFormatArr[
nId];
200 const sal_uInt16 nRows,
const sal_uInt16 nCols,
sal_uInt8 nId )
202 if( !rBoxFormatArr[
nId] )
209 if( USHRT_MAX != nCols )
211 USHRT_MAX / nCols, 0 ));
212 rBoxFormatArr[
nId ] = pBoxFormat;
214 return rBoxFormatArr[
nId];
244 OSL_ENSURE( pLine,
"No valid Line" );
248 SwTableBox *pPrvBox =
nullptr, *pNxtBox =
nullptr;
251 if( nInsPos < pLine->GetTabBoxes().
size() )
255 if(
nullptr == pPrvBox )
262 if(
nullptr == pNxtBox )
269 if(
nullptr == pNxtBox )
273 if( !pPrvBox && !pNxtBox )
275 bool bSetIdxPos =
true;
285 while( !( pNxtBox = pLine->
GetTabBoxes()[0])->GetTabLines().empty() )
286 pLine = pNxtBox->GetTabLines()[0];
287 nIdxPos = pNxtBox->GetSttIdx();
296 nIdxPos = pNxtBox->GetSttIdx();
301 for( sal_uInt16
n = 0;
n < nCnt; ++
n )
308 pPrvBox =
new SwTableBox( pBoxFormat, *pSttNd, pLine );
311 sal_uInt16 nRealInsPos = nInsPos +
n;
312 if (nRealInsPos > rTabBoxes.size())
313 nRealInsPos = rTabBoxes.size();
315 rTabBoxes.insert( rTabBoxes.begin() + nRealInsPos, pPrvBox );
326 GetDoc().GetDfltTextFormatColl(),
339 sal_uInt16 nCols, sal_Int16 eAdjust,
341 const std::vector<sal_uInt16> *pColArr,
342 bool bCalledFromShell,
344 const OUString& rTableName )
346 assert(nRows &&
"Table without line?");
347 assert(nCols &&
"Table without rows?");
361 OUString aTableName = rTableName;
368 std::make_unique<SwUndoInsTable>( rPos, nCols, nRows, o3tl::narrowing<sal_uInt16>(eAdjust),
369 rInsTableOpts, pTAFormat, pColArr,
375 *pHeadColl = pBodyColl;
382 const sal_uInt16 nRowsToRepeat =
401 bCalledFromShell ? &pContentNd->GetSwAttrSet() :
nullptr );
411 const SwAttrSet & aNdSet = pContentNd->GetSwAttrSet();
427 sal_uInt16 nSttPos = pColArr->front();
428 sal_uInt16 nLastPos = pColArr->back();
431 sal_uInt16 nFrameWidth = nLastPos;
432 nLastPos = (*pColArr)[ pColArr->size()-2 ];
435 nWidth = nLastPos - nSttPos;
472 std::vector<SwTableBoxFormat*> aBoxFormatArr;
474 if( !bDfltBorders && !pTAFormat )
481 const sal_uInt16 nBoxArrLen = pTAFormat ? 16 : 4;
482 aBoxFormatArr.resize( nBoxArrLen,
nullptr );
488 for( sal_uInt16
n = 0;
n < nRows; ++
n )
493 for( sal_uInt16
i = 0;
i < nCols; ++
i )
505 aCharSet.ClearItem();
508 if( aCharSet.Count() )
513 else if( bDfltBorders )
515 sal_uInt8 nBoxId = (
i < nCols - 1 ? 0 : 1) + (
n ? 2 : 0 );
525 nWidth = (*pColArr)[
i + 1 ] - (*pColArr)[
i ];
528 if( pBoxF->HasWriterListeners() )
531 *pNewFormat = *pBoxF;
539 rBoxes.insert( rBoxes.begin() +
i, pBox );
573 if( !pHeadlineTextColl || !nLines )
574 pHeadlineTextColl = pContentTextColl;
583 for( sal_uInt16 nL = 0; nL < nLines; ++nL )
585 for( sal_uInt16 nB = 0; nB < nBoxes; ++nB )
595 if (
nullptr != pAttrSet )
597 static const sal_uInt16 aPropagateItems[] = {
603 const sal_uInt16* pIdx = aPropagateItems;
607 SfxItemState::SET == pAttrSet->
GetItemState( *pIdx,
true, &pItem ) )
615 if ( nL + 1 >= nRepeat )
616 pTextColl = pContentTextColl;
630 auto [pStt, pEnd] = rRange.
StartEnd();
633 for( ; nCnt <= pEnd->GetNodeIndex(); ++nCnt )
634 if( !
GetNodes()[ nCnt ]->IsTextNode() )
651 SwPaM aOriginal( *pStt, *pEnd );
659 o3tl::narrowing<sal_uInt16>(eAdjust), pTAFormat );
669 SwNodeRange aRg( pStt->GetNode(), pEnd->GetNode() );
670 if( pStt->GetContentIndex() )
673 bool bEndContent = 0 != pEnd->GetContentIndex();
678 if( pEnd->GetNode().GetContentNode()->Len() != pEnd->GetContentIndex()
679 || pEnd->GetNodeIndex() >=
GetNodes().GetEndOfContent().GetIndex()-1 )
684 if( pStt->GetNodeIndex() >= pEnd->GetNodeIndex() )
693 OSL_FAIL(
"empty range" );
732 aRg, cCh, pTableFormat, pLineFormat, pBoxFormat,
737 const sal_uInt16 nRowsToRepeat =
743 bool bUseBoxFormat =
false;
744 if( !pBoxFormat->HasWriterListeners() )
748 bUseBoxFormat =
true;
760 sal_uInt8 nBoxArrLen = pTAFormat ? 16 : 4;
761 std::unique_ptr< DfltBoxAttrList_t > aBoxFormatArr1;
762 std::optional< std::vector<SwTableBoxFormat*> > aBoxFormatArr2;
769 aBoxFormatArr2 = std::vector<SwTableBoxFormat*>( nBoxArrLen,
nullptr );
782 const SwTableBoxes::size_type nCols = rBoxes.
size();
783 for( SwTableBoxes::size_type
i = 0;
i < nCols; ++
i )
791 ? 12 : (4 * (1 + ((
n-1) & 1 )))));
793 (
i+1 == nCols ? 3 : (1 + ((
i-1) & 1))));
798 bChgSz =
nullptr == (*aBoxFormatArr2)[
nId ];
800 *pTAFormat, USHRT_MAX, USHRT_MAX,
nId );
806 aCharSet.ClearItem();
809 if( aCharSet.Count() )
813 for( ; nSttNd < nEndNd; ++nSttNd )
837 bChgSz =
nullptr == (*aBoxFormatArr2)[
nId ];
856 delete (*aBoxFormatArr1)[
i ];
941 size_t const nBoxes = pCurrLine->
GetTabBoxes().size();
942 if (nMaxBoxes != nBoxes)
945 nullptr, nBoxes, nMaxBoxes - nBoxes);
949 for (
size_t i = nBoxes;
i < nMaxBoxes; ++
i)
956 if (!
n && pPositions)
967 std::vector<sal_uInt16> *
const pPositions)
969 if (pPositions && !pPositions->empty())
972 sal_uInt16 nLastPos = 0;
973 for (
size_t n = 0;
n < pPositions->size(); ++
n)
978 for (
size_t nTmpLine = 0; nTmpLine < rLns.
size(); ++nTmpLine)
982 pNewFormat->Add( rLns[ nTmpLine ]->GetTabBoxes()[
n ] );
985 nLastPos = (*pPositions)[
n ];
989 SAL_WARN_IF(rBoxFormat.HasWriterListeners(),
"sw.core",
990 "who is still registered in the format?");
995 size_t nWidth = nMaxBoxes ? USHRT_MAX / nMaxBoxes : USHRT_MAX;
1014 std::vector<sal_uInt16> aPosArr;
1017 sal_uInt16 nBoxes, nLines, nMaxBoxes = 0;
1021 for( nLines = 0, nBoxes = 0;
1026 OSL_ENSURE( pTextNd,
"Only add TextNodes to the Table" );
1028 if( !nLines && 0x0b == cCh )
1036 OUString
const& rText(pTextNd->
GetText());
1037 for (sal_Int32 nChPos = 0; nChPos < rText.getLength(); ++nChPos)
1039 if (rText[nChPos] == cCh)
1043 aPosArr.push_back( o3tl::narrowing<sal_uInt16>(
1074 if (pTextNd->
GetText()[nChPos] == cCh)
1080 if (!pContentStore->Empty())
1082 pContentStore->Restore(*pNewNode, nChPos, nChPos + 1, eMode);
1097 pNewNd->m_pStartOfSection = pSttNd;
1100 pBox =
new SwTableBox( pBoxFormat, *pSttNd, pLine );
1111 if( !pContentStore->Empty())
1112 pContentStore->Restore( *pTextNd, pTextNd->
GetText().getLength(), pTextNd->
GetText().getLength()+1 );
1119 pBox =
new SwTableBox( pBoxFormat, *pSttNd, pLine );
1121 if( nMaxBoxes < nBoxes )
1134 if (rTableNodes.empty())
1137 const std::vector<SwNodeRange>& rFirstRange = *rTableNodes.begin();
1139 if (rFirstRange.empty())
1142 const std::vector<SwNodeRange>& rLastRange = *rTableNodes.rbegin();
1144 if (rLastRange.empty())
1150 const SwNodeRange& rStartRange = *rFirstRange.begin();
1151 const SwNodeRange& rEndRange = *rLastRange.rbegin();
1194 OSL_FAIL(
"empty range" );
1202 SwNodeIndex const prev(rTableNodes.begin()->begin()->aStart, -1);
1205 for (
const auto& rRow : rTableNodes)
1207 for (
const auto& rCell : rRow)
1210 SwPaM pam(rCell.aStart, 0, *pPrev,
1214 pPrev = &rCell.aEnd;
1258 rTableNodes, pTableFormat, pLineFormat, pBoxFormat );
1263 if( !pBoxFormat->HasWriterListeners() )
1282 bool bChanged =
false;
1290 while (
aIndex < aEndIndex)
1311 aNewStart = *pStartNode;
1324 aNewStart = *pStartNode;
1329 pNode = &
aIndex.GetNode();
1333 rExpandedRange.emplace(aNewStart, aNewEnd);
1342 for (
size_t nTmpLine = 0; nTmpLine < rLines.
size(); ++nTmpLine)
1344 SwTableBoxes & rBoxes = rLines[nTmpLine]->GetTabBoxes();
1345 assert(!rBoxes.empty());
1346 size_t const nMissing = nMaxBoxes - rBoxes.size();
1351 size_t nWidth = nMaxBoxes ? USHRT_MAX / nMaxBoxes : USHRT_MAX;
1353 nWidth * (nMissing + 1)) );
1354 pNewFormat->Add(rBoxes.back());
1357 size_t nWidth = nMaxBoxes ? USHRT_MAX / nMaxBoxes : USHRT_MAX;
1367 if( rTableNodes.empty() )
1372 SwNodeIndex aInsertIndex( rTableNodes.rbegin()->rbegin()->aEnd );
1382 sal_uInt16 nLines, nMaxBoxes = 0;
1384 SwNodeIndex aNodeIndex = rTableNodes.begin()->begin()->aStart;
1386 for( nLines = 0; aNodeIndex <= rTableNodes.rbegin()->rbegin()->aEnd; ++aNodeIndex,++nLines )
1392 (0 == nLines) ? pTableFormat :
nullptr);
1397 for(
const auto& rRow : rTableNodes )
1399 sal_uInt16 nBoxes = 0;
1403 for(
const auto& rCell : rRow )
1417 for(;aCellNodeIdx <= rCell.aEnd; ++aCellNodeIdx )
1426 pBox =
new SwTableBox( pBoxFormat, *pSttNd, pLine );
1429 if( nMaxBoxes < nBoxes )
1456 std::unique_ptr<SwUndoTableToText> pUndo;
1465 const_cast<SwTable*
>(&pTableNd->
GetTable())->SwitchFormulasToExternalRepresentation();
1472 pUndo->SetRange( *pUndoRg );
1497 pLastNd(nullptr), rNds( rNodes ), pUndo( pU ), cCh( cChar ) {}
1507 assert(pPara &&
"The parameters are missing!");
1508 DelTabPara aPara( *pPara );
1513 pPara->pLastNd = aPara.pLastNd;
1518 assert(pDelPara &&
"The parameters are missing");
1528 SwDoc& rDoc = pDelPara->rNds.GetDoc();
1532 pDelPara->rNds.SectionUp( &aDelRg );
1534 if (
T2T_PARA != pDelPara->cCh && pDelPara->pLastNd)
1536 if (
nullptr != pCurTextNd)
1545 pDelPara->pLastNd->GetText().getLength());
1546 pDelPara->pLastNd->InsertText( OUString(pDelPara->cCh), aCntIdx,
1548 if( pDelPara->pUndo )
1549 pDelPara->pUndo->AddBoxPos( rDoc, nNdIdx, aDelRg.
aEnd.
GetIndex(),
1553 const sal_Int32 nOldTextLen = aCntIdx.
GetIndex();
1556 pDelPara->pLastNd->JoinNext();
1558 if( !pContentStore->Empty() )
1559 pContentStore->Restore( rDoc, pDelPara->pLastNd->GetIndex(), nOldTextLen );
1561 else if( pDelPara->pUndo )
1564 pDelPara->pUndo->AddBoxPos( rDoc, nNdIdx, aDelRg.
aEnd.
GetIndex() );
1567 else if( pDelPara->pUndo )
1573 if( pDelPara->pLastNd && pDelPara->pLastNd->HasSwAttrSet() )
1585 if (
nullptr == pTableNd ||
1590 std::optional<SwNode2LayoutSaveUpperFrames> oNode2Layout;
1595 oNode2Layout.emplace(*pTableNd);
1601 DelTabPara aDelPara( *
this, cCh, pUndo );
1618 if( pBreak || pDesc )
1634 oNode2Layout->RestoreUpperFrames( *
this,
1636 oNode2Layout.reset();
1645 if(
nullptr != pCNd )
1648 static_cast<SwContentNode*
>(pFrameNd)->MakeFramesForAdjacentContentNode(*pCNd);
1680 ((RndStdIds::FLY_AT_PARA == rAnchor.
GetAnchorId()) ||
1681 (RndStdIds::FLY_AT_CHAR == rAnchor.
GetAnchorId())) &&
1704 if( !aBoxes.
empty() )
1710 OSL_ENSURE( !rBoxes.
empty(),
"No valid Box list" );
1716 if(
dynamic_cast<const SwDDETable*
>( &rTable) !=
nullptr)
1720 std::unique_ptr<SwUndoTableNdsChg> pUndo;
1724 0, 0, nCnt, bBehind,
false ));
1733 bRet = rTable.
InsertCol(*
this, rBoxes, nCnt, bBehind);
1744 pUndo->SaveNewBoxes( *pTableNd, aTmpLst );
1756 if( !aBoxes.
empty() )
1762 OSL_ENSURE( !rBoxes.
empty(),
"No valid Box list" );
1768 if(
dynamic_cast<const SwDDETable*
>( &rTable) !=
nullptr)
1772 std::unique_ptr<SwUndoTableNdsChg> pUndo;
1776 0, 0, nCnt, bBehind,
false ));
1785 bRet = rTable.
InsertRow(
this, rBoxes, nCnt, bBehind );
1796 pUndo->SaveNewBoxes( *pTableNd, aTmpLst );
1825 FndBox_ aFndBox(
nullptr,
nullptr );
1827 FndPara aPara( aBoxes, &aFndBox );
1841 while( 1 == pFndBox->
GetLines().size() &&
1842 1 == pFndBox->
GetLines().front()->GetBoxes().size() )
1844 FndBox_ *
const pTmp = pFndBox->
GetLines().front()->GetBoxes()[0].get();
1866 pDelLine = pFndBox->
GetLines().front()->GetLine();
1869 pDelBox = pDelBox->
GetTabLines()[0]->GetTabBoxes()[0];
1891 SwPaM* pPam =
const_cast<SwPaM*
>(
static_cast<SwPaM const *
>(&rCursor));
1918 pESh->ParkCursor( *pNd );
1935 bool bNewTextNd =
false;
1943 if (nTableEnd == nSectEnd)
1976 SwPaM const* pSavePaM(
nullptr);
1980 pSavePaM = &forwardPaM;
1982 SwPaM backwardPaM(*pTableNd);
1985 if (pSavePaM ==
nullptr
1991 pSavePaM = &backwardPaM;
2001 bool bSavePageBreak =
false, bSavePageDesc =
false;
2012 bSavePageDesc =
true;
2019 bSavePageBreak =
true;
2024 pUndo->SetTableDelLastNd();
2025 pUndo->SetPgBrkFlags( bSavePageBreak, bSavePageDesc );
2039 SwPaM const* pSavePaM(
nullptr);
2043 pSavePaM = &forwardPaM;
2045 SwPaM backwardPaM(*pTableNd);
2048 if (pSavePaM ==
nullptr
2054 pSavePaM = &backwardPaM;
2087 pFEShell->UpdateTableStyleFormatting();
2101 OSL_ENSURE( !rBoxes.
empty(),
"No valid Box list" );
2127 const SwNodeOffset nTmpIdx2 = aSelBoxes.
back()->GetSttNd()->EndOfSectionIndex() + 1;
2129 aSelBoxes[0]->GetSttIdx()-1 == nTmpIdx1 &&
2136 std::unique_ptr<SwUndoTableNdsChg> pUndo;
2140 nMin, nMax, 0,
false,
false ));
2154 pUndo->ReNewBoxes( aSelBoxes );
2156 bRet = rTable.
DeleteSel(
this, aSelBoxes,
nullptr, pUndo.get(),
true,
true );
2160 pFEShell->UpdateTableStyleFormatting();
2181 OSL_ENSURE( !rBoxes.
empty() && nCnt,
"No valid Box list" );
2187 if(
dynamic_cast<const SwDDETable*
>( &rTable) !=
nullptr)
2190 std::vector<SwNodeOffset> aNdsCnts;
2192 std::unique_ptr<SwUndoTableNdsChg> pUndo;
2196 nCnt, bVert, bSameHeight ));
2201 for (
size_t n = 0;
n < rBoxes.
size(); ++
n)
2216 bRet = rTable.
SplitCol(*
this, rBoxes, nCnt);
2218 bRet = rTable.
SplitRow(*
this, rBoxes, nCnt, bSameHeight);
2223 pFEShell->UpdateTableStyleFormatting();
2233 pUndo->SaveNewBoxes( *pTableNd, aTmpLst );
2235 pUndo->SaveNewBoxes( *pTableNd, aTmpLst, rBoxes, aNdsCnts );
2249 if(
dynamic_cast<const SwDDETable*
>( &rTable) !=
nullptr )
2266 std::unique_ptr<SwUndoTableMerge> pUndo;
2275 if( !rTable.
PrepareMerge( rPam, aBoxes, aMerged, &pMergeBox, pUndo.get() ) )
2312 SwPaM* pTmp = &rPam;
2313 while( &rPam != ( pTmp = pTmp->
GetNext() ))
2314 for(
int i = 0;
i < 2; ++
i )
2323 pTableCursor->NewTableSelection();
2330 if( pTableNd->
GetTable().
Merge(
this, aBoxes, aMerged, pMergeBox, pUndo.get() ))
2378 if( !
GetTable().GetFrameFormat()->HasWriterListeners())
2384 OSL_ENSURE( pNode,
"No ContentNode or CopyNode and new Node is identical");
2390 while(
nullptr != (pFrame = aNode2Layout.
NextFrame()) )
2420 pIdxBehind->
Assign(*
this);
2424 pIdxBehind->
Assign(*pNd);
2429 while(
nullptr != (pUpper = aNode2Layout.
UpperFrame( pFrame, *
this )) )
2437 pNew->
Paste( pUpper, pFrame );
2443#if !ENABLE_WASM_STRIP_ACCESSIBILITY
2446 if ( pViewShell && pViewShell->
GetLayout() &&
2452 pNext ? pNext->DynCastTextFrame() :
nullptr,
2453 pPrev ? pPrev->DynCastTextFrame() :
nullptr );
2471 bool bAgain =
false;
2473 if (!pFrame->IsFollow() && (!pLayout || pLayout == pFrame->
getRootFrame()))
2475 while ( pFrame->HasFollow() )
2482#if !ENABLE_WASM_STRIP_ACCESSIBILITY
2483 if (!
GetDoc().IsInDtor())
2486 if ( pViewShell && pViewShell->
GetLayout() &&
2492 pNext ? pNext->DynCastTextFrame() :
nullptr,
2493 pPrev ? pPrev->DynCastTextFrame() :
nullptr );
2503 pFrame = bAgain ? aIter.
First() : aIter.
Next();
2527 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwTableNode"));
2528 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
2529 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"index"), BAD_CAST(OString::number(sal_Int32(
GetIndex())).getStr()));
2541 OSL_ENSURE( pBoxFrame,
"pBoxFrame needs to be specified!" );
2584 for (
size_t i = 0;
i < rBoxes.
size(); ++
i)
2595 OSL_ENSURE( pBoxFrame,
"GetTabRows called without pBoxFrame" );
2611 const SwCursor aTmpCursor( aPos,
nullptr );
2618 OSL_FAIL(
"Current box has been deleted during GetTabRows()" );
2624 OSL_ENSURE( pTab,
"GetTabRows called without a table" );
2645 typedef std::map< tools::Long, std::pair< tools::Long, long >, FuzzyCompare > BoundaryMap;
2646 BoundaryMap aBoundaries;
2647 BoundaryMap::iterator aIter;
2648 std::pair< tools::Long, long > aPair;
2650 typedef std::map< tools::Long, bool > HiddenMap;
2652 HiddenMap::iterator aHiddenIter;
2654 while ( pFrame && pTab->
IsAnLower( pFrame ) )
2663 aIter = aBoundaries.find( nUpperBorder );
2664 if ( aIter == aBoundaries.end() )
2666 aPair.first = nUpperBorder; aPair.second =
LONG_MAX;
2667 aBoundaries[ nUpperBorder ] = aPair;
2671 aIter = aBoundaries.find( nLowerBorder );
2672 if ( aIter == aBoundaries.end() )
2674 aPair.first = nUpperBorder; aPair.second =
LONG_MAX;
2678 nLowerBorder = (*aIter).first;
2679 tools::Long nNewLowerBorderUpperBoundary = std::max( (*aIter).second.first, nUpperBorder );
2680 aPair.first = nNewLowerBorderUpperBoundary; aPair.second =
LONG_MAX;
2682 aBoundaries[ nLowerBorder ] = aPair;
2688 aHiddenIter = aHidden.find( nTmpVal );
2689 if ( aHiddenIter == aHidden.end() )
2693 if ( aHidden[ nTmpVal ] &&
2695 aHidden[ nTmpVal ] =
false;
2697 nTmpVal = nLowerBorder;
2706 for (
const auto& rEntry : aBoundaries )
2710 const std::pair< tools::Long, long > aTmpPair = rEntry.second;
2714 aHiddenIter = aHidden.find( rEntry.first );
2715 const bool bHidden = aHiddenIter != aHidden.end() && (*aHiddenIter).second;
2716 rFill.
Insert( nKey, nFirst, nSecond, bHidden, nIdx++ );
2720 OSL_ENSURE( rFill.
Count(),
"Deleting from empty vector. Fasten your seatbelts!" );
2741 OSL_ENSURE(
false,
"must specify pBoxFrame" );
2759 if( nPrtWidth != rTableFrameSz.
GetWidth() )
2781 SetTabCols(rTab, rNew, aOld, pBox, bCurRowOnly );
2795 OSL_ENSURE(
false,
"must specify pBoxFrame" );
2809 if ( aRectFnSet.
IsVert() )
2831 OSL_ENSURE( pTable,
"My colleague told me, this couldn't happen" );
2838 const tools::Long nOldRowStart =
i == 0 ? 0 : aOld[ nIdxStt ];
2840 const tools::Long nOldRowHeight = nOldRowEnd - nOldRowStart;
2842 const tools::Long nNewRowStart =
i == 0 ? 0 : rNew[ nIdxStt ];
2844 const tools::Long nNewRowHeight = nNewRowEnd - nNewRowStart;
2846 const tools::Long nDiff = nNewRowHeight - nOldRowHeight;
2859 while ( pFrame && pTab->
IsAnLower( pFrame ) )
2867 if ( !bCurColOnly || pFrame == pBoxFrame )
2874 const sal_Int32 nRowSpan = pBox->
getRowSpan();
2876 pTextFrame =
static_cast<const SwTextFrame*
>(pContent);
2879 if( pLine && pTextFrame )
2891 const SwCursor aTmpCursor( aPos,
nullptr );
2923 std::make_unique<SwUndoAttrTable>( *rTab.
GetTableNode(),
true ));
2925 rTab.
SetTabCols( rNew, rOld, pStart, bCurRowOnly );
2938 std::make_unique<SwUndoTableHeadline>(rTable, rTable.
GetRowsToRepeat(), nSet) );
2966 std::vector<sal_uInt16>::size_type
n;
2990 std::vector<sal_uInt16>::size_type
n;
3013 for(
n = 0;
n < nArrSize; ++
n )
3052 pSplPara->
AddBox( *pBox );
3093 if( aTmpSet.Count() )
3148 sal_uInt16 nSplitLine = 0;
3162 FndBox_ aFndBox(
nullptr,
nullptr );
3175 *pNew, std::move(pSaveRowSp), eHdlnMode, bCalcNewSize);
3177 if( aHistory.
Count() )
3252 pFEShell->UpdateTableStyleFormatting(pTNd);
3253 pFEShell->UpdateTableStyleFormatting(pNew);
3267 if( USHRT_MAX == aTableMaxSz.
GetWidth() )
3270 bool bLocked = pFormat->IsModifyLocked();
3271 pFormat->LockModify();
3276 for(
auto pLn : rLns )
3280 for(
auto pBox : rBoxes )
3281 nMaxLnWidth += pBox->GetFrameFormat()->GetFrameSize().GetWidth();
3283 if( nMaxLnWidth > aTableMaxSz.
GetWidth() )
3284 aTableMaxSz.
SetWidth( nMaxLnWidth );
3288 pFormat->UnlockModify();
3295class SplitTable_Para
3297 std::map<SwFrameFormat const*, SwFrameFormat*> m_aSrcDestMap;
3303 : m_pNewTableNode(pNew)
3308 auto it = m_aSrcDestMap.find(pSrcFormat);
3309 return it == m_aSrcDestMap.end() ? nullptr : it->second;
3314 m_aSrcDestMap[pSrcFormat] = pDestFormat;
3332 if( pDestFormat ==
nullptr )
3347 if( pDestFormat ==
nullptr )
3355 pPara->ChgBox( pBox );
3383 if( USHRT_MAX == nLinePos ||
3397 assert(pOldTableEndNd &&
"Where is the EndNode?");
3408 OSL_ENSURE( pBoxNd->
IsStartNode(),
"This needs to be a StartNode!" );
3411 }
while( pBoxNd != pOldTableEndNd );
3429 const SwTableBoxes::size_type nBoxCnt = rTable.
GetTabLines()[ nLineIdx ]->GetTabBoxes().
size();
3430 for (SwTableBoxes::size_type j = 0; j < nBoxCnt; ++j)
3432 const SwTableBoxes::size_type nIdx = nBoxCnt - 1 - j;
3443 SplitTable_Para aPara( pNewTableNd, rTable );
3456 *pNewTableFormat = *pOldTableFormat;
3488 pDelTableNd = rNds[ pTableNd->
GetIndex() - 1 ]->FindTableNode();
3495 dynamic_cast<const SwDDETable*
>( &pDelTableNd->GetTable() ) !=
nullptr)
3500 pDelTableNd->GetTable().SetHTMLTableLayout(std::shared_ptr<SwHTMLTableLayout>());
3504 std::unique_ptr<SwHistory> pHistory;
3513 pTableNd->
GetTable().
Merge(pDelTableNd->GetTable(), pHistory.get());
3516 bool bRet = rNds.
MergeTable( bWithPrev ? *pTableNd : *pDelTableNd, !bWithPrev );
3520 if( pHistory->Count() )
3527 pFEShell->UpdateTableStyleFormatting();
3538 OSL_ENSURE( pDelTableNd,
"Where did the TableNode go?" );
3541 OSL_ENSURE( pTableNd,
"Where did the TableNode go?" );
3543 if( !pDelTableNd || !pTableNd )
3552 FndBox_ aFndBox(
nullptr,
nullptr );
3564 if( rTableSz != rDelTableSz )
3605 OSL_ENSURE( pBoxNd->
IsStartNode(),
"This needs to be a StartNode!" );
3608 }
while( pBoxNd != pTableEndNd );
3636struct SetAFormatTabPara
3640 sal_uInt16 nEndBox, nCurBox;
3642 bool bSingleRowTable;
3646 nEndBox( 0 ), nCurBox( 0 ), nAFormatLine( 0 ), nAFormatBox( 0 ), bSingleRowTable(false)
3658 for (
auto const& it : rLine.
GetBoxes())
3669 if( !pSetPara->nCurBox )
3670 pSetPara->nAFormatBox = 0;
3671 else if( pSetPara->nCurBox == pSetPara->nEndBox )
3672 pSetPara->nAFormatBox = 3;
3674 pSetPara->nAFormatBox =
static_cast<sal_uInt8>(1 + ((pSetPara->nCurBox-1) & 1));
3688 sal_uInt8 nPos = pSetPara->nAFormatLine * 4 + pSetPara->nAFormatBox;
3689 const bool bSingleRowTable = pSetPara->bSingleRowTable;
3690 const bool bSingleColTable = pSetPara->nEndBox == 0;
3694 if (aCharSet.Count())
3698 for (; nSttNd < nEndNd; ++nSttNd)
3706 if (aBoxSet.
Count())
3709 pSetPara->pUndo->SaveBoxContent( *pSetBox );
3719 const bool bOrigSingleRowTable = pSetPara->bSingleRowTable;
3720 pSetPara->bSingleRowTable = rBox.
GetLines().size() == 1;
3721 for (
auto const& rpFndLine : rBox.
GetLines())
3725 pSetPara->bSingleRowTable = bOrigSingleRowTable;
3729 ++pSetPara->nCurBox;
3735 OSL_ENSURE( !rBoxes.
empty(),
"No valid Box list" );
3741 FndBox_ aFndBox(
nullptr,
nullptr );
3743 FndPara aPara( rBoxes, &aFndBox );
3750 table.SetHTMLTableLayout(std::shared_ptr<SwHTMLTableLayout>());
3753 while( 1 == pFndBox->
GetLines().size() &&
3754 1 == pFndBox->
GetLines().front()->GetBoxes().size())
3756 pFndBox = pFndBox->
GetLines().front()->GetBoxes()[0].get();
3779 SetAFormatTabPara aPara( rNew );
3781 aPara.bSingleRowTable = rFLns.size() == 1;
3783 for (FndLines_t::size_type
n = 0;
n < rFLns.size(); ++
n)
3792 aPara.nAFormatLine = 0;
3793 else if (
static_cast<size_t>(
n+1) == rFLns.size())
3794 aPara.nAFormatLine = 3;
3796 aPara.nAFormatLine =
static_cast<sal_uInt8>(1 + ((
n-1) & 1 ));
3798 aPara.nAFormatBox = 0;
3800 aPara.nEndBox = pLine->
GetBoxes().size()-1;
3801 aPara.pUndo = pUndo;
3802 for (
auto const& it : pLine->
GetBoxes())
3826 OSL_ENSURE( !rBoxes.
empty(),
"No valid Box list" );
3832 FndBox_ aFndBox(
nullptr,
nullptr );
3834 FndPara aPara( rBoxes, &aFndBox );
3845 while( 1 == pFndBox->
GetLines().size() &&
3846 1 == pFndBox->
GetLines().front()->GetBoxes().size())
3848 pFndBox = pFndBox->
GetLines().front()->GetBoxes()[0].get();
3856 sal_uInt16 aLnArr[4];
3858 aLnArr[1] = 1 < rFLns.size() ? 1 : 0;
3859 aLnArr[2] = 2 < rFLns.size() ? 2 : aLnArr[1];
3860 aLnArr[3] = rFLns.size() - 1;
3862 for(
sal_uInt8 nLine = 0; nLine < 4; ++nLine )
3864 FndLine_& rLine = *rFLns[ aLnArr[ nLine ] ];
3866 sal_uInt16 aBoxArr[4];
3868 aBoxArr[1] = 1 < rLine.
GetBoxes().size() ? 1 : 0;
3869 aBoxArr[2] = 2 < rLine.
GetBoxes().size() ? 2 : aBoxArr[1];
3870 aBoxArr[3] = rLine.
GetBoxes().size() - 1;
3872 for(
sal_uInt8 nBox = 0; nBox < 4; ++nBox )
3877 pFBox = pFBox->
GetTabLines()[0]->GetTabBoxes()[0];
3911 OUString
newName =
"MailMergeTable"
3921 std::unique_ptr<sal_uInt8[]> pSetFlags(
new sal_uInt8[ nFlagSize ] );
3922 memset( pSetFlags.get(), 0, nFlagSize );
3931 const sal_Int32 nNmLen =
aName.getLength();
3933 if( nNum-- && nNum < mpTableFrameFormatTable->
size() )
3934 pSetFlags[ nNum / 8 ] |= (0x01 << ( nNum & 0x07 ));
3940 for(
size_t n = 0;
n < nFlagSize; ++
n )
3942 auto nTmp = pSetFlags[
n ];
3956 return aName + OUString::number( ++nNum );
3968 for( ; it != itEnd; ++it )
3986 std::unique_ptr<SwUndo> pUndo;
3999 eType, nAbsDiff, nRelDiff,
4000 bUndo ? &pUndo :
nullptr );
4007 eType, nAbsDiff, nRelDiff,
4008 bUndo ? &pUndo :
nullptr );
4027 if( aString.getLength() > 308 )
4043 std::unique_ptr<SwUndoTableNumFormat> pUndo;
4045 bool bIsEmptyTextNd;
4047 sal_uInt32 nFormatIdx;
4049 if( rBox.
HasNumContent( fNumber, nFormatIdx, bIsEmptyTextNd ) )
4059 pUndo->SetNumFormat( nFormatIdx, fNumber );
4065 bool bLockModify =
true;
4072 if( pNumFormatItem && !bForceNumberFormat )
4078 if( nFormatType == pNumFormatr->
GetType( nOldNumFormat ) || SvNumFormatType::NUMBER == nFormatType )
4082 nFormatIdx = nOldNumFormat;
4083 bSetNumberFormat =
true;
4089 bLockModify = bSetNumberFormat =
false;
4093 if( bSetNumberFormat || bForceNumberFormat )
4103 if( !bSetNumberFormat && !bIsEmptyTextNd && pNumFormatItem )
4110 if( bLockModify ) pBoxFormat->LockModify();
4112 if( bLockModify ) pBoxFormat->UnlockModify();
4114 if( bSetNumberFormat )
4135 if( !bIsEmptyTextNd )
4154 pUndo->SetBox( rBox );
4182 pBoxFormat->LockModify();
4184 pBoxFormat->UnlockModify();
4188 pBoxFormat->LockModify();
4190 pBoxFormat->UnlockModify();
4201 if (
nullptr == pNode )
4208 && pTextNode->
GetText().isEmpty()))
4213 pTextNode->SwContentNode::GetAttr(
rSet );
4231 std::unique_ptr<SfxStringItem> pNewItem(pFormatItem->
Clone());
4232 pNewItem->SetValue(OUString());
4233 rSet.
Put( std::move(pNewItem) );
4240 if(
nullptr == pSttNd ||
4283 const SwTable* pCpyTable,
bool bCpyName,
bool bCorrPos,
const OUString& rStyleName )
4289 : rBoxes[ 0 ]->GetSttNd()->FindTableNode();
4294 if( !pCpyTable && !pInsTableNd )
4296 std::unique_ptr<SwUndoCpyTable> pUndo;
4306 bCpyName, rStyleName );
4313 pUndo->SetTableSttIdx( pInsTableNd->
GetIndex() );
4325 std::unique_ptr<SwUndoTableCpyTable> pUndo;
4334 bool bDelCpyDoc = xCpyDoc ==
this;
4339 xCpyDoc =
new SwDoc;
4341 SwPosition aPos( xCpyDoc->GetNodes().GetEndOfContent() );
4362 && ( bDelCpyDoc || !rBoxes.
empty() ) )
4372 OSL_ENSURE( pBox,
"Box is not in this Table" );
4381 *pBoxes, pUndo.get() );
4387 aNdIdx, pUndo.get() );
4396 if( bRet || !pUndo->IsEmpty() )
4404 rInsPos.
Assign( *pSttNd );
4421 std::unique_ptr<SwUndoAttrTable> pUndo;
4426 for (
size_t i = rSrtBox.
size();
i; )
4436 if( pUndo && bChgd )
4455 if( !rBoxes.
empty() )
4457 std::unique_ptr<SwUndoAttrTable> pUndo;
4459 pUndo.reset(
new SwUndoAttrTable( *rBoxes[0]->GetSttNd()->FindTableNode() ));
4461 std::map<SwFrameFormat*, SwTableBoxFormat*> aFormatsMap;
4462 for (
size_t i = rBoxes.
size();
i; )
4468 std::map<SwFrameFormat*, SwTableBoxFormat*>::const_iterator
const it =
4469 aFormatsMap.find(pBoxFormat);
4470 if (aFormatsMap.end() != it)
4477 aFormatsMap.insert(std::make_pair(pBoxFormat, pNewBoxFormat));
4483 if( pUndo && bChgd )
4493 bool bChgd =
false, bHasSel = rPam.
HasMark() ||
4498 for(
auto n = rFormats.
size();
n ; )
4508 bool bFound =
false;
4511 auto [pStt, pEnd] = pTmp->
StartEnd();
4512 bFound = pStt->GetNodeIndex() < nTableIdx &&
4513 nTableIdx < pEnd->GetNodeIndex();
4515 }
while( !bFound && &rPam != ( pTmp = pTmp->
GetNext() ) );
4530 const OUString* pTableName,
4531 bool* pFullTableProtection )
4533 bool bHasProtection =
false;
4547 for (
size_t i = rSrtBox.
size();
i; )
4552 if( !bHasProtection )
4554 bHasProtection =
true;
4555 if( !pFullTableProtection )
4557 *pFullTableProtection =
true;
4560 else if( bHasProtection && pFullTableProtection )
4562 *pFullTableProtection =
false;
4567 return bHasProtection;
4581 std::make_unique<SwUndoTableStyleMake>(rName, *
this));
4587 return pTableFormat;
4597 std::vector<SwTable*> vAffectedTables;
4598 if (pReleasedFormat)
4601 for (
size_t i=0;
i < nTableCount; ++
i)
4608 vAffectedTables.push_back(pTable);
4617 std::make_unique<SwUndoTableStyleDelete>(std::move(pReleasedFormat), std::move(vAffectedTables), *
this));
4621 return pReleasedFormat;
4631 *pFormat = rNewFormat;
4635 for (
size_t i=0;
i < nTableCount; ++
i)
4641 pFEShell->UpdateTableStyleFormatting(pTable->
GetTableNode());
4649 std::make_unique<SwUndoTableStyleUpdate>(*pFormat, aOldFormat, *
this));
@ ShowDelete
show all deletes
@ ShowInsert
show all inserts
sal_uInt32 GetValue() const
void SetTableLines(const SwSelBoxes &rBoxes, const SwTable &rTable)
const FndLine_ * GetUpper() const
const FndLines_t & GetLines() const
void MakeFrames(SwTable &rTable)
void DelFrames(SwTable &rTable)
const SwTableBox * GetBox() const
const FndBoxes_t & GetBoxes() const
const FndBox_ * GetUpper() const
void SetUpper(FndBox_ *pUp)
virtual SwChartDataProvider * GetChartDataProvider(bool bCreate=false) const =0
returns or creates the data-provider for chart
virtual void CreateChartInternalDataProviders(const SwTable *pTable)=0
calls createInternalDataProvider for all charts using the specified table
virtual bool SplitNode(const SwPosition &rPos, bool bChkTableStart)=0
Split a node at rPos (implemented only for TextNode).
virtual void DeleteSection(SwNode *pNode)=0
Delete section containing the node.
virtual bool SetFieldsDirty(bool b, const SwNode *pChk, SwNodeOffset nLen)=0
virtual void UpdateTableFields(const SwTable *pTable)=0
virtual const SwRootFrame * GetCurrentLayout() const =0
virtual void DelLayoutFormat(SwFrameFormat *pFormat)=0
virtual const SwExtraRedlineTable & GetExtraRedlineTable() const =0
virtual bool SplitRedline(const SwPaM &rPam)=0
virtual void SetRedlineFlags_intern(RedlineFlags eMode)=0
Set a new redline mode.
virtual AppendResult AppendRedline(SwRangeRedline *pNewRedl, bool bCallDelete)=0
Append a new redline.
virtual void SetRedlineFlags(RedlineFlags eMode)=0
Set a new redline mode.
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
virtual bool AcceptRedline(SwRedlineTable::size_type nPos, bool bCallDelete)=0
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
virtual void SetEnableSetModified(bool bEnableSetModified)=0
virtual void SetModified()=0
Must be called manually at changes of format.
virtual bool IsEnableSetModified() const =0
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
virtual SfxStringItem * Clone(SfxItemPool *=nullptr) const override
static const sal_Int16 VeryThin
const editeng::SvxBorderLine * GetTop() const
void SetLine(const editeng::SvxBorderLine *pNew, SvxBoxItemLine nLine)
const editeng::SvxBorderLine * GetBottom() const
void SetAllDistances(sal_Int16 nNew)
bool IsContentProtected() const
sal_uInt16 CalcShadowSpace(SvxShadowItemSide nShadow) const
tools::Long GetHeight() const
tools::Long GetWidth() const
void SetHeight(tools::Long n)
void SetWidth(tools::Long n)
SwCellFrame is one table cell in the document layout.
const SwTableBox * GetTabBox() const
void DeleteBox(const SwTable *pTable, const SwTableBox &rBox)
Class for SplitTable Collects the uppermost or lowermost Lines of a Box from a Line in an array.
SplitTable_HeadlineOption GetMode() const
void AddBox(const SwTableBox &rBox)
bool Resize(sal_uInt16 nOffset, sal_uInt16 nWidth)
std::vector< SwTableBox * > m_Boxes
bool IsGetFromTop() const
std::vector< sal_uInt16 > m_aPositionArr
void SetValues(bool bFlag)
void AddToUndoHistory(const SwContentNode &rNd)
const SwTableBox * GetBoxOfPos(const SwTableBox &rBox)
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
Marks a character position inside a document model content node (SwContentNode)
sal_Int32 GetIndex() const
SwContentIndex & Assign(const SwContentNode *, sal_Int32)
SwFormatColl * GetFormatColl() const
bool HasSwAttrSet() const
virtual SwContentFrame * MakeFrame(SwFrame *pSib)=0
MakeFrame will be called for a certain layout pSib is another SwFrame of the same layout (e....
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
void DelFrames(SwRootFrame const *pLayout)
Method deletes all views of document for the node.
virtual bool SetAttr(const SfxPoolItem &)
made virtual
virtual sal_Int32 Len() const
const SwAttrSet * GetpSwAttrSet() const
virtual SwFormatColl * ChgFormatColl(SwFormatColl *)
virtual bool ResetAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0)
helper class to check if a frame has been deleted during an operation WARNING! This should only be us...
bool HasBeenDeleted() const
return true if mpFrame != 0 and mpFrame is not client of pRegIn false otherwise
bool GetTableAutoFormat(const SwSelBoxes &rBoxes, SwTableAutoFormat &rGet)
Find out who has the Attributes.
static SwTableNode * IsInTable(const SwNode &)
void ClearLineNumAttrs(SwPosition const &rPos)
const SwTable * TextToTable(const SwInsertTableOptions &rInsTableOpts, const SwPaM &rRange, sal_Unicode cCh, sal_Int16 eAdjust, const SwTableAutoFormat *)
Text to Table.
SwTableBoxFormat * MakeTableBoxFormat()
void ChgTableStyle(const OUString &rName, const SwTableAutoFormat &rNewFormat)
void InsertCol(const SwCursor &rCursor, sal_uInt16 nCnt=1, bool bBehind=true)
Inserting Columns/Rows.
size_t GetTableFrameFormatCount(bool bUsed) const
void UpdateCharts(const OUString &rName) const
void SetRowHeight(const SwCursor &rCursor, const SwFormatFrameSize &rNew)
void BroadcastStyleOperation(const OUString &rName, SfxStyleFamily eFamily, SfxHintId nOp)
IDocumentState const & getIDocumentState() const
IDocumentChartDataProviderAccess const & getIDocumentChartDataProviderAccess() const
const sw::TableFrameFormats * GetTableFrameFormats() const
TableMergeErr MergeTable(SwPaM &rPam)
void DeleteCol(const SwCursor &rCursor)
bool IsUsed(const sw::BroadcastingModify &) const
SwTableLineFormat * MakeTableLineFormat()
bool UnProtectTableCells(SwTable &rTable)
SwTableFormat * MakeTableFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom)
static SwTableNode * IsIdxInTable(const SwNodeIndex &rIdx)
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.
std::unique_ptr< SwTableAutoFormatTable > m_pTableStyles
Table styles (autoformats that are applied with table changes).
bool InsCopyOfTable(SwPosition &rInsPos, const SwSelBoxes &rBoxes, const SwTable *pCpyTable, bool bCpyName=false, bool bCorrPos=false, const OUString &rStyleName="")
Copies a Table from the same or another Doc into itself We create a new Table or an existing one is f...
void ChkBoxNumFormat(SwTableBox &rCurrentBox, bool bCallUpdate)
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
SwEditShell const * GetEditShell() const
bool TableToText(const SwTableNode *pTableNd, sal_Unicode cCh)
Table to Text.
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
SwTableFormat * FindTableFormatByName(const OUString &rName, bool bAll=false) const
OUString GetUniqueTableName() const
void SetTabCols(const SwTabCols &rNew, bool bCurRowOnly, const SwCellFrame *pBoxFrame)
void SetTableBoxFormulaAttrs(SwTableBox &rBox, const SfxItemSet &rSet)
void InsertRow(const SwCursor &rCursor, sal_uInt16 nCnt=1, bool bBehind=true)
void SetTabRows(const SwTabCols &rNew, bool bCurColOnly, const SwCellFrame *pBoxFrame)
std::unique_ptr< SwTableAutoFormat > DelTableStyle(const OUString &rName, bool bBroadcast=false)
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
std::unique_ptr< sw::TableFrameFormats > mpTableFrameFormatTable
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.
SwTableFormat & GetTableFrameFormat(size_t nFormat, bool bUsed) const
bool IsInsTableFormatNum() const
bool DeleteRowCol(const SwSelBoxes &rBoxes, RowColMode eMode=RowColMode::DeleteRow)
const SwAttrPool & GetAttrPool() const
bool HasTableAnyProtection(const SwPosition *pPos, const OUString *pTableName, bool *pFullTableProtection)
const SwTable * InsertTable(const SwInsertTableOptions &rInsTableOpts, const SwPosition &rPos, sal_uInt16 nRows, sal_uInt16 nCols, sal_Int16 eAdjust, const SwTableAutoFormat *pTAFormat=nullptr, const std::vector< sal_uInt16 > *pColArr=nullptr, bool bCalledFromShell=false, bool bNewModel=true, const OUString &rTableName={})
Insert new table at position.
void DeleteRow(const SwCursor &rCursor)
Deleting Columns/Rows.
const SwFrameFormat * GetDfltFrameFormat() const
void DelTable(SwTableNode *pTable)
bool IsInMailMerge() const
void ClearBoxNumAttrs(SwNode &rNode)
void SetRowsToRepeat(SwTable &rTable, sal_uInt16 nSet)
::sw::DocumentSettingManager & GetDocumentSettingManager()
const sw::FrameFormats< sw::SpzFrameFormat * > * GetSpzFrameFormats() const
SwTableAutoFormatTable & GetTableStyles()
Return the available table styles.
void SetColRowWidthHeight(SwTableBox &rCurrentBox, TableChgWidthHeightType eType, SwTwips nAbsDiff, SwTwips nRelDiff)
SvNumberFormatter * GetNumberFormatter(bool bCreate=true)
SwDocShell * GetDocShell()
::sw::UndoManager & GetUndoManager()
void UnProtectCells(const OUString &rTableName)
bool IsNumberFormat(const OUString &aString, sal_uInt32 &F_Index, double &fOutNumber)
bool SetTableAutoFormat(const SwSelBoxes &rBoxes, const SwTableAutoFormat &rNew, bool bResetDirect=false, bool isSetStyleName=false)
AutoFormat for table/table selection.
bool IsInsTableChangeNumFormat() const
SwTableAutoFormat * MakeTableStyle(const OUString &rName, bool bBroadcast=false)
Ends a section of nodes in the document model.
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
SwPageDesc * GetPageDesc()
const SwRect & getFrameArea() const
const SwRect & getFramePrintArea() const
Base class of the Writer layout elements.
tools::Long GetPrtLeft() const
SwContentFrame * FindPrevCnt()
SwTabFrame * FindTabFrame()
SwTabFrame * ImplFindTabFrame()
virtual void Paste(SwFrame *pParent, SwFrame *pSibling=nullptr)=0
SwLayoutFrame * GetUpper()
tools::Long GetPrtTop() const
const SwLayoutFrame * GetNextLayoutLeaf() const
SwRootFrame * getRootFrame()
SwContentFrame * FindNextCnt(const bool _bInSameFootnote=false)
SwPageFrame * FindPageFrame()
static void DestroyFrame(SwFrame *const pFrame)
this is the only way to delete a SwFrame instance
void Add(const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue, SwNodeOffset nNodeIdx)
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame.
bool IsAnLower(const SwFrame *) const
void RestoreUpperFrames(SwNodes &rNds, SwNodeOffset nStt, SwNodeOffset nEnd)
SwLayoutFrame * UpperFrame(SwFrame *&rpFrame, const SwNode &rNode)
Marks a node in the document model.
const SwNodes & GetNodes() const
SwNodeOffset GetIndex() const
SwNodeIndex & Assign(SwNodes const &rNds, SwNodeOffset nIdx)
Base class of the Writer document model elements.
SwFrameFormat * GetFlyFormat() const
If node is in a fly return the respective format.
SwStartNode * GetStartNode()
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwSectionNode * GetSectionNode()
SwNodeOffset GetIndex() const
const SwStartNode * FindTableBoxStartNode() const
SwStartNode * m_pStartOfSection
SwNodes & GetNodes()
Node is in which nodes-array/doc?
bool IsContentNode() const
SwNodeOffset StartOfSectionIndex() const
bool IsSectionNode() const
SwTableNode * FindTableNode()
Search table node, in which it is.
SwStartNode * FindSttNodeByType(SwStartNodeType eTyp)
const SwStartNode * StartOfSectionNode() const
SwNodeOffset EndOfSectionIndex() const
bool IsCreateFrameWhenHidingRedlines() const
SwContentNode * GetContentNode()
SwTableNode * GetTableNode()
const SwEndNode * EndOfSectionNode() const
static SwTableNode * InsertTable(SwNode &rNd, sal_uInt16 nBoxes, SwTextFormatColl *pContentTextColl, sal_uInt16 nLines, sal_uInt16 nRepeat, SwTextFormatColl *pHeadlineTextColl, const SwAttrSet *pAttrSet)
Insert nodes for tables.
SwTextNode * MakeTextNode(SwNode &rWhere, SwTextFormatColl *pColl, bool bNewFrames=true)
Implementations of "Make...Node" are in the given .cxx-files.
void SectionUp(SwNodeRange *)
increase level of the given range
SwTableNode * TextToTable(const SwNodeRange &rRange, sal_Unicode cCh, SwTableFormat *pTableFormat, SwTableLineFormat *pLineFormat, SwTableBoxFormat *pBoxFormat, SwTextFormatColl *pTextColl, SwUndoTextToTable *pUndo)
Create balanced table from selected range.
bool IsDocNodes() const
Is the NodesArray the regular one of Doc? (and not the UndoNds, ...) Implementation in doc....
std::vector< NodeRanges_t > TableRanges_t
bool InsBoxen(SwTableNode *, SwTableLine *, SwTableBoxFormat *, SwTextFormatColl *, const SfxItemSet *pAutoAttr, sal_uInt16 nInsPos, sal_uInt16 nCnt=1)
Insert a new box in the line before InsPos.
SwTableNode * SplitTable(SwNode &rPos, bool bAfter=true, bool bCalcNewSize=false)
Splits a table at the base-line which contains the index.
bool TableToText(const SwNodeRange &rRange, sal_Unicode cCh, SwUndoTableToText *)
Create regular text from what was table.
SwContentNode * GoNext(SwNodeIndex *) const
void ExpandRangeForTableBox(const SwNodeRange &rRange, std::optional< SwNodeRange > &rExpandedRange)
void DelNodes(const SwNodeIndex &rStart, SwNodeOffset nCnt=SwNodeOffset(1))
Delete a number of nodes.
bool MergeTable(SwNode &rPos, bool bWithPrev=true)
Two Tables that are following one another are merged.
SwDoc & GetDoc()
Which Doc contains the nodes-array?
SwNode * FindPrvNxtFrameNode(const SwNode &rFrameNd, const SwNode *pEnd, SwRootFrame const *pLayout=nullptr) const
Search previous / next content node or table node with frames.
SwNodeOffset Count() 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.
std::pair< const SwPosition *, const SwPosition * > StartEnd() const
Because sometimes the cost of the operator<= can add up.
SwContentNode * GetPointContentNode() const
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
SwPosition & GetBound(bool bOne=true)
const SwPosition * GetPoint() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
A page of the document layout.
tools::Long GetHeight(const SwRect &rRect) const
tools::Long YInc(tools::Long n1, tools::Long n2) const
tools::Long GetWidth(const SwRect &rRect) const
tools::Long GetTop(const SwRect &rRect) const
tools::Long YDiff(tools::Long n1, tools::Long n2) const
tools::Long GetLeft(const SwRect &rRect) const
tools::Long GetPrtTop(const SwFrame &rFrame) const
tools::Long GetBottom(const SwRect &rRect) const
tools::Long GetRight(const SwRect &rRect) const
void Top(const tools::Long nTop)
void Right(const tools::Long nRight)
void Bottom(const tools::Long nBottom)
void Left(const tools::Long nLeft)
void RegisterInModify(sw::BroadcastingModify *pRegIn, const SwNode &rNd)
The root element of a Writer document layout.
SwViewShell * GetCurrShell() const
bool HasMergedParas() const
bool IsAnyShellAccessible() const
A section node represents the start of a section on the UI, i.e.
bool IsContentHidden() const
Check for not hidden areas whether there is content that is not in a hidden sub-area.
const SwSection & GetSection() const
void MakeFramesForAdjacentContentNode(const SwNodeIndex &rIdx)
Method creates all views of document for the previous node.
void MakeOwnFrames(SwNodeIndex *pIdxBehind, SwNodeIndex *pEnd=nullptr)
Creates the frms for the SectionNode (i.e.
Starts a section of nodes in the document model.
SwEndNode * m_pEndOfSection
void CheckSectionCondColl() const
Call ChkCondcoll to all ContentNodes of section.
SwStartNodeType GetStartNodeType() const
void SetLastRowAllowedToChange(bool bNew)
void SetRight(tools::Long nNew)
void Remove(size_t nPos, size_t nCount=1)
void SetLeft(tools::Long nNew)
void SetRightMax(tools::Long nNew)
void SetLeftMin(tools::Long nNew)
tools::Long GetRight() const
void Insert(tools::Long nValue, bool bValue, size_t nPos)
SwTabFrame is one table in the document layout, containing rows (which contain cells).
const SwTable * GetTable() const
virtual void Paste(SwFrame *pParent, SwFrame *pSibling=nullptr) override
bool HasFollowFlowLine() const
virtual void Cut() override
SwTableBox is one table cell in the document model.
bool IsNumberChanged() const
sal_Int32 getRowSpan() const
SwNodeOffset GetSttIdx() const
SwFrameFormat * GetFrameFormat()
SwTableLines & GetTabLines()
void SetDirectFormatting(bool bDirect)
Set that this table box contains formatting that is not set by the table style.
bool HasNumContent(double &rNum, sal_uInt32 &rFormatIndex, bool &rIsEmptyTextNd) const
SwTableBox * FindPreviousBox(const SwTable &, const SwTableBox *) const
bool HasDirectFormatting() const
Do we contain any direct formatting (ie. something not affected by the table style)?
const SwStartNode * GetSttNd() const
void ChgFrameFormat(SwTableBoxFormat *pNewFormat, bool bNeedToReregister=true)
SwTableBox * FindNextBox(const SwTable &, const SwTableBox *, bool bOvrTableLns=true) const
SwFrameFormat * ClaimFrameFormat()
SwTableLine is one table row in the document model.
SwFrameFormat * GetFrameFormat()
void ChgFrameFormat(SwTableLineFormat *pNewFormat)
SwFrameFormat * ClaimFrameFormat()
SwTableBoxes & GetTabBoxes()
SwTableBox * FindPreviousBox(const SwTable &, const SwTableBox *=nullptr, bool bOvrTableLns=true) const
SwTableBox * FindNextBox(const SwTable &, const SwTableBox *=nullptr, bool bOvrTableLns=true) const
iterator erase(iterator aIt)
iterator insert(iterator aIt, SwTableLine *pLine)
std::vector< SwTableLine * >::size_type size_type
sal_uInt16 GetPos(const SwTableLine *pBox) const
void SetNewTable(std::unique_ptr< SwTable >, bool bNewFrames=true)
const SwTable & GetTable() const
SwTabFrame * MakeFrame(SwFrame *)
SwTableNode(const SwNode &)
void MakeOwnFrames(SwPosition *pIdxBehind=nullptr)
Creates the frms for the table node (i.e.
std::unique_ptr< SwTable > m_pTable
void MakeFramesForAdjacentContentNode(const SwNodeIndex &rIdx)
Method creates all views of the document for the previous node.
virtual ~SwTableNode() override
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Dumps the node structure to the given destination (file nodes.xml in the current directory by default...
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 SetTabCols(const SwTabCols &rNew, const SwTabCols &rOld, const SwTableBox *pStart, bool bCurRowOnly)
SwTableNode * GetTableNode() const
void SetHTMLTableLayout(std::shared_ptr< SwHTMLTableLayout > const &r)
void SetTableModel(bool bNew)
void CleanUpBottomRowSpan(sal_uInt16 nDelLines)
const OUString & GetTableStyleName() const
Return the table style name of this table.
bool SplitCol(SwDoc &rDoc, const SwSelBoxes &rBoxes, sal_uInt16 nCnt)
bool Merge(SwDoc *pDoc, const SwSelBoxes &rBoxes, const SwSelBoxes &rMerged, SwTableBox *pMergeBox, SwUndoTableMerge *pUndo)
void SetRowsToRepeat(sal_uInt16 nNumOfRows)
SwTableLines & GetTabLines()
void FindSuperfluousRows(SwSelBoxes &rBoxes)
SwTableFormat * GetFrameFormat()
bool DeleteSel(SwDoc *, const SwSelBoxes &rBoxes, const SwSelBoxes *pMerged, SwUndo *pUndo, const bool bDelMakeFrames, const bool bCorrBorder)
bool IsTableComplex() const
std::unique_ptr< SwSaveRowSpan > CleanUpTopRowSpan(sal_uInt16 nSplitLine)
void RegisterToFormat(SwFormat &rFormat)
void SetTableStyleName(const OUString &rName)
Set the new table style name for this table.
bool InsertCol(SwDoc &, const SwSelBoxes &rBoxes, sal_uInt16 nCnt, bool bBehind)
void SwitchFormulasToInternalRepresentation()
bool SetRowHeight(SwTableBox &rCurrentBox, TableChgWidthHeightType eType, SwTwips nAbsDiff, SwTwips nRelDiff, std::unique_ptr< SwUndo > *ppUndo)
bool InsertRow(SwDoc *, const SwSelBoxes &rBoxes, sal_uInt16 nCnt, bool bBehind)
SwTable::InsertRow(..) inserts one or more rows before or behind the selected boxes.
void SetTableChgMode(TableChgMode eMode)
const SwTableBox * GetTableBox(const OUString &rName, const bool bPerformValidCheck=false) const
void Split(OUString sNewTableName, sal_uInt16 nSplitLine, SwHistory *pHistory)
bool InsTable(const SwTable &rCpyTable, const SwNodeIndex &, SwUndoTableCpyTable *pUndo)
Copy Table into this Box.
static SwTable * FindTable(SwFrameFormat const *const pFormat)
void CopyHeadlineIntoTable(SwTableNode &rTableNd)
sal_uInt16 GetRowsToRepeat() const
SwTableSortBoxes & GetTabSortBoxes()
bool SetColWidth(SwTableBox &rCurrentBox, TableChgWidthHeightType eType, SwTwips nAbsDiff, SwTwips nRelDiff, std::unique_ptr< SwUndo > *ppUndo)
bool PrepareMerge(const SwPaM &rPam, SwSelBoxes &rBoxes, SwSelBoxes &rMerged, SwTableBox **ppMergeBox, SwUndoTableMerge *pUndo)
SwTable::PrepareMerge(..) some preparation for the coming Merge(..)
void GetTabCols(SwTabCols &rToFill, const SwTableBox *pStart, bool bHidden=false, bool bCurRowOnly=false) const
void PrepareDeleteCol(tools::Long nMin, tools::Long nMax)
SwTable::PrepareDeleteCol(..) adjusts the widths of the neighbour cells of a cell selection for an up...
void UpdateCharts() const
TableChgMode GetTableChgMode() const
void ExpandColumnSelection(SwSelBoxes &rBoxes, tools::Long &rMin, tools::Long &rMax) const
void SwTable::ExpandColumnSelection(..) adds cell to the give selection to assure that at least one c...
bool SplitRow(SwDoc &rDoc, const SwSelBoxes &rBoxes, sal_uInt16 nCnt, bool bSameHeight)
bool MakeCopy(SwDoc &, const SwPosition &, const SwSelBoxes &, bool bCpyName=false, const OUString &rStyleName="") const
Represents the style of a paragraph.
bool IsAssignedToListLevelOfOutlineStyle() const
const SwTextFrame * GetFrame() const
SwTwips GetCharPos(TextFrameIndex nChar, bool bCenter=true) const
Represents the visualization of a paragraph.
TextFrameIndex MapModelToView(SwTextNode const *pNode, sal_Int32 nIndex) const
SwTextNode is a paragraph in the document model.
virtual bool SetAttr(const SfxPoolItem &) override
overriding to handle change of certain paragraph attributes
void EraseText(const SwContentIndex &rIdx, const sal_Int32 nCount=SAL_MAX_INT32, const SwInsertFlags nMode=SwInsertFlags::DEFAULT)
delete text content ATTENTION: must not be called with a range that overlaps the start of an attribut...
virtual SwFormatColl * ChgFormatColl(SwFormatColl *) override
bool IsNumbered(SwRootFrame const *pLayout=nullptr) const
Returns is this text node is numbered.
SwTextNode * SplitContentNode(const SwPosition &, std::function< void(SwTextNode *, sw::mark::RestoreMode, bool AtStart)> const *pContentIndexRestore)
const OUString & GetText() const
virtual bool ResetAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0) override
void AddNode(const SwTextNode &rNd)
void SaveFormula(SwHistory &rHistory)
sal_uInt16 GetRedlSaveCount() const
void SetTableNodeOffset(SwNodeOffset nIdx)
void SaveFormula(SwHistory &rHistory)
void AddFillBox(const SwTableBox &rBox)
SwRootFrame * GetLayout() const
void InvalidateAccessibleParaFlowRelation(const SwTextFrame *_pFromTextFrame, const SwTextFrame *_pToTextFrame)
invalidate CONTENT_FLOWS_FROM/_TO relation for paragraphs
const Value & back() const
size_type erase(const Value &x)
std::pair< const_iterator, bool > insert(Value &&x)
SwUndo * RemoveLastUndo()
static std::shared_ptr< ContentIdxStore > Create()
constexpr ::Color COL_GRAY(0x80, 0x80, 0x80)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
TOOLS_DLLPUBLIC OString DateTimeToOString(const DateTime &rDateTime)
struct _xmlTextWriter * xmlTextWriterPtr
void PaMCorrAbs(const SwPaM &rRange, const SwPosition &rNewPos)
Function declarations so that everything below the CursorShell can move the Cursor once in a while.
std::deque< AttacherIndex_Impl > aIndex
void ClearFEShellTabCols(SwDoc &rDoc, SwTabFrame const *const pFrame)
@ AUTOUPD_FIELD_AND_CHARTS
@ Variable
Frame is variable in Var-direction.
@ Minimum
Value in Var-direction gives minimum (can be exceeded but not be less).
void sw_GC_Line_Border(const SwTableLine *pLine, SwGCLineBorder *pGCPara)
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(126)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
constexpr TypedWhichId< SwTableBoxValue > RES_BOXATR_VALUE(158)
constexpr sal_uInt16 RES_PARATR_BEGIN(RES_TXTATR_END)
constexpr TypedWhichId< SwConditionTextFormatColl > RES_CONDTXTFMTCOLL(166)
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
constexpr TypedWhichId< SvxShadowItem > RES_SHADOW(113)
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(108)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(99)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
constexpr TypedWhichId< SvxAdjustItem > RES_PARATR_ADJUST(64)
constexpr sal_uInt16 RES_PARATR_END(82)
constexpr TypedWhichId< SwTableBoxFormula > RES_BOXATR_FORMULA(157)
constexpr sal_uInt16 RES_CHRATR_BEGIN(HINT_BEGIN)
constexpr TypedWhichId< SvxProtectItem > RES_PROTECT(106)
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
constexpr TypedWhichId< SwTableBoxNumFormat > RES_BOXATR_FORMAT(RES_BOXATR_BEGIN)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(112)
constexpr sal_uInt16 RES_PARATR_LIST_END(88)
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(100)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(97)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(98)
const SfxPoolItem * GetDfltAttr(sal_uInt16 nWhich)
Get the default attribute from corresponding default attribute table.
WhichRangesContainer const aTableBoxSetRange(svl::Items< RES_FILL_ORDER, RES_FRM_SIZE, RES_LR_SPACE, RES_UL_SPACE, RES_PRINT, RES_PRINT, RES_PROTECT, RES_PROTECT, RES_VERT_ORIENT, RES_VERT_ORIENT, RES_BACKGROUND, RES_SHADOW, RES_FRAMEDIR, RES_FRAMEDIR, RES_FRMATR_GRABBAG, RES_FRMATR_GRABBAG, RES_BOXATR_BEGIN, RES_BOXATR_END-1, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1 >)
#define SAL_WARN_IF(condition, area, stream)
double getLength(const B2DPolygon &rCandidate)
OUString newName(std::u16string_view aNewPrefix, std::u16string_view aOldPrefix, std::u16string_view old_Name)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
static void lcl_SetDfltBoxAttr(SwFrameFormat &rFormat, sal_uInt8 nId)
static void lcl_DelLine(SwTableLine *pLine, DelTabPara *pPara)
std::map< SwFrameFormat *, SwTableBoxFormat * > DfltBoxAttrMap_t
static SwTableBoxFormat * lcl_CreateAFormatBoxFormat(SwDoc &rDoc, std::vector< SwTableBoxFormat * > &rBoxFormatArr, const SwTableAutoFormat &rAutoFormat, const sal_uInt16 nRows, const sal_uInt16 nCols, sal_uInt8 nId)
static bool lcl_SetAFormatLine(FndLine_ &, SetAFormatTabPara *pPara, bool bResetDirect)
static void lcl_DelBox(SwTableBox *pBox, DelTabPara *pDelPara)
static bool lcl_ChgTableSize(SwTable &rTable)
const sal_Unicode T2T_PARA
static void lcl_BalanceTable(SwTable &rTable, size_t const nMaxBoxes, SwTableNode &rTableNd, SwTableBoxFormat &rBoxFormat, SwTextFormatColl &rTextColl, SwUndoTextToTable *const pUndo, std::vector< sal_uInt16 > *const pPositions)
balance lines in table, insert empty boxes so all lines have the size
static void lcl_SplitTable_CpyLine(SwTableLine *pLn, SplitTable_Para *pPara)
bool sw_Line_CollectBox(const SwTableLine *&rpLine, void *pPara)
static SwTableBoxFormat * lcl_CreateDfltBoxFormat(SwDoc &rDoc, std::vector< SwTableBoxFormat * > &rBoxFormatArr, sal_uInt16 nCols, sal_uInt8 nId)
std::vector< DfltBoxAttrMap_t * > DfltBoxAttrList_t
static void lcl_SetTableBoxWidths2(SwTable &rTable, size_t const nMaxBoxes, SwTableBoxFormat &rBoxFormat, SwDoc &rDoc)
static bool lcl_IsFrameInColumn(const SwCellFrame &rFrame, SwSelBoxes const &rBoxes)
static void lcl_RemoveBreaks(SwContentNode &rNode, SwTableFormat *const pTableFormat)
static void lcl_SetTableBoxWidths(SwTable &rTable, size_t const nMaxBoxes, SwTableBoxFormat &rBoxFormat, SwDoc &rDoc, std::vector< sal_uInt16 > *const pPositions)
void sw_Box_CollectBox(const SwTableBox *pBox, SwCollectTableLineBoxes *pSplPara)
static bool lcl_SetAFormatBox(FndBox_ &, SetAFormatTabPara *pSetPara, bool bResetDirect)
static void lcl_SplitTable_CpyBox(SwTableBox *pBox, SplitTable_Para *pPara)
void sw_BoxSetSplitBoxFormats(SwTableBox *pBox, SwCollectTableLineBoxes *pSplPara)
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
SwNodeOffset abs(const SwNodeOffset &a)
bool GoInNode(SwPaM &rPam, SwMoveFnCollection const &fnMove)
SwMoveFnCollection const & fnMoveBackward
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
@ RES_POOLCOLL_TEXT
Text body.
@ RES_POOLCOLL_STANDARD
Standard.
@ RES_POOLCOLL_TABLE
Subgroup table.
@ RES_POOLCOLL_TABLE_HDLN
Table of Contents - heading.
sal_uInt16 mnRowsToRepeat
SwInsertTableFlags mnInsMode
Marks a position in the document model.
void Adjust(SwNodeOffset nDelta)
Adjust node position, and resets content position to zero.
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
OUString SwResId(TranslateId aId)
std::vector< SwTableBox * > SwTableBoxes
SplitTable_HeadlineOption
constexpr TableChgWidthHeightType extractPosition(TableChgWidthHeightType e)
void sw_LineSetHeadCondColl(const SwTableLine *pLine)
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 GetTableSel(const SwCursorShell &rShell, SwSelBoxes &rBoxes, const SwTableSearchType eSearchType)
bool CheckSplitCells(const SwCursorShell &rShell, sal_uInt16 nDiv, const SwTableSearchType eSearchType)
TableMergeErr CheckMergeSel(const SwPaM &rPam)
bool HasProtectedCells(const SwSelBoxes &rBoxes)
std::vector< std::unique_ptr< FndLine_ > > FndLines_t