LCOV - code coverage report
Current view: top level - sd/source/ui/view - GraphicViewShellBase.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 22 30 73.3 %
Date: 2015-06-13 12:38:46 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             : #include "GraphicViewShellBase.hxx"
      21             : 
      22             : #include "GraphicDocShell.hxx"
      23             : #include "sdresid.hxx"
      24             : #include "strings.hrc"
      25             : #include "app.hrc"
      26             : #include "framework/DrawModule.hxx"
      27             : #include "framework/FrameworkHelper.hxx"
      28             : #include <sfx2/request.hxx>
      29             : #include <sfx2/viewfrm.hxx>
      30             : #include <sfx2/viewsh.hxx>
      31             : 
      32             : namespace sd {
      33             : 
      34        3636 : TYPEINIT1(GraphicViewShellBase, ViewShellBase);
      35             : 
      36             : // We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
      37             : // new GraphicViewShellBase object has been constructed.
      38             : 
      39             : SfxViewFactory* GraphicViewShellBase::pFactory;
      40          86 : SfxViewShell* GraphicViewShellBase::CreateInstance (
      41             :     SfxViewFrame *pFrame, SfxViewShell *pOldView)
      42             : {
      43          86 :     GraphicViewShellBase* pBase = new GraphicViewShellBase(pFrame, pOldView);
      44          86 :     pBase->LateInit(framework::FrameworkHelper::msDrawViewURL);
      45          86 :     return pBase;
      46             : }
      47          21 : void GraphicViewShellBase::RegisterFactory( sal_uInt16 nPrio )
      48             : {
      49          21 :     pFactory = new SfxViewFactory(&CreateInstance,nPrio,"Default");
      50          21 :     InitFactory();
      51          21 : }
      52          21 : void GraphicViewShellBase::InitFactory()
      53             : {
      54          21 :     SFX_VIEW_REGISTRATION(GraphicDocShell);
      55          21 : }
      56             : 
      57          86 : GraphicViewShellBase::GraphicViewShellBase (
      58             :     SfxViewFrame* _pFrame,
      59             :     SfxViewShell* pOldShell)
      60          86 :     : ViewShellBase (_pFrame, pOldShell)
      61             : {
      62          86 : }
      63             : 
      64         172 : GraphicViewShellBase::~GraphicViewShellBase()
      65             : {
      66         172 : }
      67             : 
      68           0 : void GraphicViewShellBase::Execute (SfxRequest& rRequest)
      69             : {
      70           0 :     sal_uInt16 nSlotId = rRequest.GetSlot();
      71             : 
      72           0 :     switch (nSlotId)
      73             :     {
      74             :         case SID_NOTES_WINDOW:
      75             :         case SID_SLIDE_SORTER_MULTI_PANE_GUI:
      76             :         case SID_DIAMODE:
      77             :         case SID_OUTLINEMODE:
      78             :         case SID_NOTESMODE:
      79             :         case SID_HANDOUTMODE:
      80             :             // Prevent some Impress-only slots from being executed.
      81           0 :             rRequest.Cancel();
      82           0 :             break;
      83             : 
      84             :         case SID_TASKPANE:
      85             :         case SID_SWITCH_SHELL:
      86             :         case SID_LEFT_PANE_DRAW:
      87             :         case SID_LEFT_PANE_IMPRESS:
      88             :         default:
      89             :             // The remaining requests are forwarded to our base class.
      90           0 :             ViewShellBase::Execute (rRequest);
      91           0 :             break;
      92             :     }
      93             : 
      94           0 : }
      95             : 
      96          86 : void GraphicViewShellBase::InitializeFramework()
      97             : {
      98             :     com::sun::star::uno::Reference<com::sun::star::frame::XController>
      99          86 :         xController (GetController());
     100          86 :     sd::framework::DrawModule::Initialize(xController);
     101          86 : }
     102             : 
     103          66 : } // end of namespace sd
     104             : 
     105             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11