[Libreoffice-commits] .: xmloff/source

Kohei Yoshida kohei at kemper.freedesktop.org
Thu Jun 9 18:40:19 PDT 2011


 xmloff/source/forms/elementimport.cxx |    4 +++-
 xmloff/source/forms/layerexport.cxx   |    7 ++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 6d2ddc29ef3fc8535edfda879404a2f8016e054e
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Thu Jun 9 21:39:53 2011 -0400

    fdo#37646: Avoid crash when pasting a form control into chart.

diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx
index cdf3d12..409507a 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 2c2d5f4..0052fc3 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];


More information about the Libreoffice-commits mailing list