Tag: cws_src680_hsqlcsv
User: fs      
Date: 2006/09/18 06:51:22

Modified:
   dba/connectivity/source/drivers/hsqldb/HConnection.cxx

Log:
 #i69526# getTableEditor now taking XDatabaseDocumentUI

File Changes:

Directory: /dba/connectivity/source/drivers/hsqldb/
===================================================

File [changed]: HConnection.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/hsqldb/HConnection.cxx?r1=1.5.66.1&r2=1.5.66.2
Delta lines:  +22 -7
--------------------
--- HConnection.cxx     14 Sep 2006 11:42:05 -0000      1.5.66.1
+++ HConnection.cxx     18 Sep 2006 13:51:19 -0000      1.5.66.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: HConnection.cxx,v $
  *
- *  $Revision: 1.5.66.1 $
+ *  $Revision: 1.5.66.2 $
  *
- *  last change: $Author: fs $ $Date: 2006/09/14 11:42:05 $
+ *  last change: $Author: fs $ $Date: 2006/09/18 13:51:19 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -102,6 +102,7 @@
 using ::com::sun::star::sdbc::XResultSet;
 using ::com::sun::star::sdbc::XDatabaseMetaData;
 using ::com::sun::star::sdbc::XRow;
+using ::com::sun::star::sdb::application::XDatabaseDocumentUI;
 /** === end UNO using === **/
 
 namespace connectivity { namespace hsqldb
@@ -236,7 +237,7 @@
     }
 
     // -------------------------------------------------------------------
-    Reference< XInterface > SAL_CALL OHsqlConnection::getTableEditor( const 
::rtl::OUString& _TableName ) throw (IllegalArgumentException, 
WrappedTargetException, RuntimeException)
+    Reference< XInterface > SAL_CALL OHsqlConnection::getTableEditor( const 
Reference< XDatabaseDocumentUI >& _DocumentUI, const ::rtl::OUString& 
_TableName ) throw (IllegalArgumentException, WrappedTargetException, 
RuntimeException)
     {
         MethodGuard aGuard( *this );
 
@@ -244,7 +245,15 @@
         if ( !impl_isTextTable_nothrow( _TableName ) )
             return NULL;
 
-        Reference< XExecutableDialog > xEditor = 
impl_createLinkedTableEditor_throw( _TableName );
+        if ( !_DocumentUI.is() )
+            throw IllegalArgumentException(
+                ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The provided 
DocumentUI is not allowed to be NULL." ) ),
+                *this,
+                0
+            );
+        // TODO: resource
+
+        Reference< XExecutableDialog > xEditor = 
impl_createLinkedTableEditor_throw( _DocumentUI, _TableName );
         return xEditor.get();
     }
 
@@ -272,13 +281,14 @@
     }
 
     // -------------------------------------------------------------------
-    Reference< XExecutableDialog > 
OHsqlConnection::impl_createLinkedTableEditor_throw( const ::rtl::OUString& 
_rTableName )
+    Reference< XExecutableDialog > 
OHsqlConnection::impl_createLinkedTableEditor_throw( const Reference< 
XDatabaseDocumentUI >& _rxDocumentUI, const ::rtl::OUString& _rTableName )
     {
+        OSL_PRECOND( _rxDocumentUI.is(), 
"OHsqlConnection::impl_createLinkedTableEditor_throw: illegal document UI!" );
         Reference< XExecutableDialog > xDialog;
         try
         {
             ::comphelper::ComponentContext aContext( m_xORB );
-            Sequence< Any > aArguments(2);
+            Sequence< Any > aArguments(3);
             aArguments[0] <<= NamedValue(
                 ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TableContainer" 
) ),
                 makeAny( impl_getTableContainer_throw() )
@@ -287,6 +297,11 @@
                 ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TableName" ) ),
                 makeAny( _rTableName )
             );
+            aArguments[2] <<= NamedValue(
+                ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ParentWindow" ) 
),
+                makeAny( _rxDocumentUI->getApplicationMainWindow() )
+            );
+                
             aContext.createComponentWithArguments( 
"com.sun.star.sdb.hsql.LinkedTableEditor", aArguments, xDialog );
             if ( !xDialog.is() )
                 throw ServiceNotRegisteredException( 
::rtl::OUString::createFromAscii( "com.sun.star.sdb.hsql.LinkedTableEditor" ), 
*this );




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

Reply via email to