diff options
author | Ocke Janssen <oj@openoffice.org> | 2001-10-02 06:55:27 +0000 |
---|---|---|
committer | Ocke Janssen <oj@openoffice.org> | 2001-10-02 06:55:27 +0000 |
commit | cf54e3a7713ea8be7325949c0a00a431136f91c7 (patch) | |
tree | 365f82a0124277038288d3e342b6a984530927b2 /dbaccess | |
parent | 99cdb987035e7a82123ac79d3fc0d56f2fa145a6 (diff) |
#87728# drag&drop of table row and tableinformation repaired
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/browser/dbexchange.cxx | 9 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/sbagrid.cxx | 163 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/sbagrid.src | 17 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/TokenWriter.hxx | 60 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/dbu_resource.hrc | 10 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/sbagrid.hxx | 20 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/TokenWriter.cxx | 32 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/UITools.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/makefile.mk | 5 |
9 files changed, 184 insertions, 138 deletions
diff --git a/dbaccess/source/ui/browser/dbexchange.cxx b/dbaccess/source/ui/browser/dbexchange.cxx index d1ea6b97e04a..92c3852817f0 100644 --- a/dbaccess/source/ui/browser/dbexchange.cxx +++ b/dbaccess/source/ui/browser/dbexchange.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dbexchange.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: fs $ $Date: 2001-08-02 15:25:55 $ + * last change: $Author: oj $ $Date: 2001-10-02 07:55:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -111,11 +111,10 @@ namespace dbaui ,m_pHtml(NULL) ,m_pRtf(NULL) { - Sequence< PropertyValue > aProps = getDescriptor().createPropertyValueSequence(); - m_pHtml = new OHTMLImportExport(aProps, _rxORB, _rxFormatter); + m_pHtml = new OHTMLImportExport(getDescriptor(), _rxORB, _rxFormatter); m_xHtml = m_pHtml; - m_pRtf = new ORTFImportExport(aProps, _rxORB, _rxFormatter); + m_pRtf = new ORTFImportExport(getDescriptor(), _rxORB, _rxFormatter); m_xRtf = m_pRtf; } diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index 5e6bb4c77093..5f45716e4912 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -2,9 +2,9 @@ * * $RCSfile: sbagrid.cxx,v $ * - * $Revision: 1.50 $ + * $Revision: 1.51 $ * - * last change: $Author: oj $ $Date: 2001-09-27 06:25:18 $ + * last change: $Author: oj $ $Date: 2001-10-02 07:55:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -138,7 +138,9 @@ #ifndef _COM_SUN_STAR_UTIL_DATETIME_HPP_ #include <com/sun/star/util/DateTime.hpp> #endif - +#ifndef _COM_SUN_STAR_SDBC_XRESULTSETUPDATE_HPP_ +#include <com/sun/star/sdbc/XResultSetUpdate.hpp> +#endif #ifndef _URLOBJ_HXX #include <tools/urlobj.hxx> #endif @@ -262,6 +264,9 @@ #ifndef DBAUI_TOOLS_HXX #include "UITools.hxx" #endif +#ifndef DBAUI_TOKENWRITER_HXX +#include "TokenWriter.hxx" +#endif using namespace ::com::sun::star::ui::dialogs; using namespace ::com::sun::star::uno; @@ -275,6 +280,7 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::view; using namespace ::com::sun::star::form; using namespace ::dbaui; +using namespace ::dbtools; using namespace ::svx; using namespace ::svt; @@ -1046,6 +1052,7 @@ SbaGridControl::SbaGridControl(Reference< XMultiServiceFactory > _rM, ,m_bSelecting(sal_False) ,m_pMasterListener(NULL) ,m_bActivatingForDrop(sal_False) + ,m_nAsyncDropEvent(0) { DBG_CTOR(SbaGridControl ,NULL); } @@ -1054,6 +1061,8 @@ SbaGridControl::SbaGridControl(Reference< XMultiServiceFactory > _rM, SbaGridControl::~SbaGridControl() { DBG_DTOR(SbaGridControl ,NULL); + if (m_nAsyncDropEvent) + Application::RemoveUserEvent(m_nAsyncDropEvent); } //--------------------------------------------------------------------------------------- @@ -1659,9 +1668,9 @@ void SbaGridControl::DoFieldDrag(sal_uInt16 nColumnPos, sal_Int16 nRowPos) { switch (_aType.mnSotId) { - case SOT_FORMAT_RTF: // RTF data descriptions - case SOT_FORMATSTR_ID_HTML: // HTML data descriptions - case SOT_FORMATSTR_ID_HTML_SIMPLE: // HTML data descriptions +// case SOT_FORMAT_RTF: // RTF data descriptions +// case SOT_FORMATSTR_ID_HTML: // HTML data descriptions +// case SOT_FORMATSTR_ID_HTML_SIMPLE: // HTML data descriptions case SOT_FORMATSTR_ID_DBACCESS_TABLE: // table descriptor case SOT_FORMATSTR_ID_DBACCESS_QUERY: // query descriptor case SOT_FORMATSTR_ID_DBACCESS_COMMAND: // SQL command @@ -1757,9 +1766,12 @@ sal_Int8 SbaGridControl::AcceptDrop( const BrowserAcceptDropEvent& rEvt ) } while (sal_False); -// DataFlavorExVector& _rFlavors = GetDataFlavorExVector(); -// if(::std::find_if(_rFlavors.begin(),_rFlavors.end(),SbaGridControlPrec(sal_True)) != _rFlavors.end()) -// nAction = DND_ACTION_COPY; + if(nAction != DND_ACTION_COPY && GetEmptyRow().Is()) + { + const DataFlavorExVector& _rFlavors = GetDataFlavors(); + if(::std::find_if(_rFlavors.begin(),_rFlavors.end(),SbaGridControlPrec(sal_True)) != _rFlavors.end()) + nAction = DND_ACTION_COPY; + } /* // check formats @@ -1830,88 +1842,20 @@ sal_Int8 SbaGridControl::ExecuteDrop( const BrowserExecuteDropEvent& rEvt ) return DND_ACTION_COPY; } -/* - ////////////////////////////////////////////////////////////////////// - // DataExch-String holen - SotDataObjectRef xDataObj = ((DropEvent&)rEvt).GetData(); - const SvDataTypeList& rTypeList = xDataObj->GetTypeList(); - // the last known format - sal_uInt32 nSbaDataExchangeFormat = Exchange::RegisterFormatName(String::CreateFromAscii(SBA_DATAEXCHANGE_FORMAT)); - if( !rTypeList.Get(nSbaDataExchangeFormat) ) - return sal_False; - - SvData aData(nSbaDataExchangeFormat); - xDataObj->GetData(&aData); - String sDataExchStr; - if (!aData.GetData(sDataExchStr)) - return sal_False; - - if (!sDataExchStr.Len()) - return sal_False; - - // Formerly we just casted the xDataObj-ptr to SbaExplorerExchObj*. Unfortunally this isn't - // valid anymore (it also seems to be very bad style to me) - // Now xDataObj is an SfxExchangeObject, so we have to try other approches .... - // FS - 69292 - 20.10.99 - -// SbaExplorerExchObj* pDataExchObj = NULL; -// // so first we try our new internal format which we created for this situation -// SvData aExplorerExchangeTransfer(Exchange::RegisterFormatName(String::CreateFromAscii(SBA_DATATYPE_INTERNAL_EXPLOREREXCHANGE))); -// if (xDataObj->GetData(&aExplorerExchangeTransfer)) -// { -// DBG_ASSERT(aExplorerExchangeTransfer.GetMemorySize() == sizeof(pDataExchObj), "SbaGridControl::Drop : somebody gave me invalida data !"); -// void* pDestination = &pDataExchObj; -// aExplorerExchangeTransfer.GetData(&pDestination); -// } -// -// // next try for a SfxExchangeObject -// // (this is already somewhat dirty : we need a hard cast below ...) -// if (!pDataExchObj) -// { -// SfxExchangeObjectRef aSfxExchange = SfxExchangeObject::PasteDragServer((DropEvent&)rEvt); -// if (&aSfxExchange == &xDataObj) -// { -// // loop through all objects -// for (sal_uInt32 i=0; i<aSfxExchange->Count(); ++i) -// { -// if (aSfxExchange->GetObject(i)->HasFormat(SvDataType(nSbaDataExchangeFormat))) -// { -// pDataExchObj = (SbaExplorerExchObj*)aSfxExchange->GetObject(i); -// break; -// } -// } -// DBG_ASSERT(pDataExchObj, "SbaGridControl::Drop : invalid SfxExchangeObject !?"); -// // if the SfxExchangeObject itself has the format, at least one of it children should, too -// } -// } -// -// // last : the (real dirty :) old behaviuor : a hard cast -// if (!pDataExchObj) -// pDataExchObj = (SbaExplorerExchObj*)&xDataObj; -// -// // first we need to translate the ::com::sun::star::form::DataSelectionType into a DBObject -// sal_Int32 nDataType; -// try -// { -// nDataType = ::comphelper::getINT32(xDataSource->getPropertyValue(PROPERTY_COMMANDTYPE)); -// } -// catch(Exception&) -// { -// DBG_ERROR("SbaGridControl::Drop : could not collect essential data source attributes !"); -// return sal_False; -// } - - -// if (pDataExchObj->QueryInsertObject(eObj)) -// { -// if (pDataExchObj->GetData(getDataSource())) -// refresh(); -// // if the GetData would work with our own cursor, not with a newly created one, UpdateDataSource(sal_True) would be -// // suffient (me thinks) -// return sal_True; -// } - return sal_False; -*/ + if(GetEmptyRow().Is()) + { + const DataFlavorExVector& _rFlavors = GetDataFlavors(); + DataFlavorExVector::const_iterator aFind = ::std::find_if(_rFlavors.begin(),_rFlavors.end(),SbaGridControlPrec(sal_True)); + if( aFind != _rFlavors.end()) + { + TransferableDataHelper aDropped( rEvt.maDropEvent.Transferable ); + m_aDataDescriptor = ODataAccessObjectTransferable::extractObjectDescriptor(aDropped); + if (m_nAsyncDropEvent) + Application::RemoveUserEvent(m_nAsyncDropEvent); + m_nAsyncDropEvent = Application::PostUserEvent(LINK(this, SbaGridControl, AsynchDropEvent)); + return DND_ACTION_COPY; + } + } return DND_ACTION_NONE; } @@ -1941,6 +1885,43 @@ Reference< XPropertySet > SbaGridControl::getDataSource() const return xReturn; } +// ----------------------------------------------------------------------------- +IMPL_LINK(SbaGridControl, AsynchDropEvent, void*, EMPTY_ARG) +{ + m_nAsyncDropEvent = 0; + + Reference< XPropertySet > xDataSource = getDataSource(); + if (xDataSource.is()) + { + Reference< XResultSetUpdate > xResultSetUpdate(xDataSource,UNO_QUERY); + ORowSetImportExport* pImExport = new ORowSetImportExport(this,xResultSetUpdate,m_aDataDescriptor,getServiceManager()); + Reference<XEventListener> xHolder = pImExport; + pImExport->initialize(); + Hide(); + try + { + if(!pImExport->Read()) + { + String sError = String(ModuleRes(STR_NO_COLUMNNAME_MATCHING)); + throwGenericSQLException(sError,NULL); + } + Show(); + } + catch(const SQLException& e) + { + Show(); + ::dbaui::showError(::dbtools::SQLExceptionInfo(e),this,getServiceManager()); + } + catch(const Exception& ) + { + OSL_ENSURE(0,"Exception catched!"); + } + } + m_aDataDescriptor.clear(); + + return 0L; +} + diff --git a/dbaccess/source/ui/browser/sbagrid.src b/dbaccess/source/ui/browser/sbagrid.src index f3d202344708..9ab4d4e7e129 100644 --- a/dbaccess/source/ui/browser/sbagrid.src +++ b/dbaccess/source/ui/browser/sbagrid.src @@ -2,9 +2,9 @@ * * $RCSfile: sbagrid.src,v $ * - * $Revision: 1.28 $ + * $Revision: 1.29 $ * - * last change: $Author: kz $ $Date: 2001-09-27 20:24:49 $ + * last change: $Author: oj $ $Date: 2001-10-02 07:55:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -363,3 +363,16 @@ String STR_OBJECT_ALREADY_EXISTS }; +String STR_NO_COLUMNNAME_MATCHING +{ + Text = "Es konnten keine bereinstimmenden Spaltennamen gefunden werden!" ; + Text [ ENGLISH ] = "No matching column names found." ; +}; + +String STR_ERROR_OCCURED_WHILE_COPYING +{ + Text = "Es ist ein Fehler aufgetreten! Wollen Sie den Kopiervorgang fortsetzen?" ; + Text [ ENGLISH ] = "A error occured. Would you like to continue the copying?" ; +}; + + diff --git a/dbaccess/source/ui/inc/TokenWriter.hxx b/dbaccess/source/ui/inc/TokenWriter.hxx index dc93252cdc1a..faffd18c4790 100644 --- a/dbaccess/source/ui/inc/TokenWriter.hxx +++ b/dbaccess/source/ui/inc/TokenWriter.hxx @@ -2,9 +2,9 @@ * * $RCSfile: TokenWriter.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: oj $ $Date: 2001-07-05 12:46:54 $ + * last change: $Author: oj $ $Date: 2001-10-02 07:55:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -91,6 +91,12 @@ #ifndef _COM_SUN_STAR_SDB_COMMANDTYPE_HPP_ #include <com/sun/star/sdb/CommandType.hpp> #endif +#ifndef _SVX_DATACCESSDESCRIPTOR_HXX_ +#include <svx/dataaccessdescriptor.hxx> +#endif +#ifndef _DBAUI_MODULE_DBU_HXX_ +#include "moduledbu.hxx" +#endif namespace dbaui { @@ -102,8 +108,9 @@ namespace dbaui { void disposing(); protected: - SvStream* m_pStream; - ::com::sun::star::awt::FontDescriptor m_aFont; + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any> m_aSelection; + SvStream* m_pStream; + ::com::sun::star::awt::FontDescriptor m_aFont; ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xObject; // table/query ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection; // ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > m_xResultSet; // @@ -126,7 +133,7 @@ namespace dbaui sal_Int32* m_pRowMarker; // wenn gesetzt, dann nur diese Rows kopieren // export data - ODatabaseImportExport( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _aSeq, + ODatabaseImportExport( const ::svx::ODataAccessDescriptor& _aDataDescriptor, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF, const String& rExchange = String()); @@ -143,7 +150,7 @@ namespace dbaui virtual BOOL Write() = 0; // Export virtual BOOL Read() = 0; // Import - void initialize(); + virtual void initialize(); virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException); }; @@ -156,11 +163,11 @@ namespace dbaui public: // export data - ORTFImportExport( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _aSeq, + ORTFImportExport( const ::svx::ODataAccessDescriptor& _aDataDescriptor, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF, const String& rExchange = String()) - : ODatabaseImportExport(_aSeq,_rM,_rxNumberF,rExchange) {}; + : ODatabaseImportExport(_aDataDescriptor,_rM,_rxNumberF,rExchange) {}; // import data ORTFImportExport( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, @@ -202,7 +209,7 @@ namespace dbaui public: // export data - OHTMLImportExport( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _aSeq, + OHTMLImportExport( const ::svx::ODataAccessDescriptor& _aDataDescriptor, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF, const String& rExchange = String()); @@ -217,6 +224,41 @@ namespace dbaui virtual BOOL Read(); }; + // ========================================================================= + // normal RowSet Im- und Export + // ========================================================================= + + class ORowSetImportExport : public ODatabaseImportExport, + public OModuleClient + { + ::std::vector<sal_Int32> m_aColumnMapping; + ::std::vector<sal_Int32> m_aColumnTypes; + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetUpdate > m_xTargetResultSetUpdate; // + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowUpdate > m_xTargetRowUpdate; // + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > m_xTargetResultSetMetaData; // + Window* m_pParent; + sal_Bool m_bAlreadyAsked; + + sal_Bool insertNewRow(); + public: + // export data + ORowSetImportExport(Window* _pParent, + const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetUpdate >& _xResultSetUpdate, + const ::svx::ODataAccessDescriptor& _aDataDescriptor, + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM, + const String& rExchange = String()); + + // import data + ORowSetImportExport( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM, + const String& rExchange = String()) + : ODatabaseImportExport(_rxConnection,NULL,_rM) + {} + + virtual void initialize(); + virtual BOOL Write(); + virtual BOOL Read(); + }; } #endif // DBAUI_TOKENWRITER_HXX diff --git a/dbaccess/source/ui/inc/dbu_resource.hrc b/dbaccess/source/ui/inc/dbu_resource.hrc index fd45aa79e2ba..fa49da170b25 100644 --- a/dbaccess/source/ui/inc/dbu_resource.hrc +++ b/dbaccess/source/ui/inc/dbu_resource.hrc @@ -2,9 +2,9 @@ * * $RCSfile: dbu_resource.hrc,v $ * - * $Revision: 1.62 $ + * $Revision: 1.63 $ * - * last change: $Author: oj $ $Date: 2001-09-25 13:24:37 $ + * last change: $Author: oj $ $Date: 2001-10-02 07:55:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -452,6 +452,9 @@ #define STR_HINT_READONLY_CONNECTION RID_STRING_START + 189 #define STR_HINT_CONNECTION_NOT_CAPABLE RID_STRING_START + 190 #define STR_OBJECT_ALREADY_EXISTS RID_STRING_START + 191 +#define STR_NO_COLUMNNAME_MATCHING RID_STRING_START + 192 +#define STR_ERROR_OCCURED_WHILE_COPYING RID_STRING_START + 193 + //======================================================================== // untyped resources @@ -466,6 +469,9 @@ /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.62 2001/09/25 13:24:37 oj + * #91719# implementing the XRename handling + * * Revision 1.61 2001/08/28 08:19:41 fs * #91573# STR_HINT_READONLY_CONNECTION / STR_HINT_CONNECTION_NOT_CAPABL * diff --git a/dbaccess/source/ui/inc/sbagrid.hxx b/dbaccess/source/ui/inc/sbagrid.hxx index 7cf0684b5b9e..bd0f8f6163f9 100644 --- a/dbaccess/source/ui/inc/sbagrid.hxx +++ b/dbaccess/source/ui/inc/sbagrid.hxx @@ -2,9 +2,9 @@ * * $RCSfile: sbagrid.hxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: hr $ $Date: 2001-09-13 14:14:47 $ + * last change: $Author: oj $ $Date: 2001-10-02 07:55:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -90,6 +90,9 @@ #ifndef _SBA_MULTIPLEX_HXX #include "sbamultiplex.hxx" #endif +#ifndef _SVX_DATACCESSDESCRIPTOR_HXX_ +#include <svx/dataaccessdescriptor.hxx> +#endif class SvNumberFormatter; @@ -120,7 +123,6 @@ namespace dbaui { DECLARE_STL_MAP(::com::sun::star::util::URL, SbaXStatusMultiplexer*, SbaURLCompare,StatusMultiplexerArray); StatusMultiplexerArray m_aStatusMultiplexer; - // ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_MultiServiceFacatory; public: SbaXGridControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&); @@ -266,13 +268,15 @@ namespace dbaui // Attributes protected: - ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSQLQueryComposer > m_xComposer; // for DnD we need a composed query ... + ::svx::ODataAccessDescriptor m_aDataDescriptor; + ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSQLQueryComposer > m_xComposer; // for DnD we need a composed query ... long m_nCurrentSelectedColumn; // this is the column model (not the view) posisition ... SbaGridListener* m_pMasterListener; - sal_uInt16 m_nLastColId; - sal_uInt16 m_nLastRowId; + sal_Int32 m_nAsyncDropEvent; + sal_uInt16 m_nLastColId; + sal_uInt16 m_nLastRowId; - sal_uInt16 m_nCurrentActionColId; + sal_uInt16 m_nCurrentActionColId; // ui actions (e.g. a context menu) may be performed on columns which aren't the current one // and aren't selected, so we have to track this column id @@ -348,6 +352,8 @@ namespace dbaui SvNumberFormatter* GetDatasourceFormatter(); + DECL_LINK(AsynchDropEvent, void*); + private: sal_Bool IsReadOnlyDB() const; }; diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx index 7fddc1a8ed3f..4e936c66805c 100644 --- a/dbaccess/source/ui/misc/TokenWriter.cxx +++ b/dbaccess/source/ui/misc/TokenWriter.cxx @@ -2,9 +2,9 @@ * * $RCSfile: TokenWriter.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: oj $ $Date: 2001-07-05 12:46:55 $ + * last change: $Author: oj $ $Date: 2001-10-02 07:55:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -139,6 +139,7 @@ using namespace dbaui; using namespace dbtools; +using namespace svx; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; @@ -167,7 +168,7 @@ const static char __FAR_DATA sFontSize[] = "font-size: "; DBG_NAME(ODatabaseImportExport); //====================================================================== -ODatabaseImportExport::ODatabaseImportExport(const Sequence< PropertyValue >& _aSeq, +ODatabaseImportExport::ODatabaseImportExport(const ODataAccessDescriptor& _aDataDescriptor, const Reference< XMultiServiceFactory >& _rM, const Reference< XNumberFormatter >& _rxNumberF, const String& rExchange) @@ -182,19 +183,14 @@ ODatabaseImportExport::ODatabaseImportExport(const Sequence< PropertyValue >& _a DBG_CTOR(ODatabaseImportExport,NULL); osl_incrementInterlockedCount( &m_refCount ); // get the information we need - const PropertyValue* pBegin = _aSeq.getConstArray(); - const PropertyValue* pEnd = pBegin + _aSeq.getLength(); - for(;pBegin != pEnd;++pBegin) - { - if (0 == pBegin->Name.compareToAscii(PROPERTY_DATASOURCENAME)) - pBegin->Value >>= m_sDataSourceName; - else if (0 == pBegin->Name.compareToAscii(PROPERTY_COMMANDTYPE)) - pBegin->Value >>= m_nCommandType; - else if (0 == pBegin->Name.compareToAscii(PROPERTY_COMMAND)) - pBegin->Value >>= m_sName; - else if (0 == pBegin->Name.compareToAscii(PROPERTY_ACTIVECONNECTION)) - pBegin->Value >>= m_xConnection; - } + _aDataDescriptor[daDataSource] >>= m_sDataSourceName; + _aDataDescriptor[daCommandType] >>= m_nCommandType; + _aDataDescriptor[daCommand] >>= m_sName; + // some additonal information + if(_aDataDescriptor.has(daConnection)) + _aDataDescriptor[daConnection] >>= m_xConnection; + if(_aDataDescriptor.has(daSelection)) + _aDataDescriptor[daSelection] >>= m_aSelection; xub_StrLen nCount = rExchange.GetTokenCount(char(11)); if( nCount > SBA_FORMAT_SELECTION_COUNT && rExchange.GetToken(4).Len()) @@ -618,11 +614,11 @@ const char __FAR_DATA OHTMLImportExport::sIndentSource[nIndentMax+1] = "\t\t\t\t #define lcl_OUT_COMMENT( comment ) ((*m_pStream) << sMyBegComment, OUT_STR( comment ) << sMyEndComment << sNewLine) //------------------------------------------------------------------- -OHTMLImportExport::OHTMLImportExport(const Sequence< PropertyValue >& _aSeq, +OHTMLImportExport::OHTMLImportExport(const ODataAccessDescriptor& _aDataDescriptor, const Reference< XMultiServiceFactory >& _rM, const Reference< XNumberFormatter >& _rxNumberF, const String& rExchange) - : ODatabaseImportExport(_aSeq,_rM,_rxNumberF,rExchange) + : ODatabaseImportExport(_aDataDescriptor,_rM,_rxNumberF,rExchange) ,m_nIndent(0) #if DBG_UTIL ,m_bCheckFont(FALSE) diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 87ba05486c4b..993f11281d7f 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -2,9 +2,9 @@ * * $RCSfile: UITools.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: oj $ $Date: 2001-09-27 06:25:15 $ + * last change: $Author: oj $ $Date: 2001-10-02 07:55:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -350,6 +350,7 @@ void showError(const SQLExceptionInfo& _rInfo,Window* _pParent,const Reference< return vRet; } +// ----------------------------------------------------------------------------- const OTypeInfo* getTypeInfoFromType(const OTypeInfoMap& _rTypeInfo, sal_Int32 _nType, @@ -425,6 +426,7 @@ const OTypeInfo* getTypeInfoFromType(const OTypeInfoMap& _rTypeInfo, return pTypeInfo; } +// ----------------------------------------------------------------------------- void fillTypeInfo( const Reference< ::com::sun::star::sdbc::XConnection>& _rxConnection, const String& _rsTypeNames, OTypeInfoMap& _rTypeInfoMap, diff --git a/dbaccess/source/ui/misc/makefile.mk b/dbaccess/source/ui/misc/makefile.mk index 5ab089666e66..919aa9434c7a 100644 --- a/dbaccess/source/ui/misc/makefile.mk +++ b/dbaccess/source/ui/misc/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.15 $ +# $Revision: 1.16 $ # -# last change: $Author: obo $ $Date: 2001-09-18 13:47:57 $ +# last change: $Author: oj $ $Date: 2001-10-02 07:55:27 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -97,6 +97,7 @@ EXCEPTIONSFILES= \ $(SLO)$/querydesignaccess.obj \ $(SLO)$/DExport.obj \ $(SLO)$/uiservices.obj \ + $(SLO)$/RowSetDrop.obj \ $(SLO)$/moduledbu.obj |