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