Coverage Report

Created: 2026-08-14 10:22

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/sd/source/ui/view/grviewsh.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 <GraphicViewShell.hxx>
21
#include <LayerTabBar.hxx>
22
#include <FrameView.hxx>
23
#include <sfx2/objsh.hxx>
24
#include <sfx2/viewfrm.hxx>
25
26
constexpr sal_Int32 TAB_HEIGHT_MARGIN = 10;
27
28
namespace sd {
29
30
GraphicViewShell::GraphicViewShell (
31
    ViewShellBase& rViewShellBase,
32
    vcl::Window* pParentWindow,
33
    FrameView* pFrameView)
34
0
    : DrawViewShell (
35
0
        rViewShellBase,
36
0
        pParentWindow,
37
0
        PageKind::Standard,
38
0
        pFrameView)
39
0
{
40
0
    ConstructGraphicViewShell();
41
0
}
42
43
GraphicViewShell::~GraphicViewShell()
44
0
{
45
0
}
46
47
void GraphicViewShell::ConstructGraphicViewShell()
48
0
{
49
0
    meShellType = ST_DRAW;
50
51
0
    mpLayerTabBar.reset (VclPtr<LayerTabBar>::Create(this, GetParentWindow()));
52
53
    // #i67363# no layer tabbar in preview mode
54
0
    if ( !GetObjectShell()->IsPreview() )
55
0
        mpLayerTabBar->Show();
56
0
}
57
58
void GraphicViewShell::ChangeEditMode (
59
    EditMode eMode,
60
    bool )
61
0
{
62
    // There is no page tab that could be shown instead of the layer tab.
63
    // Therefore we have it always visible regardless of what the caller
64
    // said. (We have to change the callers behaviour, of course.)
65
0
    DrawViewShell::ChangeEditMode (eMode, true);
66
0
}
67
68
void GraphicViewShell::ArrangeGUIElements()
69
0
{
70
0
    if (mpLayerTabBar && mpLayerTabBar->IsVisible())
71
0
    {
72
0
        Size aSize = mpLayerTabBar->GetSizePixel();
73
0
        Size aFrameSize;
74
0
        if (SfxViewFrame* pViewFrame = GetViewFrame())
75
0
            aFrameSize = pViewFrame->GetWindow().GetOutputSizePixel();
76
77
0
        aSize.setHeight(GetParentWindow()->GetFont().GetFontHeight() + TAB_HEIGHT_MARGIN);
78
0
        aSize.setWidth( aFrameSize.Width() );
79
80
0
        Point aPos (0, maViewSize.Height() - aSize.Height());
81
82
0
        mpLayerTabBar->SetPosSizePixel (aPos, aSize);
83
0
    }
84
85
0
    DrawViewShell::ArrangeGUIElements();
86
0
}
87
88
} // end of namespace sd
89
90
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */