diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-14 13:58:14 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-14 14:14:36 +0200 |
commit | 0869895063bd528893707cb74c6cf4c461fef066 (patch) | |
tree | bf47ccc71145f3ee387a5dafbaab9bc86b47a008 /xmloff/source/draw | |
parent | 4acae16f9252ada89fd530f1ca86edafc046bc07 (diff) |
tdf#120703 PVS: Silence V522 warnings
V522 There might be dereferencing of a potential null pointer.
Change-Id: Ie4bc74a734a6d5a73838a27e0d80cc8e51595839
Reviewed-on: https://gerrit.libreoffice.org/70730
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'xmloff/source/draw')
-rw-r--r-- | xmloff/source/draw/ximpshap.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 29fd6f35c621..9f67a8225821 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -605,8 +605,6 @@ void SdXMLShapeContext::SetStyle( bool bSupportsStyle /* = true */) do { - XMLPropStyleContext* pDocStyle = nullptr; - // set style on shape if(maDrawStyleName.isEmpty()) break; @@ -626,10 +624,10 @@ void SdXMLShapeContext::SetStyle( bool bSupportsStyle /* = true */) OUString aStyleName = maDrawStyleName; uno::Reference< style::XStyle > xStyle; - if( dynamic_cast<const XMLShapeStyleContext*>( pStyle ) ) + XMLPropStyleContext* pDocStyle + = dynamic_cast<XMLShapeStyleContext*>(const_cast<SvXMLStyleContext*>(pStyle)); + if (pDocStyle) { - pDocStyle = const_cast<XMLShapeStyleContext*>(dynamic_cast<const XMLShapeStyleContext*>( pStyle ) ); - if( pDocStyle->GetStyle().is() ) { xStyle = pDocStyle->GetStyle(); |