[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - basctl/source basic/source dbaccess/source extensions/source filter/source include/toolkit offapi/com offapi/type_reference offapi/UnoApi_offapi.mk scripting/source sdext/source toolkit/source xmlscript/test

Stephan Bergmann sbergman at redhat.com
Sat May 25 02:48:32 PDT 2013


 basctl/source/basicide/baside3.cxx                     |   50 +++
 basctl/source/basicide/basides3.cxx                    |   10 
 basctl/source/basicide/moduldlg.cxx                    |   35 +-
 basctl/source/basicide/scriptdocument.cxx              |   26 +
 basctl/source/dlged/dlged.cxx                          |  175 ++++++-------
 basctl/source/dlged/dlgedfac.cxx                       |   12 
 basic/source/classes/eventatt.cxx                      |   32 +-
 basic/source/runtime/methods1.cxx                      |    2 
 basic/source/uno/dlgcont.cxx                           |   14 -
 dbaccess/source/ext/macromigration/migrationengine.cxx |    3 
 extensions/source/update/check/updatehdl.cxx           |   44 +--
 filter/source/t602/t602filter.cxx                      |   63 +++-
 include/toolkit/controls/dialogcontrol.hxx             |  228 -----------------
 offapi/UnoApi_offapi.mk                                |    6 
 offapi/com/sun/star/awt/UnoControlDialog.idl           |   20 +
 offapi/com/sun/star/awt/UnoControlDialogModel.idl      |  122 ++++++++-
 offapi/com/sun/star/awt/XUnoControlDialog.idl          |   58 ----
 offapi/com/sun/star/awt/XUnoControlDialogModel.idl     |  166 ------------
 offapi/type_reference/offapi.rdb                       |binary
 scripting/source/dlgprov/DialogModelProvider.cxx       |    9 
 scripting/source/dlgprov/DialogModelProvider.hxx       |    7 
 scripting/source/dlgprov/dlgprov.cxx                   |  102 ++++---
 scripting/source/dlgprov/dlgprov.hxx                   |   32 +-
 sdext/source/minimizer/informationdialog.cxx           |   31 +-
 sdext/source/minimizer/optimizerdialog.cxx             |   35 +-
 sdext/source/minimizer/unodialog.cxx                   |   78 +++--
 sdext/source/minimizer/unodialog.hxx                   |   20 +
 toolkit/source/controls/dialogcontrol.cxx              |   54 ----
 xmlscript/test/imexp.cxx                               |   28 +-
 29 files changed, 647 insertions(+), 815 deletions(-)

New commits:
commit 1b6678993c905df231147d55e4fc9a9b15406812
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri May 24 22:44:30 2013 +0200

    Revert "fdo#46808, Convert awt::UnoControlDialogModel to new style"
    
    This reverts commit 6c61b20a8d4a6dcac28801cde82a211fb7e30654.  As discussed at
    <http://lists.freedesktop.org/archives/libreoffice/2013-May/052449.html> "Re:
    fdo#46808, Convert awt::UnoControlDialogModel to new style problem" why the odd
    change in 2e2a4827ce6708f0e8677dba9cc92e1479a44086 "scripting: get
    CreateUnoDialog() work again" appears to fix things again:
    
      The problem is that the implementation of the css.awt.UnoControlDialogModel
      involves UNO aggregation
      (IMPL_CREATE_INSTANCE_WITH_GEOMETRY(UnoControlDialogModel) in
      toolkit/soruce/helper/registerservices.cxx creating a
      OGeometryControlModel<UnoControlDialogModel> instance that aggregates a
      UnoControlDialogModel instance).  That means that queryInterface can return a
      reference to something that is technically a different object, and that's
      what's happening here, and explains why calling setPropertyValue in two
      different ways on what logically appears to be a single object can end up
      calling two different implementations (of two different physical objects).
      (UNO aggregation is known to be broken and should not be used.  Nevertheless,
      there's still code that does---code that is a horrible mess and hard to clean
      up.)
    
      That all this worked as intended in the past is just sheer luck, but any
      way of substantially touching it is asking for trouble.  I'm going to
      revert 6c61b20a8d4a6dcac28801cde82a211fb7e30654 again.
    
    I wasn't able to revert without also reverting
    be50ad28f5bbdaeff527f646481ce263843c2401 "fdo#46808, Convert
    awt::XUnoControlDialog to new style," as the two were tightly dependant.  Also
    reverts all the follow-up fixes cb4b6dde8fda2a5848e11063028bf44d72f85431
    "-Werror,-Wuninitialized" (sans the const-ness fix in
    UpdateHandler::insertControlModel), 697a007c61b9cabceb9767fad87cd5822b300452
    "Fix exception specifications," 2ce6828bbbf6ba181bb2276adeec279e74151ef6 "fix
    awt::UnoControlModelDialog crash," and 2e2a4827ce6708f0e8677dba9cc92e1479a44086
    "scripting: get CreateUnoDialog() work again."
    
    Conflicts:
    	basctl/source/dlged/dlged.cxx
    	filter/source/t602/t602filter.cxx
    	xmlscript/test/imexp.cxx
    
    Change-Id: I5d133468062f3ca36300db52fbd699be1ac72998
    (cherry picked from commit e36f83d81c462e1a5959b160886e481a8d449494)

diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index a6b8774..2643400 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -35,7 +35,6 @@
 #include "objdlg.hxx"
 
 #include <basic/basmgr.hxx>
-#include <com/sun/star/awt/UnoControlDialogModel.hpp>
 #include <com/sun/star/resource/StringResourceWithLocation.hpp>
 #include <com/sun/star/ucb/SimpleFileAccess.hpp>
 #include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
@@ -945,7 +944,8 @@ bool implImportDialog( Window* pWin, const OUString& rCurPath, const ScriptDocum
 {
     bool bDone = false;
 
-    Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
+    Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory() );
+    Reference< XComponentContext > xContext( comphelper::getComponentContext( xMSF ) );
     Reference < XFilePicker3 > xFP = FilePicker::createWithMode(xContext, TemplateDescription::FILEOPEN_SIMPLE);
 
     Reference< XFilePickerControlAccess > xFPControl(xFP, UNO_QUERY);
@@ -977,9 +977,10 @@ bool implImportDialog( Window* pWin, const OUString& rCurPath, const ScriptDocum
         try
         {
             // create dialog model
-            Reference< awt::XUnoControlDialogModel > xDialogModel = awt::UnoControlDialogModel::create( xContext );
+            Reference< container::XNameContainer > xDialogModel( xMSF->createInstance
+                ( "com.sun.star.awt.UnoControlDialogModel" ), UNO_QUERY_THROW );
 
-            Reference< XSimpleFileAccess3 > xSFI( SimpleFileAccess::create(xContext) );
+            Reference< XSimpleFileAccess3 > xSFI( SimpleFileAccess::create(comphelper::getProcessComponentContext()) );
 
             Reference< XInputStream > xInput;
             if( xSFI->exists( aCurPath ) )
@@ -987,7 +988,20 @@ bool implImportDialog( Window* pWin, const OUString& rCurPath, const ScriptDocum
 
             ::xmlscript::importDialogModel( xInput, xDialogModel, xContext, rDocument.isDocument() ? rDocument.getDocument() : Reference< frame::XModel >() );
 
-            OUString aXmlDlgName = xDialogModel->getName();
+            OUString aXmlDlgName;
+            Reference< beans::XPropertySet > xDialogModelPropSet( xDialogModel, UNO_QUERY );
+            if( xDialogModelPropSet.is() )
+            {
+                try
+                {
+                    Any aXmlDialogNameAny = xDialogModelPropSet->getPropertyValue( DLGED_PROP_NAME );
+                    OUString aOUXmlDialogName;
+                    aXmlDialogNameAny >>= aOUXmlDialogName;
+                    aXmlDlgName = aOUXmlDialogName;
+                }
+                catch(const beans::UnknownPropertyException& )
+                {}
+            }
             bool bValidName = !aXmlDlgName.isEmpty();
             OSL_ASSERT( bValidName );
             if( !bValidName )
@@ -1172,8 +1186,30 @@ bool implImportDialog( Window* pWin, const OUString& rCurPath, const ScriptDocum
 
             if( eNameClashMode == CLASH_RENAME_DIALOG )
             {
-                xDialogModel->setName( aNewDlgName );
-                LocalizationMgr::renameStringResourceIDs( rDocument, aLibName, aNewDlgName, xDialogModel );
+                bool bRenamed = false;
+                if( xDialogModelPropSet.is() )
+                {
+                    try
+                    {
+                        Any aXmlDialogNameAny;
+                        aXmlDialogNameAny <<= OUString( aNewDlgName );
+                        xDialogModelPropSet->setPropertyValue( DLGED_PROP_NAME, aXmlDialogNameAny );
+                        bRenamed = true;
+                    }
+                    catch(const beans::UnknownPropertyException& )
+                    {}
+                }
+
+
+                if( bRenamed )
+                {
+                    LocalizationMgr::renameStringResourceIDs( rDocument, aLibName, aNewDlgName, xDialogModel );
+                }
+                else
+                {
+                    // TODO: Assertion?
+                    return bDone;
+                }
             }
 
             Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext, rDocument.isDocument() ? rDocument.getDocument() : Reference< frame::XModel >() );
diff --git a/basctl/source/basicide/basides3.cxx b/basctl/source/basicide/basides3.cxx
index 271282e..8d0b70d 100644
--- a/basctl/source/basicide/basides3.cxx
+++ b/basctl/source/basicide/basides3.cxx
@@ -26,9 +26,8 @@
 #include <localizationmgr.hxx>
 #include <dlgedview.hxx>
 #include <comphelper/processfactory.hxx>
-#include <com/sun/star/awt/UnoControlDialogModel.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
 #include <com/sun/star/script/XLibraryContainer.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
 #include <xmlscript/xmldlg_imexp.hxx>
 #include <sfx2/dispatch.hxx>
 #include <sfx2/docfac.hxx>
@@ -76,9 +75,12 @@ DialogWindow* Shell::CreateDlgWin( const ScriptDocument& rDocument, const OUStri
             if ( xISP.is() )
             {
                 // create dialog model
-                Reference< uno::XComponentContext > xContext = getProcessComponentContext();
-                Reference< awt::XUnoControlDialogModel > xDialogModel = awt::UnoControlDialogModel::create( xContext );
+                Reference< lang::XMultiServiceFactory > xMSF = getProcessServiceFactory();
+                Reference< container::XNameContainer > xDialogModel( xMSF->createInstance
+                    ( "com.sun.star.awt.UnoControlDialogModel" ), UNO_QUERY );
                 Reference< XInputStream > xInput( xISP->createInputStream() );
+                Reference< XComponentContext > xContext(
+                    comphelper::getComponentContext( xMSF ) );
                 ::xmlscript::importDialogModel( xInput, xDialogModel, xContext, rDocument.isDocument() ? rDocument.getDocument() : Reference< frame::XModel >() );
                 LocalizationMgr::setStringResourceAtDialog( rDocument, rLibName, aDlgName, xDialogModel );
 
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index 84a25a9..49c58a3 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -28,7 +28,6 @@
 #include "iderdll.hxx"
 
 #include <basic/basmgr.hxx>
-#include <com/sun/star/awt/UnoControlDialogModel.hpp>
 #include <com/sun/star/script/XLibraryContainerPassword.hpp>
 #include <comphelper/processfactory.hxx>
 #include <sfx2/app.hxx>
@@ -285,25 +284,31 @@ void Shell::CopyDialogResources(
         return;
 
     // create dialog model
-    Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
-    Reference< awt::XUnoControlDialogModel > xDialogModel = awt::UnoControlDialogModel::create( xContext );
+    Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
+    Reference< container::XNameContainer > xDialogModel = Reference< container::XNameContainer >( xMSF->createInstance
+        ( "com.sun.star.awt.UnoControlDialogModel" ), UNO_QUERY );
     Reference< io::XInputStream > xInput( io_xISP->createInputStream() );
+    Reference< XComponentContext > xContext(
+        comphelper::getComponentContext( xMSF ) );
     ::xmlscript::importDialogModel( xInput, xDialogModel, xContext, rSourceDoc.isDocument() ? rSourceDoc.getDocument() : Reference< frame::XModel >() );
 
-    if( bSourceLocalized && bDestLocalized )
+    if( xDialogModel.is() )
     {
-        Reference< resource::XStringResourceResolver > xSourceStringResolver( xSourceMgr, UNO_QUERY );
-        LocalizationMgr::copyResourceForDroppedDialog( xDialogModel, rDlgName, xDestMgr, xSourceStringResolver );
-    }
-    else if( bSourceLocalized )
-    {
-        LocalizationMgr::resetResourceForDialog( xDialogModel, xSourceMgr );
-    }
-    else if( bDestLocalized )
-    {
-        LocalizationMgr::setResourceIDsForDialog( xDialogModel, xDestMgr );
+        if( bSourceLocalized && bDestLocalized )
+        {
+            Reference< resource::XStringResourceResolver > xSourceStringResolver( xSourceMgr, UNO_QUERY );
+            LocalizationMgr::copyResourceForDroppedDialog( xDialogModel, rDlgName, xDestMgr, xSourceStringResolver );
+        }
+        else if( bSourceLocalized )
+        {
+            LocalizationMgr::resetResourceForDialog( xDialogModel, xSourceMgr );
+        }
+        else if( bDestLocalized )
+        {
+            LocalizationMgr::setResourceIDsForDialog( xDialogModel, xDestMgr );
+        }
+        io_xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext, rDestDoc.isDocument() ? rDestDoc.getDocument() : Reference< frame::XModel >() );
     }
-    io_xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext, rDestDoc.isDocument() ? rDestDoc.getDocument() : Reference< frame::XModel >() );
 }
 
 
diff --git a/basctl/source/basicide/scriptdocument.cxx b/basctl/source/basicide/scriptdocument.cxx
index bccb4c4..3224c71 100644
--- a/basctl/source/basicide/scriptdocument.cxx
+++ b/basctl/source/basicide/scriptdocument.cxx
@@ -25,18 +25,17 @@
 #include "doceventnotifier.hxx"
 #include "documentenumeration.hxx"
 
-#include <com/sun/star/awt/XWindow2.hpp>
-#include <com/sun/star/awt/UnoControlDialogModel.hpp>
+#include <com/sun/star/uri/UriReferenceFactory.hpp>
+#include <com/sun/star/util/theMacroExpander.hpp>
 #include <com/sun/star/document/MacroExecMode.hpp>
-#include <com/sun/star/document/XEmbeddedScripts.hpp>
+#include <com/sun/star/frame/XStorable.hpp>
 #include <com/sun/star/frame/FrameSearchFlag.hpp>
 #include <com/sun/star/frame/XDesktop.hpp>
 #include <com/sun/star/frame/XModel2.hpp>
-#include <com/sun/star/frame/XStorable.hpp>
+#include <com/sun/star/awt/XWindow2.hpp>
+#include <com/sun/star/document/XEmbeddedScripts.hpp>
 #include <com/sun/star/script/vba/XVBACompatibility.hpp>
 #include <com/sun/star/script/vba/XVBAModuleInfo.hpp>
-#include <com/sun/star/uri/UriReferenceFactory.hpp>
-#include <com/sun/star/util/theMacroExpander.hpp>
 
 #include <sfx2/objsh.hxx>
 #include <sfx2/app.hxx>
@@ -630,7 +629,12 @@ namespace basctl
                 if ( _rxExistingDialogModel.is() )
                     xDialogModel = _rxExistingDialogModel;
                 else
-                    xDialogModel = css::awt::UnoControlDialogModel::create( aContext );
+                    xDialogModel.set(
+                        ( aContext->getServiceManager()->
+                          createInstanceWithContext(
+                              "com.sun.star.awt.UnoControlDialogModel",
+                              aContext ) ),
+                        UNO_QUERY_THROW );
 
                 // import dialog model
                 Reference< XInputStreamProvider > xISP( aElement, UNO_QUERY_THROW );
@@ -749,10 +753,14 @@ namespace basctl
             // create new dialog model
             Reference< XComponentContext > aContext(
                 comphelper::getProcessComponentContext() );
-            Reference< css::awt::XUnoControlDialogModel > xDialogModel = css::awt::UnoControlDialogModel::create( aContext );
+            Reference< XNameContainer > xDialogModel(
+                aContext->getServiceManager()->createInstanceWithContext(
+                    "com.sun.star.awt.UnoControlDialogModel", aContext ),
+                UNO_QUERY_THROW );
 
             // set name property
-            xDialogModel->setName( _rDialogName );
+            Reference< XPropertySet > xDlgPSet( xDialogModel, UNO_QUERY_THROW );
+            xDlgPSet->setPropertyValue( DLGED_PROP_NAME, makeAny( _rDialogName ) );
 
             // export dialog model
             _out_rDialogProvider = ::xmlscript::exportDialogModel( xDialogModel, aContext, isDocument() ? getDocument() : Reference< XModel >() );
diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx
index 8e55c02..54aef41 100644
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@ -33,8 +33,6 @@
 #include "baside3.hxx"
 
 #include <com/sun/star/awt/Toolkit.hpp>
-#include <com/sun/star/awt/UnoControlDialog.hpp>
-#include <com/sun/star/awt/UnoControlDialogModel.hpp>
 #include <com/sun/star/awt/XDialog.hpp>
 #include <com/sun/star/resource/StringResource.hpp>
 #include <com/sun/star/util/XCloneable.hpp>
@@ -93,7 +91,7 @@ void DlgEditor::ShowDialog()
     uno::Reference< uno::XComponentContext >  xContext = getProcessComponentContext();
 
     // create a dialog
-    uno::Reference< awt::XUnoControlDialog > xDlg = awt::UnoControlDialog::create( xContext );
+    uno::Reference< awt::XControl > xDlg( getProcessServiceFactory()->createInstance( "com.sun.star.awt.UnoControlDialog" ), uno::UNO_QUERY );
 
     // clone the dialog model
     uno::Reference< util::XCloneable > xC( m_xUnoControlDialogModel, uno::UNO_QUERY );
@@ -875,9 +873,9 @@ void DlgEditor::Paste()
             if ( xTransf->isDataFlavorSupported( m_ClipboardDataFlavors[0] ) )
             {
                 // create clipboard dialog model from xml
-                Reference< uno::XComponentContext > xContext = getProcessComponentContext();
-                Reference< awt::XUnoControlDialogModel > xClipDialogModel =
-                    awt::UnoControlDialogModel::create( xContext );
+                Reference< lang::XMultiServiceFactory > xMSF = getProcessServiceFactory();
+                Reference< container::XNameContainer > xClipDialogModel( xMSF->createInstance(
+                    "com.sun.star.awt.UnoControlDialogModel" ), uno::UNO_QUERY );
 
                 bool bSourceIsLocalized = false;
                 Sequence< sal_Int8 > DialogModelBytes;
@@ -917,93 +915,102 @@ void DlgEditor::Paste()
                     aAny >>= DialogModelBytes;
                 }
 
-                ::xmlscript::importDialogModel( ::xmlscript::createInputStream( rtl::ByteSequence(DialogModelBytes.getArray(), DialogModelBytes.getLength()) ) , xClipDialogModel, xContext, m_xDocument );
-
-                // get control models from clipboard dialog model
-                Sequence< OUString > aNames = xClipDialogModel->getElementNames();
-                const OUString* pNames = aNames.getConstArray();
-                sal_uInt32 nCtrls = aNames.getLength();
-
-                Reference< resource::XStringResourcePersistence > xStringResourcePersistence;
-                if( nCtrls > 0 && bSourceIsLocalized )
+                if ( xClipDialogModel.is() )
                 {
-                    xStringResourcePersistence = css::resource::StringResource::create( getProcessComponentContext() );
-                    xStringResourcePersistence->importBinary( aResData );
+                    Reference< XComponentContext > xContext(
+                        comphelper::getComponentContext( xMSF ) );
+                    ::xmlscript::importDialogModel( ::xmlscript::createInputStream( rtl::ByteSequence(DialogModelBytes.getArray(), DialogModelBytes.getLength()) ) , xClipDialogModel, xContext, m_xDocument );
                 }
-                for( sal_uInt32 n = 0; n < nCtrls; n++ )
+
+                // get control models from clipboard dialog model
+                Reference< ::com::sun::star::container::XNameAccess > xNameAcc( xClipDialogModel, UNO_QUERY );
+                if ( xNameAcc.is() )
                 {
-                    Any aA = xClipDialogModel->getByName( pNames[n] );
-                    Reference< ::com::sun::star::awt::XControlModel > xCM;
-                    aA >>= xCM;
-
-                    // clone the control model
-                    Reference< util::XCloneable > xClone( xCM, uno::UNO_QUERY );
-                    Reference< awt::XControlModel > xCtrlModel( xClone->createClone(), uno::UNO_QUERY );
-
-                    DlgEdObj* pCtrlObj = new DlgEdObj();
-                    pCtrlObj->SetDlgEdForm(pDlgEdForm);         // set parent form
-                    pDlgEdForm->AddChild(pCtrlObj);             // add child to parent form
-                    pCtrlObj->SetUnoControlModel( xCtrlModel ); // set control model
-
-                    // set new name
-                    OUString aOUniqueName( pCtrlObj->GetUniqueName() );
-                    Reference< beans::XPropertySet > xPSet( xCtrlModel , UNO_QUERY );
-                    Any aUniqueName;
-                    aUniqueName <<= aOUniqueName;
-                    xPSet->setPropertyValue( DLGED_PROP_NAME, aUniqueName );
-
-                    // set tabindex
-                    Reference< container::XNameAccess > xNA( m_xUnoControlDialogModel , UNO_QUERY );
-                       Sequence< OUString > aNames_ = xNA->getElementNames();
-                    Any aTabIndex;
-                    aTabIndex <<= (sal_Int16) aNames_.getLength();
-                    xPSet->setPropertyValue( DLGED_PROP_TABINDEX, aTabIndex );
-
-                    if( bLocalized )
+                       Sequence< OUString > aNames = xNameAcc->getElementNames();
+                       const OUString* pNames = aNames.getConstArray();
+                    sal_uInt32 nCtrls = aNames.getLength();
+
+                    Reference< resource::XStringResourcePersistence > xStringResourcePersistence;
+                    if( nCtrls > 0 && bSourceIsLocalized )
                     {
-                        Any aControlAny;
-                        aControlAny <<= xCtrlModel;
-                        if( bSourceIsLocalized && xStringResourcePersistence.is() )
-                        {
-                            Reference< resource::XStringResourceResolver >
-                                xSourceStringResolver( xStringResourcePersistence, UNO_QUERY );
-                            LocalizationMgr::copyResourcesForPastedEditorObject( this,
-                                aControlAny, aOUniqueName, xSourceStringResolver );
-                        }
-                        else
+                        xStringResourcePersistence = css::resource::StringResource::create( getProcessComponentContext() );
+                        xStringResourcePersistence->importBinary( aResData );
+                    }
+                    for( sal_uInt32 n = 0; n < nCtrls; n++ )
+                    {
+                           Any aA = xNameAcc->getByName( pNames[n] );
+                        Reference< ::com::sun::star::awt::XControlModel > xCM;
+                           aA >>= xCM;
+
+                        // clone the control model
+                        Reference< util::XCloneable > xClone( xCM, uno::UNO_QUERY );
+                        Reference< awt::XControlModel > xCtrlModel( xClone->createClone(), uno::UNO_QUERY );
+
+                        DlgEdObj* pCtrlObj = new DlgEdObj();
+                        pCtrlObj->SetDlgEdForm(pDlgEdForm);         // set parent form
+                        pDlgEdForm->AddChild(pCtrlObj);             // add child to parent form
+                        pCtrlObj->SetUnoControlModel( xCtrlModel ); // set control model
+
+                        // set new name
+                        OUString aOUniqueName( pCtrlObj->GetUniqueName() );
+                        Reference< beans::XPropertySet > xPSet( xCtrlModel , UNO_QUERY );
+                        Any aUniqueName;
+                        aUniqueName <<= aOUniqueName;
+                        xPSet->setPropertyValue( DLGED_PROP_NAME, aUniqueName );
+
+                        // set tabindex
+                        Reference< container::XNameAccess > xNA( m_xUnoControlDialogModel , UNO_QUERY );
+                           Sequence< OUString > aNames_ = xNA->getElementNames();
+                        Any aTabIndex;
+                        aTabIndex <<= (sal_Int16) aNames_.getLength();
+                        xPSet->setPropertyValue( DLGED_PROP_TABINDEX, aTabIndex );
+
+                        if( bLocalized )
                         {
-                            LocalizationMgr::setControlResourceIDsForNewEditorObject
-                                ( this, aControlAny, aOUniqueName );
+                            Any aControlAny;
+                            aControlAny <<= xCtrlModel;
+                            if( bSourceIsLocalized && xStringResourcePersistence.is() )
+                            {
+                                Reference< resource::XStringResourceResolver >
+                                    xSourceStringResolver( xStringResourcePersistence, UNO_QUERY );
+                                LocalizationMgr::copyResourcesForPastedEditorObject( this,
+                                    aControlAny, aOUniqueName, xSourceStringResolver );
+                            }
+                            else
+                            {
+                                LocalizationMgr::setControlResourceIDsForNewEditorObject
+                                    ( this, aControlAny, aOUniqueName );
+                            }
                         }
-                    }
 
-                    // insert control model in editor dialog model
-                    Any aCtrlModel;
-                    aCtrlModel <<= xCtrlModel;
-                    m_xUnoControlDialogModel->insertByName( aOUniqueName , aCtrlModel );
-
-                    // insert object into drawing page
-                    pDlgEdModel->GetPage(0)->InsertObject( pCtrlObj );
-                    pCtrlObj->SetRectFromProps();
-                    pCtrlObj->UpdateStep();
-                    pDlgEdForm->UpdateTabOrderAndGroups();
-                    pCtrlObj->StartListening();                         // start listening
-
-                    // mark object
-                    SdrPageView* pPgView = pDlgEdView->GetSdrPageView();
-                    pDlgEdView->MarkObj( pCtrlObj, pPgView, false, true);
-                }
+                        // insert control model in editor dialog model
+                        Any aCtrlModel;
+                        aCtrlModel <<= xCtrlModel;
+                        m_xUnoControlDialogModel->insertByName( aOUniqueName , aCtrlModel );
+
+                        // insert object into drawing page
+                        pDlgEdModel->GetPage(0)->InsertObject( pCtrlObj );
+                        pCtrlObj->SetRectFromProps();
+                        pCtrlObj->UpdateStep();
+                        pDlgEdForm->UpdateTabOrderAndGroups();
+                        pCtrlObj->StartListening();                         // start listening
+
+                        // mark object
+                        SdrPageView* pPgView = pDlgEdView->GetSdrPageView();
+                        pDlgEdView->MarkObj( pCtrlObj, pPgView, false, true);
+                    }
 
-                // center marked objects in dialog editor form
-                Point aMarkCenter = (pDlgEdView->GetMarkedObjRect()).Center();
-                Point aFormCenter = (pDlgEdForm->GetSnapRect()).Center();
-                Point aPoint = aFormCenter - aMarkCenter;
-                Size  aSize( aPoint.X() , aPoint.Y() );
-                pDlgEdView->MoveMarkedObj( aSize );                     // update of control model properties (position + size) in NbcMove
-                pDlgEdView->MarkListHasChanged();
+                    // center marked objects in dialog editor form
+                    Point aMarkCenter = (pDlgEdView->GetMarkedObjRect()).Center();
+                    Point aFormCenter = (pDlgEdForm->GetSnapRect()).Center();
+                    Point aPoint = aFormCenter - aMarkCenter;
+                    Size  aSize( aPoint.X() , aPoint.Y() );
+                    pDlgEdView->MoveMarkedObj( aSize );                     // update of control model properties (position + size) in NbcMove
+                    pDlgEdView->MarkListHasChanged();
 
-                // dialog model changed
-                SetDialogModelChanged(true);
+                    // dialog model changed
+                    SetDialogModelChanged(true);
+                }
             }
         }
     }
