Kaydet (Commit) eb9f9735 authored tarafından Rüdiger Timm's avatar Rüdiger Timm

INTEGRATION: CWS oasis (1.5.144); FILE MERGED

2004/05/28 16:38:01 mib 1.5.144.1: - #i20153#: Events
üst d36d149d
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: XMLStarBasicExportHandler.cxx,v $ * $RCSfile: XMLStarBasicExportHandler.cxx,v $
* *
* $Revision: 1.5 $ * $Revision: 1.6 $
* *
* last change: $Author: vg $ $Date: 2003-05-26 08:34:03 $ * last change: $Author: rt $ $Date: 2004-07-13 08:17:50 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -79,6 +79,9 @@ ...@@ -79,6 +79,9 @@
#include "xmltoken.hxx" #include "xmltoken.hxx"
#endif #endif
#ifndef _XMLOFF_NMSPMAP_HXX
#include "nmspmap.hxx"
#endif
#ifndef _XMLOFF_XMLNMSPE_HXX #ifndef _XMLOFF_XMLNMSPE_HXX
#include "xmlnmspe.hxx" #include "xmlnmspe.hxx"
#endif #endif
...@@ -88,6 +91,7 @@ using namespace ::com::sun::star::uno; ...@@ -88,6 +91,7 @@ using namespace ::com::sun::star::uno;
using namespace ::xmloff::token; using namespace ::xmloff::token;
using ::rtl::OUString; using ::rtl::OUString;
using ::rtl::OUStringBuffer;
using ::com::sun::star::beans::PropertyValue; using ::com::sun::star::beans::PropertyValue;
...@@ -106,13 +110,16 @@ XMLStarBasicExportHandler::~XMLStarBasicExportHandler() ...@@ -106,13 +110,16 @@ XMLStarBasicExportHandler::~XMLStarBasicExportHandler()
void XMLStarBasicExportHandler::Export( void XMLStarBasicExportHandler::Export(
SvXMLExport& rExport, SvXMLExport& rExport,
const OUString& rEventName, const OUString& rEventQName,
Sequence<PropertyValue> & rValues, Sequence<PropertyValue> & rValues,
sal_Bool bUseWhitespace) sal_Bool bUseWhitespace)
{ {
rExport.AddAttribute(XML_NAMESPACE_SCRIPT, XML_LANGUAGE, sStarBasic); rExport.AddAttribute(XML_NAMESPACE_SCRIPT, XML_LANGUAGE,
rExport.AddAttribute(XML_NAMESPACE_SCRIPT, XML_EVENT_NAME, rEventName); rExport.GetNamespaceMap().GetQNameByKey(
XML_NAMESPACE_OOO, sStarBasic ) );
rExport.AddAttribute(XML_NAMESPACE_SCRIPT, XML_EVENT_NAME, rEventQName);
OUString sLocation, sName;
sal_Int32 nCount = rValues.getLength(); sal_Int32 nCount = rValues.getLength();
for(sal_Int32 i = 0; i < nCount; i++) for(sal_Int32 i = 0; i < nCount; i++)
{ {
...@@ -120,20 +127,33 @@ void XMLStarBasicExportHandler::Export( ...@@ -120,20 +127,33 @@ void XMLStarBasicExportHandler::Export(
{ {
OUString sTmp; OUString sTmp;
rValues[i].Value >>= sTmp; rValues[i].Value >>= sTmp;
rExport.AddAttribute( sLocation = GetXMLToken(
XML_NAMESPACE_SCRIPT, XML_LOCATION, (sTmp.equalsIgnoreAsciiCase(sApplication) ||
(sTmp.equalsIgnoreAsciiCase(sApplication) || sTmp.equalsIgnoreAsciiCase(sStarOffice) ) ? XML_APPLICATION sTmp.equalsIgnoreAsciiCase(sStarOffice) ) ? XML_APPLICATION
: XML_DOCUMENT ); : XML_DOCUMENT );
} }
else if (sMacroName.equals(rValues[i].Name)) else if (sMacroName.equals(rValues[i].Name))
{ {
OUString sTmp; rValues[i].Value >>= sName;
rValues[i].Value >>= sTmp;
rExport.AddAttribute(XML_NAMESPACE_SCRIPT, XML_MACRO_NAME, sTmp);
} }
// else: disregard // else: disregard
} }
SvXMLElementExport aEventElemt(rExport, XML_NAMESPACE_SCRIPT, XML_EVENT, if( sLocation.getLength() )
{
OUStringBuffer sTmp( sLocation.getLength() + sName.getLength() + 1 );
sTmp = sLocation;
sTmp.append( sal_Unicode( ':' ) );
sTmp.append( sName );
rExport.AddAttribute(XML_NAMESPACE_SCRIPT, XML_MACRO_NAME,
sTmp.makeStringAndClear());
}
else
{
rExport.AddAttribute(XML_NAMESPACE_SCRIPT, XML_MACRO_NAME, sName );
}
SvXMLElementExport aEventElemt(rExport, XML_NAMESPACE_SCRIPT,
XML_EVENT_LISTENER,
bUseWhitespace, sal_False); bUseWhitespace, sal_False);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment