User: vg      
Date: 05/03/10 08:40:14

Modified:
 /dba/dbaccess/source/filter/xml/
  xmlExport.cxx

Log:
 INTEGRATION: CWS dba24 (1.4.20); FILE MERGED
 2005/03/04 13:09:42 oj 1.4.20.2: #i42460# changes for the separation of 
datasource and database document(model)
 2005/02/18 12:44:40 oj 1.4.20.1: #i42460# changes for the separation of 
datasource and database document(model)

File Changes:

Directory: /dba/dbaccess/source/filter/xml/
===========================================

File [changed]: xmlExport.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/filter/xml/xmlExport.cxx?r1=1.4&r2=1.5
Delta lines:  +14 -9
--------------------
--- xmlExport.cxx       5 Jan 2005 12:31:05 -0000       1.4
+++ xmlExport.cxx       10 Mar 2005 16:40:12 -0000      1.5
@@ -101,6 +101,9 @@
 #ifndef _COM_SUN_STAR_SDB_XFORMDOCUMENTSSUPPLIER_HPP_
 #include <com/sun/star/sdb/XFormDocumentsSupplier.hpp>
 #endif
+#ifndef _COM_SUN_STAR_SDB_XOFFICEDATABASEDOCUMENT_HPP_
+#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
+#endif
 #ifndef _COM_SUN_STAR_SDB_XREPORTDOCUMENTSSUPPLIER_HPP_
 #include <com/sun/star/sdb/XReportDocumentsSupplier.hpp>
 #endif
@@ -306,7 +309,7 @@
 // 
-----------------------------------------------------------------------------   
    
 void ODBExport::exportDataSource()
 {
-       Reference<XPropertySet> xProp(GetModel(),UNO_QUERY);
+       Reference<XPropertySet> xProp(getDataSource());
        if ( xProp.is() )
        {
                ::rtl::OUString sValue;
@@ -589,7 +592,7 @@
                                                        
,::xmloff::token::XMLTokenEnum _eTokenFilter
                                                        
,::xmloff::token::XMLTokenEnum _eTokenType)
 {
-       Reference<XPropertySet> xProp(GetModel(),UNO_QUERY);
+       Reference<XPropertySet> xProp(getDataSource());
        Sequence< ::rtl::OUString> aValue;
        if ( _aValue.getLength() )
        {
@@ -607,7 +610,7 @@
 // 
-----------------------------------------------------------------------------
 void ODBExport::exportLogin()
 {
-       Reference<XPropertySet> xProp(GetModel(),UNO_QUERY);
+       Reference<XPropertySet> xProp(getDataSource());
        ::rtl::OUString sValue;
        xProp->getPropertyValue(PROPERTY_USER) >>= sValue;
        if ( sValue.getLength() )
@@ -842,7 +845,7 @@
 // 
-----------------------------------------------------------------------------
 void ODBExport::exportQueries(sal_Bool _bExportContext)
 {
-       Reference<XQueryDefinitionsSupplier> xSup(GetModel(),UNO_QUERY);
+       Reference<XQueryDefinitionsSupplier> xSup(getDataSource(),UNO_QUERY);
        if ( xSup.is() )
        {
                Reference< XNameAccess > xCollection = 
xSup->getQueryDefinitions();
@@ -861,7 +864,7 @@
 // 
-----------------------------------------------------------------------------
 void ODBExport::exportTables(sal_Bool _bExportContext)
 {
-       Reference<XTablesSupplier> xSup(GetModel(),UNO_QUERY);
+       Reference<XTablesSupplier> xSup(getDataSource(),UNO_QUERY);
        if ( xSup.is() )
        {
                Reference< XNameAccess > xCollection = xSup->getTables();
@@ -969,7 +972,7 @@
 // 
-----------------------------------------------------------------------------
 void ODBExport::GetViewSettings(Sequence<PropertyValue>& aProps)
 {
-       Reference<XQueryDefinitionsSupplier> xSup(GetModel(),UNO_QUERY);
+       Reference<XQueryDefinitionsSupplier> xSup(getDataSource(),UNO_QUERY);
        if ( xSup.is() )
        {
                Reference< XNameAccess > xCollection = 
xSup->getQueryDefinitions();
@@ -1007,7 +1010,7 @@
 // 
-----------------------------------------------------------------------------
 void ODBExport::GetConfigurationSettings(Sequence<PropertyValue>& aProps)
 {
-       Reference<XPropertySet> xProp(GetModel(),UNO_QUERY);
+       Reference<XPropertySet> xProp(getDataSource());
        if ( xProp.is() )
        {
                sal_Int32 nLength = aProps.getLength();
@@ -1081,8 +1084,10 @@
 // 
-----------------------------------------------------------------------------
 void SAL_CALL ODBExport::setSourceDocument( const Reference< XComponent >& 
xDoc ) throw(IllegalArgumentException, RuntimeException)
 {
-       Reference<XPropertySet> xProp(xDoc,UNO_QUERY);
-       Reference< XNumberFormatsSupplier > 
xNum(xProp->getPropertyValue(PROPERTY_NUMBERFORMATSSUPPLIER),UNO_QUERY);
+       Reference<XOfficeDatabaseDocument> xOfficeDoc(xDoc,UNO_QUERY_THROW);
+       m_xDataSource.set(xOfficeDoc->getDataSource(),UNO_QUERY_THROW);
+       OSL_ENSURE(m_xDataSource.is(),"DataSource is NULL!");
+       Reference< XNumberFormatsSupplier > 
xNum(m_xDataSource->getPropertyValue(PROPERTY_NUMBERFORMATSSUPPLIER),UNO_QUERY);
        SetNumberFormatsSupplier(xNum);
        SvXMLExport::setSourceDocument(xDoc);
 }




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

Reply via email to