Commits

Frank Schoenheit [fs]  committed 8b9fdf6 Merge

obic007: pulled merged CWS ext006

  • Participants
  • Parent commits a22158b, 38897aa

Comments (0)

Files changed (2)

File toolkit/inc/toolkit/controls/dialogcontrol.hxx

 
 #include <toolkit/controls/controlmodelcontainerbase.hxx>
 #include <com/sun/star/awt/XTopWindow.hpp>
-#include <com/sun/star/awt/XDialog.hpp>
+#include <com/sun/star/awt/XDialog2.hpp>
 #include <com/sun/star/resource/XStringResourceResolver.hpp>
 #include "toolkit/helper/servicenames.hxx"
 #include "toolkit/helper/macros.hxx"
 #include <toolkit/controls/unocontrolcontainer.hxx>
 #include <cppuhelper/basemutex.hxx>
+#include <cppuhelper/implbase3.hxx>
 #include <list>
 
 //	----------------------------------------------------
 
 };
 
-class UnoDialogControl :public ControlContainerBase,
-						public ::com::sun::star::awt::XTopWindow,
-						public ::com::sun::star::awt::XDialog,
-						public ::com::sun::star::awt::XWindowListener 
+typedef ::cppu::AggImplInheritanceHelper3   <   ControlContainerBase
+                                            ,   ::com::sun::star::awt::XTopWindow
+                                            ,   ::com::sun::star::awt::XDialog2
+                                            ,   ::com::sun::star::awt::XWindowListener 
+                                            >   UnoDialogControl_Base;
+class UnoDialogControl : public UnoDialogControl_Base
 {
 private:
     ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuBar >			mxMenuBar;
 								~UnoDialogControl();
 	::rtl::OUString				GetComponentServiceName();
 
-	::com::sun::star::uno::Any	SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlContainer::queryInterface(rType); }
-    ::com::sun::star::uno::Any	SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
-	void						SAL_CALL acquire() throw()	{ OWeakAggObject::acquire(); }
-	void						SAL_CALL release() throw()	{ OWeakAggObject::release(); }
-
     void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
     void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
     void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
     virtual void SAL_CALL windowShown( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
     virtual void SAL_CALL windowHidden( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
     
+    // ::com::sun::star::awt::XDialog2
+    virtual void SAL_CALL endDialog( ::sal_Int32 Result ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL setHelpId( const rtl::OUString& Id ) throw (::com::sun::star::uno::RuntimeException);
+
 	// ::com::sun::star::awt::XDialog
     void SAL_CALL setTitle( const ::rtl::OUString& Title ) throw(::com::sun::star::uno::RuntimeException);
 	::rtl::OUString SAL_CALL getTitle() throw(::com::sun::star::uno::RuntimeException);
 	sal_Int16 SAL_CALL execute() throw(::com::sun::star::uno::RuntimeException);
 	void SAL_CALL endExecute() throw(::com::sun::star::uno::RuntimeException);
 
-    // ::com::sun::star::lang::XTypeProvider
-	::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >	SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
-	::com::sun::star::uno::Sequence< sal_Int8 >						SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
-
 	// ::com::sun::star::awt::XControl
     sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model ) throw(::com::sun::star::uno::RuntimeException);
 

File toolkit/source/controls/dialogcontrol.cxx

 // ============================================================================
 
 UnoDialogControl::UnoDialogControl( const uno::Reference< lang::XMultiServiceFactory >& i_factory )
-    :ControlContainerBase( i_factory )
+    :UnoDialogControl_Base( i_factory )
     ,maTopWindowListeners( *this )
     ,mbWindowListener(false)
 {
         return ::rtl::OUString::createFromAscii( "TabPage" );
 }
 
-// XInterface
-Any UnoDialogControl::queryAggregation( const Type & rType ) throw(RuntimeException)
-{
-        uno::Any aRet = ::cppu::queryInterface( rType, SAL_STATIC_CAST( awt::XTopWindow*, this ) );
-        if ( !aRet.hasValue() )
-            aRet = ::cppu::queryInterface( rType, SAL_STATIC_CAST( awt::XDialog*, this ) );
-        if ( !aRet.hasValue() )
-            aRet = ::cppu::queryInterface( rType, SAL_STATIC_CAST( awt::XWindowListener*, this ) );
-	return (aRet.hasValue() ? aRet : ControlContainerBase::queryAggregation( rType ));
-}
-
- //lang::XTypeProvider
-IMPL_XTYPEPROVIDER_START( UnoDialogControl)
-    getCppuType( ( uno::Reference< awt::XTopWindow>* ) NULL ),
-    getCppuType( ( uno::Reference< awt::XDialog>* ) NULL ),
-    getCppuType( ( uno::Reference< awt::XWindowListener>* ) NULL ),
-    ControlContainerBase::getTypes()
-IMPL_XTYPEPROVIDER_END
-
 void UnoDialogControl::dispose() throw(RuntimeException)
 {
 	vos::OGuard aSolarGuard( Application::GetSolarMutex() );
 	}
 }
 
-void SAL_CALL UnoDialogControl::windowShown( const ::com::sun::star::lang::EventObject& e )
-throw (::com::sun::star::uno::RuntimeException)
+void SAL_CALL UnoDialogControl::windowShown( const EventObject& e ) throw (RuntimeException)
 {
     (void)e;
 }
 
-void SAL_CALL UnoDialogControl::windowHidden( const ::com::sun::star::lang::EventObject& e )
-throw (::com::sun::star::uno::RuntimeException)
+void SAL_CALL UnoDialogControl::windowHidden( const EventObject& e ) throw (RuntimeException)
 {
     (void)e;
 }
 
+void SAL_CALL UnoDialogControl::endDialog( ::sal_Int32 i_result ) throw (RuntimeException)
+{
+    Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY );
+    if ( xPeerDialog.is() )
+        xPeerDialog->endDialog( i_result );
+}
+
+void SAL_CALL UnoDialogControl::setHelpId( const rtl::OUString& i_id ) throw (RuntimeException)
+{
+    Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY );
+    if ( xPeerDialog.is() )
+        xPeerDialog->setHelpId( i_id );
+}
+
 void UnoDialogControl::setTitle( const ::rtl::OUString& Title ) throw(RuntimeException)
 {
 	vos::OGuard aSolarGuard( Application::GetSolarMutex() );