User: vg      
Date: 05/03/10 08:52:10

Modified:
 /dba/dbaccess/source/ui/misc/
  UITools.cxx

Log:
 INTEGRATION: CWS dba24 (1.54.4); FILE MERGED
 2005/02/21 13:13:26 oj 1.54.4.3: RESYNC: (1.54-1.55); FILE MERGED
 2005/02/18 12:42:26 oj 1.54.4.2: #i42460# changes for the separation of 
datasource and database document(model)
 2005/02/10 16:58:44 fs 1.54.4.1: ENABLETABLEALIAS was an unused duplicate

File Changes:

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

File [changed]: UITools.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/UITools.cxx?r1=1.55&r2=1.56
Delta lines:  +27 -8
--------------------
--- UITools.cxx 17 Feb 2005 11:08:41 -0000      1.55
+++ UITools.cxx 10 Mar 2005 16:52:07 -0000      1.56
@@ -134,6 +134,9 @@
 #ifndef _COM_SUN_STAR_UCB_INTERACTIVEIOEXCEPTION_HPP_
 #include <com/sun/star/ucb/InteractiveIOException.hpp>
 #endif
+#ifndef _COM_SUN_STAR_SDB_XDOCUMENTDATASOURCE_HPP_
+#include <com/sun/star/sdb/XDocumentDataSource.hpp>
+#endif
 #ifndef _COM_SUN_STAR_UCB_IOERRORCODE_HPP_
 #include <com/sun/star/ucb/IOErrorCode.hpp>
 #endif
@@ -420,9 +423,9 @@
        return aInfo;
 }
 // 
-----------------------------------------------------------------------------
-Reference< XModel > getDataSourceByName_displayError( const Reference< 
XNameAccess >& _rxDBContext,
+Reference< XDataSource > getDataSourceByName_displayError( const Reference< 
XNameAccess >& _rxDBContext,
     const ::rtl::OUString& _rDataSourceName, Window* _pErrorMessageParent, 
Reference< XMultiServiceFactory > _rxORB,
-    bool _bDisplayError )
+    bool _bDisplayError)
 {
     OSL_PRECOND( _rxDBContext.is() && _rxORB.is(), 
"getDataSourceByName_displayError: invalid service factory!" );
 
@@ -460,7 +463,7 @@
        }
 
     if ( xDatasource.is() )
-        return Reference< XModel >( xDatasource, UNO_QUERY );
+               return xDatasource;
 
     if ( _bDisplayError )
     {
@@ -472,9 +475,25 @@
             // by spec, we must pass this to an interaction handler ...
         }
     }
-    return Reference< XModel >();
+       return Reference<XDataSource>();
 }
+// 
-----------------------------------------------------------------------------
+Reference< XInterface > getDataSourceOrModel(const Reference< XInterface >& 
_xObject)
+{
+       Reference< XInterface > xRet;
+       Reference<XDocumentDataSource> xDocumentDataSource(_xObject,UNO_QUERY);
+    if ( xDocumentDataSource.is() )
+        xRet = xDocumentDataSource->getDatabaseDocument();
 
+       if ( !xRet.is() )
+       {
+               Reference<XOfficeDatabaseDocument> 
xOfficeDoc(_xObject,UNO_QUERY);
+               if ( xOfficeDoc.is() )
+                       xRet = xOfficeDoc->getDataSource();
+       }
+
+       return xRet;
+}
 // 
-----------------------------------------------------------------------------
 void showError(const SQLExceptionInfo& _rInfo,Window* _pParent,const 
Reference< XMultiServiceFactory >& _xFactory)
 {
@@ -1335,7 +1354,7 @@
 // 
-----------------------------------------------------------------------------
 sal_Bool isAppendTableAliasEnabled(const Reference<XConnection>& _xConnection)
 {
-       return 
::dbtools::isDataSourcePropertyEnabled(_xConnection,PROPERTY_ENABLETABLEALIAS,sal_True);
+       return 
::dbtools::isDataSourcePropertyEnabled(_xConnection,INFO_APPEND_TABLE_ALIAS,sal_True);
 }
 
 // 
-----------------------------------------------------------------------------
@@ -1447,7 +1466,7 @@
                                DBG_ERRORFILE( "Property 'AnchorName' is 
missing" );
                        }
                }
-               catch( ::com::sun::star::uno::Exception& )
+               catch( Exception& )
                {
                }
 
@@ -1573,7 +1592,7 @@
 }
 // 
-----------------------------------------------------------------------------
 Reference<XPropertySet> createView( const ::rtl::OUString& _sName
-                                                                  ,const 
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& 
_xConnection
+                                                                  ,const 
Reference< ::com::sun::star::sdbc::XConnection >& _xConnection
                                                                   ,const 
Reference<XPropertySet>& _xSourceObject)
 {
        Reference<XViewsSupplier> xSup(_xConnection,UNO_QUERY);




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

Reply via email to