LibreOffice Module svl (master) 1
sitem.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 <rtl/ustring.hxx>
23#include <svl/itemset.hxx>
24#include <svl/setitem.hxx>
25#include <svl/poolitem.hxx>
26
27SfxSetItem::SfxSetItem( sal_uInt16 which, const SfxItemSet &rSet) :
28 SfxPoolItem(which),
29 maSet(rSet)
30{
31 assert(!dynamic_cast<const SfxAllItemSet*>(&rSet) && "cannot handle SfxAllItemSet here");
32}
33
34
35SfxSetItem::SfxSetItem( sal_uInt16 which, SfxItemSet &&pS) :
36 SfxPoolItem(which),
37 maSet(pS)
38{
39 assert(!dynamic_cast<SfxAllItemSet*>(&pS) && "cannot handle SfxAllItemSet here");
40}
41
42
44 SfxPoolItem(rCopy),
45 maSet(rCopy.maSet.CloneAsValue(true, pPool))
46{
47 assert(!dynamic_cast<const SfxAllItemSet*>(&rCopy.maSet) && "cannot handle SfxAllItemSet here");
48}
49
50
51bool SfxSetItem::operator==( const SfxPoolItem& rCmp) const
52{
53 assert(SfxPoolItem::operator==(rCmp));
54 return maSet == static_cast<const SfxSetItem &>(rCmp).maSet;
55}
56
57
59(
60 SfxItemPresentation /*ePresentation*/,
61 MapUnit /*eCoreMetric*/,
62 MapUnit /*ePresentationMetric*/,
63 OUString& /*rText*/,
64 const IntlWrapper&
65) const
66{
67 return false;
68}
69
70/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Base class for providers of defaults of SfxPoolItems.
Definition: itempool.hxx:51
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: sitem.cxx:59
SfxSetItem(sal_uInt16 nWhich, SfxItemSet &&pSet)
Definition: sitem.cxx:35
SfxItemSet maSet
Definition: setitem.hxx:29
virtual bool operator==(const SfxPoolItem &) const override
Definition: sitem.cxx:51
const char * pS
MapUnit
SfxItemPresentation
Definition: poolitem.hxx:72
static SfxItemSet & rSet