LibreOffice Module svx (master) 1
numinf.cxx
Go to the documentation of this file.
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
25 SfxPoolItem ( nId ),
26 pFormatter ( nullptr ),
27 eValueType ( SvxNumberValueType::Undefined ),
28 aStringVal ( "" ),
29 nDoubleVal ( 0 )
30{
31}
32
33
36 SfxPoolItem ( nId ),
37 pFormatter ( pNumFormatter ),
38 eValueType ( SvxNumberValueType::Undefined ),
39 aStringVal ( "" ),
40 nDoubleVal ( 0 )
41{
42}
43
44
46 OUString aVal, const TypedWhichId<SvxNumberInfoItem> nId ) :
47 SfxPoolItem ( nId ),
48 pFormatter ( pNumFormatter ),
49 eValueType ( SvxNumberValueType::String ),
50 aStringVal (std::move( aVal )),
51 nDoubleVal ( 0 )
52{
53}
54
55
57 const double& rVal, const TypedWhichId<SvxNumberInfoItem> nId ) :
58 SfxPoolItem ( nId ),
59 pFormatter ( pNumFormatter ),
60 eValueType ( SvxNumberValueType::Number ),
61 aStringVal ( "" ),
62 nDoubleVal ( rVal )
63{
64}
65
66
68 const double& rVal, OUString aValueStr,
70 SfxPoolItem ( nId ),
71 pFormatter ( pNumFormatter ),
72 eValueType ( SvxNumberValueType::Number ),
73 aStringVal (std::move( aValueStr )),
74 nDoubleVal ( rVal )
75{
76}
77
78
80 SfxPoolItem ( rItem ),
81 pFormatter ( rItem.pFormatter ),
82 eValueType ( rItem.eValueType ),
83 aStringVal ( rItem.aStringVal ),
84 nDoubleVal ( rItem.nDoubleVal ),
85 mvDelFormats( rItem.mvDelFormats )
86{
87}
88
89
91{
92}
93
94
96(
97 SfxItemPresentation /*ePres*/,
98 MapUnit /*eCoreUnit*/,
99 MapUnit /*ePresUnit*/,
100 OUString& rText, const IntlWrapper&
101) const
102{
103 rText.clear();
104 return false;
105}
106
107
109{
110 assert(SfxPoolItem::operator==(rItem));
111
112 const SvxNumberInfoItem& rOther = static_cast<const SvxNumberInfoItem&>(rItem);
113
114 return mvDelFormats == rOther.mvDelFormats &&
115 pFormatter == rOther.pFormatter &&
116 eValueType == rOther.eValueType &&
117 nDoubleVal == rOther.nDoubleVal &&
118 aStringVal == rOther.aStringVal;
119}
120
122{
123 return new SvxNumberInfoItem( *this );
124}
125
126void SvxNumberInfoItem::SetDelFormats( std::vector<sal_uInt32> && aData )
127{
128 mvDelFormats = std::move(aData);
129}
130
131
132/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This item is used as a transport medium for a number formatter.
Definition: numinf.hxx:30
virtual SvxNumberInfoItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: numinf.cxx:121
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: numinf.cxx:96
SvxNumberInfoItem(const TypedWhichId< SvxNumberInfoItem > nId)
Definition: numinf.cxx:24
SvxNumberValueType eValueType
Definition: numinf.hxx:65
virtual ~SvxNumberInfoItem() override
Definition: numinf.cxx:90
std::vector< sal_uInt32 > mvDelFormats
Definition: numinf.hxx:69
double nDoubleVal
Definition: numinf.hxx:67
OUString aStringVal
Definition: numinf.hxx:66
void SetDelFormats(std::vector< sal_uInt32 > &&)
Definition: numinf.cxx:126
virtual bool operator==(const SfxPoolItem &) const override
Definition: numinf.cxx:108
SvNumberFormatter * pFormatter
Definition: numinf.hxx:64
MapUnit
constexpr OUStringLiteral aData
SvxNumberValueType
Definition: numfmtsh.hxx:34
sal_Int16 nId
SfxItemPresentation