Coverage Report

Created: 2026-03-31 11:00

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/chart2/source/inc/NumberFormatterWrapper.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 <com/sun/star/util/XNumberFormatsSupplier.hpp>
22
#include <tools/date.hxx>
23
24
class SvNumberFormatter;
25
class Color;
26
27
namespace chart
28
{
29
30
class NumberFormatterWrapper final
31
{
32
public:
33
    NumberFormatterWrapper( const css::uno::Reference< css::util::XNumberFormatsSupplier >& xSupplier );
34
    ~NumberFormatterWrapper();
35
36
0
    SvNumberFormatter* getSvNumberFormatter() const { return m_pNumberFormatter;}
37
    const css::uno::Reference< css::util::XNumberFormatsSupplier >&
38
0
                getNumberFormatsSupplier() const { return m_xNumberFormatsSupplier; };
39
40
    OUString getFormattedString( sal_Int32 nNumberFormatKey, double fValue, Color& rLabelColor, bool& rbColorChanged ) const;
41
    Date    getNullDate() const;
42
43
private: //private member
44
    css::uno::Reference< css::util::XNumberFormatsSupplier >
45
                        m_xNumberFormatsSupplier;
46
47
    SvNumberFormatter* m_pNumberFormatter;
48
    css::uno::Any m_aNullDate;
49
};
50
51
class FixedNumberFormatter final
52
{
53
public:
54
    FixedNumberFormatter( const css::uno::Reference< css::util::XNumberFormatsSupplier >& xSupplier
55
        , sal_Int32 nNumberFormatKey );
56
    ~FixedNumberFormatter();
57
58
    OUString getFormattedString( double fValue, Color& rLabelColor, bool& rbColorChanged ) const;
59
60
private:
61
    NumberFormatterWrapper      m_aNumberFormatterWrapper;
62
    sal_uInt32                       m_nNumberFormatKey;
63
};
64
65
} //namespace chart
66
67
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */