summaryrefslogtreecommitdiff
path: root/UnoControls/source/base
diff options
context:
space:
mode:
Diffstat (limited to 'UnoControls/source/base')
-rw-r--r--UnoControls/source/base/basecontainercontrol.cxx22
-rw-r--r--UnoControls/source/base/basecontrol.cxx27
2 files changed, 21 insertions, 28 deletions
diff --git a/UnoControls/source/base/basecontainercontrol.cxx b/UnoControls/source/base/basecontainercontrol.cxx
index 5d78317cf043..9c6bef517e53 100644
--- a/UnoControls/source/base/basecontainercontrol.cxx
+++ b/UnoControls/source/base/basecontainercontrol.cxx
@@ -364,20 +364,16 @@ void SAL_CALL BaseContainerControl::setVisible ( sal_Bool bVisible )
// protected method
-WindowDescriptor* BaseContainerControl::impl_getWindowDescriptor ( const Reference< XWindowPeer > & rParentPeer )
+WindowDescriptor BaseContainerControl::impl_getWindowDescriptor ( const Reference< XWindowPeer > & rParentPeer )
{
- // - used from "createPeer()" to set the values of a WindowDescriptor!!!
- // - if you will change the descriptor-values, you must override this virtual function
- // - the caller must release the memory for this dynamical descriptor!!!
-
- WindowDescriptor * aDescriptor = new WindowDescriptor;
-
- aDescriptor->Type = WindowClass_CONTAINER;
- aDescriptor->WindowServiceName = "window";
- aDescriptor->ParentIndex = -1;
- aDescriptor->Parent = rParentPeer;
- aDescriptor->Bounds = getPosSize ();
- aDescriptor->WindowAttributes = 0;
+ WindowDescriptor aDescriptor;
+
+ aDescriptor.Type = WindowClass_CONTAINER;
+ aDescriptor.WindowServiceName = "window";
+ aDescriptor.ParentIndex = -1;
+ aDescriptor.Parent = rParentPeer;
+ aDescriptor.Bounds = getPosSize ();
+ aDescriptor.WindowAttributes = 0;
return aDescriptor;
}
diff --git a/UnoControls/source/base/basecontrol.cxx b/UnoControls/source/base/basecontrol.cxx
index 1e072f1bb3f7..e2ce368be91d 100644
--- a/UnoControls/source/base/basecontrol.cxx
+++ b/UnoControls/source/base/basecontrol.cxx
@@ -265,11 +265,11 @@ void SAL_CALL BaseControl::createPeer( const Reference< XToolkit >& xToo
if ( !m_xPeer.is() )
{
// use method "BaseControl::getWindowDescriptor()" to change window attributes!
- WindowDescriptor* pDescriptor = impl_getWindowDescriptor( xParentPeer );
+ WindowDescriptor aDescriptor = impl_getWindowDescriptor( xParentPeer );
if ( m_bVisible )
{
- pDescriptor->WindowAttributes |= WindowAttribute::SHOW;
+ aDescriptor.WindowAttributes |= WindowAttribute::SHOW;
}
// very slow under remote conditions!
@@ -280,12 +280,9 @@ void SAL_CALL BaseControl::createPeer( const Reference< XToolkit >& xToo
// but first create well known toolkit, if it not exist
xLocalToolkit.set( Toolkit::create(m_xComponentContext), UNO_QUERY_THROW );
}
- m_xPeer = xLocalToolkit->createWindow( *pDescriptor );
+ m_xPeer = xLocalToolkit->createWindow( aDescriptor );
m_xPeerWindow.set( m_xPeer, UNO_QUERY );
- // don't forget to release the memory!
- delete pDescriptor;
-
if ( m_xPeerWindow.is() )
{
if ( m_xMultiplexer.is() )
@@ -700,22 +697,22 @@ void SAL_CALL BaseControl::windowHidden( const EventObject& /*aEvent*/ )
// protected method
-WindowDescriptor* BaseControl::impl_getWindowDescriptor( const Reference< XWindowPeer >& xParentPeer )
+WindowDescriptor BaseControl::impl_getWindowDescriptor( const Reference< XWindowPeer >& xParentPeer )
{
// - used from "createPeer()" to set the values of an css::awt::WindowDescriptor !!!
// - if you will change the descriptor-values, you must override this virtual function
// - the caller must release the memory for this dynamical descriptor !!!
- WindowDescriptor* pDescriptor = new WindowDescriptor;
+ WindowDescriptor aDescriptor;
- pDescriptor->Type = WindowClass_SIMPLE;
- pDescriptor->WindowServiceName = "window";
- pDescriptor->ParentIndex = -1;
- pDescriptor->Parent = xParentPeer;
- pDescriptor->Bounds = getPosSize ();
- pDescriptor->WindowAttributes = 0;
+ aDescriptor.Type = WindowClass_SIMPLE;
+ aDescriptor.WindowServiceName = "window";
+ aDescriptor.ParentIndex = -1;
+ aDescriptor.Parent = xParentPeer;
+ aDescriptor.Bounds = getPosSize ();
+ aDescriptor.WindowAttributes = 0;
- return pDescriptor;
+ return aDescriptor;
}
// protected method