diff options
author | Thomas Benisch <tbe@openoffice.org> | 2001-03-02 13:04:14 +0000 |
---|---|---|
committer | Thomas Benisch <tbe@openoffice.org> | 2001-03-02 13:04:14 +0000 |
commit | 4bb76ceaad19dcea194fc83ac999d36301d04ee6 (patch) | |
tree | aa0f5c0a0aea8804cd978e38fb0c14659a1f24e8 | |
parent | a9a8ea4b013cf2e27162167fe9c0ff63ba88e981 (diff) |
clone the dialog model for test mode
-rw-r--r-- | basctl/source/dlged/dlged.cxx | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx index a9583174b9d6..1b1ee910cc20 100644 --- a/basctl/source/dlged/dlged.cxx +++ b/basctl/source/dlged/dlged.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dlged.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: tbe $ $Date: 2001-03-01 09:26:02 $ + * last change: $Author: tbe $ $Date: 2001-03-02 14:04:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -97,6 +97,10 @@ #include <com/sun/star/script/XLibraryContainer.hpp> #endif +#ifndef _COM_SUN_STAR_UTIL_XCLONEABLE_HPP_ +#include <com/sun/star/util/XCloneable.hpp> +#endif + #pragma hdrstop #ifndef _SVXIDS_HRC @@ -167,13 +171,18 @@ void VCDlgEditor::ShowDialog() // create a dialog uno::Reference< awt::XControl > xDlg( xMSF->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlDialog" ) ) ), uno::UNO_QUERY ); - uno::Reference< awt::XControlModel > xDlgMod( m_xUnoControlDialogModel, uno::UNO_QUERY ); + // clone the dialog model + uno::Reference< util::XCloneable > xC( m_xUnoControlDialogModel, uno::UNO_QUERY ); + uno::Reference< util::XCloneable > xNew = xC->createClone(); + uno::Reference< awt::XControlModel > xDlgMod( xNew, uno::UNO_QUERY ); + + // set the model xDlg->setModel( xDlgMod ); // create a peer uno::Reference< awt::XToolkit> xToolkit( xMSF->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.ExtToolkit" ) ) ), uno::UNO_QUERY ); - xDlg->createPeer( xToolkit, NULL ); + xDlg->createPeer( xToolkit, pWindow->GetComponentInterface() ); uno::Reference< awt::XDialog > xD( xDlg, uno::UNO_QUERY ); xD->execute(); @@ -276,14 +285,14 @@ void VCDlgEditor::SetWindow( Window* pWindow ) pSdrView->SetLayerVisible( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "VCHiddenLayer" ) ), FALSE ); pSdrView->SetMoveSnapOnlyTopLeft( TRUE ); - Size aGridSize( 60, 60 ); //Twips + //Size aGridSize( 60, 60 ); //Twips + Size aGridSize( 100, 100 ); // 100TH_MM bGridSnap = TRUE; bGridVisible = TRUE; pSdrView->SetGridCoarse( aGridSize ); pSdrView->SetSnapGrid( aGridSize ); pSdrView->SetGridSnap( bGridSnap ); pSdrView->SetGridVisible( FALSE ); - pSdrView->SetDragStripes( FALSE ); pSdrView->SetDesignMode( TRUE ); // tbe put this somewhere else @@ -498,7 +507,8 @@ void VCDlgEditor::SetDialog( ) Any aA = xNameAcc->getByName( pNames[n] ); Reference< ::com::sun::star::awt::XControlModel > xCtrlModel; aA >>= xCtrlModel; - DlgEdObj* pCtrlObj = new DlgEdObj(pDlgEdForm); + DlgEdObj* pCtrlObj = new DlgEdObj(); + pCtrlObj->SetDlgEdForm(pDlgEdForm); pCtrlObj->SetUnoControlModel( xCtrlModel ); pCtrlObj->StartPropertyListening(); pCtrlObj->SetChanged(); |