RTF import: handle RTF_ATNREF
Otherwise dmapper won't create an annotation mark for us. Change-Id: I868c3ffd65fbaa9a5115ba7300310fa3585d2d05
This commit is contained in:
@@ -1288,8 +1288,6 @@ DECLARE_RTFIMPORT_TEST(testFdo53556, "fdo53556.rtf")
|
|||||||
|
|
||||||
DECLARE_RTFIMPORT_TEST(testFdo63428, "hello.rtf")
|
DECLARE_RTFIMPORT_TEST(testFdo63428, "hello.rtf")
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
// FIXME port to AnnotationMarks
|
|
||||||
// Pasting content that contained an annotation caused a crash.
|
// Pasting content that contained an annotation caused a crash.
|
||||||
uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
|
uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
|
||||||
uno::Reference<text::XTextRange> xText(xTextDocument->getText(), uno::UNO_QUERY);
|
uno::Reference<text::XTextRange> xText(xTextDocument->getText(), uno::UNO_QUERY);
|
||||||
@@ -1297,9 +1295,8 @@ DECLARE_RTFIMPORT_TEST(testFdo63428, "hello.rtf")
|
|||||||
paste("fdo63428.rtf", xEnd);
|
paste("fdo63428.rtf", xEnd);
|
||||||
|
|
||||||
// Additionally, commented range was imported as a normal comment.
|
// Additionally, commented range was imported as a normal comment.
|
||||||
CPPUNIT_ASSERT_EQUAL(OUString("TextFieldStart"), getProperty<OUString>(getRun(getParagraph(1), 2), "TextPortionType"));
|
CPPUNIT_ASSERT_EQUAL(OUString("Annotation"), getProperty<OUString>(getRun(getParagraph(1), 2), "TextPortionType"));
|
||||||
CPPUNIT_ASSERT_EQUAL(OUString("TextFieldEnd"), getProperty<OUString>(getRun(getParagraph(1), 4), "TextPortionType"));
|
CPPUNIT_ASSERT_EQUAL(OUString("AnnotationEnd"), getProperty<OUString>(getRun(getParagraph(1), 4), "TextPortionType"));
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DECLARE_RTFIMPORT_TEST(testGroupshapeRotation, "groupshape-rotation.rtf")
|
DECLARE_RTFIMPORT_TEST(testGroupshapeRotation, "groupshape-rotation.rtf")
|
||||||
|
@@ -1095,6 +1095,7 @@ void RTFDocumentImpl::text(OUString& rString)
|
|||||||
case DESTINATION_OBJDATA:
|
case DESTINATION_OBJDATA:
|
||||||
case DESTINATION_ANNOTATIONDATE:
|
case DESTINATION_ANNOTATIONDATE:
|
||||||
case DESTINATION_ANNOTATIONAUTHOR:
|
case DESTINATION_ANNOTATIONAUTHOR:
|
||||||
|
case DESTINATION_ANNOTATIONREFERENCE:
|
||||||
case DESTINATION_FALT:
|
case DESTINATION_FALT:
|
||||||
case DESTINATION_PARAGRAPHNUMBERING_TEXTAFTER:
|
case DESTINATION_PARAGRAPHNUMBERING_TEXTAFTER:
|
||||||
case DESTINATION_PARAGRAPHNUMBERING_TEXTBEFORE:
|
case DESTINATION_PARAGRAPHNUMBERING_TEXTBEFORE:
|
||||||
@@ -1578,6 +1579,9 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
|
|||||||
case RTF_ATNAUTHOR:
|
case RTF_ATNAUTHOR:
|
||||||
m_aStates.top().nDestinationState = DESTINATION_ANNOTATIONAUTHOR;
|
m_aStates.top().nDestinationState = DESTINATION_ANNOTATIONAUTHOR;
|
||||||
break;
|
break;
|
||||||
|
case RTF_ATNREF:
|
||||||
|
m_aStates.top().nDestinationState = DESTINATION_ANNOTATIONREFERENCE;
|
||||||
|
break;
|
||||||
case RTF_FALT:
|
case RTF_FALT:
|
||||||
m_aStates.top().nDestinationState = DESTINATION_FALT;
|
m_aStates.top().nDestinationState = DESTINATION_FALT;
|
||||||
break;
|
break;
|
||||||
@@ -4247,6 +4251,14 @@ int RTFDocumentImpl::popState()
|
|||||||
case DESTINATION_ATNID:
|
case DESTINATION_ATNID:
|
||||||
m_aAuthorInitials = m_aStates.top().aDestinationText.makeStringAndClear();
|
m_aAuthorInitials = m_aStates.top().aDestinationText.makeStringAndClear();
|
||||||
break;
|
break;
|
||||||
|
case DESTINATION_ANNOTATIONREFERENCE:
|
||||||
|
{
|
||||||
|
OUString aStr = m_aStates.top().aDestinationText.makeStringAndClear();
|
||||||
|
RTFSprms aAnnAttributes;
|
||||||
|
aAnnAttributes.set(NS_ooxml::LN_CT_Markup_id, RTFValue::Pointer_t(new RTFValue(aStr)));
|
||||||
|
Mapper().props(writerfilter::Reference<Properties>::Pointer_t(new RTFReferenceProperties(aAnnAttributes)));
|
||||||
|
}
|
||||||
|
break;
|
||||||
case DESTINATION_FALT:
|
case DESTINATION_FALT:
|
||||||
{
|
{
|
||||||
OUString aStr(m_aStates.top().aDestinationText.makeStringAndClear());
|
OUString aStr(m_aStates.top().aDestinationText.makeStringAndClear());
|
||||||
|
@@ -78,6 +78,7 @@ namespace writerfilter {
|
|||||||
DESTINATION_RESULT,
|
DESTINATION_RESULT,
|
||||||
DESTINATION_ANNOTATIONDATE,
|
DESTINATION_ANNOTATIONDATE,
|
||||||
DESTINATION_ANNOTATIONAUTHOR,
|
DESTINATION_ANNOTATIONAUTHOR,
|
||||||
|
DESTINATION_ANNOTATIONREFERENCE,
|
||||||
DESTINATION_FALT,
|
DESTINATION_FALT,
|
||||||
DESTINATION_FLYMAINCONTENT,
|
DESTINATION_FLYMAINCONTENT,
|
||||||
DESTINATION_DRAWINGOBJECT,
|
DESTINATION_DRAWINGOBJECT,
|
||||||
|
Reference in New Issue
Block a user