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

Jan Holesovsky kendy at collabora.com
Tue Dec 3 01:04:22 PST 2013


 sw/qa/extras/ooxmlexport/ooxmlexport.cxx          |   11 +++++++++++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   14 ++++++++++++++
 2 files changed, 25 insertions(+)

New commits:
commit 6cd9431a182f54d491ab1459443a80c6a8e4ae95
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Nov 20 13:39:18 2013 +0100

    Related bnc#837302: Don't introduce a redlined delete and the end of doc.
    
    Conflicts:
    	writerfilter/source/dmapper/DomainMapper_Impl.cxx
    
    Change-Id: I5c3903a40b69867684707d33acbc92b1f80a93ec
    Reviewed-on: https://gerrit.libreoffice.org/6898
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index d7a5c8b..1372151 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -800,6 +800,17 @@ void Test::testBnc837302()
     getRun(xParagraph, 3, "AAA");
     // interestingly the 'Insert' is set on the _previous_ run
     CPPUNIT_ASSERT_EQUAL(OUString("Insert"), getProperty<OUString>(getRun(xParagraph, 2), "RedlineType"));
+
+    // make sure we don't introduce a redlined delete in the 2nd paragraph
+    xParagraph = getParagraph(2);
+    OUString aProperty;
+    try
+    {
+        // throws when not present
+        aProperty = getProperty<OUString>(getRun(xParagraph, 1), "RedlineType");
+    }
+    catch (const beans::UnknownPropertyException&) {}
+    CPPUNIT_ASSERT_EQUAL(OUString(), aProperty);
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index ded106d..131559f 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -318,7 +318,21 @@ void DomainMapper_Impl::RemoveLastParagraph( )
 #else
             if (xCursor->getString() == "\r\n")
 #endif
+            {
+                uno::Reference<beans::XPropertySet> xDocProps(GetTextDocument(), uno::UNO_QUERY);
+                const OUString aRecordChanges("RecordChanges");
+                uno::Any aPreviousValue(xDocProps->getPropertyValue(aRecordChanges));
+
+                // disable redlining for this operation, otherwise we might
+                // end up with an unwanted recorded deletion
+                xDocProps->setPropertyValue(aRecordChanges, uno::Any(sal_False));
+
+                // delete
                 xCursor->setString(OUString());
+
+                // restore again
+                xDocProps->setPropertyValue(aRecordChanges, aPreviousValue);
+            }
         }
     }
     catch( const uno::Exception& )


More information about the Libreoffice-commits mailing list