23#include <com/sun/star/text/TextMarkupType.hpp>
24#include <osl/diagnose.h>
36 void initChangeTrackTextMarkupLists(
const SwTextFrame& rTextFrame,
37 std::unique_ptr<SwWrongList>& opChangeTrackInsertionTextMarkupList,
38 std::unique_ptr<SwWrongList>& opChangeTrackDeletionTextMarkupList,
39 std::unique_ptr<SwWrongList>& opChangeTrackFormatChangeTextMarkupList )
47 OSL_FAIL(
"<initChangeTrackTextMarkupLists(..) - missing <SwTextNode> instance!" );
58 || rIDocChangeTrack.GetRedlineTable().empty())
65 rIDocChangeTrack.GetRedlinePos( rTextNode, RedlineType::Any );
74 const sal_Int32 nTextFrameTextStartPos = rTextFrame.IsFollow()
77 const sal_Int32 nTextFrameTextEndPos = rTextFrame.HasFollow()
82 const SwRedlineTable& rRedlineTable = rIDocChangeTrack.GetRedlineTable();
85 nActRedline < nRedlineCount;
97 nTextNodeChangeTrackStart,
98 nTextNodeChangeTrackEnd );
99 if ( nTextNodeChangeTrackStart > nTextFrameTextEndPos ||
100 nTextNodeChangeTrackEnd < nTextFrameTextStartPos )
107 switch ( pActRedline->
GetType() )
109 case RedlineType::Insert:
111 pMarkupList = opChangeTrackInsertionTextMarkupList.get();
114 case RedlineType::Delete:
116 pMarkupList = opChangeTrackDeletionTextMarkupList.get();
119 case RedlineType::Format:
121 pMarkupList = opChangeTrackFormatChangeTextMarkupList.get();
131 const sal_Int32 nTextFrameChangeTrackStart =
132 std::max(nTextNodeChangeTrackStart, nTextFrameTextStartPos);
134 const sal_Int32 nTextFrameChangeTrackEnd =
135 std::min(nTextNodeChangeTrackEnd, nTextFrameTextEndPos);
137 pMarkupList->Insert( OUString(),
nullptr,
138 nTextFrameChangeTrackStart,
139 nTextFrameChangeTrackEnd - nTextFrameChangeTrackStart,
140 pMarkupList->Count() );
147 : mrTextFrame( rTextFrame )
165 SwWrongList* pChangeTrackingTextMarkupList =
nullptr;
170 "<SwParaChangeTrackingInfo::getChangeTrackingTextMarkupList(..) - <mpChangeTrackDeletionTextMarkupList> expected to be NULL." );
172 "<SwParaChangeTrackingInfo::getChangeTrackingTextMarkupList(..) - <mpChangeTrackFormatChangeTextMarkupList> expected to be NULL." );
179 switch ( nTextMarkupType )
181 case css::text::TextMarkupType::TRACK_CHANGE_INSERTION:
186 case css::text::TextMarkupType::TRACK_CHANGE_DELETION:
191 case css::text::TextMarkupType::TRACK_CHANGE_FORMATCHANGE:
198 OSL_FAIL(
"<SwParaChangeTrackingInfo::getChangeTrackingTextMarkupList(..)> - misusage - unexpected text markup type for change tracking." );
202 return pChangeTrackingTextMarkupList;
static bool IsShowChanges(const RedlineFlags eM)
SwRootFrame * getRootFrame()
const SwPosition * Start() const
~SwParaChangeTrackingInfo()
std::unique_ptr< SwWrongList > mpChangeTrackFormatChangeTextMarkupList
const SwWrongList * getChangeTrackingTextMarkupList(const sal_Int32 nTextMarkupType)
std::unique_ptr< SwWrongList > mpChangeTrackInsertionTextMarkupList
std::unique_ptr< SwWrongList > mpChangeTrackDeletionTextMarkupList
SwParaChangeTrackingInfo(const SwTextFrame &rTextFrame)
const SwTextFrame & mrTextFrame
void CalcStartEnd(SwNodeOffset nNdIdx, sal_Int32 &rStart, sal_Int32 &rEnd) const
Calculates the intersection with text node number nNdIdx.
RedlineType GetType(sal_uInt16 nPos=0) const
static constexpr size_type npos
vector_type::size_type size_type
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding).
Represents the visualization of a paragraph.
SwTextFrame * GetFollow()
TextFrameIndex GetOffset() const
SwTextNode * GetTextNodeFirst()
SwTextNode is a paragraph in the document model.
double getLength(const B2DPolygon &rCandidate)
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
constexpr sal_Int32 COMPLETE_STRING
@ WRONGLIST_CHANGETRACKING