LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/sd/source/ui/view - ImpressViewShellBase.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 24 32 75.0 %
Date: 2013-07-09 Functions: 12 15 80.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : 
      21             : #include "ImpressViewShellBase.hxx"
      22             : 
      23             : #include "DrawDocShell.hxx"
      24             : #include "sdresid.hxx"
      25             : #include "strings.hrc"
      26             : #include "app.hrc"
      27             : #include "framework/FrameworkHelper.hxx"
      28             : #include "framework/ImpressModule.hxx"
      29             : #include "MasterPageObserver.hxx"
      30             : #include <sfx2/request.hxx>
      31             : 
      32             : namespace sd {
      33             : 
      34         945 : TYPEINIT1(ImpressViewShellBase, ViewShellBase);
      35             : 
      36             : // We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
      37             : // new ImpressViewShellBase object has been constructed.
      38             : 
      39             : SfxViewFactory* ImpressViewShellBase::pFactory;
      40          13 : SfxViewShell* ImpressViewShellBase::CreateInstance (
      41             :     SfxViewFrame *pFrame, SfxViewShell *pOldView)
      42             : {
      43          13 :     ImpressViewShellBase* pBase = new ImpressViewShellBase(pFrame, pOldView);
      44          13 :     pBase->LateInit("");
      45          13 :     return pBase;
      46             : }
      47          10 : void ImpressViewShellBase::RegisterFactory( sal_uInt16 nPrio )
      48             : {
      49          10 :     pFactory = new SfxViewFactory(&CreateInstance,nPrio,"Default");
      50          10 :     InitFactory();
      51          10 : }
      52          10 : void ImpressViewShellBase::InitFactory()
      53             : {
      54          10 :     SFX_VIEW_REGISTRATION(DrawDocShell);
      55          10 : }
      56             : 
      57             : 
      58             : 
      59             : 
      60             : 
      61             : 
      62             : 
      63             : 
      64          13 : ImpressViewShellBase::ImpressViewShellBase (
      65             :     SfxViewFrame* _pFrame,
      66             :     SfxViewShell* pOldShell)
      67          13 :     : ViewShellBase (_pFrame, pOldShell)
      68             : {
      69          13 :     MasterPageObserver::Instance().RegisterDocument (*GetDocShell()->GetDoc());
      70          13 : }
      71             : 
      72             : 
      73             : 
      74             : 
      75          39 : ImpressViewShellBase::~ImpressViewShellBase (void)
      76             : {
      77          13 :     MasterPageObserver::Instance().UnregisterDocument (*GetDocShell()->GetDoc());
      78          26 : }
      79             : 
      80             : 
      81             : 
      82             : 
      83           0 : void ImpressViewShellBase::Execute (SfxRequest& rRequest)
      84             : {
      85           0 :     sal_uInt16 nSlotId = rRequest.GetSlot();
      86             : 
      87           0 :     switch (nSlotId)
      88             :     {
      89             :         case SID_LEFT_PANE_DRAW:
      90             :             // Prevent a Draw-only slots from being executed.
      91           0 :             rRequest.Cancel();
      92           0 :             break;
      93             : 
      94             :         default:
      95             :             // The remaining requests are forwarded to our base class.
      96           0 :             ViewShellBase::Execute(rRequest);
      97           0 :             break;
      98             :     }
      99           0 : }
     100             : 
     101             : 
     102             : 
     103             : 
     104          13 : void ImpressViewShellBase::InitializeFramework (void)
     105             : {
     106             :     ::com::sun::star::uno::Reference<com::sun::star::frame::XController>
     107          13 :         xController (GetController());
     108          13 :     sd::framework::ImpressModule::Initialize(xController);
     109          13 : }
     110             : 
     111          33 : } // end of namespace sd
     112             : 
     113             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10