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
10*f6e50924SAndrew Rist  *
11*f6e50924SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*f6e50924SAndrew Rist  *
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.
19*f6e50924SAndrew Rist  *
20*f6e50924SAndrew Rist  *************************************************************/
21*f6e50924SAndrew Rist 
22*f6e50924SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #include "precompiled_svx.hxx"
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <svx/sdr/attribute/sdrtextattribute.hxx>
27cdf0e10cSrcweir #include <svx/sdr/attribute/sdrformtextattribute.hxx>
28cdf0e10cSrcweir #include <svx/svdotext.hxx>
29cdf0e10cSrcweir #include <editeng/outlobj.hxx>
30cdf0e10cSrcweir #include <editeng/editobj.hxx>
31cdf0e10cSrcweir #include <editeng/flditem.hxx>
32cdf0e10cSrcweir #include <svx/sdr/properties/properties.hxx>
33cdf0e10cSrcweir 
34cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
35cdf0e10cSrcweir 
36cdf0e10cSrcweir namespace drawinglayer
37cdf0e10cSrcweir {
38cdf0e10cSrcweir 	namespace attribute
39cdf0e10cSrcweir 	{
40cdf0e10cSrcweir 		class ImpSdrTextAttribute
41cdf0e10cSrcweir 		{
42cdf0e10cSrcweir 		public:
43cdf0e10cSrcweir 			// refcounter
44cdf0e10cSrcweir 			sal_uInt32							mnRefCount;
45cdf0e10cSrcweir 
46cdf0e10cSrcweir             // all-text attributes. The SdrText itself and a copy
47cdf0e10cSrcweir             // of te OPO
48cdf0e10cSrcweir 			const SdrText*						mpSdrText;
49cdf0e10cSrcweir 			const OutlinerParaObject*			mpOutlinerParaObject;
50cdf0e10cSrcweir 
51cdf0e10cSrcweir             // Set when it's a FormText; contains all FormText attributes
52cdf0e10cSrcweir             SdrFormTextAttribute                maSdrFormTextAttribute;
53cdf0e10cSrcweir 
54cdf0e10cSrcweir             // text distances
55cdf0e10cSrcweir 			sal_Int32							maTextLeftDistance;
56cdf0e10cSrcweir 			sal_Int32							maTextUpperDistance;
57cdf0e10cSrcweir 			sal_Int32							maTextRightDistance;
58cdf0e10cSrcweir 			sal_Int32							maTextLowerDistance;
59cdf0e10cSrcweir 
60cdf0e10cSrcweir             // #i101556# use versioning from text attributes to detect changes
61cdf0e10cSrcweir             sal_uInt32                          maPropertiesVersion;
62cdf0e10cSrcweir 
63cdf0e10cSrcweir             // text alignments
64cdf0e10cSrcweir             SdrTextHorzAdjust                   maSdrTextHorzAdjust;
65cdf0e10cSrcweir             SdrTextVertAdjust                   maSdrTextVertAdjust;
66cdf0e10cSrcweir 
67cdf0e10cSrcweir 			// bitfield
68cdf0e10cSrcweir 			unsigned							mbContour : 1;
69cdf0e10cSrcweir 			unsigned							mbFitToSize : 1;
70cdf0e10cSrcweir 			unsigned							mbHideContour : 1;
71cdf0e10cSrcweir 			unsigned							mbBlink : 1;
72cdf0e10cSrcweir 			unsigned							mbScroll : 1;
73cdf0e10cSrcweir 			unsigned							mbInEditMode : 1;
74cdf0e10cSrcweir 			unsigned							mbFixedCellHeight : 1;
75cdf0e10cSrcweir 			unsigned							mbWrongSpell : 1;
76cdf0e10cSrcweir 
77cdf0e10cSrcweir 		public:
ImpSdrTextAttribute(const SdrText * pSdrText,const OutlinerParaObject & rOutlinerParaObject,XFormTextStyle eFormTextStyle,sal_Int32 aTextLeftDistance,sal_Int32 aTextUpperDistance,sal_Int32 aTextRightDistance,sal_Int32 aTextLowerDistance,SdrTextHorzAdjust aSdrTextHorzAdjust,SdrTextVertAdjust aSdrTextVertAdjust,bool bContour,bool bFitToSize,bool bHideContour,bool bBlink,bool bScroll,bool bInEditMode,bool bFixedCellHeight,bool bWrongSpell)78cdf0e10cSrcweir 			ImpSdrTextAttribute(
79cdf0e10cSrcweir 				const SdrText* pSdrText,
80cdf0e10cSrcweir                 const OutlinerParaObject& rOutlinerParaObject,
81cdf0e10cSrcweir 				XFormTextStyle eFormTextStyle,
82cdf0e10cSrcweir 				sal_Int32 aTextLeftDistance,
83cdf0e10cSrcweir 				sal_Int32 aTextUpperDistance,
84cdf0e10cSrcweir 				sal_Int32 aTextRightDistance,
85cdf0e10cSrcweir 				sal_Int32 aTextLowerDistance,
86cdf0e10cSrcweir                 SdrTextHorzAdjust aSdrTextHorzAdjust,
87cdf0e10cSrcweir                 SdrTextVertAdjust aSdrTextVertAdjust,
88cdf0e10cSrcweir 				bool bContour,
89cdf0e10cSrcweir                 bool bFitToSize,
90cdf0e10cSrcweir 				bool bHideContour,
91cdf0e10cSrcweir                 bool bBlink,
92cdf0e10cSrcweir 				bool bScroll,
93cdf0e10cSrcweir                 bool bInEditMode,
94cdf0e10cSrcweir                 bool bFixedCellHeight,
95cdf0e10cSrcweir 				bool bWrongSpell)
96cdf0e10cSrcweir 			:	mnRefCount(0),
97cdf0e10cSrcweir 				mpSdrText(pSdrText),
98cdf0e10cSrcweir 				mpOutlinerParaObject(new OutlinerParaObject(rOutlinerParaObject)),
99cdf0e10cSrcweir 				maSdrFormTextAttribute(),
100cdf0e10cSrcweir 				maTextLeftDistance(aTextLeftDistance),
101cdf0e10cSrcweir 				maTextUpperDistance(aTextUpperDistance),
102cdf0e10cSrcweir 				maTextRightDistance(aTextRightDistance),
103cdf0e10cSrcweir 				maTextLowerDistance(aTextLowerDistance),
104cdf0e10cSrcweir 				maPropertiesVersion(0),
105cdf0e10cSrcweir 				maSdrTextHorzAdjust(aSdrTextHorzAdjust),
106cdf0e10cSrcweir 				maSdrTextVertAdjust(aSdrTextVertAdjust),
107cdf0e10cSrcweir 				mbContour(bContour),
108cdf0e10cSrcweir 				mbFitToSize(bFitToSize),
109cdf0e10cSrcweir 				mbHideContour(bHideContour),
110cdf0e10cSrcweir 				mbBlink(bBlink),
111cdf0e10cSrcweir 				mbScroll(bScroll),
112cdf0e10cSrcweir 				mbInEditMode(bInEditMode),
113cdf0e10cSrcweir 				mbFixedCellHeight(bFixedCellHeight),
114cdf0e10cSrcweir 				mbWrongSpell(bWrongSpell)
115cdf0e10cSrcweir 			{
116cdf0e10cSrcweir 				if(pSdrText)
117cdf0e10cSrcweir 				{
118cdf0e10cSrcweir 					if(XFT_NONE != eFormTextStyle)
119cdf0e10cSrcweir 					{
120cdf0e10cSrcweir 						// text on path. Create FormText attribute
121cdf0e10cSrcweir         				const SfxItemSet& rSet = pSdrText->GetItemSet();
122cdf0e10cSrcweir 						maSdrFormTextAttribute = SdrFormTextAttribute(rSet);
123cdf0e10cSrcweir 					}
124cdf0e10cSrcweir 
125cdf0e10cSrcweir 					// #i101556# init with version number to detect changes of single text
126cdf0e10cSrcweir 					// attribute and/or style sheets in primitive data without having to
127cdf0e10cSrcweir 					// copy that data locally (which would be better from principle)
128cdf0e10cSrcweir 					maPropertiesVersion = pSdrText->GetObject().GetProperties().getVersion();
129cdf0e10cSrcweir 				}
130cdf0e10cSrcweir 			}
131cdf0e10cSrcweir 
ImpSdrTextAttribute()132cdf0e10cSrcweir 			ImpSdrTextAttribute()
133cdf0e10cSrcweir 			:	mnRefCount(0),
134cdf0e10cSrcweir 				mpSdrText(0),
135cdf0e10cSrcweir 				mpOutlinerParaObject(0),
136cdf0e10cSrcweir 				maSdrFormTextAttribute(),
137cdf0e10cSrcweir 				maTextLeftDistance(0),
138cdf0e10cSrcweir 				maTextUpperDistance(0),
139cdf0e10cSrcweir 				maTextRightDistance(0),
140cdf0e10cSrcweir 				maTextLowerDistance(0),
141cdf0e10cSrcweir 				maPropertiesVersion(0),
142cdf0e10cSrcweir 				maSdrTextHorzAdjust(SDRTEXTHORZADJUST_LEFT),
143cdf0e10cSrcweir 				maSdrTextVertAdjust(SDRTEXTVERTADJUST_TOP),
144cdf0e10cSrcweir 				mbContour(false),
145cdf0e10cSrcweir 				mbFitToSize(false),
146cdf0e10cSrcweir 				mbHideContour(false),
147cdf0e10cSrcweir 				mbBlink(false),
148cdf0e10cSrcweir 				mbScroll(false),
149cdf0e10cSrcweir 				mbInEditMode(false),
150cdf0e10cSrcweir 				mbFixedCellHeight(false),
151cdf0e10cSrcweir 				mbWrongSpell(false)
152cdf0e10cSrcweir 			{
153cdf0e10cSrcweir 			}
154cdf0e10cSrcweir 
~ImpSdrTextAttribute()155cdf0e10cSrcweir 			~ImpSdrTextAttribute()
156cdf0e10cSrcweir 			{
157cdf0e10cSrcweir 				if(mpOutlinerParaObject)
158cdf0e10cSrcweir 				{
159cdf0e10cSrcweir 					delete mpOutlinerParaObject;
160cdf0e10cSrcweir 				}
161cdf0e10cSrcweir 			}
162cdf0e10cSrcweir 
163cdf0e10cSrcweir 			// data read access
getSdrText() const164cdf0e10cSrcweir 			const SdrText& getSdrText() const
165cdf0e10cSrcweir 			{
166cdf0e10cSrcweir 				OSL_ENSURE(mpSdrText, "Access to text of default version of ImpSdrTextAttribute (!)");
167cdf0e10cSrcweir 				return *mpSdrText;
168cdf0e10cSrcweir 			}
getOutlinerParaObject() const169cdf0e10cSrcweir             const OutlinerParaObject& getOutlinerParaObject() const
170cdf0e10cSrcweir 			{
171cdf0e10cSrcweir 				OSL_ENSURE(mpOutlinerParaObject, "Access to OutlinerParaObject of default version of ImpSdrTextAttribute (!)");
172cdf0e10cSrcweir 				return *mpOutlinerParaObject;
173cdf0e10cSrcweir 			}
isContour() const174cdf0e10cSrcweir 			bool isContour() const { return mbContour; }
isFitToSize() const175cdf0e10cSrcweir 			bool isFitToSize() const { return mbFitToSize; }
isHideContour() const176cdf0e10cSrcweir 			bool isHideContour() const { return mbHideContour; }
isBlink() const177cdf0e10cSrcweir 			bool isBlink() const { return mbBlink; }
isScroll() const178cdf0e10cSrcweir 			bool isScroll() const { return mbScroll; }
isInEditMode() const179cdf0e10cSrcweir             bool isInEditMode() const { return mbInEditMode; }
isFixedCellHeight() const180cdf0e10cSrcweir             bool isFixedCellHeight() const { return mbFixedCellHeight; }
isWrongSpell() const181cdf0e10cSrcweir 			bool isWrongSpell() const { return mbWrongSpell; }
getSdrFormTextAttribute() const182cdf0e10cSrcweir             const SdrFormTextAttribute& getSdrFormTextAttribute() const { return maSdrFormTextAttribute; }
getTextLeftDistance() const183cdf0e10cSrcweir 			sal_Int32 getTextLeftDistance() const { return maTextLeftDistance; }
getTextUpperDistance() const184cdf0e10cSrcweir 			sal_Int32 getTextUpperDistance() const { return maTextUpperDistance; }
getTextRightDistance() const185cdf0e10cSrcweir 			sal_Int32 getTextRightDistance() const { return maTextRightDistance; }
getTextLowerDistance() const186cdf0e10cSrcweir 			sal_Int32 getTextLowerDistance() const { return maTextLowerDistance; }
getPropertiesVersion() const187cdf0e10cSrcweir             sal_uInt32 getPropertiesVersion() const { return maPropertiesVersion; }
getSdrTextHorzAdjust() const188cdf0e10cSrcweir             SdrTextHorzAdjust getSdrTextHorzAdjust() const { return maSdrTextHorzAdjust; }
getSdrTextVertAdjust() const189cdf0e10cSrcweir             SdrTextVertAdjust getSdrTextVertAdjust() const { return maSdrTextVertAdjust; }
190cdf0e10cSrcweir 
191cdf0e10cSrcweir 			// compare operator
operator ==(const ImpSdrTextAttribute & rCandidate) const192cdf0e10cSrcweir 			bool operator==(const ImpSdrTextAttribute& rCandidate) const
193cdf0e10cSrcweir 			{
194cdf0e10cSrcweir 				if(mpOutlinerParaObject != rCandidate.mpOutlinerParaObject)
195cdf0e10cSrcweir 				{
196cdf0e10cSrcweir 					if(mpOutlinerParaObject && rCandidate.mpOutlinerParaObject)
197cdf0e10cSrcweir 					{
198cdf0e10cSrcweir 						// compares OPO and it's contents, but traditionally not the RedLining
199cdf0e10cSrcweir 						// which is not seen as model, but as temporary information
200cdf0e10cSrcweir 						if(!(getOutlinerParaObject() == rCandidate.getOutlinerParaObject()))
201cdf0e10cSrcweir 						{
202cdf0e10cSrcweir 							return false;
203cdf0e10cSrcweir 						}
204cdf0e10cSrcweir 
205cdf0e10cSrcweir 						// #i102062# for primitive visualisation, the WrongList (SpellChecking)
206cdf0e10cSrcweir 						// is important, too, so use isWrongListEqual since there is no WrongList
207cdf0e10cSrcweir 						// comparison in the regular OutlinerParaObject compare (since it's
208cdf0e10cSrcweir 						// not-persistent data)
209cdf0e10cSrcweir 						if(!(getOutlinerParaObject().isWrongListEqual(rCandidate.getOutlinerParaObject())))
210cdf0e10cSrcweir 						{
211cdf0e10cSrcweir 							return false;
212cdf0e10cSrcweir 						}
213cdf0e10cSrcweir 					}
214cdf0e10cSrcweir 					else
215cdf0e10cSrcweir 					{
216cdf0e10cSrcweir 						// only one is zero; not equal
217cdf0e10cSrcweir 						return false;
218cdf0e10cSrcweir 					}
219cdf0e10cSrcweir 				}
220cdf0e10cSrcweir 
221cdf0e10cSrcweir 				return (
222cdf0e10cSrcweir 					   getSdrFormTextAttribute() == rCandidate.getSdrFormTextAttribute()
223cdf0e10cSrcweir 					&& getTextLeftDistance() == rCandidate.getTextLeftDistance()
224cdf0e10cSrcweir 					&& getTextUpperDistance() == rCandidate.getTextUpperDistance()
225cdf0e10cSrcweir 					&& getTextRightDistance() == rCandidate.getTextRightDistance()
226cdf0e10cSrcweir 					&& getTextLowerDistance() == rCandidate.getTextLowerDistance()
227cdf0e10cSrcweir 					&& getPropertiesVersion() == rCandidate.getPropertiesVersion()
228cdf0e10cSrcweir 
229cdf0e10cSrcweir 					&& getSdrTextHorzAdjust() == rCandidate.getSdrTextHorzAdjust()
230cdf0e10cSrcweir 					&& getSdrTextVertAdjust() == rCandidate.getSdrTextVertAdjust()
231cdf0e10cSrcweir 
232cdf0e10cSrcweir 					&& isContour() == rCandidate.isContour()
233cdf0e10cSrcweir 					&& isFitToSize() == rCandidate.isFitToSize()
234cdf0e10cSrcweir 					&& isHideContour() == rCandidate.isHideContour()
235cdf0e10cSrcweir 					&& isBlink() == rCandidate.isBlink()
236cdf0e10cSrcweir 					&& isScroll() == rCandidate.isScroll()
237cdf0e10cSrcweir 					&& isInEditMode() == rCandidate.isInEditMode()
238cdf0e10cSrcweir 					&& isFixedCellHeight() == rCandidate.isFixedCellHeight()
239cdf0e10cSrcweir 					&& isWrongSpell() == rCandidate.isWrongSpell());
240cdf0e10cSrcweir 			}
241cdf0e10cSrcweir 
get_global_default()242cdf0e10cSrcweir 			static ImpSdrTextAttribute* get_global_default()
243cdf0e10cSrcweir             {
244cdf0e10cSrcweir                 static ImpSdrTextAttribute* pDefault = 0;
245cdf0e10cSrcweir 
246cdf0e10cSrcweir                 if(!pDefault)
247cdf0e10cSrcweir                 {
248cdf0e10cSrcweir 					// use default constructor
249cdf0e10cSrcweir                     pDefault = new ImpSdrTextAttribute();
250cdf0e10cSrcweir 
251cdf0e10cSrcweir                     // never delete; start with RefCount 1, not 0
252cdf0e10cSrcweir     			    pDefault->mnRefCount++;
253cdf0e10cSrcweir                 }
254cdf0e10cSrcweir 
255cdf0e10cSrcweir                 return pDefault;
256cdf0e10cSrcweir             }
257cdf0e10cSrcweir 		};
258cdf0e10cSrcweir 
SdrTextAttribute(const SdrText & rSdrText,const OutlinerParaObject & rOutlinerParaObject,XFormTextStyle eFormTextStyle,sal_Int32 aTextLeftDistance,sal_Int32 aTextUpperDistance,sal_Int32 aTextRightDistance,sal_Int32 aTextLowerDistance,SdrTextHorzAdjust aSdrTextHorzAdjust,SdrTextVertAdjust aSdrTextVertAdjust,bool bContour,bool bFitToSize,bool bHideContour,bool bBlink,bool bScroll,bool bInEditMode,bool bFixedCellHeight,bool bWrongSpell)259cdf0e10cSrcweir         SdrTextAttribute::SdrTextAttribute(
260cdf0e10cSrcweir 			const SdrText& rSdrText,
261cdf0e10cSrcweir             const OutlinerParaObject& rOutlinerParaObject,
262cdf0e10cSrcweir 			XFormTextStyle eFormTextStyle,
263cdf0e10cSrcweir 			sal_Int32 aTextLeftDistance,
264cdf0e10cSrcweir 			sal_Int32 aTextUpperDistance,
265cdf0e10cSrcweir 			sal_Int32 aTextRightDistance,
266cdf0e10cSrcweir 			sal_Int32 aTextLowerDistance,
267cdf0e10cSrcweir             SdrTextHorzAdjust aSdrTextHorzAdjust,
268cdf0e10cSrcweir             SdrTextVertAdjust aSdrTextVertAdjust,
269cdf0e10cSrcweir 			bool bContour,
270cdf0e10cSrcweir             bool bFitToSize,
271cdf0e10cSrcweir 			bool bHideContour,
272cdf0e10cSrcweir             bool bBlink,
273cdf0e10cSrcweir 			bool bScroll,
274cdf0e10cSrcweir             bool bInEditMode,
275cdf0e10cSrcweir             bool bFixedCellHeight,
276cdf0e10cSrcweir 			bool bWrongSpell)
277cdf0e10cSrcweir 		:	mpSdrTextAttribute(new ImpSdrTextAttribute(
278cdf0e10cSrcweir 				&rSdrText, rOutlinerParaObject, eFormTextStyle, aTextLeftDistance, aTextUpperDistance,
279cdf0e10cSrcweir 				aTextRightDistance, aTextLowerDistance, aSdrTextHorzAdjust, aSdrTextVertAdjust, bContour,
280cdf0e10cSrcweir 				bFitToSize, bHideContour, bBlink, bScroll, bInEditMode, bFixedCellHeight, bWrongSpell))
281cdf0e10cSrcweir 		{
282cdf0e10cSrcweir 		}
283cdf0e10cSrcweir 
SdrTextAttribute()284cdf0e10cSrcweir 		SdrTextAttribute::SdrTextAttribute()
285cdf0e10cSrcweir         :	mpSdrTextAttribute(ImpSdrTextAttribute::get_global_default())
286cdf0e10cSrcweir 		{
287cdf0e10cSrcweir 			mpSdrTextAttribute->mnRefCount++;
288cdf0e10cSrcweir 		}
289cdf0e10cSrcweir 
SdrTextAttribute(const SdrTextAttribute & rCandidate)290cdf0e10cSrcweir         SdrTextAttribute::SdrTextAttribute(const SdrTextAttribute& rCandidate)
291cdf0e10cSrcweir 		:	mpSdrTextAttribute(rCandidate.mpSdrTextAttribute)
292cdf0e10cSrcweir 		{
293cdf0e10cSrcweir 			mpSdrTextAttribute->mnRefCount++;
294cdf0e10cSrcweir 		}
295cdf0e10cSrcweir 
~SdrTextAttribute()296cdf0e10cSrcweir 		SdrTextAttribute::~SdrTextAttribute()
297cdf0e10cSrcweir 		{
298cdf0e10cSrcweir 			if(mpSdrTextAttribute->mnRefCount)
299cdf0e10cSrcweir 			{
300cdf0e10cSrcweir 				mpSdrTextAttribute->mnRefCount--;
301cdf0e10cSrcweir 			}
302cdf0e10cSrcweir 			else
303cdf0e10cSrcweir 			{
304cdf0e10cSrcweir 				delete mpSdrTextAttribute;
305cdf0e10cSrcweir 			}
306cdf0e10cSrcweir 		}
307cdf0e10cSrcweir 
isDefault() const308cdf0e10cSrcweir         bool SdrTextAttribute::isDefault() const
309cdf0e10cSrcweir         {
310cdf0e10cSrcweir             return mpSdrTextAttribute == ImpSdrTextAttribute::get_global_default();
311cdf0e10cSrcweir         }
312cdf0e10cSrcweir 
operator =(const SdrTextAttribute & rCandidate)313cdf0e10cSrcweir         SdrTextAttribute& SdrTextAttribute::operator=(const SdrTextAttribute& rCandidate)
314cdf0e10cSrcweir 		{
315cdf0e10cSrcweir 			if(rCandidate.mpSdrTextAttribute != mpSdrTextAttribute)
316cdf0e10cSrcweir 			{
317cdf0e10cSrcweir 				if(mpSdrTextAttribute->mnRefCount)
318cdf0e10cSrcweir 				{
319cdf0e10cSrcweir 					mpSdrTextAttribute->mnRefCount--;
320cdf0e10cSrcweir 				}
321cdf0e10cSrcweir 				else
322cdf0e10cSrcweir 				{
323cdf0e10cSrcweir 					delete mpSdrTextAttribute;
324cdf0e10cSrcweir 				}
325cdf0e10cSrcweir 
326cdf0e10cSrcweir 				mpSdrTextAttribute = rCandidate.mpSdrTextAttribute;
327cdf0e10cSrcweir 				mpSdrTextAttribute->mnRefCount++;
328cdf0e10cSrcweir 			}
329cdf0e10cSrcweir 
330cdf0e10cSrcweir 			return *this;
331cdf0e10cSrcweir 		}
332cdf0e10cSrcweir 
operator ==(const SdrTextAttribute & rCandidate) const333cdf0e10cSrcweir 		bool SdrTextAttribute::operator==(const SdrTextAttribute& rCandidate) const
334cdf0e10cSrcweir 		{
335cdf0e10cSrcweir 			if(rCandidate.mpSdrTextAttribute == mpSdrTextAttribute)
336cdf0e10cSrcweir 			{
337cdf0e10cSrcweir 				return true;
338cdf0e10cSrcweir 			}
339cdf0e10cSrcweir 
340cdf0e10cSrcweir 			if(rCandidate.isDefault() != isDefault())
341cdf0e10cSrcweir 			{
342cdf0e10cSrcweir 				return false;
343cdf0e10cSrcweir 			}
344cdf0e10cSrcweir 
345cdf0e10cSrcweir 			return (*rCandidate.mpSdrTextAttribute == *mpSdrTextAttribute);
346cdf0e10cSrcweir 		}
347cdf0e10cSrcweir 
getSdrText() const348cdf0e10cSrcweir 		const SdrText& SdrTextAttribute::getSdrText() const
349cdf0e10cSrcweir 		{
350cdf0e10cSrcweir 			return mpSdrTextAttribute->getSdrText();
351cdf0e10cSrcweir 		}
352cdf0e10cSrcweir 
getOutlinerParaObject() const353cdf0e10cSrcweir 		const OutlinerParaObject& SdrTextAttribute::getOutlinerParaObject() const
354cdf0e10cSrcweir 		{
355cdf0e10cSrcweir 			return mpSdrTextAttribute->getOutlinerParaObject();
356cdf0e10cSrcweir 		}
357cdf0e10cSrcweir 
isContour() const358cdf0e10cSrcweir 		bool SdrTextAttribute::isContour() const
359cdf0e10cSrcweir 		{
360cdf0e10cSrcweir 			return mpSdrTextAttribute->isContour();
361cdf0e10cSrcweir 		}
362cdf0e10cSrcweir 
isFitToSize() const363cdf0e10cSrcweir 		bool SdrTextAttribute::isFitToSize() const
364cdf0e10cSrcweir 		{
365cdf0e10cSrcweir 			return mpSdrTextAttribute->isFitToSize();
366cdf0e10cSrcweir 		}
367cdf0e10cSrcweir 
isHideContour() const368cdf0e10cSrcweir 		bool SdrTextAttribute::isHideContour() const
369cdf0e10cSrcweir 		{
370cdf0e10cSrcweir 			return mpSdrTextAttribute->isHideContour();
371cdf0e10cSrcweir 		}
372cdf0e10cSrcweir 
isBlink() const373cdf0e10cSrcweir 		bool SdrTextAttribute::isBlink() const
374cdf0e10cSrcweir 		{
375cdf0e10cSrcweir 			return mpSdrTextAttribute->isBlink();
376cdf0e10cSrcweir 		}
377cdf0e10cSrcweir 
isScroll() const378cdf0e10cSrcweir 		bool SdrTextAttribute::isScroll() const
379cdf0e10cSrcweir 		{
380cdf0e10cSrcweir 			return mpSdrTextAttribute->isScroll();
381cdf0e10cSrcweir 		}
382cdf0e10cSrcweir 
isInEditMode() const383cdf0e10cSrcweir 		bool SdrTextAttribute::isInEditMode() const
384cdf0e10cSrcweir 		{
385cdf0e10cSrcweir 			return mpSdrTextAttribute->isInEditMode();
386cdf0e10cSrcweir 		}
387cdf0e10cSrcweir 
isFixedCellHeight() const388cdf0e10cSrcweir 		bool SdrTextAttribute::isFixedCellHeight() const
389cdf0e10cSrcweir 		{
390cdf0e10cSrcweir 			return mpSdrTextAttribute->isFixedCellHeight();
391cdf0e10cSrcweir 		}
392cdf0e10cSrcweir 
isWrongSpell() const393cdf0e10cSrcweir 		bool SdrTextAttribute::isWrongSpell() const
394cdf0e10cSrcweir 		{
395cdf0e10cSrcweir 			return mpSdrTextAttribute->isWrongSpell();
396cdf0e10cSrcweir 		}
397cdf0e10cSrcweir 
getSdrFormTextAttribute() const398cdf0e10cSrcweir 		const SdrFormTextAttribute& SdrTextAttribute::getSdrFormTextAttribute() const
399cdf0e10cSrcweir 		{
400cdf0e10cSrcweir 			return mpSdrTextAttribute->getSdrFormTextAttribute();
401cdf0e10cSrcweir 		}
402cdf0e10cSrcweir 
getTextLeftDistance() const403cdf0e10cSrcweir 		sal_Int32 SdrTextAttribute::getTextLeftDistance() const
404cdf0e10cSrcweir 		{
405cdf0e10cSrcweir 			return mpSdrTextAttribute->getTextLeftDistance();
406cdf0e10cSrcweir 		}
407cdf0e10cSrcweir 
getTextUpperDistance() const408cdf0e10cSrcweir 		sal_Int32 SdrTextAttribute::getTextUpperDistance() const
409cdf0e10cSrcweir 		{
410cdf0e10cSrcweir 			return mpSdrTextAttribute->getTextUpperDistance();
411cdf0e10cSrcweir 		}
412cdf0e10cSrcweir 
getTextRightDistance() const413cdf0e10cSrcweir 		sal_Int32 SdrTextAttribute::getTextRightDistance() const
414cdf0e10cSrcweir 		{
415cdf0e10cSrcweir 			return mpSdrTextAttribute->getTextRightDistance();
416cdf0e10cSrcweir 		}
417cdf0e10cSrcweir 
getTextLowerDistance() const418cdf0e10cSrcweir 		sal_Int32 SdrTextAttribute::getTextLowerDistance() const
419cdf0e10cSrcweir 		{
420cdf0e10cSrcweir 			return mpSdrTextAttribute->getTextLowerDistance();
421cdf0e10cSrcweir 		}
422cdf0e10cSrcweir 
getPropertiesVersion() const423cdf0e10cSrcweir 		sal_uInt32 SdrTextAttribute::getPropertiesVersion() const
424cdf0e10cSrcweir 		{
425cdf0e10cSrcweir 			return mpSdrTextAttribute->getPropertiesVersion();
426cdf0e10cSrcweir 		}
427cdf0e10cSrcweir 
getSdrTextHorzAdjust() const428cdf0e10cSrcweir 		SdrTextHorzAdjust SdrTextAttribute::getSdrTextHorzAdjust() const
429cdf0e10cSrcweir 		{
430cdf0e10cSrcweir 			return mpSdrTextAttribute->getSdrTextHorzAdjust();
431cdf0e10cSrcweir 		}
432cdf0e10cSrcweir 
getSdrTextVertAdjust() const433cdf0e10cSrcweir 		SdrTextVertAdjust SdrTextAttribute::getSdrTextVertAdjust() const
434cdf0e10cSrcweir 		{
435cdf0e10cSrcweir 			return mpSdrTextAttribute->getSdrTextVertAdjust();
436cdf0e10cSrcweir 		}
437cdf0e10cSrcweir 
getBlinkTextTiming(drawinglayer::animation::AnimationEntryList & rAnimList) const438cdf0e10cSrcweir 		void SdrTextAttribute::getBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const
439cdf0e10cSrcweir 		{
440cdf0e10cSrcweir 			if(isBlink())
441cdf0e10cSrcweir 			{
442cdf0e10cSrcweir 				getSdrText().GetObject().impGetBlinkTextTiming(rAnimList);
443cdf0e10cSrcweir 			}
444cdf0e10cSrcweir 		}
445cdf0e10cSrcweir 
getScrollTextTiming(drawinglayer::animation::AnimationEntryList & rAnimList,double fFrameLength,double fTextLength) const446cdf0e10cSrcweir 		void SdrTextAttribute::getScrollTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList, double fFrameLength, double fTextLength) const
447cdf0e10cSrcweir 		{
448cdf0e10cSrcweir 			if(isScroll())
449cdf0e10cSrcweir 			{
450cdf0e10cSrcweir 				getSdrText().GetObject().impGetScrollTextTiming(rAnimList, fFrameLength, fTextLength);
451cdf0e10cSrcweir 			}
452cdf0e10cSrcweir 		}
453cdf0e10cSrcweir 	} // end of namespace attribute
454cdf0e10cSrcweir } // end of namespace drawinglayer
455cdf0e10cSrcweir 
456cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
457cdf0e10cSrcweir // eof
458