20#include <com/sun/star/util/XModifiable.hpp>
21#include <com/sun/star/embed/XEmbeddedObject.hpp>
22#include <com/sun/star/embed/XLinkageSupport.hpp>
23#include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
24#include <com/sun/star/embed/Aspects.hpp>
25#include <com/sun/star/task/XInteractionHandler.hpp>
26#include <com/sun/star/ucb/CommandFailedException.hpp>
27#include <com/sun/star/ucb/ContentCreationException.hpp>
56#include <config_features.h>
59using namespace ::
cppu;
85 switch( pProperty->
nWID )
91 awt::Rectangle aVisArea;
92 if( !(rValue >>= aVisArea))
96 Size aTmp( aVisArea.X + aVisArea.Width, aVisArea.Y + aVisArea.Height );
97 uno::Reference < embed::XEmbeddedObject > xObj = pOle2Obj->GetObjRef();
105 xObj->setVisualAreaSize( embed::Aspects::MSOLE_CONTENT, awt::Size( aTmp.
Width(), aTmp.
Height() ) );
107 catch( uno::Exception& )
109 OSL_FAIL(
"Couldn't set the visual area for the object!" );
119 sal_Int64 nAspect = 0;
120 if( rValue >>= nAspect )
130 if( rValue >>= aCLSID )
134 if( aClassName.
MakeId( aCLSID ) )
144 uno::Reference< graphic::XGraphic > xGraphic( rValue, uno::UNO_QUERY );
147 const Graphic aGraphic(xGraphic);
155 uno::Reference< graphic::XGraphic > xGraphic( rValue, uno::UNO_QUERY );
171 OUString aPersistName;
172 if( rValue >>= aPersistName )
175#if OSL_DEBUG_LEVEL > 0
189 if( rValue >>= aLinkURL )
200 throw IllegalArgumentException();
205 switch( pProperty->
nWID )
234 if ( aLnk.
GetType() == GfxLinkType::NativeWmf )
247 const uno::Sequence<sal_Int8>
aSeq(
263 awt::Rectangle aVisArea;
266 MapMode aMapMode( MapUnit::Map100thMM );
268 aVisArea = awt::Rectangle( 0, 0, aTmp.
Width(), aTmp.
Height() );
278 rValue <<= awt::Size( aTmp.
Width(), aTmp.
Height() );
284 rValue <<= static_cast<SdrOle2Obj*>(
GetSdrObject())->GetAspect();
295 uno::Reference < embed::XEmbeddedObject > xObj( pObj->
GetObjRef() );
304 SAL_WARN_IF(!bSuccess,
"svx.svdraw",
"An object without client is provided!");
308 rValue <<= pObj->
GetObjRef()->getComponent();
318 uno::Reference< graphic::XGraphic > xGraphic;
328 uno::Reference< graphic::XGraphic > xGraphic;
337 OUString aPersistName;
343 if( !aPersistName.isEmpty() )
347 aPersistName.clear();
351 rValue <<= aPersistName;
361 uno::Reference< embed::XLinkageSupport > xLink( pOle->
GetObjRef(), uno::UNO_QUERY );
362 if ( xLink.is() && xLink->isLink() )
363 aLinkURL = xLink->getLinkURL();
381 if ( !pOle2Obj || !pOle2Obj->
IsEmpty() )
386 OUString aPersistName;
389 aPersistName = aTmpStr;
395 uno::Reference<embed::XEmbeddedObject> xObj(
407 awt::Size aSz = xObj->getVisualAreaSize( pOle2Obj->
GetAspect() );
410 catch( embed::NoVisualAreaSizeException& )
419 aSz.Height = aSize.
Height();
420 if (aSz.Width != 0 || aSz.Height != 0)
423 xObj->setVisualAreaSize( pOle2Obj->
GetAspect(), aSz );
428 aTmpStr = aPersistName;
444 if ( !pOle2Obj || !pOle2Obj->
IsEmpty() )
447 OUString aPersistName;
455 if ( xInteraction.is() )
457 aMediaDescr.realloc( 2 );
458 auto pMediaDescr = aMediaDescr.getArray();
459 pMediaDescr[1].Name =
"InteractionHandler";
460 pMediaDescr[1].Value <<= xInteraction;
464 uno::Reference< embed::XEmbeddedObject > xObj =
476 awt::Size aSz = xObj->getVisualAreaSize( pOle2Obj->
GetAspect() );
479 catch( embed::NoVisualAreaSizeException& )
488 aSz.Height = aSize.
Height();
489 xObj->setVisualAreaSize( pOle2Obj->
GetAspect(), aSz );
509 uno::Reference < util::XModifiable > xMod( pOle->
GetObjRef(), uno::UNO_QUERY );
512 xMod->setModified(
false );
532 uno::Reference < embed::XEmbeddedObject > xObj =
542 if (rHexCLSID.isEmpty())
544 const uno::Reference < embed::XEmbeddedObject >& xObj( pOle2Obj->
GetObjRef() );
597 uno::Reference < beans::XPropertySet > xSet(
static_cast<SdrOle2Obj*
>(
GetSdrObject())->GetObjRef()->getComponent(), uno::UNO_QUERY );
601 xSet->setPropertyValue( rName, rValue );
618 uno::Reference < beans::XPropertySet > xSet(
static_cast<SdrOle2Obj*
>(
GetSdrObject())->GetObjRef()->getComponent(), uno::UNO_QUERY );
621 rValue = xSet->getPropertyValue( rName );
668 uno::Reference < beans::XPropertySet > xSet(
static_cast<SdrOle2Obj*
>(
GetSdrObject())->GetObjRef()->getComponent(), uno::UNO_QUERY );
672 xSet->setPropertyValue( rName, rValue );
689 uno::Reference < beans::XPropertySet > xSet(
static_cast<SdrOle2Obj*
>(
GetSdrObject())->GetObjRef()->getComponent(), uno::UNO_QUERY );
692 rValue = xSet->getPropertyValue( rName );
723 uno::Reference<beans::XPropertySet> xSet(
static_cast<OWeakObject *
>(
this), uno::UNO_QUERY);
751 uno::Reference < beans::XPropertySet > xSet(
static_cast<SdrOle2Obj*
>(
GetSdrObject())->GetObjRef()->getComponent(), uno::UNO_QUERY );
755 xSet->setPropertyValue( rName, rValue );
767 css::uno::Any& rValue)
773 uno::Reference < beans::XPropertySet > xSet(
static_cast<SdrOle2Obj*
>(
GetSdrObject())->GetObjRef()->getComponent(), uno::UNO_QUERY );
776 rValue = xSet->getPropertyValue( rName );
788 referer_(
std::move(referer))
807#if HAVE_FEATURE_AVMEDIA
813 switch( pProperty->
nWID )
816#if HAVE_FEATURE_AVMEDIA
819 if( rValue >>=
aURL )
829#if HAVE_FEATURE_AVMEDIA
833 if( rValue >>= bLoop )
843#if HAVE_FEATURE_AVMEDIA
847 if( rValue >>= bMute )
857#if HAVE_FEATURE_AVMEDIA
859 sal_Int16 nVolumeDB = sal_Int16();
861 if( rValue >>= nVolumeDB )
871#if HAVE_FEATURE_AVMEDIA
873 css::media::ZoomLevel eLevel;
875 if( rValue >>= eLevel )
885#if HAVE_FEATURE_AVMEDIA
888 if( rValue >>= sMimeType )
898#if HAVE_FEATURE_AVMEDIA
900 uno::Reference<graphic::XGraphic> xGraphic(rValue, uno::UNO_QUERY);
911#if HAVE_FEATURE_AVMEDIA
913 text::GraphicCrop aCrop;
914 if (rValue >>= aCrop)
924#if HAVE_FEATURE_AVMEDIA
927 uno::Reference<io::XInputStream>
xStream;
933 catch (
const css::ucb::ContentCreationException&)
936 throw css::lang::WrappedTargetException(
937 "ContentCreationException Setting InputStream!",
941 catch (
const css::ucb::CommandFailedException&)
944 throw css::lang::WrappedTargetException(
945 "CommandFailedException Setting InputStream!",
953 OSL_FAIL(
"SvxMediaShape::setPropertyValueImpl(), unknown argument!");
956#if HAVE_FEATURE_AVMEDIA
969 throw IllegalArgumentException();
985#if HAVE_FEATURE_AVMEDIA
989 switch( pProperty->
nWID )
992#if HAVE_FEATURE_AVMEDIA
993 rValue <<= aItem.getURL();
998#if HAVE_FEATURE_AVMEDIA
999 rValue <<= aItem.isLoop();
1004#if HAVE_FEATURE_AVMEDIA
1005 rValue <<= aItem.isMute();
1010#if HAVE_FEATURE_AVMEDIA
1011 rValue <<= aItem.getVolumeDB();
1016#if HAVE_FEATURE_AVMEDIA
1017 rValue <<= aItem.getZoom();
1026 catch (
const css::ucb::ContentCreationException&)
1029 throw css::lang::WrappedTargetException(
1030 "ContentCreationException Getting InputStream!",
1031 getXWeak(), anyEx );
1033 catch (
const css::ucb::CommandFailedException&)
1036 throw css::lang::WrappedTargetException(
1037 "CommandFailedException Getting InputStream!",
1038 getXWeak(), anyEx );
1044#if HAVE_FEATURE_AVMEDIA
1045 rValue <<= aItem.getTempURL();
1050#if HAVE_FEATURE_AVMEDIA
1051 rValue <<= aItem.getMimeType();
1056#if HAVE_FEATURE_AVMEDIA
1058 Graphic aGraphic = aItem.getGraphic();
1068#if HAVE_FEATURE_AVMEDIA
1070 text::GraphicCrop aCrop = aItem.getCrop();
1081 OSL_FAIL(
"SvxMediaShape::getPropertyValueImpl(), unknown property!");
1092 css::beans::PropertyState& rState)
1094#if HAVE_FEATURE_AVMEDIA
1099 const text::GraphicCrop& rCrop = rItem.
getCrop();
1100 if (rCrop.Bottom > 0 || rCrop.Left > 0 || rCrop.Right > 0 || rCrop.Top > 0)
1103 rState = beans::PropertyState_DIRECT_VALUE;
1107 rState = beans::PropertyState_AMBIGUOUS_VALUE;
const sal_uInt8 * GetData() const
sal_uInt32 GetDataSize() const
GfxLinkType GetType() const
const Graphic & GetGraphic() const
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
const GDIMetaFile & GetGDIMetaFile() const
GfxLink GetGfxLink() const
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
::comphelper::IEmbeddedHelper * GetPersist() const
SdrModel & getSdrModelFromSdrObject() const
virtual void SetLogicRect(const tools::Rectangle &rRect)
sal_Int64 GetAspect() const
css::uno::Reference< css::embed::XEmbeddedObject > const & GetObjRef() const
const Graphic * GetGraphic() const
const OUString & GetPersistName() const
void SetObjRef(const css::uno::Reference< css::embed::XEmbeddedObject > &rNewObjRef)
void SetGraphicToObj(const Graphic &aGraphic)
void SetPersistName(const OUString &rPersistName, SvxOle2Shape *pCreator=nullptr)
virtual const tools::Rectangle & GetLogicRect() const override
constexpr tools::Long Height() const
constexpr tools::Long Width() const
static bool IsInternal(const SvGlobalName &)
OUString GetHexName() const
bool MakeId(std::u16string_view rId)
css::uno::Sequence< sal_Int8 > GetByteSequence() const
std::size_t GetEndOfData() const
SvxAppletShape(SdrObject *pObj)
virtual void SAL_CALL setPropertyValues(const css::uno::Sequence< OUString > &aPropertyNames, const css::uno::Sequence< css::uno::Any > &aValues) override
virtual ~SvxAppletShape() noexcept override
virtual bool setPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, const css::uno::Any &rValue) override
virtual void Create(SdrObject *pNewOpj, SvxDrawPage *pNewPage) override
virtual bool getPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, css::uno::Any &rValue) override
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual bool getPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, css::uno::Any &rValue) override
OUString m_sInitialFrameURL
virtual void Create(SdrObject *pNewOpj, SvxDrawPage *pNewPage) override
virtual void SAL_CALL setPropertyValues(const css::uno::Sequence< OUString > &aPropertyNames, const css::uno::Sequence< css::uno::Any > &aValues) override
virtual OUString GetAndClearInitialFrameURL() override
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
SvxFrameShape(SdrObject *pObj)
virtual ~SvxFrameShape() noexcept override
virtual bool setPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, const css::uno::Any &rValue) override
virtual OUString GetAndClearInitialFrameURL()
bool createObject(const SvGlobalName &aClassName)
SvxOle2Shape(SdrObject *pObj)
void createLink(const OUString &aLinkURL)
virtual bool setPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, const css::uno::Any &rValue) override
virtual ~SvxOle2Shape() noexcept override
SvGlobalName GetClassName_Impl(OUString &rHexCLSID)
void resetModifiedState()
virtual bool getPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, css::uno::Any &rValue) override
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual void SAL_CALL setPropertyValues(const css::uno::Sequence< OUString > &aPropertyNames, const css::uno::Sequence< css::uno::Any > &aValues) override
SvxPluginShape(SdrObject *pObj)
virtual bool setPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, const css::uno::Any &rValue) override
virtual void Create(SdrObject *pNewOpj, SvxDrawPage *pNewPage) override
virtual bool getPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, css::uno::Any &rValue) override
virtual ~SvxPluginShape() noexcept override
virtual bool getPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, css::uno::Any &rValue) override
virtual bool setPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, const css::uno::Any &rValue) override
virtual bool getPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, css::uno::Any &rValue)
virtual bool getPropertyStateImpl(const SfxItemPropertyMapEntry *pProperty, css::beans::PropertyState &rState)
virtual void Create(SdrObject *pNewOpj, SvxDrawPage *pNewPage)
virtual void SAL_CALL setPropertyValues(const css::uno::Sequence< OUString > &aPropertyNames, const css::uno::Sequence< css::uno::Any > &aValues) override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
void SetShapeType(const OUString &ShapeType)
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
css::uno::Any GetBitmap(bool bMetaFile=false) const
SdrObject * GetSdrObject() const
virtual bool setPropertyValueImpl(const OUString &rName, const SfxItemPropertyMapEntry *pProperty, const css::uno::Any &rValue)
static MapUnit UnoEmbed2VCLMapUnit(sal_Int32 nUnoEmbedMapUnit)
bool HasEmbeddedObject(const OUString &)
css::uno::Reference< css::embed::XEmbeddedObject > InsertEmbeddedLink(const css::uno::Sequence< css::beans::PropertyValue > &, OUString &)
css::uno::Reference< css::embed::XEmbeddedObject > GetEmbeddedObject(const OUString &, OUString const *pBaseURL=nullptr)
css::uno::Reference< css::embed::XEmbeddedObject > CreateEmbeddedObject(const css::uno::Sequence< sal_Int8 > &, OUString &, OUString const *pBaseURL=nullptr)
virtual bool isEnableSetModified() const=0
virtual EmbeddedObjectContainer & getEmbeddedObjectContainer() const=0
virtual css::uno::Reference< css::task::XInteractionHandler > getInteractionHandler() const=0
virtual OUString getDocumentBaseURL() const=0
#define SO3_PLUGIN_CLASSID
#define SO3_IFRAME_CLASSID
#define SO3_APPLET_CLASSID
static bool TryRunningState(const css::uno::Reference< css::embed::XEmbeddedObject > &)
#define DBG_TESTSOLARMUTEX()
EmbeddedObjectRef * pObject
Sequence< sal_Int8 > aSeq
#define SAL_WARN_IF(condition, area, stream)
css::uno::Sequence< css::beans::PropertyValue > InitPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
Any SAL_CALL getCaughtException()
SvxUnoPropertyMapProvider & getSvxMapProvider()
constexpr TypedWhichId< SdrGrafCropItem > SDRATTR_GRAFCROP(SDRATTR_GRAF_FIRST+9)
constexpr OUStringLiteral UNO_NAME_OLE2_PERSISTNAME
#define OWN_ATTR_MEDIA_VOLUMEDB
#define OWN_ATTR_METAFILE
#define OWN_ATTR_VALUE_GRAPHIC
#define OWN_ATTR_MEDIA_MUTE
#define OWN_ATTR_PLUGIN_MIMETYPE
#define OWN_ATTR_OLE_EMBEDDED_OBJECT
#define OWN_ATTR_OLE_EMBEDDED_OBJECT_NONEWCLIENT
#define OWN_ATTR_PERSISTNAME
#define OWN_ATTR_MEDIA_STREAM
#define OWN_ATTR_OLEMODEL
#define OWN_ATTR_OLE_VISAREA
#define OWN_ATTR_MEDIA_URL
#define OWN_ATTR_INTERNAL_OLE
#define OWN_ATTR_OLE_LINKURL
#define OWN_ATTR_APPLET_ISSCRIPT
#define OWN_ATTR_THUMBNAIL
#define OWN_ATTR_MEDIA_MIMETYPE
#define OWN_ATTR_APPLET_DOCBASE
#define OWN_ATTR_PLUGIN_COMMANDS
#define OWN_ATTR_FALLBACK_GRAPHIC
#define OWN_ATTR_FRAME_MARGIN_HEIGHT
#define OWN_ATTR_MEDIA_ZOOM
#define OWN_ATTR_MEDIA_TEMPFILEURL
#define OWN_ATTR_MEDIA_LOOP
#define OWN_ATTR_OLE_ASPECT
#define OWN_ATTR_FRAME_URL
VCL_DLLPUBLIC bool ConvertGDIMetaFileToWMF(const GDIMetaFile &rMTF, SvStream &rTargetStream, FilterConfigItem const *pConfigItem, bool bPlaceable=true)