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#include <utility>
23
24using namespace ::com::sun::star;
25
26
34
36{
37}
38
39
41 SfxPoolItem( nW ),
42 pColorList(std::move( pTable ))
43{
44}
45
46
48 SfxPoolItem( rItem ),
49 pColorList( rItem.pColorList )
50{
51}
52
54(
55 SfxItemPresentation /*ePres*/,
56 MapUnit /*eCoreUnit*/,
57 MapUnit /*ePresUnit*/,
58 OUString& rText, const IntlWrapper&
59) const
60{
61 rText.clear();
62 return false;
63}
64
65bool SvxColorListItem::operator==( const SfxPoolItem& rItem ) const
66{
67 assert(SfxPoolItem::operator==(rItem));
68 return static_cast<const SvxColorListItem&>(rItem).pColorList == pColorList;
69}
70
72{
73 return new SvxColorListItem( *this );
74}
75
76// Should be a template class but ...
77#define QUERY_PUT_IMPL(svtype, xtype) \
78bool svtype::QueryValue( css::uno::Any& rVal, sal_uInt8 ) const \
79{ \
80 rVal <<= uno::Reference< uno::XWeak >( p##xtype ); \
81 return true; \
82} \
83\
84bool svtype::PutValue( const css::uno::Any& rVal, sal_uInt8 ) \
85{ \
86 uno::Reference< uno::XWeak > xRef; \
87 if( rVal >>= xRef ) { \
88 p##xtype = X##xtype##Ref(dynamic_cast<X##xtype *>(xRef.get())); \
89 return true; \
90 } \
91 return false; \
92}
93
95
97{
98}
99
101 SfxPoolItem( nW ),
102 pGradientList(std::move( pList ))
103{
104}
105
106
108 SfxPoolItem( rItem ),
109 pGradientList( rItem.pGradientList )
110{
111}
112
113
115(
116 SfxItemPresentation /*ePres*/,
117 MapUnit /*eCoreUnit*/,
118 MapUnit /*ePresUnit*/,
119 OUString& rText, const IntlWrapper&
120) const
121{
122 rText.clear();
123 return false;
124}
125
126
128{
129 assert(SfxPoolItem::operator==(rItem));
130 return static_cast<const SvxGradientListItem&>(rItem).pGradientList == pGradientList;
131}
132
134{
135 return new SvxGradientListItem( *this );
136}
137
138QUERY_PUT_IMPL( SvxGradientListItem, GradientList )
139
141{
142}
143
144
146 SfxPoolItem( nW ),
147 pHatchList(std::move( pList ))
148{
149}
150
151
153 SfxPoolItem( rItem ),
154 pHatchList( rItem.pHatchList )
155{
156}
157
158
160(
161 SfxItemPresentation /*ePres*/,
162 MapUnit /*eCoreUnit*/,
163 MapUnit /*ePresUnit*/,
164 OUString& rText, const IntlWrapper&
165) const
166{
167 rText.clear();
168 return false;
169}
170
171
173{
174 assert(SfxPoolItem::operator==(rItem));
175 return static_cast<const SvxHatchListItem&>(rItem).pHatchList == pHatchList;
176}
177
179{
180 return new SvxHatchListItem( *this );
181}
182
184
186{
187}
188
190 SfxPoolItem( nW ),
191 pBitmapList(std::move( pList ))
192{
193}
194
196 SfxPoolItem( rItem ),
197 pBitmapList( rItem.pBitmapList )
198{
199}
200
202(
203 SfxItemPresentation /*ePres*/,
204 MapUnit /*eCoreUnit*/,
205 MapUnit /*ePresUnit*/,
206 OUString& rText, const IntlWrapper&
207) const
208{
209 rText.clear();
210 return false;
211}
212
214{
215 assert(SfxPoolItem::operator==(rItem));
216 return static_cast<const SvxBitmapListItem&>(rItem).pBitmapList == pBitmapList;
217}
218
220{
221 return new SvxBitmapListItem( *this );
222}
223
225
227{
228}
229
231 SfxPoolItem( nW ),
232 pPatternList(std::move( pList ))
233{
234}
235
237 SfxPoolItem( rItem ),
238 pPatternList( rItem.pPatternList )
239{
240}
241
243(
244 SfxItemPresentation /*ePres*/,
245 MapUnit /*eCoreUnit*/,
246 MapUnit /*ePresUnit*/,
247 OUString& rText, const IntlWrapper&
248) const
249{
250 rText.clear();
251 return false;
252}
253
255{
256 assert(SfxPoolItem::operator==(rItem));
257 return static_cast<const SvxPatternListItem&>(rItem).pPatternList == pPatternList;
258}
259
261{
262 return new SvxPatternListItem( *this );
263}
264
266
268{
269}
270
272 SfxPoolItem( nW ),
273 pDashList(std::move( pList ))
274{
275}
276
278 SfxPoolItem( rItem ),
279 pDashList( rItem.pDashList )
280{
281}
282
284(
285 SfxItemPresentation /*ePres*/,
286 MapUnit /*eCoreUnit*/,
287 MapUnit /*ePresUnit*/,
288 OUString& rText, const IntlWrapper&
289) const
290{
291 rText.clear();
292 return false;
293}
294
295bool SvxDashListItem::operator==( const SfxPoolItem& rItem ) const
296{
297 assert(SfxPoolItem::operator==(rItem));
298 return static_cast<const SvxDashListItem&>(rItem).pDashList == pDashList;
299}
300
302{
303 return new SvxDashListItem( *this );
304}
305
307
309{
310}
311
313 SfxPoolItem( nW ),
314 pLineEndList(std::move( pList ))
315{
316}
317
319 SfxPoolItem( rItem ),
320 pLineEndList( rItem.pLineEndList )
321{
322}
323
325(
326 SfxItemPresentation /*ePres*/,
327 MapUnit /*eCoreUnit*/,
328 MapUnit /*ePresUnit*/,
329 OUString& rText, const IntlWrapper&
330) const
331{
332 rText.clear();
333 return false;
334}
335
337{
338 assert(SfxPoolItem::operator==(rItem));
339 return static_cast<const SvxLineEndListItem&>(rItem).pLineEndList == pLineEndList;
340}
341
343{
344 return new SvxLineEndListItem( *this );
345}
346
348
349
350/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool operator==(const SfxPoolItem &) const override
Definition: drawitem.cxx:213
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: drawitem.cxx:202
XBitmapListRef pBitmapList
Definition: drawitem.hxx:102
static SfxPoolItem * CreateDefault()
Definition: drawitem.cxx:30
virtual SvxBitmapListItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: drawitem.cxx:219
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: drawitem.cxx:54
virtual SvxColorListItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: drawitem.cxx:71
static SfxPoolItem * CreateDefault()
Definition: drawitem.cxx:27
XColorListRef pColorList
Definition: drawitem.hxx:28
virtual bool operator==(const SfxPoolItem &) const override
Definition: drawitem.cxx:65
XDashListRef pDashList
Definition: drawitem.hxx:151
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: drawitem.cxx:284
static SfxPoolItem * CreateDefault()
Definition: drawitem.cxx:32
virtual bool operator==(const SfxPoolItem &) const override
Definition: drawitem.cxx:295
virtual SvxDashListItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: drawitem.cxx:301
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: drawitem.cxx:115
virtual SvxGradientListItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: drawitem.cxx:133
XGradientListRef pGradientList
Definition: drawitem.hxx:53
virtual bool operator==(const SfxPoolItem &) const override
Definition: drawitem.cxx:127
static SfxPoolItem * CreateDefault()
Definition: drawitem.cxx:28
XHatchListRef pHatchList
Definition: drawitem.hxx:78
static SfxPoolItem * CreateDefault()
Definition: drawitem.cxx:29
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: drawitem.cxx:160
virtual bool operator==(const SfxPoolItem &) const override
Definition: drawitem.cxx:172
virtual SvxHatchListItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: drawitem.cxx:178
virtual bool operator==(const SfxPoolItem &) const override
Definition: drawitem.cxx:336
static SfxPoolItem * CreateDefault()
Definition: drawitem.cxx:33
XLineEndListRef pLineEndList
Definition: drawitem.hxx:176
virtual SvxLineEndListItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: drawitem.cxx:342
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: drawitem.cxx:325
XPatternListRef pPatternList
Definition: drawitem.hxx:127
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: drawitem.cxx:243
virtual bool operator==(const SfxPoolItem &) const override
Definition: drawitem.cxx:254
virtual SvxPatternListItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: drawitem.cxx:260
static SfxPoolItem * CreateDefault()
Definition: drawitem.cxx:31
#define QUERY_PUT_IMPL(svtype, xtype)
Definition: drawitem.cxx:77
MapUnit
std::vector< NamedColor > ColorList
Definition: palettes.hxx:26
SfxItemPresentation