diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2007-04-03 15:26:19 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2007-04-03 15:26:19 +0000 |
commit | 583dffe7638e10bd120c04bd4a9716f03d9a7492 (patch) | |
tree | 8b010f50f626c475aa06d86a41454a4c8841dcf9 /sd/source | |
parent | ef172f8fa346bb945c5cdb735e4d68829b6e5f2b (diff) |
INTEGRATION: CWS components1 (1.1.2); FILE ADDED
2007/01/29 15:27:07 af 1.1.2.5: #68075# Resolved resync problems.
2006/09/15 09:38:56 af 1.1.2.4: #i68075# Tell the MasterPageObserver about the new document.
2006/09/07 14:51:55 af 1.1.2.3: #i68075# Transition from URL to ResourceId.
2006/08/28 14:32:33 af 1.1.2.2: #i68075# Fixed compiler problems.
2006/08/22 09:18:18 af 1.1.2.1: #i68075# Initial revision.
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/view/ImpressViewShellBase.cxx | 141 |
1 files changed, 141 insertions, 0 deletions
diff --git a/sd/source/ui/view/ImpressViewShellBase.cxx b/sd/source/ui/view/ImpressViewShellBase.cxx new file mode 100644 index 000000000000..a06a72040f91 --- /dev/null +++ b/sd/source/ui/view/ImpressViewShellBase.cxx @@ -0,0 +1,141 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: ImpressViewShellBase.cxx,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2007-04-03 16:26:19 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#include "precompiled_sd.hxx" + +#include "ImpressViewShellBase.hxx" + +#include "DrawDocShell.hxx" +#ifndef SD_RESID_HXX +#include "sdresid.hxx" +#endif +#include "strings.hrc" +#include "app.hrc" +#include "framework/FrameworkHelper.hxx" +#include "framework/ImpressModule.hxx" +#include "MasterPageObserver.hxx" + +#ifndef _SFXREQUEST_HXX +#include <sfx2/request.hxx> +#endif + +namespace sd { + +TYPEINIT1(ImpressViewShellBase, ViewShellBase); + +// We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a +// new ImpressViewShellBase object has been constructed. + +/* +SFX_IMPL_VIEWFACTORY(ImpressViewShellBase, SdResId(STR_DEFAULTVIEW)) +{ + SFX_VIEW_REGISTRATION(DrawDocShell); +} +*/ +SfxViewFactory* ImpressViewShellBase::pFactory; +SfxViewShell* __EXPORT ImpressViewShellBase::CreateInstance ( + SfxViewFrame *pFrame, SfxViewShell *pOldView) +{ + ImpressViewShellBase* pBase = new ImpressViewShellBase(pFrame, pOldView); + pBase->LateInit(::rtl::OUString()); + return pBase; +} +void ImpressViewShellBase::RegisterFactory( USHORT nPrio ) +{ + pFactory = new SfxViewFactory( + &CreateInstance,&InitFactory,nPrio,SdResId(STR_DEFAULTVIEW)); + InitFactory(); +} +void ImpressViewShellBase::InitFactory() +{ + SFX_VIEW_REGISTRATION(DrawDocShell); +} + + + + + + + + +ImpressViewShellBase::ImpressViewShellBase ( + SfxViewFrame* _pFrame, + SfxViewShell* pOldShell) + : ViewShellBase (_pFrame, pOldShell) +{ + MasterPageObserver::Instance().RegisterDocument (*GetDocShell()->GetDoc()); +} + + + + +ImpressViewShellBase::~ImpressViewShellBase (void) +{ + MasterPageObserver::Instance().UnregisterDocument (*GetDocShell()->GetDoc()); +} + + + + +void ImpressViewShellBase::Execute (SfxRequest& rRequest) +{ + USHORT nSlotId = rRequest.GetSlot(); + + switch (nSlotId) + { + case SID_LEFT_PANE_DRAW: + // Prevent a Draw-only slots from being executed. + rRequest.Cancel(); + break; + + default: + // The remaining requests are forwarded to our base class. + ViewShellBase::Execute(rRequest); + break; + } +} + + + + +void ImpressViewShellBase::InitializeFramework (void) +{ + ::com::sun::star::uno::Reference<com::sun::star::frame::XController> + xController (GetController()); + sd::framework::ImpressModule::Initialize(xController); +} + +} // end of namespace sd + |