Update ooo320-m1
[ooovba.git] / svx / source / sdr / properties / e3dcompoundproperties.cxx
blob5726758b72f7f6b4507c025405575c06af40d32c
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: e3dcompoundproperties.cxx,v $
10 * $Revision: 1.9.226.1 $
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_svx.hxx"
33 #include <svx/sdr/properties/e3dcompoundproperties.hxx>
34 #include <svtools/itemset.hxx>
35 #include <svx/obj3d.hxx>
36 #include <svx/scene3d.hxx>
38 //////////////////////////////////////////////////////////////////////////////
40 namespace sdr
42 namespace properties
44 E3dCompoundProperties::E3dCompoundProperties(SdrObject& rObj)
45 : E3dProperties(rObj)
49 E3dCompoundProperties::E3dCompoundProperties(const E3dCompoundProperties& rProps, SdrObject& rObj)
50 : E3dProperties(rProps, rObj)
54 E3dCompoundProperties::~E3dCompoundProperties()
58 BaseProperties& E3dCompoundProperties::Clone(SdrObject& rObj) const
60 return *(new E3dCompoundProperties(*this, rObj));
63 const SfxItemSet& E3dCompoundProperties::GetObjectItemSet() const
65 //DBG_ASSERT(sal_False, "E3dCompoundProperties::GetObjectItemSet() maybe the wrong call (!)");
66 return E3dProperties::GetObjectItemSet();
69 const SfxItemSet& E3dCompoundProperties::GetMergedItemSet() const
71 // include Items of scene this object belongs to
72 E3dCompoundObject& rObj = (E3dCompoundObject&)GetSdrObject();
73 E3dScene* pScene = rObj.GetScene();
75 if(pScene)
77 // force ItemSet
78 GetObjectItemSet();
80 // add filtered scene properties (SDRATTR_3DSCENE_) to local itemset
81 SfxItemSet aSet(*mpItemSet->GetPool(), SDRATTR_3DSCENE_FIRST, SDRATTR_3DSCENE_LAST);
82 aSet.Put(pScene->GetProperties().GetObjectItemSet());
83 mpItemSet->Put(aSet);
86 // call parent
87 return E3dProperties::GetMergedItemSet();
90 void E3dCompoundProperties::SetMergedItemSet(const SfxItemSet& rSet, sal_Bool bClearAllItems)
92 // Set scene specific items at scene
93 E3dCompoundObject& rObj = (E3dCompoundObject&)GetSdrObject();
94 E3dScene* pScene = rObj.GetScene();
96 if(pScene)
98 // force ItemSet
99 GetObjectItemSet();
101 // Generate filtered scene properties (SDRATTR_3DSCENE_) itemset
102 SfxItemSet aSet(*mpItemSet->GetPool(), SDRATTR_3DSCENE_FIRST, SDRATTR_3DSCENE_LAST);
103 aSet.Put(rSet);
105 if(bClearAllItems)
107 pScene->GetProperties().ClearObjectItem();
110 if(aSet.Count())
112 pScene->GetProperties().SetObjectItemSet(aSet);
116 // call parent. This will set items on local object, too.
117 E3dProperties::SetMergedItemSet(rSet, bClearAllItems);
120 void E3dCompoundProperties::PostItemChange(const sal_uInt16 nWhich)
122 // call parent
123 E3dProperties::PostItemChange(nWhich);
125 // handle value change
126 E3dCompoundObject& rObj = (E3dCompoundObject&)GetSdrObject();
128 switch(nWhich)
130 // #i28528#
131 // Added extra Item (Bool) for chart2 to be able to show reduced line geometry
132 case SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY:
134 rObj.ActionChanged();
135 break;
137 case SDRATTR_3DOBJ_DOUBLE_SIDED:
139 rObj.ActionChanged();
140 break;
142 case SDRATTR_3DOBJ_NORMALS_KIND:
144 rObj.ActionChanged();
145 break;
147 case SDRATTR_3DOBJ_NORMALS_INVERT:
149 rObj.ActionChanged();
150 break;
152 case SDRATTR_3DOBJ_TEXTURE_PROJ_X:
154 rObj.ActionChanged();
155 break;
157 case SDRATTR_3DOBJ_TEXTURE_PROJ_Y:
159 rObj.ActionChanged();
160 break;
164 } // end of namespace properties
165 } // end of namespace sdr
167 //////////////////////////////////////////////////////////////////////////////
168 // eof