summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2013-12-24 08:05:58 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-12-28 10:37:48 +0100
commitefba557c24db07557a29b86ffb3188a20c0dc6f3 (patch)
tree15fab859d95efdbd05d127c02589f1cd9e4daf05
parent709a197d930bf1f585834a8573f952e9030f3383 (diff)
DOCX import: close rPrChange properly.
Call endtrackchanges when rPrChange ends so the corresponding redline will be removed. (cherry picked from commit 75e7d6f12e914b63e66968890533b2a56d0b1a7e) Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx Reviewed on: https://gerrit.libreoffice.org/7195 Change-Id: I4091d7b54e0a74f3158cc979f210577a2dc29783
-rw-r--r--sw/qa/extras/inc/swmodeltestbase.hxx6
-rw-r--r--sw/qa/extras/ooxmlimport/data/rprchange_closed.docxbin0 -> 24695 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx7
-rw-r--r--writerfilter/source/ooxml/model.xml3
4 files changed, 16 insertions, 0 deletions
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index ba64155ae001..8a2b8c4c9633 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -300,6 +300,12 @@ protected:
return data;
}
+ bool hasProperty(const uno::Reference<uno::XInterface>& obj, const OUString& name) const
+ {
+ uno::Reference<beans::XPropertySet> properties(obj, uno::UNO_QUERY_THROW);
+ return properties->getPropertySetInfo()->hasPropertyByName(name);
+ }
+
/// Get number of paragraphs of the document.
int getParagraphs()
{
diff --git a/sw/qa/extras/ooxmlimport/data/rprchange_closed.docx b/sw/qa/extras/ooxmlimport/data/rprchange_closed.docx
new file mode 100644
index 000000000000..ff53871e91ae
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/rprchange_closed.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index bc515c86a51d..6d44d45d496e 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1556,6 +1556,13 @@ DECLARE_OOXMLIMPORT_TEST(testFdo65090, "fdo65090.docx")
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(0), "TableColumnSeparators").getLength());
}
+DECLARE_OOXMLIMPORT_TEST(testRPrChangeClosed, "rprchange_closed.docx")
+{
+ // Redline defined by rPrChanged wasn't removed.
+ // First paragraph has an rPrChange element, make sure it doesn't appear in the second paragraph.
+ CPPUNIT_ASSERT_EQUAL(false, hasProperty(getRun(getParagraph(2), 1), "RedlineType"));
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml
index 2e0a300ec0e6..1cf434ccccd9 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -22126,6 +22126,9 @@
</resource>
<resource name="CT_RPrChange" resource="Properties" tag="character">
<element name="rPr" tokenid="ooxml:CT_RPrChange_rPr"/>
+ <action name="end" action="tokenproperty"/>
+ <action name="end" action="propagateCharacterPropertiesAsSet" sendtokenid="ooxml:endtrackchange"/>
+ <action name="end" action="clearProps"/>
</resource>
<resource name="CT_ParaRPrChange" resource="Properties" tag="character">
<element name="rPr" tokenid="ooxml:CT_ParaRPrChange_rPr"/>