Index: toolkit/inc/toolkit/awt/vclxcontainer.hxx
===================================================================
RCS file: /cvs/gsl/toolkit/inc/toolkit/awt/vclxcontainer.hxx,v
retrieving revision 1.3
retrieving revision 1.3.246.1
diff -u -p -u -p -r1.3 -r1.3.246.1
--- toolkit/inc/toolkit/awt/vclxcontainer.hxx	9 Sep 2005 12:43:16 -0000	1.3
+++ toolkit/inc/toolkit/awt/vclxcontainer.hxx	13 Jul 2007 17:43:51 -0000	1.3.246.1
@@ -89,6 +89,8 @@ public:	
     void SAL_CALL setTabOrder( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > >& WindowOrder, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Tabs, sal_Bool GroupControl ) throw(::com::sun::star::uno::RuntimeException);
     void SAL_CALL setGroup( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > >& Windows ) throw(::com::sun::star::uno::RuntimeException);
 
+    static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+    virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
 };
 
 
Index: toolkit/inc/toolkit/awt/vclxtopwindow.hxx
===================================================================
RCS file: /cvs/gsl/toolkit/inc/toolkit/awt/vclxtopwindow.hxx,v
retrieving revision 1.4
retrieving revision 1.4.246.1
diff -u -p -u -p -r1.4 -r1.4.246.1
--- toolkit/inc/toolkit/awt/vclxtopwindow.hxx	9 Sep 2005 12:46:57 -0000	1.4
+++ toolkit/inc/toolkit/awt/vclxtopwindow.hxx	13 Jul 2007 17:43:51 -0000	1.4.246.1
@@ -89,6 +89,9 @@ public:	
     void SAL_CALL toFront(  ) throw(::com::sun::star::uno::RuntimeException);
     void SAL_CALL toBack(  ) throw(::com::sun::star::uno::RuntimeException);
     void SAL_CALL setMenuBar( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuBar >& xMenu ) throw(::com::sun::star::uno::RuntimeException);
+
+    static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+    virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
 };
 
 
Index: toolkit/inc/toolkit/awt/vclxwindow.hxx
===================================================================
RCS file: /cvs/gsl/toolkit/inc/toolkit/awt/vclxwindow.hxx,v
retrieving revision 1.25
retrieving revision 1.25.8.2
diff -u -p -u -p -r1.25 -r1.25.8.2
--- toolkit/inc/toolkit/awt/vclxwindow.hxx	27 Jun 2007 15:04:43 -0000	1.25
+++ toolkit/inc/toolkit/awt/vclxwindow.hxx	16 Aug 2007 16:09:16 -0000	1.25.8.2
@@ -64,6 +64,7 @@
 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYCHANGELISTENER_HPP_
 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
 #endif
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
 #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_HPP_
 #include <com/sun/star/accessibility/XAccessible.hpp>
 #endif
@@ -91,6 +92,9 @@
 #include <tools/link.hxx>
 #endif
 
+#include <stdarg.h>
+#include <list>
+
 class Window;
 class VclSimpleEvent;
 class VclWindowEvent;
@@ -107,6 +111,7 @@ namespace toolkit
 //	class VCLXWINDOW
 //	----------------------------------------------------
 
+class UnoPropertyArrayHelper;
 class VCLXWindowImpl;
 class TOOLKIT_DLLPUBLIC VCLXWindow :	public ::com::sun::star::awt::XWindow2,
 					public ::com::sun::star::awt::XVclWindowPeer,
@@ -115,6 +120,7 @@ class TOOLKIT_DLLPUBLIC VCLXWindow :	pub
 					public ::com::sun::star::awt::XDockableWindow,
 					public ::com::sun::star::accessibility::XAccessible,
 					public ::com::sun::star::lang::XEventListener,
+					public ::com::sun::star::beans::XPropertySetInfo,
 					public VCLXDevice
 {
 private:
@@ -137,14 +143,17 @@ private:
 	ULONG                           mnListenerLockLevel;
 	ULONG                           nDummy2;
     VCLXWindowImpl*                 mpImpl;
-	void*                           pDummy2;
+    UnoPropertyArrayHelper         *mpPropHelper;
 
-	sal_Bool						mbDisposing;
-	sal_Bool						mbDesignMode;
-	sal_Bool						mbSynthesizingVCLEvent;
-	sal_Bool						mbDrawingOntoParent;
 
+	sal_Bool						mbDisposing : 1;
+	sal_Bool						mbDesignMode : 1;
+	sal_Bool						mbSynthesizingVCLEvent : 1;
+    sal_Bool                        mbWithDefaultProps : 1;
+	sal_Bool						mbDrawingOntoParent;
 
+    UnoPropertyArrayHelper *GetPropHelper();
+	
 protected:
 	Size			ImplCalcWindowSize( const Size& rOutSz ) const;
 	DECL_LINK(      WindowEventListener, VclSimpleEvent* );
@@ -159,8 +168,16 @@ protected:
 
     ::toolkit::IAccessibleFactory&  getAccessibleFactory();
 
+    // helper ...
+    static void     PushPropertyIds( std::list< sal_uInt16 > &aIds, int nFirstId, ...);
+    // for use in controls/
+    static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds,
+                                        bool bWithDefaults = false );
+    virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds )
+        { return ImplGetPropertyIds( aIds, mbWithDefaultProps ); }
+
 public:
-	VCLXWindow();
+	VCLXWindow( bool bWithDefaultProps = false );
 	~VCLXWindow();
 
 	virtual void	SetWindow( Window* pWindow );
@@ -275,6 +292,10 @@ public:
     sal_Bool SAL_CALL isEnabled(  ) throw (::com::sun::star::uno::RuntimeException);
     sal_Bool SAL_CALL hasFocus(  ) throw (::com::sun::star::uno::RuntimeException);
 
+    // ::com::sun::star::beans::XPropertySetInfo
+    ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL getProperties(  ) throw (::com::sun::star::uno::RuntimeException);
+    ::com::sun::star::beans::Property SAL_CALL getPropertyByName( const ::rtl::OUString& aName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+    ::sal_Bool SAL_CALL hasPropertyByName( const ::rtl::OUString& Name ) throw (::com::sun::star::uno::RuntimeException);
 };
 
 #endif // _TOOLKIT_AWT_VCLXWINDOW_HXX_
Index: toolkit/inc/toolkit/awt/vclxwindows.hxx
===================================================================
RCS file: /cvs/gsl/toolkit/inc/toolkit/awt/vclxwindows.hxx,v
retrieving revision 1.36
retrieving revision 1.36.114.1
diff -u -p -u -p -r1.36 -r1.36.114.1
--- toolkit/inc/toolkit/awt/vclxwindows.hxx	18 Oct 2006 13:13:42 -0000	1.36
+++ toolkit/inc/toolkit/awt/vclxwindows.hxx	13 Jul 2007 17:43:51 -0000	1.36.114.1
@@ -265,6 +265,10 @@ protected:
         @see GetBitmap
     */
     virtual void    ImplSetNewImage();
+public:
+    static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+    virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+
 };
 
 //	----------------------------------------------------
@@ -310,6 +314,9 @@ public:
 	// ::com::sun::star::awt::VclWindowPeer
     void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
     ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+    static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+    virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
 };
 
 //	----------------------------------------------------
@@ -330,6 +337,8 @@ public:
     void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
     ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
 
+    static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+    virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
 protected:
     virtual void    ImplSetNewImage();
 };
@@ -387,6 +396,9 @@ public:
 	// ::com::sun::star::awt::VclWindowPeer
     void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
     ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+    static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+    virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
 };
 
 //	----------------------------------------------------
@@ -406,7 +418,6 @@ protected:
     void            ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > CreateAccessibleContext();
 
-
 public:
 					VCLXRadioButton();
 
@@ -442,6 +453,9 @@ public:
 	// ::com::sun::star::awt::VclWindowPeer
     void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
     ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+    static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+    virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
 };
 
 //	----------------------------------------------------
@@ -470,6 +484,9 @@ public:
     void SAL_CALL setMessageText( const ::rtl::OUString& aText ) throw(::com::sun::star::uno::RuntimeException);
     ::rtl::OUString SAL_CALL getMessageText(  ) throw(::com::sun::star::uno::RuntimeException);
     sal_Int16 SAL_CALL execute(  ) throw(::com::sun::star::uno::RuntimeException);
+
+    static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+    virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
 };
 
 
@@ -504,6 +521,9 @@ public:
 
 	// ::com::sun::star::awt::XDevice,
 	::com::sun::star::awt::DeviceInfo SAL_CALL getInfo() throw(::com::sun::star::uno::RuntimeException);
+
+    static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+    virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
 };
 
 //	----------------------------------------------------
@@ -538,6 +558,9 @@ public:
     ::com::sun::star::awt::Size SAL_CALL getMinimumSize(  ) throw(::com::sun::star::uno::RuntimeException);
     ::com::sun::star::awt::Size SAL_CALL getPreferredSize(  ) throw(::com::sun::star::uno::RuntimeException);
     ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException);
+
+    static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+    virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
 };
 
 //	----------------------------------------------------
@@ -553,7 +576,6 @@ protected:
     void            ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > CreateAccessibleContext();
 
-
 public:
 					VCLXScrollBar();
 	// ::com::sun::star::uno::XInterface
@@ -593,6 +615,9 @@ public:
 	// ::com::sun::star::awt::VclWindowPeer
     void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
     ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+    static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+    virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
 };
 
 //	----------------------------------------------------
@@ -658,6 +683,9 @@ public:
 	// ::com::sun::star::awt::VclWindowPeer
     void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
     ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+    static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+    virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
 };
 
 //	----------------------------------------------------
@@ -729,6 +757,9 @@ public:
 	// ::com::sun::star::awt::VclWindowPeer
     void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
     ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+    static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+    virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
 };
 
 //	----------------------------------------------------
@@ -787,6 +818,9 @@ public:
 	// ::com::sun::star::awt::VclWindowPeer
     void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
     ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+    static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+    virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
 };
 
 //	----------------------------------------------------
@@ -822,6 +856,9 @@ public:
     void SAL_CALL first(  ) throw(::com::sun::star::uno::RuntimeException);
     void SAL_CALL last(  ) throw(::com::sun::star::uno::RuntimeException);
     void SAL_CALL enableRepeat( sal_Bool bRepeat ) throw(::com::sun::star::uno::RuntimeException);
+
+    static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+    virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
 };
 
 //	----------------------------------------------------
@@ -847,6 +884,9 @@ public:
 	// ::com::sun::star::awt::VclWindowPeer
     void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
     ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+    static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+    virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
 };
 
 //	----------------------------------------------------
@@ -890,6 +930,9 @@ public:
 	// ::com::sun::star::awt::VclWindowPeer
     void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
     ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+    static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+    virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
 };
 
 //	----------------------------------------------------
@@ -930,6 +973,9 @@ public:
 	// ::com::sun::star::awt::VclWindowPeer
     void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
     ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+    static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+    virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
 };
 
 //	----------------------------------------------------
@@ -972,6 +1018,9 @@ public:
 	// ::com::sun::star::awt::VclWindowPeer
     void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
     ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+    static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+    virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
 };
 
 //	----------------------------------------------------
@@ -1015,6 +1064,9 @@ public:
 	// ::com::sun::star::awt::VclWindowPeer
     void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
     ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+    static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+    virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
 };
 
 //	----------------------------------------------------
@@ -1048,6 +1100,9 @@ public:
 	// ::com::sun::star::awt::VclWindowPeer
     void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
     ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+    static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+    virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
 };
 
 //	----------------------------------------------------
