38 #include <strings.hrc>
40 #include <osl/diagnose.h>
46 #define ERROR_PREFIX "redline table corrupted: "
53 void lcl_CheckPosition(
const SwPosition* pPos )
59 if( pTextNode ==
nullptr )
69 void lcl_CheckPam(
const SwPaM* pPam )
72 lcl_CheckPosition( pPam->
GetPoint() );
73 lcl_CheckPosition( pPam->
GetMark() );
91 OSL_ENSURE( ( *(j->GetPoint()) != *(j->GetMark()) ) ||
92 ( j->GetContentIdx() != nullptr ),
97 for(
size_t n = 1;
n < rTable.size(); ++
n )
115 #define CHECK_REDLINE( pDoc ) lcl_CheckRedline( pDoc );
119 #define CHECK_REDLINE( pDoc )
127 auto const pAuthType(static_cast<SwAuthorityFieldType*>(rIDFA.
GetFieldType(
131 pAuthType->DelSequenceArray();
154 currentStart.nNode.GetNode().IsTableNode()
155 ?
static_cast<SwStartNode*
>(currentStart.nNode.GetNode().GetTableNode())
156 : static_cast<SwStartNode*>(currentStart.nNode.GetNode().GetSectionNode()));
157 assert(pTableOrSectionNode);
164 if (pLayout->HasMergedParas())
168 static_cast<SwTableNode*
>(pTableOrSectionNode)->DelFrames(pLayout);
172 static_cast<SwSectionNode*
>(pTableOrSectionNode)->DelFrames(pLayout);
177 currentStart.nContent.Assign(currentStart.nNode.GetNode().GetContentNode(), 0);
178 pStartNode = currentStart.nNode.GetNode().GetTextNode();
180 if (currentStart < *rPam.
End())
185 std::vector<SwTextFrame*> frames;
189 if (pFrame->getRootFrame()->HasMergedParas())
191 frames.push_back(pFrame);
197 assert(std::none_of(layouts.begin(), layouts.end(),
198 [](
SwRootFrame const*
const pLayout) {
return pLayout->IsHideRedlines(); }));
206 SwTextNode & rFirstNode(pFrame->GetMergedPara()
207 ? *pFrame->GetMergedPara()->pFirstNode
209 assert(pNode == pStartNode
211 : &rFirstNode == pNode);
213 pFrame->SetMergedPara(
nullptr);
215 *pFrame, rFirstNode,
eMode));
221 if (pFrame->GetMergedPara())
223 pLast =
const_cast<SwTextNode*
>(pFrame->GetMergedPara()->pLastNode);
246 bool isAppendObjsCalled(
false);
254 currentStart.nNode.GetNode().IsTableNode()
255 ?
static_cast<SwStartNode*
>(currentStart.nNode.GetNode().GetTableNode())
256 : static_cast<SwStartNode*>(currentStart.nNode.GetNode().GetSectionNode()));
257 assert(pTableOrSectionNode);
268 isAppendObjsCalled =
true;
271 currentStart.nContent.Assign(currentStart.nNode.GetNode().GetContentNode(), 0);
272 pStartNode = currentStart.nNode.GetNode().GetTextNode();
274 if (currentStart < *rPam.
End())
279 std::vector<SwTextFrame*> frames;
283 if (pFrame->getRootFrame()->HasMergedParas())
285 frames.push_back(pFrame);
291 assert(std::none_of(layouts.begin(), layouts.end(),
292 [](
SwRootFrame const*
const pLayout) {
return pLayout->IsHideRedlines(); }));
303 if (
auto const pMergedPara = pFrame->GetMergedPara())
305 pLast =
const_cast<SwTextNode*
>(pMergedPara->pLastNode);
306 assert(pNode == pStartNode
308 : pMergedPara->pFirstNode == pNode);
310 SwTextNode & rFirstNode(*pMergedPara->pFirstNode);
311 pFrame->SetMergedPara(
nullptr);
313 *pFrame, rFirstNode,
eMode));
326 isAppendObjsCalled =
true;
339 if (!isAppendObjsCalled)
343 if (pLayout->HasMergedParas())
378 if (pToNode !=
nullptr && pFromNode !=
nullptr && pToNode != pFromNode)
380 const SwPaM aPam(*pToNode);
381 SwDoc& rDoc = aPam.GetDoc();
385 if (bCopy && pFromColl != pToColl)
401 bool bSameSet = aTmp == aTmp2;
405 for( sal_uInt16 nItem = 0; nItem < aTmp.TotalCount(); ++nItem)
407 sal_uInt16 nWhich = aTmp.GetWhichByPos(nItem);
408 if( SfxItemState::SET == aTmp.GetItemState( nWhich,
false ) &&
409 SfxItemState::SET != aTmp2.GetItemState( nWhich,
false ) )
410 aTmp2.Put( aTmp.GetPool()->GetDefaultItem(nWhich), nWhich );
414 if (bCopy && !bSameSet)
416 else if (!bCopy && (!bSameSet || pFromColl != pToColl))
429 SwPosition *pRStt =
nullptr, *pREnd =
nullptr;
431 if( pSttRng && pEndRng )
433 pRStt = pRedl->
Start();
434 pREnd = pRedl->
End();
442 case RedlineType::Insert:
443 case RedlineType::Format:
445 bool bCheck =
false, bReplace =
false;
449 if( *pSttRng == *pRStt )
453 if( *pEndRng != *pREnd )
458 rArr.
Insert( pNew ); ++rPos;
460 pRedl->
SetEnd( *pSttRng, pREnd );
471 pRedl->
SetEnd( *pSttRng, pREnd );
492 case RedlineType::Delete:
495 const SwPosition *pDelStt =
nullptr, *pDelEnd =
nullptr;
496 bool bDelRedl =
false;
529 pDelStt = pRedl->
Start();
530 pDelEnd = pRedl->
End();
538 if( pDelStt && pDelEnd )
540 SwPaM aPam( *pDelStt, *pDelEnd );
543 pRStt = pRedl->
Start();
544 pREnd = pRedl->
End();
547 if( pCSttNd && pCEndNd && pRStt && pREnd && pRStt->
nContent == 0 )
548 lcl_CopyStyle(*pREnd, *pRStt);
556 if( pCSttNd && pCEndNd )
558 else if (pCSttNd && !pCEndNd)
560 aPam.GetBound().nContent.Assign(
nullptr, 0 );
561 aPam.GetBound(
false ).nContent.Assign(
nullptr, 0 );
575 case RedlineType::FmtColl:
579 case RedlineType::ParagraphFormat:
597 SwPosition *pRStt =
nullptr, *pREnd =
nullptr;
599 if( pSttRng && pEndRng )
601 pRStt = pRedl->
Start();
602 pREnd = pRedl->
End();
610 case RedlineType::Insert:
612 const SwPosition *pDelStt =
nullptr, *pDelEnd =
nullptr;
613 bool bDelRedl =
false;
646 pDelStt = pRedl->
Start();
647 pDelEnd = pRedl->
End();
655 if( pDelStt && pDelEnd )
657 SwPaM aPam( *pDelStt, *pDelEnd );
668 if( pCSttNd && pCEndNd )
670 else if (pCSttNd && !pCEndNd)
672 aPam.GetBound().nContent.Assign(
nullptr, 0 );
673 aPam.GetBound(
false ).nContent.Assign(
nullptr, 0 );
674 if (aPam.End()->nNode.GetNode().IsStartNode())
678 assert(!aPam.End()->nNode.GetNode().IsStartNode());
691 case RedlineType::Delete:
694 bool bCheck =
false, bReplace =
false;
695 SwPaM const updatePaM(pSttRng ? *pSttRng : *pRedl->
Start(),
696 pEndRng ? *pEndRng : *pRedl->
End());
710 if( *pSttRng == *pRStt )
719 if( *pEndRng != *pREnd )
724 rArr.
Insert( pCpy ); ++rPos;
729 pRedl->
SetEnd( *pSttRng, pREnd );
755 pRedl->
SetEnd( *pSttRng, pREnd );
774 rArr.
Insert( pNew ); ++rPos;
788 case RedlineType::Format:
789 case RedlineType::FmtColl:
790 case RedlineType::ParagraphFormat:
797 if ( pRedl->
GetType() == RedlineType::Format )
802 else if ( pRedl->
GetType() == RedlineType::ParagraphFormat )
815 constexpr std::pair<sal_uInt16, sal_uInt16> aResetableSetRange[] = {
820 for (
const auto& [nBegin, nEnd] : aResetableSetRange)
822 for (sal_uInt16 i = nBegin;
i <= nEnd; ++
i)
823 aResetAttrsArray.insert( i );
826 rDoc.
ResetAttrs(aPam,
false, aResetAttrsArray);
853 int lcl_AcceptRejectRedl( Fn_AcceptReject fn_AcceptReject,
865 ( *pFnd->
Start() != *pStt || *pFnd->
End() > *pEnd ))
868 if( (*fn_AcceptReject)( rArr, n, bCallDelete, pStt, pEnd ))
875 bool bHasParagraphFormatChange =
false;
876 for(
int m = 0 ;
m < 2 && !bHasParagraphFormatChange; ++
m )
883 if( *pTmp->
End() <= *pEnd )
885 if( (m > 0 || RedlineType::ParagraphFormat == pTmp->
GetType()) &&
886 (*fn_AcceptReject)( rArr, o, bCallDelete,
nullptr, nullptr ))
888 bHasParagraphFormatChange =
true;
894 if( *pTmp->
Start() < *pEnd )
897 if( (m > 0 || RedlineType::ParagraphFormat == pTmp->
GetType()) &&
898 (*fn_AcceptReject)( rArr, o, bCallDelete, pStt, pEnd ))
900 bHasParagraphFormatChange =
true;
912 void lcl_AdjustRedlineRange(
SwPaM& rPam )
933 if( pEnd->nNode.GetNode().IsContentNode() &&
934 !rDoc.
GetNodes()[ pEnd->nNode.GetIndex() + 1 ]->IsContentNode() &&
935 pEnd->nContent.GetIndex() == pEnd->nNode.GetNode().GetContentNode()->Len() )
942 pEnd->nNode.GetIndex() + 1 )
950 class TemporaryRedlineUpdater
954 std::shared_ptr<SwUnoCursor> m_pCursor;
957 : m_rRedline(rRedline)
958 , m_pCursor(rDoc.CreateUnoCursor(*rRedline.GetPoint(), false))
963 *m_pCursor->GetMark() = *m_rRedline.
GetMark();
968 ~TemporaryRedlineUpdater()
970 static_cast<SwPaM&
>(m_rRedline) = *m_pCursor;
978 DocumentRedlineManager::DocumentRedlineManager(
SwDoc& i_rSwdoc)
983 , mbIsRedlineMove(false)
984 , mnAutoFormatRedlnCommentNo(0)
1034 if (pLayout->IsHideRedlines())
1036 pLayout->SetHideRedlines(
false);
1037 hiddenLayouts.
insert(pLayout);
1042 for (sal_uInt16 nLoop = 1; nLoop <= 2; ++nLoop)
1046 (pRedline->*pFnc)(nLoop, i,
false);
1048 || (*mpRedlineTable)[i] != pRedline)
1063 pLayout->SetHideRedlines(
true);
1068 meRedlineFlags = eMode;
1161 bool bMerged =
false;
1183 if( pTextNode ==
nullptr )
1187 OSL_ENSURE(
false,
"Redline start: non-text-node with content" );
1195 OSL_ENSURE(
false,
"Redline start: index after text" );
1200 if( pTextNode ==
nullptr )
1202 if( pEnd->nContent > 0 )
1204 OSL_ENSURE(
false,
"Redline end: non-text-node with content" );
1210 if( pEnd->nContent > pTextNode->
Len() )
1212 OSL_ENSURE(
false,
"Redline end: index after text" );
1213 pEnd->nContent = pTextNode->
Len();
1217 if( ( *pStt == *pEnd ) &&
1223 bool bCompress =
false;
1240 if( ( *pRStt == *pREnd ) &&
1251 case RedlineType::Insert:
1254 case RedlineType::Insert:
1257 bool bDelete =
false;
1261 IsPrevPos( *pREnd, *pStt ) ) ||
1266 ( *(*mpRedlineTable)[ n+1 ]->Start() >= *pEnd &&
1267 *(*mpRedlineTable)[ n+1 ]->Start() != *pREnd ) ) )
1269 pRedl->
SetEnd( *pEnd, pREnd );
1281 IsPrevPos( *pEnd, *pRStt ) ) ||
1286 *(*mpRedlineTable)[ n-1 ]->End() != *pRStt ))
1306 if( ( *pStt == *pEnd ) &&
1313 if( ( *pStt == *pEnd ) &&
1335 if( *pEnd != *pREnd )
1341 pRedl->
SetEnd( *pStt, pREnd );
1342 if( ( *pStt == *pRStt ) &&
1363 pSplit->
SetEnd( *pRStt );
1366 if( *pStt == *pEnd && pNewRedl->
GetContentIdx() == nullptr )
1382 if( ( *pStt == *pEnd ) &&
1391 case RedlineType::Delete:
1395 if( *pEnd != *pREnd )
1401 pRedl->
SetEnd( *pStt, pREnd );
1402 if( ( *pStt == *pRStt ) &&
1423 pSplit->
SetEnd( *pRStt );
1426 if( *pStt == *pEnd && pNewRedl->
GetContentIdx() == nullptr )
1445 case RedlineType::Format:
1457 pRedl->
SetEnd( *pStt, pREnd );
1476 if( *pEnd != *pREnd )
1478 if( *pEnd != *pRStt )
1482 pRedl->
SetEnd( *pStt, pREnd );
1491 pRedl->
SetEnd( *pStt, pREnd );
1502 case RedlineType::Delete:
1505 case RedlineType::Delete:
1512 if (*pEnd == *pREnd)
1514 pNewRedl->
SetEnd(*pRStt, pEnd);
1516 else if (*pStt == *pRStt)
1524 pNewRedl->
SetEnd( *pRStt, pEnd );
1547 pNewRedl->
SetStart( *pRStt, pStt );
1549 pNewRedl->
SetEnd( *pREnd, pEnd );
1554 pNewRedl->
SetStart( *pREnd, pStt );
1556 pNewRedl->
SetEnd( *pRStt, pEnd );
1572 pRStt = pRedl->
Start();
1573 pREnd = pRedl->
End();
1579 pNewRedl->
SetStart( *pRStt, pStt );
1581 pNewRedl->
SetEnd( *pREnd, pEnd );
1588 if( *(pNewRedl->
Start()) <= *pREnd )
1609 case RedlineType::Insert:
1639 pEnd->nNode.GetNode().IsEndNode() )
1642 pEnd->nContent.Assign(
1643 pEnd->nNode.GetNode().GetTextNode(), 0);
1651 if( !bCallDelete && !bDec && *pEnd == *pREnd )
1656 else if ( bCallDelete || !bDec )
1671 TemporaryRedlineUpdater
const u(
m_rDoc, *pNewRedl);
1681 SwPaM aPam( *pRStt, *pEnd );
1683 if( *pEnd == *pREnd )
1695 TemporaryRedlineUpdater
const u(
m_rDoc, *pNewRedl);
1705 SwPaM aPam( *pStt, *pREnd );
1707 if( *pStt == *pRStt )
1713 pRedl->
SetEnd( *pStt, pREnd );
1717 TemporaryRedlineUpdater
const u(
m_rDoc, *pNewRedl);
1755 if( *pRStt == *pStt )
1761 pNewRedl->
PushData( *pRedl,
false );
1771 pNewRedl->
PushData( *pRedl,
false );
1772 if( *pREnd != *pEnd )
1777 pRedl->
SetEnd( *pStt, pREnd );
1791 if( *pEnd == *pREnd )
1793 pNewRedl->
SetEnd( *pRStt, pEnd );
1795 else if (*pStt == *pRStt)
1803 pNewRedl->
SetStart( *pREnd, pStt );
1811 if( *pEnd == *pREnd )
1814 pNewRedl->
SetEnd( *pRStt, pEnd );
1827 pNewRedl->
SetEnd( *pRStt, pEnd );
1839 if( *pStt == *pRStt )
1842 pNewRedl->
SetStart( *pREnd, pStt );
1855 pNewRedl->
SetStart( *pREnd, pStt );
1888 case RedlineType::Format:
1900 pRedl->
SetEnd( *pStt, pREnd );
1914 if( *pEnd != *pREnd )
1916 if( *pEnd != *pRStt )
1920 pRedl->
SetEnd( *pStt, pREnd );
1921 if( ( *pStt == *pRStt ) &&
1930 pRedl->
SetEnd( *pStt, pREnd );
1941 case RedlineType::Format:
1944 case RedlineType::Insert:
1945 case RedlineType::Delete:
1949 pNewRedl->
SetEnd( *pRStt, pEnd );
1953 pNewRedl->
SetStart( *pREnd, pStt );
1965 if (*pEnd == *pREnd)
1967 pNewRedl->
SetEnd(*pRStt, pEnd);
1969 else if (*pStt == *pRStt)
1977 pNewRedl->
SetEnd( *pRStt, pEnd );
1987 case RedlineType::Format:
2008 else if( *pREnd == *pEnd )
2010 pRedl->
SetEnd( *pStt, pREnd );
2011 else if( *pRStt == *pStt )
2026 pRedl->
SetEnd( *pStt, pREnd );
2041 pNewRedl->
SetStart( *pRStt, pStt );
2043 pNewRedl->
SetEnd( *pREnd, pEnd );
2048 pNewRedl->
SetStart( *pREnd, pStt );
2050 pNewRedl->
SetEnd( *pRStt, pEnd );
2056 *(*mpRedlineTable)[ n-1 ]->End() < *pStt )
2060 pNewRedl->
SetEnd( *pREnd, pEnd );
2069 *(*mpRedlineTable)[ n+1 ]->Start() < *pEnd )
2073 pNewRedl->
SetStart( *pRStt, pStt );
2087 case RedlineType::FmtColl:
2098 if( ( *pStt == *pEnd ) &&
2106 if ( bCallDelete && RedlineType::Delete == pNewRedl->
GetType() )
2124 while (pDelNode !=
nullptr && pTextNd !=
nullptr && pDelNd->
GetIndex() < pTextNd->
GetIndex())
2127 if (pTextNode && pDelNode != pTextNode )
2138 pNewRedl->
SetEnd( aPos );
2144 std::unique_ptr<SwRedlineExtraData_FormatColl> xRedlineExtraData;
2147 xRedlineExtraData.reset(pExtraData);
2153 if ( pExtraData || *pPar->
Start() != *pPar->
End() )
2160 lcl_CopyStyle(*pStt, aPos);
2170 assert(ret || !pNewRedl);
2171 if (ret && !pNewRedl)
2183 if( bCallDelete && RedlineType::Delete == pNewRedl->
GetType() )
2197 return (
nullptr != pNewRedl)
2241 return nullptr != pNewRedl;
2283 return nullptr != pNewRedl;
2301 * pCur = (*mpRedlineTable)[ n ];
2303 * pPrevEnd = pPrevStt == pPrev->
GetPoint()
2306 * pCurEnd = pCurStt == pCur->GetPoint()
2307 ? pCur->GetMark() : pCur->GetPoint();
2308 if( *pPrevEnd == *pCurStt && pPrev->
CanCombine( *pCur ) &&
2315 pPrev->
Show(0, nPrevIndex);
2318 pPrev->
SetEnd( *pCur->End() );
2322 (pPrev->*pFnc)(0, nPrevIndex,
false);
2342 if (*pRedlineStart <= *pStt && *pStt <= *pRedlineEnd &&
2343 *pRedlineStart <= *pEnd && *pEnd <= *pRedlineEnd)
2347 if (*pStt == *pRedlineStart)
2349 if (*pEnd == *pRedlineEnd)
2357 pRedline->
SetEnd( *pStt, pRedlineEnd );
2362 *pRedlineStart = *pEnd;
2366 *pRedlineEnd = *pStt;
2384 else if (*pEnd < *pRedlineStart)
2403 if( pUndo->GetRedlSaveCount() )
2417 if( RedlineType::Any != nDelType && nDelType != pRedl->
GetType() )
2444 pRedl->
SetEnd( *pStt, pREnd );
2459 if( *pRStt == *pStt )
2471 if( *pREnd != *pEnd )
2479 pRedl->
SetEnd( *pStt, pREnd );
2537 if( nPt < nMk ) {
tools::Long nTmp = nMk; nMk = nPt; nPt = nTmp; }
2539 if( ( RedlineType::Any == nType || nType == pTmp->
GetType()) &&
2540 nMk <= nNdIdx && nNdIdx <= nPt )
2555 SwNodeIndex pEndNodeIndex(currentEnd.nNode.GetNode());
2558 n < mpRedlineTable->size(); ++n )
2569 if ( currentStart < *pTmp->
End() && *pTmp->
Start() <= currentEnd &&
2571 ( !bStartOrEndInRange ||
2572 ( currentStart <= *pTmp->
Start() || *pTmp->
End() <= currentEnd ) ) )
2589 nM = nU + ( nO - nU ) / 2;
2592 const SwPosition* pEnd = pStt == pRedl->GetPoint()
2594 : pRedl->GetPoint();
2597 : ( *pStt <= rPos && rPos < *pEnd ) )
2603 pRedl = (*mpRedlineTable)[ nM ];
2609 if( RedlineType::Format == pRedl->GetType() )
2612 rPos <= *(*mpRedlineTable)[ nM - 1 ]->End() &&
2613 ( RedlineType::Insert == (*mpRedlineTable)[ nM - 1 ]->GetType() ) )
2616 pRedl = (*mpRedlineTable)[ nM ];
2618 else if( ( nM + 1 ) <= nO && rPos >= *(*mpRedlineTable)[ nM + 1 ]->Start() &&
2619 rPos <= *(*mpRedlineTable)[ nM + 1 ]->End() &&
2620 ( RedlineType::Insert == (*mpRedlineTable)[ nM + 1 ]->GetType() ) )
2623 pRedl = (*mpRedlineTable)[ nM ];
2631 else if( *pEnd <= rPos )
2673 sal_uInt16 nSeqNo = pTmp->
GetSeqNo();
2680 std::make_unique<SwUndoAcceptRedline>(*pTmp) );
2697 pTmp = (*mpRedlineTable)[ nPos ];
2705 }
while( nLoopCnt );
2734 lcl_AdjustRedlineRange( aPam );
2742 int nRet = lcl_AcceptRejectRedl( lcl_AcceptRedline, *
mpRedlineTable,
2743 bCallDelete, aPam );
2776 const sal_uLong nEndIdx = pEnd->nNode.GetIndex();
2783 if( nPt < nMk ) {
tools::Long nTmp = nMk; nMk = nPt; nPt = nTmp; }
2785 if( RedlineType::ParagraphFormat == pTmp->
GetType() &&
2786 ( (nSttIdx <= nMk && nMk <= nEndIdx) || (nSttIdx <= nPt && nPt <= nEndIdx) ) )
2817 sal_uInt16 nSeqNo = pTmp->
GetSeqNo();
2824 std::make_unique<SwUndoRejectRedline>( *pTmp ) );
2841 pTmp = (*mpRedlineTable)[ nPos ];
2849 }
while( nLoopCnt );
2878 lcl_AdjustRedlineRange( aPam );
2886 int nRet = lcl_AcceptRejectRedl( lcl_RejectRedline, *
mpRedlineTable,
2887 bCallDelete, aPam );
2916 bool bSuccess =
true;
2941 if (!sUndoStr.isEmpty())
2967 if( !pCNd || ( aTmp == rSttPos.
nNode &&
2972 rSttPos = *pFnd->
End();
2980 pFnd = (*mpRedlineTable)[ n ];
2984 rSttPos = *pFnd->
End();
2996 while( ++n < mpRedlineTable->
size() )
3005 pRStt = pTmp->
Start();
3006 if( *pPrevEnd == *pRStt || IsPrevPos( *pPrevEnd, *pRStt ) )
3008 pPrevEnd = pTmp->
End();
3009 rSttPos = *pPrevEnd;
3053 if( n < mpRedlineTable->
size() )
3066 }
while( bRestart );
3093 if( !pCNd || ( aTmp == rSttPos.
nNode &&
3098 rSttPos = *pFnd->
Start();
3104 while( !pFnd && 0 < n )
3106 pFnd = (*mpRedlineTable)[ --n ];
3110 rSttPos = *pFnd->
Start();
3129 ( *pNextStt == *( pREnd = pTmp->
End() ) ||
3130 IsPrevPos( *pREnd, *pNextStt )) )
3132 pNextStt = pTmp->
Start();
3133 rSttPos = *pNextStt;
3193 }
while( bRestart );
3214 if( pStt != pEnd && *pTmp->
Start() > *pEnd )
3218 if( *pTmp->
End() >= *pEnd )
3233 return SW_MOD()->GetRedlineAuthor();
3239 return SW_MOD()->InsertRedlineAuthor(rNew);
3260 const uno::Sequence <sal_Int8>& rNewPassword)
const SwEndNode * EndOfSectionNode() const
Starts a section of nodes in the document model.
Represents the visualization of a paragraph.
virtual sal_Int32 Len() const
std::unique_ptr< SwRedlineTable > mpRedlineTable
bool CanCombine(const SwRangeRedline &rRedl) const
sal_uLong GetIndex() 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
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)
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
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)
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.
static SwContentNode * GoPrevious(SwNodeIndex *)
virtual const SwExtraRedlineTable & GetExtraRedlineTable() const override
virtual void UpdateRedlineAttr() override
Dialog to specify the properties of date form field.
IDocumentUndoRedo & GetIDocumentUndoRedo()
virtual bool DeleteAndJoin(SwPaM &, const bool bForceJoinNext=false)=0
complete delete of a given PaM
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?
void UpdateFields() const
virtual void UpdateExpFields(SwTextField *pField, bool bUpdateRefFields)=0
Pos1 end touches at Pos2 start.
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
bool IsOwnRedline(const SwRangeRedline &rRedl) const
virtual const SwRangeRedline * SelPrevRedline(SwPaM &rPam) const override
constexpr sal_uInt16 RES_PARATR_BEGIN(RES_TXTATR_END)
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
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 .
std::unique_ptr< sw::MergedPara > CheckParaRedlineMerge(SwTextFrame &rFrame, SwTextNode &rTextNode, FrameMode eMode)
sal_uLong GetIndex() const
Pos2 completely contained in Pos1.
void AddRemoveFlysAnchoredToFrameStartingAtNode(SwTextFrame &rFrame, SwTextNode &rTextNode, std::set< sal_uLong > *pSkipped)
rTextNode is the first one of the "new" merge - if rTextNode isn't the same as MergedPara::pFirstNode...
void SetInXMLImport(bool bNew)
o3tl::sorted_vector< SwRootFrame * > GetAllLayouts()
void ShowOriginal(sal_uInt16 nLoop, size_t nMyPos, bool bForced=false)
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.
bool IsContentNode() const
PaM is Point and Mark: a selection of the document model.
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()
vector_type::size_type size_type
virtual bool HasExtraRedlineTable() const override
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
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?
OUString SwResId(const char *pId)
virtual bool SplitRedline(const SwPaM &rPam) override
virtual bool HasRedline(const SwPaM &rPam, RedlineType nType, bool bStartOrEndInRange) const override
std::unique_ptr< SwExtraRedlineTable > mpExtraRedlineTable
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
constexpr sal_uInt16 RES_FRMATR_END(131)
sal_uLong EndOfSectionIndex() const
SwTextNode is a paragraph in the document model.
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
virtual ~DocumentRedlineManager() override
std::unique_ptr< OUString > mpAutoFormatRedlnComment
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)
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
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)
const SwPosition * End() const
constexpr sal_uInt16 RES_PARATR_END(82)
RedlineType GetType(sal_uInt16 nPos=0) const
bool IsAutoFormatRedline() const
virtual SwRedlineTable::size_type GetRedlinePos(const SwNode &rNode, RedlineType nType) const override
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!!!).
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.
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
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
void SetAutoFormatRedline(bool bFlag)
void CheckAnchoredFlyConsistency(SwDoc const &rDoc)
Base class of the Writer document model elements.
SwTextFormatColl * GetTextColl() const