diff --git a/basctl/source/dlged/dlgedfac.cxx b/basctl/source/dlged/dlgedfac.cxx
index a092c8f..1ffbff2 100644
--- a/basctl/source/dlged/dlgedfac.cxx
+++ b/basctl/source/dlged/dlgedfac.cxx
@@ -24,8 +24,6 @@
 #include <com/sun/star/beans/PropertyValue.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/awt/ScrollBarOrientation.hpp>
-#include <com/sun/star/awt/UnoControlDialogModel.hpp>
-
 
 namespace basctl
 {
@@ -48,11 +46,17 @@ DlgEdFactory::~DlgEdFactory()
 IMPL_LINK( DlgEdFactory, MakeObject, SdrObjFactory *, pObjFactory )
 {
     static bool bNeedsInit = true;
-    static uno::Reference< awt::XUnoControlDialogModel > xDialogSFact;
+    static uno::Reference< lang::XMultiServiceFactory > xDialogSFact;
 
     if( bNeedsInit )
     {
-        xDialogSFact = awt::UnoControlDialogModel::create( ::comphelper::getProcessComponentContext() );
+        uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
+        uno::Reference< container::XNameContainer > xC( xMSF->createInstance( "com.sun.star.awt.UnoControlDialogModel" ), uno::UNO_QUERY );
+        if( xC.is() )
+        {
+            uno::Reference< lang::XMultiServiceFactory > xModFact( xC, uno::UNO_QUERY );
+            xDialogSFact = xModFact;
+        }
         bNeedsInit = false;
     }
 
diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx
index a54d2a9..f74bb95 100644
--- a/basic/source/classes/eventatt.cxx
+++ b/basic/source/classes/eventatt.cxx
@@ -22,7 +22,6 @@
 #include <comphelper/processfactory.hxx>
 #include <comphelper/string.hxx>
 
-#include <com/sun/star/awt/UnoControlDialogModel.hpp>
 #include <com/sun/star/awt/XControlContainer.hpp>
 #include <com/sun/star/awt/XControlModel.hpp>
 #include <com/sun/star/awt/XControl.hpp>
@@ -424,7 +423,7 @@ void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrit
     (void)pBasic;
     (void)bWrite;
 
-    Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
+    Reference< XMultiServiceFactory > xMSF( comphelper::getProcessServiceFactory() );
 
     // We need at least 1 parameter
     if ( rPar.Count() < 2 )
@@ -451,22 +450,43 @@ void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrit
     }
 
     // Create new uno dialog
-    Reference< XUnoControlDialogModel > xDialogModel = UnoControlDialogModel::create( xContext );
+    Reference< XNameContainer > xDialogModel( xMSF->createInstance(
+                      OUString("com.sun.star.awt.UnoControlDialogModel")), UNO_QUERY );
+    if( !xDialogModel.is() )
+    {
+        return;
+    }
     Reference< XInputStreamProvider > xISP;
     aAnyISP >>= xISP;
     if( !xISP.is() )
     {
         return;
     }
+    Reference< XComponentContext > xContext( comphelper::getComponentContext( xMSF ) );
 
     // Import the DialogModel
     Reference< XInputStream > xInput( xISP->createInputStream() );
 
     // i83963 Force decoration
-    if( !xDialogModel->getDecoration() )
+    uno::Reference< beans::XPropertySet > xDlgModPropSet( xDialogModel, uno::UNO_QUERY );
+    if( xDlgModPropSet.is() )
     {
-        xDialogModel->setDecoration( true );
-        xDialogModel->setTitle( OUString() );
+        bool bDecoration = true;
+        try
+        {
+            OUString aDecorationPropName("Decoration");
+            Any aDecorationAny = xDlgModPropSet->getPropertyValue( aDecorationPropName );
+            aDecorationAny >>= bDecoration;
+            if( !bDecoration )
+            {
+                xDlgModPropSet->setPropertyValue( aDecorationPropName, makeAny( true ) );
+
+                OUString aTitlePropName("Title");
+                xDlgModPropSet->setPropertyValue( aTitlePropName, makeAny( OUString() ) );
+            }
+        }
+        catch(const UnknownPropertyException& )
+        {}
     }
 
     Any aDlgLibAny;
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index 7b7ea19..5847754 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -1607,7 +1607,7 @@ RTLFUNC(EqualUnoObjects)
     RTL_Impl_EqualUnoObjects( pBasic, rPar, bWrite );
 }
 