Index: toolkit/inc/toolkit/controls/unocontrolmodel.hxx
===================================================================
RCS file: /cvs/gsl/toolkit/inc/toolkit/controls/unocontrolmodel.hxx,v
retrieving revision 1.8
retrieving revision 1.8.54.1
diff -u -p -u -p -r1.8 -r1.8.54.1
--- toolkit/inc/toolkit/controls/unocontrolmodel.hxx	14 Feb 2007 15:33:32 -0000	1.8
+++ toolkit/inc/toolkit/controls/unocontrolmodel.hxx	13 Jul 2007 17:43:51 -0000	1.8.54.1
@@ -75,6 +75,8 @@
 #include <cppuhelper/propshlp.hxx>
 #include <cppuhelper/interfacecontainer.hxx>
 
+#include <list>
+
 class ImplPropertyTable; 
 
 //	----------------------------------------------------
@@ -99,6 +101,7 @@ private:
 
 protected:
 	void										ImplRegisterProperty( sal_uInt16 nPropType );
+	void										ImplRegisterProperties( const std::list< sal_uInt16 > &rIds );
 	void										ImplRegisterProperty( sal_uInt16 nPropId, const ::com::sun::star::uno::Any& rDefault );
 	::com::sun::star::uno::Sequence<sal_Int32>	ImplGetPropertyIds() const;
 	virtual void								ImplPropertyChanged( sal_uInt16 nPropId );
@@ -193,8 +196,12 @@ public:	
     void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& PropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Values ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
 };
 
-
-
+#define UNO_CONTROL_MODEL_REGISTER_PROPERTIES(a) \
+    do { \
+        std::list< sal_uInt16 > aIds; \
+        a::ImplGetPropertyIds( aIds ); \
+        ImplRegisterProperties( aIds ); \
+    } while (0)
 
 #endif // _TOOLKIT_AWT_UNOCONTROLMODEL_HXX_
 
Index: toolkit/inc/toolkit/helper/unopropertyarrayhelper.hxx
===================================================================
RCS file: /cvs/gsl/toolkit/inc/toolkit/helper/unopropertyarrayhelper.hxx,v
retrieving revision 1.3
retrieving revision 1.3.246.1
diff -u -p -u -p -r1.3 -r1.3.246.1
--- toolkit/inc/toolkit/helper/unopropertyarrayhelper.hxx	9 Sep 2005 12:59:45 -0000	1.3
+++ toolkit/inc/toolkit/helper/unopropertyarrayhelper.hxx	13 Jul 2007 17:43:52 -0000	1.3.246.1
@@ -40,6 +40,8 @@
 
 #include <tools/table.hxx>
 
+#include <list>
+
 //	----------------------------------------------------
 //	class UnoPropertyArrayHelper
 //	----------------------------------------------------
@@ -53,6 +55,7 @@ protected:
 
 public:
 				UnoPropertyArrayHelper( const ::com::sun::star::uno::Sequence<sal_Int32>& rIDs );
+				UnoPropertyArrayHelper( const std::list< sal_uInt16 > &rIDs );
 	
 	// ::cppu::IPropertyArrayHelper
 	sal_Bool SAL_CALL fillPropertyMembersByHandle( ::rtl::OUString * pPropName, sal_Int16 * pAttributes, sal_Int32 nHandle );
Index: toolkit/source/awt/vclxcontainer.cxx
===================================================================
RCS file: /cvs/gsl/toolkit/source/awt/vclxcontainer.cxx,v
retrieving revision 1.6
retrieving revision 1.6.118.1
diff -u -p -u -p -r1.6 -r1.6.118.1
--- toolkit/source/awt/vclxcontainer.cxx	16 Sep 2006 12:13:10 -0000	1.6
+++ toolkit/source/awt/vclxcontainer.cxx	13 Jul 2007 17:43:52 -0000	1.6.118.1
@@ -50,6 +50,12 @@
 //	----------------------------------------------------
 //	class VCLXContainer
 //	----------------------------------------------------
+
+void VCLXContainer::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
+{
+    VCLXWindow::ImplGetPropertyIds( rIds );
+}
+
 VCLXContainer::VCLXContainer()
 {
 }
Index: toolkit/source/awt/vclxtopwindow.cxx
===================================================================
RCS file: /cvs/gsl/toolkit/source/awt/vclxtopwindow.cxx,v
retrieving revision 1.9
retrieving revision 1.9.4.1
diff -u -p -u -p -r1.9 -r1.9.4.1
--- toolkit/source/awt/vclxtopwindow.cxx	5 Jul 2007 08:04:41 -0000	1.9
+++ toolkit/source/awt/vclxtopwindow.cxx	13 Jul 2007 17:43:52 -0000	1.9.4.1
@@ -67,6 +67,11 @@
 //	class VCLXTopWindow
 //	----------------------------------------------------
 
+void VCLXTopWindow::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
+{
+    VCLXContainer::ImplGetPropertyIds( rIds );
+}
+
 VCLXTopWindow::VCLXTopWindow(bool bWHWND)
     : m_bWHWND(bWHWND)
 {
Index: toolkit/source/awt/vclxwindow.cxx
===================================================================
RCS file: /cvs/gsl/toolkit/source/awt/vclxwindow.cxx,v
retrieving revision 1.77
retrieving revision 1.76.4.3
diff -u -p -u -p -r1.77 -r1.76.4.3
--- toolkit/source/awt/vclxwindow.cxx	2 Aug 2007 14:18:21 -0000	1.77
+++ toolkit/source/awt/vclxwindow.cxx	17 Aug 2007 14:31:57 -0000	1.76.4.3
@@ -137,6 +137,8 @@
 #include <toolkit/helper/solarrelease.hxx>
 #endif
 
+#include <toolkit/helper/unopropertyarrayhelper.hxx>
+
 using namespace ::com::sun::star;
 
 using ::com::sun::star::uno::Reference;
@@ -611,7 +613,7 @@ void ImplInitMouseEvent( awt::MouseEvent
 
 DBG_NAME(VCLXWindow);
 
-VCLXWindow::VCLXWindow()
+VCLXWindow::VCLXWindow( bool bWithDefaultProps )
 	: maEventListeners( *this ),
 	  maFocusListeners( *this ),
 	  maWindowListeners( *this ),
@@ -623,6 +625,11 @@ VCLXWindow::VCLXWindow()
 	  maTopWindowListeners( *this ),
       mnListenerLockLevel( 0 ),
       mpImpl( NULL ),
+	  mpPropHelper( NULL ),
+      mbDisposing( false ),
+      mbDesignMode( false ),
+      mbSynthesizingVCLEvent( false ),
+      mbWithDefaultProps( !!bWithDefaultProps ),
       mbDrawingOntoParent( false )
 {
 	DBG_CTOR( VCLXWindow, 0 );
@@ -639,6 +646,8 @@ VCLXWindow::~VCLXWindow()
 {
 	DBG_DTOR( VCLXWindow, 0 );
 
+    delete mpPropHelper;
+
 	if ( GetWindow() )
     {
         GetWindow()->RemoveEventListener( LINK( this, VCLXWindow, WindowEventListener ) );
@@ -1137,6 +1146,7 @@ Size VCLXWindow::ImplCalcWindowSize( con
 										SAL_STATIC_CAST( ::com::sun::star::awt::XView*, this ),
 										SAL_STATIC_CAST( ::com::sun::star::accessibility::XAccessible*, this ),
 										SAL_STATIC_CAST( ::com::sun::star::lang::XEventListener*, this ),
+										SAL_STATIC_CAST( ::com::sun::star::beans::XPropertySetInfo*, this ),
 										SAL_STATIC_CAST( ::com::sun::star::awt::XWindow2*, this ),
    										SAL_STATIC_CAST( ::com::sun::star::awt::XDockableWindow*, this ) );
 	return (aRet.hasValue() ? aRet : VCLXDevice::queryInterface( rType ));
@@ -1155,6 +1165,7 @@ IMPL_XTYPEPROVIDER_START( VCLXWindow )
 	getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XLayoutConstrains>* ) NULL ),
 	getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible>* ) NULL ),
 	getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener>* ) NULL ),
+	getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo>* ) NULL ),
 	getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XView>* ) NULL ),
 	getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDockableWindow>* ) NULL ),
 	VCLXDevice::getTypes()
@@ -1568,6 +1579,58 @@ namespace toolkit
     }
 }
 
+// Terminated by BASEPROPERTY_NOTFOUND (or 0)
+void VCLXWindow::PushPropertyIds( std::list< sal_uInt16 > &rIds,
+                                  int nFirstId, ...)
+{
+	va_list pVarArgs;
+	va_start( pVarArgs, nFirstId );
+
+	for ( int nId = nFirstId; nId != BASEPROPERTY_NOTFOUND;
+          nId = va_arg( pVarArgs, int ) )
+        rIds.push_back( nId );
+
+	va_end( pVarArgs );
+}
+
+void VCLXWindow::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds, bool bWithDefaults )
+{
+    // These are common across ~all VCLXWindow derived classes
+    if( bWithDefaults )
+        PushPropertyIds( rIds,
+                         BASEPROPERTY_ALIGN,
+                         BASEPROPERTY_BACKGROUNDCOLOR,
+                         BASEPROPERTY_BORDER,
+                         BASEPROPERTY_BORDERCOLOR,
+                         BASEPROPERTY_DEFAULTCONTROL,
+                         BASEPROPERTY_ENABLED,
+                         BASEPROPERTY_FONTDESCRIPTOR,
+                         BASEPROPERTY_HELPTEXT,
+                         BASEPROPERTY_HELPURL,
+                         BASEPROPERTY_TEXT,
+                         BASEPROPERTY_PRINTABLE,
+                         BASEPROPERTY_TABSTOP,
+                         0);
+
+    // lovely hack from:
+    // void UnoControlModel::ImplRegisterProperty( sal_uInt16 nPropId )
+    std::list< sal_uInt16 >::const_iterator iter;
+    for( iter = rIds.begin(); iter != rIds.end(); iter++) {
+        if( *iter == BASEPROPERTY_FONTDESCRIPTOR )
+        {
+            // some properties are not included in the FontDescriptor, but everytime
+            // when we have a FontDescriptor we want to have these properties too.
+            // => Easier to register the here, istead everywhere where I register the FontDescriptor...
+            
+            rIds.push_back( BASEPROPERTY_TEXTCOLOR );
+            rIds.push_back( BASEPROPERTY_TEXTLINECOLOR );
+            rIds.push_back( BASEPROPERTY_FONTRELIEF );
+            rIds.push_back( BASEPROPERTY_FONTEMPHASISMARK );
+            break;
+        }
+    }
+}
+
 void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
@@ -1995,6 +2058,12 @@ void VCLXWindow::setProperty( const ::rt
             case BASEPROPERTY_BORDERCOLOR:
                 ::toolkit::setColorSettings( pWindow, Value, &StyleSettings::SetMonoColor, &StyleSettings::GetMonoColor);
                 break;
+		    case BASEPROPERTY_DEFAULTCONTROL:
+			{
+			    rtl::OUString aName;
+				Value >>= aName;
+			    break;
+			}
 		}
 	}
 }
@@ -2611,3 +2680,34 @@ sal_Bool SAL_CALL VCLXWindow::hasFocus( 
         return FALSE;
 }
 
+// ::com::sun::star::beans::XPropertySetInfo
+
+UnoPropertyArrayHelper *
+VCLXWindow::GetPropHelper()
+{
+	::vos::OGuard aGuard( GetMutex() );
+    if (mpPropHelper == NULL)
+	{
+	    std::list< sal_uInt16 > aIDs;
+		GetPropertyIds( aIDs );
+		mpPropHelper = new UnoPropertyArrayHelper( aIDs );
+	}
+	return mpPropHelper;
+}
+
+::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL
+VCLXWindow::getProperties() throw (::com::sun::star::uno::RuntimeException)
+{
+    return GetPropHelper()->getProperties();
+}
+::com::sun::star::beans::Property SAL_CALL
+VCLXWindow::getPropertyByName( const ::rtl::OUString& rName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)
+{
+    return GetPropHelper()->getPropertyByName( rName );
+}
+
+::sal_Bool SAL_CALL
+VCLXWindow::hasPropertyByName( const ::rtl::OUString& rName ) throw (::com::sun::star::uno::RuntimeException)
+{
+    return GetPropHelper()->hasPropertyByName( rName );
+}
Index: toolkit/source/awt/vclxwindows.cxx
===================================================================
RCS file: /cvs/gsl/toolkit/source/awt/vclxwindows.cxx,v
retrieving revision 1.63
retrieving revision 1.63.8.1
diff -u -p -u -p -r1.63 -r1.63.8.1
--- toolkit/source/awt/vclxwindows.cxx	27 Jun 2007 15:15:51 -0000	1.63
+++ toolkit/source/awt/vclxwindows.cxx	13 Jul 2007 17:43:52 -0000	1.63.8.1
@@ -244,6 +244,12 @@ namespace toolkit
 //	----------------------------------------------------
 //	class VCLXImageConsumer
 //	----------------------------------------------------
