1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_svx.hxx"
30*cdf0e10cSrcweir #include <svx/sdasitm.hxx>
31*cdf0e10cSrcweir #include <svx/svdattr.hxx>
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir using namespace ::std;
34*cdf0e10cSrcweir using namespace com::sun::star;
35*cdf0e10cSrcweir 
36*cdf0e10cSrcweir SdrCustomShapeEngineItem::SdrCustomShapeEngineItem()
37*cdf0e10cSrcweir :	SfxStringItem( SDRATTR_CUSTOMSHAPE_ENGINE, String() )
38*cdf0e10cSrcweir {}
39*cdf0e10cSrcweir SdrCustomShapeEngineItem::SdrCustomShapeEngineItem( const String& rVal )
40*cdf0e10cSrcweir :	SfxStringItem( SDRATTR_CUSTOMSHAPE_ENGINE, rVal )
41*cdf0e10cSrcweir {}
42*cdf0e10cSrcweir 
43*cdf0e10cSrcweir SdrCustomShapeDataItem::SdrCustomShapeDataItem()
44*cdf0e10cSrcweir :	SfxStringItem( SDRATTR_CUSTOMSHAPE_DATA, String() )
45*cdf0e10cSrcweir {}
46*cdf0e10cSrcweir SdrCustomShapeDataItem::SdrCustomShapeDataItem( const String& rVal )
47*cdf0e10cSrcweir :	SfxStringItem( SDRATTR_CUSTOMSHAPE_DATA, rVal )
48*cdf0e10cSrcweir {}
49*cdf0e10cSrcweir 
50*cdf0e10cSrcweir bool SdrCustomShapeGeometryItem::PropertyEq::operator()( const rtl::OUString& r1, const rtl::OUString& r2 ) const
51*cdf0e10cSrcweir {
52*cdf0e10cSrcweir 	return r1.equals( r2 );
53*cdf0e10cSrcweir }
54*cdf0e10cSrcweir bool SdrCustomShapeGeometryItem::PropertyPairEq::operator()( const SdrCustomShapeGeometryItem::PropertyPair& r1, const SdrCustomShapeGeometryItem::PropertyPair& r2 ) const
55*cdf0e10cSrcweir {
56*cdf0e10cSrcweir 	return ( r1.first.equals( r2.first ) ) && ( r1.second.equals( r2.second ) );
57*cdf0e10cSrcweir }
58*cdf0e10cSrcweir size_t SdrCustomShapeGeometryItem::PropertyPairHash::operator()( const SdrCustomShapeGeometryItem::PropertyPair &r1 ) const
59*cdf0e10cSrcweir {
60*cdf0e10cSrcweir 	return (size_t)r1.first.hashCode() + r1.second.hashCode();
61*cdf0e10cSrcweir };
62*cdf0e10cSrcweir 
63*cdf0e10cSrcweir TYPEINIT1_FACTORY( SdrCustomShapeGeometryItem, SfxPoolItem , new  SdrCustomShapeGeometryItem);
64*cdf0e10cSrcweir SdrCustomShapeGeometryItem::SdrCustomShapeGeometryItem()
65*cdf0e10cSrcweir :	SfxPoolItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )
66*cdf0e10cSrcweir {}
67*cdf0e10cSrcweir SdrCustomShapeGeometryItem::SdrCustomShapeGeometryItem( const uno::Sequence< beans::PropertyValue >& rVal )
68*cdf0e10cSrcweir :	SfxPoolItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )
69*cdf0e10cSrcweir {
70*cdf0e10cSrcweir 	sal_Int32 i, j;
71*cdf0e10cSrcweir 	aPropSeq = rVal;
72*cdf0e10cSrcweir 
73*cdf0e10cSrcweir 	// hashing property values
74*cdf0e10cSrcweir //  beans::PropertyValue* pPropValues = aPropSeq.getArray();
75*cdf0e10cSrcweir //  const rtl::OUString* pPtr = NULL;
76*cdf0e10cSrcweir 	for ( i = 0; i < aPropSeq.getLength(); i++ )
77*cdf0e10cSrcweir 	{
78*cdf0e10cSrcweir 		beans::PropertyValue& rPropVal = aPropSeq[ i ];
79*cdf0e10cSrcweir 		aPropHashMap[ rPropVal.Name ] = i;
80*cdf0e10cSrcweir 		if ( rPropVal.Value.getValueType() == ::getCppuType((const ::com::sun::star::uno::Sequence < beans::PropertyValue >*)0) )
81*cdf0e10cSrcweir 		{
82*cdf0e10cSrcweir 			uno::Sequence< beans::PropertyValue >& rPropSeq = *( uno::Sequence< beans::PropertyValue >*)rPropVal.Value.getValue();
83*cdf0e10cSrcweir 			for ( j = 0; j < rPropSeq.getLength(); j++ )
84*cdf0e10cSrcweir 			{
85*cdf0e10cSrcweir 				beans::PropertyValue& rPropVal2 = rPropSeq[ j ];
86*cdf0e10cSrcweir 				aPropPairHashMap[ PropertyPair( rPropVal.Name, rPropVal2.Name ) ] = j;
87*cdf0e10cSrcweir 			}
88*cdf0e10cSrcweir 		}
89*cdf0e10cSrcweir 	}
90*cdf0e10cSrcweir }
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir com::sun::star::uno::Any* SdrCustomShapeGeometryItem::GetPropertyValueByName( const rtl::OUString& rPropName )
93*cdf0e10cSrcweir {
94*cdf0e10cSrcweir 	com::sun::star::uno::Any* pRet = NULL;
95*cdf0e10cSrcweir 	PropertyHashMap::iterator aHashIter( aPropHashMap.find( rPropName ) );
96*cdf0e10cSrcweir 	if ( aHashIter != aPropHashMap.end() )
97*cdf0e10cSrcweir 		pRet = &aPropSeq[ (*aHashIter).second ].Value;
98*cdf0e10cSrcweir 	return pRet;
99*cdf0e10cSrcweir }
100*cdf0e10cSrcweir 
101*cdf0e10cSrcweir com::sun::star::uno::Any* SdrCustomShapeGeometryItem::GetPropertyValueByName( const rtl::OUString& rSequenceName, const rtl::OUString& rPropName )
102*cdf0e10cSrcweir {
103*cdf0e10cSrcweir 	com::sun::star::uno::Any* pRet = NULL;
104*cdf0e10cSrcweir 	com::sun::star::uno::Any* pSeqAny = GetPropertyValueByName( rSequenceName );
105*cdf0e10cSrcweir 	if ( pSeqAny )
106*cdf0e10cSrcweir 	{
107*cdf0e10cSrcweir 		if ( pSeqAny->getValueType() == ::getCppuType((const ::com::sun::star::uno::Sequence < beans::PropertyValue >*)0) )
108*cdf0e10cSrcweir 		{
109*cdf0e10cSrcweir 			PropertyPairHashMap::iterator aHashIter( aPropPairHashMap.find( PropertyPair( rSequenceName, rPropName ) ) );
110*cdf0e10cSrcweir 			if ( aHashIter != aPropPairHashMap.end() )
111*cdf0e10cSrcweir 			{
112*cdf0e10cSrcweir 				::com::sun::star::uno::Sequence < beans::PropertyValue >& rSecSequence =
113*cdf0e10cSrcweir 					*((::com::sun::star::uno::Sequence < beans::PropertyValue >*)pSeqAny->getValue());
114*cdf0e10cSrcweir 				pRet = &rSecSequence[ (*aHashIter).second ].Value;
115*cdf0e10cSrcweir 			}
116*cdf0e10cSrcweir 		}
117*cdf0e10cSrcweir 	}
118*cdf0e10cSrcweir 	return pRet;
119*cdf0e10cSrcweir }
120*cdf0e10cSrcweir 
121*cdf0e10cSrcweir void SdrCustomShapeGeometryItem::SetPropertyValue( const com::sun::star::beans::PropertyValue& rPropVal )
122*cdf0e10cSrcweir {
123*cdf0e10cSrcweir 	com::sun::star::uno::Any* pAny = GetPropertyValueByName( rPropVal.Name );
124*cdf0e10cSrcweir 	if ( pAny )
125*cdf0e10cSrcweir 	{	// property is already available
126*cdf0e10cSrcweir 		sal_Int32 i;
127*cdf0e10cSrcweir 		if ( pAny->getValueType() == ::getCppuType((const ::com::sun::star::uno::Sequence < beans::PropertyValue >*)0) )
128*cdf0e10cSrcweir 		{	// old property is a sequence->each entry has to be removed from the HashPairMap
129*cdf0e10cSrcweir 			::com::sun::star::uno::Sequence < beans::PropertyValue >& rSecSequence =
130*cdf0e10cSrcweir 				*((::com::sun::star::uno::Sequence < beans::PropertyValue >*)pAny->getValue());
131*cdf0e10cSrcweir 			for ( i = 0; i < rSecSequence.getLength(); i++ )
132*cdf0e10cSrcweir 			{
133*cdf0e10cSrcweir 				PropertyPairHashMap::iterator aHashIter( aPropPairHashMap.find( PropertyPair( rPropVal.Name, rSecSequence[ i ].Name ) ) );
134*cdf0e10cSrcweir 				if ( aHashIter != aPropPairHashMap.end() )
135*cdf0e10cSrcweir 					aPropPairHashMap.erase( aHashIter );
136*cdf0e10cSrcweir 			}
137*cdf0e10cSrcweir 		}
138*cdf0e10cSrcweir 		*pAny = rPropVal.Value;
139*cdf0e10cSrcweir 		if ( rPropVal.Value.getValueType() == ::getCppuType((const ::com::sun::star::uno::Sequence < beans::PropertyValue >*)0) )
140*cdf0e10cSrcweir 		{	// the new property is a sequence->each entry has to be inserted into the HashPairMap
141*cdf0e10cSrcweir 			::com::sun::star::uno::Sequence < beans::PropertyValue >& rSecSequence =
142*cdf0e10cSrcweir 				*((::com::sun::star::uno::Sequence < beans::PropertyValue >*)pAny->getValue());
143*cdf0e10cSrcweir 			for ( i = 0; i < rSecSequence.getLength(); i++ )
144*cdf0e10cSrcweir 			{
145*cdf0e10cSrcweir 				beans::PropertyValue& rPropVal2 = rSecSequence[ i ];
146*cdf0e10cSrcweir 				aPropPairHashMap[ PropertyPair( rPropVal.Name, rPropVal2.Name ) ] = i;
147*cdf0e10cSrcweir 			}
148*cdf0e10cSrcweir 		}
149*cdf0e10cSrcweir 	}
150*cdf0e10cSrcweir 	else
151*cdf0e10cSrcweir 	{	// its a new property
152*cdf0e10cSrcweir 		sal_uInt32 nIndex = aPropSeq.getLength();
153*cdf0e10cSrcweir 		aPropSeq.realloc( nIndex + 1 );
154*cdf0e10cSrcweir 		aPropSeq[ nIndex ] = rPropVal ;
155*cdf0e10cSrcweir 
156*cdf0e10cSrcweir 		aPropHashMap[ rPropVal.Name ] = nIndex;
157*cdf0e10cSrcweir 	}
158*cdf0e10cSrcweir }
159*cdf0e10cSrcweir 
160*cdf0e10cSrcweir void SdrCustomShapeGeometryItem::SetPropertyValue( const rtl::OUString& rSequenceName, const com::sun::star::beans::PropertyValue& rPropVal )
161*cdf0e10cSrcweir {
162*cdf0e10cSrcweir 	com::sun::star::uno::Any* pAny = GetPropertyValueByName( rSequenceName, rPropVal.Name );
163*cdf0e10cSrcweir 	if ( pAny )	// just replacing
164*cdf0e10cSrcweir 		*pAny = rPropVal.Value;
165*cdf0e10cSrcweir 	else
166*cdf0e10cSrcweir 	{
167*cdf0e10cSrcweir 		com::sun::star::uno::Any* pSeqAny = GetPropertyValueByName( rSequenceName );
168*cdf0e10cSrcweir 		if( pSeqAny == NULL )
169*cdf0e10cSrcweir 		{
170*cdf0e10cSrcweir 			::com::sun::star::uno::Sequence < beans::PropertyValue > aSeq;
171*cdf0e10cSrcweir 			beans::PropertyValue aValue;
172*cdf0e10cSrcweir 			aValue.Name = rSequenceName;
173*cdf0e10cSrcweir 			aValue.Value = ::com::sun::star::uno::makeAny( aSeq );
174*cdf0e10cSrcweir 
175*cdf0e10cSrcweir 			sal_uInt32 nIndex = aPropSeq.getLength();
176*cdf0e10cSrcweir 			aPropSeq.realloc( nIndex + 1 );
177*cdf0e10cSrcweir 			aPropSeq[ nIndex ] = aValue;
178*cdf0e10cSrcweir 			aPropHashMap[ rSequenceName ] = nIndex;
179*cdf0e10cSrcweir 
180*cdf0e10cSrcweir 			pSeqAny = &aPropSeq[ nIndex ].Value;
181*cdf0e10cSrcweir 		}
182*cdf0e10cSrcweir 
183*cdf0e10cSrcweir 		DBG_ASSERT( pSeqAny, "SdrCustomShapeGeometryItem::SetPropertyValue() - No Value??" );
184*cdf0e10cSrcweir 
185*cdf0e10cSrcweir 		if( pSeqAny )
186*cdf0e10cSrcweir 		{
187*cdf0e10cSrcweir 			if ( pSeqAny->getValueType() == ::getCppuType((const ::com::sun::star::uno::Sequence < beans::PropertyValue >*)0) )
188*cdf0e10cSrcweir 			{
189*cdf0e10cSrcweir 				PropertyPairHashMap::iterator aHashIter( aPropPairHashMap.find( PropertyPair( rSequenceName, rPropVal.Name ) ) );
190*cdf0e10cSrcweir 				if ( aHashIter != aPropPairHashMap.end() )
191*cdf0e10cSrcweir 				{
192*cdf0e10cSrcweir 					::com::sun::star::uno::Sequence < beans::PropertyValue >& rSecSequence =
193*cdf0e10cSrcweir 						*((::com::sun::star::uno::Sequence < beans::PropertyValue >*)pSeqAny->getValue());
194*cdf0e10cSrcweir 					rSecSequence[ (*aHashIter).second ].Value = rPropVal.Value;
195*cdf0e10cSrcweir 				}
196*cdf0e10cSrcweir 				else
197*cdf0e10cSrcweir 				{
198*cdf0e10cSrcweir 					::com::sun::star::uno::Sequence < beans::PropertyValue >& rSecSequence =
199*cdf0e10cSrcweir 						*((::com::sun::star::uno::Sequence < beans::PropertyValue >*)pSeqAny->getValue());
200*cdf0e10cSrcweir 
201*cdf0e10cSrcweir 					sal_Int32 nCount = rSecSequence.getLength();
202*cdf0e10cSrcweir 					rSecSequence.realloc( nCount + 1 );
203*cdf0e10cSrcweir 					rSecSequence[ nCount ] = rPropVal;
204*cdf0e10cSrcweir 
205*cdf0e10cSrcweir 					aPropPairHashMap[ PropertyPair( rSequenceName, rPropVal.Name ) ] = nCount;
206*cdf0e10cSrcweir 				}
207*cdf0e10cSrcweir 			}
208*cdf0e10cSrcweir 		}
209*cdf0e10cSrcweir 	}
210*cdf0e10cSrcweir }
211*cdf0e10cSrcweir 
212*cdf0e10cSrcweir void SdrCustomShapeGeometryItem::ClearPropertyValue( const rtl::OUString& rPropName )
213*cdf0e10cSrcweir {
214*cdf0e10cSrcweir 	if ( aPropSeq.getLength() )
215*cdf0e10cSrcweir 	{
216*cdf0e10cSrcweir 		PropertyHashMap::iterator aHashIter( aPropHashMap.find( rPropName ) );
217*cdf0e10cSrcweir 		if ( aHashIter != aPropHashMap.end() )
218*cdf0e10cSrcweir 		{
219*cdf0e10cSrcweir  			com::sun::star::uno::Any* pSeqAny = &aPropSeq[ (*aHashIter).second ].Value;
220*cdf0e10cSrcweir 			if ( pSeqAny )
221*cdf0e10cSrcweir 			{
222*cdf0e10cSrcweir 				if ( pSeqAny->getValueType() == ::getCppuType((const ::com::sun::star::uno::Sequence < beans::PropertyValue >*)0) )
223*cdf0e10cSrcweir 				{
224*cdf0e10cSrcweir 					::com::sun::star::uno::Sequence < beans::PropertyValue >& rSecSequence =
225*cdf0e10cSrcweir 						*((::com::sun::star::uno::Sequence < beans::PropertyValue >*)pSeqAny->getValue());
226*cdf0e10cSrcweir 
227*cdf0e10cSrcweir 					sal_Int32 i;
228*cdf0e10cSrcweir 					for ( i = 0; i < rSecSequence.getLength(); i++ )
229*cdf0e10cSrcweir 					{
230*cdf0e10cSrcweir                         PropertyPairHashMap::iterator _aHashIter( aPropPairHashMap.find( PropertyPair( rPropName, rSecSequence[ i ].Name ) ) );
231*cdf0e10cSrcweir                         if ( _aHashIter != aPropPairHashMap.end() )
232*cdf0e10cSrcweir                             aPropPairHashMap.erase( _aHashIter );       // removing property from pair hashmap
233*cdf0e10cSrcweir 					}
234*cdf0e10cSrcweir 				}
235*cdf0e10cSrcweir 			}
236*cdf0e10cSrcweir 			sal_Int32 nLength = aPropSeq.getLength();
237*cdf0e10cSrcweir 			if ( nLength )
238*cdf0e10cSrcweir 			{
239*cdf0e10cSrcweir 				sal_Int32 nIndex  = (*aHashIter).second;
240*cdf0e10cSrcweir 				if ( nIndex != ( nLength - 1 ) )						// resizing sequence
241*cdf0e10cSrcweir 				{
242*cdf0e10cSrcweir 					PropertyHashMap::iterator aHashIter2( aPropHashMap.find( aPropSeq[ nLength - 1 ].Name ) );
243*cdf0e10cSrcweir 					(*aHashIter2).second = nIndex;
244*cdf0e10cSrcweir 					aPropSeq[ (*aHashIter).second ] = aPropSeq[ aPropSeq.getLength() - 1 ];
245*cdf0e10cSrcweir 				}
246*cdf0e10cSrcweir 				aPropSeq.realloc( aPropSeq.getLength() - 1 );
247*cdf0e10cSrcweir 			}
248*cdf0e10cSrcweir 			aPropHashMap.erase( aHashIter );							// removing property from hashmap
249*cdf0e10cSrcweir 		}
250*cdf0e10cSrcweir 	}
251*cdf0e10cSrcweir }
252*cdf0e10cSrcweir 
253*cdf0e10cSrcweir void SdrCustomShapeGeometryItem::ClearPropertyValue( const rtl::OUString& rSequenceName, const rtl::OUString& rPropName )
254*cdf0e10cSrcweir {
255*cdf0e10cSrcweir 	com::sun::star::uno::Any* pSeqAny = GetPropertyValueByName( rSequenceName );
256*cdf0e10cSrcweir 	if ( pSeqAny )
257*cdf0e10cSrcweir 	{
258*cdf0e10cSrcweir 		if ( pSeqAny->getValueType() == ::getCppuType((const ::com::sun::star::uno::Sequence < beans::PropertyValue >*)0) )
259*cdf0e10cSrcweir 		{
260*cdf0e10cSrcweir 			PropertyPairHashMap::iterator aHashIter( aPropPairHashMap.find( PropertyPair( rSequenceName, rPropName ) ) );
261*cdf0e10cSrcweir 			if ( aHashIter != aPropPairHashMap.end() )
262*cdf0e10cSrcweir 			{
263*cdf0e10cSrcweir 				::com::sun::star::uno::Sequence < beans::PropertyValue >& rSecSequence =
264*cdf0e10cSrcweir 					*((::com::sun::star::uno::Sequence < beans::PropertyValue >*)pSeqAny->getValue());
265*cdf0e10cSrcweir 
266*cdf0e10cSrcweir 				sal_Int32 nLength = rSecSequence.getLength();
267*cdf0e10cSrcweir 				if ( nLength )
268*cdf0e10cSrcweir 				{
269*cdf0e10cSrcweir 					sal_Int32 nIndex  = (*aHashIter).second;
270*cdf0e10cSrcweir 					if ( nIndex != ( nLength - 1 ) )							// resizing sequence
271*cdf0e10cSrcweir 					{
272*cdf0e10cSrcweir 						PropertyPairHashMap::iterator aHashIter2( aPropPairHashMap.find( PropertyPair( rSequenceName, rSecSequence[ nLength - 1 ].Name ) ) );
273*cdf0e10cSrcweir 						(*aHashIter2).second = nIndex;
274*cdf0e10cSrcweir 						rSecSequence[ nIndex ] = rSecSequence[ nLength - 1 ];
275*cdf0e10cSrcweir 					}
276*cdf0e10cSrcweir 					rSecSequence.realloc( aPropSeq.getLength() - 1 );
277*cdf0e10cSrcweir 				}
278*cdf0e10cSrcweir 				aPropPairHashMap.erase( aHashIter );
279*cdf0e10cSrcweir 			}
280*cdf0e10cSrcweir 		}
281*cdf0e10cSrcweir 	}
282*cdf0e10cSrcweir }
283*cdf0e10cSrcweir 
284*cdf0e10cSrcweir SdrCustomShapeGeometryItem::~SdrCustomShapeGeometryItem()
285*cdf0e10cSrcweir {
286*cdf0e10cSrcweir }
287*cdf0e10cSrcweir SdrCustomShapeGeometryItem::SdrCustomShapeGeometryItem( SvStream& /*rIn*/, sal_uInt16 nVersion ):
288*cdf0e10cSrcweir 	SfxPoolItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )
289*cdf0e10cSrcweir {
290*cdf0e10cSrcweir 	if ( nVersion )
291*cdf0e10cSrcweir 	{
292*cdf0e10cSrcweir 
293*cdf0e10cSrcweir 	}
294*cdf0e10cSrcweir }
295*cdf0e10cSrcweir int __EXPORT SdrCustomShapeGeometryItem::operator==( const SfxPoolItem& rCmp ) const
296*cdf0e10cSrcweir {
297*cdf0e10cSrcweir 	int bRet = SfxPoolItem::operator==( rCmp );
298*cdf0e10cSrcweir 	if ( bRet )
299*cdf0e10cSrcweir 		bRet = ((SdrCustomShapeGeometryItem&)rCmp).aPropSeq == aPropSeq;
300*cdf0e10cSrcweir 	return bRet;
301*cdf0e10cSrcweir }
302*cdf0e10cSrcweir 
303*cdf0e10cSrcweir SfxItemPresentation __EXPORT SdrCustomShapeGeometryItem::GetPresentation(
304*cdf0e10cSrcweir     SfxItemPresentation ePresentation, SfxMapUnit /*eCoreMetric*/,
305*cdf0e10cSrcweir     SfxMapUnit /*ePresentationMetric*/, XubString &rText, const IntlWrapper *) const
306*cdf0e10cSrcweir {
307*cdf0e10cSrcweir 	rText += sal_Unicode( ' ' );
308*cdf0e10cSrcweir 	if ( ePresentation == SFX_ITEM_PRESENTATION_COMPLETE )
309*cdf0e10cSrcweir 	{
310*cdf0e10cSrcweir 		XubString aStr;
311*cdf0e10cSrcweir //		SdrItemPool::TakeItemName( Which(), aStr );
312*cdf0e10cSrcweir 		aStr += sal_Unicode( ' ' );
313*cdf0e10cSrcweir 		rText.Insert( aStr, 0 );
314*cdf0e10cSrcweir 	}
315*cdf0e10cSrcweir 	return ePresentation;
316*cdf0e10cSrcweir }
317*cdf0e10cSrcweir 
318*cdf0e10cSrcweir SfxPoolItem* __EXPORT SdrCustomShapeGeometryItem::Create( SvStream& rIn, sal_uInt16 nItemVersion ) const
319*cdf0e10cSrcweir {
320*cdf0e10cSrcweir 	return new SdrCustomShapeGeometryItem( rIn, nItemVersion );
321*cdf0e10cSrcweir }
322*cdf0e10cSrcweir 
323*cdf0e10cSrcweir SvStream& __EXPORT SdrCustomShapeGeometryItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const
324*cdf0e10cSrcweir {
325*cdf0e10cSrcweir 	if ( nItemVersion )
326*cdf0e10cSrcweir 	{
327*cdf0e10cSrcweir 
328*cdf0e10cSrcweir 	}
329*cdf0e10cSrcweir 	return rOut;
330*cdf0e10cSrcweir }
331*cdf0e10cSrcweir 
332*cdf0e10cSrcweir SfxPoolItem* __EXPORT SdrCustomShapeGeometryItem::Clone( SfxItemPool * /*pPool*/ ) const
333*cdf0e10cSrcweir {
334*cdf0e10cSrcweir 	SdrCustomShapeGeometryItem* pItem = new SdrCustomShapeGeometryItem( GetGeometry() );
335*cdf0e10cSrcweir //	SdrCustomShapeGeometryItem* pItem = new SdrCustomShapeGeometryItem( *this );
336*cdf0e10cSrcweir 
337*cdf0e10cSrcweir /*
338*cdf0e10cSrcweir 	for ( i = 0; i < GetCount(); i++ )
339*cdf0e10cSrcweir 	{
340*cdf0e10cSrcweir 		const SdrCustomShapeAdjustmentValue& rVal = GetValue( i );
341*cdf0e10cSrcweir 		pItem->SetValue( i, rVal );
342*cdf0e10cSrcweir 	}
343*cdf0e10cSrcweir */
344*cdf0e10cSrcweir 	return pItem;
345*cdf0e10cSrcweir }
346*cdf0e10cSrcweir 
347*cdf0e10cSrcweir #ifdef SDR_ISPOOLABLE
348*cdf0e10cSrcweir int __EXPORT SdrCustomShapeGeometryItem::IsPoolable() const
349*cdf0e10cSrcweir {
350*cdf0e10cSrcweir 	sal_uInt16 nId=Which();
351*cdf0e10cSrcweir 	return nId < SDRATTR_NOTPERSIST_FIRST || nId > SDRATTR_NOTPERSIST_LAST;
352*cdf0e10cSrcweir }
353*cdf0e10cSrcweir #endif
354*cdf0e10cSrcweir sal_uInt16 SdrCustomShapeGeometryItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/ ) const
355*cdf0e10cSrcweir {
356*cdf0e10cSrcweir 	return 1;
357*cdf0e10cSrcweir }
358*cdf0e10cSrcweir sal_Bool SdrCustomShapeGeometryItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
359*cdf0e10cSrcweir {
360*cdf0e10cSrcweir 	rVal <<= aPropSeq;
361*cdf0e10cSrcweir 	return sal_True;
362*cdf0e10cSrcweir }
363*cdf0e10cSrcweir sal_Bool SdrCustomShapeGeometryItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
364*cdf0e10cSrcweir {
365*cdf0e10cSrcweir 	if ( ! ( rVal >>= aPropSeq ) )
366*cdf0e10cSrcweir 		return sal_False;
367*cdf0e10cSrcweir 	else
368*cdf0e10cSrcweir 		return sal_True;
369*cdf0e10cSrcweir }
370*cdf0e10cSrcweir const uno::Sequence< beans::PropertyValue >& SdrCustomShapeGeometryItem::GetGeometry() const
371*cdf0e10cSrcweir {
372*cdf0e10cSrcweir 	return aPropSeq;
373*cdf0e10cSrcweir }
374*cdf0e10cSrcweir /*
375*cdf0e10cSrcweir const uno::Any* GetValueByName( const rtl::OUString& rProperty ) const
376*cdf0e10cSrcweir {
377*cdf0e10cSrcweir 
378*cdf0e10cSrcweir }
379*cdf0e10cSrcweir */
380*cdf0e10cSrcweir SdrCustomShapeReplacementURLItem::SdrCustomShapeReplacementURLItem()
381*cdf0e10cSrcweir :	SfxStringItem( SDRATTR_CUSTOMSHAPE_REPLACEMENT_URL, String() )
382*cdf0e10cSrcweir {}
383*cdf0e10cSrcweir SdrCustomShapeReplacementURLItem::SdrCustomShapeReplacementURLItem( const String& rVal )
384*cdf0e10cSrcweir :	SfxStringItem( SDRATTR_CUSTOMSHAPE_REPLACEMENT_URL, rVal )
385*cdf0e10cSrcweir {}
386*cdf0e10cSrcweir 
387