21#include <rtl/ustrbuf.hxx>
30#include <com/sun/star/beans/XPropertyAccess.hpp>
31#include <com/sun/star/beans/StringPair.hpp>
32#include <com/sun/star/document/XDocumentProperties.hpp>
33#include <com/sun/star/util/DateTime.hpp>
34#include <com/sun/star/util/Duration.hpp>
35#include <com/sun/star/xml/sax/XSAXSerializable.hpp>
58 OUString::number(
static_cast<sal_Int32
>(rDateTime.Year) )
70 return sTmp.makeStringAndClear();
76 if ( !rText.isEmpty() ) {
86 if (rDate.Month != 0) {
88 if ( !sValue.isEmpty() ) {
136 const uno::Sequence< OUString > keywords =
mxDocProps->getKeywords();
137 for (
const auto& rKeyword : keywords) {
146 if (!sValue.isEmpty()) {
165 sal_Int32 secs =
mxDocProps->getEditingDuration();
171 false, 0, 0, 0, secs/3600, (secs%3600)/60, secs%60, 0));
176 const OUString sDefTarget =
mxDocProps->getDefaultTarget();
177 if ( !sDefTarget.isEmpty() )
192 const OUString sReloadURL =
mxDocProps->getAutoloadURL();
193 const sal_Int32 sReloadDelay =
mxDocProps->getAutoloadSecs();
194 if (sReloadDelay != 0 || !sReloadURL.isEmpty())
201 sReloadDelay/3600, (sReloadDelay%3600)/60, sReloadDelay%60, 0));
203 buf.makeStringAndClear());
210 const OUString sTplPath =
mxDocProps->getTemplateURL();
211 if ( !sTplPath.isEmpty() )
233 uno::Reference< beans::XPropertyAccess > xUserDefined(
234 mxDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW);
235 const uno::Sequence< beans::PropertyValue >
props =
236 xUserDefined->getPropertyValues();
237 for (
const auto& rProp :
props) {
238 OUStringBuffer sValueBuffer;
239 OUStringBuffer
sType;
246 sType.makeStringAndClear() );
252 const uno::Sequence< beans::NamedValue > aDocStatistic =
255 if ( !aDocStatistic.hasElements() )
258 for (
const auto& rDocStat : aDocStatistic )
261 if ( rDocStat.Value >>=
nValue )
263 OUString aValue = OUString::number(
nValue );
264 if ( rDocStat.Name ==
"TableCount" )
267 else if ( rDocStat.Name ==
"ObjectCount" )
270 else if ( rDocStat.Name ==
"ImageCount" )
273 else if ( rDocStat.Name ==
"PageCount" )
276 else if ( rDocStat.Name ==
"ParagraphCount" )
279 else if ( rDocStat.Name ==
"WordCount" )
282 else if ( rDocStat.Name ==
"CharacterCount" )
285 else if ( rDocStat.Name ==
"CellCount" )
290 SAL_WARN(
"xmloff",
"Unknown statistic value!");
305 uno::Reference<document::XDocumentProperties> i_rDocProps ) :
307 mxDocProps(
std::move( i_rDocProps )),
319 uno::Reference< xml::sax::XSAXSerializable> xSAXable(
mxDocProps,
322 ::std::vector< beans::StringPair >
namespaces;
325 key != USHRT_MAX; key = rNsMap.
GetNextKey(key)) {
326 beans::StringPair
ns;
331 assert(!
"namespace attribute not starting with xmlns unexpected");
351 assert(
m_level == 0 &&
"SvXMLMetaExport: level error");
358 assert(
m_level == 0 &&
"SvXMLMetaExport: level error");
364 const uno::Reference< xml::sax::XAttributeList > & i_xAttribs)
370 const sal_Int16
nCount = i_xAttribs->getLength();
372 const OUString
name(i_xAttribs->getNameByIndex(
i));
377 key != USHRT_MAX; key = rNsMap.
GetNextKey(key)) {
385 i_xAttribs->getValueByIndex(
i));
397 const OUString
ns(rPreservedNS.First);
400 const sal_Int16
nCount = i_xAttribs->getLength();
402 const OUString
name(i_xAttribs->getNameByIndex(
i));
415 if (i_rName.startsWith(
s_meta)) {
418 const sal_Int16
nLength = i_xAttribs->getLength();
420 const OUString
name (i_xAttribs->getNameByIndex (
i));
421 OUString
value(i_xAttribs->getValueByIndex(
i));
428 const sal_Int16
nLength = i_xAttribs->getLength();
430 const OUString
name (i_xAttribs->getNameByIndex(
i));
431 const OUString
value (i_xAttribs->getValueByIndex(
i));
451 assert(
m_level >= 0 &&
"SvXMLMetaExport: level error");
const OUString & getBcp47(bool bResolveSystem=true) const
const SvXMLNamespaceMap & GetNamespaceMap() const
OUString GetRelativeReference(const OUString &rValue)
void StartElement(sal_uInt16 nPrefix, enum ::xmloff::token::XMLTokenEnum eName, bool bIgnWSOutside)
void AddAttribute(sal_uInt16 nPrefix, const OUString &rName, const OUString &rValue)
void Characters(const OUString &rChars)
void IgnorableWhitespace()
void EndElement(sal_uInt16 nPrefix, enum ::xmloff::token::XMLTokenEnum eName, bool bIgnWSInside)
const OUString & GetNameByKey(sal_uInt16 nKey) const
sal_uInt16 GetFirstKey() const
OUString GetAttrNameByKey(sal_uInt16 nKey) const
sal_uInt16 GetNextKey(sal_uInt16 nOldKey) const
static void convertDuration(OUStringBuffer &rBuffer, const double fTime)
static bool convertAny(OUStringBuffer &rsValue, OUStringBuffer &rsType, const css::uno::Any &rValue)
static OUString GetGeneratorString()
#define SAL_WARN(area, stream)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
Handling of tokens in XML:
XMLTokenEnum
The enumeration of all XML tokens.
@ XML_HYPERLINK_BEHAVIOUR
OReadStatusBarDocumentHandler::StatusBar_XML_Namespace nNamespace
constexpr sal_uInt16 XML_NAMESPACE_META
constexpr sal_uInt16 XML_NAMESPACE_DC
constexpr sal_uInt16 XML_NAMESPACE_XLINK
constexpr sal_uInt16 XML_NAMESPACE_OFFICE