38 #include <strings.hrc>
40 #include <osl/diagnose.h>
47 #define ERROR_PREFIX "redline table corrupted: "
54 void lcl_CheckPosition(
const SwPosition* pPos )
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 )
128 auto const pAuthType(static_cast<SwAuthorityFieldType*>(rIDFA.
GetFieldType(
132 pAuthType->DelSequenceArray();
155 currentStart.nNode.GetNode().IsTableNode()
156 ?
static_cast<SwStartNode*
>(currentStart.nNode.GetNode().GetTableNode())
157 : static_cast<SwStartNode*>(currentStart.nNode.GetNode().GetSectionNode()));
158 if ( !pTableOrSectionNode )
160 SAL_WARN(
"sw.core",
"UpdateFramesForAddDeleteRedline:: known pathology (or ChangesInRedline mode)");
169 if (pLayout->HasMergedParas())
173 static_cast<SwTableNode*
>(pTableOrSectionNode)->DelFrames(pLayout);
177 static_cast<SwSectionNode*
>(pTableOrSectionNode)->DelFrames(pLayout);
182 currentStart.nContent.Assign(currentStart.nNode.GetNode().GetContentNode(), 0);
183 pStartNode = currentStart.nNode.GetNode().GetTextNode();
185 if (currentStart < *rPam.
End())
190 std::vector<SwTextFrame*> frames;
194 if (pFrame->getRootFrame()->HasMergedParas())
196 frames.push_back(pFrame);
199 pFrame->SetDrawObjsAsDeleted(
true);
204 assert(std::none_of(layouts.begin(), layouts.end(),
205 [](
SwRootFrame const*
const pLayout) {
return pLayout->IsHideRedlines(); }));
213 SwTextNode & rFirstNode(pFrame->GetMergedPara()
214 ? *pFrame->GetMergedPara()->pFirstNode
216 assert(pNode == pStartNode
218 : &rFirstNode == pNode);
220 pFrame->SetMergedPara(
nullptr);
222 *pFrame, rFirstNode,
eMode));
228 if (pFrame->GetMergedPara())
230 pLast =
const_cast<SwTextNode*
>(pFrame->GetMergedPara()->pLastNode);
254 bool isAppendObjsCalled(
false);
262 currentStart.nNode.GetNode().IsTableNode()
263 ?
static_cast<SwStartNode*
>(currentStart.nNode.GetNode().GetTableNode())
264 : static_cast<SwStartNode*>(currentStart.nNode.GetNode().GetSectionNode()));
265 assert(pTableOrSectionNode);
276 isAppendObjsCalled =
true;
279 currentStart.nContent.Assign(currentStart.nNode.GetNode().GetContentNode(), 0);
280 pStartNode = currentStart.nNode.GetNode().GetTextNode();
282 if (currentStart < *rPam.
End())
287 std::vector<SwTextFrame*> frames;
291 if (pFrame->getRootFrame()->HasMergedParas())
293 frames.push_back(pFrame);
296 pFrame->SetDrawObjsAsDeleted(
false);
304 assert(std::none_of(layouts.begin(), layouts.end(),
305 [](
SwRootFrame const*
const pLayout) {
return pLayout->IsHideRedlines(); }));
308 isAppendObjsCalled =
true;
318 if (
auto const pMergedPara = pFrame->GetMergedPara())
320 pLast =
const_cast<SwTextNode*
>(pMergedPara->pLastNode);
321 assert(pNode == pStartNode
323 : pMergedPara->pFirstNode == pNode);
325 SwTextNode & rFirstNode(*pMergedPara->pFirstNode);
326 pFrame->SetMergedPara(
nullptr);
328 *pFrame, rFirstNode,
eMode));
343 isAppendObjsCalled =
true;
356 if (!isAppendObjsCalled)
360 if (pLayout->HasMergedParas())
395 if (pToNode !=
nullptr && pFromNode !=
nullptr && pToNode != pFromNode)
397 const SwPaM aPam(*pToNode);
398 SwDoc& rDoc = aPam.GetDoc();
402 if (bCopy && pFromColl != pToColl)
417 bool bSameSet = aTmp == aTmp2;
421 for( sal_uInt16 nItem = 0; nItem < aTmp.TotalCount(); ++nItem)
423 sal_uInt16 nWhich = aTmp.GetWhichByPos(nItem);
424 if( SfxItemState::SET == aTmp.GetItemState( nWhich,
false ) &&
425 SfxItemState::SET != aTmp2.GetItemState( nWhich,
false ) )
426 aTmp2.Put( aTmp.GetPool()->GetDefaultItem(nWhich), nWhich );
430 if (bCopy && !bSameSet)
432 else if (!bCopy && (!bSameSet || pFromColl != pToColl))
439 void lcl_DeleteTrackedTableRow (
const SwPosition* pPos )
449 if ( pHasTextChangesOnlyProp && !pHasTextChangesOnlyProp->GetValue() )
467 void lcl_RemoveTrackingOfTableRow(
const SwPosition* pPos,
bool bRejectDeletion )
477 if ( pHasTextChangesOnlyProp && !pHasTextChangesOnlyProp->GetValue() )
479 bool bNoMoreInsertion =
false;
480 if ( !bRejectDeletion )
486 bNoMoreInsertion =
true;
488 if ( bRejectDeletion || bNoMoreInsertion )
504 SwPosition *pRStt =
nullptr, *pREnd =
nullptr;
506 if( pSttRng && pEndRng )
508 pRStt = pRedl->
Start();
509 pREnd = pRedl->
End();
517 case RedlineType::Insert:
518 case RedlineType::Format:
520 bool bCheck =
false, bReplace =
false;
524 if( *pSttRng == *pRStt )
528 if( *pEndRng != *pREnd )
533 rArr.
Insert( pNew ); ++rPos;
535 pRedl->
SetEnd( *pSttRng, pREnd );
546 pRedl->
SetEnd( *pSttRng, pREnd );
553 bool bInsert = RedlineType::Insert == pRedl->
GetType();
559 lcl_RemoveTrackingOfTableRow( &aPos,
false );
575 case RedlineType::Delete:
578 const SwPosition *pDelStt =
nullptr, *pDelEnd =
nullptr;
579 bool bDelRedl =
false;
612 pDelStt = pRedl->
Start();
613 pDelEnd = pRedl->
End();
621 if( pDelStt && pDelEnd )
623 SwPaM aPam( *pDelStt, *pDelEnd );
626 pRStt = pRedl->
Start();
627 pREnd = pRedl->
End();
630 if( pCSttNd && pCEndNd && pRStt && pREnd && pRStt->
nContent == 0 )
631 lcl_CopyStyle(*pREnd, *pRStt);
639 if( pCSttNd && pCEndNd )
642 lcl_DeleteTrackedTableRow( aPam.End() );
644 else if (pCSttNd && !pCEndNd)
646 aPam.GetBound().nContent.Assign(
nullptr, 0 );
647 aPam.GetBound(
false ).nContent.Assign(
nullptr, 0 );
661 case RedlineType::FmtColl:
665 case RedlineType::ParagraphFormat:
683 SwPosition *pRStt =
nullptr, *pREnd =
nullptr;
685 if( pSttRng && pEndRng )
687 pRStt = pRedl->
Start();
688 pREnd = pRedl->
End();
696 case RedlineType::Insert:
698 const SwPosition *pDelStt =
nullptr, *pDelEnd =
nullptr;
699 bool bDelRedl =
false;
732 pDelStt = pRedl->
Start();
733 pDelEnd = pRedl->
End();
741 if( pDelStt && pDelEnd )
743 SwPaM aPam( *pDelStt, *pDelEnd );
754 if( pCSttNd && pCEndNd )
757 lcl_DeleteTrackedTableRow( aPam.End() );
759 else if (pCSttNd && !pCEndNd)
761 aPam.GetBound().nContent.Assign(
nullptr, 0 );
762 aPam.GetBound(
false ).nContent.Assign(
nullptr, 0 );
763 if (aPam.End()->nNode.GetNode().IsStartNode())
767 assert(!aPam.End()->nNode.GetNode().IsStartNode());
780 case RedlineType::Delete:
783 bool bCheck =
false, bReplace =
false;
784 SwPaM const updatePaM(pSttRng ? *pSttRng : *pRedl->
Start(),
785 pEndRng ? *pEndRng : *pRedl->
End());
791 lcl_RemoveTrackingOfTableRow( updatePaM.End(), true );
802 if( *pSttRng == *pRStt )
811 if( *pEndRng != *pREnd )
816 rArr.
Insert( pCpy ); ++rPos;
821 pRedl->
SetEnd( *pSttRng, pREnd );
847 pRedl->
SetEnd( *pSttRng, pREnd );
866 rArr.
Insert( pNew ); ++rPos;
880 case RedlineType::Format:
881 case RedlineType::FmtColl:
882 case RedlineType::ParagraphFormat:
889 if ( pRedl->
GetType() == RedlineType::Format )
894 else if ( pRedl->
GetType() == RedlineType::ParagraphFormat )
907 constexpr std::pair<sal_uInt16, sal_uInt16> aResetableSetRange[] = {
912 for (
const auto& [nBegin, nEnd] : aResetableSetRange)
914 for (sal_uInt16 i = nBegin;
i <= nEnd; ++
i)
915 aResetAttrsArray.insert( i );
918 rDoc.
ResetAttrs(aPam,
false, aResetAttrsArray);
945 int lcl_AcceptRejectRedl( Fn_AcceptReject fn_AcceptReject,
956 ( *pFnd->
Start() != *pStt || *pFnd->
End() > *pEnd ))
959 if( (*fn_AcceptReject)( rArr, n, bCallDelete, pStt, pEnd ))
966 bool bHasParagraphFormatChange =
false;
967 for(
int m = 0 ;
m < 2 && !bHasParagraphFormatChange; ++
m )
974 if( *pTmp->
End() <= *pEnd )
976 if( (m > 0 || RedlineType::ParagraphFormat == pTmp->
GetType()) &&
977 (*fn_AcceptReject)( rArr, o, bCallDelete,
nullptr, nullptr ))
979 bHasParagraphFormatChange =
true;
985 if( *pTmp->
Start() < *pEnd )
988 if( (m > 0 || RedlineType::ParagraphFormat == pTmp->
GetType()) &&
989 (*fn_AcceptReject)( rArr, o, bCallDelete, pStt, pEnd ))
991 bHasParagraphFormatChange =
true;
1003 void lcl_AdjustRedlineRange(
SwPaM& rPam )
1009 * pEnd = rPam.
End();
1023 if( pEnd->nNode.GetNode().IsContentNode() &&
1024 !rDoc.
GetNodes()[ pEnd->nNode.GetIndex() + 1 ]->IsContentNode() &&
1025 pEnd->nContent.GetIndex() == pEnd->nNode.GetNode().GetContentNode()->Len() )
1032 pEnd->nNode.GetIndex() + 1 )
1040 class TemporaryRedlineUpdater
1044 std::shared_ptr<SwUnoCursor> m_pCursor;
1047 : m_rRedline(rRedline)
1048 , m_pCursor(rDoc.CreateUnoCursor(*rRedline.GetPoint(),
false))
1053 *m_pCursor->GetMark() = *m_rRedline.
GetMark();
1058 ~TemporaryRedlineUpdater()
1060 static_cast<SwPaM&
>(m_rRedline) = *m_pCursor;
1068 DocumentRedlineManager::DocumentRedlineManager(
SwDoc& i_rSwdoc)
1071 , mbIsRedlineMove(
false)
1072 , mnAutoFormatRedlnCommentNo(0)
1122 if (pLayout->IsHideRedlines())
1124 pLayout->SetHideRedlines(
false);
1125 hiddenLayouts.
insert(pLayout);
1130 for (sal_uInt16 nLoop = 1; nLoop <= 2; ++nLoop)
1134 (pRedline->*pFnc)(nLoop,
i,
false);
1151 pLayout->SetHideRedlines(
true);
1156 meRedlineFlags = eMode;
1248 if( bCallDelete && RedlineType::Delete == pNewRedl->
GetType() )
1264 bool bMerged =
false;
1279 * pEnd = pNewRedl->
End();
1282 if( pTextNode ==
nullptr )
1286 OSL_ENSURE(
false,
"Redline start: non-text-node with content" );
1294 OSL_ENSURE(
false,
"Redline start: index after text" );
1299 if( pTextNode ==
nullptr )
1301 if( pEnd->nContent > 0 )
1303 OSL_ENSURE(
false,
"Redline end: non-text-node with content" );
1309 if( pEnd->nContent > pTextNode->
Len() )
1311 OSL_ENSURE(
false,
"Redline end: index after text" );
1312 pEnd->nContent = pTextNode->
Len();
1316 if( ( *pStt == *pEnd ) &&
1322 bool bCompress =
false;
1335 * pREnd = pRedl->
End();
1338 if( ( *pRStt == *pREnd ) &&
1349 case RedlineType::Insert:
1352 case RedlineType::Insert:
1357 bool bDelete =
false;
1361 IsPrevPos( *pREnd, *pStt ) ) ||
1369 pRedl->
SetEnd( *pEnd, pREnd );
1381 IsPrevPos( *pEnd, *pRStt ) ) ||
1406 if( ( *pStt == *pEnd ) &&
1413 if( ( *pStt == *pEnd ) &&
1439 if( *pEnd != *pREnd )
1445 pRedl->
SetEnd( *pStt, pREnd );
1446 if( ( *pStt == *pRStt ) &&
1467 pSplit->
SetEnd( *pRStt );
1470 if( *pStt == *pEnd && pNewRedl->
GetContentIdx() == nullptr )
1486 if( ( *pStt == *pEnd ) &&
1495 case RedlineType::Delete:
1499 if( *pEnd != *pREnd )
1505 pRedl->
SetEnd( *pStt, pREnd );
1506 if( ( *pStt == *pRStt ) &&
1527 pSplit->
SetEnd( *pRStt );
1530 if( *pStt == *pEnd && pNewRedl->
GetContentIdx() == nullptr )
1549 case RedlineType::Format:
1561 pRedl->
SetEnd( *pStt, pREnd );
1580 if( *pEnd != *pREnd )
1582 if( *pEnd != *pRStt )
1586 pRedl->
SetEnd( *pStt, pREnd );
1595 pRedl->
SetEnd( *pStt, pREnd );
1606 case RedlineType::Delete:
1609 case RedlineType::Delete:
1616 if (*pEnd == *pREnd)
1618 pNewRedl->
SetEnd(*pRStt, pEnd);
1620 else if (*pStt == *pRStt)
1628 pNewRedl->
SetEnd( *pRStt, pEnd );
1651 pNewRedl->
SetStart( *pRStt, pStt );
1653 pNewRedl->
SetEnd( *pREnd, pEnd );
1658 pNewRedl->
SetStart( *pREnd, pStt );
1660 pNewRedl->
SetEnd( *pRStt, pEnd );
1676 pRStt = pRedl->
Start();
1677 pREnd = pRedl->
End();
1683 pNewRedl->
SetStart( *pRStt, pStt );
1685 pNewRedl->
SetEnd( *pREnd, pEnd );
1692 if( *(pNewRedl->
Start()) <= *pREnd )
1713 case RedlineType::Insert:
1743 pEnd->nNode.GetNode().IsEndNode() )
1746 pEnd->nContent.Assign(
1747 pEnd->nNode.GetNode().GetTextNode(), 0);
1755 if( !bCallDelete && !bDec && *pEnd == *pREnd )
1760 else if ( bCallDelete || !bDec )
1775 TemporaryRedlineUpdater
const u(
m_rDoc, *pNewRedl);
1785 SwPaM aPam( *pRStt, *pEnd );
1787 if( *pEnd == *pREnd )
1799 TemporaryRedlineUpdater
const u(
m_rDoc, *pNewRedl);
1809 SwPaM aPam( *pStt, *pREnd );
1811 if( *pStt == *pRStt )
1817 pRedl->
SetEnd( *pStt, pREnd );
1821 TemporaryRedlineUpdater
const u(
m_rDoc, *pNewRedl);
1859 if( *pRStt == *pStt )
1865 pNewRedl->
PushData( *pRedl,
false );
1875 pNewRedl->
PushData( *pRedl,
false );
1876 if( *pREnd != *pEnd )
1881 pRedl->
SetEnd( *pStt, pREnd );
1895 if( *pEnd == *pREnd )
1897 pNewRedl->
SetEnd( *pRStt, pEnd );
1899 else if (*pStt == *pRStt)
1907 pNewRedl->
SetStart( *pREnd, pStt );
1915 if( *pEnd == *pREnd )
1918 pNewRedl->
SetEnd( *pRStt, pEnd );
1931 pNewRedl->
SetEnd( *pRStt, pEnd );
1943 if( *pStt == *pRStt )
1946 pNewRedl->
SetStart( *pREnd, pStt );
1959 pNewRedl->
SetStart( *pREnd, pStt );
1992 case RedlineType::Format:
2004 pRedl->
SetEnd( *pStt, pREnd );
2018 if( *pEnd != *pREnd )
2020 if( *pEnd != *pRStt )
2024 pRedl->
SetEnd( *pStt, pREnd );
2025 if( ( *pStt == *pRStt ) &&
2034 pRedl->
SetEnd( *pStt, pREnd );
2045 case RedlineType::Format:
2048 case RedlineType::Insert:
2049 case RedlineType::Delete:
2053 pNewRedl->
SetEnd( *pRStt, pEnd );
2057 pNewRedl->
SetStart( *pREnd, pStt );
2069 if (*pEnd == *pREnd)
2071 pNewRedl->
SetEnd(*pRStt, pEnd);
2073 else if (*pStt == *pRStt)
2081 pNewRedl->
SetEnd( *pRStt, pEnd );
2091 case RedlineType::Format:
2112 else if( *pREnd == *pEnd )
2114 pRedl->
SetEnd( *pStt, pREnd );
2115 else if( *pRStt == *pStt )
2130 pRedl->
SetEnd( *pStt, pREnd );
2145 pNewRedl->
SetStart( *pRStt, pStt );
2147 pNewRedl->
SetEnd( *pREnd, pEnd );
2152 pNewRedl->
SetStart( *pREnd, pStt );
2154 pNewRedl->
SetEnd( *pRStt, pEnd );
2164 pNewRedl->
SetEnd( *pREnd, pEnd );
2178 pNewRedl->
SetStart( *pRStt, pStt );
2192 case RedlineType::FmtColl:
2203 if( ( *pStt == *pEnd ) &&
2211 if ( bCallDelete && RedlineType::Delete == pNewRedl->
GetType() )
2241 pNewRedl->
SetEnd( aPos );
2247 std::unique_ptr<SwRedlineExtraData_FormatColl> xRedlineExtraData;
2250 xRedlineExtraData.reset(pExtraData);
2256 if ( pExtraData || *pPar->
Start() != *pPar->
End() )
2263 lcl_CopyStyle(*pStt, aPos);
2276 while( --aIdx && pDelNd->
GetIndex() < aIdx.GetIndex() &&
2277 !aIdx.GetNode().IsContentNode() )
2280 if( aIdx.GetNode().IsEndNode() && aIdx.GetNode().FindTableNode() )
2298 if (aIdx.GetNode().IsContentNode())
2314 while ( aSttIdx < aEndIdx )
2316 if ( aSttIdx.GetNode().IsTableNode() )
2327 assert(ret || !pNewRedl);
2328 if (ret && !pNewRedl)
2340 return (
nullptr != pNewRedl)
2384 return nullptr != pNewRedl;
2426 return nullptr != pNewRedl;
2446 * pPrevEnd = pPrev->
End();
2448 * pCurEnd = pCur->End();
2449 if( *pPrevEnd == *pCurStt && pPrev->
CanCombine( *pCur ) &&
2456 pPrev->
Show(0, nPrevIndex);
2459 pPrev->
SetEnd( *pCur->End() );
2463 (pPrev->*pFnc)(0, nPrevIndex,
false);
2483 if (*pRedlineStart <= *pStt && *pStt <= *pRedlineEnd &&
2484 *pRedlineStart <= *pEnd && *pEnd <= *pRedlineEnd)
2488 if (*pStt == *pRedlineStart)
2490 if (*pEnd == *pRedlineEnd)
2498 pRedline->
SetEnd( *pStt, pRedlineEnd );
2503 *pRedlineStart = *pEnd;
2507 *pRedlineEnd = *pStt;
2525 else if (*pEnd < *pRedlineStart)
2544 if( pUndo->GetRedlSaveCount() )
2551 * pEnd = rRange.
End();
2557 if( RedlineType::Any != nDelType && nDelType != pRedl->
GetType() )
2561 * pREnd = pRedl->
End();
2583 pRedl->
SetEnd( *pStt, pREnd );
2598 if( *pRStt == *pStt )
2610 if( *pREnd != *pEnd )
2618 pRedl->
SetEnd( *pStt, pREnd );
2678 return lhs->End()->nNode.
GetIndex() < nNdIdx;
2686 if( ( RedlineType::Any == nType || nType == pTmp->
GetType()) &&
2687 nStart <= nNdIdx && nNdIdx <= nEnd )
2690 if( nStart > nNdIdx )
2701 if( nPt < nMk ) {
SwNodeOffset nTmp = nMk; nMk = nPt; nPt = nTmp; }
2703 if( ( RedlineType::Any == nType || nType == pTmp->
GetType()) &&
2704 nMk <= nNdIdx && nNdIdx <= nPt )
2720 SwNodeIndex pEndNodeIndex(currentEnd.nNode.GetNode());
2730 if( RedlineType::Any != nType && nType != pTmp->
GetType() )
2734 if ( currentStart < *pTmp->
End() && *pTmp->
Start() <= currentEnd &&
2736 ( !bStartOrEndInRange ||
2737 ( currentStart < *pTmp->
Start() || *pTmp->
End() < currentEnd ) ) )
2754 nM = nU + ( nO - nU ) / 2;
2760 : ( *pStt <= rPos && rPos < *pEnd ) )
2772 if( RedlineType::Format == pRedl->GetType() )
2781 else if( ( nM + 1 ) <= nO && rPos >= *
maRedlineTable[ nM + 1 ]->Start() &&
2794 else if( *pEnd <= rPos )
2836 sal_uInt16 nSeqNo = pTmp->
GetSeqNo();
2843 std::make_unique<SwUndoAcceptRedline>(*pTmp) );
2868 }
while( nLoopCnt );
2897 lcl_AdjustRedlineRange( aPam );
2905 int nRet = lcl_AcceptRejectRedl( lcl_AcceptRedline,
maRedlineTable,
2906 bCallDelete, aPam );
2935 * pEnd = rPam.
End();
2945 if( nPt < nMk ) {
SwNodeOffset nTmp = nMk; nMk = nPt; nPt = nTmp; }
2947 if( RedlineType::ParagraphFormat == pTmp->
GetType() &&
2948 ( (nSttIdx <= nMk && nMk <= nEndIdx) || (nSttIdx <= nPt && nPt <= nEndIdx) ) )
2979 sal_uInt16 nSeqNo = pTmp->
GetSeqNo();
2986 std::make_unique<SwUndoRejectRedline>( *pTmp ) );
3011 }
while( nLoopCnt );
3040 lcl_AdjustRedlineRange( aPam );
3048 int nRet = lcl_AcceptRejectRedl( lcl_RejectRedline,
maRedlineTable,
3049 bCallDelete, aPam );
3078 bool bSuccess =
true;
3103 if (!sUndoStr.isEmpty())
3129 if( !pCNd || ( aTmp == rSttPos.
nNode &&
3134 rSttPos = *pFnd->
End();
3146 rSttPos = *pFnd->
End();
3167 pRStt = pTmp->
Start();
3168 if( *pPrevEnd == *pRStt || IsPrevPos( *pPrevEnd, *pRStt ) )
3170 pPrevEnd = pTmp->
End();
3171 rSttPos = *pPrevEnd;
3228 }
while( bRestart );
3255 if( !pCNd || ( aTmp == rSttPos.
nNode &&
3260 rSttPos = *pFnd->
Start();
3266 while( !pFnd && 0 < n )
3272 rSttPos = *pFnd->
Start();
3291 ( *pNextStt == *( pREnd = pTmp->
End() ) ||
3292 IsPrevPos( *pREnd, *pNextStt )) )
3294 pNextStt = pTmp->
Start();
3295 rSttPos = *pNextStt;
3355 }
while( bRestart );
3367 * pEnd = rPaM.
End();
3375 if( pStt != pEnd && *pTmp->
Start() > *pEnd )
3379 if( *pTmp->
End() >= *pEnd )
3394 return SW_MOD()->GetRedlineAuthor();
3400 return SW_MOD()->InsertRedlineAuthor(rNew);
3421 const uno::Sequence <sal_Int8>& rNewPassword)
3452 if ( pRedline->
GetType() == RedlineType::Delete )
3454 if ( bDeletion && pRedline->
IsVisible() )
3456 pRedline->
Hide(0, rTable.
GetPos(pRedline),
false);
3457 pRedline->
Hide(1, rTable.
GetPos(pRedline),
false);
3459 else if ( !bDeletion && !pRedline->
IsVisible() )
3461 pRedline->
Show(0, rTable.
GetPos(pRedline),
true);
3462 pRedline->
Show(1, rTable.
GetPos(pRedline),
true);
3465 else if ( pRedline->
GetType() == RedlineType::Insert )
3467 if ( !bDeletion && pRedline->
IsVisible() )
3472 else if ( bDeletion && !pRedline->
IsVisible() )
3474 pRedline->
Show(0, rTable.
GetPos(pRedline),
true);
3475 pRedline->
Show(1, rTable.
GetPos(pRedline),
true);
3489 pRedline->
Show(0, rTable.
GetPos(pRedline),
true);
3490 pRedline->
Show(1, rTable.
GetPos(pRedline),
true);
const SwEndNode * EndOfSectionNode() const
Starts a section of nodes in the document model.
Represents the visualization of a paragraph.
virtual sal_Int32 Len() const
bool CanCombine(const SwRangeRedline &rRedl) const
const SwRedlineExtraData * GetExtraData() const
virtual AppendResult AppendRedline(SwRangeRedline *pPtr, bool bCallDelete) override
Append a new redline.
void Show(sal_uInt16 nLoop, size_t nMyPos, bool bForced=false)
sal_uInt16 GetSeqNo() const
SwNodeOffset EndOfSectionIndex() const
Represents the style of a paragraph.
virtual std::size_t InsertRedlineAuthor(const OUString &rAuthor) override
Insert new author into the Table for the Readers etc.
Marks a position in the document model.
void UpdateFramesForAddDeleteRedline(SwDoc &rDoc, SwPaM const &rPam)
std::optional< OUString > moAutoFormatRedlnComment
constexpr TypedWhichId< SvxPrintItem > RES_PRINT(98)
vector_type::const_iterator end() const
SwTableBox * GetTableBox() const
If node is in a table return the respective table box.
SwComparePosition ComparePosition(const T &rStt1, const T &rEnd1, const T &rStt2, const T &rEnd2)
const OUString & GetText() const
virtual const SwRootFrame * GetCurrentLayout() const =0
virtual std::size_t GetRedlineAuthor() override
SwDocShell * GetDocShell()
virtual void SetRedlineFlags(RedlineFlags eMode) override
Set a new redline mode.
virtual void SetRedlineFlags_intern(RedlineFlags eMode)=0
Set a new redline mode.
virtual SwFieldType * GetFieldType(SwFieldIds nResId, const OUString &rName, bool bDbFieldMatching) const =0
void DeleteRow(const SwCursor &rCursor)
Deleting Columns/Rows.
virtual void InsertItemSet(const SwPaM &rRg, const SfxItemSet &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr)=0
virtual const SwRedlineTable & GetRedlineTable() const override
RedlineFlags meRedlineFlags
virtual sal_Int32 Len() const override
virtual void SetModified()=0
Must be called manually at changes of format.
Pos1 is as large as Pos2.
const SwPosition * GetMark() const
Pos1 completely contained in Pos2.
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
void Remove(size_type nPos)
void SetSeqNo(sal_uInt16 nNo)
constexpr sal_uInt16 RES_FRMATR_END(133)
static SwContentNode * GoPrevSection(SwNodeIndex *, bool bSkipHidden=true, bool bSkipProtect=true)
void SetEnd(const SwPosition &rPos, SwPosition *pEndPtr=nullptr)
virtual bool DeleteRedline(const SwPaM &rPam, bool bSaveInUndo, RedlineType nDelType) override
virtual void DeleteRange(SwPaM &)=0
Delete a range SwFlyFrameFormat.
SwTableLine is one table row in the document model.
virtual const SwExtraRedlineTable & GetExtraRedlineTable() const override
virtual void UpdateRedlineAttr() override
Dialog to specify the properties of date form field.
IDocumentUndoRedo & GetIDocumentUndoRedo()
IDocumentContentOperations const & getIDocumentContentOperations() const
The root element of a Writer document layout.
const SwFrameFormats * GetSpzFrameFormats() const
bool HasValidRange() const
Do we have a valid selection?
virtual void UpdateExpFields(SwTextField *pField, bool bUpdateRefFields)=0
OUString SwResId(TranslateId aId)
Pos1 end touches at Pos2 start.
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
bool IsOwnRedline(const SwRangeRedline &rRedl) const
virtual const SwRangeRedline * SelPrevRedline(SwPaM &rPam) const override
SwTableNode * GetTableNode()
constexpr sal_uInt16 RES_PARATR_BEGIN(RES_TXTATR_END)
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.
bool SetTextFormatColl(const SwPaM &rRg, SwTextFormatColl *pFormat, const bool bReset=true, const bool bResetListAttrs=false, SwRootFrame const *pLayout=nullptr)
Add 4th optional parameter .
vector_type::const_iterator begin() const
std::unique_ptr< sw::MergedPara > CheckParaRedlineMerge(SwTextFrame &rFrame, SwTextNode &rTextNode, FrameMode eMode)
SwRedlineTable::size_type UpdateTextChangesOnly(SwRedlineTable::size_type &rRedlinePos, bool bUpdateProperty=true) const
bool HasOverlappingElements() const
Pos2 completely contained in Pos1.
void SetInXMLImport(bool bNew)
o3tl::sorted_vector< SwRootFrame * > GetAllLayouts()
void ShowOriginal(sal_uInt16 nLoop, size_t nMyPos, bool bForced=false)
SwNodeOffset GetIndex() const
virtual bool DoesUndo() const =0
Is Undo enabled?
sal_uInt16 GetStackCount() const
void SetExtraData(const SwRedlineExtraData *pData)
ExtraData gets copied, the pointer is therefore not taken over by the RedLineObject.
Redline that holds information about a table-cell that had some change.
virtual void AcceptAllRedline(bool bAcceptReject) override
OUString GetDescr(bool bSimplified=false)
Returns textual description of a redline data element of this redline.
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
bool ContainsPosition(const SwPosition &rPos) const
void DelNumRules(const SwPaM &, SwRootFrame const *pLayout=nullptr)
void InvalidateRange(Invalidation)
Initiate the layout.
SwRedlineTable maRedlineTable
virtual void UpdateFields()
bool IsContentNode() const
PaM is Point and Mark: a selection of the document model.
size_type FindPrevSeqNo(sal_uInt16 nSeqNo, size_type nSttPos) const
size_type GetPos(const SwRangeRedline *p) const
virtual void UpdateRefFields()=0
virtual void AppendUndo(std::unique_ptr< SwUndo > pUndo)=0
Add new Undo action.
virtual SwUndoId StartUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Opens undo block.
virtual const SwRangeRedline * GetRedline(const SwPosition &rPos, SwRedlineTable::size_type *pFndPos) const override
const SwStartNode * StartOfSectionNode() const
void DeleteAndDestroy(size_type nPos)
const SwPosition * GetPoint() const
Pos1 start touches at Pos2 end.
SwIndex & Assign(SwIndexReg *, sal_Int32)
OUString Apply(const OUString &rStr) const
virtual void SetRedlinePassword(const css::uno::Sequence< sal_Int8 > &rNewPassword) 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.
Document fields related interfaces.
virtual void AcceptRedlineParagraphFormatting(const SwPaM &rPam) override
static bool IsShowOriginal(const RedlineFlags eM)
virtual const SwRangeRedline * SelNextRedline(SwPaM &rPam) const override
SwContentNode * GetContentNode()
SwNodeOffset GetIndex() const
vector_type::size_type size_type
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
void Hide(sal_uInt16 nLoop, size_t nMyPos, bool bForced=false)
void AddRule(SwUndoArg eWhat, const OUString &rWith)
virtual RedlineFlags GetRedlineFlags() const override
Replaced by SwRootFrame::IsHideRedlines() (this is model-level redline hiding).
#define CHECK_REDLINE(pDoc)
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
IDocumentState const & getIDocumentState() const
SwFrameFormat * GetFrameFormat()
const SwRangeRedline * FindAtPosition(const SwPosition &startPosition, size_type &tableIndex, bool next=true) const
Find the redline at the given position.
Marks a node in the document model.
void MoveMergedFlysAndFootnotes(std::vector< SwTextFrame * > const &rFrames, SwTextNode const &rFirstNode, SwTextNode &rSecondNode, bool)
SwNodes & GetNodes()
Node is in which nodes-array/doc?
virtual bool SplitRedline(const SwPaM &rPam) override
virtual bool HasRedline(const SwPaM &rPam, RedlineType nType, bool bStartOrEndInRange) const override
virtual bool IsInRedlines(const SwNode &rNode) const override
void SetAutoFormatRedlineComment(const OUString *pText, sal_uInt16 nSeqNo=0)
Set comment-text for Redline.
Redline that holds information about a table-row that had some change.
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
enumrange< T >::Iterator end(enumrange< T >)
const SwPosition * Start() const
constexpr TypedWhichId< SwFormatContent > RES_CNTNT(95)
virtual void SetRedlineMove(bool bFlag) override
virtual const SwRangeRedline * GetRedline(const SwPosition &rPos, SwRedlineTable::size_type *pFndPos) const =0
virtual bool RejectRedline(SwRedlineTable::size_type nPos, bool bCallDelete) override
void SetComment(const OUString &rS)
virtual bool IsRedlineMove() const override
SwTextNode is a paragraph in the document model.
bool isMoved(size_type tableIndex) const
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
virtual ~DocumentRedlineManager() override
SwExtraRedlineTable maExtraRedlineTable
sal_uInt16 mnAutoFormatRedlnCommentNo
SeqNo for conjoining of AutoFormat-Redlines.
std::size_t GetAuthor(sal_uInt16 nPos=0) const
void UpdateFramesForRemoveDeleteRedline(SwDoc &rDoc, SwPaM const &rPam)
#define SAL_WARN_IF(condition, area, stream)
Pos1 overlaps Pos2 at the end.
void PushData(const SwRangeRedline &rRedl, bool bOwnAsNext=true)
virtual void CompressRedlines() override
static void UpdateFieldsForRedline(IDocumentFieldsAccess &rIDFA)
virtual void SetRedlineFlags_intern(RedlineFlags eMode) override
Set a new redline mode.
static bool IsHideChanges(const RedlineFlags eM)
virtual bool DelFullPara(SwPaM &)=0
Delete full paragraphs.
virtual bool SetRedlineComment(const SwPaM &rPam, const OUString &rComment) override
sal_Int32 GetIndex() const
virtual bool IsRedlineOn() const =0
Query if redlining is on.
virtual bool AcceptRedline(SwRedlineTable::size_type nPos, bool bCallDelete) override
constexpr sal_uInt16 RES_PARATR_LIST_BEGIN(RES_PARATR_END)
void SetRowNotTracked(const SwCursor &rCursor, const SvxPrintItem &rNotTracked, bool bAll=false)
rNotTracked = false means that the row was deleted or inserted with its tracked cell content bAll: de...
const SwPosition * End() const
SwDoc & GetDoc() const
Returns the document this position is in.
constexpr sal_uInt16 RES_PARATR_END(82)
RedlineType GetType(sal_uInt16 nPos=0) const
SwTableBox is one table cell in the document model.
size_type FindNextSeqNo(sal_uInt16 nSeqNo, size_type nSttPos) const
Search next or previous Redline with the same Seq.
bool IsAutoFormatRedline() const
const SwStartNode * FindTableBoxStartNode() const
virtual SwRedlineTable::size_type GetRedlinePos(const SwNode &rNode, RedlineType nType) const override
const SwStartNode * FindFlyStartNode() const
virtual bool IsIgnoreRedline() const override
SwFootnoteIdxs & GetFootnoteIdxs()
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
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!!!).
#define SAL_WARN(area, stream)
bool HasMergedParas() const
virtual SwFieldType * GetSysFieldType(const SwFieldIds eWhich) const =0
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
void HideAll(bool bDeletion)
css::uno::Sequence< sal_Int8 > maRedlinePasswd
virtual const SwRedlineTable & GetRedlineTable() const =0
bool Insert(SwRangeRedline *&p)
SwNode & GetEndOfRedlines() const
Section for all Redlines.
std::pair< const_iterator, bool > insert(Value &&x)
const SwIndexReg * GetIdxReg() const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
virtual bool DeleteAndJoin(SwPaM &)=0
complete delete of a given PaM
static constexpr size_type npos
virtual const css::uno::Sequence< sal_Int8 > & GetRedlinePassword() const override
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
SwNodeIndex * GetContentIdx() const
virtual bool IsRedlineOn() const override
Query if redlining is on.
Pos1 overlaps Pos2 at the beginning.
virtual bool AppendTableRowRedline(SwTableRowRedline *pPtr) override
void SetStart(const SwPosition &rPos, SwPosition *pSttPtr=nullptr)
bool IsInXMLImport() const
const SwAttrPool & GetAttrPool() const
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
virtual bool AppendTableCellRedline(SwTableCellRedline *pPtr) override
bool m_bDetectedRangeSegmentation false
void SetAutoFormatRedline(bool bFlag)
void CheckAnchoredFlyConsistency(SwDoc const &rDoc)
Base class of the Writer document model elements.
SwTextFormatColl * GetTextColl() const
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...