-// Instantiate "com.sun.star.awt.UnoControlDialog" on basis
+// Instanciate "com.sun.star.awt.UnoControlDialog" on basis
 // of a DialogLibrary entry: Convert from XML-ByteSequence
 // and attach events. Implemented in classes\eventatt.cxx
 void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite );
diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx
index 6ba2ff1..a9b28ce 100644
--- a/basic/source/uno/dlgcont.cxx
+++ b/basic/source/uno/dlgcont.cxx
@@ -17,7 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <com/sun/star/awt/UnoControlDialogModel.hpp>
 #include <com/sun/star/container/XNameContainer.hpp>
 #include <com/sun/star/xml/sax/Parser.hpp>
 #include <com/sun/star/xml/sax/InputSource.hpp>
@@ -237,7 +236,9 @@ void SfxDialogLibraryContainer::storeLibrariesToStorage( const uno::Reference< e
                 if ( xISP.is() )
                 {
                     Reference< io::XInputStream > xInput( xISP->createInputStream() );
-                    Reference< awt::XUnoControlDialogModel > xDialogModel = awt::UnoControlDialogModel::create( mxContext );
+                    Reference< XNameContainer > xDialogModel(
+                        mxContext->getServiceManager()->createInstanceWithContext("com.sun.star.awt.UnoControlDialogModel", mxContext),
+                        UNO_QUERY );
                     ::xmlscript::importDialogModel( xInput, xDialogModel, mxContext, mxOwnerDocument );
                     std::vector< OUString > vEmbeddedImageURLs;
                     GraphicObject::InspectForGraphicObjectImageURL( Reference< XInterface >( xDialogModel, UNO_QUERY ),  vEmbeddedImageURLs );
@@ -279,7 +280,14 @@ Any SAL_CALL SfxDialogLibraryContainer::importLibraryElement
 
     Reference< XParser > xParser = xml::sax::Parser::create( mxContext );
 
-    Reference< awt::XUnoControlDialogModel > xDialogModel = awt::UnoControlDialogModel::create( mxContext );
+    Reference< XNameContainer > xDialogModel(
+        mxContext->getServiceManager()->createInstanceWithContext("com.sun.star.awt.UnoControlDialogModel", mxContext),
+        UNO_QUERY );
+    if( !xDialogModel.is() )
+    {
+        OSL_FAIL( "### couldn't create com.sun.star.awt.UnoControlDialogModel component\n" );
+        return aRetAny;
+    }
 
     // Read from storage?
     sal_Bool bStorage = xElementStream.is();
diff --git a/dbaccess/source/ext/macromigration/migrationengine.cxx b/dbaccess/source/ext/macromigration/migrationengine.cxx
index 7c5a37d..bd75b8a 100644
--- a/dbaccess/source/ext/macromigration/migrationengine.cxx
+++ b/dbaccess/source/ext/macromigration/migrationengine.cxx
@@ -29,7 +29,6 @@
 #include "progresscapture.hxx"
 #include "progressmixer.hxx"
 
-#include <com/sun/star/awt/UnoControlDialogModel.hpp>
 #include <com/sun/star/sdb/XFormDocumentsSupplier.hpp>
 #include <com/sun/star/sdb/XReportDocumentsSupplier.hpp>
 #include <com/sun/star/util/XCloseable.hpp>
@@ -1822,7 +1821,7 @@ namespace dbmm
             Reference< XInputStreamProvider > xISP( _inout_rDialogLibraryElement, UNO_QUERY_THROW );
             Reference< XInputStream > xInput( xISP->createInputStream(), UNO_QUERY_THROW );
 
-            Reference< css::awt::XUnoControlDialogModel > xDialogModel = css::awt::UnoControlDialogModel::create( m_aContext );
+            Reference< XNameContainer > xDialogModel( m_aContext->getServiceManager()->createInstanceWithContext("com.sun.star.awt.UnoControlDialogModel", m_aContext), UNO_QUERY_THROW );
             ::xmlscript::importDialogModel( xInput, xDialogModel, m_aContext, m_xDocumentModel );
 
             // adjust the events of the dialog
diff --git a/extensions/source/update/check/updatehdl.cxx b/extensions/source/update/check/updatehdl.cxx
index 6c96e6e..96a74aa 100644
--- a/extensions/source/update/check/updatehdl.cxx
+++ b/extensions/source/update/check/updatehdl.cxx
@@ -33,8 +33,6 @@
 
 #include "com/sun/star/awt/ActionEvent.hpp"
 #include "com/sun/star/awt/PushButtonType.hpp"
-#include "com/sun/star/awt/UnoControlDialog.hpp"
-#include "com/sun/star/awt/UnoControlDialogModel.hpp"
 #include "com/sun/star/awt/VclWindowPeerAttribute.hpp"
 #include "com/sun/star/awt/WindowAttribute.hpp"
 #include "com/sun/star/awt/XButton.hpp"
@@ -1093,22 +1091,26 @@ void UpdateHandler::createDialog()
 
     loadStrings();
 
-    uno::Reference< awt::XUnoControlDialogModel > xControlModel = awt::UnoControlDialogModel::create( mxContext );
+    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 );
     {
         // @see awt/UnoControlDialogModel.idl
-        xControlModel->setTitle( msDlgTitle);
-        xControlModel->setCloseable( true );
-        xControlModel->setEnabled( true );
-        xControlModel->setMoveable( true );
-        xControlModel->setSizeable( true );
-        xControlModel->setDesktopAsParent( true );
-        xControlModel->setPositionX( 100 );
-        xControlModel->setPositionY( 100 );
-        xControlModel->setWidth( DIALOG_WIDTH );
-        xControlModel->setHeight( DIALOG_HEIGHT );
-        xControlModel->setHelpURL( INET_HID_SCHEME + OUString::createFromAscii( HID_CHECK_FOR_UPD_DLG ) );
+        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 ) ) );
     }
-
     {   // Label (fixed text) <status>
         uno::Sequence< beans::NamedValue > aProps(1);
 
@@ -1320,19 +1322,25 @@ void UpdateHandler::createDialog()
                             aProps);
     }
 
