Coverage Report

Created: 2026-02-14 09:37

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