[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sw/qa writerfilter/source
Zolnai Tamás
tamas.zolnai at collabora.com
Sat Dec 28 01:40:26 PST 2013
sw/qa/extras/inc/swmodeltestbase.hxx | 6 ++++++
sw/qa/extras/ooxmlimport/data/rprchange_closed.docx |binary
sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 7 +++++++
writerfilter/source/ooxml/model.xml | 3 +++
4 files changed, 16 insertions(+)
New commits:
commit efba557c24db07557a29b86ffb3188a20c0dc6f3
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date: Tue Dec 24 08:05:58 2013 +0100
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
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index ba64155..8a2b8c4 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 0000000..ff53871
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/rprchange_closed.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index bc515c8..6d44d45 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 2e0a300..1cf434c 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"/>
More information about the Libreoffice-commits
mailing list