Coverage Report

Created: 2026-08-14 10:22

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/svx/source/items/numinf.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 <svx/numinf.hxx>
21
22
23
SvxNumberInfoItem::SvxNumberInfoItem( SvNumberFormatter* pNumFormatter,
24
                                      const TypedWhichId<SvxNumberInfoItem> nId ) :
25
0
    SfxPoolItem     ( nId ),
26
0
    pFormatter      ( pNumFormatter ),
27
0
    eValueType      ( SvxNumberValueType::Undefined ),
28
0
    aStringVal      ( u""_ustr ),
29
0
    nDoubleVal      ( 0 )
30
0
{
31
0
}
32
33
34
SvxNumberInfoItem::SvxNumberInfoItem( SvNumberFormatter* pNumFormatter,
35
                                      OUString aVal, const TypedWhichId<SvxNumberInfoItem> nId ) :
36
0
    SfxPoolItem     ( nId ),
37
0
    pFormatter      ( pNumFormatter ),
38
0
    eValueType      ( SvxNumberValueType::String ),
39
0
    aStringVal      (std::move( aVal )),
40
0
    nDoubleVal      ( 0 )
41
0
{
42
0
}
43
44
45
SvxNumberInfoItem::SvxNumberInfoItem( SvNumberFormatter* pNumFormatter,
46
                                      const double& rVal, const TypedWhichId<SvxNumberInfoItem> nId ) :
47
0
    SfxPoolItem     ( nId ),
48
0
    pFormatter      ( pNumFormatter ),
49
0
    eValueType      ( SvxNumberValueType::Number ),
50
0
    aStringVal      ( u""_ustr ),
51
0
    nDoubleVal      ( rVal )
52
0
{
53
0
}
54
55
56
SvxNumberInfoItem::SvxNumberInfoItem( SvNumberFormatter* pNumFormatter,
57
                                      const double& rVal, OUString aValueStr,
58
                                      const TypedWhichId<SvxNumberInfoItem> nId ) :
59
0
    SfxPoolItem     ( nId ),
60
0
    pFormatter      ( pNumFormatter ),
61
0
    eValueType      ( SvxNumberValueType::Number ),
62
0
    aStringVal      (std::move( aValueStr )),
63
0
    nDoubleVal      ( rVal )
64
0
{
65
0
}
66
67
68
SvxNumberInfoItem::SvxNumberInfoItem( const SvxNumberInfoItem& rItem ) :
69
0
    SfxPoolItem  ( rItem ),
70
0
    pFormatter   ( rItem.pFormatter ),
71
0
    eValueType   ( rItem.eValueType ),
72
0
    aStringVal   ( rItem.aStringVal ),
73
0
    nDoubleVal   ( rItem.nDoubleVal ),
74
0
    mvDelFormats( rItem.mvDelFormats )
75
0
{
76
0
}
77
78
79
SvxNumberInfoItem::~SvxNumberInfoItem()
80
0
{
81
0
}
82
83
84
bool SvxNumberInfoItem::GetPresentation
85
(
86
    SfxItemPresentation /*ePres*/,
87
    MapUnit             /*eCoreUnit*/,
88
    MapUnit             /*ePresUnit*/,
89
    OUString&           rText, const IntlWrapper&
90
)   const
91
0
{
92
0
    rText.clear();
93
0
    return false;
94
0
}
95
96
97
bool SvxNumberInfoItem::operator==( const SfxPoolItem& rItem ) const
98
0
{
99
0
    assert(SfxPoolItem::operator==(rItem));
100
101
0
    const SvxNumberInfoItem& rOther = static_cast<const SvxNumberInfoItem&>(rItem);
102
103
0
    return mvDelFormats == rOther.mvDelFormats &&
104
0
           pFormatter == rOther.pFormatter &&
105
0
           eValueType == rOther.eValueType &&
106
0
           nDoubleVal == rOther.nDoubleVal &&
107
0
           aStringVal == rOther.aStringVal;
108
0
}
109
110
SvxNumberInfoItem* SvxNumberInfoItem::Clone( SfxItemPool * ) const
111
0
{
112
0
    return new SvxNumberInfoItem( *this );
113
0
}
114
115
void SvxNumberInfoItem::SetDelFormats( std::vector<sal_uInt32> && aData )
116
0
{
117
0
    mvDelFormats = std::move(aData);
118
0
}
119
120
121
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */