diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index d184cd6a7b11..2534099cda3e 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1288,8 +1288,6 @@ DECLARE_RTFIMPORT_TEST(testFdo53556, "fdo53556.rtf") DECLARE_RTFIMPORT_TEST(testFdo63428, "hello.rtf") { -#if 0 - // FIXME port to AnnotationMarks // Pasting content that contained an annotation caused a crash. uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference xText(xTextDocument->getText(), uno::UNO_QUERY); @@ -1297,9 +1295,8 @@ DECLARE_RTFIMPORT_TEST(testFdo63428, "hello.rtf") paste("fdo63428.rtf", xEnd); // Additionally, commented range was imported as a normal comment. - CPPUNIT_ASSERT_EQUAL(OUString("TextFieldStart"), getProperty(getRun(getParagraph(1), 2), "TextPortionType")); - CPPUNIT_ASSERT_EQUAL(OUString("TextFieldEnd"), getProperty(getRun(getParagraph(1), 4), "TextPortionType")); -#endif + CPPUNIT_ASSERT_EQUAL(OUString("Annotation"), getProperty(getRun(getParagraph(1), 2), "TextPortionType")); + CPPUNIT_ASSERT_EQUAL(OUString("AnnotationEnd"), getProperty(getRun(getParagraph(1), 4), "TextPortionType")); } DECLARE_RTFIMPORT_TEST(testGroupshapeRotation, "groupshape-rotation.rtf") diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 30702f6686b6..5db691528df0 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -1095,6 +1095,7 @@ void RTFDocumentImpl::text(OUString& rString) case DESTINATION_OBJDATA: case DESTINATION_ANNOTATIONDATE: case DESTINATION_ANNOTATIONAUTHOR: + case DESTINATION_ANNOTATIONREFERENCE: case DESTINATION_FALT: case DESTINATION_PARAGRAPHNUMBERING_TEXTAFTER: case DESTINATION_PARAGRAPHNUMBERING_TEXTBEFORE: @@ -1578,6 +1579,9 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword) case RTF_ATNAUTHOR: m_aStates.top().nDestinationState = DESTINATION_ANNOTATIONAUTHOR; break; + case RTF_ATNREF: + m_aStates.top().nDestinationState = DESTINATION_ANNOTATIONREFERENCE; + break; case RTF_FALT: m_aStates.top().nDestinationState = DESTINATION_FALT; break; @@ -4247,6 +4251,14 @@ int RTFDocumentImpl::popState() case DESTINATION_ATNID: m_aAuthorInitials = m_aStates.top().aDestinationText.makeStringAndClear(); 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::Pointer_t(new RTFReferenceProperties(aAnnAttributes))); + } + break; case DESTINATION_FALT: { OUString aStr(m_aStates.top().aDestinationText.makeStringAndClear()); diff --git a/writerfilter/source/rtftok/rtflistener.hxx b/writerfilter/source/rtftok/rtflistener.hxx index 0e07187106d9..2abfe01a4a2e 100644 --- a/writerfilter/source/rtftok/rtflistener.hxx +++ b/writerfilter/source/rtftok/rtflistener.hxx @@ -78,6 +78,7 @@ namespace writerfilter { DESTINATION_RESULT, DESTINATION_ANNOTATIONDATE, DESTINATION_ANNOTATIONAUTHOR, + DESTINATION_ANNOTATIONREFERENCE, DESTINATION_FALT, DESTINATION_FLYMAINCONTENT, DESTINATION_DRAWINGOBJECT,