+
+void VCLXImageConsumer::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
+{
+    VCLXWindow::ImplGetPropertyIds( rIds );
+}
+
 void VCLXImageConsumer::ImplSetNewImage()
 {
     OSL_PRECOND( GetWindow(), "VCLXImageConsumer::ImplSetNewImage: window is required to be not-NULL!" );
@@ -416,6 +422,37 @@ void VCLXImageConsumer::setProperty( con
 //--------------------------------------------------------------------
 //	class VCLXButton
 //	----------------------------------------------------
+
+void VCLXButton::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
+{
+    PushPropertyIds( rIds,
+                     BASEPROPERTY_BACKGROUNDCOLOR,
+                     BASEPROPERTY_DEFAULTBUTTON,
+                     BASEPROPERTY_DEFAULTCONTROL,
+                     BASEPROPERTY_ENABLED,
+                     BASEPROPERTY_FONTDESCRIPTOR,
+                     BASEPROPERTY_GRAPHIC,
+                     BASEPROPERTY_HELPTEXT,
+                     BASEPROPERTY_HELPURL,
+                     BASEPROPERTY_IMAGEALIGN,
+                     BASEPROPERTY_IMAGEPOSITION,
+                     BASEPROPERTY_IMAGEURL,
+                     BASEPROPERTY_LABEL,
+                     BASEPROPERTY_PRINTABLE,
+                     BASEPROPERTY_PUSHBUTTONTYPE,
+                     BASEPROPERTY_REPEAT,
+                     BASEPROPERTY_REPEAT_DELAY,
+                     BASEPROPERTY_STATE,
+                     BASEPROPERTY_TABSTOP,
+                     BASEPROPERTY_TOGGLE,
+                     BASEPROPERTY_FOCUSONCLICK,
+                     BASEPROPERTY_MULTILINE,
+                     BASEPROPERTY_ALIGN,
+                     BASEPROPERTY_VERTICALALIGN,
+                     0);
+    VCLXImageConsumer::ImplGetPropertyIds( rIds );
+}
+
 VCLXButton::VCLXButton()
     :maActionListeners( *this )
     ,maItemListeners( *this )
@@ -657,6 +694,26 @@ void VCLXButton::ProcessWindowEvent( con
 //	----------------------------------------------------
 //	class VCLXImageControl
 //	----------------------------------------------------
+
+void VCLXImageControl::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
+{
+    PushPropertyIds( rIds,
+                     BASEPROPERTY_BACKGROUNDCOLOR,
+                     BASEPROPERTY_BORDER,
+                     BASEPROPERTY_BORDERCOLOR,
+                     BASEPROPERTY_DEFAULTCONTROL,
+                     BASEPROPERTY_ENABLED,
+                     BASEPROPERTY_GRAPHIC,
+                     BASEPROPERTY_HELPTEXT,
+                     BASEPROPERTY_HELPURL,
+                     BASEPROPERTY_IMAGEURL,
+                     BASEPROPERTY_PRINTABLE,
+                     BASEPROPERTY_SCALEIMAGE,
+                     BASEPROPERTY_TABSTOP,
+                     0);
+    VCLXImageConsumer::ImplGetPropertyIds( rIds );
+}
+
 VCLXImageControl::VCLXImageControl()
 {
 }
@@ -749,6 +806,33 @@ void VCLXImageControl::setProperty( cons
 //	----------------------------------------------------
 //	class VCLXCheckBox
 //	----------------------------------------------------
+
+
+void VCLXCheckBox::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
+{
+    PushPropertyIds( rIds,
+                     BASEPROPERTY_DEFAULTCONTROL,
+                     BASEPROPERTY_ENABLED,
+                     BASEPROPERTY_FONTDESCRIPTOR,
+                     BASEPROPERTY_GRAPHIC,
+                     BASEPROPERTY_HELPTEXT,
+                     BASEPROPERTY_HELPURL,
+                     BASEPROPERTY_IMAGEPOSITION,
+                     BASEPROPERTY_IMAGEURL,
+                     BASEPROPERTY_LABEL,
+                     BASEPROPERTY_PRINTABLE,
+                     BASEPROPERTY_STATE,
+                     BASEPROPERTY_TABSTOP,
+                     BASEPROPERTY_TRISTATE,
+                     BASEPROPERTY_VISUALEFFECT,
+                     BASEPROPERTY_MULTILINE,
+                     BASEPROPERTY_BACKGROUNDCOLOR,
+                     BASEPROPERTY_ALIGN,
+                     BASEPROPERTY_VERTICALALIGN,
+                     0);
+    VCLXImageConsumer::ImplGetPropertyIds( rIds );
+}
+
 VCLXCheckBox::VCLXCheckBox() :  maActionListeners( *this ), maItemListeners( *this )
 {
 }
@@ -1021,6 +1105,31 @@ void VCLXCheckBox::ProcessWindowEvent( c
 //	----------------------------------------------------
 //	class VCLXRadioButton
 //	----------------------------------------------------
+void VCLXRadioButton::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
+{
+    PushPropertyIds( rIds,
+                     BASEPROPERTY_DEFAULTCONTROL,
+                     BASEPROPERTY_ENABLED,
+                     BASEPROPERTY_FONTDESCRIPTOR,
+                     BASEPROPERTY_GRAPHIC,
+                     BASEPROPERTY_HELPTEXT,
+                     BASEPROPERTY_HELPURL,
+                     BASEPROPERTY_IMAGEPOSITION,
+                     BASEPROPERTY_IMAGEURL,
+                     BASEPROPERTY_LABEL,
+                     BASEPROPERTY_PRINTABLE,
+                     BASEPROPERTY_STATE,
+                     BASEPROPERTY_TABSTOP,
+                     BASEPROPERTY_VISUALEFFECT,
+                     BASEPROPERTY_MULTILINE,
+                     BASEPROPERTY_BACKGROUNDCOLOR,
+                     BASEPROPERTY_ALIGN,
+                     BASEPROPERTY_VERTICALALIGN,
+                     0);
+    VCLXImageConsumer::ImplGetPropertyIds( rIds );
+}
+
+
 VCLXRadioButton::VCLXRadioButton() : maItemListeners( *this ), maActionListeners( *this )
 {
 }
@@ -1275,6 +1384,11 @@ void VCLXRadioButton::ImplClickedOrToggl
 //	----------------------------------------------------
 //	class VCLXSpinField
 //	----------------------------------------------------
+void VCLXSpinField::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
+{
+    VCLXEdit::ImplGetPropertyIds( rIds );
+}
+
 VCLXSpinField::VCLXSpinField() : maSpinListeners( *this )
 {
 }
@@ -1402,6 +1516,31 @@ void VCLXSpinField::ProcessWindowEvent( 
 //	----------------------------------------------------
 //	class VCLXListBox
 //	----------------------------------------------------
+void VCLXListBox::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
+{
+    PushPropertyIds( rIds,
+                     BASEPROPERTY_BACKGROUNDCOLOR,
+                     BASEPROPERTY_BORDER,
+                     BASEPROPERTY_BORDERCOLOR,
+                     BASEPROPERTY_DEFAULTCONTROL,
+                     BASEPROPERTY_DROPDOWN,
+                     BASEPROPERTY_ENABLED,
+                     BASEPROPERTY_FONTDESCRIPTOR,
+                     BASEPROPERTY_HELPTEXT,
+                     BASEPROPERTY_HELPURL,
+                     BASEPROPERTY_LINECOUNT,
+                     BASEPROPERTY_MULTISELECTION,
+                     BASEPROPERTY_PRINTABLE,
+                     BASEPROPERTY_SELECTEDITEMS,
+                     BASEPROPERTY_STRINGITEMLIST,
+                     BASEPROPERTY_TABSTOP,
+                     BASEPROPERTY_READONLY,
+                     BASEPROPERTY_ALIGN,
+                     0);
+    VCLXWindow::ImplGetPropertyIds( rIds );
+}
+
+
 VCLXListBox::VCLXListBox()
 	: maActionListeners( *this ),
 	  maItemListeners( *this )
@@ -1958,6 +2097,12 @@ void VCLXListBox::ImplCallItemListeners(
 //	----------------------------------------------------
 //	class VCLXMessageBox
 //	----------------------------------------------------
+
+void VCLXMessageBox::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
+{
+    VCLXTopWindow::ImplGetPropertyIds( rIds );
+}
+
 VCLXMessageBox::VCLXMessageBox()
 {
 }
@@ -2033,6 +2178,11 @@ sal_Int16 VCLXMessageBox::execute() thro
 //	----------------------------------------------------
 //	class VCLXDialog
 //	----------------------------------------------------
+void VCLXDialog::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
+{
+    VCLXTopWindow::ImplGetPropertyIds( rIds );
+}
+
 VCLXDialog::VCLXDialog()
 {
 }
@@ -2143,6 +2293,27 @@ void SAL_CALL VCLXDialog::draw( sal_Int3
 //	----------------------------------------------------
 //	class VCLXFixedText
 //	----------------------------------------------------
+void VCLXFixedText::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
+{
+    PushPropertyIds( rIds,
+                     BASEPROPERTY_ALIGN,
+                     BASEPROPERTY_BACKGROUNDCOLOR,
+                     BASEPROPERTY_BORDER,
+                     BASEPROPERTY_BORDERCOLOR,
+                     BASEPROPERTY_DEFAULTCONTROL,
+                     BASEPROPERTY_ENABLED,
+                     BASEPROPERTY_FONTDESCRIPTOR,
+                     BASEPROPERTY_HELPTEXT,
+                     BASEPROPERTY_HELPURL,
+                     BASEPROPERTY_LABEL,
+                     BASEPROPERTY_MULTILINE,
+                     BASEPROPERTY_PRINTABLE,
+                     BASEPROPERTY_TABSTOP,
+                     BASEPROPERTY_VERTICALALIGN,
+                     0);
+    VCLXWindow::ImplGetPropertyIds( rIds );
+}
+
 VCLXFixedText::VCLXFixedText()
 {
 }
@@ -2261,6 +2432,32 @@ short VCLXFixedText::getAlignment() thro
 //	----------------------------------------------------
 //	class VCLXScrollBar
 //	----------------------------------------------------
+void VCLXScrollBar::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
+{
+    PushPropertyIds( rIds,
+                     BASEPROPERTY_BACKGROUNDCOLOR,
+                     BASEPROPERTY_BLOCKINCREMENT,
+                     BASEPROPERTY_BORDER,
+                     BASEPROPERTY_BORDERCOLOR,
+                     BASEPROPERTY_DEFAULTCONTROL,
+                     BASEPROPERTY_ENABLED,
+                     BASEPROPERTY_HELPTEXT,
+                     BASEPROPERTY_HELPURL,
+                     BASEPROPERTY_LINEINCREMENT,
+                     BASEPROPERTY_LIVE_SCROLL,
+                     BASEPROPERTY_ORIENTATION,
+                     BASEPROPERTY_PRINTABLE,
+                     BASEPROPERTY_REPEAT_DELAY,
+                     BASEPROPERTY_SCROLLVALUE,
+                     BASEPROPERTY_SCROLLVALUE_MAX,
+                     BASEPROPERTY_SCROLLVALUE_MIN,
+                     BASEPROPERTY_SYMBOL_COLOR,
+                     BASEPROPERTY_TABSTOP,
+                     BASEPROPERTY_VISIBLESIZE,
+                     0);
+    VCLXWindow::ImplGetPropertyIds( rIds );
+}
+
 VCLXScrollBar::VCLXScrollBar() : maAdjustmentListeners( *this )
 {
 }
@@ -2698,6 +2895,34 @@ void VCLXScrollBar::ProcessWindowEvent( 
 //	class VCLXEdit
 //	----------------------------------------------------
 
+void VCLXEdit::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
+{
+    PushPropertyIds( rIds,
+                     BASEPROPERTY_ALIGN, 
+                     BASEPROPERTY_BACKGROUNDCOLOR, 
+                     BASEPROPERTY_BORDER, 
+                     BASEPROPERTY_BORDERCOLOR, 
+                     BASEPROPERTY_DEFAULTCONTROL, 
+                     BASEPROPERTY_ECHOCHAR, 
+                     BASEPROPERTY_ENABLED, 
+                     BASEPROPERTY_FONTDESCRIPTOR, 
+                     BASEPROPERTY_HARDLINEBREAKS, 
+                     BASEPROPERTY_HELPTEXT, 
+                     BASEPROPERTY_HELPURL, 
+                     BASEPROPERTY_HSCROLL, 
+                     BASEPROPERTY_LINE_END_FORMAT, 
+                     BASEPROPERTY_MAXTEXTLEN, 
+                     BASEPROPERTY_MULTILINE, 
+                     BASEPROPERTY_PRINTABLE, 
+                     BASEPROPERTY_READONLY, 
+                     BASEPROPERTY_TABSTOP, 
+                     BASEPROPERTY_TEXT, 
+                     BASEPROPERTY_VSCROLL, 
+                     BASEPROPERTY_HIDEINACTIVESELECTION,
+                     0);
+    VCLXWindow::ImplGetPropertyIds( rIds );
+}
+
 VCLXEdit::VCLXEdit() : maTextListeners( *this )
 {
 }
@@ -3040,6 +3265,33 @@ void VCLXEdit::ProcessWindowEvent( const
 //	----------------------------------------------------
 //	class VCLXComboBox
 //	----------------------------------------------------
+
+void VCLXComboBox::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
+{
+    PushPropertyIds( rIds,
+                     BASEPROPERTY_AUTOCOMPLETE,
+                     BASEPROPERTY_BACKGROUNDCOLOR,
+                     BASEPROPERTY_BORDER,
+                     BASEPROPERTY_BORDERCOLOR,
+                     BASEPROPERTY_DEFAULTCONTROL,
+                     BASEPROPERTY_DROPDOWN,
+                     BASEPROPERTY_ENABLED,
+                     BASEPROPERTY_FONTDESCRIPTOR,
+                     BASEPROPERTY_HELPTEXT,
+                     BASEPROPERTY_HELPURL,
+                     BASEPROPERTY_LINECOUNT,
+                     BASEPROPERTY_MAXTEXTLEN,
+                     BASEPROPERTY_PRINTABLE,
+                     BASEPROPERTY_READONLY,
+                     BASEPROPERTY_STRINGITEMLIST,
+                     BASEPROPERTY_TABSTOP,
+                     BASEPROPERTY_TEXT,
+                     BASEPROPERTY_HIDEINACTIVESELECTION,
+                     BASEPROPERTY_ALIGN,
+                     0);
+    VCLXEdit::ImplGetPropertyIds( rIds );
+}
+
 VCLXComboBox::VCLXComboBox()
 	: maActionListeners( *this ), maItemListeners( *this )
 {
@@ -3408,6 +3660,14 @@ void VCLXComboBox::getColumnsAndLines( s
 //	----------------------------------------------------
 //	class VCLXFormattedSpinField
 //	----------------------------------------------------
+void VCLXFormattedSpinField::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
+{
+    // Interestingly in the UnoControl API this is
+    // - not derived from XEdit ultimately, (correct ?) - so cut this here ...
+//    VCLXSpinField::ImplGetPropertyIds( rIds );
+    VCLXWindow::ImplGetPropertyIds( rIds );
+}
+
 VCLXFormattedSpinField::VCLXFormattedSpinField()
 {
 }
@@ -3505,6 +3765,38 @@ void VCLXFormattedSpinField::setProperty
 //	----------------------------------------------------
 //	class VCLXDateField
 //	----------------------------------------------------
+
+void VCLXDateField::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
+{
+    PushPropertyIds( rIds,
+                     BASEPROPERTY_BACKGROUNDCOLOR,
+                     BASEPROPERTY_BORDER,
+                     BASEPROPERTY_BORDERCOLOR,
+                     BASEPROPERTY_DATE,
+                     BASEPROPERTY_DATEMAX,
+                     BASEPROPERTY_DATEMIN,
+                     BASEPROPERTY_DATESHOWCENTURY,
+                     BASEPROPERTY_DEFAULTCONTROL,
+                     BASEPROPERTY_DROPDOWN,
+                     BASEPROPERTY_ENABLED,
+                     BASEPROPERTY_EXTDATEFORMAT,
+                     BASEPROPERTY_FONTDESCRIPTOR,
+                     BASEPROPERTY_HELPTEXT,
+                     BASEPROPERTY_HELPURL,
+                     BASEPROPERTY_PRINTABLE,
+                     BASEPROPERTY_READONLY,
+                     BASEPROPERTY_REPEAT,
+                     BASEPROPERTY_REPEAT_DELAY,
+                     BASEPROPERTY_SPIN,
+                     BASEPROPERTY_STRICTFORMAT,
+                     BASEPROPERTY_TABSTOP,
+                     BASEPROPERTY_ENFORCE_FORMAT,
+                     BASEPROPERTY_TEXT,
+                     BASEPROPERTY_HIDEINACTIVESELECTION,
+                     0);
+    VCLXFormattedSpinField::ImplGetPropertyIds( rIds );
+}
+
 VCLXDateField::VCLXDateField()
 {
 }
@@ -3811,6 +4103,36 @@ sal_Bool VCLXDateField::isStrictFormat()
 //	----------------------------------------------------
 //	class VCLXTimeField
 //	----------------------------------------------------
+
+void VCLXTimeField::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
+{
+    PushPropertyIds( rIds,
+                     BASEPROPERTY_BACKGROUNDCOLOR,
+                     BASEPROPERTY_BORDER,
+                     BASEPROPERTY_BORDERCOLOR,
+                     BASEPROPERTY_DEFAULTCONTROL,
+                     BASEPROPERTY_ENABLED,
+                     BASEPROPERTY_EXTTIMEFORMAT,
+                     BASEPROPERTY_FONTDESCRIPTOR,
+                     BASEPROPERTY_HELPTEXT,
+                     BASEPROPERTY_HELPURL,
+                     BASEPROPERTY_PRINTABLE,
+                     BASEPROPERTY_READONLY,
+                     BASEPROPERTY_REPEAT,
+                     BASEPROPERTY_REPEAT_DELAY,
+                     BASEPROPERTY_SPIN,
+                     BASEPROPERTY_STRICTFORMAT,
+                     BASEPROPERTY_TABSTOP,
+                     BASEPROPERTY_TIME,
+                     BASEPROPERTY_TIMEMAX,
+                     BASEPROPERTY_TIMEMIN,
+                     BASEPROPERTY_ENFORCE_FORMAT,
+                     BASEPROPERTY_TEXT,
+                     BASEPROPERTY_HIDEINACTIVESELECTION,
+                     0);
+    VCLXFormattedSpinField::ImplGetPropertyIds( rIds );
+}
+
 VCLXTimeField::VCLXTimeField()
 {
 }
@@ -4078,6 +4400,37 @@ void VCLXTimeField::setProperty( const :
 //	----------------------------------------------------
 //	class VCLXNumericField
 //	----------------------------------------------------
+
+void VCLXNumericField::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
+{
+    PushPropertyIds( rIds,
+                     BASEPROPERTY_BACKGROUNDCOLOR,
+                     BASEPROPERTY_BORDER,
+                     BASEPROPERTY_BORDERCOLOR,
+                     BASEPROPERTY_DECIMALACCURACY,
+                     BASEPROPERTY_DEFAULTCONTROL,
+                     BASEPROPERTY_ENABLED,
+                     BASEPROPERTY_FONTDESCRIPTOR,
+                     BASEPROPERTY_HELPTEXT,
+                     BASEPROPERTY_HELPURL,
+                     BASEPROPERTY_NUMSHOWTHOUSANDSEP,
+                     BASEPROPERTY_PRINTABLE,
+                     BASEPROPERTY_READONLY,
+                     BASEPROPERTY_REPEAT,
+                     BASEPROPERTY_REPEAT_DELAY,
+                     BASEPROPERTY_SPIN,
+                     BASEPROPERTY_STRICTFORMAT,
+                     BASEPROPERTY_TABSTOP,
+                     BASEPROPERTY_VALUEMAX_DOUBLE,
+                     BASEPROPERTY_VALUEMIN_DOUBLE,
+                     BASEPROPERTY_VALUESTEP_DOUBLE,
+                     BASEPROPERTY_VALUE_DOUBLE,
+                     BASEPROPERTY_ENFORCE_FORMAT,
+                     BASEPROPERTY_HIDEINACTIVESELECTION,
+                     0);
+    VCLXFormattedSpinField::ImplGetPropertyIds( rIds );
+}
+
 VCLXNumericField::VCLXNumericField()
 {
 }
@@ -4384,6 +4737,39 @@ void VCLXNumericField::setProperty( cons
 //	----------------------------------------------------
 //	class VCLXCurrencyField
 //	----------------------------------------------------
+
+void VCLXCurrencyField::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
+{
+    PushPropertyIds( rIds,
+                     BASEPROPERTY_BACKGROUNDCOLOR,
+                     BASEPROPERTY_BORDER,
+                     BASEPROPERTY_BORDERCOLOR,
+                     BASEPROPERTY_CURRENCYSYMBOL,
+                     BASEPROPERTY_CURSYM_POSITION,
+                     BASEPROPERTY_DECIMALACCURACY,
+                     BASEPROPERTY_DEFAULTCONTROL,
+                     BASEPROPERTY_ENABLED,
+                     BASEPROPERTY_FONTDESCRIPTOR,
+                     BASEPROPERTY_HELPTEXT,
+                     BASEPROPERTY_HELPURL,
+                     BASEPROPERTY_NUMSHOWTHOUSANDSEP,
+                     BASEPROPERTY_PRINTABLE,
+                     BASEPROPERTY_READONLY,
+                     BASEPROPERTY_REPEAT,
+                     BASEPROPERTY_REPEAT_DELAY,
+                     BASEPROPERTY_SPIN,
+                     BASEPROPERTY_STRICTFORMAT,
+                     BASEPROPERTY_TABSTOP,
+                     BASEPROPERTY_VALUEMAX_DOUBLE,
+                     BASEPROPERTY_VALUEMIN_DOUBLE,
+                     BASEPROPERTY_VALUESTEP_DOUBLE,
+                     BASEPROPERTY_VALUE_DOUBLE,
+                     BASEPROPERTY_ENFORCE_FORMAT,
+                     BASEPROPERTY_HIDEINACTIVESELECTION,
+                     0);
+    VCLXFormattedSpinField::ImplGetPropertyIds( rIds );
+}
+
 VCLXCurrencyField::VCLXCurrencyField()
 {
 }
@@ -4701,6 +5087,31 @@ void VCLXCurrencyField::setProperty( con
 //	----------------------------------------------------
 //	class VCLXPatternField
 //	----------------------------------------------------
+
+void VCLXPatternField::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
+{
+    PushPropertyIds( rIds,
+                     BASEPROPERTY_BACKGROUNDCOLOR,
+                     BASEPROPERTY_BORDER,
+                     BASEPROPERTY_BORDERCOLOR,
+                     BASEPROPERTY_DEFAULTCONTROL,
+                     BASEPROPERTY_EDITMASK,
+                     BASEPROPERTY_ENABLED,
+                     BASEPROPERTY_FONTDESCRIPTOR,
+                     BASEPROPERTY_HELPTEXT,
+                     BASEPROPERTY_HELPURL,
+                     BASEPROPERTY_LITERALMASK,
+                     BASEPROPERTY_MAXTEXTLEN,
+                     BASEPROPERTY_PRINTABLE,
+                     BASEPROPERTY_READONLY,
+                     BASEPROPERTY_STRICTFORMAT,
+                     BASEPROPERTY_TABSTOP,
+                     BASEPROPERTY_TEXT,
+                     BASEPROPERTY_HIDEINACTIVESELECTION,
+                     0);
+    VCLXFormattedSpinField::ImplGetPropertyIds( rIds );
+}
+
 VCLXPatternField::VCLXPatternField()
 {
 }
Index: toolkit/source/controls/tkscrollbar.cxx
===================================================================
RCS file: /cvs/gsl/toolkit/source/controls/tkscrollbar.cxx,v
retrieving revision 1.7
retrieving revision 1.7.118.1
diff -u -p -u -p -r1.7 -r1.7.118.1
--- toolkit/source/controls/tkscrollbar.cxx	16 Sep 2006 12:18:48 -0000	1.7
+++ toolkit/source/controls/tkscrollbar.cxx	13 Jul 2007 17:43:52 -0000	1.7.118.1
@@ -53,6 +53,9 @@
 #include <tools/debug.hxx>
 #endif
 
+// for introspection
+#include <toolkit/awt/vclxwindows.hxx>
+
 //........................................................................
 namespace toolkit
 {
@@ -66,25 +69,7 @@ namespace toolkit
 	//--------------------------------------------------------------------
     UnoControlScrollBarModel::UnoControlScrollBarModel()
     {
-	    ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
-	    ImplRegisterProperty( BASEPROPERTY_BLOCKINCREMENT );
-        ImplRegisterProperty( BASEPROPERTY_BORDER );
-		ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR );
-        ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
-	    ImplRegisterProperty( BASEPROPERTY_ENABLED );
-        ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
-	    ImplRegisterProperty( BASEPROPERTY_HELPURL );
-	    ImplRegisterProperty( BASEPROPERTY_LINEINCREMENT );
-	    ImplRegisterProperty( BASEPROPERTY_LIVE_SCROLL );
-        ImplRegisterProperty( BASEPROPERTY_ORIENTATION );
-        ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
-        ImplRegisterProperty( BASEPROPERTY_REPEAT_DELAY );
-        ImplRegisterProperty( BASEPROPERTY_SCROLLVALUE );
-        ImplRegisterProperty( BASEPROPERTY_SCROLLVALUE_MAX );
-        ImplRegisterProperty( BASEPROPERTY_SCROLLVALUE_MIN );
-        ImplRegisterProperty( BASEPROPERTY_SYMBOL_COLOR );
-        ImplRegisterProperty( BASEPROPERTY_TABSTOP );
-        ImplRegisterProperty( BASEPROPERTY_VISIBLESIZE );
+        UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXScrollBar );
     }
 
 	//--------------------------------------------------------------------
Index: toolkit/source/controls/unocontrolmodel.cxx
===================================================================
RCS file: /cvs/gsl/toolkit/source/controls/unocontrolmodel.cxx,v
retrieving revision 1.57
retrieving revision 1.56.2.2
diff -u -p -u -p -r1.57 -r1.56.2.2
--- toolkit/source/controls/unocontrolmodel.cxx	31 Jul 2007 16:01:16 -0000	1.57
+++ toolkit/source/controls/unocontrolmodel.cxx	17 Aug 2007 14:32:04 -0000	1.56.2.2
@@ -526,6 +526,15 @@ void UnoControlModel::ImplRegisterProper
     }
 }
 
+void UnoControlModel::ImplRegisterProperties( const std::list< sal_uInt16 > &rIds )
+{
+    std::list< sal_uInt16 >::const_iterator iter;
+    for( iter = rIds.begin(); iter != rIds.end(); iter++) {
+        if( !ImplHasProperty( *iter ) )
+            ImplRegisterProperty( *iter, ImplGetDefaultValue( *iter ) );
+    }
+}
+
 // ::com::sun::star::uno::XInterface
 ::com::sun::star::uno::Any UnoControlModel::queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
 {
Index: toolkit/source/controls/unocontrols.cxx
===================================================================
RCS file: /cvs/gsl/toolkit/source/controls/unocontrols.cxx,v
retrieving revision 1.82
retrieving revision 1.81.4.2
diff -u -p -u -p -r1.82 -r1.81.4.2
--- toolkit/source/controls/unocontrols.cxx	18 Jul 2007 08:43:55 -0000	1.82
+++ toolkit/source/controls/unocontrols.cxx	16 Aug 2007 15:59:29 -0000	1.81.4.2
@@ -96,6 +96,9 @@
 #include <toolkit/helper/imagealign.hxx>
 #endif
 
+// for introspection
+#include <toolkit/awt/vclxwindows.hxx>
+
 #ifndef _CPPUHELPER_TYPEPROVIDER_HXX_
 #include <cppuhelper/typeprovider.hxx>
 #endif
@@ -186,30 +189,7 @@ static void lcl_knitImageComponents( con
 //	----------------------------------------------------
 UnoControlEditModel::UnoControlEditModel()
 {
-	ImplRegisterProperty( BASEPROPERTY_ALIGN );
-	ImplRegisterProperty( BASEPROPERTY_AUTOHSCROLL );
-	ImplRegisterProperty( BASEPROPERTY_AUTOVSCROLL );
-	ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
-	ImplRegisterProperty( BASEPROPERTY_BORDER );
-	ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR );
-	ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
-	ImplRegisterProperty( BASEPROPERTY_ECHOCHAR );
-	ImplRegisterProperty( BASEPROPERTY_ENABLED );
-	ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
-	ImplRegisterProperty( BASEPROPERTY_HARDLINEBREAKS );
-	ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
-	ImplRegisterProperty( BASEPROPERTY_HELPURL );
-	ImplRegisterProperty( BASEPROPERTY_HSCROLL );
-	ImplRegisterProperty( BASEPROPERTY_LINE_END_FORMAT );
-	ImplRegisterProperty( BASEPROPERTY_MAXTEXTLEN );
-	ImplRegisterProperty( BASEPROPERTY_MULTILINE );
-	ImplRegisterProperty( BASEPROPERTY_PAINTTRANSPARENT );
-	ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
-	ImplRegisterProperty( BASEPROPERTY_READONLY );
-	ImplRegisterProperty( BASEPROPERTY_TABSTOP );
-	ImplRegisterProperty( BASEPROPERTY_TEXT );
-	ImplRegisterProperty( BASEPROPERTY_VSCROLL );
-	ImplRegisterProperty( BASEPROPERTY_HIDEINACTIVESELECTION );
+    UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXEdit );
 }
 
 ::rtl::OUString UnoControlEditModel::getServiceName( ) throw(::com::sun::star::uno::RuntimeException)
@@ -848,29 +828,7 @@ void ImageConsumerControl::ImplSetPeerPr
 //	----------------------------------------------------
 UnoControlButtonModel::UnoControlButtonModel()
 {
-	ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
-	ImplRegisterProperty( BASEPROPERTY_DEFAULTBUTTON );
-	ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
-	ImplRegisterProperty( BASEPROPERTY_ENABLED );
-	ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
-	ImplRegisterProperty( BASEPROPERTY_GRAPHIC );
-	ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
-	ImplRegisterProperty( BASEPROPERTY_HELPURL );
-	ImplRegisterProperty( BASEPROPERTY_IMAGEALIGN );
-	ImplRegisterProperty( BASEPROPERTY_IMAGEPOSITION );
-	ImplRegisterProperty( BASEPROPERTY_IMAGEURL );
-	ImplRegisterProperty( BASEPROPERTY_LABEL );
-	ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
-	ImplRegisterProperty( BASEPROPERTY_PUSHBUTTONTYPE );
-	ImplRegisterProperty( BASEPROPERTY_REPEAT );
-	ImplRegisterProperty( BASEPROPERTY_REPEAT_DELAY );
-	ImplRegisterProperty( BASEPROPERTY_STATE );
-	ImplRegisterProperty( BASEPROPERTY_TABSTOP );
-	ImplRegisterProperty( BASEPROPERTY_TOGGLE );
-    ImplRegisterProperty( BASEPROPERTY_FOCUSONCLICK );
-	ImplRegisterProperty( BASEPROPERTY_MULTILINE );
-	ImplRegisterProperty( BASEPROPERTY_ALIGN );
-	ImplRegisterProperty( BASEPROPERTY_VERTICALALIGN );
+    UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXButton );
 
     osl_incrementInterlockedCount( &m_refCount );
     {
@@ -1065,18 +1023,7 @@ awt::Size UnoButtonControl::calcAdjusted
 //	----------------------------------------------------
 UnoControlImageControlModel::UnoControlImageControlModel()
 {
-	ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
-	ImplRegisterProperty( BASEPROPERTY_BORDER );
-	ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR );
-	ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
-	ImplRegisterProperty( BASEPROPERTY_ENABLED );
-	ImplRegisterProperty( BASEPROPERTY_GRAPHIC );
-	ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
-	ImplRegisterProperty( BASEPROPERTY_HELPURL );
-	ImplRegisterProperty( BASEPROPERTY_IMAGEURL );
-	ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
-	ImplRegisterProperty( BASEPROPERTY_SCALEIMAGE );
-	ImplRegisterProperty( BASEPROPERTY_TABSTOP );
+    UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXImageControl );
 }
 
 ::rtl::OUString UnoControlImageControlModel::getServiceName() throw(::com::sun::star::uno::RuntimeException)
@@ -1159,23 +1106,7 @@ awt::Size UnoImageControlControl::calcAd
 //	----------------------------------------------------
 UnoControlRadioButtonModel::UnoControlRadioButtonModel()
 {
-	ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
-	ImplRegisterProperty( BASEPROPERTY_ENABLED );
-	ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
-	ImplRegisterProperty( BASEPROPERTY_GRAPHIC );
-	ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
-	ImplRegisterProperty( BASEPROPERTY_HELPURL );
-	ImplRegisterProperty( BASEPROPERTY_IMAGEPOSITION );
-	ImplRegisterProperty( BASEPROPERTY_IMAGEURL );
-	ImplRegisterProperty( BASEPROPERTY_LABEL );
-	ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
-	ImplRegisterProperty( BASEPROPERTY_STATE );
-	ImplRegisterProperty( BASEPROPERTY_TABSTOP );
-    ImplRegisterProperty( BASEPROPERTY_VISUALEFFECT );
-	ImplRegisterProperty( BASEPROPERTY_MULTILINE );
-	ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
-	ImplRegisterProperty( BASEPROPERTY_ALIGN );
-	ImplRegisterProperty( BASEPROPERTY_VERTICALALIGN );
+    UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXRadioButton );
 }
 
 ::rtl::OUString UnoControlRadioButtonModel::getServiceName() throw(::com::sun::star::uno::RuntimeException)
@@ -1382,24 +1313,7 @@ awt::Size UnoRadioButtonControl::calcAdj
 //	----------------------------------------------------
 UnoControlCheckBoxModel::UnoControlCheckBoxModel()
 {
-	ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
-	ImplRegisterProperty( BASEPROPERTY_ENABLED );
-	ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
-	ImplRegisterProperty( BASEPROPERTY_GRAPHIC );
-	ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
-	ImplRegisterProperty( BASEPROPERTY_HELPURL );
-	ImplRegisterProperty( BASEPROPERTY_IMAGEPOSITION );
-	ImplRegisterProperty( BASEPROPERTY_IMAGEURL );
-	ImplRegisterProperty( BASEPROPERTY_LABEL );
-	ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
-	ImplRegisterProperty( BASEPROPERTY_STATE );
-	ImplRegisterProperty( BASEPROPERTY_TABSTOP );
-	ImplRegisterProperty( BASEPROPERTY_TRISTATE );
-    ImplRegisterProperty( BASEPROPERTY_VISUALEFFECT );
-	ImplRegisterProperty( BASEPROPERTY_MULTILINE );
-	ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
-	ImplRegisterProperty( BASEPROPERTY_ALIGN );
-	ImplRegisterProperty( BASEPROPERTY_VERTICALALIGN );
+    UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXCheckBox );
 }
 
 ::rtl::OUString UnoControlCheckBoxModel::getServiceName() throw(::com::sun::star::uno::RuntimeException)
@@ -1582,20 +1496,7 @@ awt::Size UnoCheckBoxControl::calcAdjust
 //	----------------------------------------------------
 UnoControlFixedTextModel::UnoControlFixedTextModel()
 {
-	ImplRegisterProperty( BASEPROPERTY_ALIGN );
-	ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
-	ImplRegisterProperty( BASEPROPERTY_BORDER );
-	ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR );
-	ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
-	ImplRegisterProperty( BASEPROPERTY_ENABLED );
-	ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
-	ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
-	ImplRegisterProperty( BASEPROPERTY_HELPURL );
-	ImplRegisterProperty( BASEPROPERTY_LABEL );
-	ImplRegisterProperty( BASEPROPERTY_MULTILINE );
-	ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
-	ImplRegisterProperty( BASEPROPERTY_TABSTOP );
-	ImplRegisterProperty( BASEPROPERTY_VERTICALALIGN );
+    UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXFixedText );
 }
 
 ::rtl::OUString UnoControlFixedTextModel::getServiceName() throw(::com::sun::star::uno::RuntimeException)
@@ -1792,23 +1693,7 @@ sal_Bool UnoGroupBoxControl::isTranspare
 //	----------------------------------------------------
 UnoControlListBoxModel::UnoControlListBoxModel()
 {
-	ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
-	ImplRegisterProperty( BASEPROPERTY_BORDER );
-	ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR );
-	ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
-	ImplRegisterProperty( BASEPROPERTY_DROPDOWN );
-	ImplRegisterProperty( BASEPROPERTY_ENABLED );
-	ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
-	ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
-	ImplRegisterProperty( BASEPROPERTY_HELPURL );
-	ImplRegisterProperty( BASEPROPERTY_LINECOUNT );
-	ImplRegisterProperty( BASEPROPERTY_MULTISELECTION );
-	ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
-	ImplRegisterProperty( BASEPROPERTY_SELECTEDITEMS );
-	ImplRegisterProperty( BASEPROPERTY_STRINGITEMLIST );
-	ImplRegisterProperty( BASEPROPERTY_TABSTOP );
-	ImplRegisterProperty( BASEPROPERTY_READONLY );
-	ImplRegisterProperty( BASEPROPERTY_ALIGN );
+    UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXListBox );
 }
 
 ::rtl::OUString UnoControlListBoxModel::getServiceName() throw(::com::sun::star::uno::RuntimeException)
@@ -2248,25 +2133,7 @@ void UnoListBoxControl::getColumnsAndLin
 //	----------------------------------------------------
 UnoControlComboBoxModel::UnoControlComboBoxModel()
 {
-	ImplRegisterProperty( BASEPROPERTY_AUTOCOMPLETE );
-	ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
-	ImplRegisterProperty( BASEPROPERTY_BORDER );
-	ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR );
-	ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
-	ImplRegisterProperty( BASEPROPERTY_DROPDOWN );
-	ImplRegisterProperty( BASEPROPERTY_ENABLED );
-	ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
-	ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
-	ImplRegisterProperty( BASEPROPERTY_HELPURL );
-	ImplRegisterProperty( BASEPROPERTY_LINECOUNT );
-	ImplRegisterProperty( BASEPROPERTY_MAXTEXTLEN );
-	ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
-	ImplRegisterProperty( BASEPROPERTY_READONLY );
-	ImplRegisterProperty( BASEPROPERTY_STRINGITEMLIST );
-	ImplRegisterProperty( BASEPROPERTY_TABSTOP );
-	ImplRegisterProperty( BASEPROPERTY_TEXT );
-	ImplRegisterProperty( BASEPROPERTY_HIDEINACTIVESELECTION );
-	ImplRegisterProperty( BASEPROPERTY_ALIGN );
+    UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXComboBox );
 }
 
 ::rtl::OUString UnoControlComboBoxModel::getServiceName() throw(::com::sun::star::uno::RuntimeException)
@@ -2604,30 +2471,7 @@ void UnoSpinFieldControl::enableRepeat( 
 //	----------------------------------------------------
 UnoControlDateFieldModel::UnoControlDateFieldModel()
 {
-	ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
-	ImplRegisterProperty( BASEPROPERTY_BORDER );
-	ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR );
-	ImplRegisterProperty( BASEPROPERTY_DATE );
-	ImplRegisterProperty( BASEPROPERTY_DATEMAX );
-	ImplRegisterProperty( BASEPROPERTY_DATEMIN );
-	ImplRegisterProperty( BASEPROPERTY_DATESHOWCENTURY );
-	ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
-	ImplRegisterProperty( BASEPROPERTY_DROPDOWN );
-	ImplRegisterProperty( BASEPROPERTY_ENABLED );
-	ImplRegisterProperty( BASEPROPERTY_EXTDATEFORMAT );
-	ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
-	ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
-	ImplRegisterProperty( BASEPROPERTY_HELPURL );
-	ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
-	ImplRegisterProperty( BASEPROPERTY_READONLY );
-	ImplRegisterProperty( BASEPROPERTY_REPEAT );
-	ImplRegisterProperty( BASEPROPERTY_REPEAT_DELAY );
-	ImplRegisterProperty( BASEPROPERTY_SPIN );
-	ImplRegisterProperty( BASEPROPERTY_STRICTFORMAT );
-	ImplRegisterProperty( BASEPROPERTY_TABSTOP );
-	ImplRegisterProperty( BASEPROPERTY_ENFORCE_FORMAT );
-	ImplRegisterProperty( BASEPROPERTY_TEXT );
-	ImplRegisterProperty( BASEPROPERTY_HIDEINACTIVESELECTION );
+    UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXDateField );
 }
 
 ::rtl::OUString UnoControlDateFieldModel::getServiceName() throw(::com::sun::star::uno::RuntimeException)
@@ -2867,28 +2711,7 @@ sal_Bool UnoDateFieldControl::isStrictFo
 //	----------------------------------------------------
 UnoControlTimeFieldModel::UnoControlTimeFieldModel()
 {
-	ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
-	ImplRegisterProperty( BASEPROPERTY_BORDER );
-	ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR );
-	ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
-	ImplRegisterProperty( BASEPROPERTY_ENABLED);
-	ImplRegisterProperty( BASEPROPERTY_EXTTIMEFORMAT );
-	ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
-	ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
-	ImplRegisterProperty( BASEPROPERTY_HELPURL );
-	ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
-	ImplRegisterProperty( BASEPROPERTY_READONLY );
-	ImplRegisterProperty( BASEPROPERTY_REPEAT );
-	ImplRegisterProperty( BASEPROPERTY_REPEAT_DELAY );
-	ImplRegisterProperty( BASEPROPERTY_SPIN );
-	ImplRegisterProperty( BASEPROPERTY_STRICTFORMAT );
-	ImplRegisterProperty( BASEPROPERTY_TABSTOP );
-	ImplRegisterProperty( BASEPROPERTY_TIME );
-	ImplRegisterProperty( BASEPROPERTY_TIMEMAX );
-	ImplRegisterProperty( BASEPROPERTY_TIMEMIN );
-    ImplRegisterProperty( BASEPROPERTY_ENFORCE_FORMAT );
-    ImplRegisterProperty( BASEPROPERTY_TEXT );
-	ImplRegisterProperty( BASEPROPERTY_HIDEINACTIVESELECTION );
+    UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXTimeField );
 }
 
 ::rtl::OUString UnoControlTimeFieldModel::getServiceName() throw(::com::sun::star::uno::RuntimeException)
