summaryrefslogtreecommitdiff
path: root/sdext/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-05-27 11:24:12 +0200
committerNoel Grandin <noel@peralex.com>2013-05-28 08:10:22 +0200
commit1d1825db869d3c633ec222fdaa7e4a813ac0627a (patch)
treed1c84dfbe5780bc063d78c335783fa9cffda800e /sdext/source
parent61fffd72ac9f09b95faf266f29e643c7bff802bd (diff)
fdo#46808, Convert awt::UnoControlDialog to new style
Change-Id: I9a5256c8dbacda60167403b4e26900588943a9b2
Diffstat (limited to 'sdext/source')
-rw-r--r--sdext/source/minimizer/optimizerdialog.cxx2
-rw-r--r--sdext/source/minimizer/unodialog.cxx51
-rw-r--r--sdext/source/minimizer/unodialog.hxx7
3 files changed, 27 insertions, 33 deletions
diff --git a/sdext/source/minimizer/optimizerdialog.cxx b/sdext/source/minimizer/optimizerdialog.cxx
index d6c73488725d..acc45bf74df0 100644
--- a/sdext/source/minimizer/optimizerdialog.cxx
+++ b/sdext/source/minimizer/optimizerdialog.cxx
@@ -110,7 +110,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 922527e2a88d..8c2eafe3e3de 100644
--- a/sdext/source/minimizer/unodialog.cxx
+++ b/sdext/source/minimizer/unodialog.cxx
@@ -19,15 +19,16 @@
#include "unodialog.hxx"
-#include <com/sun/star/text/XTextRange.hpp>
-#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/awt/MessageBoxButtons.hpp>
+#include <com/sun/star/awt/Toolkit.hpp>
+#include <com/sun/star/awt/UnoControlDialog.hpp>
+#include <com/sun/star/awt/XMessageBoxFactory.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/text/XTextRange.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <com/sun/star/view/XControlAccess.hpp>
-#include <com/sun/star/frame/XDispatch.hpp>
-#include <com/sun/star/awt/Toolkit.hpp>
-#include <com/sun/star/awt/XMessageBoxFactory.hpp>
-#include <com/sun/star/awt/MessageBoxButtons.hpp>
// -------------
// - UnoDialog -
@@ -43,8 +44,8 @@ using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::script;
-UnoDialog::UnoDialog( const Reference< XComponentContext > &rxMSF, Reference< XFrame >& rxFrame ) :
- mxMSF( rxMSF ),
+UnoDialog::UnoDialog( const Reference< XComponentContext > &rxContext, Reference< XFrame >& rxFrame ) :
+ mxMSF( rxContext ),
mxController( rxFrame->getController() ),
mxDialogModel( mxMSF->getServiceManager()->createInstanceWithContext( OUString(
"com.sun.star.awt.UnoControlDialogModel" ), mxMSF ), UNO_QUERY_THROW ),
@@ -54,15 +55,11 @@ UnoDialog::UnoDialog( const Reference< XComponentContext > &rxMSF, Reference< XF
mxDialogModelNameContainer( mxDialogModel, UNO_QUERY_THROW ),
mxDialogModelNameAccess( mxDialogModel, UNO_QUERY_THROW ),
mxControlModel( mxDialogModel, UNO_QUERY_THROW ),
- mxDialog( mxMSF->getServiceManager()->createInstanceWithContext( OUString(
- "com.sun.star.awt.UnoControlDialog" ), mxMSF ), UNO_QUERY_THROW ),
+ mxDialog( UnoControlDialog::create(rxContext) ),
mxControl( mxDialog, UNO_QUERY_THROW ),
mbStatus( sal_False )
{
mxControl->setModel( mxControlModel );
- mxDialogControlContainer = Reference< XControlContainer >( mxDialog, UNO_QUERY_THROW );
- mxDialogComponent = Reference< XComponent >( mxDialog, UNO_QUERY_THROW );
- mxDialogWindow = Reference< XWindow >( mxDialog, UNO_QUERY_THROW );
Reference< XFrame > xFrame( mxController->getFrame() );
Reference< XWindow > xContainerWindow( xFrame->getContainerWindow() );
@@ -81,8 +78,8 @@ UnoDialog::~UnoDialog()
void UnoDialog::execute()
{
- mxDialogWindow->setEnable( sal_True );
- mxDialogWindow->setVisible( sal_True );
+ mxDialog->setEnable( sal_True );
+ mxDialog->setVisible( sal_True );
mxDialog->execute();
}
@@ -97,14 +94,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( mxMSF ), 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();
}
// -----------------------------------------------------------------------------
@@ -132,7 +129,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 );
}
@@ -153,7 +150,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() )
{
@@ -178,7 +175,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& )
{
@@ -196,7 +193,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& )
{
@@ -214,7 +211,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& )
{
@@ -232,7 +229,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& )
{
@@ -250,7 +247,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& )
{
@@ -268,7 +265,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& )
{
@@ -286,7 +283,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 b08ce1e5d8fe..b06aab794d85 100644
--- a/sdext/source/minimizer/unodialog.hxx
+++ b/sdext/source/minimizer/unodialog.hxx
@@ -43,6 +43,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>
@@ -119,14 +120,10 @@ public :
com::sun::star::uno::Reference< com::sun::star::awt::XControlModel > mxControlModel;
- com::sun::star::uno::Reference< com::sun::star::awt::XDialog > mxDialog;
+ com::sun::star::uno::Reference< com::sun::star::awt::XUnoControlDialog > mxDialog;
com::sun::star::uno::Reference< com::sun::star::awt::XControl > mxControl;
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;
};