summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2017-05-24 12:48:12 +0300
committerJustin Luth <justin_luth@sil.org>2017-05-26 19:13:57 +0200
commitbb9c240046955c432d963610d5dd99edcc6b43e6 (patch)
tree1d03a59a43c36eb58697cb3d69f9b5287b04b3a9
parent3e368230eb28cd88a9491f6ca7a16a65e2774263 (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
-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 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 >