summaryrefslogtreecommitdiff
path: root/vbahelper
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2013-04-24 11:44:59 +0100
committerNoel Power <noel.power@suse.com>2013-04-26 15:30:35 +0100
commit0f9a9b5842ac747ddae6667e6c1e5b2ec0807f2d (patch)
treeccb956226efc82de0a1a47a9216c5c1738533128 /vbahelper
parent1bbf62198c9118961024aba482e8f600cde22007 (diff)
support UserForm.Visible attribute
Change-Id: I6e5a9d3e7908349a76a73a79b3b1319b44e1e3aa
Diffstat (limited to 'vbahelper')
-rw-r--r--vbahelper/source/msforms/vbauserform.cxx18
-rw-r--r--vbahelper/source/msforms/vbauserform.hxx2
2 files changed, 20 insertions, 0 deletions
diff --git a/vbahelper/source/msforms/vbauserform.cxx b/vbahelper/source/msforms/vbauserform.cxx
index 988e83748223..5a67b7904d00 100644
--- a/vbahelper/source/msforms/vbauserform.cxx
+++ b/vbahelper/source/msforms/vbauserform.cxx
@@ -20,6 +20,7 @@
#include "vbauserform.hxx"
#include <com/sun/star/awt/XControl.hpp>
#include <com/sun/star/awt/XControlContainer.hpp>
+#include <com/sun/star/awt/XWindow2.hpp>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/beans/PropertyConcept.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
@@ -112,6 +113,23 @@ ScVbaUserForm::setCaption( const OUString& _caption ) throw (uno::RuntimeExcepti
m_xProps->setPropertyValue( "Title", uno::makeAny( _caption ) );
}
+sal_Bool SAL_CALL
+ScVbaUserForm::getVisible() throw (uno::RuntimeException)
+{
+ uno::Reference< awt::XControl > xControl( m_xDialog, uno::UNO_QUERY_THROW );
+ uno::Reference< awt::XWindow2 > xControlWindow( xControl->getPeer(), uno::UNO_QUERY_THROW );
+ return xControlWindow->isVisible();
+}
+
+void SAL_CALL
+ScVbaUserForm::setVisible( sal_Bool bVis ) throw (uno::RuntimeException)
+{
+ if ( bVis )
+ Show();
+ else
+ Hide();
+}
+
double SAL_CALL ScVbaUserForm::getInnerWidth() throw (uno::RuntimeException)
{
return mpGeometryHelper->getInnerWidth();
diff --git a/vbahelper/source/msforms/vbauserform.hxx b/vbahelper/source/msforms/vbauserform.hxx
index 59321fc4d67b..77826c33e100 100644
--- a/vbahelper/source/msforms/vbauserform.hxx
+++ b/vbahelper/source/msforms/vbauserform.hxx
@@ -56,6 +56,8 @@ public:
virtual void SAL_CALL Hide( ) throw (css::uno::RuntimeException);
virtual void SAL_CALL UnloadObject( ) throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL Controls( const css::uno::Any& index ) throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL getVisible() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setVisible( sal_Bool bVis ) throw (::com::sun::star::uno::RuntimeException);
// XIntrospection
virtual css::uno::Reference< css::beans::XIntrospectionAccess > SAL_CALL getIntrospection( ) throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL invoke( const OUString& aFunctionName, const css::uno::Sequence< css::uno::Any >& aParams, css::uno::Sequence< ::sal_Int16 >& aOutParamIndex, css::uno::Sequence< css::uno::Any >& aOutParam ) throw (css::lang::IllegalArgumentException, css::script::CannotConvertException, css::reflection::InvocationTargetException, css::uno::RuntimeException);