xref: /AOO41X/main/svx/source/sdr/attribute/sdrformtextattribute.cxx (revision f6e50924346d0b8c0b07c91832a97665dd718b0c)
1*f6e50924SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*f6e50924SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*f6e50924SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*f6e50924SAndrew Rist  * distributed with this work for additional information
6*f6e50924SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*f6e50924SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*f6e50924SAndrew Rist  * "License"); you may not use this file except in compliance
9*f6e50924SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*f6e50924SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*f6e50924SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*f6e50924SAndrew Rist  * software distributed under the License is distributed on an
15*f6e50924SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*f6e50924SAndrew Rist  * KIND, either express or implied.  See the License for the
17*f6e50924SAndrew Rist  * specific language governing permissions and limitations
18*f6e50924SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*f6e50924SAndrew Rist  *************************************************************/
21*f6e50924SAndrew Rist 
22*f6e50924SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #include "precompiled_svx.hxx"
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <svx/sdr/attribute/sdrformtextattribute.hxx>
27cdf0e10cSrcweir #include <basegfx/vector/b2enums.hxx>
28cdf0e10cSrcweir #include <svl/itemset.hxx>
29cdf0e10cSrcweir #include <svx/xftdiit.hxx>
30cdf0e10cSrcweir #include <svx/xftstit.hxx>
31cdf0e10cSrcweir #include <svx/xftshxy.hxx>
32cdf0e10cSrcweir #include <svx/xftshtit.hxx>
33cdf0e10cSrcweir #include <svx/xtextit0.hxx>
34cdf0e10cSrcweir #include <svx/xftadit.hxx>
35cdf0e10cSrcweir #include <svx/xftshit.hxx>
36cdf0e10cSrcweir #include <svx/xftshcit.hxx>
37cdf0e10cSrcweir #include <svx/xftmrit.hxx>
38cdf0e10cSrcweir #include <svx/xftouit.hxx>
39cdf0e10cSrcweir #include <svx/sdshtitm.hxx>
40cdf0e10cSrcweir #include <svx/xlntrit.hxx>
41cdf0e10cSrcweir #include <svx/sdshcitm.hxx>
42cdf0e10cSrcweir #include <svx/xlnclit.hxx>
43cdf0e10cSrcweir #include <svx/xlnwtit.hxx>
44cdf0e10cSrcweir #include <svx/xlinjoit.hxx>
45cdf0e10cSrcweir #include <svx/xlineit0.hxx>
46cdf0e10cSrcweir #include <svx/xdash.hxx>
47cdf0e10cSrcweir #include <svx/xlndsit.hxx>
48cdf0e10cSrcweir #include <drawinglayer/attribute/lineattribute.hxx>
49cdf0e10cSrcweir #include <drawinglayer/attribute/strokeattribute.hxx>
50cdf0e10cSrcweir #include <svx/sdr/attribute/sdrformtextoutlineattribute.hxx>
51cdf0e10cSrcweir 
52cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
53cdf0e10cSrcweir // helper to get line, stroke and transparence attributes from SfxItemSet
54cdf0e10cSrcweir 
55cdf0e10cSrcweir namespace
56cdf0e10cSrcweir {
57cdf0e10cSrcweir 	basegfx::B2DLineJoin impGetB2DLineJoin(XLineJoint eLineJoint)
58cdf0e10cSrcweir 	{
59cdf0e10cSrcweir 		switch(eLineJoint)
60cdf0e10cSrcweir 		{
61cdf0e10cSrcweir 			case XLINEJOINT_MIDDLE	:
62cdf0e10cSrcweir 			{
63cdf0e10cSrcweir 				return basegfx::B2DLINEJOIN_MIDDLE;
64cdf0e10cSrcweir 			}
65cdf0e10cSrcweir 			case XLINEJOINT_BEVEL	:
66cdf0e10cSrcweir 			{
67cdf0e10cSrcweir 				return basegfx::B2DLINEJOIN_BEVEL;
68cdf0e10cSrcweir 			}
69cdf0e10cSrcweir 			case XLINEJOINT_MITER	:
70cdf0e10cSrcweir 			{
71cdf0e10cSrcweir 				return basegfx::B2DLINEJOIN_MITER;
72cdf0e10cSrcweir 			}
73cdf0e10cSrcweir 			case XLINEJOINT_ROUND	:
74cdf0e10cSrcweir 			{
75cdf0e10cSrcweir 				return basegfx::B2DLINEJOIN_ROUND;
76cdf0e10cSrcweir 			}
77cdf0e10cSrcweir 			default :
78cdf0e10cSrcweir 			{
79cdf0e10cSrcweir 				return basegfx::B2DLINEJOIN_NONE; // XLINEJOINT_NONE
80cdf0e10cSrcweir 			}
81cdf0e10cSrcweir 		}
82cdf0e10cSrcweir 	}
83cdf0e10cSrcweir 
84cdf0e10cSrcweir     sal_uInt8 impGetStrokeTransparence(bool bShadow, const SfxItemSet& rSet)
85cdf0e10cSrcweir 	{
86cdf0e10cSrcweir 		sal_uInt8 nRetval;
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 		if(bShadow)
89cdf0e10cSrcweir 		{
90cdf0e10cSrcweir 			nRetval = (sal_uInt8)((((SdrShadowTransparenceItem&)(rSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue() * 255) / 100);
91cdf0e10cSrcweir 		}
92cdf0e10cSrcweir 		else
93cdf0e10cSrcweir 		{
94cdf0e10cSrcweir 			nRetval = (sal_uInt8)((((XLineTransparenceItem&)(rSet.Get(XATTR_LINETRANSPARENCE))).GetValue() * 255) / 100);
95cdf0e10cSrcweir 		}
96cdf0e10cSrcweir 
97cdf0e10cSrcweir 		return nRetval;
98cdf0e10cSrcweir 	}
99cdf0e10cSrcweir 
100cdf0e10cSrcweir 	drawinglayer::attribute::LineAttribute impGetLineAttribute(bool bShadow, const SfxItemSet& rSet)
101cdf0e10cSrcweir 	{
102cdf0e10cSrcweir 		basegfx::BColor aColorAttribute;
103cdf0e10cSrcweir 
104cdf0e10cSrcweir 		if(bShadow)
105cdf0e10cSrcweir 		{
106cdf0e10cSrcweir 			const Color aShadowColor(((SdrShadowColorItem&)(rSet.Get(SDRATTR_SHADOWCOLOR))).GetColorValue());
107cdf0e10cSrcweir 			aColorAttribute = aShadowColor.getBColor();
108cdf0e10cSrcweir 		}
109cdf0e10cSrcweir 		else
110cdf0e10cSrcweir 		{
111cdf0e10cSrcweir 			const Color aLineColor(((XLineColorItem&)(rSet.Get(XATTR_LINECOLOR))).GetColorValue());
112cdf0e10cSrcweir 			aColorAttribute = aLineColor.getBColor();
113cdf0e10cSrcweir 		}
114cdf0e10cSrcweir 
115cdf0e10cSrcweir 		const sal_uInt32 nLineWidth = ((const XLineWidthItem&)(rSet.Get(XATTR_LINEWIDTH))).GetValue();
116cdf0e10cSrcweir 		const XLineJoint eLineJoint = ((const XLineJointItem&)(rSet.Get(XATTR_LINEJOINT))).GetValue();
117cdf0e10cSrcweir 
118cdf0e10cSrcweir 		return drawinglayer::attribute::LineAttribute(aColorAttribute, (double)nLineWidth, impGetB2DLineJoin(eLineJoint));
119cdf0e10cSrcweir 	}
120cdf0e10cSrcweir 
121cdf0e10cSrcweir     drawinglayer::attribute::StrokeAttribute impGetStrokeAttribute(const SfxItemSet& rSet)
122cdf0e10cSrcweir 	{
123cdf0e10cSrcweir 		const XLineStyle eLineStyle = ((XLineStyleItem&)(rSet.Get(XATTR_LINESTYLE))).GetValue();
124cdf0e10cSrcweir 		double fFullDotDashLen(0.0);
125cdf0e10cSrcweir 		::std::vector< double > aDotDashArray;
126cdf0e10cSrcweir 
127cdf0e10cSrcweir 		if(XLINE_DASH == eLineStyle)
128cdf0e10cSrcweir 		{
129cdf0e10cSrcweir 			const XDash& rDash = ((const XLineDashItem&)(rSet.Get(XATTR_LINEDASH))).GetDashValue();
130cdf0e10cSrcweir 
131cdf0e10cSrcweir 			if(rDash.GetDots() || rDash.GetDashes())
132cdf0e10cSrcweir 			{
133cdf0e10cSrcweir         		const sal_uInt32 nLineWidth = ((const XLineWidthItem&)(rSet.Get(XATTR_LINEWIDTH))).GetValue();
134cdf0e10cSrcweir 				fFullDotDashLen = rDash.CreateDotDashArray(aDotDashArray, (double)nLineWidth);
135cdf0e10cSrcweir 			}
136cdf0e10cSrcweir 		}
137cdf0e10cSrcweir 
138cdf0e10cSrcweir 		return drawinglayer::attribute::StrokeAttribute(aDotDashArray, fFullDotDashLen);
139cdf0e10cSrcweir 	}
140cdf0e10cSrcweir } // end of anonymous namespace
141cdf0e10cSrcweir 
142cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
143cdf0e10cSrcweir 
144cdf0e10cSrcweir namespace drawinglayer
145cdf0e10cSrcweir {
146cdf0e10cSrcweir 	namespace attribute
147cdf0e10cSrcweir 	{
148cdf0e10cSrcweir 	    class ImpSdrFormTextAttribute
149cdf0e10cSrcweir 	    {
150cdf0e10cSrcweir 		public:
151cdf0e10cSrcweir 			// refcounter
152cdf0e10cSrcweir 			sal_uInt32								mnRefCount;
153cdf0e10cSrcweir 
154cdf0e10cSrcweir             // FormText (FontWork) Attributes
155cdf0e10cSrcweir 		    sal_Int32								mnFormTextDistance;		// distance from line in upright direction
156cdf0e10cSrcweir 		    sal_Int32								mnFormTextStart;		// shift from polygon start
157cdf0e10cSrcweir 		    sal_Int32								mnFormTextShdwXVal;		// shadow distance or 10th degrees
158cdf0e10cSrcweir 		    sal_Int32								mnFormTextShdwYVal;		// shadow distance or scaling
159cdf0e10cSrcweir 		    sal_uInt16								mnFormTextShdwTransp;	// shadow transparence
160cdf0e10cSrcweir 		    XFormTextStyle							meFormTextStyle;		// on/off and char orientation
161cdf0e10cSrcweir 		    XFormTextAdjust							meFormTextAdjust;		// adjustment (left/right/center) and scale
162cdf0e10cSrcweir 		    XFormTextShadow							meFormTextShadow;		// shadow mode
163cdf0e10cSrcweir 		    Color									maFormTextShdwColor;	// shadow color
164cdf0e10cSrcweir 
165cdf0e10cSrcweir             // outline attributes; used when getFormTextOutline() is true and (for
166cdf0e10cSrcweir             // shadow) when getFormTextShadow() != XFTSHADOW_NONE
167cdf0e10cSrcweir             SdrFormTextOutlineAttribute				maOutline;
168cdf0e10cSrcweir             SdrFormTextOutlineAttribute				maShadowOutline;
169cdf0e10cSrcweir 
170cdf0e10cSrcweir 		    // bitfield
171cdf0e10cSrcweir 		    unsigned								mbFormTextMirror : 1;	// change orientation
172cdf0e10cSrcweir 		    unsigned								mbFormTextOutline : 1;	// show contour of objects
173cdf0e10cSrcweir 
174cdf0e10cSrcweir 		    ImpSdrFormTextAttribute(const SfxItemSet& rSet)
175cdf0e10cSrcweir 			:	mnRefCount(0),
176cdf0e10cSrcweir 				mnFormTextDistance(((const XFormTextDistanceItem&)rSet.Get(XATTR_FORMTXTDISTANCE)).GetValue()),
177cdf0e10cSrcweir 				mnFormTextStart(((const XFormTextStartItem&)rSet.Get(XATTR_FORMTXTSTART)).GetValue()),
178cdf0e10cSrcweir 				mnFormTextShdwXVal(((const XFormTextShadowXValItem&)rSet.Get(XATTR_FORMTXTSHDWXVAL)).GetValue()),
179cdf0e10cSrcweir 				mnFormTextShdwYVal(((const XFormTextShadowYValItem&)rSet.Get(XATTR_FORMTXTSHDWYVAL)).GetValue()),
180cdf0e10cSrcweir 				mnFormTextShdwTransp(((const XFormTextShadowTranspItem&)rSet.Get(XATTR_FORMTXTSHDWTRANSP)).GetValue()),
181cdf0e10cSrcweir 				meFormTextStyle(((const XFormTextStyleItem&)rSet.Get(XATTR_FORMTXTSTYLE)).GetValue()),
182cdf0e10cSrcweir 				meFormTextAdjust(((const XFormTextAdjustItem&)rSet.Get(XATTR_FORMTXTADJUST)).GetValue()),
183cdf0e10cSrcweir 				meFormTextShadow(((const XFormTextShadowItem&)rSet.Get(XATTR_FORMTXTSHADOW)).GetValue()),
184cdf0e10cSrcweir 				maFormTextShdwColor(((const XFormTextShadowColorItem&)rSet.Get(XATTR_FORMTXTSHDWCOLOR)).GetColorValue()),
185cdf0e10cSrcweir 				maOutline(),
186cdf0e10cSrcweir 				maShadowOutline(),
187cdf0e10cSrcweir 				mbFormTextMirror(((const XFormTextMirrorItem&)rSet.Get(XATTR_FORMTXTMIRROR)).GetValue()),
188cdf0e10cSrcweir 				mbFormTextOutline(((const XFormTextOutlineItem&)rSet.Get(XATTR_FORMTXTOUTLINE)).GetValue())
189cdf0e10cSrcweir 			{
190cdf0e10cSrcweir 				if(getFormTextOutline())
191cdf0e10cSrcweir 				{
192cdf0e10cSrcweir 					const StrokeAttribute aStrokeAttribute(impGetStrokeAttribute(rSet));
193cdf0e10cSrcweir 
194cdf0e10cSrcweir 					// also need to prepare attributes for outlines
195cdf0e10cSrcweir 					{
196cdf0e10cSrcweir 						const LineAttribute aLineAttribute(impGetLineAttribute(false, rSet));
197cdf0e10cSrcweir 						const sal_uInt8 nTransparence(impGetStrokeTransparence(false, rSet));
198cdf0e10cSrcweir 
199cdf0e10cSrcweir 						maOutline = SdrFormTextOutlineAttribute(
200cdf0e10cSrcweir 							aLineAttribute, aStrokeAttribute, nTransparence);
201cdf0e10cSrcweir 					}
202cdf0e10cSrcweir 
203cdf0e10cSrcweir 					if(XFTSHADOW_NONE != getFormTextShadow())
204cdf0e10cSrcweir 					{
205cdf0e10cSrcweir 						// also need to prepare attributes for shadow outlines
206cdf0e10cSrcweir 						const LineAttribute aLineAttribute(impGetLineAttribute(true, rSet));
207cdf0e10cSrcweir 						const sal_uInt8 nTransparence(impGetStrokeTransparence(true, rSet));
208cdf0e10cSrcweir 
209cdf0e10cSrcweir 						maShadowOutline = SdrFormTextOutlineAttribute(
210cdf0e10cSrcweir 							aLineAttribute, aStrokeAttribute, nTransparence);
211cdf0e10cSrcweir 					}
212cdf0e10cSrcweir 				}
213cdf0e10cSrcweir 			}
214cdf0e10cSrcweir 
215cdf0e10cSrcweir 			ImpSdrFormTextAttribute()
216cdf0e10cSrcweir 			:	mnRefCount(0),
217cdf0e10cSrcweir 				mnFormTextDistance(0),
218cdf0e10cSrcweir 				mnFormTextStart(0),
219cdf0e10cSrcweir 				mnFormTextShdwXVal(0),
220cdf0e10cSrcweir 				mnFormTextShdwYVal(0),
221cdf0e10cSrcweir 				mnFormTextShdwTransp(0),
222cdf0e10cSrcweir 				meFormTextStyle(XFT_NONE),
223cdf0e10cSrcweir 				meFormTextAdjust(XFT_CENTER),
224cdf0e10cSrcweir 				meFormTextShadow(XFTSHADOW_NONE),
225cdf0e10cSrcweir 				maFormTextShdwColor(),
226cdf0e10cSrcweir 				maOutline(),
227cdf0e10cSrcweir 				maShadowOutline(),
228cdf0e10cSrcweir 				mbFormTextMirror(false),
229cdf0e10cSrcweir 				mbFormTextOutline(false)
230cdf0e10cSrcweir 			{
231cdf0e10cSrcweir 			}
232cdf0e10cSrcweir 
233cdf0e10cSrcweir 		    // data read access
234cdf0e10cSrcweir 		    sal_Int32 getFormTextDistance() const { return mnFormTextDistance; }
235cdf0e10cSrcweir 		    sal_Int32 getFormTextStart() const { return mnFormTextStart; }
236cdf0e10cSrcweir 		    sal_Int32 getFormTextShdwXVal() const { return mnFormTextShdwXVal; }
237cdf0e10cSrcweir 		    sal_Int32 getFormTextShdwYVal() const { return mnFormTextShdwYVal; }
238cdf0e10cSrcweir 		    sal_uInt16 getFormTextShdwTransp() const { return mnFormTextShdwTransp; }
239cdf0e10cSrcweir 		    XFormTextStyle getFormTextStyle() const { return meFormTextStyle; }
240cdf0e10cSrcweir 		    XFormTextAdjust getFormTextAdjust() const { return meFormTextAdjust; }
241cdf0e10cSrcweir 		    XFormTextShadow getFormTextShadow() const { return meFormTextShadow; }
242cdf0e10cSrcweir 		    Color getFormTextShdwColor() const { return maFormTextShdwColor; }
243cdf0e10cSrcweir             const SdrFormTextOutlineAttribute& getOutline() const { return maOutline; }
244cdf0e10cSrcweir             const SdrFormTextOutlineAttribute& getShadowOutline() const { return maShadowOutline; }
245cdf0e10cSrcweir             bool getFormTextMirror() const { return mbFormTextMirror; }
246cdf0e10cSrcweir 		    bool getFormTextOutline() const { return mbFormTextOutline; }
247cdf0e10cSrcweir 
248cdf0e10cSrcweir             // compare operator
249cdf0e10cSrcweir 			bool operator==(const ImpSdrFormTextAttribute& rCandidate) const
250cdf0e10cSrcweir 			{
251cdf0e10cSrcweir 				return (getFormTextDistance() == rCandidate.getFormTextDistance()
252cdf0e10cSrcweir 					&& getFormTextStart() == rCandidate.getFormTextStart()
253cdf0e10cSrcweir 					&& getFormTextShdwXVal() == rCandidate.getFormTextShdwXVal()
254cdf0e10cSrcweir 					&& getFormTextShdwYVal() == rCandidate.getFormTextShdwYVal()
255cdf0e10cSrcweir 					&& getFormTextShdwTransp() == rCandidate.getFormTextShdwTransp()
256cdf0e10cSrcweir 					&& getFormTextStyle() == rCandidate.getFormTextStyle()
257cdf0e10cSrcweir 					&& getFormTextAdjust() == rCandidate.getFormTextAdjust()
258cdf0e10cSrcweir 					&& getFormTextShadow() == rCandidate.getFormTextShadow()
259cdf0e10cSrcweir 					&& getFormTextShdwColor() == rCandidate.getFormTextShdwColor()
260cdf0e10cSrcweir 					&& getOutline() == rCandidate.getOutline()
261cdf0e10cSrcweir 					&& getShadowOutline() == rCandidate.getShadowOutline()
262cdf0e10cSrcweir 					&& getFormTextMirror() == rCandidate.getFormTextMirror()
263cdf0e10cSrcweir 					&& getFormTextOutline() == rCandidate.getFormTextOutline());
264cdf0e10cSrcweir 			}
265cdf0e10cSrcweir 
266cdf0e10cSrcweir             static ImpSdrFormTextAttribute* get_global_default()
267cdf0e10cSrcweir             {
268cdf0e10cSrcweir                 static ImpSdrFormTextAttribute* pDefault = 0;
269cdf0e10cSrcweir 
270cdf0e10cSrcweir                 if(!pDefault)
271cdf0e10cSrcweir                 {
272cdf0e10cSrcweir                     pDefault = new ImpSdrFormTextAttribute();
273cdf0e10cSrcweir 
274cdf0e10cSrcweir                     // never delete; start with RefCount 1, not 0
275cdf0e10cSrcweir     			    pDefault->mnRefCount++;
276cdf0e10cSrcweir                 }
277cdf0e10cSrcweir 
278cdf0e10cSrcweir                 return pDefault;
279cdf0e10cSrcweir             }
280cdf0e10cSrcweir 	    };
281cdf0e10cSrcweir 
282cdf0e10cSrcweir         SdrFormTextAttribute::SdrFormTextAttribute(const SfxItemSet& rSet)
283cdf0e10cSrcweir 		:	mpSdrFormTextAttribute(new ImpSdrFormTextAttribute(rSet))
284cdf0e10cSrcweir 		{
285cdf0e10cSrcweir 		}
286cdf0e10cSrcweir 
287cdf0e10cSrcweir 		SdrFormTextAttribute::SdrFormTextAttribute()
288cdf0e10cSrcweir         :	mpSdrFormTextAttribute(ImpSdrFormTextAttribute::get_global_default())
289cdf0e10cSrcweir 		{
290cdf0e10cSrcweir 			mpSdrFormTextAttribute->mnRefCount++;
291cdf0e10cSrcweir 		}
292cdf0e10cSrcweir 
293cdf0e10cSrcweir         SdrFormTextAttribute::SdrFormTextAttribute(const SdrFormTextAttribute& rCandidate)
294cdf0e10cSrcweir 		:	mpSdrFormTextAttribute(rCandidate.mpSdrFormTextAttribute)
295cdf0e10cSrcweir 		{
296cdf0e10cSrcweir 			mpSdrFormTextAttribute->mnRefCount++;
297cdf0e10cSrcweir 		}
298cdf0e10cSrcweir 
299cdf0e10cSrcweir 		SdrFormTextAttribute::~SdrFormTextAttribute()
300cdf0e10cSrcweir 		{
301cdf0e10cSrcweir 			if(mpSdrFormTextAttribute->mnRefCount)
302cdf0e10cSrcweir 			{
303cdf0e10cSrcweir 				mpSdrFormTextAttribute->mnRefCount--;
304cdf0e10cSrcweir 			}
305cdf0e10cSrcweir 			else
306cdf0e10cSrcweir 			{
307cdf0e10cSrcweir 				delete mpSdrFormTextAttribute;
308cdf0e10cSrcweir 			}
309cdf0e10cSrcweir 		}
310cdf0e10cSrcweir 
311cdf0e10cSrcweir         bool SdrFormTextAttribute::isDefault() const
312cdf0e10cSrcweir         {
313cdf0e10cSrcweir             return mpSdrFormTextAttribute == ImpSdrFormTextAttribute::get_global_default();
314cdf0e10cSrcweir         }
315cdf0e10cSrcweir 
316cdf0e10cSrcweir         SdrFormTextAttribute& SdrFormTextAttribute::operator=(const SdrFormTextAttribute& rCandidate)
317cdf0e10cSrcweir 		{
318cdf0e10cSrcweir 			if(rCandidate.mpSdrFormTextAttribute != mpSdrFormTextAttribute)
319cdf0e10cSrcweir 			{
320cdf0e10cSrcweir 				if(mpSdrFormTextAttribute->mnRefCount)
321cdf0e10cSrcweir 				{
322cdf0e10cSrcweir 					mpSdrFormTextAttribute->mnRefCount--;
323cdf0e10cSrcweir 				}
324cdf0e10cSrcweir 				else
325cdf0e10cSrcweir 				{
326cdf0e10cSrcweir 					delete mpSdrFormTextAttribute;
327cdf0e10cSrcweir 				}
328cdf0e10cSrcweir 
329cdf0e10cSrcweir 				mpSdrFormTextAttribute = rCandidate.mpSdrFormTextAttribute;
330cdf0e10cSrcweir 				mpSdrFormTextAttribute->mnRefCount++;
331cdf0e10cSrcweir 			}
332cdf0e10cSrcweir 
333cdf0e10cSrcweir 			return *this;
334cdf0e10cSrcweir 		}
335cdf0e10cSrcweir 
336cdf0e10cSrcweir 		bool SdrFormTextAttribute::operator==(const SdrFormTextAttribute& rCandidate) const
337cdf0e10cSrcweir 		{
338cdf0e10cSrcweir 			if(rCandidate.mpSdrFormTextAttribute == mpSdrFormTextAttribute)
339cdf0e10cSrcweir 			{
340cdf0e10cSrcweir 				return true;
341cdf0e10cSrcweir 			}
342cdf0e10cSrcweir 
343cdf0e10cSrcweir 			if(rCandidate.isDefault() != isDefault())
344cdf0e10cSrcweir 			{
345cdf0e10cSrcweir 				return false;
346cdf0e10cSrcweir 			}
347cdf0e10cSrcweir 
348cdf0e10cSrcweir 			return (*rCandidate.mpSdrFormTextAttribute == *mpSdrFormTextAttribute);
349cdf0e10cSrcweir 		}
350cdf0e10cSrcweir 
351cdf0e10cSrcweir 	    sal_Int32 SdrFormTextAttribute::getFormTextDistance() const
352cdf0e10cSrcweir 		{
353cdf0e10cSrcweir 			return mpSdrFormTextAttribute->getFormTextDistance();
354cdf0e10cSrcweir 		}
355cdf0e10cSrcweir 
356cdf0e10cSrcweir 		sal_Int32 SdrFormTextAttribute::getFormTextStart() const
357cdf0e10cSrcweir 		{
358cdf0e10cSrcweir 			return mpSdrFormTextAttribute->getFormTextStart();
359cdf0e10cSrcweir 		}
360cdf0e10cSrcweir 
361cdf0e10cSrcweir 		sal_Int32 SdrFormTextAttribute::getFormTextShdwXVal() const
362cdf0e10cSrcweir 		{
363cdf0e10cSrcweir 			return mpSdrFormTextAttribute->getFormTextShdwXVal();
364cdf0e10cSrcweir 		}
365cdf0e10cSrcweir 
366cdf0e10cSrcweir 		sal_Int32 SdrFormTextAttribute::getFormTextShdwYVal() const
367cdf0e10cSrcweir 		{
368cdf0e10cSrcweir 			return mpSdrFormTextAttribute->getFormTextShdwYVal();
369cdf0e10cSrcweir 		}
370cdf0e10cSrcweir 
371cdf0e10cSrcweir 		sal_uInt16 SdrFormTextAttribute::getFormTextShdwTransp() const
372cdf0e10cSrcweir 		{
373cdf0e10cSrcweir 			return mpSdrFormTextAttribute->getFormTextShdwTransp();
374cdf0e10cSrcweir 		}
375cdf0e10cSrcweir 
376cdf0e10cSrcweir 		XFormTextStyle SdrFormTextAttribute::getFormTextStyle() const
377cdf0e10cSrcweir 		{
378cdf0e10cSrcweir 			return mpSdrFormTextAttribute->getFormTextStyle();
379cdf0e10cSrcweir 		}
380cdf0e10cSrcweir 
381cdf0e10cSrcweir 		XFormTextAdjust SdrFormTextAttribute::getFormTextAdjust() const
382cdf0e10cSrcweir 		{
383cdf0e10cSrcweir 			return mpSdrFormTextAttribute->getFormTextAdjust();
384cdf0e10cSrcweir 		}
385cdf0e10cSrcweir 
386cdf0e10cSrcweir 		XFormTextShadow SdrFormTextAttribute::getFormTextShadow() const
387cdf0e10cSrcweir 		{
388cdf0e10cSrcweir 			return mpSdrFormTextAttribute->getFormTextShadow();
389cdf0e10cSrcweir 		}
390cdf0e10cSrcweir 
391cdf0e10cSrcweir 		Color SdrFormTextAttribute::getFormTextShdwColor() const
392cdf0e10cSrcweir 		{
393cdf0e10cSrcweir 			return mpSdrFormTextAttribute->getFormTextShdwColor();
394cdf0e10cSrcweir 		}
395cdf0e10cSrcweir 
396cdf0e10cSrcweir 		const SdrFormTextOutlineAttribute& SdrFormTextAttribute::getOutline() const
397cdf0e10cSrcweir 		{
398cdf0e10cSrcweir 			return mpSdrFormTextAttribute->getOutline();
399cdf0e10cSrcweir 		}
400cdf0e10cSrcweir 
401cdf0e10cSrcweir 		const SdrFormTextOutlineAttribute& SdrFormTextAttribute::getShadowOutline() const
402cdf0e10cSrcweir 		{
403cdf0e10cSrcweir 			return mpSdrFormTextAttribute->getShadowOutline();
404cdf0e10cSrcweir 		}
405cdf0e10cSrcweir 
406cdf0e10cSrcweir 		bool SdrFormTextAttribute::getFormTextMirror() const
407cdf0e10cSrcweir 		{
408cdf0e10cSrcweir 			return mpSdrFormTextAttribute->getFormTextMirror();
409cdf0e10cSrcweir 		}
410cdf0e10cSrcweir 
411cdf0e10cSrcweir 		bool SdrFormTextAttribute::getFormTextOutline() const
412cdf0e10cSrcweir 		{
413cdf0e10cSrcweir 			return mpSdrFormTextAttribute->getFormTextOutline();
414cdf0e10cSrcweir 		}
415cdf0e10cSrcweir 	} // end of namespace attribute
416cdf0e10cSrcweir } // end of namespace drawinglayer
417cdf0e10cSrcweir 
418cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
419cdf0e10cSrcweir // eof
420