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()
79 : rTextFrame.
GetText().getLength();
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;
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
Represents the visualization of a paragraph.
const SwWrongList * getChangeTrackingTextMarkupList(const sal_Int32 nTextMarkupType)
void CalcStartEnd(SwNodeOffset nNdIdx, sal_Int32 &rStart, sal_Int32 &rEnd) const
Calculates the intersection with text node number nNdIdx.
std::unique_ptr< SwWrongList > mpChangeTrackFormatChangeTextMarkupList
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
static bool IsShowChanges(const RedlineFlags eM)
~SwParaChangeTrackingInfo()
const SwTextFrame & mrTextFrame
SwNodeOffset GetIndex() const
SwTextFrame * GetFollow()
TextFrameIndex GetOffset() const
SwTextNode * GetTextNodeFirst()
virtual SwRedlineTable::size_type GetRedlinePos(const SwNode &rNode, RedlineType nType) const =0
vector_type::size_type size_type
SwParaChangeTrackingInfo(const SwTextFrame &rTextFrame)
std::unique_ptr< SwWrongList > mpChangeTrackInsertionTextMarkupList
const SwPosition * Start() const
SwTextNode is a paragraph in the document model.
RedlineType GetType(sal_uInt16 nPos=0) const
std::unique_ptr< SwWrongList > mpChangeTrackDeletionTextMarkupList
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding)...
constexpr sal_Int32 COMPLETE_STRING
static constexpr size_type npos
SwRootFrame * getRootFrame()