22 #include <com/sun/star/beans/PropertyValue.hpp>
24 #include <com/sun/star/document/XEventsSupplier.hpp>
26 #include <com/sun/star/container/XNameReplace.hpp>
28 #include <osl/diagnose.h>
37 using ::com::sun::star::beans::PropertyValue;
38 using ::com::sun::star::document::XEventsSupplier;
39 using ::com::sun::star::container::XNameReplace;
40 using ::com::sun::star::container::XNameAccess;
43 constexpr OUStringLiteral
gsEventType(u
"EventType");
58 std::unique_ptr<XMLEventExportHandler> pHandler )
67 if (
nullptr != pTransTable)
86 Export(rSupplier->getEvents(), bWhitespace);
95 Export(xAccess, bWhitespace);
108 bool bStarted =
false;
112 for(
const auto& rName : aNames)
121 Any aAny = rAccess->getByName( rName );
122 Sequence<PropertyValue> aValues;
126 ExportEvent( aValues, rXmlName, bWhitespace, bStarted );
131 SAL_WARN(
"xmloff",
"Unknown event name:" << rName );
153 Sequence<PropertyValue>& rEventValues,
154 const OUString& rApiEventName,
155 bool bUseWhitespace )
164 bool bStarted =
false;
165 ExportEvent( rEventValues, rXmlName, bUseWhitespace, bStarted );
176 SAL_WARN(
"xmloff",
"Unknown event name:" << rApiEventName );
183 Sequence<PropertyValue>& rEventValues,
189 const PropertyValue* pValue = std::find_if(rEventValues.begin(), rEventValues.end(),
192 if (pValue == rEventValues.end())
197 pValue->Value >>= sType;
209 OUString aEventQName(
215 rEventValues, bUseWhitespace);
219 if ( sType !=
"None" )
221 OSL_FAIL(
"unknown event type returned by API");
317 {
nullptr, 0,
nullptr }
void AddTranslationTable(const XMLEventNameTranslation *pTransTable)
register additional event names
constexpr sal_uInt16 XML_NAMESPACE_OFFICE
void ExportExt(css::uno::Reference< css::container::XNameAccess > const &xAccess)
export the events, but write element (for new file format additions) ...
SAL_DLLPRIVATE void StartElement(bool bUseWhitespace)
export the start element
XMLEventExport(SvXMLExport &rExport)
constexpr OUStringLiteral gsEventType(u"EventType")
constexpr sal_uInt16 XML_NAMESPACE_DOM
css::uno::Any const & rValue
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
void StartElement(sal_uInt16 nPrefix, enum::xmloff::token::XMLTokenEnum eName, bool bIgnWSOutside)
void AddHandler(const OUString &rName, std::unique_ptr< XMLEventExportHandler > pHandler)
register an EventExportHandler for a particular script type
void ExportSingleEvent(css::uno::Sequence< css::beans::PropertyValue > &rEventValues, const OUString &rApiEventName, bool bUseWhitespace=true)
export a single event (writes element)
OUString GetQNameByKey(sal_uInt16 nKey, const OUString &rLocalName, bool bCache=true) const
const SvXMLNamespaceMap & GetNamespaceMap() const
void IgnorableWhitespace()
void EndElement(sal_uInt16 nPrefix, enum::xmloff::token::XMLTokenEnum eName, bool bIgnWSInside)
SAL_DLLPRIVATE void EndElement(bool bUseWhitespace)
export the end element
OReadImagesDocumentHandler::Image_XML_Namespace nNamespace
NameMap aNameTranslationMap
constexpr sal_uInt16 XML_NAMESPACE_OFFICE_EXT
#define SAL_WARN(area, stream)
const XMLEventNameTranslation aStandardEventTable[]
a translation table for the events defined in the XEventsSupplier service (implemented in XMLEventExp...
css::uno::Any const SvXMLExport & rExport
SAL_DLLPRIVATE void ExportEvent(css::uno::Sequence< css::beans::PropertyValue > &rEventValues, const XMLEventName &rXmlEventName, bool bUseWhitespace, bool &rExported)
export one event (start container-element if necessary)
XMLEventNameTranslation: define tables that translate between event names as used in the XML file for...
void Export(css::uno::Reference< css::document::XEventsSupplier > const &xAccess, bool bUseWhitespace=true)
export the events (calls EventExport::Export(Reference) )