Kaydet (Commit) ded3740d authored tarafından Caolán McNamara's avatar Caolán McNamara

also consider redline that starts right before the end para marker

We were currently handing the case where a paragraph end mark is right
before the *end* of a redline, now we also need to take care if the end
mark is right after the *start* of a redline

Change-Id: I816335067f60d1d9332bfdb1117fb1448b564972
üst 4e820251
......@@ -363,6 +363,14 @@ DECLARE_WW8EXPORT_TEST(testRedlineExport2, "redline-export-2.odt")
CPPUNIT_ASSERT_EQUAL(true, hasProperty(getRun(getParagraph(3), 1), "RedlineType"));
}
DECLARE_WW8EXPORT_TEST(testRedlineExport3, "redline-export-3.odt")
{
//there must be redline information just on the para-break boundary between para one and two
CPPUNIT_ASSERT_EQUAL(false, hasProperty(getRun(getParagraph(1), 1), "RedlineType"));
CPPUNIT_ASSERT_EQUAL(true, hasProperty(getRun(getParagraph(1), 2), "RedlineType"));
CPPUNIT_ASSERT_EQUAL(true, hasProperty(getRun(getParagraph(2), 1), "RedlineType"));
CPPUNIT_ASSERT_EQUAL(false, hasProperty(getRun(getParagraph(2), 2), "RedlineType"));
}
CPPUNIT_PLUGIN_IMPLEMENT();
......
......@@ -1261,6 +1261,7 @@ bool SwWW8AttrIter::IncludeEndOfParaCRInRedlineProperties( sal_Int32 nEnd ) cons
const SwRangeRedline *pRange = m_rExport.pDoc->getIDocumentRedlineAccess().GetRedlineTbl()[nPos];
const SwPosition* pEnd = pRange->End();
const SwPosition* pStart = pRange->Start();
bool bBreak = true;
// In word the paragraph end marker is a real character, in writer it is not.
// Here we find out if the para end marker we will emit is affected by
// redlining, in which case it must be included by the range of character
......@@ -1271,11 +1272,25 @@ bool SwWW8AttrIter::IncludeEndOfParaCRInRedlineProperties( sal_Int32 nEnd ) cons
{
// This condition detects if the pseudo-char we will export
// should be explicitly included by the redlining char
// properties on this node
// properties on this node because the redlining ends right
// after it
return true;
}
bBreak = false;
}
else if (pStart->nNode.GetIndex()-1 == rNd.GetIndex())
if (pStart->nNode == rNd)
{
if (pStart->nContent.GetIndex() == nEnd)
{
// This condition detects if the pseudo-char we will export
// should be explicitly included by the redlining char
// properties on this node because the redlining starts right
// before it
return true;
}
bBreak = false;
}
if (pStart->nNode.GetIndex()-1 == rNd.GetIndex())
{
if (pStart->nContent.GetIndex() == 0)
{
......@@ -1284,9 +1299,10 @@ bool SwWW8AttrIter::IncludeEndOfParaCRInRedlineProperties( sal_Int32 nEnd ) cons
// properties starting on the next node.
return true;
}
bBreak = false;
}
else
if (bBreak)
break;
}
return false;
......
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