40#include <osl/diagnose.h>
47 #define ERROR_PREFIX "redline table corrupted: "
54 void lcl_CheckPosition(
const SwPosition* pPos )
56 assert(
dynamic_cast<SwContentIndexReg*
>(&pPos->
GetNode())
60 if( pTextNode ==
nullptr )
70 void lcl_CheckPam(
const SwPaM* pPam )
73 lcl_CheckPosition( pPam->
GetPoint() );
74 lcl_CheckPosition( pPam->
GetMark() );
92 OSL_ENSURE( ( *(j->GetPoint()) != *(j->GetMark()) ) ||
93 ( j->GetContentIdx() !=
nullptr ),
98 for(
size_t n = 1;
n < rTable.
size(); ++
n )
116 #define CHECK_REDLINE( pDoc ) lcl_CheckRedline( pDoc );
120 #define CHECK_REDLINE( pDoc )
132 pAuthType->DelSequenceArray();
158 if ( !pTableOrSectionNode )
160 SAL_WARN(
"sw.core",
"UpdateFramesForAddDeleteRedline:: known pathology (or ChangesInRedline mode)");
163 for (
SwNodeOffset j = pTableOrSectionNode->
GetIndex(); j <= pTableOrSectionNode->EndOfSectionIndex(); ++j)
169 if (pLayout->HasMergedParas())
173 static_cast<SwTableNode*
>(pTableOrSectionNode)->DelFrames(pLayout);
177 static_cast<SwSectionNode*
>(pTableOrSectionNode)->DelFrames(pLayout);
184 if (currentStart < *rPam.
End())
195 std::vector<SwTextFrame*> frames;
199 if (pFrame->getRootFrame()->HasMergedParas())
201 frames.push_back(pFrame);
204 pFrame->SetDrawObjsAsDeleted(
true);
209 assert(std::none_of(layouts.begin(), layouts.end(),
210 [](
SwRootFrame const*
const pLayout) { return pLayout->IsHideRedlines(); }));
218 SwTextNode & rFirstNode(pFrame->GetMergedPara()
219 ? *pFrame->GetMergedPara()->pFirstNode
221 assert(pNode == pStartNode
223 : &rFirstNode == pNode);
225 pFrame->SetMergedPara(
nullptr);
227 *pFrame, rFirstNode,
eMode));
233 if (pFrame->GetMergedPara())
235 pLast =
const_cast<SwTextNode*
>(pFrame->GetMergedPara()->pLastNode);
259 bool isAppendObjsCalled(
false);
270 assert(pTableOrSectionNode);
271 for (
SwNodeOffset j = pTableOrSectionNode->
GetIndex(); j <= pTableOrSectionNode->EndOfSectionIndex(); ++j)
280 isAppendObjsCalled =
true;
285 if (currentStart < *rPam.
End())
296 std::vector<SwTextFrame*> frames;
300 if (pFrame->getRootFrame()->HasMergedParas())
302 frames.push_back(pFrame);
305 pFrame->SetDrawObjsAsDeleted(
false);
313 assert(std::none_of(layouts.begin(), layouts.end(),
314 [](
SwRootFrame const*
const pLayout) { return pLayout->IsHideRedlines(); }));
317 isAppendObjsCalled =
true;
333 if (
auto const pMergedPara = pFrame->GetMergedPara())
335 pLast =
const_cast<SwTextNode*
>(pMergedPara->pLastNode);
336 assert(pNode == pStartNode
338 : pMergedPara->pFirstNode == pNode);
340 SwTextNode & rFirstNode(*pMergedPara->pFirstNode);
341 pFrame->SetMergedPara(
nullptr);
343 *pFrame, rFirstNode,
eMode));
358 isAppendObjsCalled =
true;
371 if (!isAppendObjsCalled)
375 if (pLayout->HasMergedParas())
410 if (pToNode !=
nullptr && pFromNode !=
nullptr && pToNode != pFromNode)
412 const SwPaM aPam(*pToNode);
413 SwDoc& rDoc = aPam.GetDoc();
417 if (bCopy && pFromColl != pToColl)
432 bool bSameSet = aTmp == aTmp2;
436 for( sal_uInt16 nItem = 0; nItem < aTmp.TotalCount(); ++nItem)
438 sal_uInt16 nWhich = aTmp.GetWhichByPos(nItem);
439 if( SfxItemState::SET == aTmp.GetItemState( nWhich,
false ) &&
440 SfxItemState::SET != aTmp2.GetItemState( nWhich,
false ) )
441 aTmp2.Put( aTmp.GetPool()->GetDefaultItem(nWhich), nWhich );
445 if (bCopy && !bSameSet)
447 else if (!bCopy && (!bSameSet || pFromColl != pToColl))
454 void lcl_DeleteTrackedTableRow (
const SwPosition* pPos )
464 if ( pHasTextChangesOnlyProp && !pHasTextChangesOnlyProp->GetValue() )
482 void lcl_RemoveTrackingOfTableRow(
const SwPosition* pPos,
bool bRejectDeletion )
492 if ( pHasTextChangesOnlyProp && !pHasTextChangesOnlyProp->GetValue() )
494 bool bNoMoreInsertion =
false;
495 if ( !bRejectDeletion )
501 bNoMoreInsertion =
true;
503 if ( bRejectDeletion || bNoMoreInsertion )
519 SwPosition *pRStt =
nullptr, *pREnd =
nullptr;
521 if( pSttRng && pEndRng )
523 pRStt = pRedl->
Start();
524 pREnd = pRedl->
End();
532 case RedlineType::Insert:
533 case RedlineType::Format:
535 bool bCheck =
false, bReplace =
false;
539 if( *pSttRng == *pRStt )
543 if( *pEndRng != *pREnd )
548 rArr.
Insert( pNew ); ++rPos;
550 pRedl->
SetEnd( *pSttRng, pREnd );
561 pRedl->
SetEnd( *pSttRng, pREnd );
568 bool bInsert = RedlineType::Insert == pRedl->
GetType();
574 lcl_RemoveTrackingOfTableRow( &aPos,
false );
590 case RedlineType::Delete:
593 const SwPosition *pDelStt =
nullptr, *pDelEnd =
nullptr;
594 bool bDelRedl =
false;
627 pDelStt = pRedl->
Start();
628 pDelEnd = pRedl->
End();
636 if( pDelStt && pDelEnd )
638 SwPaM aPam( *pDelStt, *pDelEnd );
641 pRStt = pRedl->
Start();
642 pREnd = pRedl->
End();
645 if( pCSttNd && pCEndNd && pRStt && pREnd && pRStt->
GetContentIndex() == 0 )
646 lcl_CopyStyle(*pREnd, *pRStt);
654 if( pCSttNd && pCEndNd )
657 lcl_DeleteTrackedTableRow( aPam.End() );
659 else if (pCSttNd && !pCEndNd)
661 aPam.GetBound().nContent.Assign(
nullptr, 0 );
662 aPam.GetBound(
false ).nContent.Assign(
nullptr, 0 );
676 case RedlineType::FmtColl:
680 case RedlineType::ParagraphFormat:
698 SwPosition *pRStt =
nullptr, *pREnd =
nullptr;
700 if( pSttRng && pEndRng )
702 pRStt = pRedl->
Start();
703 pREnd = pRedl->
End();
711 case RedlineType::Insert:
713 const SwPosition *pDelStt =
nullptr, *pDelEnd =
nullptr;
714 bool bDelRedl =
false;
747 pDelStt = pRedl->
Start();
748 pDelEnd = pRedl->
End();
756 if( pDelStt && pDelEnd )
758 SwPaM aPam( *pDelStt, *pDelEnd );
769 if( pCSttNd && pCEndNd )
772 lcl_DeleteTrackedTableRow( aPam.End() );
774 else if (pCSttNd && !pCEndNd)
776 aPam.GetBound().nContent.Assign(
nullptr, 0 );
777 aPam.GetBound(
false ).nContent.Assign(
nullptr, 0 );
778 if (aPam.End()->GetNode().IsStartNode())
782 assert(!aPam.End()->GetNode().IsStartNode());
795 case RedlineType::Delete:
798 bool bCheck =
false, bReplace =
false;
799 SwPaM const updatePaM(pSttRng ? *pSttRng : *pRedl->
Start(),
800 pEndRng ? *pEndRng : *pRedl->
End());
806 lcl_RemoveTrackingOfTableRow( updatePaM.End(),
true );
817 if( *pSttRng == *pRStt )
826 if( *pEndRng != *pREnd )
831 rArr.
Insert( pCpy ); ++rPos;
836 pRedl->
SetEnd( *pSttRng, pREnd );
862 pRedl->
SetEnd( *pSttRng, pREnd );
881 rArr.
Insert( pNew ); ++rPos;
895 case RedlineType::Format:
896 case RedlineType::FmtColl:
897 case RedlineType::ParagraphFormat:
904 if ( pRedl->
GetType() == RedlineType::Format )
909 else if ( pRedl->
GetType() == RedlineType::ParagraphFormat )
922 constexpr std::pair<sal_uInt16, sal_uInt16> aResetableSetRange[] = {
927 for (
const auto& [nBegin, nEnd] : aResetableSetRange)
929 for (sal_uInt16 i = nBegin;
i <= nEnd; ++
i)
930 aResetAttrsArray.
insert( i );
933 rDoc.
ResetAttrs(aPam,
false, aResetAttrsArray);
960 int lcl_AcceptRejectRedl( Fn_AcceptReject fn_AcceptReject,
971 ( *pFnd->
Start() != *pStt || *pFnd->
End() > *pEnd ))
974 if( (*fn_AcceptReject)( rArr, n, bCallDelete, pStt, pEnd ))
981 bool bHasParagraphFormatChange =
false;
982 for(
int m = 0 ;
m < 2 && !bHasParagraphFormatChange; ++
m )
989 if( *pTmp->
End() <= *pEnd )
991 if( (m > 0 || RedlineType::ParagraphFormat == pTmp->
GetType()) &&
992 (*fn_AcceptReject)( rArr, o, bCallDelete,
nullptr,
nullptr ))
994 bHasParagraphFormatChange =
true;
1000 if( *pTmp->
Start() < *pEnd )
1003 if( (m > 0 || RedlineType::ParagraphFormat == pTmp->
GetType()) &&
1004 (*fn_AcceptReject)( rArr, o, bCallDelete, pStt, pEnd ))
1006 bHasParagraphFormatChange =
true;
1018 void lcl_AdjustRedlineRange(
SwPaM& rPam )
1023 auto [pStt, pEnd] = rPam.
StartEnd();
1037 if( pEnd->GetNode().IsContentNode() &&
1038 !rDoc.
GetNodes()[ pEnd->GetNodeIndex() + 1 ]->IsContentNode() &&
1039 pEnd->GetContentIndex() == pEnd->GetNode().GetContentNode()->Len() )
1046 pEnd->GetNodeIndex() + 1 )
1054 class TemporaryRedlineUpdater
1058 std::shared_ptr<SwUnoCursor> m_pCursor;
1061 : m_rRedline(rRedline)
1062 , m_pCursor(rDoc.CreateUnoCursor(*rRedline.GetPoint(), false))
1067 *m_pCursor->GetMark() = *m_rRedline.
GetMark();
1072 ~TemporaryRedlineUpdater()
1074 static_cast<SwPaM&
>(m_rRedline) = *m_pCursor;
1085 , mbIsRedlineMove(false)
1086 , mnAutoFormatRedlnCommentNo(0)
1136 if (pLayout->IsHideRedlines())
1138 pLayout->SetHideRedlines(
false);
1139 hiddenLayouts.
insert(pLayout);
1144 for (sal_uInt16 nLoop = 1; nLoop <= 2; ++nLoop)
1148 (pRedline->*pFnc)(nLoop,
i,
false);
1165 pLayout->SetHideRedlines(
true);
1265 if( bCallDelete && RedlineType::Delete == pNewRedl->
GetType() )
1281 bool bMerged =
false;
1295 auto [pStt, pEnd] = pNewRedl->
StartEnd();
1298 if( pTextNode ==
nullptr )
1302 OSL_ENSURE(
false,
"Redline start: non-text-node with content" );
1310 OSL_ENSURE(
false,
"Redline start: index after text" );
1315 if( pTextNode ==
nullptr )
1317 if( pEnd->GetContentIndex() > 0 )
1319 OSL_ENSURE(
false,
"Redline end: non-text-node with content" );
1320 pEnd->SetContent(0);
1325 if( pEnd->GetContentIndex() > pTextNode->
Len() )
1327 OSL_ENSURE(
false,
"Redline end: index after text" );
1328 pEnd->SetContent( pTextNode->
Len() );
1332 if( ( *pStt == *pEnd ) &&
1338 bool bCompress =
false;
1351 auto [pRStt, pREnd] = pRedl->
StartEnd();
1354 if( ( *pRStt == *pREnd ) &&
1368 case RedlineType::Insert:
1371 case RedlineType::Insert:
1376 bool bDelete =
false;
1380 IsPrevPos( *pREnd, *pStt ) ) ||
1388 pRedl->
SetEnd( *pEnd, pREnd );
1400 IsPrevPos( *pEnd, *pRStt ) ) ||
1425 if( ( *pStt == *pEnd ) &&
1432 if( ( *pStt == *pEnd ) &&
1458 if( *pEnd != *pREnd )
1464 pRedl->
SetEnd( *pStt, pREnd );
1465 if( ( *pStt == *pRStt ) &&
1486 pSplit->
SetEnd( *pRStt );
1489 if( *pStt == *pEnd && pNewRedl->
GetContentIdx() ==
nullptr )
1505 if( ( *pStt == *pEnd ) &&
1514 case RedlineType::Delete:
1518 if( *pEnd != *pREnd )
1524 pRedl->
SetEnd( *pStt, pREnd );
1525 if( ( *pStt == *pRStt ) &&
1546 pSplit->
SetEnd( *pRStt );
1549 if( *pStt == *pEnd && pNewRedl->
GetContentIdx() ==
nullptr )
1568 case RedlineType::Format:
1580 pRedl->
SetEnd( *pStt, pREnd );
1599 if( *pEnd != *pREnd )
1601 if( *pEnd != *pRStt )
1605 pRedl->
SetEnd( *pStt, pREnd );
1614 pRedl->
SetEnd( *pStt, pREnd );
1625 case RedlineType::Delete:
1628 case RedlineType::Delete:
1635 if (*pEnd == *pREnd)
1637 pNewRedl->
SetEnd(*pRStt, pEnd);
1639 else if (*pStt == *pRStt)
1647 pNewRedl->
SetEnd( *pRStt, pEnd );
1670 pNewRedl->
SetStart( *pRStt, pStt );
1672 pNewRedl->
SetEnd( *pREnd, pEnd );
1677 pNewRedl->
SetStart( *pREnd, pStt );
1679 pNewRedl->
SetEnd( *pRStt, pEnd );
1684 && pRStt->
GetNode() != pREnd->GetNode())
1701 pRStt = pRedl->
Start();
1702 pREnd = pRedl->
End();
1708 pNewRedl->
SetStart( *pRStt, pStt );
1710 pNewRedl->
SetEnd( *pREnd, pEnd );
1717 if( *(pNewRedl->
Start()) <= *pREnd )
1738 case RedlineType::Insert:
1771 pEnd->GetNode().IsEndNode() )
1791 TemporaryRedlineUpdater
const u(
m_rDoc, *pNewRedl);
1801 SwPaM aPam( *pRStt, *pEnd );
1803 if( *pEnd == *pREnd )
1815 TemporaryRedlineUpdater
const u(
m_rDoc, *pNewRedl);
1825 SwPaM aPam( *pStt, *pREnd );
1827 if( *pStt == *pRStt )
1833 pRedl->
SetEnd( *pStt, pREnd );
1837 TemporaryRedlineUpdater
const u(
m_rDoc, *pNewRedl);
1875 if( *pRStt == *pStt )
1881 pNewRedl->
PushData( *pRedl,
false );
1891 pNewRedl->
PushData( *pRedl,
false );
1892 if( *pREnd != *pEnd )
1897 pRedl->
SetEnd( *pStt, pREnd );
1911 if( *pEnd == *pREnd )
1913 pNewRedl->
SetEnd( *pRStt, pEnd );
1915 else if (*pStt == *pRStt)
1923 pNewRedl->
SetStart( *pREnd, pStt );
1931 if( *pEnd == *pREnd )
1934 pNewRedl->
SetEnd( *pRStt, pEnd );
1947 pNewRedl->
SetEnd( *pRStt, pEnd );
1959 if( *pStt == *pRStt )
1962 pNewRedl->
SetStart( *pREnd, pStt );
1975 pNewRedl->
SetStart( *pREnd, pStt );
2008 case RedlineType::Format:
2020 pRedl->
SetEnd( *pStt, pREnd );
2034 if( *pEnd != *pREnd )
2036 if( *pEnd != *pRStt )
2040 pRedl->
SetEnd( *pStt, pREnd );
2041 if( ( *pStt == *pRStt ) &&
2050 pRedl->
SetEnd( *pStt, pREnd );
2061 case RedlineType::Format:
2064 case RedlineType::Insert:
2065 case RedlineType::Delete:
2069 pNewRedl->
SetEnd( *pRStt, pEnd );
2073 pNewRedl->
SetStart( *pREnd, pStt );
2085 if (*pEnd == *pREnd)
2087 pNewRedl->
SetEnd(*pRStt, pEnd);
2089 else if (*pStt == *pRStt)
2097 pNewRedl->
SetEnd( *pRStt, pEnd );
2107 case RedlineType::Format:
2128 else if( *pREnd == *pEnd )
2130 pRedl->
SetEnd( *pStt, pREnd );
2131 else if( *pRStt == *pStt )
2146 pRedl->
SetEnd( *pStt, pREnd );
2161 pNewRedl->
SetStart( *pRStt, pStt );
2163 pNewRedl->
SetEnd( *pREnd, pEnd );
2168 pNewRedl->
SetStart( *pREnd, pStt );
2170 pNewRedl->
SetEnd( *pRStt, pEnd );
2180 pNewRedl->
SetEnd( *pREnd, pEnd );
2194 pNewRedl->
SetStart( *pRStt, pStt );
2208 case RedlineType::FmtColl:
2219 if( ( *pStt == *pEnd ) &&
2227 if ( bCallDelete && RedlineType::Delete == pNewRedl->
GetType() )
2257 pNewRedl->
SetEnd( aPos );
2263 std::unique_ptr<SwRedlineExtraData_FormatColl> xRedlineExtraData;
2266 xRedlineExtraData.reset(pExtraData);
2272 if ( pExtraData || *pPar->
Start() != *pPar->
End() )
2279 lcl_CopyStyle(*pStt, aPos);
2329 while ( aSttIdx < aEndIdx )
2342 assert(ret || !pNewRedl);
2343 if (ret && !pNewRedl)
2355 return (
nullptr != pNewRedl)
2399 return nullptr != pNewRedl;
2441 return nullptr != pNewRedl;
2448 void (
SwRangeRedline::*pFnc)(sal_uInt16, size_t, bool) =
nullptr;
2456 if (nStartIndex == 0)
2462 auto [pPrevStt,pPrevEnd] = pPrev->
StartEnd();
2463 auto [pCurStt, pCurEnd] = pCur->StartEnd();
2465 if( *pPrevEnd == *pCurStt && pPrev->
CanCombine( *pCur ) &&
2466 pPrevStt->GetNode().StartOfSectionNode() ==
2467 pCurEnd->GetNode().StartOfSectionNode() &&
2468 !pCurEnd->GetNode().StartOfSectionNode()->IsTableNode() )
2472 pPrev->
Show(0, nPrevIndex);
2475 pPrev->
SetEnd( *pCur->End() );
2479 (pPrev->*pFnc)(0, nPrevIndex,
false);
2490 auto [pStt, pEnd] = rRange.
StartEnd();
2496 auto [pRedlineStart, pRedlineEnd] = pRedline->
StartEnd();
2497 if (*pRedlineStart <= *pStt && *pEnd <= *pRedlineEnd)
2501 if (*pStt == *pRedlineStart)
2503 if (*pEnd == *pRedlineEnd)
2511 pRedline->
SetEnd( *pStt, pRedlineEnd );
2516 *pRedlineStart = *pEnd;
2520 *pRedlineEnd = *pStt;
2538 else if (*pEnd < *pRedlineStart)
2557 if( pUndo->GetRedlSaveCount() )
2563 auto [pStt, pEnd] = rRange.
StartEnd();
2569 if( RedlineType::Any != nDelType && nDelType != pRedl->
GetType() )
2572 auto [pRStt, pREnd] = pRedl->
StartEnd();
2594 pRedl->
SetEnd( *pStt, pREnd );
2609 if( *pRStt == *pStt )
2621 if( *pREnd != *pEnd )
2629 pRedl->
SetEnd( *pStt, pREnd );
2689 return lhs->End()->GetNodeIndex() < nNdIdx;
2694 auto [pStart, pEnd] = pTmp->
StartEnd();
2696 nEnd = pEnd->GetNodeIndex();
2699 nStart <= nNdIdx && nNdIdx <= nEnd )
2702 if( nStart > nNdIdx )
2714 std::swap( nMk, nPt );
2717 nMk <= nNdIdx && nNdIdx <= nPt )
2747 if ( currentStart < *pTmp->
End() && *pTmp->
Start() <= currentEnd &&
2749 ( !bStartOrEndInRange ||
2750 ( currentStart < *pTmp->
Start() || *pTmp->
End() < currentEnd ) ) )
2767 nM = nU + ( nO - nU ) / 2;
2769 auto [pStt, pEnd] = pRedl->StartEnd();
2772 : ( *pStt <= rPos && rPos < *pEnd ) )
2784 if( RedlineType::Format == pRedl->GetType() )
2793 else if( ( nM + 1 ) <= nO && rPos >= *
maRedlineTable[ nM + 1 ]->Start() &&
2806 else if( *pEnd <= rPos )
2848 sal_uInt16 nSeqNo = pTmp->
GetSeqNo();
2855 std::make_unique<SwUndoAcceptRedline>(*pTmp) );
2880 }
while( nLoopCnt );
2909 lcl_AdjustRedlineRange( aPam );
2917 int nRet = lcl_AcceptRejectRedl( lcl_AcceptRedline,
maRedlineTable,
2918 bCallDelete, aPam );
2946 auto [pStt, pEnd] = rPam.
StartEnd();
2957 std::swap( nMk, nPt );
2959 if( RedlineType::ParagraphFormat == pTmp->
GetType() &&
2960 ( (nSttIdx <= nMk && nMk <= nEndIdx) || (nSttIdx <= nPt && nPt <= nEndIdx) ) )
2991 sal_uInt16 nSeqNo = pTmp->
GetSeqNo();
2998 std::make_unique<SwUndoRejectRedline>( *pTmp ) );
3023 }
while( nLoopCnt );
3052 lcl_AdjustRedlineRange( aPam );
3060 int nRet = lcl_AcceptRejectRedl( lcl_RejectRedline,
maRedlineTable,
3061 bCallDelete, aPam );
3090 bool bSuccess =
true;
3115 if (!sUndoStr.isEmpty())
3141 if( !pCNd || ( aTmp == rSttPos.
GetNode() &&
3146 rSttPos = *pFnd->
End();
3158 rSttPos = *pFnd->
End();
3179 pRStt = pTmp->
Start();
3180 if( *pPrevEnd == *pRStt || IsPrevPos( *pPrevEnd, *pRStt ) )
3182 pPrevEnd = pTmp->
End();
3183 rSttPos = *pPrevEnd;
3203 pPos->
Assign( *pCNd, 0 );
3240 }
while( bRestart );
3267 if( !pCNd || ( aTmp == rSttPos.
GetNode() &&
3272 rSttPos = *pFnd->
Start();
3278 while( !pFnd && 0 <
n )
3284 rSttPos = *pFnd->
Start();
3303 ( *pNextStt == *( pREnd = pTmp->
End() ) ||
3304 IsPrevPos( *pREnd, *pNextStt )) )
3306 pNextStt = pTmp->
Start();
3307 rSttPos = *pNextStt;
3345 pPos->
Assign( *pCNd, 0 );
3367 }
while( bRestart );
3378 auto [pStt, pEnd] = rPaM.
StartEnd();
3386 if( pStt != pEnd && *pTmp->
Start() > *pEnd )
3390 if( *pTmp->
End() >= *pEnd )
3405 return SW_MOD()->GetRedlineAuthor();
3411 return SW_MOD()->InsertRedlineAuthor(rNew);
3432 const uno::Sequence <sal_Int8>& rNewPassword)
3463 if ( pRedline->
GetType() == RedlineType::Delete )
3465 if ( bDeletion && pRedline->
IsVisible() )
3467 pRedline->
Hide(0, rTable.
GetPos(pRedline),
false);
3468 pRedline->
Hide(1, rTable.
GetPos(pRedline),
false);
3470 else if ( !bDeletion && !pRedline->
IsVisible() )
3472 pRedline->
Show(0, rTable.
GetPos(pRedline),
true);
3473 pRedline->
Show(1, rTable.
GetPos(pRedline),
true);
3476 else if ( pRedline->
GetType() == RedlineType::Insert )
3478 if ( !bDeletion && pRedline->
IsVisible() )
3483 else if ( bDeletion && !pRedline->
IsVisible() )
3485 pRedline->
Show(0, rTable.
GetPos(pRedline),
true);
3486 pRedline->
Show(1, rTable.
GetPos(pRedline),
true);
3500 pRedline->
Show(0, rTable.
GetPos(pRedline),
true);
3501 pRedline->
Show(1, rTable.
GetPos(pRedline),
true);
#define CHECK_REDLINE(pDoc)
@ ShowDelete
show all deletes
@ ShowInsert
show all inserts
virtual bool DeleteAndJoin(SwPaM &, SwDeleteFlags flags=SwDeleteFlags::Default)=0
complete delete of a given PaM
virtual void DeleteRange(SwPaM &)=0
Delete a range SwFlyFrameFormat.
virtual bool DelFullPara(SwPaM &)=0
Delete full paragraphs.
virtual void InsertItemSet(const SwPaM &rRg, const SfxItemSet &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr)=0
Document fields related interfaces.
virtual SwFieldType * GetSysFieldType(const SwFieldIds eWhich) const =0
virtual SwFieldType * GetFieldType(SwFieldIds nResId, const OUString &rName, bool bDbFieldMatching) const =0
virtual void UpdateRefFields()=0
virtual void UpdateExpFields(SwTextField *pField, bool bUpdateRefFields)=0
virtual const SwRootFrame * GetCurrentLayout() const =0
virtual bool IsRedlineOn() const =0
Query if redlining is on.
static bool IsShowOriginal(const RedlineFlags eM)
virtual void SetRedlineFlags_intern(RedlineFlags eMode)=0
Set a new redline mode.
virtual const SwRedlineTable & GetRedlineTable() const =0
virtual const SwRangeRedline * GetRedline(const SwPosition &rPos, SwRedlineTable::size_type *pFndPos) const =0
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
static bool IsHideChanges(const RedlineFlags eM)
virtual void SetModified()=0
Must be called manually at changes of format.
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
virtual sal_Int32 Len() const
IDocumentState const & getIDocumentState() const
o3tl::sorted_vector< SwRootFrame * > GetAllLayouts()
bool IsAutoFormatRedline() const
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
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
bool IsInXMLImport() const
void DelNumRules(const SwPaM &, SwRootFrame const *pLayout=nullptr)
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
SwFootnoteIdxs & GetFootnoteIdxs()
void SetInXMLImport(bool bNew)
void SetAutoFormatRedline(bool bFlag)
void ResetAttrs(const SwPaM &rRg, bool bTextAttr=true, const o3tl::sorted_vector< sal_uInt16 > &rAttrs=o3tl::sorted_vector< sal_uInt16 >(), const bool bSendDataChangedEvents=true, SwRootFrame const *pLayout=nullptr)
Reset attributes.
const SwAttrPool & GetAttrPool() const
void DeleteRow(const SwCursor &rCursor)
Deleting Columns/Rows.
const SwFrameFormats * GetSpzFrameFormats() const
bool SetTextFormatColl(const SwPaM &rRg, SwTextFormatColl *pFormat, const bool bReset=true, const bool bResetListAttrs=false, SwRootFrame const *pLayout=nullptr)
Add 4th optional parameter <bResetListAttrs>.
SwDocShell * GetDocShell()
virtual void UpdateFields()
Marks a node in the document model.
SwNodeOffset GetIndex() const
Base class of the Writer document model elements.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwSectionNode * GetSectionNode()
SwNodeOffset GetIndex() const
const SwStartNode * FindTableBoxStartNode() const
SwNodes & GetNodes()
Node is in which nodes-array/doc?
SwTableBox * GetTableBox() const
If node is in a table return the respective table box.
bool IsContentNode() const
const SwStartNode * FindFlyStartNode() const
SwTableNode * FindTableNode()
Search table node, in which it is.
const SwStartNode * StartOfSectionNode() const
SwNodeOffset EndOfSectionIndex() const
SwContentNode * GetContentNode()
SwTableNode * GetTableNode()
const SwEndNode * EndOfSectionNode() const
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
SwNode & GetEndOfRedlines() const
Section for all Redlines.
SwContentNode * GoNextSection(SwNodeIndex *, bool bSkipHidden=true, bool bSkipProtect=true) const
Go to next content-node that is not protected or hidden (Both set FALSE ==> GoNext/GoPrevious!...
static SwContentNode * GoPrevSection(SwNodeIndex *, bool bSkipHidden=true, bool bSkipProtect=true)
PaM is Point and Mark: a selection of the document model.
const SwPosition * GetMark() const
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
bool ContainsPosition(const SwPosition &rPos) const
std::pair< const SwPosition *, const SwPosition * > StartEnd() const
Because sometimes the cost of the operator<= can add up.
const SwPosition * End() const
const SwPosition * GetPoint() const
const SwPosition * Start() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
void Show(sal_uInt16 nLoop, size_t nMyPos, bool bForced=false)
void InvalidateRange(Invalidation)
Initiate the layout.
void SetExtraData(const SwRedlineExtraData *pData)
ExtraData gets copied, the pointer is therefore not taken over by the RedLineObject.
void SetSeqNo(sal_uInt16 nNo)
sal_uInt16 GetStackCount() const
std::size_t GetAuthor(sal_uInt16 nPos=0) const
const SwNodeIndex * GetContentIdx() const
void Hide(sal_uInt16 nLoop, size_t nMyPos, bool bForced=false)
bool IsOwnRedline(const SwRangeRedline &rRedl) const
const SwRedlineExtraData * GetExtraData() const
OUString GetDescr(bool bSimplified=false)
Returns textual description of a redline data element of this redline.
void SetStart(const SwPosition &rPos, SwPosition *pSttPtr=nullptr)
void SetEnd(const SwPosition &rPos, SwPosition *pEndPtr=nullptr)
void ShowOriginal(sal_uInt16 nLoop, size_t nMyPos, bool bForced=false)
bool HasValidRange() const
Do we have a valid selection?
void PushData(const SwRangeRedline &rRedl, bool bOwnAsNext=true)
void SetComment(const OUString &rS)
RedlineType GetType(sal_uInt16 nPos=0) const
bool CanCombine(const SwRangeRedline &rRedl) const
const SwRedlineData & GetRedlineData(sal_uInt16 nPos=0) const
sal_uInt16 GetSeqNo() const
bool IsAnonymized() const
size_type FindNextSeqNo(sal_uInt16 nSeqNo, size_type nSttPos) const
Search next or previous Redline with the same Seq.
size_type FindPrevSeqNo(sal_uInt16 nSeqNo, size_type nSttPos) const
vector_type::const_iterator end() const
bool isMoved(size_type tableIndex) const
bool Insert(SwRangeRedline *&p)
void DeleteAndDestroy(size_type nPos)
static constexpr size_type npos
vector_type::const_iterator begin() const
void Remove(size_type nPos)
vector_type::size_type size_type
bool HasOverlappingElements() const
size_type GetPos(const SwRangeRedline *p) const
const SwRangeRedline * FindAtPosition(const SwPosition &startPosition, size_type &tableIndex, bool next=true) const
Find the redline at the given position.
void AddRule(SwUndoArg eWhat, const OUString &rWith)
OUString Apply(const OUString &rStr) const
The root element of a Writer document layout.
bool HasMergedParas() const
A section node represents the start of a section on the UI, i.e.
Starts a section of nodes in the document model.
SwTableBox is one table cell in the document model.
Redline that holds information about a table-cell that had some change.
SwTableLine is one table row in the document model.
SwFrameFormat * GetFrameFormat()
SwRedlineTable::size_type UpdateTextChangesOnly(SwRedlineTable::size_type &rRedlinePos, bool bUpdateProperty=true) const
Redline that holds information about a table-row that had some change.
Represents the style of a paragraph.
Represents the visualization of a paragraph.
SwTextNode is a paragraph in the document model.
virtual sal_Int32 Len() const override
bool GetParaAttr(SfxItemSet &rSet, sal_Int32 nStt, sal_Int32 nEnd, const bool bOnlyTextAttr=false, const bool bGetFromChrFormat=true, const bool bMergeIndentValuesOfNumRule=false, SwRootFrame const *pLayout=nullptr) const
Query the attributes of textnode over the range.
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
const OUString & GetText() const
void RemoveFromListRLHidden()
SwTextFormatColl * GetTextColl() const
std::pair< const_iterator, bool > insert(Value &&x)
css::uno::Sequence< sal_Int8 > maRedlinePasswd
virtual bool SplitRedline(const SwPaM &rPam) override
void HideAll(bool bDeletion)
virtual RedlineFlags GetRedlineFlags() const override
Replaced by SwRootFrame::IsHideRedlines() (this is model-level redline hiding).
virtual AppendResult AppendRedline(SwRangeRedline *pPtr, bool bCallDelete) override
Append a new redline.
virtual bool IsRedlineMove() const override
virtual SwRedlineTable::size_type GetRedlinePos(const SwNode &rNode, RedlineType nType) const override
virtual void SetRedlineFlags_intern(RedlineFlags eMode) override
Set a new redline mode.
virtual const SwRangeRedline * SelPrevRedline(SwPaM &rPam) const override
virtual void SetRedlineMove(bool bFlag) override
virtual bool IsRedlineOn() const override
Query if redlining is on.
RedlineFlags meRedlineFlags
virtual const SwRangeRedline * SelNextRedline(SwPaM &rPam) const override
void SetAutoFormatRedlineComment(const OUString *pText, sal_uInt16 nSeqNo=0)
Set comment-text for Redline.
virtual bool HasRedline(const SwPaM &rPam, RedlineType nType, bool bStartOrEndInRange) const override
virtual const SwRedlineTable & GetRedlineTable() const override
virtual bool AcceptRedline(SwRedlineTable::size_type nPos, bool bCallDelete) override
virtual void UpdateRedlineAttr() override
virtual void SetRedlineFlags(RedlineFlags eMode) override
Set a new redline mode.
std::optional< OUString > moAutoFormatRedlnComment
virtual void CompressRedlines(size_t nStartIdx=0) override
virtual std::size_t InsertRedlineAuthor(const OUString &rAuthor) override
Insert new author into the Table for the Readers etc.
sal_uInt16 mnAutoFormatRedlnCommentNo
SeqNo for conjoining of AutoFormat-Redlines.
virtual bool SetRedlineComment(const SwPaM &rPam, const OUString &rComment) override
virtual std::size_t GetRedlineAuthor() override
virtual void SetRedlinePassword(const css::uno::Sequence< sal_Int8 > &rNewPassword) override
virtual const SwRangeRedline * GetRedline(const SwPosition &rPos, SwRedlineTable::size_type *pFndPos) const override
virtual bool RejectRedline(SwRedlineTable::size_type nPos, bool bCallDelete) override
virtual const SwExtraRedlineTable & GetExtraRedlineTable() const override
SwExtraRedlineTable maExtraRedlineTable
virtual const css::uno::Sequence< sal_Int8 > & GetRedlinePassword() const override
virtual bool IsInRedlines(const SwNode &rNode) const override
virtual bool DeleteRedline(const SwPaM &rPam, bool bSaveInUndo, RedlineType nDelType) override
virtual bool AppendTableCellRedline(SwTableCellRedline *pPtr) override
virtual void AcceptRedlineParagraphFormatting(const SwPaM &rPam) override
virtual bool AppendTableRowRedline(SwTableRowRedline *pPtr) override
virtual void AcceptAllRedline(bool bAcceptReject) override
SwRedlineTable maRedlineTable
DocumentRedlineManager(SwDoc &i_rSwdoc)
virtual bool IsIgnoreRedline() const override
virtual ~DocumentRedlineManager() override
constexpr sal_uInt16 RES_PARATR_BEGIN(RES_TXTATR_END)
constexpr sal_uInt16 RES_FRMATR_END(141)
constexpr sal_uInt16 RES_PARATR_END(82)
constexpr sal_uInt16 RES_PARATR_LIST_BEGIN(RES_PARATR_END)
constexpr TypedWhichId< SwFormatContent > RES_CNTNT(101)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(98)
constexpr TypedWhichId< SvxPrintItem > RES_PRINT(104)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
Dialog to specify the properties of date form field.
void UpdateFramesForRemoveDeleteRedline(SwDoc &rDoc, SwPaM const &rPam)
void MoveMergedFlysAndFootnotes(std::vector< SwTextFrame * > const &rFrames, SwTextNode const &rFirstNode, SwTextNode &rSecondNode, bool)
void CheckAnchoredFlyConsistency(SwDoc const &rDoc)
static void UpdateFieldsForRedline(IDocumentFieldsAccess &rIDFA)
void UpdateFramesForAddDeleteRedline(SwDoc &rDoc, SwPaM const &rPam)
void AddRemoveFlysAnchoredToFrameStartingAtNode(SwTextFrame &rFrame, SwTextNode &rTextNode, std::set< SwNodeOffset > *pSkipped)
rTextNode is the first one of the "new" merge - if rTextNode isn't the same as MergedPara::pFirstNode...
std::unique_ptr< sw::MergedPara > CheckParaRedlineMerge(SwTextFrame &rFrame, SwTextNode &rTextNode, FrameMode eMode)
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
SwComparePosition ComparePosition(const T &rStt1, const T &rEnd1, const T &rStt2, const T &rEnd2)
@ OverlapBehind
Pos1 overlaps Pos2 at the end.
@ CollideEnd
Pos1 end touches at Pos2 start.
@ Behind
Pos1 behind Pos2.
@ OverlapBefore
Pos1 overlaps Pos2 at the beginning.
@ Outside
Pos2 completely contained in Pos1.
@ Before
Pos1 before Pos2.
@ Inside
Pos1 completely contained in Pos2.
@ CollideStart
Pos1 start touches at Pos2 end.
@ Equal
Pos1 is as large as Pos2.
Marks a position in the document model.
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
void SetContent(sal_Int32 nContentIndex)
Set content index, only valid to call this if the position points to a SwContentNode subclass.
const SwContentNode * GetContentNode() const
SwNodeOffset GetNodeIndex() const
sal_Int32 GetContentIndex() const
SwDoc & GetDoc() const
Returns the document this position is in.
OUString SwResId(TranslateId aId)