User: kz Date: 05/01/21 09:06:06 Modified: /dba/dbaccess/source/ui/app/ AppControllerGen.cxx
Log: INTEGRATION: CWS dba22 (1.8.4); FILE MERGED 2005/01/03 12:47:57 oj 1.8.4.3: #i39146# renable DnD in beamer 2004/12/13 14:26:25 oj 1.8.4.2: #i38891# add listeners and hold them 2004/12/10 14:37:16 oj 1.8.4.1: #i29294# new class for uno based models and SendMail File Changes: Directory: /dba/dbaccess/source/ui/app/ ======================================= File [changed]: AppControllerGen.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppControllerGen.cxx?r1=1.8&r2=1.9 Delta lines: +48 -7 -------------------- --- AppControllerGen.cxx 25 Nov 2004 14:26:49 -0000 1.8 +++ AppControllerGen.cxx 21 Jan 2005 17:06:03 -0000 1.9 @@ -107,6 +107,9 @@ #ifndef _DBAUI_DLGRENAME_HXX #include "dlgrename.hxx" #endif +#ifndef INCLUDED_SFX_MAILMODELAPI_HXX +#include <sfx2/mailmodelapi.hxx> +#endif #ifndef DBAUI_APPVIEW_HXX #include "AppView.hxx" #endif @@ -235,7 +238,11 @@ const TransferableDataHelper& rClipboard = getViewClipboard(); ElementType eType = getContainer()->getElementType(); if ( eType == E_TABLE ) - pasteTable(_nFormatId, rClipboard ); + { + Reference<XConnection> xDestConnection; + ensureConnection(xDestConnection); + m_aTableCopyHelper.pasteTable(_nFormatId, rClipboard,getDatabaseName() , xDestConnection); + } else paste( eType,ODataAccessObjectTransferable::extractObjectDescriptor(rClipboard) ); @@ -622,23 +629,57 @@ } } // ----------------------------------------------------------------------------- -void OApplicationController::doAction(sal_uInt16 _nId ,sal_Bool _bEdit) +void OApplicationController::doAction(sal_uInt16 _nId ,OLinkedDocumentsAccess::EOpenMode _eOpenMode) { ::std::vector< ::rtl::OUString> aList; getSelectionElementNames(aList); ElementType eType = getContainer()->getElementType(); + ::std::vector< ::std::pair< ::rtl::OUString ,Reference< XModel > > > aCompoments; ::std::vector< ::rtl::OUString>::iterator aEnd = aList.end(); for (::std::vector< ::rtl::OUString>::iterator aIter = aList.begin(); aIter != aEnd; ++aIter) { if ( SID_DB_APP_CONVERTTOVIEW == _nId ) convertToView(*aIter); else - openElement(*aIter,eType, _bEdit ); + aCompoments.push_back( ::std::pair< ::rtl::OUString ,Reference< XModel > >(*aIter,Reference< XModel >(openElement(*aIter,eType, _eOpenMode ),UNO_QUERY))); + } + + // special handling for mail, if more than one document is selected attach them all + if ( _eOpenMode == OLinkedDocumentsAccess::OPEN_FORMAIL ) + { + ::std::vector< ::std::pair< ::rtl::OUString ,Reference< XModel > > >::iterator aIter = aCompoments.begin(); + ::std::vector< ::std::pair< ::rtl::OUString ,Reference< XModel > > >::iterator aEnd = aCompoments.end(); + SfxMailModel aSendMail(m_xCurrentFrame); + SfxMailModel::SendMailResult eResult = SfxMailModel::SEND_MAIL_OK; + for (; aIter != aEnd && SfxMailModel::SEND_MAIL_OK == eResult; ++aIter) + { + Reference< XModel > xModel(aIter->second,UNO_QUERY); + + eResult = aSendMail.AttachDocument(SfxMailModel::TYPE_SELF,xModel,aIter->first); + } + if ( !aSendMail.IsEmpty() ) + aSendMail.Send(); } } // ----------------------------------------------------------------------------- - +ElementType OApplicationController::getElementType(const Reference< XContainer >& _xContainer) const +{ + ElementType eRet = E_NONE; + Reference<XServiceInfo> xServiceInfo(_xContainer,UNO_QUERY); + if ( xServiceInfo.is() ) + { + if ( xServiceInfo->supportsService(SERVICE_SDBCX_TABLES) ) + eRet = E_TABLE; + else if ( xServiceInfo->supportsService(SERVICE_NAME_FORM_COLLECTION) ) + eRet = E_FORM; + else if ( xServiceInfo->supportsService(SERVICE_NAME_REPORT_COLLECTION) ) + eRet = E_REPORT; + else + eRet = E_QUERY; + } + return eRet; +} //........................................................................ } // namespace dbaui //........................................................................ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
