Tag: cws_dev300_odbmacros3
User: fs      
Date: 2008-05-07 08:35:29+0000
Modified:
   dba/dbaccess/source/ui/browser/genericcontroller.cxx

Log:
 #i49133# XController2 implementation, now used by our loader

File Changes:

Directory: /dba/dbaccess/source/ui/browser/
===========================================

File [changed]: genericcontroller.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/browser/genericcontroller.cxx?r1=1.84.6.2&r2=1.84.6.3
Delta lines:  +31 -28
---------------------
--- genericcontroller.cxx       2008-04-15 13:12:03+0000        1.84.6.2
+++ genericcontroller.cxx       2008-05-07 08:35:25+0000        1.84.6.3
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: genericcontroller.cxx,v $
- * $Revision: 1.84.6.2 $
+ * $Revision: 1.84.6.3 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -260,11 +260,6 @@
        return 0L;
 }
 // 
-----------------------------------------------------------------------------
-Reference< XWindow > OGenericUnoController::getComponentWindow() const
-{
-       return VCLUnoHelper::GetInterface( getView() );
-}
-// 
-----------------------------------------------------------------------------
 void OGenericUnoController::impl_initialize()
 {
 }
@@ -301,28 +296,26 @@
        }
        try
        {
-               if ( xFrame.is() )
-               {
+               if ( !xFrame.is() )
+            throw IllegalArgumentException( ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( "need a frame" ) ), *this, 1 );
+
                        xParent = xFrame->getContainerWindow();
                        VCLXWindow* pParentComponent = 
VCLXWindow::GetImplementation(xParent);
                        Window* pParentWin = pParentComponent ? 
pParentComponent->GetWindow() : NULL;
                        if (!pParentWin)
                        {
-                               throw 
Exception(::rtl::OUString::createFromAscii("Parent window is null"),*this);
+                       throw IllegalArgumentException( 
::rtl::OUString::createFromAscii( "Parent window is null" ), *this, 1 );
                        }
 
             m_aInitParameters.assign( aArguments );
                        Construct( pParentWin );
-            if ( !getView() )
-                throw Exception(::rtl::OUString::createFromAscii("Window is 
null"),*this);
-               }
-               else
-               {
-                       OSL_ENSURE(0,"OGenericUnoController::initialize: Frame 
is null!");
-               }
+
                ODataView* pView = getView();
-               if ( (m_bReadOnly || m_bPreview) && pView )
-                       pView->EnableInput(FALSE);
+        if ( !pView )
+            throw RuntimeException( ::rtl::OUString::createFromAscii( "unable 
to create a view" ), *this );
+
+               if ( m_bReadOnly || m_bPreview )
+                       pView->EnableInput( FALSE );
 
         impl_initialize();
        }
@@ -333,8 +326,6 @@
                m_pView = NULL;
                throw e;
        }
-       if ( xFrame.is() )
-               xFrame->setComponent(getComponentWindow(), this);
 }
 
 
//------------------------------------------------------------------------------
@@ -386,6 +377,18 @@
        InvalidateFeature(ID_BROWSER_UNDO);
 }
 // -----------------------------------------------------------------------
+Reference< XWindow > SAL_CALL OGenericUnoController::getComponentWindow() 
throw (RuntimeException)
+{
+       return VCLUnoHelper::GetInterface( getView() );
+}
+
+// -----------------------------------------------------------------------
+::rtl::OUString SAL_CALL OGenericUnoController::getViewControllerName() throw 
(::com::sun::star::uno::RuntimeException)
+{
+    return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Default" ) );
+}
+
+// -----------------------------------------------------------------------
 void OGenericUnoController::attachFrame( const Reference< XFrame >& _rxFrame ) 
throw( RuntimeException )
 {
     vos::OGuard aSolarGuard( Application::GetSolarMutex() );




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to