diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-06-14 15:48:52 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-06-14 19:54:26 +0000 |
commit | 9f0997eb167d0ef2193a59d43ab55ea5f13ebaac (patch) | |
tree | 815c61b4c26e17a1f51c503f4f1090b2b6b102c4 /basic/source/sbx/sbxvar.cxx | |
parent | be2cf3d28b91cff4127c95cfe4481f36bdeb24fb (diff) |
Resolves: tdf#59222 Crash in Basic with an array of values...
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 <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'basic/source/sbx/sbxvar.cxx')
-rw-r--r-- | basic/source/sbx/sbxvar.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx index 23d7bfe29ed3..0977c7449d02 100644 --- a/basic/source/sbx/sbxvar.cxx +++ b/basic/source/sbx/sbxvar.cxx @@ -100,6 +100,21 @@ SbxVariable::SbxVariable( const SbxVariable& r ) } } +SbxEnsureParentVariable::SbxEnsureParentVariable(const SbxVariable& r) + : SbxVariable(r) + , xParent(const_cast<SbxVariable&>(r).GetParent()) +{ + assert(GetParent() == xParent.get()); +} + +void SbxEnsureParentVariable::SetParent(SbxObject* p) +{ + assert(GetParent() == xParent.get()); + SbxVariable::SetParent(p); + xParent = SbxObjectRef(p); + assert(GetParent() == xParent.get()); +} + SbxVariable::SbxVariable( SbxDataType t, void* p ) : SbxValue( t, p ) { pCst = nullptr; |