xref: /AOO41X/main/svx/source/items/drawitem.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_svx.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir // include ---------------------------------------------------------------
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir #include <svx/svxids.hrc>
34*cdf0e10cSrcweir 
35*cdf0e10cSrcweir 
36*cdf0e10cSrcweir #include "svx/drawitem.hxx"
37*cdf0e10cSrcweir #include <svx/xtable.hxx>
38*cdf0e10cSrcweir 
39*cdf0e10cSrcweir using namespace ::com::sun::star;
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir // -----------------------------------------------------------------------
42*cdf0e10cSrcweir 
43*cdf0e10cSrcweir TYPEINIT1_FACTORY( SvxColorTableItem, SfxPoolItem , new  SvxColorTableItem);
44*cdf0e10cSrcweir TYPEINIT1_FACTORY( SvxGradientListItem, SfxPoolItem , new  SvxGradientListItem);
45*cdf0e10cSrcweir TYPEINIT1_FACTORY( SvxHatchListItem, SfxPoolItem , new  SvxHatchListItem);
46*cdf0e10cSrcweir TYPEINIT1_FACTORY( SvxBitmapListItem, SfxPoolItem , new  SvxBitmapListItem);
47*cdf0e10cSrcweir TYPEINIT1_FACTORY( SvxDashListItem, SfxPoolItem , new  SvxDashListItem);
48*cdf0e10cSrcweir TYPEINIT1_FACTORY( SvxLineEndListItem, SfxPoolItem , new  SvxLineEndListItem);
49*cdf0e10cSrcweir 
50*cdf0e10cSrcweir //==================================================================
51*cdf0e10cSrcweir //
52*cdf0e10cSrcweir //	SvxColorTableItem
53*cdf0e10cSrcweir //
54*cdf0e10cSrcweir //==================================================================
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir SvxColorTableItem::SvxColorTableItem()
57*cdf0e10cSrcweir {
58*cdf0e10cSrcweir }
59*cdf0e10cSrcweir 
60*cdf0e10cSrcweir // -----------------------------------------------------------------------
61*cdf0e10cSrcweir 
62*cdf0e10cSrcweir SvxColorTableItem::SvxColorTableItem( XColorTable* pTable, sal_uInt16 nW ) :
63*cdf0e10cSrcweir 	SfxPoolItem( nW ),
64*cdf0e10cSrcweir 	pColorTable( pTable )
65*cdf0e10cSrcweir {
66*cdf0e10cSrcweir }
67*cdf0e10cSrcweir 
68*cdf0e10cSrcweir // -----------------------------------------------------------------------
69*cdf0e10cSrcweir 
70*cdf0e10cSrcweir SvxColorTableItem::SvxColorTableItem( const SvxColorTableItem& rItem ) :
71*cdf0e10cSrcweir 	SfxPoolItem( rItem ),
72*cdf0e10cSrcweir 	pColorTable( rItem.pColorTable )
73*cdf0e10cSrcweir {
74*cdf0e10cSrcweir }
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir //------------------------------------------------------------------------
77*cdf0e10cSrcweir 
78*cdf0e10cSrcweir SfxItemPresentation SvxColorTableItem::GetPresentation
79*cdf0e10cSrcweir (
80*cdf0e10cSrcweir     SfxItemPresentation /*ePres*/,
81*cdf0e10cSrcweir     SfxMapUnit          /*eCoreUnit*/,
82*cdf0e10cSrcweir     SfxMapUnit          /*ePresUnit*/,
83*cdf0e10cSrcweir     XubString&          rText, const IntlWrapper *
84*cdf0e10cSrcweir )	const
85*cdf0e10cSrcweir {
86*cdf0e10cSrcweir 	rText.Erase();
87*cdf0e10cSrcweir 	return SFX_ITEM_PRESENTATION_NONE;
88*cdf0e10cSrcweir }
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir // -----------------------------------------------------------------------
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir int SvxColorTableItem::operator==( const SfxPoolItem& rItem ) const
93*cdf0e10cSrcweir {
94*cdf0e10cSrcweir 	DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" );
95*cdf0e10cSrcweir 	return ( ( SvxColorTableItem& ) rItem).pColorTable == pColorTable;
96*cdf0e10cSrcweir }
97*cdf0e10cSrcweir 
98*cdf0e10cSrcweir // -----------------------------------------------------------------------
99*cdf0e10cSrcweir 
100*cdf0e10cSrcweir SfxPoolItem* SvxColorTableItem::Clone( SfxItemPool * ) const
101*cdf0e10cSrcweir {
102*cdf0e10cSrcweir 	return new SvxColorTableItem( *this );
103*cdf0e10cSrcweir }
104*cdf0e10cSrcweir 
105*cdf0e10cSrcweir // -----------------------------------------------------------------------
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir sal_Bool SvxColorTableItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
108*cdf0e10cSrcweir {
109*cdf0e10cSrcweir     // This is only a quick helper to have UI support for these list items. Don't use
110*cdf0e10cSrcweir     // this method to query for a valid UNO representation.
111*cdf0e10cSrcweir     // Please ask CD if you want to change this.
112*cdf0e10cSrcweir     sal_Int64 aValue = sal_Int64( (sal_uLong)pColorTable );
113*cdf0e10cSrcweir     rVal = uno::makeAny( aValue );
114*cdf0e10cSrcweir     return sal_True;
115*cdf0e10cSrcweir }
116*cdf0e10cSrcweir 
117*cdf0e10cSrcweir // -----------------------------------------------------------------------
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir sal_Bool SvxColorTableItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
120*cdf0e10cSrcweir {
121*cdf0e10cSrcweir     // This is only a quick helper to have UI support for these list items. Don't use
122*cdf0e10cSrcweir     // this method to query for a valid UNO representation.
123*cdf0e10cSrcweir     // Please ask CD if you want to change this.
124*cdf0e10cSrcweir     sal_Int64 aValue = 0;
125*cdf0e10cSrcweir     if ( rVal >>= aValue )
126*cdf0e10cSrcweir     {
127*cdf0e10cSrcweir         pColorTable = (XColorTable *)(sal_uLong)aValue;
128*cdf0e10cSrcweir         return sal_True;
129*cdf0e10cSrcweir     }
130*cdf0e10cSrcweir 
131*cdf0e10cSrcweir     return sal_False;
132*cdf0e10cSrcweir }
133*cdf0e10cSrcweir 
134*cdf0e10cSrcweir //==================================================================
135*cdf0e10cSrcweir //
136*cdf0e10cSrcweir //	SvxGradientListItem
137*cdf0e10cSrcweir //
138*cdf0e10cSrcweir //==================================================================
139*cdf0e10cSrcweir 
140*cdf0e10cSrcweir SvxGradientListItem::SvxGradientListItem()
141*cdf0e10cSrcweir {
142*cdf0e10cSrcweir }
143*cdf0e10cSrcweir 
144*cdf0e10cSrcweir // -----------------------------------------------------------------------
145*cdf0e10cSrcweir 
146*cdf0e10cSrcweir SvxGradientListItem::SvxGradientListItem( XGradientList* pList, sal_uInt16 nW ) :
147*cdf0e10cSrcweir 	SfxPoolItem( nW ),
148*cdf0e10cSrcweir 	pGradientList( pList )
149*cdf0e10cSrcweir {
150*cdf0e10cSrcweir }
151*cdf0e10cSrcweir 
152*cdf0e10cSrcweir // -----------------------------------------------------------------------
153*cdf0e10cSrcweir 
154*cdf0e10cSrcweir SvxGradientListItem::SvxGradientListItem( const SvxGradientListItem& rItem ) :
155*cdf0e10cSrcweir 	SfxPoolItem( rItem ),
156*cdf0e10cSrcweir 	pGradientList( rItem.pGradientList )
157*cdf0e10cSrcweir {
158*cdf0e10cSrcweir }
159*cdf0e10cSrcweir 
160*cdf0e10cSrcweir //------------------------------------------------------------------------
161*cdf0e10cSrcweir 
162*cdf0e10cSrcweir SfxItemPresentation SvxGradientListItem::GetPresentation
163*cdf0e10cSrcweir (
164*cdf0e10cSrcweir     SfxItemPresentation /*ePres*/,
165*cdf0e10cSrcweir     SfxMapUnit          /*eCoreUnit*/,
166*cdf0e10cSrcweir     SfxMapUnit          /*ePresUnit*/,
167*cdf0e10cSrcweir     XubString&          rText, const IntlWrapper *
168*cdf0e10cSrcweir )	const
169*cdf0e10cSrcweir {
170*cdf0e10cSrcweir 	rText.Erase();
171*cdf0e10cSrcweir 	return SFX_ITEM_PRESENTATION_NONE;
172*cdf0e10cSrcweir }
173*cdf0e10cSrcweir 
174*cdf0e10cSrcweir // -----------------------------------------------------------------------
175*cdf0e10cSrcweir 
176*cdf0e10cSrcweir int SvxGradientListItem::operator==( const SfxPoolItem& rItem ) const
177*cdf0e10cSrcweir {
178*cdf0e10cSrcweir 	DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" );
179*cdf0e10cSrcweir 	return ( ( SvxGradientListItem& ) rItem).pGradientList == pGradientList;
180*cdf0e10cSrcweir }
181*cdf0e10cSrcweir 
182*cdf0e10cSrcweir // -----------------------------------------------------------------------
183*cdf0e10cSrcweir 
184*cdf0e10cSrcweir SfxPoolItem* SvxGradientListItem::Clone( SfxItemPool * ) const
185*cdf0e10cSrcweir {
186*cdf0e10cSrcweir 	return new SvxGradientListItem( *this );
187*cdf0e10cSrcweir }
188*cdf0e10cSrcweir 
189*cdf0e10cSrcweir // -----------------------------------------------------------------------
190*cdf0e10cSrcweir 
191*cdf0e10cSrcweir sal_Bool SvxGradientListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
192*cdf0e10cSrcweir {
193*cdf0e10cSrcweir     // This is only a quick helper to have UI support for these list items. Don't use
194*cdf0e10cSrcweir     // this method to query for a valid UNO representation.
195*cdf0e10cSrcweir     // Please ask CD if you want to change this.
196*cdf0e10cSrcweir     sal_Int64 aValue = sal_Int64( (sal_uLong)pGradientList );
197*cdf0e10cSrcweir     rVal = uno::makeAny( aValue );
198*cdf0e10cSrcweir     return sal_True;
199*cdf0e10cSrcweir }
200*cdf0e10cSrcweir 
201*cdf0e10cSrcweir // -----------------------------------------------------------------------
202*cdf0e10cSrcweir 
203*cdf0e10cSrcweir sal_Bool SvxGradientListItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
204*cdf0e10cSrcweir {
205*cdf0e10cSrcweir     // This is only a quick helper to have UI support for these list items. Don't use
206*cdf0e10cSrcweir     // this method to query for a valid UNO representation.
207*cdf0e10cSrcweir     // Please ask CD if you want to change this.
208*cdf0e10cSrcweir     sal_Int64 aValue = 0;
209*cdf0e10cSrcweir     if ( rVal >>= aValue )
210*cdf0e10cSrcweir     {
211*cdf0e10cSrcweir         pGradientList = (XGradientList *)(sal_uLong)aValue;
212*cdf0e10cSrcweir         return sal_True;
213*cdf0e10cSrcweir     }
214*cdf0e10cSrcweir 
215*cdf0e10cSrcweir     return sal_False;
216*cdf0e10cSrcweir }
217*cdf0e10cSrcweir 
218*cdf0e10cSrcweir //==================================================================
219*cdf0e10cSrcweir //
220*cdf0e10cSrcweir //	SvxHatchListItem
221*cdf0e10cSrcweir //
222*cdf0e10cSrcweir //==================================================================
223*cdf0e10cSrcweir 
224*cdf0e10cSrcweir SvxHatchListItem::SvxHatchListItem()
225*cdf0e10cSrcweir {
226*cdf0e10cSrcweir }
227*cdf0e10cSrcweir 
228*cdf0e10cSrcweir // -----------------------------------------------------------------------
229*cdf0e10cSrcweir 
230*cdf0e10cSrcweir SvxHatchListItem::SvxHatchListItem( XHatchList* pList, sal_uInt16 nW ) :
231*cdf0e10cSrcweir 	SfxPoolItem( nW ),
232*cdf0e10cSrcweir 	pHatchList( pList )
233*cdf0e10cSrcweir {
234*cdf0e10cSrcweir }
235*cdf0e10cSrcweir 
236*cdf0e10cSrcweir // -----------------------------------------------------------------------
237*cdf0e10cSrcweir 
238*cdf0e10cSrcweir SvxHatchListItem::SvxHatchListItem( const SvxHatchListItem& rItem ) :
239*cdf0e10cSrcweir 	SfxPoolItem( rItem ),
240*cdf0e10cSrcweir 	pHatchList( rItem.pHatchList )
241*cdf0e10cSrcweir {
242*cdf0e10cSrcweir }
243*cdf0e10cSrcweir 
244*cdf0e10cSrcweir //------------------------------------------------------------------------
245*cdf0e10cSrcweir 
246*cdf0e10cSrcweir SfxItemPresentation SvxHatchListItem::GetPresentation
247*cdf0e10cSrcweir (
248*cdf0e10cSrcweir     SfxItemPresentation /*ePres*/,
249*cdf0e10cSrcweir     SfxMapUnit          /*eCoreUnit*/,
250*cdf0e10cSrcweir     SfxMapUnit          /*ePresUnit*/,
251*cdf0e10cSrcweir     XubString&          rText, const IntlWrapper *
252*cdf0e10cSrcweir )	const
253*cdf0e10cSrcweir {
254*cdf0e10cSrcweir 	rText.Erase();
255*cdf0e10cSrcweir 	return SFX_ITEM_PRESENTATION_NONE;
256*cdf0e10cSrcweir }
257*cdf0e10cSrcweir 
258*cdf0e10cSrcweir // -----------------------------------------------------------------------
259*cdf0e10cSrcweir 
260*cdf0e10cSrcweir int SvxHatchListItem::operator==( const SfxPoolItem& rItem ) const
261*cdf0e10cSrcweir {
262*cdf0e10cSrcweir 	DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" );
263*cdf0e10cSrcweir 	return ( ( SvxHatchListItem& ) rItem).pHatchList == pHatchList;
264*cdf0e10cSrcweir }
265*cdf0e10cSrcweir 
266*cdf0e10cSrcweir // -----------------------------------------------------------------------
267*cdf0e10cSrcweir 
268*cdf0e10cSrcweir SfxPoolItem* SvxHatchListItem::Clone( SfxItemPool * ) const
269*cdf0e10cSrcweir {
270*cdf0e10cSrcweir 	return new SvxHatchListItem( *this );
271*cdf0e10cSrcweir }
272*cdf0e10cSrcweir 
273*cdf0e10cSrcweir // -----------------------------------------------------------------------
274*cdf0e10cSrcweir 
275*cdf0e10cSrcweir sal_Bool SvxHatchListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
276*cdf0e10cSrcweir {
277*cdf0e10cSrcweir     // This is only a quick helper to have UI support for these list items. Don't use
278*cdf0e10cSrcweir     // this method to query for a valid UNO representation.
279*cdf0e10cSrcweir     // Please ask CD if you want to change this.
280*cdf0e10cSrcweir     sal_Int64 aValue = sal_Int64( (sal_uLong)pHatchList );
281*cdf0e10cSrcweir     rVal = uno::makeAny( aValue );
282*cdf0e10cSrcweir     return sal_True;
283*cdf0e10cSrcweir }
284*cdf0e10cSrcweir 
285*cdf0e10cSrcweir // -----------------------------------------------------------------------
286*cdf0e10cSrcweir 
287*cdf0e10cSrcweir sal_Bool SvxHatchListItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
288*cdf0e10cSrcweir {
289*cdf0e10cSrcweir     // This is only a quick helper to have UI support for these list items. Don't use
290*cdf0e10cSrcweir     // this method to query for a valid UNO representation.
291*cdf0e10cSrcweir     // Please ask CD if you want to change this.
292*cdf0e10cSrcweir     sal_Int64 aValue = 0;
293*cdf0e10cSrcweir     if ( rVal >>= aValue )
294*cdf0e10cSrcweir     {
295*cdf0e10cSrcweir         pHatchList = (XHatchList *)(sal_uLong)aValue;
296*cdf0e10cSrcweir         return sal_True;
297*cdf0e10cSrcweir     }
298*cdf0e10cSrcweir 
299*cdf0e10cSrcweir     return sal_False;
300*cdf0e10cSrcweir }
301*cdf0e10cSrcweir 
302*cdf0e10cSrcweir //==================================================================
303*cdf0e10cSrcweir //
304*cdf0e10cSrcweir //	SvxBitmapListItem
305*cdf0e10cSrcweir //
306*cdf0e10cSrcweir //==================================================================
307*cdf0e10cSrcweir 
308*cdf0e10cSrcweir SvxBitmapListItem::SvxBitmapListItem()
309*cdf0e10cSrcweir {
310*cdf0e10cSrcweir }
311*cdf0e10cSrcweir 
312*cdf0e10cSrcweir // -----------------------------------------------------------------------
313*cdf0e10cSrcweir 
314*cdf0e10cSrcweir SvxBitmapListItem::SvxBitmapListItem( XBitmapList* pList, sal_uInt16 nW ) :
315*cdf0e10cSrcweir 	SfxPoolItem( nW ),
316*cdf0e10cSrcweir 	pBitmapList( pList )
317*cdf0e10cSrcweir {
318*cdf0e10cSrcweir }
319*cdf0e10cSrcweir 
320*cdf0e10cSrcweir // -----------------------------------------------------------------------
321*cdf0e10cSrcweir 
322*cdf0e10cSrcweir SvxBitmapListItem::SvxBitmapListItem( const SvxBitmapListItem& rItem ) :
323*cdf0e10cSrcweir 	SfxPoolItem( rItem ),
324*cdf0e10cSrcweir 	pBitmapList( rItem.pBitmapList )
325*cdf0e10cSrcweir {
326*cdf0e10cSrcweir }
327*cdf0e10cSrcweir 
328*cdf0e10cSrcweir //------------------------------------------------------------------------
329*cdf0e10cSrcweir 
330*cdf0e10cSrcweir SfxItemPresentation SvxBitmapListItem::GetPresentation
331*cdf0e10cSrcweir (
332*cdf0e10cSrcweir     SfxItemPresentation /*ePres*/,
333*cdf0e10cSrcweir     SfxMapUnit          /*eCoreUnit*/,
334*cdf0e10cSrcweir     SfxMapUnit          /*ePresUnit*/,
335*cdf0e10cSrcweir     XubString&          rText, const IntlWrapper *
336*cdf0e10cSrcweir )	const
337*cdf0e10cSrcweir {
338*cdf0e10cSrcweir 	rText.Erase();
339*cdf0e10cSrcweir 	return SFX_ITEM_PRESENTATION_NONE;
340*cdf0e10cSrcweir }
341*cdf0e10cSrcweir 
342*cdf0e10cSrcweir // -----------------------------------------------------------------------
343*cdf0e10cSrcweir 
344*cdf0e10cSrcweir int SvxBitmapListItem::operator==( const SfxPoolItem& rItem ) const
345*cdf0e10cSrcweir {
346*cdf0e10cSrcweir 	DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" );
347*cdf0e10cSrcweir 	return ( ( SvxBitmapListItem& ) rItem).pBitmapList == pBitmapList;
348*cdf0e10cSrcweir }
349*cdf0e10cSrcweir 
350*cdf0e10cSrcweir // -----------------------------------------------------------------------
351*cdf0e10cSrcweir 
352*cdf0e10cSrcweir SfxPoolItem* SvxBitmapListItem::Clone( SfxItemPool * ) const
353*cdf0e10cSrcweir {
354*cdf0e10cSrcweir 	return new SvxBitmapListItem( *this );
355*cdf0e10cSrcweir }
356*cdf0e10cSrcweir 
357*cdf0e10cSrcweir // -----------------------------------------------------------------------
358*cdf0e10cSrcweir 
359*cdf0e10cSrcweir sal_Bool SvxBitmapListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
360*cdf0e10cSrcweir {
361*cdf0e10cSrcweir     // This is only a quick helper to have UI support for these list items. Don't use
362*cdf0e10cSrcweir     // this method to query for a valid UNO representation.
363*cdf0e10cSrcweir     // Please ask CD if you want to change this.
364*cdf0e10cSrcweir     sal_Int64 aValue = sal_Int64( (sal_uLong)pBitmapList );
365*cdf0e10cSrcweir     rVal = uno::makeAny( aValue );
366*cdf0e10cSrcweir     return sal_True;
367*cdf0e10cSrcweir }
368*cdf0e10cSrcweir 
369*cdf0e10cSrcweir // -----------------------------------------------------------------------
370*cdf0e10cSrcweir 
371*cdf0e10cSrcweir sal_Bool SvxBitmapListItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
372*cdf0e10cSrcweir {
373*cdf0e10cSrcweir     // This is only a quick helper to have UI support for these list items. Don't use
374*cdf0e10cSrcweir     // this method to query for a valid UNO representation.
375*cdf0e10cSrcweir     // Please ask CD if you want to change this.
376*cdf0e10cSrcweir     sal_Int64 aValue = 0;
377*cdf0e10cSrcweir     if ( rVal >>= aValue )
378*cdf0e10cSrcweir     {
379*cdf0e10cSrcweir         pBitmapList = (XBitmapList *)(sal_uLong)aValue;
380*cdf0e10cSrcweir         return sal_True;
381*cdf0e10cSrcweir     }
382*cdf0e10cSrcweir 
383*cdf0e10cSrcweir     return sal_False;
384*cdf0e10cSrcweir }
385*cdf0e10cSrcweir 
386*cdf0e10cSrcweir 
387*cdf0e10cSrcweir //==================================================================
388*cdf0e10cSrcweir //
389*cdf0e10cSrcweir //	SvxDashListItem
390*cdf0e10cSrcweir //
391*cdf0e10cSrcweir //==================================================================
392*cdf0e10cSrcweir 
393*cdf0e10cSrcweir SvxDashListItem::SvxDashListItem() :
394*cdf0e10cSrcweir     pDashList( 0 )
395*cdf0e10cSrcweir {
396*cdf0e10cSrcweir }
397*cdf0e10cSrcweir 
398*cdf0e10cSrcweir // -----------------------------------------------------------------------
399*cdf0e10cSrcweir 
400*cdf0e10cSrcweir SvxDashListItem::SvxDashListItem( XDashList* pList, sal_uInt16 nW ) :
401*cdf0e10cSrcweir 	SfxPoolItem( nW ),
402*cdf0e10cSrcweir 	pDashList( pList )
403*cdf0e10cSrcweir {
404*cdf0e10cSrcweir }
405*cdf0e10cSrcweir 
406*cdf0e10cSrcweir // -----------------------------------------------------------------------
407*cdf0e10cSrcweir 
408*cdf0e10cSrcweir SvxDashListItem::SvxDashListItem( const SvxDashListItem& rItem ) :
409*cdf0e10cSrcweir 	SfxPoolItem( rItem ),
410*cdf0e10cSrcweir 	pDashList( rItem.pDashList )
411*cdf0e10cSrcweir {
412*cdf0e10cSrcweir }
413*cdf0e10cSrcweir 
414*cdf0e10cSrcweir //------------------------------------------------------------------------
415*cdf0e10cSrcweir 
416*cdf0e10cSrcweir SfxItemPresentation SvxDashListItem::GetPresentation
417*cdf0e10cSrcweir (
418*cdf0e10cSrcweir     SfxItemPresentation /*ePres*/,
419*cdf0e10cSrcweir     SfxMapUnit          /*eCoreUnit*/,
420*cdf0e10cSrcweir     SfxMapUnit          /*ePresUnit*/,
421*cdf0e10cSrcweir     XubString&          rText, const IntlWrapper *
422*cdf0e10cSrcweir )	const
423*cdf0e10cSrcweir {
424*cdf0e10cSrcweir 	rText.Erase();
425*cdf0e10cSrcweir 	return SFX_ITEM_PRESENTATION_NONE;
426*cdf0e10cSrcweir }
427*cdf0e10cSrcweir 
428*cdf0e10cSrcweir // -----------------------------------------------------------------------
429*cdf0e10cSrcweir 
430*cdf0e10cSrcweir int SvxDashListItem::operator==( const SfxPoolItem& rItem ) const
431*cdf0e10cSrcweir {
432*cdf0e10cSrcweir 	DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" );
433*cdf0e10cSrcweir 	return ( ( SvxDashListItem& ) rItem).pDashList == pDashList;
434*cdf0e10cSrcweir }
435*cdf0e10cSrcweir 
436*cdf0e10cSrcweir // -----------------------------------------------------------------------
437*cdf0e10cSrcweir 
438*cdf0e10cSrcweir SfxPoolItem* SvxDashListItem::Clone( SfxItemPool * ) const
439*cdf0e10cSrcweir {
440*cdf0e10cSrcweir 	return new SvxDashListItem( *this );
441*cdf0e10cSrcweir }
442*cdf0e10cSrcweir 
443*cdf0e10cSrcweir // -----------------------------------------------------------------------
444*cdf0e10cSrcweir 
445*cdf0e10cSrcweir sal_Bool SvxDashListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
446*cdf0e10cSrcweir {
447*cdf0e10cSrcweir     // This is only a quick helper to have UI support for these list items. Don't use
448*cdf0e10cSrcweir     // this method to query for a valid UNO representation.
449*cdf0e10cSrcweir     sal_Int64 aValue = sal_Int64( (sal_uLong)pDashList );
450*cdf0e10cSrcweir     rVal = uno::makeAny( aValue );
451*cdf0e10cSrcweir     return sal_True;
452*cdf0e10cSrcweir }
453*cdf0e10cSrcweir 
454*cdf0e10cSrcweir // -----------------------------------------------------------------------
455*cdf0e10cSrcweir 
456*cdf0e10cSrcweir sal_Bool SvxDashListItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
457*cdf0e10cSrcweir {
458*cdf0e10cSrcweir     // This is only a quick helper to have UI support for these list items. Don't use
459*cdf0e10cSrcweir     // this method to query for a valid UNO representation.
460*cdf0e10cSrcweir     sal_Int64 aValue = 0;
461*cdf0e10cSrcweir     if ( rVal >>= aValue )
462*cdf0e10cSrcweir     {
463*cdf0e10cSrcweir         pDashList = (XDashList *)(sal_uLong)aValue;
464*cdf0e10cSrcweir         return sal_True;
465*cdf0e10cSrcweir     }
466*cdf0e10cSrcweir 
467*cdf0e10cSrcweir     return sal_False;
468*cdf0e10cSrcweir }
469*cdf0e10cSrcweir 
470*cdf0e10cSrcweir // -----------------------------------------------------------------------
471*cdf0e10cSrcweir 
472*cdf0e10cSrcweir void SvxDashListItem::SetDashList( XDashList* pList )
473*cdf0e10cSrcweir {
474*cdf0e10cSrcweir     pDashList = pList;
475*cdf0e10cSrcweir }
476*cdf0e10cSrcweir 
477*cdf0e10cSrcweir //==================================================================
478*cdf0e10cSrcweir //
479*cdf0e10cSrcweir //	SvxLineEndListItem
480*cdf0e10cSrcweir //
481*cdf0e10cSrcweir //==================================================================
482*cdf0e10cSrcweir 
483*cdf0e10cSrcweir SvxLineEndListItem::SvxLineEndListItem()
484*cdf0e10cSrcweir {
485*cdf0e10cSrcweir }
486*cdf0e10cSrcweir 
487*cdf0e10cSrcweir // -----------------------------------------------------------------------
488*cdf0e10cSrcweir 
489*cdf0e10cSrcweir SvxLineEndListItem::SvxLineEndListItem( XLineEndList* pList, sal_uInt16 nW ) :
490*cdf0e10cSrcweir 	SfxPoolItem( nW ),
491*cdf0e10cSrcweir 	pLineEndList( pList )
492*cdf0e10cSrcweir {
493*cdf0e10cSrcweir }
494*cdf0e10cSrcweir 
495*cdf0e10cSrcweir // -----------------------------------------------------------------------
496*cdf0e10cSrcweir 
497*cdf0e10cSrcweir SvxLineEndListItem::SvxLineEndListItem( const SvxLineEndListItem& rItem ) :
498*cdf0e10cSrcweir 	SfxPoolItem( rItem ),
499*cdf0e10cSrcweir 	pLineEndList( rItem.pLineEndList )
500*cdf0e10cSrcweir {
501*cdf0e10cSrcweir }
502*cdf0e10cSrcweir 
503*cdf0e10cSrcweir //------------------------------------------------------------------------
504*cdf0e10cSrcweir 
505*cdf0e10cSrcweir SfxItemPresentation SvxLineEndListItem::GetPresentation
506*cdf0e10cSrcweir (
507*cdf0e10cSrcweir     SfxItemPresentation /*ePres*/,
508*cdf0e10cSrcweir     SfxMapUnit          /*eCoreUnit*/,
509*cdf0e10cSrcweir     SfxMapUnit          /*ePresUnit*/,
510*cdf0e10cSrcweir     XubString&          rText, const IntlWrapper *
511*cdf0e10cSrcweir )	const
512*cdf0e10cSrcweir {
513*cdf0e10cSrcweir 	rText.Erase();
514*cdf0e10cSrcweir 	return SFX_ITEM_PRESENTATION_NONE;
515*cdf0e10cSrcweir }
516*cdf0e10cSrcweir 
517*cdf0e10cSrcweir // -----------------------------------------------------------------------
518*cdf0e10cSrcweir 
519*cdf0e10cSrcweir int SvxLineEndListItem::operator==( const SfxPoolItem& rItem ) const
520*cdf0e10cSrcweir {
521*cdf0e10cSrcweir 	DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" );
522*cdf0e10cSrcweir 	return ( ( SvxLineEndListItem& ) rItem).pLineEndList == pLineEndList;
523*cdf0e10cSrcweir }
524*cdf0e10cSrcweir 
525*cdf0e10cSrcweir // -----------------------------------------------------------------------
526*cdf0e10cSrcweir 
527*cdf0e10cSrcweir SfxPoolItem* SvxLineEndListItem::Clone( SfxItemPool * ) const
528*cdf0e10cSrcweir {
529*cdf0e10cSrcweir 	return new SvxLineEndListItem( *this );
530*cdf0e10cSrcweir }
531*cdf0e10cSrcweir 
532*cdf0e10cSrcweir // -----------------------------------------------------------------------
533*cdf0e10cSrcweir 
534*cdf0e10cSrcweir sal_Bool SvxLineEndListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
535*cdf0e10cSrcweir {
536*cdf0e10cSrcweir     // This is only a quick helper to have UI support for these list items. Don't use
537*cdf0e10cSrcweir     // this method to query for a valid UNO representation.
538*cdf0e10cSrcweir     sal_Int64 aValue = sal_Int64( (sal_uLong)pLineEndList );
539*cdf0e10cSrcweir     rVal = uno::makeAny( aValue );
540*cdf0e10cSrcweir     return sal_True;
541*cdf0e10cSrcweir }
542*cdf0e10cSrcweir 
543*cdf0e10cSrcweir // -----------------------------------------------------------------------
544*cdf0e10cSrcweir 
545*cdf0e10cSrcweir sal_Bool SvxLineEndListItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
546*cdf0e10cSrcweir {
547*cdf0e10cSrcweir     // This is only a quick helper to have UI support for these list items. Don't use
548*cdf0e10cSrcweir     // this method to query for a valid UNO representation.
549*cdf0e10cSrcweir     sal_Int64 aValue = 0;
550*cdf0e10cSrcweir     if ( rVal >>= aValue )
551*cdf0e10cSrcweir     {
552*cdf0e10cSrcweir         pLineEndList = (XLineEndList *)(sal_uLong)aValue;
553*cdf0e10cSrcweir         return sal_True;
554*cdf0e10cSrcweir     }
555*cdf0e10cSrcweir 
556*cdf0e10cSrcweir     return sal_False;
557*cdf0e10cSrcweir }
558