1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_svl.hxx"
26 // INCLUDE ---------------------------------------------------------------
27
28 #ifndef GCC
29 #endif
30
31 #include <tools/string.hxx>
32 #include <tools/stream.hxx>
33
34 #include <svl/poolitem.hxx>
35 #include <svl/itemset.hxx>
36
37
38 // STATIC DATA -----------------------------------------------------------
39
DBG_NAME(SfxSetItem)40 DBG_NAME(SfxSetItem)
41
42 // --------------------------------------------------------------------------
43
44 SfxSetItem::SfxSetItem( sal_uInt16 which, const SfxItemSet &rSet) :
45 SfxPoolItem(which),
46 pSet(rSet.Clone(sal_True))
47 {
48 DBG_CTOR(SfxSetItem, 0);
49 }
50
51 // --------------------------------------------------------------------------
52
SfxSetItem(sal_uInt16 which,SfxItemSet * pS)53 SfxSetItem::SfxSetItem( sal_uInt16 which, SfxItemSet *pS) :
54 SfxPoolItem(which),
55 pSet(pS)
56 {
57 DBG_CTOR(SfxSetItem, 0);
58 DBG_ASSERT(pS, "SfxSetItem without set constructed" );
59 }
60
61 // --------------------------------------------------------------------------
62
SfxSetItem(const SfxSetItem & rCopy,SfxItemPool * pPool)63 SfxSetItem::SfxSetItem( const SfxSetItem& rCopy, SfxItemPool *pPool ) :
64 SfxPoolItem(rCopy.Which()),
65 pSet(rCopy.pSet->Clone(sal_True, pPool))
66 {
67 DBG_CTOR(SfxSetItem, 0);
68 }
69
70 // --------------------------------------------------------------------------
71
~SfxSetItem()72 SfxSetItem::~SfxSetItem()
73 {
74 DBG_DTOR(SfxSetItem, 0);
75 delete pSet; pSet = 0;
76 }
77
78 // --------------------------------------------------------------------------
79
operator ==(const SfxPoolItem & rCmp) const80 int SfxSetItem::operator==( const SfxPoolItem& rCmp) const
81 {
82 DBG_CHKTHIS(SfxSetItem, 0);
83 DBG_ASSERT( SfxPoolItem::operator==( rCmp ), "unequal type" );
84 return *pSet == *(((const SfxSetItem &)rCmp).pSet);
85 }
86
87 // --------------------------------------------------------------------------
88
GetPresentation(SfxItemPresentation,SfxMapUnit,SfxMapUnit,XubString &,const IntlWrapper *) const89 SfxItemPresentation SfxSetItem::GetPresentation
90 (
91 SfxItemPresentation /*ePresentation*/,
92 SfxMapUnit /*eCoreMetric*/,
93 SfxMapUnit /*ePresentationMetric*/,
94 XubString& /*rText*/,
95 const IntlWrapper *
96 ) const
97 {
98 DBG_CHKTHIS(SfxSetItem, 0);
99 return SFX_ITEM_PRESENTATION_NONE;
100 }
101
102 // --------------------------------------------------------------------------
103
Store(SvStream & rStream,sal_uInt16) const104 SvStream& SfxSetItem::Store(SvStream& rStream, sal_uInt16) const
105 {
106 GetItemSet().Store(rStream);
107 return rStream;
108 }
109
110