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 21:04:33 +0200
commitf82a36749a9df51d2344e4acb88f0e53b39f8e72 (patch)
treecd13cc6b50ad49769c5972bc36b4fc178ec0231d
parentbb50f9d66540a87065f30da8fd8cadde8e730704 (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>
-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 >