diff options
author | Kurt Zenker <kz@openoffice.org> | 2008-03-06 18:58:21 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2008-03-06 18:58:21 +0000 |
commit | 4ff1a53524e6057c4da8aa2044ba2c01474fde2f (patch) | |
tree | d645231243010c5e278d6295d62ac834ef8a4460 /sfx2/source | |
parent | ba443cb08a579a8343f1fb1deca9cd7278c4de2f (diff) |
INTEGRATION: CWS odbmacros2 (1.79.8); FILE MERGED
2007/12/22 13:50:29 fs 1.79.8.6: #i49133# using SetCurrentDocument means the explicit SfxObjectShell::SetCurrentComponent is not needed anymore
2007/12/22 13:41:06 fs 1.79.8.5: #i49133# +SetCurrentDocument
2007/12/21 20:53:44 fs 1.79.8.4: #i10000#
2007/12/21 20:51:22 fs 1.79.8.3: #i49133# new: virtual GetCurrentDocument
2007/12/20 10:21:49 fs 1.79.8.2: during #i49133#: never set the CurrentComponent (formerly WorkingDocument) to NULL. The general pattern is that every component sets the CurrentComponent to itself upon activation only. Else, we'll have a hard time to a) also support non-SFX documents and b) ensure that the CurrentComponent stays untouched when switching from another document to the Basic IDE
2007/12/18 21:16:02 fs 1.79.8.1: #i49133# SfxObjectShell's WorkingDocument changed to CurrentComponent
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index d87aa63c1ef8..6785a703be68 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -4,9 +4,9 @@ * * $RCSfile: viewsh.cxx,v $ * - * $Revision: 1.80 $ + * $Revision: 1.81 $ * - * last change: $Author: ihi $ $Date: 2008-01-15 15:42:33 $ + * last change: $Author: kz $ $Date: 2008-03-06 19:58:21 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -906,7 +906,7 @@ void SfxViewShell::Activate( BOOL bMDI ) if ( pSh->GetModel().is() ) pSh->GetModel()->setCurrentController( GetViewFrame()->GetFrame()->GetController() ); - SfxObjectShell::SetWorkingDocument( pSh->GetModel() ); + SetCurrentDocument(); } } @@ -1812,6 +1812,28 @@ SfxObjectShell* SfxViewShell::GetObjectShell() //-------------------------------------------------------------------- +Reference< XModel > SfxViewShell::GetCurrentDocument() const +{ + Reference< XModel > xDocument; + + const SfxObjectShell* pDocShell( const_cast< SfxViewShell* >( this )->GetObjectShell() ); + OSL_ENSURE( pDocShell, "SfxViewFrame::GetCurrentDocument: no DocShell!?" ); + if ( pDocShell ) + xDocument = pDocShell->GetModel(); + return xDocument; +} + +//-------------------------------------------------------------------- + +void SfxViewShell::SetCurrentDocument() const +{ + uno::Reference< frame::XModel > xDocument( GetCurrentDocument() ); + if ( xDocument.is() ) + SfxObjectShell::SetCurrentComponent( xDocument ); +} + +//-------------------------------------------------------------------- + const Size& SfxViewShell::GetMargin() const { return pImp->aMargin; |