diff options
author | obo <obo@openoffice.org> | 2010-06-22 05:59:20 +0200 |
---|---|---|
committer | obo <obo@openoffice.org> | 2010-06-22 05:59:20 +0200 |
commit | 818f7b8e8c68a4bd649c78ec02cccf4387159ae8 (patch) | |
tree | da087ec0aac34fccc768f295e7388952fff9a556 /xmloff | |
parent | 15cea5d07c629b15ed5a0c686f79a932d75e2fa4 (diff) | |
parent | 217f6932839045b7a3b487524366f7163fa4c035 (diff) |
CWS-TOOLING: integrate CWS mib16
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/inc/xmloff/XMLEventExport.hxx | 8 | ||||
-rw-r--r-- | xmloff/source/script/XMLEventExport.cxx | 25 |
2 files changed, 30 insertions, 3 deletions
diff --git a/xmloff/inc/xmloff/XMLEventExport.hxx b/xmloff/inc/xmloff/XMLEventExport.hxx index 4a8a8b8d45b5..b0ec63b45b35 100644 --- a/xmloff/inc/xmloff/XMLEventExport.hxx +++ b/xmloff/inc/xmloff/XMLEventExport.hxx @@ -73,6 +73,8 @@ class XMLOFF_DLLPUBLIC XMLEventExport HandlerMap aHandlerMap; NameMap aNameTranslationMap; + bool bExtNamespace; + public: XMLEventExport(SvXMLExport& rExport, const XMLEventNameTranslation* pTranslationTable = NULL); @@ -104,6 +106,12 @@ public: ::com::sun::star::container::XNameAccess> & xAccess, sal_Bool bUseWhitespace = sal_True); + /// export the events, but write <officeooo:events> element + /// (for new file format additions) + void ExportExt( ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameAccess> & xAccess, + sal_Bool bUseWhitespace = sal_True); + /// export a single event (writes <office:events> element) void ExportSingleEvent( ::com::sun::star::uno::Sequence< diff --git a/xmloff/source/script/XMLEventExport.cxx b/xmloff/source/script/XMLEventExport.cxx index e7c716a39372..f126fd566e94 100644 --- a/xmloff/source/script/XMLEventExport.cxx +++ b/xmloff/source/script/XMLEventExport.cxx @@ -62,7 +62,8 @@ using ::xmloff::token::XML_EVENT_LISTENERS; XMLEventExport::XMLEventExport(SvXMLExport& rExp, const XMLEventNameTranslation* pTranslationTable) : sEventType(RTL_CONSTASCII_USTRINGPARAM("EventType")), - rExport(rExp) + rExport(rExp), + bExtNamespace(false) { AddTranslationTable(pTranslationTable); } @@ -175,6 +176,16 @@ void XMLEventExport::Export( Reference<XNameAccess> & rAccess, } } +void XMLEventExport::ExportExt( Reference<XNameAccess> & rAccess, + sal_Bool bWhitespace ) +{ + // set bExtNamespace flag to use XML_NAMESPACE_OFFICE_EXT namespace + // for events element (not for child elements) + bExtNamespace = true; + Export(rAccess, bWhitespace); + bExtNamespace = false; // reset for future Export calls +} + /// export a singular event and wirte <office:events> container void XMLEventExport::ExportSingleEvent( Sequence<PropertyValue>& rEventValues, @@ -270,13 +281,17 @@ void XMLEventExport::StartElement(sal_Bool bWhitespace) { rExport.IgnorableWhitespace(); } - rExport.StartElement( XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS, + sal_uInt16 nNamespace = bExtNamespace ? XML_NAMESPACE_OFFICE_EXT + : XML_NAMESPACE_OFFICE; + rExport.StartElement( nNamespace, XML_EVENT_LISTENERS, bWhitespace); } void XMLEventExport::EndElement(sal_Bool bWhitespace) { - rExport.EndElement(XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS, bWhitespace); + sal_uInt16 nNamespace = bExtNamespace ? XML_NAMESPACE_OFFICE_EXT + : XML_NAMESPACE_OFFICE; + rExport.EndElement(nNamespace, XML_EVENT_LISTENERS, bWhitespace); if (bWhitespace) { rExport.IgnorableWhitespace(); @@ -343,6 +358,10 @@ const XMLEventNameTranslation aStandardEventTable[] = { "OnFieldMerge", XML_NAMESPACE_OFFICE, "field-merge" }, { "OnFieldMergeFinished", XML_NAMESPACE_OFFICE, "field-merge-finished" }, { "OnLayoutFinished", XML_NAMESPACE_OFFICE, "layout-finished" }, + { "OnDoubleClick", XML_NAMESPACE_OFFICE, "dblclick" }, + { "OnRightClick", XML_NAMESPACE_OFFICE, "contextmenu" }, + { "OnChange", XML_NAMESPACE_OFFICE, "content-changed" }, + { "OnCalculate", XML_NAMESPACE_OFFICE, "calculated" }, { NULL, 0, 0 } }; |