Branch data Line data Source code
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 : :
21 : : #include <tools/string.hxx>
22 : : #include <tools/stream.hxx>
23 : :
24 : : #include <svl/poolitem.hxx>
25 : : #include <svl/itemset.hxx>
26 : :
27 : :
28 : : // STATIC DATA -----------------------------------------------------------
29 : :
30 : : DBG_NAME(SfxSetItem)
31 : :
32 : : // --------------------------------------------------------------------------
33 : :
34 : 3008 : SfxSetItem::SfxSetItem( sal_uInt16 which, const SfxItemSet &rSet) :
35 : : SfxPoolItem(which),
36 [ + - ]: 3008 : pSet(rSet.Clone(sal_True))
37 : : {
38 : : DBG_CTOR(SfxSetItem, 0);
39 : 3008 : }
40 : :
41 : : // --------------------------------------------------------------------------
42 : :
43 : 124618 : SfxSetItem::SfxSetItem( sal_uInt16 which, SfxItemSet *pS) :
44 : : SfxPoolItem(which),
45 : 124618 : pSet(pS)
46 : : {
47 : : DBG_CTOR(SfxSetItem, 0);
48 : : DBG_ASSERT(pS, "SfxSetItem without set constructed" );
49 : 124618 : }
50 : :
51 : : // --------------------------------------------------------------------------
52 : :
53 : 40236 : SfxSetItem::SfxSetItem( const SfxSetItem& rCopy, SfxItemPool *pPool ) :
54 : 40236 : SfxPoolItem(rCopy.Which()),
55 [ + - ]: 40236 : pSet(rCopy.pSet->Clone(sal_True, pPool))
56 : : {
57 : : DBG_CTOR(SfxSetItem, 0);
58 : 40236 : }
59 : :
60 : : // --------------------------------------------------------------------------
61 : :
62 : 164469 : SfxSetItem::~SfxSetItem()
63 : : {
64 : : DBG_DTOR(SfxSetItem, 0);
65 [ + - ][ + - ]: 164469 : delete pSet; pSet = 0;
66 [ - + ]: 164469 : }
67 : :
68 : : // --------------------------------------------------------------------------
69 : :
70 : 25227 : int SfxSetItem::operator==( const SfxPoolItem& rCmp) const
71 : : {
72 : : DBG_CHKTHIS(SfxSetItem, 0);
73 : : DBG_ASSERT( SfxPoolItem::operator==( rCmp ), "unequal type" );
74 : 25227 : return *pSet == *(((const SfxSetItem &)rCmp).pSet);
75 : : }
76 : :
77 : : // --------------------------------------------------------------------------
78 : :
79 : 0 : SfxItemPresentation SfxSetItem::GetPresentation
80 : : (
81 : : SfxItemPresentation /*ePresentation*/,
82 : : SfxMapUnit /*eCoreMetric*/,
83 : : SfxMapUnit /*ePresentationMetric*/,
84 : : XubString& /*rText*/,
85 : : const IntlWrapper *
86 : : ) const
87 : : {
88 : : DBG_CHKTHIS(SfxSetItem, 0);
89 : 0 : return SFX_ITEM_PRESENTATION_NONE;
90 : : }
91 : :
92 : : // --------------------------------------------------------------------------
93 : :
94 : 0 : SvStream& SfxSetItem::Store(SvStream& rStream, sal_uInt16) const
95 : : {
96 : 0 : GetItemSet().Store(rStream);
97 : 0 : return rStream;
98 : : }
99 : :
100 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|