@@ -3087,29 +2910,7 @@ sal_Bool UnoTimeFieldControl::isStrictFo
 //	----------------------------------------------------
 UnoControlNumericFieldModel::UnoControlNumericFieldModel()
 {
-	ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
-	ImplRegisterProperty( BASEPROPERTY_BORDER );
-	ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR );
-	ImplRegisterProperty( BASEPROPERTY_DECIMALACCURACY );
-	ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
-	ImplRegisterProperty( BASEPROPERTY_ENABLED );
-	ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
-	ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
-	ImplRegisterProperty( BASEPROPERTY_HELPURL );
-	ImplRegisterProperty( BASEPROPERTY_NUMSHOWTHOUSANDSEP );
-	ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
-	ImplRegisterProperty( BASEPROPERTY_READONLY );
-	ImplRegisterProperty( BASEPROPERTY_REPEAT );
-	ImplRegisterProperty( BASEPROPERTY_REPEAT_DELAY );
-	ImplRegisterProperty( BASEPROPERTY_SPIN );
-	ImplRegisterProperty( BASEPROPERTY_STRICTFORMAT );
-	ImplRegisterProperty( BASEPROPERTY_TABSTOP );
-	ImplRegisterProperty( BASEPROPERTY_VALUEMAX_DOUBLE );
-	ImplRegisterProperty( BASEPROPERTY_VALUEMIN_DOUBLE );
-	ImplRegisterProperty( BASEPROPERTY_VALUESTEP_DOUBLE );
-	ImplRegisterProperty( BASEPROPERTY_VALUE_DOUBLE );
-    ImplRegisterProperty( BASEPROPERTY_ENFORCE_FORMAT );
-	ImplRegisterProperty( BASEPROPERTY_HIDEINACTIVESELECTION );
+    UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXNumericField );
 }
 
 ::rtl::OUString UnoControlNumericFieldModel::getServiceName() throw(::com::sun::star::uno::RuntimeException)
