LibreOffice Module svx (master)  1
e3dcompoundproperties.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
21 #include <svl/itemset.hxx>
22 #include <svx/obj3d.hxx>
23 #include <svx/scene3d.hxx>
24 
25 
26 namespace sdr::properties
27 {
29  : E3dProperties(rObj)
30  {
31  }
32 
34  : E3dProperties(rProps, rObj)
35  {
36  }
37 
39  {
40  }
41 
42  std::unique_ptr<BaseProperties> E3dCompoundProperties::Clone(SdrObject& rObj) const
43  {
44  return std::unique_ptr<BaseProperties>(new E3dCompoundProperties(*this, rObj));
45  }
46 
48  {
49  // include Items of scene this object belongs to
50  const E3dCompoundObject& rObj = static_cast<const E3dCompoundObject&>(GetSdrObject());
51  E3dScene* pScene(rObj.getRootE3dSceneFromE3dObject());
52 
53  if(nullptr != pScene)
54  {
55  // force ItemSet
57 
58  // add filtered scene properties (SDRATTR_3DSCENE_) to local itemset
60  aSet.Put(pScene->GetProperties().GetObjectItemSet());
61  mpItemSet->Put(aSet);
62  }
63 
64  // call parent
66  }
67 
68  void E3dCompoundProperties::SetMergedItemSet(const SfxItemSet& rSet, bool bClearAllItems)
69  {
70  // Set scene specific items at scene
71  E3dCompoundObject& rObj = static_cast<E3dCompoundObject&>(GetSdrObject());
72  E3dScene* pScene(rObj.getRootE3dSceneFromE3dObject());
73 
74  if(nullptr != pScene)
75  {
76  // force ItemSet
78 
79  // Generate filtered scene properties (SDRATTR_3DSCENE_) itemset
81  aSet.Put(rSet);
82 
83  if(bClearAllItems)
84  {
85  pScene->GetProperties().ClearObjectItem();
86  }
87 
88  if(aSet.Count())
89  {
90  pScene->GetProperties().SetObjectItemSet(aSet);
91  }
92  }
93 
94  // call parent. This will set items on local object, too.
95  E3dProperties::SetMergedItemSet(rSet, bClearAllItems);
96  }
97 
98  void E3dCompoundProperties::PostItemChange(const sal_uInt16 nWhich)
99  {
100  // call parent
102 
103  // handle value change
104  E3dCompoundObject& rObj = static_cast<E3dCompoundObject&>(GetSdrObject());
105 
106  switch(nWhich)
107  {
108  // #i28528#
109  // Added extra Item (Bool) for chart2 to be able to show reduced line geometry
111  {
112  rObj.ActionChanged();
113  break;
114  }
116  {
117  rObj.ActionChanged();
118  break;
119  }
121  {
122  rObj.ActionChanged();
123  break;
124  }
126  {
127  rObj.ActionChanged();
128  break;
129  }
131  {
132  rObj.ActionChanged();
133  break;
134  }
136  {
137  rObj.ActionChanged();
138  break;
139  }
140  }
141  }
142 } // end of namespace
143 
144 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr TypedWhichId< Svx3DTextureProjectionXItem > SDRATTR_3DOBJ_TEXTURE_PROJ_X(SDRATTR_3DOBJ_FIRST+9)
constexpr TypedWhichId< SfxBoolItem > SDRATTR_3DOBJ_NORMALS_INVERT(SDRATTR_3DOBJ_FIRST+8)
virtual std::unique_ptr< BaseProperties > Clone(SdrObject &rObj) const override
virtual void PostItemChange(const sal_uInt16 nWhich) override
constexpr TypedWhichId< SfxBoolItem > SDRATTR_3DOBJ_DOUBLE_SIDED(SDRATTR_3DOBJ_FIRST+6)
virtual const SfxItemSet & GetObjectItemSet() const override
std::unique_ptr< SfxItemSet > mpItemSet
virtual const SfxItemSet & GetMergedItemSet() const
Definition: properties.cxx:69
virtual void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
Definition: properties.cxx:75
virtual const SfxItemSet & GetMergedItemSet() const override
virtual void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false) override
constexpr TypedWhichId< Svx3DReducedLineGeometryItem > SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY(SDRATTR_3DOBJ_FIRST+24)
void ActionChanged() const
Definition: svdobj.cxx:257
Abstract DrawObject.
Definition: svdobj.hxx:312
virtual void PostItemChange(const sal_uInt16 nWhich) override
const SdrObject & GetSdrObject() const
Definition: properties.cxx:59
virtual E3dScene * getRootE3dSceneFromE3dObject() const
Definition: obj3d.cxx:254
constexpr TypedWhichId< Svx3DNormalsKindItem > SDRATTR_3DOBJ_NORMALS_KIND(SDRATTR_3DOBJ_FIRST+7)
constexpr TypedWhichId< Svx3DTextureProjectionYItem > SDRATTR_3DOBJ_TEXTURE_PROJ_Y(SDRATTR_3DOBJ_FIRST+10)