1*b1cdbd2cSJim Jagielski /**************************************************************
2*b1cdbd2cSJim Jagielski  *
3*b1cdbd2cSJim Jagielski  * Licensed to the Apache Software Foundation (ASF) under one
4*b1cdbd2cSJim Jagielski  * or more contributor license agreements.  See the NOTICE file
5*b1cdbd2cSJim Jagielski  * distributed with this work for additional information
6*b1cdbd2cSJim Jagielski  * regarding copyright ownership.  The ASF licenses this file
7*b1cdbd2cSJim Jagielski  * to you under the Apache License, Version 2.0 (the
8*b1cdbd2cSJim Jagielski  * "License"); you may not use this file except in compliance
9*b1cdbd2cSJim Jagielski  * with the License.  You may obtain a copy of the License at
10*b1cdbd2cSJim Jagielski  *
11*b1cdbd2cSJim Jagielski  *   http://www.apache.org/licenses/LICENSE-2.0
12*b1cdbd2cSJim Jagielski  *
13*b1cdbd2cSJim Jagielski  * Unless required by applicable law or agreed to in writing,
14*b1cdbd2cSJim Jagielski  * software distributed under the License is distributed on an
15*b1cdbd2cSJim Jagielski  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b1cdbd2cSJim Jagielski  * KIND, either express or implied.  See the License for the
17*b1cdbd2cSJim Jagielski  * specific language governing permissions and limitations
18*b1cdbd2cSJim Jagielski  * under the License.
19*b1cdbd2cSJim Jagielski  *
20*b1cdbd2cSJim Jagielski  *************************************************************/
21*b1cdbd2cSJim Jagielski 
22*b1cdbd2cSJim Jagielski 
23*b1cdbd2cSJim Jagielski 
24*b1cdbd2cSJim Jagielski // MARKER(update_precomp.py): autogen include statement, do not remove
25*b1cdbd2cSJim Jagielski #include "precompiled_svx.hxx"
26*b1cdbd2cSJim Jagielski #include <svx/sdr/properties/emptyproperties.hxx>
27*b1cdbd2cSJim Jagielski #include <tools/debug.hxx>
28*b1cdbd2cSJim Jagielski #include <svl/itemset.hxx>
29*b1cdbd2cSJim Jagielski #include <svx/svddef.hxx>
30*b1cdbd2cSJim Jagielski #include <svx/svdobj.hxx>
31*b1cdbd2cSJim Jagielski #include <svx/svdpool.hxx>
32*b1cdbd2cSJim Jagielski 
33*b1cdbd2cSJim Jagielski //////////////////////////////////////////////////////////////////////////////
34*b1cdbd2cSJim Jagielski 
35*b1cdbd2cSJim Jagielski namespace sdr
36*b1cdbd2cSJim Jagielski {
37*b1cdbd2cSJim Jagielski 	namespace properties
38*b1cdbd2cSJim Jagielski 	{
39*b1cdbd2cSJim Jagielski 		// create a new itemset
CreateObjectSpecificItemSet(SfxItemPool & rPool)40*b1cdbd2cSJim Jagielski 		SfxItemSet& EmptyProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
41*b1cdbd2cSJim Jagielski 		{
42*b1cdbd2cSJim Jagielski 			// Basic implementation; Basic object has NO attributes
43*b1cdbd2cSJim Jagielski 			DBG_ASSERT(sal_False, "EmptyProperties::CreateObjectSpecificItemSet() should never be called");
44*b1cdbd2cSJim Jagielski 			return *(new SfxItemSet(rPool));
45*b1cdbd2cSJim Jagielski 		}
46*b1cdbd2cSJim Jagielski 
EmptyProperties(SdrObject & rObj)47*b1cdbd2cSJim Jagielski 		EmptyProperties::EmptyProperties(SdrObject& rObj)
48*b1cdbd2cSJim Jagielski 		:	BaseProperties(rObj),
49*b1cdbd2cSJim Jagielski 			mpEmptyItemSet(0L)
50*b1cdbd2cSJim Jagielski 		{
51*b1cdbd2cSJim Jagielski 		}
52*b1cdbd2cSJim Jagielski 
EmptyProperties(const EmptyProperties & rProps,SdrObject & rObj)53*b1cdbd2cSJim Jagielski 		EmptyProperties::EmptyProperties(const EmptyProperties& rProps, SdrObject& rObj)
54*b1cdbd2cSJim Jagielski 		:	BaseProperties(rProps, rObj),
55*b1cdbd2cSJim Jagielski 			mpEmptyItemSet(0L)
56*b1cdbd2cSJim Jagielski 		{
57*b1cdbd2cSJim Jagielski 			// #115593#
58*b1cdbd2cSJim Jagielski 			// do not gererate an assert, else derivations like PageProperties will generate an assert
59*b1cdbd2cSJim Jagielski 			// using the Clone() operator path.
60*b1cdbd2cSJim Jagielski 		}
61*b1cdbd2cSJim Jagielski 
~EmptyProperties()62*b1cdbd2cSJim Jagielski 		EmptyProperties::~EmptyProperties()
63*b1cdbd2cSJim Jagielski 		{
64*b1cdbd2cSJim Jagielski 			if(mpEmptyItemSet)
65*b1cdbd2cSJim Jagielski 			{
66*b1cdbd2cSJim Jagielski 				delete mpEmptyItemSet;
67*b1cdbd2cSJim Jagielski 				mpEmptyItemSet = 0L;
68*b1cdbd2cSJim Jagielski 			}
69*b1cdbd2cSJim Jagielski 		}
70*b1cdbd2cSJim Jagielski 
Clone(SdrObject & rObj) const71*b1cdbd2cSJim Jagielski 		BaseProperties& EmptyProperties::Clone(SdrObject& rObj) const
72*b1cdbd2cSJim Jagielski 		{
73*b1cdbd2cSJim Jagielski 			return *(new EmptyProperties(*this, rObj));
74*b1cdbd2cSJim Jagielski 		}
75*b1cdbd2cSJim Jagielski 
GetObjectItemSet() const76*b1cdbd2cSJim Jagielski 		const SfxItemSet& EmptyProperties::GetObjectItemSet() const
77*b1cdbd2cSJim Jagielski 		{
78*b1cdbd2cSJim Jagielski 			if(!mpEmptyItemSet)
79*b1cdbd2cSJim Jagielski 			{
80*b1cdbd2cSJim Jagielski 				((EmptyProperties*)this)->mpEmptyItemSet = &(((EmptyProperties*)this)->CreateObjectSpecificItemSet(*GetSdrObject().GetObjectItemPool()));
81*b1cdbd2cSJim Jagielski 			}
82*b1cdbd2cSJim Jagielski 
83*b1cdbd2cSJim Jagielski 			DBG_ASSERT(mpEmptyItemSet, "Could not create an SfxItemSet(!)");
84*b1cdbd2cSJim Jagielski 			DBG_ASSERT(sal_False, "EmptyProperties::GetObjectItemSet() should never be called (!)");
85*b1cdbd2cSJim Jagielski 
86*b1cdbd2cSJim Jagielski 			return *mpEmptyItemSet;
87*b1cdbd2cSJim Jagielski 		}
88*b1cdbd2cSJim Jagielski 
SetObjectItem(const SfxPoolItem &)89*b1cdbd2cSJim Jagielski 		void EmptyProperties::SetObjectItem(const SfxPoolItem& /*rItem*/)
90*b1cdbd2cSJim Jagielski 		{
91*b1cdbd2cSJim Jagielski 			DBG_ASSERT(sal_False, "EmptyProperties::SetObjectItem() should never be called (!)");
92*b1cdbd2cSJim Jagielski 		}
93*b1cdbd2cSJim Jagielski 
SetObjectItemDirect(const SfxPoolItem &)94*b1cdbd2cSJim Jagielski 		void EmptyProperties::SetObjectItemDirect(const SfxPoolItem& /*rItem*/)
95*b1cdbd2cSJim Jagielski 		{
96*b1cdbd2cSJim Jagielski 			DBG_ASSERT(sal_False, "EmptyProperties::SetObjectItemDirect() should never be called (!)");
97*b1cdbd2cSJim Jagielski 		}
98*b1cdbd2cSJim Jagielski 
ClearObjectItem(const sal_uInt16)99*b1cdbd2cSJim Jagielski 		void EmptyProperties::ClearObjectItem(const sal_uInt16 /*nWhich*/)
100*b1cdbd2cSJim Jagielski 		{
101*b1cdbd2cSJim Jagielski 			DBG_ASSERT(sal_False, "EmptyProperties::ClearObjectItem() should never be called (!)");
102*b1cdbd2cSJim Jagielski 		}
103*b1cdbd2cSJim Jagielski 
ClearObjectItemDirect(const sal_uInt16)104*b1cdbd2cSJim Jagielski 		void EmptyProperties::ClearObjectItemDirect(const sal_uInt16 /*nWhich*/)
105*b1cdbd2cSJim Jagielski 		{
106*b1cdbd2cSJim Jagielski 			DBG_ASSERT(sal_False, "EmptyProperties::ClearObjectItemDirect() should never be called (!)");
107*b1cdbd2cSJim Jagielski 		}
108*b1cdbd2cSJim Jagielski 
SetObjectItemSet(const SfxItemSet &)109*b1cdbd2cSJim Jagielski 		void EmptyProperties::SetObjectItemSet(const SfxItemSet& /*rSet*/)
110*b1cdbd2cSJim Jagielski 		{
111*b1cdbd2cSJim Jagielski 			DBG_ASSERT(sal_False, "EmptyProperties::SetObjectItemSet() should never be called (!)");
112*b1cdbd2cSJim Jagielski 		}
113*b1cdbd2cSJim Jagielski 
ItemSetChanged(const SfxItemSet &)114*b1cdbd2cSJim Jagielski 		void EmptyProperties::ItemSetChanged(const SfxItemSet& /*rSet*/)
115*b1cdbd2cSJim Jagielski 		{
116*b1cdbd2cSJim Jagielski 			DBG_ASSERT(sal_False, "EmptyProperties::ItemSetChanged() should never be called (!)");
117*b1cdbd2cSJim Jagielski 		}
118*b1cdbd2cSJim Jagielski 
AllowItemChange(const sal_uInt16,const SfxPoolItem *) const119*b1cdbd2cSJim Jagielski 		sal_Bool EmptyProperties::AllowItemChange(const sal_uInt16 /*nWhich*/, const SfxPoolItem* /*pNewItem*/) const
120*b1cdbd2cSJim Jagielski 		{
121*b1cdbd2cSJim Jagielski 			DBG_ASSERT(sal_False, "EmptyProperties::AllowItemChange() should never be called (!)");
122*b1cdbd2cSJim Jagielski 			return sal_True;
123*b1cdbd2cSJim Jagielski 		}
124*b1cdbd2cSJim Jagielski 
ItemChange(const sal_uInt16,const SfxPoolItem *)125*b1cdbd2cSJim Jagielski 		void EmptyProperties::ItemChange(const sal_uInt16 /*nWhich*/, const SfxPoolItem* /*pNewItem*/)
126*b1cdbd2cSJim Jagielski 		{
127*b1cdbd2cSJim Jagielski 			DBG_ASSERT(sal_False, "EmptyProperties::ItemChange() should never be called (!)");
128*b1cdbd2cSJim Jagielski 		}
129*b1cdbd2cSJim Jagielski 
PostItemChange(const sal_uInt16)130*b1cdbd2cSJim Jagielski 		void EmptyProperties::PostItemChange(const sal_uInt16 /*nWhich*/)
131*b1cdbd2cSJim Jagielski 		{
132*b1cdbd2cSJim Jagielski 			DBG_ASSERT(sal_False, "EmptyProperties::PostItemChange() should never be called (!)");
133*b1cdbd2cSJim Jagielski 		}
134*b1cdbd2cSJim Jagielski 
SetStyleSheet(SfxStyleSheet *,sal_Bool)135*b1cdbd2cSJim Jagielski 		void EmptyProperties::SetStyleSheet(SfxStyleSheet* /*pNewStyleSheet*/, sal_Bool /*bDontRemoveHardAttr*/)
136*b1cdbd2cSJim Jagielski 		{
137*b1cdbd2cSJim Jagielski 			DBG_ASSERT(sal_False, "EmptyProperties::SetStyleSheet() should never be called (!)");
138*b1cdbd2cSJim Jagielski 		}
139*b1cdbd2cSJim Jagielski 
GetStyleSheet() const140*b1cdbd2cSJim Jagielski 		SfxStyleSheet* EmptyProperties::GetStyleSheet() const
141*b1cdbd2cSJim Jagielski 		{
142*b1cdbd2cSJim Jagielski 			DBG_ASSERT(sal_False, "EmptyProperties::GetStyleSheet() should never be called (!)");
143*b1cdbd2cSJim Jagielski 			return 0L;
144*b1cdbd2cSJim Jagielski 		}
145*b1cdbd2cSJim Jagielski 	} // end of namespace properties
146*b1cdbd2cSJim Jagielski } // end of namespace sdr
147*b1cdbd2cSJim Jagielski 
148*b1cdbd2cSJim Jagielski //////////////////////////////////////////////////////////////////////////////
149*b1cdbd2cSJim Jagielski // eof
150