-    uno::Reference< awt::XUnoControlDialog > xControl = awt::UnoControlDialog::create( mxContext );
+    uno::Reference< awt::XControl > xControl(
+        xFactory->createInstanceWithContext( "com.sun.star.awt.UnoControlDialog", mxContext),
+        uno::UNO_QUERY_THROW );
     xControl->setModel( xControlModel );
 
     if ( mbVisible == false )
     {
-        xControl->setVisible( false );
+        uno::Reference< awt::XWindow > xWindow( xControl, uno::UNO_QUERY );
+
+        if ( xWindow.is() )
+            xWindow->setVisible( false );
     }
 
     xControl->createPeer( NULL, NULL );
     {
+        uno::Reference< awt::XControlContainer > xContainer (xControl, uno::UNO_QUERY);
         for ( int i = 0; i < HELP_BUTTON; i++ )
         {
-            uno::Reference< awt::XButton > xButton ( xControl->getControl( msButtonIDs[i] ), uno::UNO_QUERY);
+            uno::Reference< awt::XButton > xButton ( xContainer->getControl( msButtonIDs[i] ), uno::UNO_QUERY);
             if (xButton.is())
             {
                 xButton->setActionCommand( msButtonIDs[i] );
diff --git a/filter/source/t602/t602filter.cxx b/filter/source/t602/t602filter.cxx
index 0d3c948..4ef5b6d 100644
--- a/filter/source/t602/t602filter.cxx
+++ b/filter/source/t602/t602filter.cxx
@@ -26,13 +26,11 @@
 #include <cppuhelper/factory.hxx>
 #include <cppuhelper/bootstrap.hxx>
 #include <com/sun/star/awt/Toolkit.hpp>
-#include <com/sun/star/awt/UnoControlDialogModel.hpp>
 #include <com/sun/star/bridge/XUnoUrlResolver.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/ucb/XSimpleFileAccess.hpp>
 #include <com/sun/star/text/XTextDocument.hpp>
 #include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/awt/UnoControlDialog.hpp>
 #include <com/sun/star/awt/XControl.hpp>
 #include <com/sun/star/awt/XDialog.hpp>
 #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
@@ -940,19 +938,27 @@ sal_Bool T602ImportFilterDialog::OptionsDlg()
     _prop->setPropertyValue(OUString::createFromAscii(_nam), any);
 #define _propGet(_prop,_nam) \
     _prop->getPropertyValue(OUString::createFromAscii(_nam));
+#define _InstCtx(_path,_ctx)\
+    rServiceManager->createInstanceWithContext(\
+    OUString::createFromAscii(_path),_ctx);
+#define _Inst(_path)\
+    xMultiServiceFactory->createInstance(OUString::createFromAscii(_path) );
 #define _Insert(_cont,_nam,_obj) \
     any <<= _obj;\
     _cont->insertByName( OUString::createFromAscii(_nam), any );
 
     Reference < XComponentContext > rComponentContext = defaultBootstrap_InitialComponentContext();
     Reference < XMultiComponentFactory > rServiceManager = rComponentContext->getServiceManager();
-    Reference < XUnoControlDialogModel > rInstance = UnoControlDialogModel::create(rComponentContext );
+    Reference < XInterface > rInstance = _InstCtx("com.sun.star.awt.UnoControlDialogModel", rComponentContext );
 
-    rInstance->setPositionX(100);
-    rInstance->setPositionY(100);
-    rInstance->setWidth(130);
-    rInstance->setHeight(90);
-    rInstance->setTitle(getResStr(T602FILTER_STR_IMPORT_DIALOG_TITLE));
+    Reference <XMultiServiceFactory> xMultiServiceFactory (rInstance,UNO_QUERY);
+
+    Reference < XPropertySet > xPSetDialog( rInstance, UNO_QUERY );
+    _propInt(xPSetDialog,"PositionX",100);
+    _propInt(xPSetDialog,"PositionY",100);
+    _propInt(xPSetDialog,"Width",130);
+    _propInt(xPSetDialog,"Height",90);
+    _propStringFromResId(xPSetDialog,"Title", T602FILTER_STR_IMPORT_DIALOG_TITLE);
 
 #define T602DLG_OK_BUTTON    "ok_button"
 #define T602DLG_CANCEL_BUTTON    "cancel_button"
@@ -962,7 +968,7 @@ sal_Bool T602ImportFilterDialog::OptionsDlg()
 #define T602DLG_REFORMAT_CB    "reformat_cb"
 #define T602DLG_CODE_TXT    "code_txt"
 
-    Reference < XInterface > TextModel = rInstance->createInstance("com.sun.star.awt.UnoControlFixedTextModel");
+    Reference < XInterface > TextModel = _Inst("com.sun.star.awt.UnoControlFixedTextModel");
     Reference < XPropertySet > xPSetText( TextModel, UNO_QUERY );
     _propInt(xPSetText,"PositionX",10);
     _propInt(xPSetText,"PositionY",8);
@@ -971,7 +977,7 @@ sal_Bool T602ImportFilterDialog::OptionsDlg()
     _propString(xPSetText,"Name",T602DLG_CODE_TXT);
     _propStringFromResId(xPSetText,"Label",T602FILTER_STR_ENCODING_LABEL);
 
-    Reference < XInterface > ListBoxModel = rInstance->createInstance("com.sun.star.awt.UnoControlListBoxModel");
+    Reference < XInterface > ListBoxModel = _Inst("com.sun.star.awt.UnoControlListBoxModel");
     Reference < XPropertySet > xPSetCodeLB( ListBoxModel, UNO_QUERY );
     _propInt(xPSetCodeLB,"PositionX",40);
     _propInt(xPSetCodeLB,"PositionY",5);
@@ -995,7 +1001,7 @@ sal_Bool T602ImportFilterDialog::OptionsDlg()
     any <<= shr;
     xPSetCodeLB->setPropertyValue(OUString(  "SelectedItems" ), any);
 
-    Reference < XInterface > AzbCheckBoxModel = rInstance->createInstance("com.sun.star.awt.UnoControlCheckBoxModel");
+    Reference < XInterface > AzbCheckBoxModel = _Inst("com.sun.star.awt.UnoControlCheckBoxModel");
     Reference < XPropertySet > xPSetAzbukaCB( AzbCheckBoxModel, UNO_QUERY );
     _propInt(xPSetAzbukaCB,"PositionX",10);
     _propInt(xPSetAzbukaCB,"PositionY",25);
@@ -1006,7 +1012,7 @@ sal_Bool T602ImportFilterDialog::OptionsDlg()
     _propStringFromResId(xPSetAzbukaCB,"Label",T602FILTER_STR_CYRILLIC_MODE);
     _propShort(xPSetAzbukaCB,"State",ini.ruscode);
 
-    Reference < XInterface > RefCheckBoxModel = rInstance->createInstance("com.sun.star.awt.UnoControlCheckBoxModel");
+    Reference < XInterface > RefCheckBoxModel = _Inst("com.sun.star.awt.UnoControlCheckBoxModel");
     Reference < XPropertySet > xPSetRefCB( RefCheckBoxModel, UNO_QUERY );
     _propInt(xPSetRefCB,"PositionX",10);
     _propInt(xPSetRefCB,"PositionY",40);
@@ -1017,7 +1023,7 @@ sal_Bool T602ImportFilterDialog::OptionsDlg()
     _propStringFromResId(xPSetRefCB,"Label",T602FILTER_STR_REFORMAT_TEXT);
     _propShort(xPSetRefCB,"State",ini.reformatpars);
 
-    Reference < XInterface > CommCheckBoxModel = rInstance->createInstance("com.sun.star.awt.UnoControlCheckBoxModel");
+    Reference < XInterface > CommCheckBoxModel = _Inst("com.sun.star.awt.UnoControlCheckBoxModel");
     Reference < XPropertySet > xPSetCommCB( CommCheckBoxModel, UNO_QUERY );
     _propInt(xPSetCommCB,"PositionX",10);
     _propInt(xPSetCommCB,"PositionY",55);
@@ -1028,7 +1034,7 @@ sal_Bool T602ImportFilterDialog::OptionsDlg()
     _propStringFromResId(xPSetCommCB,"Label",T602FILTER_STR_DOT_COMMANDS);
     _propShort(xPSetCommCB,"State",ini.showcomm);
 
-    Reference < XInterface > CancelButtonModel = rInstance->createInstance("com.sun.star.awt.UnoControlButtonModel");
+    Reference < XInterface > CancelButtonModel = _Inst("com.sun.star.awt.UnoControlButtonModel");
     Reference < XPropertySet > xPSetCancelButton( CancelButtonModel, UNO_QUERY );
     _propInt(xPSetCancelButton,"PositionX",10);
     _propInt(xPSetCancelButton,"PositionY",70);
@@ -1039,7 +1045,7 @@ sal_Bool T602ImportFilterDialog::OptionsDlg()
     _propShort(xPSetCancelButton,"PushButtonType",2);
     _propStringFromResId(xPSetCancelButton,"Label",T602FILTER_STR_CANCEL_BUTTON);
 
-    Reference < XInterface > OkButtonModel = rInstance->createInstance("com.sun.star.awt.UnoControlButtonModel");
+    Reference < XInterface > OkButtonModel = _Inst("com.sun.star.awt.UnoControlButtonModel");
     Reference < XPropertySet > xPSetOkButton( OkButtonModel, UNO_QUERY );
     _propInt(xPSetOkButton,"PositionX",70);
     _propInt(xPSetOkButton,"PositionY",70);
@@ -1061,18 +1067,31 @@ sal_Bool T602ImportFilterDialog::OptionsDlg()
     _Insert(xNameCont, T602DLG_CODE_LB, ListBoxModel);
     _Insert(xNameCont, T602DLG_CODE_TXT, TextModel);
 
-    Reference< XUnoControlDialog > dialog = UnoControlDialog::create(rComponentContext);
+    Reference< XInterface > dialog = _InstCtx("com.sun.star.awt.UnoControlDialog",rComponentContext);
 
+    Reference < XControl > xControl (dialog,UNO_QUERY);
     Reference < XControlModel > xControlModel (rInstance,UNO_QUERY);
 
-    dialog->setModel( xControlModel );
+    if(!xControl.is())
+        return sal_False;
+
+    xControl->setModel( xControlModel );
 
     Reference < XToolkit > xToolkit = Toolkit::create( rComponentContext );
+    Reference < XWindow > xWindow (xControl,UNO_QUERY);
+
+    if(!xWindow.is())
+        return sal_False;
 
-    dialog->setVisible( false );
-    dialog->createPeer( xToolkit, NULL );
+    xWindow->setVisible( false );
+    xControl->createPeer( xToolkit, NULL );
 
-    ret = ( dialog->execute() != 0 );
+    Reference < XDialog > xDialog (dialog,UNO_QUERY);
+
+    if(!xDialog.is())
+        return sal_False;
+
+    ret = ( xDialog->execute() != 0 );
     if ( ret ) {
 
         sal_Int16 tt = 0;
@@ -1091,7 +1110,9 @@ sal_Bool T602ImportFilterDialog::OptionsDlg()
         }
     }
 
-    Reference<XControl>(dialog)->dispose();
+    Reference < XComponent > xComponent (dialog,UNO_QUERY);
+
+    xComponent->dispose();
 
     return ret;
 }
diff --git a/include/toolkit/controls/dialogcontrol.hxx b/include/toolkit/controls/dialogcontrol.hxx
index a749c24..e8b9564 100644
--- a/include/toolkit/controls/dialogcontrol.hxx
+++ b/include/toolkit/controls/dialogcontrol.hxx
@@ -21,8 +21,6 @@
 #define TOOLKIT_DIALOG_CONTROL_HXX
 
 #include <toolkit/controls/controlmodelcontainerbase.hxx>
-#include <com/sun/star/awt/XUnoControlDialog.hpp>
-#include <com/sun/star/awt/XUnoControlDialogModel.hpp>
 #include <com/sun/star/awt/XTopWindow.hpp>
 #include <com/sun/star/awt/XDialog2.hpp>
 #include <com/sun/star/awt/XSimpleTabController.hpp>
@@ -32,8 +30,6 @@
 #include "toolkit/helper/macros.hxx"
 #include <toolkit/controls/unocontrolcontainer.hxx>
 #include <cppuhelper/basemutex.hxx>
-#include <cppuhelper/implbase1.hxx>
-#include <cppuhelper/implbase2.hxx>
 #include <cppuhelper/implbase3.hxx>
 #include <list>
 
@@ -41,10 +37,7 @@
 //  class UnoControlDialogModel
 //  ----------------------------------------------------
 
-typedef ::cppu::AggImplInheritanceHelper1   <   ControlModelContainerBase
-                                            ,   ::com::sun::star::awt::XUnoControlDialogModel
-                                            >   UnoControlDialogModel_Base;
-class UnoControlDialogModel :   public UnoControlDialogModel_Base
+class UnoControlDialogModel :   public ControlModelContainerBase
 {
 protected:
     ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicObject > mxGrfObj;
@@ -52,19 +45,6 @@ protected:
     ::cppu::IPropertyArrayHelper&       SAL_CALL getInfoHelper();
     // ::cppu::OPropertySetHelper
 	void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception);
-
-    OUString getPropertyString(const OUString& p1) throw(::com::sun::star::uno::RuntimeException);
-    sal_Bool getPropertyBool(const OUString& p1) throw(::com::sun::star::uno::RuntimeException);
-    sal_Int16 getPropertyInt16(const OUString& p1) throw(::com::sun::star::uno::RuntimeException);
-    sal_Int32 getPropertyInt32(const OUString& p1) throw(::com::sun::star::uno::RuntimeException);
-    void setPropertyString(const OUString& p1, const OUString& p2) throw(::com::sun::star::uno::RuntimeException)
-        { setPropertyValue( p1, css::uno::Any(p2) ); }
-    void setPropertyBool(const OUString& p1, sal_Bool p2) throw(::com::sun::star::uno::RuntimeException)
-        { setPropertyValue( p1, css::uno::Any(p2) ); }
-    void setPropertyInt16(const OUString& p1, sal_Int16 p2) throw(::com::sun::star::uno::RuntimeException)
-        { setPropertyValue( p1, css::uno::Any(p2) ); }
-    void setPropertyInt32(const OUString& p1, sal_Int32 p2) throw(::com::sun::star::uno::RuntimeException)
-        { setPropertyValue( p1, css::uno::Any(p2) ); }
 public:
                         UnoControlDialogModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
                         UnoControlDialogModel( const UnoControlDialogModel& rModel );
@@ -80,144 +60,11 @@ public:
     // XServiceInfo
     DECLIMPL_SERVICEINFO_DERIVED( UnoControlDialogModel, ControlModelContainerBase, szServiceName2_UnoControlDialogModel )
 
-
-    // XUnoControlDialogModel attributes
-    virtual rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException)
-       { return getPropertyString("Name"); }
-    virtual void SAL_CALL setName(const rtl::OUString& p1) throw(::com::sun::star::uno::RuntimeException)
-       { setPropertyString("Name", p1); }
-    virtual sal_Bool SAL_CALL getDecoration() throw(::com::sun::star::uno::RuntimeException)
-       { return getPropertyBool("Decoration"); }
-    virtual void SAL_CALL setDecoration(sal_Bool p1) throw(::com::sun::star::uno::RuntimeException)
-       { setPropertyBool("Decoration", p1); }
-    virtual sal_Int32 SAL_CALL getPositionX() throw(::com::sun::star::uno::RuntimeException)
-       { return getPropertyInt32("PositionX"); }
-    virtual void SAL_CALL setPositionX(sal_Int32 p1) throw(::com::sun::star::uno::RuntimeException)
-       { setPropertyInt32("PositionX", p1); }
-    virtual sal_Int32 SAL_CALL getPositionY() throw(::com::sun::star::uno::RuntimeException)
-       { return getPropertyInt32("PositionY"); }
-    virtual void SAL_CALL setPositionY(sal_Int32 p1) throw(::com::sun::star::uno::RuntimeException)
-       { setPropertyInt32("PositionY", p1); }
-    virtual sal_Int32 SAL_CALL getWidth() throw(::com::sun::star::uno::RuntimeException)
-       { return getPropertyInt32("Width"); }
-    virtual void SAL_CALL setWidth(sal_Int32 p1) throw(::com::sun::star::uno::RuntimeException)
-       { setPropertyInt32("Width", p1); }
-    virtual sal_Int32 SAL_CALL getHeight() throw(::com::sun::star::uno::RuntimeException)
-       { return getPropertyInt32("Height"); }
-    virtual void SAL_CALL setHeight(sal_Int32 p1) throw(::com::sun::star::uno::RuntimeException)
-       { setPropertyInt32("Height", p1); }
-    virtual rtl::OUString SAL_CALL getDialogSourceURL() throw(::com::sun::star::uno::RuntimeException)
-       { return getPropertyString("DialogSourceURL"); }
-    virtual void SAL_CALL setDialogSourceURL(const rtl::OUString& p1) throw(::com::sun::star::uno::RuntimeException)
-       { setPropertyString("DialogSourceURL", p1); }
-    virtual rtl::OUString SAL_CALL getTitle() throw(::com::sun::star::uno::RuntimeException)
-       { return getPropertyString("Title"); }
-    virtual void SAL_CALL setTitle(const rtl::OUString& p1) throw(::com::sun::star::uno::RuntimeException)
-       { setPropertyString("Title", p1); }
-    virtual sal_Bool SAL_CALL getCloseable() throw(::com::sun::star::uno::RuntimeException)
-       { return getPropertyBool("Closeable"); }
-    virtual void SAL_CALL setCloseable(sal_Bool p1) throw(::com::sun::star::uno::RuntimeException)
-       { setPropertyBool("Closeable", p1); }
-    virtual sal_Bool SAL_CALL getEnabled() throw(::com::sun::star::uno::RuntimeException)
-       { return getPropertyBool("Enabled"); }
-    virtual void SAL_CALL setEnabled(sal_Bool p1) throw(::com::sun::star::uno::RuntimeException)
-       { setPropertyBool("Enabled", p1); }
-    virtual sal_Bool SAL_CALL getMoveable() throw(::com::sun::star::uno::RuntimeException)
-       { return getPropertyBool("Moveable"); }
-    virtual void SAL_CALL setMoveable(sal_Bool p1) throw(::com::sun::star::uno::RuntimeException)
-       { setPropertyBool("Moveable", p1); }
-    virtual sal_Bool SAL_CALL getSizeable() throw(::com::sun::star::uno::RuntimeException)
-       { return getPropertyBool("Sizeable"); }
-    virtual void SAL_CALL setSizeable(sal_Bool p1) throw(::com::sun::star::uno::RuntimeException)
-       { setPropertyBool("Sizeable", p1); }
-    virtual sal_Bool SAL_CALL getDesktopAsParent() throw(::com::sun::star::uno::RuntimeException)
-       { return getPropertyBool("DesktopAsParent"); }
-    virtual void SAL_CALL setDesktopAsParent(sal_Bool p1) throw(::com::sun::star::uno::RuntimeException)
-       { setPropertyBool("DesktopAsParent", p1); }
-    virtual rtl::OUString SAL_CALL getHelpURL() throw(::com::sun::star::uno::RuntimeException)
-       { return getPropertyString("HelpURL"); }
-    virtual void SAL_CALL setHelpURL(const rtl::OUString& p1) throw(::com::sun::star::uno::RuntimeException)
-       { setPropertyString("HelpURL", p1); }
-    virtual sal_Int32 SAL_CALL getBackgroundColor() throw(::com::sun::star::uno::RuntimeException)
-       { return getPropertyInt32("BackgroundColor"); }
-    virtual void SAL_CALL setBackgroundColor(sal_Int32 p1) throw(::com::sun::star::uno::RuntimeException)
-       { setPropertyInt32("BackgroundColor", p1); }
-    virtual sal_Int16 SAL_CALL getFontEmphasisMark() throw(::com::sun::star::uno::RuntimeException)
-       { return getPropertyInt16("FontEmphasisMark"); }
-    virtual void SAL_CALL setFontEmphasisMark(sal_Int16 p1) throw(::com::sun::star::uno::RuntimeException)
-       { setPropertyInt16("FontEmphasisMark", p1); }
-    virtual sal_Int16 SAL_CALL getFontRelief() throw(::com::sun::star::uno::RuntimeException)
-       { return getPropertyInt16("FontRelief"); }
-    virtual void SAL_CALL setFontRelief(sal_Int16 p1) throw(::com::sun::star::uno::RuntimeException)
-       { setPropertyInt16("FontRelief", p1); }
-    virtual rtl::OUString SAL_CALL getHelpText() throw(::com::sun::star::uno::RuntimeException)
-       { return getPropertyString("HelpText"); }
-    virtual void SAL_CALL setHelpText(const rtl::OUString& p1) throw(::com::sun::star::uno::RuntimeException)
-       { setPropertyString("HelpText", p1); }
-    virtual sal_Int32 SAL_CALL getTextColor() throw(::com::sun::star::uno::RuntimeException)
-       { return getPropertyInt32("TextColor"); }
-    virtual void SAL_CALL setTextColor(sal_Int32 p1) throw(::com::sun::star::uno::RuntimeException)
-       { setPropertyInt32("TextColor", p1); }
-    virtual sal_Int32 SAL_CALL getTextLineColor() throw(::com::sun::star::uno::RuntimeException)
-       { return getPropertyInt32("TextLineColor"); }
-    virtual void SAL_CALL setTextLineColor(sal_Int32 p1) throw(::com::sun::star::uno::RuntimeException)
-       { setPropertyInt32("TextLineColor", p1); }
-    virtual rtl::OUString SAL_CALL getImageURL() throw(::com::sun::star::uno::RuntimeException)
-       { return getPropertyString("ImageURL"); }
-    virtual void SAL_CALL setImageURL(const rtl::OUString& p1) throw(::com::sun::star::uno::RuntimeException)
-       { setPropertyString("ImageURL", p1); }
-    virtual com::sun::star::awt::FontDescriptor SAL_CALL getFontDescriptor() throw(::com::sun::star::uno::RuntimeException);
-    virtual void SAL_CALL setFontDescriptor(const com::sun::star::awt::FontDescriptor& p1) throw(::com::sun::star::uno::RuntimeException)
-        { setPropertyValue( "FontDescriptor", css::uno::Any(p1) ); }
-    virtual com::sun::star::uno::Reference<com::sun::star::graphic::XGraphic> SAL_CALL getGraphic() throw(::com::sun::star::uno::RuntimeException);
-    virtual void SAL_CALL setGraphic(const com::sun::star::uno::Reference<com::sun::star::graphic::XGraphic>& p1) throw(::com::sun::star::uno::RuntimeException)
-        { setPropertyValue( "Graphic", css::uno::Any(p1) ); }
-
-
-    // overrides to resolve ambiguity
-    virtual com::sun::star::uno::Any SAL_CALL getPropertyValue(const rtl::OUString& p1) throw (com::sun::star::beans::UnknownPropertyException, com::sun::star::lang::WrappedTargetException, com::sun::star::uno::RuntimeException)
-        { return UnoControlDialogModel_Base::ControlModelContainerBase::getPropertyValue(p1); }
-    virtual void SAL_CALL setPropertyValue(const OUString& p1, const com::sun::star::uno::Any& p2) throw (com::sun::star::beans::UnknownPropertyException, com::sun::star::beans::PropertyVetoException, com::sun::star::lang::IllegalArgumentException, com::sun::star::lang::WrappedTargetException, com::sun::star::uno::RuntimeException)
-        { return UnoControlDialogModel_Base::ControlModelContainerBase::setPropertyValue(p1, p2); }
-    virtual void SAL_CALL addPropertyChangeListener(const OUString& p1, const com::sun::star::uno::Reference<com::sun::star::beans::XPropertyChangeListener>& p2) throw (com::sun::star::beans::UnknownPropertyException, com::sun::star::lang::WrappedTargetException, com::sun::star::uno::RuntimeException)
-        { return UnoControlDialogModel_Base::ControlModelContainerBase::addPropertyChangeListener(p1, p2); }
-    virtual void SAL_CALL removePropertyChangeListener(const OUString& p1, const com::sun::star::uno::Reference<com::sun::star::beans::XPropertyChangeListener>& p2) throw (com::sun::star::beans::UnknownPropertyException, com::sun::star::lang::WrappedTargetException, com::sun::star::uno::RuntimeException)
-        { return UnoControlDialogModel_Base::ControlModelContainerBase::removePropertyChangeListener(p1, p2); }
-    virtual void SAL_CALL addVetoableChangeListener(const OUString& p1, const com::sun::star::uno::Reference<com::sun::star::beans::XVetoableChangeListener>& p2) throw (com::sun::star::beans::UnknownPropertyException, com::sun::star::lang::WrappedTargetException, com::sun::star::uno::RuntimeException)
-        { return UnoControlDialogModel_Base::ControlModelContainerBase::addVetoableChangeListener(p1, p2); }
-    virtual void SAL_CALL removeVetoableChangeListener(const OUString& p1, const com::sun::star::uno::Reference<com::sun::star::beans::XVetoableChangeListener>& p2) throw (com::sun::star::beans::UnknownPropertyException, com::sun::star::lang::WrappedTargetException, com::sun::star::uno::RuntimeException)
-        { return UnoControlDialogModel_Base::ControlModelContainerBase::removeVetoableChangeListener(p1, p2); }
-    virtual com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL createInstance(const OUString& p1) throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException)
-        { return UnoControlDialogModel_Base::ControlModelContainerBase::createInstance(p1); }
-    virtual com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL createInstanceWithArguments(const OUString& p1, const com::sun::star::uno::Sequence<com::sun::star::uno::Any>& p2) throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException)
-        { return UnoControlDialogModel_Base::ControlModelContainerBase::createInstanceWithArguments(p1, p2); }
-    virtual com::sun::star::uno::Sequence<rtl::OUString> SAL_CALL getAvailableServiceNames() throw (::com::sun::star::uno::RuntimeException)
-        { return UnoControlDialogModel_Base::ControlModelContainerBase::getAvailableServiceNames(); }
-
-
-    virtual com::sun::star::uno::Type SAL_CALL getElementType() throw (::com::sun::star::uno::RuntimeException)
-        { return UnoControlDialogModel_Base::ControlModelContainerBase::getElementType(); }
-    virtual sal_Bool SAL_CALL hasElements() throw (::com::sun::star::uno::RuntimeException)
-        { return UnoControlDialogModel_Base::ControlModelContainerBase::hasElements(); }
-    virtual com::sun::star::uno::Any SAL_CALL getByName(const rtl::OUString& p1) throw (com::sun::star::container::NoSuchElementException, com::sun::star::lang::WrappedTargetException, com::sun::star::uno::RuntimeException)
-        { return UnoControlDialogModel_Base::ControlModelContainerBase::getByName(p1); }
-    virtual com::sun::star::uno::Sequence<rtl::OUString> SAL_CALL getElementNames() throw (::com::sun::star::uno::RuntimeException)
-        { return UnoControlDialogModel_Base::ControlModelContainerBase::getElementNames(); }
-    virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& p1) throw (::com::sun::star::uno::RuntimeException)
-        { return UnoControlDialogModel_Base::ControlModelContainerBase::hasByName(p1); }
-    virtual void SAL_CALL replaceByName(const rtl::OUString& p1, const com::sun::star::uno::Any& p2) throw (com::sun::star::lang::IllegalArgumentException, com::sun::star::container::NoSuchElementException, com::sun::star::lang::WrappedTargetException, com::sun::star::uno::RuntimeException)
-        { UnoControlDialogModel_Base::ControlModelContainerBase::replaceByName(p1, p2); }
-    virtual void SAL_CALL insertByName(const rtl::OUString& p1, const com::sun::star::uno::Any& p2) throw (com::sun::star::lang::IllegalArgumentException, com::sun::star::container::ElementExistException, com::sun::star::lang::WrappedTargetException, com::sun::star::uno::RuntimeException)
-        { UnoControlDialogModel_Base::ControlModelContainerBase::insertByName(p1, p2); }
-    virtual void SAL_CALL removeByName(const rtl::OUString& p1) throw (com::sun::star::container::NoSuchElementException, com::sun::star::lang::WrappedTargetException, com::sun::star::uno::RuntimeException)
-        { UnoControlDialogModel_Base::ControlModelContainerBase::removeByName(p1); }
-
-
-
 };
 
