20#include <libxml/xmlwriter.h>
21#include <boost/property_tree/json_parser.hpp>
23#include <osl/diagnose.h>
31#include <LibreOfficeKit/LibreOfficeKitEnums.h>
81 if( pCurrent == pNext )
98 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwExtraRedlineTable"));
99 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
101 for (sal_uInt16 nCurExtraRedlinePos = 0; nCurExtraRedlinePos <
GetSize(); ++nCurExtraRedlinePos)
104 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwExtraRedline"));
105 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
106 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"symbol"),
"%s", BAD_CAST(
typeid(*pExtraRedline).name()));
107 (void)xmlTextWriterEndElement(pWriter);
109 (void)xmlTextWriterEndElement(pWriter);
112#if OSL_DEBUG_LEVEL > 0
120 SwNode* pSttStart = pSttNode;
124 SwNode* pEndStart = pEndNode;
128 assert(pSttTab == pEndTab);
129 if( pSttTab != pEndTab )
131 assert(pSttTab || pSttStart == pEndStart);
132 if( !pSttTab && pSttStart != pEndStart )
158 for (sal_uInt16 nCurRedlinePos = 0; nCurRedlinePos <
GetSize(); )
162 if (pTableCellRedline)
166 if ( &rRedTable == &rTable )
173 if (RedlineType::Any == nRedlineTypeToDelete || nRedlineTypeToDelete == nRedlineType)
209 for(sal_uInt16 nCurRedlinePos = 0; nCurRedlinePos <
GetSize(); ++nCurRedlinePos )
214 if ( pRedTabLine == &rTableLine )
221 if( RedlineType::Any != nRedlineTypeToDelete && nRedlineTypeToDelete != nRedlineType )
253 for(sal_uInt16 nCurRedlinePos = 0; nCurRedlinePos <
GetSize(); ++nCurRedlinePos )
258 if ( pRedTabBox == &rTableBox )
265 if( RedlineType::Any != nRedlineTypeToDelete && nRedlineTypeToDelete != nRedlineType )
282void lcl_LOKInvalidateFrames(
const sw::BroadcastingModify& rMod,
const SwRootFrame* pLayout,
287 for (
SwFrame* pTmpFrame = aIter.First(); pTmpFrame; pTmpFrame = aIter.Next() )
289 if ((pTmpFrame->GetType() & nFrameType) &&
290 (!pLayout || pLayout == pTmpFrame->getRootFrame()) &&
291 (!pTmpFrame->IsFlowFrame() || !SwFlowFrame::CastFlowFrame( pTmpFrame )->IsFollow()))
295 pTmpFrame->InvalidateSize();
299 if (pTmpFrame->IsTextFrame())
301 auto pTextFrame =
static_cast<SwTextFrame*
>(pTmpFrame);
321 auto [pStartPos, pEndPos] = rCursor.
StartEnd();
323 lcl_LOKInvalidateFrames(*(pStartPos->GetNode().GetContentNode()),
327 lcl_LOKInvalidateFrames(*(pEndPos->GetNode().GetContentNode()),
332bool lcl_LOKRedlineNotificationEnabled()
334 static bool bDisableRedlineComments = getenv(
"DISABLE_REDLINE") !=
nullptr;
347 if (!lcl_LOKRedlineNotificationEnabled())
350 boost::property_tree::ptree aRedline;
354 aRedline.put(
"index", pRedline->
GetId());
355 aRedline.put(
"author", pRedline->
GetAuthorString(1).toUtf8().getStr());
358 aRedline.put(
"description", pRedline->
GetDescr().toUtf8().getStr());
360 aRedline.put(
"dateTime", sDateTime.toUtf8().getStr());
362 auto [pStartPos, pEndPos] = pRedline->
StartEnd();
365 if (pView && pContentNd)
374 std::vector<OString> aRects;
375 for(
const SwRect& rNextRect : *pRects)
376 aRects.push_back(rNextRect.SVRect().toString());
379 aRedline.put(
"textRange", sRects.getStr());
381 lcl_LOKInvalidateStartEndFrames(aCursor);
401 boost::property_tree::ptree aTree;
402 aTree.add_child(
"redline", aRedline);
403 std::stringstream aStream;
404 boost::property_tree::write_json(aStream, aTree);
405 std::string aPayload = aStream.str();
418 if(
p->HasValidRange() )
420 std::pair<vector_type::const_iterator, bool> rv =
maVector.
insert(
p );
427 if (
p->GetDoc().GetIDocumentUndoRedo().DoesUndo() ||
428 p->GetDoc().IsInWriterfilterImport() ||
429 p->GetDoc().IsInXMLImport() )
434 p->CallDisplayFunc(nP);
449 auto itNext = it + 1;
452 auto pNext = *itNext;
453 if (pCurr->End()->GetNodeIndex() >= pNext->Start()->GetNodeIndex())
461 auto pPrev = *(it - 1);
462 if (pPrev->End()->GetNodeIndex() >= pCurr->Start()->GetNodeIndex())
469 if(
p->HasValidRange() )
471 std::pair<vector_type::const_iterator, bool> rv =
maVector.
insert(
p );
472 rP = rv.first -
begin();
473 p->CallDisplayFunc(rP);
483std::vector<std::unique_ptr<SwRangeRedline>>
GetAllValidRanges(std::unique_ptr<SwRangeRedline> p)
485 std::vector<std::unique_ptr<SwRangeRedline>> ret;
487 auto [pStt, pEnd] =
p->StartEnd();
494 pC = rNds.
GoNext( &aNewStt );
500 if( aNewStt >= *pEnd )
503 std::unique_ptr<SwRangeRedline> pNew;
510 *pNew->GetPoint() = aNewStt;
525 pNew->GetPoint()->Assign(*pTab);
528 pNew->GetPoint()->SetContent( 0 );
534 SwNode& rBoxNode = pNew->GetMark()->GetNode();
540 pNew->GetMark()->SetContent( 1 );
543 if( *pNew->GetPoint() > *pEnd )
546 if( aNewStt.
GetNode() != pEnd->GetNode() )
559 }
while( aNewStt.
GetNodeIndex() < pEnd->GetNodeIndex() );
561 if( aNewStt.
GetNode() == pEnd->GetNode() )
568 if( aNewStt <= *pEnd )
569 *pNew->GetPoint() = aNewStt;
572 aNewStt = *pNew->GetPoint();
573#if OSL_DEBUG_LEVEL > 0
577 if( *pNew->GetPoint() != *pNew->GetMark() &&
578 pNew->HasValidRange())
580 ret.push_back(std::move(pNew));
583 if( aNewStt >= *pEnd )
585 pC = rNds.
GoNext( &aNewStt );
588 }
while( aNewStt < *pEnd );
610 bool bAnyIns =
false;
611 bool bInsert = RedlineType::Insert ==
p->GetType();
612 SwNode* pSttNode = &
p->Start()->GetNode();
614 std::vector<std::unique_ptr<SwRangeRedline>> redlines(
621 for (std::unique_ptr<SwRangeRedline> & pRedline : redlines)
623 assert(pRedline->HasValidRange());
625 auto pTmpRedline = pRedline.release();
626 if (
Insert(pTmpRedline, nInsPos))
631 pTmpRedline->CallDisplayFunc(nInsPos);
633 if (pInsPos && *pInsPos < nInsPos)
672 SwDoc* pDoc =
nullptr;
673 if( !nP && 1 ==
size() )
708 return nSttPos + 1 <
size()
709 ?
FindNextSeqNo(
operator[]( nSttPos )->GetSeqNo(), nSttPos+1 )
715 return nSttPos ?
FindPrevSeqNo(
operator[]( nSttPos )->GetSeqNo(), nSttPos-1 )
723 auto constexpr nLookahead = 20;
725 if( nSeqNo && nSttPos <
size() )
728 const size_type nTmp = nSttPos + nLookahead;
734 for( ; nSttPos < nEnd; ++nSttPos )
735 if( nSeqNo ==
operator[]( nSttPos )->GetSeqNo() )
746 auto constexpr nLookahead = 20;
748 if( nSeqNo && nSttPos <
size() )
751 if( nSttPos > nLookahead )
752 nEnd = nSttPos - nLookahead;
755 while( nSttPos > nEnd )
756 if( nSeqNo ==
operator[]( --nSttPos )->GetSeqNo() )
775 auto [pRStt, pREnd] = pTmp->
StartEnd();
776 if( bNext ? *pRStt <= rSttPos : *pRStt < rSttPos )
778 if( bNext ? *pREnd > rSttPos : *pREnd >= rSttPos )
794 auto constexpr nLookahead = 20;
799 if ( RedlineType::Delete == nPairType )
800 nPairType = RedlineType::Insert;
801 else if ( RedlineType::Insert == nPairType )
802 nPairType = RedlineType::Delete;
807 bool bDeletePaM =
false;
821 const OUString sTrimmed = pPaM->
GetText().trim();
826 if ( sTrimmed.getLength() < 6 || sTrimmed.indexOf(
' ') == -1 )
837 rPos = rPos > nLookahead ? rPos - nLookahead : 0;
838 for ( ; rPos < nEnd && !bRet ; ++rPos )
843 if ( nPairType != pPair->
GetType() ||
849 bool bDeletePairPaM =
false;
861 bDeletePairPaM =
true;
874 if ( bDeletePairPaM )
886 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwRedlineTable"));
887 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
890 operator[](nCurRedlinePos)->dumpAsXml(pWriter);
892 (void)xmlTextWriterEndElement(pWriter);
909 sal_uInt16 nPoolFormatId,
912 : m_sFormatNm(
std::move(aColl)), m_nPoolId(nPoolFormatId), m_bFormatAll(bFormatAll)
914 if( pItemSet && pItemSet->
Count() )
1038 for(
size_t n = 0;
n < nEnd; ++
n )
1049 : m_pNext( nullptr ), m_pExtraData( nullptr ),
1051 m_nAuthor( nAut ),
m_eType( eT ), m_nSeqNo( 0 ), m_bAutoFormat(false), m_bMoved(false)
1059 : m_pNext( ( bCpyNext && rCpy.m_pNext ) ? new
SwRedlineData( *rCpy.m_pNext ) : nullptr )
1060 , m_pExtraData( rCpy.m_pExtraData ? rCpy.m_pExtraData->CreateNew() : nullptr )
1061 , m_sComment( rCpy.m_sComment )
1062 , m_aStamp( rCpy.m_aStamp )
1063 , m_nAuthor( rCpy.m_nAuthor )
1065 , m_nSeqNo( rCpy.m_nSeqNo )
1066 , m_bAutoFormat(false)
1067 , m_bMoved( rCpy.m_bMoved )
1074 : m_pNext(pNxt), m_pExtraData(nullptr), m_sComment(
std::move(aCmnt)), m_aStamp(rDT),
1075 m_nAuthor(nAut),
m_eType(eT), m_nSeqNo(0), m_bAutoFormat(false), m_bMoved(false)
1088 auto const & [
min,
max] = std::minmax(t1, t2);
1091 if (
min >=
DateTime({31, 12, std::numeric_limits<sal_Int16>::max()}, {23, 59})) {
1127 STR_UNDO_REDLINE_INSERT,
1128 STR_UNDO_REDLINE_DELETE,
1129 STR_UNDO_REDLINE_FORMAT,
1130 STR_UNDO_REDLINE_TABLE,
1131 STR_UNDO_REDLINE_FMTCOLL,
1132 STR_UNDO_REDLINE_PARAGRAPH_FORMAT,
1133 STR_UNDO_REDLINE_TABLE_ROW_INSERT,
1134 STR_UNDO_REDLINE_TABLE_ROW_DELETE,
1135 STR_UNDO_REDLINE_TABLE_CELL_INSERT,
1136 STR_UNDO_REDLINE_TABLE_CELL_DELETE
1147 :
SwPaM( *rPam.GetMark(), *rPam.GetPoint() ),
1148 m_pRedlineData( new
SwRedlineData( eTyp, GetDoc().getIDocumentRedlineAccess().GetRedlineAuthor() ) ),
1149 m_nId( s_nLastId++ )
1163 ?
SwResId(STR_REDLINE_COMMENT_DELETED)
1164 :
SwResId(STR_REDLINE_COMMENT_ADDED) );
1169 :
SwPaM( *rPam.GetMark(), *rPam.GetPoint() ),
1171 m_nId( s_nLastId++ )
1185 m_nId( s_nLastId++ )
1195 :
SwPaM( *rCpy.GetMark(), *rCpy.GetPoint() ),
1197 m_nId( s_nLastId++ )
1213 if( !
GetDoc().IsInDtor() )
1222 if (!lcl_LOKRedlineNotificationEnabled())
1228 if (rRedTable[
i] == &rRedline)
1238 if (!lcl_LOKRedlineNotificationEnabled())
1250 if( !pSttPtr ) pSttPtr =
Start();
1258 if( !pEndPtr ) pEndPtr =
End();
1295 bool bIsShowChangesInMargin =
false;
1302 bIsShowChangesInMargin =
SW_MOD()->GetUsrPref(
false)->IsShowChangesInMargin();
1305 if( 1 > nLoop && !bIsShowChangesInMargin )
1314 case RedlineType::Insert:
1319 case RedlineType::Delete:
1335 case RedlineType::Format:
1336 case RedlineType::Table:
1354 case RedlineType::Insert:
1360 case RedlineType::Delete:
1370 case RedlineType::Format:
1371 case RedlineType::Table:
1396 case RedlineType::Insert:
1406 case RedlineType::Delete:
1412 case RedlineType::Format:
1413 case RedlineType::Table:
1428 nEndNd = pREnd->GetNodeIndex();
1429 sal_Int32 nSttCnt = pRStt->GetContentIndex();
1430 sal_Int32 nEndCnt = pREnd->GetContentIndex();
1442 n == nSttNd ? nSttCnt : 0,
1443 n == nEndNd ? nEndCnt : pNd->
GetText().getLength(),
1449 if (
GetType() == RedlineType::Delete)
1451 sal_Int32
const nStart(
n == nSttNd ? nSttCnt : 0);
1452 sal_Int32
const nLen((
n == nEndNd ? nEndCnt : pNd->
GetText().getLength()) - nStart);
1456 pNd->CallSwClientNotify(hint);
1461 pNd->CallSwClientNotify(hint);
1473 if( pRStt->GetNodeIndex() < nNdIdx )
1475 if( pREnd->GetNodeIndex() > nNdIdx )
1480 else if (pREnd->GetNodeIndex() == nNdIdx)
1483 rEnd = pREnd->GetContentIndex();
1491 else if( pRStt->GetNodeIndex() == nNdIdx )
1493 rStart = pRStt->GetContentIndex();
1494 if( pREnd->GetNodeIndex() == nNdIdx )
1495 rEnd = pREnd->GetContentIndex();
1514 SwPosition const& rStartPos((**iter).GetMarkStart());
1515 if ( *pStt <= rStartPos && rStartPos < *pEnd )
1523 sal_Int32 nLen = (*pStt == rStartPos) ? 1 : 0;
1549 SwPaM aPam( *pStt, *pEnd );
1560 if( pRedl->GetBound() == *pStt )
1561 pRedl->GetBound() = *pEnd;
1562 if( pRedl->GetBound(
false) == *pStt )
1563 pRedl->GetBound(
false) = *pEnd;
1569 if( pCSttNd || pCEndNd )
1582 if( pCSttNd && pCEndNd )
1590 if( pCSttNd && !pCEndNd )
1656 if( pCEndNd && pCEndNd != pCSttNd )
1697 SwPaM aPam( *pStt, *pEnd );
1708 if( pRedl->GetBound() == *pStt )
1709 pRedl->GetBound() = *pEnd;
1710 if( pRedl->GetBound(
false) == *pStt )
1711 pRedl->GetBound(
false) = *pEnd;
1715 if( pCSttNd && pCEndNd )
1721 else if( pCSttNd || pCEndNd )
1723 if( pCSttNd && !pCEndNd )
1737 for(
bool bBreak =
false; !bBreak &&
n > 0; )
1743 rTable[
n ]->GetBound() = *pEnd;
1748 rTable[
n ]->GetBound(
false) = *pEnd;
1779 std::vector<SwPosition*> aBeforeArr, aBehindArr;
1780 bool bBreak =
false;
1783 for(
n = nMyPos+1; !bBreak &&
n < rTable.
size(); ++
n )
1789 aBehindArr.push_back(&pRedl->
GetBound());
1795 aBehindArr.push_back(&pRedl->
GetBound(
false));
1799 for( bBreak =
false,
n = nMyPos; !bBreak &&
n ; )
1806 aBeforeArr.push_back(&pRedl->
GetBound());
1812 aBeforeArr.push_back(&pRedl->
GetBound(
false));
1884 for(
auto& pItem : aBeforeArr )
1886 for(
auto& pItem : aBehindArr )
1903 OSL_FAIL(
"SwRangeRedline::SetContentIdx: invalid state");
1916 OSL_FAIL(
"SwRangeRedline::ClearContentIdx: invalid state");
1954 sal_uInt16 nRet = 1;
2002 sal_uInt16 nP =
nPos;
2004 while (nP > 0 &&
nullptr != pCur->
m_pNext)
2011 SAL_WARN_IF( nP != 0,
"sw.core",
"Pos " <<
nPos <<
" is " << nP <<
" too big");
2021 SwPaM * pPaM =
nullptr;
2022 bool bDeletePaM =
false;
2040 sDescr = ( bSimplified ?
"" :
SwResId(STR_START_QUOTE) )
2041 + pTextAttr->GetFormatField().GetField()->GetFieldName()
2042 + ( bSimplified ?
"" :
SwResId(STR_END_QUOTE) );
2054 aResult = aRewriter.
Apply(aResult);
2060 sal_Int32
nPos = aTmpStr.indexOf(
SwResId(STR_LDOTS));
2073 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwRangeRedline"));
2075 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
2076 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"id"), BAD_CAST(OString::number(
GetSeqNo()).getStr()));
2077 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"author"), BAD_CAST(
SW_MOD()->GetRedlineAuthor(
GetAuthor()).toUtf8().getStr()));
2079 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"descr"), BAD_CAST(
const_cast<SwRangeRedline*
>(
this)->
GetDescr().toUtf8().getStr()));
2081 OString sRedlineType;
2084 case RedlineType::Insert:
2085 sRedlineType =
"REDLINE_INSERT";
2087 case RedlineType::Delete:
2088 sRedlineType =
"REDLINE_DELETE";
2090 case RedlineType::Format:
2091 sRedlineType =
"REDLINE_FORMAT";
2094 sRedlineType =
"UNKNOWN";
2097 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"type"), BAD_CAST(sRedlineType.getStr()));
2101 (void)xmlTextWriterEndElement(pWriter);
2144 : m_aRedlineData(rData)
2145 , m_rTableLine(rTableLine)
2154 : m_aRedlineData(rData)
2155 , 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()
virtual void libreOfficeKitViewCallback(int nType, const OString &pPayload) const override
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()
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()
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
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?
SwTableBox * GetTableBox() const
If node is in a table return the respective table box.
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.
void InsertDummy()
Add a dummy character to the redline of the table changes.
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_setRowNotTracked(SwNode &rNode)
static void lcl_storeAnnotationMarks(SwDoc &rDoc, const SwPosition *pStt, const SwPosition *pEnd)
const EnumerationType m_eType
constexpr TypedWhichId< SwFormatChg > RES_FMT_CHG(168)
constexpr TypedWhichId< SvxPrintItem > RES_PRINT(104)
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::basic_string_view< charT, traits > trim(std::basic_string_view< charT, traits > 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