diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-07-31 12:58:18 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-07-31 12:58:18 +0000 |
commit | b586086201575c0b548ff88599bf107f52146c07 (patch) | |
tree | 503f28e19ec07e901a50db45d77c375af210c166 /svx | |
parent | 3728a5178400a1263631daaa967f493a276d665c (diff) |
INTEGRATION: CWS dba23c (1.41.34); FILE MERGED
2007/07/17 19:43:47 fs 1.41.34.1: #134461# when the ObjectShell is dying, reset its pointer at the FmFormModel
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/form/fmundo.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx index 782e4b977000..95fd27a53081 100644 --- a/svx/source/form/fmundo.cxx +++ b/svx/source/form/fmundo.cxx @@ -4,9 +4,9 @@ * * $RCSfile: fmundo.cxx,v $ * - * $Revision: 1.41 $ + * $Revision: 1.42 $ * - * last change: $Author: hr $ $Date: 2007-06-27 18:16:17 $ + * last change: $Author: hr $ $Date: 2007-07-31 13:58:18 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -252,7 +252,10 @@ void FmXUndoEnvironment::dispose() UnLock(); - EndListening( *rModel.GetObjectShell() ); + OSL_PRECOND( rModel.GetObjectShell(), "FmXUndoEnvironment::dispose: no object shell anymore!" ); + if ( rModel.GetObjectShell() ) + EndListening( *rModel.GetObjectShell() ); + if ( IsListening( rModel ) ) EndListening( rModel ); @@ -264,6 +267,10 @@ void FmXUndoEnvironment::dispose() //------------------------------------------------------------------------------ void FmXUndoEnvironment::ModeChanged() { + OSL_PRECOND( rModel.GetObjectShell(), "FmXUndoEnvironment::ModeChanged: no object shell anymore!" ); + if ( !rModel.GetObjectShell() ) + return; + if (bReadOnly != (rModel.GetObjectShell()->IsReadOnly() || rModel.GetObjectShell()->IsReadOnlyUI())) { bReadOnly = !bReadOnly; @@ -329,6 +336,7 @@ void FmXUndoEnvironment::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) { case SFX_HINT_DYING: dispose(); + rModel.SetObjectShell( NULL ); break; case SFX_HINT_MODECHANGED: ModeChanged(); |