Kaydet (Commit) c9fea568 authored tarafından Michael Stahl's avatar Michael Stahl

sw_redlinehide_2: view cursor: adapt SwCursorShell::GetSelText()

Pass in ExpandMode::HideDeletions to get the same effect (hopefully)
from the model code as from the merged text frame.

Change-Id: I546f51388bc7bd0d1740167062ef9171a37d1797
üst bf488abb
......@@ -2387,6 +2387,40 @@ void SwCursorShell::CallChgLnk()
OUString SwCursorShell::GetSelText() const
{
OUString aText;
if (GetLayout()->IsHideRedlines())
{
SwContentFrame const*const pFrame(GetCurrFrame(false));
if (FrameContainsNode(*pFrame, m_pCurrentCursor->GetMark()->nNode.GetIndex()))
{
OUStringBuffer buf;
SwPosition const*const pStart(m_pCurrentCursor->Start());
SwPosition const*const pEnd(m_pCurrentCursor->End());
for (sal_uLong i = pStart->nNode.GetIndex(); i <= pEnd->nNode.GetIndex(); ++i)
{
SwNode const& rNode(*pStart->nNode.GetNodes()[i]);
assert(!rNode.IsEndNode());
if (rNode.IsStartNode())
{
i = rNode.EndOfSectionIndex();
}
else if (rNode.IsTextNode())
{
sal_Int32 const nStart(i == pStart->nNode.GetIndex()
? pStart->nContent.GetIndex()
: 0);
sal_Int32 const nEnd(i == pEnd->nNode.GetIndex()
? pEnd->nContent.GetIndex()
: pEnd->nNode.GetNode().GetTextNode()->Len());
buf.append(rNode.GetTextNode()->GetExpandText(
nStart, nEnd - nStart, false, false, false,
ExpandMode::HideDeletions));
}
}
aText = buf.makeStringAndClear();
}
}
else
if( m_pCurrentCursor->GetPoint()->nNode.GetIndex() ==
m_pCurrentCursor->GetMark()->nNode.GetIndex() )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment