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