xmloff/source/forms/elementimport.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
New commits: commit 49846da1652661e73acffd1ee8df0419aadf5cdb Author: Eike Rathke <er...@redhat.com> Date: Thu Nov 24 17:40:44 2011 +0100 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. diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx index 3fde263..10c4b2f 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; _______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits