20 #include <libxml/xmlwriter.h>
21 #include <boost/property_tree/json_parser.hpp>
23 #include <osl/diagnose.h>
30 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
56 #include <strings.hrc>
77 if( pCurrent == pNext )
89 DeleteAndDestroyAll();
94 (
void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwExtraRedlineTable"));
95 (
void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
97 for (sal_uInt16 nCurExtraRedlinePos = 0; nCurExtraRedlinePos < GetSize(); ++nCurExtraRedlinePos)
99 const SwExtraRedline* pExtraRedline = GetRedline(nCurExtraRedlinePos);
100 (
void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwExtraRedline"));
101 (
void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
102 (
void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"symbol"),
"%s", BAD_CAST(
typeid(*pExtraRedline).name()));
103 (
void)xmlTextWriterEndElement(pWriter);
105 (
void)xmlTextWriterEndElement(pWriter);
108 #if OSL_DEBUG_LEVEL > 0
116 SwNode* pSttStart = pSttNode;
120 SwNode* pEndStart = pEndNode;
124 assert(pSttTab == pEndTab);
125 if( pSttTab != pEndTab )
127 assert(pSttTab || pSttStart == pEndStart);
128 if( !pSttTab && pSttStart != pEndStart )
154 for (sal_uInt16 nCurRedlinePos = 0; nCurRedlinePos < GetSize(); )
158 if (pTableCellRedline)
162 if ( &rRedTable == &rTable )
169 if (RedlineType::Any == nRedlineTypeToDelete || nRedlineTypeToDelete == nRedlineType)
172 DeleteAndDestroy( nCurRedlinePos );
205 for(sal_uInt16 nCurRedlinePos = 0; nCurRedlinePos < GetSize(); ++nCurRedlinePos )
210 if ( pRedTabLine == &rTableLine )
217 if( RedlineType::Any != nRedlineTypeToDelete && nRedlineTypeToDelete != nRedlineType )
220 DeleteAndDestroy( nCurRedlinePos );
249 for(sal_uInt16 nCurRedlinePos = 0; nCurRedlinePos < GetSize(); ++nCurRedlinePos )
254 if ( pRedTabBox == &rTableBox )
261 if( RedlineType::Any != nRedlineTypeToDelete && nRedlineTypeToDelete != nRedlineType )
264 DeleteAndDestroy( nCurRedlinePos );
283 for (
SwFrame* pTmpFrame = aIter.First(); pTmpFrame; pTmpFrame = aIter.Next() )
285 if ((pTmpFrame->GetType() & nFrameType) &&
291 pTmpFrame->InvalidateSize();
295 if (pTmpFrame->IsTextFrame())
297 auto pTextFrame =
static_cast<SwTextFrame*
>(pTmpFrame);
319 *pEndPos = rCursor.
End();
326 lcl_LOKInvalidateFrames(*(pEndPos->nNode.GetNode().GetContentNode()),
331 bool 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());
365 if (pView && pContentNd)
369 aCursor.GetMark()->nNode = pEndPos->
nNode;
370 aCursor.GetMark()->nContent = pEndPos->
nContent;
375 std::vector<OString> aRects;
376 for(
const SwRect& rNextRect : *pRects)
377 aRects.push_back(rNextRect.SVRect().toString());
380 aRedline.put(
"textRange", sRects.getStr());
382 lcl_LOKInvalidateStartEndFrames(aCursor);
402 boost::property_tree::ptree aTree;
403 aTree.add_child(
"redline", aRedline);
404 std::stringstream aStream;
405 boost::property_tree::write_json(aStream, aTree);
406 std::string aPayload = aStream.str();
421 std::pair<vector_type::const_iterator, bool> rv = maVector.insert( p );
437 CheckOverlapping(rv.first);
440 return InsertWithValidRanges( p );
445 if (m_bHasOverlappingElements)
447 if (maVector.size() <= 1)
450 auto itNext = it + 1;
451 if (itNext != maVector.end())
453 auto pNext = *itNext;
454 if (pCurr->End()->nNode.GetIndex() >= pNext->Start()->nNode.GetIndex())
456 m_bHasOverlappingElements =
true;
460 if (it != maVector.begin())
462 auto pPrev = *(it - 1);
463 if (pPrev->End()->nNode.GetIndex() >= pCurr->Start()->nNode.GetIndex())
464 m_bHasOverlappingElements =
true;
472 std::pair<vector_type::const_iterator, bool> rv = maVector.insert( p );
473 rP = rv.first -
begin();
476 CheckOverlapping(rv.first);
479 return InsertWithValidRanges( p, &rP );
486 std::vector<SwRangeRedline*> ret;
505 if( aNewStt < *pEnd )
538 if( aNewStt.
nNode != pEnd->nNode )
551 }
while( aNewStt.
nNode.
GetIndex() < pEnd->nNode.GetIndex() );
553 if( aNewStt.
nNode == pEnd->nNode )
561 if( aNewStt <= *pEnd )
566 #if OSL_DEBUG_LEVEL > 0
577 if( aNewStt >= *pEnd )
585 }
while( aNewStt < *pEnd );
596 bool bAnyIns =
false;
597 std::vector<SwRangeRedline*>
const redlines(
601 assert(pRedline->HasValidRange());
603 if (
Insert(pRedline, nInsPos))
605 pRedline->CallDisplayFunc(nInsPos);
607 if (pInsPos && *pInsPos < nInsPos)
624 maVector.DeleteAndDestroyAll();
630 if( it == maVector.end() )
632 return it - maVector.begin();
646 SwDoc* pDoc =
nullptr;
647 if( !nP && 1 ==
size() )
648 pDoc = &maVector.front()->GetDoc();
650 maVector.erase( maVector.begin() + nP );
662 while (!maVector.empty())
664 auto const pRedline = maVector.back();
665 maVector.erase_at(maVector.size() - 1);
669 m_bHasOverlappingElements =
false;
674 auto const pRedline = maVector[nP];
675 maVector.erase(maVector.begin() + nP);
682 return nSttPos + 1 <
size()
683 ? FindNextSeqNo(
operator[]( nSttPos )->GetSeqNo(), nSttPos+1 )
689 return nSttPos ? FindPrevSeqNo(
operator[]( nSttPos )->GetSeqNo(), nSttPos-1 )
697 auto constexpr nLookahead = 20;
699 if( nSeqNo && nSttPos <
size() )
702 const size_type nTmp = nSttPos + nLookahead;
708 for( ; nSttPos < nEnd; ++nSttPos )
709 if( nSeqNo ==
operator[]( nSttPos )->GetSeqNo() )
720 auto constexpr nLookahead = 20;
722 if( nSeqNo && nSttPos <
size() )
725 if( nSttPos > nLookahead )
726 nEnd = nSttPos - nLookahead;
729 while( nSttPos > nEnd )
730 if( nSeqNo ==
operator[]( --nSttPos )->GetSeqNo() )
744 for( ; rPos < maVector.size() ; ++rPos )
750 * pREnd = pTmp->
End();
751 if( bNext ? *pRStt <= rSttPos : *pRStt < rSttPos )
753 if( bNext ? *pREnd > rSttPos : *pREnd >= rSttPos )
769 auto constexpr nLookahead = 20;
774 if ( RedlineType::Delete == nPairType )
775 nPairType = RedlineType::Insert;
776 else if ( RedlineType::Insert == nPairType )
777 nPairType = RedlineType::Delete;
782 bool bDeletePaM =
false;
797 const OUString sTrimmed = pPaM->
GetText().trim();
798 if ( sTrimmed.getLength() < 2 )
809 rPos = rPos > nLookahead ? rPos - nLookahead : 0;
810 for ( ; rPos < nEnd && !bRet ; ++rPos )
815 if ( nPairType != pPair->
GetType() ||
821 bool bDeletePairPaM =
false;
834 bDeletePairPaM =
true;
847 if ( bDeletePairPaM )
859 (
void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwRedlineTable"));
860 (
void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
863 operator[](nCurRedlinePos)->dumpAsXml(pWriter);
865 (
void)xmlTextWriterEndElement(pWriter);
882 sal_uInt16 nPoolFormatId,
885 : m_sFormatNm(rColl), m_nPoolId(nPoolFormatId), m_bFormatAll(bFormatAll)
887 if( pItemSet && pItemSet->
Count() )
919 if (aPam.GetPoint()->nNode > aPam.GetMark()->nNode)
921 aPam.GetPoint()->
nNode--;
923 aPam.GetPoint()->nContent.Assign( pNode, pNode->
Len() );
925 else if (aPam.GetPoint()->nNode < aPam.GetMark()->nNode)
927 aPam.GetMark()->nNode--;
929 aPam.GetMark()->nContent.Assign( pNode, pNode->
Len() );
1004 if( nEnd != static_cast<const SwRedlineExtraData_Format&>(rCmp).
m_aWhichIds.size() )
1007 for(
size_t n = 0;
n < nEnd; ++
n )
1009 if( static_cast<const SwRedlineExtraData_Format&>(rCmp).m_aWhichIds[
n] !=
m_aWhichIds[
n])
1018 : m_pNext( nullptr ), m_pExtraData( nullptr ),
1020 m_nAuthor( nAut ),
m_eType( eT ), m_nSeqNo( 0 ), m_bAutoFormat(
false), m_bMoved(
false)
1028 : m_pNext( ( bCpyNext && rCpy.m_pNext ) ? new
SwRedlineData( *rCpy.m_pNext ) : nullptr )
1029 , m_pExtraData( rCpy.m_pExtraData ? rCpy.m_pExtraData->CreateNew() : nullptr )
1030 , m_sComment( rCpy.m_sComment )
1031 , m_aStamp( rCpy.m_aStamp )
1032 , m_nAuthor( rCpy.m_nAuthor )
1034 , m_nSeqNo( rCpy.m_nSeqNo )
1035 , m_bAutoFormat(
false)
1036 , m_bMoved( rCpy.m_bMoved )
1043 : m_pNext(pNxt), m_pExtraData(nullptr), m_sComment(rCmnt), m_aStamp(rDT),
1044 m_nAuthor(nAut),
m_eType(eT), m_nSeqNo(0), m_bAutoFormat(
false), m_bMoved(
false)
1063 aTime == aCompareTime &&
1088 STR_UNDO_REDLINE_INSERT,
1089 STR_UNDO_REDLINE_DELETE,
1090 STR_UNDO_REDLINE_FORMAT,
1091 STR_UNDO_REDLINE_TABLE,
1092 STR_UNDO_REDLINE_FMTCOLL,
1093 STR_UNDO_REDLINE_PARAGRAPH_FORMAT,
1094 STR_UNDO_REDLINE_TABLE_ROW_INSERT,
1095 STR_UNDO_REDLINE_TABLE_ROW_DELETE,
1096 STR_UNDO_REDLINE_TABLE_CELL_INSERT,
1097 STR_UNDO_REDLINE_TABLE_CELL_DELETE
1108 :
SwPaM( *rPam.GetMark(), *rPam.GetPoint() ),
1109 m_pRedlineData( new
SwRedlineData( eTyp, GetDoc().getIDocumentRedlineAccess().GetRedlineAuthor() ) ),
1110 m_pContentSect( nullptr ),
1111 m_nId( s_nLastId++ )
1122 ?
SwResId(STR_REDLINE_COMMENT_DELETED)
1123 :
SwResId(STR_REDLINE_COMMENT_ADDED) );
1128 :
SwPaM( *rPam.GetMark(), *rPam.GetPoint() ),
1130 m_pContentSect( nullptr ),
1131 m_nId( s_nLastId++ )
1142 m_pContentSect( nullptr ),
1143 m_nId( s_nLastId++ )
1150 :
SwPaM( *rCpy.GetMark(), *rCpy.GetPoint() ),
1152 m_pContentSect( nullptr ),
1153 m_nId( s_nLastId++ )
1166 if( !
GetDoc().IsInDtor() )
1175 if (!lcl_LOKRedlineNotificationEnabled())
1181 if (rRedTable[
i] == &rRedline)
1191 if (!lcl_LOKRedlineNotificationEnabled())
1203 if( !pSttPtr ) pSttPtr =
Start();
1211 if( !pEndPtr ) pEndPtr =
End();
1248 bool bIsShowChangesInMargin =
false;
1255 bIsShowChangesInMargin =
SW_MOD()->GetUsrPref(
false)->IsShowChangesInMargin();
1258 if( 1 > nLoop && !bIsShowChangesInMargin )
1267 case RedlineType::Insert:
1272 case RedlineType::Delete:
1288 case RedlineType::Format:
1289 case RedlineType::Table:
1307 case RedlineType::Insert:
1313 case RedlineType::Delete:
1323 case RedlineType::Format:
1324 case RedlineType::Table:
1349 case RedlineType::Insert:
1359 case RedlineType::Delete:
1365 case RedlineType::Format:
1366 case RedlineType::Table:
1394 n == nSttNd ? nSttCnt : 0,
1395 n == nEndNd ? nEndCnt : pNd->
GetText().getLength(),
1401 if (
GetType() == RedlineType::Delete)
1403 sal_Int32
const nStart(
n == nSttNd ? nSttCnt : 0);
1404 sal_Int32
const nLen((
n == nEndNd ? nEndCnt : pNd->
GetText().getLength()) - nStart);
1425 if( pRStt->
nNode < nNdIdx )
1427 if( pREnd->nNode > nNdIdx )
1432 else if (pREnd->nNode == nNdIdx)
1435 rEnd = pREnd->nContent.GetIndex();
1443 else if( pRStt->
nNode == nNdIdx )
1446 if( pREnd->nNode == nNdIdx )
1447 rEnd = pREnd->nContent.GetIndex();
1463 for (
auto iter = rDMA.getAnnotationMarksBegin();
1464 iter != rDMA.getAnnotationMarksEnd(); )
1466 SwPosition const& rStartPos((**iter).GetMarkStart());
1467 if ( *pStt <= rStartPos && rStartPos < *pEnd )
1470 rDMA.findAnnotationBookmark((**iter).GetName());
1471 if ( pOldMark == rDMA.getBookmarksEnd() )
1475 sal_Int32 nLen = (*pStt == rStartPos) ? 1 : 0;
1476 SwPaM aPam( rStartPos.nNode, rStartPos.nContent.GetIndex(),
1477 rStartPos.nNode, rStartPos.nContent.GetIndex() + nLen);
1502 SwPaM aPam( *pStt, *pEnd );
1513 if( pRedl->GetBound() == *pStt )
1514 pRedl->GetBound() = *pEnd;
1515 if( pRedl->GetBound(
false) == *pStt )
1516 pRedl->GetBound(
false) = *pEnd;
1522 if( pCSttNd || pCEndNd )
1536 if( pCSttNd && pCEndNd )
1544 if( pCSttNd && !pCEndNd )
1613 if( pCEndNd && pCEndNd != pCSttNd )
1656 SwPaM aPam( *pStt, *pEnd );
1667 if( pRedl->GetBound() == *pStt )
1668 pRedl->GetBound() = *pEnd;
1669 if( pRedl->GetBound(
false) == *pStt )
1670 pRedl->GetBound(
false) = *pEnd;
1674 if( pCSttNd && pCEndNd )
1680 else if( pCSttNd || pCEndNd )
1682 if( pCSttNd && !pCEndNd )
1696 for(
bool bBreak =
false; !bBreak && n > 0; )
1702 rTable[ n ]->GetBound() = *pEnd;
1707 rTable[ n ]->GetBound(
false) = *pEnd;
1739 std::vector<SwPosition*> aBeforeArr, aBehindArr;
1740 bool bBreak =
false;
1743 for( n = nMyPos+1; !bBreak && n < rTable.
size(); ++n )
1749 aBehindArr.push_back(&pRedl->
GetBound());
1755 aBehindArr.push_back(&pRedl->
GetBound(
false));
1759 for( bBreak =
false, n = nMyPos; !bBreak && n ; )
1766 aBeforeArr.push_back(&pRedl->
GetBound());
1772 aBeforeArr.push_back(&pRedl->
GetBound(
false));
1784 aPam.GetPoint()->nContent.Assign( pCNd, pCNd->Len() );
1786 ++aPam.GetPoint()->nNode;
1788 SwFormatColl* pColl = pCNd && pCNd->Len() && aPam.GetPoint()->nNode !=
1789 aPam.GetMark()->nNode
1790 ? pCNd->GetFormatColl() :
nullptr;
1825 pCNd->ChgFormatColl( pColl );
1845 for(
auto& pItem : aBeforeArr )
1847 for(
auto& pItem : aBehindArr )
1870 OSL_FAIL(
"SwRangeRedline::SetContentIdx: invalid state");
1908 sal_uInt16 nRet = 1;
1956 sal_uInt16 nP = nPos;
1958 while (nP > 0 &&
nullptr != pCur->
m_pNext)
1965 SAL_WARN_IF( nP != 0,
"sw.core",
"Pos " << nPos <<
" is " << nP <<
" too big");
1975 SwPaM * pPaM =
nullptr;
1976 bool bDeletePaM =
false;
1995 sDescr = ( bSimplified ?
"" :
SwResId(STR_START_QUOTE) )
1996 + pTextAttr->GetFormatField().GetField()->GetFieldName()
1997 + ( bSimplified ?
"" :
SwResId(STR_END_QUOTE) );
2009 aResult = aRewriter.
Apply(aResult);
2015 sal_Int32
nPos = aTmpStr.indexOf(
SwResId(STR_LDOTS));
2028 (
void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwRangeRedline"));
2030 (
void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
2031 (
void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"id"), BAD_CAST(OString::number(
GetSeqNo()).getStr()));
2032 (
void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"author"), BAD_CAST(
SW_MOD()->GetRedlineAuthor(
GetAuthor()).toUtf8().getStr()));
2034 (
void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"descr"), BAD_CAST(const_cast<SwRangeRedline*>(
this)->
GetDescr().toUtf8().getStr()));
2036 OString sRedlineType;
2039 case RedlineType::Insert:
2040 sRedlineType =
"REDLINE_INSERT";
2042 case RedlineType::Delete:
2043 sRedlineType =
"REDLINE_DELETE";
2045 case RedlineType::Format:
2046 sRedlineType =
"REDLINE_FORMAT";
2049 sRedlineType =
"UNKNOWN";
2052 (
void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"type"), BAD_CAST(sRedlineType.getStr()));
2056 (
void)xmlTextWriterEndElement(pWriter);
2099 : m_aRedlineData(rData)
2100 , m_rTableLine(rTableLine)
2109 : m_aRedlineData(rData)
2110 , m_rTableBox(rTableBox)
void SetCopyIsMove(bool bFlag)
const SwEndNode * EndOfSectionNode() const
Starts a section of nodes in the document model.
Base class of the Writer layout elements.
Represents the visualization of a paragraph.
virtual sal_Int32 Len() const
bool CanCombine(const SwRangeRedline &rRedl) const
SwRedlineData(RedlineType eT, std::size_t nAut)
SwNode & GetNode(bool bPoint=true) const
bool InsertWithValidRanges(SwRangeRedline *&p, size_type *pInsPos=nullptr)
void Show(sal_uInt16 nLoop, size_t nMyPos, bool bForced=false)
sal_uInt16 GetSeqNo() const
SwNodeOffset EndOfSectionIndex() const
Represents the style of a paragraph.
Marks a position in the document model.
bool IsSectionNode() const
SwNodeIndex * m_pContentSect
static void lcl_storeAnnotationMarks(SwDoc &rDoc, const SwPosition *pStt, const SwPosition *pEnd)
void SetContentIdx(const SwNodeIndex *)
OUString const & GetAuthorString(sal_uInt16 nPos=0) const
virtual ~SwRangeRedline() override
const OUString & GetText() const
OUString toISO8601(const css::util::DateTime &rDateTime)
constexpr TypedWhichId< SwFormatChg > RES_FMT_CHG(162)
SwRect FindLayoutRect(const bool bPrtArea=false, const Point *pPoint=nullptr) const
void MaybeNotifyRedlinePositionModification(tools::Long nTop)
virtual void SetRedlineFlags_intern(RedlineFlags eMode)=0
Set a new redline mode.
void TriggerNodeUpdate(const sw::LegacyModifyHint &)
for hanging TextFormatCollections somewhere else (Outline-Numbering!)
virtual void InsertItemSet(const SwPaM &rRg, const SfxItemSet &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr)=0
SwTextFormatColl * FindTextFormatCollByName(const OUString &rName) const
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
virtual void SetModified()=0
Must be called manually at changes of format.
size_type FindPrevOfSeqNo(size_type nSttPos) const
const SwPosition * GetMark() const
void CallDisplayFunc(size_t nMyPos)
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
void Remove(size_type nPos)
Provides access to the marks of a document.
virtual void SetMark() override
Unless this is called, the getter method of Mark will return Point.
ViewShellDocId GetDocId() const override
void CalcStartEnd(SwNodeOffset nNdIdx, sal_Int32 &rStart, sal_Int32 &rEnd) const
Calculates the intersection with text node number nNdIdx.
const SwRedlineData & GetRedlineData() const
void SetEnd(const SwPosition &rPos, SwPosition *pEndPtr=nullptr)
const Point & GetSttPos() const
virtual void DeleteRange(SwPaM &)=0
Delete a range SwFlyFrameFormat.
SwTableLine is one table row in the document model.
const SwRedlineData & GetRedlineData() const
virtual bool MoveRange(SwPaM &, SwPosition &, SwMoveFlags)=0
SwTableCellRedline(const SwRedlineData &rData, const SwTableBox &rTableBox)
SwPosition & GetBound(bool bOne=true)
IDocumentMarkAccess * getIDocumentMarkAccess()
const SwTableBox & GetTableBox() const
Dialog to specify the properties of date form field.
IDocumentUndoRedo & GetIDocumentUndoRedo()
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
Of course Writer needs its own rectangles.
static bool CheckPosition(const SwPosition *pStt, const SwPosition *pEnd)
SwNodeOffset abs(const SwNodeOffset &a)
static SwFlowFrame * CastFlowFrame(SwFrame *pFrame)
bool IsAnnotation() const
IDocumentContentOperations const & getIDocumentContentOperations() const
The root element of a Writer document layout.
bool CanCombine(const SwRedlineData &rCmp) const
void dumpAsXml(xmlTextWriterPtr pWriter) const
bool HasValidRange() const
Do we have a valid selection?
SwWrtShell & GetWrtShell() const
static sal_uInt32 s_nLastId
SwContentNode * GetContentNode(bool bPoint=true) const
OUString SwResId(TranslateId aId)
const SfxPoolItem * NextItem()
RedlineType GetType() const
new delete redline is created
void GoEndSection(SwPosition *pPos)
go to the end of the current base section
enumrange< T >::Iterator begin(enumrange< T >)
OUString GetDescr() const
OString join(std::string_view rSeparator, const std::vector< OString > &rSequence)
bool SetTextFormatColl(const SwPaM &rRg, SwTextFormatColl *pFormat, const bool bReset=true, const bool bResetListAttrs=false, SwRootFrame const *pLayout=nullptr)
Add 4th optional parameter .
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
virtual void MoveAndJoin(SwPaM &, SwPosition &)=0
Move a range.
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
check if target position is in fly anchored at source range
const DateTime & GetTimeStamp(sal_uInt16 nPos=0) const
static SfxViewShell * GetNext(const SfxViewShell &rPrev, bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
static SfxViewShell * Current()
static void LOKRedlineNotification(RedlineNotification eType, SwRangeRedline *pRedline)
Emits LOK notification about one addition / removal of a redline item.
virtual void libreOfficeKitViewCallback(int nType, const char *pPayload) const override
void MoveFromSection(size_t nMyPos)
const SwTable & GetTable() const
virtual void DeleteSection(SwNode *pNode)=0
Delete section containing the node.
virtual bool IsRedlineMove() const =0
const SfxPoolItem * GetDfltAttr(sal_uInt16 nWhich)
Get the default attribute from corresponding default attribute table.
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
virtual void SetKeyCode(const vcl::KeyCode &)=0
Redline that holds information about a table-cell that had some change.
void dumpAsXml(xmlTextWriterPtr pWriter) const
const SwRedlineData & GetRedlineData(sal_uInt16 nPos=0) const
virtual void SetShortName(const OUString &)=0
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).
SwStartNode * MakeTextSection(const SwNodeIndex &rWhere, SwStartNodeType eSttNdTyp, SwTextFormatColl *pColl)
css::util::DateTime GetUNODateTime() const
void InvalidateRange(Invalidation)
Initiate the layout.
virtual ~SwTableRowRedline() override
void DelCopyOfSection(size_t nMyPos)
bool IsContentNode() const
PaM is Point and Mark: a selection of the document model.
size_type FindPrevSeqNo(sal_uInt16 nSeqNo, size_type nSttPos) const
void SetExtraData(const SwRedlineExtraData *pData)
ExtraData is copied.
size_type GetPos(const SwRangeRedline *p) const
delete redline is removed
SwPaM(SwPaM const &rPaM)=delete
const SwCursorShell * GetShell() const
std::vector< SwRangeRedline * > GetAllValidRanges(std::unique_ptr< SwRangeRedline > p)
const SwStartNode * StartOfSectionNode() const
void DeleteAndDestroy(size_type nPos)
const SwPosition * GetPoint() const
SwTableRowRedline(const SwRedlineData &rData, const SwTableLine &rTableLine)
virtual bool CopyRange(SwPaM &rPam, SwPosition &rPos, SwCopyFlags flags) const =0
Copy a selected content range to a position.
OUString DenoteSpecialCharacters(const OUString &rStr, bool bQuoted=true)
Denotes special characters in a string.
SwIndex & Assign(SwIndexReg *, sal_Int32)
OUString Apply(const OUString &rStr) const
OUString SwRedlineTypeToOUString(RedlineType eType)
::sw::DocumentContentOperationsManager const & GetDocumentContentOperationsManager() const
void DeleteAndDestroyAll()
SwContentNode * GetContentNode()
SwNodeOffset GetIndex() const
vector_type::size_type size_type
bool IsShowChangesInMargin() const
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)
Marks a character position inside a document model node.
void AddRule(SwUndoArg eWhat, const OUString &rWith)
std::optional< tools::Long > m_oLOKLastNodeTop
const DateTime & GetTimeStamp() const
void dumpAsXml(xmlTextWriterPtr pWriter) const
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.
SwNodes & GetNodes()
Node is in which nodes-array/doc?
virtual SwFormatColl * ChgFormatColl(SwFormatColl *)
static SfxViewShell * GetFirst(bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
Redline that holds information about a table-row that had some change.
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
void InvalidateWindows(const SwRect &rRect)
SwTable is one table in the document model, containing rows (which contain cells).
const SwPosition * Start() const
virtual void SetRedlineMove(bool bFlag)=0
const TranslateId STR_REDLINE_ARY[]
const OUString & GetComment(sal_uInt16 nPos=0) const
void SetComment(const OUString &rS)
const SwTableLine & GetTableLine() const
size_type FindNextOfSeqNo(size_type nSttPos) const
const OUString & GetComment() const
SwTextNode is a paragraph in the document model.
bool isMoved(size_type tableIndex) const
std::vector< SwRect > SwRects
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
SwRedlineExtraData * m_pExtraData
const SwStartNode * GetSttNd() const
void sw_DebugRedline(const SwDoc *pDoc)
bool operator<(const SwRangeRedline &) const
std::size_t GetAuthor(sal_uInt16 nPos=0) const
#define SAL_WARN_IF(condition, area, stream)
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
void CopyWithFlyInFly(const SwNodeRange &rRg, const SwNodeIndex &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...
const SwNodes & GetNodes() const
OUString ShortenString(const OUString &rStr, sal_Int32 nLength, const OUString &rFillStr)
Shortens a string to a maximum length.
void ClearPara()
Removes the Line information from the Cache but retains the entry itself.
const SwViewOption * GetViewOptions() const
void PushData(const SwRangeRedline &rRedl, bool bOwnAsNext=true)
bool IsCopyIsMove() const
virtual bool DelFullPara(SwPaM &)=0
Delete full paragraphs.
sal_Int32 GetIndex() const
OString DateTimeToOString(const DateTime &rDateTime)
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
std::u16string_view trim(std::u16string_view str)
const SwPosition * End() const
RedlineType GetType(sal_uInt16 nPos=0) const
SwTableBox is one table cell in the document model.
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
double getLength(const B2DPolygon &rCandidate)
size_type FindNextSeqNo(sal_uInt16 nSeqNo, size_type nSttPos) const
Search next or previous Redline with the same Seq.
virtual bool AppendTextNode(SwPosition &rPos)=0
virtual void CallSwClientNotify(const SfxHint &rHint) const override
virtual ~SwTableCellRedline() override
SwTableNode * FindTableNode()
Search table node, in which it is.
constexpr sal_Int32 COMPLETE_STRING
void CopyCollFormat(SwTextNode &rDestNd, bool bUndoForChgFormatColl=true)
Copy collection with all auto formats to dest-node.
const Point & GetEndPos() const
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
SwContentNode * GoPreviousNds(SwNodeIndex *pIdx, bool bChk)
SwFormatColl * GetFormatColl() const
struct _xmlTextWriter * xmlTextWriterPtr
const EnumerationType m_eType
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
virtual const SwRedlineTable & GetRedlineTable() const =0
bool Insert(SwRangeRedline *&p)
SwNode & GetEndOfRedlines() const
Section for all Redlines.
void MaybeNotifyRedlineModification(SwRangeRedline &rRedline, SwDoc &rDoc)
void CheckOverlapping(vector_type::const_iterator it)
SwRootFrame * GetLayout() const
virtual bool DeleteAndJoin(SwPaM &)=0
complete delete of a given PaM
virtual void Insert(SotClipboardFormatId nFormat, const OUString &rFormatName) override
SwRedlineData * m_pRedlineData
SwRangeRedline(RedlineType eType, const SwPaM &rPam)
bool operator()(SwRangeRedline *const &lhs, SwRangeRedline *const &rhs) const
SwContentNode * GoNext(SwNodeIndex *) const
SwNodeIndex * GetContentIdx() const
SwRootFrame * getRootFrame()
const int nUndoStringLength
void SetStart(const SwPosition &rPos, SwPosition *pSttPtr=nullptr)
bool IsInWriterfilterImport() const
bool IsInXMLImport() const
std::vector< SwRangeRedline * >::const_iterator const_iterator
const SfxPoolItem * GetCurItem() const
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
bool m_bDetectedRangeSegmentation false
static SwStartNode * MakeEmptySection(const SwNodeIndex &rIdx, SwStartNodeType=SwNormalStartNode)
Create an empty section of Start- and EndNote.
Base class of the Writer document model elements.
SwTextFormatColl * GetTextColl() const