summaryrefslogtreecommitdiff
path: root/basic/source/classes/eventatt.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'basic/source/classes/eventatt.cxx')
-rw-r--r--basic/source/classes/eventatt.cxx32
1 files changed, 26 insertions, 6 deletions
diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx
index a54d2a962cb7..f74bb95eb2a9 100644
--- a/basic/source/classes/eventatt.cxx
+++ b/basic/source/classes/eventatt.cxx
@@ -22,7 +22,6 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx>
-#include <com/sun/star/awt/UnoControlDialogModel.hpp>
#include <com/sun/star/awt/XControlContainer.hpp>
#include <com/sun/star/awt/XControlModel.hpp>
#include <com/sun/star/awt/XControl.hpp>
@@ -424,7 +423,7 @@ void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrit
(void)pBasic;
(void)bWrite;
- Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
+ Reference< XMultiServiceFactory > xMSF( comphelper::getProcessServiceFactory() );
// We need at least 1 parameter
if ( rPar.Count() < 2 )
@@ -451,22 +450,43 @@ void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrit
}
// Create new uno dialog
- Reference< XUnoControlDialogModel > xDialogModel = UnoControlDialogModel::create( xContext );
+ Reference< XNameContainer > xDialogModel( xMSF->createInstance(
+ OUString("com.sun.star.awt.UnoControlDialogModel")), UNO_QUERY );
+ if( !xDialogModel.is() )
+ {
+ return;
+ }
Reference< XInputStreamProvider > xISP;
aAnyISP >>= xISP;
if( !xISP.is() )
{
return;
}
+ Reference< XComponentContext > xContext( comphelper::getComponentContext( xMSF ) );
// Import the DialogModel
Reference< XInputStream > xInput( xISP->createInputStream() );
// i83963 Force decoration
- if( !xDialogModel->getDecoration() )
+ uno::Reference< beans::XPropertySet > xDlgModPropSet( xDialogModel, uno::UNO_QUERY );
+ if( xDlgModPropSet.is() )
{
- xDialogModel->setDecoration( true );
- xDialogModel->setTitle( OUString() );
+ bool bDecoration = true;
+ try
+ {
+ OUString aDecorationPropName("Decoration");
+ Any aDecorationAny = xDlgModPropSet->getPropertyValue( aDecorationPropName );
+ aDecorationAny >>= bDecoration;
+ if( !bDecoration )
+ {
+ xDlgModPropSet->setPropertyValue( aDecorationPropName, makeAny( true ) );
+
+ OUString aTitlePropName("Title");
+ xDlgModPropSet->setPropertyValue( aTitlePropName, makeAny( OUString() ) );
+ }
+ }
+ catch(const UnknownPropertyException& )
+ {}
}
Any aDlgLibAny;