summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2021-11-19 12:57:23 +0100
committerLászló Németh <nemeth@numbertext.org>2021-11-23 11:54:13 +0100
commit7bc57e698910e24495605bd197a6d3ab5e0be5b8 (patch)
tree4330d0916dc0d806d6f8f62bd4df1bbc9ef77f01 /sw/inc
parent87fafdb9dc045735e235cbba2ef37198043422c7 (diff)
tdf#145719 sw: track moved text in import and ChangesInMargin
Recognize moved text by accessing to the hidden redline content pContentSect during ODT import (in the case of Delete redlines) and ChangesInMargin mode (Delete or Insert redlines depending on Deletion in Margin or Insertion in Margin modes). Fix Undo and redline stack handling by moving IsMoved bit to SwRedlineData from SwRangeRedline. Note: .fodt format is applicable for the unit test document, because it's not affected by the problem. Change-Id: Ifd4f993520bec4b845d978a844c465509ea87b50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125552 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/redline.hxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx
index 8d17948205fa..5e01cfa8349f 100644
--- a/sw/inc/redline.hxx
+++ b/sw/inc/redline.hxx
@@ -95,6 +95,7 @@ class SW_DLLPUBLIC SwRedlineData
RedlineType m_eType;
sal_uInt16 m_nSeqNo;
bool m_bAutoFormat;
+ bool m_bMoved;
public:
SwRedlineData( RedlineType eT, std::size_t nAut );
@@ -111,6 +112,7 @@ public:
return m_nAuthor == rCmp.m_nAuthor &&
m_eType == rCmp.m_eType &&
m_bAutoFormat == rCmp.m_bAutoFormat &&
+ m_bMoved == rCmp.m_bMoved &&
m_sComment == rCmp.m_sComment &&
(( !m_pNext && !rCmp.m_pNext ) ||
( m_pNext && rCmp.m_pNext && *m_pNext == *rCmp.m_pNext )) &&
@@ -133,6 +135,8 @@ public:
void SetAutoFormat() { m_bAutoFormat = true; }
bool IsAutoFormat() const { return m_bAutoFormat; }
+ void SetMoved() { m_bMoved = true; }
+ bool IsMoved() const { return m_bMoved; }
bool CanCombine( const SwRedlineData& rCmp ) const;
// ExtraData gets copied, the pointer is therefore not taken over by
@@ -155,7 +159,6 @@ class SW_DLLPUBLIC SwRangeRedline final : public SwPaM
SwNodeIndex* m_pContentSect;
bool m_bDelLastPara : 1;
bool m_bIsVisible : 1;
- bool m_bIsMoved : 1;
sal_uInt32 m_nId;
std::optional<tools::Long> m_oLOKLastNodeTop;
@@ -175,7 +178,7 @@ public:
SwRangeRedline(SwRedlineData* pData, const SwPosition& rPos,
bool bDelLP) :
SwPaM( rPos ), m_pRedlineData( pData ), m_pContentSect( nullptr ),
- m_bDelLastPara( bDelLP ), m_bIsVisible( true ), m_bIsMoved( false ), m_nId( s_nLastId++ )
+ m_bDelLastPara( bDelLP ), m_bIsVisible( true ), m_nId( s_nLastId++ )
{}
SwRangeRedline( const SwRangeRedline& );
virtual ~SwRangeRedline() override;
@@ -263,8 +266,8 @@ public:
void MaybeNotifyRedlinePositionModification(tools::Long nTop);
- void SetMoved() { m_bIsMoved = true; }
- bool IsMoved() const { return m_bIsMoved; }
+ void SetMoved() { m_pRedlineData->SetMoved(); }
+ bool IsMoved() const { return m_pRedlineData->IsMoved(); }
};
void MaybeNotifyRedlineModification(SwRangeRedline& rRedline, SwDoc& rDoc);