LibreOffice Module svx (master) 1
drawitem.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <svx/drawitem.hxx>
21#include <svx/xtable.hxx>
22
23using namespace ::com::sun::star;
24
25
33
35{
36}
37
38
40 SfxPoolItem( nW ),
41 pColorList( pTable )
42{
43}
44
45
47 SfxPoolItem( rItem ),
48 pColorList( rItem.pColorList )
49{
50}
51
53(
54 SfxItemPresentation /*ePres*/,
55 MapUnit /*eCoreUnit*/,
56 MapUnit /*ePresUnit*/,
57 OUString& rText, const IntlWrapper&
58) const
59{
60 rText.clear();
61 return false;
62}
63
64bool SvxColorListItem::operator==( const SfxPoolItem& rItem ) const
65{
66 assert(SfxPoolItem::operator==(rItem));
67 return static_cast<const SvxColorListItem&>(rItem).pColorList == pColorList;
68}
69
71{
72 return new SvxColorListItem( *this );
73}
74
75// Should be a template class but ...
76#define QUERY_PUT_IMPL(svtype, xtype) \
77bool svtype::QueryValue( css::uno::Any& rVal, sal_uInt8 ) const \
78{ \
79 rVal <<= uno::Reference< uno::XWeak >( p##xtype ); \
80 return true; \
81} \
82\
83bool svtype::PutValue( const css::uno::Any& rVal, sal_uInt8 ) \
84{ \
85 uno::Reference< uno::XWeak > xRef; \
86 if( rVal >>= xRef ) { \
87 p##xtype = X##xtype##Ref(dynamic_cast<X##xtype *>(xRef.get())); \
88 return true; \
89 } \
90 return false; \
91}
92
94
96{
97}
98
100 SfxPoolItem( nW ),
101 pGradientList( pList )
102{
103}
104
105
107 SfxPoolItem( rItem ),
108 pGradientList( rItem.pGradientList )
109{
110}
111
112
114(
115 SfxItemPresentation /*ePres*/,
116 MapUnit /*eCoreUnit*/,
117 MapUnit /*ePresUnit*/,
118 OUString& rText, const IntlWrapper&
119) const
120{
121 rText.clear();
122 return false;
123}
124
125
127{
128 assert(SfxPoolItem::operator==(rItem));
129 return static_cast<const SvxGradientListItem&>(rItem).pGradientList == pGradientList;
130}
131
133{
134 return new SvxGradientListItem( *this );
135}
136
137QUERY_PUT_IMPL( SvxGradientListItem, GradientList )
138
140{
141}
142
143
145 SfxPoolItem( nW ),
146 pHatchList( pList )
147{
148}
149
150
152 SfxPoolItem( rItem ),
153 pHatchList( rItem.pHatchList )
154{
155}
156
157
159(
160 SfxItemPresentation /*ePres*/,
161 MapUnit /*eCoreUnit*/,
162 MapUnit /*ePresUnit*/,
163 OUString& rText, const IntlWrapper&
164) const
165{
166 rText.clear();
167 return false;
168}
169
170
172{
173 assert(SfxPoolItem::operator==(rItem));
174 return static_cast<const SvxHatchListItem&>(rItem).pHatchList == pHatchList;
175}
176
178{
179 return new SvxHatchListItem( *this );
180}
181
183
185{
186}
187
189 SfxPoolItem( nW ),
190 pBitmapList( pList )
191{
192}
193
195 SfxPoolItem( rItem ),
196 pBitmapList( rItem.pBitmapList )
197{
198}
199
201(
202 SfxItemPresentation /*ePres*/,
203 MapUnit /*eCoreUnit*/,
204 MapUnit /*ePresUnit*/,
205 OUString& rText, const IntlWrapper&
206) const
207{
208 rText.clear();
209 return false;
210}
211
213{
214 assert(SfxPoolItem::operator==(rItem));
215 return static_cast<const SvxBitmapListItem&>(rItem).pBitmapList == pBitmapList;
216}
217
219{
220 return new SvxBitmapListItem( *this );
221}
222
224
226{
227}
228
230 SfxPoolItem( nW ),
231 pPatternList( pList )
232{
233}
234
236 SfxPoolItem( rItem ),
237 pPatternList( rItem.pPatternList )
238{
239}
240
242(
243 SfxItemPresentation /*ePres*/,
244 MapUnit /*eCoreUnit*/,
245 MapUnit /*ePresUnit*/,
246 OUString& rText, const IntlWrapper&
247) const
248{
249 rText.clear();
250 return false;
251}
252
254{
255 assert(SfxPoolItem::operator==(rItem));
256 return static_cast<const SvxPatternListItem&>(rItem).pPatternList == pPatternList;
257}
258
260{
261 return new SvxPatternListItem( *this );
262}
263
265
267{
268}
269
271 SfxPoolItem( nW ),
272 pDashList( pList )
273{
274}
275
277 SfxPoolItem( rItem ),
278 pDashList( rItem.pDashList )
279{
280}
281
283(
284 SfxItemPresentation /*ePres*/,
285 MapUnit /*eCoreUnit*/,
286 MapUnit /*ePresUnit*/,
287 OUString& rText, const IntlWrapper&
288) const
289{
290 rText.clear();
291 return false;
292}
293
294bool SvxDashListItem::operator==( const SfxPoolItem& rItem ) const
295{
296 assert(SfxPoolItem::operator==(rItem));
297 return static_cast<const SvxDashListItem&>(rItem).pDashList == pDashList;
298}
299
301{
302 return new SvxDashListItem( *this );
303}
304
306
308{
309}
310
312 SfxPoolItem( nW ),
313 pLineEndList( pList )
314{
315}
316
318 SfxPoolItem( rItem ),
319 pLineEndList( rItem.pLineEndList )
320{
321}
322
324(
325 SfxItemPresentation /*ePres*/,
326 MapUnit /*eCoreUnit*/,
327 MapUnit /*ePresUnit*/,
328 OUString& rText, const IntlWrapper&
329) const
330{
331 rText.clear();
332 return false;
333}
334
336{
337 assert(SfxPoolItem::operator==(rItem));
338 return static_cast<const SvxLineEndListItem&>(rItem).pLineEndList == pLineEndList;
339}
340
342{
343 return new SvxLineEndListItem( *this );
344}
345
347
348
349/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool operator==(const SfxPoolItem &) const override
Definition: drawitem.cxx:212
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: drawitem.cxx:201
XBitmapListRef pBitmapList
Definition: drawitem.hxx:102
static SfxPoolItem * CreateDefault()
Definition: drawitem.cxx:29
virtual SvxBitmapListItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: drawitem.cxx:218
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: drawitem.cxx:53
virtual SvxColorListItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: drawitem.cxx:70
static SfxPoolItem * CreateDefault()
Definition: drawitem.cxx:26
XColorListRef pColorList
Definition: drawitem.hxx:28
virtual bool operator==(const SfxPoolItem &) const override
Definition: drawitem.cxx:64
XDashListRef pDashList
Definition: drawitem.hxx:151
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: drawitem.cxx:283
static SfxPoolItem * CreateDefault()
Definition: drawitem.cxx:31
virtual bool operator==(const SfxPoolItem &) const override
Definition: drawitem.cxx:294
virtual SvxDashListItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: drawitem.cxx:300
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: drawitem.cxx:114
virtual SvxGradientListItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: drawitem.cxx:132
XGradientListRef pGradientList
Definition: drawitem.hxx:53
virtual bool operator==(const SfxPoolItem &) const override
Definition: drawitem.cxx:126
static SfxPoolItem * CreateDefault()
Definition: drawitem.cxx:27
XHatchListRef pHatchList
Definition: drawitem.hxx:78
static SfxPoolItem * CreateDefault()
Definition: drawitem.cxx:28
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: drawitem.cxx:159
virtual bool operator==(const SfxPoolItem &) const override
Definition: drawitem.cxx:171
virtual SvxHatchListItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: drawitem.cxx:177
virtual bool operator==(const SfxPoolItem &) const override
Definition: drawitem.cxx:335
static SfxPoolItem * CreateDefault()
Definition: drawitem.cxx:32
XLineEndListRef pLineEndList
Definition: drawitem.hxx:176
virtual SvxLineEndListItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: drawitem.cxx:341
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: drawitem.cxx:324
XPatternListRef pPatternList
Definition: drawitem.hxx:127
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: drawitem.cxx:242
virtual bool operator==(const SfxPoolItem &) const override
Definition: drawitem.cxx:253
virtual SvxPatternListItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: drawitem.cxx:259
static SfxPoolItem * CreateDefault()
Definition: drawitem.cxx:30
#define QUERY_PUT_IMPL(svtype, xtype)
Definition: drawitem.cxx:76
MapUnit
std::vector< NamedColor > ColorList
Definition: palettes.hxx:26
SfxItemPresentation