diff options
author | Justin Luth <justin_luth@sil.org> | 2017-05-24 12:48:12 +0300 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-05-26 12:44:21 +0200 |
commit | 4dc3e7d5e9044be66177e467d739bd8be7556783 (patch) | |
tree | eda46688d4a2ef8980cda17c42859cb712067333 /sc/source/ui/vba/vbarange.cxx | |
parent | 0f2981329c6b2cf409a506ad10f1485a8fc7d686 (diff) |
tdf#108049 VBA exception avoided in ScVbaRange::setStyle
Change-Id: I5fc928373d70829b6e68d9000140a30f04179536
Reviewed-on: https://gerrit.libreoffice.org/37981
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc/source/ui/vba/vbarange.cxx')
-rw-r--r-- | sc/source/ui/vba/vbarange.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index bb4164303798..151403fa1f31 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -5311,7 +5311,8 @@ ScVbaRange::setStyle( const uno::Any& _style ) uno::Reference< beans::XPropertySet > xProps( mxRange, uno::UNO_QUERY_THROW ); uno::Reference< excel::XStyle > xStyle; _style >>= xStyle; - xProps->setPropertyValue( CELLSTYLE, uno::makeAny( xStyle->getName() ) ); + if ( xProps.is() && xStyle.is() ) + xProps->setPropertyValue( CELLSTYLE, uno::makeAny( xStyle->getName() ) ); } uno::Reference< excel::XRange > |