summaryrefslogtreecommitdiff
path: root/vbahelper/source/msforms/vbauserform.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vbahelper/source/msforms/vbauserform.cxx')
-rw-r--r--vbahelper/source/msforms/vbauserform.cxx23
1 files changed, 23 insertions, 0 deletions
diff --git a/vbahelper/source/msforms/vbauserform.cxx b/vbahelper/source/msforms/vbauserform.cxx
index 33e357b00c..0bb3ea425f 100644
--- a/vbahelper/source/msforms/vbauserform.cxx
+++ b/vbahelper/source/msforms/vbauserform.cxx
@@ -28,6 +28,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/beans/PropertyConcept.hpp>
#include <basic/sbx.hxx>
#include <basic/sbstar.hxx>
@@ -53,6 +54,8 @@ ScVbaUserForm::ScVbaUserForm( uno::Sequence< uno::Any > const& aArgs, uno::Refer
uno::Reference< awt::XControl > xControl( m_xDialog, uno::UNO_QUERY_THROW );
m_xProps.set( xControl->getModel(), uno::UNO_QUERY_THROW );
setGeometryHelper( new UserFormGeometryHelper( xContext, xControl ) );
+ if ( aArgs.getLength() >= 4 )
+ aArgs[ 3 ] >>= m_sLibName;
}
ScVbaUserForm::~ScVbaUserForm()
@@ -104,6 +107,24 @@ ScVbaUserForm::Hide( ) throw (uno::RuntimeException)
m_xDialog->endExecute();
}
+sal_Bool SAL_CALL ScVbaUserForm::getVisible() throw (uno::RuntimeException)
+{
+ uno::Reference< awt::XWindow2 > xWindow2( getWindowPeer(), uno::UNO_QUERY_THROW );
+ return xWindow2->isVisible();
+}
+
+void SAL_CALL ScVbaUserForm::setVisible( sal_Bool bVisible ) throw (uno::RuntimeException)
+{
+ if ( bVisible )
+ {
+ Show();
+ }
+ else
+ {
+ Hide();
+ }
+}
+
void SAL_CALL
ScVbaUserForm::RePaint( ) throw (uno::RuntimeException)
{
@@ -184,6 +205,8 @@ ScVbaUserForm::getValue( const ::rtl::OUString& aPropertyName ) throw (beans::Un
uno::Reference< msforms::XControl > xVBAControl( aFac.createControl( xDialogControl->getModel() ) );
ScVbaControl* pControl = dynamic_cast< ScVbaControl* >( xVBAControl.get() );
pControl->setGeometryHelper( new UserFormGeometryHelper( mxContext, xControl ) );
+ if ( m_sLibName.getLength() )
+ pControl->setLibraryAndCodeName( m_sLibName.concat( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) ) ).concat( getName() ) );
aResult = uno::makeAny( xVBAControl );
}