diff options
author | Tamas Bunth <tamas.bunth@collabora.co.uk> | 2017-06-27 11:49:43 +0200 |
---|---|---|
committer | Tamás Bunth <btomi96@gmail.com> | 2017-06-28 09:57:31 +0200 |
commit | 101971ab1c32ad386149bdc1797045b3f43dbe20 (patch) | |
tree | 961eca3c4318c1bd53c284b037f8697af116ad26 | |
parent | 0d7b437260ec991ee70769e7fb1002973e431f12 (diff) |
oovbaapi: do not use properties for formControl
UnderLine, CharContoured and ColorIndex does not work for formControl,
(WrappedTargetRuntimeException), disable it for now.
Change-Id: Ibc16d91bf90011131386c30a218690c0f4e74797
Reviewed-on: https://gerrit.libreoffice.org/39291
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
Tested-by: Tamás Bunth <btomi96@gmail.com>
-rw-r--r-- | sc/source/ui/vba/vbafont.cxx | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sc/source/ui/vba/vbafont.cxx b/sc/source/ui/vba/vbafont.cxx index da38074e316d..36ef891c0b94 100644 --- a/sc/source/ui/vba/vbafont.cxx +++ b/sc/source/ui/vba/vbafont.cxx @@ -70,6 +70,9 @@ ScVbaFont::getSize() void SAL_CALL ScVbaFont::setColorIndex( const uno::Any& _colorindex ) { + if(mbFormControl) + return; + sal_Int32 nIndex = 0; _colorindex >>= nIndex; // #FIXME xlColorIndexAutomatic & xlColorIndexNone are not really @@ -87,6 +90,8 @@ ScVbaFont::setColorIndex( const uno::Any& _colorindex ) uno::Any SAL_CALL ScVbaFont::getColorIndex() { + if(mbFormControl) + return uno::Any( (sal_Int32) 0 ); if ( GetDataSet() ) if ( GetDataSet()->GetItemState( ATTR_FONT_COLOR) == SfxItemState::DONTCARE ) return aNULL(); @@ -187,6 +192,9 @@ ScVbaFont::getBold() void SAL_CALL ScVbaFont::setUnderline( const uno::Any& aValue ) { + if(mbFormControl) + return; + // default sal_Int32 nValue = excel::XlUnderlineStyle::xlUnderlineStyleNone; aValue >>= nValue; @@ -226,6 +234,10 @@ ScVbaFont::getUnderline() return aNULL(); sal_Int32 nValue = awt::FontUnderline::NONE; + + if(mbFormControl) + return uno::makeAny( nValue ); + mxFont->getPropertyValue("CharUnderline") >>= nValue; switch ( nValue ) { @@ -293,7 +305,8 @@ ScVbaFont::getColor() void SAL_CALL ScVbaFont::setOutlineFont( const uno::Any& aValue ) { - mxFont->setPropertyValue("CharContoured", aValue ); + if(!mbFormControl) + mxFont->setPropertyValue("CharContoured", aValue ); } uno::Any SAL_CALL @@ -302,7 +315,7 @@ ScVbaFont::getOutlineFont() if ( GetDataSet() ) if ( GetDataSet()->GetItemState( ATTR_FONT_CONTOUR) == SfxItemState::DONTCARE ) return aNULL(); - return mxFont->getPropertyValue("CharContoured"); + return mbFormControl ? uno::Any( false ) : mxFont->getPropertyValue("CharContoured"); } OUString |