diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-16 16:17:14 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-05-21 08:23:59 +0200 |
commit | be50ad28f5bbdaeff527f646481ce263843c2401 (patch) | |
tree | 65ecdaa5762dda2d9a42cff394a536bf568ed4f6 /sdext | |
parent | 6c61b20a8d4a6dcac28801cde82a211fb7e30654 (diff) |
fdo#46808, Convert awt::XUnoControlDialog to new style
Change-Id: I40d2e2ddd92186a2ba22ebfbdda8367391e8d355
Diffstat (limited to 'sdext')
-rw-r--r-- | sdext/source/minimizer/optimizerdialog.cxx | 2 | ||||
-rw-r--r-- | sdext/source/minimizer/unodialog.cxx | 38 | ||||
-rw-r--r-- | sdext/source/minimizer/unodialog.hxx | 8 |
3 files changed, 20 insertions, 28 deletions
diff --git a/sdext/source/minimizer/optimizerdialog.cxx b/sdext/source/minimizer/optimizerdialog.cxx index e8ef92b40248..0a3ff9551e44 100644 --- a/sdext/source/minimizer/optimizerdialog.cxx +++ b/sdext/source/minimizer/optimizerdialog.cxx @@ -93,7 +93,7 @@ void OptimizerDialog::InitRoadmap() Reference< XPropertySet > xPropertySet( mxRoadmapControlModel, UNO_QUERY_THROW ); xPropertySet->setPropertyValue( TKGet( TK_Name ), Any( TKGet( TK_rdmNavi ) ) ); - mxRoadmapControl = mxDialogControlContainer->getControl( TKGet( TK_rdmNavi ) ); + mxRoadmapControl = mxDialog->getControl( TKGet( TK_rdmNavi ) ); InsertRoadmapItem( 0, sal_True, getString( STR_INTRODUCTION ), ITEM_ID_INTRODUCTION ); InsertRoadmapItem( 1, sal_True, getString( STR_SLIDES ), ITEM_ID_SLIDES ); InsertRoadmapItem( 2, sal_True, getString( STR_IMAGE_OPTIMIZATION ), ITEM_ID_GRAPHIC_OPTIMIZATION ); 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& ) { diff --git a/sdext/source/minimizer/unodialog.hxx b/sdext/source/minimizer/unodialog.hxx index 37be5e01149b..032fe6cf47af 100644 --- a/sdext/source/minimizer/unodialog.hxx +++ b/sdext/source/minimizer/unodialog.hxx @@ -44,6 +44,7 @@ #include <com/sun/star/awt/XRadioButton.hpp> #include <com/sun/star/awt/XListBox.hpp> #include <com/sun/star/awt/XFixedText.hpp> +#include <com/sun/star/awt/XUnoControlDialog.hpp> #include <com/sun/star/awt/XControlContainer.hpp> #include <com/sun/star/awt/XReschedule.hpp> #include <com/sun/star/awt/XDialog.hpp> @@ -113,14 +114,9 @@ public : com::sun::star::uno::Reference< com::sun::star::awt::XUnoControlDialogModel > mxDialogModel; - com::sun::star::uno::Reference< com::sun::star::awt::XDialog > mxDialog; - com::sun::star::uno::Reference< com::sun::star::awt::XControl > mxControl; + com::sun::star::uno::Reference< com::sun::star::awt::XUnoControlDialog > mxDialog; com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer > mxWindowPeer; - com::sun::star::uno::Reference< com::sun::star::awt::XControlContainer > mxDialogControlContainer; - com::sun::star::uno::Reference< com::sun::star::lang::XComponent > mxDialogComponent; - com::sun::star::uno::Reference< com::sun::star::awt::XWindow > mxDialogWindow; - sal_Bool mbStatus; }; |