Coverage Report

Created: 2025-11-16 09:57

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/svl/intitem.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
20
#ifndef INCLUDED_SVL_INTITEM_HXX
21
#define INCLUDED_SVL_INTITEM_HXX
22
23
#include <svl/svldllapi.h>
24
#include <svl/cintitem.hxx>
25
#include <boost/property_tree/ptree_fwd.hpp>
26
27
28
class SVL_DLLPUBLIC SfxByteItem: public CntByteItem
29
{
30
public:
31
    static SfxPoolItem* CreateDefault();
32
    DECLARE_ITEM_TYPE_FUNCTION(SfxByteItem)
33
    explicit SfxByteItem(sal_uInt16 which = 0, sal_uInt8 nValue = 0):
34
60.3k
        CntByteItem(which, nValue) {}
35
36
    virtual SfxByteItem* Clone(SfxItemPool * = nullptr) const override
37
0
    { return new SfxByteItem(*this); }
38
};
39
40
class SVL_DLLPUBLIC SfxInt16Item: public SfxPoolItem
41
{
42
    sal_Int16 m_nValue;
43
44
public:
45
    static SfxPoolItem* CreateDefault();
46
    DECLARE_ITEM_TYPE_FUNCTION(SfxInt16Item)
47
    explicit SfxInt16Item(sal_uInt16 which = 0, sal_Int16 nTheValue = 0):
48
35.5M
        SfxPoolItem(which), m_nValue(nTheValue)
49
35.5M
    {}
50
51
    virtual bool operator ==(const SfxPoolItem & rItem) const override;
52
30
    virtual bool supportsHashCode() const override final { return true; }
53
17.0M
    virtual size_t hashCode() const override final { return m_nValue; }
54
55
    virtual bool GetPresentation(SfxItemPresentation,
56
                                                MapUnit, MapUnit,
57
                                                OUString & rText,
58
                                                const IntlWrapper&)
59
        const override;
60
61
    virtual boost::property_tree::ptree dumpAsJSON() const override;
62
63
    virtual bool QueryValue( css::uno::Any& rVal,
64
                             sal_uInt8 nMemberId = 0 ) const override;
65
66
    virtual bool PutValue( const css::uno::Any& rVal,
67
                           sal_uInt8 nMemberId ) override;
68
69
    virtual SfxInt16Item* Clone(SfxItemPool * = nullptr) const override;
70
71
167M
    sal_Int16 GetValue() const { return m_nValue; }
72
73
410k
    void SetValue(sal_Int16 nTheValue) { ASSERT_CHANGE_REFCOUNTED_ITEM; m_nValue = nTheValue; }
74
};
75
76
77
class SVL_DLLPUBLIC SfxUInt16Item: public CntUInt16Item
78
{
79
public:
80
    static SfxPoolItem* CreateDefault();
81
    DECLARE_ITEM_TYPE_FUNCTION(SfxUInt16Item)
82
    explicit SfxUInt16Item(sal_uInt16 which = 0, sal_uInt16 nValue = 0):
83
5.95M
        CntUInt16Item(which, nValue) {}
84
85
    virtual SfxUInt16Item* Clone(SfxItemPool * = nullptr) const override
86
715k
    { return new SfxUInt16Item(*this); }
87
88
    void dumpAsXml(xmlTextWriterPtr pWriter) const override;
89
    virtual boost::property_tree::ptree dumpAsJSON() const override;
90
};
91
92
93
class SVL_DLLPUBLIC SfxInt32Item: public CntInt32Item
94
{
95
public:
96
    static SfxPoolItem* CreateDefault();
97
98
    DECLARE_ITEM_TYPE_FUNCTION(SfxInt32Item)
99
    explicit SfxInt32Item(sal_uInt16 which = 0, sal_Int32 nValue = 0):
100
8.94M
        CntInt32Item(which, nValue) {}
101
102
    virtual SfxInt32Item* Clone(SfxItemPool * = nullptr) const override
103
16
    { return new SfxInt32Item(*this); }
104
105
    void dumpAsXml(xmlTextWriterPtr pWriter) const override;
106
    virtual boost::property_tree::ptree dumpAsJSON() const override;
107
};
108
109
110
class SVL_DLLPUBLIC SfxUInt32Item: public CntUInt32Item
111
{
112
public:
113
    static SfxPoolItem* CreateDefault();
114
    DECLARE_ITEM_TYPE_FUNCTION(SfxUInt32Item)
115
    explicit SfxUInt32Item(sal_uInt16 which = 0, sal_uInt32 nValue = 0):
116
1.36M
        CntUInt32Item(which, nValue) {}
117
118
    virtual SfxUInt32Item* Clone(SfxItemPool * = nullptr) const override
119
897k
    { return new SfxUInt32Item(*this); }
120
121
    void dumpAsXml(xmlTextWriterPtr pWriter) const override;
122
    virtual boost::property_tree::ptree dumpAsJSON() const override;
123
};
124
125
#endif // INCLUDED_SVL_INTITEM_HXX
126
127
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */