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>
71 Reference<XUnoTunnel> xCursorTunnel( rPropSet, UNO_QUERY );
72 assert(xCursorTunnel.is() &&
"missing XUnoTunnel for embedded");
73 SwXFrame* pFrame = comphelper::getFromUnoTunnel<SwXFrame>(xCursorTunnel);
74 assert(pFrame &&
"SwXFrame missing");
100 const OUString sRelURL = ( bToRel && !rURL.isEmpty() )
104 if (!sRelURL.isEmpty())
115 std::vector<XMLPropertyState>& rStates,
125 std::vector<XMLPropertyState>& rStates,
128 MapMode aMode( MapUnit::Map100thMM );
141 const uno::Reference < embed::XEmbeddedObject >& xObj,
142 std::vector<XMLPropertyState>& rStates,
148 uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
152 bool bIsAutoScroll =
false, bIsScrollingMode =
false;
153 Any aAny = xSet->getPropertyValue(
"FrameIsAutoScroll");
154 aAny >>= bIsAutoScroll;
155 if ( !bIsAutoScroll )
157 aAny = xSet->getPropertyValue(
"FrameIsScrollingMode");
158 aAny >>= bIsScrollingMode;
161 bool bIsBorderSet =
false, bIsAutoBorder =
false;
162 aAny = xSet->getPropertyValue(
"FrameIsAutoBorder");
163 aAny >>= bIsAutoBorder;
164 if ( !bIsAutoBorder )
166 aAny = xSet->getPropertyValue(
"FrameIsBorder");
167 aAny >>= bIsBorderSet;
170 sal_Int32 nWidth, nHeight;
171 aAny = xSet->getPropertyValue(
"FrameMarginWidth");
173 aAny = xSet->getPropertyValue(
"FrameMarginHeight");
194 std::vector<XMLPropertyState> aStates;
212 Add( XmlStyleFamily::TEXT_FRAME, rPropSet, aStates );
217 const Reference < XPropertySetInfo > & rPropSetInfo )
230 nType = SV_EMBEDDED_PLUGIN;
234 nType = SV_EMBEDDED_APPLET;
238 nType = SV_EMBEDDED_FRAME;
242 nType = SV_EMBEDDED_OUTPLACE;
257 std::vector<XMLPropertyState> aStates;
261 case SV_EMBEDDED_FRAME:
265 case SV_EMBEDDED_OUTPLACE:
276 const OUString sAutoStyle =
Find( XmlStyleFamily::TEXT_FRAME,
277 rPropSet, sStyle, aStates );
280 if( !sAutoStyle.isEmpty() )
289 case SV_EMBEDDED_OUTPLACE:
290 case SV_EMBEDDED_OWN:
295 bool bIsOwnLink =
false;
296 if( SV_EMBEDDED_OWN == nType )
300 uno::Reference< embed::XLinkageSupport > xLinkage( rObjRef.
GetObject(), uno::UNO_QUERY );
301 bIsOwnLink = xLinkage.is() && xLinkage->isLink();
303 sURL = xLinkage->getLinkURL();
305 catch(
const uno::Exception&)
308 OSL_FAIL(
"Link detection or retrieving of the URL of OOo link is failed!" );
323 OUStringBuffer
aBuffer( sRange.getLength() + 2 );
324 for( sal_Int32
i=0;
i < sRange.getLength();
i++ )
336 aBuffer.append( sRange.subView(0,
i) );
338 if(
'\'' == c ||
'\\' == c )
349 sRange =
aBuffer.makeStringAndClear();
358 case SV_EMBEDDED_APPLET:
363 uno::Reference < beans::XPropertySet > xSet( rObjRef->getComponent(), uno::UNO_QUERY );
365 Any aAny2 = xSet->getPropertyValue(
"AppletCodeBase");
367 if (!aStr.isEmpty() )
370 aAny2 = xSet->getPropertyValue(
"AppletName");
375 aAny2 = xSet->getPropertyValue(
"AppletCode");
379 bool bScript =
false;
380 aAny2 = xSet->getPropertyValue(
"AppletIsScript");
384 uno::Sequence < beans::PropertyValue > aProps;
385 aAny2 = xSet->getPropertyValue(
"AppletCommands");
388 sal_Int32
i = aProps.getLength();
391 const beans::PropertyValue& aProp = aProps[--i];
396 aProp.Value >>= aStr2;
405 case SV_EMBEDDED_PLUGIN:
410 uno::Reference < beans::XPropertySet > xSet( rObjRef->getComponent(), uno::UNO_QUERY );
412 Any aAny2 = xSet->getPropertyValue(
"PluginURL");
416 aAny2 = xSet->getPropertyValue(
"PluginMimeType");
424 case SV_EMBEDDED_FRAME:
429 uno::Reference < beans::XPropertySet > xSet( rObjRef->getComponent(), uno::UNO_QUERY );
431 Any aAny2 = xSet->getPropertyValue(
"FrameURL");
436 aAny2 = xSet->getPropertyValue(
"FrameName");
446 OSL_ENSURE(
false,
"unknown object type! Base class should have been called!" );
454 case SV_EMBEDDED_OWN:
457 Reference < XEmbeddedObjectSupplier > xEOS( rPropSet, UNO_QUERY );
458 OSL_ENSURE( xEOS.is(),
"no embedded object supplier for own object" );
459 Reference < XComponent > xComp = xEOS->getEmbeddedObject();
463 case SV_EMBEDDED_OUTPLACE:
469 sURL +=
"?oasis=false";
474 case SV_EMBEDDED_APPLET:
478 uno::Reference < beans::XPropertySet > xSet( rObjRef->getComponent(), uno::UNO_QUERY );
479 uno::Sequence < beans::PropertyValue > aProps;
480 aAny = xSet->getPropertyValue(
"AppletCommands");
483 sal_Int32
i = aProps.getLength();
486 const beans::PropertyValue& aProp = aProps[--i];
491 aProp.Value >>= aStr;
500 case SV_EMBEDDED_PLUGIN:
504 uno::Reference < beans::XPropertySet > xSet( rObjRef->getComponent(), uno::UNO_QUERY );
505 uno::Sequence < beans::PropertyValue > aProps;
506 aAny = xSet->getPropertyValue(
"PluginCommands");
509 sal_Int32
i = aProps.getLength();
512 const beans::PropertyValue& aProp = aProps[--i];
517 aProp.Value >>= aStr;
530 if( SV_EMBEDDED_OUTPLACE==nType || SV_EMBEDDED_OWN==nType )
static SwHtmlOptType GetOptionType(const OUString &rName, bool bApplet)
static void lcl_addFrameProperties(const uno::Reference< embed::XEmbeddedObject > &xObj, std::vector< XMLPropertyState > &rStates, const rtl::Reference< XMLPropertySetMapper > &rMapper)
const css::uno::Reference< css::embed::XEmbeddedObject > & GetObject() const
void exportContour(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const css::uno::Reference< css::beans::XPropertySetInfo > &rPropSetInfo)
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
const SwOLEObj & GetOLEObj() const
#define SO3_IFRAME_CLASSID
#define CTF_FRAME_MARGIN_HORI
const OUString & GetChartTableName() const
#define CTF_OLE_VIS_AREA_TOP
constexpr sal_uInt16 XML_NAMESPACE_XLINK
#define CTF_OLE_VIS_AREA_WIDTH
#define CTF_OLE_VIS_AREA_LEFT
Content, content of frame (header, footer, fly).
#define CTF_FRAME_DISPLAY_SCROLLBAR
static SwNoTextNode * GetNoTextNode(const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
bool AddEmbeddedObjectAsBase64(const OUString &rEmbeddedObjectURL)
#define XML_EMBEDDEDOBJECTGRAPHIC_URL_BASE
SVL_DLLPUBLIC OUString simpleNormalizedMakeRelative(OUString const &baseUriReference, OUString const &uriReference)
SvXMLExport & GetExport()
constexpr tools::Long Width() const
const SvGlobalName m_aIFrameClassId
svt::EmbeddedObjectRef & GetObject()
void exportEvents(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)
void AddAttribute(sal_uInt16 nPrefix, const OUString &rName, const OUString &rValue)
SwNodeOffset GetIndex() const
static void lcl_addURL(SvXMLExport &rExport, const OUString &rURL, bool bToRel=true)
virtual void _exportTextEmbedded(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const css::uno::Reference< css::beans::XPropertySetInfo > &rPropSetInfo) override
constexpr sal_uInt16 XML_NAMESPACE_DRAW
const OUString & GetCurrentPersistName() const
const SvGlobalName m_aPluginClassId
static constexpr OUStringLiteral gsFrameStyleName
static bool IsInternal(const SvGlobalName &)
const SvGlobalName m_aAppletClassId
virtual ~SwXMLTextParagraphExport() override
OUString AddEmbeddedObject(const OUString &rEmbeddedObjectURL)
Layout frame for SwNoTextNode, i.e. graphics and OLE nodes (including charts).
Marks a node in the document model.
#define CTF_FRAME_DISPLAY_BORDER
#define SO3_APPLET_CLASSID
void Add(XmlStyleFamily nFamily, MultiPropertySetHelper &rPropSetHelper, const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
static void lcl_addAspect(const svt::EmbeddedObjectRef &rObj, std::vector< XMLPropertyState > &rStates, const rtl::Reference< XMLPropertySetMapper > &rMapper)
#define CTF_FRAME_MARGIN_VERT
#define CTF_OLE_DRAW_ASPECT
const rtl::Reference< SvXMLExportPropertyMapper > & GetAutoFramePropMapper() const
const SwNodeIndex * GetContentIdx() const
const OUString & GetOrigFileName() const
std::unique_ptr< char[]> aBuffer
XML_NOTIFY_ON_UPDATE_OF_RANGES
#define CTF_OLE_VIS_AREA_HEIGHT
void exportTitleAndDescription(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const css::uno::Reference< css::beans::XPropertySetInfo > &rPropSetInfo)
constexpr tools::Long Height() const
const SwNodes & GetNodes() const
virtual void _collectTextEmbeddedAutoStyles(const css::uno::Reference< css::beans::XPropertySet > &rPropSet) override
OUString Find(XmlStyleFamily nFamily, const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const OUString &rParent, const o3tl::span< const XMLPropertyState > aAddStates={}) const
Size GetSize(MapMode const *pTargetMapMode) const
constexpr OUStringLiteral gsEmbeddedObjectProtocol(u"vnd.sun.star.EmbeddedObject:")
static bool TryRunningState(const css::uno::Reference< css::embed::XEmbeddedObject > &)
static void lcl_addOutplaceProperties(const svt::EmbeddedObjectRef &rObj, std::vector< XMLPropertyState > &rStates, const rtl::Reference< XMLPropertySetMapper > &rMapper)
sal_Int64 GetViewAspect() const
#define SO3_PLUGIN_CLASSID
SvXMLExportFlags getExportFlags() const
void ExportEmbeddedOwnObject(css::uno::Reference< css::lang::XComponent > const &rComp)
SwXMLTextParagraphExport(SwXMLExport &rExp, SvXMLAutoStylePoolP &rAutoStylePool)