LibreOffice Module svl (master) 1
rngitem.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 <sal/config.h>
21
22#include <svl/rngitem.hxx>
23
24
25SfxRangeItem::SfxRangeItem( sal_uInt16 which, sal_uInt16 from, sal_uInt16 to ):
26 SfxPoolItem( which ),
27 nFrom( from ),
28 nTo( to )
29{
30}
31
32
34(
35 SfxItemPresentation /*ePresentation*/,
36 MapUnit /*eCoreMetric*/,
37 MapUnit /*ePresentationMetric*/,
38 OUString& rText,
39 const IntlWrapper&
40) const
41{
42 rText = OUString::number(nFrom) + ":" + OUString::number(nTo);
43 return true;
44}
45
46
47bool SfxRangeItem::operator==( const SfxPoolItem& rItem ) const
48{
49 assert(SfxPoolItem::operator==(rItem));
50 const SfxRangeItem& rT = static_cast<const SfxRangeItem&>(rItem);
51 return nFrom==rT.nFrom && nTo==rT.nTo;
52}
53
55{
56 return new SfxRangeItem( Which(), nFrom, nTo );
57}
58
59/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
UBlockCode from
UBlockCode to
Base class for providers of defaults of SfxPoolItems.
Definition: itempool.hxx:51
sal_uInt16 Which() const
Definition: poolitem.hxx:149
sal_uInt16 nFrom
Definition: rngitem.hxx:32
sal_uInt16 nTo
Definition: rngitem.hxx:33
virtual bool operator==(const SfxPoolItem &) const override
Definition: rngitem.cxx:47
SfxRangeItem(sal_uInt16 nWID, sal_uInt16 nFrom, sal_uInt16 nTo)
Definition: rngitem.cxx:25
virtual SfxRangeItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: rngitem.cxx:54
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
This virtual method allows to get a textual representation of the value for the SfxPoolItem subclasse...
Definition: rngitem.cxx:34
MapUnit
SfxItemPresentation
Definition: poolitem.hxx:72