22#include <rtl/tencinfo.h>
38#include <com/sun/star/script/Converter.hpp>
39#include <com/sun/star/document/XDocumentProperties.hpp>
40#include <com/sun/star/beans/XPropertySet.hpp>
42#include <rtl/bootstrap.hxx>
43#include <rtl/strbuf.hxx>
53 const OUString& rName,
54 const OUString& rContent,
56 OUString *pNonConvertableChars )
78 const uno::Reference<document::XDocumentProperties> & i_xDocProps,
80 OUString *pNonConvertableChars )
83 pNonConvertableChars );
90 if( i_xDocProps.is() )
92 const OUString& rTitle = i_xDocProps->getTitle();
93 if( !rTitle.isEmpty() )
99 if( i_xDocProps.is() )
101 const OUString&
rTarget = i_xDocProps->getDefaultTarget();
117 OUString os(
"$_OS" );
118 ::rtl::Bootstrap::expandMacros(os);
119 sGenerator = sGenerator.replaceFirst(
"%1", os );
122 if( !i_xDocProps.is() )
126 if( (i_xDocProps->getAutoloadSecs() != 0) ||
127 !i_xDocProps->getAutoloadURL().isEmpty() )
129 OUString sContent = OUString::number(
130 i_xDocProps->getAutoloadSecs() );
132 const OUString &rReloadURL = i_xDocProps->getAutoloadURL();
133 if( !rReloadURL.isEmpty() )
136 rBaseURL, rReloadURL);
140 pNonConvertableChars );
144 const OUString& rAuthor = i_xDocProps->getAuthor();
145 if( !rAuthor.isEmpty() )
147 pNonConvertableChars );
150 ::util::DateTime uDT = i_xDocProps->getCreationDate();
155 pNonConvertableChars );
158 const OUString& rChangedBy = i_xDocProps->getModifiedBy();
159 if( !rChangedBy.isEmpty() )
161 pNonConvertableChars );
164 uDT = i_xDocProps->getModificationDate();
168 pNonConvertableChars );
171 const OUString& rTheme = i_xDocProps->getSubject();
172 if( !rTheme.isEmpty() )
174 pNonConvertableChars );
177 const OUString& rComment = i_xDocProps->getDescription();
178 if( !rComment.isEmpty() )
180 pNonConvertableChars);
183 OUString
Keywords = ::comphelper::string::convertCommaSeparated(
184 i_xDocProps->getKeywords());
187 pNonConvertableChars);
189 uno::Reference < script::XTypeConverter >
xConverter( script::Converter::create(
190 ::comphelper::getProcessComponentContext() ) );
191 uno::Reference<beans::XPropertySet> xUserDefinedProps(
192 i_xDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW);
193 uno::Reference<beans::XPropertySetInfo> xPropInfo =
194 xUserDefinedProps->getPropertySetInfo();
195 DBG_ASSERT(xPropInfo.is(),
"UserDefinedProperties Info is null");
196 const uno::Sequence<beans::Property>
props = xPropInfo->getProperties();
197 for (
const auto& rProp :
props)
201 OUString
name = rProp.Name;
203 xUserDefinedProps->getPropertyValue(
name),
204 uno::TypeClass_STRING);
209 pNonConvertableChars );
211 catch (
const uno::Exception&)
214 SAL_INFO(
"sfx",
"SfxFrameHTMLWriter::Out_DocInfo: exception");
220 SvStream& rOut,
const OUString& rBaseURL,
const uno::Reference < beans::XPropertySet >& xSet )
226 uno::Any aAny = xSet->getPropertyValue(
"FrameURL");
227 if ( (aAny >>=
aStr) && !
aStr.isEmpty() )
230 if( !
aURL.isEmpty() )
242 aAny = xSet->getPropertyValue(
"FrameName");
243 if ( (aAny >>=
aStr) && !
aStr.isEmpty() )
253 aAny = xSet->getPropertyValue(
"FrameMarginWidth");
257 "=" + OString::number(nVal));
259 aAny = xSet->getPropertyValue(
"FrameMarginHeight");
263 "=" + OString::number(nVal));
267 aAny = xSet->getPropertyValue(
"FrameIsAutoScroll");
268 if ( (aAny >>= bVal) && !bVal )
270 aAny = xSet->getPropertyValue(
"FrameIsScrollingMode");
280 aAny = xSet->getPropertyValue(
"FrameIsAutoBorder");
281 if ( (aAny >>= bVal) && !bVal )
283 aAny = xSet->getPropertyValue(
"FrameIsBorder");
294 catch (
const uno::Exception&)
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
static void Out_DocInfo(SvStream &rStrm, const OUString &rBaseURL, const css::uno::Reference< css::document::XDocumentProperties > &, const char *pIndent, OUString *pNonConvertableChars=nullptr)
static void Out_FrameDescriptor(SvStream &, const OUString &rBaseURL, const css::uno::Reference< css::beans::XPropertySet > &xSet)
static SAL_DLLPRIVATE void OutMeta(SvStream &rStrm, const char *pIndent, const OUString &rName, const OUString &rContent, bool bHTTPEquiv, OUString *pNonConvertableChars=nullptr)
SvStream & WriteOString(std::string_view rStr)
static void convertTimeOrDateTime(OUStringBuffer &rBuffer, const css::util::DateTime &rDateTime)
#define SAL_NEWLINE_STRING
#define DBG_ASSERT(sCon, aError)
Reference< XTypeConverter > xConverter
char const sHTML_SC_yes[]
#define OOO_STRING_SVTOOLS_HTML_O_httpequiv
#define OOO_STRING_SVTOOLS_HTML_META_changed
#define OOO_STRING_SVTOOLS_HTML_meta
#define OOO_STRING_SVTOOLS_HTML_O_target
#define OOO_STRING_SVTOOLS_HTML_O_scrolling
#define OOO_STRING_SVTOOLS_HTML_title
#define OOO_STRING_SVTOOLS_HTML_META_created
#define OOO_STRING_SVTOOLS_HTML_META_refresh
#define OOO_STRING_SVTOOLS_HTML_O_marginwidth
#define OOO_STRING_SVTOOLS_HTML_O_src
#define OOO_STRING_SVTOOLS_HTML_O_marginheight
#define OOO_STRING_SVTOOLS_HTML_O_frameborder
#define OOO_STRING_SVTOOLS_HTML_base
#define OOO_STRING_SVTOOLS_HTML_O_content
#define OOO_STRING_SVTOOLS_HTML_META_keywords
#define OOO_STRING_SVTOOLS_HTML_META_description
#define OOO_STRING_SVTOOLS_HTML_META_author
#define OOO_STRING_SVTOOLS_HTML_META_changedby
#define OOO_STRING_SVTOOLS_HTML_O_name
#define OOO_STRING_SVTOOLS_HTML_META_content_type
#define OOO_STRING_SVTOOLS_HTML_META_classification
#define OOO_STRING_SVTOOLS_HTML_META_generator
#define SAL_INFO(area, stream)
OUString ExpandVariables(const OUString &rString)
SVL_DLLPUBLIC OUString simpleNormalizedMakeRelative(OUString const &baseUriReference, OUString const &uriReference)
OString stripEnd(const OString &rIn, char c)
constexpr OUStringLiteral STR_HTML_GENERATOR
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)
std::unique_ptr< char[]> aBuffer