diff options
author | Daniel Vogelheim <dvo@openoffice.org> | 2001-01-23 12:20:04 +0000 |
---|---|---|
committer | Daniel Vogelheim <dvo@openoffice.org> | 2001-01-23 12:20:04 +0000 |
commit | bdd39ed7f88d855e699aa4272a77f5df0ff37ecb (patch) | |
tree | fda88ca9410b34ce770e794b224879a40ebc73a8 /xmloff/inc/XMLEventImportHelper.hxx | |
parent | 1d9f7d2c9ca5bd7947effb5695c8acc4335b40b5 (diff) |
- added: translation tables are now kept in a stack
- fixed: now use STL iterators to find elements (rather than a count(), operator[] sequence)
- fixed: header is now commented
Diffstat (limited to 'xmloff/inc/XMLEventImportHelper.hxx')
-rw-r--r-- | xmloff/inc/XMLEventImportHelper.hxx | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/xmloff/inc/XMLEventImportHelper.hxx b/xmloff/inc/XMLEventImportHelper.hxx index 981d7fa40062..addfb5a6cd41 100644 --- a/xmloff/inc/XMLEventImportHelper.hxx +++ b/xmloff/inc/XMLEventImportHelper.hxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLEventImportHelper.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: dvo $ $Date: 2000-12-19 18:56:47 $ + * last change: $Author: dvo $ $Date: 2001-01-23 13:20:03 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -71,6 +71,7 @@ #endif #include <map> +#include <list> namespace com { namespace sun { namespace star { @@ -83,23 +84,52 @@ struct XMLEventNameTranslation; typedef ::std::map< ::rtl::OUString, XMLEventContextFactory* > FactoryMap; typedef ::std::map< ::rtl::OUString, ::rtl::OUString > NameMap; +typedef ::std::list< NameMap* > NameMapList; +/** + * Helps the XMLEventsImportContext. + * + * This class stores + * a) the translation from XML event names to API event names, and + * b) a mapping from script language names to XMLEventContextFactory objects + * (that handle particular languages). + * + * Event name translation tables may be added, i.e. they will be joined + * together. If different translations are needed (i.e., if the same XML name + * needs to be translated to different API names in different contexts), then + * translation tables may be saved on a translation table stack. + */ class XMLEventImportHelper { + /// map of XMLEventContextFactory objects FactoryMap aFactoryMap; - NameMap aEventNameMap; + + /// map from XML to API names + NameMap* pEventNameMap; + + /// stack of previous aEventNameMap + NameMapList aEventNameMapList; public: XMLEventImportHelper(); ~XMLEventImportHelper(); + /// register a handler for a particular language type void RegisterFactory( const ::rtl::OUString& rLanguage, XMLEventContextFactory* aFactory ); + /// add event name translation to the internal table void AddTranslationTable( const XMLEventNameTranslation* pTransTable ); + /// save the old translation table on a stack and install an empty table + void PushTranslationTable(); + + /// recover the top-most previously saved translation table + void PopTranslationTable(); + + /// create an appropriate import context for a particular event SvXMLImportContext* CreateContext( SvXMLImport& rImport, sal_uInt16 nPrefix, |