diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2018-07-03 20:18:39 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2018-08-02 19:25:58 +0200 |
commit | c8d8fdeadcb34cb5ff4fdd8368d1b92a710c0bd6 (patch) | |
tree | 7bfee53343c6f8380d64510c427bb60f3c121674 | |
parent | 6ca5d288ca810f128163da121777ee2e11c46edc (diff) |
Reportdesign: try to fix EndListening
Looking at history:
2014-05-02:
reportdesign: sal_Bool->bool
e23c98d713ababb72de0616831a2abe0e48387f5
2008-06-16:
INTEGRATION: CWS rptchart02 (1.7.4); FILE MERGED
2008/05/16 12:53:21 oj 1.7.4.6: #i89365# copy props before set args at chart
2008/05/07 06:56:32 oj 1.7.4.5: #i88842# set databaseprovider at chart
2008/04/30 13:03:34 oj 1.7.4.4: #i88843# impl clone method
2008/04/16 06:28:15 oj 1.7.4.3: RESYNC: (1.7-1.8); FILE MERGED
2008/04/03 06:35:18 oj 1.7.4.2: #i86343# remove unused code
2008/03/12 09:45:16 oj 1.7.4.1: impl chart handling
b8fe847a46f2a51e3e9653eb254e4254883496f7
@@ -299,10 +297,9 @@ void OObjectBase::EndListening(sal_Bool /*bRemoveListener*/)
DBG_CHKTHIS( rpt_OObjectBase,NULL);
OSL_ENSURE(!m_xReportComponent.is() || isListening(), "OUnoObject::EndListening: not listening currently!");
+ m_bIsListening = sal_False;
if ( isListening() && m_xReportComponent.is() )
{
- m_bIsListening = sal_False;
-
// XPropertyChangeListener
if ( m_xPropertyChangeListener.is() )
{
Since isListening() returns the value of m_bIsListening
(see https://opengrok.libreoffice.org/xref/core/reportdesign/inc/RptObject.hxx#79)
quite suspicious.
We may think that "m_bIsListening = false;" should be put if we succeed in removing the listener
382 if ( isListening() && m_xReportComponent.is() )
383 {
384 // XPropertyChangeListener
385 if ( m_xPropertyChangeListener.is() )
386 {
387 // remove listener
388 try
389 {
390 m_xReportComponent->removePropertyChangeListener( OUString() , m_xPropertyChangeListener );
391 }
392 catch(const uno::Exception &)
393 {
394 OSL_FAIL("OObjectBase::EndListening: Exception caught!");
395 }
396 }
397 m_xPropertyChangeListener.clear();
398 }
Either in the try after the remove or in a finally if we don't want to care about catch part.
(see https://opengrok.libreoffice.org/xref/core/reportdesign/source/core/sdr/RptObject.cxx#377)
But considering the 2008 commit and the former state before it, it seems it was on purpose to put m_bIsListening in all cases so...
Change-Id: I7db8ba45d915e28e707cea61d16ef94fc13b969a
Reviewed-on: https://gerrit.libreoffice.org/56898
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
-rw-r--r-- | reportdesign/source/core/sdr/RptObject.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx index bd1ee71782d1..2ed954af9ead 100644 --- a/reportdesign/source/core/sdr/RptObject.cxx +++ b/reportdesign/source/core/sdr/RptObject.cxx @@ -378,7 +378,6 @@ void OObjectBase::EndListening() { OSL_ENSURE(!m_xReportComponent.is() || isListening(), "OUnoObject::EndListening: not listening currently!"); - m_bIsListening = false; if ( isListening() && m_xReportComponent.is() ) { // XPropertyChangeListener @@ -396,6 +395,7 @@ void OObjectBase::EndListening() } m_xPropertyChangeListener.clear(); } + m_bIsListening = false; } void OObjectBase::SetPropsFromRect(const tools::Rectangle& _rRect) |