-typedef ::cppu::AggImplInheritanceHelper2   <   ControlContainerBase
-                                            ,   ::com::sun::star::awt::XUnoControlDialog
+typedef ::cppu::AggImplInheritanceHelper3   <   ControlContainerBase
+                                            ,   ::com::sun::star::awt::XTopWindow
+                                            ,   ::com::sun::star::awt::XDialog2
                                             ,   ::com::sun::star::awt::XWindowListener
                                             >   UnoDialogControl_Base;
 class UnoDialogControl : public UnoDialogControl_Base
@@ -266,73 +113,6 @@ public:
     // XModifyListener
     virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
 
-    // resolve some ambigous methods
-    virtual com::sun::star::uno::Reference<com::sun::star::awt::XWindowPeer> SAL_CALL getPeer() throw (com::sun::star::uno::RuntimeException)
-        { return UnoDialogControl_Base::ControlContainerBase::getPeer(); }
-    virtual void SAL_CALL addWindowListener(const com::sun::star::uno::Reference<com::sun::star::awt::XWindowListener>& p1) throw (com::sun::star::uno::RuntimeException)
-        { UnoDialogControl_Base::ControlContainerBase::addWindowListener(p1); }
-    virtual com::sun::star::uno::Reference<com::sun::star::awt::XControlModel> SAL_CALL getModel() throw (com::sun::star::uno::RuntimeException)
-        { return UnoDialogControl_Base::ControlContainerBase::getModel(); }
-    virtual void SAL_CALL addEventListener(const com::sun::star::uno::Reference<com::sun::star::lang::XEventListener>& p1) throw (com::sun::star::uno::RuntimeException)
-        { UnoDialogControl_Base::ControlContainerBase::addEventListener(p1); }
-    virtual void SAL_CALL removeEventListener(const com::sun::star::uno::Reference<com::sun::star::lang::XEventListener>& p1) throw (com::sun::star::uno::RuntimeException)
-        { UnoDialogControl_Base::ControlContainerBase::removeEventListener(p1); }
-    virtual void SAL_CALL setContext(const com::sun::star::uno::Reference<com::sun::star::uno::XInterface>& p1) throw (com::sun::star::uno::RuntimeException)
-        { UnoDialogControl_Base::ControlContainerBase::setContext(p1); }
-    virtual com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL getContext() throw (com::sun::star::uno::RuntimeException)
-        { return UnoDialogControl_Base::ControlContainerBase::getContext(); }
-    virtual com::sun::star::uno::Reference<com::sun::star::awt::XView> SAL_CALL getView() throw (com::sun::star::uno::RuntimeException)
-        { return UnoDialogControl_Base::ControlContainerBase::getView(); }
-    virtual void SAL_CALL setDesignMode(sal_Bool p1) throw (com::sun::star::uno::RuntimeException)
-        { UnoDialogControl_Base::ControlContainerBase::setDesignMode(p1); }
-    virtual sal_Bool SAL_CALL isDesignMode() throw (com::sun::star::uno::RuntimeException)
-        { return UnoDialogControl_Base::ControlContainerBase::isDesignMode(); }
-    virtual sal_Bool SAL_CALL isTransparent() throw (com::sun::star::uno::RuntimeException)
-        { return UnoDialogControl_Base::ControlContainerBase::isTransparent(); }
-    virtual void SAL_CALL setPosSize(sal_Int32 p1, sal_Int32 p2, sal_Int32 p3, sal_Int32 p4, sal_Int16 p5) throw (com::sun::star::uno::RuntimeException)
-        { UnoDialogControl_Base::ControlContainerBase::setPosSize(p1, p2, p3, p4, p5); }
-    virtual com::sun::star::awt::Rectangle SAL_CALL getPosSize() throw (com::sun::star::uno::RuntimeException)
-        { return UnoDialogControl_Base::ControlContainerBase::getPosSize(); }
-    virtual void SAL_CALL setVisible(sal_Bool p1) throw (com::sun::star::uno::RuntimeException)
-        { UnoDialogControl_Base::ControlContainerBase::setVisible(p1); }
-    virtual void SAL_CALL setEnable(sal_Bool p1) throw (com::sun::star::uno::RuntimeException)
-        { UnoDialogControl_Base::ControlContainerBase::setEnable(p1); }
-    virtual void SAL_CALL setFocus() throw (com::sun::star::uno::RuntimeException)
-        { UnoDialogControl_Base::ControlContainerBase::setFocus(); }
-    virtual void SAL_CALL removeWindowListener(const com::sun::star::uno::Reference<com::sun::star::awt::XWindowListener>& p1) throw (com::sun::star::uno::RuntimeException)
-        { UnoDialogControl_Base::ControlContainerBase::removeWindowListener(p1); }
-    virtual void SAL_CALL addFocusListener(const com::sun::star::uno::Reference<com::sun::star::awt::XFocusListener>& p1) throw (com::sun::star::uno::RuntimeException)
-        { UnoDialogControl_Base::ControlContainerBase::addFocusListener(p1); }
-    virtual void SAL_CALL removeFocusListener(const com::sun::star::uno::Reference<com::sun::star::awt::XFocusListener>& p1) throw (com::sun::star::uno::RuntimeException)
-        { UnoDialogControl_Base::ControlContainerBase::removeFocusListener(p1); }
-    virtual void SAL_CALL addKeyListener(const com::sun::star::uno::Reference<com::sun::star::awt::XKeyListener>& p1) throw (com::sun::star::uno::RuntimeException)
-        { UnoDialogControl_Base::ControlContainerBase::addKeyListener(p1); }
-    virtual void SAL_CALL removeKeyListener(const com::sun::star::uno::Reference<com::sun::star::awt::XKeyListener>& p1) throw (com::sun::star::uno::RuntimeException)
-        { UnoDialogControl_Base::ControlContainerBase::removeKeyListener(p1); }
-    virtual void SAL_CALL addMouseListener(const com::sun::star::uno::Reference<com::sun::star::awt::XMouseListener>& p1) throw (com::sun::star::uno::RuntimeException)
-        { UnoDialogControl_Base::ControlContainerBase::addMouseListener(p1); }
-    virtual void SAL_CALL removeMouseListener(const com::sun::star::uno::Reference<com::sun::star::awt::XMouseListener>& p1) throw (com::sun::star::uno::RuntimeException)
-        { UnoDialogControl_Base::ControlContainerBase::removeMouseListener(p1); }
-    virtual void SAL_CALL addMouseMotionListener(const com::sun::star::uno::Reference<com::sun::star::awt::XMouseMotionListener>& p1) throw (com::sun::star::uno::RuntimeException)
-        { UnoDialogControl_Base::ControlContainerBase::addMouseMotionListener(p1); }
-    virtual void SAL_CALL removeMouseMotionListener(const com::sun::star::uno::Reference<com::sun::star::awt::XMouseMotionListener>& p1) throw (com::sun::star::uno::RuntimeException)
-        { UnoDialogControl_Base::ControlContainerBase::removeMouseMotionListener(p1); }
-    virtual void SAL_CALL addPaintListener(const com::sun::star::uno::Reference<com::sun::star::awt::XPaintListener>& p1) throw (com::sun::star::uno::RuntimeException)
-        { UnoDialogControl_Base::ControlContainerBase::addPaintListener(p1); }
-    virtual void SAL_CALL removePaintListener(const com::sun::star::uno::Reference<com::sun::star::awt::XPaintListener>& p1) throw (com::sun::star::uno::RuntimeException)
-        { UnoDialogControl_Base::ControlContainerBase::removePaintListener(p1); }
-    virtual void SAL_CALL setStatusText(const rtl::OUString& p1) throw (com::sun::star::uno::RuntimeException)
-        { UnoDialogControl_Base::ControlContainerBase::setStatusText(p1); }
-    virtual com::sun::star::uno::Sequence<com::sun::star::uno::Reference<com::sun::star::awt::XControl> > SAL_CALL getControls() throw (com::sun::star::uno::RuntimeException)
-        { return UnoDialogControl_Base::ControlContainerBase::getControls(); }
-    virtual com::sun::star::uno::Reference<com::sun::star::awt::XControl> SAL_CALL getControl(const rtl::OUString& p1) throw (com::sun::star::uno::RuntimeException)
-        { return UnoDialogControl_Base::ControlContainerBase::getControl(p1); }
-    virtual void SAL_CALL addControl(const rtl::OUString& p1, const com::sun::star::uno::Reference<com::sun::star::awt::XControl>& p2) throw (com::sun::star::uno::RuntimeException)
-        { UnoDialogControl_Base::ControlContainerBase::addControl(p1, p2); }
-    virtual void SAL_CALL removeControl(const com::sun::star::uno::Reference<com::sun::star::awt::XControl>& p1) throw (com::sun::star::uno::RuntimeException)
-        { UnoDialogControl_Base::ControlContainerBase::removeControl(p1); }
-
-
     // ::com::sun::star::lang::XServiceInfo
     DECLIMPL_SERVICEINFO( UnoDialogControl, szServiceName2_UnoControlDialog )
 
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 7439a2e..db062c4 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -60,8 +60,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/awt,\
 	PopupMenu \
 	TabController \
 	Toolkit \
