diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-16 14:13:36 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-05-21 08:23:58 +0200 |
commit | 6c61b20a8d4a6dcac28801cde82a211fb7e30654 (patch) | |
tree | d82328eaa120b8bc822f028fa1e62bc7814c9e1b /extensions/source | |
parent | 6c53dff36ebdac7b6a6cf514ab469b2202d6aa48 (diff) |
fdo#46808, Convert awt::UnoControlDialogModel to new style
Change-Id: I4b912034ef3f4855b87d6d6f18ff13bd1ecc8f72
Diffstat (limited to 'extensions/source')
-rw-r--r-- | extensions/source/update/check/updatehdl.cxx | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/extensions/source/update/check/updatehdl.cxx b/extensions/source/update/check/updatehdl.cxx index 0bb52c1cb138..22ddd5d02c2d 100644 --- a/extensions/source/update/check/updatehdl.cxx +++ b/extensions/source/update/check/updatehdl.cxx @@ -31,6 +31,7 @@ #include <com/sun/star/style/VerticalAlignment.hpp> +#include "com/sun/star/awt/UnoControlDialogModel.hpp" #include "com/sun/star/awt/ActionEvent.hpp" #include "com/sun/star/awt/PushButtonType.hpp" #include "com/sun/star/awt/VclWindowPeerAttribute.hpp" @@ -1091,26 +1092,23 @@ void UpdateHandler::createDialog() loadStrings(); - uno::Reference< lang::XMultiComponentFactory > xFactory( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); - uno::Reference< awt::XControlModel > xControlModel( xFactory->createInstanceWithContext( - "com.sun.star.awt.UnoControlDialogModel", - mxContext), uno::UNO_QUERY_THROW ); + uno::Reference< awt::XUnoControlDialogModel > xControlDialogModel = awt::UnoControlDialogModel::create( mxContext ); { // @see awt/UnoControlDialogModel.idl - uno::Reference< beans::XPropertySet > xPropSet( xControlModel, uno::UNO_QUERY_THROW ); - - xPropSet->setPropertyValue( "Title", uno::Any( msDlgTitle ) ); - xPropSet->setPropertyValue( "Closeable", uno::Any( true ) ); - xPropSet->setPropertyValue( "Enabled", uno::Any( true ) ); - xPropSet->setPropertyValue( "Moveable", uno::Any( true ) ); - xPropSet->setPropertyValue( "Sizeable", uno::Any( true ) ); - xPropSet->setPropertyValue( "DesktopAsParent", uno::Any( true ) ); - xPropSet->setPropertyValue( "PositionX", uno::Any(sal_Int32( 100 )) ); - xPropSet->setPropertyValue( "PositionY", uno::Any(sal_Int32( 100 )) ); - xPropSet->setPropertyValue( "Width", uno::Any(sal_Int32( DIALOG_WIDTH )) ); - xPropSet->setPropertyValue( "Height", uno::Any(sal_Int32( DIALOG_HEIGHT )) ); - xPropSet->setPropertyValue( "HelpURL", uno::makeAny( INET_HID_SCHEME + OUString::createFromAscii( HID_CHECK_FOR_UPD_DLG ) ) ); + xControlDialogModel->setTitle( msDlgTitle); + xControlDialogModel->setCloseable( true ); + xControlDialogModel->setEnabled( true ); + xControlDialogModel->setMoveable( true ); + xControlDialogModel->setSizeable( true ); + xControlDialogModel->setDesktopAsParent( true ); + xControlDialogModel->setPositionX( 100 ); + xControlDialogModel->setPositionY( 100 ); + xControlDialogModel->setWidth( DIALOG_WIDTH ); + xControlDialogModel->setHeight( DIALOG_HEIGHT ); + xControlDialogModel->setHelpURL( INET_HID_SCHEME + OUString::createFromAscii( HID_CHECK_FOR_UPD_DLG ) ); } + + uno::Reference< awt::XControlModel > xControlModel = xControlModel; { // Label (fixed text) <status> uno::Sequence< beans::NamedValue > aProps(1); @@ -1322,6 +1320,7 @@ void UpdateHandler::createDialog() aProps); } + uno::Reference< lang::XMultiComponentFactory > xFactory( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); uno::Reference< awt::XControl > xControl( xFactory->createInstanceWithContext( "com.sun.star.awt.UnoControlDialog", mxContext), uno::UNO_QUERY_THROW ); |