21#include <com/sun/star/text/HoriOrientation.hpp>
22#include <osl/diagnose.h>
69#define CHECK_TABLE(t) (t).CheckConsistency();
83 explicit CpyTabFrame(
SwFrameFormat* pCurrentFrameFormat) : pNewFrameFormat(
nullptr )
84 { pFrameFormat = pCurrentFrameFormat; }
86 bool operator==(
const CpyTabFrame& rCpyTabFrame )
const
87 {
return pFrameFormat == rCpyTabFrame.pFrameFormat; }
88 bool operator<(
const CpyTabFrame& rCpyTabFrame )
const
89 {
return pFrameFormat < rCpyTabFrame.pFrameFormat; }
96 SwTwips nDiff, nSide, nMaxSize, nLowerDiff;
103 nDiff( nDif ), nSide( nSid ), nMaxSize( nMax ), nLowerDiff( 0 )
110 CR_SetBoxWidth(
const CR_SetBoxWidth& rCpy )
111 : pTableNd( rCpy.pTableNd ),
112 nDiff( rCpy.nDiff ), nSide( rCpy.nSide ),
113 nMaxSize( rCpy.nMaxSize ), nLowerDiff( 0 ),
115 bBigger( rCpy.bBigger ), bLeft( rCpy.bLeft )
136#define CHECKBOXWIDTH \
138 SwTwips nSize = GetFrameFormat()->GetFrameSize().GetWidth(); \
139 for (size_t nTmp = 0; nTmp < m_aLines.size(); ++nTmp) \
140 ::CheckBoxWidth( *m_aLines[ nTmp ], nSize ); \
143#define CHECKTABLELAYOUT \
145 for ( size_t i = 0; i < GetTabLines().size(); ++i ) \
147 SwFrameFormat* pFormat = GetTabLines()[i]->GetFrameFormat(); \
148 SwIterator<SwRowFrame,SwFormat> aIter( *pFormat ); \
149 for (SwRowFrame* pFrame=aIter.First(); pFrame; pFrame=aIter.Next())\
151 if ( pFrame->GetTabLine() == GetTabLines()[i] ) \
153 OSL_ENSURE( pFrame->GetUpper()->IsTabFrame(), \
154 "Table layout does not match table structure" ); \
163#define CHECKTABLELAYOUT
169struct CR_SetLineHeight
178 nMaxSpace( 0 ), nMaxHeight( 0 )
183 CR_SetLineHeight(
const CR_SetLineHeight& rCpy )
184 : pTableNd( rCpy.pTableNd ),
185 nMaxSpace( rCpy.nMaxSpace ), nMaxHeight( rCpy.nMaxHeight ),
187 bBigger( rCpy.bBigger )
206 std::shared_ptr< std::vector< std::vector< sal_uLong > > > pWidths;
214 sal_uInt16 nCpyCnt, nInsPos;
215 sal_uInt16 nLnIdx, nBoxIdx;
220 : rDoc( pNd->
GetDoc() ), pTableNd( pNd ), rTabFrameArr(rFrameArr),
221 pInsLine(
nullptr), pInsBox(
nullptr), nOldSize(0), nNewSize(0),
222 nMinLeft(ULONG_MAX), nMaxRight(0),
223 nCpyCnt(nCopies), nInsPos(0),
224 nLnIdx(0), nBoxIdx(0),
225 nDelBorderFlag(0), bCpyContent(
true )
227 CpyPara(
const CpyPara& rPara,
SwTableLine* pLine )
228 : pWidths( rPara.pWidths ), rDoc(rPara.rDoc), pTableNd(rPara.pTableNd),
229 rTabFrameArr(rPara.rTabFrameArr), pInsLine(pLine), pInsBox(rPara.pInsBox),
230 nOldSize(0), nNewSize(rPara.nNewSize), nMinLeft( rPara.nMinLeft ),
231 nMaxRight( rPara.nMaxRight ), nCpyCnt(rPara.nCpyCnt), nInsPos(0),
232 nLnIdx( rPara.nLnIdx), nBoxIdx( rPara.nBoxIdx ),
233 nDelBorderFlag( rPara.nDelBorderFlag ), bCpyContent( rPara.bCpyContent )
235 CpyPara(
const CpyPara& rPara,
SwTableBox* pBox )
236 : pWidths( rPara.pWidths ), rDoc(rPara.rDoc), pTableNd(rPara.pTableNd),
237 rTabFrameArr(rPara.rTabFrameArr), pInsLine(rPara.pInsLine), pInsBox(pBox),
238 nOldSize(rPara.nOldSize), nNewSize(rPara.nNewSize),
239 nMinLeft( rPara.nMinLeft ), nMaxRight( rPara.nMaxRight ),
240 nCpyCnt(rPara.nCpyCnt), nInsPos(0), nLnIdx(rPara.nLnIdx), nBoxIdx(rPara.nBoxIdx),
241 nDelBorderFlag( rPara.nDelBorderFlag ), bCpyContent( rPara.bCpyContent )
255 if( pCpyPara->nCpyCnt )
259 nFndPos = itFind - pCpyPara->rTabFrameArr.begin();
260 if( itFind == pCpyPara->rTabFrameArr.end() || !(*itFind == aFindFrame) )
269 bool bDiffCount =
false;
272 pCmpLine = rFndBox.
GetLines().front().get();
282 for(
auto n = rFndBoxes.size();
n; )
284 nSz += rFndBoxes[--
n]->GetBox()->
285 GetFrameFormat()->GetFrameSize().GetWidth();
288 nSz / ( pCpyPara->nCpyCnt + 1 ) );
290 aFrameSz.
SetWidth( nSz / ( pCpyPara->nCpyCnt + 1 ) );
294 MakeTableLineFormat());
295 *aFindFrame.pNewFrameFormat = *pNewFormat;
303 aFindFrame.pNewFrameFormat = pNewFormat;
304 pCpyPara->rTabFrameArr.insert( aFindFrame );
305 aFindFrame.pFrameFormat = pNewFormat;
306 pCpyPara->rTabFrameArr.insert( aFindFrame );
311 aFindFrame = pCpyPara->rTabFrameArr[ nFndPos ];
318 if( pCpyPara->nDelBorderFlag &&
319 itFind != pCpyPara->rTabFrameArr.end() )
320 aFindFrame = *itFind;
327 pBox =
new SwTableBox( aFindFrame.pNewFrameFormat,
328 rFndBox.
GetLines().size(), pCpyPara->pInsLine );
329 pCpyPara->pInsLine->GetTabBoxes().insert( pCpyPara->pInsLine->GetTabBoxes().begin() + pCpyPara->nInsPos++, pBox );
330 CpyPara aPara( *pCpyPara, pBox );
331 aPara.nDelBorderFlag &= 7;
333 for (
auto const& pFndLine : rFndBox.
GetLines())
340 ::InsTableBox( pCpyPara->rDoc, pCpyPara->pTableNd, pCpyPara->pInsLine,
341 aFindFrame.pNewFrameFormat, pBox, pCpyPara->nInsPos++ );
344 if( 8 > pCpyPara->nDelBorderFlag
345 ? pCpyPara->nDelBorderFlag != 0
346 : &rFndBox == rFndBxs[rFndBxs.size() - 1].get())
349 if( 8 > pCpyPara->nDelBorderFlag
356 if( 8 > pCpyPara->nDelBorderFlag )
357 aNew.
SetLine(
nullptr, SvxBoxItemLine::TOP );
359 aNew.
SetLine(
nullptr, SvxBoxItemLine::RIGHT );
361 if( 1 == pCpyPara->nDelBorderFlag ||
362 8 == pCpyPara->nDelBorderFlag )
365 pBox = pCpyPara->pInsLine->GetTabBoxes()[
366 pCpyPara->nInsPos - 1 ];
375 if( !pCpyPara->nCpyCnt )
376 pCpyPara->rTabFrameArr.insert( aFindFrame );
386 rFndLine.
GetBoxes().size(), pCpyPara->pInsBox );
387 if( pCpyPara->pInsBox )
389 SwTableLines& rLines = pCpyPara->pInsBox->GetTabLines();
390 rLines.
insert( rLines.
begin() + pCpyPara->nInsPos++, pNewLine );
394 SwTableLines& rLines = pCpyPara->pTableNd->GetTable().GetTabLines();
395 rLines.
insert( rLines.
begin() + pCpyPara->nInsPos++, pNewLine );
398 CpyPara aPara( *pCpyPara, pNewLine );
399 for (
auto const& it : rFndLine.
GetBoxes())
404 pCpyPara->nDelBorderFlag &= 0xf8;
414 if( 1 == pFndLn->
GetBoxes().size() &&
415 !( pFBox = pFndLn->
GetBoxes()[0].get() )->GetBox()->GetSttNd() )
418 for (
auto &rpLine : pFBox->
GetLines())
420 lcl_InsCol( rpLine.get(), rCpyPara, nCpyCnt, bBehind );
425 rCpyPara.pInsLine = pFndLn->
GetLine();
427 pFndLn->
GetBoxes().size()-1 : 0 ]->GetBox();
432 for( sal_uInt16
n = 0;
n < nCpyCnt; ++
n )
434 if(
n + 1 == nCpyCnt && bBehind )
435 rCpyPara.nDelBorderFlag = 9;
437 rCpyPara.nDelBorderFlag = 8;
438 for (
auto const& it : pFndLn->
GetBoxes())
450 if( pFrame->GetTabLine() == &rLine )
457 OSL_ENSURE( !rBoxes.
empty() && nCnt,
"No valid Box List" );
468 FndBox_ aFndBox(
nullptr,
nullptr );
470 FndPara aPara( rBoxes, &aFndBox );
486 CpyPara aCpyPara( pTableNd, nCnt, aTabFrameArr );
488 for (
auto & rpLine : aFndBox.
GetLines())
490 lcl_InsCol( rpLine.get(), aCpyPara, nCnt, bBehind );
506 pPCD->
AddRowCols( *
this, rBoxes, nCnt, bBehind );
510 pFEShell->UpdateTableStyleFormatting();
516 sal_uInt16 nCnt,
bool bBehind )
518 OSL_ENSURE( pDoc && !rBoxes.
empty() && nCnt,
"No valid Box List" );
524 FndBox_ aFndBox(
nullptr,
nullptr );
526 FndPara aPara( rBoxes, &aFndBox );
537 while( 1 == pFndBox->
GetLines().size() )
539 pFndLine = pFndBox->
GetLines()[0].get();
540 if( 1 != pFndLine->
GetBoxes().size() )
558 if( pFndBox != &aFndBox )
565 CpyPara aCpyPara( pTableNd, 0, aTabFrameArr );
568 pFndBox->
GetLines().size()-1 : 0 ]->GetLine();
569 if( &aFndBox == pFndBox )
573 aCpyPara.pInsBox = pFndBox->
GetBox();
580 aCpyPara.nDelBorderFlag = 1;
583 aCpyPara.nDelBorderFlag = 2;
585 for( sal_uInt16 nCpyCnt = 0; nCpyCnt < nCnt; ++nCpyCnt )
588 aCpyPara.nDelBorderFlag = 1;
589 for (
auto & rpFndLine : pFndBox->
GetLines())
614 if( pFndBox != &aFndBox )
625 pPCD->
AddRowCols( *
this, rBoxes, nCnt, bBehind );
629 pFEShell->UpdateTableStyleFormatting(pTableNd);
640 for (
auto pLine : rLines )
647 SwTableBox& rBox = *(bFirst ? rBoxes.front() : rBoxes.back());
650 bFirst, rShareFormats );
663 pFormat->LockModify();
665 pFormat->UnlockModify();
667 rShareFormats.
AddFormat( *pBoxFormat, *pFormat );
672 bool bCalcNewSize,
const bool bCorrBorder,
676 SwTwips nBoxSz = bCalcNewSize ?
680 sal_uInt16 nDelPos = pLine->
GetBoxPos( pBox );
684 if( bCorrBorder && 1 < rTableBoxes.size() )
694 if( nDelPos + 1 < o3tl::narrowing<sal_uInt16>(rTableBoxes.size()) )
696 SwTableBox* pNxtBox = rTableBoxes[ nDelPos + 1 ];
699 SwTableBox* pPrvBox = nDelPos ? rTableBoxes[ nDelPos - 1 ] :
nullptr;
707 SvxBoxItemLine::LEFT );
709 pShareFormats->
SetAttr( *pNxtBox, aTmp );
715 if( !bChgd && nDelPos )
717 SwTableBox* pPrvBox = rTableBoxes[ nDelPos - 1 ];
720 SwTableBox* pNxtBox = nDelPos + 1 < o3tl::narrowing<sal_uInt16>(rTableBoxes.size())
721 ? rTableBoxes[ nDelPos + 1 ] :
nullptr;
729 SvxBoxItemLine::RIGHT );
731 pShareFormats->
SetAttr( *pPrvBox, aTmp );
742 pShareFormats->
RemoveFormat( *rTableBoxes[ nDelPos ]->GetFrameFormat() );
746 delete rTableBoxes[nDelPos];
747 rTableBoxes.erase( rTableBoxes.begin() + nDelPos );
759 if( !rTableBoxes.empty() )
762 bool bLastBox = nDelPos == rTableBoxes.size();
765 pBox = rTableBoxes[nDelPos];
771 pShareFormats->
SetSize( *pBox, aNew );
781 pShareFormats ? *pShareFormats
798 delete pTabLineToDelete;
812 delete pTabLineToDelete;
820 sal_uInt16 nLinePos,
bool bNxt,
821 SwSelBoxes* pAllDelBoxes,
size_t *
const pCurPos)
831 SwTwips nFndWidth = nBoxStt + nBoxWidth;
836 if ( nFndWidth <= 0 )
842 nFndWidth -= nFndBoxWidth;
858 else if( pAllDelBoxes )
862 if( aFndIt == pAllDelBoxes->
end() )
864 size_t const nFndPos = aFndIt - pAllDelBoxes->
begin() ;
869 if( nFndPos <= *pCurPos )
871 pAllDelBoxes->
erase( pAllDelBoxes->
begin() + nFndPos );
873 }
while( bNxt ? ( nLinePos + 1 < o3tl::narrowing<sal_uInt16>(rTableLns.
size()) ) : nLinePos != 0 );
881 size_t *
const pCurPos =
nullptr )
887 sal_uInt16 nDelPos = pLine->
GetBoxPos( pUpperBox );
902 sal_uInt16 nLnPos = pTableLns->
GetPos( pLine );
907 for( sal_uInt16
n = 0;
n < nDelPos; ++
n )
908 nBoxStt += rTableBoxes[
n ]->GetFrameFormat()->GetFrameSize().GetWidth();
911 SwTableBox *pPrvBox =
nullptr, *pNxtBox =
nullptr;
914 nLnPos,
false, pAllDelBoxes, pCurPos );
916 if( nLnPos + 1 < o3tl::narrowing<sal_uInt16>(pTableLns->
size()) )
918 nLnPos,
true, pAllDelBoxes, pCurPos );
920 if( pNxtBox && pNxtBox->GetSttNd() )
922 const SvxBoxItem& rNxtBoxItem = pNxtBox->GetFrameFormat()->GetBox();
923 if( !rNxtBoxItem.
GetTop() && ( !pPrvBox ||
929 SvxBoxItemLine::TOP );
930 rShareFormats.
SetAttr( *pNxtBox, aTmp );
934 if( !(!bChgd && pPrvBox && pPrvBox->
GetSttNd()) )
938 if( !rPrvBoxItem.
GetTop() && ( !pNxtBox ||
939 !pNxtBox->GetFrameFormat()->GetBox().GetTop()) )
944 SvxBoxItemLine::BOTTOM );
945 rShareFormats.
SetAttr( *pPrvBox, aTmp );
955 const bool bDelMakeFrames,
const bool bCorrBorder )
957 OSL_ENSURE( pDoc,
"No doc?" );
959 if( !rBoxes.
empty() )
961 pTableNd =
const_cast<SwTableNode*
>(rBoxes[0]->GetSttNd()->FindTableNode());
969 FndBox_ aFndBox(
nullptr,
nullptr );
970 if ( bDelMakeFrames )
972 if( pMerged && !pMerged->
empty() )
974 else if( !rBoxes.
empty() )
985 for (
size_t n = 0;
n < aBoxes.
size(); ++
n)
996 for (
size_t n = 0;
n < rBoxes.
size(); ++
n)
998 size_t const nIdx = rBoxes.
size() - 1 -
n;
1003 if (pPCD && pTableNd)
1007 DeleteBox_( *
this, rBoxes[nIdx], pUndo,
true, bCorrBorder, &aShareFormats );
1028 OSL_ENSURE( !rBoxes.
empty() && nCnt,
"No valid values" );
1042 std::unique_ptr<tools::Long[]> pRowHeights;
1046 for (
size_t n = 0;
n < rBoxes.
size(); ++
n)
1050 OSL_ENSURE( pRow,
"Where is the SwTableLine's Frame?" );
1057 FndBox_ aFndBox(
nullptr,
nullptr );
1061 for (
size_t n = 0;
n < rBoxes.
size(); ++
n)
1064 OSL_ENSURE( pSelBox,
"Box is not within the Table" );
1075 bool bChgLineSz = 0 != aFSz.
GetHeight() || bSameHeight;
1081 sal_uInt16 nBoxPos = pInsLine->
GetBoxPos( pSelBox );
1088 bool bMoveNodes =
true;
1092 while( nSttNd < nEndNd )
1093 if( !rDoc.
GetNodes()[ nSttNd++ ]->IsTextNode() )
1101 bool bChkBorder =
nullptr != pCpyBoxFrameFormat->
GetBox().
GetTop();
1105 for( sal_uInt16
i = 0;
i <= nCnt; ++
i )
1124 ::InsTableBox( rDoc, pTableNd, pNewLine, pCpyBoxFrameFormat,
1131 aTmp.
SetLine(
nullptr, SvxBoxItemLine::TOP );
1157 pRowHeights.reset();
1170 OSL_ENSURE( !rBoxes.
empty() && nCnt,
"No valid values" );
1185 FndBox_ aFndBox(
nullptr,
nullptr );
1190 std::vector<SwTableBoxFormat*> aLastBoxArr;
1191 for (
size_t n = 0;
n < aSelBoxes.
size(); ++
n)
1194 OSL_ENSURE( pSelBox,
"Box is not in the table" );
1202 sal_uInt16 nBoxPos = pInsLine->
GetBoxPos( pSelBox );
1208 const size_t nFndPos = itFind - aFrameArr.
begin();
1209 if( itFind == aFrameArr.
end() || !(*itFind == aFindFrame) )
1214 SwTwips nNewBoxSz = nBoxSz / ( nCnt + 1 );
1217 aFrameArr.
insert( aFindFrame );
1219 pLastBoxFormat = aFindFrame.pNewFrameFormat;
1220 if( nBoxSz != ( nNewBoxSz * (nCnt + 1)))
1226 nBoxSz - ( nNewBoxSz * nCnt ), 0 ) );
1228 aLastBoxArr.insert( aLastBoxArr.begin() + nFndPos, pLastBoxFormat );
1232 aFindFrame = aFrameArr[ nFndPos ];
1234 pLastBoxFormat = aLastBoxArr[ nFndPos ];
1238 for( sal_uInt16
i = 1;
i < nCnt; ++
i )
1239 ::InsTableBox( rDoc, pTableNd, pInsLine, aFindFrame.pNewFrameFormat,
1240 pSelBox, nBoxPos +
i );
1243 pSelBox, nBoxPos + nCnt );
1246 const SvxBoxItem& aSelBoxItem = aFindFrame.pNewFrameFormat->GetBox();
1249 pInsLine->
GetTabBoxes()[ nBoxPos + nCnt ]->ClaimFrameFormat();
1252 aTmp.
SetLine(
nullptr, SvxBoxItemLine::RIGHT );
1253 aFindFrame.pNewFrameFormat->SetFormatAttr( aTmp );
1256 for(
auto i = aFrameArr.
size();
i; )
1258 const CpyTabFrame& rCTF = aFrameArr[ --
i ];
1259 if( rCTF.pNewFrameFormat == aFindFrame.pNewFrameFormat ||
1260 rCTF.pFrameFormat == aFindFrame.pNewFrameFormat )
1263 aLastBoxArr.erase( aLastBoxArr.begin() +
i );
1294 sal_uInt16 nPos = USHRT_MAX )
1296 for( sal_uInt16
n = nStt;
n < nEnd; ++
n )
1297 rLines[
n]->SetUpper( pInsBox );
1298 if( USHRT_MAX ==
nPos )
1301 rLines.
begin() + nStt, rLines.
begin() + nEnd );
1309 for( sal_uInt16
n = nStt;
n < nEnd; ++
n )
1310 rBoxes[
n]->SetUpper( pInsLine );
1313 rBoxes.begin() + nStt, rBoxes.begin() + nEnd );
1314 rBoxes.erase( rBoxes.begin() + nStt, rBoxes.begin() + nEnd );
1321 OSL_ENSURE( pBox->
GetTabLines().
size(),
"Box does not have any Lines" );
1324 OSL_ENSURE( pLine,
"Box is not within a Line" );
1328 nWidth += pTabBox->GetFrameFormat()->GetFrameSize().GetWidth();
1352 : pTableNd( pTNd ), pInsLine( pLine ), pInsBox( nullptr ),
1354 { bUL_LR =
true; bUL =
true; }
1357 { bUL_LR =
false; bUL =
true;
if( pBox ) pInsBox = pBox; }
1359 { bUL_LR =
false; bUL =
false;
if( pBox ) pInsBox = pBox; }
1361 { bUL_LR =
true; bUL =
false;
if( pLine ) pInsLine = pLine; }
1372 sal_uInt16 nStt = 0, nEnd = rFndBox.
GetLines().size();
1373 sal_uInt16 nInsPos = USHRT_MAX;
1374 if( !pULPara->bUL_LR )
1390 if(
nPos +1 < o3tl::narrowing<sal_uInt16>(pBoxes->size()) )
1392 nInsPos = pULPara->pInsLine->GetTabBoxes().size();
1394 *pBoxes, pULPara->pInsLine );
1399 else if (!rFndBox.
GetLines().empty())
1402 nStt = pULPara->bUL ? 0 : rFndBox.
GetLines().size()-1;
1406 pBoxes = &pULPara->pInsLine->GetTabBoxes();
1414 0, pULPara->pInsLine );
1415 InsULPara aPara( *pULPara );
1416 aPara.pInsBox = pBox;
1417 for (FndLines_t::iterator it = rFndBox.
GetLines().begin() + nStt;
1418 it != rFndBox.
GetLines().begin() + nEnd; ++it )
1424 if( USHRT_MAX == nInsPos )
1425 nInsPos = pBoxes->size();
1426 pBoxes->insert( pBoxes->begin() + nInsPos, pBox );
1437 sal_uInt16 nStt = 0, nEnd = rFndLine.
GetBoxes().size();
1438 sal_uInt16 nInsPos = USHRT_MAX;
1439 if( pULPara->bUL_LR )
1445 &pULPara->pTableNd->GetTable().GetTabLines();
1449 sal_uInt16 nLeft = pFndLn->
GetBoxPos( pLBx );
1450 sal_uInt16 nRight = pFndLn->
GetBoxPos( pRBx );
1452 if( !nLeft || nRight == pFndLn->
GetTabBoxes().size() )
1463 if( (
nPos = pLines->
GetPos( pFndLn )) + 1 < o3tl::narrowing<sal_uInt16>(pLines->
size()) )
1465 nInsPos = pULPara->pInsBox->GetTabLines().size();
1478 static_cast<SwTableBoxFormat*
>(pULPara->pLeftBox->GetFrameFormat()), 0, pInsLine );
1498 if( (
nPos = pLines->
GetPos( pFndLn )) + 1 < o3tl::narrowing<sal_uInt16>(pLines->
size()) )
1508 nStt = pULPara->bUL ? 0 : rFndLine.
GetBoxes().size()-1;
1511 pLines = &pULPara->pInsBox->GetTabLines();
1515 InsULPara aPara( *pULPara );
1516 aPara.pInsLine = pNewLine;
1518 for (FndBoxes_t::iterator it = rLineBoxes.begin() + nStt;
1519 it != rLineBoxes.begin() + nEnd; ++it)
1526 if( USHRT_MAX == nInsPos )
1527 nInsPos = pLines->
size();
1528 pLines->
insert( pLines->
begin() + nInsPos, pNewLine );
1539 OSL_ENSURE( !rBoxes.
empty() && pMergeBox,
"no valid values" );
1545 FndBox_ aFndBox(
nullptr,
nullptr );
1547 FndPara aPara( rBoxes, &aFndBox );
1568 while( 1 == pFndBox->
GetLines().size() &&
1569 1 == pFndBox->
GetLines().front()->GetBoxes().size() )
1571 pFndBox = pFndBox->
GetLines().front()->GetBoxes().front().get();
1584 sal_uInt16 nInsPos = pLines->
GetPos( pNewLine );
1585 pLines->
insert( pLines->
begin() + nInsPos, pInsLine );
1598 InsULPara aPara( pTableNd, pLeftBox, pInsLine );
1601 for (
auto & it : pFndBox->
GetLines().front()->GetBoxes())
1605 aPara.SetLower( pInsLine );
1606 const auto nEnd = pFndBox->
GetLines().size()-1;
1607 for (
auto & it : pFndBox->
GetLines()[nEnd]->GetBoxes())
1613 aPara.SetLeft( pLeftBox );
1614 for (
auto & rpFndLine : pFndBox->
GetLines())
1619 aPara.SetRight( pRightBox );
1620 for (
auto & rpFndLine : pFndBox->
GetLines())
1626 DeleteBox_( *
this, pLeftBox,
nullptr,
false,
false );
1630 if( pUndo && pLeftBox->
GetSttNd() )
1634 DeleteBox_( *
this, pRightBox,
nullptr,
false,
false );
1638 if( pUndo && pRightBox->
GetSttNd() )
1642 DeleteSel( pDoc, rBoxes,
nullptr,
nullptr,
false,
false );
1647 for(
const auto& rpBox :
GetTabLines()[0]->GetTabBoxes() )
1669 if( nRowSpan > nMaxSpan )
1671 else if( nRowSpan < nMinSpan )
1672 pBox->
setRowSpan( nMinSpan > 0 ? nMaxSpan : nMinSpan );
1675 nMinSpan = -nMaxSpan;
1682 const FndBox_* pFirstBox = &rBox;
1683 while (!pFirstBox->
GetLines().empty())
1685 pFirstBox = pFirstBox->
GetLines().front()->GetBoxes().front().get();
1688 sal_uInt16 nRet = 0;
1693 for(
auto pCmp : rBoxes )
1697 nRet = nRet + o3tl::narrowing<sal_uInt16>(pCmp->GetFrameFormat()->GetFrameSize().GetWidth());
1706 sal_uInt16 nRet = 0;
1709 nRet = nRet + o3tl::narrowing<sal_uInt16>(rLine.
GetBoxes()[--
n]->GetBox()
1710 ->GetFrameFormat()->GetFrameSize().GetWidth());
1717 rPara.pWidths.reset();
1718 const size_t nLineCount = rFndLines.size();
1721 rPara.pWidths = std::make_shared< std::vector< std::vector< sal_uLong > > >
1725 for(
size_t nLine = 0; nLine < nLineCount; ++nLine )
1727 std::vector< sal_uLong > &rWidth = (*rPara.pWidths)[ nLine ];
1728 const FndLine_ *pFndLine = rFndLines[ nLine ].get();
1729 if( pFndLine && !pFndLine->
GetBoxes().empty() )
1738 pFndLine->
GetBoxes().front()->GetBox();
1741 while( nBox < nBoxCount )
1750 if( rPara.nMinLeft >
nPos )
1751 rPara.nMinLeft =
nPos;
1752 nBoxCount = pFndLine->
GetBoxes().size();
1753 rWidth = std::vector< sal_uLong >( nBoxCount+2 );
1757 for( nBox = 0; nBox < nBoxCount; )
1760 ->GetBox()->GetFrameFormat()->GetFrameSize().GetWidth();
1761 rWidth[ ++nBox ] =
nPos;
1764 if( rPara.nMaxRight <
nPos )
1765 rPara.nMaxRight =
nPos;
1766 if(
nPos <= rWidth[ 0 ] )
1773 sal_uLong nSelSize = rPara.nMaxRight - rPara.nMinLeft;
1777 for(
size_t nLine = 0; nLine < nLineCount; ++nLine )
1779 std::vector< sal_uLong > &rWidth = (*rPara.pWidths)[ nLine ];
1780 const size_t nCount = rWidth.size();
1783 rWidth[
nCount - 1 ] = rPara.nMaxRight;
1785 for(
size_t nBox = 0; nBox <
nCount; ++nBox )
1787 sal_uInt64 nNextPos = rWidth[ nBox ];
1788 nNextPos -= rPara.nMinLeft;
1789 nNextPos *= rPara.nNewSize;
1790 nNextPos /= nSelSize;
1791 rWidth[ nBox ] =
static_cast<sal_uLong>(nNextPos - nLastPos);
1792 nLastPos =
static_cast<sal_uLong>(nNextPos);
1807 if( pCpyPara->pTableNd->GetTable().IsNewModel() )
1809 if( pCpyPara->nBoxIdx == 1 )
1810 nDummy1 = (*pCpyPara->pWidths)[pCpyPara->nLnIdx][0];
1811 nRealSize = (*pCpyPara->pWidths)[pCpyPara->nLnIdx][pCpyPara->nBoxIdx++];
1812 if( pCpyPara->nBoxIdx == (*pCpyPara->pWidths)[pCpyPara->nLnIdx].size()-1 )
1813 nDummy2 = (*pCpyPara->pWidths)[pCpyPara->nLnIdx][pCpyPara->nBoxIdx];
1817 nRealSize = pCpyPara->nNewSize;
1819 if (pCpyPara->nOldSize == 0)
1821 nRealSize /= pCpyPara->nOldSize;
1825 bool bDummy = nDummy1 > 0;
1838 std::shared_ptr<SwFormatFrameSize> aFrameSz(std::make_shared<SwFormatFrameSize>());
1852 bool DoCopyIt(itFind == pCpyPara->rTabFrameArr.end());
1856 DoCopyIt = !(*itFind == aFindFrame);
1861 aFindFrame = pCpyPara->rTabFrameArr[ nFndPos ];
1862 aFrameSz.reset(aFindFrame.pNewFrameFormat->GetFrameSize().Clone());
1863 DoCopyIt = aFrameSz->GetWidth() !=
static_cast<SwTwips>(nSize);
1869 aFindFrame.pNewFrameFormat = pCpyPara->rDoc.MakeTableBoxFormat();
1871 if( !pCpyPara->bCpyContent )
1873 aFrameSz->SetWidth( nSize );
1874 aFindFrame.pNewFrameFormat->SetFormatAttr( *aFrameSz );
1875 pCpyPara->rTabFrameArr.insert( aFindFrame );
1881 pBox =
new SwTableBox( aFindFrame.pNewFrameFormat,
1882 rFndBox.
GetLines().size(), pCpyPara->pInsLine );
1883 pCpyPara->pInsLine->GetTabBoxes().insert( pCpyPara->pInsLine->GetTabBoxes().begin() + pCpyPara->nInsPos++, pBox );
1884 CpyPara aPara( *pCpyPara, pBox );
1885 aPara.nNewSize = nSize;
1886 for (
auto const& rpFndLine : rFndBox.
GetLines())
1894 pCpyPara->rDoc.GetNodes().InsBoxen( pCpyPara->pTableNd, pCpyPara->pInsLine,
1895 aFindFrame.pNewFrameFormat,
1896 pCpyPara->rDoc.GetDfltTextFormatColl(),
1897 nullptr, pCpyPara->nInsPos );
1898 pBox = pCpyPara->pInsLine->GetTabBoxes()[ pCpyPara->nInsPos ];
1901 else if( pCpyPara->bCpyContent )
1910 if( aBoxAttrSet.
Count() )
1919 if( nNewIdx != nOldIdx )
1932 pCpyPara->rDoc.GetNodes().Delete( aInsIdx );
1934 ++pCpyPara->nInsPos;
1958 if( itFind == pCpyPara->rTabFrameArr.end() )
1961 aFindFrame.pNewFrameFormat =
reinterpret_cast<SwTableBoxFormat*
>(pCpyPara->rDoc.MakeTableLineFormat());
1963 pCpyPara->rTabFrameArr.insert( aFindFrame );
1966 aFindFrame = *itFind;
1969 rFndLine.
GetBoxes().size(), pCpyPara->pInsBox );
1970 if( pCpyPara->pInsBox )
1972 SwTableLines& rLines = pCpyPara->pInsBox->GetTabLines();
1973 rLines.
insert( rLines.
begin() + pCpyPara->nInsPos++, pNewLine );
1977 SwTableLines& rLines = pCpyPara->pTableNd->GetTable().GetTabLines();
1978 rLines.
insert( rLines.
begin() + pCpyPara->nInsPos++, pNewLine);
1981 CpyPara aPara( *pCpyPara, pNewLine );
1983 if( pCpyPara->pTableNd->GetTable().IsNewModel() )
1988 else if( rFndLine.
GetBoxes().size() ==
1997 pFormat = pCpyPara->pTableNd->GetTable().GetFrameFormat();
2002 for (
auto &rpBox : rFndLine.
GetBoxes())
2004 aPara.nOldSize += rpBox->GetBox()->GetFrameFormat()->GetFrameSize().GetWidth();
2008 for (
auto const& it : rBoxes)
2012 if( pCpyPara->pTableNd->GetTable().IsNewModel() )
2024 FndBox_ aFndBox(
nullptr,
nullptr );
2026 FndPara aPara( aSelBoxes, &aFndBox );
2035 CpyPara aPara( &rTableNd, 1, aCpyFormat );
2040 for (
const auto & rpFndLine : aFndBox.
GetLines())
2047 OSL_ENSURE( !pLine->
GetTabBoxes().empty(),
"Empty Table Line" );
2050 OSL_ENSURE( pTableBox,
"Missing Table Box" );
2051 pTableBox->setRowSpan( 1 );
2058 bool bCpyName,
const OUString& rStyleName )
const
2061 FndBox_ aFndBox(
nullptr,
nullptr );
2063 FndPara aPara( rSelBoxes, &aFndBox );
2072 if( pSrcDoc != &rInsDoc )
2088 OSL_ENSURE( pTableNd,
"Where is the TableNode now?" );
2095 if(
auto pSwDDETable =
dynamic_cast<const SwDDETable*
>(
this) )
2100 *pSwDDETable->GetDDEFieldType() );
2101 OSL_ENSURE( pFieldType,
"unknown FieldType" );
2106 pTableNd->
SetNewTable( std::unique_ptr<SwTable>(pNewTable),
false );
2124 CpyPara aPara( pTableNd, 1, aCpyFormat );
2130 for (
const auto & rpFndLine : aFndBox.
GetLines())
2141 if( USHRT_MAX != nLnPos && nLnPos )
2160 pFndLn = aFndBox.
GetLines().back().get();
2186 nullptr,
false,
false );
2202 const SwTableBox* pSrchBox,
bool bOvrTableLns )
const
2210 if( USHRT_MAX != nFndPos &&
2223 OSL_ENSURE( USHRT_MAX != nFndPos,
"Line is not in the Table" );
2225 if( nFndPos+1 >= o3tl::narrowing<sal_uInt16>(
GetUpper()->GetTabLines().
size()) )
2229 else if( bOvrTableLns )
2233 if( nFndPos + 1 >= o3tl::narrowing<sal_uInt16>(rTable.
GetTabLines().
size()) )
2248 return pLine->
FindNextBox( rTable,
nullptr, bOvrTableLns );
2253 const SwTableBox* pSrchBox,
bool bOvrTableLns )
const
2261 if( USHRT_MAX != nFndPos && nFndPos )
2276 OSL_ENSURE( USHRT_MAX != nFndPos,
"Line is not in the Table" );
2282 else if( bOvrTableLns )
2309 const SwTableBox* pSrchBox,
bool bOvrTableLns )
const
2356 if( bFirst && !bLeft )
2360 while( nStt <
nPos )
2361 nRet += pLine->
GetTabBoxes()[ nStt++ ]->GetFrameFormat()
2362 ->GetFrameSize().GetWidth();
2372 for(
auto pBox : rBoxes )
2377 bool bGreaterBox =
false;
2387 && ((nDist + (rParam.bLeft ? 0 : nWidth)) >= rParam.nSide);
2396 nLowerDiff = (nDist + ( rParam.bLeft ? 0 : nWidth ) ) - rParam.nSide;
2397 nLowerDiff *= rParam.nDiff;
2398 nLowerDiff /= rParam.nMaxSize;
2399 nLowerDiff = rParam.nDiff - nLowerDiff;
2402 nLowerDiff = rParam.nDiff;
2404 if( nWidth < nLowerDiff || nWidth - nLowerDiff <
MINLAY )
2410 SwTwips nLowerDiff = 0, nOldLower = rParam.nLowerDiff;
2413 rParam.nLowerDiff = 0;
2416 if( nLowerDiff < rParam.nLowerDiff )
2417 nLowerDiff = rParam.nLowerDiff;
2419 rParam.nLowerDiff = nOldLower;
2423 ( nDist + ( rParam.bLeft ? 0 : nWidth ) ) >= rParam.nSide) ||
2435 nLowerDiff = (nDist + ( rParam.bLeft ? 0 : nWidth ) ) - rParam.nSide;
2436 nLowerDiff *= rParam.nDiff;
2437 nLowerDiff /= rParam.nMaxSize;
2438 nLowerDiff = rParam.nDiff - nLowerDiff;
2441 nLowerDiff = rParam.nDiff;
2444 rParam.nLowerDiff += nLowerDiff;
2446 if( rParam.bBigger )
2447 aNew.
SetWidth( nWidth + nLowerDiff );
2449 aNew.
SetWidth( nWidth - nLowerDiff );
2450 rParam.aShareFormats.SetSize( *pBox, aNew );
2462 nDist >= rParam.nSide )
2472 for(
auto pBox : rBoxes )
2486 : ( rParam.bLeft ? nDist < rParam.nSide -
COLFUZZY
2487 : nDist >= rParam.nSide -
COLFUZZY )) )
2494 nDiff *= rParam.nDiff;
2495 nDiff /= rParam.nMaxSize;
2498 nDiff = rParam.nDiff;
2500 if( nWidth < nDiff || nWidth - nDiff <
MINLAY )
2506 SwTwips nLowerDiff = 0, nOldLower = rParam.nLowerDiff;
2509 rParam.nLowerDiff = 0;
2512 if( nLowerDiff < rParam.nLowerDiff )
2513 nLowerDiff = rParam.nLowerDiff;
2515 rParam.nLowerDiff = nOldLower;
2520 : ( rParam.bLeft ? nDist < rParam.nSide -
COLFUZZY
2521 : nDist >= rParam.nSide -
COLFUZZY)
2531 nLowerDiff = nWidth;
2532 nLowerDiff *= rParam.nDiff;
2533 nLowerDiff /= rParam.nMaxSize;
2536 nLowerDiff = rParam.nDiff;
2539 rParam.nLowerDiff += nLowerDiff;
2541 if( rParam.bBigger )
2542 aNew.
SetWidth( nWidth - nLowerDiff );
2544 aNew.
SetWidth( nWidth + nLowerDiff );
2546 rParam.aShareFormats.SetSize( *pBox, aNew );
2552 nDist > rParam.nSide )
2561 for(
auto pBox : rBoxes )
2565 nWidth *= rParam.nDiff;
2566 nWidth /= rParam.nMaxSize;
2568 rParam.aShareFormats.SetSize( *pBox, aSz );
2585 nCurrentSize += nBoxW;
2591 if (sal::static_int_cast< tools::ULong >(
std::abs(nCurrentSize - nSize)) >
2594 OSL_FAIL(
"Line's Boxes are too small or too large" );
2600 SwTwips nAbsDiff,
SwTwips nRelDiff, std::unique_ptr<SwUndo>* ppUndo )
2616 CR_SetBoxWidth aParam(
eType, nRelDiff, nDist,
2617 bLeft ? nDist : rSz.
GetWidth() - nDist,
2619 bBigger = aParam.bBigger;
2632 bool bChgLRSpace =
true;
2639 bRet = rSz.
GetWidth() <
static_cast<unsigned short>(USHRT_MAX) - nRelDiff;
2640 bChgLRSpace = bLeft ? rLR.
GetLeft() >= nAbsDiff
2644 bRet = bLeft ? rLR.
GetLeft() >= nAbsDiff
2665 if( !(*fnSelBox)(
n, aParam, nDistStt,
true ))
2686 if( aSz.
GetWidth() + nRelDiff >
static_cast<unsigned short>(USHRT_MAX) )
2690 0, aSz.
GetWidth(), aParam.pTableNd );
2694 aParam.nDiff = nRelDiff /= 2;
2696 aParam.nMaxSize /= 2;
2732 nFrameWidth += nAbsDiff;
2734 nFrameWidth -= nAbsDiff;
2756 (*fnSelBox)(
m_aLines[
n ], aParam, nDistStt, false );
2774 aParam.bBigger = !bBigger;
2777 if( aParam.bBigger )
2782 if( !(*fnOtherBox)(
n, aParam, 0,
true ))
2794 if( !(*fnSelBox)(
n, aParam, nDistStt,
true ))
2805 CR_SetBoxWidth aParam1( aParam );
2815 aParam1.LoopClear();
2816 (*fnSelBox)(
m_aLines[
n ], aParam, nDistStt, false );
2817 (*fnOtherBox)(
m_aLines[
n ], aParam1, nDistStt, false );
2826 aParam1.LoopClear();
2827 (*fnOtherBox)(
m_aLines[
n ], aParam1, nDistStt, false );
2828 (*fnSelBox)(
m_aLines[
n ], aParam, nDistStt, false );
2851 aParam.bBigger = !bBigger;
2858 const SwTableBoxes::size_type
nPos = pLine->
GetBoxPos( pBox );
2872 aParam.nMaxSize = aParam.nSide;
2875 GetFrameSize().GetWidth() - aParam.nSide;
2880 bRet = (*fnTmp)( pLine, aParam, nDistStt, true );
2885 CR_SetBoxWidth aParam1( aParam );
2891 (*fnSelBox)( pLine, aParam, nDistStt, false );
2892 (*fnOtherBox)( pLine, aParam1, nDistStt, false );
2896 (*fnOtherBox)( pLine, aParam1, nDistStt, false );
2897 (*fnSelBox)( pLine, aParam, nDistStt, false );
2920 OSL_ENSURE( pLineFrame,
"Where is the Frame from the SwTableLine?" );
2926 nMyNewH = nMyOldH + nNewHeight;
2931 aTmp *=
Fraction( nNewHeight, nOldHeight );
2961 else if( !rParam.bBigger )
2965 OSL_ENSURE( pLineFrame,
"Where is the Frame from the SwTableLine?" );
2967 if( (nRstHeight +
ROWFUZZY) < nDist )
2979 if( rParam.bBigger )
2983 OSL_ENSURE( pLineFrame,
"Where is the Frame from the SwTableLine?" );
2988 nDist /= rParam.nMaxHeight;
3000 OSL_ENSURE( pLineFrame,
"Where is the Frame from the SwTableLine??" );
3008 nDist /= rParam.nMaxHeight;
3014 nDist /= rParam.nMaxSpace;
3024 SwTwips nAbsDiff,
SwTwips nRelDiff, std::unique_ptr<SwUndo>* ppUndo )
3037 CR_SetLineHeight aParam(
eType,
3039 bBigger = aParam.bBigger;
3048 if( pLine == pBaseLine )
3053 nBaseLinePos = pLines->
GetPos( pLine );
3084 nEnd = nBaseLinePos;
3088 nStt = nBaseLinePos + 1;
3089 nEnd = pLines->
size();
3095 for(
auto n = nStt;
n < nEnd; ++
n )
3098 OSL_ENSURE( pLineFrame,
"Where is the Frame from the SwTableLine??" );
3102 if( bBigger && aParam.nMaxSpace < nAbsDiff )
3107 if( bTop ? nEnd != 0 : nStt < nEnd )
3122 for(
auto n = nStt;
n < nEnd; ++
n )
3143 CR_SetLineHeight aParam1( aParam );
3149 for(
auto n = nStt;
n < nEnd; ++
n )
3155 for(
auto n = nStt;
n < nEnd; ++
n )
3200 sal_uInt16 nWhich = rItem.
Which();
3205 GetItemState( nWhich,
false, &pItem ) && *pItem == rItem &&
3206 pTmp->GetFormatAttr(
RES_FRM_SIZE,
false ) == rFrameSz )
3281 if( pOld && pOld->HasOnlyOneListener() )
3305 *pRet =
GetFormat( *pBoxFormat, rItem );
3319 *pRet =
GetFormat( *pLineFormat, rItem );
3343 sal_uIntPtr nIdx =
reinterpret_cast<sal_uIntPtr
>(&rFormat);
3345 decltype(nO) nU = 0;
3351 const auto nM = nU + ( nO - nU ) / 2;
3352 sal_uIntPtr nFormat =
reinterpret_cast<sal_uIntPtr
>(&
m_ShareArr[ nM ].GetOldFormat());
3353 if( nFormat == nIdx )
3359 else if( nFormat < nIdx )
sal_uInt32 GetValue() const
void SetTableLines(const SwSelBoxes &rBoxes, const SwTable &rTable)
const FndLine_ * GetUpper() const
const FndLines_t & GetLines() const
void MakeNewFrames(SwTable &rTable, const sal_uInt16 nNumber, const bool bBehind)
void MakeFrames(SwTable &rTable)
bool AreLinesToRestore(const SwTable &rTable) const
void DelFrames(SwTable &rTable)
const SwTableBox * GetBox() const
const FndBoxes_t & GetBoxes() const
const SwTableLine * GetLine() const
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 void DeleteSection(SwNode *pNode)=0
Delete section containing the node.
virtual bool InsertString(const SwPaM &rRg, const OUString &, const SwInsertFlags nInsertMode=SwInsertFlags::EMPTYEXPAND)=0
Insert string into existing text node at position rRg.Point().
virtual SwFieldType * InsertFieldType(const SwFieldType &)=0
virtual const SwExtraRedlineTable & GetExtraRedlineTable() const =0
static bool IsRedlineOn(const RedlineFlags eM)
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const editeng::SvxBorderLine * GetTop() const
const editeng::SvxBorderLine * GetRight() const
void SetLine(const editeng::SvxBorderLine *pNew, SvxBoxItemLine nLine)
const editeng::SvxBorderLine * GetLeft() const
const editeng::SvxBorderLine * GetBottom() const
void SetRight(const tools::Long nR, const sal_uInt16 nProp=100)
tools::Long GetRight() const
tools::Long GetLeft() const
void SetLeft(const tools::Long nL, const sal_uInt16 nProp=100)
tools::Long GetHeight() const
tools::Long GetWidth() const
void SetHeight(tools::Long n)
void SetWidth(tools::Long n)
void AddRowCols(const SwTable &rTable, const SwSelBoxes &rBoxes, sal_uInt16 nLines, bool bBehind)
SwChartDataProvider::AddRowCols tries to notify charts of added columns or rows and extends the value...
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.
bool Resize(sal_uInt16 nOffset, sal_uInt16 nWidth)
void SetValues(bool bFlag)
SwFEShell * GetFEShell()
For Core - it knows the DocShell but not the WrtShell!
SwTextFormatColl * CopyTextColl(const SwTextFormatColl &rColl)
copy TextNodes
void UpdateCharts(const OUString &rName) const
IDocumentChartDataProviderAccess const & getIDocumentChartDataProviderAccess() const
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
void SetRowNotTracked(const SwCursor &rCursor, const SvxPrintItem &rNotTracked, bool bAll=false, bool bIns=false)
rNotTracked = false means that the row was deleted or inserted with its tracked cell content bAll: de...
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
::sw::DocumentContentOperationsManager const & GetDocumentContentOperationsManager() const
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.
SwDocShell * GetDocShell()
Instances of SwFields and those derived from it occur 0 to n times.
const SwRect & getFrameArea() const
const SwRect & getFramePrintArea() const
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame.
Marks a node in the document model.
Base class of the Writer document model elements.
SwNodeOffset GetIndex() const
SwTableNode * FindTableNode()
Search table node, in which it is.
const SwStartNode * StartOfSectionNode() const
SwNodeOffset EndOfSectionIndex() const
const SwEndNode * EndOfSectionNode() const
bool MoveNodes(const SwNodeRange &, SwNodes &rNodes, SwNode &rPos, bool bNewFrames=true)
move the node pointer
void Delete(const SwNodeIndex &rPos, SwNodeOffset nNodes=SwNodeOffset(1))
PaM is Point and Mark: a selection of the document model.
tools::Long GetHeight(const SwRect &rRect) const
void Height(tools::Long nNew)
void Width(tools::Long nNew)
SwRowFrame is one table row in the document layout.
Starts a section of nodes in the document model.
void CheckSectionCondColl() const
Call ChkCondcoll to all ContentNodes of section.
SwTabFrame is one table in the document layout, containing rows (which contain cells).
SwTableBox is one table cell in the document model.
void SetUpper(SwTableLine *pNew)
sal_Int32 getRowSpan() const
SwNodeOffset GetSttIdx() const
void setRowSpan(sal_Int32 nNewRowSpan)
SwFrameFormat * GetFrameFormat()
SwTableLines & GetTabLines()
void setDummyFlag(bool bDummy)
SwTableBox * FindPreviousBox(const SwTable &, const SwTableBox *) const
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()
sal_uInt16 GetBoxPos(const SwTableBox *pBox) const
SwTableBox * FindPreviousBox(const SwTable &, const SwTableBox *=nullptr, bool bOvrTableLns=true) const
SwTableBox * FindNextBox(const SwTable &, const SwTableBox *=nullptr, bool bOvrTableLns=true) const
SwTableLine * back() const
iterator erase(iterator aIt)
SwTableLine * front() const
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
void MakeOwnFrames(SwPosition *pIdxBehind=nullptr)
Creates the frms for the table node (i.e.
void DelFrames(SwRootFrame const *pLayout=nullptr)
Method deletes all views of document for the node.
SwTable is one table in the document model, containing rows (which contain cells).
void SetHTMLTableLayout(std::shared_ptr< SwHTMLTableLayout > const &r)
void PrepareDelBoxes(const SwSelBoxes &rBoxes)
SwTable::PrepareDelBoxes(..) adjusts the row span attributes for an upcoming deletion of table cells ...
const OUString & GetTableStyleName() const
Return the table style name of this table.
bool SplitCol(SwDoc &rDoc, const SwSelBoxes &rBoxes, sal_uInt16 nCnt)
void SetRowsToRepeat(sal_uInt16 nNumOfRows)
SwTableLines & GetTabLines()
SwTableFormat * GetFrameFormat()
bool DeleteSel(SwDoc *, const SwSelBoxes &rBoxes, const SwSelBoxes *pMerged, SwUndo *pUndo, const bool bDelMakeFrames, const bool bCorrBorder)
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)
TableChgMode m_eTableChgMode
bool OldSplitRow(SwDoc &, const SwSelBoxes &, sal_uInt16, bool)
void SwitchFormulasToRelativeRepresentation()
bool SetRowHeight(SwTableBox &rCurrentBox, TableChgWidthHeightType eType, SwTwips nAbsDiff, SwTwips nRelDiff, std::unique_ptr< SwUndo > *ppUndo)
void SetTableChgMode(TableChgMode eMode)
const SwTableBox * GetTableBox(const OUString &rName, const bool bPerformValidCheck=false) const
bool OldMerge(SwDoc *, const SwSelBoxes &, SwTableBox *, SwUndoTableMerge *)
bool NewInsertCol(SwDoc &, const SwSelBoxes &rBoxes, sal_uInt16 nCnt, bool)
SwTable::NewInsertCol(..) insert new column(s) into a table.
void CopyHeadlineIntoTable(SwTableNode &rTableNd)
void ExpandSelection(SwSelBoxes &rBoxes) const
SwTable::ExpandSelection(..) adds all boxes to the box selections which are overlapped by it.
sal_uInt16 GetRowsToRepeat() const
SwTableSortBoxes & GetTabSortBoxes()
bool SetColWidth(SwTableBox &rCurrentBox, TableChgWidthHeightType eType, SwTwips nAbsDiff, SwTwips nRelDiff, std::unique_ptr< SwUndo > *ppUndo)
static SwSelBoxes & SelLineFromBox(const SwTableBox *pBox, SwSelBoxes &rBoxes, bool bToTop=true)
bool InsertRow_(SwDoc *, const SwSelBoxes &, sal_uInt16 nCnt, bool bBehind)
TableChgMode GetTableChgMode() const
bool MakeCopy(SwDoc &, const SwPosition &, const SwSelBoxes &, bool bCpyName=false, const OUString &rStyleName="") const
void SetSelBoxes(const SwSelBoxes &rBoxes)
void AddNewBox(SwNodeOffset nSttNdIdx)
void SaveSection(SwStartNode *pSttNd)
const_iterator begin() const
std::vector< Value >::const_iterator const_iterator
const_iterator find(const Value &x) const
size_type erase(const Value &x)
const_iterator end() const
std::vector< Value >::size_type size_type
std::pair< const_iterator, bool > insert(Value &&x)
const_iterator lower_bound(const Value &x) const
void CopyWithFlyInFly(const SwNodeRange &rRg, SwNode &rInsPos, const std::pair< const SwPaM &, const SwPosition & > *pCopiedPaM=nullptr, bool bMakeNewFrames=true, bool bDelRedlines=true, bool bCopyFlyAtFly=false, SwCopyFlags flags=SwCopyFlags::Default) const
note: rRg/rInsPos exclude a partially selected start text node; pCopiedPaM includes a partially selec...
virtual OUString GetName() const override
@ Fixed
Frame cannot be moved in Var-direction.
@ Variable
Frame is variable in Var-direction.
@ Minimum
Value in Var-direction gives minimum (can be exceeded but not be less).
constexpr sal_uInt16 RES_BOXATR_END(159)
constexpr TypedWhichId< SwTableBoxValue > RES_BOXATR_VALUE(158)
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
constexpr sal_uInt16 RES_FRMATR_END(141)
constexpr TypedWhichId< SwTableBoxFormula > RES_BOXATR_FORMULA(157)
constexpr sal_uInt16 RES_BOXATR_BEGIN(RES_GRFATR_END)
constexpr TypedWhichId< SwTableBoxNumFormat > RES_BOXATR_FORMAT(RES_BOXATR_BEGIN)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(97)
#define CH_TXT_TRACKED_DUMMY_CHAR
constexpr TypedWhichId< SvxPrintItem > RES_PRINT(104)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
void sw_Box_CollectBox(const SwTableBox *pBox, SwCollectTableLineBoxes *pSplPara)
void sw_BoxSetSplitBoxFormats(SwTableBox *pBox, SwCollectTableLineBoxes *pSplPara)
SwNodeOffset abs(const SwNodeOffset &a)
@ RES_POOLCOLL_TABLE
Subgroup table.
@ RES_POOLCOLL_TABLE_HDLN
Table of Contents - heading.
Marks a position in the document model.
std::vector< SwTableBox * > SwTableBoxes
constexpr TableChgWidthHeightType extractPosition(TableChgWidthHeightType e)
static void lcl_Merge_MoveLine(FndLine_ &rFndLine, InsULPara *const pULPara)
static bool lcl_SetSelBoxWidth(SwTableLine *pLine, CR_SetBoxWidth &rParam, SwTwips nDist, bool bCheck)
static SwTwips lcl_GetDistance(SwTableBox *pBox, bool bLeft)
void DeleteBox_(SwTable &rTable, SwTableBox *pBox, SwUndo *pUndo, bool bCalcNewSize, const bool bCorrBorder, SwShareBoxFormats *pShareFormats)
static void lcl_AjustLines(SwTableLine *pLine, CR_SetBoxWidth &rParam)
void CheckBoxWidth(const SwTableLine &rLine, SwTwips nSize)
static void lcl_BoxSetHeadCondColl(const SwTableBox *pBox)
bool(* FN_lcl_SetLineHeight)(SwTableLine *, CR_SetLineHeight &, SwTwips, bool)
static void lcl_Merge_MoveBox(FndBox_ &rFndBox, InsULPara *const pULPara)
static void lcl_CopyLineToDoc(FndLine_ const &rpFndLn, CpyPara *const pCpyPara)
static void lcl_CpyLines(sal_uInt16 nStt, sal_uInt16 nEnd, SwTableLines &rLines, SwTableBox *pInsBox, sal_uInt16 nPos=USHRT_MAX)
void sw_LineSetHeadCondColl(const SwTableLine *pLine)
static void lcl_CalcWidth(SwTableBox *pBox)
static void lcl_CopyCol(FndBox_ &rFndBox, CpyPara *const pCpyPara)
static bool lcl_SetOtherBoxWidth(SwTableLine *pLine, CR_SetBoxWidth &rParam, SwTwips nDist, bool bCheck)
static SwRowFrame * GetRowFrame(SwTableLine &rLine)
bool(* FN_lcl_SetBoxWidth)(SwTableLine *, CR_SetBoxWidth &, SwTwips, bool)
static void lcl_CheckRowSpan(SwTable &rTable)
static void lcl_InsCol(FndLine_ *pFndLn, CpyPara &rCpyPara, sal_uInt16 nCpyCnt, bool bBehind)
static bool lcl_SetSelLineHeight(SwTableLine *pLine, const CR_SetLineHeight &rParam, SwTwips nDist, bool bCheck)
static void lcl_CalcNewWidths(const FndLines_t &rFndLines, CpyPara &rPara)
static bool lcl_SetOtherLineHeight(SwTableLine *pLine, const CR_SetLineHeight &rParam, SwTwips nDist, bool bCheck)
static SwTableLine * lcl_CopyRow(FndLine_ &rFndLine, CpyPara *const pCpyPara)
static void lcl_CpyBoxes(sal_uInt16 nStt, sal_uInt16 nEnd, SwTableBoxes &rBoxes, SwTableLine *pInsLine)
static SwTableBox * lcl_FndNxtPrvDelBox(const SwTableLines &rTableLns, SwTwips nBoxStt, SwTwips nBoxWidth, sal_uInt16 nLinePos, bool bNxt, SwSelBoxes *pAllDelBoxes, size_t *const pCurPos)
static sal_uInt16 lcl_GetBoxOffset(const FndBox_ &rBox)
static void lcl_SaveUpperLowerBorder(SwTable &rTable, const SwTableBox &rBox, SwShareBoxFormats &rShareFormats, SwSelBoxes *pAllDelBoxes=nullptr, size_t *const pCurPos=nullptr)
static void lcl_CopyBoxToDoc(FndBox_ const &rFndBox, CpyPara *const pCpyPara)
static sal_uInt16 lcl_GetLineWidth(const FndLine_ &rLine)
static void lcl_LastBoxSetWidth(SwTableBoxes &rBoxes, const tools::Long nOffset, bool bFirst, SwShareBoxFormats &rShareFormats)
o3tl::sorted_vector< CpyTabFrame > CpyTabFrames
static void SetLineHeight(SwTableLine &rLine, SwTwips nOldHeight, SwTwips nNewHeight, bool bMinSize)
static void lcl_LastBoxSetWidthLine(SwTableLines &rLines, const tools::Long nOffset, bool bFirst, SwShareBoxFormats &rShareFormats)
void InsTableBox(SwDoc &rDoc, SwTableNode *pTableNd, SwTableLine *pLine, SwTableBoxFormat *pBoxFrameFormat, SwTableBox *pBox, sal_uInt16 nInsPos, sal_uInt16 nCnt=1)
void ForEach_FndLineCopyCol(SwTableLines &rLines, FndPara *pFndPara)
This creates a structure mirroring the SwTable structure that contains all rows and non-leaf boxes (a...
std::vector< std::unique_ptr< FndLine_ > > FndLines_t
std::vector< std::unique_ptr< FndBox_ > > FndBoxes_t
bool operator<(const wwFont &r1, const wwFont &r2)
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)