xref: /aoo41x/main/svx/source/unodraw/unoshap4.cxx (revision a5258243)
1cdf0e10cSrcweir /*************************************************************************
2cdf0e10cSrcweir  *
3cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4cdf0e10cSrcweir  *
5cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6cdf0e10cSrcweir  *
7cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8cdf0e10cSrcweir  *
9cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10cdf0e10cSrcweir  *
11cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14cdf0e10cSrcweir  *
15cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20cdf0e10cSrcweir  *
21cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25cdf0e10cSrcweir  *
26cdf0e10cSrcweir  ************************************************************************/
27cdf0e10cSrcweir 
28cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29cdf0e10cSrcweir #include "precompiled_svx.hxx"
30cdf0e10cSrcweir #include <com/sun/star/util/XModifiable.hpp>
31cdf0e10cSrcweir #include <com/sun/star/embed/XLinkageSupport.hpp>
32cdf0e10cSrcweir #include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
33cdf0e10cSrcweir #include <com/sun/star/task/XInteractionHandler.hpp>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir #define _SVX_USE_UNOGLOBALS_
36cdf0e10cSrcweir 
37cdf0e10cSrcweir #include <vcl/virdev.hxx>
38cdf0e10cSrcweir #include <svx/svdoole2.hxx>
39cdf0e10cSrcweir #include <svx/svdomedia.hxx>
40cdf0e10cSrcweir #include <svx/svdpool.hxx>
41cdf0e10cSrcweir #ifndef SVX_LIGHT
42cdf0e10cSrcweir #ifndef _SOT_CLSIDS_HXX
43cdf0e10cSrcweir #include <sot/clsids.hxx>
44cdf0e10cSrcweir #endif
45cdf0e10cSrcweir #include <sfx2/frmdescr.hxx>
46cdf0e10cSrcweir #endif
47cdf0e10cSrcweir #include <vcl/svapp.hxx>
48cdf0e10cSrcweir #include <vos/mutex.hxx>
49cdf0e10cSrcweir 
50cdf0e10cSrcweir #include <toolkit/helper/vclunohelper.hxx>
51cdf0e10cSrcweir #include <sfx2/objsh.hxx>
52cdf0e10cSrcweir #include <sfx2/docfile.hxx>
53cdf0e10cSrcweir 
54cdf0e10cSrcweir #include <sot/storage.hxx>
55cdf0e10cSrcweir #include <sot/exchange.hxx>
56cdf0e10cSrcweir #include <svtools/FilterConfigItem.hxx>
57cdf0e10cSrcweir 
58cdf0e10cSrcweir #include <svx/svdmodel.hxx>
59cdf0e10cSrcweir #include "shapeimpl.hxx"
60cdf0e10cSrcweir 
61cdf0e10cSrcweir #include <svx/unoshprp.hxx>
62cdf0e10cSrcweir 
63cdf0e10cSrcweir #include "svx/unoapi.hxx"
64cdf0e10cSrcweir #include "svx/svdpagv.hxx"
65cdf0e10cSrcweir #include "svx/svdview.hxx"
66cdf0e10cSrcweir #include "svx/svdglob.hxx"
67cdf0e10cSrcweir #include "svx/svdstr.hrc"
68cdf0e10cSrcweir 
69cdf0e10cSrcweir ///////////////////////////////////////////////////////////////////////
70cdf0e10cSrcweir 
71cdf0e10cSrcweir extern sal_Bool ConvertGDIMetaFileToWMF( const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pFilterConfigItem = NULL, sal_Bool bPlaceable = sal_True );
72cdf0e10cSrcweir 
73cdf0e10cSrcweir ///////////////////////////////////////////////////////////////////////
74cdf0e10cSrcweir 
75cdf0e10cSrcweir using namespace ::osl;
76cdf0e10cSrcweir using namespace ::vos;
77cdf0e10cSrcweir using namespace ::rtl;
78cdf0e10cSrcweir using namespace ::cppu;
79cdf0e10cSrcweir using namespace ::com::sun::star;
80cdf0e10cSrcweir using namespace ::com::sun::star::uno;
81cdf0e10cSrcweir using namespace ::com::sun::star::lang;
82cdf0e10cSrcweir using namespace ::com::sun::star::container;
83cdf0e10cSrcweir using namespace ::com::sun::star::beans;
84cdf0e10cSrcweir 
85cdf0e10cSrcweir ///////////////////////////////////////////////////////////////////////
86cdf0e10cSrcweir SvxOle2Shape::SvxOle2Shape( SdrObject* pObject ) throw()
87*a5258243SPedro Giffuni : SvxShapeText( pObject, aSvxMapProvider.GetMap(SVXMAP_OLE2), aSvxMapProvider.GetPropertySet(SVXMAP_OLE2, SdrObject::GetGlobalDrawObjectItemPool())  )
88cdf0e10cSrcweir {
89cdf0e10cSrcweir }
90cdf0e10cSrcweir 
91cdf0e10cSrcweir SvxOle2Shape::SvxOle2Shape( SdrObject* pObject, const SfxItemPropertyMapEntry* pPropertyMap, const SvxItemPropertySet* pPropertySet ) throw ()
92*a5258243SPedro Giffuni : SvxShapeText( pObject, pPropertyMap, pPropertySet  )
93cdf0e10cSrcweir {
94cdf0e10cSrcweir }
95cdf0e10cSrcweir 
96cdf0e10cSrcweir SvxOle2Shape::~SvxOle2Shape() throw()
97cdf0e10cSrcweir {
98cdf0e10cSrcweir }
99cdf0e10cSrcweir 
100cdf0e10cSrcweir ::com::sun::star::uno::Any SAL_CALL SvxOle2Shape::queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
101cdf0e10cSrcweir {
102*a5258243SPedro Giffuni 	return SvxShapeText::queryAggregation( rType );
103cdf0e10cSrcweir }
104cdf0e10cSrcweir 
105cdf0e10cSrcweir //XPropertySet
106cdf0e10cSrcweir bool SvxOle2Shape::setPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
107cdf0e10cSrcweir {
108cdf0e10cSrcweir 	switch( pProperty->nWID )
109cdf0e10cSrcweir 	{
110cdf0e10cSrcweir /*
111cdf0e10cSrcweir 	case OWN_ATTR_CLSID:
112cdf0e10cSrcweir 	{
113cdf0e10cSrcweir 		OUString aCLSID;
114cdf0e10cSrcweir 		if( rValue >>= aCLSID )
115cdf0e10cSrcweir 		{
116cdf0e10cSrcweir             // init an ole object with a global name
117cdf0e10cSrcweir 			SdrOle2Obj* pOle2 = dynamic_cast< SdrOle2Obj* >( mpObj.get() );
118cdf0e10cSrcweir 			if( pOle2 )
119cdf0e10cSrcweir 			{
120cdf0e10cSrcweir                 uno::Reference < embed::XEmbeddedObject > xObj = pOle2->GetObjRef();
121cdf0e10cSrcweir                 if ( !xObj.is() )
122cdf0e10cSrcweir                 {
123cdf0e10cSrcweir 					SvGlobalName aClassName;
124cdf0e10cSrcweir 					if( aClassName.MakeId( aCLSID ) )
125cdf0e10cSrcweir 					{
126cdf0e10cSrcweir                         SfxObjectShell* pPersist = mpModel->GetPersist();
127cdf0e10cSrcweir                         ::rtl::OUString aPersistName;
128cdf0e10cSrcweir                         Any aAny( getPropertyValue( OUString::createFromAscii( UNO_NAME_OLE2_PERSISTNAME ) ) );
129cdf0e10cSrcweir                         aAny >>= aPersistName;
130cdf0e10cSrcweir 
131cdf0e10cSrcweir                         //TODO/LATER: how to cope with creation failure?!
132cdf0e10cSrcweir                         xObj = pPersist->GetEmbeddedObjectContainer().CreateEmbeddedObject( aClassName.GetByteSequence(), aPersistName );
133cdf0e10cSrcweir                         if( xObj.is() )
134cdf0e10cSrcweir                         {
135cdf0e10cSrcweir                             aAny <<= aPersistName;
136cdf0e10cSrcweir                             setPropertyValue( OUString::createFromAscii( UNO_NAME_OLE2_PERSISTNAME ), aAny );
137cdf0e10cSrcweir                             pOle2->SetObjRef( xObj );
138cdf0e10cSrcweir 
139cdf0e10cSrcweir                             Rectangle aRect = pOle2->GetLogicRect();
140cdf0e10cSrcweir                             awt::Size aSz;
141cdf0e10cSrcweir                             Size aSize( pOle2->GetLogicRect().GetSize() );
142cdf0e10cSrcweir                             aSz.Width = aSize.Width();
143cdf0e10cSrcweir                             aSz.Height = aSize.Height();
144cdf0e10cSrcweir                             xObj->setVisualAreaSize( pOle2->GetAspect(), aSz );
145cdf0e10cSrcweir 						}
146cdf0e10cSrcweir 					}
147cdf0e10cSrcweir                 }
148cdf0e10cSrcweir 			}
149cdf0e10cSrcweir 			return true;
150cdf0e10cSrcweir 		}
151cdf0e10cSrcweir 		break;
152cdf0e10cSrcweir 	}
153cdf0e10cSrcweir */
154cdf0e10cSrcweir 	case OWN_ATTR_OLE_VISAREA:
155cdf0e10cSrcweir 	{
156cdf0e10cSrcweir 		// TODO/LATER: seems to make no sence for iconified object
157cdf0e10cSrcweir 
158cdf0e10cSrcweir 		awt::Rectangle aVisArea;
159cdf0e10cSrcweir 		if( (rValue >>= aVisArea) && mpObj->ISA(SdrOle2Obj))
160cdf0e10cSrcweir 		{
161cdf0e10cSrcweir 			Size aTmp( aVisArea.X + aVisArea.Width, aVisArea.Y + aVisArea.Height );
162cdf0e10cSrcweir             uno::Reference < embed::XEmbeddedObject > xObj = ((SdrOle2Obj*)mpObj.get())->GetObjRef();
163cdf0e10cSrcweir             if( xObj.is() )
164cdf0e10cSrcweir 			{
165cdf0e10cSrcweir 				try
166cdf0e10cSrcweir 				{
167cdf0e10cSrcweir 					MapUnit aMapUnit( MAP_100TH_MM ); // the API handles with MAP_100TH_MM map mode
168cdf0e10cSrcweir 					MapUnit aObjUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( embed::Aspects::MSOLE_CONTENT ) );
169cdf0e10cSrcweir 					aTmp = OutputDevice::LogicToLogic( aTmp, aMapUnit, aObjUnit );
170cdf0e10cSrcweir 					xObj->setVisualAreaSize( embed::Aspects::MSOLE_CONTENT, awt::Size( aTmp.Width(), aTmp.Height() ) );
171cdf0e10cSrcweir 				}
172cdf0e10cSrcweir 				catch( uno::Exception& )
173cdf0e10cSrcweir 				{
174cdf0e10cSrcweir 					OSL_ENSURE( sal_False, "Couldn't set the visual area for the object!\n" );
175cdf0e10cSrcweir 				}
176cdf0e10cSrcweir 			}
177cdf0e10cSrcweir 
178cdf0e10cSrcweir 			return true;
179cdf0e10cSrcweir 		}
180cdf0e10cSrcweir 		break;
181cdf0e10cSrcweir 	}
182cdf0e10cSrcweir 	case OWN_ATTR_OLE_ASPECT:
183cdf0e10cSrcweir 	{
184cdf0e10cSrcweir 		sal_Int64 nAspect = 0;
185cdf0e10cSrcweir 		if( rValue >>= nAspect )
186cdf0e10cSrcweir 		{
187cdf0e10cSrcweir 			static_cast<SdrOle2Obj*>(mpObj.get())->SetAspect( nAspect );
188cdf0e10cSrcweir 			return true;
189cdf0e10cSrcweir 		}
190cdf0e10cSrcweir 		break;
191cdf0e10cSrcweir 	}
192cdf0e10cSrcweir 	case OWN_ATTR_CLSID:
193cdf0e10cSrcweir 	{
194cdf0e10cSrcweir 		OUString aCLSID;
195cdf0e10cSrcweir 		if( rValue >>= aCLSID )
196cdf0e10cSrcweir 		{
197cdf0e10cSrcweir 			// init a ole object with a global name
198cdf0e10cSrcweir 			SvGlobalName aClassName;
199cdf0e10cSrcweir 			if( aClassName.MakeId( aCLSID ) )
200cdf0e10cSrcweir 			{
201cdf0e10cSrcweir 				if( createObject( aClassName ) )
202cdf0e10cSrcweir 					return true;
203cdf0e10cSrcweir 			}
204cdf0e10cSrcweir 		}
205cdf0e10cSrcweir 		break;
206cdf0e10cSrcweir 	}
207cdf0e10cSrcweir 	case OWN_ATTR_THUMBNAIL:
208cdf0e10cSrcweir 	{
209cdf0e10cSrcweir 		OUString aURL;
210cdf0e10cSrcweir 		if( rValue >>= aURL )
211cdf0e10cSrcweir 		{
212cdf0e10cSrcweir 			GraphicObject aGrafObj( GraphicObject::CreateGraphicObjectFromURL( aURL ) );
213cdf0e10cSrcweir 			static_cast<SdrOle2Obj*>(mpObj.get())->SetGraphic( &aGrafObj.GetGraphic() );
214cdf0e10cSrcweir 			return true;
215cdf0e10cSrcweir 		}
216cdf0e10cSrcweir 		break;
217cdf0e10cSrcweir 	}
218cdf0e10cSrcweir 	case OWN_ATTR_VALUE_GRAPHIC:
219cdf0e10cSrcweir 	{
220cdf0e10cSrcweir 		uno::Reference< graphic::XGraphic > xGraphic( rValue, uno::UNO_QUERY );
221cdf0e10cSrcweir 		if( xGraphic.is() )
222cdf0e10cSrcweir 		{
223cdf0e10cSrcweir 			SdrOle2Obj* pOle = dynamic_cast< SdrOle2Obj* >( mpObj.get() );
224cdf0e10cSrcweir 			if( pOle )
225cdf0e10cSrcweir 			{
226cdf0e10cSrcweir 				GraphicObject aGrafObj( xGraphic );
227cdf0e10cSrcweir 				const Graphic aGraphic( aGrafObj.GetGraphic() );
228cdf0e10cSrcweir 				pOle->SetGraphicToObj( aGraphic, rtl::OUString() );
229cdf0e10cSrcweir 			}
230cdf0e10cSrcweir 			return true;
231cdf0e10cSrcweir 		}
232cdf0e10cSrcweir 		break;
233cdf0e10cSrcweir 	}
234cdf0e10cSrcweir 	case OWN_ATTR_PERSISTNAME:
235cdf0e10cSrcweir     {
236cdf0e10cSrcweir 		OUString aPersistName;
237cdf0e10cSrcweir         if( rValue >>= aPersistName )
238cdf0e10cSrcweir 		{
239cdf0e10cSrcweir 			static_cast<SdrOle2Obj*>(mpObj.get())->SetPersistName( aPersistName );
240cdf0e10cSrcweir             return true;
241cdf0e10cSrcweir 		}
242cdf0e10cSrcweir 		break;
243cdf0e10cSrcweir     }
244cdf0e10cSrcweir 	case OWN_ATTR_OLE_LINKURL:
245cdf0e10cSrcweir 	{
246cdf0e10cSrcweir 		OUString aLinkURL;
247cdf0e10cSrcweir 		if( rValue >>= aLinkURL )
248cdf0e10cSrcweir 		{
249cdf0e10cSrcweir 			createLink( aLinkURL );
250cdf0e10cSrcweir 			return true;
251cdf0e10cSrcweir 		}
252cdf0e10cSrcweir 		break;
253cdf0e10cSrcweir 	}
254cdf0e10cSrcweir 	default:
255*a5258243SPedro Giffuni         return SvxShapeText::setPropertyValueImpl( rName, pProperty, rValue );
256cdf0e10cSrcweir 	}
257cdf0e10cSrcweir 
258cdf0e10cSrcweir 	throw IllegalArgumentException();
259cdf0e10cSrcweir }
260cdf0e10cSrcweir 
261cdf0e10cSrcweir bool SvxOle2Shape::getPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
262cdf0e10cSrcweir {
263cdf0e10cSrcweir 	switch( pProperty->nWID )
264cdf0e10cSrcweir 	{
265cdf0e10cSrcweir 	case OWN_ATTR_CLSID:
266cdf0e10cSrcweir 	{
267cdf0e10cSrcweir 		OUString aCLSID;
268cdf0e10cSrcweir 		SvGlobalName aClassName = GetClassName_Impl(aCLSID);
269cdf0e10cSrcweir 		rValue <<= aCLSID;
270cdf0e10cSrcweir 		break;
271cdf0e10cSrcweir 	}
272cdf0e10cSrcweir 
273cdf0e10cSrcweir 	case OWN_ATTR_INTERNAL_OLE:
274cdf0e10cSrcweir 	{
275cdf0e10cSrcweir 		rtl::OUString sCLSID;
276cdf0e10cSrcweir 		rValue <<= SotExchange::IsInternal( GetClassName_Impl(sCLSID) );
277cdf0e10cSrcweir 		break;
278cdf0e10cSrcweir 	}
279cdf0e10cSrcweir 
280cdf0e10cSrcweir 	case OWN_ATTR_METAFILE:
281cdf0e10cSrcweir 	{
282cdf0e10cSrcweir 		SdrOle2Obj* pObj = dynamic_cast<SdrOle2Obj*>(mpObj.get());
283cdf0e10cSrcweir 		if( pObj )
284cdf0e10cSrcweir 		{
285cdf0e10cSrcweir 			Graphic* pGraphic = pObj->GetGraphic();
286cdf0e10cSrcweir 			if( pGraphic )
287cdf0e10cSrcweir 			{
288cdf0e10cSrcweir 				sal_Bool bIsWMF = sal_False;
289cdf0e10cSrcweir 				if ( pGraphic->IsLink() )
290cdf0e10cSrcweir 				{
291cdf0e10cSrcweir 					GfxLink aLnk = pGraphic->GetLink();
292cdf0e10cSrcweir 					if ( aLnk.GetType() == GFX_LINK_TYPE_NATIVE_WMF )
293cdf0e10cSrcweir 					{
294cdf0e10cSrcweir 						bIsWMF = sal_True;
295cdf0e10cSrcweir 						uno::Sequence<sal_Int8> aSeq((sal_Int8*)aLnk.GetData(), (sal_Int32) aLnk.GetDataSize());
296cdf0e10cSrcweir 						rValue <<= aSeq;
297cdf0e10cSrcweir 					}
298cdf0e10cSrcweir 				}
299cdf0e10cSrcweir 				if ( !bIsWMF )
300cdf0e10cSrcweir 				{
301cdf0e10cSrcweir 					GDIMetaFile aMtf;
302cdf0e10cSrcweir 					if ( pGraphic->GetType() != GRAPHIC_BITMAP )
303cdf0e10cSrcweir 						aMtf = pObj->GetGraphic()->GetGDIMetaFile();
304cdf0e10cSrcweir 					else
305cdf0e10cSrcweir 					{
306cdf0e10cSrcweir 						VirtualDevice aVirDev;
307cdf0e10cSrcweir 						aMtf.Record( &aVirDev );
308cdf0e10cSrcweir 						pGraphic->Draw( &aVirDev, Point(),  pGraphic->GetPrefSize() );
309cdf0e10cSrcweir 						aMtf.Stop();
310cdf0e10cSrcweir 						aMtf.SetPrefSize( pGraphic->GetPrefSize() );
311cdf0e10cSrcweir 						aMtf.SetPrefMapMode( pGraphic->GetPrefMapMode() );
312cdf0e10cSrcweir 					}
313cdf0e10cSrcweir 					SvMemoryStream aDestStrm( 65535, 65535 );
314cdf0e10cSrcweir 					ConvertGDIMetaFileToWMF( aMtf, aDestStrm, NULL, sal_False );
315cdf0e10cSrcweir                     const uno::Sequence<sal_Int8> aSeq(
316cdf0e10cSrcweir                         static_cast< const sal_Int8* >(aDestStrm.GetData()),
317cdf0e10cSrcweir                         aDestStrm.GetEndOfData());
318cdf0e10cSrcweir 					rValue <<= aSeq;
319cdf0e10cSrcweir 				}
320cdf0e10cSrcweir 			}
321cdf0e10cSrcweir 		}
322cdf0e10cSrcweir 		else
323cdf0e10cSrcweir 		{
324cdf0e10cSrcweir 			rValue = GetBitmap( sal_True );
325cdf0e10cSrcweir 		}
326cdf0e10cSrcweir 		break;
327cdf0e10cSrcweir 	}
328cdf0e10cSrcweir 
329cdf0e10cSrcweir 	case OWN_ATTR_OLE_VISAREA:
330cdf0e10cSrcweir 	{
331cdf0e10cSrcweir 		awt::Rectangle aVisArea;
332cdf0e10cSrcweir 		if( mpObj->ISA(SdrOle2Obj))
333cdf0e10cSrcweir 		{
334cdf0e10cSrcweir 			MapMode aMapMode( MAP_100TH_MM ); // the API uses this map mode
335cdf0e10cSrcweir 			Size aTmp = ((SdrOle2Obj*)mpObj.get())->GetOrigObjSize( &aMapMode ); // get the size in the requested map mode
336cdf0e10cSrcweir 			aVisArea = awt::Rectangle( 0, 0, aTmp.Width(), aTmp.Height() );
337cdf0e10cSrcweir 		}
338cdf0e10cSrcweir 
339cdf0e10cSrcweir 		rValue <<= aVisArea;
340cdf0e10cSrcweir 		break;
341cdf0e10cSrcweir 	}
342cdf0e10cSrcweir 
343cdf0e10cSrcweir 	case OWN_ATTR_OLESIZE:
344cdf0e10cSrcweir 	{
345cdf0e10cSrcweir 		Size aTmp( static_cast<SdrOle2Obj*>(mpObj.get())->GetOrigObjSize() );
346cdf0e10cSrcweir 		rValue <<= awt::Size( aTmp.Width(), aTmp.Height() );
347cdf0e10cSrcweir 		break;
348cdf0e10cSrcweir 	}
349cdf0e10cSrcweir 
350cdf0e10cSrcweir 	case OWN_ATTR_OLE_ASPECT:
351cdf0e10cSrcweir 	{
352cdf0e10cSrcweir 		rValue <<= static_cast<SdrOle2Obj*>(mpObj.get())->GetAspect();
353cdf0e10cSrcweir 		break;
354cdf0e10cSrcweir 	}
355cdf0e10cSrcweir 
356cdf0e10cSrcweir 	case OWN_ATTR_OLEMODEL:
357cdf0e10cSrcweir 	case OWN_ATTR_OLE_EMBEDDED_OBJECT:
358cdf0e10cSrcweir 	case OWN_ATTR_OLE_EMBEDDED_OBJECT_NONEWCLIENT:
359cdf0e10cSrcweir 	{
360cdf0e10cSrcweir 		SdrOle2Obj* pObj = dynamic_cast<SdrOle2Obj*>( mpObj.get() );
361cdf0e10cSrcweir 		if( pObj )
362cdf0e10cSrcweir 		{
363cdf0e10cSrcweir             uno::Reference < embed::XEmbeddedObject > xObj( pObj->GetObjRef() );
364cdf0e10cSrcweir             if ( xObj.is()
365cdf0e10cSrcweir 			  && ( pProperty->nWID == OWN_ATTR_OLE_EMBEDDED_OBJECT || pProperty->nWID == OWN_ATTR_OLE_EMBEDDED_OBJECT_NONEWCLIENT || svt::EmbeddedObjectRef::TryRunningState( xObj ) ) )
366cdf0e10cSrcweir 			{
367cdf0e10cSrcweir 				// Discussed with CL fue to the before GetPaintingPageView
368cdf0e10cSrcweir 				// usage. Removed it, former fallback is used now
369cdf0e10cSrcweir                 if ( pProperty->nWID == OWN_ATTR_OLEMODEL || pProperty->nWID == OWN_ATTR_OLE_EMBEDDED_OBJECT )
370cdf0e10cSrcweir                 {
371cdf0e10cSrcweir #ifdef DBG_UTIL
372cdf0e10cSrcweir 				    const sal_Bool bSuccess(pObj->AddOwnLightClient());
373cdf0e10cSrcweir 				    OSL_ENSURE( bSuccess, "An object without client is provided!" );
374cdf0e10cSrcweir #else
375cdf0e10cSrcweir 				    pObj->AddOwnLightClient();
376cdf0e10cSrcweir #endif
377cdf0e10cSrcweir                 }
378cdf0e10cSrcweir 
379cdf0e10cSrcweir 				if ( pProperty->nWID == OWN_ATTR_OLEMODEL )
380cdf0e10cSrcweir 					rValue <<= pObj->GetObjRef()->getComponent();
381cdf0e10cSrcweir 				else
382cdf0e10cSrcweir 					rValue <<= xObj;
383cdf0e10cSrcweir 			}
384cdf0e10cSrcweir 		}
385cdf0e10cSrcweir 		break;
386cdf0e10cSrcweir 	}
387cdf0e10cSrcweir 
388cdf0e10cSrcweir 	case OWN_ATTR_VALUE_GRAPHIC:
389cdf0e10cSrcweir 	{
390cdf0e10cSrcweir 		uno::Reference< graphic::XGraphic > xGraphic;
391cdf0e10cSrcweir 		Graphic* pGraphic = static_cast<SdrOle2Obj*>( mpObj.get() )->GetGraphic();
392cdf0e10cSrcweir 		if( pGraphic )
393cdf0e10cSrcweir 			xGraphic = pGraphic->GetXGraphic();
394cdf0e10cSrcweir 		rValue <<= xGraphic;
395cdf0e10cSrcweir 		break;
396cdf0e10cSrcweir 	}
397cdf0e10cSrcweir 
398cdf0e10cSrcweir 	case OWN_ATTR_THUMBNAIL:
399cdf0e10cSrcweir 	{
400cdf0e10cSrcweir 		OUString    aURL;
401cdf0e10cSrcweir 		SdrOle2Obj* pOle = dynamic_cast< SdrOle2Obj* >( mpObj.get() );
402cdf0e10cSrcweir         if( pOle )
403cdf0e10cSrcweir 		{
404cdf0e10cSrcweir 			Graphic* pGraphic = pOle->GetGraphic();
405cdf0e10cSrcweir 
406cdf0e10cSrcweir 			// if there isn't already a preview graphic set, check if we need to generate
407cdf0e10cSrcweir 			// one if model says so
408cdf0e10cSrcweir 			if( pGraphic == NULL && !pOle->IsEmptyPresObj() && mpModel->IsSaveOLEPreview() )
409cdf0e10cSrcweir                 pGraphic = pOle->GetGraphic();
410cdf0e10cSrcweir 
411cdf0e10cSrcweir 			if( pGraphic )
412cdf0e10cSrcweir 			{
413cdf0e10cSrcweir 				GraphicObject aObj( *pGraphic );
414cdf0e10cSrcweir 				aURL = OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX));
415cdf0e10cSrcweir 				aURL += OUString::createFromAscii( aObj.GetUniqueID().GetBuffer() );
416cdf0e10cSrcweir 			}
417cdf0e10cSrcweir 		}
418cdf0e10cSrcweir 		rValue <<= aURL;
419cdf0e10cSrcweir 		break;
420cdf0e10cSrcweir 	}
421cdf0e10cSrcweir 	case OWN_ATTR_PERSISTNAME:
422cdf0e10cSrcweir     {
423cdf0e10cSrcweir 		OUString    aPersistName;
424cdf0e10cSrcweir 		SdrOle2Obj* pOle = dynamic_cast< SdrOle2Obj* >( mpObj.get() );
425cdf0e10cSrcweir 
426cdf0e10cSrcweir         if( pOle )
427cdf0e10cSrcweir 		{
428cdf0e10cSrcweir             aPersistName = pOle->GetPersistName();
429cdf0e10cSrcweir 			if( aPersistName.getLength() )
430cdf0e10cSrcweir 			{
431cdf0e10cSrcweir                 ::comphelper::IEmbeddedHelper *pPersist = mpObj->GetModel()->GetPersist();
432cdf0e10cSrcweir                 if( (NULL == pPersist) || !pPersist->getEmbeddedObjectContainer().HasEmbeddedObject( pOle->GetPersistName() ) )
433cdf0e10cSrcweir 					aPersistName = OUString();
434cdf0e10cSrcweir 			}
435cdf0e10cSrcweir 		}
436cdf0e10cSrcweir 
437cdf0e10cSrcweir 		rValue <<= aPersistName;
438cdf0e10cSrcweir 		break;
439cdf0e10cSrcweir     }
440cdf0e10cSrcweir 	case OWN_ATTR_OLE_LINKURL:
441cdf0e10cSrcweir 	{
442cdf0e10cSrcweir 		OUString    aLinkURL;
443cdf0e10cSrcweir 		SdrOle2Obj* pOle = dynamic_cast< SdrOle2Obj* >( mpObj.get() );
444cdf0e10cSrcweir 
445cdf0e10cSrcweir         if( pOle )
446cdf0e10cSrcweir 		{
447cdf0e10cSrcweir 			uno::Reference< embed::XLinkageSupport > xLink( pOle->GetObjRef(), uno::UNO_QUERY );
448cdf0e10cSrcweir 			if ( xLink.is() && xLink->isLink() )
449cdf0e10cSrcweir 				aLinkURL = xLink->getLinkURL();
450cdf0e10cSrcweir 		}
451cdf0e10cSrcweir 
452cdf0e10cSrcweir 		rValue <<= aLinkURL;
453cdf0e10cSrcweir 		break;
454cdf0e10cSrcweir 	}
455cdf0e10cSrcweir 	default:
456*a5258243SPedro Giffuni         return SvxShapeText::getPropertyValueImpl( rName, pProperty, rValue );
457cdf0e10cSrcweir 	}
458cdf0e10cSrcweir 
459cdf0e10cSrcweir 	return true;
460cdf0e10cSrcweir }
461cdf0e10cSrcweir 
462cdf0e10cSrcweir sal_Bool SvxOle2Shape::createObject( const SvGlobalName &aClassName )
463cdf0e10cSrcweir {
464cdf0e10cSrcweir     DBG_TESTSOLARMUTEX();
465cdf0e10cSrcweir 
466cdf0e10cSrcweir 	SdrOle2Obj* pOle2Obj = dynamic_cast< SdrOle2Obj* >( mpObj.get() );
467cdf0e10cSrcweir     if ( !pOle2Obj || !pOle2Obj->IsEmpty() )
468cdf0e10cSrcweir 		return sal_False;
469cdf0e10cSrcweir 
470cdf0e10cSrcweir 	// create storage and inplace object
471cdf0e10cSrcweir     ::comphelper::IEmbeddedHelper*     pPersist = mpModel->GetPersist();
472cdf0e10cSrcweir     ::rtl::OUString              aPersistName;
473cdf0e10cSrcweir     OUString            aTmpStr;
474cdf0e10cSrcweir 	if( getPropertyValue( OUString::createFromAscii( UNO_NAME_OLE2_PERSISTNAME ) ) >>= aTmpStr )
475cdf0e10cSrcweir         aPersistName = aTmpStr;
476cdf0e10cSrcweir 
477cdf0e10cSrcweir     //TODO/LATER: how to cope with creation failure?!
478cdf0e10cSrcweir     uno::Reference < embed::XEmbeddedObject > xObj( pPersist->getEmbeddedObjectContainer().CreateEmbeddedObject( aClassName.GetByteSequence(), aPersistName ) );
479cdf0e10cSrcweir     if( xObj.is() )
480cdf0e10cSrcweir     {
481cdf0e10cSrcweir         Rectangle aRect = pOle2Obj->GetLogicRect();
482cdf0e10cSrcweir         if ( aRect.GetWidth() == 100 && aRect.GetHeight() == 100 )
483cdf0e10cSrcweir         {
484cdf0e10cSrcweir 			// TODO/LATER: is it possible that this method is used to create an iconified object?
485cdf0e10cSrcweir             // default size
486cdf0e10cSrcweir 			try
487cdf0e10cSrcweir 			{
488cdf0e10cSrcweir             	awt::Size aSz = xObj->getVisualAreaSize( pOle2Obj->GetAspect() );
489cdf0e10cSrcweir             	aRect.SetSize( Size( aSz.Width, aSz.Height ) );
490cdf0e10cSrcweir 			}
491cdf0e10cSrcweir 			catch( embed::NoVisualAreaSizeException& )
492cdf0e10cSrcweir 			{}
493cdf0e10cSrcweir             pOle2Obj->SetLogicRect( aRect );
494cdf0e10cSrcweir         }
495cdf0e10cSrcweir         else
496cdf0e10cSrcweir         {
497cdf0e10cSrcweir             awt::Size aSz;
498cdf0e10cSrcweir             Size aSize = pOle2Obj->GetLogicRect().GetSize();
499cdf0e10cSrcweir             aSz.Width = aSize.Width();
500cdf0e10cSrcweir             aSz.Height = aSize.Height();
501cdf0e10cSrcweir 			xObj->setVisualAreaSize(  pOle2Obj->GetAspect(), aSz );
502cdf0e10cSrcweir         }
503cdf0e10cSrcweir 
504cdf0e10cSrcweir 		// connect the object after the visual area is set
505cdf0e10cSrcweir         setPropertyValue( OUString::createFromAscii( UNO_NAME_OLE2_PERSISTNAME ), Any( aTmpStr = aPersistName ) );
506cdf0e10cSrcweir 
507cdf0e10cSrcweir 		// the object is inserted during setting of PersistName property usually
508cdf0e10cSrcweir 		if( pOle2Obj->IsEmpty() )
509cdf0e10cSrcweir 			pOle2Obj->SetObjRef( xObj );
510cdf0e10cSrcweir     }
511cdf0e10cSrcweir 
512cdf0e10cSrcweir     return xObj.is();
513cdf0e10cSrcweir }
514cdf0e10cSrcweir 
515cdf0e10cSrcweir sal_Bool SvxOle2Shape::createLink( const ::rtl::OUString& aLinkURL )
516cdf0e10cSrcweir {
517cdf0e10cSrcweir     DBG_TESTSOLARMUTEX();
518cdf0e10cSrcweir 
519cdf0e10cSrcweir 	SdrOle2Obj* pOle2Obj = dynamic_cast< SdrOle2Obj* >( mpObj.get() );
520cdf0e10cSrcweir     if ( !pOle2Obj || !pOle2Obj->IsEmpty() )
521cdf0e10cSrcweir 		return sal_False;
522cdf0e10cSrcweir 
523cdf0e10cSrcweir     ::rtl::OUString aPersistName;
524cdf0e10cSrcweir 
525cdf0e10cSrcweir     ::comphelper::IEmbeddedHelper* pPersist = mpModel->GetPersist();
526cdf0e10cSrcweir 
527cdf0e10cSrcweir 	uno::Sequence< beans::PropertyValue > aMediaDescr( 1 );
528cdf0e10cSrcweir 	aMediaDescr[0].Name = ::rtl::OUString::createFromAscii( "URL" );
529cdf0e10cSrcweir 	aMediaDescr[0].Value <<= aLinkURL;
530cdf0e10cSrcweir 
531cdf0e10cSrcweir 	uno::Reference< task::XInteractionHandler > xInteraction = pPersist->getInteractionHandler();
532cdf0e10cSrcweir 	if ( xInteraction.is() )
533cdf0e10cSrcweir 	{
534cdf0e10cSrcweir 		aMediaDescr.realloc( 2 );
535cdf0e10cSrcweir 		aMediaDescr[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InteractionHandler" ) );
536cdf0e10cSrcweir 		aMediaDescr[1].Value <<= xInteraction;
537cdf0e10cSrcweir 	}
538cdf0e10cSrcweir 
539cdf0e10cSrcweir     //TODO/LATER: how to cope with creation failure?!
540cdf0e10cSrcweir 	uno::Reference< embed::XEmbeddedObject > xObj =
541cdf0e10cSrcweir 			pPersist->getEmbeddedObjectContainer().InsertEmbeddedLink( aMediaDescr , aPersistName );
542cdf0e10cSrcweir 
543cdf0e10cSrcweir     if( xObj.is() )
544cdf0e10cSrcweir     {
545cdf0e10cSrcweir         Rectangle aRect = pOle2Obj->GetLogicRect();
546cdf0e10cSrcweir         if ( aRect.GetWidth() == 100 && aRect.GetHeight() == 100 )
547cdf0e10cSrcweir         {
548cdf0e10cSrcweir             // default size
549cdf0e10cSrcweir 			try
550cdf0e10cSrcweir 			{
551cdf0e10cSrcweir             	awt::Size aSz = xObj->getVisualAreaSize( pOle2Obj->GetAspect() );
552cdf0e10cSrcweir             	aRect.SetSize( Size( aSz.Width, aSz.Height ) );
553cdf0e10cSrcweir 			}
554cdf0e10cSrcweir 			catch( embed::NoVisualAreaSizeException& )
555cdf0e10cSrcweir 			{}
556cdf0e10cSrcweir 			pOle2Obj->SetLogicRect( aRect );
557cdf0e10cSrcweir         }
558cdf0e10cSrcweir         else
559cdf0e10cSrcweir         {
560cdf0e10cSrcweir             awt::Size aSz;
561cdf0e10cSrcweir             Size aSize = pOle2Obj->GetLogicRect().GetSize();
562cdf0e10cSrcweir             aSz.Width = aSize.Width();
563cdf0e10cSrcweir             aSz.Height = aSize.Height();
564cdf0e10cSrcweir             xObj->setVisualAreaSize(  pOle2Obj->GetAspect(), aSz );
565cdf0e10cSrcweir         }
566cdf0e10cSrcweir 
567cdf0e10cSrcweir 		// connect the object after the visual area is set
568cdf0e10cSrcweir         setPropertyValue( OUString::createFromAscii( UNO_NAME_OLE2_PERSISTNAME ), uno::makeAny( aPersistName ) );
569cdf0e10cSrcweir 
570cdf0e10cSrcweir 		// the object is inserted during setting of PersistName property usually
571cdf0e10cSrcweir 		if ( pOle2Obj->IsEmpty() )
572cdf0e10cSrcweir 			pOle2Obj->SetObjRef( xObj );
573cdf0e10cSrcweir     }
574cdf0e10cSrcweir 
575cdf0e10cSrcweir     return xObj.is();
576cdf0e10cSrcweir }
577cdf0e10cSrcweir 
578cdf0e10cSrcweir void SvxOle2Shape::resetModifiedState()
579cdf0e10cSrcweir {
580cdf0e10cSrcweir 	::comphelper::IEmbeddedHelper* pPersist = mpModel ? mpModel->GetPersist() : 0;
581cdf0e10cSrcweir 	if( pPersist && !pPersist->isEnableSetModified() )
582cdf0e10cSrcweir 	{
583cdf0e10cSrcweir 		SdrOle2Obj* pOle = dynamic_cast< SdrOle2Obj* >( mpObj.get() );
584cdf0e10cSrcweir         if( pOle && !pOle->IsEmpty() )
585cdf0e10cSrcweir 		{
586cdf0e10cSrcweir             uno::Reference < util::XModifiable > xMod( pOle->GetObjRef(), uno::UNO_QUERY );
587cdf0e10cSrcweir             if( xMod.is() )
588cdf0e10cSrcweir                 // TODO/MBA: what's this?!
589cdf0e10cSrcweir                 xMod->setModified( sal_False );
590cdf0e10cSrcweir 		}
591cdf0e10cSrcweir 	}
592cdf0e10cSrcweir }
593cdf0e10cSrcweir 
594cdf0e10cSrcweir const SvGlobalName SvxOle2Shape::GetClassName_Impl(rtl::OUString& rHexCLSID)
595cdf0e10cSrcweir {
596cdf0e10cSrcweir     DBG_TESTSOLARMUTEX();
597cdf0e10cSrcweir 	SvGlobalName aClassName;
598cdf0e10cSrcweir 	SdrOle2Obj* pOle2Obj = dynamic_cast< SdrOle2Obj* >( mpObj.get() );
599cdf0e10cSrcweir 
600cdf0e10cSrcweir 	if( pOle2Obj )
601cdf0e10cSrcweir 	{
602cdf0e10cSrcweir 		rHexCLSID = rtl::OUString();
603cdf0e10cSrcweir 
604cdf0e10cSrcweir 		if( pOle2Obj->IsEmpty() )
605cdf0e10cSrcweir 		{
606cdf0e10cSrcweir             ::comphelper::IEmbeddedHelper* pPersist = mpModel->GetPersist();
607cdf0e10cSrcweir             if( pPersist )
608cdf0e10cSrcweir 			{
609cdf0e10cSrcweir                 uno::Reference < embed::XEmbeddedObject > xObj =
610cdf0e10cSrcweir                         pPersist->getEmbeddedObjectContainer().GetEmbeddedObject( pOle2Obj->GetPersistName() );
611cdf0e10cSrcweir                 if ( xObj.is() )
612cdf0e10cSrcweir 				{
613cdf0e10cSrcweir                     aClassName = SvGlobalName( xObj->getClassID() );
614cdf0e10cSrcweir 					rHexCLSID = aClassName.GetHexName();
615cdf0e10cSrcweir 				}
616cdf0e10cSrcweir             }
617cdf0e10cSrcweir 		}
618cdf0e10cSrcweir 
619cdf0e10cSrcweir         if (!rHexCLSID.getLength())
620cdf0e10cSrcweir 		{
621cdf0e10cSrcweir             uno::Reference < embed::XEmbeddedObject > xObj( pOle2Obj->GetObjRef() );
622cdf0e10cSrcweir             if ( xObj.is() )
623cdf0e10cSrcweir 			{
624cdf0e10cSrcweir                 aClassName = SvGlobalName( xObj->getClassID() );
625cdf0e10cSrcweir 				rHexCLSID = aClassName.GetHexName();
626cdf0e10cSrcweir             }
627cdf0e10cSrcweir 		}
628cdf0e10cSrcweir 	}
629cdf0e10cSrcweir 
630cdf0e10cSrcweir     return aClassName;
631cdf0e10cSrcweir }
632cdf0e10cSrcweir 
633cdf0e10cSrcweir ///////////////////////////////////////////////////////////////////////
634cdf0e10cSrcweir 
635cdf0e10cSrcweir SvxAppletShape::SvxAppletShape( SdrObject* pObject ) throw()
636cdf0e10cSrcweir : SvxOle2Shape( pObject, aSvxMapProvider.GetMap(SVXMAP_APPLET), aSvxMapProvider.GetPropertySet(SVXMAP_APPLET, SdrObject::GetGlobalDrawObjectItemPool())  )
637cdf0e10cSrcweir {
638cdf0e10cSrcweir 	SetShapeType( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.AppletShape" ) ) );
639cdf0e10cSrcweir }
640cdf0e10cSrcweir 
641cdf0e10cSrcweir SvxAppletShape::~SvxAppletShape() throw()
642cdf0e10cSrcweir {
643cdf0e10cSrcweir }
644cdf0e10cSrcweir 
645cdf0e10cSrcweir void SvxAppletShape::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage )
646cdf0e10cSrcweir {
647cdf0e10cSrcweir 	SvxShape::Create( pNewObj, pNewPage );
648cdf0e10cSrcweir 	const SvGlobalName aAppletClassId( SO3_APPLET_CLASSID );
649cdf0e10cSrcweir 	createObject(aAppletClassId);
650cdf0e10cSrcweir 	SetShapeType( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.AppletShape" ) ) );
651cdf0e10cSrcweir }
652cdf0e10cSrcweir 
653cdf0e10cSrcweir void SAL_CALL SvxAppletShape::setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
654cdf0e10cSrcweir {
655cdf0e10cSrcweir 	SvxShape::setPropertyValue( aPropertyName, rValue );
656cdf0e10cSrcweir 	resetModifiedState();
657cdf0e10cSrcweir }
658cdf0e10cSrcweir 
659cdf0e10cSrcweir void SAL_CALL SvxAppletShape::setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rValues ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
660cdf0e10cSrcweir {
661cdf0e10cSrcweir 	SvxShape::setPropertyValues( aPropertyNames, rValues );
662cdf0e10cSrcweir 	resetModifiedState();
663cdf0e10cSrcweir }
664cdf0e10cSrcweir 
665cdf0e10cSrcweir bool SvxAppletShape::setPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
666cdf0e10cSrcweir {
667cdf0e10cSrcweir 	if( (pProperty->nWID >= OWN_ATTR_APPLET_DOCBASE) && (pProperty->nWID <= OWN_ATTR_APPLET_ISSCRIPT) )
668cdf0e10cSrcweir 	{
669cdf0e10cSrcweir         if ( svt::EmbeddedObjectRef::TryRunningState( static_cast<SdrOle2Obj*>(mpObj.get())->GetObjRef() ) )
670cdf0e10cSrcweir 		{
671cdf0e10cSrcweir 	        uno::Reference < beans::XPropertySet > xSet( static_cast<SdrOle2Obj*>(mpObj.get())->GetObjRef()->getComponent(), uno::UNO_QUERY );
672cdf0e10cSrcweir 		    if( xSet.is() )
673cdf0e10cSrcweir 			{
674cdf0e10cSrcweir 				// allow exceptions to pass through
675cdf0e10cSrcweir                 xSet->setPropertyValue( rName, rValue );
676cdf0e10cSrcweir 			}
677cdf0e10cSrcweir 		}
678cdf0e10cSrcweir 		return true;
679cdf0e10cSrcweir 	}
680cdf0e10cSrcweir 	else
681cdf0e10cSrcweir 	{
682cdf0e10cSrcweir         return SvxOle2Shape::setPropertyValueImpl( rName, pProperty, rValue );
683cdf0e10cSrcweir 	}
684cdf0e10cSrcweir }
685cdf0e10cSrcweir 
686cdf0e10cSrcweir bool SvxAppletShape::getPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
687cdf0e10cSrcweir {
688cdf0e10cSrcweir     if( (pProperty->nWID >= OWN_ATTR_APPLET_DOCBASE) && (pProperty->nWID <= OWN_ATTR_APPLET_ISSCRIPT) )
689cdf0e10cSrcweir 	{
690cdf0e10cSrcweir         if ( svt::EmbeddedObjectRef::TryRunningState( static_cast<SdrOle2Obj*>(mpObj.get())->GetObjRef() ) )
691cdf0e10cSrcweir 		{
692cdf0e10cSrcweir 			uno::Reference < beans::XPropertySet > xSet( static_cast<SdrOle2Obj*>(mpObj.get())->GetObjRef()->getComponent(), uno::UNO_QUERY );
693cdf0e10cSrcweir 			if( xSet.is() )
694cdf0e10cSrcweir 			{
695cdf0e10cSrcweir                 rValue = xSet->getPropertyValue( rName );
696cdf0e10cSrcweir 			}
697cdf0e10cSrcweir         }
698cdf0e10cSrcweir 		return true;
699cdf0e10cSrcweir 	}
700cdf0e10cSrcweir 	else
701cdf0e10cSrcweir 	{
702cdf0e10cSrcweir         return SvxOle2Shape::getPropertyValueImpl( rName, pProperty, rValue );
703cdf0e10cSrcweir 	}
704cdf0e10cSrcweir }
705cdf0e10cSrcweir 
706cdf0e10cSrcweir ///////////////////////////////////////////////////////////////////////
707cdf0e10cSrcweir 
708cdf0e10cSrcweir SvxPluginShape::SvxPluginShape( SdrObject* pObject ) throw()
709cdf0e10cSrcweir : SvxOle2Shape( pObject, aSvxMapProvider.GetMap(SVXMAP_PLUGIN), aSvxMapProvider.GetPropertySet(SVXMAP_PLUGIN, SdrObject::GetGlobalDrawObjectItemPool()) )
710cdf0e10cSrcweir {
711cdf0e10cSrcweir 	SetShapeType( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.PluginShape" ) ) );
712cdf0e10cSrcweir }
713cdf0e10cSrcweir 
714cdf0e10cSrcweir SvxPluginShape::~SvxPluginShape() throw()
715cdf0e10cSrcweir {
716cdf0e10cSrcweir }
717cdf0e10cSrcweir 
718cdf0e10cSrcweir void SvxPluginShape::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage )
719cdf0e10cSrcweir {
720cdf0e10cSrcweir 	SvxShape::Create( pNewObj, pNewPage );
721cdf0e10cSrcweir 	const SvGlobalName aPluginClassId( SO3_PLUGIN_CLASSID );
722cdf0e10cSrcweir 	createObject(aPluginClassId);
723cdf0e10cSrcweir 	SetShapeType( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.PluginShape" ) ) );
724cdf0e10cSrcweir }
725cdf0e10cSrcweir 
726cdf0e10cSrcweir void SAL_CALL SvxPluginShape::setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
727cdf0e10cSrcweir {
728cdf0e10cSrcweir 	SvxShape::setPropertyValue( aPropertyName, rValue );
729cdf0e10cSrcweir 	resetModifiedState();
730cdf0e10cSrcweir }
731cdf0e10cSrcweir 
732cdf0e10cSrcweir void SAL_CALL SvxPluginShape::setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rValues ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
733cdf0e10cSrcweir {
734*a5258243SPedro Giffuni 	SvxShape::setPropertyValues( aPropertyNames, rValues );
735cdf0e10cSrcweir 	resetModifiedState();
736cdf0e10cSrcweir }
737cdf0e10cSrcweir 
738cdf0e10cSrcweir bool SvxPluginShape::setPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
739cdf0e10cSrcweir {
740cdf0e10cSrcweir 	if( (pProperty->nWID >= OWN_ATTR_PLUGIN_MIMETYPE) && (pProperty->nWID <= OWN_ATTR_PLUGIN_COMMANDS) )
741cdf0e10cSrcweir 	{
742cdf0e10cSrcweir         if( svt::EmbeddedObjectRef::TryRunningState( static_cast<SdrOle2Obj*>(mpObj.get())->GetObjRef() ) )
743cdf0e10cSrcweir 		{
744cdf0e10cSrcweir 	        uno::Reference < beans::XPropertySet > xSet( static_cast<SdrOle2Obj*>(mpObj.get())->GetObjRef()->getComponent(), uno::UNO_QUERY );
745cdf0e10cSrcweir 			if( xSet.is() )
746cdf0e10cSrcweir 			{
747cdf0e10cSrcweir                 // allow exceptions to pass through
748cdf0e10cSrcweir                 xSet->setPropertyValue( rName, rValue );
749cdf0e10cSrcweir 			}
750cdf0e10cSrcweir 		}
751cdf0e10cSrcweir 		return true;
752cdf0e10cSrcweir 	}
753cdf0e10cSrcweir 	else
754cdf0e10cSrcweir 	{
755cdf0e10cSrcweir         return SvxOle2Shape::setPropertyValueImpl( rName, pProperty, rValue );
756cdf0e10cSrcweir 	}
757cdf0e10cSrcweir }
758cdf0e10cSrcweir 
759cdf0e10cSrcweir bool SvxPluginShape::getPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
760cdf0e10cSrcweir {
761cdf0e10cSrcweir 	if( (pProperty->nWID >= OWN_ATTR_PLUGIN_MIMETYPE) && (pProperty->nWID <= OWN_ATTR_PLUGIN_COMMANDS) )
762cdf0e10cSrcweir 	{
763cdf0e10cSrcweir 		if( svt::EmbeddedObjectRef::TryRunningState( static_cast<SdrOle2Obj*>(mpObj.get())->GetObjRef() ) )
764cdf0e10cSrcweir 		{
765cdf0e10cSrcweir 			uno::Reference < beans::XPropertySet > xSet( static_cast<SdrOle2Obj*>(mpObj.get())->GetObjRef()->getComponent(), uno::UNO_QUERY );
766cdf0e10cSrcweir 			if( xSet.is() )
767cdf0e10cSrcweir 			{
768cdf0e10cSrcweir                 rValue <<= xSet->getPropertyValue( rName );
769cdf0e10cSrcweir             }
770cdf0e10cSrcweir 		}
771cdf0e10cSrcweir 		return true;
772cdf0e10cSrcweir 	}
773cdf0e10cSrcweir 	else
774cdf0e10cSrcweir 	{
775cdf0e10cSrcweir         return SvxOle2Shape::getPropertyValueImpl( rName, pProperty, rValue );
776cdf0e10cSrcweir 	}
777cdf0e10cSrcweir }
778cdf0e10cSrcweir 
779cdf0e10cSrcweir ///////////////////////////////////////////////////////////////////////
780cdf0e10cSrcweir 
781cdf0e10cSrcweir SvxFrameShape::SvxFrameShape( SdrObject* pObject ) throw()
782cdf0e10cSrcweir : SvxOle2Shape( pObject, aSvxMapProvider.GetMap(SVXMAP_FRAME), aSvxMapProvider.GetPropertySet(SVXMAP_FRAME, SdrObject::GetGlobalDrawObjectItemPool())  )
783cdf0e10cSrcweir {
784cdf0e10cSrcweir 	SetShapeType( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.FrameShape" ) ) );
785cdf0e10cSrcweir }
786cdf0e10cSrcweir 
787cdf0e10cSrcweir SvxFrameShape::~SvxFrameShape() throw()
788cdf0e10cSrcweir {
789cdf0e10cSrcweir }
790cdf0e10cSrcweir 
791cdf0e10cSrcweir void SvxFrameShape::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage ) throw ()
792cdf0e10cSrcweir {
793cdf0e10cSrcweir 	SvxShape::Create( pNewObj, pNewPage );
794cdf0e10cSrcweir 	const SvGlobalName aIFrameClassId( SO3_IFRAME_CLASSID );
795cdf0e10cSrcweir 	createObject(aIFrameClassId);
796cdf0e10cSrcweir 	SetShapeType( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.FrameShape" ) ) );
797cdf0e10cSrcweir }
798cdf0e10cSrcweir 
799cdf0e10cSrcweir void SAL_CALL SvxFrameShape::setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
800cdf0e10cSrcweir {
801cdf0e10cSrcweir 	SvxShape::setPropertyValue( aPropertyName, rValue );
802cdf0e10cSrcweir 	resetModifiedState();
803cdf0e10cSrcweir }
804cdf0e10cSrcweir 
805cdf0e10cSrcweir void SAL_CALL SvxFrameShape::setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rValues ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
806cdf0e10cSrcweir {
807*a5258243SPedro Giffuni 	SvxShape::setPropertyValues( aPropertyNames, rValues );
808cdf0e10cSrcweir 	resetModifiedState();
809cdf0e10cSrcweir }
810cdf0e10cSrcweir 
811cdf0e10cSrcweir bool SvxFrameShape::setPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
812cdf0e10cSrcweir {
813cdf0e10cSrcweir 	if( (pProperty->nWID >= OWN_ATTR_FRAME_URL) && (pProperty->nWID <= OWN_ATTR_FRAME_MARGIN_HEIGHT) )
814cdf0e10cSrcweir 	{
815cdf0e10cSrcweir 		if( svt::EmbeddedObjectRef::TryRunningState( static_cast<SdrOle2Obj*>(mpObj.get())->GetObjRef() ) )
816cdf0e10cSrcweir 		{
817cdf0e10cSrcweir 			uno::Reference < beans::XPropertySet > xSet( static_cast<SdrOle2Obj*>(mpObj.get())->GetObjRef()->getComponent(), uno::UNO_QUERY );
818cdf0e10cSrcweir 			if( xSet.is() )
819cdf0e10cSrcweir 			{
820cdf0e10cSrcweir 				// allow exceptions to pass through
821cdf0e10cSrcweir                 xSet->setPropertyValue( rName, rValue );
822cdf0e10cSrcweir 			}
823cdf0e10cSrcweir 		}
824cdf0e10cSrcweir 		return true;
825cdf0e10cSrcweir 	}
826cdf0e10cSrcweir 	else
827cdf0e10cSrcweir 	{
828cdf0e10cSrcweir         return SvxOle2Shape::setPropertyValueImpl( rName, pProperty, rValue );
829cdf0e10cSrcweir 	}
830cdf0e10cSrcweir }
831cdf0e10cSrcweir 
832cdf0e10cSrcweir bool SvxFrameShape::getPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
833cdf0e10cSrcweir {
834cdf0e10cSrcweir 	if( (pProperty->nWID >= OWN_ATTR_FRAME_URL) && (pProperty->nWID <= OWN_ATTR_FRAME_MARGIN_HEIGHT) )
835cdf0e10cSrcweir 	{
836cdf0e10cSrcweir 		if( svt::EmbeddedObjectRef::TryRunningState( static_cast<SdrOle2Obj*>(mpObj.get())->GetObjRef() ) )
837cdf0e10cSrcweir 		{
838cdf0e10cSrcweir 			uno::Reference < beans::XPropertySet > xSet( static_cast<SdrOle2Obj*>(mpObj.get())->GetObjRef()->getComponent(), uno::UNO_QUERY );
839cdf0e10cSrcweir 			if( xSet.is() )
840cdf0e10cSrcweir 			{
841cdf0e10cSrcweir                 rValue <<= xSet->getPropertyValue( rName );
842cdf0e10cSrcweir 			}
843cdf0e10cSrcweir 		}
844cdf0e10cSrcweir 		return true;
845cdf0e10cSrcweir 	}
846cdf0e10cSrcweir 	else
847cdf0e10cSrcweir 	{
848cdf0e10cSrcweir         return SvxOle2Shape::getPropertyValueImpl( rName, pProperty, rValue );
849cdf0e10cSrcweir 	}
850cdf0e10cSrcweir }
851cdf0e10cSrcweir 
852cdf0e10cSrcweir /***********************************************************************
853cdf0e10cSrcweir *                                                                      *
854cdf0e10cSrcweir ***********************************************************************/
855cdf0e10cSrcweir 
856cdf0e10cSrcweir SvxMediaShape::SvxMediaShape( SdrObject* pObj ) throw()
857cdf0e10cSrcweir :	SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_MEDIA), aSvxMapProvider.GetPropertySet(SVXMAP_MEDIA, SdrObject::GetGlobalDrawObjectItemPool()) )
858cdf0e10cSrcweir {
859cdf0e10cSrcweir 	SetShapeType( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.MediaShape" ) ) );
860cdf0e10cSrcweir }
861cdf0e10cSrcweir 
862cdf0e10cSrcweir //----------------------------------------------------------------------
863cdf0e10cSrcweir SvxMediaShape::~SvxMediaShape() throw()
864cdf0e10cSrcweir {
865cdf0e10cSrcweir }
866cdf0e10cSrcweir 
867cdf0e10cSrcweir //----------------------------------------------------------------------
868cdf0e10cSrcweir 
869cdf0e10cSrcweir bool SvxMediaShape::setPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
870cdf0e10cSrcweir {
871cdf0e10cSrcweir 	if( (pProperty->nWID >= OWN_ATTR_MEDIA_URL) && (pProperty->nWID <= OWN_ATTR_MEDIA_ZOOM) )
872cdf0e10cSrcweir 	{
873cdf0e10cSrcweir 		SdrMediaObj* pMedia = static_cast< SdrMediaObj* >( mpObj.get() );
874cdf0e10cSrcweir 		::avmedia::MediaItem aItem;
875cdf0e10cSrcweir 		bool bOk = false;
876cdf0e10cSrcweir 
877cdf0e10cSrcweir 		switch( pProperty->nWID )
878cdf0e10cSrcweir 		{
879cdf0e10cSrcweir 		case OWN_ATTR_MEDIA_URL:
880cdf0e10cSrcweir 		{
881cdf0e10cSrcweir 			OUString aURL;
882cdf0e10cSrcweir 			if( rValue >>= aURL )
883cdf0e10cSrcweir 			{
884cdf0e10cSrcweir 				bOk = true;
885cdf0e10cSrcweir 				aItem.setURL( aURL );
886cdf0e10cSrcweir 			}
887cdf0e10cSrcweir 		}
888cdf0e10cSrcweir 		break;
889cdf0e10cSrcweir 
890cdf0e10cSrcweir 		case( OWN_ATTR_MEDIA_LOOP ):
891cdf0e10cSrcweir 		{
892cdf0e10cSrcweir 			sal_Bool bLoop = sal_Bool();
893cdf0e10cSrcweir 
894cdf0e10cSrcweir 			if( rValue >>= bLoop )
895cdf0e10cSrcweir 			{
896cdf0e10cSrcweir 				bOk = true;
897cdf0e10cSrcweir 				aItem.setLoop( bLoop );
898cdf0e10cSrcweir 			}
899cdf0e10cSrcweir 		}
900cdf0e10cSrcweir 		break;
901cdf0e10cSrcweir 
902cdf0e10cSrcweir 		case( OWN_ATTR_MEDIA_MUTE ):
903cdf0e10cSrcweir 		{
904cdf0e10cSrcweir 			sal_Bool bMute = sal_Bool();
905cdf0e10cSrcweir 
906cdf0e10cSrcweir 			if( rValue >>= bMute )
907cdf0e10cSrcweir 			{
908cdf0e10cSrcweir 				bOk = true;
909cdf0e10cSrcweir 				aItem.setMute( bMute );
910cdf0e10cSrcweir 			}
911cdf0e10cSrcweir 		}
912cdf0e10cSrcweir 		break;
913cdf0e10cSrcweir 
914cdf0e10cSrcweir 		case( OWN_ATTR_MEDIA_VOLUMEDB ):
915cdf0e10cSrcweir 		{
916cdf0e10cSrcweir 			sal_Int16 nVolumeDB = sal_Int16();
917cdf0e10cSrcweir 
918cdf0e10cSrcweir 			if( rValue >>= nVolumeDB )
919cdf0e10cSrcweir 			{
920cdf0e10cSrcweir 				bOk = true;
921cdf0e10cSrcweir 				aItem.setVolumeDB( nVolumeDB );
922cdf0e10cSrcweir 			}
923cdf0e10cSrcweir 		}
924cdf0e10cSrcweir 		break;
925cdf0e10cSrcweir 
926cdf0e10cSrcweir 		case( OWN_ATTR_MEDIA_ZOOM ):
927cdf0e10cSrcweir 		{
928cdf0e10cSrcweir 			::com::sun::star::media::ZoomLevel eLevel;
929cdf0e10cSrcweir 
930cdf0e10cSrcweir 			if( rValue >>= eLevel )
931cdf0e10cSrcweir 			{
932cdf0e10cSrcweir 				bOk = true;
933cdf0e10cSrcweir 				aItem.setZoom( eLevel );
934cdf0e10cSrcweir 			}
935cdf0e10cSrcweir 		}
936cdf0e10cSrcweir 		break;
937cdf0e10cSrcweir 
938cdf0e10cSrcweir 		default:
939cdf0e10cSrcweir 			DBG_ERROR("SvxMediaShape::setPropertyValueImpl(), unknown argument!");
940cdf0e10cSrcweir 		}
941cdf0e10cSrcweir 
942cdf0e10cSrcweir 		if( bOk )
943cdf0e10cSrcweir 		{
944cdf0e10cSrcweir 			pMedia->setMediaProperties( aItem );
945cdf0e10cSrcweir 			return true;
946cdf0e10cSrcweir 		}
947cdf0e10cSrcweir 	}
948cdf0e10cSrcweir 	else
949cdf0e10cSrcweir 	{
950cdf0e10cSrcweir         return SvxShape::setPropertyValueImpl( rName, pProperty, rValue );
951cdf0e10cSrcweir 	}
952cdf0e10cSrcweir 
953cdf0e10cSrcweir 	throw IllegalArgumentException();
954cdf0e10cSrcweir }
955cdf0e10cSrcweir 
956cdf0e10cSrcweir //----------------------------------------------------------------------
957cdf0e10cSrcweir 
958cdf0e10cSrcweir bool SvxMediaShape::getPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
959cdf0e10cSrcweir {
960cdf0e10cSrcweir 	if( ( pProperty->nWID >= OWN_ATTR_MEDIA_URL ) && ( pProperty->nWID <= OWN_ATTR_MEDIA_ZOOM ) )
961cdf0e10cSrcweir 	{
962cdf0e10cSrcweir 		SdrMediaObj* pMedia = static_cast< SdrMediaObj* >( mpObj.get() );
963cdf0e10cSrcweir 		const ::avmedia::MediaItem aItem( pMedia->getMediaProperties() );
964cdf0e10cSrcweir 
965cdf0e10cSrcweir 		switch( pProperty->nWID )
966cdf0e10cSrcweir 		{
967cdf0e10cSrcweir 			case OWN_ATTR_MEDIA_URL:
968cdf0e10cSrcweir 				rValue <<= aItem.getURL();
969cdf0e10cSrcweir 				break;
970cdf0e10cSrcweir 
971cdf0e10cSrcweir 			case( OWN_ATTR_MEDIA_LOOP ):
972cdf0e10cSrcweir 				rValue <<= (sal_Bool) aItem.isLoop();
973cdf0e10cSrcweir 				break;
974cdf0e10cSrcweir 
975cdf0e10cSrcweir 			case( OWN_ATTR_MEDIA_MUTE ):
976cdf0e10cSrcweir 				rValue <<= (sal_Bool) aItem.isMute();
977cdf0e10cSrcweir 				break;
978cdf0e10cSrcweir 
979cdf0e10cSrcweir 			case( OWN_ATTR_MEDIA_VOLUMEDB ):
980cdf0e10cSrcweir 				rValue <<= (sal_Int16) aItem.getVolumeDB();
981cdf0e10cSrcweir 				break;
982cdf0e10cSrcweir 
983cdf0e10cSrcweir 			case( OWN_ATTR_MEDIA_ZOOM ):
984cdf0e10cSrcweir 				rValue <<= aItem.getZoom();
985cdf0e10cSrcweir 				break;
986cdf0e10cSrcweir 
987cdf0e10cSrcweir 			default:
988cdf0e10cSrcweir 				DBG_ERROR("SvxMediaShape::getPropertyValueImpl(), unknown property!");
989cdf0e10cSrcweir 		}
990cdf0e10cSrcweir 		return true;
991cdf0e10cSrcweir 	}
992cdf0e10cSrcweir 	else
993cdf0e10cSrcweir 	{
994cdf0e10cSrcweir         return SvxShape::getPropertyValueImpl( rName, pProperty, rValue );
995cdf0e10cSrcweir 	}
996cdf0e10cSrcweir }
997