Coverage Report

Created: 2026-08-14 10:22

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/vcl/source/window/window3.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 <vcl/window.hxx>
21
#include <window.h>
22
#include <vcl/cursor.hxx>
23
#include <salframe.hxx>
24
25
namespace vcl
26
{
27
0
Size Window::GetOptimalSize() const { return Size(); }
28
29
void Window::ImplAdjustNWFSizes()
30
0
{
31
0
    for (Window* pWin = GetWindow(GetWindowType::FirstChild); pWin;
32
0
         pWin = pWin->GetWindow(GetWindowType::Next))
33
0
        pWin->ImplAdjustNWFSizes();
34
0
}
35
36
void WindowOutputDevice::ImplClearFontData(bool bNewFontLists)
37
8
{
38
8
    OutputDevice::ImplClearFontData(bNewFontLists);
39
12
    for (Window* pChild = mxOwnerWindow->mpWindowImpl->mpFirstChild; pChild;
40
8
         pChild = pChild->mpWindowImpl->mpNext)
41
4
        pChild->GetOutDev()->ImplClearFontData(bNewFontLists);
42
8
}
43
44
void WindowOutputDevice::ImplRefreshFontData(bool bNewFontLists)
45
8
{
46
8
    OutputDevice::ImplRefreshFontData(bNewFontLists);
47
12
    for (Window* pChild = mxOwnerWindow->mpWindowImpl->mpFirstChild; pChild;
48
8
         pChild = pChild->mpWindowImpl->mpNext)
49
4
        pChild->GetOutDev()->ImplRefreshFontData(bNewFontLists);
50
8
}
51
52
void WindowOutputDevice::ImplInitMapModeObjects()
53
87.4k
{
54
87.4k
    OutputDevice::ImplInitMapModeObjects();
55
87.4k
    if (mxOwnerWindow->mpWindowImpl->mpCursor)
56
82.5k
        mxOwnerWindow->mpWindowImpl->mpCursor->ImplNew();
57
87.4k
}
58
59
16.7k
const Font& Window::GetFont() const { return GetOutDev()->GetFont(); }
60
0
void Window::SetFont(Font const& font) { return GetOutDev()->SetFont(font); }
61
62
2
float Window::approximate_char_width() const { return GetOutDev()->approximate_char_width(); }
63
64
37.4k
const Wallpaper& Window::GetBackground() const { return GetOutDev()->GetBackground(); }
65
33.1k
bool Window::IsBackground() const { return GetOutDev()->IsBackground(); }
66
20.7k
tools::Long Window::GetTextHeight() const { return GetOutDev()->GetTextHeight(); }
67
tools::Long Window::GetTextWidth(const OUString& rStr, sal_Int32 nIndex, sal_Int32 nLen,
68
                                 vcl::text::TextLayoutCache const* pCache,
69
                                 SalLayoutGlyphs const* const pLayoutCache) const
70
8.17k
{
71
8.17k
    return GetOutDev()->GetTextWidth(rStr, nIndex, nLen, pCache, pLayoutCache);
72
8.17k
}
73
0
float Window::approximate_digit_width() const { return GetOutDev()->approximate_digit_width(); }
74
75
bool Window::IsNativeControlSupported(ControlType nType, ControlPart nPart) const
76
24.9k
{
77
24.9k
    return GetOutDev()->IsNativeControlSupported(nType, nPart);
78
24.9k
}
79
80
bool Window::GetNativeControlRegion(ControlType nType, ControlPart nPart,
81
                                    const tools::Rectangle& rControlRegion, ControlState nState,
82
                                    const ImplControlValue& aValue,
83
                                    tools::Rectangle& rNativeBoundingRegion,
84
                                    tools::Rectangle& rNativeContentRegion) const
85
0
{
86
0
    return GetOutDev()->GetNativeControlRegion(nType, nPart, rControlRegion, nState, aValue,
87
0
                                               rNativeBoundingRegion, rNativeContentRegion);
88
0
}
89
90
Size Window::GetOutputSizePixel() const
91
63.1k
{
92
63.1k
    if (!mpWindowImpl)
93
0
    {
94
0
        return Size();
95
0
    }
96
97
63.1k
    return GetOutDev()->GetOutputSizePixel();
98
63.1k
}
99
100
0
tools::Rectangle Window::GetOutputRectPixel() const { return GetOutDev()->GetOutputRectPixel(); }
101
102
0
void Window::SetTextLineColor() { GetOutDev()->SetTextLineColor(); }
103
0
void Window::SetTextLineColor(const Color& rColor) { GetOutDev()->SetTextLineColor(rColor); }
104
0
void Window::SetOverlineColor() { GetOutDev()->SetOverlineColor(); }
105
0
void Window::SetOverlineColor(const Color& rColor) { GetOutDev()->SetOverlineColor(rColor); }
106
20.9k
void Window::SetTextFillColor() { GetOutDev()->SetTextFillColor(); }
107
0
void Window::SetTextFillColor(const Color& rColor) { GetOutDev()->SetTextFillColor(rColor); }
108
41.5k
const MapMode& Window::GetMapMode() const { return GetOutDev()->GetMapMode(); }
109
16.8k
void Window::SetBackground() { GetOutDev()->SetBackground(); }
110
void Window::SetBackground(const Wallpaper& rBackground)
111
41.6k
{
112
41.6k
    GetOutDev()->SetBackground(rBackground);
113
41.6k
}
114
0
void Window::EnableMapMode(bool bEnable) { GetOutDev()->EnableMapMode(bEnable); }
115
41.1k
bool Window::IsMapModeEnabled() const { return GetOutDev()->IsMapModeEnabled(); }
116
117
0
void Window::SetTextColor(const Color& rColor) { GetOutDev()->SetTextColor(rColor); }
118
16.7k
const Color& Window::GetTextColor() const { return GetOutDev()->GetTextColor(); }
119
0
const Color& Window::GetTextLineColor() const { return GetOutDev()->GetTextLineColor(); }
120
121
0
bool Window::IsTextLineColor() const { return GetOutDev()->IsTextLineColor(); }
122
123
8.28k
Color Window::GetTextFillColor() const { return GetOutDev()->GetTextFillColor(); }
124
125
0
bool Window::IsTextFillColor() const { return GetOutDev()->IsTextFillColor(); }
126
127
0
const Color& Window::GetOverlineColor() const { return GetOutDev()->GetOverlineColor(); }
128
0
bool Window::IsOverlineColor() const { return GetOutDev()->IsOverlineColor(); }
129
0
void Window::SetTextAlign(TextAlign eAlign) { GetOutDev()->SetTextAlign(eAlign); }
130
131
8.28k
float Window::GetDPIScaleFactor() const { return GetOutDev()->GetDPIScaleFactor(); }
132
0
tools::Long Window::GetDeviceOriginX() const { return GetOutDev()->GetDeviceOriginX(); }
133
0
tools::Long Window::GetDeviceOriginY() const { return GetOutDev()->GetDeviceOriginY(); }
134
41.1k
void Window::SetMapMode() { GetOutDev()->SetMapMode(); }
135
45.6k
void Window::SetMapMode(const MapMode& rNewMapMode) { GetOutDev()->SetMapMode(rNewMapMode); }
136
0
bool Window::IsRTLEnabled() const { return GetOutDev()->IsRTLEnabled(); }
137
8.48k
TextAlign Window::GetTextAlign() const { return GetOutDev()->GetTextAlign(); }
138
53.8k
const AllSettings& Window::GetSettings() const { return GetOutDev()->GetSettings(); }
139
140
Point Window::LogicToPixel(const Point& rLogicPt) const
141
160
{
142
160
    return GetOutDev()->LogicToPixel(rLogicPt);
143
160
}
144
Size Window::LogicToPixel(const Size& rLogicSize) const
145
918
{
146
918
    return GetOutDev()->LogicToPixel(rLogicSize);
147
918
}
148
tools::Rectangle Window::LogicToPixel(const tools::Rectangle& rLogicRect) const
149
0
{
150
0
    return GetOutDev()->LogicToPixel(rLogicRect);
151
0
}
152
vcl::Region Window::LogicToPixel(const vcl::Region& rLogicRegion) const
153
0
{
154
0
    return GetOutDev()->LogicToPixel(rLogicRegion);
155
0
}
156
Point Window::LogicToPixel(const Point& rLogicPt, const MapMode& rMapMode) const
157
0
{
158
0
    return GetOutDev()->LogicToPixel(rLogicPt, rMapMode);
159
0
}
160
Size Window::LogicToPixel(const Size& rLogicSize, const MapMode& rMapMode) const
161
0
{
162
0
    return GetOutDev()->LogicToPixel(rLogicSize, rMapMode);
163
0
}
164
tools::Rectangle Window::LogicToPixel(const tools::Rectangle& rLogicRect,
165
                                      const MapMode& rMapMode) const
166
0
{
167
0
    return GetOutDev()->LogicToPixel(rLogicRect, rMapMode);
168
0
}
169
170
Point Window::PixelToLogic(const Point& rDevicePt) const
171
4.30k
{
172
4.30k
    return GetOutDev()->PixelToLogic(rDevicePt);
173
4.30k
}
174
Size Window::PixelToLogic(const Size& rDeviceSize) const
175
0
{
176
0
    return GetOutDev()->PixelToLogic(rDeviceSize);
177
0
}
178
tools::Rectangle Window::PixelToLogic(const tools::Rectangle& rDeviceRect) const
179
281
{
180
281
    return GetOutDev()->PixelToLogic(rDeviceRect);
181
281
}
182
tools::PolyPolygon Window::PixelToLogic(const tools::PolyPolygon& rDevicePolyPoly) const
183
0
{
184
0
    return GetOutDev()->PixelToLogic(rDevicePolyPoly);
185
0
}
186
vcl::Region Window::PixelToLogic(const vcl::Region& rDeviceRegion) const
187
0
{
188
0
    return GetOutDev()->PixelToLogic(rDeviceRegion);
189
0
}
190
Point Window::PixelToLogic(const Point& rDevicePt, const MapMode& rMapMode) const
191
0
{
192
0
    return GetOutDev()->PixelToLogic(rDevicePt, rMapMode);
193
0
}
194
Size Window::PixelToLogic(const Size& rDeviceSize, const MapMode& rMapMode) const
195
80
{
196
80
    return GetOutDev()->PixelToLogic(rDeviceSize, rMapMode);
197
80
}
198
tools::Rectangle Window::PixelToLogic(const tools::Rectangle& rDeviceRect,
199
                                      const MapMode& rMapMode) const
200
0
{
201
0
    return GetOutDev()->PixelToLogic(rDeviceRect, rMapMode);
202
0
}
203
204
Size Window::LogicToLogic(const Size& rSzSource, const MapMode* pMapModeSource,
205
                          const MapMode* pMapModeDest) const
206
0
{
207
0
    return GetOutDev()->LogicToLogic(rSzSource, pMapModeSource, pMapModeDest);
208
0
}
209
210
tools::Rectangle Window::GetTextRect(const tools::Rectangle& rRect, const OUString& rStr,
211
                                     DrawTextFlags nStyle, TextRectInfo* pInfo,
212
                                     const vcl::TextLayoutCommon* _pTextLayout) const
213
0
{
214
0
    return GetOutDev()->GetTextRect(rRect, rStr, nStyle, pInfo, _pTextLayout);
215
0
}
216
217
0
void Window::SetSettings(const AllSettings& rSettings) { GetOutDev()->SetSettings(rSettings); }
218
void Window::SetSettings(const AllSettings& rSettings, bool bChild)
219
0
{
220
0
    static_cast<vcl::WindowOutputDevice*>(GetOutDev())->SetSettings(rSettings, bChild);
221
0
}
222
223
0
Color Window::GetBackgroundColor() const { return GetOutDev()->GetBackgroundColor(); }
224
225
8.28k
void Window::EnableRTL(bool bEnable) { GetOutDev()->EnableRTL(bEnable); }
226
227
void Window::FlashWindow() const
228
0
{
229
0
    vcl::Window* pMyParent = ImplGetTopmostFrameWindow();
230
231
0
    if (pMyParent && pMyParent->mpWindowImpl)
232
0
        pMyParent->mpWindowImpl->mpFrame->FlashWindow();
233
0
}
234
235
void Window::SetTaskBarProgress(int nCurrentProgress)
236
27.9k
{
237
27.9k
    vcl::Window* pMyParent = ImplGetTopmostFrameWindow();
238
239
27.9k
    if (pMyParent && pMyParent->mpWindowImpl)
240
27.9k
        pMyParent->mpWindowImpl->mpFrame->SetTaskBarProgress(nCurrentProgress);
241
27.9k
}
242
243
void Window::SetTaskBarState(VclTaskBarStates eTaskBarState)
244
8.17k
{
245
8.17k
    vcl::Window* pMyParent = ImplGetTopmostFrameWindow();
246
247
8.17k
    if (pMyParent && pMyParent->mpWindowImpl)
248
8.17k
        pMyParent->mpWindowImpl->mpFrame->SetTaskBarState(eTaskBarState);
249
8.17k
}
250
251
} /* namespace vcl */
252
253
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */