From e5b578e80fd6c31dc9d4178030a9383915234315 Mon Sep 17 00:00:00 2001 From: Sascha Ballach Date: Fri, 22 Mar 2002 15:31:13 +0000 Subject: #95584#; SFX_HINT_DYING handles the base class --- .../AccessibleDocumentPagePreview.cxx | 11 +++-------- .../ui/Accessibility/AccessiblePageHeader.cxx | 12 +++-------- .../Accessibility/AccessiblePreviewHeaderCell.cxx | 12 +++-------- .../ui/Accessibility/AccessiblePreviewTable.cxx | 23 +++++++++++++--------- .../ui/Accessibility/AccessibleSpreadsheet.cxx | 11 ++++------- 5 files changed, 27 insertions(+), 42 deletions(-) diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx index a122bb00a054..38703ee4c6d3 100644 --- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessibleDocumentPagePreview.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: sab $ $Date: 2002-03-21 06:50:07 $ + * last change: $Author: sab $ $Date: 2002-03-22 16:31:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -196,12 +196,7 @@ void SAL_CALL ScAccessibleDocumentPagePreview::disposing() void ScAccessibleDocumentPagePreview::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { - if (rHint.ISA( SfxSimpleHint )) - { - const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint; - if (rRef.GetId() == SFX_HINT_DYING) - dispose(); - } + ScAccessibleDocumentBase::Notify(rBC, rHint); } //===== XAccessibleComponent ============================================ diff --git a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx index 7d1a45297e27..8436f7f243e3 100644 --- a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx +++ b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessiblePageHeader.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: sab $ $Date: 2002-03-21 06:51:50 $ + * last change: $Author: sab $ $Date: 2002-03-22 16:31:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -110,13 +110,7 @@ void SAL_CALL ScAccessiblePageHeader::disposing() void ScAccessiblePageHeader::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { - if (rHint.ISA( SfxSimpleHint )) - { - const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint; - ULONG nId = rRef.GetId(); - if ( nId == SFX_HINT_DYING ) - dispose(); - } + ScAccessibleContextBase::Notify(rBC, rHint); } //===== XAccessibleComponent ============================================ diff --git a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx index b2efd99f152a..8823ef14a6d8 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessiblePreviewHeaderCell.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: sab $ $Date: 2002-03-21 06:58:55 $ + * last change: $Author: sab $ $Date: 2002-03-22 16:31:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -136,13 +136,7 @@ void SAL_CALL ScAccessiblePreviewHeaderCell::disposing() void ScAccessiblePreviewHeaderCell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { - if (rHint.ISA( SfxSimpleHint )) - { - const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint; - ULONG nId = rRef.GetId(); - if ( nId == SFX_HINT_DYING ) - dispose(); - } + ScAccessibleContextBase::Notify(rBC, rHint); } //===== XInterface ===================================================== diff --git a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx index 3d84f5cf7f99..5b9ee401d836 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessiblePreviewTable.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: sab $ $Date: 2002-03-21 07:08:06 $ + * last change: $Author: sab $ $Date: 2002-03-22 16:31:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -99,10 +99,12 @@ ScAccessiblePreviewTable::ScAccessiblePreviewTable( const ::com::sun::star::uno: ScAccessiblePreviewTable::~ScAccessiblePreviewTable() { - if (mpViewShell) - mpViewShell->RemoveAccessibilityObject(*this); - - delete mpTableInfo; + if (!ScAccessibleContextBase::IsDefunc() && !rBHelper.bInDispose) + { + // increment refcount to prevent double call off dtor + osl_incrementInterlockedCount( &m_refCount ); + dispose(); + } } void SAL_CALL ScAccessiblePreviewTable::disposing() @@ -113,6 +115,9 @@ void SAL_CALL ScAccessiblePreviewTable::disposing() mpViewShell = NULL; } + if (mpTableInfo) + DELETEZ (mpTableInfo); + ScAccessibleContextBase::disposing(); } @@ -124,15 +129,15 @@ void ScAccessiblePreviewTable::Notify( SfxBroadcaster& rBC, const SfxHint& rHint { const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint; ULONG nId = rRef.GetId(); - if ( nId == SFX_HINT_DYING ) - dispose(); - else if ( nId == SFX_HINT_DATACHANGED ) + if ( nId == SFX_HINT_DATACHANGED ) { // column / row layout may change with any document change, // so it must be invalidated DELETEZ( mpTableInfo ); } } + + ScAccessibleContextBase::Notify(rBC, rHint); } //===== XInterface ===================================================== diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx index a9d86808d03b..fb7e1dde93e4 100644 --- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx +++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessibleSpreadsheet.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: sab $ $Date: 2002-03-21 07:10:59 $ + * last change: $Author: sab $ $Date: 2002-03-22 16:31:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -233,11 +233,6 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint CommitTableModelChange(aNewPos.Top(), aNewPos.Left(), aNewPos.Bottom(), aNewPos.Right(), AccessibleTableModelChangeType::UPDATE); } } - else if (rRef.GetId() == SFX_HINT_DYING) - { - // it seems the Broadcaster is dying, since the view is dying - dispose(); - } } else if (rHint.ISA( ScUpdateRefHint )) { @@ -264,6 +259,8 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint } } } + + ScAccessibleTableBase::Notify(rBC, rHint); } //===== XAccessibleTable ================================================ -- cgit