summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2013-11-20 13:39:18 +0100
committerJan Holesovsky <kendy@collabora.com>2013-11-29 16:51:58 +0100
commitf72580006e9e88d3c374474b3e26678e49952366 (patch)
treeeaf5abeed876002253d4358c3cf74e9d0b6ea69f
parent75f1b02da8712d1ce5041a751e907c4d79c408c6 (diff)
Related bnc#837302: Don't introduce a redlined delete and the end of doc.
Change-Id: I5c3903a40b69867684707d33acbc92b1f80a93ec
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx11
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx14
2 files changed, 25 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index f68b3b62b900..792d6e8f403f 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -512,6 +512,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 5db6df4ec050..7d8203a72cd5 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -315,7 +315,21 @@ void DomainMapper_Impl::RemoveLastParagraph( )
// If this is a text on a shape, possibly the text has the trailing
// newline removed already.
if (xCursor->getString() == "\n")
+ {
+ 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& )