24 #include <com/sun/star/document/XEventsSupplier.hpp>
35 using ::com::sun::star::xml::sax::XAttributeList;
36 using ::com::sun::star::beans::PropertyValue;
37 using ::com::sun::star::container::XNameReplace;
38 using ::com::sun::star::document::XEventsSupplier;
39 using ::com::sun::star::lang::IllegalArgumentException;
50 const Reference<XEventsSupplier> & xEventsSupplier) :
52 xEvents(xEventsSupplier->getEvents())
59 const Reference<XNameReplace> & xNameReplace) :
74 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
87 OUString sValue = aIter.toString();
103 GetImport(), xAttrList,
this, sEventName, sLanguage);
107 const Reference<XEventsSupplier> & xEventsSupplier)
109 if (xEventsSupplier.is())
116 const Reference<XNameReplace> & xNameRepl)
127 aCollectEvents.clear();
132 const OUString& rName,
133 Sequence<PropertyValue> & rSequence )
145 rSequence = aIter->second;
150 const OUString& rEventName,
151 const Sequence<PropertyValue> & rValues )
157 if (
xEvents->hasByName(rEventName))
161 xEvents->replaceByName(rEventName,
Any(rValues));
162 }
catch (
const IllegalArgumentException & rException )
168 aMsgParams, rException.Message,
nullptr);
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
css::uno::Reference< css::container::XNameReplace > xEvents
void SetEvents(const css::uno::Reference< css::document::XEventsSupplier > &xEventsSupplier)
if the import operates in delayed mode, you can use this method to set all events that have been read...
SvXMLImport & GetImport()
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
void AddEventValues(const OUString &rEventName, const css::uno::Sequence< css::beans::PropertyValue > &rValues)
void GetEventSequence(const OUString &rName, css::uno::Sequence< css::beans::PropertyValue > &rSequence)
if the import operates in delayed mode, you can use this method to obtain the value sequence for a sp...
#define XMLERROR_ILLEGAL_EVENT
XMLEventImportHelper & GetEventImport()
virtual ~XMLEventsImportContext() override
This class deliberately does not support XWeak, to improve performance when loading large documents...
::std::pair< OUString, css::uno::Sequence< css::beans::PropertyValue > > EventNameValuesPair
Handling of tokens in XML:
#define XMLERROR_FLAG_ERROR
#define XML_ELEMENT(prefix, name)
void SetError(sal_Int32 nId, const css::uno::Sequence< OUString > &rMsgParams, const OUString &rExceptionMessage, const css::uno::Reference< css::xml::sax::XLocator > &rLocator)
Record an error condition that occurred during import.
SvXMLImportContext * CreateContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, XMLEventsImportContext *rEvents, const OUString &rXmlEventName, const OUString &rLanguage)
create an appropriate import context for a particular event
std::vector< EventNameValuesPair > aCollectEvents
XMLEventsImportContext(SvXMLImport &rImport)