20#include <libxml/xmlwriter.h>
21#include <boost/property_tree/json_parser.hpp>
23#include <osl/diagnose.h>
30#include <LibreOfficeKit/LibreOfficeKitEnums.h>
80 if( pCurrent == pNext )
97 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwExtraRedlineTable"));
98 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
100 for (sal_uInt16 nCurExtraRedlinePos = 0; nCurExtraRedlinePos <
GetSize(); ++nCurExtraRedlinePos)
103 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwExtraRedline"));
104 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
105 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"symbol"),
"%s", BAD_CAST(
typeid(*pExtraRedline).name()));
106 (void)xmlTextWriterEndElement(pWriter);
108 (void)xmlTextWriterEndElement(pWriter);
111#if OSL_DEBUG_LEVEL > 0
119 SwNode* pSttStart = pSttNode;
123 SwNode* pEndStart = pEndNode;
127 assert(pSttTab == pEndTab);
128 if( pSttTab != pEndTab )
130 assert(pSttTab || pSttStart == pEndStart);
131 if( !pSttTab && pSttStart != pEndStart )
157 for (sal_uInt16 nCurRedlinePos = 0; nCurRedlinePos <
GetSize(); )
161 if (pTableCellRedline)
165 if ( &rRedTable == &rTable )
172 if (RedlineType::Any == nRedlineTypeToDelete || nRedlineTypeToDelete == nRedlineType)
208 for(sal_uInt16 nCurRedlinePos = 0; nCurRedlinePos <
GetSize(); ++nCurRedlinePos )
213 if ( pRedTabLine == &rTableLine )
220 if( RedlineType::Any != nRedlineTypeToDelete && nRedlineTypeToDelete != nRedlineType )
252 for(sal_uInt16 nCurRedlinePos = 0; nCurRedlinePos <
GetSize(); ++nCurRedlinePos )
257 if ( pRedTabBox == &rTableBox )
264 if( RedlineType::Any != nRedlineTypeToDelete && nRedlineTypeToDelete != nRedlineType )
281void lcl_LOKInvalidateFrames(
const sw::BroadcastingModify& rMod,
const SwRootFrame* pLayout,
286 for (
SwFrame* pTmpFrame = aIter.First(); pTmpFrame; pTmpFrame = aIter.Next() )
288 if ((pTmpFrame->GetType() & nFrameType) &&
289 (!pLayout || pLayout == pTmpFrame->getRootFrame()) &&
290 (!pTmpFrame->IsFlowFrame() || !SwFlowFrame::CastFlowFrame( pTmpFrame )->IsFollow()))
294 pTmpFrame->InvalidateSize();
298 if (pTmpFrame->IsTextFrame())
300 auto pTextFrame =
static_cast<SwTextFrame*
>(pTmpFrame);
320 auto [pStartPos, pEndPos] = rCursor.
StartEnd();
322 lcl_LOKInvalidateFrames(*(pStartPos->GetNode().GetContentNode()),
326 lcl_LOKInvalidateFrames(*(pEndPos->GetNode().GetContentNode()),
331bool lcl_LOKRedlineNotificationEnabled()
333 static bool bDisableRedlineComments = getenv(
"DISABLE_REDLINE") !=
nullptr;
346 if (!lcl_LOKRedlineNotificationEnabled())
349 boost::property_tree::ptree aRedline;
353 aRedline.put(
"index", pRedline->
GetId());
354 aRedline.put(
"author", pRedline->
GetAuthorString(1).toUtf8().getStr());
357 aRedline.put(
"description", pRedline->
GetDescr().toUtf8().getStr());
359 aRedline.put(
"dateTime", sDateTime.toUtf8().getStr());
361 auto [pStartPos, pEndPos] = pRedline->
StartEnd();
364 if (pView && pContentNd)
373 std::vector<OString> aRects;
374 for(
const SwRect& rNextRect : *pRects)
375 aRects.push_back(rNextRect.SVRect().toString());
378 aRedline.put(
"textRange", sRects.getStr());
380 lcl_LOKInvalidateStartEndFrames(aCursor);
400 boost::property_tree::ptree aTree;
401 aTree.add_child(
"redline", aRedline);
402 std::stringstream aStream;
403 boost::property_tree::write_json(aStream, aTree);
404 std::string aPayload = aStream.str();
417 if(
p->HasValidRange() )
419 std::pair<vector_type::const_iterator, bool> rv =
maVector.
insert(
p );
426 if (
p->GetDoc().GetIDocumentUndoRedo().DoesUndo() ||
427 p->GetDoc().IsInWriterfilterImport() ||
428 p->GetDoc().IsInXMLImport() )
433 p->CallDisplayFunc(nP);
448 auto itNext = it + 1;
451 auto pNext = *itNext;
452 if (pCurr->End()->GetNodeIndex() >= pNext->Start()->GetNodeIndex())
460 auto pPrev = *(it - 1);
461 if (pPrev->End()->GetNodeIndex() >= pCurr->Start()->GetNodeIndex())
468 if(
p->HasValidRange() )
470 std::pair<vector_type::const_iterator, bool> rv =
maVector.
insert(
p );
471 rP = rv.first -
begin();
472 p->CallDisplayFunc(rP);
482std::vector<std::unique_ptr<SwRangeRedline>>
GetAllValidRanges(std::unique_ptr<SwRangeRedline> p)
484 std::vector<std::unique_ptr<SwRangeRedline>> ret;
486 auto [pStt, pEnd] =
p->StartEnd();
493 pC = rNds.
GoNext( &aNewStt );
499 if( aNewStt >= *pEnd )
502 std::unique_ptr<SwRangeRedline> pNew;
509 *pNew->GetPoint() = aNewStt;
524 pNew->GetPoint()->Assign(*pTab);
527 pNew->GetPoint()->SetContent( 0 );
532 if( *pNew->GetPoint() > *pEnd )
535 if( aNewStt.
GetNode() != pEnd->GetNode() )
548 }
while( aNewStt.
GetNodeIndex() < pEnd->GetNodeIndex() );
550 if( aNewStt.
GetNode() == pEnd->GetNode() )
557 if( aNewStt <= *pEnd )
558 *pNew->GetPoint() = aNewStt;
561 aNewStt = *pNew->GetPoint();
562#if OSL_DEBUG_LEVEL > 0
566 if( *pNew->GetPoint() != *pNew->GetMark() &&
567 pNew->HasValidRange())
569 ret.push_back(std::move(pNew));
572 if( aNewStt >= *pEnd )
574 pC = rNds.
GoNext( &aNewStt );
577 }
while( aNewStt < *pEnd );
586 bool bAnyIns =
false;
587 std::vector<std::unique_ptr<SwRangeRedline>> redlines(
589 for (std::unique_ptr<SwRangeRedline> & pRedline : redlines)
591 assert(pRedline->HasValidRange());
593 auto pTmpRedline = pRedline.release();
594 if (
Insert(pTmpRedline, nInsPos))
596 pTmpRedline->CallDisplayFunc(nInsPos);
598 if (pInsPos && *pInsPos < nInsPos)
637 SwDoc* pDoc =
nullptr;
638 if( !nP && 1 ==
size() )
673 return nSttPos + 1 <
size()
674 ?
FindNextSeqNo(
operator[]( nSttPos )->GetSeqNo(), nSttPos+1 )
680 return nSttPos ?
FindPrevSeqNo(
operator[]( nSttPos )->GetSeqNo(), nSttPos-1 )
688 auto constexpr nLookahead = 20;
690 if( nSeqNo && nSttPos <
size() )
693 const size_type nTmp = nSttPos + nLookahead;
699 for( ; nSttPos < nEnd; ++nSttPos )
700 if( nSeqNo ==
operator[]( nSttPos )->GetSeqNo() )
711 auto constexpr nLookahead = 20;
713 if( nSeqNo && nSttPos <
size() )
716 if( nSttPos > nLookahead )
717 nEnd = nSttPos - nLookahead;
720 while( nSttPos > nEnd )
721 if( nSeqNo ==
operator[]( --nSttPos )->GetSeqNo() )
740 auto [pRStt, pREnd] = pTmp->
StartEnd();
741 if( bNext ? *pRStt <= rSttPos : *pRStt < rSttPos )
743 if( bNext ? *pREnd > rSttPos : *pREnd >= rSttPos )
759 auto constexpr nLookahead = 20;
764 if ( RedlineType::Delete == nPairType )
765 nPairType = RedlineType::Insert;
766 else if ( RedlineType::Insert == nPairType )
767 nPairType = RedlineType::Delete;
772 bool bDeletePaM =
false;
786 const OUString sTrimmed = pPaM->
GetText().trim();
791 if ( sTrimmed.getLength() < 6 || sTrimmed.indexOf(
' ') == -1 )
802 rPos = rPos > nLookahead ? rPos - nLookahead : 0;
803 for ( ; rPos < nEnd && !bRet ; ++rPos )
808 if ( nPairType != pPair->
GetType() ||
814 bool bDeletePairPaM =
false;
826 bDeletePairPaM =
true;
839 if ( bDeletePairPaM )
851 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwRedlineTable"));
852 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
855 operator[](nCurRedlinePos)->dumpAsXml(pWriter);
857 (void)xmlTextWriterEndElement(pWriter);
874 sal_uInt16 nPoolFormatId,
877 : m_sFormatNm(
std::move(aColl)), m_nPoolId(nPoolFormatId), m_bFormatAll(bFormatAll)
879 if( pItemSet && pItemSet->
Count() )
1003 for(
size_t n = 0;
n < nEnd; ++
n )
1014 : m_pNext( nullptr ), m_pExtraData( nullptr ),
1016 m_nAuthor( nAut ),
m_eType( eT ), m_nSeqNo( 0 ), m_bAutoFormat(false), m_bMoved(false)
1024 : m_pNext( ( bCpyNext && rCpy.m_pNext ) ? new
SwRedlineData( *rCpy.m_pNext ) : nullptr )
1025 , m_pExtraData( rCpy.m_pExtraData ? rCpy.m_pExtraData->CreateNew() : nullptr )
1026 , m_sComment( rCpy.m_sComment )
1027 , m_aStamp( rCpy.m_aStamp )
1028 , m_nAuthor( rCpy.m_nAuthor )
1030 , m_nSeqNo( rCpy.m_nSeqNo )
1031 , m_bAutoFormat(false)
1032 , m_bMoved( rCpy.m_bMoved )
1039 : m_pNext(pNxt), m_pExtraData(nullptr), m_sComment(
std::move(aCmnt)), m_aStamp(rDT),
1040 m_nAuthor(nAut),
m_eType(eT), m_nSeqNo(0), m_bAutoFormat(false), m_bMoved(false)
1053 auto const & [
min,
max] = std::minmax(t1, t2);
1056 if (
min >=
DateTime({31, 12, std::numeric_limits<sal_Int16>::max()}, {23, 59})) {
1092 STR_UNDO_REDLINE_INSERT,
1093 STR_UNDO_REDLINE_DELETE,
1094 STR_UNDO_REDLINE_FORMAT,
1095 STR_UNDO_REDLINE_TABLE,
1096 STR_UNDO_REDLINE_FMTCOLL,
1097 STR_UNDO_REDLINE_PARAGRAPH_FORMAT,
1098 STR_UNDO_REDLINE_TABLE_ROW_INSERT,
1099 STR_UNDO_REDLINE_TABLE_ROW_DELETE,
1100 STR_UNDO_REDLINE_TABLE_CELL_INSERT,
1101 STR_UNDO_REDLINE_TABLE_CELL_DELETE
1112 :
SwPaM( *rPam.GetMark(), *rPam.GetPoint() ),
1113 m_pRedlineData( new
SwRedlineData( eTyp, GetDoc().getIDocumentRedlineAccess().GetRedlineAuthor() ) ),
1114 m_nId( s_nLastId++ )
1128 ?
SwResId(STR_REDLINE_COMMENT_DELETED)
1129 :
SwResId(STR_REDLINE_COMMENT_ADDED) );
1134 :
SwPaM( *rPam.GetMark(), *rPam.GetPoint() ),
1136 m_nId( s_nLastId++ )
1150 m_nId( s_nLastId++ )
1160 :
SwPaM( *rCpy.GetMark(), *rCpy.GetPoint() ),
1162 m_nId( s_nLastId++ )
1178 if( !
GetDoc().IsInDtor() )
1187 if (!lcl_LOKRedlineNotificationEnabled())
1193 if (rRedTable[
i] == &rRedline)
1203 if (!lcl_LOKRedlineNotificationEnabled())
1215 if( !pSttPtr ) pSttPtr =
Start();
1223 if( !pEndPtr ) pEndPtr =
End();
1260 bool bIsShowChangesInMargin =
false;
1267 bIsShowChangesInMargin =
SW_MOD()->GetUsrPref(
false)->IsShowChangesInMargin();
1270 if( 1 > nLoop && !bIsShowChangesInMargin )
1279 case RedlineType::Insert:
1284 case RedlineType::Delete:
1300 case RedlineType::Format:
1301 case RedlineType::Table:
1319 case RedlineType::Insert:
1325 case RedlineType::Delete:
1335 case RedlineType::Format:
1336 case RedlineType::Table:
1361 case RedlineType::Insert:
1371 case RedlineType::Delete:
1377 case RedlineType::Format:
1378 case RedlineType::Table:
1393 nEndNd = pREnd->GetNodeIndex();
1394 sal_Int32 nSttCnt = pRStt->GetContentIndex();
1395 sal_Int32 nEndCnt = pREnd->GetContentIndex();
1407 n == nSttNd ? nSttCnt : 0,
1408 n == nEndNd ? nEndCnt : pNd->
GetText().getLength(),
1414 if (
GetType() == RedlineType::Delete)
1416 sal_Int32
const nStart(
n == nSttNd ? nSttCnt : 0);
1417 sal_Int32
const nLen((
n == nEndNd ? nEndCnt : pNd->
GetText().getLength()) - nStart);
1421 pNd->CallSwClientNotify(hint);
1426 pNd->CallSwClientNotify(hint);
1438 if( pRStt->GetNodeIndex() < nNdIdx )
1440 if( pREnd->GetNodeIndex() > nNdIdx )
1445 else if (pREnd->GetNodeIndex() == nNdIdx)
1448 rEnd = pREnd->GetContentIndex();
1456 else if( pRStt->GetNodeIndex() == nNdIdx )
1458 rStart = pRStt->GetContentIndex();
1459 if( pREnd->GetNodeIndex() == nNdIdx )
1460 rEnd = pREnd->GetContentIndex();
1479 SwPosition const& rStartPos((**iter).GetMarkStart());
1480 if ( *pStt <= rStartPos && rStartPos < *pEnd )
1488 sal_Int32 nLen = (*pStt == rStartPos) ? 1 : 0;
1514 SwPaM aPam( *pStt, *pEnd );
1525 if( pRedl->GetBound() == *pStt )
1526 pRedl->GetBound() = *pEnd;
1527 if( pRedl->GetBound(
false) == *pStt )
1528 pRedl->GetBound(
false) = *pEnd;
1534 if( pCSttNd || pCEndNd )
1547 if( pCSttNd && pCEndNd )
1555 if( pCSttNd && !pCEndNd )
1621 if( pCEndNd && pCEndNd != pCSttNd )
1662 SwPaM aPam( *pStt, *pEnd );
1673 if( pRedl->GetBound() == *pStt )
1674 pRedl->GetBound() = *pEnd;
1675 if( pRedl->GetBound(
false) == *pStt )
1676 pRedl->GetBound(
false) = *pEnd;
1680 if( pCSttNd && pCEndNd )
1686 else if( pCSttNd || pCEndNd )
1688 if( pCSttNd && !pCEndNd )
1702 for(
bool bBreak =
false; !bBreak &&
n > 0; )
1708 rTable[
n ]->GetBound() = *pEnd;
1713 rTable[
n ]->GetBound(
false) = *pEnd;
1744 std::vector<SwPosition*> aBeforeArr, aBehindArr;
1745 bool bBreak =
false;
1748 for(
n = nMyPos+1; !bBreak &&
n < rTable.
size(); ++
n )
1754 aBehindArr.push_back(&pRedl->
GetBound());
1760 aBehindArr.push_back(&pRedl->
GetBound(
false));
1764 for( bBreak =
false,
n = nMyPos; !bBreak &&
n ; )
1771 aBeforeArr.push_back(&pRedl->
GetBound());
1777 aBeforeArr.push_back(&pRedl->
GetBound(
false));
1849 for(
auto& pItem : aBeforeArr )
1851 for(
auto& pItem : aBehindArr )
1868 OSL_FAIL(
"SwRangeRedline::SetContentIdx: invalid state");
1881 OSL_FAIL(
"SwRangeRedline::ClearContentIdx: invalid state");
1919 sal_uInt16 nRet = 1;
1967 sal_uInt16 nP =
nPos;
1969 while (nP > 0 &&
nullptr != pCur->
m_pNext)
1976 SAL_WARN_IF( nP != 0,
"sw.core",
"Pos " <<
nPos <<
" is " << nP <<
" too big");
1986 SwPaM * pPaM =
nullptr;
1987 bool bDeletePaM =
false;
2005 sDescr = ( bSimplified ?
"" :
SwResId(STR_START_QUOTE) )
2006 + pTextAttr->GetFormatField().GetField()->GetFieldName()
2007 + ( bSimplified ?
"" :
SwResId(STR_END_QUOTE) );
2019 aResult = aRewriter.
Apply(aResult);
2025 sal_Int32
nPos = aTmpStr.indexOf(
SwResId(STR_LDOTS));
2038 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwRangeRedline"));
2040 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
2041 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"id"), BAD_CAST(OString::number(
GetSeqNo()).getStr()));
2042 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"author"), BAD_CAST(
SW_MOD()->GetRedlineAuthor(
GetAuthor()).toUtf8().getStr()));
2044 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"descr"), BAD_CAST(
const_cast<SwRangeRedline*
>(
this)->
GetDescr().toUtf8().getStr()));
2046 OString sRedlineType;
2049 case RedlineType::Insert:
2050 sRedlineType =
"REDLINE_INSERT";
2052 case RedlineType::Delete:
2053 sRedlineType =
"REDLINE_DELETE";
2055 case RedlineType::Format:
2056 sRedlineType =
"REDLINE_FORMAT";
2059 sRedlineType =
"UNKNOWN";
2062 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"type"), BAD_CAST(sRedlineType.getStr()));
2066 (void)xmlTextWriterEndElement(pWriter);
2109 : m_aRedlineData(rData)
2110 , m_rTableLine(rTableLine)
2119 : m_aRedlineData(rData)
2120 , m_rTableBox(rTableBox)
@ CheckPosInFly
check if target position is in fly anchored at source range
@ ShowDelete
show all deletes
@ ShowInsert
show all inserts
OUString SwRedlineTypeToOUString(RedlineType eType)
OUString DenoteSpecialCharacters(std::u16string_view aStr, bool bQuoted=true)
Denotes special characters in a string.
OUString ShortenString(const OUString &rStr, sal_Int32 nLength, std::u16string_view aFillStr)
Shortens a string to a maximum length.
const int nUndoStringLength
css::util::DateTime GetUNODateTime() const
virtual bool MoveRange(SwPaM &, SwPosition &, SwMoveFlags)=0
virtual bool AppendTextNode(SwPosition &rPos)=0
virtual bool DeleteAndJoin(SwPaM &, SwDeleteFlags flags=SwDeleteFlags::Default)=0
complete delete of a given PaM
virtual bool CopyRange(SwPaM &rPam, SwPosition &rPos, SwCopyFlags flags) const =0
Copy a selected content range to a position.
virtual void DeleteSection(SwNode *pNode)=0
Delete section containing the node.
virtual void DeleteRange(SwPaM &)=0
Delete a range SwFlyFrameFormat.
virtual bool DelFullPara(SwPaM &)=0
Delete full paragraphs.
virtual void MoveAndJoin(SwPaM &, SwPosition &)=0
Move a range.
virtual void InsertItemSet(const SwPaM &rRg, const SfxItemSet &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr)=0
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
Provides access to the marks of a document.
virtual const_iterator_t getAnnotationMarksEnd() const =0
virtual ::sw::mark::IMark * makeAnnotationBookmark(const SwPaM &rPaM, const OUString &rProposedName, MarkType eMark, ::sw::mark::InsertMode eMode, SwPosition const *pSepPos=nullptr)=0
virtual const_iterator_t getAnnotationMarksBegin() const =0
virtual const_iterator_t findAnnotationBookmark(const OUString &rName) const =0
virtual const_iterator_t getBookmarksEnd() const =0
returns a STL-like random access iterator to the end of the sequence of IBookmarks.
virtual bool IsRedlineMove() const =0
virtual void SetRedlineMove(bool bFlag)=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.
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
const SfxPoolItem * GetCurItem() const
const SfxPoolItem * NextItem()
ViewShellDocId GetDocId() const override
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetNext(const SfxViewShell &rPrev, bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetFirst(bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
virtual void libreOfficeKitViewCallback(int nType, const char *pPayload) const override
SwFormatColl * GetFormatColl() const
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
virtual sal_Int32 Len() const
virtual SwFormatColl * ChgFormatColl(SwFormatColl *)
SwRect FindLayoutRect(const bool bPrtArea=false, const Point *pPoint=nullptr) const
bool IsCopyIsMove() const
IDocumentState const & getIDocumentState() const
void SetCopyIsMove(bool bFlag)
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
IDocumentMarkAccess * getIDocumentMarkAccess()
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
::sw::DocumentContentOperationsManager const & GetDocumentContentOperationsManager() const
SwTextFormatColl * FindTextFormatCollByName(const OUString &rName) 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>.
Base class of the Writer layout elements.
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.
SwNodeOffset GetIndex() const
SwNodes & GetNodes()
Node is in which nodes-array/doc?
bool IsContentNode() const
bool IsSectionNode() const
SwTableNode * FindTableNode()
Search table node, in which it is.
const SwStartNode * StartOfSectionNode() const
SwNodeOffset EndOfSectionIndex() const
SwContentNode * GetContentNode()
const SwEndNode * EndOfSectionNode() const
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
static SwStartNode * MakeEmptySection(SwNode &rWhere, SwStartNodeType=SwNormalStartNode)
Create an empty section of Start- and EndNote.
SwStartNode * MakeTextSection(const SwNode &rWhere, SwStartNodeType eSttNdTyp, SwTextFormatColl *pColl)
SwNode & GetEndOfRedlines() const
Section for all Redlines.
SwContentNode * GoNext(SwNodeIndex *) const
PaM is Point and Mark: a selection of the document model.
const SwPosition * GetMark() const
SwNode & GetPointNode() const
void dumpAsXml(xmlTextWriterPtr pWriter) const
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
std::pair< const SwPosition *, const SwPosition * > StartEnd() const
Because sometimes the cost of the operator<= can add up.
SwContentNode * GetPointContentNode() const
const SwPosition * End() const
SwPaM(SwPaM const &rPaM)=delete
SwPosition & GetBound(bool bOne=true)
const SwPosition * GetPoint() const
const SwPosition * Start() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
void CallDisplayFunc(size_t nMyPos)
void Show(sal_uInt16 nLoop, size_t nMyPos, bool bForced=false)
void InvalidateRange(Invalidation)
Initiate the layout.
const OUString & GetComment(sal_uInt16 nPos=0) const
sal_uInt16 GetStackCount() const
static sal_uInt32 s_nLastId
void MaybeNotifyRedlinePositionModification(tools::Long nTop)
std::size_t GetAuthor(sal_uInt16 nPos=0) const
const SwNodeIndex * GetContentIdx() const
void DelCopyOfSection(size_t nMyPos)
void CalcStartEnd(SwNodeOffset nNdIdx, sal_Int32 &rStart, sal_Int32 &rEnd) const
Calculates the intersection with text node number nNdIdx.
void Hide(sal_uInt16 nLoop, size_t nMyPos, bool bForced=false)
bool operator<(const SwRangeRedline &) const
std::optional< SwNodeIndex > m_oContentSect
OUString const & GetAuthorString(sal_uInt16 nPos=0) const
void dumpAsXml(xmlTextWriterPtr pWriter) const
bool IsAnnotation() const
virtual ~SwRangeRedline() override
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)
const DateTime & GetTimeStamp(sal_uInt16 nPos=0) const
bool HasValidRange() const
Do we have a valid selection?
std::optional< tools::Long > m_oLOKLastNodeTop
void SetContentIdx(const SwNodeIndex &)
void PushData(const SwRangeRedline &rRedl, bool bOwnAsNext=true)
void SetComment(const OUString &rS)
RedlineType GetType(sal_uInt16 nPos=0) const
SwRedlineData * m_pRedlineData
bool CanCombine(const SwRangeRedline &rRedl) const
void MoveFromSection(size_t nMyPos)
const SwRedlineData & GetRedlineData(sal_uInt16 nPos=0) const
sal_uInt16 GetSeqNo() const
SwRangeRedline(RedlineType eType, const SwPaM &rPam)
Of course Writer needs its own rectangles.
SwRedlineExtraData * m_pExtraData
OUString GetDescr() const
bool CanCombine(const SwRedlineData &rCmp) const
SwRedlineData(RedlineType eT, std::size_t nAut)
const OUString & GetComment() const
void SetExtraData(const SwRedlineExtraData *pData)
ExtraData is copied.
const DateTime & GetTimeStamp() const
RedlineType GetType() const
void CheckOverlapping(vector_type::const_iterator it)
size_type FindNextSeqNo(sal_uInt16 nSeqNo, size_type nSttPos) const
Search next or previous Redline with the same Seq.
bool InsertWithValidRanges(SwRangeRedline *&p, size_type *pInsPos=nullptr)
void dumpAsXml(xmlTextWriterPtr pWriter) const
size_type FindPrevOfSeqNo(size_type nSttPos) const
size_type FindPrevSeqNo(sal_uInt16 nSeqNo, size_type nSttPos) const
size_type FindNextOfSeqNo(size_type nSttPos) const
bool isMoved(size_type tableIndex) const
bool Insert(SwRangeRedline *&p)
static void LOKRedlineNotification(RedlineNotification eType, SwRangeRedline *pRedline)
Emits LOK notification about one addition / removal of a redline item.
bool m_bHasOverlappingElements
Sometimes we load bad data, and we need to know if we can use fast binary search, or if we have to fa...
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
void DeleteAndDestroyAll()
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.
const SwCursorShell * GetShell() const
Represents the current text cursor of one opened edit window.
virtual void FillRects() override
const Point & GetEndPos() const
const Point & GetSttPos() const
virtual void SetMark() override
Unless this is called, the getter method of Mark will return Point.
Starts a section of nodes in the document model.
SwTableBox is one table cell in the document model.
const SwStartNode * GetSttNd() const
Redline that holds information about a table-cell that had some change.
virtual ~SwTableCellRedline() override
SwTableCellRedline(const SwRedlineData &rData, const SwTableBox &rTableBox)
const SwTableBox & GetTableBox() const
const SwRedlineData & GetRedlineData() const
SwTableLine is one table row in the document model.
const SwTable & GetTable() const
Redline that holds information about a table-row that had some change.
const SwTableLine & GetTableLine() const
const SwRedlineData & GetRedlineData() const
virtual ~SwTableRowRedline() override
SwTableRowRedline(const SwRedlineData &rData, const SwTableLine &rTableLine)
SwTable is one table in the document model, containing rows (which contain cells).
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
Represents the style of a paragraph.
Represents the visualization of a paragraph.
void ClearPara()
Removes the Line information from the Cache but retains the entry itself.
SwTextNode is a paragraph in the document model.
void CopyCollFormat(SwTextNode &rDestNd, bool bUndoForChgFormatColl=true)
Copy collection with all auto formats to dest-node.
const OUString & GetText() const
void TriggerNodeUpdate(const sw::LegacyModifyHint &)
for hanging TextFormatCollections somewhere else (Outline-Numbering!)
SwTextFormatColl * GetTextColl() const
bool IsShowChangesInMargin() const
const SwViewOption * GetViewOptions() const
SwRootFrame * GetLayout() const
void InvalidateWindows(const SwRect &rRect)
SwWrtShell & GetWrtShell() const
const Value & back() const
const_iterator begin() const
std::vector< Value >::const_iterator const_iterator
const_iterator find(const Value &x) const
size_type erase(const Value &x)
void DeleteAndDestroyAll()
void erase_at(size_t index)
const_iterator end() const
const Value & front() const
std::pair< const_iterator, bool > insert(Value &&x)
void CopyWithFlyInFly(const SwNodeRange &rRg, SwNode &rInsPos, const std::pair< const SwPaM &, const SwPosition & > *pCopiedPaM=nullptr, bool bMakeNewFrames=true, bool bDelRedlines=true, bool bCopyFlyAtFly=false, SwCopyFlags flags=SwCopyFlags::Default) const
note: rRg/rInsPos exclude a partially selected start text node; pCopiedPaM includes a partially selec...
new delete redline is created
delete redline is removed
virtual void SetShortName(const OUString &)=0
virtual void SetKeyCode(const vcl::KeyCode &)=0
TOOLS_DLLPUBLIC OString DateTimeToOString(const DateTime &rDateTime)
struct _xmlTextWriter * xmlTextWriterPtr
void sw_DebugRedline(const SwDoc *pDoc)
const TranslateId STR_REDLINE_ARY[]
static bool CheckPosition(const SwPosition *pStt, const SwPosition *pEnd)
static bool deltaOneMinute(DateTime const &t1, DateTime const &t2)
void MaybeNotifyRedlineModification(SwRangeRedline &rRedline, SwDoc &rDoc)
static void lcl_storeAnnotationMarks(SwDoc &rDoc, const SwPosition *pStt, const SwPosition *pEnd)
const EnumerationType m_eType
constexpr TypedWhichId< SwFormatChg > RES_FMT_CHG(168)
const SfxPoolItem * GetDfltAttr(sal_uInt16 nWhich)
Get the default attribute from corresponding default attribute table.
#define SAL_WARN_IF(condition, area, stream)
std::unique_ptr< sal_Int32[]> pData
double getLength(const B2DPolygon &rCandidate)
OString join(std::string_view rSeparator, const std::vector< OString > &rSequence)
std::u16string_view trim(std::u16string_view str)
Dialog to specify the properties of date form field.
std::vector< std::unique_ptr< SwRangeRedline > > GetAllValidRanges(std::unique_ptr< SwRangeRedline > p)
OUString toISO8601(const css::util::DateTime &rDateTime)
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
SwNodeOffset abs(const SwNodeOffset &a)
SwContentNode * GoPreviousPos(SwPosition *pIdx, bool bChk)
SwContentNode * GetNode(SwPaM &rPam, bool &rbFirst, SwMoveFnCollection const &fnMove, bool const bInReadOnly, SwRootFrame const *const i_pLayout)
This function returns the next node in direction of search.
void GoEndSection(SwPosition *pPos)
go to the end of the current base section
@ RES_POOLCOLL_STANDARD
Standard.
bool operator()(SwRangeRedline *const &lhs, SwRangeRedline *const &rhs) const
Marks a position in the document model.
void Adjust(SwNodeOffset nDelta)
Adjust node position, and resets content position to zero.
void SetMark(const sw::mark::IMark *pMark)
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.
SwNodeOffset GetNodeIndex() const
const SwNodes & GetNodes() const
void SetRedline(SwRangeRedline *pRangeRedline)
sal_Int32 GetContentIndex() const
OUString SwResId(TranslateId aId)
std::vector< SwRect > SwRects
constexpr sal_Int32 COMPLETE_STRING