Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <svx/svxids.hrc>
30 : : #include <svx/drawitem.hxx>
31 : : #include <svx/xtable.hxx>
32 : :
33 : : using namespace ::com::sun::star;
34 : :
35 [ # # ][ # # ]: 1167 : TYPEINIT1_FACTORY( SvxColorListItem, SfxPoolItem , new SvxColorListItem );
[ # # ]
36 [ # # ][ # # ]: 1017 : TYPEINIT1_FACTORY( SvxGradientListItem, SfxPoolItem , new SvxGradientListItem );
[ # # ]
37 [ # # ][ # # ]: 1017 : TYPEINIT1_FACTORY( SvxHatchListItem, SfxPoolItem , new SvxHatchListItem );
[ # # ]
38 [ # # ][ # # ]: 1017 : TYPEINIT1_FACTORY( SvxBitmapListItem, SfxPoolItem , new SvxBitmapListItem );
[ # # ]
39 [ # # ][ # # ]: 449 : TYPEINIT1_FACTORY( SvxDashListItem, SfxPoolItem , new SvxDashListItem );
[ # # ]
40 [ # # ][ # # ]: 149 : TYPEINIT1_FACTORY( SvxLineEndListItem, SfxPoolItem , new SvxLineEndListItem );
[ # # ]
41 : :
42 : : //==================================================================
43 : : //
44 : : // SvxColorListItem
45 : : //
46 : : //==================================================================
47 : :
48 : 0 : SvxColorListItem::SvxColorListItem()
49 : : {
50 : 0 : }
51 : :
52 : :
53 : 2569 : SvxColorListItem::SvxColorListItem( XColorListRef pTable, sal_uInt16 nW ) :
54 : : SfxPoolItem( nW ),
55 : 2569 : pColorList( pTable )
56 : : {
57 : 2569 : }
58 : :
59 : :
60 : 2688 : SvxColorListItem::SvxColorListItem( const SvxColorListItem& rItem ) :
61 : : SfxPoolItem( rItem ),
62 : 2688 : pColorList( rItem.pColorList )
63 : : {
64 : 2688 : }
65 : :
66 : 0 : SfxItemPresentation SvxColorListItem::GetPresentation
67 : : (
68 : : SfxItemPresentation /*ePres*/,
69 : : SfxMapUnit /*eCoreUnit*/,
70 : : SfxMapUnit /*ePresUnit*/,
71 : : XubString& rText, const IntlWrapper *
72 : : ) const
73 : : {
74 : 0 : rText.Erase();
75 : 0 : return SFX_ITEM_PRESENTATION_NONE;
76 : : }
77 : :
78 : 0 : int SvxColorListItem::operator==( const SfxPoolItem& rItem ) const
79 : : {
80 : : DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" );
81 : 0 : return ( ( SvxColorListItem& ) rItem).pColorList == pColorList;
82 : : }
83 : :
84 : 2569 : SfxPoolItem* SvxColorListItem::Clone( SfxItemPool * ) const
85 : : {
86 [ + - ]: 2569 : return new SvxColorListItem( *this );
87 : : }
88 : :
89 : :
90 : : // Should be a template class but ...
91 : : #define QUERY_PUT_IMPL(svtype, xtype) \
92 : : bool svtype::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const \
93 : : { \
94 : : rVal = uno::makeAny( uno::Reference< uno::XWeak >( p##xtype.get() ) ); \
95 : : return true; \
96 : : } \
97 : : \
98 : : bool svtype::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 ) \
99 : : { \
100 : : uno::Reference< uno::XWeak > xRef; \
101 : : if( rVal >>= xRef ) { \
102 : : p##xtype = X##xtype##Ref(dynamic_cast<X##xtype *>(xRef.get())); \
103 : : return true; \
104 : : } \
105 : : return false; \
106 : : }
107 : :
108 [ # # ][ # # ]: 0 : QUERY_PUT_IMPL( SvxColorListItem, ColorList )
[ # # ][ # # ]
[ # # ][ # # ]
109 : :
110 : : //==================================================================
111 : : //
112 : : // SvxGradientListItem
113 : : //
114 : : //==================================================================
115 : :
116 : 0 : SvxGradientListItem::SvxGradientListItem()
117 : : {
118 : 0 : }
119 : :
120 : 2132 : SvxGradientListItem::SvxGradientListItem( XGradientListRef pList, sal_uInt16 nW ) :
121 : : SfxPoolItem( nW ),
122 : 2132 : pGradientList( pList )
123 : : {
124 : 2132 : }
125 : :
126 : :
127 : 2132 : SvxGradientListItem::SvxGradientListItem( const SvxGradientListItem& rItem ) :
128 : : SfxPoolItem( rItem ),
129 : 2132 : pGradientList( rItem.pGradientList )
130 : : {
131 : 2132 : }
132 : :
133 : : //------------------------------------------------------------------------
134 : :
135 : 0 : SfxItemPresentation SvxGradientListItem::GetPresentation
136 : : (
137 : : SfxItemPresentation /*ePres*/,
138 : : SfxMapUnit /*eCoreUnit*/,
139 : : SfxMapUnit /*ePresUnit*/,
140 : : XubString& rText, const IntlWrapper *
141 : : ) const
142 : : {
143 : 0 : rText.Erase();
144 : 0 : return SFX_ITEM_PRESENTATION_NONE;
145 : : }
146 : :
147 : :
148 : 0 : int SvxGradientListItem::operator==( const SfxPoolItem& rItem ) const
149 : : {
150 : : DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" );
151 : 0 : return ( ( SvxGradientListItem& ) rItem).pGradientList == pGradientList;
152 : : }
153 : :
154 : :
155 : 2132 : SfxPoolItem* SvxGradientListItem::Clone( SfxItemPool * ) const
156 : : {
157 [ + - ]: 2132 : return new SvxGradientListItem( *this );
158 : : }
159 : :
160 : :
161 [ # # ][ # # ]: 0 : QUERY_PUT_IMPL( SvxGradientListItem, GradientList )
[ # # ][ # # ]
[ # # ][ # # ]
162 : :
163 : : //==================================================================
164 : : //
165 : : // SvxHatchListItem
166 : : //
167 : : //==================================================================
168 : :
169 : 0 : SvxHatchListItem::SvxHatchListItem()
170 : : {
171 : 0 : }
172 : :
173 : :
174 : 2132 : SvxHatchListItem::SvxHatchListItem( XHatchListRef pList, sal_uInt16 nW ) :
175 : : SfxPoolItem( nW ),
176 : 2132 : pHatchList( pList )
177 : : {
178 : 2132 : }
179 : :
180 : :
181 : 2132 : SvxHatchListItem::SvxHatchListItem( const SvxHatchListItem& rItem ) :
182 : : SfxPoolItem( rItem ),
183 : 2132 : pHatchList( rItem.pHatchList )
184 : : {
185 : 2132 : }
186 : :
187 : : //------------------------------------------------------------------------
188 : :
189 : 0 : SfxItemPresentation SvxHatchListItem::GetPresentation
190 : : (
191 : : SfxItemPresentation /*ePres*/,
192 : : SfxMapUnit /*eCoreUnit*/,
193 : : SfxMapUnit /*ePresUnit*/,
194 : : XubString& rText, const IntlWrapper *
195 : : ) const
196 : : {
197 : 0 : rText.Erase();
198 : 0 : return SFX_ITEM_PRESENTATION_NONE;
199 : : }
200 : :
201 : :
202 : 0 : int SvxHatchListItem::operator==( const SfxPoolItem& rItem ) const
203 : : {
204 : : DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" );
205 : 0 : return ( ( SvxHatchListItem& ) rItem).pHatchList == pHatchList;
206 : : }
207 : :
208 : :
209 : 2132 : SfxPoolItem* SvxHatchListItem::Clone( SfxItemPool * ) const
210 : : {
211 [ + - ]: 2132 : return new SvxHatchListItem( *this );
212 : : }
213 : :
214 [ # # ][ # # ]: 0 : QUERY_PUT_IMPL( SvxHatchListItem, HatchList )
[ # # ][ # # ]
[ # # ][ # # ]
215 : :
216 : :
217 : : //==================================================================
218 : : //
219 : : // SvxBitmapListItem
220 : : //
221 : : //==================================================================
222 : :
223 : 0 : SvxBitmapListItem::SvxBitmapListItem()
224 : : {
225 : 0 : }
226 : :
227 : 2132 : SvxBitmapListItem::SvxBitmapListItem( XBitmapListRef pList, sal_uInt16 nW ) :
228 : : SfxPoolItem( nW ),
229 : 2132 : pBitmapList( pList )
230 : : {
231 : 2132 : }
232 : :
233 : 2132 : SvxBitmapListItem::SvxBitmapListItem( const SvxBitmapListItem& rItem ) :
234 : : SfxPoolItem( rItem ),
235 : 2132 : pBitmapList( rItem.pBitmapList )
236 : : {
237 : 2132 : }
238 : :
239 : 0 : SfxItemPresentation SvxBitmapListItem::GetPresentation
240 : : (
241 : : SfxItemPresentation /*ePres*/,
242 : : SfxMapUnit /*eCoreUnit*/,
243 : : SfxMapUnit /*ePresUnit*/,
244 : : XubString& rText, const IntlWrapper *
245 : : ) const
246 : : {
247 : 0 : rText.Erase();
248 : 0 : return SFX_ITEM_PRESENTATION_NONE;
249 : : }
250 : :
251 : 0 : int SvxBitmapListItem::operator==( const SfxPoolItem& rItem ) const
252 : : {
253 : : DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" );
254 : 0 : return ( ( SvxBitmapListItem& ) rItem).pBitmapList == pBitmapList;
255 : : }
256 : :
257 : 2132 : SfxPoolItem* SvxBitmapListItem::Clone( SfxItemPool * ) const
258 : : {
259 [ + - ]: 2132 : return new SvxBitmapListItem( *this );
260 : : }
261 : :
262 [ # # ][ # # ]: 0 : QUERY_PUT_IMPL( SvxBitmapListItem, BitmapList )
[ # # ][ # # ]
[ # # ][ # # ]
263 : :
264 : : //==================================================================
265 : : //
266 : : // SvxDashListItem
267 : : //
268 : : //==================================================================
269 : :
270 : 0 : SvxDashListItem::SvxDashListItem() :
271 : 0 : pDashList( 0 )
272 : : {
273 : 0 : }
274 : :
275 : 2132 : SvxDashListItem::SvxDashListItem( XDashListRef pList, sal_uInt16 nW ) :
276 : : SfxPoolItem( nW ),
277 : 2132 : pDashList( pList )
278 : : {
279 : 2132 : }
280 : :
281 : 2132 : SvxDashListItem::SvxDashListItem( const SvxDashListItem& rItem ) :
282 : : SfxPoolItem( rItem ),
283 : 2132 : pDashList( rItem.pDashList )
284 : : {
285 : 2132 : }
286 : :
287 : 0 : SfxItemPresentation SvxDashListItem::GetPresentation
288 : : (
289 : : SfxItemPresentation /*ePres*/,
290 : : SfxMapUnit /*eCoreUnit*/,
291 : : SfxMapUnit /*ePresUnit*/,
292 : : XubString& rText, const IntlWrapper *
293 : : ) const
294 : : {
295 : 0 : rText.Erase();
296 : 0 : return SFX_ITEM_PRESENTATION_NONE;
297 : : }
298 : :
299 : 0 : int SvxDashListItem::operator==( const SfxPoolItem& rItem ) const
300 : : {
301 : : DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" );
302 : 0 : return ( ( SvxDashListItem& ) rItem).pDashList == pDashList;
303 : : }
304 : :
305 : 2132 : SfxPoolItem* SvxDashListItem::Clone( SfxItemPool * ) const
306 : : {
307 [ + - ]: 2132 : return new SvxDashListItem( *this );
308 : : }
309 : :
310 [ # # ][ # # ]: 0 : QUERY_PUT_IMPL( SvxDashListItem, DashList )
[ # # ][ # # ]
[ # # ][ # # ]
311 : :
312 : : //==================================================================
313 : : //
314 : : // SvxLineEndListItem
315 : : //
316 : : //==================================================================
317 : :
318 : 0 : SvxLineEndListItem::SvxLineEndListItem()
319 : : {
320 : 0 : }
321 : :
322 : 2132 : SvxLineEndListItem::SvxLineEndListItem( XLineEndListRef pList, sal_uInt16 nW ) :
323 : : SfxPoolItem( nW ),
324 : 2132 : pLineEndList( pList )
325 : : {
326 : 2132 : }
327 : :
328 : 2132 : SvxLineEndListItem::SvxLineEndListItem( const SvxLineEndListItem& rItem ) :
329 : : SfxPoolItem( rItem ),
330 : 2132 : pLineEndList( rItem.pLineEndList )
331 : : {
332 : 2132 : }
333 : :
334 : 0 : SfxItemPresentation SvxLineEndListItem::GetPresentation
335 : : (
336 : : SfxItemPresentation /*ePres*/,
337 : : SfxMapUnit /*eCoreUnit*/,
338 : : SfxMapUnit /*ePresUnit*/,
339 : : XubString& rText, const IntlWrapper *
340 : : ) const
341 : : {
342 : 0 : rText.Erase();
343 : 0 : return SFX_ITEM_PRESENTATION_NONE;
344 : : }
345 : :
346 : 0 : int SvxLineEndListItem::operator==( const SfxPoolItem& rItem ) const
347 : : {
348 : : DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" );
349 : 0 : return ( ( SvxLineEndListItem& ) rItem).pLineEndList == pLineEndList;
350 : : }
351 : :
352 : 2132 : SfxPoolItem* SvxLineEndListItem::Clone( SfxItemPool * ) const
353 : : {
354 [ + - ]: 2132 : return new SvxLineEndListItem( *this );
355 : : }
356 : :
357 [ # # ][ # # ]: 0 : QUERY_PUT_IMPL( SvxLineEndListItem, LineEndList )
[ # # ][ # # ]
[ # # ][ # # ]
358 : :
359 : :
360 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|