28 using ::com::sun::star::xml::sax::XAttributeList;
29 using ::com::sun::star::uno::Reference;
30 using ::com::sun::star::uno::Sequence;
49 const OUString& rLanguage,
50 std::unique_ptr<XMLEventContextFactory> pFactory )
59 if (
nullptr == pTransTable)
71 "conflicting event translations");
74 (*pEventNameMap)[aName] =
75 OUString::createFromAscii(pTrans->sAPIName);
90 "no translation tables left to pop");
102 const Reference<css::xml::sax::XFastAttributeList> & xAttrList,
104 const OUString& rXmlEventName,
105 const OUString& rLanguage)
113 sal_uInt16 nMacroPrefix =
117 NameMap::iterator aNameIter =
pEventNameMap->find(aEventName);
120 OUString aScriptLanguage;
122 GetKeyByAttrValueQName(rLanguage, &aScriptLanguage);
124 aScriptLanguage = rLanguage ;
127 FactoryMap::iterator aFactoryIterator =
132 pContext = aFactoryIterator->second->CreateContext(
134 rEvents, aNameIter->second);
139 if(
nullptr == pContext )
145 aMsgParams[0] = rXmlEventName;
146 aMsgParams[1] = rLanguage;
std::vector< std::unique_ptr< NameMap > > aEventNameMapVector
stack of previous aEventNameMap
constexpr sal_uInt16 XML_NAMESPACE_OOO
SvXMLNamespaceMap & GetNamespaceMap()
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
sal_uInt16 GetKeyByAttrValueQName(const OUString &rAttrName, OUString *pLocalName) const
#define XMLERROR_ILLEGAL_EVENT
#define DBG_ASSERT(sCon, aError)
void AddTranslationTable(const XMLEventNameTranslation *pTransTable)
add event name translation to the internal table
FactoryMap aFactoryMap
map of XMLEventContextFactory objects
This class deliberately does not support XWeak, to improve performance when loading large documents...
void PopTranslationTable()
recover the top-most previously saved translation table
void NotifyMacroEventRead()
#define XMLERROR_FLAG_ERROR
std::unique_ptr< NameMap > pEventNameMap
map from XML to API names
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.
void PushTranslationTable()
save the old translation table on a stack and install an empty table
::std::map< XMLEventName, OUString > NameMap
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
void RegisterFactory(const OUString &rLanguage, std::unique_ptr< XMLEventContextFactory > aFactory)
register a handler for a particular language type
XMLEventNameTranslation: define tables that translate between event names as used in the XML file for...