1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_svx.hxx"
26 #include <svx/sdr/properties/captionproperties.hxx>
27 #include <svl/itemset.hxx>
28 #include <svl/style.hxx>
29 #include <svx/svddef.hxx>
30 #include <editeng/eeitem.hxx>
31 #include <svx/svdocapt.hxx>
32 
33 //////////////////////////////////////////////////////////////////////////////
34 
35 namespace sdr
36 {
37 	namespace properties
38 	{
39 		// create a new itemset
CreateObjectSpecificItemSet(SfxItemPool & rPool)40 		SfxItemSet& CaptionProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
41 		{
42 			return *(new SfxItemSet(rPool,
43 
44 				// range from SdrAttrObj
45 				SDRATTR_START, SDRATTR_SHADOW_LAST,
46 				SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
47 				SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION,
48 
49 				// range from SdrCaptionObj
50 				SDRATTR_CAPTION_FIRST, SDRATTR_CAPTION_LAST,
51 
52 				// range from SdrTextObj
53 				EE_ITEMS_START, EE_ITEMS_END,
54 
55 				// end
56 				0, 0));
57 		}
58 
CaptionProperties(SdrObject & rObj)59 		CaptionProperties::CaptionProperties(SdrObject& rObj)
60 		:	RectangleProperties(rObj)
61 		{
62 		}
63 
CaptionProperties(const CaptionProperties & rProps,SdrObject & rObj)64 		CaptionProperties::CaptionProperties(const CaptionProperties& rProps, SdrObject& rObj)
65 		:	RectangleProperties(rProps, rObj)
66 		{
67 		}
68 
~CaptionProperties()69 		CaptionProperties::~CaptionProperties()
70 		{
71 		}
72 
Clone(SdrObject & rObj) const73 		BaseProperties& CaptionProperties::Clone(SdrObject& rObj) const
74 		{
75 			return *(new CaptionProperties(*this, rObj));
76 		}
77 
ItemSetChanged(const SfxItemSet & rSet)78 		void CaptionProperties::ItemSetChanged(const SfxItemSet& rSet)
79 		{
80 			SdrCaptionObj& rObj = (SdrCaptionObj&)GetSdrObject();
81 
82 			// local changes
83 			rObj.ImpRecalcTail();
84 
85 			// call parent
86 			RectangleProperties::ItemSetChanged(rSet);
87 		}
88 
SetStyleSheet(SfxStyleSheet * pNewStyleSheet,sal_Bool bDontRemoveHardAttr)89 		void CaptionProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
90 		{
91 			SdrCaptionObj& rObj = (SdrCaptionObj&)GetSdrObject();
92 
93 			// call parent
94 			RectangleProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
95 
96 			// local changes
97 			rObj.ImpRecalcTail();
98 		}
99 
ForceDefaultAttributes()100 		void CaptionProperties::ForceDefaultAttributes()
101 		{
102 			// call parent
103 			RectangleProperties::ForceDefaultAttributes();
104 
105 			// force ItemSet
106 			GetObjectItemSet();
107 
108 			// this was set by TextProperties::ForceDefaultAttributes(),
109 			// retet to default
110 			mpItemSet->ClearItem(XATTR_LINESTYLE);
111 		}
112 	} // end of namespace properties
113 } // end of namespace sdr
114 
115 //////////////////////////////////////////////////////////////////////////////
116 // eof
117