summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2017-05-24 12:48:12 +0300
committerAndras Timar <andras.timar@collabora.com>2017-05-30 10:19:46 +0200
commite74d699e3d442ee15564f0e9f41b8e7dd0d8e4b8 (patch)
tree9f4ba99ed6efa10194f5c16037b1797577a6eff6 /sc
parentad612ab62a2bc1cfd07aadc56b576daf3445bf24 (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> (cherry picked from commit 4dc3e7d5e9044be66177e467d739bd8be7556783) Reviewed-on: https://gerrit.libreoffice.org/38063 (cherry picked from commit bb9c240046955c432d963610d5dd99edcc6b43e6) Reviewed-on: https://gerrit.libreoffice.org/38083 Tested-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit f82a36749a9df51d2344e4acb88f0e53b39f8e72)
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/vba/vbarange.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index af3a4e6c48e1..955d35a2c4e8 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -5270,7 +5270,8 @@ ScVbaRange::setStyle( const uno::Any& _style ) throw (uno::RuntimeException, std
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 >