diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-02-07 15:04:16 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-02-11 07:08:24 +0100 |
commit | 6fd533031f2775aaa8843065a9986caf1fa304b0 (patch) | |
tree | 734e7d15ea9ebcb00b505f532cb5d43cba0f2328 /chart2 | |
parent | 3165146f6deef86eb408837275ec3f7edda0183b (diff) |
tdf#120703 PVS: remove obsolete check (leftover from static removal)
V560 A part of conditional expression is always true: !pSymbolList.
In commit a2cd17d19085d739b979445d7f9ec7158b89df49, pSymbolList and
xSymbols were made non-static. The check below was left though.
Actually, I don't know if that was a safe move, since it's unclear
how the lifetime of the returned pointer is managed now to prevent
use-after-free.
Change-Id: Ia51a9790503694f909ce7953337d3caaebfabfc1
Reviewed-on: https://gerrit.libreoffice.org/67512
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/drawinglayer/ViewElementListProvider.cxx | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx index 94660e734890..52b122f909c4 100644 --- a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx +++ b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx @@ -106,27 +106,27 @@ XPatternListRef ViewElementListProvider::GetPatternList() const SdrObjList* ViewElementListProvider::GetSymbolList() const { SdrObjList* pSymbolList = nullptr; - uno::Reference< drawing::XShapes > xSymbols;//@todo this keeps the first drawinglayer alive ... try { - if(!pSymbolList || !pSymbolList->GetObjCount()) - { - //@todo use mutex + //@todo use mutex - //get shape factory - uno::Reference< lang::XMultiServiceFactory > xShapeFactory( m_pDrawModelWrapper->getShapeFactory() ); + //get shape factory + uno::Reference<lang::XMultiServiceFactory> xShapeFactory( + m_pDrawModelWrapper->getShapeFactory()); - //get hidden draw page (target): - uno::Reference<drawing::XShapes> xTarget( m_pDrawModelWrapper->getHiddenDrawPage(), uno::UNO_QUERY ); + //get hidden draw page (target): + uno::Reference<drawing::XShapes> xTarget(m_pDrawModelWrapper->getHiddenDrawPage(), + uno::UNO_QUERY); - //create symbols via uno and convert to native sdr objects - drawing::Direction3D aSymbolSize(220,220,0); // should be 250, but 250 -> 280 ?? - xSymbols = DataPointSymbolSupplier::create2DSymbolList( xShapeFactory, xTarget, aSymbolSize ); + //create symbols via uno and convert to native sdr objects + drawing::Direction3D aSymbolSize(220, 220, 0); // should be 250, but 250 -> 280 ?? + uno::Reference<drawing::XShapes> xSymbols + = DataPointSymbolSupplier::create2DSymbolList(xShapeFactory, xTarget, aSymbolSize); - SdrObject* pSdrObject = DrawViewWrapper::getSdrObject( uno::Reference< drawing::XShape >( xSymbols, uno::UNO_QUERY ) ); - if(pSdrObject) - pSymbolList = pSdrObject->GetSubList(); - } + SdrObject* pSdrObject = DrawViewWrapper::getSdrObject( + uno::Reference<drawing::XShape>(xSymbols, uno::UNO_QUERY)); + if (pSdrObject) + pSymbolList = pSdrObject->GetSubList(); } catch( const uno::Exception& e ) { |