Coverage Report

Created: 2026-04-09 11:41

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/sd/source/ui/view/GraphicViewShellBase.cxx
Line
Count
Source
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 <DrawController.hxx>
24
#include <app.hrc>
25
#include <framework/DrawModule.hxx>
26
#include <framework/FrameworkHelper.hxx>
27
#include <sfx2/request.hxx>
28
#include <sfx2/viewfac.hxx>
29
#include <sfx2/viewfrm.hxx>
30
#include <sfx2/viewsh.hxx>
31
32
namespace sd
33
{
34
// We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
35
// new GraphicViewShellBase object has been constructed.
36
37
SfxViewFactory* GraphicViewShellBase::s_pFactory;
38
SfxViewShell* GraphicViewShellBase::CreateInstance(SfxViewFrame& rFrame, SfxViewShell* pOldView)
39
0
{
40
0
    GraphicViewShellBase* pBase = new GraphicViewShellBase(rFrame, pOldView);
41
0
    pBase->LateInit(framework::FrameworkHelper::msDrawViewURL);
42
0
    return pBase;
43
0
}
44
void GraphicViewShellBase::RegisterFactory(SfxInterfaceId nPrio)
45
0
{
46
0
    s_pFactory = new SfxViewFactory(&CreateInstance, nPrio, "Default");
47
0
    InitFactory();
48
0
}
49
0
void GraphicViewShellBase::InitFactory() { SFX_VIEW_REGISTRATION(GraphicDocShell); }
50
51
GraphicViewShellBase::GraphicViewShellBase(SfxViewFrame& _rFrame, SfxViewShell* pOldShell)
52
0
    : ViewShellBase(_rFrame, pOldShell)
53
0
{
54
0
}
55
56
0
GraphicViewShellBase::~GraphicViewShellBase() {}
57
58
void GraphicViewShellBase::Execute(SfxRequest& rRequest)
59
0
{
60
0
    sal_uInt16 nSlotId = rRequest.GetSlot();
61
62
0
    switch (nSlotId)
63
0
    {
64
0
        case SID_BOTTOM_PANE_IMPRESS:
65
0
        case SID_SLIDE_SORTER_MULTI_PANE_GUI:
66
0
        case SID_SLIDE_SORTER_MODE:
67
0
        case SID_SLIDE_MASTER_MODE:
68
0
        case SID_OUTLINE_MODE:
69
0
        case SID_NOTES_MODE:
70
0
        case SID_NOTES_MASTER_MODE:
71
0
        case SID_HANDOUT_MASTER_MODE:
72
            // Prevent some Impress-only slots from being executed.
73
0
            rRequest.Cancel();
74
0
            break;
75
76
0
        case SID_SWITCH_SHELL:
77
0
        case SID_LEFT_PANE_DRAW:
78
0
        case SID_LEFT_PANE_IMPRESS:
79
0
        default:
80
            // The remaining requests are forwarded to our base class.
81
0
            ViewShellBase::Execute(rRequest);
82
0
            break;
83
0
    }
84
0
}
85
86
void GraphicViewShellBase::InitializeFramework()
87
0
{
88
0
    rtl::Reference<sd::DrawController> xController(GetDrawController());
89
0
    sd::framework::DrawModule::Initialize(xController);
90
0
}
91
92
} // end of namespace sd
93
94
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */