diff options
author | Daniel Vogelheim <dvo@openoffice.org> | 2001-06-29 20:07:26 +0000 |
---|---|---|
committer | Daniel Vogelheim <dvo@openoffice.org> | 2001-06-29 20:07:26 +0000 |
commit | f4983559bde7e92cc93ddaf79650db9aabc15019 (patch) | |
tree | fb2a4107a2c056882b68f14fda364b2e14e142b3 /xmloff/source/script | |
parent | 5e7951a2d8e80d1353ee51be3c0129e24841e1ce (diff) |
#86004# changes sXML_* strings to XML_* tokens
Diffstat (limited to 'xmloff/source/script')
-rw-r--r-- | xmloff/source/script/XMLEventExport.cxx | 12 | ||||
-rw-r--r-- | xmloff/source/script/XMLEventImportHelper.cxx | 8 | ||||
-rw-r--r-- | xmloff/source/script/XMLEventsImportContext.cxx | 15 | ||||
-rw-r--r-- | xmloff/source/script/XMLStarBasicContextFactory.cxx | 16 | ||||
-rw-r--r-- | xmloff/source/script/XMLStarBasicExportHandler.cxx | 21 | ||||
-rw-r--r-- | xmloff/source/script/xmlscripti.cxx | 39 |
6 files changed, 54 insertions, 57 deletions
diff --git a/xmloff/source/script/XMLEventExport.cxx b/xmloff/source/script/XMLEventExport.cxx index f517325091b1..f0aa5f9fd295 100644 --- a/xmloff/source/script/XMLEventExport.cxx +++ b/xmloff/source/script/XMLEventExport.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLEventExport.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: dvo $ $Date: 2001-02-21 20:30:19 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:16 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,8 +83,8 @@ #include "xmlexp.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLNMSPE_HXX @@ -104,12 +104,14 @@ using ::com::sun::star::beans::PropertyValue; using ::com::sun::star::document::XEventsSupplier; using ::com::sun::star::container::XNameReplace; using ::com::sun::star::container::XNameAccess; +using ::xmloff::token::GetXMLToken; +using ::xmloff::token::XML_EVENTS; XMLEventExport::XMLEventExport(SvXMLExport& rExp, const XMLEventNameTranslation* pTranslationTable) : rExport(rExp), - sEvents(RTL_CONSTASCII_USTRINGPARAM(sXML_events)), + sEvents(GetXMLToken(XML_EVENTS)), sScriptEvents(rExp.GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_OFFICE, sEvents)), sEventType(RTL_CONSTASCII_USTRINGPARAM("EventType")) diff --git a/xmloff/source/script/XMLEventImportHelper.cxx b/xmloff/source/script/XMLEventImportHelper.cxx index 75097a37055e..94f09eb05d77 100644 --- a/xmloff/source/script/XMLEventImportHelper.cxx +++ b/xmloff/source/script/XMLEventImportHelper.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLEventImportHelper.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dvo $ $Date: 2001-01-23 13:20:04 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:16 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -79,10 +79,6 @@ #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" -#endif - using ::rtl::OUString; using ::com::sun::star::xml::sax::XAttributeList; diff --git a/xmloff/source/script/XMLEventsImportContext.cxx b/xmloff/source/script/XMLEventsImportContext.cxx index 6fec3421479c..ec824202a602 100644 --- a/xmloff/source/script/XMLEventsImportContext.cxx +++ b/xmloff/source/script/XMLEventsImportContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLEventsImportContext.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: dvo $ $Date: 2001-01-30 13:09:59 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:16 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -87,11 +87,12 @@ #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif using namespace ::com::sun::star::uno; +using namespace ::xmloff::token; using ::rtl::OUString; using ::com::sun::star::xml::sax::XAttributeList; @@ -183,13 +184,11 @@ SvXMLImportContext* XMLEventsImportContext::CreateChildContext( if (XML_NAMESPACE_SCRIPT == nPrefix) { - if (sLocalName.equalsAsciiL(sXML_event_name, - sizeof(sXML_event_name)-1)) + if (IsXMLToken(sLocalName, XML_EVENT_NAME)) { sEventName = xAttrList->getValueByIndex(nAttr); } - else if (sLocalName.equalsAsciiL(sXML_language, - sizeof(sXML_language)-1)) + else if (IsXMLToken(sLocalName, XML_LANGUAGE)) { sLanguage = xAttrList->getValueByIndex(nAttr); } diff --git a/xmloff/source/script/XMLStarBasicContextFactory.cxx b/xmloff/source/script/XMLStarBasicContextFactory.cxx index 086dda3ca819..9e731178db93 100644 --- a/xmloff/source/script/XMLStarBasicContextFactory.cxx +++ b/xmloff/source/script/XMLStarBasicContextFactory.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLStarBasicContextFactory.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: dvo $ $Date: 2000-12-19 18:56:45 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:16 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,8 +83,8 @@ #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif @@ -94,6 +94,9 @@ using ::com::sun::star::beans::PropertyValue; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Any; +using ::xmloff::token::IsXMLToken; +using ::xmloff::token::XML_LIBRARY; +using ::xmloff::token::XML_MACRO_NAME; XMLStarBasicContextFactory::XMLStarBasicContextFactory() : @@ -129,12 +132,11 @@ SvXMLImportContext* XMLStarBasicContextFactory::CreateContext( if (XML_NAMESPACE_SCRIPT == nPrefix) { - if (sLocalName.equalsAsciiL(sXML_library, sizeof(sXML_library)-1)) + if (IsXMLToken(sLocalName, XML_LIBRARY)) { sLibraryVal = xAttrList->getValueByIndex(nAttr); } - else if (sLocalName.equalsAsciiL(sXML_macro_name, - sizeof(sXML_macro_name)-1)) + else if (IsXMLToken(sLocalName, XML_MACRO_NAME)) { sMacroNameVal = xAttrList->getValueByIndex(nAttr); } diff --git a/xmloff/source/script/XMLStarBasicExportHandler.cxx b/xmloff/source/script/XMLStarBasicExportHandler.cxx index 203c2c248c30..f12fb1950163 100644 --- a/xmloff/source/script/XMLStarBasicExportHandler.cxx +++ b/xmloff/source/script/XMLStarBasicExportHandler.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLStarBasicExportHandler.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dvo $ $Date: 2001-02-06 11:51:27 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:16 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -75,8 +75,8 @@ #include "xmlexp.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLNMSPE_HXX @@ -85,13 +85,14 @@ using namespace ::com::sun::star::uno; +using namespace ::xmloff::token; using ::rtl::OUString; using ::com::sun::star::beans::PropertyValue; XMLStarBasicExportHandler::XMLStarBasicExportHandler() : - sStarBasic(RTL_CONSTASCII_USTRINGPARAM(sXML_starbasic)), + sStarBasic(GetXMLToken(XML_STARBASIC)), sLibrary(RTL_CONSTASCII_USTRINGPARAM("Library")), sMacroName(RTL_CONSTASCII_USTRINGPARAM("MacroName")) { @@ -107,8 +108,8 @@ void XMLStarBasicExportHandler::Export( Sequence<PropertyValue> & rValues, sal_Bool bUseWhitespace) { - rExport.AddAttribute(XML_NAMESPACE_SCRIPT, sXML_language, sStarBasic); - rExport.AddAttribute(XML_NAMESPACE_SCRIPT, sXML_event_name, rEventName); + rExport.AddAttribute(XML_NAMESPACE_SCRIPT, XML_LANGUAGE, sStarBasic); + rExport.AddAttribute(XML_NAMESPACE_SCRIPT, XML_EVENT_NAME, rEventName); sal_Int32 nCount = rValues.getLength(); for(sal_Int32 i = 0; i < nCount; i++) @@ -117,17 +118,17 @@ void XMLStarBasicExportHandler::Export( { OUString sTmp; rValues[i].Value >>= sTmp; - rExport.AddAttribute(XML_NAMESPACE_SCRIPT, sXML_library, sTmp); + rExport.AddAttribute(XML_NAMESPACE_SCRIPT, XML_LIBRARY, sTmp); } else if (sMacroName.equals(rValues[i].Name)) { OUString sTmp; rValues[i].Value >>= sTmp; - rExport.AddAttribute(XML_NAMESPACE_SCRIPT, sXML_macro_name, sTmp); + rExport.AddAttribute(XML_NAMESPACE_SCRIPT, XML_MACRO_NAME, sTmp); } // else: disregard } - SvXMLElementExport aEventElemt(rExport, XML_NAMESPACE_SCRIPT, sXML_event, + SvXMLElementExport aEventElemt(rExport, XML_NAMESPACE_SCRIPT, XML_EVENT, bUseWhitespace, sal_False); } diff --git a/xmloff/source/script/xmlscripti.cxx b/xmloff/source/script/xmlscripti.cxx index 5966e410dca2..ca1f10e9d8e3 100644 --- a/xmloff/source/script/xmlscripti.cxx +++ b/xmloff/source/script/xmlscripti.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlscripti.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: mib $ $Date: 2001-06-27 07:32:06 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:16 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -65,7 +65,7 @@ #include "xmlscripti.hxx" #include "xmlnmspe.hxx" -#include "xmlkywd.hxx" +#include "xmltoken.hxx" #include "xmlimp.hxx" #include "nmspmap.hxx" #include "XMLEventsImportContext.hxx" @@ -83,6 +83,7 @@ using namespace com::sun::star::frame; using namespace com::sun::star::script; using namespace com::sun::star::document; using namespace com::sun::star::xml::sax; +using namespace ::xmloff::token; //------------------------------------------------------------------------- @@ -165,9 +166,9 @@ XMLScriptElementContext::XMLScriptElementContext( SvXMLImport& rImport, sal_uInt sal_Bool bEmbedded = sal_False; sal_Bool bLinked = sal_False; - if( msLName.equalsAsciiL( sXML_library_embedded, sizeof(sXML_library_embedded)-1 ) ) + if( IsXMLToken( msLName, XML_LIBRARY_EMBEDDED ) ) bEmbedded = sal_True; - else if( msLName.equalsAsciiL( sXML_library_linked, sizeof(sXML_library_linked)-1 ) ) + else if( IsXMLToken( msLName, XML_LIBRARY_LINKED ) ) bLinked = sal_True; if( bEmbedded || bLinked ) @@ -182,22 +183,21 @@ XMLScriptElementContext::XMLScriptElementContext( SvXMLImport& rImport, sal_uInt &sAttrName ); if( (XML_NAMESPACE_SCRIPT == nAttrPrefix) && - sAttrName.equalsAsciiL( sXML_name, sizeof(sXML_name)-1 ) ) + IsXMLToken( sAttrName, XML_NAME ) ) { msLibName = xAttrList->getValueByIndex( i ); } else if( (XML_NAMESPACE_SCRIPT == nAttrPrefix) && - sAttrName.equalsAsciiL( sXML_password, - sizeof(sXML_password)-1 ) ) + IsXMLToken( sAttrName, XML_PASSWORD ) ) { sPassword = xAttrList->getValueByIndex( i ); } else if( (XML_NAMESPACE_XLINK == nAttrPrefix) && bLinked && - sAttrName.equalsAsciiL( sXML_href, sizeof(sXML_href)-1 ) ) + IsXMLToken( sAttrName, XML_HREF ) ) { sLinkTargetURL = GetImport().GetAbsoluteReference(xAttrList->getValueByIndex( i )); } - //else if( msLName.equalsAsciiL( sXML_external_source_url, sizeof(sXML_external_source_url)-1 ) ) + //else if( IsXMLToken(msLName, XML_EXTERNAL_SOURCE_URL) ) //{ //sLinkTargetURL = xAttrList->getValueByIndex( i ); //} @@ -222,14 +222,14 @@ SvXMLImportContext* XMLScriptElementContext::CreateChildContext( sal_uInt16 nPre if ( XML_NAMESPACE_SCRIPT == nPrefix) { - if( msLName.equalsAsciiL( sXML_library_embedded, sizeof(sXML_library_embedded)-1 ) ) + if( IsXMLToken( msLName, XML_LIBRARY_EMBEDDED ) ) { - if( rLName.equalsAsciiL( sXML_module, sizeof(sXML_module)-1 ) ) + if( IsXMLToken( rLName, XML_MODULE ) ) { pContext = new XMLScriptModuleContext( GetImport(), nPrefix, rLName, msLibName, xAttrList, *this, mxBasicAccess ); } - //else if( rLName.equalsAsciiL( sXML_dialog, sizeof(sXML_dilaog)-1 ) ) + //else if( IsXMLToken( rLName, XML_DIALOG ) ) //{ //pContext = new XMLScriptDialogContext( GetImport(), //nPrefix, rLName, xAttrList, *this, mxBasicAccess ); @@ -279,13 +279,12 @@ XMLScriptModuleContext::XMLScriptModuleContext( SvXMLImport& rImport, sal_uInt16 &sAttrName ); if( (XML_NAMESPACE_SCRIPT == nAttrPrefix) && - sAttrName.equalsAsciiL( sXML_name, sizeof(sXML_name)-1 ) ) + IsXMLToken( sAttrName, XML_NAME ) ) { msModuleName = xAttrList->getValueByIndex( i ); } else if( (XML_NAMESPACE_SCRIPT == nAttrPrefix) && - sAttrName.equalsAsciiL( sXML_language, - sizeof(sXML_language)-1 ) ) + IsXMLToken( sAttrName, XML_LANGUAGE ) ) { msLanguage = xAttrList->getValueByIndex( i ); } @@ -343,10 +342,8 @@ SvXMLImportContext* XMLScriptContext::CreateChildContext( sal_uInt16 nPrefix, if (XML_NAMESPACE_SCRIPT == nPrefix) { - if( rLName.equalsAsciiL( sXML_library_embedded, - sizeof(sXML_library_embedded)-1 ) || - rLName.equalsAsciiL( sXML_library_linked, - sizeof(sXML_library_linked)-1 ) ) + if( IsXMLToken( rLName, XML_LIBRARY_EMBEDDED ) || + IsXMLToken( rLName, XML_LIBRARY_LINKED ) ) { pContext = new XMLScriptElementContext( GetImport(), nPrefix, rLName, xAttrList, *this, mxBasicAccess); @@ -354,7 +351,7 @@ SvXMLImportContext* XMLScriptContext::CreateChildContext( sal_uInt16 nPrefix, } else if (XML_NAMESPACE_OFFICE == nPrefix) { - if ( rLName.equalsAsciiL(sXML_events, sizeof(sXML_events)-1) ) + if ( IsXMLToken( rLName, XML_EVENTS ) ) { Reference<XEventsSupplier> xSupplier(GetImport().GetModel(), UNO_QUERY); |