-	UnoControlDialog \
-	UnoControlDialogModel \
 	UnoControlDialogModelProvider \
 ))
 $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/awt/grid,\
@@ -518,7 +516,9 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/awt,\
 	UnoControlCurrencyFieldModel \
 	UnoControlDateField \
 	UnoControlDateFieldModel \
+	UnoControlDialog \
 	UnoControlDialogElement \
+	UnoControlDialogModel \
 	UnoControlEdit \
 	UnoControlEditModel \
 	UnoControlFileControl \
@@ -1876,8 +1876,6 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/awt,\
 	XTopWindowListener \
 	XUnitConversion \
 	XUnoControlContainer \
-	XUnoControlDialog \
-	XUnoControlDialogModel \
 	XUserInputInterception \
 	XVclContainer \
 	XVclContainerListener \
diff --git a/offapi/com/sun/star/awt/UnoControlDialog.idl b/offapi/com/sun/star/awt/UnoControlDialog.idl
index 67e0b79..4cc079e 100644
--- a/offapi/com/sun/star/awt/UnoControlDialog.idl
+++ b/offapi/com/sun/star/awt/UnoControlDialog.idl
@@ -19,14 +19,28 @@
 #ifndef __com_sun_star_awt_UnoControlDialog_idl__
 #define __com_sun_star_awt_UnoControlDialog_idl__
 
