diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2011-06-09 21:39:53 -0400 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-06-09 21:39:53 -0400 |
commit | 723d9ce1a28e25deb4c3b61ecd6c35f0ca100ea2 (patch) | |
tree | db3d9cb28816b7dc44be52fc143e53f4db3a7624 /xmloff | |
parent | ec1fa205bb39b8b436c10eab5d63605f88eedd9e (diff) |
fdo#37646: Avoid crash when pasting a form control into chart.
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/forms/elementimport.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/forms/layerexport.cxx | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx index 1b23c59282b0..0c58235c8e1d 100644 --- a/xmloff/source/forms/elementimport.cxx +++ b/xmloff/source/forms/elementimport.cxx @@ -252,7 +252,9 @@ namespace xmloff m_sName = implGetDefaultName(); } - m_xParentContainer->insertByName(m_sName, makeAny(m_xElement)); + if (m_xParentContainer.is()) + m_xParentContainer->insertByName(m_sName, makeAny(m_xElement)); + LEAVE_LOG_CONTEXT( ); } diff --git a/xmloff/source/forms/layerexport.cxx b/xmloff/source/forms/layerexport.cxx index 05d0a207721a..21950c9c3517 100644 --- a/xmloff/source/forms/layerexport.cxx +++ b/xmloff/source/forms/layerexport.cxx @@ -347,6 +347,9 @@ namespace xmloff //--------------------------------------------------------------------- sal_Bool OFormLayerXMLExport_Impl::implMoveIterators(const Reference< XDrawPage >& _rxDrawPage, sal_Bool _bClear) { + if (!_rxDrawPage.is()) + return false; + sal_Bool bKnownPage = sal_False; // the one for the ids @@ -406,7 +409,9 @@ namespace xmloff //--------------------------------------------------------------------- ::rtl::OUString OFormLayerXMLExport_Impl::getControlId(const Reference< XPropertySet >& _rxControl) { - OSL_ENSURE(m_aCurrentPageIds != m_aControlIds.end(), "OFormLayerXMLExport_Impl::getControlId: invalid current page!"); + if (m_aCurrentPageIds == m_aControlIds.end()) + return ::rtl::OUString(); + OSL_ENSURE(m_aCurrentPageIds->second.end() != m_aCurrentPageIds->second.find(_rxControl), "OFormLayerXMLExport_Impl::getControlId: can not find the control!"); return m_aCurrentPageIds->second[_rxControl]; |