22#include <osl/diagnose.h>
43 mbHiddenRedlines( false )
100 if ( bIsDeletion && rTable.
size() > 0 )
120 nMaxId = pRedline->
GetId();
125 pRedline->
Show(0, rTable.
GetPos(pRedline),
true);
126 pRedline->
Show(1, rTable.
GetPos(pRedline),
true);
205 m_bCanGroup( false ), m_bIsDelim( false ), m_bIsBackspace( false )
252 OUString ret = aRewriter.
Apply(
SwResId(STR_UNDO_REDLINE_DELETE));
323 m_nSaveEndNode( m_nEndNode ), m_nSaveEndContent( m_nEndContent )
336 auto [pStart, pEnd] = rPam.
StartEnd();
339 SwNodeOffset nOffsetTemp = pEnd->GetNodeIndex() - pStart->GetNodeIndex();
348 RedlineType::Insert );
350 "could not find an Insert object" );
364 SwPaM *
const pPam = & rPam;
381 auto [pStart, pEnd] = pPam->
StartEnd();
384 SwNodeOffset nOffsetTemp = pEnd->GetNodeIndex() - pStart->GetNodeIndex();
385 const sal_Int32 nCntStt = pStart->GetContentIndex();
392 sal_Int32 nLen = pCNd->
Len();
516 bool bJoinText, bJoinPrev;
524 if( pCSttNd && !pCEndNd)
@ ArtificialSelection
keyboard delete, artificial selection, avoid deleting flys
@ ShowDelete
show all deletes
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
bool isLetterNumeric(const OUString &rStr, sal_Int32 nPos) const
virtual bool DelFullPara(SwPaM &)=0
Delete full paragraphs.
virtual bool IsRedlineOn() const =0
Query if redlining is on.
virtual bool DeleteRedline(const SwPaM &rPam, bool bSaveInUndo, RedlineType nDelType)=0
static bool IsRedlineOn(const RedlineFlags eM)
virtual bool RejectRedline(SwRedlineTable::size_type nPos, bool bCallDelete)=0
virtual std::size_t GetRedlineAuthor()=0
virtual bool SplitRedline(const SwPaM &rPam)=0
virtual SwRedlineTable::size_type GetRedlinePos(const SwNode &rNode, RedlineType nType) const =0
virtual void SetRedlineFlags_intern(RedlineFlags eMode)=0
Set a new redline mode.
virtual const SwRedlineTable & GetRedlineTable() const =0
virtual AppendResult AppendRedline(SwRangeRedline *pNewRedl, bool bCallDelete)=0
Append a new redline.
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
virtual bool AcceptRedline(SwRedlineTable::size_type nPos, bool bCallDelete)=0
virtual sal_Int32 Len() const
bool SortText(const SwPaM &, const SwSortOptions &)
Sort Text in the Document.
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Marks a node in the document model.
Base class of the Writer document model elements.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodeOffset GetIndex() const
SwNode * DocumentSectionEndNode(SwNode *pNode) const
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
PaM is Point and Mark: a selection of the document model.
const SwPosition * GetMark() const
SwNode & GetPointNode() const
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
void Normalize(bool bPointFirst=true)
Normalizes PaM, i.e.
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
SwContentNode * GetMarkContentNode() const
const SwPosition * GetPoint() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
void Show(sal_uInt16 nLoop, size_t nMyPos, bool bForced=false)
void InvalidateRange(Invalidation)
Initiate the layout.
const SwRedlineData & GetRedlineData(sal_uInt16 nPos=0) const
bool Insert(SwRangeRedline *&p)
static constexpr size_type npos
vector_type::size_type size_type
size_type GetPos(const SwRangeRedline *p) const
void AddRule(SwUndoArg eWhat, const OUString &rWith)
OUString Apply(const OUString &rStr) const
SwTextNode is a paragraph in the document model.
const OUString & GetText() const
SwPaM & AddUndoRedoPaM(::sw::UndoRedoContext &, bool const bCorrToContent=false) const
void SetPaM(SwPaM &, bool bCorrToContent=false) const
void SetValues(const SwPaM &rPam)
Undo for Edit -> track changes -> accept.
virtual void RepeatImpl(::sw::RepeatContext &) override
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
SwUndoAcceptRedline(const SwPaM &rRange)
std::unique_ptr< SwRedlineSaveDatas > m_pRedlineSaveDatas
virtual void RedoImpl(::sw::UndoRedoContext &) override
std::unique_ptr< SwUndoDelete > m_pUndoDelete
std::unique_ptr< SwUndoDelete > m_pUndoDelete2
SwUndoCompDoc(const SwPaM &rRg, bool bIns)
virtual ~SwUndoCompDoc() override
virtual void UndoImpl(::sw::UndoRedoContext &) override
std::unique_ptr< SwRedlineData > m_pRedlineData
bool CanGrouping(const SwUndoRedlineDelete &rPrev)
std::unique_ptr< SwHistory > m_pHistory
for moved fly anchors
void InitHistory(SwPaM const &rRange)
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
virtual void UndoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
void SetRedlineText(const OUString &rText)
virtual SwRewriter GetRewriter() const override
Returns the rewriter for this object.
SwUndoRedlineDelete(const SwPaM &rRange, SwUndoId nUserId, SwDeleteFlags flags=SwDeleteFlags::Default)
sal_Int32 m_nSaveEndContent
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
void SetSaveRange(const SwPaM &rRange)
std::unique_ptr< SwSortOptions > m_pOpt
virtual void RepeatImpl(::sw::RepeatContext &) override
virtual void UndoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
SwNodeOffset m_nSaveEndNode
virtual ~SwUndoRedlineSort() override
SwUndoRedlineSort(const SwPaM &rRange, const SwSortOptions &rOpt)
virtual ~SwUndoRedline() override
virtual void UndoImpl(::sw::UndoRedoContext &) override
std::unique_ptr< SwRedlineSaveDatas > mpRedlSaveData
std::unique_ptr< SwRedlineData > mpRedlData
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam)
virtual void RedoImpl(::sw::UndoRedoContext &) override
sal_uInt16 GetRedlSaveCount() const
virtual void UndoRedlineImpl(SwDoc &rDoc, SwPaM &rPam)
SwUndoRedline(SwUndoId nUserId, const SwPaM &rRange)
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
SwUndoRejectRedline(const SwPaM &rRange)
virtual void RepeatImpl(::sw::RepeatContext &) override
void SetRedlineFlags(RedlineFlags eMode)
RedlineFlags GetRedlineFlags() const
static bool FillSaveData(const SwPaM &rRange, SwRedlineSaveDatas &rSData, bool bDelRange=true, bool bCopyNext=true)
static bool HasHiddenRedlines(const SwRedlineSaveDatas &rSData)
static void SetSaveData(SwDoc &rDoc, SwRedlineSaveDatas &rSData)
static bool CanRedlineGroup(SwRedlineSaveDatas &rCurr, const SwRedlineSaveDatas &rCheck, bool bCurrIsEnd)
bool sw_JoinText(SwPaM &rPam, bool bJoinPrev)
void sw_GetJoinFlags(SwPaM &rPam, bool &rJoinText, bool &rJoinPrev)
void SaveFlyInRange(const SwNodeRange &rRg, SaveFlyArr &rArr)
void RestFlyInRange(SaveFlyArr &rArr, const SwPosition &rStartPos, const SwNode *pInsertPos, bool const isForceToStartPos)
#define CH_TXTATR_BREAKWORD
CharClass & GetAppCharClass()
std::deque< SaveFly > SaveFlyArr
constexpr OUStringLiteral EMPTY
void UpdateFramesForRemoveDeleteRedline(SwDoc &rDoc, SwPaM const &rPam)
void UpdateFramesForAddDeleteRedline(SwDoc &rDoc, SwPaM const &rPam)
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
Marks a position in the document model.
void Adjust(SwNodeOffset nDelta)
Adjust node position, and resets content position to zero.
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
sal_Int32 GetContentIndex() const
OUString SwResId(TranslateId aId)