From 73258d6209e909835a3bf7774fe2ed695b29ac0c Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Wed, 26 Sep 2007 13:48:19 +0000 Subject: [PATCH] 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 --- dbaccess/source/ui/browser/dbexchange.cxx | 42 +++++++++++++---------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/dbaccess/source/ui/browser/dbexchange.cxx b/dbaccess/source/ui/browser/dbexchange.cxx index 28ac044055bc..3bd33db0a827 100644 --- a/dbaccess/source/ui/browser/dbexchange.cxx +++ b/dbaccess/source/ui/browser/dbexchange.cxx @@ -4,9 +4,9 @@ * * $RCSfile: dbexchange.cxx,v $ * - * $Revision: 1.26 $ + * $Revision: 1.27 $ * - * last change: $Author: obo $ $Date: 2006-09-17 06:56:52 $ + * last change: $Author: hr $ $Date: 2007-09-26 14:48:19 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -202,19 +202,20 @@ namespace dbaui 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: - m_pRtf->initialize(getDescriptor()); - return SetObject(m_pRtf, SOT_FORMAT_RTF, rFlavor); - + if ( m_pRtf ) + m_pRtf->initialize(getDescriptor()); + 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: - m_pHtml->initialize(getDescriptor()); - return SetObject(m_pHtml, SOT_FORMATSTR_ID_HTML_SIMPLE, rFlavor); + if ( m_pHtml ) + m_pHtml->initialize(getDescriptor()); + return m_pHtml && SetObject(m_pHtml, nHtml, rFlavor); } return ODataAccessObjectTransferable::GetData( rFlavor ); @@ -236,16 +237,21 @@ namespace dbaui ODataAccessObjectTransferable::ObjectReleased( ); } // ----------------------------------------------------------------------------- - void SAL_CALL ODataClipboard::disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException) + void SAL_CALL ODataClipboard::disposing( const ::com::sun::star::lang::EventObject& ) throw (::com::sun::star::uno::RuntimeException) { - if ( getDescriptor().has(daConnection) && getDescriptor()[daConnection] == Source.Source ) - { - getDescriptor().erase(daConnection); - } - else if ( getDescriptor().has(daCursor) && getDescriptor()[daCursor] == Source.Source ) - getDescriptor().erase(daCursor); + Reference xConnection; + Reference xProp; + if ( getDescriptor().has(daConnection) && (getDescriptor()[daConnection] >>= xConnection) ) + lcl_removeListener(xConnection,this); + if ( getDescriptor().has(daCursor) && (getDescriptor()[daCursor] >>= xProp) ) + lcl_removeListener(xProp,this); - lcl_removeListener(Source.Source,this); + ClearFormats(); + getDescriptor().clear(); + + m_pHtml = NULL; + m_pRtf = NULL; + m_aEventListeners.clear(); } // ----------------------------------------------------------------------------- IMPLEMENT_FORWARD_XINTERFACE2( ODataClipboard, ODataAccessObjectTransferable, TDataClipboard_BASE )