diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-12-13 10:15:15 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-12-13 12:17:50 +0000 |
commit | 0b9644e2443879e825fc72d5faf55080888a91b8 (patch) | |
tree | a8a296cbd4f270ab959d9efc37efa2c412258b1e /svx/source | |
parent | dd7a3f5fb873b77da326eb8339c2ef9e3bf4fbd1 (diff) |
this NULL check, leak and copy ctor all look a bit addled
Change-Id: I5a4f80e1f6b4cc834c921d4c4780989c90cbefe2
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/accessibility/AccessibleShape.cxx | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx index a72ebef31ffa..d75864f2595d 100644 --- a/svx/source/accessibility/AccessibleShape.cxx +++ b/svx/source/accessibility/AccessibleShape.cxx @@ -424,22 +424,14 @@ uno::Reference<XAccessibleRelationSet> SAL_CALL ::utl::AccessibleRelationSetHelper* pRelationSet = new utl::AccessibleRelationSetHelper; //this mxshape is the captioned shape, only for sw - if (pRelationSet != NULL) + uno::Sequence< uno::Reference< uno::XInterface > > aSequence(1); + aSequence[0] = mpParent->GetAccessibleCaption(mxShape); + if(aSequence[0].get()) { - uno::Sequence< uno::Reference< uno::XInterface > > aSequence(1); - aSequence[0] = mpParent->GetAccessibleCaption(mxShape); - if(aSequence[0].get()) - { - pRelationSet->AddRelation( - AccessibleRelation( AccessibleRelationType::DESCRIBED_BY, aSequence ) ); - } - return uno::Reference<XAccessibleRelationSet> ( - new ::utl::AccessibleRelationSetHelper (*pRelationSet)); - } - else - { - return uno::Reference<XAccessibleRelationSet>(NULL); + pRelationSet->AddRelation( + AccessibleRelation( AccessibleRelationType::DESCRIBED_BY, aSequence ) ); } + return uno::Reference<XAccessibleRelationSet>(pRelationSet); } /** Return a copy of the state set. |