diff options
Diffstat (limited to 'sdext/source/minimizer/unodialog.cxx')
-rw-r--r-- | sdext/source/minimizer/unodialog.cxx | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/sdext/source/minimizer/unodialog.cxx b/sdext/source/minimizer/unodialog.cxx index 29291b73f022..3bf603c474ba 100644 --- a/sdext/source/minimizer/unodialog.cxx +++ b/sdext/source/minimizer/unodialog.cxx @@ -19,6 +19,7 @@ #include "unodialog.hxx" +#include <com/sun/star/awt/UnoControlDialog.hpp> #include <com/sun/star/awt/UnoControlDialogModel.hpp> #include <com/sun/star/awt/Toolkit.hpp> #include <com/sun/star/awt/XMessageBoxFactory.hpp> @@ -48,15 +49,10 @@ UnoDialog::UnoDialog( const Reference< XComponentContext > &rxContext, Reference mxContext( rxContext ), mxController( rxFrame->getController() ), mxDialogModel( UnoControlDialogModel::create(rxContext) ), - mxDialog( mxContext->getServiceManager()->createInstanceWithContext( OUString( - "com.sun.star.awt.UnoControlDialog" ), mxContext ), UNO_QUERY_THROW ), - mxControl( mxDialog, UNO_QUERY_THROW ), + mxDialog( UnoControlDialog::create(rxContext) ), mbStatus( sal_False ) { - mxControl->setModel( mxDialogModel ); - mxDialogControlContainer = Reference< XControlContainer >( mxDialog, UNO_QUERY_THROW ); - mxDialogComponent = Reference< XComponent >( mxDialog, UNO_QUERY_THROW ); - mxDialogWindow = Reference< XWindow >( mxDialog, UNO_QUERY_THROW ); + mxDialog->setModel( mxDialogModel ); Reference< XFrame > xFrame( mxController->getFrame() ); Reference< XWindow > xContainerWindow( xFrame->getContainerWindow() ); @@ -75,8 +71,8 @@ UnoDialog::~UnoDialog() void UnoDialog::execute() { - mxDialogWindow->setEnable( sal_True ); - mxDialogWindow->setVisible( sal_True ); + mxDialog->setEnable( sal_True ); + mxDialog->setVisible( sal_True ); mxDialog->execute(); } @@ -91,14 +87,14 @@ void UnoDialog::endExecute( sal_Bool bStatus ) Reference< XWindowPeer > UnoDialog::createWindowPeer( Reference< XWindowPeer > xParentPeer ) throw ( Exception ) { - mxDialogWindow->setVisible( sal_False ); + mxDialog->setVisible( sal_False ); Reference< XToolkit > xToolkit( Toolkit::create( mxContext ), UNO_QUERY_THROW ); if ( !xParentPeer.is() ) xParentPeer = xToolkit->getDesktopWindow(); mxReschedule = Reference< XReschedule >( xToolkit, UNO_QUERY ); - mxControl->createPeer( xToolkit, xParentPeer ); + mxDialog->createPeer( xToolkit, xParentPeer ); // xWindowPeer = xControl.getPeer(); - return mxControl->getPeer(); + return mxDialog->getPeer(); } // ----------------------------------------------------------------------------- @@ -126,7 +122,7 @@ void UnoDialog::setVisible( const OUString& rName, sal_Bool bVisible ) { try { - Reference< XInterface > xControl( mxDialogControlContainer->getControl( rName ), UNO_QUERY_THROW ); + Reference< XInterface > xControl( mxDialog->getControl( rName ), UNO_QUERY_THROW ); Reference< XWindow > xWindow( xControl, UNO_QUERY_THROW ); xWindow->setVisible( bVisible ); } @@ -147,7 +143,7 @@ Reference< XButton > UnoDialog::insertButton( const OUString& rName, Reference< rName, rPropertyNames, rPropertyValues ) ); Reference< XPropertySet > xPropertySet( xButtonModel, UNO_QUERY_THROW ); xPropertySet->setPropertyValue( OUString( "Name" ), Any( rName ) ); - xButton = Reference< XButton >( mxDialogControlContainer->getControl( rName ), UNO_QUERY_THROW ); + xButton = Reference< XButton >( mxDialog->getControl( rName ), UNO_QUERY_THROW ); if ( xActionListener.is() ) { @@ -172,7 +168,7 @@ Reference< XFixedText > UnoDialog::insertFixedText( const OUString& rName, const Reference< XPropertySet > xPropertySet( insertControlModel( OUString( "com.sun.star.awt.UnoControlFixedTextModel" ), rName, rPropertyNames, rPropertyValues ), UNO_QUERY_THROW ); xPropertySet->setPropertyValue( OUString( "Name" ), Any( rName ) ); - xFixedText = Reference< XFixedText >( mxDialogControlContainer->getControl( rName ), UNO_QUERY_THROW ); + xFixedText = Reference< XFixedText >( mxDialog->getControl( rName ), UNO_QUERY_THROW ); } catch ( Exception& ) { @@ -190,7 +186,7 @@ Reference< XCheckBox > UnoDialog::insertCheckBox( const OUString& rName, const S Reference< XPropertySet > xPropertySet( insertControlModel( OUString( "com.sun.star.awt.UnoControlCheckBoxModel" ), rName, rPropertyNames, rPropertyValues ), UNO_QUERY_THROW ); xPropertySet->setPropertyValue( OUString( "Name" ), Any( rName ) ); - xCheckBox = Reference< XCheckBox >( mxDialogControlContainer->getControl( rName ), UNO_QUERY_THROW ); + xCheckBox = Reference< XCheckBox >( mxDialog->getControl( rName ), UNO_QUERY_THROW ); } catch ( Exception& ) { @@ -208,7 +204,7 @@ Reference< XControl > UnoDialog::insertFormattedField( const OUString& rName, co Reference< XPropertySet > xPropertySet( insertControlModel( OUString( "com.sun.star.awt.UnoControlFormattedFieldModel" ), rName, rPropertyNames, rPropertyValues ), UNO_QUERY_THROW ); xPropertySet->setPropertyValue( OUString( "Name" ), Any( rName ) ); - xControl = Reference< XControl >( mxDialogControlContainer->getControl( rName ), UNO_QUERY_THROW ); + xControl = Reference< XControl >( mxDialog->getControl( rName ), UNO_QUERY_THROW ); } catch ( Exception& ) { @@ -226,7 +222,7 @@ Reference< XComboBox > UnoDialog::insertComboBox( const OUString& rName, const S Reference< XPropertySet > xPropertySet( insertControlModel( OUString( "com.sun.star.awt.UnoControlComboBoxModel" ), rName, rPropertyNames, rPropertyValues ), UNO_QUERY_THROW ); xPropertySet->setPropertyValue( OUString( "Name" ), Any( rName ) ); - xControl = Reference< XComboBox >( mxDialogControlContainer->getControl( rName ), UNO_QUERY_THROW ); + xControl = Reference< XComboBox >( mxDialog->getControl( rName ), UNO_QUERY_THROW ); } catch ( Exception& ) { @@ -244,7 +240,7 @@ Reference< XRadioButton > UnoDialog::insertRadioButton( const OUString& rName, c Reference< XPropertySet > xPropertySet( insertControlModel( OUString( "com.sun.star.awt.UnoControlRadioButtonModel" ), rName, rPropertyNames, rPropertyValues ), UNO_QUERY_THROW ); xPropertySet->setPropertyValue( OUString( "Name" ), Any( rName ) ); - xControl = Reference< XRadioButton >( mxDialogControlContainer->getControl( rName ), UNO_QUERY_THROW ); + xControl = Reference< XRadioButton >( mxDialog->getControl( rName ), UNO_QUERY_THROW ); } catch ( Exception& ) { @@ -262,7 +258,7 @@ Reference< XListBox > UnoDialog::insertListBox( const OUString& rName, const Seq Reference< XPropertySet > xPropertySet( insertControlModel( OUString( "com.sun.star.awt.UnoControlListBoxModel" ), rName, rPropertyNames, rPropertyValues ), UNO_QUERY_THROW ); xPropertySet->setPropertyValue( OUString( "Name" ), Any( rName ) ); - xControl = Reference< XListBox >( mxDialogControlContainer->getControl( rName ), UNO_QUERY_THROW ); + xControl = Reference< XListBox >( mxDialog->getControl( rName ), UNO_QUERY_THROW ); } catch ( Exception& ) { @@ -280,7 +276,7 @@ Reference< XControl > UnoDialog::insertImage( const OUString& rName, const Seque Reference< XPropertySet > xPropertySet( insertControlModel( OUString( "com.sun.star.awt.UnoControlImageControlModel" ), rName, rPropertyNames, rPropertyValues ), UNO_QUERY_THROW ); xPropertySet->setPropertyValue( OUString( "Name" ), Any( rName ) ); - xControl = Reference< XControl >( mxDialogControlContainer->getControl( rName ), UNO_QUERY_THROW ); + xControl = Reference< XControl >( mxDialog->getControl( rName ), UNO_QUERY_THROW ); } catch ( Exception& ) { |