diff options
author | Eike Rathke <erack@redhat.com> | 2011-11-24 17:40:44 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2011-11-24 17:40:44 +0100 |
commit | 49846da1652661e73acffd1ee8df0419aadf5cdb (patch) | |
tree | ee6fe78f99915c6e3451ed972f6b2fabfb6e7c76 /xmloff | |
parent | ec9f3466d33536f68d86bde9f0389f46f8f147a2 (diff) |
fdo#43152 ooo#114415 fixed crash on unnamed form element
An unnamed form element without parent container lead to a crash when trying to
obtain a unique name by iterating over (now not) existing container elements.
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/forms/elementimport.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx index 3fde263f6022..10c4b2f61efa 100644 --- a/xmloff/source/forms/elementimport.cxx +++ b/xmloff/source/forms/elementimport.cxx @@ -495,8 +495,11 @@ namespace xmloff { // no optimization here. If this method gets called, the XML stream did not contain a name for the // element, which is a heavy error. So in this case we don't care for performance - Sequence< ::rtl::OUString > aNames = m_xParentContainer->getElementNames(); static const ::rtl::OUString sUnnamedName(RTL_CONSTASCII_USTRINGPARAM("unnamed")); + OSL_ENSURE(m_xParentContainer.is(), "OElementImport::implGetDefaultName: no parent container!"); + if (!m_xParentContainer.is()) + return sUnnamedName; + Sequence< ::rtl::OUString > aNames = m_xParentContainer->getElementNames(); ::rtl::OUString sReturn; const ::rtl::OUString* pNames = NULL; |