summaryrefslogtreecommitdiff
path: root/basctl
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 /basctl
parent61fffd72ac9f09b95faf266f29e643c7bff802bd (diff)
fdo#46808, Convert awt::UnoControlDialog to new style
Change-Id: I9a5256c8dbacda60167403b4e26900588943a9b2
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/dlged/dlged.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx
index 54aef41b16ba..d2f55c589810 100644
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@ -33,6 +33,7 @@
#include "baside3.hxx"
#include <com/sun/star/awt/Toolkit.hpp>
+#include <com/sun/star/awt/UnoControlDialog.hpp>
#include <com/sun/star/awt/XDialog.hpp>
#include <com/sun/star/resource/StringResource.hpp>
#include <com/sun/star/util/XCloneable.hpp>
@@ -91,7 +92,7 @@ void DlgEditor::ShowDialog()
uno::Reference< uno::XComponentContext > xContext = getProcessComponentContext();
// create a dialog
- uno::Reference< awt::XControl > xDlg( getProcessServiceFactory()->createInstance( "com.sun.star.awt.UnoControlDialog" ), uno::UNO_QUERY );
+ uno::Reference< awt::XUnoControlDialog > xDlg = awt::UnoControlDialog::create( xContext );
// clone the dialog model
uno::Reference< util::XCloneable > xC( m_xUnoControlDialogModel, uno::UNO_QUERY );
@@ -138,12 +139,10 @@ void DlgEditor::ShowDialog()
uno::Reference< awt::XToolkit> xToolkit = awt::Toolkit::create( xContext );
xDlg->createPeer( xToolkit, rWindow.GetComponentInterface() );
- uno::Reference< awt::XDialog > xD( xDlg, uno::UNO_QUERY );
- xD->execute();
+ xDlg->execute();
- uno::Reference< lang::XComponent > xComponent(xDlg, uno::UNO_QUERY);
- if (xComponent.is())
- xComponent->dispose();
+ // need to cast because of multiple inheritance
+ Reference<awt::XControl>(xDlg)->dispose();
}