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,
345 assert(nRows &&
"Table without line?");
346 assert(nCols &&
"Table without rows?");
365 std::make_unique<SwUndoInsTable>( rPos, nCols, nRows, o3tl::narrowing<sal_uInt16>(eAdjust),
366 rInsTableOpts, pTAFormat, pColArr,
372 *pHeadColl = pBodyColl;
379 const sal_uInt16 nRowsToRepeat =
398 bCalledFromShell ? &pContentNd->GetSwAttrSet() :
nullptr );
408 const SwAttrSet & aNdSet = pContentNd->GetSwAttrSet();
424 sal_uInt16 nSttPos = pColArr->front();
425 sal_uInt16 nLastPos = pColArr->back();
428 sal_uInt16 nFrameWidth = nLastPos;
429 nLastPos = (*pColArr)[ pColArr->size()-2 ];
432 nWidth = nLastPos - nSttPos;
469 std::vector<SwTableBoxFormat*> aBoxFormatArr;
471 if( !bDfltBorders && !pTAFormat )
478 const sal_uInt16 nBoxArrLen = pTAFormat ? 16 : 4;
479 aBoxFormatArr.resize( nBoxArrLen,
nullptr );
485 for( sal_uInt16
n = 0;
n < nRows; ++
n )
490 for( sal_uInt16
i = 0;
i < nCols; ++
i )
502 aCharSet.ClearItem();
505 if( aCharSet.Count() )
510 else if( bDfltBorders )
512 sal_uInt8 nBoxId = (
i < nCols - 1 ? 0 : 1) + (
n ? 2 : 0 );
522 nWidth = (*pColArr)[
i + 1 ] - (*pColArr)[
i ];
525 if( pBoxF->HasWriterListeners() )
528 *pNewFormat = *pBoxF;
536 rBoxes.insert( rBoxes.begin() +
i, pBox );
570 if( !pHeadlineTextColl || !nLines )
571 pHeadlineTextColl = pContentTextColl;
580 for( sal_uInt16 nL = 0; nL < nLines; ++nL )
582 for( sal_uInt16 nB = 0; nB < nBoxes; ++nB )
592 if (
nullptr != pAttrSet )
594 static const sal_uInt16 aPropagateItems[] = {
600 const sal_uInt16* pIdx = aPropagateItems;
604 SfxItemState::SET == pAttrSet->
GetItemState( *pIdx,
true, &pItem ) )
612 if ( nL + 1 >= nRepeat )
613 pTextColl = pContentTextColl;
627 auto [pStt, pEnd] = rRange.
StartEnd();
630 for( ; nCnt <= pEnd->GetNodeIndex(); ++nCnt )
631 if( !
GetNodes()[ nCnt ]->IsTextNode() )
638 SwPaM aOriginal( *pStt, *pEnd );
647 o3tl::narrowing<sal_uInt16>(eAdjust), pTAFormat );
657 SwNodeRange aRg( pStt->GetNode(), pEnd->GetNode() );
658 if( pStt->GetContentIndex() )
661 bool bEndContent = 0 != pEnd->GetContentIndex();
666 if( pEnd->GetNode().GetContentNode()->Len() != pEnd->GetContentIndex()
667 || pEnd->GetNodeIndex() >=
GetNodes().GetEndOfContent().GetIndex()-1 )
672 if( pStt->GetNodeIndex() >= pEnd->GetNodeIndex() )
681 OSL_FAIL(
"empty range" );
720 aRg, cCh, pTableFormat, pLineFormat, pBoxFormat,
725 const sal_uInt16 nRowsToRepeat =
731 bool bUseBoxFormat =
false;
732 if( !pBoxFormat->HasWriterListeners() )
736 bUseBoxFormat =
true;
748 sal_uInt8 nBoxArrLen = pTAFormat ? 16 : 4;
749 std::unique_ptr< DfltBoxAttrList_t > aBoxFormatArr1;
750 std::optional< std::vector<SwTableBoxFormat*> > aBoxFormatArr2;
757 aBoxFormatArr2 = std::vector<SwTableBoxFormat*>( nBoxArrLen,
nullptr );
770 const SwTableBoxes::size_type nCols = rBoxes.
size();
771 for( SwTableBoxes::size_type
i = 0;
i < nCols; ++
i )
779 ? 12 : (4 * (1 + ((
n-1) & 1 )))));
781 (
i+1 == nCols ? 3 : (1 + ((
i-1) & 1))));
786 bChgSz =
nullptr == (*aBoxFormatArr2)[
nId ];
788 *pTAFormat, USHRT_MAX, USHRT_MAX,
nId );
794 aCharSet.ClearItem();
797 if( aCharSet.Count() )
801 for( ; nSttNd < nEndNd; ++nSttNd )
825 bChgSz =
nullptr == (*aBoxFormatArr2)[
nId ];
844 delete (*aBoxFormatArr1)[
i ];
929 size_t const nBoxes = pCurrLine->
GetTabBoxes().size();
930 if (nMaxBoxes != nBoxes)
933 nullptr, nBoxes, nMaxBoxes - nBoxes);
937 for (
size_t i = nBoxes;
i < nMaxBoxes; ++
i)
944 if (!
n && pPositions)
955 std::vector<sal_uInt16> *
const pPositions)
957 if (pPositions && !pPositions->empty())
960 sal_uInt16 nLastPos = 0;
961 for (
size_t n = 0;
n < pPositions->size(); ++
n)
966 for (
size_t nTmpLine = 0; nTmpLine < rLns.
size(); ++nTmpLine)
970 pNewFormat->Add( rLns[ nTmpLine ]->GetTabBoxes()[
n ] );
973 nLastPos = (*pPositions)[
n ];
977 SAL_WARN_IF(rBoxFormat.HasWriterListeners(),
"sw.core",
978 "who is still registered in the format?");
983 size_t nWidth = nMaxBoxes ? USHRT_MAX / nMaxBoxes : USHRT_MAX;
1002 std::vector<sal_uInt16> aPosArr;
1005 sal_uInt16 nBoxes, nLines, nMaxBoxes = 0;
1009 for( nLines = 0, nBoxes = 0;
1014 OSL_ENSURE( pTextNd,
"Only add TextNodes to the Table" );
1016 if( !nLines && 0x0b == cCh )
1024 OUString
const& rText(pTextNd->
GetText());
1025 for (sal_Int32 nChPos = 0; nChPos < rText.getLength(); ++nChPos)
1027 if (rText[nChPos] == cCh)
1031 aPosArr.push_back( o3tl::narrowing<sal_uInt16>(
1062 if (pTextNd->
GetText()[nChPos] == cCh)
1068 if (!pContentStore->Empty())
1070 pContentStore->Restore(*pNewNode, nChPos, nChPos + 1, eMode);
1085 pNewNd->m_pStartOfSection = pSttNd;
1088 pBox =
new SwTableBox( pBoxFormat, *pSttNd, pLine );
1099 if( !pContentStore->Empty())
1100 pContentStore->Restore( *pTextNd, pTextNd->
GetText().getLength(), pTextNd->
GetText().getLength()+1 );
1107 pBox =
new SwTableBox( pBoxFormat, *pSttNd, pLine );
1109 if( nMaxBoxes < nBoxes )
1122 if (rTableNodes.empty())
1125 const std::vector<SwNodeRange>& rFirstRange = *rTableNodes.begin();
1127 if (rFirstRange.empty())
1130 const std::vector<SwNodeRange>& rLastRange = *rTableNodes.rbegin();
1132 if (rLastRange.empty())
1138 const SwNodeRange& rStartRange = *rFirstRange.begin();
1139 const SwNodeRange& rEndRange = *rLastRange.rbegin();
1182 OSL_FAIL(
"empty range" );
1190 SwNodeIndex const prev(rTableNodes.begin()->begin()->aStart, -1);
1193 for (
const auto& rRow : rTableNodes)
1195 for (
const auto& rCell : rRow)
1198 SwPaM pam(rCell.aStart, 0, *pPrev,
1202 pPrev = &rCell.aEnd;
1246 rTableNodes, pTableFormat, pLineFormat, pBoxFormat );
1251 if( !pBoxFormat->HasWriterListeners() )
1270 bool bChanged =
false;
1278 while (
aIndex < aEndIndex)
1299 aNewStart = *pStartNode;
1312 aNewStart = *pStartNode;
1317 pNode = &
aIndex.GetNode();
1321 rExpandedRange.emplace(aNewStart, aNewEnd);
1330 for (
size_t nTmpLine = 0; nTmpLine < rLines.
size(); ++nTmpLine)
1332 SwTableBoxes & rBoxes = rLines[nTmpLine]->GetTabBoxes();
1333 assert(!rBoxes.empty());
1334 size_t const nMissing = nMaxBoxes - rBoxes.size();
1339 size_t nWidth = nMaxBoxes ? USHRT_MAX / nMaxBoxes : USHRT_MAX;
1341 nWidth * (nMissing + 1)) );
1342 pNewFormat->Add(rBoxes.back());
1345 size_t nWidth = nMaxBoxes ? USHRT_MAX / nMaxBoxes : USHRT_MAX;
1355 if( rTableNodes.empty() )
1360 SwNodeIndex aInsertIndex( rTableNodes.rbegin()->rbegin()->aEnd );
1370 sal_uInt16 nLines, nMaxBoxes = 0;
1372 SwNodeIndex aNodeIndex = rTableNodes.begin()->begin()->aStart;
1374 for( nLines = 0; aNodeIndex <= rTableNodes.rbegin()->rbegin()->aEnd; ++aNodeIndex,++nLines )
1380 (0 == nLines) ? pTableFormat :
nullptr);
1385 for(
const auto& rRow : rTableNodes )
1387 sal_uInt16 nBoxes = 0;
1391 for(
const auto& rCell : rRow )
1405 for(;aCellNodeIdx <= rCell.aEnd; ++aCellNodeIdx )
1414 pBox =
new SwTableBox( pBoxFormat, *pSttNd, pLine );
1417 if( nMaxBoxes < nBoxes )
1444 std::unique_ptr<SwUndoTableToText> pUndo;
1462 pUndo->SetRange( *pUndoRg );
1487 pLastNd(nullptr), rNds( rNodes ), pUndo( pU ), cCh( cChar ) {}
1497 assert(pPara &&
"The parameters are missing!");
1498 DelTabPara aPara( *pPara );
1503 pPara->pLastNd = aPara.pLastNd;
1508 assert(pDelPara &&
"The parameters are missing");
1518 SwDoc& rDoc = pDelPara->rNds.GetDoc();
1522 pDelPara->rNds.SectionUp( &aDelRg );
1524 if (
T2T_PARA != pDelPara->cCh && pDelPara->pLastNd)
1526 if (
nullptr != pCurTextNd)
1535 pDelPara->pLastNd->GetText().getLength());
1536 pDelPara->pLastNd->InsertText( OUString(pDelPara->cCh), aCntIdx,
1538 if( pDelPara->pUndo )
1539 pDelPara->pUndo->AddBoxPos( rDoc, nNdIdx, aDelRg.
aEnd.
GetIndex(),
1543 const sal_Int32 nOldTextLen = aCntIdx.
GetIndex();
1546 pDelPara->pLastNd->JoinNext();
1548 if( !pContentStore->Empty() )
1549 pContentStore->Restore( rDoc, pDelPara->pLastNd->GetIndex(), nOldTextLen );
1551 else if( pDelPara->pUndo )
1554 pDelPara->pUndo->AddBoxPos( rDoc, nNdIdx, aDelRg.
aEnd.
GetIndex() );
1557 else if( pDelPara->pUndo )
1563 if( pDelPara->pLastNd && pDelPara->pLastNd->HasSwAttrSet() )
1575 if (
nullptr == pTableNd ||
1580 std::optional<SwNode2LayoutSaveUpperFrames> oNode2Layout;
1585 oNode2Layout.emplace(*pTableNd);
1591 DelTabPara aDelPara( *
this, cCh, pUndo );
1608 if( pBreak || pDesc )
1624 oNode2Layout->RestoreUpperFrames( *
this,
1626 oNode2Layout.reset();
1635 if(
nullptr != pCNd )
1638 static_cast<SwContentNode*
>(pFrameNd)->MakeFramesForAdjacentContentNode(*pCNd);
1665 for(
auto pFly : rFlyArr )
1671 ((RndStdIds::FLY_AT_PARA == rAnchor.
GetAnchorId()) ||
1672 (RndStdIds::FLY_AT_CHAR == rAnchor.
GetAnchorId())) &&
1673 nStt <= pAnchorNode->GetIndex() &&
1695 if( !aBoxes.
empty() )
1701 OSL_ENSURE( !rBoxes.
empty(),
"No valid Box list" );
1707 if(
dynamic_cast<const SwDDETable*
>( &rTable) !=
nullptr)
1711 std::unique_ptr<SwUndoTableNdsChg> pUndo;
1715 0, 0, nCnt, bBehind,
false ));
1727 bRet = rTable.
InsertCol(*
this, rBoxes, nCnt, bBehind);
1738 pUndo->SaveNewBoxes( *pTableNd, aTmpLst );
1750 if( !aBoxes.
empty() )
1756 OSL_ENSURE( !rBoxes.
empty(),
"No valid Box list" );
1762 if(
dynamic_cast<const SwDDETable*
>( &rTable) !=
nullptr)
1766 std::unique_ptr<SwUndoTableNdsChg> pUndo;
1770 0, 0, nCnt, bBehind,
false ));
1782 bRet = rTable.
InsertRow(
this, rBoxes, nCnt, bBehind );
1793 pUndo->SaveNewBoxes( *pTableNd, aTmpLst );
1822 FndBox_ aFndBox(
nullptr,
nullptr );
1824 FndPara aPara( aBoxes, &aFndBox );
1838 while( 1 == pFndBox->
GetLines().size() &&
1839 1 == pFndBox->
GetLines().front()->GetBoxes().size() )
1841 FndBox_ *
const pTmp = pFndBox->
GetLines().front()->GetBoxes()[0].get();
1863 pDelLine = pFndBox->
GetLines().front()->GetLine();
1866 pDelBox = pDelBox->
GetTabLines()[0]->GetTabBoxes()[0];
1888 SwPaM* pPam =
const_cast<SwPaM*
>(
static_cast<SwPaM const *
>(&rCursor));
1915 pESh->ParkCursor( *pNd );
1932 OSL_ENSURE( !rBoxes.
empty(),
"No valid Box list" );
1958 const SwNodeOffset nTmpIdx2 = aSelBoxes.
back()->GetSttNd()->EndOfSectionIndex() + 1;
1960 aSelBoxes[0]->GetSttIdx()-1 == nTmpIdx1 &&
1963 bool bNewTextNd =
false;
1971 if( nTableEnd == nSectEnd )
2016 bool bSavePageBreak =
false, bSavePageDesc =
false;
2027 bSavePageDesc =
true;
2034 bSavePageBreak =
true;
2039 pUndo->SetTableDelLastNd();
2040 pUndo->SetPgBrkFlags( bSavePageBreak, bSavePageDesc );
2092 std::unique_ptr<SwUndoTableNdsChg> pUndo;
2096 nMin, nMax, 0,
false,
false ));
2113 pUndo->ReNewBoxes( aSelBoxes );
2115 bRet = rTable.
DeleteSel(
this, aSelBoxes,
nullptr, pUndo.get(),
true,
true );
2139 OSL_ENSURE( !rBoxes.
empty() && nCnt,
"No valid Box list" );
2145 if(
dynamic_cast<const SwDDETable*
>( &rTable) !=
nullptr)
2148 std::vector<SwNodeOffset> aNdsCnts;
2150 std::unique_ptr<SwUndoTableNdsChg> pUndo;
2154 nCnt, bVert, bSameHeight ));
2159 for (
size_t n = 0;
n < rBoxes.
size(); ++
n)
2177 bRet = rTable.
SplitCol(*
this, rBoxes, nCnt);
2179 bRet = rTable.
SplitRow(*
this, rBoxes, nCnt, bSameHeight);
2193 pUndo->SaveNewBoxes( *pTableNd, aTmpLst );
2195 pUndo->SaveNewBoxes( *pTableNd, aTmpLst, rBoxes, aNdsCnts );
2209 if(
dynamic_cast<const SwDDETable*
>( &rTable) !=
nullptr )
2226 std::unique_ptr<SwUndoTableMerge> pUndo;
2235 if( !rTable.
PrepareMerge( rPam, aBoxes, aMerged, &pMergeBox, pUndo.get() ) )
2272 SwPaM* pTmp = &rPam;
2273 while( &rPam != ( pTmp = pTmp->
GetNext() ))
2274 for(
int i = 0;
i < 2; ++
i )
2283 pTableCursor->NewTableSelection();
2292 if( pTableNd->
GetTable().
Merge(
this, aBoxes, aMerged, pMergeBox, pUndo.get() ))
2340 if( !
GetTable().GetFrameFormat()->HasWriterListeners())
2346 OSL_ENSURE( pNode,
"No ContentNode or CopyNode and new Node is identical");
2352 while(
nullptr != (pFrame = aNode2Layout.
NextFrame()) )
2379 pIdxBehind->
Assign(*
this);
2383 pIdxBehind->
Assign(*pNd);
2388 while(
nullptr != (pUpper = aNode2Layout.
UpperFrame( pFrame, *
this )) )
2396 pNew->
Paste( pUpper, pFrame );
2402#if !ENABLE_WASM_STRIP_ACCESSIBILITY
2405 if ( pViewShell && pViewShell->
GetLayout() &&
2411 pNext ? pNext->DynCastTextFrame() :
nullptr,
2412 pPrev ? pPrev->DynCastTextFrame() :
nullptr );
2430 bool bAgain =
false;
2432 if (!pFrame->IsFollow() && (!pLayout || pLayout == pFrame->
getRootFrame()))
2434 while ( pFrame->HasFollow() )
2441#if !ENABLE_WASM_STRIP_ACCESSIBILITY
2444 if ( pViewShell && pViewShell->
GetLayout() &&
2450 pNext ? pNext->DynCastTextFrame() :
nullptr,
2451 pPrev ? pPrev->DynCastTextFrame() :
nullptr );
2461 pFrame = bAgain ? aIter.
First() : aIter.
Next();
2485 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwTableNode"));
2486 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
2487 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"index"), BAD_CAST(OString::number(sal_Int32(
GetIndex())).getStr()));
2491 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwTable"));
2492 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
m_pTable.get());
2493 m_pTable->GetFrameFormat()->dumpAsXml(pWriter);
2494 for (
const auto& pLine :
m_pTable->GetTabLines())
2496 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwTableLine"));
2497 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p", pLine);
2498 pLine->GetFrameFormat()->dumpAsXml(pWriter);
2499 (void)xmlTextWriterEndElement(pWriter);
2501 (void)xmlTextWriterEndElement(pWriter);
2509 OSL_ENSURE( pBoxFrame,
"pBoxFrame needs to be specified!" );
2552 for (
size_t i = 0;
i < rBoxes.
size(); ++
i)
2563 OSL_ENSURE( pBoxFrame,
"GetTabRows called without pBoxFrame" );
2579 const SwCursor aTmpCursor( aPos,
nullptr );
2586 OSL_FAIL(
"Current box has been deleted during GetTabRows()" );
2592 OSL_ENSURE( pTab,
"GetTabRows called without a table" );
2613 typedef std::map< tools::Long, std::pair< tools::Long, long >, FuzzyCompare > BoundaryMap;
2614 BoundaryMap aBoundaries;
2615 BoundaryMap::iterator aIter;
2616 std::pair< tools::Long, long > aPair;
2618 typedef std::map< tools::Long, bool > HiddenMap;
2620 HiddenMap::iterator aHiddenIter;
2622 while ( pFrame && pTab->
IsAnLower( pFrame ) )
2631 aIter = aBoundaries.find( nUpperBorder );
2632 if ( aIter == aBoundaries.end() )
2634 aPair.first = nUpperBorder; aPair.second =
LONG_MAX;
2635 aBoundaries[ nUpperBorder ] = aPair;
2639 aIter = aBoundaries.find( nLowerBorder );
2640 if ( aIter == aBoundaries.end() )
2642 aPair.first = nUpperBorder; aPair.second =
LONG_MAX;
2646 nLowerBorder = (*aIter).first;
2647 tools::Long nNewLowerBorderUpperBoundary = std::max( (*aIter).second.first, nUpperBorder );
2648 aPair.first = nNewLowerBorderUpperBoundary; aPair.second =
LONG_MAX;
2650 aBoundaries[ nLowerBorder ] = aPair;
2656 aHiddenIter = aHidden.find( nTmpVal );
2657 if ( aHiddenIter == aHidden.end() )
2661 if ( aHidden[ nTmpVal ] &&
2663 aHidden[ nTmpVal ] =
false;
2665 nTmpVal = nLowerBorder;
2674 for (
const auto& rEntry : aBoundaries )
2678 const std::pair< tools::Long, long > aTmpPair = rEntry.second;
2682 aHiddenIter = aHidden.find( rEntry.first );
2683 const bool bHidden = aHiddenIter != aHidden.end() && (*aHiddenIter).second;
2684 rFill.
Insert( nKey, nFirst, nSecond, bHidden, nIdx++ );
2688 OSL_ENSURE( rFill.
Count(),
"Deleting from empty vector. Fasten your seatbelts!" );
2709 OSL_ENSURE(
false,
"must specify pBoxFrame" );
2727 if( nPrtWidth != rTableFrameSz.
GetWidth() )
2749 SetTabCols(rTab, rNew, aOld, pBox, bCurRowOnly );
2763 OSL_ENSURE(
false,
"must specify pBoxFrame" );
2777 if ( aRectFnSet.
IsVert() )
2799 OSL_ENSURE( pTable,
"My colleague told me, this couldn't happen" );
2806 const tools::Long nOldRowStart =
i == 0 ? 0 : aOld[ nIdxStt ];
2808 const tools::Long nOldRowHeight = nOldRowEnd - nOldRowStart;
2810 const tools::Long nNewRowStart =
i == 0 ? 0 : rNew[ nIdxStt ];
2812 const tools::Long nNewRowHeight = nNewRowEnd - nNewRowStart;
2814 const tools::Long nDiff = nNewRowHeight - nOldRowHeight;
2827 while ( pFrame && pTab->
IsAnLower( pFrame ) )
2835 if ( !bCurColOnly || pFrame == pBoxFrame )
2842 const sal_Int32 nRowSpan = pBox->
getRowSpan();
2844 pTextFrame =
static_cast<const SwTextFrame*
>(pContent);
2847 if( pLine && pTextFrame )
2859 const SwCursor aTmpCursor( aPos,
nullptr );
2891 std::make_unique<SwUndoAttrTable>( *rTab.
GetTableNode(),
true ));
2893 rTab.
SetTabCols( rNew, rOld, pStart, bCurRowOnly );
2906 std::make_unique<SwUndoTableHeadline>(rTable, rTable.
GetRowsToRepeat(), nSet) );
2935 std::vector<sal_uInt16>::size_type
n;
2959 std::vector<sal_uInt16>::size_type
n;
2982 for(
n = 0;
n < nArrSize; ++
n )
3021 pSplPara->
AddBox( *pBox );
3062 if( aTmpSet.Count() )
3142 FndBox_ aFndBox(
nullptr,
nullptr );
3155 *pNew, std::move(pSaveRowSp), eHdlnMode, bCalcNewSize);
3157 if( aHistory.
Count() )
3244 if( USHRT_MAX == aTableMaxSz.
GetWidth() )
3247 bool bLocked = pFormat->IsModifyLocked();
3248 pFormat->LockModify();
3253 for(
auto pLn : rLns )
3257 for(
auto pBox : rBoxes )
3258 nMaxLnWidth += pBox->GetFrameFormat()->GetFrameSize().GetWidth();
3260 if( nMaxLnWidth > aTableMaxSz.
GetWidth() )
3261 aTableMaxSz.
SetWidth( nMaxLnWidth );
3265 pFormat->UnlockModify();
3272class SplitTable_Para
3274 std::map<SwFrameFormat const*, SwFrameFormat*> m_aSrcDestMap;
3280 : m_pNewTableNode(pNew)
3285 auto it = m_aSrcDestMap.find(pSrcFormat);
3286 return it == m_aSrcDestMap.end() ? nullptr : it->second;
3291 m_aSrcDestMap[pSrcFormat] = pDestFormat;
3309 if( pDestFormat ==
nullptr )
3324 if( pDestFormat ==
nullptr )
3332 pPara->ChgBox( pBox );
3360 if( USHRT_MAX == nLinePos ||
3374 assert(pOldTableEndNd &&
"Where is the EndNode?");
3385 OSL_ENSURE( pBoxNd->
IsStartNode(),
"This needs to be a StartNode!" );
3388 }
while( pBoxNd != pOldTableEndNd );
3406 const SwTableBoxes::size_type nBoxCnt = rTable.
GetTabLines()[ nLineIdx ]->GetTabBoxes().
size();
3407 for (SwTableBoxes::size_type j = 0; j < nBoxCnt; ++j)
3409 const SwTableBoxes::size_type nIdx = nBoxCnt - 1 - j;
3420 SplitTable_Para aPara( pNewTableNd, rTable );
3433 *pNewTableFormat = *pOldTableFormat;
3465 pDelTableNd = rNds[ pTableNd->
GetIndex() - 1 ]->FindTableNode();
3472 dynamic_cast<const SwDDETable*
>( &pDelTableNd->GetTable() ) !=
nullptr)
3477 pDelTableNd->GetTable().SetHTMLTableLayout(std::shared_ptr<SwHTMLTableLayout>());
3481 std::unique_ptr<SwHistory> pHistory;
3497 bool bRet = rNds.
MergeTable( bWithPrev ? *pTableNd : *pDelTableNd, !bWithPrev );
3501 if( pHistory->Count() )
3518 OSL_ENSURE( pDelTableNd,
"Where did the TableNode go?" );
3521 OSL_ENSURE( pTableNd,
"Where did the TableNode go?" );
3523 if( !pDelTableNd || !pTableNd )
3532 FndBox_ aFndBox(
nullptr,
nullptr );
3544 if( rTableSz != rDelTableSz )
3585 OSL_ENSURE( pBoxNd->
IsStartNode(),
"This needs to be a StartNode!" );
3588 }
while( pBoxNd != pTableEndNd );
3616struct SetAFormatTabPara
3620 sal_uInt16 nEndBox, nCurBox;
3622 bool bSingleRowTable;
3626 nEndBox( 0 ), nCurBox( 0 ), nAFormatLine( 0 ), nAFormatBox( 0 ), bSingleRowTable(false)
3638 for (
auto const& it : rLine.
GetBoxes())
3649 if( !pSetPara->nCurBox )
3650 pSetPara->nAFormatBox = 0;
3651 else if( pSetPara->nCurBox == pSetPara->nEndBox )
3652 pSetPara->nAFormatBox = 3;
3654 pSetPara->nAFormatBox =
static_cast<sal_uInt8>(1 + ((pSetPara->nCurBox-1) & 1));
3668 sal_uInt8 nPos = pSetPara->nAFormatLine * 4 + pSetPara->nAFormatBox;
3669 const bool bSingleRowTable = pSetPara->bSingleRowTable;
3670 const bool bSingleColTable = pSetPara->nEndBox == 0;
3674 if (aCharSet.Count())
3678 for (; nSttNd < nEndNd; ++nSttNd)
3686 if (aBoxSet.
Count())
3689 pSetPara->pUndo->SaveBoxContent( *pSetBox );
3699 const bool bOrigSingleRowTable = pSetPara->bSingleRowTable;
3700 pSetPara->bSingleRowTable = rBox.
GetLines().size() == 1;
3701 for (
auto const& rpFndLine : rBox.
GetLines())
3705 pSetPara->bSingleRowTable = bOrigSingleRowTable;
3709 ++pSetPara->nCurBox;
3715 OSL_ENSURE( !rBoxes.
empty(),
"No valid Box list" );
3721 FndBox_ aFndBox(
nullptr,
nullptr );
3723 FndPara aPara( rBoxes, &aFndBox );
3730 table.SetHTMLTableLayout(std::shared_ptr<SwHTMLTableLayout>());
3733 while( 1 == pFndBox->
GetLines().size() &&
3734 1 == pFndBox->
GetLines().front()->GetBoxes().size())
3736 pFndBox = pFndBox->
GetLines().front()->GetBoxes()[0].get();
3759 SetAFormatTabPara aPara( rNew );
3761 aPara.bSingleRowTable = rFLns.size() == 1;
3763 for (FndLines_t::size_type
n = 0;
n < rFLns.size(); ++
n)
3772 aPara.nAFormatLine = 0;
3773 else if (
static_cast<size_t>(
n+1) == rFLns.size())
3774 aPara.nAFormatLine = 3;
3776 aPara.nAFormatLine =
static_cast<sal_uInt8>(1 + ((
n-1) & 1 ));
3778 aPara.nAFormatBox = 0;
3780 aPara.nEndBox = pLine->
GetBoxes().size()-1;
3781 aPara.pUndo = pUndo;
3782 for (
auto const& it : pLine->
GetBoxes())
3806 OSL_ENSURE( !rBoxes.
empty(),
"No valid Box list" );
3812 FndBox_ aFndBox(
nullptr,
nullptr );
3814 FndPara aPara( rBoxes, &aFndBox );
3825 while( 1 == pFndBox->
GetLines().size() &&
3826 1 == pFndBox->
GetLines().front()->GetBoxes().size())
3828 pFndBox = pFndBox->
GetLines().front()->GetBoxes()[0].get();
3836 sal_uInt16 aLnArr[4];
3838 aLnArr[1] = 1 < rFLns.size() ? 1 : 0;
3839 aLnArr[2] = 2 < rFLns.size() ? 2 : aLnArr[1];
3840 aLnArr[3] = rFLns.size() - 1;
3842 for(
sal_uInt8 nLine = 0; nLine < 4; ++nLine )
3844 FndLine_& rLine = *rFLns[ aLnArr[ nLine ] ];
3846 sal_uInt16 aBoxArr[4];
3848 aBoxArr[1] = 1 < rLine.
GetBoxes().size() ? 1 : 0;
3849 aBoxArr[2] = 2 < rLine.
GetBoxes().size() ? 2 : aBoxArr[1];
3850 aBoxArr[3] = rLine.
GetBoxes().size() - 1;
3852 for(
sal_uInt8 nBox = 0; nBox < 4; ++nBox )
3857 pFBox = pFBox->
GetTabLines()[0]->GetTabBoxes()[0];
3891 OUString
newName =
"MailMergeTable"
3901 std::unique_ptr<sal_uInt8[]> pSetFlags(
new sal_uInt8[ nFlagSize ] );
3902 memset( pSetFlags.get(), 0, nFlagSize );
3911 const sal_Int32 nNmLen =
aName.getLength();
3913 if( nNum-- && nNum < mpTableFrameFormatTable->
size() )
3914 pSetFlags[ nNum / 8 ] |= (0x01 << ( nNum & 0x07 ));
3920 for(
size_t n = 0;
n < nFlagSize; ++
n )
3922 auto nTmp = pSetFlags[
n ];
3936 return aName + OUString::number( ++nNum );
3948 for( ; it != itEnd; ++it )
3966 std::unique_ptr<SwUndo> pUndo;
3982 eType, nAbsDiff, nRelDiff,
3983 bUndo ? &pUndo :
nullptr );
3990 eType, nAbsDiff, nRelDiff,
3991 bUndo ? &pUndo :
nullptr );
4010 if( aString.size() > 308 )
4014 OUStringBuffer sStringBuffer(aString);
4016 while( nCommentPosition != -1 )
4018 sStringBuffer.remove( nCommentPosition, 1 );
4019 nCommentPosition = sStringBuffer.indexOf(
CH_TXTATR_INWORD, nCommentPosition );
4033 std::unique_ptr<SwUndoTableNumFormat> pUndo;
4035 bool bIsEmptyTextNd;
4037 sal_uInt32 nFormatIdx;
4039 if( rBox.
HasNumContent( fNumber, nFormatIdx, bIsEmptyTextNd ) )
4049 pUndo->SetNumFormat( nFormatIdx, fNumber );
4055 bool bLockModify =
true;
4062 if( pNumFormatItem && !bForceNumberFormat )
4068 if( nFormatType == pNumFormatr->
GetType( nOldNumFormat ) || SvNumFormatType::NUMBER == nFormatType )
4072 nFormatIdx = nOldNumFormat;
4073 bSetNumberFormat =
true;
4079 bLockModify = bSetNumberFormat =
false;
4083 if( bSetNumberFormat || bForceNumberFormat )
4093 if( !bSetNumberFormat && !bIsEmptyTextNd && pNumFormatItem )
4100 if( bLockModify ) pBoxFormat->LockModify();
4102 if( bLockModify ) pBoxFormat->UnlockModify();
4104 if( bSetNumberFormat )
4125 if( !bIsEmptyTextNd )
4144 pUndo->SetBox( rBox );
4173 pBoxFormat->LockModify();
4175 pBoxFormat->UnlockModify();
4179 pBoxFormat->LockModify();
4181 pBoxFormat->UnlockModify();
4192 if (
nullptr == pNode )
4199 && pTextNode->
GetText().isEmpty()))
4204 pTextNode->SwContentNode::GetAttr(
rSet );
4222 std::unique_ptr<SfxStringItem> pNewItem(pFormatItem->
Clone());
4223 pNewItem->SetValue(OUString());
4224 rSet.
Put( std::move(pNewItem) );
4231 if(
nullptr == pSttNd ||
4274 const SwTable* pCpyTable,
bool bCpyName,
bool bCorrPos,
const OUString& rStyleName )
4280 : rBoxes[ 0 ]->GetSttNd()->FindTableNode();
4285 if( !pCpyTable && !pInsTableNd )
4287 std::unique_ptr<SwUndoCpyTable> pUndo;
4297 bCpyName, rStyleName );
4304 pUndo->SetTableSttIdx( pInsTableNd->
GetIndex() );
4316 std::unique_ptr<SwUndoTableCpyTable> pUndo;
4325 bool bDelCpyDoc = xCpyDoc ==
this;
4330 xCpyDoc =
new SwDoc;
4332 SwPosition aPos( xCpyDoc->GetNodes().GetEndOfContent() );
4353 && ( bDelCpyDoc || !rBoxes.
empty() ) )
4363 OSL_ENSURE( pBox,
"Box is not in this Table" );
4372 *pBoxes, pUndo.get() );
4378 aNdIdx, pUndo.get() );
4387 if( bRet || !pUndo->IsEmpty() )
4395 rInsPos.
Assign( *pSttNd );
4412 std::unique_ptr<SwUndoAttrTable> pUndo;
4417 for (
size_t i = rSrtBox.
size();
i; )
4427 if( pUndo && bChgd )
4446 if( !rBoxes.
empty() )
4448 std::unique_ptr<SwUndoAttrTable> pUndo;
4450 pUndo.reset(
new SwUndoAttrTable( *rBoxes[0]->GetSttNd()->FindTableNode() ));
4452 std::map<SwFrameFormat*, SwTableBoxFormat*> aFormatsMap;
4453 for (
size_t i = rBoxes.
size();
i; )
4459 std::map<SwFrameFormat*, SwTableBoxFormat*>::const_iterator
const it =
4460 aFormatsMap.find(pBoxFormat);
4461 if (aFormatsMap.end() != it)
4468 aFormatsMap.insert(std::make_pair(pBoxFormat, pNewBoxFormat));
4474 if( pUndo && bChgd )
4484 bool bChgd =
false, bHasSel = rPam.
HasMark() ||
4489 for(
auto n = rFormats.
size();
n ; )
4499 bool bFound =
false;
4502 auto [pStt, pEnd] = pTmp->
StartEnd();
4503 bFound = pStt->GetNodeIndex() < nTableIdx &&
4504 nTableIdx < pEnd->GetNodeIndex();
4506 }
while( !bFound && &rPam != ( pTmp = pTmp->
GetNext() ) );
4521 const OUString* pTableName,
4522 bool* pFullTableProtection )
4524 bool bHasProtection =
false;
4538 for (
size_t i = rSrtBox.
size();
i; )
4543 if( !bHasProtection )
4545 bHasProtection =
true;
4546 if( !pFullTableProtection )
4548 *pFullTableProtection =
true;
4551 else if( bHasProtection && pFullTableProtection )
4553 *pFullTableProtection =
false;
4558 return bHasProtection;
4572 std::make_unique<SwUndoTableStyleMake>(rName, *
this));
4578 return pTableFormat;
4588 std::vector<SwTable*> vAffectedTables;
4589 if (pReleasedFormat)
4592 for (
size_t i=0;
i < nTableCount; ++
i)
4599 vAffectedTables.push_back(pTable);
4608 std::make_unique<SwUndoTableStyleDelete>(std::move(pReleasedFormat), std::move(vAffectedTables), *
this));
4612 return pReleasedFormat;
4622 *pFormat = rNewFormat;
4626 for (
size_t i=0;
i < nTableCount; ++
i)
4639 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(SfxPoolItem *pHt)=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 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
SwFEShell * GetFEShell()
For Core - it knows the DocShell but not the WrtShell!
bool IsNumberFormat(std::u16string_view aString, sal_uInt32 &F_Index, double &fOutNumber)
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.
std::unique_ptr< SwFrameFormats > mpTableFrameFormatTable
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
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)
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)
Insert new table at position.
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
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.
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)
void DeleteRow(const SwCursor &rCursor)
Deleting Columns/Rows.
const SwFrameFormat * GetDfltFrameFormat() const
const SwFrameFormats * GetSpzFrameFormats() const
bool IsInMailMerge() const
void ClearBoxNumAttrs(SwNode &rNode)
SwFrameFormat & GetTableFrameFormat(size_t nFormat, bool bUsed) const
void SetRowsToRepeat(SwTable &rTable, sal_uInt16 nSet)
::sw::DocumentSettingManager & GetDocumentSettingManager()
SwTableAutoFormatTable & GetTableStyles()
Return the available table styles.
void SetColRowWidthHeight(SwTableBox &rCurrentBox, TableChgWidthHeightType eType, SwTwips nAbsDiff, SwTwips nRelDiff)
const SwFrameFormats * GetTableFrameFormats() const
SvNumberFormatter * GetNumberFormatter(bool bCreate=true)
SwDocShell * GetDocShell()
::sw::UndoManager & GetUndoManager()
void UnProtectCells(const OUString &rTableName)
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.
bool UpdateTableStyleFormatting(SwTableNode *pTableNode=nullptr, bool bResetDirect=false, OUString const *pStyleName=nullptr)
Update the direct formatting according to the current table style.
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)