merge the formfield patch from ooo-build
[ooovba.git] / svtools / source / items1 / sitem.cxx
blobec50581170e6472f2d785a8bb18543e2945854f6
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sitem.cxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svtools.hxx"
33 // INCLUDE ---------------------------------------------------------------
35 #ifndef GCC
36 #endif
38 #include <tools/string.hxx>
39 #include <tools/stream.hxx>
41 #include <svtools/poolitem.hxx>
42 #include <svtools/itemset.hxx>
45 // STATIC DATA -----------------------------------------------------------
47 DBG_NAME(SfxSetItem)
49 // --------------------------------------------------------------------------
51 SfxSetItem::SfxSetItem( USHORT which, const SfxItemSet &rSet) :
52 SfxPoolItem(which),
53 pSet(rSet.Clone(TRUE))
55 DBG_CTOR(SfxSetItem, 0);
58 // --------------------------------------------------------------------------
60 SfxSetItem::SfxSetItem( USHORT which, SfxItemSet *pS) :
61 SfxPoolItem(which),
62 pSet(pS)
64 DBG_CTOR(SfxSetItem, 0);
65 DBG_ASSERT(pS, "SfxSetItem without set constructed" );
68 // --------------------------------------------------------------------------
70 SfxSetItem::SfxSetItem( const SfxSetItem& rCopy, SfxItemPool *pPool ) :
71 SfxPoolItem(rCopy.Which()),
72 pSet(rCopy.pSet->Clone(TRUE, pPool))
74 DBG_CTOR(SfxSetItem, 0);
77 // --------------------------------------------------------------------------
79 SfxSetItem::~SfxSetItem()
81 DBG_DTOR(SfxSetItem, 0);
82 delete pSet; pSet = 0;
85 // --------------------------------------------------------------------------
87 int SfxSetItem::operator==( const SfxPoolItem& rCmp) const
89 DBG_CHKTHIS(SfxSetItem, 0);
90 DBG_ASSERT( SfxPoolItem::operator==( rCmp ), "unequal type" );
91 return *pSet == *(((const SfxSetItem &)rCmp).pSet);
94 // --------------------------------------------------------------------------
96 SfxItemPresentation SfxSetItem::GetPresentation
98 SfxItemPresentation /*ePresentation*/,
99 SfxMapUnit /*eCoreMetric*/,
100 SfxMapUnit /*ePresentationMetric*/,
101 XubString& /*rText*/,
102 const IntlWrapper *
103 ) const
105 DBG_CHKTHIS(SfxSetItem, 0);
106 return SFX_ITEM_PRESENTATION_NONE;
109 // --------------------------------------------------------------------------
111 SvStream& SfxSetItem::Store(SvStream& rStream, USHORT) const
113 GetItemSet().Store(rStream);
114 return rStream;