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