[Libreoffice-commits] .: Branch 'libreoffice-3-4' - xmloff/source

Markus Mohrhard mmohrhard at kemper.freedesktop.org
Thu Jun 9 21:12:29 PDT 2011


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

New commits:
commit 61cdc82f4df5e0b21ebdb9029651a22eb54c1cea
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Fri Jun 10 01:39:53 2011 +0000

    fdo#37646: Avoid crash when pasting a form control into chart.
    
    Signed-off-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx
index 7f5688e..99ce71f 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