summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2013-11-20 13:39:18 +0100
committerAndras Timar <andras.timar@collabora.com>2013-12-03 20:50:58 +0100
commit7418a5ab18955a76b38512ef757c873d149d6c02 (patch)
treea301c3369ba98df453cb5ac987cf6189e112f60c
parent6837d5ef4120c964735ba1a5d4f47c5ba76d5c1c (diff)
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@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk> Signed-off-by: Andras Timar <andras.timar@collabora.com>
-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 d7a5c8bc5527..1372151e1c93 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 ded106d238e5..131559f4edd8 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& )