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_svx.hxx"
30 #include <svx/sdr/properties/emptyproperties.hxx>
31 #include <tools/debug.hxx>
32 #include <svl/itemset.hxx>
33 #include <svx/svddef.hxx>
34 #include <svx/svdobj.hxx>
35 #include <svx/svdpool.hxx>
36 
37 //////////////////////////////////////////////////////////////////////////////
38 
39 namespace sdr
40 {
41 	namespace properties
42 	{
43 		// create a new itemset
44 		SfxItemSet& EmptyProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
45 		{
46 			// Basic implementation; Basic object has NO attributes
47 			DBG_ASSERT(sal_False, "EmptyProperties::CreateObjectSpecificItemSet() should never be called");
48 			return *(new SfxItemSet(rPool));
49 		}
50 
51 		EmptyProperties::EmptyProperties(SdrObject& rObj)
52 		:	BaseProperties(rObj),
53 			mpEmptyItemSet(0L)
54 		{
55 		}
56 
57 		EmptyProperties::EmptyProperties(const EmptyProperties& rProps, SdrObject& rObj)
58 		:	BaseProperties(rProps, rObj),
59 			mpEmptyItemSet(0L)
60 		{
61 			// #115593#
62 			// do not gererate an assert, else derivations like PageProperties will generate an assert
63 			// using the Clone() operator path.
64 		}
65 
66 		EmptyProperties::~EmptyProperties()
67 		{
68 			if(mpEmptyItemSet)
69 			{
70 				delete mpEmptyItemSet;
71 				mpEmptyItemSet = 0L;
72 			}
73 		}
74 
75 		BaseProperties& EmptyProperties::Clone(SdrObject& rObj) const
76 		{
77 			return *(new EmptyProperties(*this, rObj));
78 		}
79 
80 		const SfxItemSet& EmptyProperties::GetObjectItemSet() const
81 		{
82 			if(!mpEmptyItemSet)
83 			{
84 				((EmptyProperties*)this)->mpEmptyItemSet = &(((EmptyProperties*)this)->CreateObjectSpecificItemSet(*GetSdrObject().GetObjectItemPool()));
85 			}
86 
87 			DBG_ASSERT(mpEmptyItemSet, "Could not create an SfxItemSet(!)");
88 			DBG_ASSERT(sal_False, "EmptyProperties::GetObjectItemSet() should never be called (!)");
89 
90 			return *mpEmptyItemSet;
91 		}
92 
93 		void EmptyProperties::SetObjectItem(const SfxPoolItem& /*rItem*/)
94 		{
95 			DBG_ASSERT(sal_False, "EmptyProperties::SetObjectItem() should never be called (!)");
96 		}
97 
98 		void EmptyProperties::SetObjectItemDirect(const SfxPoolItem& /*rItem*/)
99 		{
100 			DBG_ASSERT(sal_False, "EmptyProperties::SetObjectItemDirect() should never be called (!)");
101 		}
102 
103 		void EmptyProperties::ClearObjectItem(const sal_uInt16 /*nWhich*/)
104 		{
105 			DBG_ASSERT(sal_False, "EmptyProperties::ClearObjectItem() should never be called (!)");
106 		}
107 
108 		void EmptyProperties::ClearObjectItemDirect(const sal_uInt16 /*nWhich*/)
109 		{
110 			DBG_ASSERT(sal_False, "EmptyProperties::ClearObjectItemDirect() should never be called (!)");
111 		}
112 
113 		void EmptyProperties::SetObjectItemSet(const SfxItemSet& /*rSet*/)
114 		{
115 			DBG_ASSERT(sal_False, "EmptyProperties::SetObjectItemSet() should never be called (!)");
116 		}
117 
118 		void EmptyProperties::ItemSetChanged(const SfxItemSet& /*rSet*/)
119 		{
120 			DBG_ASSERT(sal_False, "EmptyProperties::ItemSetChanged() should never be called (!)");
121 		}
122 
123 		sal_Bool EmptyProperties::AllowItemChange(const sal_uInt16 /*nWhich*/, const SfxPoolItem* /*pNewItem*/) const
124 		{
125 			DBG_ASSERT(sal_False, "EmptyProperties::AllowItemChange() should never be called (!)");
126 			return sal_True;
127 		}
128 
129 		void EmptyProperties::ItemChange(const sal_uInt16 /*nWhich*/, const SfxPoolItem* /*pNewItem*/)
130 		{
131 			DBG_ASSERT(sal_False, "EmptyProperties::ItemChange() should never be called (!)");
132 		}
133 
134 		void EmptyProperties::PostItemChange(const sal_uInt16 /*nWhich*/)
135 		{
136 			DBG_ASSERT(sal_False, "EmptyProperties::PostItemChange() should never be called (!)");
137 		}
138 
139 		void EmptyProperties::SetStyleSheet(SfxStyleSheet* /*pNewStyleSheet*/, sal_Bool /*bDontRemoveHardAttr*/)
140 		{
141 			DBG_ASSERT(sal_False, "EmptyProperties::SetStyleSheet() should never be called (!)");
142 		}
143 
144 		SfxStyleSheet* EmptyProperties::GetStyleSheet() const
145 		{
146 			DBG_ASSERT(sal_False, "EmptyProperties::GetStyleSheet() should never be called (!)");
147 			return 0L;
148 		}
149 	} // end of namespace properties
150 } // end of namespace sdr
151 
152 //////////////////////////////////////////////////////////////////////////////
153 // eof
154