User: hr Date: 2007-09-26 14:48:22+0000 Modified: dba/dbaccess/source/ui/browser/dbexchange.cxx
Log: INTEGRATION: CWS dba24a (1.26.120); FILE MERGED 2007/09/05 11:24:03 oj 1.26.120.3: unused param 2007/09/05 11:04:18 oj 1.26.120.2: #i68334# fix ref count prob 2007/08/30 09:04:43 oj 1.26.120.1: #i68334# release rtf and html when connection was disposed File Changes: Directory: /dba/dbaccess/source/ui/browser/ =========================================== File [changed]: dbexchange.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/browser/dbexchange.cxx?r1=1.26&r2=1.27 Delta lines: +22 -16 --------------------- --- dbexchange.cxx 2006-09-17 06:56:52+0000 1.26 +++ dbexchange.cxx 2007-09-26 14:48:19+0000 1.27 @@ -202,19 +202,20 @@ sal_Bool ODataClipboard::GetData( const DataFlavor& rFlavor ) { ULONG nFormat = SotExchange::GetFormat(rFlavor); + sal_uInt32 nHtml = SOT_FORMATSTR_ID_HTML_SIMPLE; switch (nFormat) { case SOT_FORMAT_RTF: + if ( m_pRtf ) m_pRtf->initialize(getDescriptor()); - return SetObject(m_pRtf, SOT_FORMAT_RTF, rFlavor); - + return m_pRtf && SetObject(m_pRtf, SOT_FORMAT_RTF, rFlavor); case SOT_FORMATSTR_ID_HTML: - m_pHtml->initialize(getDescriptor()); - return SetObject(m_pHtml, SOT_FORMATSTR_ID_HTML, rFlavor); - + nHtml = SOT_FORMATSTR_ID_HTML; + // run through case SOT_FORMATSTR_ID_HTML_SIMPLE: + if ( m_pHtml ) m_pHtml->initialize(getDescriptor()); - return SetObject(m_pHtml, SOT_FORMATSTR_ID_HTML_SIMPLE, rFlavor); + return m_pHtml && SetObject(m_pHtml, nHtml, rFlavor); } return ODataAccessObjectTransferable::GetData( rFlavor ); @@ -236,16 +237,21 @@ ODataAccessObjectTransferable::ObjectReleased( ); } // ----------------------------------------------------------------------------- - void SAL_CALL ODataClipboard::disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException) - { - if ( getDescriptor().has(daConnection) && getDescriptor()[daConnection] == Source.Source ) + void SAL_CALL ODataClipboard::disposing( const ::com::sun::star::lang::EventObject& ) throw (::com::sun::star::uno::RuntimeException) { - getDescriptor().erase(daConnection); - } - else if ( getDescriptor().has(daCursor) && getDescriptor()[daCursor] == Source.Source ) - getDescriptor().erase(daCursor); + Reference<XConnection> xConnection; + Reference<XResultSet> xProp; + if ( getDescriptor().has(daConnection) && (getDescriptor()[daConnection] >>= xConnection) ) + lcl_removeListener(xConnection,this); + if ( getDescriptor().has(daCursor) && (getDescriptor()[daCursor] >>= xProp) ) + lcl_removeListener(xProp,this); + + ClearFormats(); + getDescriptor().clear(); - lcl_removeListener(Source.Source,this); + m_pHtml = NULL; + m_pRtf = NULL; + m_aEventListeners.clear(); } // ----------------------------------------------------------------------------- IMPLEMENT_FORWARD_XINTERFACE2( ODataClipboard, ODataAccessObjectTransferable, TDataClipboard_BASE ) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
