1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_svx.hxx"
26 #include <svx/sdr/properties/e3dproperties.hxx>
27 #include <svl/itemset.hxx>
28 #include <svx/svddef.hxx>
29 #include <svx/obj3d.hxx>
30 
31 //////////////////////////////////////////////////////////////////////////////
32 
33 namespace sdr
34 {
35 	namespace properties
36 	{
37 		// create a new itemset
CreateObjectSpecificItemSet(SfxItemPool & rPool)38 		SfxItemSet& E3dProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
39 		{
40 			return *(new SfxItemSet(rPool,
41 
42 				// ranges from SdrAttrObj
43 				SDRATTR_START, SDRATTR_SHADOW_LAST,
44 				SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
45 				SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION,
46 
47 				// ranges from E3dObject, contains object and scene because of GetMergedItemSet()
48 				SDRATTR_3D_FIRST, SDRATTR_3D_LAST,
49 
50 				// end
51 				0, 0));
52 		}
53 
E3dProperties(SdrObject & rObj)54 		E3dProperties::E3dProperties(SdrObject& rObj)
55 		:	AttributeProperties(rObj)
56 		{
57 		}
58 
E3dProperties(const E3dProperties & rProps,SdrObject & rObj)59 		E3dProperties::E3dProperties(const E3dProperties& rProps, SdrObject& rObj)
60 		:	AttributeProperties(rProps, rObj)
61 		{
62 		}
63 
~E3dProperties()64 		E3dProperties::~E3dProperties()
65 		{
66 		}
67 
Clone(SdrObject & rObj) const68 		BaseProperties& E3dProperties::Clone(SdrObject& rObj) const
69 		{
70 			return *(new E3dProperties(*this, rObj));
71 		}
72 
ItemSetChanged(const SfxItemSet & rSet)73 		void E3dProperties::ItemSetChanged(const SfxItemSet& rSet)
74 		{
75 			E3dObject& rObj = (E3dObject&)GetSdrObject();
76 
77 			// call parent
78 			AttributeProperties::ItemSetChanged(rSet);
79 
80 			// local changes
81 			rObj.StructureChanged();
82 		}
83 
SetStyleSheet(SfxStyleSheet * pNewStyleSheet,sal_Bool bDontRemoveHardAttr)84 		void E3dProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
85 		{
86 			// call parent
87 			AttributeProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
88 
89 			// propagate call to contained objects
90 			const SdrObjList* pSub = ((const E3dObject&)GetSdrObject()).GetSubList();
91 			const sal_uInt32 nCount(pSub->GetObjCount());
92 
93 			for(sal_uInt32 a(0L); a < nCount; a++)
94 			{
95 				pSub->GetObj(a)->GetProperties().SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
96 			}
97 		}
98 	} // end of namespace properties
99 } // end of namespace sdr
100 
101 //////////////////////////////////////////////////////////////////////////////
102 // eof
103