1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
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.
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).
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.
27 ************************************************************************/
30 // include ---------------------------------------------------------------
31 #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
32 #include <com/sun/star/drawing/Hatch.hpp>
33 #include <com/sun/star/drawing/LineStyle.hpp>
34 #include <com/sun/star/drawing/LineDash.hpp>
35 #include <com/sun/star/drawing/DashStyle.hpp>
36 #include <com/sun/star/awt/Point.hpp>
37 #include <com/sun/star/drawing/PointSequence.hpp>
38 #include <com/sun/star/drawing/FillStyle.hpp>
39 #include <com/sun/star/awt/Gradient.hpp>
40 #include <com/sun/star/uno/Sequence.hxx>
41 #include <com/sun/star/beans/PropertyValue.hpp>
42 #include <svl/itempool.hxx>
43 #include <editeng/memberids.hrc>
44 #include <tools/stream.hxx>
46 #include "svx/unoapi.hxx"
47 #include <svl/style.hxx>
49 #include <tools/bigint.hxx>
50 #include <svl/itemset.hxx>
51 #include <svx/dialogs.hrc>
52 #include "svx/svdstr.hrc"
53 #include "svx/xattr.hxx"
54 #include <svx/xtable.hxx>
55 #include <svx/dialmgr.hxx>
56 #include <editeng/itemtype.hxx>
57 #include <svx/xdef.hxx>
58 #include <svx/unomid.hxx>
59 #include <svx/svdmodel.hxx>
60 #include <basegfx/polygon/b2dpolygon.hxx>
61 #include <basegfx/point/b2dpoint.hxx>
62 #include <basegfx/vector/b2dvector.hxx>
63 #include <basegfx/tools/unotools.hxx>
67 using namespace ::rtl
;
68 using namespace ::com::sun::star
;
70 #define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
71 #define MM100_TO_TWIP(MM100) ((MM100) >= 0 ? (((MM100)*72L+63L)/127L) : (((MM100)*72L-63L)/127L))
73 /************************************************************************/
75 #define VCLTOSVCOL( rCol ) (sal_uInt16)((((sal_uInt16)(rCol))<<8)|(rCol))
77 /************************************************************************/
79 TYPEINIT1_AUTOFACTORY(NameOrIndex
, SfxStringItem
);
81 /*************************************************************************
85 \*************************************************************************/
87 long ScaleMetricValue( long nVal
, long nMul
, long nDiv
)
93 if ( aVal
.IsNeg() != ( nDiv
< 0 ) )
94 aVal
-=nDiv
/2; // fuer korrektes Runden
96 aVal
+=nDiv
/2; // fuer korrektes Runden
103 /*************************************************************************
105 |* NameOrIndex::NameOrIndex(sal_uInt16 nWhich, sal_Int32 nIndex)
107 *************************************************************************/
109 NameOrIndex::NameOrIndex(sal_uInt16 _nWhich
, sal_Int32 nIndex
) :
110 SfxStringItem(_nWhich
, rtl::OUString()),
115 /*************************************************************************
117 |* NameOrIndex::NameOrIndex(sal_uInt16 nWhich, const String& rName)
119 *************************************************************************/
121 NameOrIndex::NameOrIndex(sal_uInt16 _nWhich
, const XubString
& rName
) :
122 SfxStringItem(_nWhich
, rName
),
127 /*************************************************************************
129 |* NameOrIndex::NameOrIndex(sal_uInt16 nWhich, SvStream& rIn)
131 *************************************************************************/
133 NameOrIndex::NameOrIndex(sal_uInt16 _nWhich
, SvStream
& rIn
) :
134 SfxStringItem(_nWhich
, rIn
)
139 /*************************************************************************
141 |* NameOrIndex::NameOrIndex(const NameOrIndex& rNameOrIndex)
143 *************************************************************************/
145 NameOrIndex::NameOrIndex(const NameOrIndex
& rNameOrIndex
) :
146 SfxStringItem(rNameOrIndex
),
147 nPalIndex(rNameOrIndex
.nPalIndex
)
151 /*************************************************************************
153 |* int NameOrIndex::operator==(const SfxPoolItem& rItem) const
155 *************************************************************************/
157 int NameOrIndex::operator==(const SfxPoolItem
& rItem
) const
159 return ( SfxStringItem::operator==(rItem
) &&
160 ((const NameOrIndex
&) rItem
).nPalIndex
== nPalIndex
);
163 /*************************************************************************
165 |* SfxPoolItem* NameOrIndex::Clone(SfxItemPool* pPool) const
167 *************************************************************************/
169 SfxPoolItem
* NameOrIndex::Clone(SfxItemPool
* /*pPool*/) const
172 return new NameOrIndex(*this);
175 /*************************************************************************
177 |* SfxPoolItem* NameOrIndex::Create(SvStream& rIn, sal_uInt16 nVer) const
179 *************************************************************************/
181 SfxPoolItem
* NameOrIndex::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
183 return new NameOrIndex(Which(), rIn
);
186 /*************************************************************************
188 |* SvStream* NameOrIndex::Store(SvStream& rIn) const
190 *************************************************************************/
192 SvStream
& NameOrIndex::Store( SvStream
& rOut
, sal_uInt16 nItemVersion
) const
194 SfxStringItem::Store( rOut
, nItemVersion
);
199 /** this static checks if the given NameOrIndex item has a unique name for its value.
200 The returned String is a unique name for an item with this value in both given pools.
201 Argument pPool2 can be null.
202 If returned string equals NameOrIndex->GetName(), the name was already unique.
204 String
NameOrIndex::CheckNamedItem( const NameOrIndex
* pCheckItem
, const sal_uInt16 nWhich
, const SfxItemPool
* pPool1
, const SfxItemPool
* /*pPool2*/, SvxCompareValueFunc pCompareValueFunc
, sal_uInt16 nPrefixResId
, const XPropertyListRef
&pDefaults
)
206 sal_Bool bForceNew
= sal_False
;
209 SvxUnogetInternalNameForItem( nWhich
, pCheckItem
->GetName(), aUniqueName
);
211 // 2. if we have a name check if there is already an item with the
212 // same name in the documents pool with a different line end or start
214 if( aUniqueName
.Len() && pPool1
)
216 const sal_uInt32 nCount
= pPool1
->GetItemCount2( nWhich
);
218 const NameOrIndex
*pItem
;
219 for( sal_uInt32 nSurrogate
= 0; nSurrogate
< nCount
; nSurrogate
++ )
221 pItem
= (NameOrIndex
*)pPool1
->GetItem2( nWhich
, nSurrogate
);
223 if( pItem
&& ( pItem
->GetName() == pCheckItem
->GetName() ) )
225 // if there is already an item with the same name and the same
226 // value its ok to set it
227 if( !pCompareValueFunc( pItem
, pCheckItem
) )
229 // same name but different value, we need a new name for this item
230 aUniqueName
= String();
231 bForceNew
= sal_True
;
238 // if we have no name yet, find existing item with same conent or
239 // create a unique name
240 if( aUniqueName
.Len() == 0 )
242 sal_Int32 nUserIndex
= 1;
243 const ResId
aRes(SVX_RES(nPrefixResId
));
244 String
aUser( aRes
);
245 aUser
+= sal_Unicode( ' ' );
247 if( pDefaults
.get() )
249 const int nCount
= pDefaults
->Count();
251 for( nIndex
= 0; nIndex
< nCount
; nIndex
++ )
253 XPropertyEntry
* pEntry
= pDefaults
->Get( nIndex
, 0 );
260 case XATTR_FILLBITMAP
:
261 bFound
= (((XFillBitmapItem
*)pCheckItem
)->GetBitmapValue().GetGraphicObject().GetUniqueID() ==
262 ((XBitmapEntry
*)pEntry
)->GetXBitmap().GetGraphicObject().GetUniqueID());
265 bFound
= (((XLineDashItem
*)pCheckItem
)->GetDashValue() == ((XDashEntry
*)pEntry
) ->GetDash());
267 case XATTR_LINESTART
:
268 bFound
= (((XLineStartItem
*)pCheckItem
)->GetLineStartValue() == ((XLineEndEntry
*)pEntry
)->GetLineEnd());
271 bFound
= (((XLineEndItem
*)pCheckItem
)->GetLineEndValue() == ((XLineEndEntry
*)pEntry
)->GetLineEnd());
273 case XATTR_FILLGRADIENT
:
274 bFound
= (((XFillGradientItem
*)pCheckItem
)->GetGradientValue() == ((XGradientEntry
*)pEntry
)->GetGradient());
276 case XATTR_FILLHATCH
:
277 bFound
= (((XFillHatchItem
*)pCheckItem
)->GetHatchValue() == ((XHatchEntry
*)pEntry
)->GetHatch());
283 aUniqueName
= pEntry
->GetName();
288 sal_Int32 nThisIndex
= pEntry
->GetName().Copy( aUser
.Len() ).ToInt32();
289 if( nThisIndex
>= nUserIndex
)
290 nUserIndex
= nThisIndex
+ 1;
296 if( (aUniqueName
.Len() == 0) && pPool1
)
298 const sal_uInt32 nCount
= pPool1
->GetItemCount2( nWhich
);
299 const NameOrIndex
*pItem
;
300 for( sal_uInt32 nSurrogate
= 0; nSurrogate
< nCount
; nSurrogate
++ )
302 pItem
= (NameOrIndex
*)pPool1
->GetItem2( nWhich
, nSurrogate
);
304 if( pItem
&& pItem
->GetName().Len() )
306 if( !bForceNew
&& pCompareValueFunc( pItem
, pCheckItem
) )
307 return pItem
->GetName();
309 if( pItem
->GetName().CompareTo( aUser
, aUser
.Len() ) == 0 )
311 sal_Int32 nThisIndex
= pItem
->GetName().Copy( aUser
.Len() ).ToInt32();
312 if( nThisIndex
>= nUserIndex
)
313 nUserIndex
= nThisIndex
+ 1;
318 aUniqueName
+= String::CreateFromInt32( nUserIndex
);
325 //*************************************************************************
327 // -------------------
329 // -------------------
330 TYPEINIT1_AUTOFACTORY(XColorItem
, NameOrIndex
);
332 /*************************************************************************
334 |* XColorItem::XColorItem(sal_uInt16 nWhich, sal_Int32 nIndex, const Color& rTheColor)
336 \************************************************************************/
338 XColorItem::XColorItem(sal_uInt16 _nWhich
, sal_Int32 nIndex
, const Color
& rTheColor
) :
339 NameOrIndex(_nWhich
, nIndex
),
344 /*************************************************************************
346 |* XColorItem::XColorItem(sal_uInt16 nWhich, const String& rName, const Color& rTheColor)
348 \************************************************************************/
350 XColorItem::XColorItem(sal_uInt16 _nWhich
, const XubString
& rName
, const Color
& rTheColor
) :
351 NameOrIndex(_nWhich
, rName
),
356 /*************************************************************************
358 |* XColorItem::XColorItem(const XColorItem& rItem)
360 \************************************************************************/
362 XColorItem::XColorItem(const XColorItem
& rItem
) :
368 /*************************************************************************
370 |* XColorItem::XColorItem(sal_uInt16 nWhich, SvStream& rIn)
372 \************************************************************************/
374 XColorItem::XColorItem(sal_uInt16 _nWhich
, SvStream
& rIn
) :
375 NameOrIndex(_nWhich
, rIn
)
383 /*************************************************************************
385 |* XColorItem::Clone(SfxItemPool* pPool) const
387 \************************************************************************/
389 SfxPoolItem
* XColorItem::Clone(SfxItemPool
* /*pPool*/) const
391 return new XColorItem(*this);
394 /*************************************************************************
396 |* int XColorItem::operator==(const SfxPoolItem& rItem) const
398 \************************************************************************/
400 int XColorItem::operator==(const SfxPoolItem
& rItem
) const
402 return ( NameOrIndex::operator==(rItem
) &&
403 ((const XColorItem
&) rItem
).aColor
== aColor
);
406 /*************************************************************************
408 |* SfxPoolItem* XColorItem::Create(SvStream& rIn, sal_uInt16 nVer) const
410 \************************************************************************/
412 SfxPoolItem
* XColorItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
414 return new XColorItem(Which(), rIn
);
417 /*************************************************************************
419 |* SfxPoolItem* XColorItem::Store(SvStream& rOut) const
421 \************************************************************************/
423 SvStream
& XColorItem::Store( SvStream
& rOut
, sal_uInt16 nItemVersion
) const
425 NameOrIndex::Store( rOut
, nItemVersion
);
435 /*************************************************************************
437 |* const XColor& XColorItem::GetColorValue(const XColorList* pTable) const
439 \************************************************************************/
441 const Color
& XColorItem::GetColorValue(const XColorList
* pTable
) const
446 return pTable
->GetColor(GetIndex())->GetColor();
450 bool XColorItem::QueryValue( ::com::sun::star::uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
452 rVal
<<= (sal_Int32
)GetColorValue().GetRGBColor();
456 bool XColorItem::PutValue( const ::com::sun::star::uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
458 sal_Int32 nValue
= 0;
460 SetColorValue( nValue
);
466 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
468 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
470 //---------------------
471 // class XLineStyleItem
472 //---------------------
473 TYPEINIT1_AUTOFACTORY(XLineStyleItem
, SfxEnumItem
);
475 /*************************************************************************
477 |* XLineStyleItem::XLineStyleItem(XLineStyle eTheLineStyle)
479 *************************************************************************/
481 XLineStyleItem::XLineStyleItem(XLineStyle eTheLineStyle
) :
482 SfxEnumItem(XATTR_LINESTYLE
, sal::static_int_cast
< sal_uInt16
>(eTheLineStyle
))
486 /*************************************************************************
488 |* XLineStyleItem::XLineStyleItem(SvStream& rIn)
490 *************************************************************************/
492 XLineStyleItem::XLineStyleItem(SvStream
& rIn
) :
493 SfxEnumItem(XATTR_LINESTYLE
, rIn
)
497 /*************************************************************************
499 |* XLineStyleItem::Clone(SfxItemPool* pPool) const
501 *************************************************************************/
503 SfxPoolItem
* XLineStyleItem::Clone(SfxItemPool
* /*pPool*/) const
505 return new XLineStyleItem( *this );
508 /*************************************************************************
510 |* SfxPoolItem* XLineStyleItem::Create(SvStream& rIn, sal_uInt16 nVer) const
512 *************************************************************************/
514 SfxPoolItem
* XLineStyleItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
516 return new XLineStyleItem(rIn
);
519 //------------------------------------------------------------------------
521 SfxItemPresentation
XLineStyleItem::GetPresentation
523 SfxItemPresentation ePres
,
524 SfxMapUnit
/*eCoreUnit*/,
525 SfxMapUnit
/*ePresUnit*/,
526 XubString
& rText
, const IntlWrapper
*
533 case SFX_ITEM_PRESENTATION_NONE
:
535 case SFX_ITEM_PRESENTATION_COMPLETE
:
536 case SFX_ITEM_PRESENTATION_NAMELESS
:
540 switch( (sal_uInt16
)GetValue() )
543 nId
= RID_SVXSTR_INVISIBLE
;
546 nId
= RID_SVXSTR_SOLID
;
551 rText
= SVX_RESSTR( nId
);
555 return SFX_ITEM_PRESENTATION_NONE
;
559 bool XLineStyleItem::QueryValue( ::com::sun::star::uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
561 ::com::sun::star::drawing::LineStyle eLS
= (::com::sun::star::drawing::LineStyle
)GetValue();
566 bool XLineStyleItem::PutValue( const ::com::sun::star::uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
568 ::com::sun::star::drawing::LineStyle eLS
;
571 // also try an int (for Basic)
575 eLS
= (::com::sun::star::drawing::LineStyle
)nLS
;
578 SetValue( sal::static_int_cast
< sal_uInt16
>( eLS
) );
582 //------------------------------------------------------------------------
584 sal_uInt16
XLineStyleItem::GetValueCount() const
593 /*************************************************************************
595 |* XDash::XDash(XDashStyle, sal_uInt16, sal_uIntPtr, sal_uInt16, sal_uIntPtr, sal_uIntPtr)
597 *************************************************************************/
599 XDash::XDash(XDashStyle eTheDash
, sal_uInt16 nTheDots
, sal_uIntPtr nTheDotLen
,
600 sal_uInt16 nTheDashes
, sal_uIntPtr nTheDashLen
, sal_uIntPtr nTheDistance
) :
605 nDashLen(nTheDashLen
),
606 nDistance(nTheDistance
)
610 /*************************************************************************
612 |* int XDash::operator==(const SfxPoolItem& rItem) const
614 *************************************************************************/
616 bool XDash::operator==(const XDash
& rDash
) const
618 return ( eDash
== rDash
.eDash
&&
619 nDots
== rDash
.nDots
&&
620 nDotLen
== rDash
.nDotLen
&&
621 nDashes
== rDash
.nDashes
&&
622 nDashLen
== rDash
.nDashLen
&&
623 nDistance
== rDash
.nDistance
);
626 // XDash is translated into an array of doubles which describe the lengths of the
627 // dashes, dots and empty passages. It returns the complete length of the full DashDot
628 // sequence and fills the given vetor of doubles accordingly (also resizing, so deleting it).
629 static double SMALLEST_DASH_WIDTH(26.95);
630 double XDash::CreateDotDashArray(::std::vector
< double >& rDotDashArray
, double fLineWidth
) const
632 double fFullDotDashLen(0.0);
633 const sal_uInt16 nNumDotDashArray
= (GetDots() + GetDashes()) * 2;
634 rDotDashArray
.resize( nNumDotDashArray
, 0.0 );
637 double fDashDotDistance
= (double)GetDistance();
638 double fSingleDashLen
= (double)GetDashLen();
639 double fSingleDotLen
= (double)GetDotLen();
641 if(GetDashStyle() == XDASH_RECTRELATIVE
|| GetDashStyle() == XDASH_ROUNDRELATIVE
)
643 if(fLineWidth
!= 0.0)
645 double fFactor
= fLineWidth
/ 100.0;
652 fSingleDashLen
*= fFactor
;
657 fSingleDashLen
= fLineWidth
;
666 fSingleDotLen
*= fFactor
;
671 fSingleDotLen
= fLineWidth
;
675 if(GetDashes() || GetDots())
679 fDashDotDistance
*= fFactor
;
683 fDashDotDistance
= fLineWidth
;
694 fSingleDashLen
= (SMALLEST_DASH_WIDTH
* fSingleDashLen
) / 100.0;
699 fSingleDashLen
= SMALLEST_DASH_WIDTH
;
708 fSingleDotLen
= (SMALLEST_DASH_WIDTH
* fSingleDotLen
) / 100.0;
713 fSingleDotLen
= SMALLEST_DASH_WIDTH
;
717 if(GetDashes() || GetDots())
722 fDashDotDistance
= (SMALLEST_DASH_WIDTH
* fDashDotDistance
) / 100.0;
727 fDashDotDistance
= SMALLEST_DASH_WIDTH
;
734 // smallest dot size compare value
735 double fDotCompVal(fLineWidth
!= 0.0 ? fLineWidth
: SMALLEST_DASH_WIDTH
);
743 if(fSingleDashLen
< SMALLEST_DASH_WIDTH
)
745 fSingleDashLen
= SMALLEST_DASH_WIDTH
;
751 if(fSingleDashLen
< fDotCompVal
)
753 fSingleDashLen
= fDotCompVal
;
763 if(fSingleDotLen
< SMALLEST_DASH_WIDTH
)
765 fSingleDotLen
= SMALLEST_DASH_WIDTH
;
771 if(fSingleDotLen
< fDotCompVal
)
773 fSingleDotLen
= fDotCompVal
;
778 if(GetDashes() || GetDots())
783 if(fDashDotDistance
< SMALLEST_DASH_WIDTH
)
785 fDashDotDistance
= SMALLEST_DASH_WIDTH
;
791 if(fDashDotDistance
< fDotCompVal
)
793 fDashDotDistance
= fDotCompVal
;
799 for(a
=0;a
<GetDots();a
++)
801 rDotDashArray
[nIns
++] = fSingleDotLen
;
802 fFullDotDashLen
+= fSingleDotLen
;
803 rDotDashArray
[nIns
++] = fDashDotDistance
;
804 fFullDotDashLen
+= fDashDotDistance
;
807 for(a
=0;a
<GetDashes();a
++)
809 rDotDashArray
[nIns
++] = fSingleDashLen
;
810 fFullDotDashLen
+= fSingleDashLen
;
811 rDotDashArray
[nIns
++] = fDashDotDistance
;
812 fFullDotDashLen
+= fDashDotDistance
;
815 return fFullDotDashLen
;
818 // -------------------
819 // class XLineDashItem
820 // -------------------
821 TYPEINIT1_AUTOFACTORY(XLineDashItem
, NameOrIndex
);
823 /*************************************************************************
825 |* XLineDashItem::XLineDashItem(const String& rName, const XDash& rTheDash)
827 *************************************************************************/
829 XLineDashItem::XLineDashItem(const XubString
& rName
, const XDash
& rTheDash
) :
830 NameOrIndex(XATTR_LINEDASH
, rName
),
835 /*************************************************************************
837 |* XLineDashItem::XLineDashItem(const XLineDashItem& rItem)
839 *************************************************************************/
841 XLineDashItem::XLineDashItem(const XLineDashItem
& rItem
) :
847 /*************************************************************************
849 |* XLineDashItem::XLineDashItem(SvStream& rIn)
851 *************************************************************************/
853 XLineDashItem::XLineDashItem(SvStream
& rIn
) :
854 NameOrIndex(XATTR_LINEDASH
, rIn
)
862 rIn
>> nITemp
; aDash
.SetDashStyle((XDashStyle
)nITemp
);
863 rIn
>> nSTemp
; aDash
.SetDots(nSTemp
);
864 rIn
>> nLTemp
; aDash
.SetDotLen(nLTemp
);
865 rIn
>> nSTemp
; aDash
.SetDashes(nSTemp
);
866 rIn
>> nLTemp
; aDash
.SetDashLen(nLTemp
);
867 rIn
>> nLTemp
; aDash
.SetDistance(nLTemp
);
871 //*************************************************************************
873 XLineDashItem::XLineDashItem(SfxItemPool
* /*pPool*/, const XDash
& rTheDash
)
874 : NameOrIndex( XATTR_LINEDASH
, -1 ),
879 /*************************************************************************
881 |* XLineDashItem::Clone(SfxItemPool* pPool) const
883 *************************************************************************/
885 SfxPoolItem
* XLineDashItem::Clone(SfxItemPool
* /*pPool*/) const
887 return new XLineDashItem(*this);
890 /*************************************************************************
892 |* int XLineDashItem::operator==(const SfxPoolItem& rItem) const
894 *************************************************************************/
896 int XLineDashItem::operator==(const SfxPoolItem
& rItem
) const
898 return ( NameOrIndex::operator==(rItem
) &&
899 aDash
== ((const XLineDashItem
&) rItem
).aDash
);
902 /*************************************************************************
904 |* SfxPoolItem* XLineDashItem::Create(SvStream& rIn, sal_uInt16 nVer) const
906 *************************************************************************/
908 SfxPoolItem
* XLineDashItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
910 return new XLineDashItem(rIn
);
913 /*************************************************************************
915 |* SfxPoolItem* XLineDashItem::Store(SvStream& rOut) const
917 *************************************************************************/
919 SvStream
& XLineDashItem::Store( SvStream
& rOut
, sal_uInt16 nItemVersion
) const
921 NameOrIndex::Store( rOut
, nItemVersion
);
925 rOut
<< (sal_Int32
) aDash
.GetDashStyle();
926 rOut
<< aDash
.GetDots();
927 rOut
<< (sal_uInt32
) aDash
.GetDotLen();
928 rOut
<< aDash
.GetDashes();
929 rOut
<< (sal_uInt32
) aDash
.GetDashLen();
930 rOut
<< (sal_uInt32
) aDash
.GetDistance();
936 /*************************************************************************
938 |* const XDash& XLineDashItem::GetValue() const
940 *************************************************************************/
942 const XDash
& XLineDashItem::GetDashValue() const
947 //------------------------------------------------------------------------
949 SfxItemPresentation
XLineDashItem::GetPresentation
951 SfxItemPresentation ePres
,
952 SfxMapUnit
/*eCoreUnit*/,
953 SfxMapUnit
/*ePresUnit*/,
954 XubString
& rText
, const IntlWrapper
*
959 case SFX_ITEM_PRESENTATION_NONE
:
962 case SFX_ITEM_PRESENTATION_NAMELESS
:
963 case SFX_ITEM_PRESENTATION_COMPLETE
:
967 return SFX_ITEM_PRESENTATION_NONE
;
971 //------------------------------------------------------------------------
973 bool XLineDashItem::HasMetrics() const
978 //------------------------------------------------------------------------
980 bool XLineDashItem::ScaleMetrics(long nMul
, long nDiv
)
982 aDash
.SetDotLen( ScaleMetricValue( aDash
.GetDotLen(), nMul
, nDiv
) );
983 aDash
.SetDashLen( ScaleMetricValue( aDash
.GetDashLen(), nMul
, nDiv
) );
984 aDash
.SetDistance( ScaleMetricValue( aDash
.GetDistance(), nMul
, nDiv
) );
988 bool XLineDashItem::QueryValue( ::com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
) const
990 // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
991 nMemberId
&= ~CONVERT_TWIPS
;
997 uno::Sequence
< beans::PropertyValue
> aPropSeq( 2 );
999 ::com::sun::star::drawing::LineDash aLineDash
;
1001 const XDash
& rXD
= GetDashValue();
1002 aLineDash
.Style
= (::com::sun::star::drawing::DashStyle
)((sal_uInt16
)rXD
.GetDashStyle());
1003 aLineDash
.Dots
= rXD
.GetDots();
1004 aLineDash
.DotLen
= rXD
.GetDotLen();
1005 aLineDash
.Dashes
= rXD
.GetDashes();
1006 aLineDash
.DashLen
= rXD
.GetDashLen();
1007 aLineDash
.Distance
= rXD
.GetDistance();
1009 rtl::OUString aApiName
;
1010 SvxUnogetApiNameForItem( Which(), GetName(), aApiName
);
1011 aPropSeq
[0].Name
= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ));
1012 aPropSeq
[0].Value
= uno::makeAny( aApiName
);
1013 aPropSeq
[1].Name
= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LineDash" ));
1014 aPropSeq
[1].Value
= uno::makeAny( aLineDash
);
1015 rVal
= uno::makeAny( aPropSeq
);
1021 rtl::OUString aApiName
;
1022 SvxUnogetApiNameForItem( Which(), GetName(), aApiName
);
1029 const XDash
& rXD
= GetDashValue();
1031 ::com::sun::star::drawing::LineDash aLineDash
;
1033 aLineDash
.Style
= (::com::sun::star::drawing::DashStyle
)((sal_uInt16
)rXD
.GetDashStyle());
1034 aLineDash
.Dots
= rXD
.GetDots();
1035 aLineDash
.DotLen
= rXD
.GetDotLen();
1036 aLineDash
.Dashes
= rXD
.GetDashes();
1037 aLineDash
.DashLen
= rXD
.GetDashLen();
1038 aLineDash
.Distance
= rXD
.GetDistance();
1044 case MID_LINEDASH_STYLE
:
1046 const XDash
& rXD
= GetDashValue();
1047 rVal
<<= (::com::sun::star::drawing::DashStyle
)((sal_Int16
)rXD
.GetDashStyle());
1051 case MID_LINEDASH_DOTS
:
1053 const XDash
& rXD
= GetDashValue();
1054 rVal
<<= rXD
.GetDots();
1058 case MID_LINEDASH_DOTLEN
:
1060 const XDash
& rXD
= GetDashValue();
1061 rVal
<<= rXD
.GetDotLen();
1065 case MID_LINEDASH_DASHES
:
1067 const XDash
& rXD
= GetDashValue();
1068 rVal
<<= rXD
.GetDashes();
1072 case MID_LINEDASH_DASHLEN
:
1074 const XDash
& rXD
= GetDashValue();
1075 rVal
<<= rXD
.GetDashLen();
1079 case MID_LINEDASH_DISTANCE
:
1081 const XDash
& rXD
= GetDashValue();
1082 rVal
<<= rXD
.GetDistance();
1086 default: OSL_FAIL("Wrong MemberId!"); return false;
1092 bool XLineDashItem::PutValue( const ::com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
)
1094 // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
1095 nMemberId
&= ~CONVERT_TWIPS
;
1097 switch ( nMemberId
)
1101 uno::Sequence
< beans::PropertyValue
> aPropSeq
;
1102 ::com::sun::star::drawing::LineDash aLineDash
;
1103 rtl::OUString aName
;
1104 sal_Bool
bLineDash( sal_False
);
1106 if ( rVal
>>= aPropSeq
)
1108 for ( sal_Int32 n
= 0; n
< aPropSeq
.getLength(); n
++ )
1110 if ( aPropSeq
[n
].Name
.equalsAsciiL( "Name", 4 ))
1111 aPropSeq
[n
].Value
>>= aName
;
1112 else if ( aPropSeq
[n
].Name
.equalsAsciiL( "LineDash", 8 ))
1114 if ( aPropSeq
[n
].Value
>>= aLineDash
)
1124 aXDash
.SetDashStyle((XDashStyle
)((sal_uInt16
)(aLineDash
.Style
)));
1125 aXDash
.SetDots(aLineDash
.Dots
);
1126 aXDash
.SetDotLen(aLineDash
.DotLen
);
1127 aXDash
.SetDashes(aLineDash
.Dashes
);
1128 aXDash
.SetDashLen(aLineDash
.DashLen
);
1129 aXDash
.SetDistance(aLineDash
.Distance
);
1131 if((0 == aXDash
.GetDots()) && (0 == aXDash
.GetDashes()))
1134 SetDashValue( aXDash
);
1145 rtl::OUString aName
;
1146 if (!(rVal
>>= aName
))
1154 ::com::sun::star::drawing::LineDash aLineDash
;
1155 if(!(rVal
>>= aLineDash
))
1160 aXDash
.SetDashStyle((XDashStyle
)((sal_uInt16
)(aLineDash
.Style
)));
1161 aXDash
.SetDots(aLineDash
.Dots
);
1162 aXDash
.SetDotLen(aLineDash
.DotLen
);
1163 aXDash
.SetDashes(aLineDash
.Dashes
);
1164 aXDash
.SetDashLen(aLineDash
.DashLen
);
1165 aXDash
.SetDistance(aLineDash
.Distance
);
1167 if((0 == aXDash
.GetDots()) && (0 == aXDash
.GetDashes()))
1170 SetDashValue( aXDash
);
1174 case MID_LINEDASH_STYLE
:
1176 sal_Int16 nVal
= sal_Int16();
1177 if(!(rVal
>>= nVal
))
1180 XDash aXDash
= GetDashValue();
1181 aXDash
.SetDashStyle((XDashStyle
)((sal_uInt16
)(nVal
)));
1183 if((0 == aXDash
.GetDots()) && (0 == aXDash
.GetDashes()))
1186 SetDashValue( aXDash
);
1191 case MID_LINEDASH_DOTS
:
1192 case MID_LINEDASH_DASHES
:
1194 sal_Int16 nVal
= sal_Int16();
1195 if(!(rVal
>>= nVal
))
1198 XDash aXDash
= GetDashValue();
1199 if ( nMemberId
== MID_LINEDASH_DOTS
)
1200 aXDash
.SetDots( nVal
);
1202 aXDash
.SetDashes( nVal
);
1204 if((0 == aXDash
.GetDots()) && (0 == aXDash
.GetDashes()))
1207 SetDashValue( aXDash
);
1211 case MID_LINEDASH_DOTLEN
:
1212 case MID_LINEDASH_DASHLEN
:
1213 case MID_LINEDASH_DISTANCE
:
1216 if(!(rVal
>>= nVal
))
1219 XDash aXDash
= GetDashValue();
1220 if ( nMemberId
== MID_LINEDASH_DOTLEN
)
1221 aXDash
.SetDotLen( nVal
);
1222 else if ( nMemberId
== MID_LINEDASH_DASHLEN
)
1223 aXDash
.SetDashLen( nVal
);
1225 aXDash
.SetDistance( nVal
);
1227 if((0 == aXDash
.GetDots()) && (0 == aXDash
.GetDashes()))
1230 SetDashValue( aXDash
);
1238 sal_Bool
XLineDashItem::CompareValueFunc( const NameOrIndex
* p1
, const NameOrIndex
* p2
)
1240 return ((XLineDashItem
*)p1
)->GetDashValue() == ((XLineDashItem
*)p2
)->GetDashValue();
1243 XLineDashItem
* XLineDashItem::checkForUniqueItem( SdrModel
* pModel
) const
1247 const String aUniqueName
= NameOrIndex::CheckNamedItem(
1248 this, XATTR_LINEDASH
, &pModel
->GetItemPool(),
1249 pModel
->GetStyleSheetPool() ? &pModel
->GetStyleSheetPool()->GetPool() : NULL
,
1250 XLineDashItem::CompareValueFunc
, RID_SVXSTR_DASH11
,
1251 pModel
->GetPropertyList( XDASH_LIST
) );
1253 // if the given name is not valid, replace it!
1254 if( aUniqueName
!= GetName() )
1255 return new XLineDashItem( aUniqueName
, aDash
);
1258 return (XLineDashItem
*)this;
1261 // -------------------
1262 // class XLineWidthItem
1263 // -------------------
1264 TYPEINIT1_AUTOFACTORY(XLineWidthItem
, SfxMetricItem
);
1266 /*************************************************************************
1268 |* XLineWidthItem::XLineWidthItem(long nWidth)
1270 *************************************************************************/
1272 XLineWidthItem::XLineWidthItem(long nWidth
) :
1273 SfxMetricItem(XATTR_LINEWIDTH
, nWidth
)
1277 /*************************************************************************
1279 |* XLineWidthItem::XLineWidthItem(SvStream& rIn)
1281 *************************************************************************/
1283 XLineWidthItem::XLineWidthItem(SvStream
& rIn
) :
1284 SfxMetricItem(XATTR_LINEWIDTH
, rIn
)
1288 /*************************************************************************
1290 |* XLineWidthItem::Clone(SfxItemPool* pPool) const
1292 *************************************************************************/
1294 SfxPoolItem
* XLineWidthItem::Clone(SfxItemPool
* /*pPool*/) const
1296 return new XLineWidthItem(*this);
1299 /*************************************************************************
1301 |* SfxPoolItem* XLineWidthItem::Create(SvStream& rIn, sal_uInt16 nVer) const
1303 *************************************************************************/
1305 SfxPoolItem
* XLineWidthItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
1307 return new XLineWidthItem(rIn
);
1310 //------------------------------------------------------------------------
1312 SfxItemPresentation
XLineWidthItem::GetPresentation
1314 SfxItemPresentation ePres
,
1315 SfxMapUnit eCoreUnit
,
1316 SfxMapUnit ePresUnit
,
1317 XubString
& rText
, const IntlWrapper
* pIntl
1322 case SFX_ITEM_PRESENTATION_NONE
:
1325 case SFX_ITEM_PRESENTATION_NAMELESS
:
1326 case SFX_ITEM_PRESENTATION_COMPLETE
:
1327 rText
= GetMetricText( (long) GetValue(),
1328 eCoreUnit
, ePresUnit
, pIntl
);
1329 rText
+= SVX_RESSTR( GetMetricId( ePresUnit
) );
1332 return SFX_ITEM_PRESENTATION_NONE
;
1336 bool XLineWidthItem::QueryValue( ::com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
) const
1338 sal_Int32 nValue
= GetValue();
1339 if( 0 != (nMemberId
&CONVERT_TWIPS
) )
1340 nValue
= TWIP_TO_MM100(nValue
);
1346 bool XLineWidthItem::PutValue( const ::com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
)
1348 sal_Int32 nValue
= 0;
1350 if( 0 != (nMemberId
&CONVERT_TWIPS
) )
1351 nValue
= MM100_TO_TWIP(nValue
);
1357 // -------------------
1358 // class XLineColorItem
1359 // -------------------
1360 TYPEINIT1_AUTOFACTORY(XLineColorItem
, XColorItem
);
1362 /*************************************************************************
1364 |* XLineColorItem::XLineColorItem(sal_Int32 nIndex, const Color& rTheColor)
1366 *************************************************************************/
1368 XLineColorItem::XLineColorItem(sal_Int32 nIndex
, const Color
& rTheColor
) :
1369 XColorItem(XATTR_LINECOLOR
, nIndex
, rTheColor
)
1373 /*************************************************************************
1375 |* XLineColorItem::XLineColorItem(const XubString& rName, const Color& rTheColor)
1377 *************************************************************************/
1379 XLineColorItem::XLineColorItem(const XubString
& rName
, const Color
& rTheColor
) :
1380 XColorItem(XATTR_LINECOLOR
, rName
, rTheColor
)
1384 /*************************************************************************
1386 |* XLineColorItem::XLineColorItem(SvStream& rIn)
1388 *************************************************************************/
1390 XLineColorItem::XLineColorItem(SvStream
& rIn
) :
1391 XColorItem(XATTR_LINECOLOR
, rIn
)
1395 /*************************************************************************
1397 |* XLineColorItem::Clone(SfxItemPool* pPool) const
1399 *************************************************************************/
1401 SfxPoolItem
* XLineColorItem::Clone(SfxItemPool
* /*pPool*/) const
1403 return new XLineColorItem(*this);
1406 /*************************************************************************
1408 |* SfxPoolItem* XLineColorItem::Create(SvStream& rIn, sal_uInt16 nVer) const
1410 *************************************************************************/
1412 SfxPoolItem
* XLineColorItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
1414 return new XLineColorItem(rIn
);
1417 //------------------------------------------------------------------------
1419 SfxItemPresentation
XLineColorItem::GetPresentation
1421 SfxItemPresentation ePres
,
1422 SfxMapUnit
/*eCoreUnit*/,
1423 SfxMapUnit
/*ePresUnit*/,
1424 XubString
& rText
, const IntlWrapper
*
1429 case SFX_ITEM_PRESENTATION_NONE
:
1432 case SFX_ITEM_PRESENTATION_NAMELESS
:
1433 case SFX_ITEM_PRESENTATION_COMPLETE
:
1437 return SFX_ITEM_PRESENTATION_NONE
;
1441 bool XLineColorItem::QueryValue( ::com::sun::star::uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
1443 rVal
<<= (sal_Int32
)GetColorValue().GetRGBColor();
1447 bool XLineColorItem::PutValue( const ::com::sun::star::uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
1449 sal_Int32 nValue
= 0;
1450 if(!(rVal
>>= nValue
))
1453 SetColorValue( nValue
);
1457 //////////////////////////////////////////////////////////////////////////////
1458 // tooling for simple spooling B2DPolygon to file and back
1462 void streamOutB2DPolyPolygon(const basegfx::B2DPolyPolygon
& rPolyPolygon
, SvStream
& rOut
)
1464 const sal_uInt32
nPolygonCount(rPolyPolygon
.count());
1465 rOut
<< nPolygonCount
;
1467 for(sal_uInt32
a(0L); a
< nPolygonCount
; a
++)
1469 const basegfx::B2DPolygon
aCandidate(rPolyPolygon
.getB2DPolygon(a
));
1470 const sal_uInt32
nPointCount(aCandidate
.count());
1471 const sal_uInt8
bClosed(aCandidate
.isClosed() ? 1 : 0);
1472 const sal_uInt8
bControlPoints(aCandidate
.areControlPointsUsed() ? 1 : 0);
1473 rOut
<< nPointCount
;
1475 rOut
<< bControlPoints
;
1477 for(sal_uInt32
b(0L); b
< nPointCount
; b
++)
1479 const basegfx::B2DPoint
aPoint(aCandidate
.getB2DPoint(b
));
1480 rOut
<< aPoint
.getX();
1481 rOut
<< aPoint
.getY();
1485 const sal_uInt8
bEdgeIsCurve(aCandidate
.isPrevControlPointUsed(b
) || aCandidate
.isNextControlPointUsed(b
) ? 1 : 0);
1486 rOut
<< bEdgeIsCurve
;
1490 const basegfx::B2DVector
aControlVectorA(aCandidate
.getPrevControlPoint(b
));
1491 rOut
<< aControlVectorA
.getX();
1492 rOut
<< aControlVectorA
.getY();
1494 const basegfx::B2DVector
aControlVectorB(aCandidate
.getNextControlPoint(b
));
1495 rOut
<< aControlVectorB
.getX();
1496 rOut
<< aControlVectorB
.getY();
1503 basegfx::B2DPolyPolygon
streamInB2DPolyPolygon(SvStream
& rIn
)
1505 basegfx::B2DPolyPolygon aRetval
;
1506 sal_uInt32 nPolygonCount
;
1507 rIn
>> nPolygonCount
;
1509 for(sal_uInt32
a(0L); a
< nPolygonCount
; a
++)
1511 sal_uInt32 nPointCount
;
1513 sal_uInt8 bControlPoints
;
1517 rIn
>> bControlPoints
;
1519 basegfx::B2DPolygon aCandidate
;
1520 aCandidate
.setClosed(0 != bClosed
);
1522 for(sal_uInt32
b(0L); b
< nPointCount
; b
++)
1527 aCandidate
.append(basegfx::B2DPoint(fX
, fY
));
1529 if(0 != bControlPoints
)
1531 sal_uInt8 bEdgeIsCurve
;
1532 rIn
>> bEdgeIsCurve
;
1534 if(0 != bEdgeIsCurve
)
1538 aCandidate
.setPrevControlPoint(b
, basegfx::B2DVector(fX
, fY
));
1542 aCandidate
.setNextControlPoint(b
, basegfx::B2DVector(fX
, fY
));
1547 aRetval
.append(aCandidate
);
1554 //////////////////////////////////////////////////////////////////////////////
1556 // -----------------------
1557 // class XLineStartItem
1558 // -----------------------
1559 TYPEINIT1_AUTOFACTORY(XLineStartItem
, NameOrIndex
);
1561 /*************************************************************************
1563 |* XLineStartItem::XLineStartItem(sal_Int32 nIndex)
1565 *************************************************************************/
1567 XLineStartItem::XLineStartItem(sal_Int32 nIndex
)
1568 : NameOrIndex(XATTR_LINESTART
, nIndex
)
1572 /*************************************************************************
1574 |* XLineStartItem::XLineStartItem(const XubString& rName,
1575 |* const basegfx::B2DPolyPolygon& rXPolygon)
1577 *************************************************************************/
1579 XLineStartItem::XLineStartItem(const XubString
& rName
, const basegfx::B2DPolyPolygon
& rPolyPolygon
)
1580 : NameOrIndex(XATTR_LINESTART
, rName
),
1581 maPolyPolygon(rPolyPolygon
)
1585 /*************************************************************************
1587 |* XLineStartItem::XLineStartItem(const XLineStartItem& rItem)
1589 *************************************************************************/
1591 XLineStartItem::XLineStartItem(const XLineStartItem
& rItem
)
1592 : NameOrIndex(rItem
),
1593 maPolyPolygon(rItem
.maPolyPolygon
)
1597 /*************************************************************************
1599 |* XLineStartItem::XLineStartItem(SvStream& rIn)
1601 *************************************************************************/
1603 XLineStartItem::XLineStartItem(SvStream
& rIn
) :
1604 NameOrIndex(XATTR_LINESTART
, rIn
)
1608 maPolyPolygon
= streamInB2DPolyPolygon(rIn
);
1612 //*************************************************************************
1614 XLineStartItem::XLineStartItem(SfxItemPool
* /*pPool*/, const basegfx::B2DPolyPolygon
& rPolyPolygon
)
1615 : NameOrIndex( XATTR_LINESTART
, -1 ),
1616 maPolyPolygon(rPolyPolygon
)
1620 /*************************************************************************
1622 |* XLineStartItem::Clone(SfxItemPool* pPool) const
1624 *************************************************************************/
1626 SfxPoolItem
* XLineStartItem::Clone(SfxItemPool
* /*pPool*/) const
1628 return new XLineStartItem(*this);
1631 /*************************************************************************
1633 |* int XLineStartItem::operator==(const SfxPoolItem& rItem) const
1635 *************************************************************************/
1637 int XLineStartItem::operator==(const SfxPoolItem
& rItem
) const
1639 return ( NameOrIndex::operator==(rItem
) && ((const XLineStartItem
&) rItem
).maPolyPolygon
== maPolyPolygon
);
1642 /*************************************************************************
1644 |* SfxPoolItem* XLineStartItem::Create(SvStream& rIn, sal_uInt16 nVer) const
1646 *************************************************************************/
1648 SfxPoolItem
* XLineStartItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
1650 return new XLineStartItem(rIn
);
1653 /*************************************************************************
1655 |* SfxPoolItem* XLineStartItem::Store(SvStream& rOut) const
1657 *************************************************************************/
1659 SvStream
& XLineStartItem::Store( SvStream
& rOut
, sal_uInt16 nItemVersion
) const
1661 NameOrIndex::Store( rOut
, nItemVersion
);
1665 streamOutB2DPolyPolygon(maPolyPolygon
, rOut
);
1671 /*************************************************************************
1673 |* const basegfx::B2DPolyPolygon& XLineStartItem::GetValue() const
1675 *************************************************************************/
1677 basegfx::B2DPolyPolygon
XLineStartItem::GetLineStartValue() const
1680 // return maPolyPolygon;
1682 // return pTable->GetLineEnd(GetIndex())->GetLineEnd();
1683 return maPolyPolygon
;
1686 //------------------------------------------------------------------------
1688 SfxItemPresentation
XLineStartItem::GetPresentation
1690 SfxItemPresentation ePres
,
1691 SfxMapUnit
/*eCoreUnit*/,
1692 SfxMapUnit
/*ePresUnit*/,
1693 XubString
& rText
, const IntlWrapper
*
1698 case SFX_ITEM_PRESENTATION_NONE
:
1701 case SFX_ITEM_PRESENTATION_NAMELESS
:
1702 case SFX_ITEM_PRESENTATION_COMPLETE
:
1706 return SFX_ITEM_PRESENTATION_NONE
;
1710 bool XLineStartItem::QueryValue( ::com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
) const
1712 // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
1713 nMemberId
&= ~CONVERT_TWIPS
;
1714 if( nMemberId
== MID_NAME
)
1716 rtl::OUString aApiName
;
1717 SvxUnogetApiNameForItem( Which(), GetName(), aApiName
);
1722 com::sun::star::drawing::PolyPolygonBezierCoords aBezier
;
1723 basegfx::unotools::b2DPolyPolygonToPolyPolygonBezier( maPolyPolygon
, aBezier
);
1730 bool XLineStartItem::PutValue( const ::com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
)
1732 // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
1733 nMemberId
&= ~CONVERT_TWIPS
;
1734 if( nMemberId
== MID_NAME
)
1740 maPolyPolygon
.clear();
1742 if( rVal
.hasValue() && rVal
.getValue() )
1744 if( rVal
.getValueType() != ::getCppuType((const com::sun::star::drawing::PolyPolygonBezierCoords
*)0) )
1747 com::sun::star::drawing::PolyPolygonBezierCoords
* pCoords
= (com::sun::star::drawing::PolyPolygonBezierCoords
*)rVal
.getValue();
1748 if( pCoords
->Coordinates
.getLength() > 0 )
1750 maPolyPolygon
= basegfx::unotools::polyPolygonBezierToB2DPolyPolygon( *pCoords
);
1751 // #i72807# close line start/end polygons hard
1752 // maPolyPolygon.setClosed(true);
1760 /** this function searches in both the models pool and the styles pool for XLineStartItem
1761 and XLineEndItem with the same value or name and returns an item with the value of
1762 this item and a unique name for an item with this value. */
1763 XLineStartItem
* XLineStartItem::checkForUniqueItem( SdrModel
* pModel
) const
1767 XLineStartItem
* pTempItem
= NULL
;
1768 const XLineStartItem
* pLineStartItem
= this;
1770 String
aUniqueName( GetName() );
1772 if( !maPolyPolygon
.count() )
1774 // if the polygon is empty, check if the name is empty
1775 if( aUniqueName
.Len() == 0 )
1776 return (XLineStartItem
*)this;
1778 // force empty name for empty polygons
1779 return new XLineStartItem( String(), maPolyPolygon
);
1782 if( maPolyPolygon
.count() > 1L )
1784 // check if the polygon is closed
1785 if(!maPolyPolygon
.isClosed())
1787 // force a closed polygon
1788 basegfx::B2DPolyPolygon
aNew(maPolyPolygon
);
1789 aNew
.setClosed(true);
1790 pTempItem
= new XLineStartItem( aUniqueName
, aNew
);
1791 pLineStartItem
= pTempItem
;
1795 sal_Bool bForceNew
= sal_False
;
1797 // 2. if we have a name check if there is already an item with the
1798 // same name in the documents pool with a different line end or start
1800 sal_uInt32 nCount
, nSurrogate
;
1802 const SfxItemPool
* pPool1
= &pModel
->GetItemPool();
1803 if( aUniqueName
.Len() && pPool1
)
1805 nCount
= pPool1
->GetItemCount2( XATTR_LINESTART
);
1807 for( nSurrogate
= 0; nSurrogate
< nCount
; nSurrogate
++ )
1809 const XLineStartItem
* pItem
= (const XLineStartItem
*)pPool1
->GetItem2( XATTR_LINESTART
, nSurrogate
);
1811 if( pItem
&& ( pItem
->GetName() == pLineStartItem
->GetName() ) )
1813 // if there is already an item with the same name and the same
1814 // value its ok to set it
1815 if( pItem
->GetLineStartValue() != pLineStartItem
->GetLineStartValue() )
1817 // same name but different value, we need a new name for this item
1818 aUniqueName
= String();
1819 bForceNew
= sal_True
;
1827 nCount
= pPool1
->GetItemCount2( XATTR_LINEEND
);
1829 for( nSurrogate
= 0; nSurrogate
< nCount
; nSurrogate
++ )
1831 const XLineEndItem
* pItem
= (const XLineEndItem
*)pPool1
->GetItem2( XATTR_LINEEND
, nSurrogate
);
1833 if( pItem
&& ( pItem
->GetName() == pLineStartItem
->GetName() ) )
1835 // if there is already an item with the same name and the same
1836 // value its ok to set it
1837 if( pItem
->GetLineEndValue() != pLineStartItem
->GetLineStartValue() )
1839 // same name but different value, we need a new name for this item
1840 aUniqueName
= String();
1841 bForceNew
= sal_True
;
1849 const SfxItemPool
* pPool2
= pModel
->GetStyleSheetPool() ? &pModel
->GetStyleSheetPool()->GetPool() : NULL
;
1850 if( aUniqueName
.Len() && pPool2
)
1852 nCount
= pPool2
->GetItemCount2( XATTR_LINESTART
);
1853 for( nSurrogate
= 0; nSurrogate
< nCount
; nSurrogate
++ )
1855 const XLineStartItem
* pItem
= (const XLineStartItem
*)pPool2
->GetItem2( XATTR_LINESTART
, nSurrogate
);
1857 if( pItem
&& ( pItem
->GetName() == pLineStartItem
->GetName() ) )
1859 // if there is already an item with the same name and the same
1860 // value its ok to set it
1861 if( pItem
->GetLineStartValue() != pLineStartItem
->GetLineStartValue() )
1863 // same name but different value, we need a new name for this item
1864 aUniqueName
= String();
1865 bForceNew
= sal_True
;
1873 nCount
= pPool2
->GetItemCount2( XATTR_LINEEND
);
1874 for( nSurrogate
= 0; nSurrogate
< nCount
; nSurrogate
++ )
1876 const XLineEndItem
* pItem
= (const XLineEndItem
*)pPool2
->GetItem2( XATTR_LINEEND
, nSurrogate
);
1878 if( pItem
&& ( pItem
->GetName() == pLineStartItem
->GetName() ) )
1880 // if there is already an item with the same name and the same
1881 // value its ok to set it
1882 if( pItem
->GetLineEndValue() != pLineStartItem
->GetLineStartValue() )
1884 // same name but different value, we need a new name for this item
1885 aUniqueName
= String();
1886 bForceNew
= sal_True
;
1894 // if we have no name yet, find existing item with same conent or
1895 // create a unique name
1896 if( aUniqueName
.Len() == 0 )
1898 sal_Bool bFoundExisting
= sal_False
;
1900 sal_Int32 nUserIndex
= 1;
1901 const ResId
aRes(SVX_RES(RID_SVXSTR_LINEEND
));
1902 const String
aUser( aRes
);
1906 nCount
= pPool1
->GetItemCount2( XATTR_LINESTART
);
1907 sal_uInt32 nSurrogate2
;
1909 for( nSurrogate2
= 0; nSurrogate2
< nCount
; nSurrogate2
++ )
1911 const XLineStartItem
* pItem
= (const XLineStartItem
*)pPool1
->GetItem2( XATTR_LINESTART
, nSurrogate2
);
1913 if( pItem
&& pItem
->GetName().Len() )
1915 if( !bForceNew
&& pItem
->GetLineStartValue() == pLineStartItem
->GetLineStartValue() )
1917 aUniqueName
= pItem
->GetName();
1918 bFoundExisting
= sal_True
;
1922 if( pItem
->GetName().CompareTo( aUser
, aUser
.Len() ) == 0 )
1924 sal_Int32 nThisIndex
= pItem
->GetName().Copy( aUser
.Len() ).ToInt32();
1925 if( nThisIndex
>= nUserIndex
)
1926 nUserIndex
= nThisIndex
+ 1;
1931 nCount
= pPool1
->GetItemCount2( XATTR_LINEEND
);
1932 for( nSurrogate2
= 0; nSurrogate2
< nCount
; nSurrogate2
++ )
1934 const XLineEndItem
* pItem
= (const XLineEndItem
*)pPool1
->GetItem2( XATTR_LINEEND
, nSurrogate2
);
1936 if( pItem
&& pItem
->GetName().Len() )
1938 if( !bForceNew
&& pItem
->GetLineEndValue() == pLineStartItem
->GetLineStartValue() )
1940 aUniqueName
= pItem
->GetName();
1941 bFoundExisting
= sal_True
;
1945 if( pItem
->GetName().CompareTo( aUser
, aUser
.Len() ) == 0 )
1947 sal_Int32 nThisIndex
= pItem
->GetName().Copy( aUser
.Len() ).ToInt32();
1948 if( nThisIndex
>= nUserIndex
)
1949 nUserIndex
= nThisIndex
+ 1;
1955 if( !bFoundExisting
)
1957 aUniqueName
= aUser
;
1958 aUniqueName
+= sal_Unicode(' ');
1959 aUniqueName
+= String::CreateFromInt32( nUserIndex
);
1963 // if the given name is not valid, replace it!
1964 if( aUniqueName
!= GetName() || pTempItem
)
1968 pTempItem
->SetName( aUniqueName
);
1973 return new XLineStartItem( aUniqueName
, maPolyPolygon
);
1978 return (XLineStartItem
*)this;
1981 // ---------------------
1982 // class XLineEndItem
1983 // ---------------------
1984 TYPEINIT1_AUTOFACTORY(XLineEndItem
, NameOrIndex
);
1986 /*************************************************************************
1988 |* XLineEndItem::XLineEndItem(sal_Int32 nIndex)
1990 *************************************************************************/
1992 XLineEndItem::XLineEndItem(sal_Int32 nIndex
)
1993 : NameOrIndex(XATTR_LINEEND
, nIndex
)
1997 /*************************************************************************
1999 |* XLineEndItem::XLineEndItem(const XubString& rName,
2000 |* const basegfx::B2DPolyPolygon& rXPolygon)
2002 *************************************************************************/
2004 XLineEndItem::XLineEndItem(const XubString
& rName
, const basegfx::B2DPolyPolygon
& rPolyPolygon
)
2005 : NameOrIndex(XATTR_LINEEND
, rName
),
2006 maPolyPolygon(rPolyPolygon
)
2010 /*************************************************************************
2012 |* XLineEndItem::XLineEndItem(const XLineEndItem& rItem)
2014 *************************************************************************/
2016 XLineEndItem::XLineEndItem(const XLineEndItem
& rItem
)
2017 : NameOrIndex(rItem
),
2018 maPolyPolygon(rItem
.maPolyPolygon
)
2022 /*************************************************************************
2024 |* XLineEndItem::XLineEndItem(SvStream& rIn)
2026 *************************************************************************/
2028 XLineEndItem::XLineEndItem(SvStream
& rIn
) :
2029 NameOrIndex(XATTR_LINEEND
, rIn
)
2033 maPolyPolygon
= streamInB2DPolyPolygon(rIn
);
2037 //*************************************************************************
2039 XLineEndItem::XLineEndItem(SfxItemPool
* /*pPool*/, const basegfx::B2DPolyPolygon
& rPolyPolygon
)
2040 : NameOrIndex( XATTR_LINEEND
, -1 ),
2041 maPolyPolygon(rPolyPolygon
)
2045 /*************************************************************************
2047 |* XLineEndItem::Clone(SfxItemPool* pPool) const
2049 *************************************************************************/
2051 SfxPoolItem
* XLineEndItem::Clone(SfxItemPool
* /*pPool*/) const
2053 return new XLineEndItem(*this);
2056 /*************************************************************************
2058 |* int XLineEndItem::operator==(const SfxPoolItem& rItem) const
2060 *************************************************************************/
2062 int XLineEndItem::operator==(const SfxPoolItem
& rItem
) const
2064 return ( NameOrIndex::operator==(rItem
) && ((const XLineEndItem
&) rItem
).maPolyPolygon
== maPolyPolygon
);
2067 /*************************************************************************
2069 |* SfxPoolItem* XLineEndItem::Create(SvStream& rIn, sal_uInt16 nVer) const
2071 *************************************************************************/
2073 SfxPoolItem
* XLineEndItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
2075 return new XLineEndItem(rIn
);
2078 /*************************************************************************
2080 |* SfxPoolItem* XLineEndItem::Store(SvStream& rOut) const
2082 *************************************************************************/
2084 SvStream
& XLineEndItem::Store( SvStream
& rOut
, sal_uInt16 nItemVersion
) const
2086 NameOrIndex::Store( rOut
, nItemVersion
);
2090 streamOutB2DPolyPolygon(maPolyPolygon
, rOut
);
2096 /*************************************************************************
2098 |* const basegfx::B2DPolyPolygon& XLineEndItem::GetValue() const
2100 *************************************************************************/
2102 basegfx::B2DPolyPolygon
XLineEndItem::GetLineEndValue() const
2105 // return maPolyPolygon;
2107 // return pTable->GetLineEnd(GetIndex())->GetLineEnd();
2108 return maPolyPolygon
;
2112 /** this function searches in both the models pool and the styles pool for XLineStartItem
2113 and XLineEndItem with the same value or name and returns an item with the value of
2114 this item and a unique name for an item with this value. */
2115 XLineEndItem
* XLineEndItem::checkForUniqueItem( SdrModel
* pModel
) const
2119 XLineEndItem
* pTempItem
= NULL
;
2120 const XLineEndItem
* pLineEndItem
= this;
2122 String
aUniqueName( GetName() );
2124 if( !maPolyPolygon
.count() )
2126 // if the polygon is empty, check if the name is empty
2127 if( aUniqueName
.Len() == 0 )
2128 return (XLineEndItem
*)this;
2130 // force empty name for empty polygons
2131 return new XLineEndItem( String(), maPolyPolygon
);
2134 if( maPolyPolygon
.count() > 1L )
2136 // check if the polygon is closed
2137 if(!maPolyPolygon
.isClosed())
2139 // force a closed polygon
2140 basegfx::B2DPolyPolygon
aNew(maPolyPolygon
);
2141 aNew
.setClosed(true);
2142 pTempItem
= new XLineEndItem( aUniqueName
, aNew
);
2143 pLineEndItem
= pTempItem
;
2147 sal_Bool bForceNew
= sal_False
;
2149 // 2. if we have a name check if there is already an item with the
2150 // same name in the documents pool with a different line end or start
2152 sal_uInt16 nCount
, nSurrogate
;
2154 const SfxItemPool
* pPool1
= &pModel
->GetItemPool();
2155 if( aUniqueName
.Len() && pPool1
)
2157 nCount
= pPool1
->GetItemCount2( XATTR_LINESTART
);
2159 for( nSurrogate
= 0; nSurrogate
< nCount
; nSurrogate
++ )
2161 const XLineStartItem
* pItem
= (const XLineStartItem
*)pPool1
->GetItem2( XATTR_LINESTART
, nSurrogate
);
2163 if( pItem
&& ( pItem
->GetName() == pLineEndItem
->GetName() ) )
2165 // if there is already an item with the same name and the same
2166 // value its ok to set it
2167 if( pItem
->GetLineStartValue() != pLineEndItem
->GetLineEndValue() )
2169 // same name but different value, we need a new name for this item
2170 aUniqueName
= String();
2171 bForceNew
= sal_True
;
2179 nCount
= pPool1
->GetItemCount2( XATTR_LINEEND
);
2181 for( nSurrogate
= 0; nSurrogate
< nCount
; nSurrogate
++ )
2183 const XLineEndItem
* pItem
= (const XLineEndItem
*)pPool1
->GetItem2( XATTR_LINEEND
, nSurrogate
);
2185 if( pItem
&& ( pItem
->GetName() == pLineEndItem
->GetName() ) )
2187 // if there is already an item with the same name and the same
2188 // value its ok to set it
2189 if( pItem
->GetLineEndValue() != pLineEndItem
->GetLineEndValue() )
2191 // same name but different value, we need a new name for this item
2192 aUniqueName
= String();
2193 bForceNew
= sal_True
;
2201 const SfxItemPool
* pPool2
= pModel
->GetStyleSheetPool() ? &pModel
->GetStyleSheetPool()->GetPool() : NULL
;
2202 if( aUniqueName
.Len() && pPool2
)
2204 nCount
= pPool2
->GetItemCount2( XATTR_LINESTART
);
2205 for( nSurrogate
= 0; nSurrogate
< nCount
; nSurrogate
++ )
2207 const XLineStartItem
* pItem
= (const XLineStartItem
*)pPool2
->GetItem2( XATTR_LINESTART
, nSurrogate
);
2209 if( pItem
&& ( pItem
->GetName() == pLineEndItem
->GetName() ) )
2211 // if there is already an item with the same name and the same
2212 // value its ok to set it
2213 if( pItem
->GetLineStartValue() != pLineEndItem
->GetLineEndValue() )
2215 // same name but different value, we need a new name for this item
2216 aUniqueName
= String();
2217 bForceNew
= sal_True
;
2225 nCount
= pPool2
->GetItemCount2( XATTR_LINEEND
);
2226 for( nSurrogate
= 0; nSurrogate
< nCount
; nSurrogate
++ )
2228 const XLineEndItem
* pItem
= (const XLineEndItem
*)pPool2
->GetItem2( XATTR_LINEEND
, nSurrogate
);
2230 if( pItem
&& ( pItem
->GetName() == pLineEndItem
->GetName() ) )
2232 // if there is already an item with the same name and the same
2233 // value its ok to set it
2234 if( pItem
->GetLineEndValue() != pLineEndItem
->GetLineEndValue() )
2236 // same name but different value, we need a new name for this item
2237 aUniqueName
= String();
2238 bForceNew
= sal_True
;
2246 // if we have no name yet, find existing item with same conent or
2247 // create a unique name
2248 if( aUniqueName
.Len() == 0 )
2250 sal_Bool bFoundExisting
= sal_False
;
2252 sal_Int32 nUserIndex
= 1;
2253 const ResId
aRes(SVX_RES(RID_SVXSTR_LINEEND
));
2254 const String
aUser( aRes
);
2258 nCount
= pPool1
->GetItemCount2( XATTR_LINESTART
);
2259 sal_uInt32 nSurrogate2
;
2261 for( nSurrogate2
= 0; nSurrogate2
< nCount
; nSurrogate2
++ )
2263 const XLineStartItem
* pItem
= (const XLineStartItem
*)pPool1
->GetItem2( XATTR_LINESTART
, nSurrogate2
);
2265 if( pItem
&& pItem
->GetName().Len() )
2267 if( !bForceNew
&& pItem
->GetLineStartValue() == pLineEndItem
->GetLineEndValue() )
2269 aUniqueName
= pItem
->GetName();
2270 bFoundExisting
= sal_True
;
2274 if( pItem
->GetName().CompareTo( aUser
, aUser
.Len() ) == 0 )
2276 sal_Int32 nThisIndex
= pItem
->GetName().Copy( aUser
.Len() ).ToInt32();
2277 if( nThisIndex
>= nUserIndex
)
2278 nUserIndex
= nThisIndex
+ 1;
2283 nCount
= pPool1
->GetItemCount2( XATTR_LINEEND
);
2284 for( nSurrogate2
= 0; nSurrogate2
< nCount
; nSurrogate2
++ )
2286 const XLineEndItem
* pItem
= (const XLineEndItem
*)pPool1
->GetItem2( XATTR_LINEEND
, nSurrogate2
);
2288 if( pItem
&& pItem
->GetName().Len() )
2290 if( !bForceNew
&& pItem
->GetLineEndValue() == pLineEndItem
->GetLineEndValue() )
2292 aUniqueName
= pItem
->GetName();
2293 bFoundExisting
= sal_True
;
2297 if( pItem
->GetName().CompareTo( aUser
, aUser
.Len() ) == 0 )
2299 sal_Int32 nThisIndex
= pItem
->GetName().Copy( aUser
.Len() ).ToInt32();
2300 if( nThisIndex
>= nUserIndex
)
2301 nUserIndex
= nThisIndex
+ 1;
2307 if( !bFoundExisting
)
2309 aUniqueName
= aUser
;
2310 aUniqueName
+= sal_Unicode(' ');
2311 aUniqueName
+= String::CreateFromInt32( nUserIndex
);
2315 // if the given name is not valid, replace it!
2316 if( aUniqueName
!= GetName() || pTempItem
)
2320 pTempItem
->SetName( aUniqueName
);
2325 return new XLineEndItem( aUniqueName
, maPolyPolygon
);
2330 return (XLineEndItem
*)this;
2334 //------------------------------------------------------------------------
2336 SfxItemPresentation
XLineEndItem::GetPresentation
2338 SfxItemPresentation ePres
,
2339 SfxMapUnit
/*eCoreUnit*/,
2340 SfxMapUnit
/*ePresUnit*/,
2341 XubString
& rText
, const IntlWrapper
*
2346 case SFX_ITEM_PRESENTATION_NONE
:
2349 case SFX_ITEM_PRESENTATION_NAMELESS
:
2350 case SFX_ITEM_PRESENTATION_COMPLETE
:
2354 return SFX_ITEM_PRESENTATION_NONE
;
2358 bool XLineEndItem::QueryValue( ::com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
) const
2360 // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
2361 nMemberId
&= ~CONVERT_TWIPS
;
2362 if( nMemberId
== MID_NAME
)
2364 rtl::OUString aApiName
;
2365 SvxUnogetApiNameForItem( Which(), GetName(), aApiName
);
2370 com::sun::star::drawing::PolyPolygonBezierCoords aBezier
;
2371 basegfx::unotools::b2DPolyPolygonToPolyPolygonBezier( maPolyPolygon
, aBezier
);
2377 bool XLineEndItem::PutValue( const ::com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
)
2379 // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
2380 nMemberId
&= ~CONVERT_TWIPS
;
2381 if( nMemberId
== MID_NAME
)
2387 maPolyPolygon
.clear();
2389 if( rVal
.hasValue() && rVal
.getValue() )
2391 if( rVal
.getValueType() != ::getCppuType((const com::sun::star::drawing::PolyPolygonBezierCoords
*)0) )
2394 com::sun::star::drawing::PolyPolygonBezierCoords
* pCoords
= (com::sun::star::drawing::PolyPolygonBezierCoords
*)rVal
.getValue();
2395 if( pCoords
->Coordinates
.getLength() > 0 )
2397 maPolyPolygon
= basegfx::unotools::polyPolygonBezierToB2DPolyPolygon( *pCoords
);
2398 // #i72807# close line start/end polygons hard
2399 // maPolyPolygon.setClosed(true);
2407 // ----------------------------
2408 // class XLineStartWidthItem
2409 // ----------------------------
2410 TYPEINIT1_AUTOFACTORY(XLineStartWidthItem
, SfxMetricItem
);
2412 /*************************************************************************
2414 |* XLineStartWidthItem::XLineStartWidthItem(sal_Int32 nWidth)
2416 *************************************************************************/
2418 XLineStartWidthItem::XLineStartWidthItem(long nWidth
) :
2419 SfxMetricItem(XATTR_LINESTARTWIDTH
, nWidth
)
2423 /*************************************************************************
2425 |* XLineStartWidthItem::XLineStartWidthItem(SvStream& rIn)
2427 *************************************************************************/
2429 XLineStartWidthItem::XLineStartWidthItem(SvStream
& rIn
) :
2430 SfxMetricItem(XATTR_LINESTARTWIDTH
, rIn
)
2434 /*************************************************************************
2436 |* XLineStartWidthItem::Clone(SfxItemPool* pPool) const
2438 *************************************************************************/
2440 SfxPoolItem
* XLineStartWidthItem::Clone(SfxItemPool
* /*pPool*/) const
2442 return new XLineStartWidthItem(*this);
2445 /*************************************************************************
2447 |* SfxPoolItem* XLineStartWidthItem::Create(SvStream& rIn, sal_uInt16 nVer)
2450 *************************************************************************/
2452 SfxPoolItem
* XLineStartWidthItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
2454 return new XLineStartWidthItem(rIn
);
2457 //------------------------------------------------------------------------
2459 SfxItemPresentation
XLineStartWidthItem::GetPresentation
2461 SfxItemPresentation ePres
,
2462 SfxMapUnit eCoreUnit
,
2463 SfxMapUnit ePresUnit
,
2464 XubString
& rText
, const IntlWrapper
* pIntl
2469 case SFX_ITEM_PRESENTATION_NONE
:
2472 case SFX_ITEM_PRESENTATION_NAMELESS
:
2473 case SFX_ITEM_PRESENTATION_COMPLETE
:
2474 rText
= GetMetricText( (long) GetValue(),
2475 eCoreUnit
, ePresUnit
, pIntl
);
2476 rText
+= SVX_RESSTR( GetMetricId( ePresUnit
) );
2479 return SFX_ITEM_PRESENTATION_NONE
;
2483 bool XLineStartWidthItem::QueryValue( ::com::sun::star::uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
2485 rVal
<<= (sal_Int32
)GetValue();
2489 bool XLineStartWidthItem::PutValue( const ::com::sun::star::uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
2491 sal_Int32 nValue
= 0;
2499 // --------------------------
2500 // class XLineEndWidthItem
2501 // --------------------------
2502 TYPEINIT1_AUTOFACTORY(XLineEndWidthItem
, SfxMetricItem
);
2504 /*************************************************************************
2506 |* XLineEndWidthItem::XLineEndWidthItem(long nWidth)
2508 *************************************************************************/
2510 XLineEndWidthItem::XLineEndWidthItem(long nWidth
) :
2511 SfxMetricItem(XATTR_LINEENDWIDTH
, nWidth
)
2515 /*************************************************************************
2517 |* XLineEndWidthItem::XLineEndWidthItem(SvStream& rIn)
2519 *************************************************************************/
2521 XLineEndWidthItem::XLineEndWidthItem(SvStream
& rIn
) :
2522 SfxMetricItem(XATTR_LINEENDWIDTH
, rIn
)
2526 /*************************************************************************
2528 |* XLineEndWidthItem::Clone(SfxItemPool* pPool) const
2530 *************************************************************************/
2532 SfxPoolItem
* XLineEndWidthItem::Clone(SfxItemPool
* /*pPool*/) const
2534 return new XLineEndWidthItem(*this);
2537 /*************************************************************************
2539 |* SfxPoolItem* XLineEndWidthItem::Create(SvStream& rIn, sal_uInt16 nVer) const
2541 *************************************************************************/
2543 SfxPoolItem
* XLineEndWidthItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
2545 return new XLineEndWidthItem(rIn
);
2548 //------------------------------------------------------------------------
2550 SfxItemPresentation
XLineEndWidthItem::GetPresentation
2552 SfxItemPresentation ePres
,
2553 SfxMapUnit eCoreUnit
,
2554 SfxMapUnit ePresUnit
,
2555 XubString
& rText
, const IntlWrapper
*pIntl
2560 case SFX_ITEM_PRESENTATION_NONE
:
2563 case SFX_ITEM_PRESENTATION_NAMELESS
:
2564 case SFX_ITEM_PRESENTATION_COMPLETE
:
2565 rText
= GetMetricText( (long) GetValue(),
2566 eCoreUnit
, ePresUnit
, pIntl
);
2567 rText
+= SVX_RESSTR( GetMetricId( ePresUnit
) );
2570 return SFX_ITEM_PRESENTATION_NONE
;
2574 bool XLineEndWidthItem::QueryValue( ::com::sun::star::uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
2576 rVal
<<= (sal_Int32
)GetValue();
2580 bool XLineEndWidthItem::PutValue( const ::com::sun::star::uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
2582 sal_Int32 nValue
= 0;
2589 // -----------------------------
2590 // class XLineStartCenterItem
2591 // -----------------------------
2592 TYPEINIT1_AUTOFACTORY(XLineStartCenterItem
, SfxBoolItem
);
2594 /*************************************************************************
2596 |* XLineStartCenterItem::XLineStartCenterItem(sal_Bool bStartCenter)
2598 *************************************************************************/
2600 XLineStartCenterItem::XLineStartCenterItem(sal_Bool bStartCenter
) :
2601 SfxBoolItem(XATTR_LINESTARTCENTER
, bStartCenter
)
2605 /*************************************************************************
2607 |* XLineStartCenterItem::XLineStartCenterItem(SvStream& rIn)
2609 *************************************************************************/
2611 XLineStartCenterItem::XLineStartCenterItem(SvStream
& rIn
) :
2612 SfxBoolItem(XATTR_LINESTARTCENTER
, rIn
)
2616 /*************************************************************************
2618 |* XLineStartCenterItem::Clone(SfxItemPool* pPool) const
2620 *************************************************************************/
2622 SfxPoolItem
* XLineStartCenterItem::Clone(SfxItemPool
* /*pPool*/) const
2624 return new XLineStartCenterItem(*this);
2627 /*************************************************************************
2629 |* SfxPoolItem* XLineStartCenterItem::Create(SvStream& rIn, sal_uInt16 nVer)
2632 *************************************************************************/
2634 SfxPoolItem
* XLineStartCenterItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
2636 return new XLineStartCenterItem(rIn
);
2639 //------------------------------------------------------------------------
2641 SfxItemPresentation
XLineStartCenterItem::GetPresentation
2643 SfxItemPresentation ePres
,
2644 SfxMapUnit
/*eCoreUnit*/,
2645 SfxMapUnit
/*ePresUnit*/,
2646 XubString
& rText
, const IntlWrapper
*
2651 case SFX_ITEM_PRESENTATION_NONE
:
2654 case SFX_ITEM_PRESENTATION_NAMELESS
:
2655 case SFX_ITEM_PRESENTATION_COMPLETE
:
2656 rText
= XubString( ResId( GetValue() ? RID_SVXSTR_CENTERED
:
2657 RID_SVXSTR_NOTCENTERED
, DIALOG_MGR() ) );
2660 return SFX_ITEM_PRESENTATION_NONE
;
2664 bool XLineStartCenterItem::QueryValue( ::com::sun::star::uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
2666 sal_Bool bValue
= GetValue();
2667 rVal
.setValue( &bValue
, ::getCppuBooleanType() );
2671 bool XLineStartCenterItem::PutValue( const ::com::sun::star::uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
2673 if( !rVal
.hasValue() || rVal
.getValueType() != ::getCppuBooleanType() )
2676 SetValue( *(sal_Bool
*)rVal
.getValue() );
2681 // ---------------------------
2682 // class XLineEndCenterItem
2683 // ---------------------------
2684 TYPEINIT1_AUTOFACTORY(XLineEndCenterItem
, SfxBoolItem
);
2686 /*************************************************************************
2688 |* XLineEndCenterItem::XLineEndCenterItem(sal_Bool bEndCenter)
2690 *************************************************************************/
2692 XLineEndCenterItem::XLineEndCenterItem(sal_Bool bEndCenter
) :
2693 SfxBoolItem(XATTR_LINEENDCENTER
, bEndCenter
)
2697 /*************************************************************************
2699 |* XLineEndCenterItem::XLineEndCenterItem(SvStream& rIn)
2701 *************************************************************************/
2703 XLineEndCenterItem::XLineEndCenterItem(SvStream
& rIn
) :
2704 SfxBoolItem(XATTR_LINEENDCENTER
, rIn
)
2708 /*************************************************************************
2710 |* XLineEndCenterItem::Clone(SfxItemPool* pPool) const
2712 *************************************************************************/
2714 SfxPoolItem
* XLineEndCenterItem::Clone(SfxItemPool
* /*pPool*/) const
2716 return new XLineEndCenterItem(*this);
2719 /*************************************************************************
2721 |* SfxPoolItem* XLineEndCenterItem::Create(SvStream& rIn, sal_uInt16 nVer)
2724 *************************************************************************/
2726 SfxPoolItem
* XLineEndCenterItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
2728 return new XLineEndCenterItem(rIn
);
2731 //------------------------------------------------------------------------
2733 SfxItemPresentation
XLineEndCenterItem::GetPresentation
2735 SfxItemPresentation ePres
,
2736 SfxMapUnit
/*eCoreUnit*/,
2737 SfxMapUnit
/*ePresUnit*/,
2738 XubString
& rText
, const IntlWrapper
*
2743 case SFX_ITEM_PRESENTATION_NONE
:
2746 case SFX_ITEM_PRESENTATION_NAMELESS
:
2747 case SFX_ITEM_PRESENTATION_COMPLETE
:
2748 rText
= XubString( ResId( GetValue() ? RID_SVXSTR_CENTERED
:
2749 RID_SVXSTR_NOTCENTERED
, DIALOG_MGR() ) );
2752 return SFX_ITEM_PRESENTATION_NONE
;
2756 bool XLineEndCenterItem::QueryValue( ::com::sun::star::uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
2758 sal_Bool bValue
= GetValue();
2759 rVal
.setValue( &bValue
, ::getCppuBooleanType() );
2763 bool XLineEndCenterItem::PutValue( const ::com::sun::star::uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
2765 if( !rVal
.hasValue() || rVal
.getValueType() != ::getCppuBooleanType() )
2768 SetValue( *(sal_Bool
*)rVal
.getValue() );
2773 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2775 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2777 // --------------------
2778 // class XFillStyleItem
2779 // --------------------
2780 TYPEINIT1_AUTOFACTORY(XFillStyleItem
, SfxEnumItem
);
2782 /*************************************************************************
2784 |* XFillStyleItem::XFillStyleItem(XFillStyle eFillStyle)
2786 *************************************************************************/
2788 XFillStyleItem::XFillStyleItem(XFillStyle eFillStyle
) :
2789 SfxEnumItem(XATTR_FILLSTYLE
, sal::static_int_cast
< sal_uInt16
>(eFillStyle
))
2793 /*************************************************************************
2795 |* XFillStyleItem::XFillStyleItem(SvStream& rIn)
2797 *************************************************************************/
2799 XFillStyleItem::XFillStyleItem(SvStream
& rIn
) :
2800 SfxEnumItem(XATTR_FILLSTYLE
, rIn
)
2804 /*************************************************************************
2806 |* XFillStyleItem::Clone(SfxItemPool* pPool) const
2808 *************************************************************************/
2810 SfxPoolItem
* XFillStyleItem::Clone(SfxItemPool
* /*pPool*/) const
2812 return new XFillStyleItem( *this );
2815 /*************************************************************************
2817 |* SfxPoolItem* XFillStyleItem::Create(SvStream& rIn, sal_uInt16 nVer) const
2819 *************************************************************************/
2821 SfxPoolItem
* XFillStyleItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
2823 return new XFillStyleItem(rIn
);
2826 //------------------------------------------------------------------------
2828 SfxItemPresentation
XFillStyleItem::GetPresentation
2830 SfxItemPresentation ePres
,
2831 SfxMapUnit
/*eCoreUnit*/,
2832 SfxMapUnit
/*ePresUnit*/,
2833 XubString
& rText
, const IntlWrapper
*
2840 case SFX_ITEM_PRESENTATION_NONE
:
2843 case SFX_ITEM_PRESENTATION_NAMELESS
:
2844 case SFX_ITEM_PRESENTATION_COMPLETE
:
2848 switch( (sal_uInt16
)GetValue() )
2851 nId
= RID_SVXSTR_INVISIBLE
;
2854 nId
= RID_SVXSTR_SOLID
;
2856 case XFILL_GRADIENT
:
2857 nId
= RID_SVXSTR_GRADIENT
;
2860 nId
= RID_SVXSTR_HATCH
;
2863 nId
= RID_SVXSTR_BITMAP
;
2868 rText
= SVX_RESSTR( nId
);
2872 return SFX_ITEM_PRESENTATION_NONE
;
2876 //------------------------------------------------------------------------
2878 sal_uInt16
XFillStyleItem::GetValueCount() const
2883 // -----------------------------------------------------------------------
2884 bool XFillStyleItem::QueryValue( ::com::sun::star::uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
2886 ::com::sun::star::drawing::FillStyle eFS
= (::com::sun::star::drawing::FillStyle
)GetValue();
2893 // -----------------------------------------------------------------------
2894 bool XFillStyleItem::PutValue( const ::com::sun::star::uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
2896 ::com::sun::star::drawing::FillStyle eFS
;
2899 // also try an int (for Basic)
2903 eFS
= (::com::sun::star::drawing::FillStyle
)nFS
;
2906 SetValue( sal::static_int_cast
< sal_uInt16
>( eFS
) );
2912 // -------------------
2913 // class XFillColorItem
2914 // -------------------
2915 TYPEINIT1_AUTOFACTORY(XFillColorItem
, XColorItem
);
2917 /*************************************************************************
2919 |* XFillColorItem::XFillColorItem(sal_Int32 nIndex, const Color& rTheColor)
2921 *************************************************************************/
2923 XFillColorItem::XFillColorItem(sal_Int32 nIndex
, const Color
& rTheColor
) :
2924 XColorItem(XATTR_FILLCOLOR
, nIndex
, rTheColor
)
2928 /*************************************************************************
2930 |* XFillColorItem::XFillColorItem(const XubString& rName, const Color& rTheColor)
2932 *************************************************************************/
2934 XFillColorItem::XFillColorItem(const XubString
& rName
, const Color
& rTheColor
) :
2935 XColorItem(XATTR_FILLCOLOR
, rName
, rTheColor
)
2939 /*************************************************************************
2941 |* XFillColorItem::XFillColorItem(SvStream& rIn)
2943 *************************************************************************/
2945 XFillColorItem::XFillColorItem(SvStream
& rIn
) :
2946 XColorItem(XATTR_FILLCOLOR
, rIn
)
2950 /*************************************************************************
2952 |* XFillColorItem::Clone(SfxItemPool* pPool) const
2954 *************************************************************************/
2956 SfxPoolItem
* XFillColorItem::Clone(SfxItemPool
* /*pPool*/) const
2958 return new XFillColorItem(*this);
2961 /*************************************************************************
2963 |* SfxPoolItem* XFillColorItem::Create(SvStream& rIn, sal_uInt16 nVer) const
2965 *************************************************************************/
2967 SfxPoolItem
* XFillColorItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
2969 return new XFillColorItem(rIn
);
2972 //------------------------------------------------------------------------
2974 SfxItemPresentation
XFillColorItem::GetPresentation
2976 SfxItemPresentation ePres
,
2977 SfxMapUnit
/*eCoreUnit*/,
2978 SfxMapUnit
/*ePresUnit*/,
2979 XubString
& rText
, const IntlWrapper
*
2984 case SFX_ITEM_PRESENTATION_NONE
:
2987 case SFX_ITEM_PRESENTATION_NAMELESS
:
2988 case SFX_ITEM_PRESENTATION_COMPLETE
:
2992 return SFX_ITEM_PRESENTATION_NONE
;
2996 // -----------------------------------------------------------------------
2998 bool XFillColorItem::QueryValue( ::com::sun::star::uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
3000 rVal
<<= (sal_Int32
)GetColorValue().GetRGBColor();
3005 // -----------------------------------------------------------------------
3007 bool XFillColorItem::PutValue( const ::com::sun::star::uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
3009 sal_Int32 nValue
= 0;
3010 if(!(rVal
>>= nValue
))
3013 SetColorValue( nValue
);
3017 // -----------------------------
3018 // class XSecondaryFillColorItem
3019 // -----------------------------
3020 TYPEINIT1_AUTOFACTORY(XSecondaryFillColorItem
, XColorItem
);
3022 XSecondaryFillColorItem::XSecondaryFillColorItem(const XubString
& rName
, const Color
& rTheColor
) :
3023 XColorItem(XATTR_SECONDARYFILLCOLOR
, rName
, rTheColor
)
3027 XSecondaryFillColorItem::XSecondaryFillColorItem( SvStream
& rIn
) :
3028 XColorItem(XATTR_SECONDARYFILLCOLOR
, rIn
)
3032 SfxPoolItem
* XSecondaryFillColorItem::Clone(SfxItemPool
* /*pPool*/) const
3034 return new XSecondaryFillColorItem(*this);
3037 SfxPoolItem
* XSecondaryFillColorItem::Create( SvStream
& rIn
, sal_uInt16 nVer
) const
3040 return new XSecondaryFillColorItem( rIn
);
3042 return new XSecondaryFillColorItem( String(), Color(0,184,255) );
3044 sal_uInt16
XSecondaryFillColorItem::GetVersion( sal_uInt16
/*nFileFormatVersion*/ ) const
3048 SfxItemPresentation
XSecondaryFillColorItem::GetPresentation
3050 SfxItemPresentation ePres
,
3051 SfxMapUnit
/*eCoreUnit*/,
3052 SfxMapUnit
/*ePresUnit*/,
3053 XubString
& rText
, const IntlWrapper
*
3058 case SFX_ITEM_PRESENTATION_NONE
:
3061 case SFX_ITEM_PRESENTATION_NAMELESS
:
3062 case SFX_ITEM_PRESENTATION_COMPLETE
:
3066 return SFX_ITEM_PRESENTATION_NONE
;
3074 /*************************************************************************
3076 |* XGradient::XGradient()
3078 *************************************************************************/
3080 XGradient::XGradient() :
3081 eStyle( XGRAD_LINEAR
),
3082 aStartColor( Color( COL_BLACK
) ),
3083 aEndColor( Color( COL_WHITE
) ),
3088 nIntensStart( 100 ),
3094 /*************************************************************************
3096 |* XGradient::XGradient(XGradientStyle, const Color&, const Color&,
3097 |* long, sal_uInt16, sal_uInt16, sal_uInt16)
3099 *************************************************************************/
3101 XGradient::XGradient(const Color
& rStart
, const Color
& rEnd
,
3102 XGradientStyle eTheStyle
, long nTheAngle
, sal_uInt16 nXOfs
,
3103 sal_uInt16 nYOfs
, sal_uInt16 nTheBorder
,
3104 sal_uInt16 nStartIntens
, sal_uInt16 nEndIntens
,
3105 sal_uInt16 nSteps
) :
3107 aStartColor(rStart
),
3110 nBorder(nTheBorder
),
3113 nIntensStart(nStartIntens
),
3114 nIntensEnd(nEndIntens
),
3119 /*************************************************************************
3121 |* int XGradient::operator==(const SfxPoolItem& rItem) const
3123 *************************************************************************/
3125 bool XGradient::operator==(const XGradient
& rGradient
) const
3127 return ( eStyle
== rGradient
.eStyle
&&
3128 aStartColor
== rGradient
.aStartColor
&&
3129 aEndColor
== rGradient
.aEndColor
&&
3130 nAngle
== rGradient
.nAngle
&&
3131 nBorder
== rGradient
.nBorder
&&
3132 nOfsX
== rGradient
.nOfsX
&&
3133 nOfsY
== rGradient
.nOfsY
&&
3134 nIntensStart
== rGradient
.nIntensStart
&&
3135 nIntensEnd
== rGradient
.nIntensEnd
&&
3136 nStepCount
== rGradient
.nStepCount
);
3140 // -----------------------
3141 // class XFillGradientItem
3142 // -----------------------
3143 TYPEINIT1_AUTOFACTORY(XFillGradientItem
, NameOrIndex
);
3145 /*************************************************************************
3147 |* XFillGradientItem::XFillGradientItem(sal_Int32 nIndex,
3148 |* const XGradient& rTheGradient)
3150 *************************************************************************/
3152 XFillGradientItem::XFillGradientItem(sal_Int32 nIndex
,
3153 const XGradient
& rTheGradient
) :
3154 NameOrIndex(XATTR_FILLGRADIENT
, nIndex
),
3155 aGradient(rTheGradient
)
3159 /*************************************************************************
3161 |* XFillGradientItem::XFillGradientItem(const XubString& rName,
3162 |* const XGradient& rTheGradient)
3164 *************************************************************************/
3166 XFillGradientItem::XFillGradientItem(const XubString
& rName
,
3167 const XGradient
& rTheGradient
) :
3168 NameOrIndex(XATTR_FILLGRADIENT
, rName
),
3169 aGradient(rTheGradient
)
3173 /*************************************************************************
3175 |* XFillGradientItem::XFillGradientItem(const XFillGradientItem& rItem)
3177 *************************************************************************/
3179 XFillGradientItem::XFillGradientItem(const XFillGradientItem
& rItem
) :
3181 aGradient(rItem
.aGradient
)
3185 /*************************************************************************
3187 |* XFillGradientItem::XFillGradientItem(SvStream& rIn)
3189 *************************************************************************/
3191 XFillGradientItem::XFillGradientItem(SvStream
& rIn
, sal_uInt16 nVer
) :
3192 NameOrIndex(XATTR_FILLGRADIENT
, rIn
),
3193 aGradient(COL_BLACK
, COL_WHITE
)
3204 rIn
>> nITemp
; aGradient
.SetGradientStyle((XGradientStyle
)nITemp
);
3209 aCol
= Color( (sal_uInt8
)( nRed
>> 8 ), (sal_uInt8
)( nGreen
>> 8 ), (sal_uInt8
)( nBlue
>> 8 ) );
3210 aGradient
.SetStartColor( aCol
);
3215 aCol
= Color( (sal_uInt8
)( nRed
>> 8 ), (sal_uInt8
)( nGreen
>> 8 ), (sal_uInt8
)( nBlue
>> 8 ) );
3216 aGradient
.SetEndColor(aCol
);
3217 rIn
>> nLTemp
; aGradient
.SetAngle(nLTemp
);
3218 rIn
>> nUSTemp
; aGradient
.SetBorder(nUSTemp
);
3219 rIn
>> nUSTemp
; aGradient
.SetXOffset(nUSTemp
);
3220 rIn
>> nUSTemp
; aGradient
.SetYOffset(nUSTemp
);
3221 rIn
>> nUSTemp
; aGradient
.SetStartIntens(nUSTemp
);
3222 rIn
>> nUSTemp
; aGradient
.SetEndIntens(nUSTemp
);
3224 // bei neueren Versionen wird zusaetzlich
3225 // die Schrittweite mit eingelesen
3228 rIn
>> nUSTemp
; aGradient
.SetSteps(nUSTemp
);
3233 //*************************************************************************
3235 XFillGradientItem::XFillGradientItem( const XGradient
& rTheGradient
)
3236 : NameOrIndex( XATTR_FILLGRADIENT
, -1 ),
3237 aGradient(rTheGradient
)
3241 /*************************************************************************
3243 |* XFillGradientItem::Clone(SfxItemPool* pPool) const
3245 *************************************************************************/
3247 SfxPoolItem
* XFillGradientItem::Clone(SfxItemPool
* /*pPool*/) const
3249 return new XFillGradientItem(*this);
3252 /*************************************************************************
3254 |* int XFillGradientItem::operator==(const SfxPoolItem& rItem) const
3256 *************************************************************************/
3258 int XFillGradientItem::operator==(const SfxPoolItem
& rItem
) const
3260 return ( NameOrIndex::operator==(rItem
) &&
3261 aGradient
== ((const XFillGradientItem
&) rItem
).aGradient
);
3264 /*************************************************************************
3266 |* SfxPoolItem* XFillGradientItem::Create(SvStream& rIn, sal_uInt16 nVer) const
3268 *************************************************************************/
3270 SfxPoolItem
* XFillGradientItem::Create(SvStream
& rIn
, sal_uInt16 nVer
) const
3272 return new XFillGradientItem(rIn
, nVer
);
3275 /*************************************************************************
3277 |* SfxPoolItem* XFillGradientItem::Store(SvStream& rOut) const
3279 *************************************************************************/
3281 SvStream
& XFillGradientItem::Store( SvStream
& rOut
, sal_uInt16 nItemVersion
) const
3283 NameOrIndex::Store( rOut
, nItemVersion
);
3287 rOut
<< (sal_Int16
)aGradient
.GetGradientStyle();
3291 nTmp
= VCLTOSVCOL( aGradient
.GetStartColor().GetRed() ); rOut
<< nTmp
;
3292 nTmp
= VCLTOSVCOL( aGradient
.GetStartColor().GetGreen() ); rOut
<< nTmp
;
3293 nTmp
= VCLTOSVCOL( aGradient
.GetStartColor().GetBlue() ); rOut
<< nTmp
;
3294 nTmp
= VCLTOSVCOL( aGradient
.GetEndColor().GetRed() ); rOut
<< nTmp
;
3295 nTmp
= VCLTOSVCOL( aGradient
.GetEndColor().GetGreen() ); rOut
<< nTmp
;
3296 nTmp
= VCLTOSVCOL( aGradient
.GetEndColor().GetBlue() ); rOut
<< nTmp
;
3298 rOut
<< (sal_Int32
) aGradient
.GetAngle();
3299 rOut
<< aGradient
.GetBorder();
3300 rOut
<< aGradient
.GetXOffset();
3301 rOut
<< aGradient
.GetYOffset();
3302 rOut
<< aGradient
.GetStartIntens();
3303 rOut
<< aGradient
.GetEndIntens();
3304 rOut
<< aGradient
.GetSteps();
3310 /*************************************************************************
3312 |* const XGradient& XFillGradientItem::GetValue(const XGradientTable* pTable)
3315 *************************************************************************/
3317 const XGradient
& XFillGradientItem::GetGradientValue() const // GetValue -> GetGradientValue
3321 // ToDo: This should fail. We never called this code with a table so this should always
3322 // have failed. Thus, I'm thinking that XFillGradientItem can't be an Index.
3327 /*************************************************************************
3329 |* sal_uInt16 XFillGradientItem::GetVersion() const
3331 *************************************************************************/
3333 sal_uInt16
XFillGradientItem::GetVersion( sal_uInt16
/*nFileFormatVersion*/) const
3335 // !!! this version number also represents the version number of superclasses
3336 // !!! (e.g. XFillFloatTransparenceItem); if you make any changes here,
3337 // !!! the superclass is also affected
3341 //------------------------------------------------------------------------
3343 SfxItemPresentation
XFillGradientItem::GetPresentation
3345 SfxItemPresentation ePres
,
3346 SfxMapUnit
/*eCoreUnit*/,
3347 SfxMapUnit
/*ePresUnit*/,
3348 XubString
& rText
, const IntlWrapper
*
3353 case SFX_ITEM_PRESENTATION_NONE
:
3356 case SFX_ITEM_PRESENTATION_NAMELESS
:
3357 case SFX_ITEM_PRESENTATION_COMPLETE
:
3361 return SFX_ITEM_PRESENTATION_NONE
;
3365 // -----------------------------------------------------------------------
3366 bool XFillGradientItem::QueryValue( ::com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
) const
3368 //sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
3369 nMemberId
&= ~CONVERT_TWIPS
;
3370 switch ( nMemberId
)
3374 uno::Sequence
< beans::PropertyValue
> aPropSeq( 2 );
3376 ::com::sun::star::awt::Gradient aGradient2
;
3378 const XGradient
& aXGradient
= GetGradientValue();
3379 aGradient2
.Style
= (::com::sun::star::awt::GradientStyle
) aXGradient
.GetGradientStyle();
3380 aGradient2
.StartColor
= (sal_Int32
)aXGradient
.GetStartColor().GetColor();
3381 aGradient2
.EndColor
= (sal_Int32
)aXGradient
.GetEndColor().GetColor();
3382 aGradient2
.Angle
= (short)aXGradient
.GetAngle();
3383 aGradient2
.Border
= aXGradient
.GetBorder();
3384 aGradient2
.XOffset
= aXGradient
.GetXOffset();
3385 aGradient2
.YOffset
= aXGradient
.GetYOffset();
3386 aGradient2
.StartIntensity
= aXGradient
.GetStartIntens();
3387 aGradient2
.EndIntensity
= aXGradient
.GetEndIntens();
3388 aGradient2
.StepCount
= aXGradient
.GetSteps();
3390 rtl::OUString aApiName
;
3391 SvxUnogetApiNameForItem( Which(), GetName(), aApiName
);
3392 aPropSeq
[0].Name
= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ));
3393 aPropSeq
[0].Value
= uno::makeAny( aApiName
);
3394 aPropSeq
[1].Name
= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FillGradient" ));
3395 aPropSeq
[1].Value
= uno::makeAny( aGradient2
);
3396 rVal
= uno::makeAny( aPropSeq
);
3400 case MID_FILLGRADIENT
:
3402 const XGradient
& aXGradient
= GetGradientValue();
3403 ::com::sun::star::awt::Gradient aGradient2
;
3405 aGradient2
.Style
= (::com::sun::star::awt::GradientStyle
) aXGradient
.GetGradientStyle();
3406 aGradient2
.StartColor
= (sal_Int32
)aXGradient
.GetStartColor().GetColor();
3407 aGradient2
.EndColor
= (sal_Int32
)aXGradient
.GetEndColor().GetColor();
3408 aGradient2
.Angle
= (short)aXGradient
.GetAngle();
3409 aGradient2
.Border
= aXGradient
.GetBorder();
3410 aGradient2
.XOffset
= aXGradient
.GetXOffset();
3411 aGradient2
.YOffset
= aXGradient
.GetYOffset();
3412 aGradient2
.StartIntensity
= aXGradient
.GetStartIntens();
3413 aGradient2
.EndIntensity
= aXGradient
.GetEndIntens();
3414 aGradient2
.StepCount
= aXGradient
.GetSteps();
3416 rVal
<<= aGradient2
;
3422 rtl::OUString aApiName
;
3423 SvxUnogetApiNameForItem( Which(), GetName(), aApiName
);
3428 case MID_GRADIENT_STYLE
: rVal
<<= (sal_Int16
)GetGradientValue().GetGradientStyle(); break;
3429 case MID_GRADIENT_STARTCOLOR
: rVal
<<= (sal_Int32
)GetGradientValue().GetStartColor().GetColor(); break;
3430 case MID_GRADIENT_ENDCOLOR
: rVal
<<= (sal_Int32
)GetGradientValue().GetEndColor().GetColor(); break;
3431 case MID_GRADIENT_ANGLE
: rVal
<<= (sal_Int16
)GetGradientValue().GetAngle(); break;
3432 case MID_GRADIENT_BORDER
: rVal
<<= GetGradientValue().GetBorder(); break;
3433 case MID_GRADIENT_XOFFSET
: rVal
<<= GetGradientValue().GetXOffset(); break;
3434 case MID_GRADIENT_YOFFSET
: rVal
<<= GetGradientValue().GetYOffset(); break;
3435 case MID_GRADIENT_STARTINTENSITY
: rVal
<<= GetGradientValue().GetStartIntens(); break;
3436 case MID_GRADIENT_ENDINTENSITY
: rVal
<<= GetGradientValue().GetEndIntens(); break;
3437 case MID_GRADIENT_STEPCOUNT
: rVal
<<= GetGradientValue().GetSteps(); break;
3439 default: OSL_FAIL("Wrong MemberId!"); return false;
3445 // -----------------------------------------------------------------------
3446 bool XFillGradientItem::PutValue( const ::com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
)
3448 // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
3449 nMemberId
&= ~CONVERT_TWIPS
;
3451 switch ( nMemberId
)
3455 uno::Sequence
< beans::PropertyValue
> aPropSeq
;
3456 ::com::sun::star::awt::Gradient aGradient2
;
3457 rtl::OUString aName
;
3458 bool bGradient( false );
3460 if ( rVal
>>= aPropSeq
)
3462 for ( sal_Int32 n
= 0; n
< aPropSeq
.getLength(); n
++ )
3464 if ( aPropSeq
[n
].Name
== "Name" )
3465 aPropSeq
[n
].Value
>>= aName
;
3466 else if ( aPropSeq
[n
].Name
== "FillGradient" )
3468 if ( aPropSeq
[n
].Value
>>= aGradient2
)
3476 XGradient aXGradient
;
3478 aXGradient
.SetGradientStyle( (XGradientStyle
) aGradient2
.Style
);
3479 aXGradient
.SetStartColor( aGradient2
.StartColor
);
3480 aXGradient
.SetEndColor( aGradient2
.EndColor
);
3481 aXGradient
.SetAngle( aGradient2
.Angle
);
3482 aXGradient
.SetBorder( aGradient2
.Border
);
3483 aXGradient
.SetXOffset( aGradient2
.XOffset
);
3484 aXGradient
.SetYOffset( aGradient2
.YOffset
);
3485 aXGradient
.SetStartIntens( aGradient2
.StartIntensity
);
3486 aXGradient
.SetEndIntens( aGradient2
.EndIntensity
);
3487 aXGradient
.SetSteps( aGradient2
.StepCount
);
3489 SetGradientValue( aXGradient
);
3500 rtl::OUString aName
;
3501 if (!(rVal
>>= aName
))
3507 case MID_FILLGRADIENT
:
3509 ::com::sun::star::awt::Gradient aGradient2
;
3510 if(!(rVal
>>= aGradient2
))
3513 XGradient aXGradient
;
3515 aXGradient
.SetGradientStyle( (XGradientStyle
) aGradient2
.Style
);
3516 aXGradient
.SetStartColor( aGradient2
.StartColor
);
3517 aXGradient
.SetEndColor( aGradient2
.EndColor
);
3518 aXGradient
.SetAngle( aGradient2
.Angle
);
3519 aXGradient
.SetBorder( aGradient2
.Border
);
3520 aXGradient
.SetXOffset( aGradient2
.XOffset
);
3521 aXGradient
.SetYOffset( aGradient2
.YOffset
);
3522 aXGradient
.SetStartIntens( aGradient2
.StartIntensity
);
3523 aXGradient
.SetEndIntens( aGradient2
.EndIntensity
);
3524 aXGradient
.SetSteps( aGradient2
.StepCount
);
3526 SetGradientValue( aXGradient
);
3530 case MID_GRADIENT_STARTCOLOR
:
3531 case MID_GRADIENT_ENDCOLOR
:
3534 if(!(rVal
>>= nVal
))
3537 XGradient aXGradient
= GetGradientValue();
3539 if ( nMemberId
== MID_GRADIENT_STARTCOLOR
)
3540 aXGradient
.SetStartColor( nVal
);
3542 aXGradient
.SetEndColor( nVal
);
3543 SetGradientValue( aXGradient
);
3547 case MID_GRADIENT_STYLE
:
3548 case MID_GRADIENT_ANGLE
:
3549 case MID_GRADIENT_BORDER
:
3550 case MID_GRADIENT_STARTINTENSITY
:
3551 case MID_GRADIENT_ENDINTENSITY
:
3552 case MID_GRADIENT_STEPCOUNT
:
3553 case MID_GRADIENT_XOFFSET
:
3554 case MID_GRADIENT_YOFFSET
:
3556 sal_Int16 nVal
= sal_Int16();
3557 if(!(rVal
>>= nVal
))
3560 XGradient aXGradient
= GetGradientValue();
3562 switch ( nMemberId
)
3564 case MID_GRADIENT_STYLE
:
3565 aXGradient
.SetGradientStyle( (XGradientStyle
)nVal
); break;
3566 case MID_GRADIENT_ANGLE
:
3567 aXGradient
.SetAngle( nVal
); break;
3568 case MID_GRADIENT_BORDER
:
3569 aXGradient
.SetBorder( nVal
); break;
3570 case MID_GRADIENT_STARTINTENSITY
:
3571 aXGradient
.SetStartIntens( nVal
); break;
3572 case MID_GRADIENT_ENDINTENSITY
:
3573 aXGradient
.SetEndIntens( nVal
); break;
3574 case MID_GRADIENT_STEPCOUNT
:
3575 aXGradient
.SetSteps( nVal
); break;
3576 case MID_GRADIENT_XOFFSET
:
3577 aXGradient
.SetXOffset( nVal
); break;
3578 case MID_GRADIENT_YOFFSET
:
3579 aXGradient
.SetYOffset( nVal
); break;
3582 SetGradientValue( aXGradient
);
3590 sal_Bool
XFillGradientItem::CompareValueFunc( const NameOrIndex
* p1
, const NameOrIndex
* p2
)
3592 return ((XFillGradientItem
*)p1
)->GetGradientValue() == ((XFillGradientItem
*)p2
)->GetGradientValue();
3595 XFillGradientItem
* XFillGradientItem::checkForUniqueItem( SdrModel
* pModel
) const
3599 const String aUniqueName
= NameOrIndex::CheckNamedItem(
3600 this, XATTR_FILLGRADIENT
, &pModel
->GetItemPool(),
3601 pModel
->GetStyleSheetPool() ? &pModel
->GetStyleSheetPool()->GetPool() : NULL
,
3602 XFillGradientItem::CompareValueFunc
, RID_SVXSTR_GRADIENT
,
3603 pModel
->GetPropertyList( XGRADIENT_LIST
) );
3605 // if the given name is not valid, replace it!
3606 if( aUniqueName
!= GetName() )
3607 return new XFillGradientItem( aUniqueName
, aGradient
);
3610 return (XFillGradientItem
*)this;
3613 // ----------------------------------
3614 // class XFillFloatTransparenceItem -
3615 // ----------------------------------
3617 TYPEINIT1_AUTOFACTORY( XFillFloatTransparenceItem
, XFillGradientItem
);
3619 // -----------------------------------------------------------------------------
3621 XFillFloatTransparenceItem::XFillFloatTransparenceItem() :
3622 bEnabled( sal_False
)
3624 SetWhich( XATTR_FILLFLOATTRANSPARENCE
);
3627 //------------------------------------------------------------------------
3629 XFillFloatTransparenceItem::XFillFloatTransparenceItem(const XubString
& rName
, const XGradient
& rGradient
, sal_Bool bEnable
) :
3630 XFillGradientItem ( rName
, rGradient
),
3631 bEnabled ( bEnable
)
3633 SetWhich( XATTR_FILLFLOATTRANSPARENCE
);
3636 //------------------------------------------------------------------------
3638 XFillFloatTransparenceItem::XFillFloatTransparenceItem( const XFillFloatTransparenceItem
& rItem
) :
3639 XFillGradientItem ( rItem
),
3640 bEnabled ( rItem
.bEnabled
)
3642 SetWhich( XATTR_FILLFLOATTRANSPARENCE
);
3645 //*************************************************************************
3647 XFillFloatTransparenceItem::XFillFloatTransparenceItem(SfxItemPool
* /*pPool*/, const XGradient
& rTheGradient
, sal_Bool bEnable
)
3648 : XFillGradientItem ( -1, rTheGradient
),
3649 bEnabled ( bEnable
)
3651 SetWhich( XATTR_FILLFLOATTRANSPARENCE
);
3654 //------------------------------------------------------------------------
3656 int XFillFloatTransparenceItem::operator==( const SfxPoolItem
& rItem
) const
3658 return ( NameOrIndex::operator==(rItem
) ) &&
3659 ( GetGradientValue() == ((const XFillGradientItem
&)rItem
).GetGradientValue() ) &&
3660 ( bEnabled
== ( (XFillFloatTransparenceItem
&) rItem
).bEnabled
);
3663 //------------------------------------------------------------------------
3665 SfxPoolItem
* XFillFloatTransparenceItem::Clone( SfxItemPool
* /*pPool*/) const
3667 return new XFillFloatTransparenceItem( *this );
3670 //------------------------------------------------------------------------
3672 sal_uInt16
XFillFloatTransparenceItem::GetVersion( sal_uInt16 nFileFormatVersion
) const
3674 // !!! if version number of this object must be increased, please !!!
3675 // !!! increase version number of base class XFillGradientItem !!!
3676 return XFillGradientItem::GetVersion( nFileFormatVersion
);
3679 //------------------------------------------------------------------------
3681 bool XFillFloatTransparenceItem::QueryValue( ::com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
) const
3683 return XFillGradientItem::QueryValue( rVal
, nMemberId
);
3686 //------------------------------------------------------------------------
3688 bool XFillFloatTransparenceItem::PutValue( const ::com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
)
3690 return XFillGradientItem::PutValue( rVal
, nMemberId
);
3693 //------------------------------------------------------------------------
3695 SfxItemPresentation
XFillFloatTransparenceItem::GetPresentation( SfxItemPresentation ePres
,
3696 SfxMapUnit eCoreUnit
, SfxMapUnit ePresUnit
,
3698 const IntlWrapper
* pIntlWrapper
) const
3700 return XFillGradientItem::GetPresentation( ePres
, eCoreUnit
, ePresUnit
, rText
, pIntlWrapper
);
3703 sal_Bool
XFillFloatTransparenceItem::CompareValueFunc( const NameOrIndex
* p1
, const NameOrIndex
* p2
)
3705 return ((XFillFloatTransparenceItem
*)p1
)->IsEnabled() == ((XFillFloatTransparenceItem
*)p2
)->IsEnabled() &&
3706 ((XFillFloatTransparenceItem
*)p1
)->GetGradientValue() == ((XFillFloatTransparenceItem
*)p2
)->GetGradientValue();
3709 XFillFloatTransparenceItem
* XFillFloatTransparenceItem::checkForUniqueItem( SdrModel
* pModel
) const
3711 // #85953# unique name only necessary when enabled
3716 const String aUniqueName
= NameOrIndex::CheckNamedItem( this,
3717 XATTR_FILLFLOATTRANSPARENCE
,
3718 &pModel
->GetItemPool(),
3719 pModel
->GetStyleSheetPool() ? &pModel
->GetStyleSheetPool()->GetPool() : NULL
,
3720 XFillFloatTransparenceItem::CompareValueFunc
,
3721 RID_SVXSTR_TRASNGR0
,
3722 XPropertyListRef() );
3724 // if the given name is not valid, replace it!
3725 if( aUniqueName
!= GetName() )
3727 return new XFillFloatTransparenceItem( aUniqueName
, GetGradientValue(), sal_True
);
3733 // #85953# if disabled, force name to empty string
3736 return new XFillFloatTransparenceItem(String(), GetGradientValue(), sal_False
);
3740 return (XFillFloatTransparenceItem
*)this;
3747 /*************************************************************************
3749 |* XHatch::XHatch(XHatchStyle, const Color&, long, long)
3751 *************************************************************************/
3753 XHatch::XHatch(const Color
& rCol
, XHatchStyle eTheStyle
, long nTheDistance
,
3757 nDistance(nTheDistance
),
3762 /*************************************************************************
3764 |* int XHatch::operator==(const SfxPoolItem& rItem) const
3766 *************************************************************************/
3768 bool XHatch::operator==(const XHatch
& rHatch
) const
3770 return ( eStyle
== rHatch
.eStyle
&&
3771 aColor
== rHatch
.aColor
&&
3772 nDistance
== rHatch
.nDistance
&&
3773 nAngle
== rHatch
.nAngle
);
3777 // -----------------------
3778 // class XFillHatchItem
3779 // -----------------------
3780 TYPEINIT1_AUTOFACTORY(XFillHatchItem
, NameOrIndex
);
3782 /*************************************************************************
3784 |* XFillHatchItem::XFillHatchItem(const XubString& rName,
3785 |* const XHatch& rTheHatch)
3787 *************************************************************************/
3789 XFillHatchItem::XFillHatchItem(const XubString
& rName
,
3790 const XHatch
& rTheHatch
) :
3791 NameOrIndex(XATTR_FILLHATCH
, rName
),
3796 /*************************************************************************
3798 |* XFillHatchItem::XFillHatchItem(const XFillHatchItem& rItem)
3800 *************************************************************************/
3802 XFillHatchItem::XFillHatchItem(const XFillHatchItem
& rItem
) :
3804 aHatch(rItem
.aHatch
)
3808 /*************************************************************************
3810 |* XFillHatchItem::XFillHatchItem(SvStream& rIn)
3812 *************************************************************************/
3814 XFillHatchItem::XFillHatchItem(SvStream
& rIn
) :
3815 NameOrIndex(XATTR_FILLHATCH
, rIn
),
3826 rIn
>> nITemp
; aHatch
.SetHatchStyle((XHatchStyle
)nITemp
);
3832 aCol
= Color( (sal_uInt8
)( nRed
>> 8 ), (sal_uInt8
)( nGreen
>> 8 ), (sal_uInt8
)( nBlue
>> 8 ) );
3833 aHatch
.SetColor(aCol
);
3834 rIn
>> nLTemp
; aHatch
.SetDistance(nLTemp
);
3835 rIn
>> nLTemp
; aHatch
.SetAngle(nLTemp
);
3839 //*************************************************************************
3841 XFillHatchItem::XFillHatchItem(SfxItemPool
* /*pPool*/, const XHatch
& rTheHatch
)
3842 : NameOrIndex( XATTR_FILLHATCH
, -1 ),
3847 /*************************************************************************
3849 |* XFillHatchItem::Clone(SfxItemPool* pPool) const
3851 *************************************************************************/
3853 SfxPoolItem
* XFillHatchItem::Clone(SfxItemPool
* /*pPool*/) const
3855 return new XFillHatchItem(*this);
3858 /*************************************************************************
3860 |* int XFillHatchItem::operator==(const SfxPoolItem& rItem) const
3862 *************************************************************************/
3864 int XFillHatchItem::operator==(const SfxPoolItem
& rItem
) const
3866 return ( NameOrIndex::operator==(rItem
) &&
3867 aHatch
== ((const XFillHatchItem
&) rItem
).aHatch
);
3870 /*************************************************************************
3872 |* SfxPoolItem* XFillHatchItem::Create(SvStream& rIn, sal_uInt16 nVer) const
3874 *************************************************************************/
3876 SfxPoolItem
* XFillHatchItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
3878 return new XFillHatchItem(rIn
);
3881 /*************************************************************************
3883 |* SfxPoolItem* XFillHatchItem::Store(SvStream& rOut) const
3885 *************************************************************************/
3887 SvStream
& XFillHatchItem::Store( SvStream
& rOut
, sal_uInt16 nItemVersion
) const
3889 NameOrIndex::Store( rOut
, nItemVersion
);
3893 rOut
<< (sal_Int16
)aHatch
.GetHatchStyle();
3896 nTmp
= VCLTOSVCOL( aHatch
.GetColor().GetRed() ); rOut
<< nTmp
;
3897 nTmp
= VCLTOSVCOL( aHatch
.GetColor().GetGreen() ); rOut
<< nTmp
;
3898 nTmp
= VCLTOSVCOL( aHatch
.GetColor().GetBlue() ); rOut
<< nTmp
;
3900 rOut
<< (sal_Int32
) aHatch
.GetDistance();
3901 rOut
<< (sal_Int32
) aHatch
.GetAngle();
3907 /*************************************************************************
3909 |* const XHatch& XFillHatchItem::GetValue(const XHatchTable* pTable) const
3911 *************************************************************************/
3913 const XHatch
& XFillHatchItem::GetHatchValue() const // GetValue -> GetHatchValue
3918 // return pTable->GetHatch(GetIndex())->GetHatch();
3922 //------------------------------------------------------------------------
3924 SfxItemPresentation
XFillHatchItem::GetPresentation
3926 SfxItemPresentation ePres
,
3927 SfxMapUnit
/*eCoreUnit*/,
3928 SfxMapUnit
/*ePresUnit*/,
3929 XubString
& rText
, const IntlWrapper
*
3934 case SFX_ITEM_PRESENTATION_NONE
:
3937 case SFX_ITEM_PRESENTATION_NAMELESS
:
3938 case SFX_ITEM_PRESENTATION_COMPLETE
:
3942 return SFX_ITEM_PRESENTATION_NONE
;
3946 //------------------------------------------------------------------------
3948 bool XFillHatchItem::HasMetrics() const
3953 //------------------------------------------------------------------------
3955 bool XFillHatchItem::ScaleMetrics(long nMul
, long nDiv
)
3957 aHatch
.SetDistance( ScaleMetricValue( aHatch
.GetDistance(), nMul
, nDiv
) );
3961 // -----------------------------------------------------------------------
3962 bool XFillHatchItem::QueryValue( ::com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
) const
3964 // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
3965 nMemberId
&= ~CONVERT_TWIPS
;
3967 switch ( nMemberId
)
3971 uno::Sequence
< beans::PropertyValue
> aPropSeq( 2 );
3973 ::com::sun::star::drawing::Hatch aUnoHatch
;
3975 aUnoHatch
.Style
= (::com::sun::star::drawing::HatchStyle
)aHatch
.GetHatchStyle();
3976 aUnoHatch
.Color
= aHatch
.GetColor().GetColor();
3977 aUnoHatch
.Distance
= aHatch
.GetDistance();
3978 aUnoHatch
.Angle
= aHatch
.GetAngle();
3980 rtl::OUString aApiName
;
3981 SvxUnogetApiNameForItem( Which(), GetName(), aApiName
);
3982 aPropSeq
[0].Name
= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ));
3983 aPropSeq
[0].Value
= uno::makeAny( aApiName
);
3984 aPropSeq
[1].Name
= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FillHatch" ));
3985 aPropSeq
[1].Value
= uno::makeAny( aUnoHatch
);
3986 rVal
= uno::makeAny( aPropSeq
);
3992 ::com::sun::star::drawing::Hatch aUnoHatch
;
3994 aUnoHatch
.Style
= (::com::sun::star::drawing::HatchStyle
)aHatch
.GetHatchStyle();
3995 aUnoHatch
.Color
= aHatch
.GetColor().GetColor();
3996 aUnoHatch
.Distance
= aHatch
.GetDistance();
3997 aUnoHatch
.Angle
= aHatch
.GetAngle();
4004 rtl::OUString aApiName
;
4005 SvxUnogetApiNameForItem( Which(), GetName(), aApiName
);
4010 case MID_HATCH_STYLE
:
4011 rVal
<<= (::com::sun::star::drawing::HatchStyle
)aHatch
.GetHatchStyle(); break;
4012 case MID_HATCH_COLOR
:
4013 rVal
<<= (sal_Int32
)aHatch
.GetColor().GetColor(); break;
4014 case MID_HATCH_DISTANCE
:
4015 rVal
<<= aHatch
.GetDistance(); break;
4016 case MID_HATCH_ANGLE
:
4017 rVal
<<= aHatch
.GetAngle(); break;
4019 default: OSL_FAIL("Wrong MemberId!"); return false;
4025 // -----------------------------------------------------------------------
4026 bool XFillHatchItem::PutValue( const ::com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
)
4028 // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
4029 nMemberId
&= ~CONVERT_TWIPS
;
4031 switch ( nMemberId
)
4035 uno::Sequence
< beans::PropertyValue
> aPropSeq
;
4036 ::com::sun::star::drawing::Hatch aUnoHatch
;
4037 rtl::OUString aName
;
4038 bool bHatch( false );
4040 if ( rVal
>>= aPropSeq
)
4042 for ( sal_Int32 n
= 0; n
< aPropSeq
.getLength(); n
++ )
4044 if ( aPropSeq
[n
].Name
== "Name" )
4045 aPropSeq
[n
].Value
>>= aName
;
4046 else if ( aPropSeq
[n
].Name
== "FillHatch" )
4048 if ( aPropSeq
[n
].Value
>>= aUnoHatch
)
4056 aHatch
.SetHatchStyle( (XHatchStyle
)aUnoHatch
.Style
);
4057 aHatch
.SetColor( aUnoHatch
.Color
);
4058 aHatch
.SetDistance( aUnoHatch
.Distance
);
4059 aHatch
.SetAngle( aUnoHatch
.Angle
);
4070 ::com::sun::star::drawing::Hatch aUnoHatch
;
4071 if(!(rVal
>>= aUnoHatch
))
4074 aHatch
.SetHatchStyle( (XHatchStyle
)aUnoHatch
.Style
);
4075 aHatch
.SetColor( aUnoHatch
.Color
);
4076 aHatch
.SetDistance( aUnoHatch
.Distance
);
4077 aHatch
.SetAngle( aUnoHatch
.Angle
);
4083 rtl::OUString aName
;
4084 if (!(rVal
>>= aName
))
4090 case MID_HATCH_STYLE
:
4092 sal_Int16 nVal
= sal_Int16();
4093 if (!(rVal
>>= nVal
))
4095 aHatch
.SetHatchStyle( (XHatchStyle
)nVal
);
4099 case MID_HATCH_COLOR
:
4100 case MID_HATCH_DISTANCE
:
4101 case MID_HATCH_ANGLE
:
4104 if (!(rVal
>>= nVal
))
4107 if ( nMemberId
== MID_HATCH_COLOR
)
4108 aHatch
.SetColor( nVal
);
4109 else if ( nMemberId
== MID_HATCH_DISTANCE
)
4110 aHatch
.SetDistance( nVal
);
4112 aHatch
.SetAngle( nVal
);
4116 default: OSL_FAIL("Wrong MemberId!"); return false;
4122 sal_Bool
XFillHatchItem::CompareValueFunc( const NameOrIndex
* p1
, const NameOrIndex
* p2
)
4124 return ((XFillHatchItem
*)p1
)->GetHatchValue() == ((XFillHatchItem
*)p2
)->GetHatchValue();
4127 XFillHatchItem
* XFillHatchItem::checkForUniqueItem( SdrModel
* pModel
) const
4131 const String aUniqueName
= NameOrIndex::CheckNamedItem(
4132 this, XATTR_FILLHATCH
, &pModel
->GetItemPool(),
4133 pModel
->GetStyleSheetPool() ? &pModel
->GetStyleSheetPool()->GetPool() : NULL
,
4134 XFillHatchItem::CompareValueFunc
, RID_SVXSTR_HATCH10
,
4135 pModel
->GetPropertyList( XHATCH_LIST
) );
4137 // if the given name is not valid, replace it!
4138 if( aUniqueName
!= GetName() )
4139 return new XFillHatchItem( aUniqueName
, aHatch
);
4142 return (XFillHatchItem
*)this;
4145 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4146 // FormText-Attribute
4147 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4149 //-------------------------
4150 // class XFormTextStyleItem
4151 //-------------------------
4152 TYPEINIT1_AUTOFACTORY(XFormTextStyleItem
, SfxEnumItem
);
4154 /*************************************************************************
4156 |* XFormTextStyleItem::XFormTextStyleItem()
4158 *************************************************************************/
4160 XFormTextStyleItem::XFormTextStyleItem(XFormTextStyle eTheStyle
) :
4161 SfxEnumItem(XATTR_FORMTXTSTYLE
, sal::static_int_cast
< sal_uInt16
>(eTheStyle
))
4165 /*************************************************************************
4167 |* XFormTextStyleItem::XFormTextStyleItem(SvStream& rIn)
4169 *************************************************************************/
4171 XFormTextStyleItem::XFormTextStyleItem(SvStream
& rIn
) :
4172 SfxEnumItem(XATTR_FORMTXTSTYLE
, rIn
)
4176 /*************************************************************************
4178 |* XFormTextStyleItem::Clone(SfxItemPool* pPool) const
4180 *************************************************************************/
4182 SfxPoolItem
* XFormTextStyleItem::Clone(SfxItemPool
* /*pPool*/) const
4184 return new XFormTextStyleItem( *this );
4187 /*************************************************************************
4189 |* SfxPoolItem* XFormTextStyleItem::Create(SvStream& rIn, sal_uInt16 nVer) const
4191 *************************************************************************/
4193 SfxPoolItem
* XFormTextStyleItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
4195 return new XFormTextStyleItem(rIn
);
4198 /*************************************************************************
4202 \*************************************************************************/
4204 sal_uInt16
XFormTextStyleItem::GetValueCount() const
4209 /*************************************************************************
4213 \*************************************************************************/
4216 bool XFormTextStyleItem::QueryValue( uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
4218 rVal
<<= (sal_Int32
)GetValue();
4222 /*************************************************************************
4226 \*************************************************************************/
4229 bool XFormTextStyleItem::PutValue( const uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
4231 sal_Int32 nValue
= 0;
4233 SetValue(sal::static_int_cast
< sal_uInt16
>(nValue
));
4238 //-------------------------
4239 // class XFormTextAdjustItem
4240 //-------------------------
4241 TYPEINIT1_AUTOFACTORY(XFormTextAdjustItem
, SfxEnumItem
);
4243 /*************************************************************************
4245 |* XFormTextAdjustItem::XFormTextAdjustItem()
4247 *************************************************************************/
4249 XFormTextAdjustItem::XFormTextAdjustItem(XFormTextAdjust eTheAdjust
) :
4250 SfxEnumItem(XATTR_FORMTXTADJUST
, sal::static_int_cast
< sal_uInt16
>(eTheAdjust
))
4254 /*************************************************************************
4256 |* XFormTextAdjustItem::XFormTextAdjustItem(SvStream& rIn)
4258 *************************************************************************/
4260 XFormTextAdjustItem::XFormTextAdjustItem(SvStream
& rIn
) :
4261 SfxEnumItem(XATTR_FORMTXTADJUST
, rIn
)
4265 /*************************************************************************
4267 |* XFormTextAdjustItem::Clone(SfxItemPool* pPool) const
4269 *************************************************************************/
4271 SfxPoolItem
* XFormTextAdjustItem::Clone(SfxItemPool
* /*pPool*/) const
4273 return new XFormTextAdjustItem( *this );
4276 /*************************************************************************
4278 |* SfxPoolItem* XFormTextAdjustItem::Create(SvStream& rIn, sal_uInt16 nVer) const
4280 *************************************************************************/
4282 SfxPoolItem
* XFormTextAdjustItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
4284 return new XFormTextAdjustItem(rIn
);
4287 /*************************************************************************
4291 \*************************************************************************/
4293 sal_uInt16
XFormTextAdjustItem::GetValueCount() const
4298 /*************************************************************************
4302 \*************************************************************************/
4305 bool XFormTextAdjustItem::QueryValue( uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
4307 rVal
<<= (sal_Int32
)GetValue();
4311 /*************************************************************************
4315 \*************************************************************************/
4318 bool XFormTextAdjustItem::PutValue( const uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
4320 sal_Int32 nValue
= 0;
4322 SetValue(sal::static_int_cast
< sal_uInt16
>(nValue
));
4327 //----------------------------
4328 // class XFormTextDistanceItem
4329 //----------------------------
4330 TYPEINIT1_AUTOFACTORY(XFormTextDistanceItem
, SfxMetricItem
);
4332 /*************************************************************************
4334 |* XFormTextDistanceItem::XFormTextDistanceItem()
4336 *************************************************************************/
4338 XFormTextDistanceItem::XFormTextDistanceItem(long nDist
) :
4339 SfxMetricItem(XATTR_FORMTXTDISTANCE
, nDist
)
4343 /*************************************************************************
4345 |* XFormTextDistanceItem::XFormTextDistanceItem(SvStream& rIn)
4347 *************************************************************************/
4349 XFormTextDistanceItem::XFormTextDistanceItem(SvStream
& rIn
) :
4350 SfxMetricItem(XATTR_FORMTXTDISTANCE
, rIn
)
4354 /*************************************************************************
4356 |* XFormTextDistanceItem::Clone(SfxItemPool* pPool) const
4358 *************************************************************************/
4360 SfxPoolItem
* XFormTextDistanceItem::Clone(SfxItemPool
* /*pPool*/) const
4362 return new XFormTextDistanceItem(*this);
4365 /*************************************************************************
4367 |* SfxPoolItem* XFormTextDistanceItem::Create(SvStream& rIn, sal_uInt16 nVer) const
4369 *************************************************************************/
4371 SfxPoolItem
* XFormTextDistanceItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
4373 return new XFormTextDistanceItem(rIn
);
4376 //-------------------------
4377 // class XFormTextStartItem
4378 //-------------------------
4379 TYPEINIT1_AUTOFACTORY(XFormTextStartItem
, SfxMetricItem
);
4381 /*************************************************************************
4383 |* XFormTextStartItem::XFormTextStartItem(long nStart)
4385 *************************************************************************/
4387 XFormTextStartItem::XFormTextStartItem(long nStart
) :
4388 SfxMetricItem(XATTR_FORMTXTSTART
, nStart
)
4392 /*************************************************************************
4394 |* XFormTextStartItem::XFormTextStartItem(SvStream& rIn)
4396 *************************************************************************/
4398 XFormTextStartItem::XFormTextStartItem(SvStream
& rIn
) :
4399 SfxMetricItem(XATTR_FORMTXTSTART
, rIn
)
4403 /*************************************************************************
4405 |* XFormTextStartItem::Clone(SfxItemPool* pPool) const
4407 *************************************************************************/
4409 SfxPoolItem
* XFormTextStartItem::Clone(SfxItemPool
* /*pPool*/) const
4411 return new XFormTextStartItem(*this);
4414 /*************************************************************************
4416 |* SfxPoolItem* XFormTextStartItem::Create(SvStream& rIn, sal_uInt16 nVer) const
4418 *************************************************************************/
4420 SfxPoolItem
* XFormTextStartItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
4422 return new XFormTextStartItem(rIn
);
4425 // -------------------------
4426 // class XFormTextMirrorItem
4427 // -------------------------
4428 TYPEINIT1_AUTOFACTORY(XFormTextMirrorItem
, SfxBoolItem
);
4430 /*************************************************************************
4432 |* XFormTextMirrorItem::XFormTextMirrorItem(sal_Bool bMirror)
4434 *************************************************************************/
4436 XFormTextMirrorItem::XFormTextMirrorItem(sal_Bool bMirror
) :
4437 SfxBoolItem(XATTR_FORMTXTMIRROR
, bMirror
)
4441 /*************************************************************************
4443 |* XFormTextMirrorItem::XFormTextMirrorItem(SvStream& rIn)
4445 *************************************************************************/
4447 XFormTextMirrorItem::XFormTextMirrorItem(SvStream
& rIn
) :
4448 SfxBoolItem(XATTR_FORMTXTMIRROR
, rIn
)
4452 /*************************************************************************
4454 |* XFormTextMirrorItem::Clone(SfxItemPool* pPool) const
4456 *************************************************************************/
4458 SfxPoolItem
* XFormTextMirrorItem::Clone(SfxItemPool
* /*pPool*/) const
4460 return new XFormTextMirrorItem(*this);
4463 /*************************************************************************
4465 |* SfxPoolItem* XFormTextMirrorItem::Create(SvStream& rIn, sal_uInt16 nVer)
4468 *************************************************************************/
4470 SfxPoolItem
* XFormTextMirrorItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
4472 return new XFormTextMirrorItem(rIn
);
4476 // --------------------------
4477 // class XFormTextOutlineItem
4478 // --------------------------
4479 TYPEINIT1_AUTOFACTORY(XFormTextOutlineItem
, SfxBoolItem
);
4481 /*************************************************************************
4483 |* XFormTextOutlineItem::XFormTextOutlineItem()
4485 *************************************************************************/
4487 XFormTextOutlineItem::XFormTextOutlineItem(sal_Bool bOutline
) :
4488 SfxBoolItem(XATTR_FORMTXTOUTLINE
, bOutline
)
4492 /*************************************************************************
4494 |* XFormTextOutlineItem::XFormTextOutlineItem(SvStream& rIn)
4496 *************************************************************************/
4498 XFormTextOutlineItem::XFormTextOutlineItem(SvStream
& rIn
) :
4499 SfxBoolItem(XATTR_FORMTXTOUTLINE
, rIn
)
4503 /*************************************************************************
4505 |* XFormTextOutlineItem::Clone(SfxItemPool* pPool) const
4507 *************************************************************************/
4509 SfxPoolItem
* XFormTextOutlineItem::Clone(SfxItemPool
* /*pPool*/) const
4511 return new XFormTextOutlineItem(*this);
4514 /*************************************************************************
4516 |* SfxPoolItem* XFormTextOutlineItem::Create(SvStream& rIn, sal_uInt16 nVer)
4519 *************************************************************************/
4521 SfxPoolItem
* XFormTextOutlineItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
4523 return new XFormTextOutlineItem(rIn
);
4526 //--------------------------
4527 // class XFormTextShadowItem
4528 //--------------------------
4529 TYPEINIT1_AUTOFACTORY(XFormTextShadowItem
, SfxEnumItem
);
4531 /*************************************************************************
4533 |* XFormTextShadowItem::XFormTextShadowItem()
4535 *************************************************************************/
4537 XFormTextShadowItem::XFormTextShadowItem(XFormTextShadow eFormTextShadow
) :
4539 XATTR_FORMTXTSHADOW
, sal::static_int_cast
< sal_uInt16
>(eFormTextShadow
))
4543 /*************************************************************************
4545 |* XFormTextShadowItem::XFormTextShadowItem(SvStream& rIn)
4547 *************************************************************************/
4549 XFormTextShadowItem::XFormTextShadowItem(SvStream
& rIn
) :
4550 SfxEnumItem(XATTR_FORMTXTSHADOW
, rIn
)
4554 /*************************************************************************
4556 |* XFormTextShadowItem::Clone(SfxItemPool* pPool) const
4558 *************************************************************************/
4560 SfxPoolItem
* XFormTextShadowItem::Clone(SfxItemPool
* /*pPool*/) const
4562 return new XFormTextShadowItem( *this );
4565 /*************************************************************************
4567 |* SfxPoolItem* XFormTextShadowItem::Create(SvStream& rIn, sal_uInt16 nVer) const
4569 *************************************************************************/
4571 SfxPoolItem
* XFormTextShadowItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
4573 return new XFormTextShadowItem(rIn
);
4577 /*************************************************************************
4581 \*************************************************************************/
4583 sal_uInt16
XFormTextShadowItem::GetValueCount() const
4588 /*************************************************************************
4592 \*************************************************************************/
4595 bool XFormTextShadowItem::QueryValue( uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
4597 rVal
<<= (sal_Int32
)GetValue();
4601 /*************************************************************************
4605 \*************************************************************************/
4608 bool XFormTextShadowItem::PutValue( const uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
4610 sal_Int32 nValue
= 0;
4612 SetValue(sal::static_int_cast
< sal_uInt16
>(nValue
));
4617 // -------------------------------
4618 // class XFormTextShadowColorItem
4619 // -------------------------------
4620 TYPEINIT1_AUTOFACTORY(XFormTextShadowColorItem
, XColorItem
);
4622 /*************************************************************************
4624 |* XFormTextShadowColorItem::XFormTextShadowColorItem(const XubString& rName, const Color& rTheColor)
4626 *************************************************************************/
4628 XFormTextShadowColorItem::XFormTextShadowColorItem(const XubString
& rName
,
4629 const Color
& rTheColor
) :
4630 XColorItem(XATTR_FORMTXTSHDWCOLOR
, rName
, rTheColor
)
4634 /*************************************************************************
4636 |* XFormTextShadowColorItem::XFormTextShadowColorItem(SvStream& rIn)
4638 *************************************************************************/
4640 XFormTextShadowColorItem::XFormTextShadowColorItem(SvStream
& rIn
) :
4641 XColorItem(XATTR_FORMTXTSHDWCOLOR
, rIn
)
4645 /*************************************************************************
4647 |* XFormTextShadowColorItem::Clone(SfxItemPool* pPool) const
4649 *************************************************************************/
4651 SfxPoolItem
* XFormTextShadowColorItem::Clone(SfxItemPool
* /*pPool*/) const
4653 return new XFormTextShadowColorItem(*this);
4656 /*************************************************************************
4658 |* SfxPoolItem* XFormTextShadowColorItem::Create(SvStream& rIn, sal_uInt16 nVer) const
4660 *************************************************************************/
4662 SfxPoolItem
* XFormTextShadowColorItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
4664 return new XFormTextShadowColorItem(rIn
);
4667 //------------------------------
4668 // class XFormTextShadowXValItem
4669 //------------------------------
4670 TYPEINIT1_AUTOFACTORY(XFormTextShadowXValItem
, SfxMetricItem
);
4672 /*************************************************************************
4674 |* XFormTextShadowXValItem::XFormTextShadowXValItem(long)
4676 *************************************************************************/
4678 XFormTextShadowXValItem::XFormTextShadowXValItem(long nVal
) :
4679 SfxMetricItem(XATTR_FORMTXTSHDWXVAL
, nVal
)
4683 /*************************************************************************
4685 |* XFormTextShadowXValItem::XFormTextShadowXValItem(SvStream& rIn)
4687 *************************************************************************/
4689 XFormTextShadowXValItem::XFormTextShadowXValItem(SvStream
& rIn
) :
4690 SfxMetricItem(XATTR_FORMTXTSHDWXVAL
, rIn
)
4694 /*************************************************************************
4696 |* XFormTextShadowXValItem::Clone(SfxItemPool* pPool) const
4698 *************************************************************************/
4700 SfxPoolItem
* XFormTextShadowXValItem::Clone(SfxItemPool
* /*pPool*/) const
4702 return new XFormTextShadowXValItem(*this);
4705 /*************************************************************************
4707 |* SfxPoolItem* XFormTextShadowXValItem::Create(SvStream& rIn, sal_uInt16 nVer) const
4709 *************************************************************************/
4711 SfxPoolItem
* XFormTextShadowXValItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
4713 return new XFormTextShadowXValItem(rIn
);
4716 //------------------------------
4717 // class XFormTextShadowYValItem
4718 //------------------------------
4719 TYPEINIT1_AUTOFACTORY(XFormTextShadowYValItem
, SfxMetricItem
);
4721 /*************************************************************************
4723 |* XFormTextShadowYValItem::XFormTextShadowYValItem(long)
4725 *************************************************************************/
4727 XFormTextShadowYValItem::XFormTextShadowYValItem(long nVal
) :
4728 SfxMetricItem(XATTR_FORMTXTSHDWYVAL
, nVal
)
4732 /*************************************************************************
4734 |* XFormTextShadowYValItem::XFormTextShadowYValItem(SvStream& rIn)
4736 *************************************************************************/
4738 XFormTextShadowYValItem::XFormTextShadowYValItem(SvStream
& rIn
) :
4739 SfxMetricItem(XATTR_FORMTXTSHDWYVAL
, rIn
)
4743 /*************************************************************************
4745 |* XFormTextShadowYValItem::Clone(SfxItemPool* pPool) const
4747 *************************************************************************/
4749 SfxPoolItem
* XFormTextShadowYValItem::Clone(SfxItemPool
* /*pPool*/) const
4751 return new XFormTextShadowYValItem(*this);
4754 /*************************************************************************
4756 |* SfxPoolItem* XFormTextShadowYValItem::Create(SvStream& rIn, sal_uInt16 nVer) const
4758 *************************************************************************/
4760 SfxPoolItem
* XFormTextShadowYValItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
4762 return new XFormTextShadowYValItem(rIn
);
4765 //---------------------------
4766 // class XFormTextStdFormItem
4767 //---------------------------
4768 TYPEINIT1_AUTOFACTORY(XFormTextStdFormItem
, SfxEnumItem
);
4770 /*************************************************************************
4772 |* XFormTextStdFormItem::XFormTextStdFormItem()
4774 *************************************************************************/
4776 XFormTextStdFormItem::XFormTextStdFormItem(XFormTextStdForm eFormTextStdForm
) :
4778 XATTR_FORMTXTSTDFORM
, sal::static_int_cast
< sal_uInt16
>(eFormTextStdForm
))
4782 /*************************************************************************
4784 |* XFormTextStdFormItem::XFormTextStdFormItem(SvStream& rIn)
4786 *************************************************************************/
4788 XFormTextStdFormItem::XFormTextStdFormItem(SvStream
& rIn
) :
4789 SfxEnumItem(XATTR_FORMTXTSTDFORM
, rIn
)
4793 /*************************************************************************
4795 |* XFormTextStdFormItem::Clone(SfxItemPool* pPool) const
4797 *************************************************************************/
4799 SfxPoolItem
* XFormTextStdFormItem::Clone(SfxItemPool
* /*pPool*/) const
4801 return new XFormTextStdFormItem( *this );
4804 /*************************************************************************
4806 |* SfxPoolItem* XFormTextStdFormItem::Create(SvStream& rIn, sal_uInt16 nVer) const
4808 *************************************************************************/
4810 SfxPoolItem
* XFormTextStdFormItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
4812 return new XFormTextStdFormItem(rIn
);
4816 /*************************************************************************
4820 \*************************************************************************/
4822 sal_uInt16
XFormTextStdFormItem::GetValueCount() const
4827 /*************************************************************************
4831 \*************************************************************************/
4834 bool XFormTextStdFormItem::QueryValue( uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
4836 rVal
<<= (sal_Int32
)GetValue();
4840 /*************************************************************************
4844 \*************************************************************************/
4847 bool XFormTextStdFormItem::PutValue( const uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
4849 sal_Int32 nValue
= 0;
4851 SetValue(sal::static_int_cast
< sal_uInt16
>(nValue
));
4856 // --------------------------
4857 // class XFormTextHideFormItem
4858 // --------------------------
4859 TYPEINIT1_AUTOFACTORY(XFormTextHideFormItem
, SfxBoolItem
);
4861 /*************************************************************************
4863 |* XFormTextHideFormItem::XFormTextHideFormItem()
4865 *************************************************************************/
4867 XFormTextHideFormItem::XFormTextHideFormItem(sal_Bool bHide
) :
4868 SfxBoolItem(XATTR_FORMTXTHIDEFORM
, bHide
)
4872 /*************************************************************************
4874 |* XFormTextHideFormItem::XFormTextHideFormItem(SvStream& rIn)
4876 *************************************************************************/
4878 XFormTextHideFormItem::XFormTextHideFormItem(SvStream
& rIn
) :
4879 SfxBoolItem(XATTR_FORMTXTHIDEFORM
, rIn
)
4883 /*************************************************************************
4885 |* XFormTextHideFormItem::Clone(SfxItemPool* pPool) const
4887 *************************************************************************/
4889 SfxPoolItem
* XFormTextHideFormItem::Clone(SfxItemPool
* /*pPool*/) const
4891 return new XFormTextHideFormItem(*this);
4894 /*************************************************************************
4896 |* SfxPoolItem* XFormTextHideFormItem::Create(SvStream& rIn, sal_uInt16 nVer)
4899 *************************************************************************/
4901 SfxPoolItem
* XFormTextHideFormItem::Create(SvStream
& rIn
, sal_uInt16
/*nVer*/) const
4903 return new XFormTextHideFormItem(rIn
);
4908 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4910 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4912 TYPEINIT1(XLineAttrSetItem
, SfxSetItem
);
4914 /*************************************************************************
4916 |* Konstruktoren fuer Linienattribute-SetItem
4918 \************************************************************************/
4920 XLineAttrSetItem::XLineAttrSetItem( SfxItemSet
* pItemSet
) :
4921 SfxSetItem( XATTRSET_LINE
, pItemSet
)
4925 /************************************************************************/
4927 XLineAttrSetItem::XLineAttrSetItem( SfxItemPool
* pItemPool
) :
4928 SfxSetItem( XATTRSET_LINE
,
4929 new SfxItemSet( *pItemPool
, XATTR_LINE_FIRST
, XATTR_LINE_LAST
))
4933 /************************************************************************/
4935 XLineAttrSetItem::XLineAttrSetItem( const XLineAttrSetItem
& rLineAttr
) :
4936 SfxSetItem( rLineAttr
)
4940 /************************************************************************/
4942 XLineAttrSetItem::XLineAttrSetItem( const XLineAttrSetItem
& rLineAttr
,
4943 SfxItemPool
* pItemPool
) :
4944 SfxSetItem( rLineAttr
, pItemPool
)
4948 /*************************************************************************
4952 \************************************************************************/
4954 SfxPoolItem
* XLineAttrSetItem::Clone( SfxItemPool
* pPool
) const
4956 return new XLineAttrSetItem( *this, pPool
);
4959 /*************************************************************************
4961 |* SetItem aus Stream erzeugen
4963 \************************************************************************/
4965 SfxPoolItem
* XLineAttrSetItem::Create( SvStream
& rStream
, sal_uInt16
/*nVersion*/) const
4967 SfxItemSet
*pSet2
= new SfxItemSet( *GetItemSet().GetPool(),
4968 XATTR_LINE_FIRST
, XATTR_LINE_LAST
);
4969 pSet2
->Load( rStream
);
4970 return new XLineAttrSetItem( pSet2
);
4973 /*************************************************************************
4975 |* SetItem in Stream speichern
4977 \************************************************************************/
4979 SvStream
& XLineAttrSetItem::Store( SvStream
& rStream
, sal_uInt16 nItemVersion
) const
4981 return SfxSetItem::Store( rStream
, nItemVersion
);
4985 TYPEINIT1(XFillAttrSetItem
, SfxSetItem
);
4987 /*************************************************************************
4989 |* Konstruktoren fuer Fuellattribute-SetItem
4991 \************************************************************************/
4993 XFillAttrSetItem::XFillAttrSetItem( SfxItemSet
* pItemSet
) :
4994 SfxSetItem( XATTRSET_FILL
, pItemSet
)
4998 /************************************************************************/
5000 XFillAttrSetItem::XFillAttrSetItem( SfxItemPool
* pItemPool
) :
5001 SfxSetItem( XATTRSET_FILL
,
5002 new SfxItemSet( *pItemPool
, XATTR_FILL_FIRST
, XATTR_FILL_LAST
))
5006 /************************************************************************/
5008 XFillAttrSetItem::XFillAttrSetItem( const XFillAttrSetItem
& rFillAttr
) :
5009 SfxSetItem( rFillAttr
)
5013 /************************************************************************/
5015 XFillAttrSetItem::XFillAttrSetItem( const XFillAttrSetItem
& rFillAttr
,
5016 SfxItemPool
* pItemPool
) :
5017 SfxSetItem( rFillAttr
, pItemPool
)
5021 /*************************************************************************
5025 \************************************************************************/
5027 SfxPoolItem
* XFillAttrSetItem::Clone( SfxItemPool
* pPool
) const
5029 return new XFillAttrSetItem( *this, pPool
);
5032 /*************************************************************************
5034 |* SetItem aus Stream erzeugen
5036 \************************************************************************/
5038 SfxPoolItem
* XFillAttrSetItem::Create( SvStream
& rStream
, sal_uInt16
/*nVersion*/) const
5040 SfxItemSet
*pSet2
= new SfxItemSet( *GetItemSet().GetPool(),
5041 XATTR_FILL_FIRST
, XATTR_FILL_LAST
);
5042 pSet2
->Load( rStream
);
5043 return new XFillAttrSetItem( pSet2
);
5046 /*************************************************************************
5048 |* SetItem in Stream speichern
5050 \************************************************************************/
5052 SvStream
& XFillAttrSetItem::Store( SvStream
& rStream
, sal_uInt16 nItemVersion
) const
5054 return SfxSetItem::Store( rStream
, nItemVersion
);
5059 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */