xref: /aoo42x/main/svx/source/xoutdev/xattr.cxx (revision c7be74b1)
1f6e50924SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3f6e50924SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4f6e50924SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5f6e50924SAndrew Rist  * distributed with this work for additional information
6f6e50924SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7f6e50924SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8f6e50924SAndrew Rist  * "License"); you may not use this file except in compliance
9f6e50924SAndrew Rist  * with the License.  You may obtain a copy of the License at
10f6e50924SAndrew Rist  *
11f6e50924SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12f6e50924SAndrew Rist  *
13f6e50924SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14f6e50924SAndrew Rist  * software distributed under the License is distributed on an
15f6e50924SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16f6e50924SAndrew Rist  * KIND, either express or implied.  See the License for the
17f6e50924SAndrew Rist  * specific language governing permissions and limitations
18f6e50924SAndrew Rist  * under the License.
19f6e50924SAndrew Rist  *
20f6e50924SAndrew Rist  *************************************************************/
21f6e50924SAndrew Rist 
22f6e50924SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_svx.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir // include ---------------------------------------------------------------
28cdf0e10cSrcweir #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
29cdf0e10cSrcweir #include <com/sun/star/drawing/Hatch.hpp>
30cdf0e10cSrcweir #include <com/sun/star/drawing/LineStyle.hpp>
31cdf0e10cSrcweir #include <com/sun/star/drawing/LineDash.hpp>
32cdf0e10cSrcweir #include <com/sun/star/drawing/DashStyle.hpp>
33cdf0e10cSrcweir #include <com/sun/star/awt/Point.hpp>
34cdf0e10cSrcweir #include <com/sun/star/drawing/PointSequence.hpp>
35cdf0e10cSrcweir #include <com/sun/star/drawing/FillStyle.hpp>
36cdf0e10cSrcweir #include <com/sun/star/awt/Gradient.hpp>
37cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx>
38cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp>
39cdf0e10cSrcweir #include <svl/itempool.hxx>
40cdf0e10cSrcweir #include <editeng/memberids.hrc>
41cdf0e10cSrcweir #include <tools/stream.hxx>
42cdf0e10cSrcweir 
43cdf0e10cSrcweir #include "svx/unoapi.hxx"
44cdf0e10cSrcweir #include <svl/style.hxx>
45cdf0e10cSrcweir #include "unopolyhelper.hxx"
46cdf0e10cSrcweir 
47cdf0e10cSrcweir #include <tools/bigint.hxx>
48cdf0e10cSrcweir #include <svl/itemset.hxx>
49cdf0e10cSrcweir #include <svx/dialogs.hrc>
50cdf0e10cSrcweir #include "svx/svdstr.hrc"
51cdf0e10cSrcweir #include "svx/xattr.hxx"
52cdf0e10cSrcweir #include <svx/xtable.hxx>
53cdf0e10cSrcweir #include <svx/dialmgr.hxx>
54cdf0e10cSrcweir #include <editeng/itemtype.hxx>
55cdf0e10cSrcweir #include <svx/xdef.hxx>
56cdf0e10cSrcweir #include <svx/unomid.hxx>
57cdf0e10cSrcweir #include <svx/svdmodel.hxx>
58cdf0e10cSrcweir #include <basegfx/polygon/b2dpolygon.hxx>
59cdf0e10cSrcweir #include <basegfx/point/b2dpoint.hxx>
60cdf0e10cSrcweir #include <basegfx/vector/b2dvector.hxx>
61cdf0e10cSrcweir 
62cdf0e10cSrcweir #include <stdio.h>
63cdf0e10cSrcweir 
64cdf0e10cSrcweir using namespace ::rtl;
65cdf0e10cSrcweir using namespace ::com::sun::star;
66cdf0e10cSrcweir 
67cdf0e10cSrcweir #define GLOBALOVERFLOW
68cdf0e10cSrcweir 
69cdf0e10cSrcweir #define TWIP_TO_MM100(TWIP)     ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
70cdf0e10cSrcweir #define MM100_TO_TWIP(MM100)    ((MM100) >= 0 ? (((MM100)*72L+63L)/127L) : (((MM100)*72L-63L)/127L))
71cdf0e10cSrcweir 
72cdf0e10cSrcweir /************************************************************************/
73cdf0e10cSrcweir 
74cdf0e10cSrcweir #define VCLTOSVCOL( rCol ) (sal_uInt16)((((sal_uInt16)(rCol))<<8)|(rCol))
75cdf0e10cSrcweir 
76cdf0e10cSrcweir /************************************************************************/
77cdf0e10cSrcweir 
78cdf0e10cSrcweir XubString aNameOrIndexEmptyString;
79cdf0e10cSrcweir 
80cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(NameOrIndex, SfxStringItem);
81cdf0e10cSrcweir 
82cdf0e10cSrcweir /*************************************************************************
83cdf0e10cSrcweir |*
84cdf0e10cSrcweir |*
85cdf0e10cSrcweir |*
86cdf0e10cSrcweir \*************************************************************************/
87cdf0e10cSrcweir 
88cdf0e10cSrcweir long ScaleMetricValue( long nVal, long nMul, long nDiv )
89cdf0e10cSrcweir {
90cdf0e10cSrcweir 	BigInt aVal( nVal );
91cdf0e10cSrcweir 
92cdf0e10cSrcweir 	aVal *= nMul;
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 	if ( aVal.IsNeg() != ( nDiv < 0 ) )
95cdf0e10cSrcweir 		aVal-=nDiv/2; // fuer korrektes Runden
96cdf0e10cSrcweir 	else
97cdf0e10cSrcweir 		aVal+=nDiv/2; // fuer korrektes Runden
98cdf0e10cSrcweir 
99cdf0e10cSrcweir 	aVal/=nDiv;
100cdf0e10cSrcweir 
101cdf0e10cSrcweir 	return long( aVal );
102cdf0e10cSrcweir }
103cdf0e10cSrcweir 
104cdf0e10cSrcweir /*************************************************************************
105cdf0e10cSrcweir |*
106cdf0e10cSrcweir |*	  NameOrIndex::NameOrIndex(sal_uInt16 nWhich, sal_Int32 nIndex)
107cdf0e10cSrcweir |*
108cdf0e10cSrcweir |*	  Beschreibung
109cdf0e10cSrcweir |*	  Ersterstellung	14.11.94
110cdf0e10cSrcweir |*	  Letzte Aenderung	14.11.94
111cdf0e10cSrcweir |*
112cdf0e10cSrcweir *************************************************************************/
113cdf0e10cSrcweir 
114cdf0e10cSrcweir NameOrIndex::NameOrIndex(sal_uInt16 _nWhich, sal_Int32 nIndex) :
115cdf0e10cSrcweir 	SfxStringItem(_nWhich, aNameOrIndexEmptyString),
116cdf0e10cSrcweir 	nPalIndex(nIndex)
117cdf0e10cSrcweir {
118cdf0e10cSrcweir }
119cdf0e10cSrcweir 
120cdf0e10cSrcweir /*************************************************************************
121cdf0e10cSrcweir |*
122cdf0e10cSrcweir |*	  NameOrIndex::NameOrIndex(sal_uInt16 nWhich, const String& rName)
123cdf0e10cSrcweir |*
124cdf0e10cSrcweir |*	  Beschreibung
125cdf0e10cSrcweir |*	  Ersterstellung	14.11.94
126cdf0e10cSrcweir |*	  Letzte Aenderung	14.11.94
127cdf0e10cSrcweir |*
128cdf0e10cSrcweir *************************************************************************/
129cdf0e10cSrcweir 
130cdf0e10cSrcweir NameOrIndex::NameOrIndex(sal_uInt16 _nWhich, const XubString& rName) :
131cdf0e10cSrcweir 	SfxStringItem(_nWhich, rName),
132cdf0e10cSrcweir 	nPalIndex(-1)
133cdf0e10cSrcweir {
134cdf0e10cSrcweir }
135cdf0e10cSrcweir 
136cdf0e10cSrcweir /*************************************************************************
137cdf0e10cSrcweir |*
138cdf0e10cSrcweir |*	  NameOrIndex::NameOrIndex(sal_uInt16 nWhich, SvStream& rIn)
139cdf0e10cSrcweir |*
140cdf0e10cSrcweir |*	  Beschreibung
141cdf0e10cSrcweir |*	  Ersterstellung	14.11.94
142cdf0e10cSrcweir |*	  Letzte Aenderung	14.11.94
143cdf0e10cSrcweir |*
144cdf0e10cSrcweir *************************************************************************/
145cdf0e10cSrcweir 
146cdf0e10cSrcweir NameOrIndex::NameOrIndex(sal_uInt16 _nWhich, SvStream& rIn) :
147cdf0e10cSrcweir 	SfxStringItem(_nWhich, rIn)
148cdf0e10cSrcweir {
149cdf0e10cSrcweir 	rIn >> nPalIndex;
150cdf0e10cSrcweir }
151cdf0e10cSrcweir 
152cdf0e10cSrcweir /*************************************************************************
153cdf0e10cSrcweir |*
154cdf0e10cSrcweir |*	  NameOrIndex::NameOrIndex(const NameOrIndex& rNameOrIndex)
155cdf0e10cSrcweir |*
156cdf0e10cSrcweir |*	  Beschreibung
157cdf0e10cSrcweir |*	  Ersterstellung	14.11.94
158cdf0e10cSrcweir |*	  Letzte Aenderung	14.11.94
159cdf0e10cSrcweir |*
160cdf0e10cSrcweir *************************************************************************/
161cdf0e10cSrcweir 
162cdf0e10cSrcweir NameOrIndex::NameOrIndex(const NameOrIndex& rNameOrIndex) :
163cdf0e10cSrcweir 	SfxStringItem(rNameOrIndex),
164cdf0e10cSrcweir 	nPalIndex(rNameOrIndex.nPalIndex)
165cdf0e10cSrcweir {
166cdf0e10cSrcweir }
167cdf0e10cSrcweir 
168cdf0e10cSrcweir /*************************************************************************
169cdf0e10cSrcweir |*
170cdf0e10cSrcweir |*	  int NameOrIndex::operator==(const SfxPoolItem& rItem) const
171cdf0e10cSrcweir |*
172cdf0e10cSrcweir |*	  Beschreibung
173cdf0e10cSrcweir |*	  Ersterstellung	14.11.94
174cdf0e10cSrcweir |*	  Letzte Aenderung	14.11.94
175cdf0e10cSrcweir |*
176cdf0e10cSrcweir *************************************************************************/
177cdf0e10cSrcweir 
178cdf0e10cSrcweir int NameOrIndex::operator==(const SfxPoolItem& rItem) const
179cdf0e10cSrcweir {
180cdf0e10cSrcweir 	return ( SfxStringItem::operator==(rItem) &&
181cdf0e10cSrcweir 			((const NameOrIndex&) rItem).nPalIndex == nPalIndex );
182cdf0e10cSrcweir }
183cdf0e10cSrcweir 
184cdf0e10cSrcweir /*************************************************************************
185cdf0e10cSrcweir |*
186cdf0e10cSrcweir |*	  SfxPoolItem* NameOrIndex::Clone(SfxItemPool* pPool) const
187cdf0e10cSrcweir |*
188cdf0e10cSrcweir |*	  Beschreibung
189cdf0e10cSrcweir |*	  Ersterstellung	14.11.94
190cdf0e10cSrcweir |*	  Letzte Aenderung	14.11.94
191cdf0e10cSrcweir |*
192cdf0e10cSrcweir *************************************************************************/
193cdf0e10cSrcweir 
194cdf0e10cSrcweir SfxPoolItem* NameOrIndex::Clone(SfxItemPool* /*pPool*/) const
195cdf0e10cSrcweir {
196cdf0e10cSrcweir 
197cdf0e10cSrcweir 	return new NameOrIndex(*this);
198cdf0e10cSrcweir }
199cdf0e10cSrcweir 
200cdf0e10cSrcweir /*************************************************************************
201cdf0e10cSrcweir |*
202cdf0e10cSrcweir |*	  SfxPoolItem* NameOrIndex::Create(SvStream& rIn, sal_uInt16 nVer) const
203cdf0e10cSrcweir |*
204cdf0e10cSrcweir |*	  Beschreibung
205cdf0e10cSrcweir |*	  Ersterstellung	14.11.94
206cdf0e10cSrcweir |*	  Letzte Aenderung	14.11.94
207cdf0e10cSrcweir |*
208cdf0e10cSrcweir *************************************************************************/
209cdf0e10cSrcweir 
210cdf0e10cSrcweir SfxPoolItem* NameOrIndex::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
211cdf0e10cSrcweir {
212cdf0e10cSrcweir 	return new NameOrIndex(Which(), rIn);
213cdf0e10cSrcweir }
214cdf0e10cSrcweir 
215cdf0e10cSrcweir /*************************************************************************
216cdf0e10cSrcweir |*
217cdf0e10cSrcweir |*	  SvStream* NameOrIndex::Store(SvStream& rIn) const
218cdf0e10cSrcweir |*
219cdf0e10cSrcweir |*	  Beschreibung
220cdf0e10cSrcweir |*	  Ersterstellung	14.11.94
221cdf0e10cSrcweir |*	  Letzte Aenderung	14.11.94
222cdf0e10cSrcweir |*
223cdf0e10cSrcweir *************************************************************************/
224cdf0e10cSrcweir 
225cdf0e10cSrcweir SvStream& NameOrIndex::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const
226cdf0e10cSrcweir {
227cdf0e10cSrcweir 	SfxStringItem::Store( rOut, nItemVersion );
228cdf0e10cSrcweir 	rOut << nPalIndex;
229cdf0e10cSrcweir 	return rOut;
230cdf0e10cSrcweir }
231cdf0e10cSrcweir 
232cdf0e10cSrcweir /** this static checks if the given NameOrIndex item has a unique name for its value.
233cdf0e10cSrcweir 	The returned String is a unique name for an item with this value in both given pools.
234cdf0e10cSrcweir 	Argument pPool2 can be null.
235cdf0e10cSrcweir 	If returned string equals NameOrIndex->GetName(), the name was already unique.
236cdf0e10cSrcweir */
237cdf0e10cSrcweir String NameOrIndex::CheckNamedItem( const NameOrIndex* pCheckItem, const sal_uInt16 nWhich, const SfxItemPool* pPool1, const SfxItemPool* /*pPool2*/, SvxCompareValueFunc pCompareValueFunc, sal_uInt16 nPrefixResId, XPropertyList* pDefaults )
238cdf0e10cSrcweir {
239cdf0e10cSrcweir 	sal_Bool bForceNew = sal_False;
240cdf0e10cSrcweir 
241cdf0e10cSrcweir 	String aUniqueName;
242cdf0e10cSrcweir 	SvxUnogetInternalNameForItem( nWhich, pCheckItem->GetName(), aUniqueName );
243cdf0e10cSrcweir 
244cdf0e10cSrcweir 	// 2. if we have a name check if there is already an item with the
245cdf0e10cSrcweir 	// same name in the documents pool with a different line end or start
246cdf0e10cSrcweir 
247cdf0e10cSrcweir 	if( aUniqueName.Len() && pPool1 )
248cdf0e10cSrcweir 	{
249cdf0e10cSrcweir 		const sal_uInt32 nCount = pPool1->GetItemCount2( nWhich );
250cdf0e10cSrcweir 
251cdf0e10cSrcweir 		const NameOrIndex *pItem;
252cdf0e10cSrcweir 		for( sal_uInt32 nSurrogate = 0; nSurrogate < nCount; nSurrogate++ )
253cdf0e10cSrcweir 		{
254cdf0e10cSrcweir 			pItem = (NameOrIndex*)pPool1->GetItem2( nWhich, nSurrogate );
255cdf0e10cSrcweir 
256cdf0e10cSrcweir 			if( pItem && ( pItem->GetName() == pCheckItem->GetName() ) )
257cdf0e10cSrcweir 			{
258cdf0e10cSrcweir 				// if there is already an item with the same name and the same
259cdf0e10cSrcweir 				// value its ok to set it
260cdf0e10cSrcweir 				if( !pCompareValueFunc( pItem, pCheckItem ) )
261cdf0e10cSrcweir 				{
262cdf0e10cSrcweir 					// same name but different value, we need a new name for this item
263cdf0e10cSrcweir 					aUniqueName = String();
264cdf0e10cSrcweir 					bForceNew = sal_True;
265cdf0e10cSrcweir 				}
266cdf0e10cSrcweir 				break;
267cdf0e10cSrcweir 			}
268cdf0e10cSrcweir 		}
269cdf0e10cSrcweir 	}
270cdf0e10cSrcweir 
271cdf0e10cSrcweir 	// if we have no name yet, find existing item with same conent or
272cdf0e10cSrcweir 	// create a unique name
273cdf0e10cSrcweir 	if( aUniqueName.Len() == 0 )
274cdf0e10cSrcweir 	{
275cdf0e10cSrcweir 		sal_Int32 nUserIndex = 1;
276cdf0e10cSrcweir 		const ResId aRes(SVX_RES(nPrefixResId));
277cdf0e10cSrcweir 		String aUser( aRes );
278cdf0e10cSrcweir 		aUser += sal_Unicode( ' ' );
279cdf0e10cSrcweir 
280cdf0e10cSrcweir 		if( pDefaults )
281cdf0e10cSrcweir 		{
282cdf0e10cSrcweir 			const int nCount = pDefaults->Count();
283cdf0e10cSrcweir 			int nIndex;
284cdf0e10cSrcweir 			for( nIndex = 0; nIndex < nCount; nIndex++ )
285cdf0e10cSrcweir 			{
286*c7be74b1SArmin Le Grand 				XPropertyEntry* pEntry = pDefaults->Get( nIndex );
287cdf0e10cSrcweir 				if( pEntry )
288cdf0e10cSrcweir 				{
289cdf0e10cSrcweir 					bool bFound = false;
290cdf0e10cSrcweir 
291cdf0e10cSrcweir 					switch( nWhich )
292cdf0e10cSrcweir 					{
293cdf0e10cSrcweir 					case XATTR_FILLBITMAP:
29470d3707aSArmin Le Grand                     {
29570d3707aSArmin Le Grand                         const GraphicObject& rGraphicObjectA(((XFillBitmapItem*)pCheckItem)->GetGraphicObject());
29670d3707aSArmin Le Grand                         const GraphicObject& rGraphicObjectB(((XBitmapEntry*)pEntry)->GetGraphicObject());
29770d3707aSArmin Le Grand 
29870d3707aSArmin Le Grand                         bFound = (rGraphicObjectA == rGraphicObjectB);
299cdf0e10cSrcweir 						break;
30070d3707aSArmin Le Grand                     }
301cdf0e10cSrcweir 					case XATTR_LINEDASH:
302cdf0e10cSrcweir 						bFound = (((XLineDashItem*)pCheckItem)->GetDashValue() == ((XDashEntry*)pEntry) ->GetDash());
303cdf0e10cSrcweir 						break;
304cdf0e10cSrcweir 					case XATTR_LINESTART:
305cdf0e10cSrcweir 						bFound = (((XLineStartItem*)pCheckItem)->GetLineStartValue() == ((XLineEndEntry*)pEntry)->GetLineEnd());
306cdf0e10cSrcweir 						break;
307cdf0e10cSrcweir 					case XATTR_LINEEND:
308cdf0e10cSrcweir 						bFound = (((XLineEndItem*)pCheckItem)->GetLineEndValue() == ((XLineEndEntry*)pEntry)->GetLineEnd());
309cdf0e10cSrcweir 						break;
310cdf0e10cSrcweir 					case XATTR_FILLGRADIENT:
311cdf0e10cSrcweir 						bFound = (((XFillGradientItem*)pCheckItem)->GetGradientValue() == ((XGradientEntry*)pEntry)->GetGradient());
312cdf0e10cSrcweir 						break;
313cdf0e10cSrcweir 					case XATTR_FILLHATCH:
314cdf0e10cSrcweir 						bFound = (((XFillHatchItem*)pCheckItem)->GetHatchValue() == ((XHatchEntry*)pEntry)->GetHatch());
315cdf0e10cSrcweir 						break;
316cdf0e10cSrcweir 					}
317cdf0e10cSrcweir 
318cdf0e10cSrcweir 					if( bFound )
319cdf0e10cSrcweir 					{
320cdf0e10cSrcweir 						aUniqueName = pEntry->GetName();
321cdf0e10cSrcweir 						break;
322cdf0e10cSrcweir 					}
323cdf0e10cSrcweir 					else
324cdf0e10cSrcweir 					{
325cdf0e10cSrcweir 						sal_Int32 nThisIndex = pEntry->GetName().Copy( aUser.Len() ).ToInt32();
326cdf0e10cSrcweir 						if( nThisIndex >= nUserIndex )
327cdf0e10cSrcweir 							nUserIndex = nThisIndex + 1;
328cdf0e10cSrcweir 					}
329cdf0e10cSrcweir 				}
330cdf0e10cSrcweir 			}
331cdf0e10cSrcweir 		}
332cdf0e10cSrcweir 
333cdf0e10cSrcweir 		if( (aUniqueName.Len() == 0) && pPool1 )
334cdf0e10cSrcweir 		{
335cdf0e10cSrcweir 			const sal_uInt32 nCount = pPool1->GetItemCount2( nWhich );
336cdf0e10cSrcweir 			const NameOrIndex *pItem;
337cdf0e10cSrcweir 			for( sal_uInt32 nSurrogate = 0; nSurrogate < nCount; nSurrogate++ )
338cdf0e10cSrcweir 			{
339cdf0e10cSrcweir 				pItem = (NameOrIndex*)pPool1->GetItem2( nWhich, nSurrogate );
340cdf0e10cSrcweir 
341cdf0e10cSrcweir 				if( pItem && pItem->GetName().Len() )
342cdf0e10cSrcweir 				{
343cdf0e10cSrcweir 					if( !bForceNew && pCompareValueFunc( pItem, pCheckItem ) )
344cdf0e10cSrcweir 						return pItem->GetName();
345cdf0e10cSrcweir 
346cdf0e10cSrcweir 					if( pItem->GetName().CompareTo( aUser, aUser.Len() ) == 0 )
347cdf0e10cSrcweir 					{
348cdf0e10cSrcweir 						sal_Int32 nThisIndex = pItem->GetName().Copy( aUser.Len() ).ToInt32();
349cdf0e10cSrcweir 						if( nThisIndex >= nUserIndex )
350cdf0e10cSrcweir 							nUserIndex = nThisIndex + 1;
351cdf0e10cSrcweir 					}
352cdf0e10cSrcweir 				}
353cdf0e10cSrcweir 			}
354cdf0e10cSrcweir             aUniqueName = aUser;
355cdf0e10cSrcweir             aUniqueName += String::CreateFromInt32( nUserIndex );
356cdf0e10cSrcweir 		}
357cdf0e10cSrcweir 	}
358cdf0e10cSrcweir 
359cdf0e10cSrcweir 	return aUniqueName;
360cdf0e10cSrcweir }
361cdf0e10cSrcweir 
362cdf0e10cSrcweir //*************************************************************************
363cdf0e10cSrcweir 
364cdf0e10cSrcweir // -------------------
365cdf0e10cSrcweir // class XColorItem
366cdf0e10cSrcweir // -------------------
367cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XColorItem, NameOrIndex);
368cdf0e10cSrcweir 
369cdf0e10cSrcweir /*************************************************************************
370cdf0e10cSrcweir |*
371cdf0e10cSrcweir |*	  XColorItem::XColorItem(sal_uInt16 nWhich, sal_Int32 nIndex, const Color& rTheColor)
372cdf0e10cSrcweir |*
373cdf0e10cSrcweir \************************************************************************/
374cdf0e10cSrcweir 
375cdf0e10cSrcweir XColorItem::XColorItem(sal_uInt16 _nWhich, sal_Int32 nIndex, const Color& rTheColor) :
376cdf0e10cSrcweir 	NameOrIndex(_nWhich, nIndex),
377cdf0e10cSrcweir 	aColor(rTheColor)
378cdf0e10cSrcweir {
379cdf0e10cSrcweir }
380cdf0e10cSrcweir 
381cdf0e10cSrcweir /*************************************************************************
382cdf0e10cSrcweir |*
383cdf0e10cSrcweir |*	  XColorItem::XColorItem(sal_uInt16 nWhich, const String& rName, const Color& rTheColor)
384cdf0e10cSrcweir |*
385cdf0e10cSrcweir \************************************************************************/
386cdf0e10cSrcweir 
387cdf0e10cSrcweir XColorItem::XColorItem(sal_uInt16 _nWhich, const XubString& rName, const Color& rTheColor) :
388cdf0e10cSrcweir 	NameOrIndex(_nWhich, rName),
389cdf0e10cSrcweir 	aColor(rTheColor)
390cdf0e10cSrcweir {
391cdf0e10cSrcweir }
392cdf0e10cSrcweir 
393cdf0e10cSrcweir /*************************************************************************
394cdf0e10cSrcweir |*
395cdf0e10cSrcweir |*	  XColorItem::XColorItem(const XColorItem& rItem)
396cdf0e10cSrcweir |*
397cdf0e10cSrcweir \************************************************************************/
398cdf0e10cSrcweir 
399cdf0e10cSrcweir XColorItem::XColorItem(const XColorItem& rItem) :
400cdf0e10cSrcweir 	NameOrIndex(rItem),
401cdf0e10cSrcweir 	aColor(rItem.aColor)
402cdf0e10cSrcweir {
403cdf0e10cSrcweir }
404cdf0e10cSrcweir 
405cdf0e10cSrcweir /*************************************************************************
406cdf0e10cSrcweir |*
407cdf0e10cSrcweir |*	  XColorItem::XColorItem(sal_uInt16 nWhich, SvStream& rIn)
408cdf0e10cSrcweir |*
409cdf0e10cSrcweir \************************************************************************/
410cdf0e10cSrcweir 
411cdf0e10cSrcweir XColorItem::XColorItem(sal_uInt16 _nWhich, SvStream& rIn) :
412cdf0e10cSrcweir 	NameOrIndex(_nWhich, rIn)
413cdf0e10cSrcweir {
414cdf0e10cSrcweir 	if (!IsIndex())
415cdf0e10cSrcweir 	{
416cdf0e10cSrcweir 		rIn >> aColor;
417cdf0e10cSrcweir 	}
418cdf0e10cSrcweir }
419cdf0e10cSrcweir 
420cdf0e10cSrcweir /*************************************************************************
421cdf0e10cSrcweir |*
422cdf0e10cSrcweir |*	  XColorItem::Clone(SfxItemPool* pPool) const
423cdf0e10cSrcweir |*
424cdf0e10cSrcweir \************************************************************************/
425cdf0e10cSrcweir 
426cdf0e10cSrcweir SfxPoolItem* XColorItem::Clone(SfxItemPool* /*pPool*/) const
427cdf0e10cSrcweir {
428cdf0e10cSrcweir 	return new XColorItem(*this);
429cdf0e10cSrcweir }
430cdf0e10cSrcweir 
431cdf0e10cSrcweir /*************************************************************************
432cdf0e10cSrcweir |*
433cdf0e10cSrcweir |*	  int XColorItem::operator==(const SfxPoolItem& rItem) const
434cdf0e10cSrcweir |*
435cdf0e10cSrcweir \************************************************************************/
436cdf0e10cSrcweir 
437cdf0e10cSrcweir int XColorItem::operator==(const SfxPoolItem& rItem) const
438cdf0e10cSrcweir {
439cdf0e10cSrcweir 	return ( NameOrIndex::operator==(rItem) &&
440cdf0e10cSrcweir 			((const XColorItem&) rItem).aColor == aColor );
441cdf0e10cSrcweir }
442cdf0e10cSrcweir 
443cdf0e10cSrcweir /*************************************************************************
444cdf0e10cSrcweir |*
445cdf0e10cSrcweir |*	  SfxPoolItem* XColorItem::Create(SvStream& rIn, sal_uInt16 nVer) const
446cdf0e10cSrcweir |*
447cdf0e10cSrcweir \************************************************************************/
448cdf0e10cSrcweir 
449cdf0e10cSrcweir SfxPoolItem* XColorItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
450cdf0e10cSrcweir {
451cdf0e10cSrcweir 	return new XColorItem(Which(), rIn);
452cdf0e10cSrcweir }
453cdf0e10cSrcweir 
454cdf0e10cSrcweir /*************************************************************************
455cdf0e10cSrcweir |*
456cdf0e10cSrcweir |*	  SfxPoolItem* XColorItem::Store(SvStream& rOut) const
457cdf0e10cSrcweir |*
458cdf0e10cSrcweir \************************************************************************/
459cdf0e10cSrcweir 
460cdf0e10cSrcweir SvStream& XColorItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const
461cdf0e10cSrcweir {
462cdf0e10cSrcweir 	NameOrIndex::Store( rOut, nItemVersion );
463cdf0e10cSrcweir 
464cdf0e10cSrcweir 	if ( !IsIndex() )
465cdf0e10cSrcweir 	{
466cdf0e10cSrcweir 		rOut << aColor;
467cdf0e10cSrcweir 	}
468cdf0e10cSrcweir 
469cdf0e10cSrcweir 	return rOut;
470cdf0e10cSrcweir }
471cdf0e10cSrcweir 
472cdf0e10cSrcweir /*************************************************************************
473cdf0e10cSrcweir |*
47497e8a929SArmin Le Grand |*	  const XColor& XColorItem::GetColorValue(const XColorList* pTable) const
475cdf0e10cSrcweir |*
476cdf0e10cSrcweir \************************************************************************/
477cdf0e10cSrcweir 
478*c7be74b1SArmin Le Grand const Color& XColorItem::GetColorValue() const
479cdf0e10cSrcweir {
480*c7be74b1SArmin Le Grand     if(!IsIndex())
481*c7be74b1SArmin Le Grand     {
482*c7be74b1SArmin Le Grand         return aColor;
483*c7be74b1SArmin Le Grand     }
484*c7be74b1SArmin Le Grand 
485*c7be74b1SArmin Le Grand     OSL_ENSURE(false, "Acces to Indexed XColorItem needs to use the call which hands over a XColorListSharedPtr (!)");
486*c7be74b1SArmin Le Grand 
487*c7be74b1SArmin Le Grand     return aColor;
488*c7be74b1SArmin Le Grand }
489*c7be74b1SArmin Le Grand 
490*c7be74b1SArmin Le Grand const Color& XColorItem::GetColorValue(const XColorListSharedPtr aTable) const
491*c7be74b1SArmin Le Grand {
492*c7be74b1SArmin Le Grand     if(!IsIndex())
493*c7be74b1SArmin Le Grand     {
494*c7be74b1SArmin Le Grand         return aColor;
495*c7be74b1SArmin Le Grand     }
496cdf0e10cSrcweir 
497*c7be74b1SArmin Le Grand     return aTable->GetColor(GetIndex())->GetColor();
498cdf0e10cSrcweir }
499cdf0e10cSrcweir 
500cdf0e10cSrcweir sal_Bool XColorItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
501cdf0e10cSrcweir {
502cdf0e10cSrcweir     rVal <<= (sal_Int32)GetColorValue().GetRGBColor();
503cdf0e10cSrcweir 	return sal_True;
504cdf0e10cSrcweir }
505cdf0e10cSrcweir 
506cdf0e10cSrcweir sal_Bool XColorItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/)
507cdf0e10cSrcweir {
508cdf0e10cSrcweir 	sal_Int32 nValue = 0;
509cdf0e10cSrcweir 	rVal >>= nValue;
510cdf0e10cSrcweir 	SetColorValue( nValue );
511cdf0e10cSrcweir 
512cdf0e10cSrcweir 	return sal_True;
513cdf0e10cSrcweir }
514cdf0e10cSrcweir 
515cdf0e10cSrcweir 
516cdf0e10cSrcweir //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
517cdf0e10cSrcweir //							 Linienattribute
518cdf0e10cSrcweir //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
519cdf0e10cSrcweir 
520cdf0e10cSrcweir //---------------------
521cdf0e10cSrcweir // class XLineStyleItem
522cdf0e10cSrcweir //---------------------
523cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XLineStyleItem, SfxEnumItem);
524cdf0e10cSrcweir 
525cdf0e10cSrcweir /*************************************************************************
526cdf0e10cSrcweir |*
527cdf0e10cSrcweir |*	  XLineStyleItem::XLineStyleItem(XLineStyle eTheLineStyle)
528cdf0e10cSrcweir |*
529cdf0e10cSrcweir |*	  Beschreibung
530cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
531cdf0e10cSrcweir |*	  Letzte Aenderung	18.11.94
532cdf0e10cSrcweir |*
533cdf0e10cSrcweir *************************************************************************/
534cdf0e10cSrcweir 
535cdf0e10cSrcweir XLineStyleItem::XLineStyleItem(XLineStyle eTheLineStyle) :
536cdf0e10cSrcweir 	SfxEnumItem(XATTR_LINESTYLE, sal::static_int_cast< sal_uInt16 >(eTheLineStyle))
537cdf0e10cSrcweir {
538cdf0e10cSrcweir }
539cdf0e10cSrcweir 
540cdf0e10cSrcweir /*************************************************************************
541cdf0e10cSrcweir |*
542cdf0e10cSrcweir |*	  XLineStyleItem::XLineStyleItem(SvStream& rIn)
543cdf0e10cSrcweir |*
544cdf0e10cSrcweir |*	  Beschreibung
545cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
546cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
547cdf0e10cSrcweir |*
548cdf0e10cSrcweir *************************************************************************/
549cdf0e10cSrcweir 
550cdf0e10cSrcweir XLineStyleItem::XLineStyleItem(SvStream& rIn) :
551cdf0e10cSrcweir 	SfxEnumItem(XATTR_LINESTYLE, rIn)
552cdf0e10cSrcweir {
553cdf0e10cSrcweir }
554cdf0e10cSrcweir 
555cdf0e10cSrcweir /*************************************************************************
556cdf0e10cSrcweir |*
557cdf0e10cSrcweir |*	  XLineStyleItem::Clone(SfxItemPool* pPool) const
558cdf0e10cSrcweir |*
559cdf0e10cSrcweir |*	  Beschreibung
560cdf0e10cSrcweir |*	  Ersterstellung	09.11.94
561cdf0e10cSrcweir |*	  Letzte Aenderung	09.11.94
562cdf0e10cSrcweir |*
563cdf0e10cSrcweir *************************************************************************/
564cdf0e10cSrcweir 
565cdf0e10cSrcweir SfxPoolItem* XLineStyleItem::Clone(SfxItemPool* /*pPool*/) const
566cdf0e10cSrcweir {
567cdf0e10cSrcweir 	return new XLineStyleItem( *this );
568cdf0e10cSrcweir }
569cdf0e10cSrcweir 
570cdf0e10cSrcweir /*************************************************************************
571cdf0e10cSrcweir |*
572cdf0e10cSrcweir |*	  SfxPoolItem* XLineStyleItem::Create(SvStream& rIn, sal_uInt16 nVer) const
573cdf0e10cSrcweir |*
574cdf0e10cSrcweir |*	  Beschreibung
575cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
576cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
577cdf0e10cSrcweir |*
578cdf0e10cSrcweir *************************************************************************/
579cdf0e10cSrcweir 
580cdf0e10cSrcweir SfxPoolItem* XLineStyleItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
581cdf0e10cSrcweir {
582cdf0e10cSrcweir 	return new XLineStyleItem(rIn);
583cdf0e10cSrcweir }
584cdf0e10cSrcweir 
585cdf0e10cSrcweir //------------------------------------------------------------------------
586cdf0e10cSrcweir 
587cdf0e10cSrcweir SfxItemPresentation XLineStyleItem::GetPresentation
588cdf0e10cSrcweir (
589cdf0e10cSrcweir 	SfxItemPresentation ePres,
590cdf0e10cSrcweir 	SfxMapUnit			/*eCoreUnit*/,
591cdf0e10cSrcweir 	SfxMapUnit			/*ePresUnit*/,
592cdf0e10cSrcweir     XubString&          rText, const IntlWrapper *
593cdf0e10cSrcweir )	const
594cdf0e10cSrcweir {
595cdf0e10cSrcweir 	rText.Erase();
596cdf0e10cSrcweir 
597cdf0e10cSrcweir 	switch ( ePres )
598cdf0e10cSrcweir 	{
599cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NONE:
600cdf0e10cSrcweir 			return ePres;
601cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_COMPLETE:
602cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NAMELESS:
603cdf0e10cSrcweir 		{
604cdf0e10cSrcweir 			sal_uInt16 nId = 0;
605cdf0e10cSrcweir 
606cdf0e10cSrcweir 			switch( (sal_uInt16)GetValue() )
607cdf0e10cSrcweir 			{
608cdf0e10cSrcweir 				case XLINE_NONE:
609cdf0e10cSrcweir 					nId = RID_SVXSTR_INVISIBLE;
610cdf0e10cSrcweir 					break;
611cdf0e10cSrcweir 				case XLINE_SOLID:
612cdf0e10cSrcweir 					nId = RID_SVXSTR_SOLID;
613cdf0e10cSrcweir 					break;
614cdf0e10cSrcweir 			}
615cdf0e10cSrcweir 
616cdf0e10cSrcweir 			if ( nId )
617cdf0e10cSrcweir 				rText = SVX_RESSTR( nId );
618cdf0e10cSrcweir 			return ePres;
619cdf0e10cSrcweir 		}
620cdf0e10cSrcweir 		default:
621cdf0e10cSrcweir 			return SFX_ITEM_PRESENTATION_NONE;
622cdf0e10cSrcweir 	}
623cdf0e10cSrcweir }
624cdf0e10cSrcweir 
625cdf0e10cSrcweir sal_Bool XLineStyleItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
626cdf0e10cSrcweir {
627cdf0e10cSrcweir 	::com::sun::star::drawing::LineStyle eLS = (::com::sun::star::drawing::LineStyle)GetValue();
628cdf0e10cSrcweir 	rVal <<= eLS;
629cdf0e10cSrcweir 	return sal_True;
630cdf0e10cSrcweir }
631cdf0e10cSrcweir 
632cdf0e10cSrcweir sal_Bool XLineStyleItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/)
633cdf0e10cSrcweir {
634cdf0e10cSrcweir 	::com::sun::star::drawing::LineStyle eLS;
635cdf0e10cSrcweir 	if(!(rVal >>= eLS ))
636cdf0e10cSrcweir     {
637cdf0e10cSrcweir         // also try an int (for Basic)
638cdf0e10cSrcweir         sal_Int32 nLS = 0;
639cdf0e10cSrcweir         if(!(rVal >>= nLS))
640cdf0e10cSrcweir             return sal_False;
641cdf0e10cSrcweir         eLS = (::com::sun::star::drawing::LineStyle)nLS;
642cdf0e10cSrcweir     }
643cdf0e10cSrcweir 
644cdf0e10cSrcweir 	SetValue( sal::static_int_cast< sal_uInt16 >( eLS ) );
645cdf0e10cSrcweir 	return sal_True;
646cdf0e10cSrcweir }
647cdf0e10cSrcweir 
648cdf0e10cSrcweir //------------------------------------------------------------------------
649cdf0e10cSrcweir 
650cdf0e10cSrcweir sal_uInt16 XLineStyleItem::GetValueCount() const
651cdf0e10cSrcweir {
652cdf0e10cSrcweir 	return 3;
653cdf0e10cSrcweir }
654cdf0e10cSrcweir 
655cdf0e10cSrcweir 
656cdf0e10cSrcweir // ------------
657cdf0e10cSrcweir // class XDash
658cdf0e10cSrcweir // ------------
659cdf0e10cSrcweir /*************************************************************************
660cdf0e10cSrcweir |*
661cdf0e10cSrcweir |*	  XDash::XDash(XDashStyle, sal_uInt16, sal_uIntPtr, sal_uInt16, sal_uIntPtr, sal_uIntPtr)
662cdf0e10cSrcweir |*
663cdf0e10cSrcweir |*	  Beschreibung
664cdf0e10cSrcweir |*	  Ersterstellung	21.11.94
665cdf0e10cSrcweir |*	  Letzte Aenderung	21.11.94
666cdf0e10cSrcweir |*
667cdf0e10cSrcweir *************************************************************************/
668cdf0e10cSrcweir 
669cdf0e10cSrcweir XDash::XDash(XDashStyle eTheDash, sal_uInt16 nTheDots, sal_uIntPtr nTheDotLen,
670cdf0e10cSrcweir 			 sal_uInt16 nTheDashes, sal_uIntPtr nTheDashLen, sal_uIntPtr nTheDistance) :
671cdf0e10cSrcweir 	eDash(eTheDash),
672cdf0e10cSrcweir 	nDots(nTheDots),
673cdf0e10cSrcweir 	nDotLen(nTheDotLen),
674cdf0e10cSrcweir 	nDashes(nTheDashes),
675cdf0e10cSrcweir 	nDashLen(nTheDashLen),
676cdf0e10cSrcweir 	nDistance(nTheDistance)
677cdf0e10cSrcweir {
678cdf0e10cSrcweir }
679cdf0e10cSrcweir 
680cdf0e10cSrcweir /*************************************************************************
681cdf0e10cSrcweir |*
682cdf0e10cSrcweir |*	  int XDash::operator==(const SfxPoolItem& rItem) const
683cdf0e10cSrcweir |*
684cdf0e10cSrcweir |*	  Beschreibung
685cdf0e10cSrcweir |*	  Ersterstellung	29.11.94
686cdf0e10cSrcweir |*	  Letzte Aenderung	29.11.94
687cdf0e10cSrcweir |*
688cdf0e10cSrcweir *************************************************************************/
689cdf0e10cSrcweir 
690cdf0e10cSrcweir bool XDash::operator==(const XDash& rDash) const
691cdf0e10cSrcweir {
692cdf0e10cSrcweir 	return ( eDash		== rDash.eDash		&&
693cdf0e10cSrcweir 			 nDots		== rDash.nDots		&&
694cdf0e10cSrcweir 			 nDotLen	== rDash.nDotLen	&&
695cdf0e10cSrcweir 			 nDashes	== rDash.nDashes	&&
696cdf0e10cSrcweir 			 nDashLen	== rDash.nDashLen	&&
697cdf0e10cSrcweir 			 nDistance	== rDash.nDistance );
698cdf0e10cSrcweir }
699cdf0e10cSrcweir 
700cdf0e10cSrcweir // XDash is translated into an array of doubles which describe the lengths of the
701cdf0e10cSrcweir // dashes, dots and empty passages. It returns the complete length of the full DashDot
702cdf0e10cSrcweir // sequence and fills the given vetor of doubles accordingly (also resizing, so deleting it).
703cdf0e10cSrcweir static double SMALLEST_DASH_WIDTH(26.95);
704cdf0e10cSrcweir double XDash::CreateDotDashArray(::std::vector< double >& rDotDashArray, double fLineWidth) const
705cdf0e10cSrcweir {
706cdf0e10cSrcweir 	double fFullDotDashLen(0.0);
707cdf0e10cSrcweir 	const sal_uInt16 nNumDotDashArray = (GetDots() + GetDashes()) * 2;
708cdf0e10cSrcweir 	rDotDashArray.resize( nNumDotDashArray, 0.0 );
709cdf0e10cSrcweir 	sal_uInt16 a;
710cdf0e10cSrcweir 	sal_uInt16 nIns(0);
711cdf0e10cSrcweir 	double fDashDotDistance = (double)GetDistance();
712cdf0e10cSrcweir 	double fSingleDashLen = (double)GetDashLen();
713cdf0e10cSrcweir 	double fSingleDotLen = (double)GetDotLen();
714cdf0e10cSrcweir 
715cdf0e10cSrcweir 	if(GetDashStyle() == XDASH_RECTRELATIVE || GetDashStyle() == XDASH_ROUNDRELATIVE)
716cdf0e10cSrcweir 	{
717cdf0e10cSrcweir 		if(fLineWidth != 0.0)
718cdf0e10cSrcweir 		{
719cdf0e10cSrcweir 			double fFactor = fLineWidth / 100.0;
720cdf0e10cSrcweir 
721cdf0e10cSrcweir 			if(GetDashes())
722cdf0e10cSrcweir 			{
723cdf0e10cSrcweir 				if(GetDashLen())
724cdf0e10cSrcweir 				{
725cdf0e10cSrcweir 					// is a dash
726cdf0e10cSrcweir 					fSingleDashLen *= fFactor;
727cdf0e10cSrcweir 				}
728cdf0e10cSrcweir 				else
729cdf0e10cSrcweir 				{
730cdf0e10cSrcweir 					// is a dot
731cdf0e10cSrcweir 					fSingleDashLen = fLineWidth;
732cdf0e10cSrcweir 				}
733cdf0e10cSrcweir 			}
734cdf0e10cSrcweir 
735cdf0e10cSrcweir 			if(GetDots())
736cdf0e10cSrcweir 			{
737cdf0e10cSrcweir 				if(GetDotLen())
738cdf0e10cSrcweir 				{
739cdf0e10cSrcweir 					// is a dash
740cdf0e10cSrcweir 					fSingleDotLen *= fFactor;
741cdf0e10cSrcweir 				}
742cdf0e10cSrcweir 				else
743cdf0e10cSrcweir 				{
744cdf0e10cSrcweir 					// is a dot
745cdf0e10cSrcweir 					fSingleDotLen = fLineWidth;
746cdf0e10cSrcweir 				}
747cdf0e10cSrcweir 			}
748cdf0e10cSrcweir 
749cdf0e10cSrcweir 			if(GetDashes() || GetDots())
750cdf0e10cSrcweir 			{
751cdf0e10cSrcweir 				if(GetDistance())
752cdf0e10cSrcweir 				{
753cdf0e10cSrcweir 					fDashDotDistance *= fFactor;
754cdf0e10cSrcweir 				}
755cdf0e10cSrcweir 				else
756cdf0e10cSrcweir 				{
757cdf0e10cSrcweir 					fDashDotDistance = fLineWidth;
758cdf0e10cSrcweir 				}
759cdf0e10cSrcweir 			}
760cdf0e10cSrcweir 		}
761cdf0e10cSrcweir 		else
762cdf0e10cSrcweir 		{
763cdf0e10cSrcweir 			if(GetDashes())
764cdf0e10cSrcweir 			{
765cdf0e10cSrcweir 				if(GetDashLen())
766cdf0e10cSrcweir 				{
767cdf0e10cSrcweir 					// is a dash
768cdf0e10cSrcweir 					fSingleDashLen = (SMALLEST_DASH_WIDTH * fSingleDashLen) / 100.0;
769cdf0e10cSrcweir 				}
770cdf0e10cSrcweir 				else
771cdf0e10cSrcweir 				{
772cdf0e10cSrcweir 					// is a dot
773cdf0e10cSrcweir 					fSingleDashLen = SMALLEST_DASH_WIDTH;
774cdf0e10cSrcweir 				}
775cdf0e10cSrcweir 			}
776cdf0e10cSrcweir 
777cdf0e10cSrcweir 			if(GetDots())
778cdf0e10cSrcweir 			{
779cdf0e10cSrcweir 				if(GetDotLen())
780cdf0e10cSrcweir 				{
781cdf0e10cSrcweir 					// is a dash
782cdf0e10cSrcweir 					fSingleDotLen = (SMALLEST_DASH_WIDTH * fSingleDotLen) / 100.0;
783cdf0e10cSrcweir 				}
784cdf0e10cSrcweir 				else
785cdf0e10cSrcweir 				{
786cdf0e10cSrcweir 					// is a dot
787cdf0e10cSrcweir 					fSingleDotLen = SMALLEST_DASH_WIDTH;
788cdf0e10cSrcweir 				}
789cdf0e10cSrcweir 			}
790cdf0e10cSrcweir 
791cdf0e10cSrcweir 			if(GetDashes() || GetDots())
792cdf0e10cSrcweir 			{
793cdf0e10cSrcweir 				if(GetDistance())
794cdf0e10cSrcweir 				{
795cdf0e10cSrcweir 					// dash as distance
796cdf0e10cSrcweir 					fDashDotDistance = (SMALLEST_DASH_WIDTH * fDashDotDistance) / 100.0;
797cdf0e10cSrcweir 				}
798cdf0e10cSrcweir 				else
799cdf0e10cSrcweir 				{
800cdf0e10cSrcweir 					// dot as distance
801cdf0e10cSrcweir 					fDashDotDistance = SMALLEST_DASH_WIDTH;
802cdf0e10cSrcweir 				}
803cdf0e10cSrcweir 			}
804cdf0e10cSrcweir 		}
805cdf0e10cSrcweir 	}
806cdf0e10cSrcweir 	else
807cdf0e10cSrcweir 	{
808cdf0e10cSrcweir 		// smallest dot size compare value
809cdf0e10cSrcweir 		double fDotCompVal(fLineWidth != 0.0 ? fLineWidth : SMALLEST_DASH_WIDTH);
810cdf0e10cSrcweir 
811cdf0e10cSrcweir 		// absolute values
812cdf0e10cSrcweir 		if(GetDashes())
813cdf0e10cSrcweir 		{
814cdf0e10cSrcweir 			if(GetDashLen())
815cdf0e10cSrcweir 			{
816cdf0e10cSrcweir 				// is a dash
817cdf0e10cSrcweir 				if(fSingleDashLen < SMALLEST_DASH_WIDTH)
818cdf0e10cSrcweir 				{
819cdf0e10cSrcweir 					fSingleDashLen = SMALLEST_DASH_WIDTH;
820cdf0e10cSrcweir 				}
821cdf0e10cSrcweir 			}
822cdf0e10cSrcweir 			else
823cdf0e10cSrcweir 			{
824cdf0e10cSrcweir 				// is a dot
825cdf0e10cSrcweir 				if(fSingleDashLen < fDotCompVal)
826cdf0e10cSrcweir 				{
827cdf0e10cSrcweir 					fSingleDashLen = fDotCompVal;
828cdf0e10cSrcweir 				}
829cdf0e10cSrcweir 			}
830cdf0e10cSrcweir 		}
831cdf0e10cSrcweir 
832cdf0e10cSrcweir 		if(GetDots())
833cdf0e10cSrcweir 		{
834cdf0e10cSrcweir 			if(GetDotLen())
835cdf0e10cSrcweir 			{
836cdf0e10cSrcweir 				// is a dash
837cdf0e10cSrcweir 				if(fSingleDotLen < SMALLEST_DASH_WIDTH)
838cdf0e10cSrcweir 				{
839cdf0e10cSrcweir 					fSingleDotLen = SMALLEST_DASH_WIDTH;
840cdf0e10cSrcweir 				}
841cdf0e10cSrcweir 			}
842cdf0e10cSrcweir 			else
843cdf0e10cSrcweir 			{
844cdf0e10cSrcweir 				// is a dot
845cdf0e10cSrcweir 				if(fSingleDotLen < fDotCompVal)
846cdf0e10cSrcweir 				{
847cdf0e10cSrcweir 					fSingleDotLen = fDotCompVal;
848cdf0e10cSrcweir 				}
849cdf0e10cSrcweir 			}
850cdf0e10cSrcweir 		}
851cdf0e10cSrcweir 
852cdf0e10cSrcweir 		if(GetDashes() || GetDots())
853cdf0e10cSrcweir 		{
854cdf0e10cSrcweir 			if(GetDistance())
855cdf0e10cSrcweir 			{
856cdf0e10cSrcweir 				// dash as distance
857cdf0e10cSrcweir 				if(fDashDotDistance < SMALLEST_DASH_WIDTH)
858cdf0e10cSrcweir 				{
859cdf0e10cSrcweir 					fDashDotDistance = SMALLEST_DASH_WIDTH;
860cdf0e10cSrcweir 				}
861cdf0e10cSrcweir 			}
862cdf0e10cSrcweir 			else
863cdf0e10cSrcweir 			{
864cdf0e10cSrcweir 				// dot as distance
865cdf0e10cSrcweir 				if(fDashDotDistance < fDotCompVal)
866cdf0e10cSrcweir 				{
867cdf0e10cSrcweir 					fDashDotDistance = fDotCompVal;
868cdf0e10cSrcweir 				}
869cdf0e10cSrcweir 			}
870cdf0e10cSrcweir 		}
871cdf0e10cSrcweir 	}
872cdf0e10cSrcweir 
873cdf0e10cSrcweir 	for(a=0;a<GetDots();a++)
874cdf0e10cSrcweir 	{
875cdf0e10cSrcweir 		rDotDashArray[nIns++] = fSingleDotLen;
876cdf0e10cSrcweir 		fFullDotDashLen += fSingleDotLen;
877cdf0e10cSrcweir 		rDotDashArray[nIns++] = fDashDotDistance;
878cdf0e10cSrcweir 		fFullDotDashLen += fDashDotDistance;
879cdf0e10cSrcweir 	}
880cdf0e10cSrcweir 
881cdf0e10cSrcweir 	for(a=0;a<GetDashes();a++)
882cdf0e10cSrcweir 	{
883cdf0e10cSrcweir 		rDotDashArray[nIns++] = fSingleDashLen;
884cdf0e10cSrcweir 		fFullDotDashLen += fSingleDashLen;
885cdf0e10cSrcweir 		rDotDashArray[nIns++] = fDashDotDistance;
886cdf0e10cSrcweir 		fFullDotDashLen += fDashDotDistance;
887cdf0e10cSrcweir 	}
888cdf0e10cSrcweir 
889cdf0e10cSrcweir 	return fFullDotDashLen;
890cdf0e10cSrcweir }
891cdf0e10cSrcweir 
892cdf0e10cSrcweir // -------------------
893cdf0e10cSrcweir // class XLineDashItem
894cdf0e10cSrcweir // -------------------
895cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XLineDashItem, NameOrIndex);
896cdf0e10cSrcweir 
897cdf0e10cSrcweir /*************************************************************************
898cdf0e10cSrcweir |*
899cdf0e10cSrcweir |*	  XLineDashItem::XLineDashItem(sal_Int32 nIndex, const XDash& rTheDash)
900cdf0e10cSrcweir |*
901cdf0e10cSrcweir |*	  Beschreibung
902cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
903cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
904cdf0e10cSrcweir |*
905cdf0e10cSrcweir *************************************************************************/
906cdf0e10cSrcweir 
907cdf0e10cSrcweir XLineDashItem::XLineDashItem(sal_Int32 nIndex, const XDash& rTheDash) :
908cdf0e10cSrcweir 	NameOrIndex(XATTR_LINEDASH, nIndex),
909cdf0e10cSrcweir 	aDash(rTheDash)
910cdf0e10cSrcweir {
911cdf0e10cSrcweir }
912cdf0e10cSrcweir 
913cdf0e10cSrcweir /*************************************************************************
914cdf0e10cSrcweir |*
915cdf0e10cSrcweir |*	  XLineDashItem::XLineDashItem(const String& rName, const XDash& rTheDash)
916cdf0e10cSrcweir |*
917cdf0e10cSrcweir |*	  Beschreibung
918cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
919cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
920cdf0e10cSrcweir |*
921cdf0e10cSrcweir *************************************************************************/
922cdf0e10cSrcweir 
923cdf0e10cSrcweir XLineDashItem::XLineDashItem(const XubString& rName, const XDash& rTheDash) :
924cdf0e10cSrcweir 	NameOrIndex(XATTR_LINEDASH, rName),
925cdf0e10cSrcweir 	aDash(rTheDash)
926cdf0e10cSrcweir {
927cdf0e10cSrcweir }
928cdf0e10cSrcweir 
929cdf0e10cSrcweir /*************************************************************************
930cdf0e10cSrcweir |*
931cdf0e10cSrcweir |*	  XLineDashItem::XLineDashItem(const XLineDashItem& rItem)
932cdf0e10cSrcweir |*
933cdf0e10cSrcweir |*	  Beschreibung
934cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
935cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
936cdf0e10cSrcweir |*
937cdf0e10cSrcweir *************************************************************************/
938cdf0e10cSrcweir 
939cdf0e10cSrcweir XLineDashItem::XLineDashItem(const XLineDashItem& rItem) :
940cdf0e10cSrcweir 	NameOrIndex(rItem),
941cdf0e10cSrcweir 	aDash(rItem.aDash)
942cdf0e10cSrcweir {
943cdf0e10cSrcweir }
944cdf0e10cSrcweir 
945cdf0e10cSrcweir /*************************************************************************
946cdf0e10cSrcweir |*
947cdf0e10cSrcweir |*	  XLineDashItem::XLineDashItem(SvStream& rIn)
948cdf0e10cSrcweir |*
949cdf0e10cSrcweir |*	  Beschreibung
950cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
951cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
952cdf0e10cSrcweir |*
953cdf0e10cSrcweir *************************************************************************/
954cdf0e10cSrcweir 
955cdf0e10cSrcweir XLineDashItem::XLineDashItem(SvStream& rIn) :
956cdf0e10cSrcweir 	NameOrIndex(XATTR_LINEDASH, rIn)
957cdf0e10cSrcweir {
958cdf0e10cSrcweir 	if (!IsIndex())
959cdf0e10cSrcweir 	{
960cdf0e10cSrcweir 		sal_uInt16	nSTemp;
961cdf0e10cSrcweir 		sal_uInt32	nLTemp;
962cdf0e10cSrcweir 		sal_Int32   nITemp;
963cdf0e10cSrcweir 
964cdf0e10cSrcweir 		rIn >> nITemp; aDash.SetDashStyle((XDashStyle)nITemp);
965cdf0e10cSrcweir 		rIn >> nSTemp; aDash.SetDots(nSTemp);
966cdf0e10cSrcweir 		rIn >> nLTemp; aDash.SetDotLen(nLTemp);
967cdf0e10cSrcweir 		rIn >> nSTemp; aDash.SetDashes(nSTemp);
968cdf0e10cSrcweir 		rIn >> nLTemp; aDash.SetDashLen(nLTemp);
969cdf0e10cSrcweir 		rIn >> nLTemp; aDash.SetDistance(nLTemp);
970cdf0e10cSrcweir 	}
971cdf0e10cSrcweir }
972cdf0e10cSrcweir 
973cdf0e10cSrcweir //*************************************************************************
974cdf0e10cSrcweir 
975cdf0e10cSrcweir XLineDashItem::XLineDashItem(SfxItemPool* /*pPool*/, const XDash& rTheDash)
976cdf0e10cSrcweir : 	NameOrIndex( XATTR_LINEDASH, -1 ),
977cdf0e10cSrcweir 	aDash(rTheDash)
978cdf0e10cSrcweir {
979cdf0e10cSrcweir }
980cdf0e10cSrcweir 
981cdf0e10cSrcweir //*************************************************************************
982cdf0e10cSrcweir 
983cdf0e10cSrcweir XLineDashItem::XLineDashItem(SfxItemPool* /*pPool*/)
984cdf0e10cSrcweir : NameOrIndex(XATTR_LINEDASH, -1 )
985cdf0e10cSrcweir {
986cdf0e10cSrcweir }
987cdf0e10cSrcweir 
988cdf0e10cSrcweir /*************************************************************************
989cdf0e10cSrcweir |*
990cdf0e10cSrcweir |*	  XLineDashItem::Clone(SfxItemPool* pPool) const
991cdf0e10cSrcweir |*
992cdf0e10cSrcweir |*	  Beschreibung
993cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
994cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
995cdf0e10cSrcweir |*
996cdf0e10cSrcweir *************************************************************************/
997cdf0e10cSrcweir 
998cdf0e10cSrcweir SfxPoolItem* XLineDashItem::Clone(SfxItemPool* /*pPool*/) const
999cdf0e10cSrcweir {
1000cdf0e10cSrcweir 	return new XLineDashItem(*this);
1001cdf0e10cSrcweir }
1002cdf0e10cSrcweir 
1003cdf0e10cSrcweir /*************************************************************************
1004cdf0e10cSrcweir |*
1005cdf0e10cSrcweir |*	  int XLineDashItem::operator==(const SfxPoolItem& rItem) const
1006cdf0e10cSrcweir |*
1007cdf0e10cSrcweir |*	  Beschreibung
1008cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
1009cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
1010cdf0e10cSrcweir |*
1011cdf0e10cSrcweir *************************************************************************/
1012cdf0e10cSrcweir 
1013cdf0e10cSrcweir int XLineDashItem::operator==(const SfxPoolItem& rItem) const
1014cdf0e10cSrcweir {
1015cdf0e10cSrcweir 	return ( NameOrIndex::operator==(rItem) &&
1016cdf0e10cSrcweir 			 aDash == ((const XLineDashItem&) rItem).aDash );
1017cdf0e10cSrcweir }
1018cdf0e10cSrcweir 
1019cdf0e10cSrcweir /*************************************************************************
1020cdf0e10cSrcweir |*
1021cdf0e10cSrcweir |*	  SfxPoolItem* XLineDashItem::Create(SvStream& rIn, sal_uInt16 nVer) const
1022cdf0e10cSrcweir |*
1023cdf0e10cSrcweir |*	  Beschreibung
1024cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
1025cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
1026cdf0e10cSrcweir |*
1027cdf0e10cSrcweir *************************************************************************/
1028cdf0e10cSrcweir 
1029cdf0e10cSrcweir SfxPoolItem* XLineDashItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
1030cdf0e10cSrcweir {
1031cdf0e10cSrcweir 	return new XLineDashItem(rIn);
1032cdf0e10cSrcweir }
1033cdf0e10cSrcweir 
1034cdf0e10cSrcweir /*************************************************************************
1035cdf0e10cSrcweir |*
1036cdf0e10cSrcweir |*	  SfxPoolItem* XLineDashItem::Store(SvStream& rOut) const
1037cdf0e10cSrcweir |*
1038cdf0e10cSrcweir |*	  Beschreibung
1039cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
1040cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
1041cdf0e10cSrcweir |*
1042cdf0e10cSrcweir *************************************************************************/
1043cdf0e10cSrcweir 
1044cdf0e10cSrcweir SvStream& XLineDashItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const
1045cdf0e10cSrcweir {
1046cdf0e10cSrcweir 	NameOrIndex::Store( rOut, nItemVersion );
1047cdf0e10cSrcweir 
1048cdf0e10cSrcweir 	if (!IsIndex())
1049cdf0e10cSrcweir 	{
1050cdf0e10cSrcweir 		rOut << (sal_Int32) aDash.GetDashStyle();
1051cdf0e10cSrcweir 		rOut << aDash.GetDots();
1052cdf0e10cSrcweir 		rOut << (sal_uInt32) aDash.GetDotLen();
1053cdf0e10cSrcweir 		rOut << aDash.GetDashes();
1054cdf0e10cSrcweir 		rOut << (sal_uInt32) aDash.GetDashLen();
1055cdf0e10cSrcweir 		rOut << (sal_uInt32) aDash.GetDistance();
1056cdf0e10cSrcweir 	}
1057cdf0e10cSrcweir 
1058cdf0e10cSrcweir 	return rOut;
1059cdf0e10cSrcweir }
1060cdf0e10cSrcweir 
1061cdf0e10cSrcweir /*************************************************************************
1062cdf0e10cSrcweir |*
106397e8a929SArmin Le Grand |*	  const XDash& XLineDashItem::GetValue(const XDashList* pTable) const
1064cdf0e10cSrcweir |*
1065cdf0e10cSrcweir |*	  Beschreibung
1066cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
1067cdf0e10cSrcweir |*	  Letzte Aenderung	18.11.94
1068cdf0e10cSrcweir |*
1069cdf0e10cSrcweir *************************************************************************/
1070cdf0e10cSrcweir 
107197e8a929SArmin Le Grand const XDash& XLineDashItem::GetDashValue(const XDashList* pTable) const // GetValue -> GetDashValue
1072cdf0e10cSrcweir {
1073cdf0e10cSrcweir 	if (!IsIndex())
1074cdf0e10cSrcweir 		return aDash;
1075cdf0e10cSrcweir 	else
1076cdf0e10cSrcweir 		return pTable->GetDash(GetIndex())->GetDash();
1077cdf0e10cSrcweir }
1078cdf0e10cSrcweir 
1079cdf0e10cSrcweir //------------------------------------------------------------------------
1080cdf0e10cSrcweir 
1081cdf0e10cSrcweir SfxItemPresentation XLineDashItem::GetPresentation
1082cdf0e10cSrcweir (
1083cdf0e10cSrcweir 	SfxItemPresentation ePres,
1084cdf0e10cSrcweir 	SfxMapUnit			/*eCoreUnit*/,
1085cdf0e10cSrcweir 	SfxMapUnit			/*ePresUnit*/,
1086cdf0e10cSrcweir     XubString&          rText, const IntlWrapper *
1087cdf0e10cSrcweir )	const
1088cdf0e10cSrcweir {
1089cdf0e10cSrcweir 	switch ( ePres )
1090cdf0e10cSrcweir 	{
1091cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NONE:
1092cdf0e10cSrcweir 			rText.Erase();
1093cdf0e10cSrcweir 			return ePres;
1094cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NAMELESS:
1095cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_COMPLETE:
1096cdf0e10cSrcweir 			rText = GetName();
1097cdf0e10cSrcweir 			return ePres;
1098cdf0e10cSrcweir 		default:
1099cdf0e10cSrcweir 			return SFX_ITEM_PRESENTATION_NONE;
1100cdf0e10cSrcweir 	}
1101cdf0e10cSrcweir }
1102cdf0e10cSrcweir 
1103cdf0e10cSrcweir //------------------------------------------------------------------------
1104cdf0e10cSrcweir 
1105cdf0e10cSrcweir FASTBOOL XLineDashItem::HasMetrics() const
1106cdf0e10cSrcweir {
1107cdf0e10cSrcweir 	return sal_True;
1108cdf0e10cSrcweir }
1109cdf0e10cSrcweir 
1110cdf0e10cSrcweir //------------------------------------------------------------------------
1111cdf0e10cSrcweir 
1112cdf0e10cSrcweir FASTBOOL XLineDashItem::ScaleMetrics(long nMul, long nDiv)
1113cdf0e10cSrcweir {
1114cdf0e10cSrcweir 	aDash.SetDotLen( ScaleMetricValue( aDash.GetDotLen(), nMul, nDiv ) );
1115cdf0e10cSrcweir 	aDash.SetDashLen( ScaleMetricValue( aDash.GetDashLen(), nMul, nDiv ) );
1116cdf0e10cSrcweir 	aDash.SetDistance( ScaleMetricValue( aDash.GetDistance(), nMul, nDiv ) );
1117cdf0e10cSrcweir 	return sal_True;
1118cdf0e10cSrcweir }
1119cdf0e10cSrcweir 
1120cdf0e10cSrcweir sal_Bool XLineDashItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const
1121cdf0e10cSrcweir {
1122cdf0e10cSrcweir //    sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
1123cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
1124cdf0e10cSrcweir 
1125cdf0e10cSrcweir 	switch ( nMemberId )
1126cdf0e10cSrcweir 	{
1127cdf0e10cSrcweir         case 0:
1128cdf0e10cSrcweir         {
1129cdf0e10cSrcweir             uno::Sequence< beans::PropertyValue > aPropSeq( 2 );
1130cdf0e10cSrcweir 
1131cdf0e10cSrcweir             ::com::sun::star::drawing::LineDash aLineDash;
1132cdf0e10cSrcweir 
1133cdf0e10cSrcweir 			const XDash& rXD = GetDashValue();
1134cdf0e10cSrcweir 			aLineDash.Style = (::com::sun::star::drawing::DashStyle)((sal_uInt16)rXD.GetDashStyle());
1135cdf0e10cSrcweir 			aLineDash.Dots = rXD.GetDots();
1136cdf0e10cSrcweir 			aLineDash.DotLen = rXD.GetDotLen();
1137cdf0e10cSrcweir 			aLineDash.Dashes = rXD.GetDashes();
1138cdf0e10cSrcweir 			aLineDash.DashLen = rXD.GetDashLen();
1139cdf0e10cSrcweir 			aLineDash.Distance = rXD.GetDistance();
1140cdf0e10cSrcweir 
1141cdf0e10cSrcweir 			rtl::OUString aApiName;
1142cdf0e10cSrcweir 			SvxUnogetApiNameForItem( Which(), GetName(), aApiName );
1143cdf0e10cSrcweir             aPropSeq[0].Name    = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ));
1144cdf0e10cSrcweir             aPropSeq[0].Value   = uno::makeAny( aApiName );
1145cdf0e10cSrcweir             aPropSeq[1].Name    = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LineDash" ));
1146cdf0e10cSrcweir             aPropSeq[1].Value   = uno::makeAny( aLineDash );
1147cdf0e10cSrcweir             rVal = uno::makeAny( aPropSeq );
1148cdf0e10cSrcweir             break;
1149cdf0e10cSrcweir         }
1150cdf0e10cSrcweir 
1151cdf0e10cSrcweir         case MID_NAME:
1152cdf0e10cSrcweir 		{
1153cdf0e10cSrcweir 			rtl::OUString aApiName;
1154cdf0e10cSrcweir 			SvxUnogetApiNameForItem( Which(), GetName(), aApiName );
1155cdf0e10cSrcweir 			rVal <<= aApiName;
1156cdf0e10cSrcweir 			break;
1157cdf0e10cSrcweir 		}
1158cdf0e10cSrcweir 
1159cdf0e10cSrcweir 		case MID_LINEDASH:
1160cdf0e10cSrcweir 		{
1161cdf0e10cSrcweir 			const XDash& rXD = GetDashValue();
1162cdf0e10cSrcweir 
1163cdf0e10cSrcweir 			::com::sun::star::drawing::LineDash aLineDash;
1164cdf0e10cSrcweir 
1165cdf0e10cSrcweir 			aLineDash.Style = (::com::sun::star::drawing::DashStyle)((sal_uInt16)rXD.GetDashStyle());
1166cdf0e10cSrcweir 			aLineDash.Dots = rXD.GetDots();
1167cdf0e10cSrcweir 			aLineDash.DotLen = rXD.GetDotLen();
1168cdf0e10cSrcweir 			aLineDash.Dashes = rXD.GetDashes();
1169cdf0e10cSrcweir 			aLineDash.DashLen = rXD.GetDashLen();
1170cdf0e10cSrcweir 			aLineDash.Distance = rXD.GetDistance();
1171cdf0e10cSrcweir 
1172cdf0e10cSrcweir 			rVal <<= aLineDash;
1173cdf0e10cSrcweir 			break;
1174cdf0e10cSrcweir 		}
1175cdf0e10cSrcweir 
1176cdf0e10cSrcweir 		case MID_LINEDASH_STYLE:
1177cdf0e10cSrcweir 		{
1178cdf0e10cSrcweir 			const XDash& rXD = GetDashValue();
1179cdf0e10cSrcweir 			rVal <<= (::com::sun::star::drawing::DashStyle)((sal_Int16)rXD.GetDashStyle());
1180cdf0e10cSrcweir 			break;
1181cdf0e10cSrcweir 		}
1182cdf0e10cSrcweir 
1183cdf0e10cSrcweir 		case MID_LINEDASH_DOTS:
1184cdf0e10cSrcweir 		{
1185cdf0e10cSrcweir 			const XDash& rXD = GetDashValue();
1186cdf0e10cSrcweir 			rVal <<= rXD.GetDots();
1187cdf0e10cSrcweir 			break;
1188cdf0e10cSrcweir 		}
1189cdf0e10cSrcweir 
1190cdf0e10cSrcweir 		case MID_LINEDASH_DOTLEN:
1191cdf0e10cSrcweir 		{
1192cdf0e10cSrcweir 			const XDash& rXD = GetDashValue();
1193cdf0e10cSrcweir 			rVal <<= rXD.GetDotLen();
1194cdf0e10cSrcweir 			break;
1195cdf0e10cSrcweir 		}
1196cdf0e10cSrcweir 
1197cdf0e10cSrcweir 		case MID_LINEDASH_DASHES:
1198cdf0e10cSrcweir 		{
1199cdf0e10cSrcweir 			const XDash& rXD = GetDashValue();
1200cdf0e10cSrcweir 			rVal <<= rXD.GetDashes();
1201cdf0e10cSrcweir 			break;
1202cdf0e10cSrcweir 		}
1203cdf0e10cSrcweir 
1204cdf0e10cSrcweir 		case MID_LINEDASH_DASHLEN:
1205cdf0e10cSrcweir 		{
1206cdf0e10cSrcweir 			const XDash& rXD = GetDashValue();
1207cdf0e10cSrcweir 			rVal <<= rXD.GetDashLen();
1208cdf0e10cSrcweir 			break;
1209cdf0e10cSrcweir 		}
1210cdf0e10cSrcweir 
1211cdf0e10cSrcweir 		case MID_LINEDASH_DISTANCE:
1212cdf0e10cSrcweir 		{
1213cdf0e10cSrcweir 			const XDash& rXD = GetDashValue();
1214cdf0e10cSrcweir 			rVal <<= rXD.GetDistance();
1215cdf0e10cSrcweir 			break;
1216cdf0e10cSrcweir 		}
1217cdf0e10cSrcweir 
1218cdf0e10cSrcweir 		default: DBG_ERROR("Wrong MemberId!"); return sal_False;
1219cdf0e10cSrcweir 	}
1220cdf0e10cSrcweir 
1221cdf0e10cSrcweir 	return sal_True;
1222cdf0e10cSrcweir }
1223cdf0e10cSrcweir 
1224cdf0e10cSrcweir sal_Bool XLineDashItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId )
1225cdf0e10cSrcweir {
1226cdf0e10cSrcweir //    sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
1227cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
1228cdf0e10cSrcweir 
1229cdf0e10cSrcweir 	switch ( nMemberId )
1230cdf0e10cSrcweir 	{
1231cdf0e10cSrcweir         case 0:
1232cdf0e10cSrcweir         {
1233cdf0e10cSrcweir             uno::Sequence< beans::PropertyValue >   aPropSeq;
1234cdf0e10cSrcweir             ::com::sun::star::drawing::LineDash     aLineDash;
1235cdf0e10cSrcweir             rtl::OUString                           aName;
1236cdf0e10cSrcweir             sal_Bool                                bLineDash( sal_False );
1237cdf0e10cSrcweir 
1238cdf0e10cSrcweir             if ( rVal >>= aPropSeq )
1239cdf0e10cSrcweir             {
1240cdf0e10cSrcweir                 for ( sal_Int32 n = 0; n < aPropSeq.getLength(); n++ )
1241cdf0e10cSrcweir                 {
1242cdf0e10cSrcweir                     if ( aPropSeq[n].Name.equalsAsciiL( "Name", 4  ))
1243cdf0e10cSrcweir                         aPropSeq[n].Value >>= aName;
1244cdf0e10cSrcweir                     else if ( aPropSeq[n].Name.equalsAsciiL( "LineDash", 8 ))
1245cdf0e10cSrcweir                     {
1246cdf0e10cSrcweir                         if ( aPropSeq[n].Value >>= aLineDash )
1247cdf0e10cSrcweir                             bLineDash = sal_True;
1248cdf0e10cSrcweir                     }
1249cdf0e10cSrcweir                 }
1250cdf0e10cSrcweir 
1251cdf0e10cSrcweir                 SetName( aName );
1252cdf0e10cSrcweir                 if ( bLineDash )
1253cdf0e10cSrcweir                 {
1254cdf0e10cSrcweir 			        XDash aXDash;
1255cdf0e10cSrcweir 
1256cdf0e10cSrcweir 			        aXDash.SetDashStyle((XDashStyle)((sal_uInt16)(aLineDash.Style)));
1257cdf0e10cSrcweir 			        aXDash.SetDots(aLineDash.Dots);
1258cdf0e10cSrcweir 			        aXDash.SetDotLen(aLineDash.DotLen);
1259cdf0e10cSrcweir 			        aXDash.SetDashes(aLineDash.Dashes);
1260cdf0e10cSrcweir 			        aXDash.SetDashLen(aLineDash.DashLen);
1261cdf0e10cSrcweir 			        aXDash.SetDistance(aLineDash.Distance);
1262cdf0e10cSrcweir 
1263cdf0e10cSrcweir 			        if((0 == aXDash.GetDots()) && (0 == aXDash.GetDashes()))
1264cdf0e10cSrcweir 				        aXDash.SetDots(1);
1265cdf0e10cSrcweir 
1266cdf0e10cSrcweir 			        SetDashValue( aXDash );
1267cdf0e10cSrcweir                 }
1268cdf0e10cSrcweir 
1269cdf0e10cSrcweir                 return sal_True;
1270cdf0e10cSrcweir             }
1271cdf0e10cSrcweir 
1272cdf0e10cSrcweir             return sal_False;
1273cdf0e10cSrcweir         }
1274cdf0e10cSrcweir 
1275cdf0e10cSrcweir         case MID_NAME:
1276cdf0e10cSrcweir 		{
1277cdf0e10cSrcweir 			rtl::OUString aName;
1278cdf0e10cSrcweir 			if (!(rVal >>= aName))
1279cdf0e10cSrcweir 				return sal_False;
1280cdf0e10cSrcweir 			SetName( aName );
1281cdf0e10cSrcweir 			break;
1282cdf0e10cSrcweir 		}
1283cdf0e10cSrcweir 
1284cdf0e10cSrcweir 		case MID_LINEDASH:
1285cdf0e10cSrcweir 		{
1286cdf0e10cSrcweir 			::com::sun::star::drawing::LineDash aLineDash;
1287cdf0e10cSrcweir 			if(!(rVal >>= aLineDash))
1288cdf0e10cSrcweir 				return sal_False;
1289cdf0e10cSrcweir 
1290cdf0e10cSrcweir 			XDash aXDash;
1291cdf0e10cSrcweir 
1292cdf0e10cSrcweir 			aXDash.SetDashStyle((XDashStyle)((sal_uInt16)(aLineDash.Style)));
1293cdf0e10cSrcweir 			aXDash.SetDots(aLineDash.Dots);
1294cdf0e10cSrcweir 			aXDash.SetDotLen(aLineDash.DotLen);
1295cdf0e10cSrcweir 			aXDash.SetDashes(aLineDash.Dashes);
1296cdf0e10cSrcweir 			aXDash.SetDashLen(aLineDash.DashLen);
1297cdf0e10cSrcweir 			aXDash.SetDistance(aLineDash.Distance);
1298cdf0e10cSrcweir 
1299cdf0e10cSrcweir 			if((0 == aXDash.GetDots()) && (0 == aXDash.GetDashes()))
1300cdf0e10cSrcweir 				aXDash.SetDots(1);
1301cdf0e10cSrcweir 
1302cdf0e10cSrcweir 			SetDashValue( aXDash );
1303cdf0e10cSrcweir 			break;
1304cdf0e10cSrcweir 		}
1305cdf0e10cSrcweir 
1306cdf0e10cSrcweir 		case MID_LINEDASH_STYLE:
1307cdf0e10cSrcweir 		{
1308cdf0e10cSrcweir 			sal_Int16 nVal = sal_Int16();
1309cdf0e10cSrcweir 			if(!(rVal >>= nVal))
1310cdf0e10cSrcweir 				return sal_False;
1311cdf0e10cSrcweir 
1312cdf0e10cSrcweir 			XDash aXDash = GetDashValue();
1313cdf0e10cSrcweir 			aXDash.SetDashStyle((XDashStyle)((sal_uInt16)(nVal)));
1314cdf0e10cSrcweir 
1315cdf0e10cSrcweir 			if((0 == aXDash.GetDots()) && (0 == aXDash.GetDashes()))
1316cdf0e10cSrcweir 				aXDash.SetDots(1);
1317cdf0e10cSrcweir 
1318cdf0e10cSrcweir 			SetDashValue( aXDash );
1319cdf0e10cSrcweir 
1320cdf0e10cSrcweir 			break;
1321cdf0e10cSrcweir 		}
1322cdf0e10cSrcweir 
1323cdf0e10cSrcweir 		case MID_LINEDASH_DOTS:
1324cdf0e10cSrcweir 		case MID_LINEDASH_DASHES:
1325cdf0e10cSrcweir 		{
1326cdf0e10cSrcweir 			sal_Int16 nVal = sal_Int16();
1327cdf0e10cSrcweir 			if(!(rVal >>= nVal))
1328cdf0e10cSrcweir 				return sal_False;
1329cdf0e10cSrcweir 
1330cdf0e10cSrcweir 			XDash aXDash = GetDashValue();
1331cdf0e10cSrcweir 			if ( nMemberId == MID_LINEDASH_DOTS )
1332cdf0e10cSrcweir 				aXDash.SetDots( nVal );
1333cdf0e10cSrcweir 			else
1334cdf0e10cSrcweir 				aXDash.SetDashes( nVal );
1335cdf0e10cSrcweir 
1336cdf0e10cSrcweir 			if((0 == aXDash.GetDots()) && (0 == aXDash.GetDashes()))
1337cdf0e10cSrcweir 				aXDash.SetDots(1);
1338cdf0e10cSrcweir 
1339cdf0e10cSrcweir 			SetDashValue( aXDash );
1340cdf0e10cSrcweir 			break;
1341cdf0e10cSrcweir 		}
1342cdf0e10cSrcweir 
1343cdf0e10cSrcweir 		case MID_LINEDASH_DOTLEN:
1344cdf0e10cSrcweir 		case MID_LINEDASH_DASHLEN:
1345cdf0e10cSrcweir 		case MID_LINEDASH_DISTANCE:
1346cdf0e10cSrcweir 		{
1347cdf0e10cSrcweir 			sal_Int32 nVal = 0;
1348cdf0e10cSrcweir 			if(!(rVal >>= nVal))
1349cdf0e10cSrcweir 				return sal_False;
1350cdf0e10cSrcweir 
1351cdf0e10cSrcweir 			XDash aXDash = GetDashValue();
1352cdf0e10cSrcweir 			if ( nMemberId == MID_LINEDASH_DOTLEN )
1353cdf0e10cSrcweir 				aXDash.SetDotLen( nVal );
1354cdf0e10cSrcweir 			else if ( nMemberId == MID_LINEDASH_DASHLEN )
1355cdf0e10cSrcweir 				aXDash.SetDashLen( nVal );
1356cdf0e10cSrcweir 			else
1357cdf0e10cSrcweir 				aXDash.SetDistance( nVal );
1358cdf0e10cSrcweir 
1359cdf0e10cSrcweir 			if((0 == aXDash.GetDots()) && (0 == aXDash.GetDashes()))
1360cdf0e10cSrcweir 				aXDash.SetDots(1);
1361cdf0e10cSrcweir 
1362cdf0e10cSrcweir 			SetDashValue( aXDash );
1363cdf0e10cSrcweir 			break;
1364cdf0e10cSrcweir 		}
1365cdf0e10cSrcweir 	}
1366cdf0e10cSrcweir 
1367cdf0e10cSrcweir 	return sal_True;
1368cdf0e10cSrcweir }
1369cdf0e10cSrcweir 
1370cdf0e10cSrcweir sal_Bool XLineDashItem::CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 )
1371cdf0e10cSrcweir {
1372cdf0e10cSrcweir 	return ((XLineDashItem*)p1)->GetDashValue() == ((XLineDashItem*)p2)->GetDashValue();
1373cdf0e10cSrcweir }
1374cdf0e10cSrcweir 
1375cdf0e10cSrcweir XLineDashItem* XLineDashItem::checkForUniqueItem( SdrModel* pModel ) const
1376cdf0e10cSrcweir {
1377cdf0e10cSrcweir 	if( pModel )
1378cdf0e10cSrcweir 	{
1379cdf0e10cSrcweir 		const String aUniqueName = NameOrIndex::CheckNamedItem(	this,
1380cdf0e10cSrcweir 																XATTR_LINEDASH,
1381cdf0e10cSrcweir 																&pModel->GetItemPool(),
1382cdf0e10cSrcweir 																pModel->GetStyleSheetPool() ? &pModel->GetStyleSheetPool()->GetPool() : NULL,
1383cdf0e10cSrcweir 																XLineDashItem::CompareValueFunc,
1384cdf0e10cSrcweir 																RID_SVXSTR_DASH11,
1385*c7be74b1SArmin Le Grand 																pModel->GetDashListFromSdrModel().get() );
1386cdf0e10cSrcweir 
1387cdf0e10cSrcweir 		// if the given name is not valid, replace it!
1388cdf0e10cSrcweir 		if( aUniqueName != GetName() )
1389cdf0e10cSrcweir 		{
1390cdf0e10cSrcweir 			return new XLineDashItem( aUniqueName, aDash );
1391cdf0e10cSrcweir 		}
1392cdf0e10cSrcweir 	}
1393cdf0e10cSrcweir 
1394cdf0e10cSrcweir 	return (XLineDashItem*)this;
1395cdf0e10cSrcweir }
1396cdf0e10cSrcweir 
1397cdf0e10cSrcweir // -------------------
1398cdf0e10cSrcweir // class XLineWidthItem
1399cdf0e10cSrcweir // -------------------
1400cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XLineWidthItem, SfxMetricItem);
1401cdf0e10cSrcweir 
1402cdf0e10cSrcweir /*************************************************************************
1403cdf0e10cSrcweir |*
1404cdf0e10cSrcweir |*	  XLineWidthItem::XLineWidthItem(long nWidth)
1405cdf0e10cSrcweir |*
1406cdf0e10cSrcweir |*	  Beschreibung
1407cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
1408cdf0e10cSrcweir |*	  Letzte Aenderung	18.11.94
1409cdf0e10cSrcweir |*
1410cdf0e10cSrcweir *************************************************************************/
1411cdf0e10cSrcweir 
1412cdf0e10cSrcweir XLineWidthItem::XLineWidthItem(long nWidth) :
1413cdf0e10cSrcweir 	SfxMetricItem(XATTR_LINEWIDTH, nWidth)
1414cdf0e10cSrcweir {
1415cdf0e10cSrcweir }
1416cdf0e10cSrcweir 
1417cdf0e10cSrcweir /*************************************************************************
1418cdf0e10cSrcweir |*
1419cdf0e10cSrcweir |*	  XLineWidthItem::XLineWidthItem(SvStream& rIn)
1420cdf0e10cSrcweir |*
1421cdf0e10cSrcweir |*	  Beschreibung
1422cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
1423cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
1424cdf0e10cSrcweir |*
1425cdf0e10cSrcweir *************************************************************************/
1426cdf0e10cSrcweir 
1427cdf0e10cSrcweir XLineWidthItem::XLineWidthItem(SvStream& rIn) :
1428cdf0e10cSrcweir 	SfxMetricItem(XATTR_LINEWIDTH, rIn)
1429cdf0e10cSrcweir {
1430cdf0e10cSrcweir }
1431cdf0e10cSrcweir 
1432cdf0e10cSrcweir /*************************************************************************
1433cdf0e10cSrcweir |*
1434cdf0e10cSrcweir |*	  XLineWidthItem::Clone(SfxItemPool* pPool) const
1435cdf0e10cSrcweir |*
1436cdf0e10cSrcweir |*	  Beschreibung
1437cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
1438cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
1439cdf0e10cSrcweir |*
1440cdf0e10cSrcweir *************************************************************************/
1441cdf0e10cSrcweir 
1442cdf0e10cSrcweir SfxPoolItem* XLineWidthItem::Clone(SfxItemPool* /*pPool*/) const
1443cdf0e10cSrcweir {
1444cdf0e10cSrcweir 	return new XLineWidthItem(*this);
1445cdf0e10cSrcweir }
1446cdf0e10cSrcweir 
1447cdf0e10cSrcweir /*************************************************************************
1448cdf0e10cSrcweir |*
1449cdf0e10cSrcweir |*	  SfxPoolItem* XLineWidthItem::Create(SvStream& rIn, sal_uInt16 nVer) const
1450cdf0e10cSrcweir |*
1451cdf0e10cSrcweir |*	  Beschreibung
1452cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
1453cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
1454cdf0e10cSrcweir |*
1455cdf0e10cSrcweir *************************************************************************/
1456cdf0e10cSrcweir 
1457cdf0e10cSrcweir SfxPoolItem* XLineWidthItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
1458cdf0e10cSrcweir {
1459cdf0e10cSrcweir 	return new XLineWidthItem(rIn);
1460cdf0e10cSrcweir }
1461cdf0e10cSrcweir 
1462cdf0e10cSrcweir //------------------------------------------------------------------------
1463cdf0e10cSrcweir 
1464cdf0e10cSrcweir SfxItemPresentation XLineWidthItem::GetPresentation
1465cdf0e10cSrcweir (
1466cdf0e10cSrcweir 	SfxItemPresentation ePres,
1467cdf0e10cSrcweir 	SfxMapUnit			eCoreUnit,
1468cdf0e10cSrcweir 	SfxMapUnit			ePresUnit,
1469cdf0e10cSrcweir     XubString&          rText, const IntlWrapper * pIntl
1470cdf0e10cSrcweir )	const
1471cdf0e10cSrcweir {
1472cdf0e10cSrcweir 	switch ( ePres )
1473cdf0e10cSrcweir 	{
1474cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NONE:
1475cdf0e10cSrcweir 			rText.Erase();
1476cdf0e10cSrcweir 			return ePres;
1477cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NAMELESS:
1478cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_COMPLETE:
1479cdf0e10cSrcweir 			rText = GetMetricText( (long) GetValue(),
1480cdf0e10cSrcweir                                     eCoreUnit, ePresUnit, pIntl);
1481cdf0e10cSrcweir 			rText += SVX_RESSTR( GetMetricId( ePresUnit) );
1482cdf0e10cSrcweir 			return ePres;
1483cdf0e10cSrcweir 		default:
1484cdf0e10cSrcweir 			return SFX_ITEM_PRESENTATION_NONE;
1485cdf0e10cSrcweir 	}
1486cdf0e10cSrcweir }
1487cdf0e10cSrcweir 
1488cdf0e10cSrcweir sal_Bool XLineWidthItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const
1489cdf0e10cSrcweir {
1490cdf0e10cSrcweir     sal_Int32 nValue = GetValue();
1491cdf0e10cSrcweir     if( 0 != (nMemberId&CONVERT_TWIPS) )
1492cdf0e10cSrcweir         nValue = TWIP_TO_MM100(nValue);
1493cdf0e10cSrcweir 
1494cdf0e10cSrcweir     rVal <<= nValue;
1495cdf0e10cSrcweir 	return sal_True;
1496cdf0e10cSrcweir }
1497cdf0e10cSrcweir 
1498cdf0e10cSrcweir sal_Bool XLineWidthItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId )
1499cdf0e10cSrcweir {
1500cdf0e10cSrcweir 	sal_Int32 nValue = 0;
1501cdf0e10cSrcweir 	rVal >>= nValue;
1502cdf0e10cSrcweir     if( 0 != (nMemberId&CONVERT_TWIPS) )
1503cdf0e10cSrcweir         nValue = MM100_TO_TWIP(nValue);
1504cdf0e10cSrcweir 
1505cdf0e10cSrcweir 	SetValue( nValue );
1506cdf0e10cSrcweir 	return sal_True;
1507cdf0e10cSrcweir }
1508cdf0e10cSrcweir 
1509cdf0e10cSrcweir // -------------------
1510cdf0e10cSrcweir // class XLineColorItem
1511cdf0e10cSrcweir // -------------------
1512cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XLineColorItem, XColorItem);
1513cdf0e10cSrcweir 
1514cdf0e10cSrcweir /*************************************************************************
1515cdf0e10cSrcweir |*
1516cdf0e10cSrcweir |*	  XLineColorItem::XLineColorItem(sal_Int32 nIndex, const Color& rTheColor)
1517cdf0e10cSrcweir |*
1518cdf0e10cSrcweir |*	  Beschreibung
1519cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
1520cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
1521cdf0e10cSrcweir |*
1522cdf0e10cSrcweir *************************************************************************/
1523cdf0e10cSrcweir 
1524cdf0e10cSrcweir XLineColorItem::XLineColorItem(sal_Int32 nIndex, const Color& rTheColor) :
1525cdf0e10cSrcweir 	XColorItem(XATTR_LINECOLOR, nIndex, rTheColor)
1526cdf0e10cSrcweir {
1527cdf0e10cSrcweir }
1528cdf0e10cSrcweir 
1529cdf0e10cSrcweir /*************************************************************************
1530cdf0e10cSrcweir |*
1531cdf0e10cSrcweir |*	  XLineColorItem::XLineColorItem(const XubString& rName, const Color& rTheColor)
1532cdf0e10cSrcweir |*
1533cdf0e10cSrcweir |*	  Beschreibung
1534cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
1535cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
1536cdf0e10cSrcweir |*
1537cdf0e10cSrcweir *************************************************************************/
1538cdf0e10cSrcweir 
1539cdf0e10cSrcweir XLineColorItem::XLineColorItem(const XubString& rName, const Color& rTheColor) :
1540cdf0e10cSrcweir 	XColorItem(XATTR_LINECOLOR, rName, rTheColor)
1541cdf0e10cSrcweir {
1542cdf0e10cSrcweir }
1543cdf0e10cSrcweir 
1544cdf0e10cSrcweir /*************************************************************************
1545cdf0e10cSrcweir |*
1546cdf0e10cSrcweir |*	  XLineColorItem::XLineColorItem(SvStream& rIn)
1547cdf0e10cSrcweir |*
1548cdf0e10cSrcweir |*	  Beschreibung
1549cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
1550cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
1551cdf0e10cSrcweir |*
1552cdf0e10cSrcweir *************************************************************************/
1553cdf0e10cSrcweir 
1554cdf0e10cSrcweir XLineColorItem::XLineColorItem(SvStream& rIn) :
1555cdf0e10cSrcweir 	XColorItem(XATTR_LINECOLOR, rIn)
1556cdf0e10cSrcweir {
1557cdf0e10cSrcweir }
1558cdf0e10cSrcweir 
1559cdf0e10cSrcweir /*************************************************************************
1560cdf0e10cSrcweir |*
1561cdf0e10cSrcweir |*	  XLineColorItem::Clone(SfxItemPool* pPool) const
1562cdf0e10cSrcweir |*
1563cdf0e10cSrcweir |*	  Beschreibung
1564cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
1565cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
1566cdf0e10cSrcweir |*
1567cdf0e10cSrcweir *************************************************************************/
1568cdf0e10cSrcweir 
1569cdf0e10cSrcweir SfxPoolItem* XLineColorItem::Clone(SfxItemPool* /*pPool*/) const
1570cdf0e10cSrcweir {
1571cdf0e10cSrcweir 	return new XLineColorItem(*this);
1572cdf0e10cSrcweir }
1573cdf0e10cSrcweir 
1574cdf0e10cSrcweir /*************************************************************************
1575cdf0e10cSrcweir |*
1576cdf0e10cSrcweir |*	  SfxPoolItem* XLineColorItem::Create(SvStream& rIn, sal_uInt16 nVer) const
1577cdf0e10cSrcweir |*
1578cdf0e10cSrcweir |*	  Beschreibung
1579cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
1580cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
1581cdf0e10cSrcweir |*
1582cdf0e10cSrcweir *************************************************************************/
1583cdf0e10cSrcweir 
1584cdf0e10cSrcweir SfxPoolItem* XLineColorItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
1585cdf0e10cSrcweir {
1586cdf0e10cSrcweir 	return new XLineColorItem(rIn);
1587cdf0e10cSrcweir }
1588cdf0e10cSrcweir 
1589cdf0e10cSrcweir //------------------------------------------------------------------------
1590cdf0e10cSrcweir 
1591cdf0e10cSrcweir SfxItemPresentation XLineColorItem::GetPresentation
1592cdf0e10cSrcweir (
1593cdf0e10cSrcweir 	SfxItemPresentation ePres,
1594cdf0e10cSrcweir 	SfxMapUnit			/*eCoreUnit*/,
1595cdf0e10cSrcweir 	SfxMapUnit			/*ePresUnit*/,
1596cdf0e10cSrcweir     XubString&          rText, const IntlWrapper *
1597cdf0e10cSrcweir )	const
1598cdf0e10cSrcweir {
1599cdf0e10cSrcweir 	switch ( ePres )
1600cdf0e10cSrcweir 	{
1601cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NONE:
1602cdf0e10cSrcweir 			rText.Erase();
1603cdf0e10cSrcweir 			return ePres;
1604cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NAMELESS:
1605cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_COMPLETE:
1606cdf0e10cSrcweir 			rText = GetName();
1607cdf0e10cSrcweir 			return ePres;
1608cdf0e10cSrcweir 		default:
1609cdf0e10cSrcweir 			return SFX_ITEM_PRESENTATION_NONE;
1610cdf0e10cSrcweir 	}
1611cdf0e10cSrcweir }
1612cdf0e10cSrcweir 
1613cdf0e10cSrcweir sal_Bool XLineColorItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1614cdf0e10cSrcweir {
1615cdf0e10cSrcweir     rVal <<= (sal_Int32)GetColorValue().GetRGBColor();
1616cdf0e10cSrcweir 	return sal_True;
1617cdf0e10cSrcweir }
1618cdf0e10cSrcweir 
1619cdf0e10cSrcweir sal_Bool XLineColorItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1620cdf0e10cSrcweir {
1621cdf0e10cSrcweir 	sal_Int32 nValue = 0;
1622cdf0e10cSrcweir 	if(!(rVal >>= nValue))
1623cdf0e10cSrcweir 		return sal_False;
1624cdf0e10cSrcweir 
1625cdf0e10cSrcweir 	SetColorValue( nValue );
1626cdf0e10cSrcweir 	return sal_True;
1627cdf0e10cSrcweir }
1628cdf0e10cSrcweir 
1629cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
1630cdf0e10cSrcweir // tooling for simple spooling B2DPolygon to file and back
1631cdf0e10cSrcweir 
1632cdf0e10cSrcweir namespace
1633cdf0e10cSrcweir {
1634cdf0e10cSrcweir 	void streamOutB2DPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPolygon, SvStream& rOut)
1635cdf0e10cSrcweir 	{
1636cdf0e10cSrcweir 		const sal_uInt32 nPolygonCount(rPolyPolygon.count());
1637cdf0e10cSrcweir 		rOut << nPolygonCount;
1638cdf0e10cSrcweir 
1639cdf0e10cSrcweir 		for(sal_uInt32 a(0L); a < nPolygonCount; a++)
1640cdf0e10cSrcweir 		{
1641cdf0e10cSrcweir 			const basegfx::B2DPolygon aCandidate(rPolyPolygon.getB2DPolygon(a));
1642cdf0e10cSrcweir 			const sal_uInt32 nPointCount(aCandidate.count());
1643cdf0e10cSrcweir 			const sal_uInt8 bClosed(aCandidate.isClosed() ? 1 : 0);
1644cdf0e10cSrcweir 			const sal_uInt8 bControlPoints(aCandidate.areControlPointsUsed() ? 1 : 0);
1645cdf0e10cSrcweir 			rOut << nPointCount;
1646cdf0e10cSrcweir 			rOut << bClosed;
1647cdf0e10cSrcweir 			rOut << bControlPoints;
1648cdf0e10cSrcweir 
1649cdf0e10cSrcweir 			for(sal_uInt32 b(0L); b < nPointCount; b++)
1650cdf0e10cSrcweir 			{
1651cdf0e10cSrcweir 				const basegfx::B2DPoint aPoint(aCandidate.getB2DPoint(b));
1652cdf0e10cSrcweir 				rOut << aPoint.getX();
1653cdf0e10cSrcweir 				rOut << aPoint.getY();
1654cdf0e10cSrcweir 
1655cdf0e10cSrcweir 				if(bControlPoints)
1656cdf0e10cSrcweir 				{
1657cdf0e10cSrcweir 					const sal_uInt8 bEdgeIsCurve(aCandidate.isPrevControlPointUsed(b) || aCandidate.isNextControlPointUsed(b) ? 1 : 0);
1658cdf0e10cSrcweir 					rOut << bEdgeIsCurve;
1659cdf0e10cSrcweir 
1660cdf0e10cSrcweir 					if(bEdgeIsCurve)
1661cdf0e10cSrcweir 					{
1662cdf0e10cSrcweir 						const basegfx::B2DVector aControlVectorA(aCandidate.getPrevControlPoint(b));
1663cdf0e10cSrcweir 						rOut << aControlVectorA.getX();
1664cdf0e10cSrcweir 						rOut << aControlVectorA.getY();
1665cdf0e10cSrcweir 
1666cdf0e10cSrcweir 						const basegfx::B2DVector aControlVectorB(aCandidate.getNextControlPoint(b));
1667cdf0e10cSrcweir 						rOut << aControlVectorB.getX();
1668cdf0e10cSrcweir 						rOut << aControlVectorB.getY();
1669cdf0e10cSrcweir 					}
1670cdf0e10cSrcweir 				}
1671cdf0e10cSrcweir 			}
1672cdf0e10cSrcweir 		}
1673cdf0e10cSrcweir 	}
1674cdf0e10cSrcweir 
1675cdf0e10cSrcweir 	basegfx::B2DPolyPolygon streamInB2DPolyPolygon(SvStream& rIn)
1676cdf0e10cSrcweir 	{
1677cdf0e10cSrcweir 		basegfx::B2DPolyPolygon aRetval;
1678cdf0e10cSrcweir 		sal_uInt32 nPolygonCount;
1679cdf0e10cSrcweir 		rIn >> nPolygonCount;
1680cdf0e10cSrcweir 
1681cdf0e10cSrcweir 		for(sal_uInt32 a(0L); a < nPolygonCount; a++)
1682cdf0e10cSrcweir 		{
1683cdf0e10cSrcweir 			sal_uInt32 nPointCount;
1684cdf0e10cSrcweir 			sal_uInt8 bClosed;
1685cdf0e10cSrcweir 			sal_uInt8 bControlPoints;
1686cdf0e10cSrcweir 
1687cdf0e10cSrcweir 			rIn >> nPointCount;
1688cdf0e10cSrcweir 			rIn >> bClosed;
1689cdf0e10cSrcweir 			rIn >> bControlPoints;
1690cdf0e10cSrcweir 
1691cdf0e10cSrcweir 			basegfx::B2DPolygon aCandidate;
1692cdf0e10cSrcweir 			aCandidate.setClosed(0 != bClosed);
1693cdf0e10cSrcweir 
1694cdf0e10cSrcweir 			for(sal_uInt32 b(0L); b < nPointCount; b++)
1695cdf0e10cSrcweir 			{
1696cdf0e10cSrcweir 				double fX, fY;
1697cdf0e10cSrcweir 				rIn >> fX;
1698cdf0e10cSrcweir 				rIn >> fY;
1699cdf0e10cSrcweir 				aCandidate.append(basegfx::B2DPoint(fX, fY));
1700cdf0e10cSrcweir 
1701cdf0e10cSrcweir 				if(0 != bControlPoints)
1702cdf0e10cSrcweir 				{
1703cdf0e10cSrcweir 					sal_uInt8 bEdgeIsCurve;
1704cdf0e10cSrcweir 					rIn >> bEdgeIsCurve;
1705cdf0e10cSrcweir 
1706cdf0e10cSrcweir 					if(0 != bEdgeIsCurve)
1707cdf0e10cSrcweir 					{
1708cdf0e10cSrcweir 						rIn >> fX;
1709cdf0e10cSrcweir 						rIn >> fY;
1710cdf0e10cSrcweir 						aCandidate.setPrevControlPoint(b, basegfx::B2DVector(fX, fY));
1711cdf0e10cSrcweir 
1712cdf0e10cSrcweir 						rIn >> fX;
1713cdf0e10cSrcweir 						rIn >> fY;
1714cdf0e10cSrcweir 						aCandidate.setNextControlPoint(b, basegfx::B2DVector(fX, fY));
1715cdf0e10cSrcweir 					}
1716cdf0e10cSrcweir 				}
1717cdf0e10cSrcweir 			}
1718cdf0e10cSrcweir 
1719cdf0e10cSrcweir 			aRetval.append(aCandidate);
1720cdf0e10cSrcweir 		}
1721cdf0e10cSrcweir 
1722cdf0e10cSrcweir 		return aRetval;
1723cdf0e10cSrcweir 	}
1724cdf0e10cSrcweir }
1725cdf0e10cSrcweir 
1726cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
1727cdf0e10cSrcweir 
1728cdf0e10cSrcweir // -----------------------
1729cdf0e10cSrcweir // class XLineStartItem
1730cdf0e10cSrcweir // -----------------------
1731cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XLineStartItem, NameOrIndex);
1732cdf0e10cSrcweir 
1733cdf0e10cSrcweir /*************************************************************************
1734cdf0e10cSrcweir |*
1735cdf0e10cSrcweir |*	  XLineStartItem::XLineStartItem(sal_Int32 nIndex)
1736cdf0e10cSrcweir |*
1737cdf0e10cSrcweir |*	  Beschreibung
1738cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
1739cdf0e10cSrcweir |*	  Letzte Aenderung	18.11.94
1740cdf0e10cSrcweir |*
1741cdf0e10cSrcweir *************************************************************************/
1742cdf0e10cSrcweir 
1743cdf0e10cSrcweir XLineStartItem::XLineStartItem(sal_Int32 nIndex)
1744cdf0e10cSrcweir :	NameOrIndex(XATTR_LINESTART, nIndex)
1745cdf0e10cSrcweir {
1746cdf0e10cSrcweir }
1747cdf0e10cSrcweir 
1748cdf0e10cSrcweir /*************************************************************************
1749cdf0e10cSrcweir |*
1750cdf0e10cSrcweir |*	  XLineStartItem::XLineStartItem(const XubString& rName,
1751cdf0e10cSrcweir |*									 const basegfx::B2DPolyPolygon& rXPolygon)
1752cdf0e10cSrcweir |*
1753cdf0e10cSrcweir |*	  Beschreibung
1754cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
1755cdf0e10cSrcweir |*	  Letzte Aenderung	18.11.94
1756cdf0e10cSrcweir |*
1757cdf0e10cSrcweir *************************************************************************/
1758cdf0e10cSrcweir 
1759cdf0e10cSrcweir XLineStartItem::XLineStartItem(const XubString& rName, const basegfx::B2DPolyPolygon& rPolyPolygon)
1760cdf0e10cSrcweir :	NameOrIndex(XATTR_LINESTART, rName),
1761cdf0e10cSrcweir 	maPolyPolygon(rPolyPolygon)
1762cdf0e10cSrcweir {
1763cdf0e10cSrcweir }
1764cdf0e10cSrcweir 
1765cdf0e10cSrcweir /*************************************************************************
1766cdf0e10cSrcweir |*
1767cdf0e10cSrcweir |*	  XLineStartItem::XLineStartItem(const XLineStartItem& rItem)
1768cdf0e10cSrcweir |*
1769cdf0e10cSrcweir |*	  Beschreibung
1770cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
1771cdf0e10cSrcweir |*	  Letzte Aenderung	17.11.94
1772cdf0e10cSrcweir |*
1773cdf0e10cSrcweir *************************************************************************/
1774cdf0e10cSrcweir 
1775cdf0e10cSrcweir XLineStartItem::XLineStartItem(const XLineStartItem& rItem)
1776cdf0e10cSrcweir :	NameOrIndex(rItem),
1777cdf0e10cSrcweir 	maPolyPolygon(rItem.maPolyPolygon)
1778cdf0e10cSrcweir {
1779cdf0e10cSrcweir }
1780cdf0e10cSrcweir 
1781cdf0e10cSrcweir /*************************************************************************
1782cdf0e10cSrcweir |*
1783cdf0e10cSrcweir |*	  XLineStartItem::XLineStartItem(SvStream& rIn)
1784cdf0e10cSrcweir |*
1785cdf0e10cSrcweir |*	  Beschreibung
1786cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
1787cdf0e10cSrcweir |*	  Letzte Aenderung	17.11.94
1788cdf0e10cSrcweir |*
1789cdf0e10cSrcweir *************************************************************************/
1790cdf0e10cSrcweir 
1791cdf0e10cSrcweir XLineStartItem::XLineStartItem(SvStream& rIn) :
1792cdf0e10cSrcweir 	NameOrIndex(XATTR_LINESTART, rIn)
1793cdf0e10cSrcweir {
1794cdf0e10cSrcweir 	if (!IsIndex())
1795cdf0e10cSrcweir 	{
1796cdf0e10cSrcweir 		maPolyPolygon = streamInB2DPolyPolygon(rIn);
1797cdf0e10cSrcweir 	}
1798cdf0e10cSrcweir }
1799cdf0e10cSrcweir 
1800cdf0e10cSrcweir //*************************************************************************
1801cdf0e10cSrcweir 
1802cdf0e10cSrcweir XLineStartItem::XLineStartItem(SfxItemPool* /*pPool*/, const basegfx::B2DPolyPolygon& rPolyPolygon)
1803cdf0e10cSrcweir : 	NameOrIndex( XATTR_LINESTART, -1 ),
1804cdf0e10cSrcweir 	maPolyPolygon(rPolyPolygon)
1805cdf0e10cSrcweir {
1806cdf0e10cSrcweir }
1807cdf0e10cSrcweir 
1808cdf0e10cSrcweir //*************************************************************************
1809cdf0e10cSrcweir 
1810cdf0e10cSrcweir XLineStartItem::XLineStartItem(SfxItemPool* /*pPool*/)
1811cdf0e10cSrcweir :	NameOrIndex(XATTR_LINESTART, -1 )
1812cdf0e10cSrcweir {
1813cdf0e10cSrcweir }
1814cdf0e10cSrcweir 
1815cdf0e10cSrcweir /*************************************************************************
1816cdf0e10cSrcweir |*
1817cdf0e10cSrcweir |*	  XLineStartItem::Clone(SfxItemPool* pPool) const
1818cdf0e10cSrcweir |*
1819cdf0e10cSrcweir |*	  Beschreibung
1820cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
1821cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
1822cdf0e10cSrcweir |*
1823cdf0e10cSrcweir *************************************************************************/
1824cdf0e10cSrcweir 
1825cdf0e10cSrcweir SfxPoolItem* XLineStartItem::Clone(SfxItemPool* /*pPool*/) const
1826cdf0e10cSrcweir {
1827cdf0e10cSrcweir 	return new XLineStartItem(*this);
1828cdf0e10cSrcweir }
1829cdf0e10cSrcweir 
1830cdf0e10cSrcweir /*************************************************************************
1831cdf0e10cSrcweir |*
1832cdf0e10cSrcweir |*	  int XLineStartItem::operator==(const SfxPoolItem& rItem) const
1833cdf0e10cSrcweir |*
1834cdf0e10cSrcweir |*	  Beschreibung
1835cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
1836cdf0e10cSrcweir |*	  Letzte Aenderung	18.11.94
1837cdf0e10cSrcweir |*
1838cdf0e10cSrcweir *************************************************************************/
1839cdf0e10cSrcweir 
1840cdf0e10cSrcweir int XLineStartItem::operator==(const SfxPoolItem& rItem) const
1841cdf0e10cSrcweir {
1842cdf0e10cSrcweir 	return ( NameOrIndex::operator==(rItem) && ((const XLineStartItem&) rItem).maPolyPolygon == maPolyPolygon );
1843cdf0e10cSrcweir }
1844cdf0e10cSrcweir 
1845cdf0e10cSrcweir /*************************************************************************
1846cdf0e10cSrcweir |*
1847cdf0e10cSrcweir |*	  SfxPoolItem* XLineStartItem::Create(SvStream& rIn, sal_uInt16 nVer) const
1848cdf0e10cSrcweir |*
1849cdf0e10cSrcweir |*	  Beschreibung
1850cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
1851cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
1852cdf0e10cSrcweir |*
1853cdf0e10cSrcweir *************************************************************************/
1854cdf0e10cSrcweir 
1855cdf0e10cSrcweir SfxPoolItem* XLineStartItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
1856cdf0e10cSrcweir {
1857cdf0e10cSrcweir 	return new XLineStartItem(rIn);
1858cdf0e10cSrcweir }
1859cdf0e10cSrcweir 
1860cdf0e10cSrcweir /*************************************************************************
1861cdf0e10cSrcweir |*
1862cdf0e10cSrcweir |*	  SfxPoolItem* XLineStartItem::Store(SvStream& rOut) const
1863cdf0e10cSrcweir |*
1864cdf0e10cSrcweir |*	  Beschreibung
1865cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
1866cdf0e10cSrcweir |*	  Letzte Aenderung	18.11.94
1867cdf0e10cSrcweir |*
1868cdf0e10cSrcweir *************************************************************************/
1869cdf0e10cSrcweir 
1870cdf0e10cSrcweir SvStream& XLineStartItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const
1871cdf0e10cSrcweir {
1872cdf0e10cSrcweir 	NameOrIndex::Store( rOut, nItemVersion );
1873cdf0e10cSrcweir 
1874cdf0e10cSrcweir 	if (!IsIndex())
1875cdf0e10cSrcweir 	{
1876cdf0e10cSrcweir 		streamOutB2DPolyPolygon(maPolyPolygon, rOut);
1877cdf0e10cSrcweir 	}
1878cdf0e10cSrcweir 
1879cdf0e10cSrcweir 	return rOut;
1880cdf0e10cSrcweir }
1881cdf0e10cSrcweir 
1882cdf0e10cSrcweir /*************************************************************************
1883cdf0e10cSrcweir |*
188497e8a929SArmin Le Grand |*	  const basegfx::B2DPolyPolygon& XLineStartItem::GetValue(const XLineEndList* pTable)
1885cdf0e10cSrcweir |*											   const
1886cdf0e10cSrcweir |*
1887cdf0e10cSrcweir |*	  Beschreibung
1888cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
1889cdf0e10cSrcweir |*	  Letzte Aenderung	18.11.94
1890cdf0e10cSrcweir |*
1891cdf0e10cSrcweir *************************************************************************/
1892cdf0e10cSrcweir 
189397e8a929SArmin Le Grand basegfx::B2DPolyPolygon XLineStartItem::GetLineStartValue(const XLineEndList* pTable) const
1894cdf0e10cSrcweir {
1895cdf0e10cSrcweir 	if (!IsIndex())
1896cdf0e10cSrcweir 	{
1897cdf0e10cSrcweir 		return maPolyPolygon;
1898cdf0e10cSrcweir 	}
1899cdf0e10cSrcweir 	else
1900cdf0e10cSrcweir 	{
1901cdf0e10cSrcweir 		return pTable->GetLineEnd(GetIndex())->GetLineEnd();
1902cdf0e10cSrcweir 	}
1903cdf0e10cSrcweir }
1904cdf0e10cSrcweir 
1905cdf0e10cSrcweir //------------------------------------------------------------------------
1906cdf0e10cSrcweir 
1907cdf0e10cSrcweir SfxItemPresentation XLineStartItem::GetPresentation
1908cdf0e10cSrcweir (
1909cdf0e10cSrcweir 	SfxItemPresentation ePres,
1910cdf0e10cSrcweir 	SfxMapUnit			/*eCoreUnit*/,
1911cdf0e10cSrcweir 	SfxMapUnit			/*ePresUnit*/,
1912cdf0e10cSrcweir     XubString&          rText, const IntlWrapper *
1913cdf0e10cSrcweir )	const
1914cdf0e10cSrcweir {
1915cdf0e10cSrcweir 	switch ( ePres )
1916cdf0e10cSrcweir 	{
1917cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NONE:
1918cdf0e10cSrcweir 			rText.Erase();
1919cdf0e10cSrcweir 			return ePres;
1920cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NAMELESS:
1921cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_COMPLETE:
1922cdf0e10cSrcweir 			rText = GetName();
1923cdf0e10cSrcweir 			return ePres;
1924cdf0e10cSrcweir 		default:
1925cdf0e10cSrcweir 		return SFX_ITEM_PRESENTATION_NONE;
1926cdf0e10cSrcweir 	}
1927cdf0e10cSrcweir }
1928cdf0e10cSrcweir 
1929cdf0e10cSrcweir sal_Bool XLineStartItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const
1930cdf0e10cSrcweir {
1931cdf0e10cSrcweir //    sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
1932cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
1933cdf0e10cSrcweir 	if( nMemberId == MID_NAME )
1934cdf0e10cSrcweir 	{
1935cdf0e10cSrcweir 		rtl::OUString aApiName;
1936cdf0e10cSrcweir 		SvxUnogetApiNameForItem( Which(), GetName(), aApiName );
1937cdf0e10cSrcweir 		rVal <<= aApiName;
1938cdf0e10cSrcweir 	}
1939cdf0e10cSrcweir 	else
1940cdf0e10cSrcweir 	{
1941cdf0e10cSrcweir 		com::sun::star::drawing::PolyPolygonBezierCoords aBezier;
1942cdf0e10cSrcweir 		SvxConvertB2DPolyPolygonToPolyPolygonBezier( maPolyPolygon, aBezier );
1943cdf0e10cSrcweir 		rVal <<= aBezier;
1944cdf0e10cSrcweir 	}
1945cdf0e10cSrcweir 
1946cdf0e10cSrcweir 	return sal_True;
1947cdf0e10cSrcweir }
1948cdf0e10cSrcweir 
1949cdf0e10cSrcweir sal_Bool XLineStartItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId )
1950cdf0e10cSrcweir {
1951cdf0e10cSrcweir //    sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
1952cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
1953cdf0e10cSrcweir 	if( nMemberId == MID_NAME )
1954cdf0e10cSrcweir 	{
1955cdf0e10cSrcweir 		return sal_False;
1956cdf0e10cSrcweir 	}
1957cdf0e10cSrcweir 	else
1958cdf0e10cSrcweir 	{
1959cdf0e10cSrcweir 		maPolyPolygon.clear();
1960cdf0e10cSrcweir 
1961cdf0e10cSrcweir 		if( rVal.hasValue() && rVal.getValue() )
1962cdf0e10cSrcweir 		{
1963cdf0e10cSrcweir 			if( rVal.getValueType() != ::getCppuType((const com::sun::star::drawing::PolyPolygonBezierCoords*)0) )
1964cdf0e10cSrcweir 				return sal_False;
1965cdf0e10cSrcweir 
1966cdf0e10cSrcweir 			com::sun::star::drawing::PolyPolygonBezierCoords* pCoords = (com::sun::star::drawing::PolyPolygonBezierCoords*)rVal.getValue();
1967cdf0e10cSrcweir 			if( pCoords->Coordinates.getLength() > 0 )
1968cdf0e10cSrcweir 			{
1969cdf0e10cSrcweir 				maPolyPolygon = SvxConvertPolyPolygonBezierToB2DPolyPolygon( pCoords );
1970cdf0e10cSrcweir 				// #i72807# close line start/end polygons hard
1971cdf0e10cSrcweir 				// maPolyPolygon.setClosed(true);
1972cdf0e10cSrcweir 			}
1973cdf0e10cSrcweir 		}
1974cdf0e10cSrcweir 	}
1975cdf0e10cSrcweir 
1976cdf0e10cSrcweir 	return sal_True;
1977cdf0e10cSrcweir }
1978cdf0e10cSrcweir 
1979cdf0e10cSrcweir /** this function searches in both the models pool and the styles pool for XLineStartItem
1980cdf0e10cSrcweir 	and XLineEndItem with the same value or name and returns an item with the value of
1981cdf0e10cSrcweir 	this item and a unique name for an item with this value. */
1982cdf0e10cSrcweir XLineStartItem* XLineStartItem::checkForUniqueItem( SdrModel* pModel ) const
1983cdf0e10cSrcweir {
1984cdf0e10cSrcweir 	if( pModel )
1985cdf0e10cSrcweir 	{
1986cdf0e10cSrcweir 		XLineStartItem* pTempItem = NULL;
1987cdf0e10cSrcweir 		const XLineStartItem* pLineStartItem = this;
1988cdf0e10cSrcweir 
1989cdf0e10cSrcweir 		String aUniqueName( GetName() );
1990cdf0e10cSrcweir 
1991cdf0e10cSrcweir 		if( !maPolyPolygon.count() )
1992cdf0e10cSrcweir 		{
1993cdf0e10cSrcweir 			// if the polygon is empty, check if the name is empty
1994cdf0e10cSrcweir 			if( aUniqueName.Len() == 0 )
1995cdf0e10cSrcweir 				return (XLineStartItem*)this;
1996cdf0e10cSrcweir 
1997cdf0e10cSrcweir 			// force empty name for empty polygons
1998cdf0e10cSrcweir 			return new XLineStartItem( String(), maPolyPolygon );
1999cdf0e10cSrcweir 		}
2000cdf0e10cSrcweir 
2001cdf0e10cSrcweir 		if( maPolyPolygon.count() > 1L )
2002cdf0e10cSrcweir 		{
2003cdf0e10cSrcweir 			// check if the polygon is closed
2004cdf0e10cSrcweir 			if(!maPolyPolygon.isClosed())
2005cdf0e10cSrcweir 			{
2006cdf0e10cSrcweir 				// force a closed polygon
2007cdf0e10cSrcweir 				basegfx::B2DPolyPolygon aNew(maPolyPolygon);
2008cdf0e10cSrcweir 				aNew.setClosed(true);
2009cdf0e10cSrcweir 				pTempItem = new XLineStartItem( aUniqueName, aNew );
2010cdf0e10cSrcweir 				pLineStartItem = pTempItem;
2011cdf0e10cSrcweir 			}
2012cdf0e10cSrcweir 		}
2013cdf0e10cSrcweir 
2014cdf0e10cSrcweir 		sal_Bool bForceNew = sal_False;
2015cdf0e10cSrcweir 
2016cdf0e10cSrcweir 		// 2. if we have a name check if there is already an item with the
2017cdf0e10cSrcweir 		// same name in the documents pool with a different line end or start
2018cdf0e10cSrcweir 
2019cdf0e10cSrcweir 		sal_uInt32 nCount, nSurrogate;
2020cdf0e10cSrcweir 
2021cdf0e10cSrcweir 		const SfxItemPool* pPool1 = &pModel->GetItemPool();
2022cdf0e10cSrcweir 		if( aUniqueName.Len() && pPool1 )
2023cdf0e10cSrcweir 		{
2024cdf0e10cSrcweir 			nCount = pPool1->GetItemCount2( XATTR_LINESTART );
2025cdf0e10cSrcweir 
2026cdf0e10cSrcweir 			for( nSurrogate = 0; nSurrogate < nCount; nSurrogate++ )
2027cdf0e10cSrcweir 			{
2028cdf0e10cSrcweir 				const XLineStartItem* pItem = (const XLineStartItem*)pPool1->GetItem2( XATTR_LINESTART, nSurrogate );
2029cdf0e10cSrcweir 
2030cdf0e10cSrcweir 				if( pItem && ( pItem->GetName() == pLineStartItem->GetName() ) )
2031cdf0e10cSrcweir 				{
2032cdf0e10cSrcweir 					// if there is already an item with the same name and the same
2033cdf0e10cSrcweir 					// value its ok to set it
2034cdf0e10cSrcweir 					if( pItem->GetLineStartValue() != pLineStartItem->GetLineStartValue() )
2035cdf0e10cSrcweir 					{
2036cdf0e10cSrcweir 						// same name but different value, we need a new name for this item
2037cdf0e10cSrcweir 						aUniqueName = String();
2038cdf0e10cSrcweir 						bForceNew = sal_True;
2039cdf0e10cSrcweir 					}
2040cdf0e10cSrcweir 					break;
2041cdf0e10cSrcweir 				}
2042cdf0e10cSrcweir 			}
2043cdf0e10cSrcweir 
2044cdf0e10cSrcweir 			if( !bForceNew )
2045cdf0e10cSrcweir 			{
2046cdf0e10cSrcweir 				nCount = pPool1->GetItemCount2( XATTR_LINEEND );
2047cdf0e10cSrcweir 
2048cdf0e10cSrcweir 				for( nSurrogate = 0; nSurrogate < nCount; nSurrogate++ )
2049cdf0e10cSrcweir 				{
2050cdf0e10cSrcweir 					const XLineEndItem* pItem = (const XLineEndItem*)pPool1->GetItem2( XATTR_LINEEND, nSurrogate );
2051cdf0e10cSrcweir 
2052cdf0e10cSrcweir 					if( pItem && ( pItem->GetName() == pLineStartItem->GetName() ) )
2053cdf0e10cSrcweir 					{
2054cdf0e10cSrcweir 						// if there is already an item with the same name and the same
2055cdf0e10cSrcweir 						// value its ok to set it
2056cdf0e10cSrcweir 						if( pItem->GetLineEndValue() != pLineStartItem->GetLineStartValue() )
2057cdf0e10cSrcweir 						{
2058cdf0e10cSrcweir 							// same name but different value, we need a new name for this item
2059cdf0e10cSrcweir 							aUniqueName = String();
2060cdf0e10cSrcweir 							bForceNew = sal_True;
2061cdf0e10cSrcweir 						}
2062cdf0e10cSrcweir 						break;
2063cdf0e10cSrcweir 					}
2064cdf0e10cSrcweir 				}
2065cdf0e10cSrcweir 			}
2066cdf0e10cSrcweir 		}
2067cdf0e10cSrcweir 
2068cdf0e10cSrcweir 		const SfxItemPool* pPool2 = pModel->GetStyleSheetPool() ? &pModel->GetStyleSheetPool()->GetPool() : NULL;
2069cdf0e10cSrcweir 		if( aUniqueName.Len() && pPool2)
2070cdf0e10cSrcweir 		{
2071cdf0e10cSrcweir 			nCount = pPool2->GetItemCount2( XATTR_LINESTART );
2072cdf0e10cSrcweir 			for( nSurrogate = 0; nSurrogate < nCount; nSurrogate++ )
2073cdf0e10cSrcweir 			{
2074cdf0e10cSrcweir 				const XLineStartItem* pItem = (const XLineStartItem*)pPool2->GetItem2( XATTR_LINESTART, nSurrogate );
2075cdf0e10cSrcweir 
2076cdf0e10cSrcweir 				if( pItem && ( pItem->GetName() == pLineStartItem->GetName() ) )
2077cdf0e10cSrcweir 				{
2078cdf0e10cSrcweir 					// if there is already an item with the same name and the same
2079cdf0e10cSrcweir 					// value its ok to set it
2080cdf0e10cSrcweir 					if( pItem->GetLineStartValue() != pLineStartItem->GetLineStartValue() )
2081cdf0e10cSrcweir 					{
2082cdf0e10cSrcweir 						// same name but different value, we need a new name for this item
2083cdf0e10cSrcweir 						aUniqueName = String();
2084cdf0e10cSrcweir 						bForceNew = sal_True;
2085cdf0e10cSrcweir 					}
2086cdf0e10cSrcweir 					break;
2087cdf0e10cSrcweir 				}
2088cdf0e10cSrcweir 			}
2089cdf0e10cSrcweir 
2090cdf0e10cSrcweir 			if( !bForceNew )
2091cdf0e10cSrcweir 			{
2092cdf0e10cSrcweir 				nCount = pPool2->GetItemCount2( XATTR_LINEEND );
2093cdf0e10cSrcweir 				for( nSurrogate = 0; nSurrogate < nCount; nSurrogate++ )
2094cdf0e10cSrcweir 				{
2095cdf0e10cSrcweir 					const XLineEndItem* pItem = (const XLineEndItem*)pPool2->GetItem2( XATTR_LINEEND, nSurrogate );
2096cdf0e10cSrcweir 
2097cdf0e10cSrcweir 					if( pItem && ( pItem->GetName() == pLineStartItem->GetName() ) )
2098cdf0e10cSrcweir 					{
2099cdf0e10cSrcweir 						// if there is already an item with the same name and the same
2100cdf0e10cSrcweir 						// value its ok to set it
2101cdf0e10cSrcweir 						if( pItem->GetLineEndValue() != pLineStartItem->GetLineStartValue() )
2102cdf0e10cSrcweir 						{
2103cdf0e10cSrcweir 							// same name but different value, we need a new name for this item
2104cdf0e10cSrcweir 							aUniqueName = String();
2105cdf0e10cSrcweir 							bForceNew = sal_True;
2106cdf0e10cSrcweir 						}
2107cdf0e10cSrcweir 						break;
2108cdf0e10cSrcweir 					}
2109cdf0e10cSrcweir 				}
2110cdf0e10cSrcweir 			}
2111cdf0e10cSrcweir 		}
2112cdf0e10cSrcweir 
2113cdf0e10cSrcweir 		// if we have no name yet, find existing item with same conent or
2114cdf0e10cSrcweir 		// create a unique name
2115cdf0e10cSrcweir 		if( aUniqueName.Len() == 0 )
2116cdf0e10cSrcweir 		{
2117cdf0e10cSrcweir 			sal_Bool bFoundExisting = sal_False;
2118cdf0e10cSrcweir 
2119cdf0e10cSrcweir 			sal_Int32 nUserIndex = 1;
2120cdf0e10cSrcweir 			const ResId aRes(SVX_RES(RID_SVXSTR_LINEEND));
2121cdf0e10cSrcweir 			const String aUser( aRes );
2122cdf0e10cSrcweir 
2123cdf0e10cSrcweir 			if( pPool1 )
2124cdf0e10cSrcweir 			{
2125cdf0e10cSrcweir 				nCount = pPool1->GetItemCount2( XATTR_LINESTART );
2126cdf0e10cSrcweir 				sal_uInt32 nSurrogate2;
2127cdf0e10cSrcweir 
2128cdf0e10cSrcweir 				for( nSurrogate2 = 0; nSurrogate2 < nCount; nSurrogate2++ )
2129cdf0e10cSrcweir 				{
2130cdf0e10cSrcweir 					const XLineStartItem* pItem = (const XLineStartItem*)pPool1->GetItem2( XATTR_LINESTART, nSurrogate2 );
2131cdf0e10cSrcweir 
2132cdf0e10cSrcweir 					if( pItem && pItem->GetName().Len() )
2133cdf0e10cSrcweir 					{
2134cdf0e10cSrcweir 						if( !bForceNew && pItem->GetLineStartValue() == pLineStartItem->GetLineStartValue() )
2135cdf0e10cSrcweir 						{
2136cdf0e10cSrcweir 							aUniqueName = pItem->GetName();
2137cdf0e10cSrcweir 							bFoundExisting = sal_True;
2138cdf0e10cSrcweir 							break;
2139cdf0e10cSrcweir 						}
2140cdf0e10cSrcweir 
2141cdf0e10cSrcweir 						if( pItem->GetName().CompareTo( aUser, aUser.Len() ) == 0 )
2142cdf0e10cSrcweir 						{
2143cdf0e10cSrcweir 							sal_Int32 nThisIndex = pItem->GetName().Copy( aUser.Len() ).ToInt32();
2144cdf0e10cSrcweir 							if( nThisIndex >= nUserIndex )
2145cdf0e10cSrcweir 								nUserIndex = nThisIndex + 1;
2146cdf0e10cSrcweir 						}
2147cdf0e10cSrcweir 					}
2148cdf0e10cSrcweir 				}
2149cdf0e10cSrcweir 
2150cdf0e10cSrcweir 				nCount = pPool1->GetItemCount2( XATTR_LINEEND );
2151cdf0e10cSrcweir 				for( nSurrogate2 = 0; nSurrogate2 < nCount; nSurrogate2++ )
2152cdf0e10cSrcweir 				{
2153cdf0e10cSrcweir 					const XLineEndItem* pItem = (const XLineEndItem*)pPool1->GetItem2( XATTR_LINEEND, nSurrogate2 );
2154cdf0e10cSrcweir 
2155cdf0e10cSrcweir 					if( pItem && pItem->GetName().Len() )
2156cdf0e10cSrcweir 					{
2157cdf0e10cSrcweir 						if( !bForceNew && pItem->GetLineEndValue() == pLineStartItem->GetLineStartValue() )
2158cdf0e10cSrcweir 						{
2159cdf0e10cSrcweir 							aUniqueName = pItem->GetName();
2160cdf0e10cSrcweir 							bFoundExisting = sal_True;
2161cdf0e10cSrcweir 							break;
2162cdf0e10cSrcweir 						}
2163cdf0e10cSrcweir 
2164cdf0e10cSrcweir 						if( pItem->GetName().CompareTo( aUser, aUser.Len() ) == 0 )
2165cdf0e10cSrcweir 						{
2166cdf0e10cSrcweir 							sal_Int32 nThisIndex = pItem->GetName().Copy( aUser.Len() ).ToInt32();
2167cdf0e10cSrcweir 							if( nThisIndex >= nUserIndex )
2168cdf0e10cSrcweir 								nUserIndex = nThisIndex + 1;
2169cdf0e10cSrcweir 						}
2170cdf0e10cSrcweir 					}
2171cdf0e10cSrcweir 				}
2172cdf0e10cSrcweir 			}
2173cdf0e10cSrcweir 
2174cdf0e10cSrcweir 			if( !bFoundExisting )
2175cdf0e10cSrcweir 			{
2176cdf0e10cSrcweir 				aUniqueName = aUser;
2177cdf0e10cSrcweir 				aUniqueName += sal_Unicode(' ');
2178cdf0e10cSrcweir 				aUniqueName += String::CreateFromInt32( nUserIndex );
2179cdf0e10cSrcweir 			}
2180cdf0e10cSrcweir 		}
2181cdf0e10cSrcweir 
2182cdf0e10cSrcweir 		// if the given name is not valid, replace it!
2183cdf0e10cSrcweir 		if( aUniqueName != GetName() || pTempItem )
2184cdf0e10cSrcweir 		{
2185cdf0e10cSrcweir 			if( pTempItem )
2186cdf0e10cSrcweir 			{
2187cdf0e10cSrcweir 				pTempItem->SetName( aUniqueName );
2188cdf0e10cSrcweir 				return pTempItem;
2189cdf0e10cSrcweir 			}
2190cdf0e10cSrcweir 			else
2191cdf0e10cSrcweir 			{
2192cdf0e10cSrcweir 				return new XLineStartItem( aUniqueName, maPolyPolygon );
2193cdf0e10cSrcweir 			}
2194cdf0e10cSrcweir 		}
2195cdf0e10cSrcweir 	}
2196cdf0e10cSrcweir 
2197cdf0e10cSrcweir 	return (XLineStartItem*)this;
2198cdf0e10cSrcweir }
2199cdf0e10cSrcweir 
2200cdf0e10cSrcweir // ---------------------
2201cdf0e10cSrcweir // class XLineEndItem
2202cdf0e10cSrcweir // ---------------------
2203cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XLineEndItem, NameOrIndex);
2204cdf0e10cSrcweir 
2205cdf0e10cSrcweir /*************************************************************************
2206cdf0e10cSrcweir |*
2207cdf0e10cSrcweir |*	  XLineEndItem::XLineEndItem(sal_Int32 nIndex)
2208cdf0e10cSrcweir |*
2209cdf0e10cSrcweir |*	  Beschreibung
2210cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
2211cdf0e10cSrcweir |*	  Letzte Aenderung	18.11.94
2212cdf0e10cSrcweir |*
2213cdf0e10cSrcweir *************************************************************************/
2214cdf0e10cSrcweir 
2215cdf0e10cSrcweir XLineEndItem::XLineEndItem(sal_Int32 nIndex)
2216cdf0e10cSrcweir :	NameOrIndex(XATTR_LINEEND, nIndex)
2217cdf0e10cSrcweir {
2218cdf0e10cSrcweir }
2219cdf0e10cSrcweir 
2220cdf0e10cSrcweir /*************************************************************************
2221cdf0e10cSrcweir |*
2222cdf0e10cSrcweir |*	  XLineEndItem::XLineEndItem(const XubString& rName,
2223cdf0e10cSrcweir |*								 const basegfx::B2DPolyPolygon& rXPolygon)
2224cdf0e10cSrcweir |*
2225cdf0e10cSrcweir |*	  Beschreibung
2226cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
2227cdf0e10cSrcweir |*	  Letzte Aenderung	18.11.94
2228cdf0e10cSrcweir |*
2229cdf0e10cSrcweir *************************************************************************/
2230cdf0e10cSrcweir 
2231cdf0e10cSrcweir XLineEndItem::XLineEndItem(const XubString& rName, const basegfx::B2DPolyPolygon& rPolyPolygon)
2232cdf0e10cSrcweir :	NameOrIndex(XATTR_LINEEND, rName),
2233cdf0e10cSrcweir 	maPolyPolygon(rPolyPolygon)
2234cdf0e10cSrcweir {
2235cdf0e10cSrcweir }
2236cdf0e10cSrcweir 
2237cdf0e10cSrcweir /*************************************************************************
2238cdf0e10cSrcweir |*
2239cdf0e10cSrcweir |*	  XLineEndItem::XLineEndItem(const XLineEndItem& rItem)
2240cdf0e10cSrcweir |*
2241cdf0e10cSrcweir |*	  Beschreibung
2242cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
2243cdf0e10cSrcweir |*	  Letzte Aenderung	18.11.94
2244cdf0e10cSrcweir |*
2245cdf0e10cSrcweir *************************************************************************/
2246cdf0e10cSrcweir 
2247cdf0e10cSrcweir XLineEndItem::XLineEndItem(const XLineEndItem& rItem)
2248cdf0e10cSrcweir :	NameOrIndex(rItem),
2249cdf0e10cSrcweir 	maPolyPolygon(rItem.maPolyPolygon)
2250cdf0e10cSrcweir {
2251cdf0e10cSrcweir }
2252cdf0e10cSrcweir 
2253cdf0e10cSrcweir /*************************************************************************
2254cdf0e10cSrcweir |*
2255cdf0e10cSrcweir |*	  XLineEndItem::XLineEndItem(SvStream& rIn)
2256cdf0e10cSrcweir |*
2257cdf0e10cSrcweir |*	  Beschreibung
2258cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
2259cdf0e10cSrcweir |*	  Letzte Aenderung	17.11.94
2260cdf0e10cSrcweir |*
2261cdf0e10cSrcweir *************************************************************************/
2262cdf0e10cSrcweir 
2263cdf0e10cSrcweir XLineEndItem::XLineEndItem(SvStream& rIn) :
2264cdf0e10cSrcweir 	NameOrIndex(XATTR_LINEEND, rIn)
2265cdf0e10cSrcweir {
2266cdf0e10cSrcweir 	if (!IsIndex())
2267cdf0e10cSrcweir 	{
2268cdf0e10cSrcweir 		maPolyPolygon = streamInB2DPolyPolygon(rIn);
2269cdf0e10cSrcweir 	}
2270cdf0e10cSrcweir }
2271cdf0e10cSrcweir 
2272cdf0e10cSrcweir //*************************************************************************
2273cdf0e10cSrcweir 
2274cdf0e10cSrcweir XLineEndItem::XLineEndItem(SfxItemPool* /*pPool*/, const basegfx::B2DPolyPolygon& rPolyPolygon)
2275cdf0e10cSrcweir : 	NameOrIndex( XATTR_LINEEND, -1 ),
2276cdf0e10cSrcweir 	maPolyPolygon(rPolyPolygon)
2277cdf0e10cSrcweir {
2278cdf0e10cSrcweir }
2279cdf0e10cSrcweir 
2280cdf0e10cSrcweir //*************************************************************************
2281cdf0e10cSrcweir 
2282cdf0e10cSrcweir XLineEndItem::XLineEndItem(SfxItemPool* /*pPool*/)
2283cdf0e10cSrcweir :	NameOrIndex(XATTR_LINEEND, -1 )
2284cdf0e10cSrcweir {
2285cdf0e10cSrcweir }
2286cdf0e10cSrcweir 
2287cdf0e10cSrcweir /*************************************************************************
2288cdf0e10cSrcweir |*
2289cdf0e10cSrcweir |*	  XLineEndItem::Clone(SfxItemPool* pPool) const
2290cdf0e10cSrcweir |*
2291cdf0e10cSrcweir |*	  Beschreibung
2292cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
2293cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
2294cdf0e10cSrcweir |*
2295cdf0e10cSrcweir *************************************************************************/
2296cdf0e10cSrcweir 
2297cdf0e10cSrcweir SfxPoolItem* XLineEndItem::Clone(SfxItemPool* /*pPool*/) const
2298cdf0e10cSrcweir {
2299cdf0e10cSrcweir 	return new XLineEndItem(*this);
2300cdf0e10cSrcweir }
2301cdf0e10cSrcweir 
2302cdf0e10cSrcweir /*************************************************************************
2303cdf0e10cSrcweir |*
2304cdf0e10cSrcweir |*	  int XLineEndItem::operator==(const SfxPoolItem& rItem) const
2305cdf0e10cSrcweir |*
2306cdf0e10cSrcweir |*	  Beschreibung
2307cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
2308cdf0e10cSrcweir |*	  Letzte Aenderung	17.11.94
2309cdf0e10cSrcweir |*
2310cdf0e10cSrcweir *************************************************************************/
2311cdf0e10cSrcweir 
2312cdf0e10cSrcweir int XLineEndItem::operator==(const SfxPoolItem& rItem) const
2313cdf0e10cSrcweir {
2314cdf0e10cSrcweir 	return ( NameOrIndex::operator==(rItem) && ((const XLineEndItem&) rItem).maPolyPolygon == maPolyPolygon );
2315cdf0e10cSrcweir }
2316cdf0e10cSrcweir 
2317cdf0e10cSrcweir /*************************************************************************
2318cdf0e10cSrcweir |*
2319cdf0e10cSrcweir |*	  SfxPoolItem* XLineEndItem::Create(SvStream& rIn, sal_uInt16 nVer) const
2320cdf0e10cSrcweir |*
2321cdf0e10cSrcweir |*	  Beschreibung
2322cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
2323cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
2324cdf0e10cSrcweir |*
2325cdf0e10cSrcweir *************************************************************************/
2326cdf0e10cSrcweir 
2327cdf0e10cSrcweir SfxPoolItem* XLineEndItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
2328cdf0e10cSrcweir {
2329cdf0e10cSrcweir 	return new XLineEndItem(rIn);
2330cdf0e10cSrcweir }
2331cdf0e10cSrcweir 
2332cdf0e10cSrcweir /*************************************************************************
2333cdf0e10cSrcweir |*
2334cdf0e10cSrcweir |*	  SfxPoolItem* XLineEndItem::Store(SvStream& rOut) const
2335cdf0e10cSrcweir |*
2336cdf0e10cSrcweir |*	  Beschreibung
2337cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
2338cdf0e10cSrcweir |*	  Letzte Aenderung	17.11.94
2339cdf0e10cSrcweir |*
2340cdf0e10cSrcweir *************************************************************************/
2341cdf0e10cSrcweir 
2342cdf0e10cSrcweir SvStream& XLineEndItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const
2343cdf0e10cSrcweir {
2344cdf0e10cSrcweir 	NameOrIndex::Store( rOut, nItemVersion );
2345cdf0e10cSrcweir 
2346cdf0e10cSrcweir 	if (!IsIndex())
2347cdf0e10cSrcweir 	{
2348cdf0e10cSrcweir 		streamOutB2DPolyPolygon(maPolyPolygon, rOut);
2349cdf0e10cSrcweir 	}
2350cdf0e10cSrcweir 
2351cdf0e10cSrcweir 	return rOut;
2352cdf0e10cSrcweir }
2353cdf0e10cSrcweir 
2354cdf0e10cSrcweir /*************************************************************************
2355cdf0e10cSrcweir |*
235697e8a929SArmin Le Grand |*	  const basegfx::B2DPolyPolygon& XLineEndItem::GetValue(const XLineEndList* pTable) const
2357cdf0e10cSrcweir |*
2358cdf0e10cSrcweir |*	  Beschreibung
2359cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
2360cdf0e10cSrcweir |*	  Letzte Aenderung	18.11.94
2361cdf0e10cSrcweir |*
2362cdf0e10cSrcweir *************************************************************************/
2363cdf0e10cSrcweir 
236497e8a929SArmin Le Grand basegfx::B2DPolyPolygon XLineEndItem::GetLineEndValue(const XLineEndList* pTable) const
2365cdf0e10cSrcweir {
2366cdf0e10cSrcweir 	if (!IsIndex())
2367cdf0e10cSrcweir 	{
2368cdf0e10cSrcweir 		return maPolyPolygon;
2369cdf0e10cSrcweir 	}
2370cdf0e10cSrcweir 	else
2371cdf0e10cSrcweir 	{
2372cdf0e10cSrcweir 		return pTable->GetLineEnd(GetIndex())->GetLineEnd();
2373cdf0e10cSrcweir 	}
2374cdf0e10cSrcweir }
2375cdf0e10cSrcweir 
2376cdf0e10cSrcweir 
2377cdf0e10cSrcweir /** this function searches in both the models pool and the styles pool for XLineStartItem
2378cdf0e10cSrcweir 	and XLineEndItem with the same value or name and returns an item with the value of
2379cdf0e10cSrcweir 	this item and a unique name for an item with this value. */
2380cdf0e10cSrcweir XLineEndItem* XLineEndItem::checkForUniqueItem( SdrModel* pModel ) const
2381cdf0e10cSrcweir {
2382cdf0e10cSrcweir 	if( pModel )
2383cdf0e10cSrcweir 	{
2384cdf0e10cSrcweir 		XLineEndItem* pTempItem = NULL;
2385cdf0e10cSrcweir 		const XLineEndItem* pLineEndItem = this;
2386cdf0e10cSrcweir 
2387cdf0e10cSrcweir 		String aUniqueName( GetName() );
2388cdf0e10cSrcweir 
2389cdf0e10cSrcweir 		if( !maPolyPolygon.count() )
2390cdf0e10cSrcweir 		{
2391cdf0e10cSrcweir 			// if the polygon is empty, check if the name is empty
2392cdf0e10cSrcweir 			if( aUniqueName.Len() == 0 )
2393cdf0e10cSrcweir 				return (XLineEndItem*)this;
2394cdf0e10cSrcweir 
2395cdf0e10cSrcweir 			// force empty name for empty polygons
2396cdf0e10cSrcweir 			return new XLineEndItem( String(), maPolyPolygon );
2397cdf0e10cSrcweir 		}
2398cdf0e10cSrcweir 
2399cdf0e10cSrcweir 		if( maPolyPolygon.count() > 1L )
2400cdf0e10cSrcweir 		{
2401cdf0e10cSrcweir 			// check if the polygon is closed
2402cdf0e10cSrcweir 			if(!maPolyPolygon.isClosed())
2403cdf0e10cSrcweir 			{
2404cdf0e10cSrcweir 				// force a closed polygon
2405cdf0e10cSrcweir 				basegfx::B2DPolyPolygon aNew(maPolyPolygon);
2406cdf0e10cSrcweir 				aNew.setClosed(true);
2407cdf0e10cSrcweir 				pTempItem = new XLineEndItem( aUniqueName, aNew );
2408cdf0e10cSrcweir 				pLineEndItem = pTempItem;
2409cdf0e10cSrcweir 			}
2410cdf0e10cSrcweir 		}
2411cdf0e10cSrcweir 
2412cdf0e10cSrcweir 		sal_Bool bForceNew = sal_False;
2413cdf0e10cSrcweir 
2414cdf0e10cSrcweir 		// 2. if we have a name check if there is already an item with the
2415cdf0e10cSrcweir 		// same name in the documents pool with a different line end or start
2416cdf0e10cSrcweir 
2417cdf0e10cSrcweir 		sal_uInt16 nCount, nSurrogate;
2418cdf0e10cSrcweir 
2419cdf0e10cSrcweir 		const SfxItemPool* pPool1 = &pModel->GetItemPool();
2420cdf0e10cSrcweir 		if( aUniqueName.Len() && pPool1 )
2421cdf0e10cSrcweir 		{
2422cdf0e10cSrcweir 			nCount = pPool1->GetItemCount2( XATTR_LINESTART );
2423cdf0e10cSrcweir 
2424cdf0e10cSrcweir 			for( nSurrogate = 0; nSurrogate < nCount; nSurrogate++ )
2425cdf0e10cSrcweir 			{
2426cdf0e10cSrcweir 				const XLineStartItem* pItem = (const XLineStartItem*)pPool1->GetItem2( XATTR_LINESTART, nSurrogate );
2427cdf0e10cSrcweir 
2428cdf0e10cSrcweir 				if( pItem && ( pItem->GetName() == pLineEndItem->GetName() ) )
2429cdf0e10cSrcweir 				{
2430cdf0e10cSrcweir 					// if there is already an item with the same name and the same
2431cdf0e10cSrcweir 					// value its ok to set it
2432cdf0e10cSrcweir 					if( pItem->GetLineStartValue() != pLineEndItem->GetLineEndValue() )
2433cdf0e10cSrcweir 					{
2434cdf0e10cSrcweir 						// same name but different value, we need a new name for this item
2435cdf0e10cSrcweir 						aUniqueName = String();
2436cdf0e10cSrcweir 						bForceNew = sal_True;
2437cdf0e10cSrcweir 					}
2438cdf0e10cSrcweir 					break;
2439cdf0e10cSrcweir 				}
2440cdf0e10cSrcweir 			}
2441cdf0e10cSrcweir 
2442cdf0e10cSrcweir 			if( !bForceNew )
2443cdf0e10cSrcweir 			{
2444cdf0e10cSrcweir 				nCount = pPool1->GetItemCount2( XATTR_LINEEND );
2445cdf0e10cSrcweir 
2446cdf0e10cSrcweir 				for( nSurrogate = 0; nSurrogate < nCount; nSurrogate++ )
2447cdf0e10cSrcweir 				{
2448cdf0e10cSrcweir 					const XLineEndItem* pItem = (const XLineEndItem*)pPool1->GetItem2( XATTR_LINEEND, nSurrogate );
2449cdf0e10cSrcweir 
2450cdf0e10cSrcweir 					if( pItem && ( pItem->GetName() == pLineEndItem->GetName() ) )
2451cdf0e10cSrcweir 					{
2452cdf0e10cSrcweir 						// if there is already an item with the same name and the same
2453cdf0e10cSrcweir 						// value its ok to set it
2454cdf0e10cSrcweir 						if( pItem->GetLineEndValue() != pLineEndItem->GetLineEndValue() )
2455cdf0e10cSrcweir 						{
2456cdf0e10cSrcweir 							// same name but different value, we need a new name for this item
2457cdf0e10cSrcweir 							aUniqueName = String();
2458cdf0e10cSrcweir 							bForceNew = sal_True;
2459cdf0e10cSrcweir 						}
2460cdf0e10cSrcweir 						break;
2461cdf0e10cSrcweir 					}
2462cdf0e10cSrcweir 				}
2463cdf0e10cSrcweir 			}
2464cdf0e10cSrcweir 		}
2465cdf0e10cSrcweir 
2466cdf0e10cSrcweir 		const SfxItemPool* pPool2 = pModel->GetStyleSheetPool() ? &pModel->GetStyleSheetPool()->GetPool() : NULL;
2467cdf0e10cSrcweir 		if( aUniqueName.Len() && pPool2)
2468cdf0e10cSrcweir 		{
2469cdf0e10cSrcweir 			nCount = pPool2->GetItemCount2( XATTR_LINESTART );
2470cdf0e10cSrcweir 			for( nSurrogate = 0; nSurrogate < nCount; nSurrogate++ )
2471cdf0e10cSrcweir 			{
2472cdf0e10cSrcweir 				const XLineStartItem* pItem = (const XLineStartItem*)pPool2->GetItem2( XATTR_LINESTART, nSurrogate );
2473cdf0e10cSrcweir 
2474cdf0e10cSrcweir 				if( pItem && ( pItem->GetName() == pLineEndItem->GetName() ) )
2475cdf0e10cSrcweir 				{
2476cdf0e10cSrcweir 					// if there is already an item with the same name and the same
2477cdf0e10cSrcweir 					// value its ok to set it
2478cdf0e10cSrcweir 					if( pItem->GetLineStartValue() != pLineEndItem->GetLineEndValue() )
2479cdf0e10cSrcweir 					{
2480cdf0e10cSrcweir 						// same name but different value, we need a new name for this item
2481cdf0e10cSrcweir 						aUniqueName = String();
2482cdf0e10cSrcweir 						bForceNew = sal_True;
2483cdf0e10cSrcweir 					}
2484cdf0e10cSrcweir 					break;
2485cdf0e10cSrcweir 				}
2486cdf0e10cSrcweir 			}
2487cdf0e10cSrcweir 
2488cdf0e10cSrcweir 			if( !bForceNew )
2489cdf0e10cSrcweir 			{
2490cdf0e10cSrcweir 				nCount = pPool2->GetItemCount2( XATTR_LINEEND );
2491cdf0e10cSrcweir 				for( nSurrogate = 0; nSurrogate < nCount; nSurrogate++ )
2492cdf0e10cSrcweir 				{
2493cdf0e10cSrcweir 					const XLineEndItem* pItem = (const XLineEndItem*)pPool2->GetItem2( XATTR_LINEEND, nSurrogate );
2494cdf0e10cSrcweir 
2495cdf0e10cSrcweir 					if( pItem && ( pItem->GetName() == pLineEndItem->GetName() ) )
2496cdf0e10cSrcweir 					{
2497cdf0e10cSrcweir 						// if there is already an item with the same name and the same
2498cdf0e10cSrcweir 						// value its ok to set it
2499cdf0e10cSrcweir 						if( pItem->GetLineEndValue() != pLineEndItem->GetLineEndValue() )
2500cdf0e10cSrcweir 						{
2501cdf0e10cSrcweir 							// same name but different value, we need a new name for this item
2502cdf0e10cSrcweir 							aUniqueName = String();
2503cdf0e10cSrcweir 							bForceNew = sal_True;
2504cdf0e10cSrcweir 						}
2505cdf0e10cSrcweir 						break;
2506cdf0e10cSrcweir 					}
2507cdf0e10cSrcweir 				}
2508cdf0e10cSrcweir 			}
2509cdf0e10cSrcweir 		}
2510cdf0e10cSrcweir 
2511cdf0e10cSrcweir 		// if we have no name yet, find existing item with same conent or
2512cdf0e10cSrcweir 		// create a unique name
2513cdf0e10cSrcweir 		if( aUniqueName.Len() == 0 )
2514cdf0e10cSrcweir 		{
2515cdf0e10cSrcweir 			sal_Bool bFoundExisting = sal_False;
2516cdf0e10cSrcweir 
2517cdf0e10cSrcweir 			sal_Int32 nUserIndex = 1;
2518cdf0e10cSrcweir 			const ResId aRes(SVX_RES(RID_SVXSTR_LINEEND));
2519cdf0e10cSrcweir 			const String aUser( aRes );
2520cdf0e10cSrcweir 
2521cdf0e10cSrcweir 			if( pPool1 )
2522cdf0e10cSrcweir 			{
2523cdf0e10cSrcweir 				nCount = pPool1->GetItemCount2( XATTR_LINESTART );
2524cdf0e10cSrcweir 				sal_uInt32 nSurrogate2;
2525cdf0e10cSrcweir 
2526cdf0e10cSrcweir 				for( nSurrogate2 = 0; nSurrogate2 < nCount; nSurrogate2++ )
2527cdf0e10cSrcweir 				{
2528cdf0e10cSrcweir 					const XLineStartItem* pItem = (const XLineStartItem*)pPool1->GetItem2( XATTR_LINESTART, nSurrogate2 );
2529cdf0e10cSrcweir 
2530cdf0e10cSrcweir 					if( pItem && pItem->GetName().Len() )
2531cdf0e10cSrcweir 					{
2532cdf0e10cSrcweir 						if( !bForceNew && pItem->GetLineStartValue() == pLineEndItem->GetLineEndValue() )
2533cdf0e10cSrcweir 						{
2534cdf0e10cSrcweir 							aUniqueName = pItem->GetName();
2535cdf0e10cSrcweir 							bFoundExisting = sal_True;
2536cdf0e10cSrcweir 							break;
2537cdf0e10cSrcweir 						}
2538cdf0e10cSrcweir 
2539cdf0e10cSrcweir 						if( pItem->GetName().CompareTo( aUser, aUser.Len() ) == 0 )
2540cdf0e10cSrcweir 						{
2541cdf0e10cSrcweir 							sal_Int32 nThisIndex = pItem->GetName().Copy( aUser.Len() ).ToInt32();
2542cdf0e10cSrcweir 							if( nThisIndex >= nUserIndex )
2543cdf0e10cSrcweir 								nUserIndex = nThisIndex + 1;
2544cdf0e10cSrcweir 						}
2545cdf0e10cSrcweir 					}
2546cdf0e10cSrcweir 				}
2547cdf0e10cSrcweir 
2548cdf0e10cSrcweir 				nCount = pPool1->GetItemCount2( XATTR_LINEEND );
2549cdf0e10cSrcweir 				for( nSurrogate2 = 0; nSurrogate2 < nCount; nSurrogate2++ )
2550cdf0e10cSrcweir 				{
2551cdf0e10cSrcweir 					const XLineEndItem* pItem = (const XLineEndItem*)pPool1->GetItem2( XATTR_LINEEND, nSurrogate2 );
2552cdf0e10cSrcweir 
2553cdf0e10cSrcweir 					if( pItem && pItem->GetName().Len() )
2554cdf0e10cSrcweir 					{
2555cdf0e10cSrcweir 						if( !bForceNew && pItem->GetLineEndValue() == pLineEndItem->GetLineEndValue() )
2556cdf0e10cSrcweir 						{
2557cdf0e10cSrcweir 							aUniqueName = pItem->GetName();
2558cdf0e10cSrcweir 							bFoundExisting = sal_True;
2559cdf0e10cSrcweir 							break;
2560cdf0e10cSrcweir 						}
2561cdf0e10cSrcweir 
2562cdf0e10cSrcweir 						if( pItem->GetName().CompareTo( aUser, aUser.Len() ) == 0 )
2563cdf0e10cSrcweir 						{
2564cdf0e10cSrcweir 							sal_Int32 nThisIndex = pItem->GetName().Copy( aUser.Len() ).ToInt32();
2565cdf0e10cSrcweir 							if( nThisIndex >= nUserIndex )
2566cdf0e10cSrcweir 								nUserIndex = nThisIndex + 1;
2567cdf0e10cSrcweir 						}
2568cdf0e10cSrcweir 					}
2569cdf0e10cSrcweir 				}
2570cdf0e10cSrcweir 			}
2571cdf0e10cSrcweir 
2572cdf0e10cSrcweir 			if( !bFoundExisting )
2573cdf0e10cSrcweir 			{
2574cdf0e10cSrcweir 				aUniqueName = aUser;
2575cdf0e10cSrcweir 				aUniqueName += sal_Unicode(' ');
2576cdf0e10cSrcweir 				aUniqueName += String::CreateFromInt32( nUserIndex );
2577cdf0e10cSrcweir 			}
2578cdf0e10cSrcweir 		}
2579cdf0e10cSrcweir 
2580cdf0e10cSrcweir 		// if the given name is not valid, replace it!
2581cdf0e10cSrcweir 		if( aUniqueName != GetName() || pTempItem )
2582cdf0e10cSrcweir 		{
2583cdf0e10cSrcweir 			if( pTempItem )
2584cdf0e10cSrcweir 			{
2585cdf0e10cSrcweir 				pTempItem->SetName( aUniqueName );
2586cdf0e10cSrcweir 				return pTempItem;
2587cdf0e10cSrcweir 			}
2588cdf0e10cSrcweir 			else
2589cdf0e10cSrcweir 			{
2590cdf0e10cSrcweir 				return new XLineEndItem( aUniqueName, maPolyPolygon );
2591cdf0e10cSrcweir 			}
2592cdf0e10cSrcweir 		}
2593cdf0e10cSrcweir 	}
2594cdf0e10cSrcweir 
2595cdf0e10cSrcweir 	return (XLineEndItem*)this;
2596cdf0e10cSrcweir }
2597cdf0e10cSrcweir 
2598cdf0e10cSrcweir 
2599cdf0e10cSrcweir //------------------------------------------------------------------------
2600cdf0e10cSrcweir 
2601cdf0e10cSrcweir SfxItemPresentation XLineEndItem::GetPresentation
2602cdf0e10cSrcweir (
2603cdf0e10cSrcweir 	SfxItemPresentation ePres,
2604cdf0e10cSrcweir 	SfxMapUnit			/*eCoreUnit*/,
2605cdf0e10cSrcweir 	SfxMapUnit			/*ePresUnit*/,
2606cdf0e10cSrcweir     XubString&          rText, const IntlWrapper *
2607cdf0e10cSrcweir )	const
2608cdf0e10cSrcweir {
2609cdf0e10cSrcweir 	switch ( ePres )
2610cdf0e10cSrcweir 	{
2611cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NONE:
2612cdf0e10cSrcweir 			rText.Erase();
2613cdf0e10cSrcweir 			return ePres;
2614cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NAMELESS:
2615cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_COMPLETE:
2616cdf0e10cSrcweir 			rText = GetName();
2617cdf0e10cSrcweir 			return ePres;
2618cdf0e10cSrcweir 		default:
2619cdf0e10cSrcweir 			return SFX_ITEM_PRESENTATION_NONE;
2620cdf0e10cSrcweir 	}
2621cdf0e10cSrcweir }
2622cdf0e10cSrcweir 
2623cdf0e10cSrcweir sal_Bool XLineEndItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const
2624cdf0e10cSrcweir {
2625cdf0e10cSrcweir //    sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
2626cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
2627cdf0e10cSrcweir 	if( nMemberId == MID_NAME )
2628cdf0e10cSrcweir 	{
2629cdf0e10cSrcweir 		rtl::OUString aApiName;
2630cdf0e10cSrcweir 		SvxUnogetApiNameForItem( Which(), GetName(), aApiName );
2631cdf0e10cSrcweir 		rVal <<= aApiName;
2632cdf0e10cSrcweir 	}
2633cdf0e10cSrcweir 	else
2634cdf0e10cSrcweir 	{
2635cdf0e10cSrcweir 		com::sun::star::drawing::PolyPolygonBezierCoords aBezier;
2636cdf0e10cSrcweir 		SvxConvertB2DPolyPolygonToPolyPolygonBezier( maPolyPolygon, aBezier );
2637cdf0e10cSrcweir 		rVal <<= aBezier;
2638cdf0e10cSrcweir 	}
2639cdf0e10cSrcweir 	return sal_True;
2640cdf0e10cSrcweir }
2641cdf0e10cSrcweir 
2642cdf0e10cSrcweir sal_Bool XLineEndItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId )
2643cdf0e10cSrcweir {
2644cdf0e10cSrcweir //    sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
2645cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
2646cdf0e10cSrcweir 	if( nMemberId == MID_NAME )
2647cdf0e10cSrcweir 	{
2648cdf0e10cSrcweir 		return sal_False;
2649cdf0e10cSrcweir 	}
2650cdf0e10cSrcweir 	else
2651cdf0e10cSrcweir 	{
2652cdf0e10cSrcweir 		maPolyPolygon.clear();
2653cdf0e10cSrcweir 
2654cdf0e10cSrcweir 		if( rVal.hasValue() && rVal.getValue() )
2655cdf0e10cSrcweir 		{
2656cdf0e10cSrcweir 			if( rVal.getValueType() != ::getCppuType((const com::sun::star::drawing::PolyPolygonBezierCoords*)0) )
2657cdf0e10cSrcweir 				return sal_False;
2658cdf0e10cSrcweir 
2659cdf0e10cSrcweir 			com::sun::star::drawing::PolyPolygonBezierCoords* pCoords = (com::sun::star::drawing::PolyPolygonBezierCoords*)rVal.getValue();
2660cdf0e10cSrcweir 			if( pCoords->Coordinates.getLength() > 0 )
2661cdf0e10cSrcweir 			{
2662cdf0e10cSrcweir 				maPolyPolygon = SvxConvertPolyPolygonBezierToB2DPolyPolygon( pCoords );
2663cdf0e10cSrcweir 				// #i72807# close line start/end polygons hard
2664cdf0e10cSrcweir 				// maPolyPolygon.setClosed(true);
2665cdf0e10cSrcweir 			}
2666cdf0e10cSrcweir 		}
2667cdf0e10cSrcweir 	}
2668cdf0e10cSrcweir 
2669cdf0e10cSrcweir 	return sal_True;
2670cdf0e10cSrcweir }
2671cdf0e10cSrcweir 
2672cdf0e10cSrcweir // ----------------------------
2673cdf0e10cSrcweir // class XLineStartWidthItem
2674cdf0e10cSrcweir // ----------------------------
2675cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XLineStartWidthItem, SfxMetricItem);
2676cdf0e10cSrcweir 
2677cdf0e10cSrcweir /*************************************************************************
2678cdf0e10cSrcweir |*
2679cdf0e10cSrcweir |*	  XLineStartWidthItem::XLineStartWidthItem(sal_Int32 nWidth)
2680cdf0e10cSrcweir |*
2681cdf0e10cSrcweir |*	  Beschreibung
2682cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
2683cdf0e10cSrcweir |*	  Letzte Aenderung	18.11.94
2684cdf0e10cSrcweir |*
2685cdf0e10cSrcweir *************************************************************************/
2686cdf0e10cSrcweir 
2687cdf0e10cSrcweir XLineStartWidthItem::XLineStartWidthItem(long nWidth) :
2688cdf0e10cSrcweir 	SfxMetricItem(XATTR_LINESTARTWIDTH, nWidth)
2689cdf0e10cSrcweir {
2690cdf0e10cSrcweir }
2691cdf0e10cSrcweir 
2692cdf0e10cSrcweir /*************************************************************************
2693cdf0e10cSrcweir |*
2694cdf0e10cSrcweir |*	  XLineStartWidthItem::XLineStartWidthItem(SvStream& rIn)
2695cdf0e10cSrcweir |*
2696cdf0e10cSrcweir |*	  Beschreibung
2697cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
2698cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
2699cdf0e10cSrcweir |*
2700cdf0e10cSrcweir *************************************************************************/
2701cdf0e10cSrcweir 
2702cdf0e10cSrcweir XLineStartWidthItem::XLineStartWidthItem(SvStream& rIn) :
2703cdf0e10cSrcweir 	SfxMetricItem(XATTR_LINESTARTWIDTH, rIn)
2704cdf0e10cSrcweir {
2705cdf0e10cSrcweir }
2706cdf0e10cSrcweir 
2707cdf0e10cSrcweir /*************************************************************************
2708cdf0e10cSrcweir |*
2709cdf0e10cSrcweir |*	  XLineStartWidthItem::Clone(SfxItemPool* pPool) const
2710cdf0e10cSrcweir |*
2711cdf0e10cSrcweir |*	  Beschreibung
2712cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
2713cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
2714cdf0e10cSrcweir |*
2715cdf0e10cSrcweir *************************************************************************/
2716cdf0e10cSrcweir 
2717cdf0e10cSrcweir SfxPoolItem* XLineStartWidthItem::Clone(SfxItemPool* /*pPool*/) const
2718cdf0e10cSrcweir {
2719cdf0e10cSrcweir 	return new XLineStartWidthItem(*this);
2720cdf0e10cSrcweir }
2721cdf0e10cSrcweir 
2722cdf0e10cSrcweir /*************************************************************************
2723cdf0e10cSrcweir |*
2724cdf0e10cSrcweir |*	  SfxPoolItem* XLineStartWidthItem::Create(SvStream& rIn, sal_uInt16 nVer)
2725cdf0e10cSrcweir |*												const
2726cdf0e10cSrcweir |*
2727cdf0e10cSrcweir |*	  Beschreibung
2728cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
2729cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
2730cdf0e10cSrcweir |*
2731cdf0e10cSrcweir *************************************************************************/
2732cdf0e10cSrcweir 
2733cdf0e10cSrcweir SfxPoolItem* XLineStartWidthItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
2734cdf0e10cSrcweir {
2735cdf0e10cSrcweir 	return new XLineStartWidthItem(rIn);
2736cdf0e10cSrcweir }
2737cdf0e10cSrcweir 
2738cdf0e10cSrcweir //------------------------------------------------------------------------
2739cdf0e10cSrcweir 
2740cdf0e10cSrcweir SfxItemPresentation XLineStartWidthItem::GetPresentation
2741cdf0e10cSrcweir (
2742cdf0e10cSrcweir 	SfxItemPresentation ePres,
2743cdf0e10cSrcweir 	SfxMapUnit			eCoreUnit,
2744cdf0e10cSrcweir 	SfxMapUnit			ePresUnit,
2745cdf0e10cSrcweir     XubString&          rText, const IntlWrapper * pIntl
2746cdf0e10cSrcweir )	const
2747cdf0e10cSrcweir {
2748cdf0e10cSrcweir 	switch ( ePres )
2749cdf0e10cSrcweir 	{
2750cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NONE:
2751cdf0e10cSrcweir 			rText.Erase();
2752cdf0e10cSrcweir 			return ePres;
2753cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NAMELESS:
2754cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_COMPLETE:
2755cdf0e10cSrcweir 			rText = GetMetricText( (long) GetValue(),
2756cdf0e10cSrcweir                                     eCoreUnit, ePresUnit, pIntl);
2757cdf0e10cSrcweir 			rText += SVX_RESSTR( GetMetricId( ePresUnit) );
2758cdf0e10cSrcweir 			return ePres;
2759cdf0e10cSrcweir 		default:
2760cdf0e10cSrcweir 			return SFX_ITEM_PRESENTATION_NONE;
2761cdf0e10cSrcweir 	}
2762cdf0e10cSrcweir }
2763cdf0e10cSrcweir 
2764cdf0e10cSrcweir sal_Bool XLineStartWidthItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
2765cdf0e10cSrcweir {
2766cdf0e10cSrcweir 	rVal <<= (sal_Int32)GetValue();
2767cdf0e10cSrcweir 	return sal_True;
2768cdf0e10cSrcweir }
2769cdf0e10cSrcweir 
2770cdf0e10cSrcweir sal_Bool XLineStartWidthItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/)
2771cdf0e10cSrcweir {
2772cdf0e10cSrcweir 	sal_Int32 nValue = 0;
2773cdf0e10cSrcweir 	rVal >>= nValue;
2774cdf0e10cSrcweir 	SetValue( nValue );
2775cdf0e10cSrcweir 	return sal_True;
2776cdf0e10cSrcweir }
2777cdf0e10cSrcweir 
2778cdf0e10cSrcweir 
2779cdf0e10cSrcweir 
2780cdf0e10cSrcweir // --------------------------
2781cdf0e10cSrcweir // class XLineEndWidthItem
2782cdf0e10cSrcweir // --------------------------
2783cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XLineEndWidthItem, SfxMetricItem);
2784cdf0e10cSrcweir 
2785cdf0e10cSrcweir /*************************************************************************
2786cdf0e10cSrcweir |*
2787cdf0e10cSrcweir |*	  XLineEndWidthItem::XLineEndWidthItem(long nWidth)
2788cdf0e10cSrcweir |*
2789cdf0e10cSrcweir |*	  Beschreibung
2790cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
2791cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
2792cdf0e10cSrcweir |*
2793cdf0e10cSrcweir *************************************************************************/
2794cdf0e10cSrcweir 
2795cdf0e10cSrcweir XLineEndWidthItem::XLineEndWidthItem(long nWidth) :
2796cdf0e10cSrcweir    SfxMetricItem(XATTR_LINEENDWIDTH, nWidth)
2797cdf0e10cSrcweir {
2798cdf0e10cSrcweir }
2799cdf0e10cSrcweir 
2800cdf0e10cSrcweir /*************************************************************************
2801cdf0e10cSrcweir |*
2802cdf0e10cSrcweir |*	  XLineEndWidthItem::XLineEndWidthItem(SvStream& rIn)
2803cdf0e10cSrcweir |*
2804cdf0e10cSrcweir |*	  Beschreibung
2805cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
2806cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
2807cdf0e10cSrcweir |*
2808cdf0e10cSrcweir *************************************************************************/
2809cdf0e10cSrcweir 
2810cdf0e10cSrcweir XLineEndWidthItem::XLineEndWidthItem(SvStream& rIn) :
2811cdf0e10cSrcweir 	SfxMetricItem(XATTR_LINEENDWIDTH, rIn)
2812cdf0e10cSrcweir {
2813cdf0e10cSrcweir }
2814cdf0e10cSrcweir 
2815cdf0e10cSrcweir /*************************************************************************
2816cdf0e10cSrcweir |*
2817cdf0e10cSrcweir |*	  XLineEndWidthItem::Clone(SfxItemPool* pPool) const
2818cdf0e10cSrcweir |*
2819cdf0e10cSrcweir |*	  Beschreibung
2820cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
2821cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
2822cdf0e10cSrcweir |*
2823cdf0e10cSrcweir *************************************************************************/
2824cdf0e10cSrcweir 
2825cdf0e10cSrcweir SfxPoolItem* XLineEndWidthItem::Clone(SfxItemPool* /*pPool*/) const
2826cdf0e10cSrcweir {
2827cdf0e10cSrcweir 	return new XLineEndWidthItem(*this);
2828cdf0e10cSrcweir }
2829cdf0e10cSrcweir 
2830cdf0e10cSrcweir /*************************************************************************
2831cdf0e10cSrcweir |*
2832cdf0e10cSrcweir |*	  SfxPoolItem* XLineEndWidthItem::Create(SvStream& rIn, sal_uInt16 nVer) const
2833cdf0e10cSrcweir |*
2834cdf0e10cSrcweir |*	  Beschreibung
2835cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
2836cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
2837cdf0e10cSrcweir |*
2838cdf0e10cSrcweir *************************************************************************/
2839cdf0e10cSrcweir 
2840cdf0e10cSrcweir SfxPoolItem* XLineEndWidthItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
2841cdf0e10cSrcweir {
2842cdf0e10cSrcweir 	return new XLineEndWidthItem(rIn);
2843cdf0e10cSrcweir }
2844cdf0e10cSrcweir 
2845cdf0e10cSrcweir //------------------------------------------------------------------------
2846cdf0e10cSrcweir 
2847cdf0e10cSrcweir SfxItemPresentation XLineEndWidthItem::GetPresentation
2848cdf0e10cSrcweir (
2849cdf0e10cSrcweir 	SfxItemPresentation ePres,
2850cdf0e10cSrcweir 	SfxMapUnit			eCoreUnit,
2851cdf0e10cSrcweir 	SfxMapUnit			ePresUnit,
2852cdf0e10cSrcweir     XubString&          rText, const IntlWrapper *pIntl
2853cdf0e10cSrcweir )	const
2854cdf0e10cSrcweir {
2855cdf0e10cSrcweir 	switch ( ePres )
2856cdf0e10cSrcweir 	{
2857cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NONE:
2858cdf0e10cSrcweir 			rText.Erase();
2859cdf0e10cSrcweir 			return ePres;
2860cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NAMELESS:
2861cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_COMPLETE:
2862cdf0e10cSrcweir 			rText = GetMetricText( (long) GetValue(),
2863cdf0e10cSrcweir                                     eCoreUnit, ePresUnit, pIntl);
2864cdf0e10cSrcweir 			rText += SVX_RESSTR( GetMetricId( ePresUnit) );
2865cdf0e10cSrcweir 			return ePres;
2866cdf0e10cSrcweir 		default:
2867cdf0e10cSrcweir 			return SFX_ITEM_PRESENTATION_NONE;
2868cdf0e10cSrcweir 	}
2869cdf0e10cSrcweir }
2870cdf0e10cSrcweir 
2871cdf0e10cSrcweir sal_Bool XLineEndWidthItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
2872cdf0e10cSrcweir {
2873cdf0e10cSrcweir 	rVal <<= (sal_Int32)GetValue();
2874cdf0e10cSrcweir 	return sal_True;
2875cdf0e10cSrcweir }
2876cdf0e10cSrcweir 
2877cdf0e10cSrcweir sal_Bool XLineEndWidthItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/)
2878cdf0e10cSrcweir {
2879cdf0e10cSrcweir 	sal_Int32 nValue = 0;
2880cdf0e10cSrcweir 	rVal >>= nValue;
2881cdf0e10cSrcweir 	SetValue( nValue );
2882cdf0e10cSrcweir 	return sal_True;
2883cdf0e10cSrcweir }
2884cdf0e10cSrcweir 
2885cdf0e10cSrcweir 
2886cdf0e10cSrcweir // -----------------------------
2887cdf0e10cSrcweir // class XLineStartCenterItem
2888cdf0e10cSrcweir // -----------------------------
2889cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XLineStartCenterItem, SfxBoolItem);
2890cdf0e10cSrcweir 
2891cdf0e10cSrcweir /*************************************************************************
2892cdf0e10cSrcweir |*
2893cdf0e10cSrcweir |*	  XLineStartCenterItem::XLineStartCenterItem(sal_Bool bStartCenter)
2894cdf0e10cSrcweir |*
2895cdf0e10cSrcweir |*	  Beschreibung
2896cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
2897cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
2898cdf0e10cSrcweir |*
2899cdf0e10cSrcweir *************************************************************************/
2900cdf0e10cSrcweir 
2901cdf0e10cSrcweir XLineStartCenterItem::XLineStartCenterItem(sal_Bool bStartCenter) :
2902cdf0e10cSrcweir 	SfxBoolItem(XATTR_LINESTARTCENTER, bStartCenter)
2903cdf0e10cSrcweir {
2904cdf0e10cSrcweir }
2905cdf0e10cSrcweir 
2906cdf0e10cSrcweir /*************************************************************************
2907cdf0e10cSrcweir |*
2908cdf0e10cSrcweir |*	  XLineStartCenterItem::XLineStartCenterItem(SvStream& rIn)
2909cdf0e10cSrcweir |*
2910cdf0e10cSrcweir |*	  Beschreibung
2911cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
2912cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
2913cdf0e10cSrcweir |*
2914cdf0e10cSrcweir *************************************************************************/
2915cdf0e10cSrcweir 
2916cdf0e10cSrcweir XLineStartCenterItem::XLineStartCenterItem(SvStream& rIn) :
2917cdf0e10cSrcweir 	SfxBoolItem(XATTR_LINESTARTCENTER, rIn)
2918cdf0e10cSrcweir {
2919cdf0e10cSrcweir }
2920cdf0e10cSrcweir 
2921cdf0e10cSrcweir /*************************************************************************
2922cdf0e10cSrcweir |*
2923cdf0e10cSrcweir |*	  XLineStartCenterItem::Clone(SfxItemPool* pPool) const
2924cdf0e10cSrcweir |*
2925cdf0e10cSrcweir |*	  Beschreibung
2926cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
2927cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
2928cdf0e10cSrcweir |*
2929cdf0e10cSrcweir *************************************************************************/
2930cdf0e10cSrcweir 
2931cdf0e10cSrcweir SfxPoolItem* XLineStartCenterItem::Clone(SfxItemPool* /*pPool*/) const
2932cdf0e10cSrcweir {
2933cdf0e10cSrcweir 	return new XLineStartCenterItem(*this);
2934cdf0e10cSrcweir }
2935cdf0e10cSrcweir 
2936cdf0e10cSrcweir /*************************************************************************
2937cdf0e10cSrcweir |*
2938cdf0e10cSrcweir |*	  SfxPoolItem* XLineStartCenterItem::Create(SvStream& rIn, sal_uInt16 nVer)
2939cdf0e10cSrcweir |*												const
2940cdf0e10cSrcweir |*
2941cdf0e10cSrcweir |*	  Beschreibung
2942cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
2943cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
2944cdf0e10cSrcweir |*
2945cdf0e10cSrcweir *************************************************************************/
2946cdf0e10cSrcweir 
2947cdf0e10cSrcweir SfxPoolItem* XLineStartCenterItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
2948cdf0e10cSrcweir {
2949cdf0e10cSrcweir 	return new XLineStartCenterItem(rIn);
2950cdf0e10cSrcweir }
2951cdf0e10cSrcweir 
2952cdf0e10cSrcweir //------------------------------------------------------------------------
2953cdf0e10cSrcweir 
2954cdf0e10cSrcweir SfxItemPresentation XLineStartCenterItem::GetPresentation
2955cdf0e10cSrcweir (
2956cdf0e10cSrcweir 	SfxItemPresentation ePres,
2957cdf0e10cSrcweir 	SfxMapUnit			/*eCoreUnit*/,
2958cdf0e10cSrcweir 	SfxMapUnit			/*ePresUnit*/,
2959cdf0e10cSrcweir     XubString&          rText, const IntlWrapper *
2960cdf0e10cSrcweir )	const
2961cdf0e10cSrcweir {
2962cdf0e10cSrcweir 	switch ( ePres )
2963cdf0e10cSrcweir 	{
2964cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NONE:
2965cdf0e10cSrcweir 			rText.Erase();
2966cdf0e10cSrcweir 			return ePres;
2967cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NAMELESS:
2968cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_COMPLETE:
2969cdf0e10cSrcweir 			rText = XubString( ResId( GetValue() ? RID_SVXSTR_CENTERED :
2970cdf0e10cSrcweir 							RID_SVXSTR_NOTCENTERED, DIALOG_MGR() ) );
2971cdf0e10cSrcweir 			return ePres;
2972cdf0e10cSrcweir 		default:
2973cdf0e10cSrcweir 			return SFX_ITEM_PRESENTATION_NONE;
2974cdf0e10cSrcweir 	}
2975cdf0e10cSrcweir }
2976cdf0e10cSrcweir 
2977cdf0e10cSrcweir sal_Bool XLineStartCenterItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
2978cdf0e10cSrcweir {
2979cdf0e10cSrcweir 	sal_Bool bValue = GetValue();
2980cdf0e10cSrcweir 	rVal.setValue( &bValue, ::getCppuBooleanType()  );
2981cdf0e10cSrcweir 	return sal_True;
2982cdf0e10cSrcweir }
2983cdf0e10cSrcweir 
2984cdf0e10cSrcweir sal_Bool XLineStartCenterItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/)
2985cdf0e10cSrcweir {
2986cdf0e10cSrcweir 	if( !rVal.hasValue() || rVal.getValueType() != ::getCppuBooleanType() )
2987cdf0e10cSrcweir 		return sal_False;
2988cdf0e10cSrcweir 
2989cdf0e10cSrcweir 	SetValue( *(sal_Bool*)rVal.getValue() );
2990cdf0e10cSrcweir 	return sal_True;
2991cdf0e10cSrcweir }
2992cdf0e10cSrcweir 
2993cdf0e10cSrcweir 
2994cdf0e10cSrcweir // ---------------------------
2995cdf0e10cSrcweir // class XLineEndCenterItem
2996cdf0e10cSrcweir // ---------------------------
2997cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XLineEndCenterItem, SfxBoolItem);
2998cdf0e10cSrcweir 
2999cdf0e10cSrcweir /*************************************************************************
3000cdf0e10cSrcweir |*
3001cdf0e10cSrcweir |*	  XLineEndCenterItem::XLineEndCenterItem(sal_Bool bEndCenter)
3002cdf0e10cSrcweir |*
3003cdf0e10cSrcweir |*	  Beschreibung
3004cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
3005cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
3006cdf0e10cSrcweir |*
3007cdf0e10cSrcweir *************************************************************************/
3008cdf0e10cSrcweir 
3009cdf0e10cSrcweir XLineEndCenterItem::XLineEndCenterItem(sal_Bool bEndCenter) :
3010cdf0e10cSrcweir 	SfxBoolItem(XATTR_LINEENDCENTER, bEndCenter)
3011cdf0e10cSrcweir {
3012cdf0e10cSrcweir }
3013cdf0e10cSrcweir 
3014cdf0e10cSrcweir /*************************************************************************
3015cdf0e10cSrcweir |*
3016cdf0e10cSrcweir |*	  XLineEndCenterItem::XLineEndCenterItem(SvStream& rIn)
3017cdf0e10cSrcweir |*
3018cdf0e10cSrcweir |*	  Beschreibung
3019cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
3020cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
3021cdf0e10cSrcweir |*
3022cdf0e10cSrcweir *************************************************************************/
3023cdf0e10cSrcweir 
3024cdf0e10cSrcweir XLineEndCenterItem::XLineEndCenterItem(SvStream& rIn) :
3025cdf0e10cSrcweir 	SfxBoolItem(XATTR_LINEENDCENTER, rIn)
3026cdf0e10cSrcweir {
3027cdf0e10cSrcweir }
3028cdf0e10cSrcweir 
3029cdf0e10cSrcweir /*************************************************************************
3030cdf0e10cSrcweir |*
3031cdf0e10cSrcweir |*	  XLineEndCenterItem::Clone(SfxItemPool* pPool) const
3032cdf0e10cSrcweir |*
3033cdf0e10cSrcweir |*	  Beschreibung
3034cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
3035cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
3036cdf0e10cSrcweir |*
3037cdf0e10cSrcweir *************************************************************************/
3038cdf0e10cSrcweir 
3039cdf0e10cSrcweir SfxPoolItem* XLineEndCenterItem::Clone(SfxItemPool* /*pPool*/) const
3040cdf0e10cSrcweir {
3041cdf0e10cSrcweir 	return new XLineEndCenterItem(*this);
3042cdf0e10cSrcweir }
3043cdf0e10cSrcweir 
3044cdf0e10cSrcweir /*************************************************************************
3045cdf0e10cSrcweir |*
3046cdf0e10cSrcweir |*	  SfxPoolItem* XLineEndCenterItem::Create(SvStream& rIn, sal_uInt16 nVer)
3047cdf0e10cSrcweir |*												const
3048cdf0e10cSrcweir |*
3049cdf0e10cSrcweir |*	  Beschreibung
3050cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
3051cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
3052cdf0e10cSrcweir |*
3053cdf0e10cSrcweir *************************************************************************/
3054cdf0e10cSrcweir 
3055cdf0e10cSrcweir SfxPoolItem* XLineEndCenterItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
3056cdf0e10cSrcweir {
3057cdf0e10cSrcweir 	return new XLineEndCenterItem(rIn);
3058cdf0e10cSrcweir }
3059cdf0e10cSrcweir 
3060cdf0e10cSrcweir //------------------------------------------------------------------------
3061cdf0e10cSrcweir 
3062cdf0e10cSrcweir SfxItemPresentation XLineEndCenterItem::GetPresentation
3063cdf0e10cSrcweir (
3064cdf0e10cSrcweir 	SfxItemPresentation ePres,
3065cdf0e10cSrcweir 	SfxMapUnit			/*eCoreUnit*/,
3066cdf0e10cSrcweir 	SfxMapUnit			/*ePresUnit*/,
3067cdf0e10cSrcweir     XubString&          rText, const IntlWrapper *
3068cdf0e10cSrcweir )	const
3069cdf0e10cSrcweir {
3070cdf0e10cSrcweir 	switch ( ePres )
3071cdf0e10cSrcweir 	{
3072cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NONE:
3073cdf0e10cSrcweir 			rText.Erase();
3074cdf0e10cSrcweir 			return ePres;
3075cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NAMELESS:
3076cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_COMPLETE:
3077cdf0e10cSrcweir 			rText = XubString( ResId( GetValue() ? RID_SVXSTR_CENTERED :
3078cdf0e10cSrcweir 							RID_SVXSTR_NOTCENTERED, DIALOG_MGR() ) );
3079cdf0e10cSrcweir 			return ePres;
3080cdf0e10cSrcweir 		default:
3081cdf0e10cSrcweir 			return SFX_ITEM_PRESENTATION_NONE;
3082cdf0e10cSrcweir 	}
3083cdf0e10cSrcweir }
3084cdf0e10cSrcweir 
3085cdf0e10cSrcweir sal_Bool XLineEndCenterItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
3086cdf0e10cSrcweir {
3087cdf0e10cSrcweir 	sal_Bool bValue = GetValue();
3088cdf0e10cSrcweir 	rVal.setValue( &bValue, ::getCppuBooleanType()  );
3089cdf0e10cSrcweir 	return sal_True;
3090cdf0e10cSrcweir }
3091cdf0e10cSrcweir 
3092cdf0e10cSrcweir sal_Bool XLineEndCenterItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/)
3093cdf0e10cSrcweir {
3094cdf0e10cSrcweir 	if( !rVal.hasValue() || rVal.getValueType() != ::getCppuBooleanType() )
3095cdf0e10cSrcweir 		return sal_False;
3096cdf0e10cSrcweir 
3097cdf0e10cSrcweir 	SetValue( *(sal_Bool*)rVal.getValue() );
3098cdf0e10cSrcweir 	return sal_True;
3099cdf0e10cSrcweir }
3100cdf0e10cSrcweir 
3101cdf0e10cSrcweir 
3102cdf0e10cSrcweir //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3103cdf0e10cSrcweir //							 Fuellattribute
3104cdf0e10cSrcweir //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3105cdf0e10cSrcweir 
3106cdf0e10cSrcweir // --------------------
3107cdf0e10cSrcweir // class XFillStyleItem
3108cdf0e10cSrcweir // --------------------
3109cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFillStyleItem, SfxEnumItem);
3110cdf0e10cSrcweir 
3111cdf0e10cSrcweir /*************************************************************************
3112cdf0e10cSrcweir |*
3113cdf0e10cSrcweir |*	  XFillStyleItem::XFillStyleItem(XFillStyle eFillStyle)
3114cdf0e10cSrcweir |*
3115cdf0e10cSrcweir |*	  Beschreibung
3116cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
3117cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
3118cdf0e10cSrcweir |*
3119cdf0e10cSrcweir *************************************************************************/
3120cdf0e10cSrcweir 
3121cdf0e10cSrcweir XFillStyleItem::XFillStyleItem(XFillStyle eFillStyle) :
3122cdf0e10cSrcweir 	SfxEnumItem(XATTR_FILLSTYLE, sal::static_int_cast< sal_uInt16 >(eFillStyle))
3123cdf0e10cSrcweir {
3124cdf0e10cSrcweir }
3125cdf0e10cSrcweir 
3126cdf0e10cSrcweir /*************************************************************************
3127cdf0e10cSrcweir |*
3128cdf0e10cSrcweir |*	  XFillStyleItem::XFillStyleItem(SvStream& rIn)
3129cdf0e10cSrcweir |*
3130cdf0e10cSrcweir |*	  Beschreibung
3131cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
3132cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
3133cdf0e10cSrcweir |*
3134cdf0e10cSrcweir *************************************************************************/
3135cdf0e10cSrcweir 
3136cdf0e10cSrcweir XFillStyleItem::XFillStyleItem(SvStream& rIn) :
3137cdf0e10cSrcweir 	SfxEnumItem(XATTR_FILLSTYLE, rIn)
3138cdf0e10cSrcweir {
3139cdf0e10cSrcweir }
3140cdf0e10cSrcweir 
3141cdf0e10cSrcweir /*************************************************************************
3142cdf0e10cSrcweir |*
3143cdf0e10cSrcweir |*	  XFillStyleItem::Clone(SfxItemPool* pPool) const
3144cdf0e10cSrcweir |*
3145cdf0e10cSrcweir |*	  Beschreibung
3146cdf0e10cSrcweir |*	  Ersterstellung	09.11.94
3147cdf0e10cSrcweir |*	  Letzte Aenderung	09.11.94
3148cdf0e10cSrcweir |*
3149cdf0e10cSrcweir *************************************************************************/
3150cdf0e10cSrcweir 
3151cdf0e10cSrcweir SfxPoolItem* XFillStyleItem::Clone(SfxItemPool* /*pPool*/) const
3152cdf0e10cSrcweir {
3153cdf0e10cSrcweir 	return new XFillStyleItem( *this );
3154cdf0e10cSrcweir }
3155cdf0e10cSrcweir 
3156cdf0e10cSrcweir /*************************************************************************
3157cdf0e10cSrcweir |*
3158cdf0e10cSrcweir |*	  SfxPoolItem* XFillStyleItem::Create(SvStream& rIn, sal_uInt16 nVer) const
3159cdf0e10cSrcweir |*
3160cdf0e10cSrcweir |*	  Beschreibung
3161cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
3162cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
3163cdf0e10cSrcweir |*
3164cdf0e10cSrcweir *************************************************************************/
3165cdf0e10cSrcweir 
3166cdf0e10cSrcweir SfxPoolItem* XFillStyleItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
3167cdf0e10cSrcweir {
3168cdf0e10cSrcweir 	return new XFillStyleItem(rIn);
3169cdf0e10cSrcweir }
3170cdf0e10cSrcweir 
3171cdf0e10cSrcweir //------------------------------------------------------------------------
3172cdf0e10cSrcweir 
3173cdf0e10cSrcweir SfxItemPresentation XFillStyleItem::GetPresentation
3174cdf0e10cSrcweir (
3175cdf0e10cSrcweir 	SfxItemPresentation ePres,
3176cdf0e10cSrcweir 	SfxMapUnit			/*eCoreUnit*/,
3177cdf0e10cSrcweir 	SfxMapUnit			/*ePresUnit*/,
3178cdf0e10cSrcweir     XubString&          rText, const IntlWrapper *
3179cdf0e10cSrcweir )	const
3180cdf0e10cSrcweir {
3181cdf0e10cSrcweir 	rText.Erase();
3182cdf0e10cSrcweir 
3183cdf0e10cSrcweir 	switch ( ePres )
3184cdf0e10cSrcweir 	{
3185cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NONE:
3186cdf0e10cSrcweir 			return ePres;
3187cdf0e10cSrcweir 
3188cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NAMELESS:
3189cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_COMPLETE:
3190cdf0e10cSrcweir 		{
3191cdf0e10cSrcweir 			sal_uInt16 nId = 0;
3192cdf0e10cSrcweir 
3193cdf0e10cSrcweir 			switch( (sal_uInt16)GetValue() )
3194cdf0e10cSrcweir 			{
3195cdf0e10cSrcweir 				case XFILL_NONE:
3196cdf0e10cSrcweir 					nId = RID_SVXSTR_INVISIBLE;
3197cdf0e10cSrcweir 					break;
3198cdf0e10cSrcweir 				case XFILL_SOLID:
3199cdf0e10cSrcweir 					nId = RID_SVXSTR_SOLID;
3200cdf0e10cSrcweir 					break;
3201cdf0e10cSrcweir 				case XFILL_GRADIENT:
3202cdf0e10cSrcweir 					nId = RID_SVXSTR_GRADIENT;
3203cdf0e10cSrcweir 					break;
3204cdf0e10cSrcweir 				case XFILL_HATCH:
3205cdf0e10cSrcweir 					nId = RID_SVXSTR_HATCH;
3206cdf0e10cSrcweir 					break;
3207cdf0e10cSrcweir 				case XFILL_BITMAP:
3208cdf0e10cSrcweir 					nId = RID_SVXSTR_BITMAP;
3209cdf0e10cSrcweir 					break;
3210cdf0e10cSrcweir 			}
3211cdf0e10cSrcweir 
3212cdf0e10cSrcweir 			if ( nId )
3213cdf0e10cSrcweir 				rText = SVX_RESSTR( nId );
3214cdf0e10cSrcweir 			return ePres;
3215cdf0e10cSrcweir 		}
3216cdf0e10cSrcweir 		default:
3217cdf0e10cSrcweir 			return SFX_ITEM_PRESENTATION_NONE;
3218cdf0e10cSrcweir 	}
3219cdf0e10cSrcweir }
3220cdf0e10cSrcweir 
3221cdf0e10cSrcweir //------------------------------------------------------------------------
3222cdf0e10cSrcweir 
3223cdf0e10cSrcweir sal_uInt16 XFillStyleItem::GetValueCount() const
3224cdf0e10cSrcweir {
3225cdf0e10cSrcweir 	return 5;
3226cdf0e10cSrcweir }
3227cdf0e10cSrcweir 
3228cdf0e10cSrcweir // -----------------------------------------------------------------------
3229cdf0e10cSrcweir sal_Bool XFillStyleItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
3230cdf0e10cSrcweir {
3231cdf0e10cSrcweir 	::com::sun::star::drawing::FillStyle eFS = (::com::sun::star::drawing::FillStyle)GetValue();
3232cdf0e10cSrcweir 
3233cdf0e10cSrcweir 	rVal <<= eFS;
3234cdf0e10cSrcweir 
3235cdf0e10cSrcweir 	return sal_True;
3236cdf0e10cSrcweir }
3237cdf0e10cSrcweir 
3238cdf0e10cSrcweir // -----------------------------------------------------------------------
3239cdf0e10cSrcweir sal_Bool XFillStyleItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/)
3240cdf0e10cSrcweir {
3241cdf0e10cSrcweir     ::com::sun::star::drawing::FillStyle eFS;
3242cdf0e10cSrcweir 	if(!(rVal >>= eFS))
3243cdf0e10cSrcweir     {
3244cdf0e10cSrcweir         // also try an int (for Basic)
3245cdf0e10cSrcweir         sal_Int32 nFS = 0;
3246cdf0e10cSrcweir         if(!(rVal >>= nFS))
3247cdf0e10cSrcweir             return sal_False;
3248cdf0e10cSrcweir         eFS = (::com::sun::star::drawing::FillStyle)nFS;
3249cdf0e10cSrcweir     }
3250cdf0e10cSrcweir 
3251cdf0e10cSrcweir 	SetValue( sal::static_int_cast< sal_uInt16 >( eFS ) );
3252cdf0e10cSrcweir 
3253cdf0e10cSrcweir 	return sal_True;
3254cdf0e10cSrcweir }
3255cdf0e10cSrcweir 
3256cdf0e10cSrcweir 
3257cdf0e10cSrcweir // -------------------
3258cdf0e10cSrcweir // class XFillColorItem
3259cdf0e10cSrcweir // -------------------
3260cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFillColorItem, XColorItem);
3261cdf0e10cSrcweir 
3262cdf0e10cSrcweir /*************************************************************************
3263cdf0e10cSrcweir |*
3264cdf0e10cSrcweir |*	  XFillColorItem::XFillColorItem(sal_Int32 nIndex, const Color& rTheColor)
3265cdf0e10cSrcweir |*
3266cdf0e10cSrcweir |*	  Beschreibung
3267cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
3268cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
3269cdf0e10cSrcweir |*
3270cdf0e10cSrcweir *************************************************************************/
3271cdf0e10cSrcweir 
3272cdf0e10cSrcweir XFillColorItem::XFillColorItem(sal_Int32 nIndex, const Color& rTheColor) :
3273cdf0e10cSrcweir 	XColorItem(XATTR_FILLCOLOR, nIndex, rTheColor)
3274cdf0e10cSrcweir {
3275cdf0e10cSrcweir }
3276cdf0e10cSrcweir 
3277cdf0e10cSrcweir /*************************************************************************
3278cdf0e10cSrcweir |*
3279cdf0e10cSrcweir |*	  XFillColorItem::XFillColorItem(const XubString& rName, const Color& rTheColor)
3280cdf0e10cSrcweir |*
3281cdf0e10cSrcweir |*	  Beschreibung
3282cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
3283cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
3284cdf0e10cSrcweir |*
3285cdf0e10cSrcweir *************************************************************************/
3286cdf0e10cSrcweir 
3287cdf0e10cSrcweir XFillColorItem::XFillColorItem(const XubString& rName, const Color& rTheColor) :
3288cdf0e10cSrcweir 	XColorItem(XATTR_FILLCOLOR, rName, rTheColor)
3289cdf0e10cSrcweir {
3290cdf0e10cSrcweir }
3291cdf0e10cSrcweir 
3292cdf0e10cSrcweir /*************************************************************************
3293cdf0e10cSrcweir |*
3294cdf0e10cSrcweir |*	  XFillColorItem::XFillColorItem(SvStream& rIn)
3295cdf0e10cSrcweir |*
3296cdf0e10cSrcweir |*	  Beschreibung
3297cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
3298cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
3299cdf0e10cSrcweir |*
3300cdf0e10cSrcweir *************************************************************************/
3301cdf0e10cSrcweir 
3302cdf0e10cSrcweir XFillColorItem::XFillColorItem(SvStream& rIn) :
3303cdf0e10cSrcweir 	XColorItem(XATTR_FILLCOLOR, rIn)
3304cdf0e10cSrcweir {
3305cdf0e10cSrcweir }
3306cdf0e10cSrcweir 
3307cdf0e10cSrcweir /*************************************************************************
3308cdf0e10cSrcweir |*
3309cdf0e10cSrcweir |*	  XFillColorItem::Clone(SfxItemPool* pPool) const
3310cdf0e10cSrcweir |*
3311cdf0e10cSrcweir |*	  Beschreibung
3312cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
3313cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
3314cdf0e10cSrcweir |*
3315cdf0e10cSrcweir *************************************************************************/
3316cdf0e10cSrcweir 
3317cdf0e10cSrcweir SfxPoolItem* XFillColorItem::Clone(SfxItemPool* /*pPool*/) const
3318cdf0e10cSrcweir {
3319cdf0e10cSrcweir 	return new XFillColorItem(*this);
3320cdf0e10cSrcweir }
3321cdf0e10cSrcweir 
3322cdf0e10cSrcweir /*************************************************************************
3323cdf0e10cSrcweir |*
3324cdf0e10cSrcweir |*	  SfxPoolItem* XFillColorItem::Create(SvStream& rIn, sal_uInt16 nVer) const
3325cdf0e10cSrcweir |*
3326cdf0e10cSrcweir |*	  Beschreibung
3327cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
3328cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
3329cdf0e10cSrcweir |*
3330cdf0e10cSrcweir *************************************************************************/
3331cdf0e10cSrcweir 
3332cdf0e10cSrcweir SfxPoolItem* XFillColorItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
3333cdf0e10cSrcweir {
3334cdf0e10cSrcweir 	return new XFillColorItem(rIn);
3335cdf0e10cSrcweir }
3336cdf0e10cSrcweir 
3337cdf0e10cSrcweir //------------------------------------------------------------------------
3338cdf0e10cSrcweir 
3339cdf0e10cSrcweir SfxItemPresentation XFillColorItem::GetPresentation
3340cdf0e10cSrcweir (
3341cdf0e10cSrcweir 	SfxItemPresentation ePres,
3342cdf0e10cSrcweir 	SfxMapUnit			/*eCoreUnit*/,
3343cdf0e10cSrcweir 	SfxMapUnit			/*ePresUnit*/,
3344cdf0e10cSrcweir     XubString&          rText, const IntlWrapper *
3345cdf0e10cSrcweir )	const
3346cdf0e10cSrcweir {
3347cdf0e10cSrcweir 	switch ( ePres )
3348cdf0e10cSrcweir 	{
3349cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NONE:
3350cdf0e10cSrcweir 			rText.Erase();
3351cdf0e10cSrcweir 			return ePres;
3352cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NAMELESS:
3353cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_COMPLETE:
3354cdf0e10cSrcweir 			rText = GetName();
3355cdf0e10cSrcweir 			return ePres;
3356cdf0e10cSrcweir 		default:
3357cdf0e10cSrcweir 			return SFX_ITEM_PRESENTATION_NONE;
3358cdf0e10cSrcweir 	}
3359cdf0e10cSrcweir }
3360cdf0e10cSrcweir 
3361cdf0e10cSrcweir // -----------------------------------------------------------------------
3362cdf0e10cSrcweir 
3363cdf0e10cSrcweir sal_Bool XFillColorItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
3364cdf0e10cSrcweir {
3365cdf0e10cSrcweir     rVal <<= (sal_Int32)GetColorValue().GetRGBColor();
3366cdf0e10cSrcweir 
3367cdf0e10cSrcweir 	return sal_True;
3368cdf0e10cSrcweir }
3369cdf0e10cSrcweir 
3370cdf0e10cSrcweir // -----------------------------------------------------------------------
3371cdf0e10cSrcweir 
3372cdf0e10cSrcweir sal_Bool XFillColorItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/)
3373cdf0e10cSrcweir {
3374cdf0e10cSrcweir 	sal_Int32 nValue = 0;
3375cdf0e10cSrcweir 	if(!(rVal >>= nValue ))
3376cdf0e10cSrcweir 		return sal_False;
3377cdf0e10cSrcweir 
3378cdf0e10cSrcweir 	SetColorValue( nValue );
3379cdf0e10cSrcweir 	return sal_True;
3380cdf0e10cSrcweir }
3381cdf0e10cSrcweir 
3382cdf0e10cSrcweir // -----------------------------
3383cdf0e10cSrcweir // class XSecondaryFillColorItem
3384cdf0e10cSrcweir // -----------------------------
3385cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XSecondaryFillColorItem, XColorItem);
3386cdf0e10cSrcweir 
3387cdf0e10cSrcweir XSecondaryFillColorItem::XSecondaryFillColorItem(sal_Int32 nIndex, const Color& rTheColor) :
3388cdf0e10cSrcweir 	XColorItem(XATTR_SECONDARYFILLCOLOR, nIndex, rTheColor)
3389cdf0e10cSrcweir {
3390cdf0e10cSrcweir }
3391cdf0e10cSrcweir 
3392cdf0e10cSrcweir XSecondaryFillColorItem::XSecondaryFillColorItem(const XubString& rName, const Color& rTheColor) :
3393cdf0e10cSrcweir 	XColorItem(XATTR_SECONDARYFILLCOLOR, rName, rTheColor)
3394cdf0e10cSrcweir {
3395cdf0e10cSrcweir }
3396cdf0e10cSrcweir 
3397cdf0e10cSrcweir XSecondaryFillColorItem::XSecondaryFillColorItem( SvStream& rIn ) :
3398cdf0e10cSrcweir 	XColorItem(XATTR_SECONDARYFILLCOLOR, rIn)
3399cdf0e10cSrcweir {
3400cdf0e10cSrcweir }
3401cdf0e10cSrcweir 
3402cdf0e10cSrcweir SfxPoolItem* XSecondaryFillColorItem::Clone(SfxItemPool* /*pPool*/) const
3403cdf0e10cSrcweir {
3404cdf0e10cSrcweir 	return new XSecondaryFillColorItem(*this);
3405cdf0e10cSrcweir }
3406cdf0e10cSrcweir 
3407cdf0e10cSrcweir SfxPoolItem* XSecondaryFillColorItem::Create( SvStream& rIn, sal_uInt16 nVer ) const
3408cdf0e10cSrcweir {
3409cdf0e10cSrcweir 	if ( nVer >= 2 )
3410cdf0e10cSrcweir 		return new XSecondaryFillColorItem( rIn );
3411cdf0e10cSrcweir 	else
3412cdf0e10cSrcweir 		return new XSecondaryFillColorItem( String(), Color(0,184,255) );
3413cdf0e10cSrcweir }
3414cdf0e10cSrcweir sal_uInt16 XSecondaryFillColorItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/ ) const
3415cdf0e10cSrcweir {
3416cdf0e10cSrcweir 	return 2;
3417cdf0e10cSrcweir }
3418cdf0e10cSrcweir SfxItemPresentation XSecondaryFillColorItem::GetPresentation
3419cdf0e10cSrcweir (
3420cdf0e10cSrcweir 	SfxItemPresentation ePres,
3421cdf0e10cSrcweir 	SfxMapUnit			/*eCoreUnit*/,
3422cdf0e10cSrcweir 	SfxMapUnit			/*ePresUnit*/,
3423cdf0e10cSrcweir     XubString&          rText, const IntlWrapper *
3424cdf0e10cSrcweir )	const
3425cdf0e10cSrcweir {
3426cdf0e10cSrcweir 	switch ( ePres )
3427cdf0e10cSrcweir 	{
3428cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NONE:
3429cdf0e10cSrcweir 			rText.Erase();
3430cdf0e10cSrcweir 			return ePres;
3431cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NAMELESS:
3432cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_COMPLETE:
3433cdf0e10cSrcweir 			rText = GetName();
3434cdf0e10cSrcweir 			return ePres;
3435cdf0e10cSrcweir 		default:
3436cdf0e10cSrcweir 			return SFX_ITEM_PRESENTATION_NONE;
3437cdf0e10cSrcweir 	}
3438cdf0e10cSrcweir }
3439cdf0e10cSrcweir 
3440cdf0e10cSrcweir // ----------------
3441cdf0e10cSrcweir // class XGradient
3442cdf0e10cSrcweir // ----------------
3443cdf0e10cSrcweir 
3444cdf0e10cSrcweir /*************************************************************************
3445cdf0e10cSrcweir |*
3446cdf0e10cSrcweir |*    XGradient::XGradient()
3447cdf0e10cSrcweir |*
3448cdf0e10cSrcweir *************************************************************************/
3449cdf0e10cSrcweir 
3450cdf0e10cSrcweir XGradient::XGradient() :
3451cdf0e10cSrcweir     eStyle( XGRAD_LINEAR ),
3452cdf0e10cSrcweir     aStartColor( Color( COL_BLACK ) ),
3453cdf0e10cSrcweir     aEndColor( Color( COL_WHITE ) ),
3454cdf0e10cSrcweir     nAngle( 0 ),
3455cdf0e10cSrcweir     nBorder( 0 ),
3456cdf0e10cSrcweir     nOfsX( 50 ),
3457cdf0e10cSrcweir     nOfsY( 50 ),
3458cdf0e10cSrcweir     nIntensStart( 100 ),
3459cdf0e10cSrcweir     nIntensEnd( 100 ),
3460cdf0e10cSrcweir     nStepCount( 0 )
3461cdf0e10cSrcweir {
3462cdf0e10cSrcweir }
3463cdf0e10cSrcweir 
3464cdf0e10cSrcweir /*************************************************************************
3465cdf0e10cSrcweir |*
3466cdf0e10cSrcweir |*    XGradient::XGradient(XGradientStyle, const Color&, const Color&,
3467cdf0e10cSrcweir |*                         long, sal_uInt16, sal_uInt16, sal_uInt16)
3468cdf0e10cSrcweir |*
3469cdf0e10cSrcweir |*    Beschreibung
3470cdf0e10cSrcweir |*    Ersterstellung    21.11.94
3471cdf0e10cSrcweir |*    Letzte Aenderung  21.11.94
3472cdf0e10cSrcweir |*
3473cdf0e10cSrcweir *************************************************************************/
3474cdf0e10cSrcweir 
3475cdf0e10cSrcweir XGradient::XGradient(const Color& rStart, const Color& rEnd,
3476cdf0e10cSrcweir 					 XGradientStyle eTheStyle, long nTheAngle, sal_uInt16 nXOfs,
3477cdf0e10cSrcweir 					 sal_uInt16 nYOfs, sal_uInt16 nTheBorder,
3478cdf0e10cSrcweir 					 sal_uInt16 nStartIntens, sal_uInt16 nEndIntens,
3479cdf0e10cSrcweir 					 sal_uInt16 nSteps) :
3480cdf0e10cSrcweir 	eStyle(eTheStyle),
3481cdf0e10cSrcweir 	aStartColor(rStart),
3482cdf0e10cSrcweir 	aEndColor(rEnd),
3483cdf0e10cSrcweir 	nAngle(nTheAngle),
3484cdf0e10cSrcweir 	nBorder(nTheBorder),
3485cdf0e10cSrcweir 	nOfsX(nXOfs),
3486cdf0e10cSrcweir 	nOfsY(nYOfs),
3487cdf0e10cSrcweir 	nIntensStart(nStartIntens),
3488cdf0e10cSrcweir 	nIntensEnd(nEndIntens),
3489cdf0e10cSrcweir 	nStepCount(nSteps)
3490cdf0e10cSrcweir {
3491cdf0e10cSrcweir }
3492cdf0e10cSrcweir 
3493cdf0e10cSrcweir /*************************************************************************
3494cdf0e10cSrcweir |*
3495cdf0e10cSrcweir |*	  int XGradient::operator==(const SfxPoolItem& rItem) const
3496cdf0e10cSrcweir |*
3497cdf0e10cSrcweir |*	  Beschreibung
3498cdf0e10cSrcweir |*	  Ersterstellung	29.11.94
3499cdf0e10cSrcweir |*	  Letzte Aenderung	29.11.94
3500cdf0e10cSrcweir |*
3501cdf0e10cSrcweir *************************************************************************/
3502cdf0e10cSrcweir 
3503cdf0e10cSrcweir bool XGradient::operator==(const XGradient& rGradient) const
3504cdf0e10cSrcweir {
3505cdf0e10cSrcweir 	return ( eStyle 		== rGradient.eStyle 		&&
3506cdf0e10cSrcweir 			 aStartColor	== rGradient.aStartColor	&&
3507cdf0e10cSrcweir 			 aEndColor		== rGradient.aEndColor		&&
3508cdf0e10cSrcweir 			 nAngle 		== rGradient.nAngle 		&&
3509cdf0e10cSrcweir 			 nBorder		== rGradient.nBorder		&&
3510cdf0e10cSrcweir 			 nOfsX			== rGradient.nOfsX			&&
3511cdf0e10cSrcweir 			 nOfsY			== rGradient.nOfsY			&&
3512cdf0e10cSrcweir 			 nIntensStart	== rGradient.nIntensStart	&&
3513cdf0e10cSrcweir 			 nIntensEnd		== rGradient.nIntensEnd		&&
3514cdf0e10cSrcweir 			 nStepCount		== rGradient.nStepCount );
3515cdf0e10cSrcweir }
3516cdf0e10cSrcweir 
3517cdf0e10cSrcweir 
3518cdf0e10cSrcweir // -----------------------
3519cdf0e10cSrcweir // class XFillGradientItem
3520cdf0e10cSrcweir // -----------------------
3521cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFillGradientItem, NameOrIndex);
3522cdf0e10cSrcweir 
3523cdf0e10cSrcweir /*************************************************************************
3524cdf0e10cSrcweir |*
3525cdf0e10cSrcweir |*	  XFillGradientItem::XFillGradientItem(sal_Int32 nIndex,
3526cdf0e10cSrcweir |*										 const XGradient& rTheGradient)
3527cdf0e10cSrcweir |*
3528cdf0e10cSrcweir |*	  Beschreibung
3529cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
3530cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
3531cdf0e10cSrcweir |*
3532cdf0e10cSrcweir *************************************************************************/
3533cdf0e10cSrcweir 
3534cdf0e10cSrcweir XFillGradientItem::XFillGradientItem(sal_Int32 nIndex,
3535cdf0e10cSrcweir 								   const XGradient& rTheGradient) :
3536cdf0e10cSrcweir 	NameOrIndex(XATTR_FILLGRADIENT, nIndex),
3537cdf0e10cSrcweir 	aGradient(rTheGradient)
3538cdf0e10cSrcweir {
3539cdf0e10cSrcweir }
3540cdf0e10cSrcweir 
3541cdf0e10cSrcweir /*************************************************************************
3542cdf0e10cSrcweir |*
3543cdf0e10cSrcweir |*	  XFillGradientItem::XFillGradientItem(const XubString& rName,
3544cdf0e10cSrcweir |*										 const XGradient& rTheGradient)
3545cdf0e10cSrcweir |*
3546cdf0e10cSrcweir |*	  Beschreibung
3547cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
3548cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
3549cdf0e10cSrcweir |*
3550cdf0e10cSrcweir *************************************************************************/
3551cdf0e10cSrcweir 
3552cdf0e10cSrcweir XFillGradientItem::XFillGradientItem(const XubString& rName,
3553cdf0e10cSrcweir 								   const XGradient& rTheGradient) :
3554cdf0e10cSrcweir 	NameOrIndex(XATTR_FILLGRADIENT, rName),
3555cdf0e10cSrcweir 	aGradient(rTheGradient)
3556cdf0e10cSrcweir {
3557cdf0e10cSrcweir }
3558cdf0e10cSrcweir 
3559cdf0e10cSrcweir /*************************************************************************
3560cdf0e10cSrcweir |*
3561cdf0e10cSrcweir |*	  XFillGradientItem::XFillGradientItem(const XFillGradientItem& rItem)
3562cdf0e10cSrcweir |*
3563cdf0e10cSrcweir |*	  Beschreibung
3564cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
3565cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
3566cdf0e10cSrcweir |*
3567cdf0e10cSrcweir *************************************************************************/
3568cdf0e10cSrcweir 
3569cdf0e10cSrcweir XFillGradientItem::XFillGradientItem(const XFillGradientItem& rItem) :
3570cdf0e10cSrcweir 	NameOrIndex(rItem),
3571cdf0e10cSrcweir 	aGradient(rItem.aGradient)
3572cdf0e10cSrcweir {
3573cdf0e10cSrcweir }
3574cdf0e10cSrcweir 
3575cdf0e10cSrcweir /*************************************************************************
3576cdf0e10cSrcweir |*
3577cdf0e10cSrcweir |*	  XFillGradientItem::XFillGradientItem(SvStream& rIn)
3578cdf0e10cSrcweir |*
3579cdf0e10cSrcweir |*	  Beschreibung
3580cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
3581cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
3582cdf0e10cSrcweir |*
3583cdf0e10cSrcweir *************************************************************************/
3584cdf0e10cSrcweir 
3585cdf0e10cSrcweir XFillGradientItem::XFillGradientItem(SvStream& rIn, sal_uInt16 nVer) :
3586cdf0e10cSrcweir 	NameOrIndex(XATTR_FILLGRADIENT, rIn),
3587cdf0e10cSrcweir 	aGradient(COL_BLACK, COL_WHITE)
3588cdf0e10cSrcweir {
3589cdf0e10cSrcweir 	if (!IsIndex())
3590cdf0e10cSrcweir 	{
3591cdf0e10cSrcweir 		sal_uInt16 nUSTemp;
3592cdf0e10cSrcweir 		sal_uInt16 nRed;
3593cdf0e10cSrcweir 		sal_uInt16 nGreen;
3594cdf0e10cSrcweir 		sal_uInt16 nBlue;
3595cdf0e10cSrcweir 		sal_Int16  nITemp;
3596cdf0e10cSrcweir 		sal_Int32  nLTemp;
3597cdf0e10cSrcweir 
3598cdf0e10cSrcweir 		rIn >> nITemp; aGradient.SetGradientStyle((XGradientStyle)nITemp);
3599cdf0e10cSrcweir 		rIn >> nRed;
3600cdf0e10cSrcweir 		rIn >> nGreen;
3601cdf0e10cSrcweir 		rIn >> nBlue;
3602cdf0e10cSrcweir 		Color aCol;
3603cdf0e10cSrcweir 		aCol = Color( (sal_uInt8)( nRed >> 8 ), (sal_uInt8)( nGreen >> 8 ), (sal_uInt8)( nBlue >> 8 ) );
3604cdf0e10cSrcweir 		aGradient.SetStartColor( aCol );
3605cdf0e10cSrcweir 
3606cdf0e10cSrcweir 		rIn >> nRed;
3607cdf0e10cSrcweir 		rIn >> nGreen;
3608cdf0e10cSrcweir 		rIn >> nBlue;
3609cdf0e10cSrcweir 		aCol = Color( (sal_uInt8)( nRed >> 8 ), (sal_uInt8)( nGreen >> 8 ), (sal_uInt8)( nBlue >> 8 ) );
3610cdf0e10cSrcweir 		aGradient.SetEndColor(aCol);
3611cdf0e10cSrcweir 		rIn >> nLTemp; aGradient.SetAngle(nLTemp);
3612cdf0e10cSrcweir 		rIn >> nUSTemp; aGradient.SetBorder(nUSTemp);
3613cdf0e10cSrcweir 		rIn >> nUSTemp; aGradient.SetXOffset(nUSTemp);
3614cdf0e10cSrcweir 		rIn >> nUSTemp; aGradient.SetYOffset(nUSTemp);
3615cdf0e10cSrcweir 		rIn >> nUSTemp; aGradient.SetStartIntens(nUSTemp);
3616cdf0e10cSrcweir 		rIn >> nUSTemp; aGradient.SetEndIntens(nUSTemp);
3617cdf0e10cSrcweir 
3618cdf0e10cSrcweir 		// bei neueren Versionen wird zusaetzlich
3619cdf0e10cSrcweir 		// die Schrittweite mit eingelesen
3620cdf0e10cSrcweir 		if (nVer >= 1)
3621cdf0e10cSrcweir 		{
3622cdf0e10cSrcweir 			rIn >> nUSTemp; aGradient.SetSteps(nUSTemp);
3623cdf0e10cSrcweir 		}
3624cdf0e10cSrcweir 	}
3625cdf0e10cSrcweir }
3626cdf0e10cSrcweir 
3627cdf0e10cSrcweir //*************************************************************************
3628cdf0e10cSrcweir 
3629cdf0e10cSrcweir XFillGradientItem::XFillGradientItem(SfxItemPool* /*pPool*/, const XGradient& rTheGradient)
3630cdf0e10cSrcweir : 	NameOrIndex( XATTR_FILLGRADIENT, -1 ),
3631cdf0e10cSrcweir 	aGradient(rTheGradient)
3632cdf0e10cSrcweir {
3633cdf0e10cSrcweir }
3634cdf0e10cSrcweir 
3635cdf0e10cSrcweir //*************************************************************************
3636cdf0e10cSrcweir 
3637cdf0e10cSrcweir XFillGradientItem::XFillGradientItem(SfxItemPool* /*pPool*/)
3638cdf0e10cSrcweir : NameOrIndex(XATTR_FILLGRADIENT, -1 )
3639cdf0e10cSrcweir {
3640cdf0e10cSrcweir }
3641cdf0e10cSrcweir 
3642cdf0e10cSrcweir /*************************************************************************
3643cdf0e10cSrcweir |*
3644cdf0e10cSrcweir |*	  XFillGradientItem::Clone(SfxItemPool* pPool) const
3645cdf0e10cSrcweir |*
3646cdf0e10cSrcweir |*	  Beschreibung
3647cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
3648cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
3649cdf0e10cSrcweir |*
3650cdf0e10cSrcweir *************************************************************************/
3651cdf0e10cSrcweir 
3652cdf0e10cSrcweir SfxPoolItem* XFillGradientItem::Clone(SfxItemPool* /*pPool*/) const
3653cdf0e10cSrcweir {
3654cdf0e10cSrcweir 	return new XFillGradientItem(*this);
3655cdf0e10cSrcweir }
3656cdf0e10cSrcweir 
3657cdf0e10cSrcweir /*************************************************************************
3658cdf0e10cSrcweir |*
3659cdf0e10cSrcweir |*	  int XFillGradientItem::operator==(const SfxPoolItem& rItem) const
3660cdf0e10cSrcweir |*
3661cdf0e10cSrcweir |*	  Beschreibung
3662cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
3663cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
3664cdf0e10cSrcweir |*
3665cdf0e10cSrcweir *************************************************************************/
3666cdf0e10cSrcweir 
3667cdf0e10cSrcweir int XFillGradientItem::operator==(const SfxPoolItem& rItem) const
3668cdf0e10cSrcweir {
3669cdf0e10cSrcweir 	return ( NameOrIndex::operator==(rItem) &&
3670cdf0e10cSrcweir 			 aGradient == ((const XFillGradientItem&) rItem).aGradient );
3671cdf0e10cSrcweir }
3672cdf0e10cSrcweir 
3673cdf0e10cSrcweir /*************************************************************************
3674cdf0e10cSrcweir |*
3675cdf0e10cSrcweir |*	  SfxPoolItem* XFillGradientItem::Create(SvStream& rIn, sal_uInt16 nVer) const
3676cdf0e10cSrcweir |*
3677cdf0e10cSrcweir |*	  Beschreibung
3678cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
3679cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
3680cdf0e10cSrcweir |*
3681cdf0e10cSrcweir *************************************************************************/
3682cdf0e10cSrcweir 
3683cdf0e10cSrcweir SfxPoolItem* XFillGradientItem::Create(SvStream& rIn, sal_uInt16 nVer) const
3684cdf0e10cSrcweir {
3685cdf0e10cSrcweir 	return new XFillGradientItem(rIn, nVer);
3686cdf0e10cSrcweir }
3687cdf0e10cSrcweir 
3688cdf0e10cSrcweir /*************************************************************************
3689cdf0e10cSrcweir |*
3690cdf0e10cSrcweir |*	  SfxPoolItem* XFillGradientItem::Store(SvStream& rOut) const
3691cdf0e10cSrcweir |*
3692cdf0e10cSrcweir |*	  Beschreibung
3693cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
3694cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
3695cdf0e10cSrcweir |*
3696cdf0e10cSrcweir *************************************************************************/
3697cdf0e10cSrcweir 
3698cdf0e10cSrcweir SvStream& XFillGradientItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const
3699cdf0e10cSrcweir {
3700cdf0e10cSrcweir 	NameOrIndex::Store( rOut, nItemVersion );
3701cdf0e10cSrcweir 
3702cdf0e10cSrcweir 	if (!IsIndex())
3703cdf0e10cSrcweir 	{
3704cdf0e10cSrcweir 		rOut << (sal_Int16)aGradient.GetGradientStyle();
3705cdf0e10cSrcweir 
3706cdf0e10cSrcweir 		sal_uInt16 nTmp;
3707cdf0e10cSrcweir 
3708cdf0e10cSrcweir 		nTmp = VCLTOSVCOL( aGradient.GetStartColor().GetRed() ); rOut << nTmp;
3709cdf0e10cSrcweir 		nTmp = VCLTOSVCOL( aGradient.GetStartColor().GetGreen() ); rOut << nTmp;
3710cdf0e10cSrcweir 		nTmp = VCLTOSVCOL( aGradient.GetStartColor().GetBlue() ); rOut << nTmp;
3711cdf0e10cSrcweir 		nTmp = VCLTOSVCOL( aGradient.GetEndColor().GetRed() ); rOut << nTmp;
3712cdf0e10cSrcweir 		nTmp = VCLTOSVCOL( aGradient.GetEndColor().GetGreen() ); rOut << nTmp;
3713cdf0e10cSrcweir 		nTmp = VCLTOSVCOL( aGradient.GetEndColor().GetBlue() ); rOut << nTmp;
3714cdf0e10cSrcweir 
3715cdf0e10cSrcweir 		rOut << (sal_Int32) aGradient.GetAngle();
3716cdf0e10cSrcweir 		rOut << aGradient.GetBorder();
3717cdf0e10cSrcweir 		rOut << aGradient.GetXOffset();
3718cdf0e10cSrcweir 		rOut << aGradient.GetYOffset();
3719cdf0e10cSrcweir 		rOut << aGradient.GetStartIntens();
3720cdf0e10cSrcweir 		rOut << aGradient.GetEndIntens();
3721cdf0e10cSrcweir 		rOut << aGradient.GetSteps();
3722cdf0e10cSrcweir 	}
3723cdf0e10cSrcweir 
3724cdf0e10cSrcweir 	return rOut;
3725cdf0e10cSrcweir }
3726cdf0e10cSrcweir 
3727cdf0e10cSrcweir /*************************************************************************
3728cdf0e10cSrcweir |*
372997e8a929SArmin Le Grand |*	  const XGradient& XFillGradientItem::GetValue(const XGradientList* pTable)
3730cdf0e10cSrcweir |*																   const
3731cdf0e10cSrcweir |*
3732cdf0e10cSrcweir |*	  Beschreibung
3733cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
3734cdf0e10cSrcweir |*	  Letzte Aenderung	18.11.94
3735cdf0e10cSrcweir |*
3736cdf0e10cSrcweir *************************************************************************/
3737cdf0e10cSrcweir 
373897e8a929SArmin Le Grand const XGradient& XFillGradientItem::GetGradientValue(const XGradientList* pTable) const // GetValue -> GetGradientValue
3739cdf0e10cSrcweir {
3740cdf0e10cSrcweir 	if (!IsIndex())
3741cdf0e10cSrcweir 		return aGradient;
3742cdf0e10cSrcweir 	else
3743cdf0e10cSrcweir 		return pTable->GetGradient(GetIndex())->GetGradient();
3744cdf0e10cSrcweir }
3745cdf0e10cSrcweir 
3746cdf0e10cSrcweir 
3747cdf0e10cSrcweir /*************************************************************************
3748cdf0e10cSrcweir |*
3749cdf0e10cSrcweir |*	  sal_uInt16 XFillGradientItem::GetVersion() const
3750cdf0e10cSrcweir |*
3751cdf0e10cSrcweir |*	  Beschreibung
3752cdf0e10cSrcweir |*	  Ersterstellung	01.11.95
3753cdf0e10cSrcweir |*	  Letzte Aenderung	01.11.95
3754cdf0e10cSrcweir |*
3755cdf0e10cSrcweir *************************************************************************/
3756cdf0e10cSrcweir 
3757cdf0e10cSrcweir sal_uInt16 XFillGradientItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/) const
3758cdf0e10cSrcweir {
3759cdf0e10cSrcweir 	// !!! this version number also represents the version number of superclasses
3760cdf0e10cSrcweir 	// !!! (e.g. XFillFloatTransparenceItem); if you make any changes here,
3761cdf0e10cSrcweir 	// !!! the superclass is also affected
3762cdf0e10cSrcweir 	return 1;
3763cdf0e10cSrcweir }
3764cdf0e10cSrcweir 
3765cdf0e10cSrcweir //------------------------------------------------------------------------
3766cdf0e10cSrcweir 
3767cdf0e10cSrcweir SfxItemPresentation XFillGradientItem::GetPresentation
3768cdf0e10cSrcweir (
3769cdf0e10cSrcweir 	SfxItemPresentation ePres,
3770cdf0e10cSrcweir 	SfxMapUnit			/*eCoreUnit*/,
3771cdf0e10cSrcweir 	SfxMapUnit			/*ePresUnit*/,
3772cdf0e10cSrcweir     XubString&          rText, const IntlWrapper *
3773cdf0e10cSrcweir )	const
3774cdf0e10cSrcweir {
3775cdf0e10cSrcweir 	switch ( ePres )
3776cdf0e10cSrcweir 	{
3777cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NONE:
3778cdf0e10cSrcweir 			rText.Erase();
3779cdf0e10cSrcweir 			return ePres;
3780cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NAMELESS:
3781cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_COMPLETE:
3782cdf0e10cSrcweir 			rText = GetName();
3783cdf0e10cSrcweir 			return ePres;
3784cdf0e10cSrcweir 		default:
3785cdf0e10cSrcweir 			return SFX_ITEM_PRESENTATION_NONE;
3786cdf0e10cSrcweir 	}
3787cdf0e10cSrcweir }
3788cdf0e10cSrcweir 
3789cdf0e10cSrcweir // -----------------------------------------------------------------------
3790cdf0e10cSrcweir sal_Bool XFillGradientItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const
3791cdf0e10cSrcweir {
3792cdf0e10cSrcweir     //sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
3793cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
3794cdf0e10cSrcweir 	switch ( nMemberId )
3795cdf0e10cSrcweir 	{
3796cdf0e10cSrcweir         case 0:
3797cdf0e10cSrcweir         {
3798cdf0e10cSrcweir             uno::Sequence< beans::PropertyValue > aPropSeq( 2 );
3799cdf0e10cSrcweir 
3800cdf0e10cSrcweir             ::com::sun::star::awt::Gradient aGradient2;
3801cdf0e10cSrcweir 
3802cdf0e10cSrcweir 			const XGradient& aXGradient = GetGradientValue();
3803cdf0e10cSrcweir 			aGradient2.Style = (::com::sun::star::awt::GradientStyle) aXGradient.GetGradientStyle();
3804cdf0e10cSrcweir 			aGradient2.StartColor = (sal_Int32)aXGradient.GetStartColor().GetColor();
3805cdf0e10cSrcweir 			aGradient2.EndColor = (sal_Int32)aXGradient.GetEndColor().GetColor();
3806cdf0e10cSrcweir 			aGradient2.Angle = (short)aXGradient.GetAngle();
3807cdf0e10cSrcweir 			aGradient2.Border = aXGradient.GetBorder();
3808cdf0e10cSrcweir 			aGradient2.XOffset = aXGradient.GetXOffset();
3809cdf0e10cSrcweir 			aGradient2.YOffset = aXGradient.GetYOffset();
3810cdf0e10cSrcweir 			aGradient2.StartIntensity = aXGradient.GetStartIntens();
3811cdf0e10cSrcweir 			aGradient2.EndIntensity = aXGradient.GetEndIntens();
3812cdf0e10cSrcweir 			aGradient2.StepCount = aXGradient.GetSteps();
3813cdf0e10cSrcweir 
3814cdf0e10cSrcweir 			rtl::OUString aApiName;
3815cdf0e10cSrcweir 			SvxUnogetApiNameForItem( Which(), GetName(), aApiName );
3816cdf0e10cSrcweir             aPropSeq[0].Name    = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ));
3817cdf0e10cSrcweir             aPropSeq[0].Value   = uno::makeAny( aApiName );
3818cdf0e10cSrcweir             aPropSeq[1].Name    = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FillGradient" ));
3819cdf0e10cSrcweir             aPropSeq[1].Value   = uno::makeAny( aGradient2 );
3820cdf0e10cSrcweir             rVal = uno::makeAny( aPropSeq );
3821cdf0e10cSrcweir             break;
3822cdf0e10cSrcweir         }
3823cdf0e10cSrcweir 
3824cdf0e10cSrcweir         case MID_FILLGRADIENT:
3825cdf0e10cSrcweir 		{
3826cdf0e10cSrcweir 			const XGradient& aXGradient = GetGradientValue();
3827cdf0e10cSrcweir 			::com::sun::star::awt::Gradient aGradient2;
3828cdf0e10cSrcweir 
3829cdf0e10cSrcweir 			aGradient2.Style = (::com::sun::star::awt::GradientStyle) aXGradient.GetGradientStyle();
3830cdf0e10cSrcweir 			aGradient2.StartColor = (sal_Int32)aXGradient.GetStartColor().GetColor();
3831cdf0e10cSrcweir 			aGradient2.EndColor = (sal_Int32)aXGradient.GetEndColor().GetColor();
3832cdf0e10cSrcweir 			aGradient2.Angle = (short)aXGradient.GetAngle();
3833cdf0e10cSrcweir 			aGradient2.Border = aXGradient.GetBorder();
3834cdf0e10cSrcweir 			aGradient2.XOffset = aXGradient.GetXOffset();
3835cdf0e10cSrcweir 			aGradient2.YOffset = aXGradient.GetYOffset();
3836cdf0e10cSrcweir 			aGradient2.StartIntensity = aXGradient.GetStartIntens();
3837cdf0e10cSrcweir 			aGradient2.EndIntensity = aXGradient.GetEndIntens();
3838cdf0e10cSrcweir 			aGradient2.StepCount = aXGradient.GetSteps();
3839cdf0e10cSrcweir 
3840cdf0e10cSrcweir 			rVal <<= aGradient2;
3841cdf0e10cSrcweir 			break;
3842cdf0e10cSrcweir 		}
3843cdf0e10cSrcweir 
3844cdf0e10cSrcweir 		case MID_NAME:
3845cdf0e10cSrcweir 		{
3846cdf0e10cSrcweir 			rtl::OUString aApiName;
3847cdf0e10cSrcweir 			SvxUnogetApiNameForItem( Which(), GetName(), aApiName );
3848cdf0e10cSrcweir 			rVal <<= aApiName;
3849cdf0e10cSrcweir 			break;
3850cdf0e10cSrcweir 		}
3851cdf0e10cSrcweir 
3852cdf0e10cSrcweir 		case MID_GRADIENT_STYLE: rVal <<= (sal_Int16)GetGradientValue().GetGradientStyle(); break;
3853cdf0e10cSrcweir 		case MID_GRADIENT_STARTCOLOR: rVal <<= (sal_Int32)GetGradientValue().GetStartColor().GetColor(); break;
3854cdf0e10cSrcweir 		case MID_GRADIENT_ENDCOLOR: rVal <<= (sal_Int32)GetGradientValue().GetEndColor().GetColor(); break;
3855cdf0e10cSrcweir 		case MID_GRADIENT_ANGLE: rVal <<= (sal_Int16)GetGradientValue().GetAngle(); break;
3856cdf0e10cSrcweir 		case MID_GRADIENT_BORDER: rVal <<= GetGradientValue().GetBorder(); break;
3857cdf0e10cSrcweir 		case MID_GRADIENT_XOFFSET: rVal <<= GetGradientValue().GetXOffset(); break;
3858cdf0e10cSrcweir 		case MID_GRADIENT_YOFFSET: rVal <<= GetGradientValue().GetYOffset(); break;
3859cdf0e10cSrcweir 		case MID_GRADIENT_STARTINTENSITY: rVal <<= GetGradientValue().GetStartIntens(); break;
3860cdf0e10cSrcweir 		case MID_GRADIENT_ENDINTENSITY: rVal <<= GetGradientValue().GetEndIntens(); break;
3861cdf0e10cSrcweir 		case MID_GRADIENT_STEPCOUNT: rVal <<= GetGradientValue().GetSteps(); break;
3862cdf0e10cSrcweir 
3863cdf0e10cSrcweir 		default: DBG_ERROR("Wrong MemberId!"); return sal_False;
3864cdf0e10cSrcweir 	}
3865cdf0e10cSrcweir 
3866cdf0e10cSrcweir 	return sal_True;
3867cdf0e10cSrcweir }
3868cdf0e10cSrcweir 
3869cdf0e10cSrcweir // -----------------------------------------------------------------------
3870cdf0e10cSrcweir sal_Bool XFillGradientItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId )
3871cdf0e10cSrcweir {
3872cdf0e10cSrcweir //    sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
3873cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
3874cdf0e10cSrcweir 
3875cdf0e10cSrcweir 	switch ( nMemberId )
3876cdf0e10cSrcweir 	{
3877cdf0e10cSrcweir         case 0:
3878cdf0e10cSrcweir         {
3879cdf0e10cSrcweir             uno::Sequence< beans::PropertyValue >   aPropSeq;
3880cdf0e10cSrcweir             ::com::sun::star::awt::Gradient         aGradient2;
3881cdf0e10cSrcweir             rtl::OUString                           aName;
3882cdf0e10cSrcweir             bool                                    bGradient( false );
3883cdf0e10cSrcweir 
3884cdf0e10cSrcweir             if ( rVal >>= aPropSeq )
3885cdf0e10cSrcweir             {
3886cdf0e10cSrcweir                 for ( sal_Int32 n = 0; n < aPropSeq.getLength(); n++ )
3887cdf0e10cSrcweir                 {
3888cdf0e10cSrcweir                     if ( aPropSeq[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Name" )))
3889cdf0e10cSrcweir                         aPropSeq[n].Value >>= aName;
3890cdf0e10cSrcweir                     else if ( aPropSeq[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "FillGradient" )))
3891cdf0e10cSrcweir                     {
3892cdf0e10cSrcweir                         if ( aPropSeq[n].Value >>= aGradient2 )
3893cdf0e10cSrcweir                             bGradient = true;
3894cdf0e10cSrcweir                     }
3895cdf0e10cSrcweir                 }
3896cdf0e10cSrcweir 
3897cdf0e10cSrcweir                 SetName( aName );
3898cdf0e10cSrcweir                 if ( bGradient )
3899cdf0e10cSrcweir                 {
3900cdf0e10cSrcweir 			        XGradient aXGradient;
3901cdf0e10cSrcweir 
3902cdf0e10cSrcweir                     aXGradient.SetGradientStyle( (XGradientStyle) aGradient2.Style );
3903cdf0e10cSrcweir                     aXGradient.SetStartColor( aGradient2.StartColor );
3904cdf0e10cSrcweir                     aXGradient.SetEndColor( aGradient2.EndColor );
3905cdf0e10cSrcweir                     aXGradient.SetAngle( aGradient2.Angle );
3906cdf0e10cSrcweir                     aXGradient.SetBorder( aGradient2.Border );
3907cdf0e10cSrcweir                     aXGradient.SetXOffset( aGradient2.XOffset );
3908cdf0e10cSrcweir                     aXGradient.SetYOffset( aGradient2.YOffset );
3909cdf0e10cSrcweir                     aXGradient.SetStartIntens( aGradient2.StartIntensity );
3910cdf0e10cSrcweir                     aXGradient.SetEndIntens( aGradient2.EndIntensity );
3911cdf0e10cSrcweir                     aXGradient.SetSteps( aGradient2.StepCount );
3912cdf0e10cSrcweir 
3913cdf0e10cSrcweir                     SetGradientValue( aXGradient );
3914cdf0e10cSrcweir                 }
3915cdf0e10cSrcweir 
3916cdf0e10cSrcweir                 return sal_True;
3917cdf0e10cSrcweir             }
3918cdf0e10cSrcweir 
3919cdf0e10cSrcweir             return sal_False;
3920cdf0e10cSrcweir         }
3921cdf0e10cSrcweir 
3922cdf0e10cSrcweir 		case MID_NAME:
3923cdf0e10cSrcweir 		{
3924cdf0e10cSrcweir 			rtl::OUString aName;
3925cdf0e10cSrcweir 			if (!(rVal >>= aName ))
3926cdf0e10cSrcweir 				return sal_False;
3927cdf0e10cSrcweir 			SetName( aName );
3928cdf0e10cSrcweir 			break;
3929cdf0e10cSrcweir 		}
3930cdf0e10cSrcweir 
3931cdf0e10cSrcweir 		case MID_FILLGRADIENT:
3932cdf0e10cSrcweir 		{
3933cdf0e10cSrcweir 			::com::sun::star::awt::Gradient aGradient2;
3934cdf0e10cSrcweir 			if(!(rVal >>= aGradient2))
3935cdf0e10cSrcweir 				return sal_False;
3936cdf0e10cSrcweir 
3937cdf0e10cSrcweir 			XGradient aXGradient;
3938cdf0e10cSrcweir 
3939cdf0e10cSrcweir 			aXGradient.SetGradientStyle( (XGradientStyle) aGradient2.Style );
3940cdf0e10cSrcweir 			aXGradient.SetStartColor( aGradient2.StartColor );
3941cdf0e10cSrcweir 			aXGradient.SetEndColor( aGradient2.EndColor );
3942cdf0e10cSrcweir 			aXGradient.SetAngle( aGradient2.Angle );
3943cdf0e10cSrcweir 			aXGradient.SetBorder( aGradient2.Border );
3944cdf0e10cSrcweir 			aXGradient.SetXOffset( aGradient2.XOffset );
3945cdf0e10cSrcweir 			aXGradient.SetYOffset( aGradient2.YOffset );
3946cdf0e10cSrcweir 			aXGradient.SetStartIntens( aGradient2.StartIntensity );
3947cdf0e10cSrcweir 			aXGradient.SetEndIntens( aGradient2.EndIntensity );
3948cdf0e10cSrcweir 			aXGradient.SetSteps( aGradient2.StepCount );
3949cdf0e10cSrcweir 
3950cdf0e10cSrcweir 			SetGradientValue( aXGradient );
3951cdf0e10cSrcweir 			break;
3952cdf0e10cSrcweir 		}
3953cdf0e10cSrcweir 
3954cdf0e10cSrcweir 		case MID_GRADIENT_STARTCOLOR:
3955cdf0e10cSrcweir 		case MID_GRADIENT_ENDCOLOR:
3956cdf0e10cSrcweir 		{
3957cdf0e10cSrcweir 			sal_Int32 nVal = 0;
3958cdf0e10cSrcweir 			if(!(rVal >>= nVal ))
3959cdf0e10cSrcweir 				return sal_False;
3960cdf0e10cSrcweir 
3961cdf0e10cSrcweir 			XGradient aXGradient = GetGradientValue();
3962cdf0e10cSrcweir 
3963cdf0e10cSrcweir 			if ( nMemberId == MID_GRADIENT_STARTCOLOR )
3964cdf0e10cSrcweir 				aXGradient.SetStartColor( nVal );
3965cdf0e10cSrcweir 			else
3966cdf0e10cSrcweir 				aXGradient.SetEndColor( nVal );
3967cdf0e10cSrcweir 			SetGradientValue( aXGradient );
3968cdf0e10cSrcweir 			break;
3969cdf0e10cSrcweir 		}
3970cdf0e10cSrcweir 
3971cdf0e10cSrcweir 		case MID_GRADIENT_STYLE:
3972cdf0e10cSrcweir 		case MID_GRADIENT_ANGLE:
3973cdf0e10cSrcweir 		case MID_GRADIENT_BORDER:
3974cdf0e10cSrcweir 		case MID_GRADIENT_STARTINTENSITY:
3975cdf0e10cSrcweir 		case MID_GRADIENT_ENDINTENSITY:
3976cdf0e10cSrcweir 		case MID_GRADIENT_STEPCOUNT:
3977cdf0e10cSrcweir 		case MID_GRADIENT_XOFFSET:
3978cdf0e10cSrcweir 		case MID_GRADIENT_YOFFSET:
3979cdf0e10cSrcweir 		{
3980cdf0e10cSrcweir 			sal_Int16 nVal = sal_Int16();
3981cdf0e10cSrcweir 			if(!(rVal >>= nVal ))
3982cdf0e10cSrcweir 				return sal_False;
3983cdf0e10cSrcweir 
3984cdf0e10cSrcweir 			XGradient aXGradient = GetGradientValue();
3985cdf0e10cSrcweir 
3986cdf0e10cSrcweir 			switch ( nMemberId )
3987cdf0e10cSrcweir 			{
3988cdf0e10cSrcweir 				case MID_GRADIENT_STYLE:
3989cdf0e10cSrcweir 					aXGradient.SetGradientStyle( (XGradientStyle)nVal ); break;
3990cdf0e10cSrcweir 				case MID_GRADIENT_ANGLE:
3991cdf0e10cSrcweir 					aXGradient.SetAngle( nVal ); break;
3992cdf0e10cSrcweir 				case MID_GRADIENT_BORDER:
3993cdf0e10cSrcweir 					aXGradient.SetBorder( nVal ); break;
3994cdf0e10cSrcweir 				case MID_GRADIENT_STARTINTENSITY:
3995cdf0e10cSrcweir 					aXGradient.SetStartIntens( nVal ); break;
3996cdf0e10cSrcweir 				case MID_GRADIENT_ENDINTENSITY:
3997cdf0e10cSrcweir 					aXGradient.SetEndIntens( nVal ); break;
3998cdf0e10cSrcweir 				case MID_GRADIENT_STEPCOUNT:
3999cdf0e10cSrcweir 					aXGradient.SetSteps( nVal ); break;
4000cdf0e10cSrcweir 				case MID_GRADIENT_XOFFSET:
4001cdf0e10cSrcweir 					aXGradient.SetXOffset( nVal ); break;
4002cdf0e10cSrcweir 				case MID_GRADIENT_YOFFSET:
4003cdf0e10cSrcweir 					aXGradient.SetYOffset( nVal ); break;
4004cdf0e10cSrcweir 			}
4005cdf0e10cSrcweir 
4006cdf0e10cSrcweir 			SetGradientValue( aXGradient );
4007cdf0e10cSrcweir 			break;
4008cdf0e10cSrcweir 		}
4009cdf0e10cSrcweir 	}
4010cdf0e10cSrcweir 
4011cdf0e10cSrcweir 	return sal_True;
4012cdf0e10cSrcweir }
4013cdf0e10cSrcweir 
4014cdf0e10cSrcweir sal_Bool XFillGradientItem::CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 )
4015cdf0e10cSrcweir {
4016cdf0e10cSrcweir 	return ((XFillGradientItem*)p1)->GetGradientValue() == ((XFillGradientItem*)p2)->GetGradientValue();
4017cdf0e10cSrcweir }
4018cdf0e10cSrcweir 
4019cdf0e10cSrcweir XFillGradientItem* XFillGradientItem::checkForUniqueItem( SdrModel* pModel ) const
4020cdf0e10cSrcweir {
4021cdf0e10cSrcweir 	if( pModel )
4022cdf0e10cSrcweir 	{
4023cdf0e10cSrcweir 		const String aUniqueName = NameOrIndex::CheckNamedItem(	this,
4024cdf0e10cSrcweir 																XATTR_FILLGRADIENT,
4025cdf0e10cSrcweir 																&pModel->GetItemPool(),
4026cdf0e10cSrcweir 																pModel->GetStyleSheetPool() ? &pModel->GetStyleSheetPool()->GetPool() : NULL,
4027cdf0e10cSrcweir 																XFillGradientItem::CompareValueFunc,
4028cdf0e10cSrcweir 																RID_SVXSTR_GRADIENT,
4029*c7be74b1SArmin Le Grand 																pModel->GetGradientListFromSdrModel().get() );
4030cdf0e10cSrcweir 
4031cdf0e10cSrcweir 		// if the given name is not valid, replace it!
4032cdf0e10cSrcweir 		if( aUniqueName != GetName() )
4033cdf0e10cSrcweir 		{
4034cdf0e10cSrcweir 			return new XFillGradientItem( aUniqueName, aGradient );
4035cdf0e10cSrcweir 		}
4036cdf0e10cSrcweir 	}
4037cdf0e10cSrcweir 
4038cdf0e10cSrcweir 	return (XFillGradientItem*)this;
4039cdf0e10cSrcweir }
4040cdf0e10cSrcweir 
4041cdf0e10cSrcweir // ----------------------------------
4042cdf0e10cSrcweir // class XFillFloatTransparenceItem -
4043cdf0e10cSrcweir // ----------------------------------
4044cdf0e10cSrcweir 
4045cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY( XFillFloatTransparenceItem, XFillGradientItem );
4046cdf0e10cSrcweir 
4047cdf0e10cSrcweir // -----------------------------------------------------------------------------
4048cdf0e10cSrcweir 
4049cdf0e10cSrcweir XFillFloatTransparenceItem::XFillFloatTransparenceItem() :
4050cdf0e10cSrcweir 	bEnabled( sal_False )
4051cdf0e10cSrcweir {
4052cdf0e10cSrcweir 	SetWhich( XATTR_FILLFLOATTRANSPARENCE );
4053cdf0e10cSrcweir }
4054cdf0e10cSrcweir 
4055cdf0e10cSrcweir //------------------------------------------------------------------------
4056cdf0e10cSrcweir 
4057cdf0e10cSrcweir XFillFloatTransparenceItem::XFillFloatTransparenceItem( sal_Int32 nIndex, const XGradient& rGradient, sal_Bool bEnable ) :
4058cdf0e10cSrcweir 	XFillGradientItem	( nIndex, rGradient ),
4059cdf0e10cSrcweir 	bEnabled			( bEnable )
4060cdf0e10cSrcweir {
4061cdf0e10cSrcweir 	SetWhich( XATTR_FILLFLOATTRANSPARENCE );
4062cdf0e10cSrcweir }
4063cdf0e10cSrcweir 
4064cdf0e10cSrcweir //------------------------------------------------------------------------
4065cdf0e10cSrcweir 
4066cdf0e10cSrcweir XFillFloatTransparenceItem::XFillFloatTransparenceItem(const XubString& rName, const XGradient& rGradient, sal_Bool bEnable ) :
4067cdf0e10cSrcweir 	XFillGradientItem	( rName, rGradient ),
4068cdf0e10cSrcweir 	bEnabled			( bEnable )
4069cdf0e10cSrcweir {
4070cdf0e10cSrcweir 	SetWhich( XATTR_FILLFLOATTRANSPARENCE );
4071cdf0e10cSrcweir }
4072cdf0e10cSrcweir 
4073cdf0e10cSrcweir //------------------------------------------------------------------------
4074cdf0e10cSrcweir 
4075cdf0e10cSrcweir XFillFloatTransparenceItem::XFillFloatTransparenceItem( const XFillFloatTransparenceItem& rItem ) :
4076cdf0e10cSrcweir 	XFillGradientItem	( rItem ),
4077cdf0e10cSrcweir 	bEnabled			( rItem.bEnabled )
4078cdf0e10cSrcweir {
4079cdf0e10cSrcweir 	SetWhich( XATTR_FILLFLOATTRANSPARENCE );
4080cdf0e10cSrcweir }
4081cdf0e10cSrcweir 
4082cdf0e10cSrcweir //------------------------------------------------------------------------
4083cdf0e10cSrcweir 
4084cdf0e10cSrcweir //XFillFloatTransparenceItem::XFillFloatTransparenceItem( SvStream& rIn, sal_uInt16 nVer ) :
4085cdf0e10cSrcweir //	XFillGradientItem	( rIn, nVer )
4086cdf0e10cSrcweir //{
4087cdf0e10cSrcweir //	SetWhich( XATTR_FILLFLOATTRANSPARENCE );
4088cdf0e10cSrcweir //	rIn >> bEnabled;
4089cdf0e10cSrcweir //}
4090cdf0e10cSrcweir 
4091cdf0e10cSrcweir //*************************************************************************
4092cdf0e10cSrcweir 
4093cdf0e10cSrcweir XFillFloatTransparenceItem::XFillFloatTransparenceItem(SfxItemPool* /*pPool*/, const XGradient& rTheGradient, sal_Bool bEnable )
4094cdf0e10cSrcweir : 	XFillGradientItem	( -1, rTheGradient ),
4095cdf0e10cSrcweir 	bEnabled			( bEnable )
4096cdf0e10cSrcweir {
4097cdf0e10cSrcweir 	SetWhich( XATTR_FILLFLOATTRANSPARENCE );
4098cdf0e10cSrcweir }
4099cdf0e10cSrcweir 
4100cdf0e10cSrcweir //*************************************************************************
4101cdf0e10cSrcweir 
4102cdf0e10cSrcweir XFillFloatTransparenceItem::XFillFloatTransparenceItem(SfxItemPool* /*pPool*/)
4103cdf0e10cSrcweir {
4104cdf0e10cSrcweir 	SetWhich( XATTR_FILLFLOATTRANSPARENCE );
4105cdf0e10cSrcweir }
4106cdf0e10cSrcweir 
4107cdf0e10cSrcweir //------------------------------------------------------------------------
4108cdf0e10cSrcweir 
4109cdf0e10cSrcweir int XFillFloatTransparenceItem::operator==( const SfxPoolItem& rItem ) const
4110cdf0e10cSrcweir {
4111cdf0e10cSrcweir 	return ( NameOrIndex::operator==(rItem) ) &&
4112cdf0e10cSrcweir 			( GetGradientValue() == ((const XFillGradientItem&)rItem).GetGradientValue() ) &&
4113cdf0e10cSrcweir 		     ( bEnabled == ( (XFillFloatTransparenceItem&) rItem ).bEnabled );
4114cdf0e10cSrcweir }
4115cdf0e10cSrcweir 
4116cdf0e10cSrcweir //------------------------------------------------------------------------
4117cdf0e10cSrcweir 
4118cdf0e10cSrcweir SfxPoolItem* XFillFloatTransparenceItem::Clone( SfxItemPool* /*pPool*/) const
4119cdf0e10cSrcweir {
4120cdf0e10cSrcweir 	return new XFillFloatTransparenceItem( *this );
4121cdf0e10cSrcweir }
4122cdf0e10cSrcweir 
4123cdf0e10cSrcweir //------------------------------------------------------------------------
4124cdf0e10cSrcweir 
4125cdf0e10cSrcweir //SfxPoolItem* XFillFloatTransparenceItem::Create( SvStream& rIn, sal_uInt16 nVer ) const
4126cdf0e10cSrcweir //{
4127cdf0e10cSrcweir //	return( ( 0 == nVer ) ? Clone( NULL ) : new XFillFloatTransparenceItem( rIn, nVer ) );
4128cdf0e10cSrcweir //}
4129cdf0e10cSrcweir 
4130cdf0e10cSrcweir //------------------------------------------------------------------------
4131cdf0e10cSrcweir 
4132cdf0e10cSrcweir //SvStream& XFillFloatTransparenceItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const
4133cdf0e10cSrcweir //{
4134cdf0e10cSrcweir //	XFillGradientItem::Store( rOut, nItemVersion );
4135cdf0e10cSrcweir //	rOut << bEnabled;
4136cdf0e10cSrcweir //	return rOut;
4137cdf0e10cSrcweir //}
4138cdf0e10cSrcweir 
4139cdf0e10cSrcweir //------------------------------------------------------------------------
4140cdf0e10cSrcweir 
4141cdf0e10cSrcweir sal_uInt16 XFillFloatTransparenceItem::GetVersion( sal_uInt16 nFileFormatVersion ) const
4142cdf0e10cSrcweir {
4143cdf0e10cSrcweir 	// !!! if version number of this object must be increased, please	!!!
4144cdf0e10cSrcweir 	// !!! increase version number of base class XFillGradientItem		!!!
4145cdf0e10cSrcweir 	return XFillGradientItem::GetVersion( nFileFormatVersion );
4146cdf0e10cSrcweir }
4147cdf0e10cSrcweir 
4148cdf0e10cSrcweir //------------------------------------------------------------------------
4149cdf0e10cSrcweir 
4150cdf0e10cSrcweir sal_Bool XFillFloatTransparenceItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const
4151cdf0e10cSrcweir {
4152cdf0e10cSrcweir 	return XFillGradientItem::QueryValue( rVal, nMemberId );
4153cdf0e10cSrcweir }
4154cdf0e10cSrcweir 
4155cdf0e10cSrcweir //------------------------------------------------------------------------
4156cdf0e10cSrcweir 
4157cdf0e10cSrcweir sal_Bool XFillFloatTransparenceItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId )
4158cdf0e10cSrcweir {
4159cdf0e10cSrcweir 	return XFillGradientItem::PutValue( rVal, nMemberId );
4160cdf0e10cSrcweir }
4161cdf0e10cSrcweir 
4162cdf0e10cSrcweir //------------------------------------------------------------------------
4163cdf0e10cSrcweir 
4164cdf0e10cSrcweir SfxItemPresentation XFillFloatTransparenceItem::GetPresentation(	SfxItemPresentation ePres,
4165cdf0e10cSrcweir 																	SfxMapUnit eCoreUnit, SfxMapUnit ePresUnit,
4166cdf0e10cSrcweir 																	XubString& rText,
4167cdf0e10cSrcweir                                                                     const IntlWrapper * pIntlWrapper ) const
4168cdf0e10cSrcweir {
4169cdf0e10cSrcweir     return XFillGradientItem::GetPresentation( ePres, eCoreUnit, ePresUnit, rText, pIntlWrapper );
4170cdf0e10cSrcweir }
4171cdf0e10cSrcweir 
4172cdf0e10cSrcweir sal_Bool XFillFloatTransparenceItem::CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 )
4173cdf0e10cSrcweir {
4174cdf0e10cSrcweir 	return	((XFillFloatTransparenceItem*)p1)->IsEnabled() == ((XFillFloatTransparenceItem*)p2)->IsEnabled() &&
4175cdf0e10cSrcweir 			((XFillFloatTransparenceItem*)p1)->GetGradientValue()  == ((XFillFloatTransparenceItem*)p2)->GetGradientValue();
4176cdf0e10cSrcweir }
4177cdf0e10cSrcweir 
4178cdf0e10cSrcweir XFillFloatTransparenceItem* XFillFloatTransparenceItem::checkForUniqueItem( SdrModel* pModel ) const
4179cdf0e10cSrcweir {
4180cdf0e10cSrcweir 	// #85953# unique name only necessary when enabled
4181cdf0e10cSrcweir 	if(IsEnabled())
4182cdf0e10cSrcweir 	{
4183cdf0e10cSrcweir 		if( pModel )
4184cdf0e10cSrcweir 		{
4185cdf0e10cSrcweir 			const String aUniqueName = NameOrIndex::CheckNamedItem(	this,
4186cdf0e10cSrcweir 																	XATTR_FILLFLOATTRANSPARENCE,
4187cdf0e10cSrcweir 																	&pModel->GetItemPool(),
4188cdf0e10cSrcweir 																	pModel->GetStyleSheetPool() ? &pModel->GetStyleSheetPool()->GetPool() : NULL,
4189cdf0e10cSrcweir 																	XFillFloatTransparenceItem::CompareValueFunc,
4190cdf0e10cSrcweir 																	RID_SVXSTR_TRASNGR0,
4191cdf0e10cSrcweir 																	NULL );
4192cdf0e10cSrcweir 
4193cdf0e10cSrcweir 			// if the given name is not valid, replace it!
4194cdf0e10cSrcweir 			if( aUniqueName != GetName() )
4195cdf0e10cSrcweir 			{
4196cdf0e10cSrcweir 				return new XFillFloatTransparenceItem( aUniqueName, GetGradientValue(), sal_True );
4197cdf0e10cSrcweir 			}
4198cdf0e10cSrcweir 		}
4199cdf0e10cSrcweir 	}
4200cdf0e10cSrcweir 	else
4201cdf0e10cSrcweir 	{
4202cdf0e10cSrcweir 		// #85953# if disabled, force name to empty string
4203cdf0e10cSrcweir 		if(GetName().Len())
4204cdf0e10cSrcweir 		{
4205cdf0e10cSrcweir 			return new XFillFloatTransparenceItem(String(), GetGradientValue(), sal_False);
4206cdf0e10cSrcweir 		}
4207cdf0e10cSrcweir 	}
4208cdf0e10cSrcweir 
4209cdf0e10cSrcweir 	return (XFillFloatTransparenceItem*)this;
4210cdf0e10cSrcweir }
4211cdf0e10cSrcweir 
4212cdf0e10cSrcweir // -------------
4213cdf0e10cSrcweir // class XHatch
4214cdf0e10cSrcweir // -------------
4215cdf0e10cSrcweir 
4216cdf0e10cSrcweir /*************************************************************************
4217cdf0e10cSrcweir |*
4218cdf0e10cSrcweir |*	  XHatch::XHatch(XHatchStyle, const Color&, long, long)
4219cdf0e10cSrcweir |*
4220cdf0e10cSrcweir |*	  Beschreibung
4221cdf0e10cSrcweir |*	  Ersterstellung	21.11.94
4222cdf0e10cSrcweir |*	  Letzte Aenderung	21.11.94
4223cdf0e10cSrcweir |*
4224cdf0e10cSrcweir *************************************************************************/
4225cdf0e10cSrcweir 
4226cdf0e10cSrcweir XHatch::XHatch(const Color& rCol, XHatchStyle eTheStyle, long nTheDistance,
4227cdf0e10cSrcweir 			   long nTheAngle) :
4228cdf0e10cSrcweir 	eStyle(eTheStyle),
4229cdf0e10cSrcweir 	aColor(rCol),
4230cdf0e10cSrcweir 	nDistance(nTheDistance),
4231cdf0e10cSrcweir 	nAngle(nTheAngle)
4232cdf0e10cSrcweir {
4233cdf0e10cSrcweir }
4234cdf0e10cSrcweir 
4235cdf0e10cSrcweir /*************************************************************************
4236cdf0e10cSrcweir |*
4237cdf0e10cSrcweir |*	  int XHatch::operator==(const SfxPoolItem& rItem) const
4238cdf0e10cSrcweir |*
4239cdf0e10cSrcweir |*	  Beschreibung
4240cdf0e10cSrcweir |*	  Ersterstellung	29.11.94
4241cdf0e10cSrcweir |*	  Letzte Aenderung	29.11.94
4242cdf0e10cSrcweir |*
4243cdf0e10cSrcweir *************************************************************************/
4244cdf0e10cSrcweir 
4245cdf0e10cSrcweir bool XHatch::operator==(const XHatch& rHatch) const
4246cdf0e10cSrcweir {
4247cdf0e10cSrcweir 	return ( eStyle 	== rHatch.eStyle	&&
4248cdf0e10cSrcweir 			 aColor 	== rHatch.aColor	&&
4249cdf0e10cSrcweir 			 nDistance	== rHatch.nDistance &&
4250cdf0e10cSrcweir 			 nAngle 	== rHatch.nAngle );
4251cdf0e10cSrcweir }
4252cdf0e10cSrcweir 
4253cdf0e10cSrcweir 
4254cdf0e10cSrcweir // -----------------------
4255cdf0e10cSrcweir // class XFillHatchItem
4256cdf0e10cSrcweir // -----------------------
4257cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFillHatchItem, NameOrIndex);
4258cdf0e10cSrcweir 
4259cdf0e10cSrcweir /*************************************************************************
4260cdf0e10cSrcweir |*
4261cdf0e10cSrcweir |*	  XFillHatchItem::XFillHatchItem(sal_Int32 nIndex,
4262cdf0e10cSrcweir |*								   const XHatch& rTheHatch)
4263cdf0e10cSrcweir |*
4264cdf0e10cSrcweir |*	  Beschreibung
4265cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
4266cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
4267cdf0e10cSrcweir |*
4268cdf0e10cSrcweir *************************************************************************/
4269cdf0e10cSrcweir 
4270cdf0e10cSrcweir XFillHatchItem::XFillHatchItem(sal_Int32 nIndex,
4271cdf0e10cSrcweir 							 const XHatch& rTheHatch) :
4272cdf0e10cSrcweir 	NameOrIndex(XATTR_FILLHATCH, nIndex),
4273cdf0e10cSrcweir 	aHatch(rTheHatch)
4274cdf0e10cSrcweir {
4275cdf0e10cSrcweir }
4276cdf0e10cSrcweir 
4277cdf0e10cSrcweir /*************************************************************************
4278cdf0e10cSrcweir |*
4279cdf0e10cSrcweir |*	  XFillHatchItem::XFillHatchItem(const XubString& rName,
4280cdf0e10cSrcweir |*								   const XHatch& rTheHatch)
4281cdf0e10cSrcweir |*
4282cdf0e10cSrcweir |*	  Beschreibung
4283cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
4284cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
4285cdf0e10cSrcweir |*
4286cdf0e10cSrcweir *************************************************************************/
4287cdf0e10cSrcweir 
4288cdf0e10cSrcweir XFillHatchItem::XFillHatchItem(const XubString& rName,
4289cdf0e10cSrcweir 							 const XHatch& rTheHatch) :
4290cdf0e10cSrcweir 	NameOrIndex(XATTR_FILLHATCH, rName),
4291cdf0e10cSrcweir 	aHatch(rTheHatch)
4292cdf0e10cSrcweir {
4293cdf0e10cSrcweir }
4294cdf0e10cSrcweir 
4295cdf0e10cSrcweir /*************************************************************************
4296cdf0e10cSrcweir |*
4297cdf0e10cSrcweir |*	  XFillHatchItem::XFillHatchItem(const XFillHatchItem& rItem)
4298cdf0e10cSrcweir |*
4299cdf0e10cSrcweir |*	  Beschreibung
4300cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
4301cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
4302cdf0e10cSrcweir |*
4303cdf0e10cSrcweir *************************************************************************/
4304cdf0e10cSrcweir 
4305cdf0e10cSrcweir XFillHatchItem::XFillHatchItem(const XFillHatchItem& rItem) :
4306cdf0e10cSrcweir 	NameOrIndex(rItem),
4307cdf0e10cSrcweir 	aHatch(rItem.aHatch)
4308cdf0e10cSrcweir {
4309cdf0e10cSrcweir }
4310cdf0e10cSrcweir 
4311cdf0e10cSrcweir /*************************************************************************
4312cdf0e10cSrcweir |*
4313cdf0e10cSrcweir |*	  XFillHatchItem::XFillHatchItem(SvStream& rIn)
4314cdf0e10cSrcweir |*
4315cdf0e10cSrcweir |*	  Beschreibung
4316cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
4317cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
4318cdf0e10cSrcweir |*
4319cdf0e10cSrcweir *************************************************************************/
4320cdf0e10cSrcweir 
4321cdf0e10cSrcweir XFillHatchItem::XFillHatchItem(SvStream& rIn) :
4322cdf0e10cSrcweir 	NameOrIndex(XATTR_FILLHATCH, rIn),
4323cdf0e10cSrcweir 	aHatch(COL_BLACK)
4324cdf0e10cSrcweir {
4325cdf0e10cSrcweir 	if (!IsIndex())
4326cdf0e10cSrcweir 	{
4327cdf0e10cSrcweir 		sal_uInt16 nRed;
4328cdf0e10cSrcweir 		sal_uInt16 nGreen;
4329cdf0e10cSrcweir 		sal_uInt16 nBlue;
4330cdf0e10cSrcweir 		sal_Int16  nITemp;
4331cdf0e10cSrcweir 		sal_Int32  nLTemp;
4332cdf0e10cSrcweir 
4333cdf0e10cSrcweir 		rIn >> nITemp; aHatch.SetHatchStyle((XHatchStyle)nITemp);
4334cdf0e10cSrcweir 		rIn >> nRed;
4335cdf0e10cSrcweir 		rIn >> nGreen;
4336cdf0e10cSrcweir 		rIn >> nBlue;
4337cdf0e10cSrcweir 
4338cdf0e10cSrcweir 		Color aCol;
4339cdf0e10cSrcweir 		aCol = Color( (sal_uInt8)( nRed >> 8 ), (sal_uInt8)( nGreen >> 8 ), (sal_uInt8)( nBlue >> 8 ) );
4340cdf0e10cSrcweir 		aHatch.SetColor(aCol);
4341cdf0e10cSrcweir 		rIn >> nLTemp; aHatch.SetDistance(nLTemp);
4342cdf0e10cSrcweir 		rIn >> nLTemp; aHatch.SetAngle(nLTemp);
4343cdf0e10cSrcweir 	}
4344cdf0e10cSrcweir }
4345cdf0e10cSrcweir 
4346cdf0e10cSrcweir //*************************************************************************
4347cdf0e10cSrcweir 
4348cdf0e10cSrcweir XFillHatchItem::XFillHatchItem(SfxItemPool* /*pPool*/, const XHatch& rTheHatch)
4349cdf0e10cSrcweir : 	NameOrIndex( XATTR_FILLHATCH, -1 ),
4350cdf0e10cSrcweir 	aHatch(rTheHatch)
4351cdf0e10cSrcweir {
4352cdf0e10cSrcweir }
4353cdf0e10cSrcweir 
4354cdf0e10cSrcweir //*************************************************************************
4355cdf0e10cSrcweir 
4356cdf0e10cSrcweir XFillHatchItem::XFillHatchItem(SfxItemPool* /*pPool*/)
4357cdf0e10cSrcweir : NameOrIndex(XATTR_FILLHATCH, -1 )
4358cdf0e10cSrcweir {
4359cdf0e10cSrcweir }
4360cdf0e10cSrcweir 
4361cdf0e10cSrcweir /*************************************************************************
4362cdf0e10cSrcweir |*
4363cdf0e10cSrcweir |*	  XFillHatchItem::Clone(SfxItemPool* pPool) const
4364cdf0e10cSrcweir |*
4365cdf0e10cSrcweir |*	  Beschreibung
4366cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
4367cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
4368cdf0e10cSrcweir |*
4369cdf0e10cSrcweir *************************************************************************/
4370cdf0e10cSrcweir 
4371cdf0e10cSrcweir SfxPoolItem* XFillHatchItem::Clone(SfxItemPool* /*pPool*/) const
4372cdf0e10cSrcweir {
4373cdf0e10cSrcweir 	return new XFillHatchItem(*this);
4374cdf0e10cSrcweir }
4375cdf0e10cSrcweir 
4376cdf0e10cSrcweir /*************************************************************************
4377cdf0e10cSrcweir |*
4378cdf0e10cSrcweir |*	  int XFillHatchItem::operator==(const SfxPoolItem& rItem) const
4379cdf0e10cSrcweir |*
4380cdf0e10cSrcweir |*	  Beschreibung
4381cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
4382cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
4383cdf0e10cSrcweir |*
4384cdf0e10cSrcweir *************************************************************************/
4385cdf0e10cSrcweir 
4386cdf0e10cSrcweir int XFillHatchItem::operator==(const SfxPoolItem& rItem) const
4387cdf0e10cSrcweir {
4388cdf0e10cSrcweir 	return ( NameOrIndex::operator==(rItem) &&
4389cdf0e10cSrcweir 			 aHatch == ((const XFillHatchItem&) rItem).aHatch );
4390cdf0e10cSrcweir }
4391cdf0e10cSrcweir 
4392cdf0e10cSrcweir /*************************************************************************
4393cdf0e10cSrcweir |*
4394cdf0e10cSrcweir |*	  SfxPoolItem* XFillHatchItem::Create(SvStream& rIn, sal_uInt16 nVer) const
4395cdf0e10cSrcweir |*
4396cdf0e10cSrcweir |*	  Beschreibung
4397cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
4398cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
4399cdf0e10cSrcweir |*
4400cdf0e10cSrcweir *************************************************************************/
4401cdf0e10cSrcweir 
4402cdf0e10cSrcweir SfxPoolItem* XFillHatchItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
4403cdf0e10cSrcweir {
4404cdf0e10cSrcweir 	return new XFillHatchItem(rIn);
4405cdf0e10cSrcweir }
4406cdf0e10cSrcweir 
4407cdf0e10cSrcweir /*************************************************************************
4408cdf0e10cSrcweir |*
4409cdf0e10cSrcweir |*	  SfxPoolItem* XFillHatchItem::Store(SvStream& rOut) const
4410cdf0e10cSrcweir |*
4411cdf0e10cSrcweir |*	  Beschreibung
4412cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
4413cdf0e10cSrcweir |*	  Letzte Aenderung	15.11.94
4414cdf0e10cSrcweir |*
4415cdf0e10cSrcweir *************************************************************************/
4416cdf0e10cSrcweir 
4417cdf0e10cSrcweir SvStream& XFillHatchItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const
4418cdf0e10cSrcweir {
4419cdf0e10cSrcweir 	NameOrIndex::Store( rOut, nItemVersion );
4420cdf0e10cSrcweir 
4421cdf0e10cSrcweir 	if (!IsIndex())
4422cdf0e10cSrcweir 	{
4423cdf0e10cSrcweir 		rOut << (sal_Int16)aHatch.GetHatchStyle();
4424cdf0e10cSrcweir 
4425cdf0e10cSrcweir 		sal_uInt16 nTmp;
4426cdf0e10cSrcweir 		nTmp = VCLTOSVCOL( aHatch.GetColor().GetRed() ); rOut << nTmp;
4427cdf0e10cSrcweir 		nTmp = VCLTOSVCOL( aHatch.GetColor().GetGreen() ); rOut << nTmp;
4428cdf0e10cSrcweir 		nTmp = VCLTOSVCOL( aHatch.GetColor().GetBlue() ); rOut << nTmp;
4429cdf0e10cSrcweir 
4430cdf0e10cSrcweir 		rOut << (sal_Int32) aHatch.GetDistance();
4431cdf0e10cSrcweir 		rOut << (sal_Int32) aHatch.GetAngle();
4432cdf0e10cSrcweir 	}
4433cdf0e10cSrcweir 
4434cdf0e10cSrcweir 	return rOut;
4435cdf0e10cSrcweir }
4436cdf0e10cSrcweir 
4437cdf0e10cSrcweir /*************************************************************************
4438cdf0e10cSrcweir |*
443997e8a929SArmin Le Grand |*	  const XHatch& XFillHatchItem::GetValue(const XHatchList* pTable) const
4440cdf0e10cSrcweir |*
4441cdf0e10cSrcweir |*	  Beschreibung
4442cdf0e10cSrcweir |*	  Ersterstellung	15.11.94
4443cdf0e10cSrcweir |*	  Letzte Aenderung	18.11.94
4444cdf0e10cSrcweir |*
4445cdf0e10cSrcweir *************************************************************************/
4446cdf0e10cSrcweir 
444797e8a929SArmin Le Grand const XHatch& XFillHatchItem::GetHatchValue(const XHatchList* pTable) const // GetValue -> GetHatchValue
4448cdf0e10cSrcweir {
4449cdf0e10cSrcweir 	if (!IsIndex())
4450cdf0e10cSrcweir 		return aHatch;
4451cdf0e10cSrcweir 	else
4452cdf0e10cSrcweir 		return pTable->GetHatch(GetIndex())->GetHatch();
4453cdf0e10cSrcweir }
4454cdf0e10cSrcweir 
4455cdf0e10cSrcweir //------------------------------------------------------------------------
4456cdf0e10cSrcweir 
4457cdf0e10cSrcweir SfxItemPresentation XFillHatchItem::GetPresentation
4458cdf0e10cSrcweir (
4459cdf0e10cSrcweir 	SfxItemPresentation ePres,
4460cdf0e10cSrcweir 	SfxMapUnit			/*eCoreUnit*/,
4461cdf0e10cSrcweir 	SfxMapUnit			/*ePresUnit*/,
4462cdf0e10cSrcweir     XubString&          rText, const IntlWrapper *
4463cdf0e10cSrcweir )	const
4464cdf0e10cSrcweir {
4465cdf0e10cSrcweir 	switch ( ePres )
4466cdf0e10cSrcweir 	{
4467cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NONE:
4468cdf0e10cSrcweir 			rText.Erase();
4469cdf0e10cSrcweir 			return ePres;
4470cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_NAMELESS:
4471cdf0e10cSrcweir 		case SFX_ITEM_PRESENTATION_COMPLETE:
4472cdf0e10cSrcweir 			rText = GetName();
4473cdf0e10cSrcweir 			return ePres;
4474cdf0e10cSrcweir 		default:
4475cdf0e10cSrcweir 			return SFX_ITEM_PRESENTATION_NONE;
4476cdf0e10cSrcweir 	}
4477cdf0e10cSrcweir }
4478cdf0e10cSrcweir 
4479cdf0e10cSrcweir //------------------------------------------------------------------------
4480cdf0e10cSrcweir 
4481cdf0e10cSrcweir FASTBOOL XFillHatchItem::HasMetrics() const
4482cdf0e10cSrcweir {
4483cdf0e10cSrcweir 	return sal_True;
4484cdf0e10cSrcweir }
4485cdf0e10cSrcweir 
4486cdf0e10cSrcweir //------------------------------------------------------------------------
4487cdf0e10cSrcweir 
4488cdf0e10cSrcweir FASTBOOL XFillHatchItem::ScaleMetrics(long nMul, long nDiv)
4489cdf0e10cSrcweir {
4490cdf0e10cSrcweir 	aHatch.SetDistance( ScaleMetricValue( aHatch.GetDistance(), nMul, nDiv ) );
4491cdf0e10cSrcweir 	return sal_True;
4492cdf0e10cSrcweir }
4493cdf0e10cSrcweir 
4494cdf0e10cSrcweir // -----------------------------------------------------------------------
4495cdf0e10cSrcweir sal_Bool XFillHatchItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const
4496cdf0e10cSrcweir {
4497cdf0e10cSrcweir //    sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
4498cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
4499cdf0e10cSrcweir 
4500cdf0e10cSrcweir 	switch ( nMemberId )
4501cdf0e10cSrcweir 	{
4502cdf0e10cSrcweir         case 0:
4503cdf0e10cSrcweir         {
4504cdf0e10cSrcweir             uno::Sequence< beans::PropertyValue > aPropSeq( 2 );
4505cdf0e10cSrcweir 
4506cdf0e10cSrcweir 			::com::sun::star::drawing::Hatch aUnoHatch;
4507cdf0e10cSrcweir 
4508cdf0e10cSrcweir 			aUnoHatch.Style = (::com::sun::star::drawing::HatchStyle)aHatch.GetHatchStyle();
4509cdf0e10cSrcweir 			aUnoHatch.Color = aHatch.GetColor().GetColor();
4510cdf0e10cSrcweir 			aUnoHatch.Distance = aHatch.GetDistance();
4511cdf0e10cSrcweir 			aUnoHatch.Angle = aHatch.GetAngle();
4512cdf0e10cSrcweir 
4513cdf0e10cSrcweir 			rtl::OUString aApiName;
4514cdf0e10cSrcweir 			SvxUnogetApiNameForItem( Which(), GetName(), aApiName );
4515cdf0e10cSrcweir             aPropSeq[0].Name    = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ));
4516cdf0e10cSrcweir             aPropSeq[0].Value   = uno::makeAny( aApiName );
4517cdf0e10cSrcweir             aPropSeq[1].Name    = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FillHatch" ));
4518cdf0e10cSrcweir             aPropSeq[1].Value   = uno::makeAny( aUnoHatch );
4519cdf0e10cSrcweir             rVal = uno::makeAny( aPropSeq );
4520cdf0e10cSrcweir             break;
4521cdf0e10cSrcweir         }
4522cdf0e10cSrcweir 
4523cdf0e10cSrcweir 		case MID_FILLHATCH:
4524cdf0e10cSrcweir 		{
4525cdf0e10cSrcweir 			::com::sun::star::drawing::Hatch aUnoHatch;
4526cdf0e10cSrcweir 
4527cdf0e10cSrcweir 			aUnoHatch.Style = (::com::sun::star::drawing::HatchStyle)aHatch.GetHatchStyle();
4528cdf0e10cSrcweir 			aUnoHatch.Color = aHatch.GetColor().GetColor();
4529cdf0e10cSrcweir 			aUnoHatch.Distance = aHatch.GetDistance();
4530cdf0e10cSrcweir 			aUnoHatch.Angle = aHatch.GetAngle();
4531cdf0e10cSrcweir 			rVal <<= aUnoHatch;
4532cdf0e10cSrcweir 			break;
4533cdf0e10cSrcweir 		}
4534cdf0e10cSrcweir 
4535cdf0e10cSrcweir 		case MID_NAME:
4536cdf0e10cSrcweir 		{
4537cdf0e10cSrcweir 			rtl::OUString aApiName;
4538cdf0e10cSrcweir 			SvxUnogetApiNameForItem( Which(), GetName(), aApiName );
4539cdf0e10cSrcweir 			rVal <<= aApiName;
4540cdf0e10cSrcweir 			break;
4541cdf0e10cSrcweir 		}
4542cdf0e10cSrcweir 
4543cdf0e10cSrcweir 		case MID_HATCH_STYLE:
4544cdf0e10cSrcweir 			rVal <<= (::com::sun::star::drawing::HatchStyle)aHatch.GetHatchStyle(); break;
4545cdf0e10cSrcweir 		case MID_HATCH_COLOR:
4546cdf0e10cSrcweir 			rVal <<= (sal_Int32)aHatch.GetColor().GetColor(); break;
4547cdf0e10cSrcweir 		case MID_HATCH_DISTANCE:
4548cdf0e10cSrcweir 			rVal <<= aHatch.GetDistance(); break;
4549cdf0e10cSrcweir 		case MID_HATCH_ANGLE:
4550cdf0e10cSrcweir 			rVal <<= aHatch.GetAngle(); break;
4551cdf0e10cSrcweir 
4552cdf0e10cSrcweir 		default: DBG_ERROR("Wrong MemberId!"); return sal_False;
4553cdf0e10cSrcweir 	}
4554cdf0e10cSrcweir 
4555cdf0e10cSrcweir 	return sal_True;
4556cdf0e10cSrcweir }
4557cdf0e10cSrcweir 
4558cdf0e10cSrcweir // -----------------------------------------------------------------------
4559cdf0e10cSrcweir sal_Bool XFillHatchItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId )
4560cdf0e10cSrcweir {
4561cdf0e10cSrcweir //    sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
4562cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
4563cdf0e10cSrcweir 
4564cdf0e10cSrcweir 	switch ( nMemberId )
4565cdf0e10cSrcweir 	{
4566cdf0e10cSrcweir         case 0:
4567cdf0e10cSrcweir         {
4568cdf0e10cSrcweir             uno::Sequence< beans::PropertyValue >   aPropSeq;
4569cdf0e10cSrcweir 			::com::sun::star::drawing::Hatch        aUnoHatch;
4570cdf0e10cSrcweir             rtl::OUString                           aName;
4571cdf0e10cSrcweir             bool                                    bHatch( false );
4572cdf0e10cSrcweir 
4573cdf0e10cSrcweir             if ( rVal >>= aPropSeq )
4574cdf0e10cSrcweir             {
4575cdf0e10cSrcweir                 for ( sal_Int32 n = 0; n < aPropSeq.getLength(); n++ )
4576cdf0e10cSrcweir                 {
4577cdf0e10cSrcweir                     if ( aPropSeq[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Name" )))
4578cdf0e10cSrcweir                         aPropSeq[n].Value >>= aName;
4579cdf0e10cSrcweir                     else if ( aPropSeq[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "FillHatch" )))
4580cdf0e10cSrcweir                     {
4581cdf0e10cSrcweir                         if ( aPropSeq[n].Value >>= aUnoHatch )
4582cdf0e10cSrcweir                             bHatch = true;
4583cdf0e10cSrcweir                     }
4584cdf0e10cSrcweir                 }
4585cdf0e10cSrcweir 
4586cdf0e10cSrcweir                 SetName( aName );
4587cdf0e10cSrcweir                 if ( bHatch )
4588cdf0e10cSrcweir                 {
4589cdf0e10cSrcweir                     aHatch.SetHatchStyle( (XHatchStyle)aUnoHatch.Style );
4590cdf0e10cSrcweir                     aHatch.SetColor( aUnoHatch.Color );
4591cdf0e10cSrcweir                     aHatch.SetDistance( aUnoHatch.Distance );
4592cdf0e10cSrcweir                     aHatch.SetAngle( aUnoHatch.Angle );
4593cdf0e10cSrcweir                 }
4594cdf0e10cSrcweir 
4595cdf0e10cSrcweir                 return sal_True;
4596cdf0e10cSrcweir             }
4597cdf0e10cSrcweir 
4598cdf0e10cSrcweir             return sal_False;
4599cdf0e10cSrcweir         }
4600cdf0e10cSrcweir 
4601cdf0e10cSrcweir 		case MID_FILLHATCH:
4602cdf0e10cSrcweir 		{
4603cdf0e10cSrcweir 			::com::sun::star::drawing::Hatch aUnoHatch;
4604cdf0e10cSrcweir 			if(!(rVal >>= aUnoHatch))
4605cdf0e10cSrcweir 				return sal_False;
4606cdf0e10cSrcweir 
4607cdf0e10cSrcweir 			aHatch.SetHatchStyle( (XHatchStyle)aUnoHatch.Style );
4608cdf0e10cSrcweir 			aHatch.SetColor( aUnoHatch.Color );
4609cdf0e10cSrcweir 			aHatch.SetDistance( aUnoHatch.Distance );
4610cdf0e10cSrcweir 			aHatch.SetAngle( aUnoHatch.Angle );
4611cdf0e10cSrcweir 			break;
4612cdf0e10cSrcweir 		}
4613cdf0e10cSrcweir 
4614cdf0e10cSrcweir 		case MID_NAME:
4615cdf0e10cSrcweir 		{
4616cdf0e10cSrcweir 			rtl::OUString aName;
4617cdf0e10cSrcweir 			if (!(rVal >>= aName ))
4618cdf0e10cSrcweir 				return sal_False;
4619cdf0e10cSrcweir 			SetName( aName );
4620cdf0e10cSrcweir 			break;
4621cdf0e10cSrcweir 		}
4622cdf0e10cSrcweir 
4623cdf0e10cSrcweir 		case MID_HATCH_STYLE:
4624cdf0e10cSrcweir 		{
4625cdf0e10cSrcweir 			sal_Int16 nVal = sal_Int16();
4626cdf0e10cSrcweir 			if (!(rVal >>= nVal ))
4627cdf0e10cSrcweir 				return sal_False;
4628cdf0e10cSrcweir 			aHatch.SetHatchStyle( (XHatchStyle)nVal );
4629cdf0e10cSrcweir 			break;
4630cdf0e10cSrcweir 		}
4631cdf0e10cSrcweir 
4632cdf0e10cSrcweir 		case MID_HATCH_COLOR:
4633cdf0e10cSrcweir 		case MID_HATCH_DISTANCE:
4634cdf0e10cSrcweir 		case MID_HATCH_ANGLE:
4635cdf0e10cSrcweir 		{
4636cdf0e10cSrcweir 			sal_Int32 nVal = 0;
4637cdf0e10cSrcweir 			if (!(rVal >>= nVal ))
4638cdf0e10cSrcweir 				return sal_False;
4639cdf0e10cSrcweir 
4640cdf0e10cSrcweir 			if ( nMemberId == MID_HATCH_COLOR )
4641cdf0e10cSrcweir 				aHatch.SetColor( nVal );
4642cdf0e10cSrcweir 			else if ( nMemberId == MID_HATCH_DISTANCE )
4643cdf0e10cSrcweir 				aHatch.SetDistance( nVal );
4644cdf0e10cSrcweir 			else
4645cdf0e10cSrcweir 				aHatch.SetAngle( nVal );
4646cdf0e10cSrcweir 			break;
4647cdf0e10cSrcweir 		}
4648cdf0e10cSrcweir 
4649cdf0e10cSrcweir 		default: DBG_ERROR("Wrong MemberId!"); return sal_False;
4650cdf0e10cSrcweir 	}
4651cdf0e10cSrcweir 
4652cdf0e10cSrcweir 	return sal_True;
4653cdf0e10cSrcweir }
4654cdf0e10cSrcweir 
4655cdf0e10cSrcweir sal_Bool XFillHatchItem::CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 )
4656cdf0e10cSrcweir {
4657cdf0e10cSrcweir 	return ((XFillHatchItem*)p1)->GetHatchValue() == ((XFillHatchItem*)p2)->GetHatchValue();
4658cdf0e10cSrcweir }
4659cdf0e10cSrcweir 
4660cdf0e10cSrcweir XFillHatchItem* XFillHatchItem::checkForUniqueItem( SdrModel* pModel ) const
4661cdf0e10cSrcweir {
4662cdf0e10cSrcweir 	if( pModel )
4663cdf0e10cSrcweir 	{
4664cdf0e10cSrcweir 		const String aUniqueName = NameOrIndex::CheckNamedItem(	this,
4665cdf0e10cSrcweir 																XATTR_FILLHATCH,
4666cdf0e10cSrcweir 																&pModel->GetItemPool(),
4667cdf0e10cSrcweir 																pModel->GetStyleSheetPool() ? &pModel->GetStyleSheetPool()->GetPool() : NULL,
4668cdf0e10cSrcweir 																XFillHatchItem::CompareValueFunc,
4669cdf0e10cSrcweir 																RID_SVXSTR_HATCH10,
4670*c7be74b1SArmin Le Grand 																pModel->GetHatchListFromSdrModel().get() );
4671cdf0e10cSrcweir 
4672cdf0e10cSrcweir 		// if the given name is not valid, replace it!
4673cdf0e10cSrcweir 		if( aUniqueName != GetName() )
4674cdf0e10cSrcweir 		{
4675cdf0e10cSrcweir 			return new XFillHatchItem( aUniqueName, aHatch );
4676cdf0e10cSrcweir 		}
4677cdf0e10cSrcweir 	}
4678cdf0e10cSrcweir 
4679cdf0e10cSrcweir 	return (XFillHatchItem*)this;
4680cdf0e10cSrcweir }
4681cdf0e10cSrcweir 
4682cdf0e10cSrcweir //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4683cdf0e10cSrcweir //							FormText-Attribute
4684cdf0e10cSrcweir //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4685cdf0e10cSrcweir 
4686cdf0e10cSrcweir //-------------------------
4687cdf0e10cSrcweir // class XFormTextStyleItem
4688cdf0e10cSrcweir //-------------------------
4689cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFormTextStyleItem, SfxEnumItem);
4690cdf0e10cSrcweir 
4691cdf0e10cSrcweir /*************************************************************************
4692cdf0e10cSrcweir |*
4693cdf0e10cSrcweir |*	  XFormTextStyleItem::XFormTextStyleItem()
4694cdf0e10cSrcweir |*
4695cdf0e10cSrcweir |*	  Beschreibung
4696cdf0e10cSrcweir |*	  Ersterstellung	02.02.95 ESO
4697cdf0e10cSrcweir |*	  Letzte Aenderung	02.02.95 ESO
4698cdf0e10cSrcweir |*
4699cdf0e10cSrcweir *************************************************************************/
4700cdf0e10cSrcweir 
4701cdf0e10cSrcweir XFormTextStyleItem::XFormTextStyleItem(XFormTextStyle eTheStyle) :
4702cdf0e10cSrcweir 	SfxEnumItem(XATTR_FORMTXTSTYLE, sal::static_int_cast< sal_uInt16 >(eTheStyle))
4703cdf0e10cSrcweir {
4704cdf0e10cSrcweir }
4705cdf0e10cSrcweir 
4706cdf0e10cSrcweir /*************************************************************************
4707cdf0e10cSrcweir |*
4708cdf0e10cSrcweir |*	  XFormTextStyleItem::XFormTextStyleItem(SvStream& rIn)
4709cdf0e10cSrcweir |*
4710cdf0e10cSrcweir |*	  Beschreibung
4711cdf0e10cSrcweir |*	  Ersterstellung	02.02.95 ESO
4712cdf0e10cSrcweir |*	  Letzte Aenderung	02.02.95 ESO
4713cdf0e10cSrcweir |*
4714cdf0e10cSrcweir *************************************************************************/
4715cdf0e10cSrcweir 
4716cdf0e10cSrcweir XFormTextStyleItem::XFormTextStyleItem(SvStream& rIn) :
4717cdf0e10cSrcweir 	SfxEnumItem(XATTR_FORMTXTSTYLE, rIn)
4718cdf0e10cSrcweir {
4719cdf0e10cSrcweir }
4720cdf0e10cSrcweir 
4721cdf0e10cSrcweir /*************************************************************************
4722cdf0e10cSrcweir |*
4723cdf0e10cSrcweir |*	  XFormTextStyleItem::Clone(SfxItemPool* pPool) const
4724cdf0e10cSrcweir |*
4725cdf0e10cSrcweir |*	  Beschreibung
4726cdf0e10cSrcweir |*	  Ersterstellung	02.02.95 ESO
4727cdf0e10cSrcweir |*	  Letzte Aenderung	02.02.95 ESO
4728cdf0e10cSrcweir |*
4729cdf0e10cSrcweir *************************************************************************/
4730cdf0e10cSrcweir 
4731cdf0e10cSrcweir SfxPoolItem* XFormTextStyleItem::Clone(SfxItemPool* /*pPool*/) const
4732cdf0e10cSrcweir {
4733cdf0e10cSrcweir 	return new XFormTextStyleItem( *this );
4734cdf0e10cSrcweir }
4735cdf0e10cSrcweir 
4736cdf0e10cSrcweir /*************************************************************************
4737cdf0e10cSrcweir |*
4738cdf0e10cSrcweir |*	  SfxPoolItem* XFormTextStyleItem::Create(SvStream& rIn, sal_uInt16 nVer) const
4739cdf0e10cSrcweir |*
4740cdf0e10cSrcweir |*	  Beschreibung
4741cdf0e10cSrcweir |*	  Ersterstellung	02.02.95 ESO
4742cdf0e10cSrcweir |*	  Letzte Aenderung	02.02.95 ESO
4743cdf0e10cSrcweir |*
4744cdf0e10cSrcweir *************************************************************************/
4745cdf0e10cSrcweir 
4746cdf0e10cSrcweir SfxPoolItem* XFormTextStyleItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
4747cdf0e10cSrcweir {
4748cdf0e10cSrcweir 	return new XFormTextStyleItem(rIn);
4749cdf0e10cSrcweir }
4750cdf0e10cSrcweir 
4751cdf0e10cSrcweir /*************************************************************************
4752cdf0e10cSrcweir |*
4753cdf0e10cSrcweir |*
4754cdf0e10cSrcweir |*
4755cdf0e10cSrcweir \*************************************************************************/
4756cdf0e10cSrcweir 
4757cdf0e10cSrcweir sal_uInt16 XFormTextStyleItem::GetValueCount() const
4758cdf0e10cSrcweir {
4759cdf0e10cSrcweir 	return 5;
4760cdf0e10cSrcweir }
4761cdf0e10cSrcweir 
4762cdf0e10cSrcweir /*************************************************************************
4763cdf0e10cSrcweir |*
4764cdf0e10cSrcweir |*
4765cdf0e10cSrcweir |*
4766cdf0e10cSrcweir \*************************************************************************/
4767cdf0e10cSrcweir 
4768cdf0e10cSrcweir // #FontWork#
4769cdf0e10cSrcweir sal_Bool XFormTextStyleItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
4770cdf0e10cSrcweir {
4771cdf0e10cSrcweir 	rVal <<= (sal_Int32)GetValue();
4772cdf0e10cSrcweir 	return sal_True;
4773cdf0e10cSrcweir }
4774cdf0e10cSrcweir 
4775cdf0e10cSrcweir /*************************************************************************
4776cdf0e10cSrcweir |*
4777cdf0e10cSrcweir |*
4778cdf0e10cSrcweir |*
4779cdf0e10cSrcweir \*************************************************************************/
4780cdf0e10cSrcweir 
4781cdf0e10cSrcweir // #FontWork#
4782cdf0e10cSrcweir sal_Bool XFormTextStyleItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
4783cdf0e10cSrcweir {
4784cdf0e10cSrcweir 	sal_Int32 nValue = 0;
4785cdf0e10cSrcweir 	rVal >>= nValue;
4786cdf0e10cSrcweir 	SetValue(sal::static_int_cast< sal_uInt16 >(nValue));
4787cdf0e10cSrcweir 
4788cdf0e10cSrcweir 	return sal_True;
4789cdf0e10cSrcweir }
4790cdf0e10cSrcweir 
4791cdf0e10cSrcweir //-------------------------
4792cdf0e10cSrcweir // class XFormTextAdjustItem
4793cdf0e10cSrcweir //-------------------------
4794cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFormTextAdjustItem, SfxEnumItem);
4795cdf0e10cSrcweir 
4796cdf0e10cSrcweir /*************************************************************************
4797cdf0e10cSrcweir |*
4798cdf0e10cSrcweir |*	  XFormTextAdjustItem::XFormTextAdjustItem()
4799cdf0e10cSrcweir |*
4800cdf0e10cSrcweir |*	  Beschreibung
4801cdf0e10cSrcweir |*	  Ersterstellung	02.02.95 ESO
4802cdf0e10cSrcweir |*	  Letzte Aenderung	02.02.95 ESO
4803cdf0e10cSrcweir |*
4804cdf0e10cSrcweir *************************************************************************/
4805cdf0e10cSrcweir 
4806cdf0e10cSrcweir XFormTextAdjustItem::XFormTextAdjustItem(XFormTextAdjust eTheAdjust) :
4807cdf0e10cSrcweir 	SfxEnumItem(XATTR_FORMTXTADJUST, sal::static_int_cast< sal_uInt16 >(eTheAdjust))
4808cdf0e10cSrcweir {
4809cdf0e10cSrcweir }
4810cdf0e10cSrcweir 
4811cdf0e10cSrcweir /*************************************************************************
4812cdf0e10cSrcweir |*
4813cdf0e10cSrcweir |*	  XFormTextAdjustItem::XFormTextAdjustItem(SvStream& rIn)
4814cdf0e10cSrcweir |*
4815cdf0e10cSrcweir |*	  Beschreibung
4816cdf0e10cSrcweir |*	  Ersterstellung	02.02.95 ESO
4817cdf0e10cSrcweir |*	  Letzte Aenderung	02.02.95 ESO
4818cdf0e10cSrcweir |*
4819cdf0e10cSrcweir *************************************************************************/
4820cdf0e10cSrcweir 
4821cdf0e10cSrcweir XFormTextAdjustItem::XFormTextAdjustItem(SvStream& rIn) :
4822cdf0e10cSrcweir 	SfxEnumItem(XATTR_FORMTXTADJUST, rIn)
4823cdf0e10cSrcweir {
4824cdf0e10cSrcweir }
4825cdf0e10cSrcweir 
4826cdf0e10cSrcweir /*************************************************************************
4827cdf0e10cSrcweir |*
4828cdf0e10cSrcweir |*	  XFormTextAdjustItem::Clone(SfxItemPool* pPool) const
4829cdf0e10cSrcweir |*
4830cdf0e10cSrcweir |*	  Beschreibung
4831cdf0e10cSrcweir |*	  Ersterstellung	02.02.95 ESO
4832cdf0e10cSrcweir |*	  Letzte Aenderung	02.02.95 ESO
4833cdf0e10cSrcweir |*
4834cdf0e10cSrcweir *************************************************************************/
4835cdf0e10cSrcweir 
4836cdf0e10cSrcweir SfxPoolItem* XFormTextAdjustItem::Clone(SfxItemPool* /*pPool*/) const
4837cdf0e10cSrcweir {
4838cdf0e10cSrcweir 	return new XFormTextAdjustItem( *this );
4839cdf0e10cSrcweir }
4840cdf0e10cSrcweir 
4841cdf0e10cSrcweir /*************************************************************************
4842cdf0e10cSrcweir |*
4843cdf0e10cSrcweir |*	  SfxPoolItem* XFormTextAdjustItem::Create(SvStream& rIn, sal_uInt16 nVer) const
4844cdf0e10cSrcweir |*
4845cdf0e10cSrcweir |*	  Beschreibung
4846cdf0e10cSrcweir |*	  Ersterstellung	02.02.95 ESO
4847cdf0e10cSrcweir |*	  Letzte Aenderung	02.02.95 ESO
4848cdf0e10cSrcweir |*
4849cdf0e10cSrcweir *************************************************************************/
4850cdf0e10cSrcweir 
4851cdf0e10cSrcweir SfxPoolItem* XFormTextAdjustItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
4852cdf0e10cSrcweir {
4853cdf0e10cSrcweir 	return new XFormTextAdjustItem(rIn);
4854cdf0e10cSrcweir }
4855cdf0e10cSrcweir 
4856cdf0e10cSrcweir /*************************************************************************
4857cdf0e10cSrcweir |*
4858cdf0e10cSrcweir |*
4859cdf0e10cSrcweir |*
4860cdf0e10cSrcweir \*************************************************************************/
4861cdf0e10cSrcweir 
4862cdf0e10cSrcweir sal_uInt16 XFormTextAdjustItem::GetValueCount() const
4863cdf0e10cSrcweir {
4864cdf0e10cSrcweir 	return 4;
4865cdf0e10cSrcweir }
4866cdf0e10cSrcweir 
4867cdf0e10cSrcweir /*************************************************************************
4868cdf0e10cSrcweir |*
4869cdf0e10cSrcweir |*
4870cdf0e10cSrcweir |*
4871cdf0e10cSrcweir \*************************************************************************/
4872cdf0e10cSrcweir 
4873cdf0e10cSrcweir // #FontWork#
4874cdf0e10cSrcweir sal_Bool XFormTextAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
4875cdf0e10cSrcweir {
4876cdf0e10cSrcweir 	rVal <<= (sal_Int32)GetValue();
4877cdf0e10cSrcweir 	return sal_True;
4878cdf0e10cSrcweir }
4879cdf0e10cSrcweir 
4880cdf0e10cSrcweir /*************************************************************************
4881cdf0e10cSrcweir |*
4882cdf0e10cSrcweir |*
4883cdf0e10cSrcweir |*
4884cdf0e10cSrcweir \*************************************************************************/
4885cdf0e10cSrcweir 
4886cdf0e10cSrcweir // #FontWork#
4887cdf0e10cSrcweir sal_Bool XFormTextAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
4888cdf0e10cSrcweir {
4889cdf0e10cSrcweir 	sal_Int32 nValue = 0;
4890cdf0e10cSrcweir 	rVal >>= nValue;
4891cdf0e10cSrcweir 	SetValue(sal::static_int_cast< sal_uInt16 >(nValue));
4892cdf0e10cSrcweir 
4893cdf0e10cSrcweir 	return sal_True;
4894cdf0e10cSrcweir }
4895cdf0e10cSrcweir 
4896cdf0e10cSrcweir //----------------------------
4897cdf0e10cSrcweir // class XFormTextDistanceItem
4898cdf0e10cSrcweir //----------------------------
4899cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFormTextDistanceItem, SfxMetricItem);
4900cdf0e10cSrcweir 
4901cdf0e10cSrcweir /*************************************************************************
4902cdf0e10cSrcweir |*
4903cdf0e10cSrcweir |*	  XFormTextDistanceItem::XFormTextDistanceItem()
4904cdf0e10cSrcweir |*
4905cdf0e10cSrcweir |*	  Beschreibung
4906cdf0e10cSrcweir |*	  Ersterstellung	02.02.95 ESO
4907cdf0e10cSrcweir |*	  Letzte Aenderung	02.02.95 ESO
4908cdf0e10cSrcweir |*
4909cdf0e10cSrcweir *************************************************************************/
4910cdf0e10cSrcweir 
4911cdf0e10cSrcweir XFormTextDistanceItem::XFormTextDistanceItem(long nDist) :
4912cdf0e10cSrcweir 	SfxMetricItem(XATTR_FORMTXTDISTANCE, nDist)
4913cdf0e10cSrcweir {
4914cdf0e10cSrcweir }
4915cdf0e10cSrcweir 
4916cdf0e10cSrcweir /*************************************************************************
4917cdf0e10cSrcweir |*
4918cdf0e10cSrcweir |*	  XFormTextDistanceItem::XFormTextDistanceItem(SvStream& rIn)
4919cdf0e10cSrcweir |*
4920cdf0e10cSrcweir |*	  Beschreibung
4921cdf0e10cSrcweir |*	  Ersterstellung	02.02.95 ESO
4922cdf0e10cSrcweir |*	  Letzte Aenderung	02.02.95 ESO
4923cdf0e10cSrcweir |*
4924cdf0e10cSrcweir *************************************************************************/
4925cdf0e10cSrcweir 
4926cdf0e10cSrcweir XFormTextDistanceItem::XFormTextDistanceItem(SvStream& rIn) :
4927cdf0e10cSrcweir 	SfxMetricItem(XATTR_FORMTXTDISTANCE, rIn)
4928cdf0e10cSrcweir {
4929cdf0e10cSrcweir }
4930cdf0e10cSrcweir 
4931cdf0e10cSrcweir /*************************************************************************
4932cdf0e10cSrcweir |*
4933cdf0e10cSrcweir |*	  XFormTextDistanceItem::Clone(SfxItemPool* pPool) const
4934cdf0e10cSrcweir |*
4935cdf0e10cSrcweir |*	  Beschreibung
4936cdf0e10cSrcweir |*	  Ersterstellung	02.02.95 ESO
4937cdf0e10cSrcweir |*	  Letzte Aenderung	02.02.95 ESO
4938cdf0e10cSrcweir |*
4939cdf0e10cSrcweir *************************************************************************/
4940cdf0e10cSrcweir 
4941cdf0e10cSrcweir SfxPoolItem* XFormTextDistanceItem::Clone(SfxItemPool* /*pPool*/) const
4942cdf0e10cSrcweir {
4943cdf0e10cSrcweir 	return new XFormTextDistanceItem(*this);
4944cdf0e10cSrcweir }
4945cdf0e10cSrcweir 
4946cdf0e10cSrcweir /*************************************************************************
4947cdf0e10cSrcweir |*
4948cdf0e10cSrcweir |*	  SfxPoolItem* XFormTextDistanceItem::Create(SvStream& rIn, sal_uInt16 nVer) const
4949cdf0e10cSrcweir |*
4950cdf0e10cSrcweir |*	  Beschreibung
4951cdf0e10cSrcweir |*	  Ersterstellung	02.02.95 ESO
4952cdf0e10cSrcweir |*	  Letzte Aenderung	02.02.95 ESO
4953cdf0e10cSrcweir |*
4954cdf0e10cSrcweir *************************************************************************/
4955cdf0e10cSrcweir 
4956cdf0e10cSrcweir SfxPoolItem* XFormTextDistanceItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
4957cdf0e10cSrcweir {
4958cdf0e10cSrcweir 	return new XFormTextDistanceItem(rIn);
4959cdf0e10cSrcweir }
4960cdf0e10cSrcweir 
4961cdf0e10cSrcweir //-------------------------
4962cdf0e10cSrcweir // class XFormTextStartItem
4963cdf0e10cSrcweir //-------------------------
4964cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFormTextStartItem, SfxMetricItem);
4965cdf0e10cSrcweir 
4966cdf0e10cSrcweir /*************************************************************************
4967cdf0e10cSrcweir |*
4968cdf0e10cSrcweir |*	  XFormTextStartItem::XFormTextStartItem(long nStart)
4969cdf0e10cSrcweir |*
4970cdf0e10cSrcweir |*	  Beschreibung
4971cdf0e10cSrcweir |*	  Ersterstellung	02.02.95 ESO
4972cdf0e10cSrcweir |*	  Letzte Aenderung	02.02.95 ESO
4973cdf0e10cSrcweir |*
4974cdf0e10cSrcweir *************************************************************************/
4975cdf0e10cSrcweir 
4976cdf0e10cSrcweir XFormTextStartItem::XFormTextStartItem(long nStart) :
4977cdf0e10cSrcweir 	SfxMetricItem(XATTR_FORMTXTSTART, nStart)
4978cdf0e10cSrcweir {
4979cdf0e10cSrcweir }
4980cdf0e10cSrcweir 
4981cdf0e10cSrcweir /*************************************************************************
4982cdf0e10cSrcweir |*
4983cdf0e10cSrcweir |*	  XFormTextStartItem::XFormTextStartItem(SvStream& rIn)
4984cdf0e10cSrcweir |*
4985cdf0e10cSrcweir |*	  Beschreibung
4986cdf0e10cSrcweir |*	  Ersterstellung	02.02.95 ESO
4987cdf0e10cSrcweir |*	  Letzte Aenderung	02.02.95 ESO
4988cdf0e10cSrcweir |*
4989cdf0e10cSrcweir *************************************************************************/
4990cdf0e10cSrcweir 
4991cdf0e10cSrcweir XFormTextStartItem::XFormTextStartItem(SvStream& rIn) :
4992cdf0e10cSrcweir 	SfxMetricItem(XATTR_FORMTXTSTART, rIn)
4993cdf0e10cSrcweir {
4994cdf0e10cSrcweir }
4995cdf0e10cSrcweir 
4996cdf0e10cSrcweir /*************************************************************************
4997cdf0e10cSrcweir |*
4998cdf0e10cSrcweir |*	  XFormTextStartItem::Clone(SfxItemPool* pPool) const
4999cdf0e10cSrcweir |*
5000cdf0e10cSrcweir |*	  Beschreibung
5001cdf0e10cSrcweir |*	  Ersterstellung	02.02.95 ESO
5002cdf0e10cSrcweir |*	  Letzte Aenderung	02.02.95 ESO
5003cdf0e10cSrcweir |*
5004cdf0e10cSrcweir *************************************************************************/
5005cdf0e10cSrcweir 
5006cdf0e10cSrcweir SfxPoolItem* XFormTextStartItem::Clone(SfxItemPool* /*pPool*/) const
5007cdf0e10cSrcweir {
5008cdf0e10cSrcweir 	return new XFormTextStartItem(*this);
5009cdf0e10cSrcweir }
5010cdf0e10cSrcweir 
5011cdf0e10cSrcweir /*************************************************************************
5012cdf0e10cSrcweir |*
5013cdf0e10cSrcweir |*	  SfxPoolItem* XFormTextStartItem::Create(SvStream& rIn, sal_uInt16 nVer) const
5014cdf0e10cSrcweir |*
5015cdf0e10cSrcweir |*	  Beschreibung
5016cdf0e10cSrcweir |*	  Ersterstellung	02.02.95 ESO
5017cdf0e10cSrcweir |*	  Letzte Aenderung	02.02.95 ESO
5018cdf0e10cSrcweir |*
5019cdf0e10cSrcweir *************************************************************************/
5020cdf0e10cSrcweir 
5021cdf0e10cSrcweir SfxPoolItem* XFormTextStartItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
5022cdf0e10cSrcweir {
5023cdf0e10cSrcweir 	return new XFormTextStartItem(rIn);
5024cdf0e10cSrcweir }
5025cdf0e10cSrcweir 
5026cdf0e10cSrcweir // -------------------------
5027cdf0e10cSrcweir // class XFormTextMirrorItem
5028cdf0e10cSrcweir // -------------------------
5029cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFormTextMirrorItem, SfxBoolItem);
5030cdf0e10cSrcweir 
5031cdf0e10cSrcweir /*************************************************************************
5032cdf0e10cSrcweir |*
5033cdf0e10cSrcweir |*	  XFormTextMirrorItem::XFormTextMirrorItem(sal_Bool bMirror)
5034cdf0e10cSrcweir |*
5035cdf0e10cSrcweir |*	  Ersterstellung	06.02.95 ESO
5036cdf0e10cSrcweir |*	  Letzte Aenderung	06.02.95 ESO
5037cdf0e10cSrcweir |*
5038cdf0e10cSrcweir *************************************************************************/
5039cdf0e10cSrcweir 
5040cdf0e10cSrcweir XFormTextMirrorItem::XFormTextMirrorItem(sal_Bool bMirror) :
5041cdf0e10cSrcweir 	SfxBoolItem(XATTR_FORMTXTMIRROR, bMirror)
5042cdf0e10cSrcweir {
5043cdf0e10cSrcweir }
5044cdf0e10cSrcweir 
5045cdf0e10cSrcweir /*************************************************************************
5046cdf0e10cSrcweir |*
5047cdf0e10cSrcweir |*	  XFormTextMirrorItem::XFormTextMirrorItem(SvStream& rIn)
5048cdf0e10cSrcweir |*
5049cdf0e10cSrcweir |*	  Ersterstellung	06.02.95 ESO
5050cdf0e10cSrcweir |*	  Letzte Aenderung	06.02.95 ESO
5051cdf0e10cSrcweir |*
5052cdf0e10cSrcweir *************************************************************************/
5053cdf0e10cSrcweir 
5054cdf0e10cSrcweir XFormTextMirrorItem::XFormTextMirrorItem(SvStream& rIn) :
5055cdf0e10cSrcweir 	SfxBoolItem(XATTR_FORMTXTMIRROR, rIn)
5056cdf0e10cSrcweir {
5057cdf0e10cSrcweir }
5058cdf0e10cSrcweir 
5059cdf0e10cSrcweir /*************************************************************************
5060cdf0e10cSrcweir |*
5061cdf0e10cSrcweir |*	  XFormTextMirrorItem::Clone(SfxItemPool* pPool) const
5062cdf0e10cSrcweir |*
5063cdf0e10cSrcweir |*	  Ersterstellung	06.02.95 ESO
5064cdf0e10cSrcweir |*	  Letzte Aenderung	06.02.95 ESO
5065cdf0e10cSrcweir |*
5066cdf0e10cSrcweir *************************************************************************/
5067cdf0e10cSrcweir 
5068cdf0e10cSrcweir SfxPoolItem* XFormTextMirrorItem::Clone(SfxItemPool* /*pPool*/) const
5069cdf0e10cSrcweir {
5070cdf0e10cSrcweir 	return new XFormTextMirrorItem(*this);
5071cdf0e10cSrcweir }
5072cdf0e10cSrcweir 
5073cdf0e10cSrcweir /*************************************************************************
5074cdf0e10cSrcweir |*
5075cdf0e10cSrcweir |*	  SfxPoolItem* XFormTextMirrorItem::Create(SvStream& rIn, sal_uInt16 nVer)
5076cdf0e10cSrcweir |*												const
5077cdf0e10cSrcweir |*
5078cdf0e10cSrcweir |*	  Ersterstellung	06.02.95 ESO
5079cdf0e10cSrcweir |*	  Letzte Aenderung	06.02.95 ESO
5080cdf0e10cSrcweir |*
5081cdf0e10cSrcweir *************************************************************************/
5082cdf0e10cSrcweir 
5083cdf0e10cSrcweir SfxPoolItem* XFormTextMirrorItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
5084cdf0e10cSrcweir {
5085cdf0e10cSrcweir 	return new XFormTextMirrorItem(rIn);
5086cdf0e10cSrcweir }
5087cdf0e10cSrcweir 
5088cdf0e10cSrcweir 
5089cdf0e10cSrcweir // --------------------------
5090cdf0e10cSrcweir // class XFormTextOutlineItem
5091cdf0e10cSrcweir // --------------------------
5092cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFormTextOutlineItem, SfxBoolItem);
5093cdf0e10cSrcweir 
5094cdf0e10cSrcweir /*************************************************************************
5095cdf0e10cSrcweir |*
5096cdf0e10cSrcweir |*	  XFormTextOutlineItem::XFormTextOutlineItem()
5097cdf0e10cSrcweir |*
5098cdf0e10cSrcweir |*	  Ersterstellung	27.06.95 ESO
5099cdf0e10cSrcweir |*	  Letzte Aenderung	27.06.95 ESO
5100cdf0e10cSrcweir |*
5101cdf0e10cSrcweir *************************************************************************/
5102cdf0e10cSrcweir 
5103cdf0e10cSrcweir XFormTextOutlineItem::XFormTextOutlineItem(sal_Bool bOutline) :
5104cdf0e10cSrcweir 	SfxBoolItem(XATTR_FORMTXTOUTLINE, bOutline)
5105cdf0e10cSrcweir {
5106cdf0e10cSrcweir }
5107cdf0e10cSrcweir 
5108cdf0e10cSrcweir /*************************************************************************
5109cdf0e10cSrcweir |*
5110cdf0e10cSrcweir |*	  XFormTextOutlineItem::XFormTextOutlineItem(SvStream& rIn)
5111cdf0e10cSrcweir |*
5112cdf0e10cSrcweir |*	  Ersterstellung	27.06.95 ESO
5113cdf0e10cSrcweir |*	  Letzte Aenderung	27.06.95 ESO
5114cdf0e10cSrcweir |*
5115cdf0e10cSrcweir *************************************************************************/
5116cdf0e10cSrcweir 
5117cdf0e10cSrcweir XFormTextOutlineItem::XFormTextOutlineItem(SvStream& rIn) :
5118cdf0e10cSrcweir 	SfxBoolItem(XATTR_FORMTXTOUTLINE, rIn)
5119cdf0e10cSrcweir {
5120cdf0e10cSrcweir }
5121cdf0e10cSrcweir 
5122cdf0e10cSrcweir /*************************************************************************
5123cdf0e10cSrcweir |*
5124cdf0e10cSrcweir |*	  XFormTextOutlineItem::Clone(SfxItemPool* pPool) const
5125cdf0e10cSrcweir |*
5126cdf0e10cSrcweir |*	  Ersterstellung	27.06.95 ESO
5127cdf0e10cSrcweir |*	  Letzte Aenderung	27.06.95 ESO
5128cdf0e10cSrcweir |*
5129cdf0e10cSrcweir *************************************************************************/
5130cdf0e10cSrcweir 
5131cdf0e10cSrcweir SfxPoolItem* XFormTextOutlineItem::Clone(SfxItemPool* /*pPool*/) const
5132cdf0e10cSrcweir {
5133cdf0e10cSrcweir 	return new XFormTextOutlineItem(*this);
5134cdf0e10cSrcweir }
5135cdf0e10cSrcweir 
5136cdf0e10cSrcweir /*************************************************************************
5137cdf0e10cSrcweir |*
5138cdf0e10cSrcweir |*	  SfxPoolItem* XFormTextOutlineItem::Create(SvStream& rIn, sal_uInt16 nVer)
5139cdf0e10cSrcweir |*												const
5140cdf0e10cSrcweir |*
5141cdf0e10cSrcweir |*	  Ersterstellung	27.06.95 ESO
5142cdf0e10cSrcweir |*	  Letzte Aenderung	27.06.95 ESO
5143cdf0e10cSrcweir |*
5144cdf0e10cSrcweir *************************************************************************/
5145cdf0e10cSrcweir 
5146cdf0e10cSrcweir SfxPoolItem* XFormTextOutlineItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
5147cdf0e10cSrcweir {
5148cdf0e10cSrcweir 	return new XFormTextOutlineItem(rIn);
5149cdf0e10cSrcweir }
5150cdf0e10cSrcweir 
5151cdf0e10cSrcweir //--------------------------
5152cdf0e10cSrcweir // class XFormTextShadowItem
5153cdf0e10cSrcweir //--------------------------
5154cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFormTextShadowItem, SfxEnumItem);
5155cdf0e10cSrcweir 
5156cdf0e10cSrcweir /*************************************************************************
5157cdf0e10cSrcweir |*
5158cdf0e10cSrcweir |*	  XFormTextShadowItem::XFormTextShadowItem()
5159cdf0e10cSrcweir |*
5160cdf0e10cSrcweir |*	  Beschreibung
5161cdf0e10cSrcweir |*	  Ersterstellung	27.06.95
5162cdf0e10cSrcweir |*	  Letzte Aenderung	27.06.95
5163cdf0e10cSrcweir |*
5164cdf0e10cSrcweir *************************************************************************/
5165cdf0e10cSrcweir 
5166cdf0e10cSrcweir XFormTextShadowItem::XFormTextShadowItem(XFormTextShadow eFormTextShadow) :
5167cdf0e10cSrcweir 	SfxEnumItem(
5168cdf0e10cSrcweir         XATTR_FORMTXTSHADOW, sal::static_int_cast< sal_uInt16 >(eFormTextShadow))
5169cdf0e10cSrcweir {
5170cdf0e10cSrcweir }
5171cdf0e10cSrcweir 
5172cdf0e10cSrcweir /*************************************************************************
5173cdf0e10cSrcweir |*
5174cdf0e10cSrcweir |*	  XFormTextShadowItem::XFormTextShadowItem(SvStream& rIn)
5175cdf0e10cSrcweir |*
5176cdf0e10cSrcweir |*	  Beschreibung
5177cdf0e10cSrcweir |*	  Ersterstellung	27.06.95
5178cdf0e10cSrcweir |*	  Letzte Aenderung	27.06.95
5179cdf0e10cSrcweir |*
5180cdf0e10cSrcweir *************************************************************************/
5181cdf0e10cSrcweir 
5182cdf0e10cSrcweir XFormTextShadowItem::XFormTextShadowItem(SvStream& rIn) :
5183cdf0e10cSrcweir 	SfxEnumItem(XATTR_FORMTXTSHADOW, rIn)
5184cdf0e10cSrcweir {
5185cdf0e10cSrcweir }
5186cdf0e10cSrcweir 
5187cdf0e10cSrcweir /*************************************************************************
5188cdf0e10cSrcweir |*
5189cdf0e10cSrcweir |*	  XFormTextShadowItem::Clone(SfxItemPool* pPool) const
5190cdf0e10cSrcweir |*
5191cdf0e10cSrcweir |*	  Beschreibung
5192cdf0e10cSrcweir |*	  Ersterstellung	27.06.95
5193cdf0e10cSrcweir |*	  Letzte Aenderung	27.06.95
5194cdf0e10cSrcweir |*
5195cdf0e10cSrcweir *************************************************************************/
5196cdf0e10cSrcweir 
5197cdf0e10cSrcweir SfxPoolItem* XFormTextShadowItem::Clone(SfxItemPool* /*pPool*/) const
5198cdf0e10cSrcweir {
5199cdf0e10cSrcweir 	return new XFormTextShadowItem( *this );
5200cdf0e10cSrcweir }
5201cdf0e10cSrcweir 
5202cdf0e10cSrcweir /*************************************************************************
5203cdf0e10cSrcweir |*
5204cdf0e10cSrcweir |*	  SfxPoolItem* XFormTextShadowItem::Create(SvStream& rIn, sal_uInt16 nVer) const
5205cdf0e10cSrcweir |*
5206cdf0e10cSrcweir |*	  Beschreibung
5207cdf0e10cSrcweir |*	  Ersterstellung	27.06.95
5208cdf0e10cSrcweir |*	  Letzte Aenderung	27.06.95
5209cdf0e10cSrcweir |*
5210cdf0e10cSrcweir *************************************************************************/
5211cdf0e10cSrcweir 
5212cdf0e10cSrcweir SfxPoolItem* XFormTextShadowItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
5213cdf0e10cSrcweir {
5214cdf0e10cSrcweir 	return new XFormTextShadowItem(rIn);
5215cdf0e10cSrcweir }
5216cdf0e10cSrcweir 
5217cdf0e10cSrcweir 
5218cdf0e10cSrcweir /*************************************************************************
5219cdf0e10cSrcweir |*
5220cdf0e10cSrcweir |*
5221cdf0e10cSrcweir |*
5222cdf0e10cSrcweir \*************************************************************************/
5223cdf0e10cSrcweir 
5224cdf0e10cSrcweir sal_uInt16 XFormTextShadowItem::GetValueCount() const
5225cdf0e10cSrcweir {
5226cdf0e10cSrcweir 	return 3;
5227cdf0e10cSrcweir }
5228cdf0e10cSrcweir 
5229cdf0e10cSrcweir /*************************************************************************
5230cdf0e10cSrcweir |*
5231cdf0e10cSrcweir |*
5232cdf0e10cSrcweir |*
5233cdf0e10cSrcweir \*************************************************************************/
5234cdf0e10cSrcweir 
5235cdf0e10cSrcweir // #FontWork#
5236cdf0e10cSrcweir sal_Bool XFormTextShadowItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
5237cdf0e10cSrcweir {
5238cdf0e10cSrcweir 	rVal <<= (sal_Int32)GetValue();
5239cdf0e10cSrcweir 	return sal_True;
5240cdf0e10cSrcweir }
5241cdf0e10cSrcweir 
5242cdf0e10cSrcweir /*************************************************************************
5243cdf0e10cSrcweir |*
5244cdf0e10cSrcweir |*
5245cdf0e10cSrcweir |*
5246cdf0e10cSrcweir \*************************************************************************/
5247cdf0e10cSrcweir 
5248cdf0e10cSrcweir // #FontWork#
5249cdf0e10cSrcweir sal_Bool XFormTextShadowItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
5250cdf0e10cSrcweir {
5251cdf0e10cSrcweir 	sal_Int32 nValue = 0;
5252cdf0e10cSrcweir 	rVal >>= nValue;
5253cdf0e10cSrcweir 	SetValue(sal::static_int_cast< sal_uInt16 >(nValue));
5254cdf0e10cSrcweir 
5255cdf0e10cSrcweir 	return sal_True;
5256cdf0e10cSrcweir }
5257cdf0e10cSrcweir 
5258cdf0e10cSrcweir // -------------------------------
5259cdf0e10cSrcweir // class XFormTextShadowColorItem
5260cdf0e10cSrcweir // -------------------------------
5261cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFormTextShadowColorItem, XColorItem);
5262cdf0e10cSrcweir 
5263cdf0e10cSrcweir /*************************************************************************
5264cdf0e10cSrcweir |*
5265cdf0e10cSrcweir |*	  XFormTextShadowColorItem::XFormTextShadowColorItem()
5266cdf0e10cSrcweir |*
5267cdf0e10cSrcweir |*	  Beschreibung
5268cdf0e10cSrcweir |*	  Ersterstellung	27.06.95
5269cdf0e10cSrcweir |*	  Letzte Aenderung	27.06.95
5270cdf0e10cSrcweir |*
5271cdf0e10cSrcweir *************************************************************************/
5272cdf0e10cSrcweir 
5273cdf0e10cSrcweir XFormTextShadowColorItem::XFormTextShadowColorItem(sal_Int32 nIndex,
5274cdf0e10cSrcweir 													 const Color& rTheColor) :
5275cdf0e10cSrcweir 	XColorItem(XATTR_FORMTXTSHDWCOLOR, nIndex, rTheColor)
5276cdf0e10cSrcweir {
5277cdf0e10cSrcweir }
5278cdf0e10cSrcweir 
5279cdf0e10cSrcweir /*************************************************************************
5280cdf0e10cSrcweir |*
5281cdf0e10cSrcweir |*	  XFormTextShadowColorItem::XFormTextShadowColorItem(const XubString& rName, const Color& rTheColor)
5282cdf0e10cSrcweir |*
5283cdf0e10cSrcweir |*	  Beschreibung
5284cdf0e10cSrcweir |*	  Ersterstellung	27.06.95
5285cdf0e10cSrcweir |*	  Letzte Aenderung	27.06.95
5286cdf0e10cSrcweir |*
5287cdf0e10cSrcweir *************************************************************************/
5288cdf0e10cSrcweir 
5289cdf0e10cSrcweir XFormTextShadowColorItem::XFormTextShadowColorItem(const XubString& rName,
5290cdf0e10cSrcweir 													 const Color& rTheColor) :
5291cdf0e10cSrcweir 	XColorItem(XATTR_FORMTXTSHDWCOLOR, rName, rTheColor)
5292cdf0e10cSrcweir {
5293cdf0e10cSrcweir }
5294cdf0e10cSrcweir 
5295cdf0e10cSrcweir /*************************************************************************
5296cdf0e10cSrcweir |*
5297cdf0e10cSrcweir |*	  XFormTextShadowColorItem::XFormTextShadowColorItem(SvStream& rIn)
5298cdf0e10cSrcweir |*
5299cdf0e10cSrcweir |*	  Beschreibung
5300cdf0e10cSrcweir |*	  Ersterstellung	27.06.95
5301cdf0e10cSrcweir |*	  Letzte Aenderung	27.06.95
5302cdf0e10cSrcweir |*
5303cdf0e10cSrcweir *************************************************************************/
5304cdf0e10cSrcweir 
5305cdf0e10cSrcweir XFormTextShadowColorItem::XFormTextShadowColorItem(SvStream& rIn) :
5306cdf0e10cSrcweir 	XColorItem(XATTR_FORMTXTSHDWCOLOR, rIn)
5307cdf0e10cSrcweir {
5308cdf0e10cSrcweir }
5309cdf0e10cSrcweir 
5310cdf0e10cSrcweir /*************************************************************************
5311cdf0e10cSrcweir |*
5312cdf0e10cSrcweir |*	  XFormTextShadowColorItem::Clone(SfxItemPool* pPool) const
5313cdf0e10cSrcweir |*
5314cdf0e10cSrcweir |*	  Beschreibung
5315cdf0e10cSrcweir |*	  Ersterstellung	27.06.95
5316cdf0e10cSrcweir |*	  Letzte Aenderung	27.06.95
5317cdf0e10cSrcweir |*
5318cdf0e10cSrcweir *************************************************************************/
5319cdf0e10cSrcweir 
5320cdf0e10cSrcweir SfxPoolItem* XFormTextShadowColorItem::Clone(SfxItemPool* /*pPool*/) const
5321cdf0e10cSrcweir {
5322cdf0e10cSrcweir 	return new XFormTextShadowColorItem(*this);
5323cdf0e10cSrcweir }
5324cdf0e10cSrcweir 
5325cdf0e10cSrcweir /*************************************************************************
5326cdf0e10cSrcweir |*
5327cdf0e10cSrcweir |*	  SfxPoolItem* XFormTextShadowColorItem::Create(SvStream& rIn, sal_uInt16 nVer) const
5328cdf0e10cSrcweir |*
5329cdf0e10cSrcweir |*	  Beschreibung
5330cdf0e10cSrcweir |*	  Ersterstellung	27.06.95
5331cdf0e10cSrcweir |*	  Letzte Aenderung	27.06.95
5332cdf0e10cSrcweir |*
5333cdf0e10cSrcweir *************************************************************************/
5334cdf0e10cSrcweir 
5335cdf0e10cSrcweir SfxPoolItem* XFormTextShadowColorItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
5336cdf0e10cSrcweir {
5337cdf0e10cSrcweir 	return new XFormTextShadowColorItem(rIn);
5338cdf0e10cSrcweir }
5339cdf0e10cSrcweir 
5340cdf0e10cSrcweir //------------------------------
5341cdf0e10cSrcweir // class XFormTextShadowXValItem
5342cdf0e10cSrcweir //------------------------------
5343cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFormTextShadowXValItem, SfxMetricItem);
5344cdf0e10cSrcweir 
5345cdf0e10cSrcweir /*************************************************************************
5346cdf0e10cSrcweir |*
5347cdf0e10cSrcweir |*	  XFormTextShadowXValItem::XFormTextShadowXValItem(long)
5348cdf0e10cSrcweir |*
5349cdf0e10cSrcweir |*	  Beschreibung
5350cdf0e10cSrcweir |*	  Ersterstellung	28.06.95 ESO
5351cdf0e10cSrcweir |*	  Letzte Aenderung	28.06.95 ESO
5352cdf0e10cSrcweir |*
5353cdf0e10cSrcweir *************************************************************************/
5354cdf0e10cSrcweir 
5355cdf0e10cSrcweir XFormTextShadowXValItem::XFormTextShadowXValItem(long nVal) :
5356cdf0e10cSrcweir 	SfxMetricItem(XATTR_FORMTXTSHDWXVAL, nVal)
5357cdf0e10cSrcweir {
5358cdf0e10cSrcweir }
5359cdf0e10cSrcweir 
5360cdf0e10cSrcweir /*************************************************************************
5361cdf0e10cSrcweir |*
5362cdf0e10cSrcweir |*	  XFormTextShadowXValItem::XFormTextShadowXValItem(SvStream& rIn)
5363cdf0e10cSrcweir |*
5364cdf0e10cSrcweir |*	  Beschreibung
5365cdf0e10cSrcweir |*	  Ersterstellung	28.06.95 ESO
5366cdf0e10cSrcweir |*	  Letzte Aenderung	28.06.95 ESO
5367cdf0e10cSrcweir |*
5368cdf0e10cSrcweir *************************************************************************/
5369cdf0e10cSrcweir 
5370cdf0e10cSrcweir XFormTextShadowXValItem::XFormTextShadowXValItem(SvStream& rIn) :
5371cdf0e10cSrcweir 	SfxMetricItem(XATTR_FORMTXTSHDWXVAL, rIn)
5372cdf0e10cSrcweir {
5373cdf0e10cSrcweir }
5374cdf0e10cSrcweir 
5375cdf0e10cSrcweir /*************************************************************************
5376cdf0e10cSrcweir |*
5377cdf0e10cSrcweir |*	  XFormTextShadowXValItem::Clone(SfxItemPool* pPool) const
5378cdf0e10cSrcweir |*
5379cdf0e10cSrcweir |*	  Beschreibung
5380cdf0e10cSrcweir |*	  Ersterstellung	28.06.95 ESO
5381cdf0e10cSrcweir |*	  Letzte Aenderung	28.06.95 ESO
5382cdf0e10cSrcweir |*
5383cdf0e10cSrcweir *************************************************************************/
5384cdf0e10cSrcweir 
5385cdf0e10cSrcweir SfxPoolItem* XFormTextShadowXValItem::Clone(SfxItemPool* /*pPool*/) const
5386cdf0e10cSrcweir {
5387cdf0e10cSrcweir 	return new XFormTextShadowXValItem(*this);
5388cdf0e10cSrcweir }
5389cdf0e10cSrcweir 
5390cdf0e10cSrcweir /*************************************************************************
5391cdf0e10cSrcweir |*
5392cdf0e10cSrcweir |*	  SfxPoolItem* XFormTextShadowXValItem::Create(SvStream& rIn, sal_uInt16 nVer) const
5393cdf0e10cSrcweir |*
5394cdf0e10cSrcweir |*	  Beschreibung
5395cdf0e10cSrcweir |*	  Ersterstellung	28.06.95 ESO
5396cdf0e10cSrcweir |*	  Letzte Aenderung	28.06.95 ESO
5397cdf0e10cSrcweir |*
5398cdf0e10cSrcweir *************************************************************************/
5399cdf0e10cSrcweir 
5400cdf0e10cSrcweir SfxPoolItem* XFormTextShadowXValItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
5401cdf0e10cSrcweir {
5402cdf0e10cSrcweir 	return new XFormTextShadowXValItem(rIn);
5403cdf0e10cSrcweir }
5404cdf0e10cSrcweir 
5405cdf0e10cSrcweir //------------------------------
5406cdf0e10cSrcweir // class XFormTextShadowYValItem
5407cdf0e10cSrcweir //------------------------------
5408cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFormTextShadowYValItem, SfxMetricItem);
5409cdf0e10cSrcweir 
5410cdf0e10cSrcweir /*************************************************************************
5411cdf0e10cSrcweir |*
5412cdf0e10cSrcweir |*	  XFormTextShadowYValItem::XFormTextShadowYValItem(long)
5413cdf0e10cSrcweir |*
5414cdf0e10cSrcweir |*	  Beschreibung
5415cdf0e10cSrcweir |*	  Ersterstellung	28.06.95 ESO
5416cdf0e10cSrcweir |*	  Letzte Aenderung	28.06.95 ESO
5417cdf0e10cSrcweir |*
5418cdf0e10cSrcweir *************************************************************************/
5419cdf0e10cSrcweir 
5420cdf0e10cSrcweir XFormTextShadowYValItem::XFormTextShadowYValItem(long nVal) :
5421cdf0e10cSrcweir 	SfxMetricItem(XATTR_FORMTXTSHDWYVAL, nVal)
5422cdf0e10cSrcweir {
5423cdf0e10cSrcweir }
5424cdf0e10cSrcweir 
5425cdf0e10cSrcweir /*************************************************************************
5426cdf0e10cSrcweir |*
5427cdf0e10cSrcweir |*	  XFormTextShadowYValItem::XFormTextShadowYValItem(SvStream& rIn)
5428cdf0e10cSrcweir |*
5429cdf0e10cSrcweir |*	  Beschreibung
5430cdf0e10cSrcweir |*	  Ersterstellung	28.06.95 ESO
5431cdf0e10cSrcweir |*	  Letzte Aenderung	28.06.95 ESO
5432cdf0e10cSrcweir |*
5433cdf0e10cSrcweir *************************************************************************/
5434cdf0e10cSrcweir 
5435cdf0e10cSrcweir XFormTextShadowYValItem::XFormTextShadowYValItem(SvStream& rIn) :
5436cdf0e10cSrcweir 	SfxMetricItem(XATTR_FORMTXTSHDWYVAL, rIn)
5437cdf0e10cSrcweir {
5438cdf0e10cSrcweir }
5439cdf0e10cSrcweir 
5440cdf0e10cSrcweir /*************************************************************************
5441cdf0e10cSrcweir |*
5442cdf0e10cSrcweir |*	  XFormTextShadowYValItem::Clone(SfxItemPool* pPool) const
5443cdf0e10cSrcweir |*
5444cdf0e10cSrcweir |*	  Beschreibung
5445cdf0e10cSrcweir |*	  Ersterstellung	28.06.95 ESO
5446cdf0e10cSrcweir |*	  Letzte Aenderung	28.06.95 ESO
5447cdf0e10cSrcweir |*
5448cdf0e10cSrcweir *************************************************************************/
5449cdf0e10cSrcweir 
5450cdf0e10cSrcweir SfxPoolItem* XFormTextShadowYValItem::Clone(SfxItemPool* /*pPool*/) const
5451cdf0e10cSrcweir {
5452cdf0e10cSrcweir 	return new XFormTextShadowYValItem(*this);
5453cdf0e10cSrcweir }
5454cdf0e10cSrcweir 
5455cdf0e10cSrcweir /*************************************************************************
5456cdf0e10cSrcweir |*
5457cdf0e10cSrcweir |*	  SfxPoolItem* XFormTextShadowYValItem::Create(SvStream& rIn, sal_uInt16 nVer) const
5458cdf0e10cSrcweir |*
5459cdf0e10cSrcweir |*	  Beschreibung
5460cdf0e10cSrcweir |*	  Ersterstellung	28.06.95 ESO
5461cdf0e10cSrcweir |*	  Letzte Aenderung	28.06.95 ESO
5462cdf0e10cSrcweir |*
5463cdf0e10cSrcweir *************************************************************************/
5464cdf0e10cSrcweir 
5465cdf0e10cSrcweir SfxPoolItem* XFormTextShadowYValItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
5466cdf0e10cSrcweir {
5467cdf0e10cSrcweir 	return new XFormTextShadowYValItem(rIn);
5468cdf0e10cSrcweir }
5469cdf0e10cSrcweir 
5470cdf0e10cSrcweir // --------------------------
5471cdf0e10cSrcweir // class XFormTextHideFormItem
5472cdf0e10cSrcweir // --------------------------
5473cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(XFormTextHideFormItem, SfxBoolItem);
5474cdf0e10cSrcweir 
5475cdf0e10cSrcweir /*************************************************************************
5476cdf0e10cSrcweir |*
5477cdf0e10cSrcweir |*	  XFormTextHideFormItem::XFormTextHideFormItem()
5478cdf0e10cSrcweir |*
5479cdf0e10cSrcweir |*	  Ersterstellung	27.06.95 ESO
5480cdf0e10cSrcweir |*	  Letzte Aenderung	27.06.95 ESO
5481cdf0e10cSrcweir |*
5482cdf0e10cSrcweir *************************************************************************/
5483cdf0e10cSrcweir 
5484cdf0e10cSrcweir XFormTextHideFormItem::XFormTextHideFormItem(sal_Bool bHide) :
5485cdf0e10cSrcweir 	SfxBoolItem(XATTR_FORMTXTHIDEFORM, bHide)
5486cdf0e10cSrcweir {
5487cdf0e10cSrcweir }
5488cdf0e10cSrcweir 
5489cdf0e10cSrcweir /*************************************************************************
5490cdf0e10cSrcweir |*
5491cdf0e10cSrcweir |*	  XFormTextHideFormItem::XFormTextHideFormItem(SvStream& rIn)
5492cdf0e10cSrcweir |*
5493cdf0e10cSrcweir |*	  Ersterstellung	27.06.95 ESO
5494cdf0e10cSrcweir |*	  Letzte Aenderung	27.06.95 ESO
5495cdf0e10cSrcweir |*
5496cdf0e10cSrcweir *************************************************************************/
5497cdf0e10cSrcweir 
5498cdf0e10cSrcweir XFormTextHideFormItem::XFormTextHideFormItem(SvStream& rIn) :
5499cdf0e10cSrcweir 	SfxBoolItem(XATTR_FORMTXTHIDEFORM, rIn)
5500cdf0e10cSrcweir {
5501cdf0e10cSrcweir }
5502cdf0e10cSrcweir 
5503cdf0e10cSrcweir /*************************************************************************
5504cdf0e10cSrcweir |*
5505cdf0e10cSrcweir |*	  XFormTextHideFormItem::Clone(SfxItemPool* pPool) const
5506cdf0e10cSrcweir |*
5507cdf0e10cSrcweir |*	  Ersterstellung	27.06.95 ESO
5508cdf0e10cSrcweir |*	  Letzte Aenderung	27.06.95 ESO
5509cdf0e10cSrcweir |*
5510cdf0e10cSrcweir *************************************************************************/
5511cdf0e10cSrcweir 
5512cdf0e10cSrcweir SfxPoolItem* XFormTextHideFormItem::Clone(SfxItemPool* /*pPool*/) const
5513cdf0e10cSrcweir {
5514cdf0e10cSrcweir 	return new XFormTextHideFormItem(*this);
5515cdf0e10cSrcweir }
5516cdf0e10cSrcweir 
5517cdf0e10cSrcweir /*************************************************************************
5518cdf0e10cSrcweir |*
5519cdf0e10cSrcweir |*	  SfxPoolItem* XFormTextHideFormItem::Create(SvStream& rIn, sal_uInt16 nVer)
5520cdf0e10cSrcweir |*												const
5521cdf0e10cSrcweir |*
5522cdf0e10cSrcweir |*	  Ersterstellung	27.06.95 ESO
5523cdf0e10cSrcweir |*	  Letzte Aenderung	27.06.95 ESO
5524cdf0e10cSrcweir |*
5525cdf0e10cSrcweir *************************************************************************/
5526cdf0e10cSrcweir 
5527cdf0e10cSrcweir SfxPoolItem* XFormTextHideFormItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
5528cdf0e10cSrcweir {
5529cdf0e10cSrcweir 	return new XFormTextHideFormItem(rIn);
5530cdf0e10cSrcweir }
5531cdf0e10cSrcweir 
5532cdf0e10cSrcweir 
5533cdf0e10cSrcweir 
5534cdf0e10cSrcweir //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
5535cdf0e10cSrcweir //								SetItems
5536cdf0e10cSrcweir //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
5537cdf0e10cSrcweir 
5538cdf0e10cSrcweir TYPEINIT1(XLineAttrSetItem, SfxSetItem);
5539cdf0e10cSrcweir 
5540cdf0e10cSrcweir /*************************************************************************
5541cdf0e10cSrcweir |*
5542cdf0e10cSrcweir |* Konstruktoren fuer Linienattribute-SetItem
5543cdf0e10cSrcweir |*
5544cdf0e10cSrcweir \************************************************************************/
5545cdf0e10cSrcweir 
5546cdf0e10cSrcweir XLineAttrSetItem::XLineAttrSetItem( SfxItemSet* pItemSet ) :
5547cdf0e10cSrcweir 	SfxSetItem( XATTRSET_LINE, pItemSet)
5548cdf0e10cSrcweir {
5549cdf0e10cSrcweir }
5550cdf0e10cSrcweir 
5551cdf0e10cSrcweir /************************************************************************/
5552cdf0e10cSrcweir 
5553cdf0e10cSrcweir XLineAttrSetItem::XLineAttrSetItem( SfxItemPool* pItemPool ) :
5554cdf0e10cSrcweir 	SfxSetItem( XATTRSET_LINE,
5555cdf0e10cSrcweir 		new SfxItemSet( *pItemPool, XATTR_LINE_FIRST, XATTR_LINE_LAST))
5556cdf0e10cSrcweir {
5557cdf0e10cSrcweir }
5558cdf0e10cSrcweir 
5559cdf0e10cSrcweir /************************************************************************/
5560cdf0e10cSrcweir 
5561cdf0e10cSrcweir XLineAttrSetItem::XLineAttrSetItem( const XLineAttrSetItem& rLineAttr ) :
5562cdf0e10cSrcweir 	SfxSetItem( rLineAttr )
5563cdf0e10cSrcweir {
5564cdf0e10cSrcweir }
5565cdf0e10cSrcweir 
5566cdf0e10cSrcweir /************************************************************************/
5567cdf0e10cSrcweir 
5568cdf0e10cSrcweir XLineAttrSetItem::XLineAttrSetItem( const XLineAttrSetItem& rLineAttr,
5569cdf0e10cSrcweir 									SfxItemPool* pItemPool) :
5570cdf0e10cSrcweir 	SfxSetItem( rLineAttr, pItemPool )
5571cdf0e10cSrcweir {
5572cdf0e10cSrcweir }
5573cdf0e10cSrcweir 
5574cdf0e10cSrcweir /*************************************************************************
5575cdf0e10cSrcweir |*
5576cdf0e10cSrcweir |* Clone-Funktion
5577cdf0e10cSrcweir |*
5578cdf0e10cSrcweir \************************************************************************/
5579cdf0e10cSrcweir 
5580cdf0e10cSrcweir SfxPoolItem* XLineAttrSetItem::Clone( SfxItemPool* pPool ) const
5581cdf0e10cSrcweir {
5582cdf0e10cSrcweir 	return new XLineAttrSetItem( *this, pPool );
5583cdf0e10cSrcweir }
5584cdf0e10cSrcweir 
5585cdf0e10cSrcweir /*************************************************************************
5586cdf0e10cSrcweir |*
5587cdf0e10cSrcweir |* SetItem aus Stream erzeugen
5588cdf0e10cSrcweir |*
5589cdf0e10cSrcweir \************************************************************************/
5590cdf0e10cSrcweir 
5591cdf0e10cSrcweir SfxPoolItem* XLineAttrSetItem::Create( SvStream& rStream, sal_uInt16 /*nVersion*/) const
5592cdf0e10cSrcweir {
5593cdf0e10cSrcweir 	SfxItemSet *pSet2 = new SfxItemSet( *GetItemSet().GetPool(),
5594cdf0e10cSrcweir 									XATTR_LINE_FIRST, XATTR_LINE_LAST);
5595cdf0e10cSrcweir 	pSet2->Load( rStream );
5596cdf0e10cSrcweir 	return new XLineAttrSetItem( pSet2 );
5597cdf0e10cSrcweir }
5598cdf0e10cSrcweir 
5599cdf0e10cSrcweir /*************************************************************************
5600cdf0e10cSrcweir |*
5601cdf0e10cSrcweir |* SetItem in Stream speichern
5602cdf0e10cSrcweir |*
5603cdf0e10cSrcweir \************************************************************************/
5604cdf0e10cSrcweir 
5605cdf0e10cSrcweir SvStream& XLineAttrSetItem::Store( SvStream& rStream, sal_uInt16 nItemVersion ) const
5606cdf0e10cSrcweir {
5607cdf0e10cSrcweir 	return SfxSetItem::Store( rStream, nItemVersion );
5608cdf0e10cSrcweir }
5609cdf0e10cSrcweir 
5610cdf0e10cSrcweir 
5611cdf0e10cSrcweir TYPEINIT1(XFillAttrSetItem, SfxSetItem);
5612cdf0e10cSrcweir 
5613cdf0e10cSrcweir /*************************************************************************
5614cdf0e10cSrcweir |*
5615cdf0e10cSrcweir |* Konstruktoren fuer Fuellattribute-SetItem
5616cdf0e10cSrcweir |*
5617cdf0e10cSrcweir \************************************************************************/
5618cdf0e10cSrcweir 
5619cdf0e10cSrcweir XFillAttrSetItem::XFillAttrSetItem( SfxItemSet* pItemSet ) :
5620cdf0e10cSrcweir 	SfxSetItem( XATTRSET_FILL, pItemSet)
5621cdf0e10cSrcweir {
5622cdf0e10cSrcweir }
5623cdf0e10cSrcweir 
5624cdf0e10cSrcweir /************************************************************************/
5625cdf0e10cSrcweir 
5626cdf0e10cSrcweir XFillAttrSetItem::XFillAttrSetItem( SfxItemPool* pItemPool ) :
5627cdf0e10cSrcweir 	SfxSetItem( XATTRSET_FILL,
5628cdf0e10cSrcweir 		new SfxItemSet( *pItemPool, XATTR_FILL_FIRST, XATTR_FILL_LAST))
5629cdf0e10cSrcweir {
5630cdf0e10cSrcweir }
5631cdf0e10cSrcweir 
5632cdf0e10cSrcweir /************************************************************************/
5633cdf0e10cSrcweir 
5634cdf0e10cSrcweir XFillAttrSetItem::XFillAttrSetItem( const XFillAttrSetItem& rFillAttr ) :
5635cdf0e10cSrcweir 	SfxSetItem( rFillAttr )
5636cdf0e10cSrcweir {
5637cdf0e10cSrcweir }
5638cdf0e10cSrcweir 
5639cdf0e10cSrcweir /************************************************************************/
5640cdf0e10cSrcweir 
5641cdf0e10cSrcweir XFillAttrSetItem::XFillAttrSetItem( const XFillAttrSetItem& rFillAttr,
5642cdf0e10cSrcweir 									SfxItemPool* pItemPool ) :
5643cdf0e10cSrcweir 	SfxSetItem( rFillAttr, pItemPool )
5644cdf0e10cSrcweir {
5645cdf0e10cSrcweir }
5646cdf0e10cSrcweir 
5647cdf0e10cSrcweir /*************************************************************************
5648cdf0e10cSrcweir |*
5649cdf0e10cSrcweir |* Clone-Funktion
5650cdf0e10cSrcweir |*
5651cdf0e10cSrcweir \************************************************************************/
5652cdf0e10cSrcweir 
5653cdf0e10cSrcweir SfxPoolItem* XFillAttrSetItem::Clone( SfxItemPool* pPool ) const
5654cdf0e10cSrcweir {
5655cdf0e10cSrcweir 	return new XFillAttrSetItem( *this, pPool );
5656cdf0e10cSrcweir }
5657cdf0e10cSrcweir 
5658cdf0e10cSrcweir /*************************************************************************
5659cdf0e10cSrcweir |*
5660cdf0e10cSrcweir |* SetItem aus Stream erzeugen
5661cdf0e10cSrcweir |*
5662cdf0e10cSrcweir \************************************************************************/
5663cdf0e10cSrcweir 
5664cdf0e10cSrcweir SfxPoolItem* XFillAttrSetItem::Create( SvStream& rStream, sal_uInt16 /*nVersion*/) const
5665cdf0e10cSrcweir {
5666cdf0e10cSrcweir 	SfxItemSet *pSet2 = new SfxItemSet( *GetItemSet().GetPool(),
5667cdf0e10cSrcweir 									XATTR_FILL_FIRST, XATTR_FILL_LAST);
5668cdf0e10cSrcweir 	pSet2->Load( rStream );
5669cdf0e10cSrcweir 	return new XFillAttrSetItem( pSet2 );
5670cdf0e10cSrcweir }
5671cdf0e10cSrcweir 
5672cdf0e10cSrcweir /*************************************************************************
5673cdf0e10cSrcweir |*
5674cdf0e10cSrcweir |* SetItem in Stream speichern
5675cdf0e10cSrcweir |*
5676cdf0e10cSrcweir \************************************************************************/
5677cdf0e10cSrcweir 
5678cdf0e10cSrcweir SvStream& XFillAttrSetItem::Store( SvStream& rStream, sal_uInt16 nItemVersion ) const
5679cdf0e10cSrcweir {
5680cdf0e10cSrcweir 	return SfxSetItem::Store( rStream, nItemVersion );
5681cdf0e10cSrcweir }
5682cdf0e10cSrcweir 
5683cdf0e10cSrcweir // eof
5684cdf0e10cSrcweir 
5685