xref: /aoo41x/main/svl/source/items/sitem.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_svl.hxx"
30 // INCLUDE ---------------------------------------------------------------
31 
32 #ifndef GCC
33 #endif
34 
35 #include <tools/string.hxx>
36 #include <tools/stream.hxx>
37 
38 #include <svl/poolitem.hxx>
39 #include <svl/itemset.hxx>
40 
41 
42 // STATIC DATA -----------------------------------------------------------
43 
44 DBG_NAME(SfxSetItem)
45 
46 // --------------------------------------------------------------------------
47 
48 SfxSetItem::SfxSetItem( sal_uInt16 which, const SfxItemSet &rSet) :
49 	SfxPoolItem(which),
50 	pSet(rSet.Clone(sal_True))
51 {
52 	DBG_CTOR(SfxSetItem, 0);
53 }
54 
55 // --------------------------------------------------------------------------
56 
57 SfxSetItem::SfxSetItem( sal_uInt16 which, SfxItemSet *pS) :
58 	SfxPoolItem(which),
59 	pSet(pS)
60 {
61 	DBG_CTOR(SfxSetItem, 0);
62 	DBG_ASSERT(pS, "SfxSetItem without set constructed" );
63 }
64 
65 // --------------------------------------------------------------------------
66 
67 SfxSetItem::SfxSetItem( const SfxSetItem& rCopy, SfxItemPool *pPool ) :
68 	SfxPoolItem(rCopy.Which()),
69 	pSet(rCopy.pSet->Clone(sal_True, pPool))
70 {
71 	DBG_CTOR(SfxSetItem, 0);
72 }
73 
74 // --------------------------------------------------------------------------
75 
76 SfxSetItem::~SfxSetItem()
77 {
78 	DBG_DTOR(SfxSetItem, 0);
79 	delete pSet; pSet = 0;
80 }
81 
82 // --------------------------------------------------------------------------
83 
84 int SfxSetItem::operator==( const SfxPoolItem& rCmp) const
85 {
86 	DBG_CHKTHIS(SfxSetItem, 0);
87 	DBG_ASSERT( SfxPoolItem::operator==( rCmp ), "unequal type" );
88 	return *pSet == *(((const SfxSetItem &)rCmp).pSet);
89 }
90 
91 // --------------------------------------------------------------------------
92 
93 SfxItemPresentation SfxSetItem::GetPresentation
94 (
95 	SfxItemPresentation     /*ePresentation*/,
96 	SfxMapUnit              /*eCoreMetric*/,
97 	SfxMapUnit              /*ePresentationMetric*/,
98 	XubString&              /*rText*/,
99     const IntlWrapper *
100 )   const
101 {
102 	DBG_CHKTHIS(SfxSetItem, 0);
103 	return SFX_ITEM_PRESENTATION_NONE;
104 }
105 
106 // --------------------------------------------------------------------------
107 
108 SvStream& SfxSetItem::Store(SvStream& rStream, sal_uInt16) const
109 {
110 	GetItemSet().Store(rStream);
111 	return rStream;
112 }
113 
114