From 9f0997eb167d0ef2193a59d43ab55ea5f13ebaac Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 14 Jun 2016 15:48:52 +0100 Subject: Resolves: tdf#59222 Crash in Basic with an array of values... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit from a range address trying to make all SbxVariables reference count their parents is ludiciously hard, so just reference count this one known crashing case Change-Id: Ie1fa6624e8184146dd00d766cdbacef674153ef6 Reviewed-on: https://gerrit.libreoffice.org/26272 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- include/basic/sbxvar.hxx | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/basic/sbxvar.hxx') diff --git a/include/basic/sbxvar.hxx b/include/basic/sbxvar.hxx index 3ee3768a2a07..25ac2605d859 100644 --- a/include/basic/sbxvar.hxx +++ b/include/basic/sbxvar.hxx @@ -283,8 +283,19 @@ public: static sal_uInt16 MakeHashCode( const OUString& rName ); }; +typedef tools::SvRef SbxObjectRef; typedef tools::SvRef SbxVariableRef; +//tdf#59222 SbxEnsureParentVariable is a SbxVariable which keeps a reference to +//its parent, ensuring it always exists while this SbxVariable exists +class BASIC_DLLPUBLIC SbxEnsureParentVariable : public SbxVariable +{ + SbxObjectRef xParent; +public: + SbxEnsureParentVariable(const SbxVariable& r); + virtual void SetParent(SbxObject* p) override; +}; + #endif // INCLUDED_BASIC_SBXVAR_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit