34#include <svx/svxids.hrc>
54#include <osl/diagnose.h>
57using ::editeng::SvxBorderLine;
71class SwTableFormatCmp :
public SwClient
75 ~SwTableFormatCmp()
override;
77 static SwFrameFormat* FindNewFormat(std::vector<std::unique_ptr<SwTableFormatCmp>>& rArr,
96SwTableFormatCmp::~SwTableFormatCmp()
100 m_pOld->Remove(
this);
101 if (!m_pOld->HasWriterListeners())
107SwFrameFormat* SwTableFormatCmp::FindNewFormat(std::vector<std::unique_ptr<SwTableFormatCmp>>& rArr,
110 for (
const auto& pCmp : rArr)
112 if (pCmp->m_pOld == pOld && pCmp->m_nType == nType)
122 "Tab selection not at ContentNode" );
124 Point aPtPos, aMkPos;
136 std::pair<Point, bool> tmp(aPtPos,
true);
141 prStart = pPointFrame ? pPointFrame->
GetUpper() :
nullptr;
142 prEnd = pMarkFrame ? pMarkFrame->
GetUpper() :
nullptr;
146 bool bAllCursor =
false )
154 const SwPaM *pCurPam = &rCursor, *pSttPam = pCurPam;
163 }
while( bAllCursor &&
164 pSttPam != ( pCurPam = pCurPam->
GetNext()) );
166 return !rBoxes.
empty();
171 if( rLineArr.end() == std::find( rLineArr.begin(), rLineArr.end(), pLine ) )
172 rLineArr.push_back( pLine );
192 std::vector<SwTableLine*> &m_rLines;
196 LinesAndTable(std::vector<SwTableLine*> &rL,
const SwTable &rTable) :
197 m_rLines(rL),
m_rTable(rTable), m_bInsertLines(true) {}
208 pPara->m_bInsertLines =
true;
209 for (
auto const& rpFndLine : rBox.
GetLines())
214 if (pPara->m_bInsertLines)
218 : pPara->m_rTable.GetTabLines();
221 for (
auto pLine : rLines )
225 pPara->m_bInsertLines =
false;
237 for (
auto const& it : rLine.
GetBoxes())
252 const SwTable &rTable = aBoxes[0]->GetSttNd()->FindTableNode()->GetTable();
253 LinesAndTable aPara( rArr, rTable );
254 FndBox_ aFndBox(
nullptr,
nullptr );
256 FndPara aTmpPara( aBoxes, &aFndBox );
268 for ( std::vector<SwTableLine*>::size_type
i = 0;
i < rArr.size(); ++
i )
271 for ( std::vector<SwTableLine*>::size_type k = 0; k < rArr.size(); ++k )
275 rArr.erase( rArr.begin() + k );
288 if (
nullptr != pNewFormat )
295 rFormatCmp.push_back(std::make_unique<SwTableFormatCmp>(pOld, pNew, 0));
299static void lcl_ProcessBoxSize(std::vector<std::unique_ptr<SwTableFormatCmp>>& rFormatCmp,
307 for (
auto pBox : rBoxes )
315 if ( !rLines.
empty() )
319 for (
auto pLine : rLines )
330 std::vector<SwTableLine*> aRowArr;
333 if( aRowArr.empty() )
341 std::vector<std::unique_ptr<SwTableFormatCmp>> aFormatCmp;
342 aFormatCmp.reserve( std::max( 255,
static_cast<int>(aRowArr.size()) ) );
344 for(
auto pLn : aRowArr )
356 std::vector<SwTableLine*> aRowArr;
359 if( aRowArr.empty() )
364 for (
auto pLn : aRowArr )
366 if ( pSz->
GetValue() != pLn->GetFrameFormat()->GetRowSplit().GetValue() )
371 return std::make_unique<SwFormatRowSplit>( *pSz );
395 std::vector<SwTableLine*> aRowArr;
398 if( aRowArr.empty() )
406 std::vector<std::unique_ptr<SwTableFormatCmp>> aFormatCmp;
407 aFormatCmp.reserve( std::max( 255,
static_cast<int>(aRowArr.size()) ) );
408 for (
auto pLn : aRowArr )
420 std::vector<SwTableLine*> aRowArr;
423 if( aRowArr.empty() )
428 for (
auto pLn : aRowArr )
430 if ( *pSz != pLn->GetFrameFormat()->GetFrameSize() )
433 return std::make_unique<SwFormatFrameSize>( *pSz );
442 std::vector<SwTableLine*> aRowArr;
445 if( 1 < aRowArr.size() )
450 sal_Int32 nTotalHeight = 0;
451 for (
auto pLn : aRowArr )
460 pFrame = aIter.
Next();
462 nTotalHeight += nHeight;
466 nHeight = nTotalHeight / aRowArr.size();
473 std::make_unique<SwUndoAttrTable>(*pTableNd));
476 std::vector<std::unique_ptr<SwTableFormatCmp>> aFormatCmp;
477 aFormatCmp.reserve( std::max( 255,
static_cast<int>(aRowArr.size()) ) );
478 for(
auto pLn : aRowArr )
495 std::vector<SwTableLine*> aRowArr;
498 if( aRowArr.empty() )
506 std::vector<std::unique_ptr<SwTableFormatCmp>> aFormatCmp;
507 aFormatCmp.reserve( std::max( 255,
static_cast<int>(aRowArr.size()) ) );
509 for(
auto pLn : aRowArr )
521 std::vector<SwTableLine*> aRowArr;
524 if( !aRowArr.empty() )
526 rToFill = aRowArr[0]->GetFrameFormat()->makeBackgroundBrushItem();
529 for ( std::vector<SwTableLine*>::size_type
i = 1;
i < aRowArr.size(); ++
i )
531 std::unique_ptr<SvxBrushItem> aAlternative(aRowArr[
i]->GetFrameFormat()->makeBackgroundBrushItem());
533 if ( *rToFill != *aAlternative )
551 std::vector<SwTableLine*> aRowArr;
554 if( aRowArr.empty() )
558 SwDoc* pDoc = aRowArr[0]->GetFrameFormat()->GetDoc();
561 for(
auto pLn : aRowArr )
564 if ( !pHasTextChangesOnlyProp || pHasTextChangesOnlyProp->GetValue() )
574 if ( RedlineType::Insert == pTmp->
GetType() )
588 std::vector<SwTableLine*> aRowArr;
597 if( aRowArr.empty() )
605 bool bInsertDummy = !bAll && !bIns &&
608 std::vector<std::unique_ptr<SwTableFormatCmp>> aFormatCmp;
609 aFormatCmp.reserve( std::max( 255,
static_cast<int>(aRowArr.size()) ) );
612 for(
auto pLn : aRowArr )
617 bool bDeletionOfOwnRowInsertion =
false;
623 SwDoc* pDoc = pLn->GetFrameFormat()->GetDoc();
627 if ( RedlineType::Insert == pTmp->
GetType() &&
631 bDeletionOfOwnRowInsertion =
true;
641 if ( bInsertDummy && (pLn->IsEmpty() || bDeletionOfOwnRowInsertion ) )
644 SwNodeIndex aInsPos( *(pLn->GetTabBoxes()[0]->GetSttNd()), 1 );
661 if( rCellArr.end() == std::find( rCellArr.begin(), rCellArr.end(), pCellFrame ) )
662 rCellArr.push_back( pCellFrame );
675 OSL_ENSURE( pCell,
"Frame is not a Cell" );
685 }
while( pCell && pTab->
IsAnLower( pCell ) );
701 if( aUnions.empty() )
710 std::vector<std::unique_ptr<SwTableFormatCmp>> aFormatCmp;
711 aFormatCmp.reserve( 255 );
715 const SvxBorderLine* pLeft =
nullptr;
716 const SvxBorderLine* pRight =
nullptr;
717 const SvxBorderLine* pTop =
nullptr;
718 const SvxBorderLine* pBottom =
nullptr;
719 const SvxBorderLine* pHori =
nullptr;
720 const SvxBorderLine* pVert =
nullptr;
721 bool bHoriValid =
true, bVertValid =
true,
722 bTopValid =
true, bBottomValid =
true,
723 bLeftValid =
true, bRightValid =
true;
729 pHori = pSetBoxInfo->
GetHori();
730 pVert = pSetBoxInfo->
GetVert();
732 bHoriValid = pSetBoxInfo->
IsValid(SvxBoxInfoItemValidFlags::HORI);
733 bVertValid = pSetBoxInfo->
IsValid(SvxBoxInfoItemValidFlags::VERT);
736 bTopValid = pSetBoxInfo->
IsValid(SvxBoxInfoItemValidFlags::TOP);
737 bBottomValid = pSetBoxInfo->
IsValid(SvxBoxInfoItemValidFlags::BOTTOM);
738 bLeftValid = pSetBoxInfo->
IsValid(SvxBoxInfoItemValidFlags::LEFT);
739 bRightValid = pSetBoxInfo->
IsValid(SvxBoxInfoItemValidFlags::RIGHT);
753 bTopValid = bBottomValid = bLeftValid = bRightValid =
false;
758 for ( SwSelUnions::size_type
i = 0;
i < aUnions.size(); ++
i )
763 const bool bLast = (
i == aUnions.size() - 1);
765 std::vector<SwCellFrame*> aCellArr;
766 aCellArr.reserve( 255 );
777 for (
auto pCell : aCellArr )
781 bool bTopOver, bLeftOver, bRightOver, bBottomOver;
784 bTopOver = pCell->getFrameArea().Right() >= rUnion.
Right();
785 bLeftOver = pCell->getFrameArea().Top() <= rUnion.
Top();
786 bRightOver = pCell->getFrameArea().Bottom() >= rUnion.
Bottom();
787 bBottomOver = pCell->getFrameArea().Left() <= rUnion.
Left();
791 bTopOver = pCell->getFrameArea().Top() <= rUnion.
Top();
792 bLeftOver = pCell->getFrameArea().Left() <= rUnion.
Left();
793 bRightOver = pCell->getFrameArea().Right() >= rUnion.
Right();
794 bBottomOver = pCell->getFrameArea().Bottom() >= rUnion.
Bottom();
798 std::swap( bLeftOver, bRightOver );
801 if ( pTab->IsFollow() &&
804 pCell->IsInFollowFlowRow() ) )
807 SvxBoxItem aBox( pCell->GetFormat()->GetBox() );
814 if ( bFirst && bTopOver )
816 aBox.
SetLine( pTop, SvxBoxItemLine::TOP );
819 else if ( bHoriValid )
821 aBox.
SetLine(
nullptr, SvxBoxItemLine::TOP );
829 if( bLeftOver && bRightOver)
833 aBox.
SetLine( pLeft, SvxBoxItemLine::RIGHT );
838 aBox.
SetLine( pRight, SvxBoxItemLine::LEFT );
846 aBox.
SetLine( bRightOver ? pLeft :
nullptr, SvxBoxItemLine::RIGHT );
856 aBox.
SetLine( pRight, SvxBoxItemLine::LEFT );
860 else if ( bVertValid )
862 aBox.
SetLine( pVert, SvxBoxItemLine::LEFT );
874 aBox.
SetLine( pLeft, SvxBoxItemLine::LEFT );
878 else if( bVertValid )
880 aBox.
SetLine( pVert, SvxBoxItemLine::LEFT );
889 aBox.
SetLine( pRight, SvxBoxItemLine::RIGHT );
892 else if ( bVertValid )
894 aBox.
SetLine(
nullptr, SvxBoxItemLine::RIGHT );
901 if ( bLast && bBottomOver )
905 aBox.
SetLine( pBottom, SvxBoxItemLine::BOTTOM );
909 else if( bHoriValid )
911 aBox.
SetLine( pHori, SvxBoxItemLine::BOTTOM );
923 if (
nullptr != pNewFormat )
930 aFormatCmp.push_back(std::make_unique<SwTableFormatCmp>(pOld, pNew,
nType));
951 const Color *pColor,
const SvxBorderLine *pBorderLine)
957 Color aTmp( pToSet->GetColor() );
958 *pToSet = *pBorderLine;
959 pToSet->SetColor( aTmp );
962 *pToSet = *pBorderLine;
965 pToSet->SetColor( *pColor );
969 const Color* pColor,
bool bSetLine,
970 const SvxBorderLine* pBorderLine )
983 if( aUnions.empty() )
992 SvxBorderLine aDefaultBorder(pBorderLine ? *pBorderLine
994 if (pColor && pBorderLine)
995 aDefaultBorder.SetColor(*pColor);
997 for(
auto &rU : aUnions )
1001 std::vector<SwCellFrame*> aCellArr;
1002 aCellArr.reserve( 255 );
1005 for (
auto pCell : aCellArr )
1008 if ( pTab->IsFollow() && pTab->
IsInHeadline( *pCell ) )
1011 const_cast<SwTableBox*
>(pCell->GetTabBox())->ClaimFrameFormat();
1013 std::unique_ptr<SvxBoxItem> aBox(pFormat->
GetBox().
Clone());
1015 SvxBorderLine* pTop = aBox->GetTop();
1016 SvxBorderLine* pBot = aBox->GetBottom();
1017 SvxBorderLine* pLeft = aBox->GetLeft();
1018 SvxBorderLine* pRight = aBox->GetRight();
1020 if ( !pBorderLine && bSetLine )
1024 else if ((pColor || pBorderLine) && !pTop && !pBot && !pLeft && !pRight)
1026 aBox->SetLine(&aDefaultBorder, SvxBoxItemLine::TOP);
1027 aBox->SetLine(&aDefaultBorder, SvxBoxItemLine::BOTTOM);
1028 aBox->SetLine(&aDefaultBorder, SvxBoxItemLine::LEFT);
1029 aBox->SetLine(&aDefaultBorder, SvxBoxItemLine::RIGHT);
1072 if( aUnions.empty() )
1078 bool bTopSet =
false,
1084 bDistanceSet =
false,
1089 for ( SwSelUnions::size_type
i = 0;
i < aUnions.size(); ++
i )
1094 const bool bFirst =
i == 0;
1095 const bool bLast = (
i == aUnions.size() - 1);
1097 std::vector<SwCellFrame*> aCellArr;
1098 aCellArr.reserve(255);
1101 for (
auto pCell : aCellArr )
1105 bool bTopOver, bLeftOver, bRightOver, bBottomOver;
1108 bTopOver = pCell->getFrameArea().Right() >= rUnion.
Right();
1109 bLeftOver = pCell->getFrameArea().Top() <= rUnion.
Top();
1110 bRightOver = pCell->getFrameArea().Bottom() >= rUnion.
Bottom();
1111 bBottomOver = pCell->getFrameArea().Left() <= rUnion.
Left();
1115 bTopOver = pCell->getFrameArea().Top() <= rUnion.
Top();
1116 bLeftOver = pCell->getFrameArea().Left() <= rUnion.
Left();
1117 bRightOver = pCell->getFrameArea().Right() >= rUnion.
Right();
1118 bBottomOver = pCell->getFrameArea().Bottom() >= rUnion.
Bottom();
1122 std::swap( bLeftOver, bRightOver );
1128 if ( bFirst && bTopOver )
1130 if (aSetBoxInfo.
IsValid(SvxBoxInfoItemValidFlags::TOP))
1140 aSetBoxInfo.
SetValid(SvxBoxInfoItemValidFlags::TOP,
false );
1141 aSetBox.
SetLine(
nullptr, SvxBoxItemLine::TOP );
1149 if (aSetBoxInfo.
IsValid(SvxBoxInfoItemValidFlags::LEFT))
1159 aSetBoxInfo.
SetValid(SvxBoxInfoItemValidFlags::LEFT,
false );
1160 aSetBox.
SetLine(
nullptr, SvxBoxItemLine::LEFT );
1166 if (aSetBoxInfo.
IsValid(SvxBoxInfoItemValidFlags::VERT))
1175 { aSetBoxInfo.
SetValid( SvxBoxInfoItemValidFlags::VERT,
false );
1176 aSetBoxInfo.
SetLine(
nullptr, SvxBoxInfoItemLine::VERT );
1182 if ( aSetBoxInfo.
IsValid(SvxBoxInfoItemValidFlags::RIGHT) && bRightOver )
1191 { aSetBoxInfo.
SetValid( SvxBoxInfoItemValidFlags::RIGHT,
false );
1192 aSetBox.
SetLine(
nullptr, SvxBoxItemLine::RIGHT );
1197 if ( bLast && bBottomOver )
1199 if ( aSetBoxInfo.
IsValid(SvxBoxInfoItemValidFlags::BOTTOM) )
1202 { bBottomSet =
true;
1208 { aSetBoxInfo.
SetValid( SvxBoxInfoItemValidFlags::BOTTOM,
false );
1209 aSetBox.
SetLine(
nullptr, SvxBoxItemLine::BOTTOM );
1217 if (aSetBoxInfo.
IsValid(SvxBoxInfoItemValidFlags::HORI))
1227 aSetBoxInfo.
SetValid( SvxBoxInfoItemValidFlags::HORI,
false );
1228 aSetBoxInfo.
SetLine(
nullptr, SvxBoxInfoItemLine::HORI );
1234 if (aSetBoxInfo.
IsValid(SvxBoxInfoItemValidFlags::DISTANCE))
1238 bDistanceSet =
true;
1248 aSetBoxInfo.
SetValid( SvxBoxInfoItemValidFlags::DISTANCE,
false );
1267 aTempBoxInfo.
SetValid( SvxBoxInfoItemValidFlags::LEFT, aSetBoxInfo.
IsValid(SvxBoxInfoItemValidFlags::LEFT) );
1268 aSetBoxInfo.
SetValid( SvxBoxInfoItemValidFlags::LEFT, aSetBoxInfo.
IsValid(SvxBoxInfoItemValidFlags::RIGHT) );
1269 aSetBoxInfo.
SetValid( SvxBoxInfoItemValidFlags::RIGHT, aTempBoxInfo.
IsValid(SvxBoxInfoItemValidFlags::LEFT) );
1289 std::vector<std::unique_ptr<SwTableFormatCmp>> aFormatCmp;
1290 aFormatCmp.reserve(std::max<size_t>(255, aBoxes.
size()));
1291 for (
size_t i = 0;
i < aBoxes.
size(); ++
i)
1296 if (
nullptr != pNewFormat )
1303 aFormatCmp.push_back(std::make_unique<SwTableFormatCmp>(pOld, pNew, 0));
1324 assert(rToFill &&
"requires object here");
1331 bool bOneFound =
false;
1332 const sal_uInt16 nWhich = rToFill->Which();
1333 for (
size_t i = 0;
i < aBoxes.
size(); ++
i)
1339 std::unique_ptr<SvxBrushItem> xBack =
1340 aBoxes[
i]->GetFrameFormat()->makeBackgroundBrushItem();
1343 rToFill = std::move(xBack);
1346 else if( *rToFill != *xBack )
1354 aBoxes[
i]->GetFrameFormat()->GetFrameDir();
1357 rToFill.reset(rDir.
Clone());
1360 else if( rToFill && *rToFill != rDir )
1367 aBoxes[
i]->GetFrameFormat()->GetVertOrient();
1370 rToFill.reset(rOrient.
Clone());
1373 else if( rToFill && *rToFill != rOrient )
1389 nAlign == text::VertOrientation::CENTER ||
1390 nAlign == text::VertOrientation::BOTTOM,
"Wrong alignment" );
1397 sal_uInt16 nAlign = USHRT_MAX;
1402 for (
size_t i = 0;
i < aBoxes.
size(); ++
i)
1405 aBoxes[
i]->GetFrameFormat()->GetVertOrient();
1406 if( USHRT_MAX == nAlign )
1433 nRet = std::max( nRet, nCalcFitToContent + nAdd );
1443 return o3tl::narrowing<sal_uInt16>(std::max(
SwTwips(
MINLAY), nRet ));
1463 const sal_uInt16 nWish = bWishValues ?
1469 for (
size_t i = 0 ;
i <= rCols.
Count(); ++
i )
1488 if ( nColLeft <= nCellLeft && nColRight >= (nCellLeft+
COLFUZZY) )
1489 nWidth = nColRight - nCellLeft;
1490 else if ( nColLeft <= (nCellRight-
COLFUZZY) && nColRight >= nCellRight )
1491 nWidth = nCellRight - nColLeft;
1492 else if ( nColLeft >= nCellLeft && nColRight <= nCellRight )
1493 nWidth = nColRight - nColLeft;
1498 rToFill[
i] = sal_uInt16(nTmp);
1529 for (
auto &rU : aUnions )
1548 bool bNotInCols =
true;
1550 for (
size_t i = 0;
i <= rCols.
Count(); ++
i )
1552 sal_uInt16 nFit = rToFill[
i];
1559 nColRight = rCols.
GetRight() - nColLeft;
1560 nColLeft = rCols.
GetRight() - nTmpRight;
1589 if ( !nFit || nMin < nFit )
1592 if ( rToFill[
i] < nFit )
1602 }
while ( pCell && pTab->
IsAnLower( pCell ) );
1607 const bool bBalance,
1608 const bool bNoShrink )
1630 if ( ! aTabCols.
Count() )
1633 std::vector<sal_uInt16> aWish(aTabCols.
Count() + 1);
1634 std::vector<sal_uInt16> aMins(aTabCols.
Count() + 1);
1646 sal_uInt16 nSelectedWidth = 0, nCols = 0;
1647 float fTotalWish = 0;
1648 if ( bBalance || bNoShrink )
1651 for (
size_t i = 0;
i <= aTabCols.
Count(); ++
i )
1656 nSelectedWidth += aTabCols[
i] - aTabCols.
GetLeft();
1657 else if (
i == aTabCols.
Count() )
1658 nSelectedWidth += aTabCols.
GetRight() - aTabCols[
i-1];
1660 nSelectedWidth += aTabCols[
i] - aTabCols[
i-1];
1663 fTotalWish += aWish[
i];
1669 const sal_uInt16 nEqualWidth = nCols ? nSelectedWidth / nCols : 0;
1670 for (sal_uInt16 & rn : aWish)
1686 const sal_uInt16 nEqualWidth = (nMaxRight - aTabCols.
GetLeft()) / (aTabCols.
Count() + 1);
1687 const sal_Int16 nTablePadding = nSelectedWidth - fTotalWish;
1688 for (
int k = 0; k < 2; ++k )
1690 for (
size_t i = 0;
i <= aTabCols.
Count(); ++
i )
1693 if ( bNoShrink && k && nTablePadding > 0 && fTotalWish > 0 )
1694 aWish[
i] +=
round( aWish[
i] / fTotalWish * nTablePadding );
1699 int nDiff = k ? aWish[
i] :
std::min(aWish[
i], nEqualWidth);
1702 int nMin = aMins[
i];
1708 if( aTabCols.
Count() )
1709 nDiff -= aTabCols[0] - aTabCols.
GetLeft();
1713 else if (
i == aTabCols.
Count() )
1714 nDiff -= aTabCols.
GetRight() - aTabCols[
i-1];
1716 nDiff -= aTabCols[
i] - aTabCols[
i-1];
1722 if (!bBalance && nTabRight > nMaxRight)
1730 for (
size_t i2 =
i; i2 < aTabCols.Count(); ++i2 )
1731 aTabCols[i2] += nDiff;
1732 aTabCols.SetRight( nTabRight );
1756 if( !bBalance && nNewRight < nOldRight )
const FndLines_t & GetLines() const
const SwTableBox * GetBox() const
const FndBoxes_t & GetBoxes() const
virtual bool DeleteAndJoin(SwPaM &, SwDeleteFlags flags=SwDeleteFlags::Default)=0
complete delete of a given PaM
virtual bool InsertString(const SwPaM &rRg, const OUString &, const SwInsertFlags nInsertMode=SwInsertFlags::EMPTYEXPAND)=0
Insert string into existing text node at position rRg.Point().
virtual const SwRootFrame * GetCurrentLayout() const =0
virtual std::size_t GetRedlineAuthor()=0
virtual void SetRedlineFlags_intern(RedlineFlags eMode)=0
Set a new redline mode.
virtual const SwRedlineTable & GetRedlineTable() const =0
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
virtual void SetModified()=0
Must be called manually at changes of format.
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
static const sal_Int16 VeryThin
bool IsValid(SvxBoxInfoItemValidFlags nValid) const
const editeng::SvxBorderLine * GetHori() const
const editeng::SvxBorderLine * GetVert() const
void SetValid(SvxBoxInfoItemValidFlags nValid, bool bValid=true)
void SetLine(const editeng::SvxBorderLine *pNew, SvxBoxInfoItemLine nLine)
const editeng::SvxBorderLine * GetTop() const
virtual SvxBoxItem * Clone(SfxItemPool *pPool=nullptr) const override
const editeng::SvxBorderLine * GetRight() const
void SetLine(const editeng::SvxBorderLine *pNew, SvxBoxItemLine nLine)
const editeng::SvxBorderLine * GetLeft() const
sal_Int16 GetDistance(SvxBoxItemLine nLine, bool bAllowNegative=false) const
void SetDistance(sal_Int16 nNew, SvxBoxItemLine nLine)
const editeng::SvxBorderLine * GetBottom() const
void SetAllDistances(sal_Int16 nNew)
virtual SvxFrameDirectionItem * Clone(SfxItemPool *pPool=nullptr) const override
tools::Long GetHeight() const
void SetHeight(tools::Long n)
SwCellFrame is one table cell in the document layout.
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
void SetRowHeight(const SwCursor &rCursor, const SwFormatFrameSize &rNew)
void SetTabLineStyle(const SwCursor &rCursor, const Color *pColor, bool bSetLine, const editeng::SvxBorderLine *pBorderLine)
static sal_uInt16 GetBoxAlign(const SwCursor &rCursor)
void SetRowSplit(const SwCursor &rCursor, const SwFormatRowSplit &rNew)
IDocumentState const & getIDocumentState() const
bool BalanceRowHeight(const SwCursor &rCursor, bool bTstOnly, const bool bOptimize)
Adjustment of Rowheights.
static bool GetRowBackground(const SwCursor &rCursor, std::unique_ptr< SvxBrushItem > &rToFill)
static bool GetBoxAttr(const SwCursor &rCursor, std::unique_ptr< SfxPoolItem > &rToFill)
Retrieves a box attribute from the given cursor.
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
static std::unique_ptr< SwFormatFrameSize > GetRowHeight(const SwCursor &rCursor)
void SetRowNotTracked(const SwCursor &rCursor, const SvxPrintItem &rNotTracked, bool bAll=false, bool bIns=false)
rNotTracked = false means that the row was deleted or inserted with its tracked cell content bAll: de...
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
static std::unique_ptr< SwFormatRowSplit > GetRowSplit(const SwCursor &rCursor)
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
void SetTabCols(const SwTabCols &rNew, bool bCurRowOnly, const SwCellFrame *pBoxFrame)
static void GetTabCols(SwTabCols &rFill, const SwCellFrame *pBoxFrame)
void SetTabBorders(const SwCursor &rCursor, const SfxItemSet &rSet)
void SetBoxAlign(const SwCursor &rCursor, sal_uInt16 nAlign)
void AdjustCellWidth(const SwCursor &rCursor, const bool bBalance, const bool bNoShrink)
Adjusts selected cell widths in such a way, that their content does not need to be wrapped (if possib...
static bool HasRowNotTracked(const SwCursor &rCursor)
don't call SetRowNotTracked() for rows with tracked row change
void SetBoxAttr(const SwCursor &rCursor, const SfxPoolItem &rNew)
void SetRowBackground(const SwCursor &rCursor, const SvxBrushItem &rNew)
static void GetTabBorders(const SwCursor &rCursor, SfxItemSet &rSet)
const SwRect & getFrameArea() const
const SwRect & getFramePrintArea() const
Base class of the Writer layout elements.
SwTabFrame * FindTabFrame()
SwTabFrame * ImplFindTabFrame()
bool IsRightToLeft() const
SwLayoutFrame * GetUpper()
const SwLayoutFrame * GetNextLayoutLeaf() const
sal_uInt16 GetBrowseWidthByTabFrame(const SwTabFrame &rTabFrame) const
Calculates available width by table-frame.
bool Resize(sal_uInt16 nAbsAvail, bool bRecalc=false, bool bForce=false, sal_uLong nDelay=0)
Recalculation of table widths for available width that has been passed.
void BordersChanged(sal_uInt16 nAbsAvail)
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame.
const SwCellFrame * FirstCell() const
Calls ContainsAny first to reach the innermost cell.
bool IsAnLower(const SwFrame *) const
const SwFrame * Lower() const
Marks a node in the document model.
Base class of the Writer document model elements.
SwNodeOffset GetIndex() const
const SwStartNode * FindTableBoxStartNode() const
SwTableNode * FindTableNode()
Search table node, in which it is.
SwContentNode * GetContentNode()
PaM is Point and Mark: a selection of the document model.
SwNode & GetPointNode() const
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
SwContentNode * GetPointContentNode() const
SwContentNode * GetMarkContentNode() const
const SwPosition * GetPoint() const
RedlineType GetType(sal_uInt16 nPos=0) const
const SwRedlineData & GetRedlineData(sal_uInt16 nPos=0) const
tools::Long GetWidth(const SwRect &rRect) const
tools::Long GetLeft(const SwRect &rRect) const
tools::Long GetRight(const SwRect &rRect) const
Of course Writer needs its own rectangles.
void Height(tools::Long nNew)
void Top(const tools::Long nTop)
void Right(const tools::Long nRight)
void Bottom(const tools::Long nBottom)
bool Overlaps(const SwRect &rRect) const
void Left(const tools::Long nLeft)
void Width(tools::Long nNew)
std::size_t GetAuthor() const
static constexpr size_type npos
vector_type::size_type size_type
const SwRect & GetUnion() const
const SwTabFrame * GetTable() const
Represents the current text cursor of one opened edit window.
const Point & GetPtPos() const
const Point & GetMkPos() const
tools::Long GetLeft() const
tools::Long GetLeftMin() const
tools::Long GetRight() const
tools::Long GetRightMax() const
SwTabFrame is one table in the document layout, containing rows (which contain cells).
SwFrame * FindLastContentOrTable()
bool IsInHeadline(const SwFrame &rFrame) const
SwTableBox is one table cell in the document model.
SwFrameFormat * GetFrameFormat()
SwTableLines & GetTabLines()
void SetDirectFormatting(bool bDirect)
Set that this table box contains formatting that is not set by the table style.
void ChgFrameFormat(SwTableBoxFormat *pNewFormat, bool bNeedToReregister=true)
SwFrameFormat * ClaimFrameFormat()
SwTableLine is one table row in the document model.
SwFrameFormat * GetFrameFormat()
void ChgFrameFormat(SwTableLineFormat *pNewFormat)
SwFrameFormat * ClaimFrameFormat()
SwTableBoxes & GetTabBoxes()
iterator insert(iterator aIt, SwTableLine *pLine)
const SwTable & GetTable() const
SwTable is one table in the document model, containing rows (which contain cells).
SwTableLines & GetTabLines()
SwTableFormat * GetFrameFormat()
SwHTMLTableLayout * GetHTMLTableLayout()
Represents the visualization of a paragraph.
SwTwips CalcFitToContent()
Simulates a formatting as if there were not right margin or Flys or other obstacles and returns the w...
std::pair< const_iterator, bool > insert(Value &&x)
void ClearFEShellTabCols(SwDoc &rDoc, SwTabFrame const *const pFrame)
@ Minimum
Value in Var-direction gives minimum (can be exceeded but not be less).
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(126)
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(108)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(112)
#define CH_TXT_TRACKED_DUMMY_CHAR
constexpr TypedWhichId< SvxPrintItem > RES_PRINT(104)
const SfxPoolItem * GetDfltAttr(sal_uInt16 nWhich)
Get the default attribute from corresponding default attribute table.
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
css::uno::Reference< css::animations::XAnimationNode > Clone(const css::uno::Reference< css::animations::XAnimationNode > &xSourceNode, const SdPage *pSource=nullptr, const SdPage *pTarget=nullptr)
static void lcl_GetStartEndCell(const SwCursor &rCursor, SwLayoutFrame *&prStart, SwLayoutFrame *&prEnd)
static bool lcl_GetBoxSel(const SwCursor &rCursor, SwSelBoxes &rBoxes, bool bAllCursor=false)
static bool FindBox_(FndBox_ &rBox, LinesAndTable *pPara)
static void InsertLine(std::vector< SwTableLine * > &rLineArr, SwTableLine *pLine)
static void lcl_CalcColValues(std::vector< sal_uInt16 > &rToFill, const SwTabCols &rCols, const SwLayoutFrame *pStart, const SwLayoutFrame *pEnd, bool bWishValues)
Retrieves new values to set the TabCols.
static bool IsSame(tools::Long nA, tools::Long nB)
static void lcl_CollectCells(std::vector< SwCellFrame * > &rArr, const SwRect &rUnion, SwTabFrame *pTab)
static sal_uInt16 lcl_CalcCellFit(const SwLayoutFrame *pCell)
static bool lcl_IsAnLower(const SwTableLine *pLine, const SwTableLine *pAssumed)
static void lcl_SetLineStyle(SvxBorderLine *pToSet, const Color *pColor, const SvxBorderLine *pBorderLine)
static bool FindLine_(FndLine_ &rLine, LinesAndTable *pPara)
static void lcl_CollectLines(std::vector< SwTableLine * > &rArr, const SwCursor &rCursor, bool bRemoveLines)
static void InsertCell(std::vector< SwCellFrame * > &rCellArr, SwCellFrame *pCellFrame)
static void lcl_ProcessBoxSize(std::vector< std::unique_ptr< SwTableFormatCmp > > &rFormatCmp, SwTableBox *pBox, const SwFormatFrameSize &rNew)
static void lcl_ProcessRowAttr(std::vector< std::unique_ptr< SwTableFormatCmp > > &rFormatCmp, SwTableLine *pLine, const SfxPoolItem &rNew)
static void lcl_CalcSubColValues(std::vector< sal_uInt16 > &rToFill, const SwTabCols &rCols, const SwLayoutFrame *pCell, const SwLayoutFrame *pTab, bool bWishValues)
static void lcl_ProcessRowSize(std::vector< std::unique_ptr< SwTableFormatCmp > > &rFormatCmp, SwTableLine *pLine, const SwFormatFrameSize &rNew)
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
SwNodeOffset abs(const SwNodeOffset &a)
std::vector< SwTableBox * > SwTableBoxes
void ForEach_FndLineCopyCol(SwTableLines &rLines, FndPara *pFndPara)
This creates a structure mirroring the SwTable structure that contains all rows and non-leaf boxes (a...
void GetTableSelCrs(const SwCursorShell &rShell, SwSelBoxes &rBoxes)
void MakeSelUnions(SwSelUnions &rUnions, const SwLayoutFrame *pStart, const SwLayoutFrame *pEnd, const SwTableSearchType eSearchType)
bool IsFrameInTableSel(const SwRect &rUnion, const SwFrame *pCell)
std::vector< SwSelUnion > SwSelUnions