diff options
-rw-r--r-- | vbahelper/source/msforms/vbacontrol.cxx | 15 | ||||
-rw-r--r-- | vbahelper/source/vbahelper/vbacommandbars.cxx | 4 |
2 files changed, 18 insertions, 1 deletions
diff --git a/vbahelper/source/msforms/vbacontrol.cxx b/vbahelper/source/msforms/vbacontrol.cxx index 288cefaf20cc..e9be0406615d 100644 --- a/vbahelper/source/msforms/vbacontrol.cxx +++ b/vbahelper/source/msforms/vbacontrol.cxx @@ -192,7 +192,14 @@ void SAL_CALL ScVbaControl::setEnabled( sal_Bool bVisible ) throw (uno::RuntimeE sal_Bool SAL_CALL ScVbaControl::getVisible() throw (uno::RuntimeException) { sal_Bool bVisible( sal_True ); - m_xProps->getPropertyValue( "EnableVisible" ) >>= bVisible; + uno::Reference< drawing::XControlShape > xControlShape( m_xControl, uno::UNO_QUERY ); + if ( xControlShape.is() ) + { + uno::Reference< beans::XPropertySet > xProps( m_xControl, uno::UNO_QUERY_THROW ); + xProps->getPropertyValue ( "Visible" ) >>= bVisible; + } + else + m_xProps->getPropertyValue ( "EnableVisible" ) >>= bVisible; return bVisible; } @@ -200,6 +207,12 @@ void SAL_CALL ScVbaControl::setVisible( sal_Bool bVisible ) throw (uno::RuntimeE { uno::Any aValue( bVisible ); m_xProps->setPropertyValue( "EnableVisible" , aValue); + uno::Reference< drawing::XControlShape > xControlShape( m_xControl, uno::UNO_QUERY ); + if ( xControlShape.is() ) + { + uno::Reference< beans::XPropertySet > xProps( m_xControl, uno::UNO_QUERY_THROW ); + xProps->setPropertyValue ( "Visible", aValue ); + } } double SAL_CALL ScVbaControl::getHeight() throw (uno::RuntimeException) { diff --git a/vbahelper/source/vbahelper/vbacommandbars.cxx b/vbahelper/source/vbahelper/vbacommandbars.cxx index 62b5f913a83b..0ca27c2c57f7 100644 --- a/vbahelper/source/vbahelper/vbacommandbars.cxx +++ b/vbahelper/source/vbahelper/vbacommandbars.cxx @@ -63,6 +63,10 @@ public: { uno::Reference< container::XIndexAccess > xCBarSetting = m_pCBarHelper->getSettings( sResourceUrl ); uno::Reference< XCommandBar > xCommandBar( new ScVbaCommandBar( m_xParent, m_xContext, m_pCBarHelper, xCBarSetting, sResourceUrl, sal_False ) ); + // Strange, shouldn't the Enumeration support match/share the + // iteration code? ( e.g. ScVbaCommandBars::Item(...) ) + // and we at least should return here ( something ) it seems + return uno::makeAny( xCommandBar ); } else return nextElement(); |