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/e3dproperties.hxx>
31 #include <svl/itemset.hxx>
32 #include <svx/svddef.hxx>
33 #include <svx/obj3d.hxx>
34 
35 //////////////////////////////////////////////////////////////////////////////
36 
37 namespace sdr
38 {
39 	namespace properties
40 	{
41 		// create a new itemset
42 		SfxItemSet& E3dProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
43 		{
44 			return *(new SfxItemSet(rPool,
45 
46 				// ranges from SdrAttrObj
47 				SDRATTR_START, SDRATTR_SHADOW_LAST,
48 				SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
49 				SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION,
50 
51 				// ranges from E3dObject, contains object and scene because of GetMergedItemSet()
52 				SDRATTR_3D_FIRST, SDRATTR_3D_LAST,
53 
54 				// end
55 				0, 0));
56 		}
57 
58 		E3dProperties::E3dProperties(SdrObject& rObj)
59 		:	AttributeProperties(rObj)
60 		{
61 		}
62 
63 		E3dProperties::E3dProperties(const E3dProperties& rProps, SdrObject& rObj)
64 		:	AttributeProperties(rProps, rObj)
65 		{
66 		}
67 
68 		E3dProperties::~E3dProperties()
69 		{
70 		}
71 
72 		BaseProperties& E3dProperties::Clone(SdrObject& rObj) const
73 		{
74 			return *(new E3dProperties(*this, rObj));
75 		}
76 
77 		void E3dProperties::ItemSetChanged(const SfxItemSet& rSet)
78 		{
79 			E3dObject& rObj = (E3dObject&)GetSdrObject();
80 
81 			// call parent
82 			AttributeProperties::ItemSetChanged(rSet);
83 
84 			// local changes
85 			rObj.StructureChanged();
86 		}
87 
88 		void E3dProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
89 		{
90 			// call parent
91 			AttributeProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
92 
93 			// propagate call to contained objects
94 			const SdrObjList* pSub = ((const E3dObject&)GetSdrObject()).GetSubList();
95 			const sal_uInt32 nCount(pSub->GetObjCount());
96 
97 			for(sal_uInt32 a(0L); a < nCount; a++)
98 			{
99 				pSub->GetObj(a)->GetProperties().SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
100 			}
101 		}
102 	} // end of namespace properties
103 } // end of namespace sdr
104 
105 //////////////////////////////////////////////////////////////////////////////
106 // eof
107