[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/qa writerfilter/source

Zolnai Tamás tamas.zolnai at collabora.com
Sat Dec 28 02:10:51 PST 2013


 sw/qa/extras/inc/swmodeltestbase.hxx                |    6 ++++++
 sw/qa/extras/ooxmlimport/data/rprchange_closed.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx            |    9 +++++++++
 writerfilter/source/ooxml/model.xml                 |    3 +++
 4 files changed, 18 insertions(+)

New commits:
commit a5d5aa022c2ae04e1d230050a773b3983a410cde
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.
    
    Conflicts:
    	sw/qa/extras/ooxmlimport/ooxmlimport.cxx
    Reviewed on:
    	https://gerrit.libreoffice.org/7194
    
    Change-Id: I4091d7b54e0a74f3158cc979f210577a2dc29783

diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index a9b2368..727580d 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 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 2076c8c..d1fa650 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();
diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml
index 4fad4ba..d368dab 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -22077,6 +22077,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