23#include <com/sun/star/embed/XEmbeddedObject.hpp>
24#include <com/sun/star/embed/XLinkageSupport.hpp>
25#include <com/sun/star/document/XEmbeddedObjectSupplier.hpp>
41#include <osl/diagnose.h>
57enum SvEmbeddedObjectTypes
69 const Reference < XPropertySet >& rPropSet )
71 SwXFrame* pFrame =
dynamic_cast<SwXFrame*
>(rPropSet.get());
72 assert(pFrame &&
"SwXFrame missing");
98 const OUString sRelURL = ( bToRel && !rURL.isEmpty() )
102 if (!sRelURL.isEmpty())
113 std::vector<XMLPropertyState>& rStates,
123 std::vector<XMLPropertyState>& rStates,
126 MapMode aMode( MapUnit::Map100thMM );
139 const uno::Reference < embed::XEmbeddedObject >& xObj,
140 std::vector<XMLPropertyState>& rStates,
146 uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
150 bool bIsAutoScroll =
false, bIsScrollingMode =
false;
151 Any aAny = xSet->getPropertyValue(
"FrameIsAutoScroll");
152 aAny >>= bIsAutoScroll;
153 if ( !bIsAutoScroll )
155 aAny = xSet->getPropertyValue(
"FrameIsScrollingMode");
156 aAny >>= bIsScrollingMode;
159 bool bIsBorderSet =
false, bIsAutoBorder =
false;
160 aAny = xSet->getPropertyValue(
"FrameIsAutoBorder");
161 aAny >>= bIsAutoBorder;
162 if ( !bIsAutoBorder )
164 aAny = xSet->getPropertyValue(
"FrameIsBorder");
165 aAny >>= bIsBorderSet;
168 sal_Int32 nWidth, nHeight;
169 aAny = xSet->getPropertyValue(
"FrameMarginWidth");
171 aAny = xSet->getPropertyValue(
"FrameMarginHeight");
185 const Reference < XPropertySet > & rPropSet )
192 std::vector<XMLPropertyState> aStates;
210 Add( XmlStyleFamily::TEXT_FRAME, rPropSet, aStates );
214 const Reference < XPropertySet > & rPropSet,
215 const Reference < XPropertySetInfo > & rPropSetInfo )
225 SvEmbeddedObjectTypes
nType = SV_EMBEDDED_OWN;
228 nType = SV_EMBEDDED_PLUGIN;
232 nType = SV_EMBEDDED_APPLET;
236 nType = SV_EMBEDDED_FRAME;
240 nType = SV_EMBEDDED_OUTPLACE;
255 std::vector<XMLPropertyState> aStates;
259 case SV_EMBEDDED_FRAME:
263 case SV_EMBEDDED_OUTPLACE:
274 const OUString sAutoStyle =
Find( XmlStyleFamily::TEXT_FRAME,
275 rPropSet, sStyle, aStates );
278 if( !sAutoStyle.isEmpty() )
287 case SV_EMBEDDED_OUTPLACE:
288 case SV_EMBEDDED_OWN:
293 bool bIsOwnLink =
false;
294 if( SV_EMBEDDED_OWN ==
nType )
298 uno::Reference< embed::XLinkageSupport > xLinkage( rObjRef.
GetObject(), uno::UNO_QUERY );
299 bIsOwnLink = xLinkage.is() && xLinkage->isLink();
301 sURL = xLinkage->getLinkURL();
303 catch(
const uno::Exception&)
306 OSL_FAIL(
"Link detection or retrieving of the URL of OOo link is failed!" );
321 OUStringBuffer
aBuffer( sRange.getLength() + 2 );
322 for( sal_Int32
i=0;
i < sRange.getLength();
i++ )
333 aBuffer.append( OUString::Concat(
"\'") + sRange.subView(0,
i) );
335 if(
'\'' == c ||
'\\' == c )
346 sRange =
aBuffer.makeStringAndClear();
355 case SV_EMBEDDED_APPLET:
360 uno::Reference < beans::XPropertySet > xSet( rObjRef->getComponent(), uno::UNO_QUERY );
362 Any aAny2 = xSet->getPropertyValue(
"AppletCodeBase");
364 if (!
aStr.isEmpty() )
367 aAny2 = xSet->getPropertyValue(
"AppletName");
372 aAny2 = xSet->getPropertyValue(
"AppletCode");
376 bool bScript =
false;
377 aAny2 = xSet->getPropertyValue(
"AppletIsScript");
381 uno::Sequence < beans::PropertyValue > aProps;
382 aAny2 = xSet->getPropertyValue(
"AppletCommands");
385 sal_Int32
i = aProps.getLength();
388 const beans::PropertyValue& aProp = aProps[--
i];
393 aProp.Value >>= aStr2;
402 case SV_EMBEDDED_PLUGIN:
407 uno::Reference < beans::XPropertySet > xSet( rObjRef->getComponent(), uno::UNO_QUERY );
409 Any aAny2 = xSet->getPropertyValue(
"PluginURL");
413 aAny2 = xSet->getPropertyValue(
"PluginMimeType");
421 case SV_EMBEDDED_FRAME:
426 uno::Reference < beans::XPropertySet > xSet( rObjRef->getComponent(), uno::UNO_QUERY );
428 Any aAny2 = xSet->getPropertyValue(
"FrameURL");
433 aAny2 = xSet->getPropertyValue(
"FrameName");
443 OSL_ENSURE(
false,
"unknown object type! Base class should have been called!" );
451 case SV_EMBEDDED_OWN:
454 Reference < XEmbeddedObjectSupplier > xEOS( rPropSet, UNO_QUERY );
455 OSL_ENSURE( xEOS.is(),
"no embedded object supplier for own object" );
456 Reference < XComponent > xComp = xEOS->getEmbeddedObject();
460 case SV_EMBEDDED_OUTPLACE:
466 sURL +=
"?oasis=false";
471 case SV_EMBEDDED_APPLET:
475 uno::Reference < beans::XPropertySet > xSet( rObjRef->getComponent(), uno::UNO_QUERY );
476 uno::Sequence < beans::PropertyValue > aProps;
477 aAny = xSet->getPropertyValue(
"AppletCommands");
480 sal_Int32
i = aProps.getLength();
483 const beans::PropertyValue& aProp = aProps[--
i];
488 aProp.Value >>=
aStr;
497 case SV_EMBEDDED_PLUGIN:
501 uno::Reference < beans::XPropertySet > xSet( rObjRef->getComponent(), uno::UNO_QUERY );
502 uno::Sequence < beans::PropertyValue > aProps;
503 aAny = xSet->getPropertyValue(
"PluginCommands");
506 sal_Int32
i = aProps.getLength();
509 const beans::PropertyValue& aProp = aProps[--
i];
514 aProp.Value >>=
aStr;
527 if( SV_EMBEDDED_OUTPLACE==
nType || SV_EMBEDDED_OWN==
nType )
constexpr tools::Long Height() const
constexpr tools::Long Width() const
static bool IsInternal(const SvGlobalName &)
void AddAttribute(sal_uInt16 nPrefix, const OUString &rName, const OUString &rValue)
SvXMLExportFlags getExportFlags() const
OUString AddEmbeddedObject(const OUString &rEmbeddedObjectURL)
void ExportEmbeddedOwnObject(css::uno::Reference< css::lang::XComponent > const &rComp)
bool AddEmbeddedObjectAsBase64(const OUString &rEmbeddedObjectURL)
const OUString & GetOrigFileName() const
static SwHtmlOptType GetOptionType(std::u16string_view rName, bool bApplet)
Content, content of frame (header, footer, fly).
const SwNodeIndex * GetContentIdx() const
Layout frame for SwNoTextNode, i.e. graphics and OLE nodes (including charts).
Marks a node in the document model.
const SwNodes & GetNodes() const
SwNodeOffset GetIndex() const
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
const SwOLEObj & GetOLEObj() const
const OUString & GetChartTableName() const
svt::EmbeddedObjectRef & GetObject()
const OUString & GetCurrentPersistName() const
SwXMLTextParagraphExport(SwXMLExport &rExp, SvXMLAutoStylePoolP &rAutoStylePool)
const SvGlobalName m_aIFrameClassId
virtual void _exportTextEmbedded(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const css::uno::Reference< css::beans::XPropertySetInfo > &rPropSetInfo) override
static SwNoTextNode * GetNoTextNode(const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
virtual ~SwXMLTextParagraphExport() override
virtual void _collectTextEmbeddedAutoStyles(const css::uno::Reference< css::beans::XPropertySet > &rPropSet) override
const SvGlobalName m_aPluginClassId
const SvGlobalName m_aAppletClassId
SvXMLExport & GetExport()
void exportTitleAndDescription(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const css::uno::Reference< css::beans::XPropertySetInfo > &rPropSetInfo)
void exportContour(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const css::uno::Reference< css::beans::XPropertySetInfo > &rPropSetInfo)
static constexpr OUStringLiteral gsFrameStyleName
const rtl::Reference< SvXMLExportPropertyMapper > & GetAutoFramePropMapper() const
void Add(XmlStyleFamily nFamily, MultiPropertySetHelper &rPropSetHelper, const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
XMLShapeExportFlags addTextFrameAttributes(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, bool bShape, basegfx::B2DPoint *pCenter=nullptr, OUString *pMinHeightValue=nullptr, OUString *pMinWidthValue=nullptr)
OUString Find(XmlStyleFamily nFamily, const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const OUString &rParent, const o3tl::span< const XMLPropertyState > aAddStates={}) const
void exportEvents(const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
#define SO3_PLUGIN_CLASSID
#define SO3_IFRAME_CLASSID
#define SO3_APPLET_CLASSID
static bool TryRunningState(const css::uno::Reference< css::embed::XEmbeddedObject > &)
sal_Int64 GetViewAspect() const
Size GetSize(MapMode const *pTargetMapMode) const
const css::uno::Reference< css::embed::XEmbeddedObject > & GetObject() const
SVL_DLLPUBLIC OUString simpleNormalizedMakeRelative(OUString const &baseUriReference, OUString const &uriReference)
XML_NOTIFY_ON_UPDATE_OF_RANGES
#define CTF_FRAME_MARGIN_VERT
#define CTF_OLE_VIS_AREA_TOP
#define CTF_FRAME_DISPLAY_BORDER
#define CTF_OLE_DRAW_ASPECT
#define CTF_OLE_VIS_AREA_HEIGHT
#define CTF_OLE_VIS_AREA_WIDTH
#define CTF_FRAME_MARGIN_HORI
#define CTF_OLE_VIS_AREA_LEFT
#define CTF_FRAME_DISPLAY_SCROLLBAR
std::unique_ptr< char[]> aBuffer
constexpr sal_uInt16 XML_NAMESPACE_DRAW
constexpr sal_uInt16 XML_NAMESPACE_XLINK
static void lcl_addAspect(const svt::EmbeddedObjectRef &rObj, std::vector< XMLPropertyState > &rStates, const rtl::Reference< XMLPropertySetMapper > &rMapper)
static void lcl_addFrameProperties(const uno::Reference< embed::XEmbeddedObject > &xObj, std::vector< XMLPropertyState > &rStates, const rtl::Reference< XMLPropertySetMapper > &rMapper)
constexpr OUStringLiteral gsEmbeddedObjectProtocol(u"vnd.sun.star.EmbeddedObject:")
static void lcl_addOutplaceProperties(const svt::EmbeddedObjectRef &rObj, std::vector< XMLPropertyState > &rStates, const rtl::Reference< XMLPropertySetMapper > &rMapper)
static void lcl_addURL(SvXMLExport &rExport, const OUString &rURL, bool bToRel=true)
#define XML_EMBEDDEDOBJECTGRAPHIC_URL_BASE