Kaydet (Commit) 5bc6c7b2 authored tarafından Michael Stahl's avatar Michael Stahl

fdo#42450: fix crash in SwXTextSection::attach:

Inserting the section can fail if the given text range is not valid.

Change-Id: Ib6ba3b02dd581dce08b646b841354073caf894b2
üst 1488e24a
......@@ -400,6 +400,12 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
SwSection *const pRet =
pDoc->InsertSwSection( aPam, aSect, 0, aSet.Count() ? &aSet : 0 );
if (!pRet) // fdo#42450 text range could parially overlap existing section
{
throw lang::IllegalArgumentException(
"SwXTextSection::attach(): invalid TextRange",
static_cast< ::cppu::OWeakObject*>(this), 0);
}
pRet->GetFmt()->Add(m_pImpl.get());
pRet->GetFmt()->SetXObject(static_cast< ::cppu::OWeakObject*>(this));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment