20#include <config_java.h>
23#include <rtl/strbuf.hxx>
61#include <com/sun/star/embed/XClassifiedObject.hpp>
62#include <com/sun/star/embed/Aspects.hpp>
63#include <com/sun/star/beans/XPropertySet.hpp>
64#include <com/sun/star/frame/XStorable.hpp>
65#include <com/sun/star/embed/ElementModes.hpp>
66#include <com/sun/star/io/XActiveDataStreamer.hpp>
67#include <com/sun/star/embed/XEmbedPersist2.hpp>
68#include <com/sun/star/lang/XInitialization.hpp>
80#include <osl/file.hxx>
87#define HTML_DFLT_EMBED_WIDTH (o3tl::toTwips(125, o3tl::Length::mm10))
88#define HTML_DFLT_EMBED_HEIGHT (o3tl::toTwips(125, o3tl::Length::mm10))
90#define HTML_DFLT_APPLET_WIDTH (o3tl::toTwips(125, o3tl::Length::mm10))
91#define HTML_DFLT_APPLET_HEIGHT (o3tl::toTwips(125, o3tl::Length::mm10))
146OUString lcl_CalculateFileName(
const OUString* pOrigFileName,
const Graphic& rGraphic,
147 std::u16string_view rExtension)
152 aFileName = *pOrigFileName;
155 aURL.getExtension() +
"_" +
158 aURL.setExtension(rExtension);
166 const Size& rTwipDfltSize,
167 bool bPercentWidth,
bool bPercentHeight,
172 sal_uInt8 nPercentWidth = 0, nPercentHeight = 0;
173 Size aTwipSz( bPercentWidth || USHRT_MAX==rPixSize.
Width() ? 0 : rPixSize.
Width(),
174 bPercentHeight || USHRT_MAX==rPixSize.
Height() ? 0 : rPixSize.
Height() );
192 else if( bPercentWidth && rPixSize.
Width() )
200 else if( USHRT_MAX==rPixSize.
Width() )
219 else if( bPercentHeight && rPixSize.
Height() )
223 nPercentHeight = 100;
227 else if( USHRT_MAX==rPixSize.
Height() )
240 rFlyItemSet.
Put( aFrameSize );
248 sal_Int32 nLeftSpace = 0, nRightSpace = 0;
249 sal_uInt16 nUpperSpace = 0, nLowerSpace = 0;
256 nLeftSpace = nRightSpace = aTwipSpc.
Width();
257 nUpperSpace = nLowerSpace = o3tl::narrowing<sal_uInt16>(aTwipSpc.
Height());
267 nLeftSpace = pLeft->GetTextLeft();
276 nRightSpace = pRight->GetRight();
281 if( nLeftSpace > 0 || nRightSpace > 0 )
284 aLRItem.
SetLeft( std::max<sal_Int32>(nLeftSpace, 0) );
285 aLRItem.
SetRight( std::max<sal_Int32>(nRightSpace, 0) );
286 rFlyItemSet.
Put( aLRItem );
295 rFlyItemSet.
Put( aHoriOri );
306 nUpperSpace = pULItem->GetUpper();
311 nLowerSpace = pULItem->GetLower();
316 if( !(nUpperSpace || nLowerSpace) )
322 rFlyItemSet.
Put( aULItem );
331 rFlyItemSet.
Put( aVertOri );
341 sal_Int32
nIndex = rPath.indexOf(
'?');
344 return rPath.copy(0,
nIndex);
351 OUString
aURL, aType,
aName, aAlt, aId, aStyle, aClass;
353 Size aSize( USHRT_MAX, USHRT_MAX );
354 Size aSpace( USHRT_MAX, USHRT_MAX );
355 bool bPercentWidth =
false, bPercentHeight =
false, bHidden =
false;
363 for (
const auto & rOption : rHTMLOptions)
365 switch( rOption.GetToken() )
367 case HtmlOptionId::ID:
368 aId = rOption.GetString();
370 case HtmlOptionId::STYLE:
371 aStyle = rOption.GetString();
373 case HtmlOptionId::CLASS:
374 aClass = rOption.GetString();
376 case HtmlOptionId::NAME:
377 aName = rOption.GetString();
379 case HtmlOptionId::SRC:
381 aURL = rOption.GetString();
383 case HtmlOptionId::ALT:
384 aAlt = rOption.GetString();
386 case HtmlOptionId::TYPE:
387 if( aType.isEmpty() )
388 aType = rOption.GetString();
390 case HtmlOptionId::ALIGN:
397 case HtmlOptionId::WIDTH:
398 if( USHRT_MAX==aSize.
Width() )
400 bPercentWidth = (rOption.GetString().indexOf(
'%') != -1);
404 case HtmlOptionId::HEIGHT:
405 if( USHRT_MAX==aSize.
Height() )
407 bPercentHeight = (rOption.GetString().indexOf(
'%') != -1);
411 case HtmlOptionId::HSPACE:
412 if( USHRT_MAX==aSpace.
Width() )
415 case HtmlOptionId::VSPACE:
416 if( USHRT_MAX==aSpace.
Height() )
419 case HtmlOptionId::DATA:
421 aData = rOption.GetString();
423 case HtmlOptionId::UNKNOWN:
424 if (rOption.GetTokenString().equalsIgnoreAsciiCase(
427 bHidden = !rOption.GetString().equalsIgnoreAsciiCase(
435 aCmdLst.
Append( rOption.GetTokenString(), rOption.GetString() );
438 static const std::set<std::u16string_view> vAllowlist = {
452 if (vAllowlist.find(aType) != vAllowlist.end() &&
m_aEmbeds.empty())
466 eVertOri = text::VertOrientation::TOP;
467 if( USHRT_MAX==aSpace.
Width() )
469 if( USHRT_MAX==aSpace.
Height() )
476 bPercentWidth = bPercentHeight =
false;
481 bool bHasURL = !
aURL.isEmpty() &&
486 bool bHasData = !
aData.isEmpty();
492 aURLObj.
SetURL(rtl::Uri::convertRelToAbs(
495 catch (
const rtl::MalformedUriException& )
501 bool bHasType = !aType.isEmpty();
502 if( !bHasURL && !bHasType && !bHasData )
531 if (aSize.
Width() == USHRT_MAX && bPercentHeight)
535 bPercentWidth =
true;
537 if (aSize.
Height() == USHRT_MAX && bPercentWidth)
541 bPercentHeight =
true;
544 SetFixSize(aSize, aDefaultTwipSize, bPercentWidth, bPercentHeight, aPropInfo, aAttrSet);
552 uno::Reference < embed::XEmbeddedObject > xObj;
558 uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
564 xSet->setPropertyValue(
"PluginMimeType",
uno::Any( aType ) );
566 uno::Sequence < beans::PropertyValue > aProps;
568 xSet->setPropertyValue(
"PluginCommands",
uno::Any( aProps ) );
576 uno::Reference<embed::XStorage> xStorage = pDocSh->GetStorage();
582 uno::Reference<io::XInputStream> xInStream;
590 OString aMagic(
"{\\object");
593 if (aHeader == aMagic)
596 bool bOwnFormat =
false;
605 { {
"InputStream",
uno::Any(xInStream) },
606 {
"URL",
uno::Any(OUString(
"private:stream")) },
613 aType =
"application/vnd.sun.star.oleobject";
629 uno::Reference<io::XStream> xOutStream
630 = xStorage->openStreamElement(aObjName, embed::ElementModes::READWRITE);
633 xOutStream->getOutputStream());
635 if (!aType.isEmpty())
638 uno::Reference<beans::XPropertySet> xOutStreamProps(xOutStream, uno::UNO_QUERY);
639 if (xOutStreamProps.is())
640 xOutStreamProps->setPropertyValue(
"MediaType",
uno::Any(aType));
660 aFrameSet.Put( aAnchor );
661 aFrameSet.Put(
SwFormatHoriOrient( 0, text::HoriOrientation::LEFT, text::RelOrientation::FRAME) );
663 aFrameSet.Put(
SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::PRINT_AREA ) );
668 SetFixSize( aSize, aDfltSz, bPercentWidth, bPercentHeight, aPropInfo, aFrameSet );
669 SetSpace( aSpace, aItemSet, aPropInfo, aFrameSet );
672 uno::Reference<lang::XInitialization> xObjInitialization(xObj, uno::UNO_QUERY);
673 if (xObjInitialization.is())
683 m_xDoc->getIDocumentContentOperations().InsertEmbObject(*
m_pPam,
686 if (xObjInitialization.is())
695 if( !
aName.isEmpty() )
726void SwHTMLParser::NewObject()
729 OUString aStandBy, aId, aStyle, aClass;
730 Size aSize( USHRT_MAX, USHRT_MAX );
732 sal_Int16 eVertOri = text::VertOrientation::TOP;
735 bool bPercentWidth =
false, bPercentHeight =
false,
741 for (
size_t i = rHTMLOptions.size(); i; )
746 case HtmlOptionId::ID:
749 case HtmlOptionId::STYLE:
752 case HtmlOptionId::CLASS:
755 case HtmlOptionId::DECLARE:
758 case HtmlOptionId::CLASSID:
761 case HtmlOptionId::CODEBASE:
763 case HtmlOptionId::DATA:
765 case HtmlOptionId::TYPE:
767 case HtmlOptionId::CODETYPE:
769 case HtmlOptionId::ARCHIVE:
770 case HtmlOptionId::UNKNOWN:
772 case HtmlOptionId::STANDBY:
775 case HtmlOptionId::WIDTH:
776 bPercentWidth = (rOption.
GetString().indexOf(
'%') != -1);
779 case HtmlOptionId::HEIGHT:
780 bPercentHeight = (rOption.
GetString().indexOf(
'%') != -1);
783 case HtmlOptionId::ALIGN:
787 case HtmlOptionId::USEMAP:
789 case HtmlOptionId::NAME:
791 case HtmlOptionId::HSPACE:
794 case HtmlOptionId::VSPACE:
797 case HtmlOptionId::BORDER:
800 case HtmlOptionId::SDONCLICK:
801 case HtmlOptionId::ONCLICK:
802 case HtmlOptionId::SDONMOUSEOVER:
803 case HtmlOptionId::ONMOUSEOVER:
804 case HtmlOptionId::SDONMOUSEOUT:
805 case HtmlOptionId::ONMOUSEOUT:
817 bool bIsApplet =
false;
819 if( !bDeclare &&
aClassID.getLength() == 42 &&
824 if( aCID.
MakeId( aClassID ) )
826 SvGlobalName aJavaCID( 0x8AD9C840UL, 0x044EU, 0x11D1U, 0xB3U, 0xE9U,
827 0x00U, 0x80U, 0x5FU, 0x49U, 0x9DU, 0x93U );
829 bIsApplet = aJavaCID == aCID;
855 SetFixSize( aSize, aDfltSz, bPercentWidth, bPercentHeight, aPropInfo, rFrameSet );
856 SetSpace( aSpace, aItemSet, aPropInfo, rFrameSet );
872 m_xDoc->getIDocumentContentOperations().InsertEmbObject(*
m_pPam,
892void SwHTMLParser::InsertApplet()
894 OUString aCodeBase, aCode,
aName, aAlt, aId, aStyle, aClass;
895 Size aSize( USHRT_MAX, USHRT_MAX );
897 bool bPercentWidth =
false, bPercentHeight =
false, bMayScript =
false;
898 sal_Int16 eVertOri = text::VertOrientation::TOP;
905 for (
size_t i = rHTMLOptions.size(); i; )
910 case HtmlOptionId::ID:
913 case HtmlOptionId::STYLE:
916 case HtmlOptionId::CLASS:
919 case HtmlOptionId::CODEBASE:
922 case HtmlOptionId::CODE:
925 case HtmlOptionId::NAME:
928 case HtmlOptionId::ALT:
931 case HtmlOptionId::ALIGN:
935 case HtmlOptionId::WIDTH:
936 bPercentWidth = (rOption.
GetString().indexOf(
'%') != -1);
939 case HtmlOptionId::HEIGHT:
940 bPercentHeight = (rOption.
GetString().indexOf(
'%') != -1);
943 case HtmlOptionId::HSPACE:
946 case HtmlOptionId::VSPACE:
949 case HtmlOptionId::MAYSCRIPT:
960 if( aCode.isEmpty() )
966 if ( !aCodeBase.isEmpty() )
985 SetFixSize( aSize, aDfltSz, bPercentWidth, bPercentHeight, aPropInfo, rFrameSet );
986 SetSpace( aSpace, aItemSet, aPropInfo, rFrameSet );
1000 m_xDoc->getIDocumentContentOperations().InsertEmbObject(*
m_pPam,
1021#if HAVE_FEATURE_JAVA
1025 OUString
aName, aValue;
1028 for (
size_t i = rHTMLOptions.size();
i; )
1033 case HtmlOptionId::NAME:
1036 case HtmlOptionId::VALUE:
1043 if(
aName.isEmpty() )
1054 OUString aAlt, aId, aStyle, aClass;
1055 Size aSize( USHRT_MAX, USHRT_MAX );
1056 Size aSpace( 0, 0 );
1057 bool bPercentWidth =
false, bPercentHeight =
false;
1058 sal_Int16 eVertOri = text::VertOrientation::TOP;
1064 for (
const auto & rOption : rHTMLOptions)
1068 case HtmlOptionId::ID:
1071 case HtmlOptionId::STYLE:
1074 case HtmlOptionId::CLASS:
1077 case HtmlOptionId::ALT:
1080 case HtmlOptionId::ALIGN:
1084 case HtmlOptionId::WIDTH:
1085 bPercentWidth = (rOption.
GetString().indexOf(
'%') != -1);
1088 case HtmlOptionId::HEIGHT:
1089 bPercentHeight = (rOption.
GetString().indexOf(
'%') != -1);
1092 case HtmlOptionId::HSPACE:
1095 case HtmlOptionId::VSPACE:
1117 uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
1127 if (
INetURLObject(sHRef).GetProtocol() == INetProtocol::Macro)
1130 xSet->setPropertyValue(
"FrameURL",
uno::Any( sHRef ) );
1133 if ( eScroll == ScrollingMode::Auto )
1134 xSet->setPropertyValue(
"FrameIsAutoScroll",
1137 xSet->setPropertyValue(
"FrameIsScrollingMode",
1138 uno::Any( eScroll == ScrollingMode::Yes ) );
1140 xSet->setPropertyValue(
"FrameIsBorder",
1143 xSet->setPropertyValue(
"FrameMarginWidth",
1146 xSet->setPropertyValue(
"FrameMarginHeight",
1151 catch ( uno::Exception& )
1170 SetFixSize( aSize, aDfltSz, bPercentWidth, bPercentHeight, aPropInfo, aFrameSet );
1171 SetSpace( aSpace, aItemSet, aPropInfo, aFrameSet );
1175 m_xDoc->getIDocumentContentOperations().InsertEmbObject(*
m_pPam,
1198 assert(pOLENode &&
"must exist");
1201 uno::Reference < embed::XClassifiedObject > xClass = rObj.
GetOleRef();
1211#if HAVE_FEATURE_JAVA
1228 OSL_ENSURE( pOLENd,
"OLE-Node expected" );
1234 uno::Reference < embed::XEmbeddedObject > xObj( rObj.
GetOleRef() );
1238 uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
1239 bool bHiddenEmbed =
false;
1243 OSL_FAIL(
"Unknown Object" );
1253 if( !rFrameFormat.
GetName().isEmpty() )
1258 OStringBuffer sOut(
"<");
1266 aAny = xSet->getPropertyValue(
"PluginURL");
1267 if( (aAny >>=
aStr) && !
aStr.isEmpty() )
1273 if( !
aURL.isEmpty() )
1283 aAny = xSet->getPropertyValue(
"PluginMimeType");
1284 if( (aAny >>= aType) && !aType.isEmpty() )
1299 bHiddenEmbed =
true;
1315 aAny = xSet->getPropertyValue(
"AppletCodeBase");
1316 if( (aAny >>= aCd) && !aCd.isEmpty() )
1319 if( !sCodeBase.isEmpty() )
1331 aAny = xSet->getPropertyValue(
"AppletCode");
1340 OUString aAppletName;
1341 aAny = xSet->getPropertyValue(
"AppletName");
1342 aAny >>= aAppletName;
1343 if( !aAppletName.isEmpty() )
1352 bool bScript =
false;
1353 aAny = xSet->getPropertyValue(
"AppletIsScript");
1391 uno::Sequence < beans::PropertyValue > aProps;
1392 aAny = xSet->getPropertyValue(
"AppletCommands");
1397 std::vector<sal_uLong> aParams;
1398 size_t i = aCommands.
size();
1401 const SvCommand& rCommand = aCommands[ --
i ];
1402 const OUString& rName = rCommand.
GetCommand();
1414 aParams.push_back(
i );
1422 size_t ii = aParams.size();
1425 const SvCommand& rCommand = aCommands[ aParams[--ii] ];
1426 const OUString& rName = rCommand.
GetCommand();
1443 if( aCommands.
size() )
1451 uno::Sequence < beans::PropertyValue > aProps;
1452 aAny = xSet->getPropertyValue(
"PluginCommands");
1457 for(
size_t i = 0;
i < aCommands.
size();
i++ )
1460 const OUString& rName = rCommand.
GetCommand();
1481 if( !aEndTags.isEmpty() )
1488 bool bInCntnr,
bool bWriteReplacementGraphic )
1494 OSL_ENSURE( pOLENd,
"OLE-Node expected" );
1503 uno::Reference<document::XEmbeddedObjectSupplier2> xEmbeddedObjectSupplier(xTextContent, uno::UNO_QUERY);
1504 uno::Reference<frame::XStorable> xStorable(xEmbeddedObjectSupplier->getEmbeddedObject(), uno::UNO_QUERY);
1505 SAL_WARN_IF(!xStorable.is(),
"sw.html",
"OutHTML_FrameFormatOLENodeGrf: no embedded object");
1508 uno::Reference<lang::XServiceInfo> xServiceInfo(xStorable, uno::UNO_QUERY);
1510 if (xServiceInfo.is())
1512 if (xServiceInfo->supportsService(
"com.sun.star.sheet.SpreadsheetDocument"))
1513 aFilter =
"HTML (StarCalc)";
1514 else if (xServiceInfo->supportsService(
"com.sun.star.text.TextDocument"))
1515 aFilter =
"HTML (StarWriter)";
1518 if (xStorable.is() && !aFilter.isEmpty())
1526 aMediaDescriptor[
"FilterName"] <<= aFilter;
1527 aMediaDescriptor[
"FilterOptions"] <<= OUString(
"SkipHeaderFooter");
1528 aMediaDescriptor[
"OutputStream"] <<= xOutputStream;
1529 xStorable->storeToURL(
"private:stream", aMediaDescriptor.getAsConstPropertyValueList());
1531 OString
aData(
static_cast<const char*
>(aStream.
GetData()),
static_cast<sal_Int32
>(aStream.
GetSize()));
1537 catch ( uno::Exception& )
1547 SAL_WARN(
"sw.html",
"Unexpected missing OLE fallback graphic");
1554 bool bObjectOpened =
false;
1555 OUString aRTFType =
"text/rtf";
1567 OUString aFileName = lcl_CalculateFileName(rWrt.
GetOrigFileName(), aGraphic,
u"ole");
1571 uno::Reference<embed::XEmbeddedObject> xEmbeddedObject = rOLEObj.
GetOleRef();
1574 uno::Reference<io::XActiveDataStreamer> xStreamProvider;
1575 uno::Reference<embed::XEmbedPersist2> xOwnEmbedded;
1576 if (xEmbeddedObject.is())
1578 xStreamProvider.set(xEmbeddedObject, uno::UNO_QUERY);
1579 xOwnEmbedded.set(xEmbeddedObject, uno::UNO_QUERY);
1581 if (xStreamProvider.is())
1584 uno::Reference<io::XInputStream>
xStream(xStreamProvider->getStream(), uno::UNO_QUERY);
1591 aFileType = aRTFType;
1595 else if (xOwnEmbedded.is())
1610 aFileType = aRTFType;
1617 uno::Reference<embed::XStorage> xStorage = pDocSh->
GetStorage();
1618 uno::Reference<io::XStream> xInStream;
1622 xInStream = xStorage->openStreamElement(aStreamName, embed::ElementModes::READ);
1623 }
catch (
const uno::Exception&)
1625 TOOLS_WARN_EXCEPTION(
"sw.html",
"OutHTML_FrameFormatOLENodeGrf: failed to open stream element");
1631 xOutStream->getOutputStream());
1634 uno::Reference<beans::XPropertySet> xOutStreamProps(xInStream, uno::UNO_QUERY);
1635 if (xOutStreamProps.is())
1636 xOutStreamProps->getPropertyValue(
"MediaType") >>= aFileType;
1637 if (!aRTFType.isEmpty())
1639 aFileType = aRTFType;
1648 rWrt.
Strm().
WriteOString(Concat2View(
" data=\"" + aFileName.toUtf8() +
"\""));
1649 if (!aFileType.isEmpty())
1650 rWrt.
Strm().
WriteOString(Concat2View(
" type=\"" + aFileType.toUtf8() +
"\""));
1652 bObjectOpened =
true;
1656 if (!bObjectOpened || bWriteReplacementGraphic)
1658 OUString aGraphicURL;
1664 aGraphicURL = *pTempFileName;
1666 OUString aFilterName(
"JPG");
1667 XOutFlags nFlags = XOutFlags::UseGifIfPossible | XOutFlags::UseNativeIfPossible;
1671 aFilterName =
"PNG";
1672 nFlags = XOutFlags::NONE;
1675 if (aGraphic.
GetType() == GraphicType::NONE)
1678 aGraphicURL = lcl_CalculateFileName(rWrt.
GetOrigFileName(), aGraphic,
u"png");
1679 osl::File aFile(aGraphicURL);
1680 aFile.open(osl_File_OpenFlag_Create);
#define OOO_STRING_SW_HTML_O_Hidden
static OutputDevice * GetDefaultDevice()
static GraphicFilter & GetGraphicFilter()
GraphicType GetType() const
BitmapChecksum GetChecksum() const
Size GetSizePixel(const OutputDevice *pRefDevice=nullptr) const
HtmlOptionId GetToken() const
const OUString & GetTokenString() const
const OUString & GetString() const
EnumT GetEnum(const HTMLOptionEnum< EnumT > *pOptEnums, EnumT nDflt=static_cast< EnumT >(0)) const
sal_uInt32 GetNumber() const
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
static OUString GetAbsURL(std::u16string_view rTheBaseURIRef, OUString const &rTheRelURIRef, EncodeMechanism eEncodeMechanism=EncodeMechanism::WasEncoded, DecodeMechanism eDecodeMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
bool SetURL(std::u16string_view rTheAbsURIRef, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
static void ResetFrameFormatAttrs(SfxItemSet &rFrameSet)
const Size & GetMargin() const
const OUString & GetName() const
bool HasFrameBorder() const
const INetURLObject & GetURL() const
ScrollingMode GetScrollingMode() const
static void Out_FrameDescriptor(SvStream &, const OUString &rBaseURL, const css::uno::Reference< css::beans::XPropertySet > &xSet)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
css::uno::Reference< css::embed::XStorage > const & GetStorage()
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
void FillSequence(css::uno::Sequence< css::beans::PropertyValue > &) const
void FillFromSequence(const css::uno::Sequence< css::beans::PropertyValue > &)
void Append(const OUString &rCommand, const OUString &rArg)
const OUString & GetArgument() const
const OUString & GetCommand() const
bool MakeId(std::u16string_view rId)
SvStream & WriteOString(std::string_view rStr)
sal_uInt64 Seek(sal_uInt64 nPos)
SvStream & WriteChar(char nChar)
SvxCSS1LengthType m_eHeightType
SvxCSS1LengthType m_eWidthType
void SetRight(const tools::Long nR, const sal_uInt16 nProp=100)
void SetLeft(const tools::Long nL, const sal_uInt16 nProp=100)
void ExportOLEObject(svt::EmbeddedObjectRef const &rObj, SotStorage &rDestStg)
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
static SwHtmlOptType GetOptionType(std::u16string_view rName, bool bApplet)
bool SetFlyFrameAttr(SwFrameFormat &rFlyFormat, SfxItemSet &rSet)
SwDocShell * GetDocShell()
Content, content of frame (header, footer, fly).
const SwNodeIndex * GetContentIdx() const
std::stack< SwOLENode * > m_aEmbeds
Non-owning pointers to already inserted OLE nodes, matching opened <object> XHTML elements.
static OUString StripQueryFromPath(std::u16string_view rBase, const OUString &rPath)
Strips query and fragment from a URL path if base URL is a file:// one.
void SetAnchorAndAdjustment(sal_Int16 eVertOri, sal_Int16 eHoriOri, const SvxCSS1PropertyInfo &rPropInfo, SfxItemSet &rFrameSet)
static void SetSpace(const Size &rPixSpace, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, SfxItemSet &rFlyItemSet)
std::set< OUString > m_aAllowedRTFOLEMimeTypes
static bool HasStyleOptions(std::u16string_view rStyle, std::u16string_view rId, std::u16string_view rClass, const OUString *pLang=nullptr, const OUString *pDir=nullptr)
static void SetFixSize(const Size &rPixSize, const Size &rTwipDfltSize, bool bPercentWidth, bool bPercentHeight, SvxCSS1PropertyInfo const &rPropInfo, SfxItemSet &rFlyItemSet)
rtl::Reference< SwDoc > m_xDoc
bool ParseStyleOptions(const OUString &rStyle, const OUString &rId, const OUString &rClass, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, const OUString *pLang=nullptr, const OUString *pDir=nullptr)
std::unique_ptr< SwCSS1Parser > m_pCSS1Parser
std::unique_ptr< SwApplet_Impl > m_pAppletImpl
void NotifyMacroEventRead()
void RegisterFlyFrame(SwFrameFormat *pFlyFrame)
void InsertFloatingFrame()
OUString m_aEmbedURL
This is the URL of the outer <object> data if it's not OLE2 or an image.
bool mbXHTML
If XHTML markup should be written instead of HTML.
OString GetNamespace() const
Determines the prefix string needed to respect the requested namespace alias.
OString OutFrameFormatOptions(const SwFrameFormat &rFrameFormat, const OUString &rAltText, HtmlFrmOpts nFrameOpts)
void OutCSS1_FrameFormatOptions(const SwFrameFormat &rFrameFormat, HtmlFrmOpts nFrameOpts, const SdrObject *pSdrObj=nullptr, const SfxItemSet *pItemSet=nullptr)
static SwHTMLFrameType GuessOLENodeFrameType(const SwNode &rNd)
void OutNewLine(bool bCheck=false)
OString maNamespace
XML namespace, in case of XHTML.
bool IsHTMLMode(sal_uInt32 nMode) const
OUString m_aRTFOLEMimeType
void OutImplicitMark(std::u16string_view rMark, const char *pMarkType)
Layout frame for SwNoTextNode, i.e. graphics and OLE nodes (including charts).
OUString GetTitle() const
void SetTitle(const OUString &rTitle)
SwNodeOffset GetIndex() const
Base class of the Writer document model elements.
SwFrameFormat * GetFlyFormat() const
If node is in a fly return the respective format.
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
virtual Size GetTwipSize() const override
const SwOLEObj & GetOLEObj() const
const Graphic * GetGraphic()
svt::EmbeddedObjectRef & GetObject()
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
const OUString & GetCurrentPersistName() const
const SwPosition * GetPoint() const
static rtl::Reference< SwXTextEmbeddedObject > CreateXTextEmbeddedObject(SwDoc &rDoc, SwFrameFormat *pFrameFormat)
const OUString * GetOrigFileName() const
const OUString & GetBaseURL() const
static ErrCode WriteGraphic(const Graphic &rGraphic, OUString &rFileName, const OUString &rFilterName, const XOutFlags nFlags, const Size *pMtfSize_100TH_MM=nullptr, const css::uno::Sequence< css::beans::PropertyValue > *pFilterData=nullptr, OUString *pMediaType=nullptr)
OUString CreateUniqueObjectName()
void SwitchPersistence(const css::uno::Reference< css::embed::XStorage > &)
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)
bool InsertEmbeddedObject(const css::uno::Reference< css::embed::XEmbeddedObject > &, OUString &)
static void CopyInputToOutput(const css::uno::Reference< css::io::XInputStream > &xInput, const css::uno::Reference< css::io::XOutputStream > &xOutput)
#define SO3_PLUGIN_CLASSID
#define SO3_IFRAME_CLASSID
#define SO3_APPLET_CLASSID
static bool TryRunningState(const css::uno::Reference< css::embed::XEmbeddedObject > &)
void SetGraphic(const Graphic &rGraphic, const OUString &rMediaType)
static std::unique_ptr< SvStream > CreateStream(const OUString &rFileName, StreamMode eOpenMode, css::uno::Reference< css::awt::XWindow > xParentWin=nullptr)
#define TOOLS_WARN_EXCEPTION(area, stream)
@ Fixed
Frame cannot be moved in Var-direction.
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
constexpr TypedWhichId< SwFormatHoriOrient > RES_HORI_ORIENT(109)
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(108)
constexpr sal_uInt16 RES_FRMATR_END(141)
constexpr TypedWhichId< SvxRightMarginItem > RES_MARGIN_RIGHT(93)
constexpr TypedWhichId< SvxTextLeftMarginItem > RES_MARGIN_TEXTLEFT(92)
constexpr TypedWhichId< SwFormatContent > RES_CNTNT(101)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(97)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(98)
SwHTMLWriter & OutHTML_ImageEnd(HtmlWriter &rHtml, SwHTMLWriter &rWrt)
SwHTMLWriter & OutHTML_ImageStart(HtmlWriter &rHtml, SwHTMLWriter &rWrt, const SwFrameFormat &rFrameFormat, const OUString &rGraphicURL, Graphic const &rGraphic, const OUString &rAlternateText, const Size &rRealSize, HtmlFrmOpts nFrameOpts, const char *pMarkType, const ImageMap *pAltImgMap, std::u16string_view rMimeType)
HTMLOptionEnum< sal_Int16 > const aHTMLImgVAlignTable[]
HTMLOptionEnum< sal_Int16 > const aHTMLImgHAlignTable[]
#define OOO_STRING_SVTOOLS_HTML_O_mayscript
#define OOO_STRING_SVTOOLS_HTML_param
#define OOO_STRING_SVTOOLS_HTML_applet
#define OOO_STRING_SVTOOLS_HTML_O_value
#define OOO_STRING_SVTOOLS_HTML_iframe
#define OOO_STRING_SVTOOLS_HTML_span
#define OOO_STRING_SVTOOLS_HTML_O_src
#define OOO_STRING_SVTOOLS_HTML_O_code
#define OOO_STRING_SVTOOLS_HTML_O_type
#define OOO_STRING_SVTOOLS_HTML_embed
#define OOO_STRING_SVTOOLS_HTML_O_name
#define OOO_STRING_SVTOOLS_HTML_object
#define OOO_STRING_SVTOOLS_HTML_O_codebase
const HtmlFrmOpts HTML_FRMOPTS_OLE_CSS1
const HtmlFrmOpts HTML_FRMOPTS_IFRAME
const HtmlFrmOpts HTML_FRMOPTS_EMBED_CNTNR
const HtmlFrmOpts HTML_FRMOPTS_IFRAME_CNTNR
SwHTMLWriter & OutHTML_FrameFormatOLENode(SwHTMLWriter &rWrt, const SwFrameFormat &rFrameFormat, bool bInCntnr)
const HtmlFrmOpts HTML_FRMOPTS_IFRAME_ALL
#define HTML_DFLT_EMBED_HEIGHT
const HtmlFrmOpts HTML_FRMOPTS_EMBED
#define HTML_DFLT_EMBED_WIDTH
const HtmlFrmOpts HTML_FRMOPTS_APPLET_CNTNR
const HtmlFrmOpts HTML_FRMOPTS_EMBED_ALL
#define HTML_DFLT_APPLET_HEIGHT
#define HTML_DFLT_APPLET_WIDTH
const HtmlFrmOpts HTML_FRMOPTS_APPLET
const HtmlFrmOpts HTML_FRMOPTS_APPLET_ALL
SwHTMLWriter & OutHTML_FrameFormatOLENodeGrf(SwHTMLWriter &rWrt, const SwFrameFormat &rFrameFormat, bool bInCntnr, bool bWriteReplacementGraphic)
const HtmlFrmOpts HTML_FRMOPTS_HIDDEN_EMBED
Sequence< PropertyValue > aArguments
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
constexpr OUStringLiteral aData
void ParseFrameOptions(SfxFrameDescriptor *pFrame, const HTMLOptions &rOptions, std::u16string_view rBaseURL)
bool WrapOleInRtf(SvStream &rOle2, SvStream &rRtf, SwOLENode &rOLENode, const SwFrameFormat &rFormat)
Wraps an OLE2 container binary in an RTF fragment.
bool ExtractOleFromRtf(SvStream &rRtf, SvStream &rOle, bool &bOwnFormat)
Extracts an OLE2 container binary from an RTF fragment.
SVL_DLLPUBLIC Link< OUString *, bool > const & GetMaybeFileHdl()
SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const &rTheBaseURIRef, OUString const &rTheRelURIRef, Link< OUString *, bool > const &rMaybeFileHdl=Link< OUString *, bool >(), bool bCheckFileExists=true, bool bIgnoreFragment=false, INetURLObject::EncodeMechanism eEncodeMechanism=INetURLObject::EncodeMechanism::WasEncoded, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
SVL_DLLPUBLIC OUString simpleNormalizedMakeRelative(OUString const &baseUriReference, OUString const &uriReference)
COMPHELPER_DLLPUBLIC bool isFileUrl(std::u16string_view url)
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)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
::std::vector< HTMLOption > HTMLOptions
const char *const aClassID
const sal_Unicode *const aMimeType[]
TOOLS_DLLPUBLIC OString read_uInt8s_ToOString(SvStream &rStrm, std::size_t nUnits)
static SVT_DLLPUBLIC SvStream & Out_AsciiTag(SvStream &, std::string_view rStr, bool bOn=true)
static SVT_DLLPUBLIC SvStream & Out_String(SvStream &, const OUString &, OUString *pNonConvertableChars=nullptr)
@ SVX_CSS1_LTYPE_PERCENTAGE
#define WARN_SWG_POOR_LOAD
@ Replacement
The graphic frame is a replacement image of an OLE object.
#define HTMLMODE_ABS_POS_FLY