28using ::com::sun::star::uno::Reference;
45 const OUString& rLanguage,
46 std::unique_ptr<XMLEventContextFactory> pFactory )
55 if (
nullptr == pTransTable)
67 "conflicting event translations");
70 (*pEventNameMap)[
aName] =
71 OUString::createFromAscii(pTrans->sAPIName);
86 "no translation tables left to pop");
98 const Reference<css::xml::sax::XFastAttributeList> & xAttrList,
100 const OUString& rXmlEventName,
101 const OUString& rLanguage)
107 sal_uInt16 nMacroPrefix =
108 rImport.GetNamespaceMap().GetKeyByAttrValueQName(rXmlEventName,
111 NameMap::iterator aNameIter =
pEventNameMap->find(aEventName);
114 OUString aScriptLanguage;
115 sal_uInt16 nScriptPrefix = rImport.GetNamespaceMap().
116 GetKeyByAttrValueQName(rLanguage, &aScriptLanguage);
118 aScriptLanguage = rLanguage ;
121 FactoryMap::iterator aFactoryIterator =
126 pContext = aFactoryIterator->second->CreateContext(
128 rEvents, aNameIter->second);
133 if(
nullptr == pContext )
138 { rXmlEventName, rLanguage });
::std::map< XMLEventName, OUString > NameMap
This class deliberately does not support XWeak, to improve performance when loading large documents.
FactoryMap aFactoryMap
map of XMLEventContextFactory objects
std::vector< std::unique_ptr< NameMap > > aEventNameMapVector
stack of previous aEventNameMap
void AddTranslationTable(const XMLEventNameTranslation *pTransTable)
add event name translation to the internal table
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::unique_ptr< NameMap > pEventNameMap
map from XML to API names
void RegisterFactory(const OUString &rLanguage, std::unique_ptr< XMLEventContextFactory > aFactory)
register a handler for a particular language type
void PopTranslationTable()
recover the top-most previously saved translation table
void PushTranslationTable()
save the old translation table on a stack and install an empty table
Import <script:events> element.
#define DBG_ASSERT(sCon, aError)
XMLEventNameTranslation: define tables that translate between event names as used in the XML file for...
constexpr OUStringLiteral sMacroName
#define XMLERROR_ILLEGAL_EVENT
#define XMLERROR_FLAG_ERROR
constexpr sal_uInt16 XML_NAMESPACE_OOO