Line data Source code
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 :
20 : #include <sdr/properties/e3dproperties.hxx>
21 : #include <svl/itemset.hxx>
22 : #include <svx/svddef.hxx>
23 : #include <svx/obj3d.hxx>
24 :
25 :
26 :
27 : namespace sdr
28 : {
29 : namespace properties
30 : {
31 : // create a new itemset
32 5504 : SfxItemSet& E3dProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
33 : {
34 : return *(new SfxItemSet(rPool,
35 :
36 : // ranges from SdrAttrObj
37 : SDRATTR_START, SDRATTR_SHADOW_LAST,
38 : SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
39 : SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION,
40 :
41 : // ranges from E3dObject, contains object and scene because of GetMergedItemSet()
42 : SDRATTR_3D_FIRST, SDRATTR_3D_LAST,
43 :
44 : // end
45 5504 : 0, 0));
46 : }
47 :
48 5504 : E3dProperties::E3dProperties(SdrObject& rObj)
49 5504 : : AttributeProperties(rObj)
50 : {
51 5504 : }
52 :
53 0 : E3dProperties::E3dProperties(const E3dProperties& rProps, SdrObject& rObj)
54 0 : : AttributeProperties(rProps, rObj)
55 : {
56 0 : }
57 :
58 5504 : E3dProperties::~E3dProperties()
59 : {
60 5504 : }
61 :
62 0 : BaseProperties& E3dProperties::Clone(SdrObject& rObj) const
63 : {
64 0 : return *(new E3dProperties(*this, rObj));
65 : }
66 :
67 16770 : void E3dProperties::ItemSetChanged(const SfxItemSet& rSet)
68 : {
69 16770 : E3dObject& rObj = static_cast<E3dObject&>(GetSdrObject());
70 :
71 : // call parent
72 16770 : AttributeProperties::ItemSetChanged(rSet);
73 :
74 : // local changes
75 16770 : rObj.StructureChanged();
76 16770 : }
77 :
78 4098 : void E3dProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
79 : {
80 : // call parent
81 4098 : AttributeProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
82 :
83 : // propagate call to contained objects
84 4098 : const SdrObjList* pSub = static_cast<const E3dObject&>(GetSdrObject()).GetSubList();
85 4098 : const size_t nCount(pSub->GetObjCount());
86 :
87 4098 : for(size_t a = 0; a < nCount; ++a)
88 : {
89 0 : pSub->GetObj(a)->GetProperties().SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
90 : }
91 4098 : }
92 : } // end of namespace properties
93 651 : } // end of namespace sdr
94 :
95 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|