-#include <com/sun/star/awt/XUnoControlDialog.idl>
+#include <com/sun/star/awt/UnoControlContainer.idl>
 
-module com {  module sun {  module star {  module awt {
+#include <com/sun/star/awt/XTopWindow.idl>
+
+#include <com/sun/star/awt/XDialog2.idl>
+
+
+
+ module com {  module sun {  module star {  module awt {
 
 
 /** specifies a dialog control.
  */
-published service UnoControlDialog : XUnoControlDialog;
+published service UnoControlDialog
+{
+    service com::sun::star::awt::UnoControlContainer;
+
+    interface com::sun::star::awt::XTopWindow;
+
+    interface com::sun::star::awt::XDialog2;
+
+};
 
 
 }; }; }; };
diff --git a/offapi/com/sun/star/awt/UnoControlDialogModel.idl b/offapi/com/sun/star/awt/UnoControlDialogModel.idl
index 3956102..9c4dd99 100644
--- a/offapi/com/sun/star/awt/UnoControlDialogModel.idl
+++ b/offapi/com/sun/star/awt/UnoControlDialogModel.idl
@@ -19,7 +19,14 @@
 #ifndef __com_sun_star_awt_UnoControlDialogModel_idl__
 #define __com_sun_star_awt_UnoControlDialogModel_idl__
 
-#include <com/sun/star/awt/XUnoControlDialogModel.idl>
+#include <com/sun/star/awt/FontDescriptor.idl>
+#include <com/sun/star/awt/UnoControlModel.idl>
+#include <com/sun/star/container/XContainer.idl>
+#include <com/sun/star/container/XNameContainer.idl>
+
+#include <com/sun/star/lang/XMultiServiceFactory.idl>
+#include <com/sun/star/util/Color.idl>
+#include <com/sun/star/graphic/XGraphic.idl>
 
 
  module com {  module sun {  module star {  module awt {
@@ -27,7 +34,118 @@
 
 /** specifies the standard model of an <type>UnoControlDialog</type>.
  */
-published service UnoControlDialogModel : XUnoControlDialogModel;
+published service UnoControlDialogModel
+{
+    service com::sun::star::awt::UnoControlModel;
+
+    /** allows to create control models, which support the
+        <type>UnoControlDialogElement</type> service and can be inserted into
+        this container.
+     */
+    interface com::sun::star::lang::XMultiServiceFactory;
+
+    interface com::sun::star::container::XContainer;
+
+    interface com::sun::star::container::XNameContainer;
+
+
+    /** specifies the background color (RGB) of the dialog.
+     */
+    [property] com::sun::star::util::Color BackgroundColor;
+
+
+    /** specifies if the dialog is closeable.
+     */
+    [property] boolean Closeable;
+
+
+    /** determines whether a dialog is enabled or disabled.
+     */
+    [property] boolean Enabled;
+
+
+    /** specifies the font attributes of the text in the caption bar of the dialog.
+     */
+    [property] com::sun::star::awt::FontDescriptor FontDescriptor;
+
+
+    /** specifies the <type scope="com::sun::star::text">FontEmphasis</type>
+        value of the text in the caption bar of the dialog.
+     */
+    [property] short FontEmphasisMark;
+
+
+    /** specifies the <type scope="com::sun::star::text">FontRelief</type>
+        value of the text in the caption bar of the dialog.
+     */
+    [property] short FontRelief;
+
+
+    /** specifies the help text of the dialog.
+     */
+    [property] string HelpText;
+
+
+    /** specifies the help URL of the dialog.
+     */
+    [property] string HelpURL;
+
+
+    /** specifies if the dialog is moveable.
+     */
+    [property] boolean Moveable;
+
+
+    /** specifies if the dialog is sizeable.
+     */
+    [property] boolean Sizeable;
+
+
+    /** specifies the text color (RGB) of the dialog.
+     */
+    [property] com::sun::star::util::Color TextColor;
+
+
+    /** specifies the text line color (RGB) of the dialog.
+     */
+    [property] com::sun::star::util::Color TextLineColor;
+
+
+    /** specifies the text that is displayed in the caption bar of the dialog.
+     */
+    [property] string Title;
+
+
+    /** If set to true the dialog will have the desktop as parent.
+
+        @since OOo 2.3
+     */
+    [optional, property] boolean DesktopAsParent;
+
+    /** specifies a URL that references a graphic that should be used as a
+        background image.
+            @see Graphic
+
+        @since OOo 2.4
+    */
+    [optional, property] string ImageURL;
+
+    /** specifies a graphic to be displayed as a background image
+
+        <p>If this property is present, it interacts with the <member>ImageURL</member>in the
+        following way:
+        <ul><li>If <member>ImageURL</member> is set, <member>Graphic</member> will be reset
+            to an object as loaded from the given image URL, or <NULL/> if <member>ImageURL</member>
+            does not point to a valid image file.</li>
+            <li>If <member>Graphic</member> is set, <member>ImageURL</member> will be reset
+            to an empty string.</li>
+        </ul></p>
+
+        @since OOo 2.4
+     */
+    [optional, property, transient] com::sun::star::graphic::XGraphic Graphic;
+
+};
 
 
 }; }; }; };
diff --git a/offapi/com/sun/star/awt/XUnoControlDialog.idl b/offapi/com/sun/star/awt/XUnoControlDialog.idl
deleted file mode 100644
index 3d513b7..0000000
--- a/offapi/com/sun/star/awt/XUnoControlDialog.idl
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef __com_sun_star_awt_XUnoControlDialog_idl__
-#define __com_sun_star_awt_XUnoControlDialog_idl__
-
-#include <com/sun/star/container/XNameContainer.idl>
-#include <com/sun/star/awt/XControl.idl>
-#include <com/sun/star/awt/XDialog2.idl>
-#include <com/sun/star/awt/XTopWindow.idl>
-#include <com/sun/star/awt/XControlContainer.idl>
-#include <com/sun/star/awt/XWindow.idl>
-
-
-module com {  module sun {  module star {  module awt {
-
-/**
-   The interface for the UnoControlDialog service.
-   This service actually implements a whole whack of interfaces. This is the just
-   the subset that our code needs.
-
-   @since LibreOffice 4.1
- */
-published interface XUnoControlDialog
-{
-
-    interface com::sun::star::awt::XControlContainer; // -> XInterface
-
-    interface com::sun::star::awt::XControl; // -> XComponent
-
-    interface com::sun::star::awt::XWindow; // -> XComponent
-
-    interface com::sun::star::awt::XTopWindow; // -> XInterface
-
-    interface com::sun::star::awt::XDialog2; // -> XDialog -> XInterface
-};
-
-
-}; }; }; };
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/awt/XUnoControlDialogModel.idl b/offapi/com/sun/star/awt/XUnoControlDialogModel.idl
deleted file mode 100644
index 9032a37..0000000
--- a/offapi/com/sun/star/awt/XUnoControlDialogModel.idl
+++ /dev/null
@@ -1,166 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef __com_sun_star_awt_XUnoControlDialogModel_idl__
-#define __com_sun_star_awt_XUnoControlDialogModel_idl__
-
-#include <com/sun/star/awt/FontDescriptor.idl>
-#include <com/sun/star/awt/XControlModel.idl>
-#include <com/sun/star/beans/XPropertySet.idl>
-#include <com/sun/star/container/XContainer.idl>
-#include <com/sun/star/container/XNameContainer.idl>
-
-#include <com/sun/star/lang/XMultiServiceFactory.idl>
-#include <com/sun/star/util/Color.idl>
-#include <com/sun/star/graphic/XGraphic.idl>
-
-
-module com {  module sun {  module star {  module awt {
-
-
-/**
-    Unified interface for the UnoControlDialogModel service.
-
-    @since LibreOffice 4.1
- */
-published interface XUnoControlDialogModel
-{
-    interface com::sun::star::awt::XControlModel;
-
-    /** allows to create control models, which support the
-        <type>UnoControlDialogElement</type> service and can be inserted into
-        this container.
-     */
-    interface com::sun::star::lang::XMultiServiceFactory;
-
-    interface com::sun::star::beans::XPropertySet;
-
-    interface com::sun::star::container::XNameContainer; // -> XNameReplace -> XNameAccess -> XElementAccess
-
-    [attribute] string Name;
-
-    [attribute] boolean Decoration;
-
-    [attribute] long PositionX;
-
-    [attribute] long PositionY;
-
-    [attribute] long Width;
-
-    [attribute] long Height;
-
-    [attribute] string DialogSourceURL;
-
-    /** specifies the text that is displayed in the caption bar of the dialog.
-     */
-    [attribute] string Title;
-
-    /** specifies if the dialog is closeable.
-     */
-    [attribute] boolean Closeable;
-
-    /** determines whether a dialog is enabled or disabled.
-     */
-    [attribute] boolean Enabled;
-
-    /** specifies if the dialog is moveable.
-     */
-    [attribute] boolean Moveable;
-
-    /** specifies if the dialog is sizeable.
-     */
-    [attribute] boolean Sizeable;
-
-    /** If set to true the dialog will have the desktop as parent.
-
-        @since OOo 2.3
-     */
-    [attribute] boolean DesktopAsParent;
-
-    /** specifies the help URL of the dialog.
-     */
-    [attribute] string HelpURL;
-
-
-    /** specifies the background color (RGB) of the dialog.
-     */
-    [attribute] com::sun::star::util::Color BackgroundColor;
-
-
-    /** specifies the font attributes of the text in the caption bar of the dialog.
-     */
-    [attribute] com::sun::star::awt::FontDescriptor FontDescriptor;
-
-
-    /** specifies the <type scope="com::sun::star::text">FontEmphasis</type>
-        value of the text in the caption bar of the dialog.
-     */
-    [attribute] short FontEmphasisMark;
-
-
-    /** specifies the <type scope="com::sun::star::text">FontRelief</type>
-        value of the text in the caption bar of the dialog.
-     */
-    [attribute] short FontRelief;
-
-
-    /** specifies the help text of the dialog.
-     */
-    [attribute] string HelpText;
-
-
-    /** specifies the text color (RGB) of the dialog.
-     */
-    [attribute] com::sun::star::util::Color TextColor;
-
-
-    /** specifies the text line color (RGB) of the dialog.
-     */
-    [attribute] com::sun::star::util::Color TextLineColor;
-
-    /** specifies a URL that references a graphic that should be used as a
-        background image.
-            @see Graphic
-
-        @since OOo 2.4
-    */
-    [attribute] string ImageURL;
-
-    /** specifies a graphic to be displayed as a background image
-
-        <p>If this property is present, it interacts with the <member>ImageURL</member>in the
-        following way:
-        <ul><li>If <member>ImageURL</member> is set, <member>Graphic</member> will be reset
-            to an object as loaded from the given image URL, or <NULL/> if <member>ImageURL</member>
-            does not point to a valid image file.</li>
-            <li>If <member>Graphic</member> is set, <member>ImageURL</member> will be reset
-            to an empty string.</li>
-        </ul></p>
-
-        @since OOo 2.4
-     */
-    [attribute] com::sun::star::graphic::XGraphic Graphic;
-
-};
-
-
-}; }; }; };
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/type_reference/offapi.rdb b/offapi/type_reference/offapi.rdb
index c117713..0d73ab1 100644
Binary files a/offapi/type_reference/offapi.rdb and b/offapi/type_reference/offapi.rdb differ
diff --git a/scripting/source/dlgprov/DialogModelProvider.cxx b/scripting/source/dlgprov/DialogModelProvider.cxx
index b7b5de3..aee0a9a 100644
--- a/scripting/source/dlgprov/DialogModelProvider.cxx
+++ b/scripting/source/dlgprov/DialogModelProvider.cxx
@@ -76,9 +76,12 @@ void SAL_CALL DialogModelProvider::initialize(const css::uno::Sequence< uno::Any
             if ( xInput.is() )
             {
                 xStringResourceManager = dlgprov::lcl_getStringResourceManager(m_xContext,sURL);
+                Any aDialogSourceURLAny;
+                aDialogSourceURLAny <<= sURL;
 
                 Reference< frame::XModel > xModel;
-                m_xDialogModel = dlgprov::lcl_createDialogModel( m_xContext, xInput , xModel, xStringResourceManager, sURL  );
+                m_xDialogModel.set( dlgprov::lcl_createDialogModel( m_xContext, xInput , xModel, xStringResourceManager, aDialogSourceURLAny  ), UNO_QUERY_THROW);
+                m_xDialogModelProp.set(m_xDialogModel, UNO_QUERY_THROW);
             }
         }
         catch( Exception& )
@@ -132,14 +135,14 @@ void SAL_CALL DialogModelProvider::removeByName(const OUString & aName) throw (c
 }
 uno::Reference< beans::XPropertySetInfo > SAL_CALL DialogModelProvider::getPropertySetInfo(  ) throw (uno::RuntimeException)
 {
-    return m_xDialogModel->getPropertySetInfo();
+    return m_xDialogModelProp->getPropertySetInfo();
 }
 void SAL_CALL DialogModelProvider::setPropertyValue( const OUString&, const uno::Any& ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
 {
 }
 uno::Any SAL_CALL DialogModelProvider::getPropertyValue( const OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
 {
-    return m_xDialogModel->getPropertyValue(PropertyName);
+    return m_xDialogModelProp->getPropertyValue(PropertyName);
 }
 void SAL_CALL DialogModelProvider::addPropertyChangeListener( const OUString& , const uno::Reference< beans::XPropertyChangeListener >& ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
 {
diff --git a/scripting/source/dlgprov/DialogModelProvider.hxx b/scripting/source/dlgprov/DialogModelProvider.hxx
index b104614..4d9256a 100644
--- a/scripting/source/dlgprov/DialogModelProvider.hxx
+++ b/scripting/source/dlgprov/DialogModelProvider.hxx
@@ -23,8 +23,6 @@
 #include "com/sun/star/container/XNameContainer.hpp"
 #include "com/sun/star/lang/XServiceInfo.hpp"
 #include "com/sun/star/beans/XPropertySet.hpp"
-#include "com/sun/star/awt/XUnoControlDialogModel.hpp"
-
 
 /// anonymous implementation namespace
 namespace dlgprov{
@@ -77,8 +75,9 @@ private:
 
     // destructor is private and will be called indirectly by the release call    virtual ~DialogModelProvider() {}
 
-    css::uno::Reference< css::uno::XComponentContext >       m_xContext;
-    css::uno::Reference< css::awt::XUnoControlDialogModel>   m_xDialogModel;
+    css::uno::Reference< css::uno::XComponentContext >      m_xContext;
+    css::uno::Reference< css::container::XNameContainer>    m_xDialogModel;
+    css::uno::Reference< css::beans::XPropertySet>          m_xDialogModelProp;
 };
 } // closing anonymous implementation namespace
 
diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx
index 21ec3ef..2be567d 100644
--- a/scripting/source/dlgprov/dlgprov.cxx
+++ b/scripting/source/dlgprov/dlgprov.cxx
@@ -21,8 +21,6 @@
 #include "DialogModelProvider.hxx"
 #include "dlgprov.hxx"
 #include "dlgevtatt.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/XControlContainer.hpp>
 #include <com/sun/star/awt/XWindowPeer.hpp>
@@ -122,20 +120,23 @@ static OUString aResourceResolverPropName("ResourceResolver");
         }
         return xStringResourceManager;
     }
-    static Reference< XUnoControlDialogModel > lcl_createControlModel(const Reference< XComponentContext >& i_xContext)
+    Reference< container::XNameContainer > lcl_createControlModel(const Reference< XComponentContext >& i_xContext)
     {
-        Reference< XUnoControlDialogModel > xControlModel = UnoControlDialogModel::create( i_xContext );
+        Reference< XMultiComponentFactory > xSMgr_( i_xContext->getServiceManager(), UNO_QUERY_THROW );
+        Reference< container::XNameContainer > xControlModel( xSMgr_->createInstanceWithContext( OUString( "com.sun.star.awt.UnoControlDialogModel"  ), i_xContext ), UNO_QUERY_THROW );
         return xControlModel;
     }
-    Reference< XUnoControlDialogModel > lcl_createDialogModel( const Reference< XComponentContext >& i_xContext,
+    Reference< container::XNameContainer > lcl_createDialogModel( const Reference< XComponentContext >& i_xContext,
         const Reference< io::XInputStream >& xInput,
         const Reference< frame::XModel >& xModel,
         const Reference< resource::XStringResourceManager >& xStringResourceManager,
-        const OUString& aDialogSourceURL) throw ( Exception )
+        const Any &aDialogSourceURL) throw ( Exception )
     {
-        Reference< XUnoControlDialogModel > xDialogModel(  lcl_createControlModel(i_xContext) );
+        Reference< container::XNameContainer > xDialogModel(  lcl_createControlModel(i_xContext) );
 
-        xDialogModel->setDialogSourceURL( aDialogSourceURL );
+        OUString aDlgSrcUrlPropName( "DialogSourceURL"  );
+        Reference< beans::XPropertySet > xDlgPropSet( xDialogModel, UNO_QUERY );
+        xDlgPropSet->setPropertyValue( aDlgSrcUrlPropName, aDialogSourceURL );
 
         // #TODO we really need to detect the source of the Dialog, is it
         // the dialog. E.g. if the dialog was created from basic ( then we just
@@ -254,15 +255,15 @@ static OUString aResourceResolverPropName("ResourceResolver");
         return xStringResourceManager;
     }
 
-    Reference< XUnoControlDialogModel > DialogProviderImpl::createDialogModel(
+    Reference< container::XNameContainer > DialogProviderImpl::createDialogModel(
         const Reference< io::XInputStream >& xInput,
         const Reference< resource::XStringResourceManager >& xStringResourceManager,
-        const OUString &aDialogSourceURL) throw ( Exception )
+        const Any &aDialogSourceURL) throw ( Exception )
     {
         return lcl_createDialogModel(m_xContext,xInput,m_xModel,xStringResourceManager,aDialogSourceURL);
     }
 
-    Reference< XUnoControlDialogModel > DialogProviderImpl::createDialogModelForBasic() throw ( Exception )
+    Reference< XControlModel > DialogProviderImpl::createDialogModelForBasic() throw ( Exception )
     {
         if ( !m_BasicInfo.get() )
             // shouln't get here
@@ -270,10 +271,13 @@ static OUString aResourceResolverPropName("ResourceResolver");
         Reference< resource::XStringResourceManager > xStringResourceManager = getStringResourceFromDialogLibrary( m_BasicInfo->mxDlgLib );
 
         OUString aURL("" );
-        return createDialogModel( m_BasicInfo->mxInput, xStringResourceManager, aURL );
+        Any aDialogSourceURL;
+        aDialogSourceURL <<= aURL;
+        Reference< XControlModel > xCtrlModel( createDialogModel( m_BasicInfo->mxInput, xStringResourceManager, aDialogSourceURL ), UNO_QUERY_THROW );
+        return xCtrlModel;
     }
 
-    Reference< XUnoControlDialogModel > DialogProviderImpl::createDialogModel( const OUString& sURL )
+    Reference< XControlModel > DialogProviderImpl::createDialogModel( const OUString& sURL )
     {
 
         OUString aURL( sURL );
@@ -443,7 +447,7 @@ static OUString aResourceResolverPropName("ResourceResolver");
         }
 
         // import dialog model
-        Reference< XUnoControlDialogModel > xCtrlModel;
+        Reference< XControlModel > xCtrlModel;
         if ( xInput.is() && m_xContext.is() )
         {
             Reference< resource::XStringResourceManager > xStringResourceManager;
@@ -456,51 +460,67 @@ static OUString aResourceResolverPropName("ResourceResolver");
                 xStringResourceManager = getStringResourceFromDialogLibrary( xDialogLib );
             }
 
-            xCtrlModel = createDialogModel( xInput , xStringResourceManager, aURL  );
+            Any aDialogSourceURLAny;
+            aDialogSourceURLAny <<= aURL;
+
+            Reference< container::XNameContainer > xDialogModel( createDialogModel( xInput , xStringResourceManager, aDialogSourceURLAny  ), UNO_QUERY_THROW);
+
+            xCtrlModel = Reference< XControlModel >( xDialogModel, UNO_QUERY );
         }
         return xCtrlModel;
     }
 
     // -----------------------------------------------------------------------------
 
-    Reference< XUnoControlDialog > DialogProviderImpl::createDialogControl
+    Reference< XControl > DialogProviderImpl::createDialogControl
         ( const Reference< XControlModel >& rxDialogModel, const Reference< XWindowPeer >& xParent )
     {
         OSL_ENSURE( rxDialogModel.is(), "DialogProviderImpl::getDialogControl: no dialog model" );
 
-        Reference< XUnoControlDialog > xDialogControl;
+        Reference< XControl > xDialogControl;
 
         if ( m_xContext.is() )
         {
-            xDialogControl = UnoControlDialog::create( m_xContext );
-
-            // set the model
-            if ( rxDialogModel.is() )
-                xDialogControl->setModel( rxDialogModel );
+            Reference< XMultiComponentFactory > xSMgr( m_xContext->getServiceManager() );
 
-            // set visible
-            xDialogControl->setVisible( sal_False );
-
-            // get the parent of the dialog control
-            Reference< XWindowPeer > xPeer;
-            if( xParent.is() )
-            {
-                xPeer = xParent;
-            }
-            else if ( m_xModel.is() )
+            if ( xSMgr.is() )
             {
-                Reference< frame::XController > xController( m_xModel->getCurrentController(), UNO_QUERY );
-                if ( xController.is() )
+                xDialogControl = Reference< XControl >( xSMgr->createInstanceWithContext(
+                    OUString( "com.sun.star.awt.UnoControlDialog"  ), m_xContext ), UNO_QUERY );
+
+                if ( xDialogControl.is() )
                 {
-                    Reference< frame::XFrame > xFrame( xController->getFrame(), UNO_QUERY );
-                    if ( xFrame.is() )
-                        xPeer = Reference< XWindowPeer>( xFrame->getContainerWindow(), UNO_QUERY );
+                    // set the model
+                    if ( rxDialogModel.is() )
+                        xDialogControl->setModel( rxDialogModel );
+
+                    // set visible
+                    Reference< XWindow > xW( xDialogControl, UNO_QUERY );
+                    if ( xW.is() )
+                        xW->setVisible( sal_False );
+
+                    // get the parent of the dialog control
+                    Reference< XWindowPeer > xPeer;
+                    if( xParent.is() )
+                    {
+                        xPeer = xParent;
+                    }
+                    else if ( m_xModel.is() )
+                    {
+                        Reference< frame::XController > xController( m_xModel->getCurrentController(), UNO_QUERY );
+                        if ( xController.is() )
+                        {
+                            Reference< frame::XFrame > xFrame( xController->getFrame(), UNO_QUERY );
+                            if ( xFrame.is() )
+                                xPeer = Reference< XWindowPeer>( xFrame->getContainerWindow(), UNO_QUERY );
+                        }
+                    }
+
+                    // create a peer
+                    Reference< XToolkit> xToolkit( Toolkit::create( m_xContext ), UNO_QUERY_THROW );
+                    xDialogControl->createPeer( xToolkit, xPeer );
                 }
             }
-
-            // create a peer
-            Reference< XToolkit> xToolkit( Toolkit::create( m_xContext ), UNO_QUERY_THROW );
-            xDialogControl->createPeer( xToolkit, xPeer );
         }
 
         return xDialogControl;
diff --git a/scripting/source/dlgprov/dlgprov.hxx b/scripting/source/dlgprov/dlgprov.hxx
index 515f25a..651edfa 100644
--- a/scripting/source/dlgprov/dlgprov.hxx
+++ b/scripting/source/dlgprov/dlgprov.hxx
@@ -21,20 +21,18 @@
 #define SCRIPTING_DLGPROV_HXX
 
 #include <com/sun/star/awt/XControl.hpp>
-#include <com/sun/star/awt/XContainerWindowProvider.hpp>
 #include <com/sun/star/awt/XDialog.hpp>
 #include <com/sun/star/awt/XDialogProvider2.hpp>
-#include <com/sun/star/awt/XUnoControlDialog.hpp>
-#include <com/sun/star/awt/XUnoControlDialogModel.hpp>
-#include <com/sun/star/beans/XIntrospectionAccess.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/awt/XContainerWindowProvider.hpp>
 #include <com/sun/star/frame/XModel.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <com/sun/star/resource/XStringResourceManager.hpp>
 #include <com/sun/star/script/XScriptEventsAttacher.hpp>
 #include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/beans/XIntrospectionAccess.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/resource/XStringResourceManager.hpp>
 
 #include <cppuhelper/implbase4.hxx>
 #include <osl/mutex.hxx>
@@ -55,14 +53,14 @@ namespace dlgprov
     // =============================================================================
     // class DialogProviderImpl
     // =============================================================================
-    ::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceManager > lcl_getStringResourceManager(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_xContext,const OUString& i_sURL);;
-
-    ::com::sun::star::uno::Reference< ::com::sun::star::awt::XUnoControlDialogModel > lcl_createDialogModel(
+    ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > lcl_createControlModel(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_xContext);
+    ::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceManager > lcl_getStringResourceManager(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_xContext,const OUString& i_sURL);
+    ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > lcl_createDialogModel(
                 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_xContext,
                 const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInput,
                 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel,

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list