@@ -3305,31 +3106,7 @@ sal_Int16 UnoNumericFieldControl::getDec
 //	----------------------------------------------------
 UnoControlCurrencyFieldModel::UnoControlCurrencyFieldModel()
 {
-	ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
-	ImplRegisterProperty( BASEPROPERTY_BORDER );
-	ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR );
-	ImplRegisterProperty( BASEPROPERTY_CURRENCYSYMBOL );
-	ImplRegisterProperty( BASEPROPERTY_CURSYM_POSITION );
-	ImplRegisterProperty( BASEPROPERTY_DECIMALACCURACY );
-	ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
-	ImplRegisterProperty( BASEPROPERTY_ENABLED );
-	ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
-	ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
-	ImplRegisterProperty( BASEPROPERTY_HELPURL );
-	ImplRegisterProperty( BASEPROPERTY_NUMSHOWTHOUSANDSEP );
-	ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
-	ImplRegisterProperty( BASEPROPERTY_READONLY );
-	ImplRegisterProperty( BASEPROPERTY_REPEAT );
-	ImplRegisterProperty( BASEPROPERTY_REPEAT_DELAY );
-	ImplRegisterProperty( BASEPROPERTY_SPIN );
-	ImplRegisterProperty( BASEPROPERTY_STRICTFORMAT );
-	ImplRegisterProperty( BASEPROPERTY_TABSTOP );
-	ImplRegisterProperty( BASEPROPERTY_VALUEMAX_DOUBLE );
-	ImplRegisterProperty( BASEPROPERTY_VALUEMIN_DOUBLE );
-	ImplRegisterProperty( BASEPROPERTY_VALUESTEP_DOUBLE );
-	ImplRegisterProperty( BASEPROPERTY_VALUE_DOUBLE );
-    ImplRegisterProperty( BASEPROPERTY_ENFORCE_FORMAT );
-	ImplRegisterProperty( BASEPROPERTY_HIDEINACTIVESELECTION );
+    UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXCurrencyField );
 }
 
 ::rtl::OUString UnoControlCurrencyFieldModel::getServiceName() throw(::com::sun::star::uno::RuntimeException)
@@ -3528,23 +3305,7 @@ sal_Int16 UnoCurrencyFieldControl::getDe
 //	----------------------------------------------------
 UnoControlPatternFieldModel::UnoControlPatternFieldModel()
 {
-	ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
-	ImplRegisterProperty( BASEPROPERTY_BORDER );
-	ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR );
-	ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
-	ImplRegisterProperty( BASEPROPERTY_EDITMASK );
-	ImplRegisterProperty( BASEPROPERTY_ENABLED );
-	ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
-	ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
-	ImplRegisterProperty( BASEPROPERTY_HELPURL );
-	ImplRegisterProperty( BASEPROPERTY_LITERALMASK );
-	ImplRegisterProperty( BASEPROPERTY_MAXTEXTLEN );
-	ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
-	ImplRegisterProperty( BASEPROPERTY_READONLY );
-	ImplRegisterProperty( BASEPROPERTY_STRICTFORMAT );
-	ImplRegisterProperty( BASEPROPERTY_TABSTOP );
-	ImplRegisterProperty( BASEPROPERTY_TEXT );
-	ImplRegisterProperty( BASEPROPERTY_HIDEINACTIVESELECTION );
+    UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXPatternField );
 }
 
 ::rtl::OUString UnoControlPatternFieldModel::getServiceName() throw(::com::sun::star::uno::RuntimeException)
Index: toolkit/source/helper/unopropertyarrayhelper.cxx
===================================================================
RCS file: /cvs/gsl/toolkit/source/helper/unopropertyarrayhelper.cxx,v
retrieving revision 1.5
retrieving revision 1.5.114.1
diff -u -p -u -p -r1.5 -r1.5.114.1
--- toolkit/source/helper/unopropertyarrayhelper.cxx	12 Oct 2006 10:33:28 -0000	1.5
+++ toolkit/source/helper/unopropertyarrayhelper.cxx	13 Jul 2007 17:43:53 -0000	1.5.114.1
@@ -51,6 +51,13 @@ UnoPropertyArrayHelper::UnoPropertyArray
 		maIDs.Insert( pIDs[n], (void*)1L );
 }
 
+UnoPropertyArrayHelper::UnoPropertyArrayHelper( const std::list< sal_uInt16 > &rIDs )
+{
+    std::list< sal_uInt16 >::const_iterator iter;
+    for( iter = rIDs.begin(); iter != rIDs.end(); iter++)
+	  maIDs.Insert( *iter, (void*)1L);
+}
+
 sal_Bool UnoPropertyArrayHelper::ImplHasProperty( sal_uInt16 nPropId ) const
 {
 	if ( ( nPropId >= BASEPROPERTY_FONTDESCRIPTORPART_START ) && ( nPropId <= BASEPROPERTY_FONTDESCRIPTORPART_END ) )
Index: toolkit/source/helper/unowrapper.cxx
===================================================================
RCS file: /cvs/gsl/toolkit/source/helper/unowrapper.cxx,v
retrieving revision 1.32
retrieving revision 1.32.4.1
diff -u -p -u -p -r1.32 -r1.32.4.1
--- toolkit/source/helper/unowrapper.cxx	6 Jul 2007 14:28:36 -0000	1.32
+++ toolkit/source/helper/unowrapper.cxx	16 Aug 2007 16:09:16 -0000	1.32.4.1
@@ -139,7 +139,7 @@ using namespace ::com::sun::star;
 		// case WINDOW_SCROLLBARBOX:
 		// case WINDOW_PATTERNBOX:
 		// case WINDOW_CURRENCYBOX:
-        default:                    return new VCLXWindow;
+        default:                    return new VCLXWindow( true );
     }
 }
 
Index: vcl/inc/vcl/button.hxx
===================================================================
RCS file: /cvs/gsl/vcl/inc/vcl/button.hxx,v
retrieving revision 1.2
retrieving revision 1.2.142.1
diff -u -p -u -p -r1.2 -r1.2.142.1
--- vcl/inc/vcl/button.hxx	11 Apr 2007 17:48:44 -0000	1.2
+++ vcl/inc/vcl/button.hxx	17 Aug 2007 13:52:57 -0000	1.2.142.1
@@ -220,6 +220,7 @@ public:
     TriState        GetSavedValue() const { return meSaveValue; }
 
     Size            CalcMinimumSize( long nMaxWidth = 0 ) const;
+    virtual Size    GetOptimalSize(WindowSizeType eType) const;
 
     void            SetToggleHdl( const Link& rLink ) { maToggleHdl = rLink; }
     const Link&     GetToggleHdl() const { return maToggleHdl; }
@@ -393,6 +394,7 @@ public:
     static Image    GetRadioImage( const AllSettings& rSettings, USHORT nFlags );
 
     Size            CalcMinimumSize( long nMaxWidth = 0 ) const;
+    virtual Size    GetOptimalSize(WindowSizeType eType) const;
 
     void            SetToggleHdl( const Link& rLink ) { maToggleHdl = rLink; }
     const Link&     GetToggleHdl() const { return maToggleHdl; }
@@ -471,6 +473,7 @@ public:
     static Image    GetCheckImage( const AllSettings& rSettings, USHORT nFlags );
 
     Size            CalcMinimumSize( long nMaxWidth = 0 ) const;
+    virtual Size    GetOptimalSize(WindowSizeType eType) const;
 
     void            SetToggleHdl( const Link& rLink ) { maToggleHdl = rLink; }
     const Link&     GetToggleHdl() const { return maToggleHdl; }
Index: vcl/inc/vcl/combobox.hxx
===================================================================
RCS file: /cvs/gsl/vcl/inc/vcl/combobox.hxx,v
retrieving revision 1.2
retrieving revision 1.2.142.1
diff -u -p -u -p -r1.2 -r1.2.142.1
--- vcl/inc/vcl/combobox.hxx	11 Apr 2007 17:49:26 -0000	1.2
+++ vcl/inc/vcl/combobox.hxx	17 Aug 2007 13:52:57 -0000	1.2.142.1
@@ -191,6 +191,7 @@ public:
     const Link&     GetDoubleClickHdl() const               { return maDoubleClickHdl; }
 
     Size            CalcMinimumSize() const;
+    virtual Size    GetOptimalSize(WindowSizeType eType) const;
     Size            CalcAdjustedSize( const Size& rPrefSize ) const;
     using Edit::CalcSize;
     Size            CalcSize( USHORT nColumns, USHORT nLines ) const;
Index: vcl/inc/vcl/ctrl.hxx
===================================================================
RCS file: /cvs/gsl/vcl/inc/vcl/ctrl.hxx,v
retrieving revision 1.2
retrieving revision 1.2.142.1
diff -u -p -u -p -r1.2 -r1.2.142.1
--- vcl/inc/vcl/ctrl.hxx	11 Apr 2007 17:50:12 -0000	1.2
+++ vcl/inc/vcl/ctrl.hxx	17 Aug 2007 13:52:57 -0000	1.2.142.1
@@ -174,6 +174,8 @@ public:
 	const Link& 	GetLoseFocusHdl() const { return maLoseFocusHdl; }
 
     void			SetLayoutDataParent( const Control* pParent ) const;
+
+    virtual Size    GetOptimalSize(WindowSizeType eType) const;
 };
 
 #endif	// _SV_CTRL_HXX
Index: vcl/inc/vcl/edit.hxx
===================================================================
RCS file: /cvs/gsl/vcl/inc/vcl/edit.hxx,v
retrieving revision 1.3
retrieving revision 1.3.122.1
diff -u -p -u -p -r1.3 -r1.3.122.1
--- vcl/inc/vcl/edit.hxx	26 Apr 2007 10:34:39 -0000	1.3
+++ vcl/inc/vcl/edit.hxx	17 Aug 2007 13:52:57 -0000	1.3.122.1
@@ -255,6 +255,7 @@ public:
 	AutocompleteAction	GetAutocompleteAction() const { return meAutocompleteAction; }
 
 	virtual Size		CalcMinimumSize() const;
+    virtual Size        GetOptimalSize(WindowSizeType eType) const;
 	virtual Size		CalcSize( USHORT nChars ) const;
 	virtual xub_StrLen	GetMaxVisChars() const;
 
Index: vcl/inc/vcl/fixed.hxx
===================================================================
RCS file: /cvs/gsl/vcl/inc/vcl/fixed.hxx,v
retrieving revision 1.2
retrieving revision 1.2.142.1
diff -u -p -u -p -r1.2 -r1.2.142.1
--- vcl/inc/vcl/fixed.hxx	11 Apr 2007 17:53:32 -0000	1.2
+++ vcl/inc/vcl/fixed.hxx	17 Aug 2007 13:52:57 -0000	1.2.142.1
@@ -86,6 +86,7 @@ public:
     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
 
     Size            CalcMinimumSize( long nMaxWidth = 0 ) const;
+    virtual Size    GetOptimalSize(WindowSizeType eType) const;
 };
 
 // -------------
Index: vcl/inc/vcl/lstbox.hxx
===================================================================
RCS file: /cvs/gsl/vcl/inc/vcl/lstbox.hxx,v
retrieving revision 1.2
retrieving revision 1.2.142.1
diff -u -p -u -p -r1.2 -r1.2.142.1
--- vcl/inc/vcl/lstbox.hxx	11 Apr 2007 17:59:45 -0000	1.2
+++ vcl/inc/vcl/lstbox.hxx	17 Aug 2007 13:52:57 -0000	1.2.142.1
@@ -217,6 +217,7 @@ public:
 	const Link& 	GetDoubleClickHdl() const				{ return maDoubleClickHdl; }
 
 	Size			CalcMinimumSize() const;
+    virtual Size    GetOptimalSize(WindowSizeType eType) const;
 	Size			CalcAdjustedSize( const Size& rPrefSize ) const;
 	Size			CalcSize( USHORT nColumns, USHORT nLines ) const;
 	void			GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const;
Index: vcl/inc/vcl/msgbox.hxx
===================================================================
RCS file: /cvs/gsl/vcl/inc/vcl/msgbox.hxx,v
retrieving revision 1.2
retrieving revision 1.2.142.1
diff -u -p -u -p -r1.2 -r1.2.142.1
--- vcl/inc/vcl/msgbox.hxx	11 Apr 2007 18:01:26 -0000	1.2
+++ vcl/inc/vcl/msgbox.hxx	17 Aug 2007 13:52:57 -0000	1.2.142.1
@@ -128,6 +128,8 @@ public:
     const XubString&    GetCheckBoxText() const { return maCheckBoxText;}
     void                SetCheckBoxState( BOOL bCheck );
     BOOL                GetCheckBoxState() const;
+
+    virtual Size        GetOptimalSize(WindowSizeType eType) const;
 };
 
 // -----------
Index: vcl/inc/vcl/spinfld.hxx
===================================================================
RCS file: /cvs/gsl/vcl/inc/vcl/spinfld.hxx,v
retrieving revision 1.2
retrieving revision 1.2.142.1
diff -u -p -u -p -r1.2 -r1.2.142.1
--- vcl/inc/vcl/spinfld.hxx	11 Apr 2007 18:11:38 -0000	1.2
+++ vcl/inc/vcl/spinfld.hxx	17 Aug 2007 13:52:57 -0000	1.2.142.1
@@ -125,6 +125,7 @@ public:
 	const Link& 	GetLastHdl() const { return maLastHdlLink; }
 
 	virtual Size	CalcMinimumSize() const;
+    virtual Size    GetOptimalSize(WindowSizeType eType) const;
 	virtual Size	CalcSize( USHORT nChars ) const;
 };
 
Index: vcl/inc/vcl/window.hxx
===================================================================
RCS file: /cvs/gsl/vcl/inc/vcl/window.hxx,v
retrieving revision 1.3
retrieving revision 1.2.114.2
diff -u -p -u -p -r1.3 -r1.2.114.2
--- vcl/inc/vcl/window.hxx	3 Aug 2007 14:06:01 -0000	1.3
+++ vcl/inc/vcl/window.hxx	17 Aug 2007 14:44:02 -0000	1.2.114.2
@@ -362,6 +362,12 @@ typedef USHORT StateChangedType;
 #define DLGWINDOW_FIRST                 2
 //#endif
 
+enum WindowSizeType { 
+    WINDOWSIZE_MINIMUM,
+    WINDOWSIZE_PREFERRED,
+    WINDOWSIZE_MAXIMUM
+};
+
 // ----------
 // - Window -
 // ----------
@@ -1034,6 +1040,9 @@ public:
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > GetClipboard();
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > GetPrimarySelection();
 
+    // Advisory Sizing - what is a good size for this widget ?
+    virtual Size GetOptimalSize(WindowSizeType eType) const;
+
     //-------------------------------------
     //  Native Widget Rendering functions
     //-------------------------------------
Index: vcl/source/control/button.cxx
===================================================================
RCS file: /cvs/gsl/vcl/source/control/button.cxx,v
retrieving revision 1.54
retrieving revision 1.52.18.2
diff -u -p -u -p -r1.54 -r1.52.18.2
--- vcl/source/control/button.cxx	24 Jul 2007 12:13:34 -0000	1.54
+++ vcl/source/control/button.cxx	17 Aug 2007 14:46:07 -0000	1.52.18.2
@@ -1995,6 +1995,18 @@ Size PushButton::CalcMinimumSize( long n
     return CalcWindowSize( aSize );
 }
 
+// -----------------------------------------------------------------------
+
+Size PushButton::GetOptimalSize(WindowSizeType eType) const
+{
+    switch (eType) {
+    case WINDOWSIZE_MINIMUM:
+        return CalcMinimumSize();
+    default:
+        return Button::GetOptimalSize( eType );
+    }
+}
+
 // =======================================================================
 
 void OKButton::ImplInit( Window* pParent, WinBits nStyle )
@@ -3254,6 +3266,18 @@ Size RadioButton::CalcMinimumSize( long 
     return CalcWindowSize( aSize );
 }
 
+// -----------------------------------------------------------------------
+
+Size RadioButton::GetOptimalSize(WindowSizeType eType) const
+{
+    switch (eType) {
+    case WINDOWSIZE_MINIMUM:
+        return CalcMinimumSize();
+    default:
+        return Button::GetOptimalSize( eType );
+    }
+}
+
 // =======================================================================
 
 void CheckBox::ImplInitCheckBoxData()
@@ -4084,6 +4108,18 @@ Size CheckBox::CalcMinimumSize( long nMa
     return CalcWindowSize( aSize );
 }
 
+// -----------------------------------------------------------------------
+
+Size CheckBox::GetOptimalSize(WindowSizeType eType) const
+{
+    switch (eType) {
+    case WINDOWSIZE_MINIMUM:
+        return CalcMinimumSize();
+    default:
+        return Button::GetOptimalSize( eType );
+    }
+}
+
 // =======================================================================
 
 ImageButton::ImageButton( WindowType nType ) :
Index: vcl/source/control/combobox.cxx
===================================================================
RCS file: /cvs/gsl/vcl/source/control/combobox.cxx,v
retrieving revision 1.44
retrieving revision 1.42.10.2
diff -u -p -u -p -r1.44 -r1.42.10.2
--- vcl/source/control/combobox.cxx	3 Aug 2007 14:06:48 -0000	1.44
+++ vcl/source/control/combobox.cxx	17 Aug 2007 14:46:14 -0000	1.42.10.2
@@ -1093,6 +1093,18 @@ long ComboBox::CalcWindowSizePixel( USHO
 
 // -----------------------------------------------------------------------
 
+Size ComboBox::GetOptimalSize(WindowSizeType eType) const
+{
+    switch (eType) {
+    case WINDOWSIZE_MINIMUM:
+        return CalcMinimumSize();
+    default:
+        return Edit::GetOptimalSize( eType );
+    }
+}
+
+// -----------------------------------------------------------------------
+
 Size ComboBox::CalcMinimumSize() const
 {
 	Size aSz;
Index: vcl/source/control/ctrl.cxx
===================================================================
RCS file: /cvs/gsl/vcl/source/control/ctrl.cxx,v
retrieving revision 1.23
retrieving revision 1.23.66.1
diff -u -p -u -p -r1.23 -r1.23.66.1
--- vcl/source/control/ctrl.cxx	27 Jun 2007 20:04:56 -0000	1.23
+++ vcl/source/control/ctrl.cxx	17 Aug 2007 13:52:57 -0000	1.23.66.1
@@ -470,3 +470,19 @@ ControlLayoutData::~ControlLayoutData()
     if( m_pParent )
         m_pParent->ImplClearLayoutData();
 }
+
+// -----------------------------------------------------------------
+
+Size Control::GetOptimalSize(WindowSizeType eType) const
+{
+    switch (eType) {
+    case WINDOWSIZE_MINIMUM:
+        return Size( GetTextWidth( GetText() ) + 2 * 12,
+                     GetTextHeight() + 2 * 6 );
+    case WINDOWSIZE_PREFERRED:
+        return GetOptimalSize( WINDOWSIZE_MINIMUM );
+    case WINDOWSIZE_MAXIMUM:
+    default:
+        return Size( LONG_MAX, LONG_MAX );
+    }
+}
Index: vcl/source/control/edit.cxx
===================================================================
RCS file: /cvs/gsl/vcl/source/control/edit.cxx,v
retrieving revision 1.88
retrieving revision 1.86.10.2
diff -u -p -u -p -r1.88 -r1.86.10.2
--- vcl/source/control/edit.cxx	3 Aug 2007 14:07:02 -0000	1.88
+++ vcl/source/control/edit.cxx	17 Aug 2007 14:45:57 -0000	1.86.10.2
@@ -2714,6 +2714,18 @@ Size Edit::CalcMinimumSize() const
 
 // -----------------------------------------------------------------------
 
+Size Edit::GetOptimalSize(WindowSizeType eType) const
+{
+    switch (eType) {
+    case WINDOWSIZE_MINIMUM:
+        return CalcMinimumSize();
+    default:
+        return Control::GetOptimalSize( eType );
+    }
+}
+
+// -----------------------------------------------------------------------
+
 Size Edit::CalcSize( xub_StrLen nChars ) const
 {
 	// Breite fuer n Zeichen, unabhaengig vom Inhalt.
Index: vcl/source/control/fixed.cxx
===================================================================
RCS file: /cvs/gsl/vcl/source/control/fixed.cxx,v
retrieving revision 1.21
retrieving revision 1.21.66.1
diff -u -p -u -p -r1.21 -r1.21.66.1
--- vcl/source/control/fixed.cxx	27 Jun 2007 20:06:03 -0000	1.21
+++ vcl/source/control/fixed.cxx	17 Aug 2007 13:52:57 -0000	1.21.66.1
@@ -420,6 +420,17 @@ Size FixedText::CalcMinimumSize( long nM
 
 	return CalcWindowSize( aSize );
 }
+// -----------------------------------------------------------------------
+
+Size FixedText::GetOptimalSize(WindowSizeType eType) const
+{
+    switch (eType) {
+    case WINDOWSIZE_MINIMUM:
+        return CalcMinimumSize();
+    default:
+        return Control::GetOptimalSize( eType );
+    }
+}
 
 // -----------------------------------------------------------------------
 
Index: vcl/source/control/lstbox.cxx
===================================================================
RCS file: /cvs/gsl/vcl/source/control/lstbox.cxx,v
retrieving revision 1.39
retrieving revision 1.38.10.2
diff -u -p -u -p -r1.39 -r1.38.10.2
--- vcl/source/control/lstbox.cxx	24 Jul 2007 10:06:54 -0000	1.39
+++ vcl/source/control/lstbox.cxx	17 Aug 2007 14:46:35 -0000	1.38.10.2
@@ -1276,6 +1276,18 @@ Size ListBox::CalcMinimumSize() const
 
 // -----------------------------------------------------------------------
 
+Size ListBox::GetOptimalSize(WindowSizeType eType) const
+{
+    switch (eType) {
+    case WINDOWSIZE_MINIMUM:
+        return CalcMinimumSize();
+    default:
+        return Control::GetOptimalSize( eType );
+    }
+}
+
+// -----------------------------------------------------------------------
+
 Size ListBox::CalcAdjustedSize( const Size& rPrefSize ) const
 {
 	Size aSz = rPrefSize;
Index: vcl/source/control/spinfld.cxx
===================================================================
RCS file: /cvs/gsl/vcl/source/control/spinfld.cxx,v
retrieving revision 1.25
retrieving revision 1.24.46.2
diff -u -p -u -p -r1.25 -r1.24.46.2
--- vcl/source/control/spinfld.cxx	3 Aug 2007 14:07:14 -0000	1.25
+++ vcl/source/control/spinfld.cxx	17 Aug 2007 14:46:42 -0000	1.24.46.2
@@ -981,6 +981,18 @@ Size SpinField::CalcMinimumSize() const
 
 // -----------------------------------------------------------------------
 
+Size SpinField::GetOptimalSize(WindowSizeType eType) const
+{
+    switch (eType) {
+    case WINDOWSIZE_MINIMUM:
+        return CalcMinimumSize();
+    default:
+        return Edit::GetOptimalSize( eType );
+    }
+}
+
+// -----------------------------------------------------------------------
+
 Size SpinField::CalcSize( USHORT nChars ) const
 {
 	Size aSz = Edit::CalcSize( nChars );
Index: vcl/source/window/msgbox.cxx
===================================================================
RCS file: /cvs/gsl/vcl/source/window/msgbox.cxx,v
retrieving revision 1.23
retrieving revision 1.22.10.2
diff -u -p -u -p -r1.23 -r1.22.10.2
--- vcl/source/window/msgbox.cxx	24 Jul 2007 10:21:07 -0000	1.23
+++ vcl/source/window/msgbox.cxx	17 Aug 2007 14:55:02 -0000	1.22.10.2
@@ -680,3 +680,14 @@ Image QueryBox::GetStandardImage()
 	ImplInitMsgBoxImageList();
 	return ImplGetSVData()->maWinData.mpMsgBoxImgList->GetImage( 2 );
 }
+
+Size MessBox::GetOptimalSize(WindowSizeType eType) const
+{
+    switch( eType ) {
+    case WINDOWSIZE_MINIMUM:
+        // FIXME: base me on the font size ?
+        return Size( 250, 100 );
+    default:
+        return Window::GetOptimalSize( eType );
+    }
+}
Index: vcl/source/window/window3.cxx
===================================================================
RCS file: /cvs/gsl/vcl/source/window/window3.cxx,v
retrieving revision 1.10
retrieving revision 1.9.10.2
diff -u -p -u -p -r1.10 -r1.9.10.2
--- vcl/source/window/window3.cxx	24 Jul 2007 10:23:32 -0000	1.10
+++ vcl/source/window/window3.cxx	17 Aug 2007 14:56:31 -0000	1.9.10.2
@@ -317,3 +317,18 @@ WaitObject::~WaitObject()
     if ( mpWindow )
         mpWindow->LeaveWait();
 }
+
+// -----------------------------------------------------------------------
+
+Size Window::GetOptimalSize(WindowSizeType eType) const
+{
+    switch (eType) {
+    case WINDOWSIZE_MINIMUM:
+        return Size();
+    case WINDOWSIZE_PREFERRED:
+        return GetOptimalSize( WINDOWSIZE_MINIMUM );
+    case WINDOWSIZE_MAXIMUM:
+    default:
+        return Size( LONG_MAX, LONG_MAX );
+    }
+}
