summaryrefslogtreecommitdiff
path: root/sw
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 11:06:29 +0100
commita5d5aa022c2ae04e1d230050a773b3983a410cde (patch)
treea9a3b62c196a08c5fefea60603eddba354420465 /sw
parent70f90c08592ef3e50840afda20428078c25c463a (diff)
DOCX import: close rPrChange properly.
Call endtrackchanges when rPrChange ends so the corresponding redline will be removed. Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx Reviewed on: https://gerrit.libreoffice.org/7194 Change-Id: I4091d7b54e0a74f3158cc979f210577a2dc29783
Diffstat (limited to 'sw')
-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.cxx9
3 files changed, 15 insertions, 0 deletions
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index a9b2368830b0..727580d02612 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -166,6 +166,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 2076c8c96fcf..d1fa6507598b 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -135,6 +135,7 @@ public:
void testVmlTextVerticalAdjust();
void testGroupshapeSdt();
void testBnc779620();
+ void testRPrChangeClosed();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -235,6 +236,7 @@ void Test::run()
{"vml-text-vertical-adjust.docx", &Test::testVmlTextVerticalAdjust},
{"groupshape-sdt.docx", &Test::testGroupshapeSdt},
{"bnc779620.docx", &Test::testBnc779620},
+ {"rprchange_closed.docx", &Test::testRPrChangeClosed},
};
header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1652,6 +1654,13 @@ void Test::testBnc779620()
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
}
+void Test::testRPrChangeClosed()
+{
+ // 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"));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();