LibreOffice Module svl (master) 1
int64item.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
10#include <svl/int64item.hxx>
11
12SfxInt64Item::SfxInt64Item( sal_uInt16 nWhich, sal_Int64 nVal ) :
13 SfxPoolItem(nWhich), mnValue(nVal)
14{
15}
16
18
19bool SfxInt64Item::operator== ( const SfxPoolItem& rItem ) const
20{
21 return SfxPoolItem::operator==(rItem) && mnValue == static_cast<const SfxInt64Item&>(rItem).mnValue;
22}
23
25 SfxItemPresentation, MapUnit, MapUnit, OUString& rText,
26 const IntlWrapper& /*rIntlWrapper*/ ) const
27{
28 rText = OUString::number(mnValue);
29 return true;
30}
31
33 css::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
34{
35 rVal <<= mnValue;
36 return true;
37}
38
40 const css::uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
41{
42 sal_Int64 nVal;
43
44 if (rVal >>= nVal)
45 {
46 mnValue = nVal;
47 return true;
48 }
49
50 return false;
51}
52
54{
55 return new SfxInt64Item(*this);
56}
57
58/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxInt64Item(sal_uInt16 nWhich, sal_Int64 nVal)
Definition: int64item.cxx:12
virtual SfxInt64Item * Clone(SfxItemPool *pOther=nullptr) const override
Definition: int64item.cxx:53
virtual ~SfxInt64Item() override
Definition: int64item.cxx:17
sal_Int64 mnValue
Definition: int64item.hxx:18
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: int64item.cxx:39
virtual bool operator==(const SfxPoolItem &rItem) const override
Definition: int64item.cxx:19
virtual bool GetPresentation(SfxItemPresentation, MapUnit, MapUnit, OUString &rText, const IntlWrapper &rIntlWrapper) const override
This virtual method allows to get a textual representation of the value for the SfxPoolItem subclasse...
Definition: int64item.cxx:24
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: int64item.cxx:32
Base class for providers of defaults of SfxPoolItems.
Definition: itempool.hxx:51
virtual bool operator==(const SfxPoolItem &) const =0
Definition: poolitem.cxx:478
MapUnit
SfxItemPresentation
Definition: poolitem.hxx:72
const double mnValue
unsigned char sal_uInt8