lok: vcl: fix multiple floatwin removal case more robustly.
[LibreOffice.git] / svl / source / items / int64item.cxx
blobb5dc818b9d4699b3fee4350f1122558d59d611b6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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 */
10 #include <svl/int64item.hxx>
11 #include <tools/stream.hxx>
13 SfxInt64Item::SfxInt64Item( sal_uInt16 nWhich, sal_Int64 nVal ) :
14 SfxPoolItem(nWhich), mnValue(nVal)
18 SfxInt64Item::SfxInt64Item( sal_uInt16 nWhich, SvStream& rStream ) :
19 SfxPoolItem(nWhich), mnValue(0)
21 rStream.ReadInt64(mnValue);
24 SfxInt64Item::~SfxInt64Item() {}
26 bool SfxInt64Item::operator== ( const SfxPoolItem& rItem ) const
28 return mnValue == static_cast<const SfxInt64Item&>(rItem).mnValue;
31 bool SfxInt64Item::GetPresentation(
32 SfxItemPresentation, MapUnit, MapUnit, OUString& rText,
33 const IntlWrapper& /*rIntlWrapper*/ ) const
35 rText = OUString::number(mnValue);
36 return true;
39 bool SfxInt64Item::QueryValue(
40 css::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
42 rVal <<= mnValue;
43 return true;
46 bool SfxInt64Item::PutValue(
47 const css::uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
49 sal_Int64 nVal;
51 if (rVal >>= nVal)
53 mnValue = nVal;
54 return true;
57 return false;
60 SfxPoolItem* SfxInt64Item::Create( SvStream& rStream, sal_uInt16 /*nItemVersion*/ ) const
62 return new SfxInt64Item(Which(), rStream);
65 SvStream& SfxInt64Item::Store( SvStream& rStream, sal_uInt16 /*nItemVersion*/ ) const
67 return rStream.WriteInt64(mnValue);
70 SfxPoolItem* SfxInt64Item::Clone( SfxItemPool* /*pOther*/ ) const
72 return new SfxInt64Item(*this);
76 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */