xref: /trunk/main/svx/source/sdr/properties/connectorproperties.cxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
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/connectorproperties.hxx>
31 #include <svl/itemset.hxx>
32 #include <svl/style.hxx>
33 #include <svx/svddef.hxx>
34 #include <editeng/eeitem.hxx>
35 #include <svx/svdoedge.hxx>
36 
37 //////////////////////////////////////////////////////////////////////////////
38 
39 namespace sdr
40 {
41     namespace properties
42     {
43         // create a new itemset
44         SfxItemSet& ConnectorProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
45         {
46             return *(new SfxItemSet(rPool,
47 
48                 // range from SdrAttrObj
49                 SDRATTR_START, SDRATTR_SHADOW_LAST,
50                 SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
51                 SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION,
52 
53                 // range from SdrEdgeObj
54                 SDRATTR_EDGE_FIRST, SDRATTR_EDGE_LAST,
55 
56                 // range from SdrTextObj
57                 EE_ITEMS_START, EE_ITEMS_END,
58 
59                 // end
60                 0, 0));
61         }
62 
63         ConnectorProperties::ConnectorProperties(SdrObject& rObj)
64         :   TextProperties(rObj)
65         {
66         }
67 
68         ConnectorProperties::ConnectorProperties(const ConnectorProperties& rProps, SdrObject& rObj)
69         :   TextProperties(rProps, rObj)
70         {
71         }
72 
73         ConnectorProperties::~ConnectorProperties()
74         {
75         }
76 
77         BaseProperties& ConnectorProperties::Clone(SdrObject& rObj) const
78         {
79             return *(new ConnectorProperties(*this, rObj));
80         }
81 
82         void ConnectorProperties::ItemSetChanged(const SfxItemSet& rSet)
83         {
84             SdrEdgeObj& rObj = (SdrEdgeObj&)GetSdrObject();
85 
86             // call parent
87             TextProperties::ItemSetChanged(rSet);
88 
89             // local changes
90             rObj.ImpSetAttrToEdgeInfo();
91         }
92 
93         void ConnectorProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
94         {
95             SdrEdgeObj& rObj = (SdrEdgeObj&)GetSdrObject();
96 
97             // call parent
98             TextProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
99 
100             // local changes
101             rObj.ImpSetAttrToEdgeInfo();
102         }
103     } // end of namespace properties
104 } // end of namespace sdr
105 
106 //////////////////////////////////////////////////////////////////////////////
107 // eof
108