From 4113b15ca4f432608b782cc6419a6a5cd5e5f117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 2 Mar 2011 11:41:33 +0000 Subject: [PATCH] Resolves: fdo#33701 ensure node outlives path --- ...-fdo-33701-ensure-node-outlives-path.patch | 65 +++++++++++++++++++ libreoffice.spec | 5 +- 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 0001-Resolves-fdo-33701-ensure-node-outlives-path.patch diff --git a/0001-Resolves-fdo-33701-ensure-node-outlives-path.patch b/0001-Resolves-fdo-33701-ensure-node-outlives-path.patch new file mode 100644 index 0000000..61b8f0c --- /dev/null +++ b/0001-Resolves-fdo-33701-ensure-node-outlives-path.patch @@ -0,0 +1,65 @@ +From 09be9031ce3e3ffb6cc40f45ac5e1a4192adcb15 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Wed, 2 Mar 2011 11:09:41 +0000 +Subject: [PATCH] Resolves: fdo#33701 ensure node outlives path + +The xpath on destruction needs the xmldoc to exist, so the reference +to the doc-owning nodelist needs to be the first reference listed +in the class in order that its dtor is called *after* the xpath +dtor +--- + unoxml/source/xpath/nodelist.cxx | 4 ++-- + unoxml/source/xpath/nodelist.hxx | 4 ++-- + unoxml/source/xpath/xpathobject.cxx | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/unoxml/source/xpath/nodelist.cxx b/unoxml/source/xpath/nodelist.cxx +index b4e3313..884cf85 100644 +--- a/unoxml/source/xpath/nodelist.cxx ++++ b/unoxml/source/xpath/nodelist.cxx +@@ -31,8 +31,8 @@ + + namespace XPath + { +- CNodeList::CNodeList(boost::shared_ptr& rxpathObj, const Reference< XNode >& contextNode) +- : m_xContextNode(contextNode) ++ CNodeList::CNodeList(const Reference< XNode >& rContextNode, boost::shared_ptr& rxpathObj) ++ : m_xContextNode(rContextNode) + , m_pNodeSet(0) + { + if (rxpathObj != NULL && rxpathObj->type == XPATH_NODESET) +diff --git a/unoxml/source/xpath/nodelist.hxx b/unoxml/source/xpath/nodelist.hxx +index 31b9b51..c917a7d 100644 +--- a/unoxml/source/xpath/nodelist.hxx ++++ b/unoxml/source/xpath/nodelist.hxx +@@ -53,12 +53,12 @@ namespace XPath + class CNodeList : public cppu::WeakImplHelper1< XNodeList > + { + private: +- boost::shared_ptr m_pXPathObj; + const Reference< XNode > m_xContextNode; ++ boost::shared_ptr m_pXPathObj; + xmlNodeSetPtr m_pNodeSet; + + public: +- CNodeList(boost::shared_ptr &rxpathObj, const Reference< XNode >& contextNode); ++ CNodeList(const Reference< XNode >& contextNode, boost::shared_ptr &rxpathObj); + /** + The number of nodes in the list. + */ +diff --git a/unoxml/source/xpath/xpathobject.cxx b/unoxml/source/xpath/xpathobject.cxx +index 67a8f59..bbb8a5b 100644 +--- a/unoxml/source/xpath/xpathobject.cxx ++++ b/unoxml/source/xpath/xpathobject.cxx +@@ -86,7 +86,7 @@ namespace XPath + */ + Reference< XNodeList > SAL_CALL CXPathObject::getNodeList() throw (RuntimeException) + { +- return Reference< XNodeList >(new CNodeList(m_pXPathObj, m_xContextNode)); ++ return Reference< XNodeList >(new CNodeList(m_xContextNode, m_pXPathObj)); + } + + /** +-- +1.7.4.1 + diff --git a/libreoffice.spec b/libreoffice.spec index efe336a..c8cd36c 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -115,6 +115,7 @@ Patch27: 0001-rhbz-649310-don-t-crash-deregistering-diff.-platform.patch Patch28: 0001-Resolves-rhbz-674330-dereference-of-NULL-mpBase.patch Patch29: 0001-rhbz-678284-Get-correct-current-position-when-shift-page-up-and-.patch Patch30: 0001-Resolves-rhbz-681159-bandaid-for-crash.patch +Patch31: 0001-Resolves-fdo-33701-ensure-node-outlives-path.patch %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %define instdir %{_libdir} @@ -748,6 +749,7 @@ mv -f redhat.soc extras/source/palettes/standard.soc %patch28 -p1 -b .rhbz674330-dereference-of-NULL-mpBase.patch %patch29 -p1 -b .rhbz678284-Get-correct-current-position-when-shift-page-up-and-.patch %patch30 -p1 -b .rhbz681159-bandaid-for-crash.patch +%patch31 -p1 -b .fdo33701-ensure-node-outlives-path.patch touch scripting/source/pyprov/delzip touch scripting/util/provider/beanshell/delzip touch scripting/util/provider/javascript/delzip @@ -2093,8 +2095,9 @@ update-desktop-database %{_datadir}/applications &> /dev/null || : %{basisinstdir}/program/kde-open-url %changelog -* Tue Mar 01 2011 Caolán McNamara 3.3.1.2-3 +* Wed Mar 01 2011 Caolán McNamara 3.3.1.2-3 - Resolves: rhbz#681159 crash in writer +- Resolves: fdo#33701 ensure node outlives path * Thu Feb 17 2011 Caolán McNamara 3.3.1.2-2 - Resolves: rhbz#678284 Calc crashes during cell select with keys