Coverage Report

Created: 2026-09-28 10:59

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/vcl/rendercontext/ImplMapRes.hxx
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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
#pragma once
21
22
#include <tools/long.hxx>
23
#include <o3tl/unit_conversion.hxx>
24
25
class MapMode;
26
27
struct ImplMapRes
28
{
29
4.39M
    ImplMapRes() = default;
30
    ImplMapRes(const MapMode& rMapMode, tools::Long nDPIX, tools::Long nDPIY);
31
32
    void SetMapRes(const o3tl::Length eUnit);
33
    void CalcMapResolution(const MapMode& rMapMode, tools::Long nDPIX, tools::Long nDPIY);
34
    ImplMapRes ResolveMapRes(const MapMode* pMode, const MapMode& rDefaultMapMode, bool bMap,
35
                             tools::Long nDPIX, tools::Long nDPIY);
36
37
    tools::Long ScaleDistanceX(const tools::Long nDistance, const ImplMapRes& rDestRes) const;
38
    tools::Long ScaleDistanceY(const tools::Long nDistance, const ImplMapRes& rDestRes) const;
39
40
    tools::Long LocalToAbsoluteX(const tools::Long nLocalX) const;
41
    tools::Long AbsoluteToLocalX(const tools::Long nLocalX) const;
42
43
    tools::Long LocalToAbsoluteY(const tools::Long nLocalY) const;
44
    tools::Long AbsoluteToLocalY(const tools::Long nLocalY) const;
45
46
    tools::Long TransformPointX(const tools::Long nLocalX, const ImplMapRes& rDestRes) const;
47
    tools::Long TransformPointY(const tools::Long nLocalY, const ImplMapRes& rDestRes) const;
48
49
    tools::Long mnMapOfsX = 0; ///< Offset in X direction
50
    tools::Long mnMapOfsY = 0; ///< Offset in Y direction
51
    double mfMapScX = 1; ///< Scaling factor in X direction
52
    double mfMapScY = 1; ///< Scaling factor in Y direction
53
};
54
55
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */