summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-09-12 22:14:59 +0200
committerMichael Stahl <mstahl@redhat.com>2012-09-12 22:19:19 +0200
commit2940a697dce2292e9c5b118feb8ec4159e3606fa (patch)
tree926671317a2e36444d6ed919bbcdc4d9ae7fe76a /sw
parent1e7666e825e5842bf1e07082df3a026fef02eca5 (diff)
fdo#42450: also end undo on error condition
Change-Id: I59a33631d73a02cf8c84ccc002401bdc2da10267
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/unocore/unosect.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx
index 4e68e309ffeb..517d3a36d65d 100644
--- a/sw/source/core/unocore/unosect.cxx
+++ b/sw/source/core/unocore/unosect.cxx
@@ -402,6 +402,8 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
pDoc->InsertSwSection( aPam, aSect, 0, aSet.Count() ? &aSet : 0 );
if (!pRet) // fdo#42450 text range could parially overlap existing section
{
+ // shouldn't have created an undo object yet
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_INSSECTION, NULL );
throw lang::IllegalArgumentException(
"SwXTextSection::attach(): invalid TextRange",
static_cast< ::cppu::OWeakObject*>(this), 0);