Coverage Report

Created: 2026-04-09 11:41

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/svl/cintitem.hxx
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
#pragma once
20
21
#include <svl/svldllapi.h>
22
#include <svl/poolitem.hxx>
23
24
class SVL_DLLPUBLIC CntByteItem: public SfxPoolItem
25
{
26
    sal_uInt8 m_nValue;
27
28
public:
29
    DECLARE_ITEM_TYPE_FUNCTION(CntByteItem)
30
    CntByteItem(sal_uInt16 which, sal_uInt8 nTheValue):
31
61.7k
        SfxPoolItem(which), m_nValue(nTheValue) {}
32
33
    virtual bool operator ==(const SfxPoolItem & rItem) const override final;
34
35
    virtual bool supportsHashCode() const override final;
36
    virtual size_t hashCode() const override final;
37
38
    virtual bool GetPresentation(SfxItemPresentation,
39
                                 MapUnit, MapUnit,
40
                                 OUString & rText,
41
                                 const IntlWrapper&)
42
        const override;
43
44
    virtual bool QueryValue(css::uno::Any& rVal,
45
                            sal_uInt8 nMemberId = 0) const override;
46
47
    virtual bool PutValue(const css::uno::Any& rVal,
48
                          sal_uInt8 nMemberId) override;
49
50
    virtual CntByteItem* Clone(SfxItemPool * = nullptr) const override;
51
52
254k
    sal_uInt8 GetValue() const { return m_nValue; }
53
54
15
    void SetValue(sal_uInt8 nTheValue) { ASSERT_CHANGE_REFCOUNTED_ITEM; m_nValue = nTheValue; }
55
};
56
57
class SVL_DLLPUBLIC CntUInt16Item: public SfxPoolItem
58
{
59
    sal_uInt16 m_nValue;
60
61
public:
62
    DECLARE_ITEM_TYPE_FUNCTION(CntUInt16Item)
63
    CntUInt16Item(sal_uInt16 which, sal_uInt16 nTheValue):
64
5.83M
        SfxPoolItem(which), m_nValue(nTheValue)
65
5.83M
    {}
66
67
    virtual bool operator ==(const SfxPoolItem & rItem) const override;
68
69
    virtual bool supportsHashCode() const override final;
70
    virtual size_t hashCode() const override final;
71
72
    virtual bool GetPresentation(SfxItemPresentation,
73
                                 MapUnit, MapUnit,
74
                                 OUString & rText,
75
                                 const IntlWrapper&)
76
        const override;
77
78
    virtual bool QueryValue(css::uno::Any& rVal,
79
                            sal_uInt8 nMemberId = 0) const override;
80
81
    virtual bool PutValue(const css::uno::Any& rVal,
82
                          sal_uInt8 nMemberId) override;
83
84
    virtual CntUInt16Item* Clone(SfxItemPool * = nullptr) const override;
85
86
105M
    sal_uInt16 GetValue() const { return m_nValue; }
87
88
47.2k
    void SetValue(sal_uInt16 nTheValue) { ASSERT_CHANGE_REFCOUNTED_ITEM; m_nValue = nTheValue; }
89
};
90
91
92
class SVL_DLLPUBLIC CntInt32Item: public SfxPoolItem
93
{
94
    sal_Int32 m_nValue;
95
96
public:
97
    DECLARE_ITEM_TYPE_FUNCTION(CntInt32Item)
98
    CntInt32Item(sal_uInt16 which, sal_Int32 nTheValue):
99
9.06M
        SfxPoolItem(which), m_nValue(nTheValue)
100
9.06M
    {}
101
102
    virtual bool operator ==(const SfxPoolItem & rItem) const override final;
103
104
    virtual bool supportsHashCode() const override final;
105
    virtual size_t hashCode() const override final;
106
107
    virtual bool GetPresentation(SfxItemPresentation,
108
                                 MapUnit, MapUnit,
109
                                 OUString & rText,
110
                                 const IntlWrapper&)
111
        const override;
112
113
    virtual bool QueryValue(css::uno::Any& rVal,
114
                            sal_uInt8 nMemberId = 0) const override;
115
116
    virtual bool PutValue(const css::uno::Any& rVal,
117
                          sal_uInt8 nMemberId) override;
118
119
    virtual CntInt32Item* Clone(SfxItemPool * = nullptr) const override;
120
121
16.5M
    sal_Int32 GetValue() const { return m_nValue; }
122
123
77.7k
    void SetValue(sal_Int32 nTheValue) { ASSERT_CHANGE_REFCOUNTED_ITEM; m_nValue = nTheValue; }
124
};
125
126
127
class SVL_DLLPUBLIC CntUInt32Item: public SfxPoolItem
128
{
129
    sal_uInt32 m_nValue;
130
131
public:
132
    DECLARE_ITEM_TYPE_FUNCTION(CntUInt32Item)
133
    CntUInt32Item(sal_uInt16 which, sal_uInt32 nTheValue):
134
1.40M
        SfxPoolItem(which), m_nValue(nTheValue)
135
1.40M
    {}
136
137
    virtual bool operator ==(const SfxPoolItem & rItem) const override;
138
139
    virtual bool supportsHashCode() const override final;
140
    virtual size_t hashCode() const override final;
141
142
    virtual bool GetPresentation(SfxItemPresentation,
143
                                 MapUnit, MapUnit,
144
                                 OUString & rText,
145
                                 const IntlWrapper&)
146
        const override;
147
148
    virtual bool QueryValue(css::uno::Any& rVal,
149
                            sal_uInt8 nMemberId = 0) const override;
150
151
    virtual bool PutValue(const css::uno::Any& rVal,
152
                          sal_uInt8 nMemberId) override;
153
154
    virtual CntUInt32Item* Clone(SfxItemPool * = nullptr) const override;
155
156
748k
    sal_uInt32 GetValue() const { return m_nValue; }
157
158
830
    void SetValue(sal_uInt32 nTheValue) { ASSERT_CHANGE_REFCOUNTED_ITEM; m_nValue = nTheValue; }
159
};
160
161
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */