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