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 
SdrCustomShapeEngineItem()32cdf0e10cSrcweir SdrCustomShapeEngineItem::SdrCustomShapeEngineItem()
33cdf0e10cSrcweir :	SfxStringItem( SDRATTR_CUSTOMSHAPE_ENGINE, String() )
34cdf0e10cSrcweir {}
SdrCustomShapeEngineItem(const String & rVal)35cdf0e10cSrcweir SdrCustomShapeEngineItem::SdrCustomShapeEngineItem( const String& rVal )
36cdf0e10cSrcweir :	SfxStringItem( SDRATTR_CUSTOMSHAPE_ENGINE, rVal )
37cdf0e10cSrcweir {}
38cdf0e10cSrcweir 
SdrCustomShapeDataItem()39cdf0e10cSrcweir SdrCustomShapeDataItem::SdrCustomShapeDataItem()
40cdf0e10cSrcweir :	SfxStringItem( SDRATTR_CUSTOMSHAPE_DATA, String() )
41cdf0e10cSrcweir {}
SdrCustomShapeDataItem(const String & rVal)42cdf0e10cSrcweir SdrCustomShapeDataItem::SdrCustomShapeDataItem( const String& rVal )
43cdf0e10cSrcweir :	SfxStringItem( SDRATTR_CUSTOMSHAPE_DATA, rVal )
44cdf0e10cSrcweir {}
45cdf0e10cSrcweir 
46cdf0e10cSrcweir TYPEINIT1_FACTORY( SdrCustomShapeGeometryItem, SfxPoolItem , new  SdrCustomShapeGeometryItem);
SdrCustomShapeGeometryItem()47cdf0e10cSrcweir SdrCustomShapeGeometryItem::SdrCustomShapeGeometryItem()
48cdf0e10cSrcweir :	SfxPoolItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )
49cdf0e10cSrcweir {}
SdrCustomShapeGeometryItem(const uno::Sequence<beans::PropertyValue> & rVal)50cdf0e10cSrcweir SdrCustomShapeGeometryItem::SdrCustomShapeGeometryItem( const uno::Sequence< beans::PropertyValue >& rVal )
51cdf0e10cSrcweir :	SfxPoolItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )
52cdf0e10cSrcweir {
53cdf0e10cSrcweir 	sal_Int32 i, j;
54cdf0e10cSrcweir 	aPropSeq = rVal;
55cdf0e10cSrcweir 
56cdf0e10cSrcweir 	// hashing property values
57cdf0e10cSrcweir //  beans::PropertyValue* pPropValues = aPropSeq.getArray();
58cdf0e10cSrcweir //  const rtl::OUString* pPtr = NULL;
59cdf0e10cSrcweir 	for ( i = 0; i < aPropSeq.getLength(); i++ )
60cdf0e10cSrcweir 	{
61cdf0e10cSrcweir 		beans::PropertyValue& rPropVal = aPropSeq[ i ];
62cdf0e10cSrcweir 		aPropHashMap[ rPropVal.Name ] = i;
63cdf0e10cSrcweir 		if ( rPropVal.Value.getValueType() == ::getCppuType((const ::com::sun::star::uno::Sequence < beans::PropertyValue >*)0) )
64cdf0e10cSrcweir 		{
65cdf0e10cSrcweir 			uno::Sequence< beans::PropertyValue >& rPropSeq = *( uno::Sequence< beans::PropertyValue >*)rPropVal.Value.getValue();
66cdf0e10cSrcweir 			for ( j = 0; j < rPropSeq.getLength(); j++ )
67cdf0e10cSrcweir 			{
68cdf0e10cSrcweir 				beans::PropertyValue& rPropVal2 = rPropSeq[ j ];
69cdf0e10cSrcweir 				aPropPairHashMap[ PropertyPair( rPropVal.Name, rPropVal2.Name ) ] = j;
70cdf0e10cSrcweir 			}
71cdf0e10cSrcweir 		}
72cdf0e10cSrcweir 	}
73cdf0e10cSrcweir }
74cdf0e10cSrcweir 
GetPropertyValueByName(const rtl::OUString & rPropName)75cdf0e10cSrcweir com::sun::star::uno::Any* SdrCustomShapeGeometryItem::GetPropertyValueByName( const rtl::OUString& rPropName )
76cdf0e10cSrcweir {
77cdf0e10cSrcweir 	com::sun::star::uno::Any* pRet = NULL;
78cdf0e10cSrcweir 	PropertyHashMap::iterator aHashIter( aPropHashMap.find( rPropName ) );
79cdf0e10cSrcweir 	if ( aHashIter != aPropHashMap.end() )
80cdf0e10cSrcweir 		pRet = &aPropSeq[ (*aHashIter).second ].Value;
81cdf0e10cSrcweir 	return pRet;
82cdf0e10cSrcweir }
83cdf0e10cSrcweir 
GetPropertyValueByName(const rtl::OUString & rSequenceName,const rtl::OUString & rPropName)84cdf0e10cSrcweir com::sun::star::uno::Any* SdrCustomShapeGeometryItem::GetPropertyValueByName( const rtl::OUString& rSequenceName, const rtl::OUString& rPropName )
85cdf0e10cSrcweir {
86cdf0e10cSrcweir 	com::sun::star::uno::Any* pRet = NULL;
87cdf0e10cSrcweir 	com::sun::star::uno::Any* pSeqAny = GetPropertyValueByName( rSequenceName );
88cdf0e10cSrcweir 	if ( pSeqAny )
89cdf0e10cSrcweir 	{
90cdf0e10cSrcweir 		if ( pSeqAny->getValueType() == ::getCppuType((const ::com::sun::star::uno::Sequence < beans::PropertyValue >*)0) )
91cdf0e10cSrcweir 		{
92cdf0e10cSrcweir 			PropertyPairHashMap::iterator aHashIter( aPropPairHashMap.find( PropertyPair( rSequenceName, rPropName ) ) );
93cdf0e10cSrcweir 			if ( aHashIter != aPropPairHashMap.end() )
94cdf0e10cSrcweir 			{
95cdf0e10cSrcweir 				::com::sun::star::uno::Sequence < beans::PropertyValue >& rSecSequence =
96cdf0e10cSrcweir 					*((::com::sun::star::uno::Sequence < beans::PropertyValue >*)pSeqAny->getValue());
97cdf0e10cSrcweir 				pRet = &rSecSequence[ (*aHashIter).second ].Value;
98cdf0e10cSrcweir 			}
99cdf0e10cSrcweir 		}
100cdf0e10cSrcweir 	}
101cdf0e10cSrcweir 	return pRet;
102cdf0e10cSrcweir }
103cdf0e10cSrcweir 
SetPropertyValue(const com::sun::star::beans::PropertyValue & rPropVal)104cdf0e10cSrcweir void SdrCustomShapeGeometryItem::SetPropertyValue( const com::sun::star::beans::PropertyValue& rPropVal )
105cdf0e10cSrcweir {
106cdf0e10cSrcweir 	com::sun::star::uno::Any* pAny = GetPropertyValueByName( rPropVal.Name );
107cdf0e10cSrcweir 	if ( pAny )
108cdf0e10cSrcweir 	{	// property is already available
109cdf0e10cSrcweir 		sal_Int32 i;
110cdf0e10cSrcweir 		if ( pAny->getValueType() == ::getCppuType((const ::com::sun::star::uno::Sequence < beans::PropertyValue >*)0) )
111cdf0e10cSrcweir 		{	// old property is a sequence->each entry has to be removed from the HashPairMap
112cdf0e10cSrcweir 			::com::sun::star::uno::Sequence < beans::PropertyValue >& rSecSequence =
113cdf0e10cSrcweir 				*((::com::sun::star::uno::Sequence < beans::PropertyValue >*)pAny->getValue());
114cdf0e10cSrcweir 			for ( i = 0; i < rSecSequence.getLength(); i++ )
115cdf0e10cSrcweir 			{
116cdf0e10cSrcweir 				PropertyPairHashMap::iterator aHashIter( aPropPairHashMap.find( PropertyPair( rPropVal.Name, rSecSequence[ i ].Name ) ) );
117cdf0e10cSrcweir 				if ( aHashIter != aPropPairHashMap.end() )
118cdf0e10cSrcweir 					aPropPairHashMap.erase( aHashIter );
119cdf0e10cSrcweir 			}
120cdf0e10cSrcweir 		}
121cdf0e10cSrcweir 		*pAny = rPropVal.Value;
122cdf0e10cSrcweir 		if ( rPropVal.Value.getValueType() == ::getCppuType((const ::com::sun::star::uno::Sequence < beans::PropertyValue >*)0) )
123cdf0e10cSrcweir 		{	// the new property is a sequence->each entry has to be inserted into the HashPairMap
124cdf0e10cSrcweir 			::com::sun::star::uno::Sequence < beans::PropertyValue >& rSecSequence =
125cdf0e10cSrcweir 				*((::com::sun::star::uno::Sequence < beans::PropertyValue >*)pAny->getValue());
126cdf0e10cSrcweir 			for ( i = 0; i < rSecSequence.getLength(); i++ )
127cdf0e10cSrcweir 			{
128cdf0e10cSrcweir 				beans::PropertyValue& rPropVal2 = rSecSequence[ i ];
129cdf0e10cSrcweir 				aPropPairHashMap[ PropertyPair( rPropVal.Name, rPropVal2.Name ) ] = i;
130cdf0e10cSrcweir 			}
131cdf0e10cSrcweir 		}
132cdf0e10cSrcweir 	}
133cdf0e10cSrcweir 	else
134cdf0e10cSrcweir 	{	// its a new property
135cdf0e10cSrcweir 		sal_uInt32 nIndex = aPropSeq.getLength();
136cdf0e10cSrcweir 		aPropSeq.realloc( nIndex + 1 );
137cdf0e10cSrcweir 		aPropSeq[ nIndex ] = rPropVal ;
138cdf0e10cSrcweir 
139cdf0e10cSrcweir 		aPropHashMap[ rPropVal.Name ] = nIndex;
140cdf0e10cSrcweir 	}
141cdf0e10cSrcweir }
142cdf0e10cSrcweir 
SetPropertyValue(const rtl::OUString & rSequenceName,const com::sun::star::beans::PropertyValue & rPropVal)143cdf0e10cSrcweir void SdrCustomShapeGeometryItem::SetPropertyValue( const rtl::OUString& rSequenceName, const com::sun::star::beans::PropertyValue& rPropVal )
144cdf0e10cSrcweir {
145cdf0e10cSrcweir 	com::sun::star::uno::Any* pAny = GetPropertyValueByName( rSequenceName, rPropVal.Name );
146cdf0e10cSrcweir 	if ( pAny )	// just replacing
147cdf0e10cSrcweir 		*pAny = rPropVal.Value;
148cdf0e10cSrcweir 	else
149cdf0e10cSrcweir 	{
150cdf0e10cSrcweir 		com::sun::star::uno::Any* pSeqAny = GetPropertyValueByName( rSequenceName );
151cdf0e10cSrcweir 		if( pSeqAny == NULL )
152cdf0e10cSrcweir 		{
153cdf0e10cSrcweir 			::com::sun::star::uno::Sequence < beans::PropertyValue > aSeq;
154cdf0e10cSrcweir 			beans::PropertyValue aValue;
155cdf0e10cSrcweir 			aValue.Name = rSequenceName;
156cdf0e10cSrcweir 			aValue.Value = ::com::sun::star::uno::makeAny( aSeq );
157cdf0e10cSrcweir 
158cdf0e10cSrcweir 			sal_uInt32 nIndex = aPropSeq.getLength();
159cdf0e10cSrcweir 			aPropSeq.realloc( nIndex + 1 );
160cdf0e10cSrcweir 			aPropSeq[ nIndex ] = aValue;
161cdf0e10cSrcweir 			aPropHashMap[ rSequenceName ] = nIndex;
162cdf0e10cSrcweir 
163cdf0e10cSrcweir 			pSeqAny = &aPropSeq[ nIndex ].Value;
164cdf0e10cSrcweir 		}
165cdf0e10cSrcweir 
166cdf0e10cSrcweir 		DBG_ASSERT( pSeqAny, "SdrCustomShapeGeometryItem::SetPropertyValue() - No Value??" );
167cdf0e10cSrcweir 
168cdf0e10cSrcweir 		if( pSeqAny )
169cdf0e10cSrcweir 		{
170cdf0e10cSrcweir 			if ( pSeqAny->getValueType() == ::getCppuType((const ::com::sun::star::uno::Sequence < beans::PropertyValue >*)0) )
171cdf0e10cSrcweir 			{
172cdf0e10cSrcweir 				PropertyPairHashMap::iterator aHashIter( aPropPairHashMap.find( PropertyPair( rSequenceName, rPropVal.Name ) ) );
173cdf0e10cSrcweir 				if ( aHashIter != aPropPairHashMap.end() )
174cdf0e10cSrcweir 				{
175cdf0e10cSrcweir 					::com::sun::star::uno::Sequence < beans::PropertyValue >& rSecSequence =
176cdf0e10cSrcweir 						*((::com::sun::star::uno::Sequence < beans::PropertyValue >*)pSeqAny->getValue());
177cdf0e10cSrcweir 					rSecSequence[ (*aHashIter).second ].Value = rPropVal.Value;
178cdf0e10cSrcweir 				}
179cdf0e10cSrcweir 				else
180cdf0e10cSrcweir 				{
181cdf0e10cSrcweir 					::com::sun::star::uno::Sequence < beans::PropertyValue >& rSecSequence =
182cdf0e10cSrcweir 						*((::com::sun::star::uno::Sequence < beans::PropertyValue >*)pSeqAny->getValue());
183cdf0e10cSrcweir 
184cdf0e10cSrcweir 					sal_Int32 nCount = rSecSequence.getLength();
185cdf0e10cSrcweir 					rSecSequence.realloc( nCount + 1 );
186cdf0e10cSrcweir 					rSecSequence[ nCount ] = rPropVal;
187cdf0e10cSrcweir 
188cdf0e10cSrcweir 					aPropPairHashMap[ PropertyPair( rSequenceName, rPropVal.Name ) ] = nCount;
189cdf0e10cSrcweir 				}
190cdf0e10cSrcweir 			}
191cdf0e10cSrcweir 		}
192cdf0e10cSrcweir 	}
193cdf0e10cSrcweir }
194cdf0e10cSrcweir 
ClearPropertyValue(const rtl::OUString & rPropName)195cdf0e10cSrcweir void SdrCustomShapeGeometryItem::ClearPropertyValue( const rtl::OUString& rPropName )
196cdf0e10cSrcweir {
197cdf0e10cSrcweir 	if ( aPropSeq.getLength() )
198cdf0e10cSrcweir 	{
199cdf0e10cSrcweir 		PropertyHashMap::iterator aHashIter( aPropHashMap.find( rPropName ) );
200cdf0e10cSrcweir 		if ( aHashIter != aPropHashMap.end() )
201cdf0e10cSrcweir 		{
202cdf0e10cSrcweir  			com::sun::star::uno::Any* pSeqAny = &aPropSeq[ (*aHashIter).second ].Value;
203cdf0e10cSrcweir 			if ( pSeqAny )
204cdf0e10cSrcweir 			{
205cdf0e10cSrcweir 				if ( pSeqAny->getValueType() == ::getCppuType((const ::com::sun::star::uno::Sequence < beans::PropertyValue >*)0) )
206cdf0e10cSrcweir 				{
207cdf0e10cSrcweir 					::com::sun::star::uno::Sequence < beans::PropertyValue >& rSecSequence =
208cdf0e10cSrcweir 						*((::com::sun::star::uno::Sequence < beans::PropertyValue >*)pSeqAny->getValue());
209cdf0e10cSrcweir 
210cdf0e10cSrcweir 					sal_Int32 i;
211cdf0e10cSrcweir 					for ( i = 0; i < rSecSequence.getLength(); i++ )
212cdf0e10cSrcweir 					{
213cdf0e10cSrcweir                         PropertyPairHashMap::iterator _aHashIter( aPropPairHashMap.find( PropertyPair( rPropName, rSecSequence[ i ].Name ) ) );
214cdf0e10cSrcweir                         if ( _aHashIter != aPropPairHashMap.end() )
215cdf0e10cSrcweir                             aPropPairHashMap.erase( _aHashIter );       // removing property from pair hashmap
216cdf0e10cSrcweir 					}
217cdf0e10cSrcweir 				}
218cdf0e10cSrcweir 			}
219cdf0e10cSrcweir 			sal_Int32 nLength = aPropSeq.getLength();
220cdf0e10cSrcweir 			if ( nLength )
221cdf0e10cSrcweir 			{
222cdf0e10cSrcweir 				sal_Int32 nIndex  = (*aHashIter).second;
223cdf0e10cSrcweir 				if ( nIndex != ( nLength - 1 ) )						// resizing sequence
224cdf0e10cSrcweir 				{
225cdf0e10cSrcweir 					PropertyHashMap::iterator aHashIter2( aPropHashMap.find( aPropSeq[ nLength - 1 ].Name ) );
226cdf0e10cSrcweir 					(*aHashIter2).second = nIndex;
227cdf0e10cSrcweir 					aPropSeq[ (*aHashIter).second ] = aPropSeq[ aPropSeq.getLength() - 1 ];
228cdf0e10cSrcweir 				}
229cdf0e10cSrcweir 				aPropSeq.realloc( aPropSeq.getLength() - 1 );
230cdf0e10cSrcweir 			}
231cdf0e10cSrcweir 			aPropHashMap.erase( aHashIter );							// removing property from hashmap
232cdf0e10cSrcweir 		}
233cdf0e10cSrcweir 	}
234cdf0e10cSrcweir }
235cdf0e10cSrcweir 
ClearPropertyValue(const rtl::OUString & rSequenceName,const rtl::OUString & rPropName)236cdf0e10cSrcweir void SdrCustomShapeGeometryItem::ClearPropertyValue( const rtl::OUString& rSequenceName, const rtl::OUString& rPropName )
237cdf0e10cSrcweir {
238cdf0e10cSrcweir 	com::sun::star::uno::Any* pSeqAny = GetPropertyValueByName( rSequenceName );
239cdf0e10cSrcweir 	if ( pSeqAny )
240cdf0e10cSrcweir 	{
241cdf0e10cSrcweir 		if ( pSeqAny->getValueType() == ::getCppuType((const ::com::sun::star::uno::Sequence < beans::PropertyValue >*)0) )
242cdf0e10cSrcweir 		{
243cdf0e10cSrcweir 			PropertyPairHashMap::iterator aHashIter( aPropPairHashMap.find( PropertyPair( rSequenceName, rPropName ) ) );
244cdf0e10cSrcweir 			if ( aHashIter != aPropPairHashMap.end() )
245cdf0e10cSrcweir 			{
246cdf0e10cSrcweir 				::com::sun::star::uno::Sequence < beans::PropertyValue >& rSecSequence =
247cdf0e10cSrcweir 					*((::com::sun::star::uno::Sequence < beans::PropertyValue >*)pSeqAny->getValue());
248cdf0e10cSrcweir 
249cdf0e10cSrcweir 				sal_Int32 nLength = rSecSequence.getLength();
250cdf0e10cSrcweir 				if ( nLength )
251cdf0e10cSrcweir 				{
252cdf0e10cSrcweir 					sal_Int32 nIndex  = (*aHashIter).second;
253cdf0e10cSrcweir 					if ( nIndex != ( nLength - 1 ) )							// resizing sequence
254cdf0e10cSrcweir 					{
255cdf0e10cSrcweir 						PropertyPairHashMap::iterator aHashIter2( aPropPairHashMap.find( PropertyPair( rSequenceName, rSecSequence[ nLength - 1 ].Name ) ) );
256cdf0e10cSrcweir 						(*aHashIter2).second = nIndex;
257cdf0e10cSrcweir 						rSecSequence[ nIndex ] = rSecSequence[ nLength - 1 ];
258cdf0e10cSrcweir 					}
259cdf0e10cSrcweir 					rSecSequence.realloc( aPropSeq.getLength() - 1 );
260cdf0e10cSrcweir 				}
261cdf0e10cSrcweir 				aPropPairHashMap.erase( aHashIter );
262cdf0e10cSrcweir 			}
263cdf0e10cSrcweir 		}
264cdf0e10cSrcweir 	}
265cdf0e10cSrcweir }
266cdf0e10cSrcweir 
~SdrCustomShapeGeometryItem()267cdf0e10cSrcweir SdrCustomShapeGeometryItem::~SdrCustomShapeGeometryItem()
268cdf0e10cSrcweir {
269cdf0e10cSrcweir }
SdrCustomShapeGeometryItem(SvStream &,sal_uInt16 nVersion)270cdf0e10cSrcweir SdrCustomShapeGeometryItem::SdrCustomShapeGeometryItem( SvStream& /*rIn*/, sal_uInt16 nVersion ):
271cdf0e10cSrcweir 	SfxPoolItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )
272cdf0e10cSrcweir {
273cdf0e10cSrcweir 	if ( nVersion )
274cdf0e10cSrcweir 	{
275cdf0e10cSrcweir 
276cdf0e10cSrcweir 	}
277cdf0e10cSrcweir }
operator ==(const SfxPoolItem & rCmp) const278cdf0e10cSrcweir int __EXPORT SdrCustomShapeGeometryItem::operator==( const SfxPoolItem& rCmp ) const
279cdf0e10cSrcweir {
280cdf0e10cSrcweir 	int bRet = SfxPoolItem::operator==( rCmp );
281cdf0e10cSrcweir 	if ( bRet )
282cdf0e10cSrcweir 		bRet = ((SdrCustomShapeGeometryItem&)rCmp).aPropSeq == aPropSeq;
283cdf0e10cSrcweir 	return bRet;
284cdf0e10cSrcweir }
285cdf0e10cSrcweir 
GetPresentation(SfxItemPresentation ePresentation,SfxMapUnit,SfxMapUnit,XubString & rText,const IntlWrapper *) const286cdf0e10cSrcweir SfxItemPresentation __EXPORT SdrCustomShapeGeometryItem::GetPresentation(
287cdf0e10cSrcweir     SfxItemPresentation ePresentation, SfxMapUnit /*eCoreMetric*/,
288cdf0e10cSrcweir     SfxMapUnit /*ePresentationMetric*/, XubString &rText, const IntlWrapper *) const
289cdf0e10cSrcweir {
290cdf0e10cSrcweir 	rText += sal_Unicode( ' ' );
291cdf0e10cSrcweir 	if ( ePresentation == SFX_ITEM_PRESENTATION_COMPLETE )
292cdf0e10cSrcweir 	{
293cdf0e10cSrcweir 		XubString aStr;
294cdf0e10cSrcweir //		SdrItemPool::TakeItemName( Which(), aStr );
295cdf0e10cSrcweir 		aStr += sal_Unicode( ' ' );
296cdf0e10cSrcweir 		rText.Insert( aStr, 0 );
297cdf0e10cSrcweir 	}
298cdf0e10cSrcweir 	return ePresentation;
299cdf0e10cSrcweir }
300cdf0e10cSrcweir 
Create(SvStream & rIn,sal_uInt16 nItemVersion) const301cdf0e10cSrcweir SfxPoolItem* __EXPORT SdrCustomShapeGeometryItem::Create( SvStream& rIn, sal_uInt16 nItemVersion ) const
302cdf0e10cSrcweir {
303cdf0e10cSrcweir 	return new SdrCustomShapeGeometryItem( rIn, nItemVersion );
304cdf0e10cSrcweir }
305cdf0e10cSrcweir 
Store(SvStream & rOut,sal_uInt16 nItemVersion) const306cdf0e10cSrcweir SvStream& __EXPORT SdrCustomShapeGeometryItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const
307cdf0e10cSrcweir {
308cdf0e10cSrcweir 	if ( nItemVersion )
309cdf0e10cSrcweir 	{
310cdf0e10cSrcweir 
311cdf0e10cSrcweir 	}
312cdf0e10cSrcweir 	return rOut;
313cdf0e10cSrcweir }
314cdf0e10cSrcweir 
Clone(SfxItemPool *) const315cdf0e10cSrcweir SfxPoolItem* __EXPORT SdrCustomShapeGeometryItem::Clone( SfxItemPool * /*pPool*/ ) const
316cdf0e10cSrcweir {
317cdf0e10cSrcweir 	SdrCustomShapeGeometryItem* pItem = new SdrCustomShapeGeometryItem( GetGeometry() );
318cdf0e10cSrcweir //	SdrCustomShapeGeometryItem* pItem = new SdrCustomShapeGeometryItem( *this );
319cdf0e10cSrcweir 
320cdf0e10cSrcweir /*
321cdf0e10cSrcweir 	for ( i = 0; i < GetCount(); i++ )
322cdf0e10cSrcweir 	{
323cdf0e10cSrcweir 		const SdrCustomShapeAdjustmentValue& rVal = GetValue( i );
324cdf0e10cSrcweir 		pItem->SetValue( i, rVal );
325cdf0e10cSrcweir 	}
326cdf0e10cSrcweir */
327cdf0e10cSrcweir 	return pItem;
328cdf0e10cSrcweir }
329cdf0e10cSrcweir 
330cdf0e10cSrcweir #ifdef SDR_ISPOOLABLE
IsPoolable() const331cdf0e10cSrcweir int __EXPORT SdrCustomShapeGeometryItem::IsPoolable() const
332cdf0e10cSrcweir {
333cdf0e10cSrcweir 	sal_uInt16 nId=Which();
334cdf0e10cSrcweir 	return nId < SDRATTR_NOTPERSIST_FIRST || nId > SDRATTR_NOTPERSIST_LAST;
335cdf0e10cSrcweir }
336cdf0e10cSrcweir #endif
GetVersion(sal_uInt16) const337cdf0e10cSrcweir sal_uInt16 SdrCustomShapeGeometryItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/ ) const
338cdf0e10cSrcweir {
339cdf0e10cSrcweir 	return 1;
340cdf0e10cSrcweir }
QueryValue(uno::Any & rVal,sal_uInt8) const341cdf0e10cSrcweir sal_Bool SdrCustomShapeGeometryItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
342cdf0e10cSrcweir {
343cdf0e10cSrcweir 	rVal <<= aPropSeq;
344cdf0e10cSrcweir 	return sal_True;
345cdf0e10cSrcweir }
PutValue(const uno::Any & rVal,sal_uInt8)346cdf0e10cSrcweir sal_Bool SdrCustomShapeGeometryItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
347cdf0e10cSrcweir {
348cdf0e10cSrcweir 	if ( ! ( rVal >>= aPropSeq ) )
349cdf0e10cSrcweir 		return sal_False;
350cdf0e10cSrcweir 	else
351cdf0e10cSrcweir 		return sal_True;
352cdf0e10cSrcweir }
GetGeometry() const353cdf0e10cSrcweir const uno::Sequence< beans::PropertyValue >& SdrCustomShapeGeometryItem::GetGeometry() const
354cdf0e10cSrcweir {
355cdf0e10cSrcweir 	return aPropSeq;
356cdf0e10cSrcweir }
357cdf0e10cSrcweir /*
358cdf0e10cSrcweir const uno::Any* GetValueByName( const rtl::OUString& rProperty ) const
359cdf0e10cSrcweir {
360cdf0e10cSrcweir 
361cdf0e10cSrcweir }
362cdf0e10cSrcweir */
SdrCustomShapeReplacementURLItem()363cdf0e10cSrcweir SdrCustomShapeReplacementURLItem::SdrCustomShapeReplacementURLItem()
364cdf0e10cSrcweir :	SfxStringItem( SDRATTR_CUSTOMSHAPE_REPLACEMENT_URL, String() )
365cdf0e10cSrcweir {}
SdrCustomShapeReplacementURLItem(const String & rVal)366cdf0e10cSrcweir SdrCustomShapeReplacementURLItem::SdrCustomShapeReplacementURLItem( const String& rVal )
367cdf0e10cSrcweir :	SfxStringItem( SDRATTR_CUSTOMSHAPE_REPLACEMENT_URL, rVal )
368cdf0e10cSrcweir {}
369cdf0e10cSrcweir 
370