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/captionproperties.hxx>
31 #include <svl/itemset.hxx>
32 #include <svl/style.hxx>
33 #include <svx/svddef.hxx>
34 #include <editeng/eeitem.hxx>
35 #include <svx/svdocapt.hxx>
36 
37 //////////////////////////////////////////////////////////////////////////////
38 
39 namespace sdr
40 {
41 	namespace properties
42 	{
43 		// create a new itemset
44 		SfxItemSet& CaptionProperties::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 SdrCaptionObj
54 				SDRATTR_CAPTION_FIRST, SDRATTR_CAPTION_LAST,
55 
56 				// range from SdrTextObj
57 				EE_ITEMS_START, EE_ITEMS_END,
58 
59 				// end
60 				0, 0));
61 		}
62 
63 		CaptionProperties::CaptionProperties(SdrObject& rObj)
64 		:	RectangleProperties(rObj)
65 		{
66 		}
67 
68 		CaptionProperties::CaptionProperties(const CaptionProperties& rProps, SdrObject& rObj)
69 		:	RectangleProperties(rProps, rObj)
70 		{
71 		}
72 
73 		CaptionProperties::~CaptionProperties()
74 		{
75 		}
76 
77 		BaseProperties& CaptionProperties::Clone(SdrObject& rObj) const
78 		{
79 			return *(new CaptionProperties(*this, rObj));
80 		}
81 
82 		void CaptionProperties::ItemSetChanged(const SfxItemSet& rSet)
83 		{
84 			SdrCaptionObj& rObj = (SdrCaptionObj&)GetSdrObject();
85 
86 			// local changes
87 			rObj.ImpRecalcTail();
88 
89 			// call parent
90 			RectangleProperties::ItemSetChanged(rSet);
91 		}
92 
93 		void CaptionProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
94 		{
95 			SdrCaptionObj& rObj = (SdrCaptionObj&)GetSdrObject();
96 
97 			// call parent
98 			RectangleProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
99 
100 			// local changes
101 			rObj.ImpRecalcTail();
102 		}
103 
104 		void CaptionProperties::ForceDefaultAttributes()
105 		{
106 			// call parent
107 			RectangleProperties::ForceDefaultAttributes();
108 
109 			// force ItemSet
110 			GetObjectItemSet();
111 
112 			// this was set by TextProperties::ForceDefaultAttributes(),
113 			// retet to default
114 			mpItemSet->ClearItem(XATTR_LINESTYLE);
115 		}
116 	} // end of namespace properties
117 } // end of namespace sdr
118 
119 //////////////////////////////////////////////////////////////////////////////
120 // eof
121