diff options
Diffstat (limited to 'xmloff/source/text')
68 files changed, 1602 insertions, 1656 deletions
diff --git a/xmloff/source/text/XMLAutoMarkFileContext.cxx b/xmloff/source/text/XMLAutoMarkFileContext.cxx index 05e4b5d53f61..abf731404292 100644 --- a/xmloff/source/text/XMLAutoMarkFileContext.cxx +++ b/xmloff/source/text/XMLAutoMarkFileContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLAutoMarkFileContext.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: mib $ $Date: 2001-06-27 07:33:58 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -79,8 +79,8 @@ #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _COM_SUN_STAR_UNO_REFERENCE_HXX_ @@ -103,6 +103,9 @@ using ::com::sun::star::uno::UNO_QUERY; using ::com::sun::star::xml::sax::XAttributeList; using ::com::sun::star::beans::XPropertySet; +using ::xmloff::token::IsXMLToken; +using ::xmloff::token::XML_HREF; + TYPEINIT1( XMLAutoMarkFileContext, SvXMLImportContext ); @@ -135,7 +138,7 @@ void XMLAutoMarkFileContext::StartElement( GetKeyByAttrName( xAttrList->getNameByIndex(i), &sLocalName ); if ( ( XML_NAMESPACE_XLINK == nPrefix ) && - sLocalName.equalsAsciiL(sXML_href, sizeof(sXML_href)-1 ) ) + IsXMLToken(sLocalName, XML_HREF) ) { Any aAny; aAny <<= GetImport().GetAbsoluteReference( xAttrList->getValueByIndex(i) ); diff --git a/xmloff/source/text/XMLAutoTextContainerEventImport.cxx b/xmloff/source/text/XMLAutoTextContainerEventImport.cxx index 6ce50da026ea..1640e987f3e6 100644 --- a/xmloff/source/text/XMLAutoTextContainerEventImport.cxx +++ b/xmloff/source/text/XMLAutoTextContainerEventImport.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLAutoTextContainerEventImport.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dvo $ $Date: 2001-03-09 14:53:43 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -87,8 +87,8 @@ #include "nmspmap.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLEVENTSIMPORTCONTEXT_HXX @@ -103,7 +103,8 @@ using ::com::sun::star::uno::Any; using ::com::sun::star::uno::Reference; using ::com::sun::star::xml::sax::XAttributeList; using ::com::sun::star::container::XNameReplace; - +using ::xmloff::token::IsXMLToken; +using ::xmloff::token::XML_EVENTS; TYPEINIT1(XMLAutoTextContainerEventImport, SvXMLImportContext); @@ -128,9 +129,8 @@ SvXMLImportContext* XMLAutoTextContainerEventImport::CreateChildContext( const OUString& rLocalName, const Reference<XAttributeList> & xAttrList ) { - if ((XML_NAMESPACE_OFFICE == nPrefix) && - rLocalName.equalsAsciiL(sXML_events, - sizeof(sXML_events)-1)) + if ( (XML_NAMESPACE_OFFICE == nPrefix) && + IsXMLToken( rLocalName, XML_EVENTS) ) { return new XMLEventsImportContext(GetImport(), nPrefix, rLocalName, rEvents); diff --git a/xmloff/source/text/XMLAutoTextEventExport.cxx b/xmloff/source/text/XMLAutoTextEventExport.cxx index 159ee7b61e14..adce70f2da93 100644 --- a/xmloff/source/text/XMLAutoTextEventExport.cxx +++ b/xmloff/source/text/XMLAutoTextEventExport.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLAutoTextEventExport.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: dvo $ $Date: 2001-06-18 15:08:14 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -213,7 +213,7 @@ void XMLAutoTextEventExport::initialize( sal_uInt32 XMLAutoTextEventExport::exportDoc( - const sal_Char* pClass) + enum XMLTokenEnum eClass) { if (hasEvents()) { diff --git a/xmloff/source/text/XMLAutoTextEventExport.hxx b/xmloff/source/text/XMLAutoTextEventExport.hxx index 7ac8c241fec7..c02f1e39e0e6 100644 --- a/xmloff/source/text/XMLAutoTextEventExport.hxx +++ b/xmloff/source/text/XMLAutoTextEventExport.hxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLAutoTextEventExport.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: dvo $ $Date: 2001-03-09 14:53:43 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -125,7 +125,7 @@ protected: /// export the events off all autotexts virtual sal_uInt32 exportDoc( - const sal_Char *pClass = NULL ); + enum ::xmloff::token::XMLTokenEnum eClass = xmloff::token::XML_TOKEN_INVALID ); /// does the document have any events ? sal_Bool hasEvents(); diff --git a/xmloff/source/text/XMLAutoTextEventImport.cxx b/xmloff/source/text/XMLAutoTextEventImport.cxx index 1f24a4baa884..5126ce9d847c 100644 --- a/xmloff/source/text/XMLAutoTextEventImport.cxx +++ b/xmloff/source/text/XMLAutoTextEventImport.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLAutoTextEventImport.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: dvo $ $Date: 2001-03-09 14:53:43 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -91,8 +91,8 @@ #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _TOOLS_DEBUG_HXX @@ -113,6 +113,8 @@ using ::com::sun::star::xml::sax::XAttributeList; using ::com::sun::star::document::XEventsSupplier; using ::com::sun::star::container::XNameReplace; using ::com::sun::star::lang::XMultiServiceFactory; +using ::xmloff::token::IsXMLToken; +using ::xmloff::token::XML_AUTO_TEXT_EVENTS; const sal_Char sAPI_AutoText[] = "com.sun.star.text.AutoTextContainer"; @@ -162,10 +164,8 @@ SvXMLImportContext* XMLAutoTextEventImport::CreateContext( const OUString& rLocalName, const Reference<XAttributeList > & xAttrList ) { - if ( xEvents.is() && - (XML_NAMESPACE_OFFICE == nPrefix) && - rLocalName.equalsAsciiL(sXML_auto_text_events, - sizeof(sXML_auto_text_events)-1) ) + if ( xEvents.is() && (XML_NAMESPACE_OFFICE == nPrefix) && + IsXMLToken( rLocalName, XML_AUTO_TEXT_EVENTS) ) { return new XMLAutoTextContainerEventImport( *this, nPrefix, rLocalName, xEvents); diff --git a/xmloff/source/text/XMLCalculationSettingsContext.cxx b/xmloff/source/text/XMLCalculationSettingsContext.cxx index 6d733391844d..df52bbcb7b79 100644 --- a/xmloff/source/text/XMLCalculationSettingsContext.cxx +++ b/xmloff/source/text/XMLCalculationSettingsContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLCalculationSettingsContext.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: mtg $ $Date: 2001-03-30 15:00:43 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,11 +77,8 @@ #ifndef _XMLOFF_XMLNMSPE_HXX #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" -#endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLUCONV_HXX #include "xmluconv.hxx" @@ -92,6 +89,7 @@ using namespace ::rtl; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::text; +using namespace ::xmloff::token; XMLCalculationSettingsContext::XMLCalculationSettingsContext( SvXMLImport& rImport, sal_uInt16 nPrefix, @@ -112,7 +110,7 @@ XMLCalculationSettingsContext::XMLCalculationSettingsContext( SvXMLImport& rImpo if (nPrefix == XML_NAMESPACE_TABLE) { - if (aLocalName.compareToAscii(sXML_null_year) == 0) + if ( IsXMLToken( aLocalName, XML_NULL_YEAR ) ) { sal_Int32 nTemp; GetImport().GetMM100UnitConverter().convertNumber(nTemp, sValue); diff --git a/xmloff/source/text/XMLChangeImportContext.cxx b/xmloff/source/text/XMLChangeImportContext.cxx index 73c21ef40318..0159dbd70320 100644 --- a/xmloff/source/text/XMLChangeImportContext.cxx +++ b/xmloff/source/text/XMLChangeImportContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLChangeImportContext.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dvo $ $Date: 2001-01-19 19:19:50 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,14 +83,16 @@ #include "nmspmap.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif using ::rtl::OUString; using ::com::sun::star::uno::Reference; using ::com::sun::star::text::XTextRange; using ::com::sun::star::xml::sax::XAttributeList; +using ::xmloff::token::IsXMLToken; +using ::xmloff::token::XML_CHANGE_ID; TYPEINIT1( XMLChangeImportContext, SvXMLImportContext ); @@ -124,8 +126,7 @@ void XMLChangeImportContext::StartElement( GetKeyByAttrName( xAttrList->getNameByIndex(nAttr), &sLocalName ); if ( (XML_NAMESPACE_TEXT == nPrefix) && - (sLocalName.equalsAsciiL(sXML_change_id, - sizeof(sXML_change_id)-1)) ) + IsXMLToken( sLocalName, XML_CHANGE_ID ) ) { // Id found! Now call RedlineImportHelper diff --git a/xmloff/source/text/XMLChangeInfoContext.cxx b/xmloff/source/text/XMLChangeInfoContext.cxx index 79577ee60925..06437107afb5 100644 --- a/xmloff/source/text/XMLChangeInfoContext.cxx +++ b/xmloff/source/text/XMLChangeInfoContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLChangeInfoContext.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dvo $ $Date: 2001-01-24 16:49:51 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,8 +83,8 @@ #include "nmspmap.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLIMP_HXX @@ -93,12 +93,13 @@ +using namespace ::xmloff::token; + using ::rtl::OUString; using ::com::sun::star::uno::Reference; using ::com::sun::star::xml::sax::XAttributeList; - TYPEINIT1(XMLChangeInfoContext, SvXMLImportContext); XMLChangeInfoContext::XMLChangeInfoContext( @@ -131,13 +132,11 @@ void XMLChangeInfoContext::StartElement( OUString sValue = xAttrList->getValueByIndex(nAttr); if (XML_NAMESPACE_OFFICE == nPrefix) { - if (sLocalName.equalsAsciiL(sXML_chg_author, - sizeof(sXML_chg_author)-1)) + if ( IsXMLToken( sLocalName, XML_CHG_AUTHOR ) ) { sAuthor = sValue; } - else if (sLocalName.equalsAsciiL(sXML_chg_date_time, - sizeof(sXML_chg_date_time)-1)) + else if ( IsXMLToken( sLocalName, XML_CHG_DATE_TIME ) ) { sDateTime = sValue; } @@ -155,8 +154,8 @@ SvXMLImportContext* XMLChangeInfoContext::CreateChildContext( { SvXMLImportContext* pContext = NULL; - if ((XML_NAMESPACE_TEXT == nPrefix) && - rLocalName.equalsAsciiL(sXML_p, sizeof(sXML_p)-1)) + if ( ( XML_NAMESPACE_TEXT == nPrefix ) && + IsXMLToken( rLocalName, XML_P ) ) { pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, rLocalName, sCommentBuffer); diff --git a/xmloff/source/text/XMLChangedRegionImportContext.cxx b/xmloff/source/text/XMLChangedRegionImportContext.cxx index 1475dffd9b29..38490a8e7726 100644 --- a/xmloff/source/text/XMLChangedRegionImportContext.cxx +++ b/xmloff/source/text/XMLChangedRegionImportContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLChangedRegionImportContext.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: mib $ $Date: 2001-03-09 07:23:23 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -91,8 +91,8 @@ #include "nmspmap.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLUCONV_HXX @@ -100,6 +100,7 @@ #endif +using namespace ::xmloff::token; using ::rtl::OUString; using ::com::sun::star::uno::Reference; @@ -134,9 +135,8 @@ void XMLChangedRegionImportContext::StartElement( sal_uInt16 nPrefix = GetImport().GetNamespaceMap(). GetKeyByAttrName( xAttrList->getNameByIndex(nAttr), &sLocalName ); - if ( (XML_NAMESPACE_TEXT == nPrefix) && - (sLocalName.equalsAsciiL(sXML_id, - sizeof(sXML_id)-1)) ) + if ( ( XML_NAMESPACE_TEXT == nPrefix ) && + ( IsXMLToken( sLocalName, XML_ID ) ) ) { sID = xAttrList->getValueByIndex(nAttr); } @@ -152,15 +152,14 @@ SvXMLImportContext* XMLChangedRegionImportContext::CreateChildContext( if (XML_NAMESPACE_TEXT == nPrefix) { - if (rLocalName.equalsAsciiL(sXML_insertion, sizeof(sXML_insertion)-1)|| - rLocalName.equalsAsciiL(sXML_deletion, sizeof(sXML_deletion)-1) || - rLocalName.equalsAsciiL(sXML_format_change, - sizeof(sXML_format_change)-1) ) + if ( IsXMLToken( rLocalName, XML_INSERTION ) || + IsXMLToken( rLocalName, XML_DELETION ) || + IsXMLToken( rLocalName, XML_FORMAT_CHANGE ) ) { // create XMLChangeElementImportContext for all kinds of changes pContext = new XMLChangeElementImportContext( GetImport(), nPrefix, rLocalName, - rLocalName.equalsAsciiL(sXML_deletion, sizeof(sXML_deletion)-1), + IsXMLToken( rLocalName, XML_DELETION ), *this); } // else: it may be a text element, see below diff --git a/xmloff/source/text/XMLFootnoteBodyImportContext.cxx b/xmloff/source/text/XMLFootnoteBodyImportContext.cxx index e306bdaada26..577daf665e29 100644 --- a/xmloff/source/text/XMLFootnoteBodyImportContext.cxx +++ b/xmloff/source/text/XMLFootnoteBodyImportContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLFootnoteBodyImportContext.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: mib $ $Date: 2000-11-17 07:37:42 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -88,10 +88,6 @@ #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" -#endif - #ifndef _COM_SUN_STAR_XML_SAX_XATTRIBUTELIST_HPP_ #include <com/sun/star/xml/sax/XAttributeList.hpp> #endif diff --git a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx index 42521658e330..15360a83773a 100644 --- a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx +++ b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLFootnoteConfigurationImportContext.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: dvo $ $Date: 2001-06-15 17:13:32 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:21 $ * * 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 #ifndef _XMLOFF_FAMILIES_HXX @@ -365,7 +365,7 @@ void XMLFootnoteConfigurationImportContext::StartElement( break; } case XML_TOK_FTNCONFIG_POSITION: - bPosition = (0 == sValue.compareToAscii(sXML_document)); + bPosition = IsXMLToken( sValue, XML_DOCUMENT ); break; default: ; // ignore @@ -384,17 +384,15 @@ SvXMLImportContext *XMLFootnoteConfigurationImportContext::CreateChildContext( { if (XML_NAMESPACE_TEXT == nPrefix) { - if (rLocalName.equalsAsciiL( - sXML_footnote_continuation_notice_forward, - sizeof(sXML_footnote_continuation_notice_forward)-1)) + if ( IsXMLToken( rLocalName, + XML_FOOTNOTE_CONTINUATION_NOTICE_FORWARD ) ) { pContext = new XMLFootnoteConfigHelper(GetImport(), nPrefix, rLocalName, *this, sal_False); } - else if (rLocalName.equalsAsciiL( - sXML_footnote_continuation_notice_backward, - sizeof(sXML_footnote_continuation_notice_backward)-1)) + else if ( IsXMLToken( rLocalName, + XML_FOOTNOTE_CONTINUATION_NOTICE_BACKWARD ) ) { pContext = new XMLFootnoteConfigHelper(GetImport(), nPrefix, rLocalName, diff --git a/xmloff/source/text/XMLFootnoteImportContext.cxx b/xmloff/source/text/XMLFootnoteImportContext.cxx index 54db06ab403f..4fd26314360e 100644 --- a/xmloff/source/text/XMLFootnoteImportContext.cxx +++ b/xmloff/source/text/XMLFootnoteImportContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLFootnoteImportContext.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: dvo $ $Date: 2001-06-15 17:13:32 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -87,8 +87,8 @@ #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLFOOTNOTEBODYIMPORTCONTEXT_HXX @@ -169,7 +169,7 @@ void XMLFootnoteImportContext::StartElement( if( xFactory.is() ) { // create endnote or footnote - sal_Bool bIsEndnote = (0 == GetLocalName().compareToAscii(sXML_endnote)); + sal_Bool bIsEndnote = IsXMLToken( GetLocalName(), XML_ENDNOTE ); Reference<XInterface> xIfc = xFactory->createInstance( bIsEndnote ? OUString(RTL_CONSTASCII_USTRINGPARAM(sAPI_service_endnote)) : @@ -189,7 +189,7 @@ void XMLFootnoteImportContext::StartElement( &sLocalName ); if ( (XML_NAMESPACE_TEXT == nPrefix) && - (0 == sLocalName.compareToAscii(sXML_id)) ) + IsXMLToken( sLocalName, XML_ID ) ) { // get ID ... Reference<XPropertySet> xPropertySet(xTextContent, UNO_QUERY); @@ -259,7 +259,7 @@ SvXMLImportContext *XMLFootnoteImportContext::CreateChildContext( &sLocalName ); if ( (nPrefix == XML_NAMESPACE_TEXT) && - (0 == sLocalName.compareToAscii(sXML_label)) ) + IsXMLToken( sLocalName, XML_LABEL ) ) { xFootnote->setLabel(xAttrList->getValueByIndex(nAttr)); } diff --git a/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx b/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx index 098f3d65809b..cfdb77f20749 100644 --- a/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx +++ b/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLIndexAlphabeticalSourceContext.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: dvo $ $Date: 2001-06-20 14:16:28 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -104,8 +104,8 @@ #include "nmspmap.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLUCONV_HXX @@ -128,6 +128,9 @@ using ::com::sun::star::beans::XPropertySet; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Any; using ::com::sun::star::xml::sax::XAttributeList; +using ::xmloff::token::IsXMLToken; +using ::xmloff::token::XML_ALPHABETICAL_INDEX_ENTRY_TEMPLATE; +using ::xmloff::token::XML_OUTLINE_LEVEL; const sal_Char sAPI_MainEntryCharacterStyleName[] = "MainEntryCharacterStyleName"; const sal_Char sAPI_UseAlphabeticalSeparators[] = "UseAlphabeticalSeparators"; @@ -323,13 +326,12 @@ SvXMLImportContext* XMLIndexAlphabeticalSourceContext::CreateChildContext( const Reference<XAttributeList> & xAttrList ) { if ( (XML_NAMESPACE_TEXT == nPrefix) && - (rLocalName.equalsAsciiL(sXML_alphabetical_index_entry_template, - sizeof(sXML_alphabetical_index_entry_template)-1))) + IsXMLToken( rLocalName, XML_ALPHABETICAL_INDEX_ENTRY_TEMPLATE ) ) { return new XMLIndexTemplateContext(GetImport(), rIndexPropertySet, nPrefix, rLocalName, aLevelNameAlphaMap, - sXML_outline_level, + XML_OUTLINE_LEVEL, aLevelStylePropNameAlphaMap, aAllowedTokenTypesAlpha); } diff --git a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx index bb8c0ebb03e2..d7875d3ad4c2 100644 --- a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx +++ b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLIndexBibliographyConfigurationContext.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: dvo $ $Date: 2001-06-12 17:46:20 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -88,10 +88,6 @@ #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" -#endif - #ifndef _XMLOFF_XMLTOKEN_HXX #include "xmltoken.hxx" #endif @@ -238,8 +234,8 @@ SvXMLImportContext *XMLIndexBibliographyConfigurationContext::CreateChildContext sal_Bool bSort(sal_True); // process children here and use default context! - if ((nPrefix == XML_NAMESPACE_TEXT) && - rLocalName.equalsAsciiL(sXML_sort_key, sizeof(sXML_sort_key)-1)) + if ( ( nPrefix == XML_NAMESPACE_TEXT ) && + IsXMLToken( rLocalName, XML_SORT_KEY ) ) { sal_Int16 nLength = xAttrList->getLength(); for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++) @@ -251,12 +247,11 @@ SvXMLImportContext *XMLIndexBibliographyConfigurationContext::CreateChildContext if (nPrfx == XML_NAMESPACE_TEXT) { - if (sLocalName.equalsAsciiL(sXML_key, sizeof(sXML_key)-1)) + if ( IsXMLToken( sLocalName, XML_KEY ) ) { sKey = xAttrList->getValueByIndex(nAttr); } - else if (sLocalName.equalsAsciiL(sXML_sort_ascending, - sizeof(sXML_sort_ascending)-1)) + else if ( IsXMLToken( sLocalName, XML_SORT_ASCENDING ) ) { sal_Bool bTmp; if (SvXMLUnitConverter::convertBool( diff --git a/xmloff/source/text/XMLIndexBibliographyEntryContext.cxx b/xmloff/source/text/XMLIndexBibliographyEntryContext.cxx index 419f06331f09..c1c4452805f6 100644 --- a/xmloff/source/text/XMLIndexBibliographyEntryContext.cxx +++ b/xmloff/source/text/XMLIndexBibliographyEntryContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLIndexBibliographyEntryContext.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: dvo $ $Date: 2001-06-15 10:37:08 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -88,8 +88,8 @@ #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLUCONV_HXX @@ -185,14 +185,12 @@ void XMLIndexBibliographyEntryContext::StartElement( &sLocalName ); if (XML_NAMESPACE_TEXT == nPrefix) { - if (sLocalName.equalsAsciiL(sXML_style_name, - sizeof(sXML_style_name)-1)) + if ( IsXMLToken( sLocalName, XML_STYLE_NAME ) ) { sCharStyleName = xAttrList->getValueByIndex(nAttr); bCharStyleNameOK = sal_True; } - else if (sLocalName.equalsAsciiL(sXML_bibliography_data_field, - sizeof(sXML_bibliography_data_field)-1)) + else if ( IsXMLToken( sLocalName, XML_BIBLIOGRAPHY_DATA_FIELD ) ) { sal_uInt16 nTmp; if (SvXMLUnitConverter::convertEnum( diff --git a/xmloff/source/text/XMLIndexBibliographySourceContext.cxx b/xmloff/source/text/XMLIndexBibliographySourceContext.cxx index fd0d37361d62..5d663bf14ad2 100644 --- a/xmloff/source/text/XMLIndexBibliographySourceContext.cxx +++ b/xmloff/source/text/XMLIndexBibliographySourceContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLIndexBibliographySourceContext.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: dvo $ $Date: 2000-11-14 14:42:50 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -104,8 +104,8 @@ #include "nmspmap.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLUCONV_HXX @@ -120,6 +120,9 @@ #include <rtl/ustring.hxx> #endif + +using namespace ::xmloff::token; + using ::rtl::OUString; using ::com::sun::star::beans::XPropertySet; using ::com::sun::star::uno::Reference; @@ -163,14 +166,13 @@ SvXMLImportContext* XMLIndexBibliographySourceContext::CreateChildContext( const OUString& rLocalName, const Reference<XAttributeList> & xAttrList ) { - if ( (XML_NAMESPACE_TEXT == nPrefix) && - (rLocalName.equalsAsciiL(sXML_bibliography_entry_template, - sizeof(sXML_bibliography_entry_template)-1))) + if ( ( XML_NAMESPACE_TEXT == nPrefix ) && + ( IsXMLToken( rLocalName, XML_BIBLIOGRAPHY_ENTRY_TEMPLATE ) ) ) { return new XMLIndexTemplateContext(GetImport(), rIndexPropertySet, nPrefix, rLocalName, aLevelNameBibliographyMap, - sXML_bibliography_type, + XML_BIBLIOGRAPHY_TYPE, aLevelStylePropNameBibliographyMap, aAllowedTokenTypesBibliography); } diff --git a/xmloff/source/text/XMLIndexBodyContext.cxx b/xmloff/source/text/XMLIndexBodyContext.cxx index f0af07a3932e..4aa2f357642d 100644 --- a/xmloff/source/text/XMLIndexBodyContext.cxx +++ b/xmloff/source/text/XMLIndexBodyContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLIndexBodyContext.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dvo $ $Date: 2001-05-31 16:11:06 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -76,10 +76,6 @@ #include "txtimp.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" -#endif - #ifndef _TOOLS_DEBUG_HXX #include <tools/debug.hxx> #endif diff --git a/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx b/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx index 9fe9a8518bae..425b1d6a2b6a 100644 --- a/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx +++ b/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLIndexChapterInfoEntryContext.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: dvo $ $Date: 2001-06-15 10:37:08 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -88,8 +88,8 @@ #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLUCONV_HXX @@ -156,14 +156,12 @@ void XMLIndexChapterInfoEntryContext::StartElement( &sLocalName ); if (XML_NAMESPACE_TEXT == nPrefix) { - if (sLocalName.equalsAsciiL(sXML_style_name, - sizeof(sXML_style_name)-1)) + if ( IsXMLToken( sLocalName, XML_STYLE_NAME ) ) { sCharStyleName = xAttrList->getValueByIndex(nAttr); bCharStyleNameOK = sal_True; } - else if (sLocalName.equalsAsciiL(sXML_display, - sizeof(sXML_display)-1)) + else if ( IsXMLToken( sLocalName, XML_DISPLAY ) ) { sal_uInt16 nTmp; if (SvXMLUnitConverter::convertEnum( diff --git a/xmloff/source/text/XMLIndexIllustrationSourceContext.cxx b/xmloff/source/text/XMLIndexIllustrationSourceContext.cxx index b01c19fbb392..cb7c470294b5 100644 --- a/xmloff/source/text/XMLIndexIllustrationSourceContext.cxx +++ b/xmloff/source/text/XMLIndexIllustrationSourceContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLIndexIllustrationSourceContext.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: dvo $ $Date: 2000-11-14 14:42:50 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -92,8 +92,8 @@ #include "nmspmap.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLUCONV_HXX @@ -113,7 +113,9 @@ using ::com::sun::star::beans::XPropertySet; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Any; using ::com::sun::star::xml::sax::XAttributeList; - +using ::xmloff::token::IsXMLToken; +using ::xmloff::token::XML_ILLUSTRATION_INDEX_ENTRY_TEMPLATE; +using ::xmloff::token::XML_TOKEN_INVALID; TYPEINIT1(XMLIndexIllustrationSourceContext, XMLIndexTableSourceContext); @@ -136,14 +138,13 @@ SvXMLImportContext* XMLIndexIllustrationSourceContext::CreateChildContext( const OUString& rLocalName, const Reference<XAttributeList> & xAttrList ) { - if ( (XML_NAMESPACE_TEXT == nPrefix) && - (rLocalName.equalsAsciiL(sXML_illustration_index_entry_template, - sizeof(sXML_illustration_index_entry_template)-1))) + if ( ( XML_NAMESPACE_TEXT == nPrefix ) && + ( IsXMLToken( rLocalName, XML_ILLUSTRATION_INDEX_ENTRY_TEMPLATE ) ) ) { return new XMLIndexTemplateContext(GetImport(), rIndexPropertySet, nPrefix, rLocalName, aLevelNameTableMap, - NULL, // no outline-level attr + XML_TOKEN_INVALID, // no outline-level attr aLevelStylePropNameTableMap, aAllowedTokenTypesTable); } diff --git a/xmloff/source/text/XMLIndexMarkExport.cxx b/xmloff/source/text/XMLIndexMarkExport.cxx index 7c8a230de5b9..ea2ee28297e9 100644 --- a/xmloff/source/text/XMLIndexMarkExport.cxx +++ b/xmloff/source/text/XMLIndexMarkExport.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLIndexMarkExport.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: dvo $ $Date: 2001-06-15 10:37:08 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,8 +83,8 @@ #include <com/sun/star/beans/XPropertySetInfo.hpp> #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLNMSPE_HXX @@ -100,6 +100,8 @@ #endif +using namespace ::xmloff::token; + using ::rtl::OUString; using ::rtl::OUStringBuffer; using ::com::sun::star::beans::XPropertySet; @@ -125,15 +127,15 @@ XMLIndexMarkExport::XMLIndexMarkExport( { } -const sal_Char* lcl_pTocMarkNames[] = - { sXML_toc_mark, sXML_toc_mark_start, sXML_toc_mark_end }; -const sal_Char* lcl_pUserIndexMarkName[] = - { sXML_user_index_mark, - sXML_user_index_mark_start, sXML_user_index_mark_end }; -const sal_Char* lcl_pAlphaIndexMarkName[] = - { sXML_alphabetical_index_mark, - sXML_alphabetical_index_mark_start, - sXML_alphabetical_index_mark_end }; +const enum XMLTokenEnum lcl_pTocMarkNames[] = + { XML_TOC_MARK, XML_TOC_MARK_START, XML_TOC_MARK_END }; +const enum XMLTokenEnum lcl_pUserIndexMarkName[] = + { XML_USER_INDEX_MARK, + XML_USER_INDEX_MARK_START, XML_USER_INDEX_MARK_END }; +const enum XMLTokenEnum lcl_pAlphaIndexMarkName[] = + { XML_ALPHABETICAL_INDEX_MARK, + XML_ALPHABETICAL_INDEX_MARK_START, + XML_ALPHABETICAL_INDEX_MARK_END }; XMLIndexMarkExport::~XMLIndexMarkExport() @@ -147,7 +149,7 @@ void XMLIndexMarkExport::ExportIndexMark( /// index marks have no styles! if (!bAutoStyles) { - const sal_Char** pElementNames = NULL; + const enum XMLTokenEnum * pElements = NULL; sal_Int8 nElementNo = -1; // get index mark @@ -171,8 +173,7 @@ void XMLIndexMarkExport::ExportIndexMark( aAny >>= sTmp; DBG_ASSERT(sTmp.getLength() > 0, "collapsed index mark without alternative text"); - rExport.AddAttribute(XML_NAMESPACE_TEXT, - sXML_string_value, sTmp); + rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_STRING_VALUE, sTmp); } else { @@ -183,8 +184,8 @@ void XMLIndexMarkExport::ExportIndexMark( // generate ID OUStringBuffer sBuf; GetID(sBuf, xIndexMarkPropSet); - rExport.AddAttribute(XML_NAMESPACE_TEXT, sXML_id, - sBuf.makeStringAndClear()); + rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_ID, + sBuf.makeStringAndClear()); } // distinguish between TOC, user, alphab. index marks by @@ -196,7 +197,7 @@ void XMLIndexMarkExport::ExportIndexMark( if (xPropertySetInfo->hasPropertyByName(sUserIndexName)) { // user index mark - pElementNames = lcl_pUserIndexMarkName; + pElements = lcl_pUserIndexMarkName; if (nElementNo != 2) { ExportUserIndexMarkAttributes(xIndexMarkPropSet); @@ -205,7 +206,7 @@ void XMLIndexMarkExport::ExportIndexMark( else if (xPropertySetInfo->hasPropertyByName(sPrimaryKey)) { // alphabetical index mark - pElementNames = lcl_pAlphaIndexMarkName; + pElements = lcl_pAlphaIndexMarkName; if (nElementNo != 2) { ExportAlphabeticalIndexMarkAttributes(xIndexMarkPropSet); @@ -214,7 +215,7 @@ void XMLIndexMarkExport::ExportIndexMark( else { // table of content: - pElementNames = lcl_pTocMarkNames; + pElements = lcl_pTocMarkNames; if (nElementNo != 2) { ExportTOCMarkAttributes(xIndexMarkPropSet); @@ -222,15 +223,15 @@ void XMLIndexMarkExport::ExportIndexMark( } // export element - DBG_ASSERT(pElementNames != NULL, "illegal element array"); + DBG_ASSERT(pElements != NULL, "illegal element array"); DBG_ASSERT(nElementNo >= 0, "illegal name array index"); DBG_ASSERT(nElementNo <= 2, "illegal name array index"); - if ((pElementNames != NULL) && (nElementNo != -1)) + if ((pElements != NULL) && (nElementNo != -1)) { SvXMLElementExport aElem(rExport, XML_NAMESPACE_TEXT, - pElementNames[nElementNo], + pElements[nElementNo], sal_False, sal_False); } } @@ -245,7 +246,7 @@ void XMLIndexMarkExport::ExportTOCMarkAttributes( aAny >>= nLevel; OUStringBuffer sBuf; SvXMLUnitConverter::convertNumber(sBuf, (sal_Int32)nLevel); - rExport.AddAttribute(XML_NAMESPACE_TEXT, sXML_outline_level, + rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_OUTLINE_LEVEL, sBuf.makeStringAndClear()); } @@ -259,7 +260,7 @@ void XMLIndexMarkExport::ExportUserIndexMarkAttributes( aAny >>= sIndexName; if (sIndexName.getLength() > 0) { - rExport.AddAttribute(XML_NAMESPACE_TEXT, sXML_index_name, + rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_INDEX_NAME, sIndexName); } @@ -277,7 +278,7 @@ void XMLIndexMarkExport::ExportAlphabeticalIndexMarkAttributes( aAny >>= sPrimary; if (sPrimary.getLength() > 0) { - rExport.AddAttribute(XML_NAMESPACE_TEXT, sXML_key1, sPrimary); + rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_KEY1, sPrimary); } OUString sSecondary; @@ -285,7 +286,7 @@ void XMLIndexMarkExport::ExportAlphabeticalIndexMarkAttributes( aAny >>= sSecondary; if (sSecondary.getLength() > 0) { - rExport.AddAttribute(XML_NAMESPACE_TEXT, sXML_key2, sSecondary); + rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_KEY2, sSecondary); } } diff --git a/xmloff/source/text/XMLIndexObjectSourceContext.cxx b/xmloff/source/text/XMLIndexObjectSourceContext.cxx index df12491fca16..19613ec79789 100644 --- a/xmloff/source/text/XMLIndexObjectSourceContext.cxx +++ b/xmloff/source/text/XMLIndexObjectSourceContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLIndexObjectSourceContext.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dvo $ $Date: 2000-11-17 18:54:34 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -104,8 +104,8 @@ #include "nmspmap.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLUCONV_HXX @@ -121,13 +121,14 @@ #endif - - using ::rtl::OUString; using ::com::sun::star::beans::XPropertySet; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Any; using ::com::sun::star::xml::sax::XAttributeList; +using ::xmloff::token::IsXMLToken; +using ::xmloff::token::XML_OBJECT_INDEX_ENTRY_TEMPLATE; +using ::xmloff::token::XML_TOKEN_INVALID; const sal_Char sAPI_CreateFromStarCalc[] = "CreateFromStarCalc"; const sal_Char sAPI_CreateFromStarChart[] = "CreateFromStarChart"; @@ -136,6 +137,7 @@ const sal_Char sAPI_CreateFromStarImage[] = "CreateFromStarImage"; const sal_Char sAPI_CreateFromStarMath[] = "CreateFromStarMath"; const sal_Char sAPI_CreateFromOtherEmbeddedObjects[] = "CreateFromOtherEmbeddedObjects"; + TYPEINIT1( XMLIndexObjectSourceContext, XMLIndexSourceBaseContext ); XMLIndexObjectSourceContext::XMLIndexObjectSourceContext( @@ -244,13 +246,12 @@ SvXMLImportContext* XMLIndexObjectSourceContext::CreateChildContext( const Reference<XAttributeList> & xAttrList ) { if ( (XML_NAMESPACE_TEXT == nPrefix) && - (rLocalName.equalsAsciiL(sXML_object_index_entry_template, - sizeof(sXML_object_index_entry_template)-1))) + (IsXMLToken(rLocalName, XML_OBJECT_INDEX_ENTRY_TEMPLATE)) ) { return new XMLIndexTemplateContext(GetImport(), rIndexPropertySet, nPrefix, rLocalName, aLevelNameTableMap, - NULL, // no outline-level attr + XML_TOKEN_INVALID, // no outline-level attr aLevelStylePropNameTableMap, aAllowedTokenTypesTable); } diff --git a/xmloff/source/text/XMLIndexSimpleEntryContext.cxx b/xmloff/source/text/XMLIndexSimpleEntryContext.cxx index 4ee8305c2a69..2f4124f8a796 100644 --- a/xmloff/source/text/XMLIndexSimpleEntryContext.cxx +++ b/xmloff/source/text/XMLIndexSimpleEntryContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLIndexSimpleEntryContext.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dvo $ $Date: 2001-01-02 14:41:37 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -88,8 +88,8 @@ #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLUCONV_HXX @@ -106,7 +106,8 @@ using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Any; using ::com::sun::star::xml::sax::XAttributeList; - +using ::xmloff::token::IsXMLToken; +using ::xmloff::token::XML_STYLE_NAME; const sal_Char sAPI_TokenType[] = "TokenType"; const sal_Char sAPI_CharacterStyleName[] = "CharacterStyleName"; @@ -144,8 +145,7 @@ void XMLIndexSimpleEntryContext::StartElement( GetKeyByAttrName( xAttrList->getNameByIndex(nAttr), &sLocalName ); if ( (XML_NAMESPACE_TEXT == nPrefix) && - (sLocalName.equalsAsciiL(sXML_style_name, - sizeof(sXML_style_name)-1)) ) + IsXMLToken(sLocalName, XML_STYLE_NAME) ) { sCharStyleName = xAttrList->getValueByIndex(nAttr); bCharStyleNameOK = sal_True; diff --git a/xmloff/source/text/XMLIndexSourceBaseContext.cxx b/xmloff/source/text/XMLIndexSourceBaseContext.cxx index 3fcd4a0d8f98..a92507757b77 100644 --- a/xmloff/source/text/XMLIndexSourceBaseContext.cxx +++ b/xmloff/source/text/XMLIndexSourceBaseContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLIndexSourceBaseContext.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: dvo $ $Date: 2001-06-20 14:16:28 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -104,8 +104,8 @@ #include "nmspmap.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLUCONV_HXX @@ -278,7 +278,7 @@ void XMLIndexSourceBaseContext::ProcessAttribute( switch (eParam) { case XML_TOK_INDEXSOURCE_INDEX_SCOPE: - if (rValue.equalsAsciiL(sXML_chapter, sizeof(sXML_chapter)-1)) + if ( IsXMLToken( rValue, XML_CHAPTER ) ) { bChapterIndex = sal_True; } @@ -320,16 +320,14 @@ SvXMLImportContext* XMLIndexSourceBaseContext::CreateChildContext( if (XML_NAMESPACE_TEXT == nPrefix) { - if (rLocalName.equalsAsciiL(sXML_index_title_template, - sizeof(sXML_index_title_template)-1)) + if ( IsXMLToken( rLocalName, XML_INDEX_TITLE_TEMPLATE ) ) { pContext = new XMLIndexTitleTemplateContext(GetImport(), rIndexPropertySet, nPrefix, rLocalName); } - else if (bUseLevelFormats && - rLocalName.equalsAsciiL(sXML_index_source_styles, - sizeof(sXML_index_source_styles)-1)) + else if ( bUseLevelFormats && + IsXMLToken( rLocalName, XML_INDEX_SOURCE_STYLES ) ) { pContext = new XMLIndexTOCStylesContext(GetImport(), rIndexPropertySet, diff --git a/xmloff/source/text/XMLIndexTOCContext.cxx b/xmloff/source/text/XMLIndexTOCContext.cxx index 13303e3fe0bd..8cfc208312bf 100644 --- a/xmloff/source/text/XMLIndexTOCContext.cxx +++ b/xmloff/source/text/XMLIndexTOCContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLIndexTOCContext.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: dvo $ $Date: 2001-06-15 10:37:08 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -144,6 +144,10 @@ #include "xmlkywd.hxx" #endif +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" +#endif + #ifndef _XMLOFF_PRSTYLEI_HXX_ #include "prstylei.hxx" #endif @@ -390,8 +394,7 @@ void XMLIndexTOCContext::StartElement( &sLocalName ); if ( XML_NAMESPACE_TEXT == nPrefix) { - if ( sLocalName.equalsAsciiL(sXML_style_name, - sizeof(sXML_style_name)-1) ) + if ( IsXMLToken( sLocalName, XML_STYLE_NAME ) ) { XMLPropStyleContext* pStyle = GetImport().GetTextImport()->FindSectionStyle( @@ -401,8 +404,7 @@ void XMLIndexTOCContext::StartElement( pStyle->FillPropertySet( xTOCPropertySet ); } } - else if ( sLocalName.equalsAsciiL(sXML_protected, - sizeof(sXML_protected)-1) ) + else if ( IsXMLToken( sLocalName, XML_PROTECTED ) ) { sal_Bool bTmp; if ( SvXMLUnitConverter::convertBool( @@ -453,8 +455,7 @@ SvXMLImportContext* XMLIndexTOCContext::CreateChildContext( { if (XML_NAMESPACE_TEXT == nPrefix) { - if (rLocalName.equalsAsciiL(sXML_index_body, - sizeof(sXML_index_body)-1)) + if ( IsXMLToken( rLocalName, XML_INDEX_BODY ) ) { pContext = new XMLIndexBodyContext(GetImport(), nPrefix, rLocalName); diff --git a/xmloff/source/text/XMLIndexTOCSourceContext.cxx b/xmloff/source/text/XMLIndexTOCSourceContext.cxx index c6aef875079e..53a801cdb366 100644 --- a/xmloff/source/text/XMLIndexTOCSourceContext.cxx +++ b/xmloff/source/text/XMLIndexTOCSourceContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLIndexTOCSourceContext.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dvo $ $Date: 2000-11-21 11:53:19 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -104,8 +104,8 @@ #include "nmspmap.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLUCONV_HXX @@ -122,6 +122,7 @@ +using namespace ::xmloff::token; using ::rtl::OUString; using ::com::sun::star::beans::XPropertySet; @@ -135,6 +136,7 @@ const sal_Char sAPI_CreateFromMarks[] = "CreateFromMarks"; const sal_Char sAPI_Level[] = "Level"; const sal_Char sAPI_CreateFromLevelParagraphStyles[] = "CreateFromLevelParagraphStyles"; + TYPEINIT1( XMLIndexTOCSourceContext, XMLIndexSourceBaseContext ); XMLIndexTOCSourceContext::XMLIndexTOCSourceContext( @@ -169,7 +171,7 @@ void XMLIndexTOCSourceContext::ProcessAttribute( switch (eParam) { case XML_TOK_INDEXSOURCE_OUTLINE_LEVEL: - if (rValue.equalsAsciiL(sXML_none, sizeof(sXML_none)-1)) + if ( IsXMLToken( rValue, XML_NONE ) ) { bUseOutline = sal_False; } @@ -240,13 +242,12 @@ SvXMLImportContext* XMLIndexTOCSourceContext::CreateChildContext( const Reference<XAttributeList> & xAttrList ) { if ( (XML_NAMESPACE_TEXT == nPrefix) && - (rLocalName.equalsAsciiL(sXML_table_of_content_entry_template, - sizeof(sXML_table_of_content_entry_template)-1))) + IsXMLToken(rLocalName, XML_TABLE_OF_CONTENT_ENTRY_TEMPLATE) ) { return new XMLIndexTemplateContext(GetImport(), rIndexPropertySet, nPrefix, rLocalName, aLevelNameTOCMap, - sXML_outline_level, + XML_OUTLINE_LEVEL, aLevelStylePropNameTOCMap, aAllowedTokenTypesTOC); } diff --git a/xmloff/source/text/XMLIndexTOCStylesContext.cxx b/xmloff/source/text/XMLIndexTOCStylesContext.cxx index 2b952b8a13b6..e4138a0a0efe 100644 --- a/xmloff/source/text/XMLIndexTOCStylesContext.cxx +++ b/xmloff/source/text/XMLIndexTOCStylesContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLIndexTOCStylesContext.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dvo $ $Date: 2001-01-02 14:41:38 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -93,8 +93,8 @@ #include "nmspmap.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLUCONV_HXX @@ -113,6 +113,9 @@ #include <rtl/ustring.hxx> #endif + +using namespace ::xmloff::token; + using ::rtl::OUString; using ::com::sun::star::beans::XPropertySet; using ::com::sun::star::uno::Reference; @@ -121,6 +124,7 @@ using ::com::sun::star::uno::Any; using ::com::sun::star::container::XIndexReplace; using ::com::sun::star::xml::sax::XAttributeList; + const sal_Char sAPI_LevelParagraphStyles[] = "LevelParagraphStyles"; TYPEINIT1( XMLIndexTOCStylesContext, SvXMLImportContext ); @@ -156,8 +160,7 @@ void XMLIndexTOCStylesContext::StartElement( GetKeyByAttrName( xAttrList->getNameByIndex(nAttr), &sLocalName ); if ( (XML_NAMESPACE_TEXT == nPrefix) && - (sLocalName.equalsAsciiL(sXML_outline_level, - sizeof(sXML_outline_level)-1)) ) + (IsXMLToken(sLocalName, XML_OUTLINE_LEVEL)) ) { sal_Int32 nTmp; if (SvXMLUnitConverter::convertNumber( @@ -203,8 +206,7 @@ SvXMLImportContext *XMLIndexTOCStylesContext::CreateChildContext( { // check for index-source-style if ( (XML_NAMESPACE_TEXT == nPrefix) && - rLocalName.equalsAsciiL(sXML_index_source_style, - sizeof(sXML_index_source_style)-1) ) + IsXMLToken( rLocalName, XML_INDEX_SOURCE_STYLE ) ) { // find text:style-name attribute and record in aStyleNames sal_Int16 nCount = xAttrList->getLength(); @@ -215,8 +217,7 @@ SvXMLImportContext *XMLIndexTOCStylesContext::CreateChildContext( GetKeyByAttrName( xAttrList->getNameByIndex(nAttr), &sLocalName ); if ( (XML_NAMESPACE_TEXT == nPrefix) && - (sLocalName.equalsAsciiL(sXML_style_name, - sizeof(sXML_style_name)-1)) ) + IsXMLToken( sLocalName, XML_STYLE_NAME ) ) { aStyleNames.push_back(xAttrList->getValueByIndex(nAttr)); } diff --git a/xmloff/source/text/XMLIndexTabStopEntryContext.cxx b/xmloff/source/text/XMLIndexTabStopEntryContext.cxx index b1d54a74617e..84bf522d2b72 100644 --- a/xmloff/source/text/XMLIndexTabStopEntryContext.cxx +++ b/xmloff/source/text/XMLIndexTabStopEntryContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLIndexTabStopEntryContext.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dvo $ $Date: 2001-01-02 14:41:38 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -88,8 +88,8 @@ #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLUCONV_HXX @@ -100,6 +100,9 @@ #include <rtl/ustring.hxx> #endif + +using namespace ::xmloff::token; + using ::rtl::OUString; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Reference; @@ -107,6 +110,7 @@ using ::com::sun::star::uno::Any; using ::com::sun::star::beans::PropertyValue; using ::com::sun::star::xml::sax::XAttributeList; + TYPEINIT1( XMLIndexTabStopEntryContext, SvXMLImportContext ); XMLIndexTabStopEntryContext::XMLIndexTabStopEntryContext( @@ -142,16 +146,14 @@ void XMLIndexTabStopEntryContext::StartElement( OUString sAttr = xAttrList->getValueByIndex(nAttr); if (XML_NAMESPACE_STYLE == nPrefix) { - if (sLocalName.equalsAsciiL(sXML_type, sizeof(sXML_type)-1)) + if ( IsXMLToken( sLocalName, XML_TYPE ) ) { // if it's neither left nor right, value is // ignored. Since left is default, we only need to // check for right - bTabRightAligned = sAttr.equalsAsciiL(sXML_right, - sizeof(sXML_right)-1); + bTabRightAligned = IsXMLToken( sAttr, XML_RIGHT ); } - else if (sLocalName.equalsAsciiL(sXML_position, - sizeof(sXML_position)-1)) + else if ( IsXMLToken( sLocalName, XML_POSITION ) ) { sal_Int32 nTmp; if (GetImport().GetMM100UnitConverter(). @@ -161,8 +163,7 @@ void XMLIndexTabStopEntryContext::StartElement( bTabPositionOK = sal_True; } } - else if (sLocalName.equalsAsciiL(sXML_leader_char, - sizeof(sXML_leader_char)-1)) + else if ( IsXMLToken( sLocalName, XML_LEADER_CHAR ) ) { sLeaderChar = sAttr; // valid only, if we have a char! diff --git a/xmloff/source/text/XMLIndexTableSourceContext.cxx b/xmloff/source/text/XMLIndexTableSourceContext.cxx index 7336a640eabf..c6405cb5e3d2 100644 --- a/xmloff/source/text/XMLIndexTableSourceContext.cxx +++ b/xmloff/source/text/XMLIndexTableSourceContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLIndexTableSourceContext.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: dvo $ $Date: 2001-06-15 10:37:08 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -108,8 +108,8 @@ #include "nmspmap.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLUCONV_HXX @@ -124,6 +124,7 @@ #include <rtl/ustring.hxx> #endif + using namespace ::com::sun::star::text; using namespace ::xmloff::token; @@ -242,14 +243,13 @@ SvXMLImportContext* XMLIndexTableSourceContext::CreateChildContext( const OUString& rLocalName, const Reference<XAttributeList> & xAttrList ) { - if ( (XML_NAMESPACE_TEXT == nPrefix) && - (rLocalName.equalsAsciiL(sXML_table_index_entry_template, - sizeof(sXML_table_index_entry_template)-1))) + if ( ( XML_NAMESPACE_TEXT == nPrefix ) && + ( IsXMLToken( rLocalName, XML_TABLE_INDEX_ENTRY_TEMPLATE ) ) ) { return new XMLIndexTemplateContext(GetImport(), rIndexPropertySet, nPrefix, rLocalName, aLevelNameTableMap, - NULL, // no outline-level attr + XML_TOKEN_INVALID, // no outline-level attr aLevelStylePropNameTableMap, aAllowedTokenTypesTable); } diff --git a/xmloff/source/text/XMLIndexTemplateContext.cxx b/xmloff/source/text/XMLIndexTemplateContext.cxx index bf25387d649f..c8476deea75b 100644 --- a/xmloff/source/text/XMLIndexTemplateContext.cxx +++ b/xmloff/source/text/XMLIndexTemplateContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLIndexTemplateContext.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dvo $ $Date: 2001-06-15 10:37:08 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -104,8 +104,8 @@ #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLUCONV_HXX @@ -164,7 +164,7 @@ XMLIndexTemplateContext::XMLIndexTemplateContext( sal_uInt16 nPrfx, const OUString& rLocalName, const SvXMLEnumMapEntry* pLevelNameMap, - const sal_Char* pLevelAttrName, + enum XMLTokenEnum eLevelAttrName, const sal_Char** pLevelStylePropMap, const sal_Bool* pAllowedTokenTypes) : SvXMLImportContext(rImport, nPrfx, rLocalName), @@ -173,7 +173,7 @@ XMLIndexTemplateContext::XMLIndexTemplateContext( nOutlineLevel(1), // all indices have level 1 (0 is for header) bStyleNameOK(sal_False), bOutlineLevelOK(sal_False), - pOutlineLevelAttrName(pLevelAttrName), + eOutlineLevelAttrName(eLevelAttrName), pOutlineLevelNameMap(pLevelNameMap), pOutlineLevelStylePropMap(pLevelStylePropMap), pAllowedTokenTypesMap(pAllowedTokenTypes), @@ -203,8 +203,8 @@ XMLIndexTemplateContext::XMLIndexTemplateContext( "BibliographyDataField")), sChapterFormat(RTL_CONSTASCII_USTRINGPARAM("ChapterFormat")) { - DBG_ASSERT( ((NULL != pLevelAttrName) && (NULL != pLevelNameMap)) - || ((NULL == pLevelAttrName) && (NULL == pLevelNameMap)), + DBG_ASSERT( ((XML_TOKEN_INVALID != eLevelAttrName) && (NULL != pLevelNameMap)) + || ((XML_TOKEN_INVALID == eLevelAttrName) && (NULL == pLevelNameMap)), "need both, attribute name and value map, or neither" ); DBG_ASSERT( NULL != pOutlineLevelStylePropMap, "need property name map" ); DBG_ASSERT( NULL != pAllowedTokenTypes, "need allowed tokens map" ); @@ -242,17 +242,16 @@ void XMLIndexTemplateContext::StartElement( &sLocalName ); if (XML_NAMESPACE_TEXT == nPrefix) { - if (sLocalName.equalsAsciiL(sXML_style_name, - sizeof(sXML_style_name)-1)) + if ( IsXMLToken( sLocalName, XML_STYLE_NAME ) ) { // style name sStyleName = xAttrList->getValueByIndex(nAttr); bStyleNameOK = sal_True; } - else if (NULL != pOutlineLevelAttrName) + else if (eOutlineLevelAttrName != XML_TOKEN_INVALID) { // we have an attr name! Then see if we have the attr, too. - if (0 == sLocalName.compareToAscii(pOutlineLevelAttrName)) + if (IsXMLToken(sLocalName, eOutlineLevelAttrName)) { // outline level sal_uInt16 nTmp; diff --git a/xmloff/source/text/XMLIndexTemplateContext.hxx b/xmloff/source/text/XMLIndexTemplateContext.hxx index 3e174d4749e0..9cda0688c509 100644 --- a/xmloff/source/text/XMLIndexTemplateContext.hxx +++ b/xmloff/source/text/XMLIndexTemplateContext.hxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLIndexTemplateContext.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: dvo $ $Date: 2001-02-06 10:41:54 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -66,6 +66,10 @@ #include "xmlictxt.hxx" #endif +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" +#endif + #include <vector> #ifndef _COM_SUN_STAR_UNO_REFERENCE_H_ @@ -124,7 +128,7 @@ class XMLIndexTemplateContext : public SvXMLImportContext ::rtl::OUString sStyleName; const SvXMLEnumMapEntry* pOutlineLevelNameMap; - const sal_Char* pOutlineLevelAttrName; + enum ::xmloff::token::XMLTokenEnum eOutlineLevelAttrName; const sal_Char** pOutlineLevelStylePropMap; const sal_Bool* pAllowedTokenTypesMap; @@ -172,7 +176,7 @@ public: sal_uInt16 nPrfx, const ::rtl::OUString& rLocalName, const SvXMLEnumMapEntry* aLevelNameMap, - const sal_Char* pLevelAttrName, + enum ::xmloff::token::XMLTokenEnum eLevelAttrName, const sal_Char** aLevelStylePropNameMap, const sal_Bool* aAllowedTokenTypes); diff --git a/xmloff/source/text/XMLIndexTitleTemplateContext.cxx b/xmloff/source/text/XMLIndexTitleTemplateContext.cxx index a303e84e2b56..b745b7d56d40 100644 --- a/xmloff/source/text/XMLIndexTitleTemplateContext.cxx +++ b/xmloff/source/text/XMLIndexTitleTemplateContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLIndexTitleTemplateContext.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dvo $ $Date: 2001-01-02 14:41:38 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -79,8 +79,8 @@ #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif @@ -90,6 +90,8 @@ using ::com::sun::star::beans::XPropertySet; using ::com::sun::star::uno::Any; using ::com::sun::star::uno::Reference; using ::com::sun::star::xml::sax::XAttributeList; +using ::xmloff::token::IsXMLToken; +using ::xmloff::token::XML_STYLE_NAME; const sal_Char sAPI_Title[] = "Title"; @@ -130,8 +132,7 @@ void XMLIndexTitleTemplateContext::StartElement( GetKeyByAttrName( xAttrList->getNameByIndex(nAttr), &sLocalName ); if ( (XML_NAMESPACE_TEXT == nPrefix) && - (sLocalName.equalsAsciiL(sXML_style_name, - sizeof(sXML_style_name)-1)) ) + (IsXMLToken(sLocalName, XML_STYLE_NAME)) ) { sStyleName = xAttrList->getValueByIndex(nAttr); bStyleNameOK = sal_True; diff --git a/xmloff/source/text/XMLIndexUserSourceContext.cxx b/xmloff/source/text/XMLIndexUserSourceContext.cxx index 4034fd173af1..647664e1253d 100644 --- a/xmloff/source/text/XMLIndexUserSourceContext.cxx +++ b/xmloff/source/text/XMLIndexUserSourceContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLIndexUserSourceContext.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dvo $ $Date: 2000-11-21 11:53:19 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -104,8 +104,8 @@ #include "nmspmap.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLUCONV_HXX @@ -120,11 +120,15 @@ #include <rtl/ustring.hxx> #endif + using ::rtl::OUString; using ::com::sun::star::beans::XPropertySet; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Any; using ::com::sun::star::xml::sax::XAttributeList; +using ::xmloff::token::IsXMLToken; +using ::xmloff::token::XML_USER_INDEX_ENTRY_TEMPLATE; +using ::xmloff::token::XML_OUTLINE_LEVEL; const sal_Char sAPI_CreateFromEmbeddedObjects[] = "CreateFromEmbeddedObjects"; @@ -270,13 +274,12 @@ SvXMLImportContext* XMLIndexUserSourceContext::CreateChildContext( const Reference<XAttributeList> & xAttrList ) { if ( (XML_NAMESPACE_TEXT == nPrefix) && - (rLocalName.equalsAsciiL(sXML_user_index_entry_template, - sizeof(sXML_user_index_entry_template)-1))) + (IsXMLToken(rLocalName, XML_USER_INDEX_ENTRY_TEMPLATE)) ) { return new XMLIndexTemplateContext(GetImport(), rIndexPropertySet, nPrefix, rLocalName, aLevelNameTOCMap, - sXML_outline_level, + XML_OUTLINE_LEVEL, aLevelStylePropNameTOCMap, aAllowedTokenTypesUser); } diff --git a/xmloff/source/text/XMLLineNumberingExport.cxx b/xmloff/source/text/XMLLineNumberingExport.cxx index 71c9220d570d..69cdde7d75a3 100644 --- a/xmloff/source/text/XMLLineNumberingExport.cxx +++ b/xmloff/source/text/XMLLineNumberingExport.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLLineNumberingExport.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: dvo $ $Date: 2001-06-15 10:37:08 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -87,14 +87,15 @@ #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLNUME_HXX #include "xmlnume.hxx" #endif + using namespace ::com::sun::star::uno; using namespace ::com::sun::star; using namespace ::xmloff::token; @@ -104,6 +105,7 @@ using ::rtl::OUStringBuffer; using ::com::sun::star::beans::XPropertySet; using ::com::sun::star::text::XLineNumberingProperties; + XMLLineNumberingExport::XMLLineNumberingExport(SvXMLExport& rExp) : rExport(rExp), sCharStyleName(RTL_CONSTASCII_USTRINGPARAM("CharStyleName")), @@ -151,40 +153,39 @@ void XMLLineNumberingExport::Export() aAny >>= sTmp; if (sTmp.getLength() > 0) { - rExport.AddAttribute(XML_NAMESPACE_TEXT, sXML_style_name,sTmp); + rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_STYLE_NAME, sTmp); } // enable aAny = xLineNumbering->getPropertyValue(sIsOn); if (! *(sal_Bool*)aAny.getValue()) { - rExport.AddAttributeASCII(XML_NAMESPACE_TEXT, - sXML_number_lines, sXML_false); + rExport.AddAttribute(XML_NAMESPACE_TEXT, + XML_NUMBER_LINES, XML_FALSE); } // count empty lines aAny = xLineNumbering->getPropertyValue(sCountEmptyLines); if (! *(sal_Bool*)aAny.getValue()) { - rExport.AddAttributeASCII(XML_NAMESPACE_TEXT, - sXML_count_empty_lines, sXML_false); + rExport.AddAttribute(XML_NAMESPACE_TEXT, + XML_COUNT_EMPTY_LINES, XML_FALSE); } // count in frames aAny = xLineNumbering->getPropertyValue(sCountLinesInFrames); if (*(sal_Bool*)aAny.getValue()) { - rExport.AddAttributeASCII(XML_NAMESPACE_TEXT, - sXML_count_in_floating_frames, - sXML_true); + rExport.AddAttribute(XML_NAMESPACE_TEXT, + XML_COUNT_IN_FLOATING_FRAMES, XML_TRUE); } // restart numbering aAny = xLineNumbering->getPropertyValue(sRestartAtEachPage); if (*(sal_Bool*)aAny.getValue()) { - rExport.AddAttributeASCII(XML_NAMESPACE_TEXT, - sXML_restart_on_page, sXML_true); + rExport.AddAttribute(XML_NAMESPACE_TEXT, + XML_RESTART_ON_PAGE, XML_TRUE); } // Distance @@ -195,7 +196,7 @@ void XMLLineNumberingExport::Export() { OUStringBuffer sBuf; rExport.GetMM100UnitConverter().convertMeasure(sBuf, nLength); - rExport.AddAttribute(XML_NAMESPACE_TEXT, sXML_offset, + rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_OFFSET, sBuf.makeStringAndClear()); } @@ -205,13 +206,13 @@ void XMLLineNumberingExport::Export() sal_Int16 nFormat; aAny >>= nFormat; rExport.GetMM100UnitConverter().convertNumFormat( sNumPosBuf, nFormat ); - rExport.AddAttribute(XML_NAMESPACE_STYLE, sXML_num_format, + rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_NUM_FORMAT, sNumPosBuf.makeStringAndClear()); rExport.GetMM100UnitConverter().convertNumLetterSync( sNumPosBuf, nFormat ); if( sNumPosBuf.getLength() ) { rExport.AddAttribute(XML_NAMESPACE_STYLE, - sXML_num_letter_sync, + XML_NUM_LETTER_SYNC, sNumPosBuf.makeStringAndClear() ); } @@ -222,7 +223,7 @@ void XMLLineNumberingExport::Export() if (SvXMLUnitConverter::convertEnum(sNumPosBuf, nPosition, aLineNumberPositionMap)) { - rExport.AddAttribute(XML_NAMESPACE_TEXT, sXML_number_position, + rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_NUMBER_POSITION, sNumPosBuf.makeStringAndClear()); } @@ -233,11 +234,11 @@ void XMLLineNumberingExport::Export() OUStringBuffer sBuf; SvXMLUnitConverter::convertNumber(sBuf, (sal_Int32)nLineInterval); - rExport.AddAttribute(XML_NAMESPACE_TEXT, sXML_increment, + rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_INCREMENT, sBuf.makeStringAndClear()); SvXMLElementExport aConfigElem(rExport, XML_NAMESPACE_TEXT, - sXML_linenumbering_configuration, + XML_LINENUMBERING_CONFIGURATION, sal_True, sal_True); // line separator @@ -254,11 +255,11 @@ void XMLLineNumberingExport::Export() OUStringBuffer sBuf; SvXMLUnitConverter::convertNumber(sBuf, (sal_Int32)nLineDistance); - rExport.AddAttribute(XML_NAMESPACE_TEXT, sXML_increment, + rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_INCREMENT, sBuf.makeStringAndClear()); SvXMLElementExport aSeparatorElem(rExport, XML_NAMESPACE_TEXT, - sXML_linenumbering_separator, + XML_LINENUMBERING_SEPARATOR, sal_True, sal_False); rExport.GetDocHandler()->characters(sSeparator); } diff --git a/xmloff/source/text/XMLLineNumberingImportContext.cxx b/xmloff/source/text/XMLLineNumberingImportContext.cxx index 10dbe5007d8a..7aa7b04f25a7 100644 --- a/xmloff/source/text/XMLLineNumberingImportContext.cxx +++ b/xmloff/source/text/XMLLineNumberingImportContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLLineNumberingImportContext.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: dvo $ $Date: 2001-06-15 17:13:32 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -98,8 +98,8 @@ #include "nmspmap.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLNUMI_HXX @@ -127,8 +127,8 @@ XMLLineNumberingImportContext::XMLLineNumberingImportContext( const Reference<XAttributeList> & xAttrList) : SvXMLStyleContext(rImport, nPrfx, rLocalName, xAttrList, XML_STYLE_FAMILY_TEXT_LINENUMBERINGCONFIG), sStyleName(), - sNumFormat(RTL_CONSTASCII_USTRINGPARAM(sXML_1)), - sNumLetterSync(RTL_CONSTASCII_USTRINGPARAM(sXML_false)), + sNumFormat(GetXMLToken(XML_1)), + sNumLetterSync(GetXMLToken(XML_FALSE)), sSeparator(), nOffset(-1), nNumberPosition(style::LineNumberPosition::LEFT), @@ -364,8 +364,7 @@ SvXMLImportContext* XMLLineNumberingImportContext::CreateChildContext( const Reference<XAttributeList> & xAttrList ) { if ( (nPrefix == XML_NAMESPACE_TEXT) && - rLocalName.equalsAsciiL(sXML_linenumbering_separator, - sizeof(sXML_linenumbering_separator)-1) ) + IsXMLToken(rLocalName, XML_LINENUMBERING_SEPARATOR) ) { return new XMLLineNumberingSeparatorImportContext(GetImport(), nPrefix, rLocalName, diff --git a/xmloff/source/text/XMLLineNumberingSeparatorImportContext.cxx b/xmloff/source/text/XMLLineNumberingSeparatorImportContext.cxx index 4de76d8a7868..f159f6f02d35 100644 --- a/xmloff/source/text/XMLLineNumberingSeparatorImportContext.cxx +++ b/xmloff/source/text/XMLLineNumberingSeparatorImportContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLLineNumberingSeparatorImportContext.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: dvo $ $Date: 2000-12-11 19:14:26 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -79,8 +79,8 @@ #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLUCONV_HXX @@ -93,6 +93,8 @@ using namespace ::com::sun::star::uno; using ::com::sun::star::xml::sax::XAttributeList; using ::rtl::OUString; using ::rtl::OUStringBuffer; +using ::xmloff::token::IsXMLToken; +using ::xmloff::token::XML_INCREMENT; TYPEINIT1( XMLLineNumberingSeparatorImportContext, SvXMLImportContext ); @@ -121,7 +123,7 @@ void XMLLineNumberingSeparatorImportContext::StartElement( GetKeyByAttrName( xAttrList->getNameByIndex(i), &sLocalName ); if ( (nPrefix == XML_NAMESPACE_TEXT) && - sLocalName.equalsAsciiL(sXML_increment, sizeof(sXML_increment)-1)) + IsXMLToken(sLocalName, XML_INCREMENT) ) { sal_Int32 nTmp; if (SvXMLUnitConverter::convertNumber( diff --git a/xmloff/source/text/XMLRedlineExport.cxx b/xmloff/source/text/XMLRedlineExport.cxx index 2a61902c92fb..ed601ac2a3e4 100644 --- a/xmloff/source/text/XMLRedlineExport.cxx +++ b/xmloff/source/text/XMLRedlineExport.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLRedlineExport.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: dvo $ $Date: 2001-05-02 16:19:18 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -107,8 +107,8 @@ #include <com/sun/star/util/DateTime.hpp> #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLNMSPE_HXX @@ -125,6 +125,7 @@ using namespace ::com::sun::star; +using namespace ::xmloff::token; using ::com::sun::star::beans::PropertyValue; using ::com::sun::star::beans::XPropertySet; @@ -145,11 +146,11 @@ using ::std::list; XMLRedlineExport::XMLRedlineExport(SvXMLExport& rExp) : sDelete(RTL_CONSTASCII_USTRINGPARAM("Delete")), - sDeletion(RTL_CONSTASCII_USTRINGPARAM(sXML_deletion)), + sDeletion(GetXMLToken(XML_DELETION)), sFormat(RTL_CONSTASCII_USTRINGPARAM("Format")), - sFormatChange(RTL_CONSTASCII_USTRINGPARAM(sXML_format_change)), + sFormatChange(GetXMLToken(XML_FORMAT_CHANGE)), sInsert(RTL_CONSTASCII_USTRINGPARAM("Insert")), - sInsertion(RTL_CONSTASCII_USTRINGPARAM(sXML_insertion)), + sInsertion(GetXMLToken(XML_INSERTION)), sIsCollapsed(RTL_CONSTASCII_USTRINGPARAM("IsCollapsed")), sIsStart(RTL_CONSTASCII_USTRINGPARAM("IsStart")), sRedlineAuthor(RTL_CONSTASCII_USTRINGPARAM("RedlineAuthor")), @@ -235,7 +236,7 @@ void XMLRedlineExport::ExportChangesList( { // changes container element SvXMLElementExport aChanges(rExport, XML_NAMESPACE_TEXT, - sXML_tracked_changes, + XML_TRACKED_CHANGES, sal_True, sal_True); // iterate over changes list @@ -297,7 +298,7 @@ void XMLRedlineExport::ExportChangesListElements() { OUStringBuffer aBuffer; SvXMLUnitConverter::encodeBase64( aBuffer, aKey ); - rExport.AddAttribute( XML_NAMESPACE_TEXT, sXML_protection_key, + rExport.AddAttribute( XML_NAMESPACE_TEXT, XML_PROTECTION_KEY, aBuffer.makeStringAndClear() ); } @@ -312,14 +313,14 @@ void XMLRedlineExport::ExportChangesListElements() // export only if we have changes, but tracking is not enabled if ( !bEnabled != !aEnumAccess->hasElements() ) { - rExport.AddAttributeASCII( - XML_NAMESPACE_TEXT, sXML_track_changes, - bEnabled ? sXML_true : sXML_false ); + rExport.AddAttribute( + XML_NAMESPACE_TEXT, XML_TRACK_CHANGES, + bEnabled ? XML_TRUE : XML_FALSE ); } // changes container element SvXMLElementExport aChanges(rExport, XML_NAMESPACE_TEXT, - sXML_tracked_changes, + XML_TRACKED_CHANGES, sal_True, sal_True); // get enumeration and iterate over elements @@ -411,30 +412,30 @@ void XMLRedlineExport::ExportChangeInline( const Reference<XPropertySet> & rPropSet) { // determine element name (depending on collapsed, start/end) - sal_Char* pElement = NULL; + enum XMLTokenEnum eElement = XML_TOKEN_INVALID; Any aAny = rPropSet->getPropertyValue(sIsCollapsed); sal_Bool bCollapsed = *(sal_Bool *)aAny.getValue(); sal_Bool bStart = sal_True; // ignored if bCollapsed = sal_True if (bCollapsed) { - pElement = sXML_change; + eElement = XML_CHANGE; } else { aAny = rPropSet->getPropertyValue(sIsStart); bStart = *(sal_Bool *)aAny.getValue(); - pElement = bStart ? sXML_change_start : sXML_change_end; + eElement = bStart ? XML_CHANGE_START : XML_CHANGE_END; } - if (NULL != pElement) + if (XML_TOKEN_INVALID != eElement) { // we always need the ID - rExport.AddAttribute(XML_NAMESPACE_TEXT, sXML_change_id, + rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_CHANGE_ID, GetRedlineID(rPropSet)); // export the element (no whitespace because we're in the text body) SvXMLElementExport aChangeElem(rExport, XML_NAMESPACE_TEXT, - pElement, sal_False, sal_False); + eElement, sal_False, sal_False); } } @@ -443,9 +444,9 @@ void XMLRedlineExport::ExportChangedRegion( const Reference<XPropertySet> & rPropSet) { // export changed-region element (with change-ID) - rExport.AddAttribute(XML_NAMESPACE_TEXT, sXML_id, GetRedlineID(rPropSet) ); + rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_ID, GetRedlineID(rPropSet) ); SvXMLElementExport aChangedRegion(rExport, XML_NAMESPACE_TEXT, - sXML_changed_region, sal_True, sal_True); + XML_CHANGED_REGION, sal_True, sal_True); // scope for (first) change element { @@ -485,7 +486,7 @@ void XMLRedlineExport::ExportChangedRegion( // delete an insertion. This assumption is asserted in // ExportChangeInfo(Sequence<PropertyValue>&). SvXMLElementExport aSecondChangeElem( - rExport, XML_NAMESPACE_TEXT, sXML_insertion, + rExport, XML_NAMESPACE_TEXT, XML_INSERTION, sal_True, sal_True); ExportChangeInfo(aSuccessorData); @@ -539,7 +540,7 @@ void XMLRedlineExport::ExportChangeInfo( aAny >>= sTmp; if (sTmp.getLength() > 0) { - rExport.AddAttribute(XML_NAMESPACE_OFFICE, sXML_chg_author, sTmp); + rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_CHG_AUTHOR, sTmp); } aAny = rPropSet->getPropertyValue(sRedlineDateTime); @@ -547,11 +548,11 @@ void XMLRedlineExport::ExportChangeInfo( aAny >>= aDateTime; OUStringBuffer sBuf; rExport.GetMM100UnitConverter().convertDateTime(sBuf, aDateTime); - rExport.AddAttribute(XML_NAMESPACE_OFFICE, sXML_chg_date_time, + rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_CHG_DATE_TIME, sBuf.makeStringAndClear()); SvXMLElementExport aChangeInfo(rExport, XML_NAMESPACE_OFFICE, - sXML_change_info, sal_True, sal_True); + XML_CHANGE_INFO, sal_True, sal_True); // comment as <text:p> sequence aAny = rPropSet->getPropertyValue(sRedlineComment); @@ -565,7 +566,7 @@ void XMLRedlineExport::ExportChangeInfo( while (aEnumerator.getNextToken(aSubString)) { SvXMLElementExport aParagraph( - rExport, XML_NAMESPACE_TEXT, sXML_p, sal_True, sal_False); + rExport, XML_NAMESPACE_TEXT, XML_P, sal_True, sal_False); rExport.GetDocHandler()->characters(aSubString); } } @@ -585,7 +586,7 @@ void XMLRedlineExport::ExportChangeInfo( rVal.Value >>= sTmp; if (sTmp.getLength() > 0) { - rExport.AddAttribute(XML_NAMESPACE_OFFICE, sXML_chg_author, + rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_CHG_AUTHOR, sTmp); } } @@ -595,7 +596,7 @@ void XMLRedlineExport::ExportChangeInfo( rVal.Value >>= sTmp; if (sTmp.getLength() > 0) { - rExport.AddAttribute(XML_NAMESPACE_OFFICE, sXML_chg_comment, + rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_CHG_COMMENT, sTmp); } } @@ -605,7 +606,7 @@ void XMLRedlineExport::ExportChangeInfo( rVal.Value >>= aDateTime; OUStringBuffer sBuf; rExport.GetMM100UnitConverter().convertDateTime(sBuf, aDateTime); - rExport.AddAttribute(XML_NAMESPACE_OFFICE, sXML_chg_date_time, + rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_CHG_DATE_TIME, sBuf.makeStringAndClear()); } else if (rVal.Name.equals(sRedlineType)) @@ -621,7 +622,7 @@ void XMLRedlineExport::ExportChangeInfo( // finally write element SvXMLElementExport aChangeInfo(rExport, XML_NAMESPACE_OFFICE, - sXML_change_info, sal_True, sal_True); + XML_CHANGE_INFO, sal_True, sal_True); } void XMLRedlineExport::ExportStartOrEndRedline( @@ -647,14 +648,14 @@ void XMLRedlineExport::ExportStartOrEndRedline( OUStringBuffer sBuffer(sChangePrefix); sBuffer.append(sId); - rExport.AddAttribute(XML_NAMESPACE_TEXT, sXML_change_id, + rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_CHANGE_ID, sBuffer.makeStringAndClear()); // export the element // (whitespace because we're not inside paragraphs) SvXMLElementExport aChangeElem( rExport, XML_NAMESPACE_TEXT, - bStart ? sXML_change_start : sXML_change_end, + bStart ? XML_CHANGE_START : XML_CHANGE_END, sal_True, sal_True); // and break out of loop, in case a second RedlineIdentifier Value diff --git a/xmloff/source/text/XMLSectionExport.hxx b/xmloff/source/text/XMLSectionExport.hxx index 95a1b3612b35..74abfaa24bec 100644 --- a/xmloff/source/text/XMLSectionExport.hxx +++ b/xmloff/source/text/XMLSectionExport.hxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLSectionExport.hxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: dvo $ $Date: 2001-06-12 17:46:20 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -74,6 +74,9 @@ #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_ #include <com/sun/star/beans/PropertyValue.hpp> #endif +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" +#endif class SvXMLExport; class XMLTextParagraphExport; @@ -395,7 +398,7 @@ protected: const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> & rPropSet, const ::rtl::OUString& sPropertyName, - const sal_Char* pAttributeName, + enum ::xmloff::token::XMLTokenEnum eAttributeName, sal_Bool bDefault, sal_Bool bInvert = sal_False); }; diff --git a/xmloff/source/text/XMLSectionFootnoteConfigExport.cxx b/xmloff/source/text/XMLSectionFootnoteConfigExport.cxx index ae7a4735e223..7c3a91ada22c 100644 --- a/xmloff/source/text/XMLSectionFootnoteConfigExport.cxx +++ b/xmloff/source/text/XMLSectionFootnoteConfigExport.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLSectionFootnoteConfigExport.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: dvo $ $Date: 2001-04-17 12:01:21 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -95,8 +95,8 @@ #include "xmluconv.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLNUME_HXX @@ -118,6 +118,8 @@ #include <vector> +using namespace ::xmloff::token; + using ::std::vector; using ::rtl::OUString; using ::rtl::OUStringBuffer; @@ -217,7 +219,7 @@ void XMLSectionFootnoteConfigExport::exportXML( // restart number is stored as 0.., but interpreted as 1.. SvXMLUnitConverter::convertNumber(sBuf, (sal_Int32)(nNumRestartAt+1)); - rExport.AddAttribute(XML_NAMESPACE_TEXT, sXML_start_value, + rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_START_VALUE, sBuf.makeStringAndClear()); } @@ -226,19 +228,19 @@ void XMLSectionFootnoteConfigExport::exportXML( // prefix and suffix if (sNumPrefix.getLength() > 0) { - rExport.AddAttribute(XML_NAMESPACE_STYLE, sXML_num_prefix, + rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_NUM_PREFIX, sNumPrefix); } if (sNumSuffix.getLength() > 0) { - rExport.AddAttribute(XML_NAMESPACE_STYLE, sXML_num_suffix, + rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_NUM_SUFFIX, sNumSuffix); } // number type: num format rExport.GetMM100UnitConverter().convertNumFormat( sBuf, nNumberingType ); - rExport.AddAttribute(XML_NAMESPACE_STYLE, sXML_num_format, + rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_NUM_FORMAT, sBuf.makeStringAndClear()); // and letter sync, if applicable @@ -247,15 +249,15 @@ void XMLSectionFootnoteConfigExport::exportXML( if (sBuf.getLength()) { rExport.AddAttribute(XML_NAMESPACE_STYLE, - sXML_num_letter_sync, + XML_NUM_LETTER_SYNC, sBuf.makeStringAndClear()); } } // and finally, the element SvXMLElementExport rElem(rExport, XML_NAMESPACE_TEXT, - (bEndnote ? sXML_endnotes_configuration : - sXML_footnotes_configuration ), + (bEndnote ? XML_ENDNOTES_CONFIGURATION : + XML_FOOTNOTES_CONFIGURATION ), sal_True, sal_True); } } diff --git a/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx b/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx index 48f5a1fa06d0..2924e90561f9 100644 --- a/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx +++ b/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLSectionFootnoteConfigImport.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: dvo $ $Date: 2001-04-17 12:01:21 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -82,8 +82,8 @@ #include "xmlimp.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLUCONV_HXX @@ -120,7 +120,10 @@ #include <vector> + +using namespace ::xmloff::token; using namespace ::com::sun::star::style; + using ::rtl::OUString; using ::std::vector; using ::com::sun::star::uno::Any; @@ -173,8 +176,7 @@ void XMLSectionFootnoteConfigImport::StartElement( if (XML_NAMESPACE_TEXT == nPrefix) { - if (sLocalName.equalsAsciiL(sXML_start_value, - sizeof(sXML_start_value)-1)) + if (IsXMLToken(sLocalName, XML_START_VALUE)) { sal_Int32 nTmp; if (SvXMLUnitConverter::convertNumber(nTmp, sAttrValue)) @@ -186,26 +188,22 @@ void XMLSectionFootnoteConfigImport::StartElement( } else if (XML_NAMESPACE_STYLE == nPrefix) { - if (sLocalName.equalsAsciiL(sXML_num_prefix, - sizeof(sXML_num_prefix)-1)) + if (IsXMLToken(sLocalName, XML_NUM_PREFIX)) { sNumPrefix = sAttrValue; bNumOwn = sal_True; } - else if (sLocalName.equalsAsciiL(sXML_num_suffix, - sizeof(sXML_num_suffix)-1)) + else if (IsXMLToken(sLocalName, XML_NUM_SUFFIX)) { sNumSuffix = sAttrValue; bNumOwn = sal_True; } - else if (sLocalName.equalsAsciiL(sXML_num_format, - sizeof(sXML_num_format)-1)) + else if (IsXMLToken(sLocalName, XML_NUM_FORMAT)) { sNumFormat = sAttrValue; bNumOwn = sal_True; } - else if (sLocalName.equalsAsciiL(sXML_num_letter_sync, - sizeof(sXML_num_letter_sync)-1)) + else if (IsXMLToken(sLocalName, XML_NUM_LETTER_SYNC)) { sNumLetterSync = sAttrValue; bNumOwn = sal_True; @@ -215,9 +213,7 @@ void XMLSectionFootnoteConfigImport::StartElement( // OK, now we have all values and can fill the XMLPropertyState vector Any aAny; - sal_Bool bEndnote = GetLocalName().equalsAsciiL( - sXML_endnotes_configuration, - sizeof(sXML_endnotes_configuration)-1 ); + sal_Bool bEndnote = IsXMLToken(GetLocalName(), XML_ENDNOTES_CONFIGURATION); aAny.setValue( &bNumOwn, ::getBooleanCppuType() ); sal_Int32 nIndex = rMapper->FindEntryIndex( bEndnote ? diff --git a/xmloff/source/text/XMLSectionImportContext.cxx b/xmloff/source/text/XMLSectionImportContext.cxx index 3743cbcdfa0a..297272ef3342 100644 --- a/xmloff/source/text/XMLSectionImportContext.cxx +++ b/xmloff/source/text/XMLSectionImportContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLSectionImportContext.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: dvo $ $Date: 2001-06-15 17:13:32 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -91,8 +91,8 @@ #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLUCONV_HXX @@ -216,8 +216,7 @@ void XMLSectionImportContext::StartElement( ProcessAttributes(xAttrList); // process index headers: - sal_Bool bIsIndexHeader = GetLocalName().equalsAsciiL( - sXML_index_title, sizeof(sXML_index_title)-1); + sal_Bool bIsIndexHeader = IsXMLToken( GetLocalName(), XML_INDEX_TITLE ); if (bIsIndexHeader) { bValid = sal_True; @@ -273,9 +272,8 @@ void XMLSectionImportContext::StartElement( } // password (only for regular sections) - if (bSequenceOK && - GetLocalName().equalsAsciiL(sXML_section, - sizeof(sXML_section)-1)) + if ( bSequenceOK && + IsXMLToken(GetLocalName(), XML_SECTION) ) { Any aAny; aAny <<= aSequence; @@ -355,13 +353,12 @@ void XMLSectionImportContext::ProcessAttributes( bCondOK = sal_True; break; case XML_TOK_SECTION_DISPLAY: - if (sAttr.equalsAsciiL(sXML_true, sizeof(sXML_true)-1)) + if (IsXMLToken(sAttr, XML_TRUE)) { bIsVisible = sal_True; } - else if ( sAttr.equalsAsciiL(sXML_none, sizeof(sXML_none)-1) || - sAttr.equalsAsciiL(sXML_condition, - sizeof(sXML_condition)-1) ) + else if ( IsXMLToken(sAttr, XML_NONE) || + IsXMLToken(sAttr, XML_CONDITION) ) { bIsVisible = sal_False; } @@ -414,17 +411,15 @@ SvXMLImportContext* XMLSectionImportContext::CreateChildContext( SvXMLImportContext* pContext = NULL; // section-source (-dde) elements - if ((XML_NAMESPACE_TEXT == nPrefix) && - rLocalName.equalsAsciiL(sXML_section_source, - sizeof(sXML_section_source)-1)) + if ( (XML_NAMESPACE_TEXT == nPrefix) && + IsXMLToken(rLocalName, XML_SECTION_SOURCE) ) { pContext = new XMLSectionSourceImportContext(GetImport(), nPrefix, rLocalName, xSectionPropertySet); } - else if ((XML_NAMESPACE_OFFICE == nPrefix) && - rLocalName.equalsAsciiL(sXML_dde_source, - sizeof(sXML_dde_source)-1)) + else if ( (XML_NAMESPACE_OFFICE == nPrefix) && + IsXMLToken(rLocalName, XML_DDE_SOURCE) ) { pContext = new XMLSectionSourceDDEImportContext(GetImport(), nPrefix, rLocalName, diff --git a/xmloff/source/text/XMLStringBufferImportContext.cxx b/xmloff/source/text/XMLStringBufferImportContext.cxx index 09d69d6be7b3..d7aaeadea52f 100644 --- a/xmloff/source/text/XMLStringBufferImportContext.cxx +++ b/xmloff/source/text/XMLStringBufferImportContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLStringBufferImportContext.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: dvo $ $Date: 2001-01-24 16:49:52 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -63,18 +63,22 @@ #include "XMLStringBufferImportContext.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLNMSPE_HXX #include "xmlnmspe.hxx" #endif + using ::rtl::OUString; using ::rtl::OUStringBuffer; using ::com::sun::star::uno::Reference; using ::com::sun::star::xml::sax::XAttributeList; +using ::xmloff::token::IsXMLToken; +using ::xmloff::token::XML_P; + TYPEINIT1(XMLStringBufferImportContext, SvXMLImportContext); @@ -111,7 +115,7 @@ void XMLStringBufferImportContext::EndElement() { // add return for paragraph elements if ( (XML_NAMESPACE_TEXT == GetPrefix()) && - (GetLocalName().equalsAsciiL(sXML_p, sizeof(sXML_p)-1)) ) + (IsXMLToken(GetLocalName(), XML_P)) ) { rTextBuffer.append(sal_Unicode(0x0a)); } diff --git a/xmloff/source/text/XMLTextColumnsContext.cxx b/xmloff/source/text/XMLTextColumnsContext.cxx index c61c898ea148..53c903df58ab 100644 --- a/xmloff/source/text/XMLTextColumnsContext.cxx +++ b/xmloff/source/text/XMLTextColumnsContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLTextColumnsContext.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: dvo $ $Date: 2001-06-21 17:03:04 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -90,8 +90,8 @@ #ifndef _XMLOFF_XMLIMP_HXX #include "xmlimp.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLTEXTCOLUMNSCONTEXT_HXX #include "XMLTextColumnsContext.hxx" @@ -359,15 +359,13 @@ XMLTextColumnsContext::XMLTextColumnsContext( const OUString& rValue = xAttrList->getValueByIndex( i ); if( XML_NAMESPACE_FO == nPrefix ) { - if( aLocalName.equalsAsciiL( sXML_column_count, - sizeof(sXML_column_count)-1 ) && + if( IsXMLToken( aLocalName, XML_COLUMN_COUNT ) && GetImport().GetMM100UnitConverter(). convertNumber( nVal, rValue, 0, SHRT_MAX ) ) { nCount = (sal_Int16)nVal; } - else if( aLocalName.equalsAsciiL( sXML_column_gap, - sizeof(sXML_column_gap)-1 ) ) + else if( IsXMLToken( aLocalName, XML_COLUMN_GAP ) ) { bAutomatic = GetImport().GetMM100UnitConverter(). convertMeasure( nAutomaticDistance, rValue ); @@ -405,7 +403,7 @@ SvXMLImportContext *XMLTextColumnsContext::CreateChildContext( SvXMLImportContext *pContext = 0; if( XML_NAMESPACE_STYLE == nPrefix && - rLocalName.equalsAsciiL( sXML_column, sizeof(sXML_column)-1 ) ) + IsXMLToken( rLocalName, XML_COLUMN ) ) { XMLTextColumnContext_Impl *pColumn = new XMLTextColumnContext_Impl( GetImport(), nPrefix, rLocalName, @@ -421,8 +419,7 @@ SvXMLImportContext *XMLTextColumnsContext::CreateChildContext( pContext = pColumn; } else if( XML_NAMESPACE_STYLE == nPrefix && - rLocalName.equalsAsciiL( sXML_column_sep, - sizeof(sXML_column_sep)-1 ) ) + IsXMLToken( rLocalName, XML_COLUMN_SEP ) ) { pColumnSep = new XMLTextColumnSepContext_Impl( GetImport(), nPrefix, rLocalName, diff --git a/xmloff/source/text/XMLTextColumnsExport.cxx b/xmloff/source/text/XMLTextColumnsExport.cxx index 3eb10305ae44..0f6e27e7a23e 100644 --- a/xmloff/source/text/XMLTextColumnsExport.cxx +++ b/xmloff/source/text/XMLTextColumnsExport.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLTextColumnsExport.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dvo $ $Date: 2001-05-15 12:37:49 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -82,8 +82,8 @@ #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLNMSPE_HXX #include "xmlnmspe.hxx" @@ -104,6 +104,7 @@ using namespace ::com::sun::star::text; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::rtl; +using namespace ::xmloff::token; XMLTextColumnsExport::XMLTextColumnsExport( SvXMLExport& rExp ) : @@ -129,7 +130,7 @@ void XMLTextColumnsExport::exportXML( const Any& rAny ) OUStringBuffer sValue; GetExport().GetMM100UnitConverter().convertNumber( sValue, nCount ); - GetExport().AddAttribute( XML_NAMESPACE_FO, sXML_column_count, + GetExport().AddAttribute( XML_NAMESPACE_FO, XML_COLUMN_COUNT, sValue.makeStringAndClear() ); // handle 'automatic' columns @@ -146,12 +147,12 @@ void XMLTextColumnsExport::exportXML( const Any& rAny ) GetExport().GetMM100UnitConverter().convertMeasure( aBuffer, nDistance ); GetExport().AddAttribute( XML_NAMESPACE_FO, - sXML_column_gap, + XML_COLUMN_GAP, aBuffer.makeStringAndClear() ); } } - SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, sXML_columns, + SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, XML_COLUMNS, sal_True, sal_True ); if( xPropSet.is() ) @@ -165,7 +166,7 @@ void XMLTextColumnsExport::exportXML( const Any& rAny ) aAny >>= nWidth; GetExport().GetMM100UnitConverter().convertMeasure( sValue, nWidth ); - GetExport().AddAttribute( XML_NAMESPACE_STYLE, sXML_width, + GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_WIDTH, sValue.makeStringAndClear() ); // style:color @@ -174,7 +175,7 @@ void XMLTextColumnsExport::exportXML( const Any& rAny ) aAny >>= nColor; GetExport().GetMM100UnitConverter().convertColor( sValue, nColor ); - GetExport().AddAttribute( XML_NAMESPACE_STYLE, sXML_color, + GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_COLOR, sValue.makeStringAndClear() ); // style:height @@ -183,7 +184,7 @@ void XMLTextColumnsExport::exportXML( const Any& rAny ) aAny >>= nHeight; GetExport().GetMM100UnitConverter().convertPercent( sValue, nHeight ); - GetExport().AddAttribute( XML_NAMESPACE_STYLE, sXML_height, + GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_HEIGHT, sValue.makeStringAndClear() ); // style:vertical-align @@ -191,21 +192,21 @@ void XMLTextColumnsExport::exportXML( const Any& rAny ) VerticalAlignment eVertAlign; aAny >>= eVertAlign; - sal_Char *pStr = 0; + enum XMLTokenEnum eStr = XML_TOKEN_INVALID; switch( eVertAlign ) { -// case VerticalAlignment_TOP: pStr = sXML_top; - case VerticalAlignment_MIDDLE: pStr = sXML_middle; break; - case VerticalAlignment_BOTTOM: pStr = sXML_bottom; break; +// case VerticalAlignment_TOP: eStr = XML_TOP; + case VerticalAlignment_MIDDLE: eStr = XML_MIDDLE; break; + case VerticalAlignment_BOTTOM: eStr = XML_BOTTOM; break; } - if( pStr ) - GetExport().AddAttributeASCII( XML_NAMESPACE_STYLE, - sXML_vertical_align, pStr ); + if( eStr != XML_TOKEN_INVALID) + GetExport().AddAttribute( XML_NAMESPACE_STYLE, + XML_VERTICAL_ALIGN, eStr ); // style:column-sep SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, - sXML_column_sep, + XML_COLUMN_SEP, sal_True, sal_True ); } } @@ -216,23 +217,23 @@ void XMLTextColumnsExport::exportXML( const Any& rAny ) GetExport().GetMM100UnitConverter().convertNumber( sValue, pColumns->Width ); sValue.append( (sal_Unicode)'*' ); - GetExport().AddAttribute( XML_NAMESPACE_STYLE, sXML_rel_width, + GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_REL_WIDTH, sValue.makeStringAndClear() ); // fo:margin-left GetExport().GetMM100UnitConverter().convertMeasure( sValue, pColumns->LeftMargin ); - GetExport().AddAttribute( XML_NAMESPACE_FO, sXML_margin_left, + GetExport().AddAttribute( XML_NAMESPACE_FO, XML_MARGIN_LEFT, sValue.makeStringAndClear() ); // fo:margin-right GetExport().GetMM100UnitConverter().convertMeasure( sValue, pColumns->RightMargin ); - GetExport().AddAttribute( XML_NAMESPACE_FO, sXML_margin_right, + GetExport().AddAttribute( XML_NAMESPACE_FO, XML_MARGIN_RIGHT, sValue.makeStringAndClear() ); // style:column - SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, sXML_column, + SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, XML_COLUMN, sal_True, sal_True ); pColumns++; } diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index 914169b1900e..6eedeacf45a7 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLTextFrameContext.cxx,v $ * - * $Revision: 1.45 $ + * $Revision: 1.46 $ * - * last change: $Author: mib $ $Date: 2001-06-28 13:21:55 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -154,6 +154,7 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::container; using namespace ::com::sun::star::drawing; using namespace ::com::sun::star::document; +using namespace ::xmloff::token; using ::com::sun::star::document::XEventsSupplier; class XMLTextFrameDescContext_Impl : public SvXMLImportContext @@ -233,12 +234,12 @@ XMLTextFrameParam_Impl::XMLTextFrameParam_Impl( SvXMLImport& rImport, sal_uInt16 OUString aLocalName; sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName, &aLocalName ); - if ( XML_NAMESPACE_DRAW == nPrefix && aLocalName.equalsAsciiL( sXML_value, sizeof(sXML_value) -1 ) ) + if ( XML_NAMESPACE_DRAW == nPrefix && IsXMLToken(aLocalName, XML_VALUE) ) { sValue = rValue; bFoundValue=sal_True; } - else if ( XML_NAMESPACE_OFFICE == nPrefix && aLocalName.equalsAsciiL( sXML_name, sizeof( sXML_name) -1 ) ) + else if ( XML_NAMESPACE_OFFICE == nPrefix && IsXMLToken(aLocalName, XML_NAME) ) sName = rValue; } if (sName.getLength() && bFoundValue ) @@ -321,7 +322,7 @@ XMLTextFrameContourContext_Impl::XMLTextFrameContourContext_Impl( rValue); break; case XML_TOK_TEXT_CONTOUR_AUTO: - bAuto = rValue.equalsAsciiL( sXML_true, sizeof(sXML_true)-1 ); + bAuto = IsXMLToken(rValue, XML_TRUE); break; } } @@ -752,7 +753,7 @@ XMLTextFrameContext::XMLTextFrameContext( } break; case XML_TOK_TEXT_FRAME_REL_WIDTH: - if( rValue.equalsAsciiL( sXML_scale, sizeof(sXML_scale)-1 ) ) + if( IsXMLToken(rValue, XML_SCALE) ) { bSyncWidth = sal_True; } @@ -780,12 +781,11 @@ XMLTextFrameContext::XMLTextFrameContext( } break; case XML_TOK_TEXT_FRAME_REL_HEIGHT: - if( rValue.equalsAsciiL( sXML_scale, sizeof(sXML_scale)-1 ) ) + if( IsXMLToken( rValue, XML_SCALE ) ) { bSyncHeight = sal_True; } - else if( rValue.equalsAsciiL( sXML_scale_min, - sizeof(sXML_scale_min)-1 ) ) + else if( IsXMLToken( rValue, XML_SCALE_MIN ) ) { bSyncHeight = sal_True; bMinHeight = sal_True; @@ -854,10 +854,7 @@ XMLTextFrameContext::XMLTextFrameContext( sArchive = rValue; break; case XML_TOK_TEXT_FRAME_MAY_SCRIPT: - if ( rValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( sXML_true ) ) ) - bMayScript = sal_True; - else - bMayScript = sal_False; + bMayScript = IsXMLToken( rValue, XML_TRUE ); break; case XML_TOK_TEXT_FRAME_MIME_TYPE: sMimeType = rValue; @@ -925,7 +922,7 @@ SvXMLImportContext *XMLTextFrameContext::CreateChildContext( SvXMLImportContext *pContext = 0; if( XML_NAMESPACE_SVG == nPrefix && - rLocalName.equalsAsciiL( sXML_desc, sizeof(sXML_desc)-1 ) ) + IsXMLToken( rLocalName, XML_DESC ) ) { pContext = new XMLTextFrameDescContext_Impl( GetImport(), nPrefix, rLocalName, @@ -934,7 +931,7 @@ SvXMLImportContext *XMLTextFrameContext::CreateChildContext( else if( XML_NAMESPACE_DRAW == nPrefix ) { if ( (nType == XML_TEXT_FRAME_APPLET || nType == XML_TEXT_FRAME_PLUGIN) && - rLocalName.equalsAsciiL ( sXML_param, sizeof (sXML_param) -1 ) ) + IsXMLToken( rLocalName, XML_PARAM ) ) { pContext = new XMLTextFrameParam_Impl( GetImport(), nPrefix, rLocalName, @@ -942,18 +939,15 @@ SvXMLImportContext *XMLTextFrameContext::CreateChildContext( } else if( xPropSet.is() ) { - if( rLocalName.equalsAsciiL( sXML_contour_polygon, - sizeof(sXML_contour_polygon)-1 ) ) + if( IsXMLToken( rLocalName, XML_CONTOUR_POLYGON ) ) pContext = new XMLTextFrameContourContext_Impl( GetImport(), nPrefix, rLocalName, xAttrList, xPropSet, sal_False ); - else if( rLocalName.equalsAsciiL( sXML_contour_path, - sizeof(sXML_contour_path)-1 ) ) + else if( IsXMLToken( rLocalName, XML_CONTOUR_PATH ) ) pContext = new XMLTextFrameContourContext_Impl( GetImport(), nPrefix, rLocalName, xAttrList, xPropSet, sal_True ); - else if ( rLocalName.equalsAsciiL( sXML_image_map, - sizeof(sXML_image_map)-1) && + else if ( IsXMLToken( rLocalName, XML_IMAGE_MAP ) && ( nType == XML_TEXT_FRAME_TEXTBOX || nType == XML_TEXT_FRAME_GRAPHIC || nType == XML_TEXT_FRAME_OBJECT_OLE ) ) @@ -963,7 +957,7 @@ SvXMLImportContext *XMLTextFrameContext::CreateChildContext( } else if( (XML_NAMESPACE_OFFICE == nPrefix) ) { - if( rLocalName.equalsAsciiL(sXML_events, sizeof(sXML_events)-1) ) + if( IsXMLToken( rLocalName, XML_EVENTS ) ) { // do we still have the frame object? if (xPropSet.is()) @@ -1005,10 +999,10 @@ SvXMLImportContext *XMLTextFrameContext::CreateChildContext( } if( !pContext && ( XML_TEXT_FRAME_OBJECT == nType && - (XML_NAMESPACE_OFFICE == nPrefix && - rLocalName.equalsAsciiL(sXML_document, sizeof(sXML_document)-1)) || - (XML_NAMESPACE_MATH == nPrefix && - rLocalName.equalsAsciiL(sXML_math, sizeof(sXML_math)-1)) ) ) + (XML_NAMESPACE_OFFICE == nPrefix && + IsXMLToken( rLocalName, XML_DOCUMENT )) || + (XML_NAMESPACE_MATH == nPrefix && + IsXMLToken(rLocalName, XML_MATH) ) ) ) { if( !xPropSet.is() ) { diff --git a/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx b/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx index 5b96cd26b8b2..ceb6edf3a0e6 100644 --- a/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx +++ b/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLTextFrameHyperlinkContext.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: mib $ $Date: 2001-06-27 07:38:11 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -68,8 +68,8 @@ #ifndef _XMLOFF_XMLNMSPE_HXX #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLUCONV_HXX #include "xmluconv.hxx" @@ -86,6 +86,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::text; using namespace ::com::sun::star::xml::sax; using namespace ::com::sun::star::beans; +using namespace ::xmloff::token; TYPEINIT1( XMLTextFrameHyperlinkContext, SvXMLImportContext ); @@ -145,10 +146,10 @@ XMLTextFrameHyperlinkContext::XMLTextFrameHyperlinkContext( if( sShow.getLength() && !sTargetFrameName.getLength() ) { - if( sShow.equalsAsciiL( sXML_new, sizeof(sXML_new)-1 ) ) + if( IsXMLToken( sShow, XML_NEW ) ) sTargetFrameName = OUString( RTL_CONSTASCII_USTRINGPARAM("_blank" ) ); - else if( sShow.equalsAsciiL( sXML_replace, sizeof(sXML_replace)-1 ) ) + else if( IsXMLToken( sShow, XML_REPLACE ) ) sTargetFrameName = OUString( RTL_CONSTASCII_USTRINGPARAM("_self" ) ); } @@ -171,13 +172,13 @@ SvXMLImportContext *XMLTextFrameHyperlinkContext::CreateChildContext( XMLTextFrameContext *pTextFrameContext = 0; if( XML_NAMESPACE_DRAW == nPrefix && - rLocalName.equalsAsciiL( sXML_text_box, sizeof(sXML_text_box)-1 ) ) + IsXMLToken( rLocalName, XML_TEXT_BOX ) ) pTextFrameContext = new XMLTextFrameContext( GetImport(), nPrefix, rLocalName, xAttrList, eAnchorType, XML_TEXT_FRAME_TEXTBOX); else if( XML_NAMESPACE_DRAW == nPrefix && - rLocalName.equalsAsciiL( sXML_image, sizeof(sXML_image)-1 ) ) + IsXMLToken( rLocalName, XML_IMAGE ) ) pTextFrameContext = new XMLTextFrameContext( GetImport(), nPrefix, rLocalName, xAttrList, eAnchorType, diff --git a/xmloff/source/text/XMLTextHeaderFooterContext.cxx b/xmloff/source/text/XMLTextHeaderFooterContext.cxx index 3032fd2d45ec..510508351c3b 100644 --- a/xmloff/source/text/XMLTextHeaderFooterContext.cxx +++ b/xmloff/source/text/XMLTextHeaderFooterContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLTextHeaderFooterContext.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: mib $ $Date: 2001-03-09 07:23:23 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -71,9 +71,6 @@ #ifndef _XMLOFF_XMLNMSPE_HXX #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" -#endif #ifndef _XMLOFF_TEXTHEADERFOOTERCONTEXT_HXX_ #include "XMLTextHeaderFooterContext.hxx" #endif diff --git a/xmloff/source/text/XMLTextListBlockContext.cxx b/xmloff/source/text/XMLTextListBlockContext.cxx index 966fd7ebd859..adbabb05d111 100644 --- a/xmloff/source/text/XMLTextListBlockContext.cxx +++ b/xmloff/source/text/XMLTextListBlockContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLTextListBlockContext.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: mib $ $Date: 2000-10-23 10:17:35 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -88,8 +88,8 @@ #ifndef _XMLOFF_XMLNMSPE_HXX #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLTEXTLISTITEMCONTEXT_HXX @@ -105,6 +105,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::container; using namespace ::com::sun::star::style; using namespace ::com::sun::star::beans; +using namespace ::xmloff::token; TYPEINIT1( XMLTextListBlockContext, SvXMLImportContext ); @@ -156,7 +157,7 @@ XMLTextListBlockContext::XMLTextListBlockContext( switch( rTokenMap.Get( nPrefix, aLocalName ) ) { case XML_TOK_TEXT_LIST_BLOCK_CONTINUE_NUMBERING: - bRestartNumbering = rValue.compareToAscii( sXML_true ) != 0; + bRestartNumbering = !IsXMLToken(rValue, XML_TRUE); break; case XML_TOK_TEXT_LIST_BLOCK_STYLE_NAME: sStyleName = rValue; diff --git a/xmloff/source/text/XMLTextListItemContext.cxx b/xmloff/source/text/XMLTextListItemContext.cxx index 48782c6af650..3be12541e839 100644 --- a/xmloff/source/text/XMLTextListItemContext.cxx +++ b/xmloff/source/text/XMLTextListItemContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLTextListItemContext.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: mib $ $Date: 2000-09-25 06:57:28 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -72,8 +72,8 @@ #ifndef _XMLOFF_XMLNMSPE_HXX #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_TXTPARAI_HXX #include "txtparai.hxx" @@ -93,6 +93,7 @@ using namespace ::rtl; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; +using namespace ::xmloff::token; TYPEINIT1( XMLTextListItemContext, SvXMLImportContext ); @@ -117,7 +118,7 @@ XMLTextListItemContext::XMLTextListItemContext( GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName, &aLocalName ); if( !bIsHeader && XML_NAMESPACE_TEXT == nPrefix && - aLocalName.compareToAscii( sXML_start_value ) == 0 ) + IsXMLToken( aLocalName, XML_START_VALUE ) ) { sal_Int32 nTmp = rValue.toInt32(); if( nTmp >= 0 && nTmp <= SHRT_MAX ) diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx index 54b89c9e94c8..444254d6114e 100644 --- a/xmloff/source/text/XMLTextMarkImportContext.cxx +++ b/xmloff/source/text/XMLTextMarkImportContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLTextMarkImportContext.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dvo $ $Date: 2001-06-15 10:37:08 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -75,8 +75,8 @@ #include "xmluconv.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLIMP_HXX @@ -290,7 +290,7 @@ sal_Bool XMLTextMarkImportContext::FindName( &sLocalName ); if ( (XML_NAMESPACE_TEXT == nPrefix) && - (0 == sLocalName.compareToAscii(sXML_name)) ) + IsXMLToken(sLocalName, XML_NAME) ) { sName = xAttrList->getValueByIndex(nAttr); bNameOK = sal_True; diff --git a/xmloff/source/text/XMLTextMasterPageContext.cxx b/xmloff/source/text/XMLTextMasterPageContext.cxx index 2b87b85e743a..5c097ae51805 100644 --- a/xmloff/source/text/XMLTextMasterPageContext.cxx +++ b/xmloff/source/text/XMLTextMasterPageContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLTextMasterPageContext.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: cl $ $Date: 2001-01-16 22:19:14 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -74,8 +74,8 @@ #ifndef _XMLOFF_XMLNMSPE_HXX #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_TEXTMASTERPAGECONTEXT_HXX_ #include "XMLTextMasterPageContext.hxx" @@ -101,6 +101,7 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; //using namespace ::com::sun::star::text; +using namespace ::xmloff::token; Reference < XStyle > XMLTextMasterPageContext::Create() { @@ -148,17 +149,15 @@ XMLTextMasterPageContext::XMLTextMasterPageContext( SvXMLImport& rImport, sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName, &aLocalName ); if( XML_NAMESPACE_STYLE == nPrefix ) { - if( aLocalName.equalsAsciiL( sXML_name, sizeof( sXML_name )-1 ) ) + if( IsXMLToken( aLocalName, XML_NAME ) ) { sName = xAttrList->getValueByIndex( i ); } - else if( aLocalName.equalsAsciiL( sXML_next_style_name, - sizeof( sXML_next_style_name )-1 ) ) + else if( IsXMLToken( aLocalName, XML_NEXT_STYLE_NAME ) ) { sFollow = xAttrList->getValueByIndex( i ); } - else if( aLocalName.equalsAsciiL( sXML_page_master_name, - sizeof( sXML_page_master_name )-1 ) ) + else if( IsXMLToken( aLocalName, XML_PAGE_MASTER_NAME ) ) { sPageMasterName = xAttrList->getValueByIndex( i ); } diff --git a/xmloff/source/text/XMLTextMasterPageExport.cxx b/xmloff/source/text/XMLTextMasterPageExport.cxx index 7c2524feeee9..7a860c749062 100644 --- a/xmloff/source/text/XMLTextMasterPageExport.cxx +++ b/xmloff/source/text/XMLTextMasterPageExport.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLTextMasterPageExport.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dvo $ $Date: 2001-03-09 14:13:18 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -66,8 +66,8 @@ #ifndef _XMLOFF_XMLNMSPE_HXX #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _COM_SUN_STAR_TEXT_XTEXT_HPP_ @@ -92,6 +92,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::text; using namespace ::com::sun::star::beans; +using namespace ::xmloff::token; XMLTextMasterPageExport::XMLTextMasterPageExport( SvXMLExport& rExp ) : XMLPageExport( rExp ), @@ -182,20 +183,20 @@ void XMLTextMasterPageExport::exportMasterPageContent( if( xHeaderText.is() ) { if( !bHeader ) - GetExport().AddAttributeASCII( XML_NAMESPACE_STYLE, - sXML_display, sXML_false ); + GetExport().AddAttribute( XML_NAMESPACE_STYLE, + XML_DISPLAY, XML_FALSE ); SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, - sXML_header, sal_True, sal_True ); + XML_HEADER, sal_True, sal_True ); exportHeaderFooterContent( xHeaderText, sal_False ); } if( xHeaderTextLeft.is() && xHeaderTextLeft != xHeaderText ) { if( !bHeaderLeft ) - GetExport().AddAttributeASCII( XML_NAMESPACE_STYLE, - sXML_display, sXML_false ); + GetExport().AddAttribute( XML_NAMESPACE_STYLE, + XML_DISPLAY, XML_FALSE ); SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, - sXML_header_left, sal_True, sal_True ); + XML_HEADER_LEFT, sal_True, sal_True ); exportHeaderFooterContent( xHeaderTextLeft, sal_False ); } @@ -212,20 +213,20 @@ void XMLTextMasterPageExport::exportMasterPageContent( if( xFooterText.is() ) { if( !bFooter ) - GetExport().AddAttributeASCII( XML_NAMESPACE_STYLE, - sXML_display, sXML_false ); + GetExport().AddAttribute( XML_NAMESPACE_STYLE, + XML_DISPLAY, XML_FALSE ); SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, - sXML_footer, sal_True, sal_True ); + XML_FOOTER, sal_True, sal_True ); exportHeaderFooterContent( xFooterText, sal_False ); } if( xFooterTextLeft.is() && xFooterTextLeft != xFooterText ) { if( !bFooterLeft ) - GetExport().AddAttributeASCII( XML_NAMESPACE_STYLE, - sXML_display, sXML_false ); + GetExport().AddAttribute( XML_NAMESPACE_STYLE, + XML_DISPLAY, XML_FALSE ); SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, - sXML_footer_left, sal_True, sal_True ); + XML_FOOTER_LEFT, sal_True, sal_True ); exportHeaderFooterContent( xFooterTextLeft, sal_False ); } } diff --git a/xmloff/source/text/XMLTextMasterStylesContext.cxx b/xmloff/source/text/XMLTextMasterStylesContext.cxx index 85c63b7626d1..677c6ad15d20 100644 --- a/xmloff/source/text/XMLTextMasterStylesContext.cxx +++ b/xmloff/source/text/XMLTextMasterStylesContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLTextMasterStylesContext.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: mib $ $Date: 2000-10-18 11:18:30 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -70,8 +70,8 @@ #ifndef _XMLOFF_XMLNMSPE_HXX #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_NMSPMAP_HXX #include "nmspmap.hxx" @@ -88,6 +88,9 @@ using namespace ::rtl; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::xml::sax; +using ::xmloff::token::IsXMLToken; +using ::xmloff::token::XML_MASTER_PAGE; + // ------------------------------------------------------------------------ TYPEINIT1( XMLTextMasterStylesContext, SvXMLStylesContext ); @@ -117,7 +120,7 @@ SvXMLStyleContext *XMLTextMasterStylesContext::CreateStyleChildContext( SvXMLStyleContext *pContext = 0; if( XML_NAMESPACE_STYLE == nPrefix && - rLocalName.equalsAsciiL( sXML_master_page, sizeof(sXML_master_page)-1 ) && + IsXMLToken( rLocalName, XML_MASTER_PAGE ) && InsertStyleFamily( XML_STYLE_FAMILY_MASTER_PAGE ) ) pContext = new XMLTextMasterPageContext( GetImport(), nPrefix, rLocalName, diff --git a/xmloff/source/text/XMLTextShapeStyleContext.cxx b/xmloff/source/text/XMLTextShapeStyleContext.cxx index 2d229869012f..fa0e14c3e19a 100644 --- a/xmloff/source/text/XMLTextShapeStyleContext.cxx +++ b/xmloff/source/text/XMLTextShapeStyleContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLTextShapeStyleContext.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: dvo $ $Date: 2001-02-06 14:00:16 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -68,8 +68,8 @@ #ifndef _XMLOFF_XMLNMSPE_HXX #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLTEXTPROPERTYSETCONTEXT_HXX #include "XMLTextPropertySetContext.hxx" @@ -103,6 +103,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::xml::sax; using namespace ::com::sun::star::style; using namespace ::com::sun::star::beans; +using namespace ::xmloff::token; class XMLTextShapePropertySetContext_Impl : public XMLShapePropertySetContext { @@ -186,10 +187,9 @@ void XMLTextShapeStyleContext::SetAttribute( sal_uInt16 nPrefixKey, const OUString& rValue ) { if( XML_NAMESPACE_STYLE == nPrefixKey && - rLocalName.equalsAsciiL( sXML_auto_update, - sizeof(sXML_auto_update)-1 ) ) + IsXMLToken( rLocalName, XML_AUTO_UPDATE ) ) { - if( rValue.equalsAsciiL( sXML_true, sizeof(sXML_true)-1 ) ) + if( IsXMLToken( rValue, XML_TRUE ) ) bAutoUpdate = sal_True; } else @@ -224,7 +224,7 @@ SvXMLImportContext *XMLTextShapeStyleContext::CreateChildContext( SvXMLImportContext *pContext = 0; if( XML_NAMESPACE_STYLE == nPrefix && - rLocalName.compareToAscii( sXML_properties ) == 0 ) + IsXMLToken( rLocalName, XML_PROPERTIES ) ) { UniReference < SvXMLImportPropertyMapper > xImpPrMap = GetStyles()->GetImportPropertyMapper( GetFamily() ); @@ -236,7 +236,7 @@ SvXMLImportContext *XMLTextShapeStyleContext::CreateChildContext( } } else if ( (XML_NAMESPACE_OFFICE == nPrefix) && - rLocalName.equalsAsciiL( sXML_events, sizeof(sXML_events)-1 ) ) + IsXMLToken( rLocalName, XML_EVENTS ) ) { // create and remember events import context // (for delayed processing of events) diff --git a/xmloff/source/text/XMLTrackedChangesImportContext.cxx b/xmloff/source/text/XMLTrackedChangesImportContext.cxx index e2a415cb467d..38eaa8b86cc9 100644 --- a/xmloff/source/text/XMLTrackedChangesImportContext.cxx +++ b/xmloff/source/text/XMLTrackedChangesImportContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLTrackedChangesImportContext.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dvo $ $Date: 2001-05-02 16:19:18 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -91,8 +91,8 @@ #include "xmluconv.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif @@ -100,6 +100,7 @@ using ::rtl::OUString; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; using ::com::sun::star::xml::sax::XAttributeList; +using namespace ::xmloff::token; @@ -133,8 +134,7 @@ void XMLTrackedChangesImportContext::StartElement( if ( XML_NAMESPACE_TEXT == nPrefix ) { - if ( sLocalName.equalsAsciiL( sXML_track_changes, - sizeof(sXML_track_changes)-1 ) ) + if ( IsXMLToken( sLocalName, XML_TRACK_CHANGES ) ) { sal_Bool bTmp; if( SvXMLUnitConverter::convertBool( @@ -143,9 +143,7 @@ void XMLTrackedChangesImportContext::StartElement( bTrackChanges = bTmp; } } - else if ( sLocalName.equalsAsciiL( sXML_protection_key, - sizeof(sXML_protection_key)-1 ) ) - { + else if ( IsXMLToken( sLocalName, XML_PROTECTION_KEY ) ) { Sequence<sal_Int8> aSequence; SvXMLUnitConverter::decodeBase64( aSequence, xAttrList->getValueByIndex(i)); @@ -171,8 +169,7 @@ SvXMLImportContext* XMLTrackedChangesImportContext::CreateChildContext( SvXMLImportContext* pContext = NULL; if ( (XML_NAMESPACE_TEXT == nPrefix) && - rLocalName.equalsAsciiL(sXML_changed_region, - sizeof(sXML_changed_region)-1) ) + IsXMLToken( rLocalName, XML_CHANGED_REGION ) ) { pContext = new XMLChangedRegionImportContext(GetImport(), nPrefix, rLocalName); diff --git a/xmloff/source/text/txtdrope.cxx b/xmloff/source/text/txtdrope.cxx index dd69b96bddb8..b7cd1bdc7ae8 100644 --- a/xmloff/source/text/txtdrope.cxx +++ b/xmloff/source/text/txtdrope.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtdrope.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:07:06 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -71,8 +71,8 @@ #include <com/sun/star/style/DropCapFormat.hpp> #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_NMSPMAP_HXX #include "nmspmap.hxx" @@ -92,6 +92,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::style; using namespace ::com::sun::star::uno; using namespace ::rtl; +using namespace ::xmloff::token; OUString XMLTextDropCapExport::GetQNameByKey( sal_uInt16 nKey, const OUString& rLocalName ) const @@ -116,19 +117,17 @@ void XMLTextDropCapExport::CheckAttrList() #endif void XMLTextDropCapExport::AddAttribute( sal_uInt16 nPrefixKey, - const sal_Char *pName, - const OUString& rValue ) + enum XMLTokenEnum eName, + const OUString& rValue ) { - OUString sName( OUString::createFromAscii( pName ) ); - - pAttrList->AddAttribute( GetQNameByKey( nPrefixKey, sName ), + pAttrList->AddAttribute( GetQNameByKey( nPrefixKey, GetXMLToken(eName) ), sCDATA, rValue ); } XMLTextDropCapExport::XMLTextDropCapExport( const Reference< xml::sax::XDocumentHandler > & rHandler, const SvXMLUnitConverter& rUnitConverter ) : - sCDATA( OUString::createFromAscii( sXML_CDATA ) ), + sCDATA( GetXMLToken( XML_CDATA ) ), pNamespaceMap( 0 ), rUnitConv( rUnitConverter ), pAttrList( new SvXMLAttributeList ) @@ -158,13 +157,13 @@ void XMLTextDropCapExport::exportXML( const Any& rAny, { // style:lines rUnitConv.convertNumber( sBuffer, (sal_Int32)aFormat.Lines ); - AddAttribute( XML_NAMESPACE_STYLE, sXML_lines, + AddAttribute( XML_NAMESPACE_STYLE, XML_LINES, sBuffer.makeStringAndClear() ); // style:length if( bWholeWord ) { - sValue = OUString::createFromAscii(sXML_word); + sValue = GetXMLToken(XML_WORD); } else if( aFormat.Count > 1 ) { @@ -172,24 +171,24 @@ void XMLTextDropCapExport::exportXML( const Any& rAny, sValue = sBuffer.makeStringAndClear(); } if( sValue.getLength() ) - AddAttribute( XML_NAMESPACE_STYLE, sXML_length, sValue ); + AddAttribute( XML_NAMESPACE_STYLE, XML_LENGTH, sValue ); // style:distance if( aFormat.Distance > 0 ) { rUnitConv.convertMeasure( sBuffer, aFormat.Distance ); - AddAttribute( XML_NAMESPACE_STYLE, sXML_distance, + AddAttribute( XML_NAMESPACE_STYLE, XML_DISTANCE, sBuffer.makeStringAndClear() ); } // style:style-name if( rStyleName.getLength() ) - AddAttribute( XML_NAMESPACE_STYLE, sXML_style_name, + AddAttribute( XML_NAMESPACE_STYLE, XML_STYLE_NAME, rStyleName ); } OUString sElem = GetQNameByKey( XML_NAMESPACE_STYLE, - OUString::createFromAscii(sXML_drop_cap) ); + GetXMLToken(XML_DROP_CAP) ); xHandler->startElement( sElem, xAttrList ); ClearAttrList(); xHandler->endElement( sElem ); diff --git a/xmloff/source/text/txtdrope.hxx b/xmloff/source/text/txtdrope.hxx index 225b3d99855c..6e0de91ca47b 100644 --- a/xmloff/source/text/txtdrope.hxx +++ b/xmloff/source/text/txtdrope.hxx @@ -2,9 +2,9 @@ * * $RCSfile: txtdrope.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:07:06 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -70,6 +70,10 @@ #include "attrlist.hxx" #endif +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" +#endif + class SvXMLNamespaceMap; class SvXMLUnitConverter; namespace com { namespace sun { namespace star { namespace uno { @@ -104,7 +108,8 @@ protected: void CheckAttrList(); #endif void ClearAttrList(); - void AddAttribute( sal_uInt16 nPrefixKey, const sal_Char *pName, + void AddAttribute( sal_uInt16 nPrefixKey, + enum ::xmloff::token::XMLTokenEnum eName, const ::rtl::OUString& rValue ); ::rtl::OUString GetQNameByKey( sal_uInt16 nKey, const ::rtl::OUString& rLocalName ) const; diff --git a/xmloff/source/text/txtdropi.cxx b/xmloff/source/text/txtdropi.cxx index b72ed16f0b2c..c95bafa685fa 100644 --- a/xmloff/source/text/txtdropi.cxx +++ b/xmloff/source/text/txtdropi.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtdropi.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dvo $ $Date: 2001-06-15 17:13:32 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -80,8 +80,8 @@ #ifndef _XMLOFF_XMLIMP_HXX #include "xmlimp.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif using namespace ::rtl; @@ -139,7 +139,7 @@ void XMLTextDropCapImportContext::ProcessAttrs( break; case XML_TOK_DROP_LENGTH: - if( rValue.compareToAscii( sXML_word ) == 0 ) + if( IsXMLToken( rValue, XML_WORD ) ) { bWholeWord = sal_True; } diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index 9eabde20d397..77f62eafe95b 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtflde.cxx,v $ * - * $Revision: 1.32 $ + * $Revision: 1.33 $ * - * last change: $Author: mib $ $Date: 2001-06-27 07:52:52 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -76,8 +76,8 @@ #include "xmlnumfe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLEMENT_HXX @@ -1025,9 +1025,9 @@ void XMLTextFieldExport::ExportField(const Reference<XTextField> & rTextField ) { // export <text:span> element GetExport().AddAttribute( XML_NAMESPACE_TEXT, - sXML_style_name, sStyle ); + XML_STYLE_NAME, sStyle ); SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, - sXML_span, sal_False, sal_False); + XML_SPAN, sal_False, sal_False); ExportFieldHelper( rTextField, xPropSet, xRangePropSet, nToken ); } else @@ -1060,36 +1060,36 @@ void XMLTextFieldExport::ExportFieldHelper( switch (nToken) { case FIELD_ID_AUTHOR: // author field: fixed, field (sub-)type - ProcessBoolean(sXML_fixed, + ProcessBoolean(XML_FIXED, GetBoolProperty(sPropertyIsFixed, rPropSet), sal_True); ExportElement(MapAuthorFieldName(rPropSet), sPresentation); break; case FIELD_ID_SENDER: // sender field: fixed, field (sub-)type - ProcessBoolean(sXML_fixed, + ProcessBoolean(XML_FIXED, GetBoolProperty(sPropertyIsFixed, rPropSet), sal_True); ExportElement(MapSenderFieldName(rPropSet), sPresentation); break; case FIELD_ID_PLACEHOLDER: // placeholder field: type, name, description - ProcessString(sXML_placeholder_type, + ProcessString(XML_PLACEHOLDER_TYPE, MapPlaceholderType( GetInt16Property(sPropertyPlaceholderType, rPropSet))); - ProcessString(sXML_description, + ProcessString(XML_DESCRIPTION, GetStringProperty(sPropertyHint,rPropSet), sal_True); - ExportElement(sXML_placeholder, sPresentation); + ExportElement(XML_PLACEHOLDER, sPresentation); break; case FIELD_ID_VARIABLE_SET: { // variable set field: name, visible, format&value - ProcessString(sXML_name, + ProcessString(XML_NAME, GetStringProperty(sPropertyVariableName, rPropSet)); ProcessDisplay(GetBoolProperty(sPropertyIsVisible, rPropSet), sal_False); - ProcessString(sXML_formula, + ProcessString(XML_FORMULA, GetStringProperty(sPropertyContent, rPropSet), sPresentation); ProcessValueAndType(IsStringField(nToken, rPropSet), @@ -1098,13 +1098,13 @@ void XMLTextFieldExport::ExportFieldHelper( sPresentation, GetDoubleProperty(sPropertyValue, rPropSet), sal_True, sal_True, sal_True); - ExportElement(sXML_variable_set, sPresentation); + ExportElement(XML_VARIABLE_SET, sPresentation); break; } case FIELD_ID_VARIABLE_GET: { // variable get field: name, format&value - ProcessString(sXML_name, + ProcessString(XML_NAME, GetStringProperty(sPropertyContent, rPropSet)); sal_Bool bCmd = GetBoolProperty(sPropertyIsShowFormula, rPropSet); ProcessDisplay(sal_True, bCmd); @@ -1113,18 +1113,18 @@ void XMLTextFieldExport::ExportFieldHelper( GetIntProperty(sPropertyNumberFormat, rPropSet), sEmpty, sEmpty, 0.0, // values not used sal_False, !bCmd, !bCmd); - ExportElement(sXML_variable_get, sPresentation); + ExportElement(XML_VARIABLE_GET, sPresentation); break; } case FIELD_ID_VARIABLE_INPUT: // variable input field: name, description, format&value - ProcessString(sXML_name, + ProcessString(XML_NAME, GetStringProperty(sPropertyVariableName, rPropSet)); - ProcessString(sXML_description, + ProcessString(XML_DESCRIPTION, GetStringProperty(sPropertyHint , rPropSet)); ProcessDisplay(GetBoolProperty(sPropertyIsVisible, rPropSet), sal_False); - ProcessString(sXML_formula, + ProcessString(XML_FORMULA, GetStringProperty(sPropertyContent, rPropSet), sPresentation); ProcessValueAndType(IsStringField(nToken, rPropSet), @@ -1133,7 +1133,7 @@ void XMLTextFieldExport::ExportFieldHelper( sPresentation, GetDoubleProperty(sPropertyValue, rPropSet), sal_True, sal_True, sal_True); - ExportElement(sXML_variable_input, sPresentation); + ExportElement(XML_VARIABLE_INPUT, sPresentation); break; case FIELD_ID_USER_GET: @@ -1148,23 +1148,23 @@ void XMLTextFieldExport::ExportFieldHelper( sal_False, sal_False, !bCmd); // name from FieldMaster - ProcessString(sXML_name, + ProcessString(XML_NAME, GetStringProperty(sPropertyName, GetMasterPropertySet(rTextField))); - ExportElement(sXML_user_field_get, sPresentation); + ExportElement(XML_USER_FIELD_GET, sPresentation); break; } case FIELD_ID_USER_INPUT: // user input field: name (from FieldMaster), description -// ProcessString(sXML_name, +// ProcessString(XML_NAME, // GetStringProperty(sPropertyName, // GetMasterPropertySet(rTextField))); - ProcessString(sXML_name, + ProcessString(XML_NAME, GetStringProperty(sPropertyContent, rPropSet)); - ProcessString(sXML_description, + ProcessString(XML_DESCRIPTION, GetStringProperty(sPropertyHint, rPropSet)); - ExportElement(sXML_user_field_input, sPresentation); + ExportElement(XML_USER_FIELD_INPUT, sPresentation); break; case FIELD_ID_SEQUENCE: @@ -1172,17 +1172,17 @@ void XMLTextFieldExport::ExportFieldHelper( // sequence field: name, formula, seq-format OUString sName = GetStringProperty(sPropertyVariableName, rPropSet); // TODO: use reference name only if actually beeing referenced. - ProcessString(sXML_ref_name, + ProcessString(XML_REF_NAME, MakeSequenceRefName( GetInt16Property(sPropertySequenceValue, rPropSet), sName)); - ProcessString(sXML_name, sName); - ProcessString(sXML_formula, + ProcessString(XML_NAME, sName); + ProcessString(XML_FORMULA, GetStringProperty(sPropertyContent, rPropSet), sPresentation); ProcessNumberingType(GetInt16Property(sPropertyNumberingType, rPropSet)); - ExportElement(sXML_sequence, sPresentation); + ExportElement(XML_SEQUENCE, sPresentation); break; } @@ -1190,7 +1190,7 @@ void XMLTextFieldExport::ExportFieldHelper( { // formula field: formula, format&value sal_Bool bCmd = GetBoolProperty(sPropertyIsShowFormula, rPropSet); - ProcessString(sXML_formula, + ProcessString(XML_FORMULA, GetStringProperty(sPropertyContent, rPropSet), sPresentation); ProcessDisplay(sal_True, bCmd); @@ -1200,15 +1200,15 @@ void XMLTextFieldExport::ExportFieldHelper( sPresentation, GetDoubleProperty(sPropertyValue, rPropSet), !bCmd, !bCmd, !bCmd); - ExportElement(sXML_expression, sPresentation); + ExportElement(XML_EXPRESSION, sPresentation); break; } case FIELD_ID_TEXT_INPUT: // text input field: description and string-value - ProcessString(sXML_description, + ProcessString(XML_DESCRIPTION, GetStringProperty(sPropertyHint, rPropSet)); - ExportElement(sXML_text_input, sPresentation); + ExportElement(XML_TEXT_INPUT, sPresentation); break; case FIELD_ID_TIME: @@ -1223,7 +1223,7 @@ void XMLTextFieldExport::ExportFieldHelper( if (xPropSetInfo->hasPropertyByName(sPropertyDateTimeValue)) { // no value -> current time - ProcessDateTime(sXML_time_value, + ProcessDateTime(XML_TIME_VALUE, GetDateTimeProperty(sPropertyDateTimeValue, rPropSet), sal_False ); @@ -1231,24 +1231,24 @@ void XMLTextFieldExport::ExportFieldHelper( if (xPropSetInfo->hasPropertyByName(sPropertyDateTime)) { // no value -> current time - ProcessDateTime(sXML_time_value, + ProcessDateTime(XML_TIME_VALUE, GetDateTimeProperty(sPropertyDateTime,rPropSet), sal_False ); } if (xPropSetInfo->hasPropertyByName(sPropertyIsFixed)) { - ProcessBoolean(sXML_fixed, + ProcessBoolean(XML_FIXED, GetBoolProperty(sPropertyIsFixed, rPropSet), sal_False); } if (xPropSetInfo->hasPropertyByName(sPropertyAdjust)) { // adjust value given as integer in minutes - ProcessDateTime(sXML_time_adjust, + ProcessDateTime(XML_TIME_ADJUST, GetIntProperty(sPropertyAdjust, rPropSet), sal_False, sal_True, sal_True); } - ExportElement(sXML_time, sPresentation); + ExportElement(XML_TIME, sPresentation); break; case FIELD_ID_DATE: @@ -1263,7 +1263,7 @@ void XMLTextFieldExport::ExportFieldHelper( if (xPropSetInfo->hasPropertyByName(sPropertyDateTimeValue)) { // no value -> current date - ProcessDateTime(sXML_date_value, + ProcessDateTime(XML_DATE_VALUE, GetDateTimeProperty(sPropertyDateTimeValue, rPropSet), sal_True); @@ -1271,24 +1271,24 @@ void XMLTextFieldExport::ExportFieldHelper( // TODO: remove double-handling after SRC614 else if (xPropSetInfo->hasPropertyByName(sPropertyDateTime)) { - ProcessDateTime(sXML_date_value, + ProcessDateTime(XML_DATE_VALUE, GetDateTimeProperty(sPropertyDateTime,rPropSet), sal_True ); } if (xPropSetInfo->hasPropertyByName(sPropertyIsFixed)) { - ProcessBoolean(sXML_fixed, + ProcessBoolean(XML_FIXED, GetBoolProperty(sPropertyIsFixed, rPropSet), sal_False); } if (xPropSetInfo->hasPropertyByName(sPropertyAdjust)) { // adjust value given as number of days - ProcessDateTime(sXML_date_adjust, + ProcessDateTime(XML_DATE_ADJUST, GetIntProperty(sPropertyAdjust, rPropSet), sal_True, sal_True, sal_True); } - ExportElement(sXML_date, sPresentation); + ExportElement(XML_DATE, sPresentation); break; case FIELD_ID_PAGENUMBER: @@ -1305,80 +1305,80 @@ void XMLTextFieldExport::ExportFieldHelper( if (xPropSetInfo->hasPropertyByName(sPropertySubType)) { // property SubType used in MapPageNumebrName - ProcessString(sXML_select_page, + ProcessString(XML_SELECT_PAGE, MapPageNumberName(rPropSet, nAdjust)); } - ProcessInteger(sXML_page_adjust, nAdjust, 0); + ProcessInteger(XML_PAGE_ADJUST, nAdjust, 0); } - ExportElement(sXML_page_number, sPresentation); + ExportElement(XML_PAGE_NUMBER, sPresentation); break; case FIELD_ID_PAGESTRING: { - ProcessString(sXML_string_value, + ProcessString(XML_STRING_VALUE, GetStringProperty(sPropertyUserText, rPropSet), sPresentation); sal_Int32 nDummy = 0; // MapPageNumberName need int - ProcessString(sXML_select_page, MapPageNumberName(rPropSet, nDummy)); - ExportElement(sXML_page_continuation_string, sPresentation); + ProcessString(XML_SELECT_PAGE, MapPageNumberName(rPropSet, nDummy)); + ExportElement(XML_PAGE_CONTINUATION_STRING, sPresentation); break; } case FIELD_ID_DATABASE_NAME: - ProcessString(sXML_database_name, + ProcessString(XML_DATABASE_NAME, GetStringProperty(sPropertyDataBaseName, rPropSet)); - ProcessString(sXML_table_name, + ProcessString(XML_TABLE_NAME, GetStringProperty(sPropertyDataTableName, rPropSet)); - ExportElement(sXML_database_name, sPresentation); + ExportElement(XML_DATABASE_NAME, sPresentation); break; case FIELD_ID_DATABASE_NUMBER: - ProcessString(sXML_database_name, + ProcessString(XML_DATABASE_NAME, GetStringProperty(sPropertyDataBaseName, rPropSet)); - ProcessString(sXML_table_name, + ProcessString(XML_TABLE_NAME, GetStringProperty(sPropertyDataTableName, rPropSet)); ProcessNumberingType( GetInt16Property(sPropertyNumberingType,rPropSet)); - ProcessInteger(sXML_value, + ProcessInteger(XML_VALUE, GetIntProperty(sPropertySetNumber, rPropSet)); - ExportElement(sXML_database_row_number, sPresentation); + ExportElement(XML_DATABASE_ROW_NUMBER, sPresentation); break; case FIELD_ID_DATABASE_NEXT: - ProcessString(sXML_database_name, + ProcessString(XML_DATABASE_NAME, GetStringProperty(sPropertyDataBaseName, rPropSet)); - ProcessString(sXML_table_name, + ProcessString(XML_TABLE_NAME, GetStringProperty(sPropertyDataTableName, rPropSet)); - ProcessString(sXML_condition, + ProcessString(XML_CONDITION, GetStringProperty(sPropertyCondition, rPropSet)); DBG_ASSERT(sPresentation.equals(sEmpty), "Unexpected presentation for database next field"); - ExportElement(sXML_database_next); + ExportElement(XML_DATABASE_NEXT); break; case FIELD_ID_DATABASE_SELECT: - ProcessString(sXML_database_name, + ProcessString(XML_DATABASE_NAME, GetStringProperty(sPropertyDataBaseName, rPropSet)); - ProcessString(sXML_table_name, + ProcessString(XML_TABLE_NAME, GetStringProperty(sPropertyDataTableName, rPropSet)); - ProcessString(sXML_condition, + ProcessString(XML_CONDITION, GetStringProperty(sPropertyCondition, rPropSet)); - ProcessInteger(sXML_row_number, + ProcessInteger(XML_ROW_NUMBER, GetIntProperty(sPropertySetNumber, rPropSet)); DBG_ASSERT(sPresentation.equals(sEmpty), "Unexpected presentation for database select field"); - ExportElement(sXML_database_select); + ExportElement(XML_DATABASE_SELECT); break; case FIELD_ID_DATABASE_DISPLAY: { // get database, table and column name from field master Reference<XPropertySet> & xMaster = GetMasterPropertySet(rTextField); - ProcessString(sXML_database_name, + ProcessString(XML_DATABASE_NAME, GetStringProperty(sPropertyDataBaseName, xMaster)); - ProcessString(sXML_table_name, + ProcessString(XML_TABLE_NAME, GetStringProperty(sPropertyDataTableName, xMaster)); - ProcessString(sXML_column_name, + ProcessString(XML_COLUMN_NAME, GetStringProperty(sPropertyDataColumnName, xMaster)); // export number format if available (happens only for numbers!) if (!GetBoolProperty(sPropertyIsDataBaseFormat, rPropSet)) @@ -1388,12 +1388,12 @@ void XMLTextFieldExport::ExportFieldHelper( sEmpty, sEmpty, 0.0, // not used sal_False, sal_False, sal_True); } - ExportElement(sXML_database_display, sPresentation); + ExportElement(XML_DATABASE_DISPLAY, sPresentation); break; } case FIELD_ID_DOCINFO_REVISION: - ProcessBoolean(sXML_fixed, + ProcessBoolean(XML_FIXED, GetBoolProperty(sPropertyIsFixed, rPropSet), sal_False); ExportElement(MapDocInfoFieldName(nToken), sPresentation); break; @@ -1410,7 +1410,7 @@ void XMLTextFieldExport::ExportFieldHelper( sEmpty, sEmpty, 0.0, sal_False, sal_False, sal_True); // todo: export date/time value, but values not available -> core bug - ProcessBoolean(sXML_fixed, + ProcessBoolean(XML_FIXED, GetBoolProperty(sPropertyIsFixed, rPropSet), sal_False); ExportElement(MapDocInfoFieldName(nToken), sPresentation); break; @@ -1424,7 +1424,7 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_DOCINFO_SAVE_AUTHOR: if (xPropSetInfo->hasPropertyByName(sPropertyIsFixed)) { - ProcessBoolean(sXML_fixed, + ProcessBoolean(XML_FIXED, GetBoolProperty(sPropertyIsFixed, rPropSet), sal_False); } ExportElement(MapDocInfoFieldName(nToken), sPresentation); @@ -1439,12 +1439,12 @@ void XMLTextFieldExport::ExportFieldHelper( GetExport().GetModel(), UNO_QUERY); Reference<XDocumentInfo> xDocInfo =xDocInfoSupplier->getDocumentInfo(); Any aAny; - ProcessString(sXML_name, + ProcessString(XML_NAME, xDocInfo->getUserFieldName(nToken - FIELD_ID_DOCINFO_INFORMATION0)); - ProcessBoolean(sXML_fixed, + ProcessBoolean(XML_FIXED, GetBoolProperty(sPropertyIsFixed, rPropSet), sal_False); - ExportElement(sXML_user_defined, sPresentation); + ExportElement(XML_USER_DEFINED, sPresentation); break; } @@ -1466,106 +1466,106 @@ void XMLTextFieldExport::ExportFieldHelper( break; case FIELD_ID_CONDITIONAL_TEXT: - ProcessString(sXML_condition, + ProcessString(XML_CONDITION, GetStringProperty(sPropertyCondition, rPropSet)); - ProcessString(sXML_string_value_if_true, + ProcessString(XML_STRING_VALUE_IF_TRUE, GetStringProperty(sPropertyTrueContent, rPropSet)); - ProcessString(sXML_string_value_if_false, + ProcessString(XML_STRING_VALUE_IF_FALSE, GetStringProperty(sPropertyFalseContent, rPropSet)); - ProcessBoolean(sXML_current_value, + ProcessBoolean(XML_CURRENT_VALUE, GetBoolProperty(sPropertyIsConditionTrue, rPropSet), sal_False); - ExportElement(sXML_conditional_text, sPresentation); + ExportElement(XML_CONDITIONAL_TEXT, sPresentation); break; case FIELD_ID_HIDDEN_TEXT: - ProcessString(sXML_condition, + ProcessString(XML_CONDITION, GetStringProperty(sPropertyCondition, rPropSet)); - ProcessString(sXML_string_value, + ProcessString(XML_STRING_VALUE, GetStringProperty(sPropertyContent, rPropSet)); - ProcessBoolean(sXML_is_hidden, + ProcessBoolean(XML_IS_HIDDEN, GetBoolProperty(sPropertyIsHidden, rPropSet), sal_False); - ExportElement(sXML_hidden_text, sPresentation); + ExportElement(XML_HIDDEN_TEXT, sPresentation); break; case FIELD_ID_HIDDEN_PARAGRAPH: - ProcessString(sXML_condition, + ProcessString(XML_CONDITION, GetStringProperty(sPropertyCondition, rPropSet)); - ProcessBoolean(sXML_is_hidden, + ProcessBoolean(XML_IS_HIDDEN, GetBoolProperty(sPropertyIsHidden, rPropSet), sal_False); DBG_ASSERT(sPresentation.equals(sEmpty), "Unexpected presentation for hidden paragraph field"); - ExportElement(sXML_hidden_paragraph); + ExportElement(XML_HIDDEN_PARAGRAPH); break; case FIELD_ID_TEMPLATE_NAME: - ProcessString(sXML_display, + ProcessString(XML_DISPLAY, MapTemplateDisplayFormat( GetInt16Property(sPropertyFileFormat, rPropSet))); - ExportElement(sXML_template_name, sPresentation); + ExportElement(XML_TEMPLATE_NAME, sPresentation); break; case FIELD_ID_CHAPTER: - ProcessString(sXML_display, + ProcessString(XML_DISPLAY, MapChapterDisplayFormat( GetInt16Property(sPropertyChapterFormat, rPropSet))); // API numbers 0..9, we number 1..10 - ProcessInteger(sXML_outline_level, + ProcessInteger(XML_OUTLINE_LEVEL, GetInt8Property(sPropertyLevel, rPropSet) + 1); - ExportElement(sXML_chapter, sPresentation); + ExportElement(XML_CHAPTER, sPresentation); break; case FIELD_ID_FILE_NAME: // all properties are optional if (xPropSetInfo->hasPropertyByName(sPropertyFileFormat)) { - ProcessString(sXML_display, + ProcessString(XML_DISPLAY, MapFilenameDisplayFormat( GetInt16Property(sPropertyFileFormat, rPropSet))); } if (xPropSetInfo->hasPropertyByName(sPropertyIsFixed)) { - ProcessBoolean(sXML_fixed, + ProcessBoolean(XML_FIXED, GetBoolProperty(sPropertyIsFixed, rPropSet), sal_False); } - ExportElement(sXML_file_name, sPresentation); + ExportElement(XML_FILE_NAME, sPresentation); break; case FIELD_ID_REFPAGE_SET: - ProcessBoolean(sXML_active, + ProcessBoolean(XML_ACTIVE, GetBoolProperty(sPropertyOn, rPropSet), sal_True); - ProcessInteger(sXML_page_adjust, + ProcessInteger(XML_PAGE_ADJUST, GetInt16Property(sPropertyOffset, rPropSet), 0); DBG_ASSERT(sPresentation.equals(sEmpty), "Unexpected presentation page variable field"); - ExportElement(sXML_page_variable_set); + ExportElement(XML_PAGE_VARIABLE_SET); break; case FIELD_ID_REFPAGE_GET: ProcessNumberingType( GetInt16Property(sPropertyNumberingType, rPropSet)); - ExportElement(sXML_page_variable_get, sPresentation); + ExportElement(XML_PAGE_VARIABLE_GET, sPresentation); break; case FIELD_ID_MACRO: - ProcessString(sXML_name, GetStringProperty(sPropertyMacro, rPropSet)); - ProcessString(sXML_description, + ProcessString(XML_NAME, GetStringProperty(sPropertyMacro, rPropSet)); + ProcessString(XML_DESCRIPTION, GetStringProperty(sPropertyHint, rPropSet), sPresentation); - ExportElement(sXML_execute_macro, sPresentation); + ExportElement(XML_EXECUTE_MACRO, sPresentation); break; case FIELD_ID_REF_SEQUENCE: // reference to sequence: format, name, find value (and element) // was: if (nSeqNumber != -1) ... - ProcessString(sXML_reference_format, + ProcessString(XML_REFERENCE_FORMAT, MapReferenceType(GetInt16Property( sPropertyReferenceFieldPart, rPropSet)), - sXML_template); - ProcessString(sXML_ref_name, + XML_TEMPLATE); + ProcessString(XML_REF_NAME, MakeSequenceRefName( GetInt16Property(sPropertySequenceNumber, rPropSet), GetStringProperty(sPropertySourceName, rPropSet) ) ); @@ -1578,11 +1578,11 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_REF_REFERENCE: case FIELD_ID_REF_BOOKMARK: // reference to bookmarks, references: format, name (and element) - ProcessString(sXML_reference_format, + ProcessString(XML_REFERENCE_FORMAT, MapReferenceType(GetInt16Property( sPropertyReferenceFieldPart, rPropSet)), - sXML_template); - ProcessString(sXML_ref_name, + XML_TEMPLATE); + ProcessString(XML_REF_NAME, GetStringProperty(sPropertySourceName, rPropSet)); ExportElement( MapReferenceSource(GetInt16Property( @@ -1593,11 +1593,11 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_REF_FOOTNOTE: case FIELD_ID_REF_ENDNOTE: // reference to end-/footnote: format, generate name, (and element) - ProcessString(sXML_reference_format, + ProcessString(XML_REFERENCE_FORMAT, MapReferenceType(GetInt16Property( sPropertyReferenceFieldPart, rPropSet)), - sXML_template); - ProcessString(sXML_ref_name, + XML_TEMPLATE); + ProcessString(XML_REF_NAME, MakeFootnoteRefName(GetInt16Property( sPropertySequenceNumber, rPropSet))); ExportElement( @@ -1608,28 +1608,28 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_DDE: // name from field master - ProcessString(sXML_connection_name, + ProcessString(XML_CONNECTION_NAME, GetStringProperty(sPropertyName, GetMasterPropertySet(rTextField))); - ExportElement(sXML_dde_connection, sPresentation); + ExportElement(XML_DDE_CONNECTION, sPresentation); break; case FIELD_ID_SHEET_NAME: // name of spreadsheet (Calc only) - ExportElement(sXML_sheet_name, sPresentation); + ExportElement(XML_SHEET_NAME, sPresentation); break; case FIELD_ID_URL: { // this field is a special case because it gets mapped onto a // hyperlink, rather than one of the regular text field. - ProcessString(sXML_href, GetExport().GetRelativeReference(GetStringProperty(sPropertyURL, rPropSet)), + ProcessString(XML_HREF, GetExport().GetRelativeReference(GetStringProperty(sPropertyURL, rPropSet)), sal_True, XML_NAMESPACE_XLINK); - ProcessString(sXML_target_frame_name, + ProcessString(XML_TARGET_FRAME_NAME, GetStringProperty(sPropertyTargetFrame,rPropSet), sal_True, XML_NAMESPACE_OFFICE); - SvXMLElementExport aUrlField(rExport, XML_NAMESPACE_TEXT, sXML_a, + SvXMLElementExport aUrlField(rExport, XML_NAMESPACE_TEXT, XML_A, sal_False, sal_False); GetExport().GetDocHandler()->characters(sPresentation); break; @@ -1638,26 +1638,26 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_BIBLIOGRAPHY: { ProcessBibliographyData(rPropSet); - ExportElement(sXML_bibliography_mark, sPresentation); + ExportElement(XML_BIBLIOGRAPHY_MARK, sPresentation); break; } case FIELD_ID_SCRIPT: - ProcessString(sXML_language, + ProcessString(XML_LANGUAGE, GetStringProperty(sPropertyScriptType, rPropSet), sal_True, XML_NAMESPACE_SCRIPT); DBG_ASSERT(sPresentation.equals(sEmpty), "Unexpected presentation for script field"); if (GetBoolProperty(sPropertyURLContent, rPropSet)) { - ProcessString(sXML_href, + ProcessString(XML_HREF, GetExport().GetRelativeReference(GetStringProperty(sPropertyContent, rPropSet)), sal_False, XML_NAMESPACE_XLINK); - ExportElement(sXML_script); + ExportElement(XML_SCRIPT); } else { - ExportElement(sXML_script, + ExportElement(XML_SCRIPT, GetStringProperty(sPropertyContent, rPropSet)); } break; @@ -1665,12 +1665,12 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_ANNOTATION: { // author - ProcessString(sXML_author, + ProcessString(XML_AUTHOR, GetStringProperty(sPropertyAuthor, rPropSet), sal_True, XML_NAMESPACE_OFFICE); // date time - ProcessDate(sXML_create_date, + ProcessDate(XML_CREATE_DATE, GetDateProperty(sPropertyDate, rPropSet), XML_NAMESPACE_OFFICE); @@ -1680,7 +1680,7 @@ void XMLTextFieldExport::ExportFieldHelper( // annotation element + content SvXMLElementExport aElem(GetExport(), XML_NAMESPACE_OFFICE, - sXML_annotation, sal_False, sal_True); + XML_ANNOTATION, sal_False, sal_True); ProcessParagraphSequence(GetStringProperty(sPropertyContent,rPropSet)); break; } @@ -1689,18 +1689,18 @@ void XMLTextFieldExport::ExportFieldHelper( { // get style name for current style + combine letters and export a span const XMLPropertyState *aStates[] = { pCombinedCharactersPropertyState, 0 }; - ProcessString(sXML_style_name, + ProcessString(XML_STYLE_NAME, GetExport().GetTextParagraphExport()->Find( XML_STYLE_FAMILY_TEXT_TEXT, rRangePropSet, sEmpty, aStates) ); - ExportElement(sXML_span, sPresentation); + ExportElement(XML_SPAN, sPresentation); break; } case FIELD_ID_MEASURE: { - ProcessString(sXML_kind, MapMeasureKind(GetInt16Property(sPropertyMeasureKind, rPropSet))); - ExportElement( sXML_measure, sPresentation ); + ProcessString(XML_KIND, MapMeasureKind(GetInt16Property(sPropertyMeasureKind, rPropSet))); + ExportElement( XML_MEASURE, sPresentation ); break; } @@ -1840,7 +1840,7 @@ void XMLTextFieldExport::ExportFieldDeclarations( { SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, - sXML_variable_decls, + XML_VARIABLE_DECLS, sal_True, sal_True ); for (vector<OUString>::iterator aVarIter = aVarName.begin(); @@ -1888,8 +1888,8 @@ void XMLTextFieldExport::ExportFieldDeclarations( sal_False, sal_True, sal_False); } - ProcessString(sXML_name, sVarName); - ExportElement(sXML_variable_decl, sal_True); + ProcessString(XML_NAME, sVarName); + ExportElement(XML_VARIABLE_DECL, sal_True); } } // else: no declarations element @@ -1899,7 +1899,7 @@ void XMLTextFieldExport::ExportFieldDeclarations( { SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, - sXML_sequence_decls, + XML_SEQUENCE_DECLS, sal_True, sal_True ); for (vector<OUString>::iterator aSeqIter = aSeqName.begin(); @@ -1923,15 +1923,15 @@ void XMLTextFieldExport::ExportFieldDeclarations( sPropertyChapterNumberingLevel, xPropSet); DBG_ASSERT(nLevel >= 0, "illegal outline level"); DBG_ASSERT(nLevel < 127, "possible illegal outline level"); - ProcessInteger(sXML_display_outline_level, nLevel); + ProcessInteger(XML_DISPLAY_OUTLINE_LEVEL, nLevel); // separation character if (nLevel > 0) { - ProcessString(sXML_separation_character, GetStringProperty( + ProcessString(XML_SEPARATION_CHARACTER, GetStringProperty( sPropertyNumberingSeparator, xPropSet)); } - ProcessString(sXML_name, sVarName); - ExportElement(sXML_sequence_decl, sal_True); + ProcessString(XML_NAME, sVarName); + ExportElement(XML_SEQUENCE_DECL, sal_True); } } // else: no declarations element @@ -1941,7 +1941,7 @@ void XMLTextFieldExport::ExportFieldDeclarations( { SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, - sXML_user_field_decls, + XML_USER_FIELD_DECLS, sal_True, sal_True ); for (vector<OUString>::iterator aUserIter = aUserName.begin(); @@ -1974,12 +1974,12 @@ void XMLTextFieldExport::ExportFieldDeclarations( else { // string: write regardless of default - ProcessString(sXML_value_type, sXML_string); - ProcessString(sXML_string_value, + ProcessString(XML_VALUE_TYPE, XML_STRING); + ProcessString(XML_STRING_VALUE, GetStringProperty(sPropertyContent, xPropSet)); } - ProcessString(sXML_name, sVarName); - ExportElement(sXML_user_field_decl, sal_True); + ProcessString(XML_NAME, sVarName); + ExportElement(XML_USER_FIELD_DECL, sal_True); } } // else: no declarations element @@ -1989,7 +1989,7 @@ void XMLTextFieldExport::ExportFieldDeclarations( { SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, - sXML_dde_connection_decls, + XML_DDE_CONNECTION_DECLS, sal_True, sal_True ); for (vector<OUString>::iterator aDdeIter = aDdeName.begin(); @@ -2008,20 +2008,20 @@ void XMLTextFieldExport::ExportFieldDeclarations( if (GetDependentFieldPropertySet(xPropSet, xDummy)) { - ProcessString(sXML_name, + ProcessString(XML_NAME, GetStringProperty(sPropertyName, xPropSet)); // export elements; can't use ProcessString because // elements are in office namespace - ProcessString(sXML_dde_application, + ProcessString(XML_DDE_APPLICATION, GetStringProperty(sPropertyDDECommandType, xPropSet), sal_False, XML_NAMESPACE_OFFICE); - ProcessString(sXML_dde_topic, + ProcessString(XML_DDE_TOPIC, GetStringProperty(sPropertyDDECommandFile, xPropSet), sal_False, XML_NAMESPACE_OFFICE); - ProcessString(sXML_dde_item, + ProcessString(XML_DDE_ITEM, GetStringProperty(sPropertyDDECommandElement, xPropSet), sal_False, XML_NAMESPACE_OFFICE); @@ -2029,12 +2029,12 @@ void XMLTextFieldExport::ExportFieldDeclarations( sPropertyIsAutomaticUpdate, xPropSet); if (bIsAutomaticUpdate) { - GetExport().AddAttributeASCII(XML_NAMESPACE_OFFICE, - sXML_automatic_update, - sXML_true); + GetExport().AddAttribute(XML_NAMESPACE_OFFICE, + XML_AUTOMATIC_UPDATE, + XML_TRUE); } - ExportElement(sXML_dde_connection_decl, sal_True); + ExportElement(XML_DDE_CONNECTION_DECL, sal_True); } // else: no dependent field -> no export of field declaration } @@ -2053,36 +2053,32 @@ void XMLTextFieldExport::SetExportOnlyUsedFieldDeclarations( pUsedMasters = new map<Reference<XText>, set<OUString> > ; } -void XMLTextFieldExport::ExportElement(const sal_Char* pElementName, +void XMLTextFieldExport::ExportElement(enum XMLTokenEnum eElementName, sal_Bool bAddSpace) { - // can't call ExportElement(sal_Char*, const OUString&) with empty + // can't call ExportElement(eElementName, const OUString&) with empty // string because xmlprinter only uses empty tags if no content // (not even empty content) was written. - DBG_ASSERT(NULL != pElementName, "invalid element name!"); - if (NULL != pElementName) + DBG_ASSERT(XML_TOKEN_INVALID != eElementName, "invalid element name!"); + if (XML_TOKEN_INVALID != eElementName) { // Element - SvXMLElementExport aElem( GetExport(), - XML_NAMESPACE_TEXT, - pElementName, - bAddSpace, bAddSpace ); + SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, + eElementName, bAddSpace, bAddSpace ); } // else: ignore } -void XMLTextFieldExport::ExportElement(const sal_Char* pElementName, +void XMLTextFieldExport::ExportElement(enum XMLTokenEnum eElementName, const OUString& sContent, sal_Bool bAddSpace) { - DBG_ASSERT(NULL != pElementName, "invalid element name!"); - if (NULL != pElementName) + DBG_ASSERT(eElementName != XML_TOKEN_INVALID, "invalid element name!"); + if (eElementName != XML_TOKEN_INVALID) { // Element - SvXMLElementExport aElem( GetExport(), - XML_NAMESPACE_TEXT, - pElementName, - bAddSpace, bAddSpace ); + SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, + eElementName, bAddSpace, bAddSpace ); // export content GetExport().GetDocHandler()->characters(sContent); } else { @@ -2144,7 +2140,7 @@ void XMLTextFieldExport::ProcessValueAndType( if( sDataStyleName.getLength() > 0 ) { GetExport().AddAttribute( XML_NAMESPACE_STYLE, - sXML_data_style_name, + XML_DATA_STYLE_NAME, sDataStyleName ); } // else: ignore (no valid number format) } // else: ignore (no number format) @@ -2159,43 +2155,39 @@ void XMLTextFieldExport::ProcessDisplay(sal_Bool bIsVisible, sal_Bool bIsCommand, sal_Bool bValueDefault) { - sal_Char* pValue; + enum XMLTokenEnum eValue; if (bIsVisible) { - pValue = bIsCommand ? sXML_formula : sXML_value; + eValue = bIsCommand ? XML_FORMULA : XML_VALUE; } else { - pValue = sXML_none; + eValue = XML_NONE; } // omit attribute if default - if (!bValueDefault || (pValue != sXML_value)) + if (!bValueDefault || (eValue != XML_VALUE)) { - GetExport().AddAttributeASCII(XML_NAMESPACE_TEXT, - sXML_display, - pValue); + GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_DISPLAY, eValue); } } /// export boolean property -void XMLTextFieldExport::ProcessBoolean(const sal_Char* pXmlName, +void XMLTextFieldExport::ProcessBoolean(enum XMLTokenEnum eName, sal_Bool bBool, sal_Bool bDefault) { - DBG_ASSERT(NULL!=pXmlName, "invalid element name"); - if (NULL == pXmlName) { + DBG_ASSERT( eName != XML_TOKEN_INVALID, "invalid element token"); + if ( XML_TOKEN_INVALID == eName ) return; - } // write attribute (if different than default) // negate to force 0/1 values (and make sal_Bool comparable) if ((!bBool) != (!bDefault)) { - GetExport().AddAttributeASCII(XML_NAMESPACE_TEXT, - pXmlName, - (bBool ? sXML_true : sXML_false) ); + GetExport().AddAttribute(XML_NAMESPACE_TEXT, eName, + (bBool ? XML_TRUE : XML_FALSE) ); } } @@ -2203,72 +2195,65 @@ void XMLTextFieldExport::ProcessBoolean(const sal_Char* pXmlName, /// export string attribute -void XMLTextFieldExport::ProcessString(const sal_Char* pXmlName, +void XMLTextFieldExport::ProcessString(enum XMLTokenEnum eName, const OUString& sValue, sal_Bool bOmitEmpty, sal_uInt16 nPrefix) { - DBG_ASSERT(NULL!=pXmlName, "invalid element name"); - if (NULL == pXmlName) { + DBG_ASSERT( eName != XML_TOKEN_INVALID, "invalid element token"); + if ( XML_TOKEN_INVALID == eName ) return; - } // check for empty string, if applicable - if (bOmitEmpty && (sValue.getLength()==0)) { + if ( bOmitEmpty && (sValue.getLength()==0) ) return; - } // write attribute - GetExport().AddAttribute(nPrefix, pXmlName, sValue); + GetExport().AddAttribute(nPrefix, eName, sValue); } /// export a string attribute -void XMLTextFieldExport::ProcessString(const sal_Char* pXmlName, +void XMLTextFieldExport::ProcessString(enum XMLTokenEnum eName, const ::rtl::OUString& sValue, const ::rtl::OUString& sDefault, sal_uInt16 nPrefix) { if (sValue != sDefault) { - ProcessString(pXmlName, sValue, sal_False, nPrefix); + ProcessString(eName, sValue, sal_False, nPrefix); } } /// export string attribute void XMLTextFieldExport::ProcessString( - const sal_Char* pXmlName, - const sal_Char* pValue, + enum XMLTokenEnum eName, + enum XMLTokenEnum eValue, sal_Bool bOmitEmpty, sal_uInt16 nPrefix) { - DBG_ASSERT(NULL != pXmlName, "invalid element name"); - DBG_ASSERT(NULL != pValue, "invalid value name"); - if ((NULL == pXmlName) || (NULL == pValue)) { + DBG_ASSERT( eName != XML_TOKEN_INVALID, "invalid element token" ); + DBG_ASSERT( bOmitEmpty || (eValue != XML_TOKEN_INVALID), + "invalid value token" ); + if ( XML_TOKEN_INVALID == eName ) return; - } // check for empty string, if applicable - if (bOmitEmpty && (0 == pValue[0])) { + if (bOmitEmpty && (eValue == XML_TOKEN_INVALID)) return; - } - GetExport().AddAttributeASCII(XML_NAMESPACE_TEXT, pXmlName, pValue); + GetExport().AddAttribute(XML_NAMESPACE_TEXT, eName, eValue); } /// export a string attribute void XMLTextFieldExport::ProcessString( - const sal_Char* pXmlName, - const sal_Char* pValue, - const sal_Char* pDefault, + enum XMLTokenEnum eName, + enum XMLTokenEnum eValue, + enum XMLTokenEnum eDefault, sal_uInt16 nPrefix) { - // save comparisons if pointers are equals. This will happen - // frequently, as almost every code in here uses sXML_* constants. - if ((pValue != pDefault) && (0 != strcmp(pValue, pDefault))) - { - ProcessString(pXmlName, pValue, sal_False, nPrefix); - } + if ( eValue != eDefault ) + ProcessString( eName, eValue, sal_False, nPrefix); } @@ -2283,33 +2268,29 @@ void XMLTextFieldExport::ProcessParagraphSequence( while (aEnumerator.getNextToken(aSubString)) { SvXMLElementExport aParagraph( - GetExport(), XML_NAMESPACE_TEXT, sXML_p, sal_True, sal_False); + GetExport(), XML_NAMESPACE_TEXT, XML_P, sal_True, sal_False); GetExport().GetDocHandler()->characters(aSubString); } } // export an integer attribute -void XMLTextFieldExport::ProcessInteger(const sal_Char* pXmlName, +void XMLTextFieldExport::ProcessInteger(enum XMLTokenEnum eName, sal_Int32 nNum) { - DBG_ASSERT(NULL != pXmlName, "invalid element name"); - - if (NULL == pXmlName) { + DBG_ASSERT( eName != XML_TOKEN_INVALID, "invalid element token"); + if ( XML_TOKEN_INVALID == eName ) return; - } - GetExport().AddAttribute(XML_NAMESPACE_TEXT, pXmlName, + GetExport().AddAttribute(XML_NAMESPACE_TEXT, eName, OUString::valueOf(nNum)); } /// export an integer attribute, omit if default -void XMLTextFieldExport::ProcessInteger(const sal_Char* pXmlName, +void XMLTextFieldExport::ProcessInteger(enum XMLTokenEnum eName, sal_Int32 nNum, sal_Int32 nDefault) { if (nNum != nDefault) - { - ProcessInteger(pXmlName, nNum); - } + ProcessInteger(eName, nNum); } @@ -2324,8 +2305,7 @@ void XMLTextFieldExport::ProcessNumberingType(sal_Int16 nNumberingType) // number type: num format GetExport().GetMM100UnitConverter().convertNumFormat( sTmp, nNumberingType ); - GetExport().AddAttribute(XML_NAMESPACE_STYLE, - sXML_num_format, + GetExport().AddAttribute(XML_NAMESPACE_STYLE, XML_NUM_FORMAT, sTmp.makeStringAndClear() ); // and letter sync, if applicable GetExport().GetMM100UnitConverter().convertNumLetterSync( sTmp, @@ -2333,9 +2313,8 @@ void XMLTextFieldExport::ProcessNumberingType(sal_Int16 nNumberingType) if (sTmp.getLength()) { - GetExport().AddAttribute(XML_NAMESPACE_STYLE, - sXML_num_letter_sync, - sTmp.makeStringAndClear() ); + GetExport().AddAttribute(XML_NAMESPACE_STYLE, XML_NUM_LETTER_SYNC, + sTmp.makeStringAndClear() ); } } // else: like page descriptor => ignore @@ -2343,7 +2322,7 @@ void XMLTextFieldExport::ProcessNumberingType(sal_Int16 nNumberingType) /// export a date, time, or duration -void XMLTextFieldExport::ProcessDateTime(const sal_Char* sXMLName, +void XMLTextFieldExport::ProcessDateTime(enum XMLTokenEnum eName, double dValue, sal_Bool bIsDate, sal_Bool bIsDuration, @@ -2372,11 +2351,11 @@ void XMLTextFieldExport::ProcessDateTime(const sal_Char* sXMLName, } // output attribute - ProcessString(sXMLName, aBuffer.makeStringAndClear(), sal_True, nPrefix); + ProcessString(eName, aBuffer.makeStringAndClear(), sal_True, nPrefix); } /// export a date or time -void XMLTextFieldExport::ProcessDateTime(const sal_Char* sXMLName, +void XMLTextFieldExport::ProcessDateTime(enum XMLTokenEnum eName, const DateTime& rTime, sal_Bool bIsDate, sal_uInt16 nPrefix) @@ -2398,12 +2377,12 @@ void XMLTextFieldExport::ProcessDateTime(const sal_Char* sXMLName, rExport.GetMM100UnitConverter().convertDateTime(aBuffer, aDateTime); // output attribute - ProcessString(sXMLName, aBuffer.makeStringAndClear(), sal_True, nPrefix); + ProcessString(eName, aBuffer.makeStringAndClear(), sal_True, nPrefix); } /// export date according to ISO 8601 void XMLTextFieldExport::ProcessDate( - const sal_Char* sXMLName, + enum XMLTokenEnum eName, const ::com::sun::star::util::Date& rDate, sal_uInt16 nPrefix) { @@ -2412,12 +2391,12 @@ void XMLTextFieldExport::ProcessDate( aDateTime.Day = rDate.Day; aDateTime.Month = rDate.Month; aDateTime.Year = rDate.Year; - ProcessDateTime(sXMLName, aDateTime, sal_True, nPrefix); + ProcessDateTime(eName, aDateTime, sal_True, nPrefix); } /// export a date, time, or duration -void XMLTextFieldExport::ProcessDateTime(const sal_Char* sXMLName, +void XMLTextFieldExport::ProcessDateTime(enum XMLTokenEnum eName, sal_Int32 nMinutes, sal_Bool bIsDate, sal_Bool bIsDuration, @@ -2427,7 +2406,7 @@ void XMLTextFieldExport::ProcessDateTime(const sal_Char* sXMLName, // handle bOmitDurationIfZero here, because we can precisely compare ints if (!(bIsDuration && bOmitDurationIfZero && (nMinutes==0))) { - ProcessDateTime(sXMLName, (double)nMinutes / (double)(24*60), + ProcessDateTime(eName, (double)nMinutes / (double)(24*60), bIsDate, bIsDuration, bOmitDurationIfZero, nPrefix); } } @@ -2485,7 +2464,7 @@ void XMLTextFieldExport::ProcessBibliographyData( aBibliographyDataTypeMap)) { rExport.AddAttribute(XML_NAMESPACE_TEXT, - sXML_bibiliographic_type, + XML_BIBILIOGRAPHIC_TYPE, sBuf.makeStringAndClear()); } // else: ignore this argument @@ -2570,54 +2549,55 @@ sal_Bool XMLTextFieldExport::GetDependentFieldPropertySet( /// map placeholder type -const sal_Char* XMLTextFieldExport::MapPlaceholderType(sal_uInt16 nType) +enum XMLTokenEnum XMLTextFieldExport::MapPlaceholderType(sal_uInt16 nType) { - sal_Char* pTypeString = sXML_text; + enum XMLTokenEnum eType = XML_TEXT; - switch (nType) { - case PlaceholderType::TEXT: - pTypeString = sXML_text; - break; + switch (nType) + { + case PlaceholderType::TEXT: + eType = XML_TEXT; + break; - case PlaceholderType::TABLE: - pTypeString = sXML_table; - break; + case PlaceholderType::TABLE: + eType = XML_TABLE; + break; - case PlaceholderType::TEXTFRAME: - pTypeString = sXML_text_box; - break; + case PlaceholderType::TEXTFRAME: + eType = XML_TEXT_BOX; + break; - case PlaceholderType::GRAPHIC: - pTypeString = sXML_image; - break; + case PlaceholderType::GRAPHIC: + eType = XML_IMAGE; + break; - case PlaceholderType::OBJECT: - pTypeString = sXML_object; - break; + case PlaceholderType::OBJECT: + eType = XML_OBJECT; + break; - default: - // unkown placeholder: sXML_text - DBG_ERROR("unkown placeholder type"); + default: + // unkown placeholder: XML_TEXT + DBG_ERROR("unkown placeholder type"); } - return pTypeString; + return eType; } /// element name for author fields -const sal_Char* XMLTextFieldExport::MapAuthorFieldName( +enum XMLTokenEnum XMLTextFieldExport::MapAuthorFieldName( const Reference<XPropertySet> & xPropSet) { // Initalen oder voller Name? return GetBoolProperty(sPropertyFullName, xPropSet) - ? sXML_author_name : sXML_author_initials; + ? XML_AUTHOR_NAME : XML_AUTHOR_INITIALS; } -const sal_Char* XMLTextFieldExport::MapPageNumberName( +enum XMLTokenEnum XMLTextFieldExport::MapPageNumberName( const Reference<XPropertySet> & xPropSet, sal_Int32& nOffset) { - sal_Char* pName = NULL; + enum XMLTokenEnum eName = XML_TOKEN_INVALID; PageNumberType ePage; Any aAny = xPropSet->getPropertyValue(sPropertySubType); ePage = *(PageNumberType*)aAny.getValue(); @@ -2625,512 +2605,512 @@ const sal_Char* XMLTextFieldExport::MapPageNumberName( switch (ePage) { case PageNumberType_PREV: - pName = sXML_previous; + eName = XML_PREVIOUS; nOffset += 1; break; case PageNumberType_CURRENT: - pName = sXML_current; + eName = XML_CURRENT; break; case PageNumberType_NEXT: - pName = sXML_next; + eName = XML_NEXT; nOffset -= 1; break; default: DBG_ERROR("unknown page number type"); - pName = NULL; + eName = XML_TOKEN_INVALID; break; } - return pName; + return eName; } /// map TemplateDisplayFormat to XML -const sal_Char* XMLTextFieldExport::MapTemplateDisplayFormat(sal_Int16 nFormat) +enum XMLTokenEnum XMLTextFieldExport::MapTemplateDisplayFormat(sal_Int16 nFormat) { - sal_Char* pName = NULL; + enum XMLTokenEnum eName = XML_TOKEN_INVALID; switch (nFormat) { case TemplateDisplayFormat::FULL: - pName = sXML_full; + eName = XML_FULL; break; case TemplateDisplayFormat::PATH: - pName = sXML_path; + eName = XML_PATH; break; case TemplateDisplayFormat::NAME: - pName = sXML_name; + eName = XML_NAME; break; case TemplateDisplayFormat::NAME_AND_EXT: - pName = sXML_name_and_extension; + eName = XML_NAME_AND_EXTENSION; break; case TemplateDisplayFormat::AREA: - pName = sXML_area; + eName = XML_AREA; break; case TemplateDisplayFormat::TITLE: - pName = sXML_title; + eName = XML_TITLE; break; default: DBG_ERROR("unknown template display format"); - pName = NULL; + eName = XML_TOKEN_INVALID; break; } - return pName; + return eName; } /// map count/statistics field token to XML name -const sal_Char* XMLTextFieldExport::MapCountFieldName(sal_Int16 nToken) +enum XMLTokenEnum XMLTextFieldExport::MapCountFieldName(sal_Int16 nToken) { - const sal_Char* pElementName = NULL; + enum XMLTokenEnum eElement = XML_TOKEN_INVALID; switch (nToken) { case FIELD_ID_COUNT_PAGES: - pElementName = sXML_page_count; + eElement = XML_PAGE_COUNT; break; case FIELD_ID_COUNT_PARAGRAPHS: - pElementName = sXML_paragraph_count; + eElement = XML_PARAGRAPH_COUNT; break; case FIELD_ID_COUNT_WORDS: - pElementName = sXML_word_count; + eElement = XML_WORD_COUNT; break; case FIELD_ID_COUNT_CHARACTERS: - pElementName = sXML_character_count; + eElement = XML_CHARACTER_COUNT; break; case FIELD_ID_COUNT_TABLES: - pElementName = sXML_table_count; + eElement = XML_TABLE_COUNT; break; case FIELD_ID_COUNT_GRAPHICS: - pElementName = sXML_image_count; + eElement = XML_IMAGE_COUNT; break; case FIELD_ID_COUNT_OBJECTS: - pElementName = sXML_object_count; + eElement = XML_OBJECT_COUNT; break; default: DBG_ERROR("no count field token"); - pElementName = NULL; + eElement = XML_TOKEN_INVALID; break; } - return pElementName; + return eElement; } /// map ChapterDisplayFormat to XML string -const sal_Char* XMLTextFieldExport::MapChapterDisplayFormat(sal_Int16 nFormat) +enum XMLTokenEnum XMLTextFieldExport::MapChapterDisplayFormat(sal_Int16 nFormat) { - const sal_Char* pName = NULL; + enum XMLTokenEnum eName = XML_TOKEN_INVALID; switch (nFormat) { case ChapterFormat::NAME: - pName = sXML_name; + eName = XML_NAME; break; case ChapterFormat::NUMBER: - pName = sXML_number; + eName = XML_NUMBER; break; case ChapterFormat::NAME_NUMBER: - pName = sXML_number_and_name; + eName = XML_NUMBER_AND_NAME; break; case ChapterFormat::NO_PREFIX_SUFFIX: - pName = sXML_plain_number_and_name; + eName = XML_PLAIN_NUMBER_AND_NAME; break; case ChapterFormat::DIGIT: - pName = sXML_plain_number; + eName = XML_PLAIN_NUMBER; break; default: DBG_ERROR("unkown chapter display format"); - pName = NULL; + eName = XML_TOKEN_INVALID; break; } - return pName; + return eName; } /// map FilenameDisplayFormat to XML attribute names -const sal_Char* XMLTextFieldExport::MapFilenameDisplayFormat(sal_Int16 nFormat) +enum XMLTokenEnum XMLTextFieldExport::MapFilenameDisplayFormat(sal_Int16 nFormat) { - sal_Char* pName = NULL; + enum XMLTokenEnum eName = XML_TOKEN_INVALID; switch (nFormat) { case FilenameDisplayFormat::FULL: - pName = sXML_full; + eName = XML_FULL; break; case FilenameDisplayFormat::PATH: - pName = sXML_path; + eName = XML_PATH; break; case FilenameDisplayFormat::NAME: - pName = sXML_name; + eName = XML_NAME; break; case FilenameDisplayFormat::NAME_AND_EXT: - pName = sXML_name_and_extension; + eName = XML_NAME_AND_EXTENSION; break; default: DBG_ERROR("unknown filename display format"); } - return pName; + return eName; } /// map ReferenceFieldPart to XML string -const sal_Char* XMLTextFieldExport::MapReferenceType(sal_Int16 nType) +enum XMLTokenEnum XMLTextFieldExport::MapReferenceType(sal_Int16 nType) { - sal_Char* pElementName = NULL; + enum XMLTokenEnum eElement = XML_TOKEN_INVALID; switch (nType) { case ReferenceFieldPart::PAGE: - pElementName = sXML_page; + eElement = XML_PAGE; break; case ReferenceFieldPart::CHAPTER: - pElementName = sXML_chapter; + eElement = XML_CHAPTER; break; case ReferenceFieldPart::TEXT: - pElementName = sXML_text; + eElement = XML_TEXT; break; case ReferenceFieldPart::UP_DOWN: - pElementName = sXML_direction; + eElement = XML_DIRECTION; break; case ReferenceFieldPart::CATEGORY_AND_NUMBER: - pElementName = sXML_category_and_value; + eElement = XML_CATEGORY_AND_VALUE; break; case ReferenceFieldPart::ONLY_CAPTION: - pElementName = sXML_caption; + eElement = XML_CAPTION; break; case ReferenceFieldPart::ONLY_SEQUENCE_NUMBER: - pElementName = sXML_value; + eElement = XML_VALUE; break; case ReferenceFieldPart::PAGE_DESC: // small hack: this value never gets written, because - // sXML_template is default - pElementName = sXML_template; + // XML_TEMPLATE is default + eElement = XML_TEMPLATE; break; default: DBG_ERROR("unknown reference type"); - pElementName = sXML_template; + eElement = XML_TEMPLATE; break; } - return pElementName; + return eElement; } /// map ReferenceFieldPart to XML string -const sal_Char* XMLTextFieldExport::MapReferenceSource(sal_Int16 nType) +enum XMLTokenEnum XMLTextFieldExport::MapReferenceSource(sal_Int16 nType) { - sal_Char* pElementName = NULL; + enum XMLTokenEnum eElement = XML_TOKEN_INVALID; switch (nType) { case ReferenceFieldSource::REFERENCE_MARK: - pElementName = sXML_reference_ref; + eElement = XML_REFERENCE_REF; break; case ReferenceFieldSource::SEQUENCE_FIELD: - pElementName = sXML_sequence_ref; + eElement = XML_SEQUENCE_REF; break; case ReferenceFieldSource::BOOKMARK: - pElementName = sXML_bookmark_ref; + eElement = XML_BOOKMARK_REF; break; case ReferenceFieldSource::FOOTNOTE: - pElementName = sXML_footnote_ref; + eElement = XML_FOOTNOTE_REF; break; case ReferenceFieldSource::ENDNOTE: - pElementName = sXML_endnote_ref; + eElement = XML_ENDNOTE_REF; break; default: DBG_ERROR("unkown reference source"); break; } - return pElementName; + return eElement; } /// element name for sender fields -const sal_Char* XMLTextFieldExport::MapSenderFieldName( +enum XMLTokenEnum XMLTextFieldExport::MapSenderFieldName( const Reference<XPropertySet> & xPropSet) { - sal_Char* pElementName = NULL; + enum XMLTokenEnum eName = XML_TOKEN_INVALID; // sub-field type switch (GetInt16Property(sPropertyFieldSubType, xPropSet)) { case UserDataPart::COMPANY : - pElementName = sXML_sender_company; + eName = XML_SENDER_COMPANY; break; case UserDataPart::FIRSTNAME : - pElementName = sXML_sender_firstname; + eName = XML_SENDER_FIRSTNAME; break; case UserDataPart::NAME : - pElementName = sXML_sender_lastname; + eName = XML_SENDER_LASTNAME; break; case UserDataPart::SHORTCUT : - pElementName = sXML_sender_initials; + eName = XML_SENDER_INITIALS; break; case UserDataPart::STREET : - pElementName = sXML_sender_street; + eName = XML_SENDER_STREET; break; case UserDataPart::COUNTRY : - pElementName = sXML_sender_country; + eName = XML_SENDER_COUNTRY; break; case UserDataPart::ZIP : - pElementName = sXML_sender_postal_code; + eName = XML_SENDER_POSTAL_CODE; break; case UserDataPart::CITY : - pElementName = sXML_sender_city; + eName = XML_SENDER_CITY; break; case UserDataPart::TITLE : - pElementName = sXML_sender_title; + eName = XML_SENDER_TITLE; break; case UserDataPart::POSITION : - pElementName = sXML_sender_position; + eName = XML_SENDER_POSITION; break; case UserDataPart::PHONE_PRIVATE : - pElementName = sXML_sender_phone_private; + eName = XML_SENDER_PHONE_PRIVATE; break; case UserDataPart::PHONE_COMPANY : - pElementName = sXML_sender_phone_work; + eName = XML_SENDER_PHONE_WORK; break; case UserDataPart::FAX : - pElementName = sXML_sender_fax; + eName = XML_SENDER_FAX; break; case UserDataPart::EMAIL : - pElementName = sXML_sender_email; + eName = XML_SENDER_EMAIL; break; case UserDataPart::STATE : - pElementName = sXML_sender_state_or_province; + eName = XML_SENDER_STATE_OR_PROVINCE; break; default: DBG_WARNING("unknown sender type"); - pElementName = NULL; + eName = XML_TOKEN_INVALID; break; } - return pElementName; + return eName; } -const sal_Char* XMLTextFieldExport::MapDocInfoFieldName( +enum XMLTokenEnum XMLTextFieldExport::MapDocInfoFieldName( enum FieldIdEnum nToken) { - sal_Char* pElementName = NULL; + enum XMLTokenEnum eElement = XML_TOKEN_INVALID; switch (nToken) { case FIELD_ID_DOCINFO_CREATION_AUTHOR: - pElementName = sXML_initial_creator; + eElement = XML_INITIAL_CREATOR; break; case FIELD_ID_DOCINFO_CREATION_DATE: - pElementName = sXML_creation_date; + eElement = XML_CREATION_DATE; break; case FIELD_ID_DOCINFO_CREATION_TIME: - pElementName = sXML_creation_time; + eElement = XML_CREATION_TIME; break; case FIELD_ID_DOCINFO_DESCRIPTION: - pElementName = sXML_description; + eElement = XML_DESCRIPTION; break; case FIELD_ID_DOCINFO_INFORMATION0: - pElementName = sXML_user_info_0; + eElement = XML_USER_INFO_0; break; case FIELD_ID_DOCINFO_INFORMATION1: - pElementName = sXML_user_info_1; + eElement = XML_USER_INFO_1; break; case FIELD_ID_DOCINFO_INFORMATION2: - pElementName = sXML_user_info_2; + eElement = XML_USER_INFO_2; break; case FIELD_ID_DOCINFO_INFORMATION3: - pElementName = sXML_user_info_3; + eElement = XML_USER_INFO_3; break; case FIELD_ID_DOCINFO_PRINT_TIME: - pElementName = sXML_print_time; + eElement = XML_PRINT_TIME; break; case FIELD_ID_DOCINFO_PRINT_DATE: - pElementName = sXML_print_date; + eElement = XML_PRINT_DATE; break; case FIELD_ID_DOCINFO_PRINT_AUTHOR: - pElementName = sXML_printed_by; + eElement = XML_PRINTED_BY; break; case FIELD_ID_DOCINFO_TITLE: - pElementName = sXML_title; + eElement = XML_TITLE; break; case FIELD_ID_DOCINFO_SUBJECT: - pElementName = sXML_subject; + eElement = XML_SUBJECT; break; case FIELD_ID_DOCINFO_KEYWORDS: - pElementName = sXML_keywords; + eElement = XML_KEYWORDS; break; case FIELD_ID_DOCINFO_REVISION: - pElementName = sXML_editing_cycles; + eElement = XML_EDITING_CYCLES; break; case FIELD_ID_DOCINFO_EDIT_DURATION: - pElementName = sXML_editing_duration; + eElement = XML_EDITING_DURATION; break; case FIELD_ID_DOCINFO_SAVE_TIME: - pElementName = sXML_modification_time; + eElement = XML_MODIFICATION_TIME; break; case FIELD_ID_DOCINFO_SAVE_DATE: - pElementName = sXML_modification_date; + eElement = XML_MODIFICATION_DATE; break; case FIELD_ID_DOCINFO_SAVE_AUTHOR: - pElementName = sXML_creator; + eElement = XML_CREATOR; break; default: DBG_WARNING("unknown docinfo field type!"); - pElementName = NULL; + eElement = XML_TOKEN_INVALID; break; } - return pElementName; + return eElement; } -const sal_Char* XMLTextFieldExport::MapBibliographyFieldName(OUString sName) +enum XMLTokenEnum XMLTextFieldExport::MapBibliographyFieldName(OUString sName) { - sal_Char* pName = NULL; + enum XMLTokenEnum eName = XML_TOKEN_INVALID; if (sName.equalsAsciiL("Identifier", sizeof("Identifier")-1)) { - pName = sXML_identifier; + eName = XML_IDENTIFIER; } else if (sName.equalsAsciiL("BibiliographicType", sizeof("BibiliographicType")-1)) { - pName = sXML_bibiliographic_type; + eName = XML_BIBILIOGRAPHIC_TYPE; } else if (sName.equalsAsciiL("Address", sizeof("Address")-1)) { - pName = sXML_address; + eName = XML_ADDRESS; } else if (sName.equalsAsciiL("Annote", sizeof("Annote")-1)) { - pName = sXML_annote; + eName = XML_ANNOTE; } else if (sName.equalsAsciiL("Author", sizeof("Author")-1)) { - pName = sXML_author; + eName = XML_AUTHOR; } else if (sName.equalsAsciiL("Booktitle", sizeof("Booktitle")-1)) { - pName = sXML_booktitle; + eName = XML_BOOKTITLE; } else if (sName.equalsAsciiL("Chapter", sizeof("Chapter")-1)) { - pName = sXML_chapter; + eName = XML_CHAPTER; } else if (sName.equalsAsciiL("Edition", sizeof("Edition")-1)) { - pName = sXML_edition; + eName = XML_EDITION; } else if (sName.equalsAsciiL("Editor", sizeof("Editor")-1)) { - pName = sXML_editor; + eName = XML_EDITOR; } else if (sName.equalsAsciiL("Howpublished", sizeof("Howpublished")-1)) { - pName = sXML_howpublished; + eName = XML_HOWPUBLISHED; } else if (sName.equalsAsciiL("Institution", sizeof("Institution")-1)) { - pName = sXML_institution; + eName = XML_INSTITUTION; } else if (sName.equalsAsciiL("Journal", sizeof("Journal")-1)) { - pName = sXML_journal; + eName = XML_JOURNAL; } else if (sName.equalsAsciiL("Month", sizeof("Month")-1)) { - pName = sXML_month; + eName = XML_MONTH; } else if (sName.equalsAsciiL("Note", sizeof("Note")-1)) { - pName = sXML_note; + eName = XML_NOTE; } else if (sName.equalsAsciiL("Number", sizeof("Number")-1)) { - pName = sXML_number; + eName = XML_NUMBER; } else if (sName.equalsAsciiL("Organizations", sizeof("Organizations")-1)) { - pName = sXML_organizations; + eName = XML_ORGANIZATIONS; } else if (sName.equalsAsciiL("Pages", sizeof("Pages")-1)) { - pName = sXML_pages; + eName = XML_PAGES; } else if (sName.equalsAsciiL("Publisher", sizeof("Publisher")-1)) { - pName = sXML_publisher; + eName = XML_PUBLISHER; } else if (sName.equalsAsciiL("School", sizeof("School")-1)) { - pName = sXML_school; + eName = XML_SCHOOL; } else if (sName.equalsAsciiL("Series", sizeof("Series")-1)) { - pName = sXML_series; + eName = XML_SERIES; } else if (sName.equalsAsciiL("Title", sizeof("Title")-1)) { - pName = sXML_title; + eName = XML_TITLE; } else if (sName.equalsAsciiL("Report_Type", sizeof("Report_Type")-1)) { - pName = sXML_report_type; + eName = XML_REPORT_TYPE; } else if (sName.equalsAsciiL("Volume", sizeof("Volume")-1)) { - pName = sXML_volume; + eName = XML_VOLUME; } else if (sName.equalsAsciiL("Year", sizeof("Year")-1)) { - pName = sXML_year; + eName = XML_YEAR; } else if (sName.equalsAsciiL("URL", sizeof("URL")-1)) { - pName = sXML_url; + eName = XML_URL; } else if (sName.equalsAsciiL("Custom1", sizeof("Custom1")-1)) { - pName = sXML_custom1; + eName = XML_CUSTOM1; } else if (sName.equalsAsciiL("Custom2", sizeof("Custom2")-1)) { - pName = sXML_custom2; + eName = XML_CUSTOM2; } else if (sName.equalsAsciiL("Custom3", sizeof("Custom3")-1)) { - pName = sXML_custom3; + eName = XML_CUSTOM3; } else if (sName.equalsAsciiL("Custom4", sizeof("Custom4")-1)) { - pName = sXML_custom4; + eName = XML_CUSTOM4; } else if (sName.equalsAsciiL("Custom5", sizeof("Custom5")-1)) { - pName = sXML_custom5; + eName = XML_CUSTOM5; } else if (sName.equalsAsciiL("ISBN", sizeof("ISBN")-1)) { - pName = sXML_isbn; + eName = XML_ISBN; } else { DBG_ERROR("Unknown bibliography info data"); - pName = NULL; + eName = XML_TOKEN_INVALID; } - return pName; + return eName; } -const sal_Char* XMLTextFieldExport::MapMeasureKind(sal_Int16 nKind) +enum XMLTokenEnum XMLTextFieldExport::MapMeasureKind(sal_Int16 nKind) { switch( nKind ) { case 0: - return sXML_value; + return XML_VALUE; case 1: - return sXML_unit; + return XML_UNIT; } - return sXML_gap; + return XML_GAP; } OUString XMLTextFieldExport::MakeFootnoteRefName( diff --git a/xmloff/source/text/txtftne.cxx b/xmloff/source/text/txtftne.cxx index ca19833243a5..20bd61632eb9 100644 --- a/xmloff/source/text/txtftne.cxx +++ b/xmloff/source/text/txtftne.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtftne.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: dvo $ $Date: 2001-04-26 13:17:32 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -113,8 +113,8 @@ #include <com/sun/star/text/FootnoteNumbering.hpp> #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLNMSPE_HXX #include "xmlnmspe.hxx" @@ -147,6 +147,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::text; +using namespace ::xmloff::token; void XMLTextParagraphExport::exportTextFootnote( @@ -181,10 +182,10 @@ void XMLTextParagraphExport::exportTextFootnote( OUString sStyle = FindTextStyle( rPropSet ); if( sStyle.getLength() ) { - GetExport().AddAttribute( XML_NAMESPACE_TEXT, sXML_style_name, + GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME, sStyle ); SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, - sXML_span, sal_False, sal_False ); + XML_SPAN, sal_False, sal_False ); exportTextFootnoteHelper(xFootnote, xText, sText, bAutoStyles, bIsEndnote, bProgress ); } @@ -219,33 +220,33 @@ void XMLTextParagraphExport::exportTextFootnoteHelper( OUStringBuffer aBuf; aBuf.appendAscii("ftn"); aBuf.append(nNumber); - GetExport().AddAttribute(XML_NAMESPACE_TEXT, sXML_id, + GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_ID, aBuf.makeStringAndClear()); SvXMLElementExport aNote(GetExport(), XML_NAMESPACE_TEXT, - (bIsEndnote ? sXML_endnote : sXML_footnote), + (bIsEndnote ? XML_ENDNOTE : XML_FOOTNOTE), sal_False, sal_False); { // handle label vs. automatic numbering OUString sLabel = rFootnote->getLabel(); if (sLabel.getLength()>0) { - GetExport().AddAttribute(XML_NAMESPACE_TEXT, sXML_label, + GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_LABEL, sLabel); } // else: automatic numbering -> no attribute SvXMLElementExport aCite(GetExport(), XML_NAMESPACE_TEXT, - (bIsEndnote ? sXML_endnote_citation : - sXML_footnote_citation), + (bIsEndnote ? XML_ENDNOTE_CITATION : + XML_FOOTNOTE_CITATION), sal_False, sal_False); GetExport().GetDocHandler()->characters(sText); } { SvXMLElementExport aBody(GetExport(), XML_NAMESPACE_TEXT, - (bIsEndnote ? sXML_endnote_body : - sXML_footnote_body), + (bIsEndnote ? XML_ENDNOTE_BODY : + XML_FOOTNOTE_BODY), sal_False, sal_False); exportText(rText, bAutoStyles, bProgress, sal_True ); } @@ -276,17 +277,17 @@ void lcl_exportString( const Reference<XPropertySet> & rPropSet, const OUString& sProperty, sal_uInt16 nPrefix, - const sal_Char* pElementName, + enum XMLTokenEnum eElement, sal_Bool bOmitIfEmpty = sal_True) { - DBG_ASSERT(NULL != pElementName, "need element name"); + DBG_ASSERT( eElement != XML_TOKEN_INVALID, "need element token"); Any aAny = rPropSet->getPropertyValue(sProperty); OUString sTmp; aAny >>= sTmp; if (!bOmitIfEmpty || (sTmp.getLength() > 0)) { - rExport.AddAttribute(nPrefix, pElementName, sTmp); + rExport.AddAttribute(nPrefix, eElement, sTmp); } } @@ -296,28 +297,28 @@ void XMLTextParagraphExport::exportTextFootnoteConfigurationHelper( { // default/paragraph style lcl_exportString( GetExport(), rFootnoteConfig, sParaStyleName, - XML_NAMESPACE_TEXT, sXML_default_style_name, sal_True); + XML_NAMESPACE_TEXT, XML_DEFAULT_STYLE_NAME, sal_True); // citation style lcl_exportString( GetExport(), rFootnoteConfig, sCharStyleName, - XML_NAMESPACE_TEXT, sXML_citation_style_name, sal_True); + XML_NAMESPACE_TEXT, XML_CITATION_STYLE_NAME, sal_True); // citation body style lcl_exportString( GetExport(), rFootnoteConfig, sAnchorCharStyleName, - XML_NAMESPACE_TEXT, sXML_citation_body_style_name, + XML_NAMESPACE_TEXT, XML_CITATION_BODY_STYLE_NAME, sal_True); // page style lcl_exportString( GetExport(), rFootnoteConfig, sPageStyleName, - XML_NAMESPACE_TEXT, sXML_master_page_name, sal_True); + XML_NAMESPACE_TEXT, XML_MASTER_PAGE_NAME, sal_True); // prefix lcl_exportString( GetExport(), rFootnoteConfig, sPrefix, - XML_NAMESPACE_STYLE, sXML_num_prefix, sal_True); + XML_NAMESPACE_STYLE, XML_NUM_PREFIX, sal_True); // suffix lcl_exportString( GetExport(), rFootnoteConfig, sSuffix, - XML_NAMESPACE_STYLE, sXML_num_suffix, sal_True); + XML_NAMESPACE_STYLE, XML_NUM_SUFFIX, sal_True); @@ -329,14 +330,13 @@ void XMLTextParagraphExport::exportTextFootnoteConfigurationHelper( sal_Int16 nNumbering; aAny >>= nNumbering; GetExport().GetMM100UnitConverter().convertNumFormat( sBuffer, nNumbering); - GetExport().AddAttribute(XML_NAMESPACE_STYLE, sXML_num_format, + GetExport().AddAttribute(XML_NAMESPACE_STYLE, XML_NUM_FORMAT, sBuffer.makeStringAndClear() ); GetExport().GetMM100UnitConverter().convertNumLetterSync( sBuffer, nNumbering); if (sBuffer.getLength() ) { - GetExport().AddAttribute(XML_NAMESPACE_STYLE, - sXML_num_letter_sync, - sBuffer.makeStringAndClear()); + GetExport().AddAttribute(XML_NAMESPACE_STYLE, XML_NUM_LETTER_SYNC, + sBuffer.makeStringAndClear()); } // StartAt / start-value @@ -344,7 +344,7 @@ void XMLTextParagraphExport::exportTextFootnoteConfigurationHelper( sal_Int16 nOffset; aAny >>= nOffset; SvXMLUnitConverter::convertNumber(sBuffer, (sal_Int32)nOffset); - GetExport().AddAttribute(XML_NAMESPACE_TEXT, sXML_start_value, + GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_START_VALUE, sBuffer.makeStringAndClear()); // some properties are for footnotes only @@ -353,40 +353,36 @@ void XMLTextParagraphExport::exportTextFootnoteConfigurationHelper( // footnotes position aAny = rFootnoteConfig->getPropertyValue( sPositionEndOfDoc); - GetExport().AddAttributeASCII(XML_NAMESPACE_TEXT, - sXML_footnotes_position, - ( (*(sal_Bool *)aAny.getValue()) ? - sXML_document : sXML_page ) ); + GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_FOOTNOTES_POSITION, + ( (*(sal_Bool *)aAny.getValue()) ? + XML_DOCUMENT : XML_PAGE ) ); aAny = rFootnoteConfig->getPropertyValue(sFootnoteCounting); sal_Int16 nTmp; aAny >>= nTmp; - sal_Char* pElement; + enum XMLTokenEnum eElement; switch (nTmp) { case FootnoteNumbering::PER_PAGE: - pElement = sXML_page; + eElement = XML_PAGE; break; case FootnoteNumbering::PER_CHAPTER: - pElement = sXML_chapter; + eElement = XML_CHAPTER; break; case FootnoteNumbering::PER_DOCUMENT: default: - pElement = sXML_document; + eElement = XML_DOCUMENT; break; } - GetExport().AddAttributeASCII(XML_NAMESPACE_TEXT, - sXML_start_numbering_at, - pElement); + GetExport().AddAttribute(XML_NAMESPACE_TEXT, + XML_START_NUMBERING_AT, eElement); } // element - SvXMLElementExport aFootnoteConfigElement(GetExport(), - XML_NAMESPACE_TEXT, - ( bIsEndnote ? - sXML_endnotes_configuration : - sXML_footnotes_configuration ), - sal_True, sal_True); + SvXMLElementExport aFootnoteConfigElement( + GetExport(), XML_NAMESPACE_TEXT, + ( bIsEndnote ? XML_ENDNOTES_CONFIGURATION:XML_FOOTNOTES_CONFIGURATION), + sal_True, sal_True); // two element for footnote content if (!bIsEndnote) @@ -400,7 +396,7 @@ void XMLTextParagraphExport::exportTextFootnoteConfigurationHelper( if (sTmp.getLength() > 0) { SvXMLElementExport aElem(GetExport(), XML_NAMESPACE_TEXT, - sXML_footnote_continuation_notice_forward, + XML_FOOTNOTE_CONTINUATION_NOTICE_FORWARD, sal_True, sal_False); GetExport().GetDocHandler()->characters(sTmp); } @@ -412,7 +408,7 @@ void XMLTextParagraphExport::exportTextFootnoteConfigurationHelper( if (sTmp.getLength() > 0) { SvXMLElementExport aElem(GetExport(), XML_NAMESPACE_TEXT, - sXML_footnote_continuation_notice_backward, + XML_FOOTNOTE_CONTINUATION_NOTICE_BACKWARD, sal_True, sal_False); GetExport().GetDocHandler()->characters(sTmp); } diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index ebd272a15bc1..e836c3fa5884 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtimp.cxx,v $ * - * $Revision: 1.78 $ + * $Revision: 1.79 $ * - * last change: $Author: mib $ $Date: 2001-06-28 13:19:19 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -122,8 +122,8 @@ #include <com/sun/star/container/XNamed.hpp> #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLNMSPE_HXX #include "xmlnmspe.hxx" @@ -1507,7 +1507,7 @@ sal_Bool XMLTextImportHelper::HasDrawNameAttribute( sal_uInt16 nPrefix = rNamespaceMap.GetKeyByAttrName( rAttrName, &aLocalName ); if( XML_NAMESPACE_DRAW == nPrefix && - aLocalName.equalsAsciiL( sXML_name, sizeof( sXML_name ) - 1 ) ) + IsXMLToken( aLocalName, XML_NAME ) ) { return xAttrList->getValueByIndex(i).getLength() != 0; } diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index dde2d1dcae20..b4755222b9c0 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtparae.cxx,v $ * - * $Revision: 1.85 $ + * $Revision: 1.86 $ * - * last change: $Author: mib $ $Date: 2001-06-27 07:38:11 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -261,6 +261,8 @@ using namespace ::com::sun::star::util; using namespace ::com::sun::star::drawing; using namespace ::com::sun::star::document; using namespace ::com::sun::star::frame; +using namespace ::xmloff::token; + typedef OUString *OUStringPtr; SV_DECL_PTRARR_DEL( OUStrings_Impl, OUStringPtr, 20, 10 ) @@ -569,22 +571,21 @@ void XMLTextParagraphExport::exportListChange( if( sTmp.getLength() ) sName = sTmp; } - GetExport().AddAttribute( XML_NAMESPACE_TEXT, sXML_style_name, + GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME, sName ); } if( bContinue && rNextInfo.IsOrdered() ) - GetExport().AddAttributeASCII( XML_NAMESPACE_TEXT, - sXML_continue_numbering, - sXML_true ); + GetExport().AddAttribute( XML_NAMESPACE_TEXT, + XML_CONTINUE_NUMBERING, XML_TRUE ); - const sal_Char *pLName = - rNextInfo.IsOrdered() ? sXML_ordered_list - : sXML_unordered_list; + enum XMLTokenEnum eLName = + rNextInfo.IsOrdered() ? XML_ORDERED_LIST + : XML_UNORDERED_LIST; OUString *pElem = new OUString( GetExport().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_TEXT, - OUString::createFromAscii(pLName) ) ); + GetXMLToken(eLName) ) ); GetExport().GetDocHandler()->ignorableWhitespace( GetExport().sWS ); GetExport().GetDocHandler()->startElement( @@ -601,15 +602,15 @@ void XMLTextParagraphExport::exportListChange( { OUStringBuffer aBuffer; aBuffer.append( (sal_Int32)rNextInfo.GetStartValue() ); - GetExport().AddAttribute( XML_NAMESPACE_TEXT, sXML_start_value, + GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE, aBuffer.makeStringAndClear() ); } - pLName = (rNextInfo.IsNumbered() || i+1 < nNextLevel) - ? sXML_list_item - : sXML_list_header; + eLName = (rNextInfo.IsNumbered() || i+1 < nNextLevel) + ? XML_LIST_ITEM + : XML_LIST_HEADER; pElem = new OUString( GetExport().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_TEXT, - OUString::createFromAscii(pLName) ) ); + GetXMLToken(eLName) ) ); GetExport().GetDocHandler()->ignorableWhitespace( GetExport().sWS ); GetExport().GetDocHandler()->startElement( *pElem, GetExport().GetXAttrList() ); @@ -641,12 +642,12 @@ void XMLTextParagraphExport::exportListChange( { OUStringBuffer aBuffer; aBuffer.append( (sal_Int32)rNextInfo.GetStartValue() ); - GetExport().AddAttribute( XML_NAMESPACE_TEXT, sXML_start_value, + GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE, aBuffer.makeStringAndClear() ); } pElem = new OUString( GetExport().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_TEXT, - OUString::createFromAscii(sXML_list_item) ) ); + GetXMLToken(XML_LIST_ITEM) ) ); GetExport().GetDocHandler()->ignorableWhitespace( GetExport().sWS ); GetExport().GetDocHandler()->startElement( *pElem, GetExport().GetXAttrList() ); @@ -772,7 +773,7 @@ XMLTextParagraphExport::XMLTextParagraphExport( xParaPropMapper = new XMLTextExportPropertySetMapper( xPropMapper, GetExport() ); - OUString sFamily( RTL_CONSTASCII_USTRINGPARAM(sXML_paragraph) ); + OUString sFamily( GetXMLToken(XML_PARAGRAPH) ); OUString sPrefix( 'P' ); rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_PARAGRAPH, sFamily, xParaPropMapper, sPrefix ); @@ -780,7 +781,7 @@ XMLTextParagraphExport::XMLTextParagraphExport( xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT ); xTextPropMapper = new XMLTextExportPropertySetMapper( xPropMapper, GetExport() ); - sFamily = OUString( RTL_CONSTASCII_USTRINGPARAM(sXML_text) ); + sFamily = OUString( GetXMLToken(XML_TEXT) ); sPrefix = OUString( 'T' ); rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_TEXT, sFamily, xTextPropMapper, sPrefix ); @@ -796,14 +797,14 @@ XMLTextParagraphExport::XMLTextParagraphExport( xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_SECTION ); xSectionPropMapper = new XMLTextExportPropertySetMapper( xPropMapper, GetExport() ); - sFamily = OUString( RTL_CONSTASCII_USTRINGPARAM( sXML_section ) ); + sFamily = OUString( GetXMLToken( XML_SECTION ) ); sPrefix = OUString( RTL_CONSTASCII_USTRINGPARAM( "Sect" ) ); rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_SECTION, sFamily, xSectionPropMapper, sPrefix ); xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_RUBY ); xRubyPropMapper = new SvXMLExportPropertyMapper( xPropMapper ); - sFamily = OUString( RTL_CONSTASCII_USTRINGPARAM( sXML_ruby ) ); + sFamily = OUString( GetXMLToken( XML_RUBY ) ); sPrefix = OUString( RTL_CONSTASCII_USTRINGPARAM( "Ru" ) ); rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_RUBY, sFamily, xRubyPropMapper, sPrefix ); @@ -824,7 +825,8 @@ XMLTextParagraphExport::XMLTextParagraphExport( sal_Bool bTmp = sal_True; aAny.setValue(&bTmp, ::getBooleanCppuType()); sal_Int32 nIndex = xTextPropMapper->getPropertySetMapper()->FindEntryIndex( - "", XML_NAMESPACE_STYLE, sXML_text_combine); + "", XML_NAMESPACE_STYLE, + GetXMLToken(XML_TEXT_COMBINE)); pFieldExport = new XMLTextFieldExport( rExp, new XMLPropertyState( nIndex, aAny ) ); } @@ -1412,7 +1414,7 @@ void XMLTextParagraphExport::exportParagraph( OUString sAutoStyle( sStyle ); sAutoStyle = Find( XML_STYLE_FAMILY_TEXT_PARAGRAPH, xPropSet, sStyle ); if( sAutoStyle.getLength() ) - GetExport().AddAttribute( XML_NAMESPACE_TEXT, sXML_style_name, + GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME, sAutoStyle ); if( rPropSetHelper.hasProperty( PARA_CONDITIONAL_STYLE_NAME ) ) @@ -1426,7 +1428,7 @@ void XMLTextParagraphExport::exportParagraph( sCondStyle ); if( sCondStyle.getLength() ) GetExport().AddAttribute( XML_NAMESPACE_TEXT, - sXML_cond_style_name, + XML_COND_STYLE_NAME, sCondStyle ); } } @@ -1439,7 +1441,7 @@ void XMLTextParagraphExport::exportParagraph( { OUStringBuffer sTmp; sTmp.append( (sal_Int32)nOutlineLevel+1L ); - GetExport().AddAttribute( XML_NAMESPACE_TEXT, sXML_level, + GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_LEVEL, sTmp.makeStringAndClear() ); } } @@ -1470,9 +1472,9 @@ void XMLTextParagraphExport::exportParagraph( } else { - const sal_Char *pElem = - -1 == nOutlineLevel ? sXML_p : sXML_h; - SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, pElem, + enum XMLTokenEnum eElem = + -1 == nOutlineLevel ? XML_P : XML_H; + SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, eElem, sal_True, sal_False ); if( xContentEnum.is() ) exportTextContentEnumeration( xContentEnum, bAutoStyles, xSection, @@ -1484,10 +1486,10 @@ void XMLTextParagraphExport::exportParagraph( // bookmarks, reference marks (and TOC marks) are the same except for the // element names. We use the same method for export and it an array with // the proper element names -static const sal_Char* lcl_XmlReferenceElements[] = { - sXML_reference_mark, sXML_reference_mark_start, sXML_reference_mark_end }; -static const sal_Char* lcl_XmlBookmarkElements[] = { - sXML_bookmark, sXML_bookmark_start, sXML_bookmark_end }; +static const enum XMLTokenEnum lcl_XmlReferenceElements[] = { + XML_REFERENCE_MARK, XML_REFERENCE_MARK_START, XML_REFERENCE_MARK_END }; +static const enum XMLTokenEnum lcl_XmlBookmarkElements[] = { + XML_BOOKMARK, XML_BOOKMARK_START, XML_BOOKMARK_END }; void XMLTextParagraphExport::exportTextRangeEnumeration( @@ -1639,7 +1641,7 @@ void XMLTextParagraphExport::exportTextField( void XMLTextParagraphExport::exportTextMark( const Reference<XPropertySet> & rPropSet, const OUString sProperty, - const sal_Char* pElements[], + const enum XMLTokenEnum pElements[], sal_Bool bAutoStyles) { // mib said: "Hau wech!" @@ -1660,7 +1662,7 @@ void XMLTextParagraphExport::exportTextMark( // name element Reference<XNamed> xName(xRefMark, UNO_QUERY); - GetExport().AddAttribute(XML_NAMESPACE_TEXT, sXML_name, + GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, xName->getName()); // start, end, or point-reference? @@ -1717,7 +1719,7 @@ sal_Int32 XMLTextParagraphExport::addTextFrameAttributes( { OUString sName( xNamed->getName() ); if( sName.getLength() ) - GetExport().AddAttribute( XML_NAMESPACE_DRAW, sXML_name, + GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_NAME, xNamed->getName() ); } @@ -1733,7 +1735,7 @@ sal_Int32 XMLTextParagraphExport::addTextFrameAttributes( OUString sTmp; aAnchorTypeHdl.exportXML( sTmp, aAny, GetExport().GetMM100UnitConverter() ); - GetExport().AddAttribute( XML_NAMESPACE_TEXT, sXML_anchor_type, sTmp ); + GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_ANCHOR_TYPE, sTmp ); } // text:anchor-page-number @@ -1744,7 +1746,7 @@ sal_Int32 XMLTextParagraphExport::addTextFrameAttributes( aAny >>= nPage; GetExport().GetMM100UnitConverter().convertNumber( sValue, (sal_Int32)nPage ); - GetExport().AddAttribute( XML_NAMESPACE_TEXT, sXML_anchor_page_number, + GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_ANCHOR_PAGE_NUMBER, sValue.makeStringAndClear() ); } @@ -1760,7 +1762,7 @@ sal_Int32 XMLTextParagraphExport::addTextFrameAttributes( Any aAny = rPropSet->getPropertyValue( sHoriOrientPosition ); aAny >>= nPos; GetExport().GetMM100UnitConverter().convertMeasure( sValue, nPos ); - GetExport().AddAttribute( XML_NAMESPACE_SVG, sXML_x, + GetExport().AddAttribute( XML_NAMESPACE_SVG, XML_X, sValue.makeStringAndClear() ); } } @@ -1779,7 +1781,7 @@ sal_Int32 XMLTextParagraphExport::addTextFrameAttributes( Any aAny = rPropSet->getPropertyValue( sVertOrientPosition ); aAny >>= nPos; GetExport().GetMM100UnitConverter().convertMeasure( sValue, nPos ); - GetExport().AddAttribute( XML_NAMESPACE_SVG, sXML_y, + GetExport().AddAttribute( XML_NAMESPACE_SVG, XML_Y, sValue.makeStringAndClear() ); } if( bShape ) @@ -1796,7 +1798,7 @@ sal_Int32 XMLTextParagraphExport::addTextFrameAttributes( aAny = rPropSet->getPropertyValue( sWidth ); aAny >>= nWidth; GetExport().GetMM100UnitConverter().convertMeasure( sValue, nWidth ); - GetExport().AddAttribute( XML_NAMESPACE_SVG, sXML_width, + GetExport().AddAttribute( XML_NAMESPACE_SVG, XML_WIDTH, sValue.makeStringAndClear() ); } sal_Bool bSyncWidth = sal_False; @@ -1805,8 +1807,8 @@ sal_Int32 XMLTextParagraphExport::addTextFrameAttributes( aAny = rPropSet->getPropertyValue( sIsSyncWidthToHeight ); bSyncWidth = *(sal_Bool *)aAny.getValue(); if( bSyncWidth ) - GetExport().AddAttributeASCII( XML_NAMESPACE_STYLE, sXML_rel_width, - sXML_scale ); + GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_REL_WIDTH, + XML_SCALE ); } if( !bSyncWidth && xPropSetInfo->hasPropertyByName( sRelativeWidth ) ) { @@ -1819,7 +1821,7 @@ sal_Int32 XMLTextParagraphExport::addTextFrameAttributes( { GetExport().GetMM100UnitConverter().convertPercent( sValue, nRelWidth ); - GetExport().AddAttribute( XML_NAMESPACE_STYLE, sXML_rel_width, + GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_REL_WIDTH, sValue.makeStringAndClear() ); } } @@ -1851,16 +1853,16 @@ sal_Int32 XMLTextParagraphExport::addTextFrameAttributes( GetExport().GetMM100UnitConverter().convertMeasure( sValue, nHeight ); if( SizeType::MIN == nSizeType && 0==nRelHeight && !bSyncHeight ) - GetExport().AddAttribute( XML_NAMESPACE_FO, sXML_min_height, + GetExport().AddAttribute( XML_NAMESPACE_FO, XML_MIN_HEIGHT, sValue.makeStringAndClear() ); else - GetExport().AddAttribute( XML_NAMESPACE_SVG, sXML_height, + GetExport().AddAttribute( XML_NAMESPACE_SVG, XML_HEIGHT, sValue.makeStringAndClear() ); } if( bSyncHeight ) { - GetExport().AddAttributeASCII( XML_NAMESPACE_STYLE, sXML_rel_height, - SizeType::MIN == nSizeType ? sXML_scale_min : sXML_scale ); + GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_REL_HEIGHT, + SizeType::MIN == nSizeType ? XML_SCALE_MIN : XML_SCALE ); } else if( nRelHeight > 0 ) @@ -1868,10 +1870,10 @@ sal_Int32 XMLTextParagraphExport::addTextFrameAttributes( GetExport().GetMM100UnitConverter().convertPercent( sValue, nRelHeight ); if( SizeType::MIN == nSizeType ) - GetExport().AddAttribute( XML_NAMESPACE_FO, sXML_min_height, + GetExport().AddAttribute( XML_NAMESPACE_FO, XML_MIN_HEIGHT, sValue.makeStringAndClear() ); else - GetExport().AddAttribute( XML_NAMESPACE_STYLE, sXML_rel_height, + GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_REL_HEIGHT, sValue.makeStringAndClear() ); } @@ -1885,7 +1887,7 @@ sal_Int32 XMLTextParagraphExport::addTextFrameAttributes( { GetExport().GetMM100UnitConverter().convertNumber( sValue, nZIndex ); - GetExport().AddAttribute( XML_NAMESPACE_DRAW, sXML_zindex, + GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_ZINDEX, sValue.makeStringAndClear() ); } } @@ -1912,7 +1914,7 @@ void XMLTextParagraphExport::_exportTextFrame( OUString sAutoStyle( sStyle ); sAutoStyle = Find( XML_STYLE_FAMILY_TEXT_FRAME, rPropSet, sStyle ); if( sAutoStyle.getLength() ) - GetExport().AddAttribute( XML_NAMESPACE_DRAW, sXML_style_name, + GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE_NAME, sAutoStyle ); addTextFrameAttributes( rPropSet, sal_False ); @@ -1923,12 +1925,12 @@ void XMLTextParagraphExport::_exportTextFrame( aAny = rPropSet->getPropertyValue( sChainNextName ); if( (aAny >>= sNext) && sNext.getLength() > 0 ) GetExport().AddAttribute( XML_NAMESPACE_DRAW, - sXML_chain_next_name, + XML_CHAIN_NEXT_NAME, sNext ); } SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_DRAW, - sXML_text_box, sal_False, sal_True ); + XML_TEXT_BOX, sal_False, sal_True ); // frame bound frames exportFramesBoundToFrame( xTxtFrame, bProgress ); @@ -1972,11 +1974,11 @@ void XMLTextParagraphExport::exportTextFrame( pRangePropSet && lcl_txtpara_isBoundAsChar( xPropSet, xPropSetInfo ) && addTextStyleAttribute( *pRangePropSet ), - XML_NAMESPACE_TEXT, sXML_span, sal_False, sal_False ); + XML_NAMESPACE_TEXT, XML_SPAN, sal_False, sal_False ); { SvXMLElementExport aElem( GetExport(), addHyperlinkAttributes( xPropSet, xPropState,xPropSetInfo ), - XML_NAMESPACE_DRAW, sXML_a, sal_False, sal_False ); + XML_NAMESPACE_DRAW, XML_A, sal_False, sal_False ); _exportTextFrame( xPropSet, xPropSetInfo, bProgress ); } } @@ -2030,7 +2032,7 @@ void XMLTextParagraphExport::exportContour( GetExport().GetMM100UnitConverter().convertMeasurePx(aStringBuffer, aSize.Width); else GetExport().GetMM100UnitConverter().convertMeasure(aStringBuffer, aSize.Width); - GetExport().AddAttribute( XML_NAMESPACE_SVG, sXML_width, + GetExport().AddAttribute( XML_NAMESPACE_SVG, XML_WIDTH, aStringBuffer.makeStringAndClear() ); // svg: height @@ -2038,17 +2040,17 @@ void XMLTextParagraphExport::exportContour( GetExport().GetMM100UnitConverter().convertMeasurePx(aStringBuffer, aSize.Height); else GetExport().GetMM100UnitConverter().convertMeasure(aStringBuffer, aSize.Height); - GetExport().AddAttribute( XML_NAMESPACE_SVG, sXML_height, + GetExport().AddAttribute( XML_NAMESPACE_SVG, XML_HEIGHT, aStringBuffer.makeStringAndClear() ); // svg:viewbox SdXMLImExViewBox aViewBox(0, 0, aSize.Width, aSize.Height); - GetExport().AddAttribute(XML_NAMESPACE_SVG, sXML_viewBox, + GetExport().AddAttribute(XML_NAMESPACE_SVG, XML_VIEWBOX, aViewBox.GetExportString(GetExport().GetMM100UnitConverter())); sal_Int32 nOuterCnt( aSourcePolyPolygon.getLength() ); - const sal_Char *pElem = 0; + enum XMLTokenEnum eElem = XML_TOKEN_INVALID; if( 1L == nOuterCnt ) { // simple polygon shape, can be written as svg:points sequence @@ -2059,9 +2061,9 @@ void XMLTextParagraphExport::exportContour( aSize, GetExport().GetMM100UnitConverter() ); // write point array - GetExport().AddAttribute( XML_NAMESPACE_DRAW, sXML_points, + GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_POINTS, aPoints.GetExportString()); - pElem = sXML_contour_polygon; + eElem = XML_CONTOUR_POLYGON; } else { @@ -2085,9 +2087,9 @@ void XMLTextParagraphExport::exportContour( } // write point array - GetExport().AddAttribute( XML_NAMESPACE_SVG, sXML_d, + GetExport().AddAttribute( XML_NAMESPACE_SVG, XML_D, aSvgDElement.GetExportString()); - pElem = sXML_contour_path; + eElem = XML_CONTOUR_PATH; } } @@ -2095,13 +2097,12 @@ void XMLTextParagraphExport::exportContour( { aAny = rPropSet->getPropertyValue( sIsAutomaticContour ); if( *(sal_Bool *)aAny.getValue() ) - GetExport().AddAttributeASCII( XML_NAMESPACE_DRAW, - sXML_recreate_on_edit, - sXML_true ); + GetExport().AddAttribute( XML_NAMESPACE_DRAW, + XML_RECREATE_ON_EDIT, XML_TRUE ); } // write object now - SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_DRAW, pElem, + SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_DRAW, eElem, sal_True, sal_True ); } @@ -2120,7 +2121,7 @@ void XMLTextParagraphExport::_exportTextGraphic( OUString sAutoStyle( sStyle ); sAutoStyle = Find( XML_STYLE_FAMILY_TEXT_FRAME, rPropSet, sStyle ); if( sAutoStyle.getLength() ) - GetExport().AddAttribute( XML_NAMESPACE_DRAW, sXML_style_name, + GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE_NAME, sAutoStyle ); addTextFrameAttributes( rPropSet, sal_False ); @@ -2134,13 +2135,11 @@ void XMLTextParagraphExport::_exportTextGraphic( // If there still is no url, then then graphic is empty if( sURL.getLength() ) { - GetExport().AddAttribute(XML_NAMESPACE_XLINK, sXML_href, sURL ); - GetExport().AddAttributeASCII( XML_NAMESPACE_XLINK, sXML_type, - sXML_simple ); - GetExport().AddAttributeASCII( XML_NAMESPACE_XLINK, sXML_show, - sXML_embed ); - GetExport().AddAttributeASCII( XML_NAMESPACE_XLINK, sXML_actuate, - sXML_onLoad ); + GetExport().AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, sURL ); + GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); + GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED ); + GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, + XML_ONLOAD ); } // draw:filter-name @@ -2148,7 +2147,7 @@ void XMLTextParagraphExport::_exportTextGraphic( aAny = rPropSet->getPropertyValue( sGraphicFilter ); aAny >>= sGrfFilter; if( sGrfFilter.getLength() ) - GetExport().AddAttribute( XML_NAMESPACE_DRAW, sXML_filter_name, + GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_FILTER_NAME, sGrfFilter ); // svg:transform @@ -2157,17 +2156,17 @@ void XMLTextParagraphExport::_exportTextGraphic( aAny >>= nVal; if( nVal != 0 ) { - OUStringBuffer sRet( sizeof(sXML_rotate)+4 ); - sRet.appendAscii(sXML_rotate); + OUStringBuffer sRet( GetXMLToken(XML_ROTATE).getLength()+4 ); + sRet.append( GetXMLToken(XML_ROTATE)); sRet.append( (sal_Unicode)'(' ); GetExport().GetMM100UnitConverter().convertNumber( sRet, (sal_Int32)nVal ); sRet.append( (sal_Unicode)')' ); - GetExport().AddAttribute( XML_NAMESPACE_SVG, sXML_transform, + GetExport().AddAttribute( XML_NAMESPACE_SVG, XML_TRANSFORM, sRet.makeStringAndClear() ); } SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_DRAW, - sXML_image, sal_False, sal_True ); + XML_IMAGE, sal_False, sal_True ); // optional office:binary-data GetExport().AddEmbeddedGraphicObjectAsBase64( sOrigURL ); @@ -2185,7 +2184,7 @@ void XMLTextParagraphExport::_exportTextGraphic( if( sAltText.getLength() ) { SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_SVG, - sXML_desc, sal_True, sal_False ); + XML_DESC, sal_True, sal_False ); GetExport().GetDocHandler()->characters( sAltText ); } */ @@ -2222,11 +2221,11 @@ void XMLTextParagraphExport::exportTextGraphic( pRangePropSet && lcl_txtpara_isBoundAsChar( xPropSet, xPropSetInfo ) && addTextStyleAttribute( *pRangePropSet ), - XML_NAMESPACE_TEXT, sXML_span, sal_False, sal_False ); + XML_NAMESPACE_TEXT, XML_SPAN, sal_False, sal_False ); { SvXMLElementExport aElem( GetExport(), addHyperlinkAttributes( xPropSet, xPropState,xPropSetInfo ), - XML_NAMESPACE_DRAW, sXML_a, sal_False, sal_False ); + XML_NAMESPACE_DRAW, XML_A, sal_False, sal_False ); _exportTextGraphic( xPropSet, xPropSetInfo ); } } @@ -2255,7 +2254,7 @@ void XMLTextParagraphExport::exportShape( lcl_txtpara_isBoundAsChar( xPropSet, xPropSet->getPropertySetInfo() ) && addTextStyleAttribute( *pRangePropSet ), - XML_NAMESPACE_TEXT, sXML_span, sal_False, sal_False ); + XML_NAMESPACE_TEXT, XML_SPAN, sal_False, sal_False ); sal_Int32 nFeatures = addTextFrameAttributes( xPropSet, sal_True ); GetExport().GetShapeExport()->exportShape( xShape, nFeatures ); } @@ -2298,7 +2297,7 @@ void XMLTextParagraphExport::exportAlternativeText( if( sAltText.getLength() ) { SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_SVG, - sXML_desc, sal_True, sal_False ); + XML_DESC, sal_True, sal_False ); GetExport().GetDocHandler()->characters( sAltText ); } } @@ -2327,11 +2326,11 @@ void XMLTextParagraphExport::exportTextEmbedded( pRangePropSet && lcl_txtpara_isBoundAsChar( xPropSet, xPropSetInfo ) && addTextStyleAttribute( *pRangePropSet ), - XML_NAMESPACE_TEXT, sXML_span, sal_False, sal_False ); + XML_NAMESPACE_TEXT, XML_SPAN, sal_False, sal_False ); { SvXMLElementExport aElem( GetExport(), addHyperlinkAttributes( xPropSet, xPropState,xPropSetInfo ), - XML_NAMESPACE_DRAW, sXML_a, sal_False, sal_False ); + XML_NAMESPACE_DRAW, XML_A, sal_False, sal_False ); _exportTextEmbedded( xPropSet, xPropSetInfo ); } } @@ -2353,10 +2352,10 @@ void XMLTextParagraphExport::_exportTextRange( OUString sText = rTextRange->getString(); if( sStyle.getLength() ) { - GetExport().AddAttribute( XML_NAMESPACE_TEXT, sXML_style_name, + GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME, sStyle ); SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, - sXML_span, sal_False, sal_False ); + XML_SPAN, sal_False, sal_False ); exportText( sText, rPrevCharIsSpace ); } else @@ -2438,36 +2437,33 @@ sal_Bool XMLTextParagraphExport::addHyperlinkAttributes( if( bExport ) { - GetExport().AddAttributeASCII( XML_NAMESPACE_XLINK, sXML_type, - sXML_simple ); - GetExport().AddAttribute( XML_NAMESPACE_XLINK, sXML_href, GetExport().GetRelativeReference( sHRef ) ); + GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); + GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, GetExport().GetRelativeReference( sHRef ) ); if( sName.getLength() > 0 ) - GetExport().AddAttribute( XML_NAMESPACE_OFFICE, sXML_name, sName ); + GetExport().AddAttribute( XML_NAMESPACE_OFFICE, XML_NAME, sName ); if( sTargetFrame.getLength() ) { GetExport().AddAttribute( XML_NAMESPACE_OFFICE, - sXML_target_frame_name, sTargetFrame ); - const sal_Char *pStr = + XML_TARGET_FRAME_NAME, sTargetFrame ); + enum XMLTokenEnum eTok = sTargetFrame.equalsAsciiL( "_blank", sizeof("_blank")-1 ) - ? sXML_new : sXML_replace; - GetExport().AddAttributeASCII( XML_NAMESPACE_XLINK, - sXML_show, pStr ); + ? XML_NEW : XML_REPLACE; + GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, eTok ); } if( bServerMap ) - GetExport().AddAttributeASCII( XML_NAMESPACE_OFFICE, - sXML_server_map, - sXML_true ); + GetExport().AddAttribute( XML_NAMESPACE_OFFICE, + XML_SERVER_MAP, XML_TRUE ); if( sUStyleName.getLength() ) GetExport().AddAttribute( XML_NAMESPACE_TEXT, - sXML_style_name, sUStyleName ); + XML_STYLE_NAME, sUStyleName ); if( sVStyleName.getLength() ) GetExport().AddAttribute( XML_NAMESPACE_TEXT, - sXML_visited_style_name, sVStyleName ); + XML_VISITED_STYLE_NAME, sVStyleName ); } return bExport; @@ -2481,7 +2477,7 @@ sal_Bool XMLTextParagraphExport::addTextStyleAttribute( if( sStyle.getLength() ) { GetExport().AddAttribute( XML_NAMESPACE_TEXT, - sXML_style_name, sStyle ); + XML_STYLE_NAME, sStyle ); bRet = sal_True; } @@ -2510,7 +2506,7 @@ void XMLTextParagraphExport::exportTextRange( { addHyperlinkAttributes( xPropSet, xPropState, xPropSetInfo ); SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, - sXML_a, sal_False, sal_False ); + XML_A, sal_False, sal_False ); // export events (if supported) OUString sHyperLinkEvents(RTL_CONSTASCII_USTRINGPARAM( @@ -2598,12 +2594,12 @@ void XMLTextParagraphExport::exportText( const OUString& rText, { OUStringBuffer sTmp; sTmp.append( (sal_Int32)nSpaceChars ); - GetExport().AddAttribute( XML_NAMESPACE_TEXT, sXML_c, + GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_C, sTmp.makeStringAndClear() ); } SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, - sXML_s, sal_False, sal_False ); + XML_S, sal_False, sal_False ); nSpaceChars = 0; } @@ -2617,14 +2613,14 @@ void XMLTextParagraphExport::exportText( const OUString& rText, case 0x0009: // Tab { SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, - sXML_tab_stop, sal_False, + XML_TAB_STOP, sal_False, sal_False ); } break; case 0x000A: // LF { SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, - sXML_line_break, sal_False, + XML_LINE_BREAK, sal_False, sal_False ); } break; @@ -2661,11 +2657,11 @@ void XMLTextParagraphExport::exportText( const OUString& rText, { OUStringBuffer sTmp; sTmp.append( (sal_Int32)nSpaceChars ); - GetExport().AddAttribute( XML_NAMESPACE_TEXT, sXML_c, + GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_C, sTmp.makeStringAndClear() ); } - SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, sXML_s, + SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, XML_S, sal_False, sal_False ); } } @@ -2689,11 +2685,11 @@ void XMLTextParagraphExport::exportTextDeclarations() aAny >>= sUrl; if (sUrl.getLength() > 0) { - GetExport().AddAttribute( XML_NAMESPACE_XLINK, sXML_href, + GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, GetExport().GetRelativeReference(sUrl) ); SvXMLElementExport aAutoMarkElement( GetExport(), XML_NAMESPACE_TEXT, - sXML_alphabetical_index_auto_mark_file, + XML_ALPHABETICAL_INDEX_AUTO_MARK_FILE, sal_True, sal_True ); } } @@ -2791,10 +2787,10 @@ void XMLTextParagraphExport::exportRuby( else { // prepare element names - OUString sRuby(RTL_CONSTASCII_USTRINGPARAM(sXML_ruby)); + OUString sRuby(GetXMLToken(XML_RUBY)); OUString sTextRuby(GetExport().GetNamespaceMap(). GetQNameByKey(XML_NAMESPACE_TEXT, sRuby)); - OUString sRubyBase(RTL_CONSTASCII_USTRINGPARAM(sXML_ruby_base)); + OUString sRubyBase(GetXMLToken(XML_RUBY_BASE)); OUString sTextRubyBase(GetExport().GetNamespaceMap(). GetQNameByKey(XML_NAMESPACE_TEXT, sRubyBase)); @@ -2820,7 +2816,7 @@ void XMLTextParagraphExport::exportRuby( sEmpty ); DBG_ASSERT(sStyleName.getLength() > 0, "I can't find the style!"); GetExport().AddAttribute(XML_NAMESPACE_TEXT, - sXML_style_name, sStyleName); + XML_STYLE_NAME, sStyleName); // export <text:ruby> and <text:ruby-base> start elements GetExport().GetDocHandler()->startElement( @@ -2847,11 +2843,11 @@ void XMLTextParagraphExport::exportRuby( { if (sOpenRubyCharStyle.getLength() > 0) GetExport().AddAttribute( - XML_NAMESPACE_TEXT, sXML_style_name, + XML_NAMESPACE_TEXT, XML_STYLE_NAME, sOpenRubyCharStyle); SvXMLElementExport aRuby( - GetExport(), XML_NAMESPACE_TEXT, sXML_ruby_text, + GetExport(), XML_NAMESPACE_TEXT, XML_RUBY_TEXT, sal_False, sal_False); GetExport().GetDocHandler()->characters(sOpenRubyText); diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx index 48ba341f4809..a42ec1ad5ffb 100644 --- a/xmloff/source/text/txtparai.cxx +++ b/xmloff/source/text/txtparai.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtparai.cxx,v $ * - * $Revision: 1.27 $ + * $Revision: 1.28 $ * - * last change: $Author: dvo $ $Date: 2001-06-22 16:35:55 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -103,9 +103,6 @@ #ifndef _XMLOFF_XMLIMP_HXX #include "xmlimp.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" -#endif #ifndef _XMLOFF_XMLTOKEN_HXX #include "xmltoken.hxx" #endif @@ -428,7 +425,7 @@ XMLImpCharContext_Impl::XMLImpCharContext_Impl( GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName, &aLocalName ); if( XML_NAMESPACE_TEXT == nPrefix && - aLocalName.compareToAscii( sXML_c ) == 0 ) + IsXMLToken( aLocalName, XML_C ) ) { sal_Int32 nTmp = xAttrList->getValueByIndex(i).toInt32(); if( nTmp > 0L ) @@ -444,14 +441,14 @@ XMLImpCharContext_Impl::XMLImpCharContext_Impl( if( 1U == nCount ) { - OUString sBuff( c ); + OUString sBuff( &c, 1 ); GetImport().GetTextImport()->InsertString( sBuff ); } else { OUStringBuffer sBuff( nCount ); while( nCount-- ) - sBuff.append( c ); + sBuff.append( &c, 1 ); GetImport().GetTextImport()->InsertString( sBuff.makeStringAndClear() ); } @@ -484,7 +481,7 @@ public: XMLStartReferenceContext_Impl ( SvXMLImport& rImport, sal_uInt16 nPrefix, - const String& rLocalName, + const OUString& rLocalName, XMLHints_Impl& rHnts, const Reference<xml::sax::XAttributeList> & xAttrList); }; @@ -494,7 +491,7 @@ TYPEINIT1( XMLStartReferenceContext_Impl, SvXMLImportContext ); XMLStartReferenceContext_Impl::XMLStartReferenceContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrefix, - const String& rLocalName, + const OUString& rLocalName, XMLHints_Impl& rHints, const Reference<xml::sax::XAttributeList> & xAttrList) : SvXMLImportContext(rImport, nPrefix, rLocalName) @@ -527,7 +524,7 @@ public: XMLEndReferenceContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrefix, - const String& rLocalName, + const OUString& rLocalName, XMLHints_Impl& rHnts, const Reference<xml::sax::XAttributeList> & xAttrList); }; @@ -537,7 +534,7 @@ TYPEINIT1( XMLEndReferenceContext_Impl, SvXMLImportContext ); XMLEndReferenceContext_Impl::XMLEndReferenceContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrefix, - const String& rLocalName, + const OUString& rLocalName, XMLHints_Impl& rHints, const Reference<xml::sax::XAttributeList> & xAttrList) : SvXMLImportContext(rImport, nPrefix, rLocalName) @@ -698,10 +695,10 @@ XMLImpHyperlinkContext_Impl::XMLImpHyperlinkContext_Impl( if( sShow.getLength() && !pHint->GetTargetFrameName().getLength() ) { - if( sShow.equalsAsciiL( sXML_new, sizeof(sXML_new)-1 ) ) + if( IsXMLToken( sShow, XML_NEW ) ) pHint->SetTargetFrameName( OUString( RTL_CONSTASCII_USTRINGPARAM("_blank" ) ) ); - else if( sShow.equalsAsciiL( sXML_replace, sizeof(sXML_replace)-1 ) ) + else if( IsXMLToken( sShow, XML_REPLACE ) ) pHint->SetTargetFrameName( OUString( RTL_CONSTASCII_USTRINGPARAM("_self" ) ) ); } @@ -720,7 +717,7 @@ SvXMLImportContext *XMLImpHyperlinkContext_Impl::CreateChildContext( const Reference< xml::sax::XAttributeList > & xAttrList ) { if ( (nPrefix == XML_NAMESPACE_OFFICE) && - (rLocalName.equalsAsciiL(sXML_events, sizeof(sXML_events)-1))) + IsXMLToken(rLocalName, XML_EVENTS) ) { XMLEventsImportContext* pCtxt = new XMLEventsImportContext( GetImport(), nPrefix, rLocalName); @@ -854,8 +851,7 @@ XMLImpRubyTextContext_Impl::XMLImpRubyTextContext_Impl( GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName, &aLocalName ); if( XML_NAMESPACE_TEXT == nPrefix && - aLocalName.equalsAsciiL( sXML_style_name, - sizeof(sXML_style_name)-1 ) ) + IsXMLToken( aLocalName, XML_STYLE_NAME ) ) { pHint->SetTextStyleName( rValue ); break; @@ -926,8 +922,7 @@ XMLImpRubyContext_Impl::XMLImpRubyContext_Impl( GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName, &aLocalName ); if( XML_NAMESPACE_TEXT == nPrefix && - aLocalName.equalsAsciiL( sXML_style_name, - sizeof(sXML_style_name)-1 ) ) + IsXMLToken( aLocalName, XML_STYLE_NAME ) ) { pHint->SetStyleName( rValue ); break; @@ -950,15 +945,13 @@ SvXMLImportContext *XMLImpRubyContext_Impl::CreateChildContext( SvXMLImportContext *pContext; if( XML_NAMESPACE_TEXT == nPrefix ) { - if( rLocalName.equalsAsciiL( sXML_ruby_base, - sizeof(sXML_ruby_base)-1 ) ) + if( IsXMLToken( rLocalName, XML_RUBY_BASE ) ) pContext = new XMLImpRubyBaseContext_Impl( GetImport(), nPrefix, rLocalName, xAttrList, rHints, rIgnoreLeadingSpace ); - else if( rLocalName.equalsAsciiL( sXML_ruby_text, - sizeof(sXML_ruby_text)-1 ) ) + else if( IsXMLToken( rLocalName, XML_RUBY_TEXT ) ) pContext = new XMLImpRubyTextContext_Impl( GetImport(), nPrefix, rLocalName, xAttrList, @@ -995,7 +988,7 @@ public: XMLIndexMarkImportContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrefix, - const String& rLocalName, + const OUString& rLocalName, enum XMLTextPElemTokens nTok, XMLHints_Impl& rHnts); @@ -1033,7 +1026,7 @@ TYPEINIT1( XMLIndexMarkImportContext_Impl, SvXMLImportContext ); XMLIndexMarkImportContext_Impl::XMLIndexMarkImportContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrefix, - const String& rLocalName, + const OUString& rLocalName, enum XMLTextPElemTokens eTok, XMLHints_Impl& rHnts) : SvXMLImportContext(rImport, nPrefix, rLocalName), @@ -1162,8 +1155,7 @@ void XMLIndexMarkImportContext_Impl::ProcessAttribute( case XML_TOK_TEXT_USER_INDEX_MARK: case XML_TOK_TEXT_ALPHA_INDEX_MARK: if ( (XML_NAMESPACE_TEXT == nNamespace) && - sLocalName.equalsAsciiL(sXML_string_value, - sizeof(sXML_string_value)-1)) + IsXMLToken( sLocalName, XML_STRING_VALUE ) ) { Any aAny; aAny <<= sValue; @@ -1179,7 +1171,7 @@ void XMLIndexMarkImportContext_Impl::ProcessAttribute( case XML_TOK_TEXT_USER_INDEX_MARK_END: case XML_TOK_TEXT_ALPHA_INDEX_MARK_END: if ( (XML_NAMESPACE_TEXT == nNamespace) && - sLocalName.equalsAsciiL(sXML_id, sizeof(sXML_id)-1) ) + IsXMLToken( sLocalName, XML_ID ) ) { sID = sValue; } @@ -1280,7 +1272,7 @@ public: XMLTOCMarkImportContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrefix, - const String& rLocalName, + const OUString& rLocalName, enum XMLTextPElemTokens nTok, XMLHints_Impl& rHnts); @@ -1297,7 +1289,7 @@ TYPEINIT1( XMLTOCMarkImportContext_Impl, XMLIndexMarkImportContext_Impl ); XMLTOCMarkImportContext_Impl::XMLTOCMarkImportContext_Impl( - SvXMLImport& rImport, sal_uInt16 nPrefix, const String& rLocalName, + SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName, enum XMLTextPElemTokens nTok, XMLHints_Impl& rHnts) : XMLIndexMarkImportContext_Impl(rImport, nPrefix, rLocalName, nTok, rHnts), @@ -1314,8 +1306,7 @@ void XMLTOCMarkImportContext_Impl::ProcessAttribute( DBG_ASSERT(rPropSet.is(), "need PropertySet"); if ((XML_NAMESPACE_TEXT == nNamespace) && - sLocalName.equalsAsciiL(sXML_outline_level, - sizeof(sXML_outline_level)-1)) + IsXMLToken( sLocalName, XML_OUTLINE_LEVEL ) ) { // ouline level: set Level property sal_Int32 nTmp; @@ -1348,7 +1339,7 @@ public: XMLUserIndexMarkImportContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrefix, - const String& rLocalName, + const OUString& rLocalName, enum XMLTextPElemTokens nTok, XMLHints_Impl& rHnts); @@ -1364,7 +1355,7 @@ protected: TYPEINIT1( XMLUserIndexMarkImportContext_Impl, XMLIndexMarkImportContext_Impl); XMLUserIndexMarkImportContext_Impl::XMLUserIndexMarkImportContext_Impl( - SvXMLImport& rImport, sal_uInt16 nPrefix, const String& rLocalName, + SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName, enum XMLTextPElemTokens nTok, XMLHints_Impl& rHnts) : XMLIndexMarkImportContext_Impl(rImport, nPrefix, rLocalName, nTok, rHnts), @@ -1426,7 +1417,7 @@ public: XMLAlphaIndexMarkImportContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrefix, - const String& rLocalName, + const OUString& rLocalName, enum XMLTextPElemTokens nTok, XMLHints_Impl& rHnts); @@ -1443,7 +1434,7 @@ TYPEINIT1( XMLAlphaIndexMarkImportContext_Impl, XMLIndexMarkImportContext_Impl ); XMLAlphaIndexMarkImportContext_Impl::XMLAlphaIndexMarkImportContext_Impl( - SvXMLImport& rImport, sal_uInt16 nPrefix, const String& rLocalName, + SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName, enum XMLTextPElemTokens nTok, XMLHints_Impl& rHnts) : XMLIndexMarkImportContext_Impl(rImport, nPrefix, rLocalName, nTok, rHnts), @@ -1458,13 +1449,13 @@ void XMLAlphaIndexMarkImportContext_Impl::ProcessAttribute( { if (XML_NAMESPACE_TEXT == nNamespace) { - if (sLocalName.equalsAsciiL(sXML_key1, sizeof(sXML_key1)-1)) + if ( IsXMLToken( sLocalName, XML_KEY1 ) ) { Any aAny; aAny <<= sValue; rPropSet->setPropertyValue(sPrimaryKey, aAny); } - else if (sLocalName.equalsAsciiL(sXML_key2, sizeof(sXML_key2)-1)) + else if ( IsXMLToken( sLocalName, XML_KEY2 ) ) { Any aAny; aAny <<= sValue; @@ -1520,7 +1511,7 @@ XMLImpSpanContext_Impl::XMLImpSpanContext_Impl( GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName, &aLocalName ); if( XML_NAMESPACE_TEXT == nPrefix && - aLocalName.compareToAscii( sXML_style_name ) == 0 ) + IsXMLToken( aLocalName, XML_STYLE_NAME ) ) aStyleName = xAttrList->getValueByIndex( i ); } diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx index 5570e27720b7..1eea29fc5eb5 100644 --- a/xmloff/source/text/txtprhdl.cxx +++ b/xmloff/source/text/txtprhdl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtprhdl.cxx,v $ * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * - * last change: $Author: mib $ $Date: 2001-06-20 12:01:47 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -114,8 +114,8 @@ #ifndef _XMLOFF_XMLUCONV_HXX #include "xmluconv.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_XMLANCHORTYPEPROPHDL_HXX #include "XMLAnchorTypePropHdl.hxx" @@ -390,11 +390,9 @@ sal_Bool XMLOpaquePropHdl_Impl::importXML( { sal_Bool bRet = sal_True; sal_Bool bVal = sal_False; - if( rStrImpValue.equalsAsciiL( - CONSTASCII_USTRINGPARAM_CMP( sXML_foreground ) ) ) + if( IsXMLToken( rStrImpValue, XML_FOREGROUND ) ) bVal = sal_True; - else if( !rStrImpValue.equalsAsciiL( - CONSTASCII_USTRINGPARAM_CMP( sXML_background ) ) ) + else if( !IsXMLToken( rStrImpValue, XML_BACKGROUND ) ) bRet = sal_False; if( bRet ) @@ -409,9 +407,9 @@ sal_Bool XMLOpaquePropHdl_Impl::exportXML( const SvXMLUnitConverter& rUnitConverter ) const { if( *(sal_Bool *)rValue.getValue() ) - rStrExpValue = OUString( RTL_CONSTASCII_USTRINGPARAM(sXML_foreground) ); + rStrExpValue = GetXMLToken( XML_FOREGROUND ); else - rStrExpValue = OUString( RTL_CONSTASCII_USTRINGPARAM(sXML_background) ); + rStrExpValue = GetXMLToken( XML_BACKGROUND ); return sal_True; } @@ -444,11 +442,9 @@ sal_Bool XMLContourModePropHdl_Impl::importXML( { sal_Bool bRet = sal_True; sal_Bool bVal = sal_False; - if( rStrImpValue.equalsAsciiL( - CONSTASCII_USTRINGPARAM_CMP( sXML_outside ) ) ) + if( IsXMLToken( rStrImpValue, XML_OUTSIDE ) ) bVal = sal_True; - else if( !rStrImpValue.equalsAsciiL( - CONSTASCII_USTRINGPARAM_CMP( sXML_full ) ) ) + else if( ! IsXMLToken( rStrImpValue, XML_FULL ) ) bRet = sal_False; if( bRet ) @@ -463,9 +459,9 @@ sal_Bool XMLContourModePropHdl_Impl::exportXML( const SvXMLUnitConverter& rUnitConverter ) const { if( *(sal_Bool *)rValue.getValue() ) - rStrExpValue = OUString( RTL_CONSTASCII_USTRINGPARAM(sXML_outside) ); + rStrExpValue = GetXMLToken( XML_OUTSIDE ); else - rStrExpValue = OUString( RTL_CONSTASCII_USTRINGPARAM(sXML_full) ); + rStrExpValue = GetXMLToken( XML_FULL ); return sal_True; } @@ -499,7 +495,7 @@ sal_Bool XMLParagraphOnlyPropHdl_Impl::importXML( sal_Bool bRet = sal_True; sal_Bool bVal = sal_False; - if( !rStrImpValue.compareToAscii( sXML_no_limit ) == 0 ) + if( ! IsXMLToken( rStrImpValue, XML_NO_LIMIT ) ) { sal_Int32 nValue = 0; bRet = rUnitConverter.convertNumber( nValue, rStrImpValue ); @@ -518,9 +514,9 @@ sal_Bool XMLParagraphOnlyPropHdl_Impl::exportXML( const SvXMLUnitConverter& rUnitConverter ) const { if( *(sal_Bool *)rValue.getValue() ) - rStrExpValue = OUString( RTL_CONSTASCII_USTRINGPARAM("1") ); + rStrExpValue = GetXMLToken( XML_1 ); else - rStrExpValue = OUString( RTL_CONSTASCII_USTRINGPARAM(sXML_no_limit) ); + rStrExpValue = GetXMLToken( XML_NO_LIMIT ); return sal_True; } @@ -599,8 +595,8 @@ class XMLFrameProtectPropHdl_Impl : public XMLPropertyHandler { const OUString sVal; public: - XMLFrameProtectPropHdl_Impl( const sal_Char *pVal ) : - sVal( OUString::createFromAscii(pVal) ) {} + XMLFrameProtectPropHdl_Impl( enum XMLTokenEnum eVal ) : + sVal( GetXMLToken(eVal) ) {} virtual ~XMLFrameProtectPropHdl_Impl (); virtual sal_Bool importXML( @@ -620,7 +616,7 @@ sal_Bool XMLFrameProtectPropHdl_Impl::importXML( { sal_Bool bRet = sal_True; sal_Bool bVal = sal_False; - if( !rStrImpValue.equalsAsciiL( CONSTASCII_USTRINGPARAM_CMP( sXML_none ) ) ) + if( ! IsXMLToken( rStrImpValue, XML_NONE ) ) { bRet = sal_False; SvXMLTokenEnumerator aTokenEnum( rStrImpValue ); @@ -650,7 +646,7 @@ sal_Bool XMLFrameProtectPropHdl_Impl::exportXML( if( *(sal_Bool *)rValue.getValue() ) { if( !rStrExpValue.getLength() || - rStrExpValue.equalsAsciiL(CONSTASCII_USTRINGPARAM_CMP(sXML_none)) ) + IsXMLToken( rStrExpValue, XML_NONE ) ) { rStrExpValue = sVal; } @@ -666,7 +662,7 @@ sal_Bool XMLFrameProtectPropHdl_Impl::exportXML( } else if( !rStrExpValue.getLength() ) { - rStrExpValue = OUString( RTL_CONSTASCII_USTRINGPARAM(sXML_none) ); + rStrExpValue = GetXMLToken( XML_NONE ); } return sal_True; @@ -856,8 +852,8 @@ class XMLGrfMirrorPropHdl_Impl : public XMLPropertyHandler sal_Bool bHori; public: - XMLGrfMirrorPropHdl_Impl( const sal_Char *pVal, sal_Bool bH ) : - sVal( OUString::createFromAscii(pVal) ), + XMLGrfMirrorPropHdl_Impl( enum XMLTokenEnum eVal, sal_Bool bH ) : + sVal( GetXMLToken( eVal ) ), bHori( bH ) {} virtual ~XMLGrfMirrorPropHdl_Impl (); @@ -878,7 +874,7 @@ sal_Bool XMLGrfMirrorPropHdl_Impl::importXML( { sal_Bool bRet = sal_True; sal_Bool bVal = sal_False; - if( !rStrImpValue.equalsAsciiL( CONSTASCII_USTRINGPARAM_CMP( sXML_none ) ) ) + if( ! IsXMLToken( rStrImpValue, XML_NONE ) ) { bRet = sal_False; SvXMLTokenEnumerator aTokenEnum( rStrImpValue ); @@ -887,8 +883,7 @@ sal_Bool XMLGrfMirrorPropHdl_Impl::importXML( { bRet = sal_True; if( aToken == sVal || - (bHori && aToken.equalsAsciiL( - CONSTASCII_USTRINGPARAM_CMP( sXML_horizontal ) ) ) ) + (bHori && IsXMLToken( aToken, XML_HORIZONTAL ) ) ) { bVal = sal_True; break; @@ -910,15 +905,15 @@ sal_Bool XMLGrfMirrorPropHdl_Impl::exportXML( if( *(sal_Bool *)rValue.getValue() ) { if( !rStrExpValue.getLength() || - rStrExpValue.equalsAsciiL(CONSTASCII_USTRINGPARAM_CMP(sXML_none)) ) + IsXMLToken( rStrExpValue, XML_NONE ) ) { rStrExpValue = sVal; } else if( bHori && - ( rStrExpValue.equalsAsciiL( CONSTASCII_USTRINGPARAM_CMP(sXML_horizontal_on_left_pages)) || - rStrExpValue.equalsAsciiL( CONSTASCII_USTRINGPARAM_CMP(sXML_horizontal_on_right_pages)) ) ) + ( IsXMLToken( rStrExpValue, XML_HORIZONTAL_ON_LEFT_PAGES ) || + IsXMLToken( rStrExpValue, XML_HORIZONTAL_ON_RIGHT_PAGES ) )) { - rStrExpValue = OUString(RTL_CONSTASCII_USTRINGPARAM(sXML_horizontal) ); + rStrExpValue = GetXMLToken( XML_HORIZONTAL ); } else { @@ -932,7 +927,7 @@ sal_Bool XMLGrfMirrorPropHdl_Impl::exportXML( } else if( !rStrExpValue.getLength() ) { - rStrExpValue = OUString( RTL_CONSTASCII_USTRINGPARAM(sXML_none) ); + rStrExpValue = GetXMLToken( XML_NONE ); } return sal_True; @@ -983,14 +978,12 @@ sal_Bool XMLTextEmphasizePropHdl_Impl::importXML( SvXMLTokenEnumerator aTokenEnum( rStrImpValue ); while( aTokenEnum.getNextToken( aToken ) ) { - if( !bHasPos && - aToken.equalsAsciiL( sXML_above, sizeof(sXML_above)-1 ) ) + if( !bHasPos && IsXMLToken( aToken, XML_ABOVE ) ) { bBelow = sal_False; bHasPos = sal_True; } - else if( !bHasPos && - aToken.equalsAsciiL( sXML_below, sizeof(sXML_below)-1 ) ) + else if( !bHasPos && IsXMLToken( aToken, XML_BELOW ) ) { bBelow = sal_True; bHasPos = sal_True; @@ -1041,9 +1034,9 @@ sal_Bool XMLTextEmphasizePropHdl_Impl::exportXML( { if( nType != 0 ) { - const sal_Char *pPos = bBelow ? sXML_below : sXML_above; + enum XMLTokenEnum ePos = bBelow ? XML_BELOW : XML_ABOVE; aOut.append( (sal_Unicode)' ' ); - aOut.appendAscii( pPos ); + aOut.append( GetXMLToken(ePos) ); } rStrExpValue = aOut.makeStringAndClear(); } @@ -1164,8 +1157,8 @@ class XMLTextSyncWidthHeightPropHdl_Impl : public XMLPropertyHandler const OUString sValue; public: - XMLTextSyncWidthHeightPropHdl_Impl( const sal_Char *pValue ) : - sValue( OUString::createFromAscii(pValue) ) {} + XMLTextSyncWidthHeightPropHdl_Impl( enum XMLTokenEnum eValue ) : + sValue( GetXMLToken(eValue) ) {} virtual ~XMLTextSyncWidthHeightPropHdl_Impl(); virtual sal_Bool importXML( @@ -1305,13 +1298,13 @@ const XMLPropertyHandler *XMLTextPropertyHandlerFactory_Impl::GetPropertyHandler pHdl = new XMLOpaquePropHdl_Impl; break; case XML_TYPE_TEXT_PROTECT_CONTENT: - pHdl = new XMLFrameProtectPropHdl_Impl( sXML_content ); + pHdl = new XMLFrameProtectPropHdl_Impl( XML_CONTENT ); break; case XML_TYPE_TEXT_PROTECT_SIZE: - pHdl = new XMLFrameProtectPropHdl_Impl( sXML_size ); + pHdl = new XMLFrameProtectPropHdl_Impl( XML_SIZE ); break; case XML_TYPE_TEXT_PROTECT_POSITION: - pHdl = new XMLFrameProtectPropHdl_Impl( sXML_position ); + pHdl = new XMLFrameProtectPropHdl_Impl( XML_POSITION ); break; case XML_TYPE_TEXT_ANCHOR_TYPE: pHdl = new XMLAnchorTypePropHdl; @@ -1350,13 +1343,13 @@ const XMLPropertyHandler *XMLTextPropertyHandlerFactory_Impl::GetPropertyHandler pHdl = new XMLConstantsPropertyHandler( pXML_VertRelAsChar_Enum, XML_TOKEN_INVALID ); break; case XML_TYPE_TEXT_MIRROR_VERTICAL: - pHdl = new XMLGrfMirrorPropHdl_Impl( sXML_vertical, sal_False ); + pHdl = new XMLGrfMirrorPropHdl_Impl( XML_VERTICAL, sal_False ); break; case XML_TYPE_TEXT_MIRROR_HORIZONTAL_LEFT: - pHdl = new XMLGrfMirrorPropHdl_Impl( sXML_horizontal_on_left_pages, sal_True ); + pHdl = new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_LEFT_PAGES, sal_True ); break; case XML_TYPE_TEXT_MIRROR_HORIZONTAL_RIGHT: - pHdl = new XMLGrfMirrorPropHdl_Impl( sXML_horizontal_on_right_pages, sal_True ); + pHdl = new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_RIGHT_PAGES, sal_True ); break; case XML_TYPE_TEXT_CLIP: pHdl = new XMLClipPropertyHandler; @@ -1365,41 +1358,36 @@ const XMLPropertyHandler *XMLTextPropertyHandlerFactory_Impl::GetPropertyHandler pHdl = new XMLTextEmphasizePropHdl_Impl; break; case XML_TYPE_TEXT_COMBINE: - pHdl = new XMLNamedBoolPropertyHdl( - OUString( RTL_CONSTASCII_USTRINGPARAM( sXML_lines ) ), - OUString( RTL_CONSTASCII_USTRINGPARAM( sXML_none ) ) ); + pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_LINES ), + GetXMLToken( XML_NONE ) ); break; case XML_TYPE_TEXT_COMBINE_CHARACTERS: - pHdl = new XMLNamedBoolPropertyHdl( - OUString( RTL_CONSTASCII_USTRINGPARAM( sXML_letters ) ), - OUString( RTL_CONSTASCII_USTRINGPARAM( sXML_none ) ) ); + pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_LETTERS ), + GetXMLToken( XML_NONE ) ); break; case XML_TYPE_TEXT_COMBINECHAR: pHdl = new XMLTextCombineCharPropHdl_Impl; break; case XML_TYPE_TEXT_AUTOSPACE: - pHdl = new XMLNamedBoolPropertyHdl( - OUString( RTL_CONSTASCII_USTRINGPARAM( sXML_ideograph_alpha ) ), - OUString( RTL_CONSTASCII_USTRINGPARAM( sXML_none ) ) ); + pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_IDEOGRAPH_ALPHA ), + GetXMLToken( XML_NONE ) ); break; case XML_TYPE_TEXT_PUNCTUATION_WRAP: - pHdl = new XMLNamedBoolPropertyHdl( - OUString( RTL_CONSTASCII_USTRINGPARAM( sXML_hanging ) ), - OUString( RTL_CONSTASCII_USTRINGPARAM( sXML_simple ) ) ); + pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_HANGING ), + GetXMLToken( XML_SIMPLE ) ); break; case XML_TYPE_TEXT_LINE_BREAK: - pHdl = new XMLNamedBoolPropertyHdl( - OUString( RTL_CONSTASCII_USTRINGPARAM( sXML_strict ) ), - OUString( RTL_CONSTASCII_USTRINGPARAM( sXML_normal ) ) ); + pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_STRICT ), + GetXMLToken( XML_NORMAL ) ); break; case XML_TYPE_TEXT_REL_WIDTH_HEIGHT: pHdl = new XMLTextRelWidthHeightPropHdl_Impl; break; case XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT: - pHdl = new XMLTextSyncWidthHeightPropHdl_Impl( sXML_scale ); + pHdl = new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE ); break; case XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT_MIN: - pHdl = new XMLTextSyncWidthHeightPropHdl_Impl( sXML_scale_min ); + pHdl = new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE_MIN ); break; case XML_TYPE_TEXT_RUBY_ADJUST: pHdl = new XMLConstantsPropertyHandler( pXML_RubyAdjust_Enum, XML_TOKEN_INVALID ); @@ -1411,9 +1399,8 @@ const XMLPropertyHandler *XMLTextPropertyHandlerFactory_Impl::GetPropertyHandler pHdl = new XMLTextRotationAnglePropHdl_Impl; break; case XML_TYPE_TEXT_ROTATION_SCALE: - pHdl = new XMLNamedBoolPropertyHdl( - OUString( RTL_CONSTASCII_USTRINGPARAM( sXML_fixed ) ), - OUString( RTL_CONSTASCII_USTRINGPARAM( sXML_line_height ) ) ); + pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_FIXED ), + GetXMLToken( XML_LINE_HEIGHT ) ); break; case XML_TYPE_TEXT_VERTICAL_ALIGN: pHdl = new XMLConstantsPropertyHandler( pXML_VerticalAlign_Enum, XML_TOKEN_INVALID ); diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx index c38a965f2694..f806a3cf8ca4 100644 --- a/xmloff/source/text/txtprmap.cxx +++ b/xmloff/source/text/txtprmap.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtprmap.cxx,v $ * - * $Revision: 1.53 $ + * $Revision: 1.54 $ * - * last change: $Author: mib $ $Date: 2001-06-26 09:51:04 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -66,8 +66,8 @@ #ifndef _XMLOFF_XMLNMSPE_HXX #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_TXTPRHDL_HXX #include "txtprhdl.hxx" @@ -78,142 +78,143 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; +using namespace ::xmloff::token; #define M_E( a, p, l, t, c ) \ - { a, XML_NAMESPACE_##p, sXML_##l, t, c } + { a, XML_NAMESPACE_##p, XML_##l, t, c } #define M_ED( a, p, l, t, c ) \ - { a, XML_NAMESPACE_##p, sXML_##l, (t) | MID_FLAG_DEFAULT_ITEM_EXPORT, c } + { a, XML_NAMESPACE_##p, XML_##l, (t) | MID_FLAG_DEFAULT_ITEM_EXPORT, c } XMLPropertyMapEntry aXMLParaPropMap[] = { // RES_LR_SPACE - M_E( "ParaLeftMargin", FO, margin_left, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARALEFTMARGIN ), - M_E( "ParaLeftMarginRelative", FO, margin_left, XML_TYPE_PERCENT16, CTF_PARALEFTMARGIN_REL ), - M_E( "ParaRightMargin", FO, margin_right, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARARIGHTMARGIN ), - M_E( "ParaRightMarginRelative", FO, margin_right, XML_TYPE_PERCENT16, CTF_PARARIGHTMARGIN_REL ), + M_E( "ParaLeftMargin", FO, MARGIN_LEFT, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARALEFTMARGIN ), + M_E( "ParaLeftMarginRelative", FO, MARGIN_LEFT, XML_TYPE_PERCENT16, CTF_PARALEFTMARGIN_REL ), + M_E( "ParaRightMargin", FO, MARGIN_RIGHT, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARARIGHTMARGIN ), + M_E( "ParaRightMarginRelative", FO, MARGIN_RIGHT, XML_TYPE_PERCENT16, CTF_PARARIGHTMARGIN_REL ), // RES_UL_SPACE - M_E( "ParaTopMargin", FO, margin_top, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARATOPMARGIN ), - M_E( "ParaTopMarginRelative", FO, margin_top, XML_TYPE_PERCENT16, CTF_PARATOPMARGIN_REL ), - M_E( "ParaBottomMargin", FO, margin_bottom, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARABOTTOMMARGIN ), - M_E( "ParaBottomMarginRelative",FO, margin_bottom, XML_TYPE_PERCENT16, CTF_PARABOTTOMMARGIN_REL ), + M_E( "ParaTopMargin", FO, MARGIN_TOP, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARATOPMARGIN ), + M_E( "ParaTopMarginRelative", FO, MARGIN_TOP, XML_TYPE_PERCENT16, CTF_PARATOPMARGIN_REL ), + M_E( "ParaBottomMargin", FO, MARGIN_BOTTOM, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARABOTTOMMARGIN ), + M_E( "ParaBottomMarginRelative",FO, MARGIN_BOTTOM, XML_TYPE_PERCENT16, CTF_PARABOTTOMMARGIN_REL ), // RES_CHRATR_CASEMAP - M_E( "CharCaseMap", FO, font_variant, XML_TYPE_TEXT_CASEMAP_VAR, 0 ), - M_E( "CharCaseMap", FO, text_transform, XML_TYPE_TEXT_CASEMAP, 0 ), + M_E( "CharCaseMap", FO, FONT_VARIANT, XML_TYPE_TEXT_CASEMAP_VAR, 0 ), + M_E( "CharCaseMap", FO, TEXT_TRANSFORM, XML_TYPE_TEXT_CASEMAP, 0 ), // RES_CHRATR_COLOR - M_ED( "CharColor", FO, color, XML_TYPE_COLORAUTO|MID_FLAG_MERGE_PROPERTY, 0 ), - M_ED( "CharColor", STYLE, use_window_font_color, XML_TYPE_ISAUTOCOLOR|MID_FLAG_MERGE_PROPERTY, 0 ), + M_ED( "CharColor", FO, COLOR, XML_TYPE_COLORAUTO|MID_FLAG_MERGE_PROPERTY, 0 ), + M_ED( "CharColor", STYLE, USE_WINDOW_FONT_COLOR, XML_TYPE_ISAUTOCOLOR|MID_FLAG_MERGE_PROPERTY, 0 ), // RES_CHRATR_CONTOUR - M_E( "CharContoured", STYLE, text_outline, XML_TYPE_BOOL, 0 ), + M_E( "CharContoured", STYLE, TEXT_OUTLINE, XML_TYPE_BOOL, 0 ), // RES_CHRATR_CROSSEDOUT - M_E( "CharStrikeout", STYLE, text_crossing_out, XML_TYPE_TEXT_CROSSEDOUT, 0), + M_E( "CharStrikeout", STYLE, TEXT_CROSSING_OUT, XML_TYPE_TEXT_CROSSEDOUT, 0), // RES_CHRATR_ESCAPEMENT - M_E( "CharEscapement", STYLE, text_position, XML_TYPE_TEXT_ESCAPEMENT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ), - M_E( "CharEscapementHeight", STYLE, text_position, XML_TYPE_TEXT_ESCAPEMENT_HEIGHT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ), + M_E( "CharEscapement", STYLE, TEXT_POSITION, XML_TYPE_TEXT_ESCAPEMENT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ), + M_E( "CharEscapementHeight", STYLE, TEXT_POSITION, XML_TYPE_TEXT_ESCAPEMENT_HEIGHT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ), // RES_CHRATR_FONT - M_ED( "CharFontName", STYLE, font_name, XML_TYPE_STRING|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTNAME ), + M_ED( "CharFontName", STYLE, FONT_NAME, XML_TYPE_STRING|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTNAME ), #ifdef CONV_STAR_FONTS - M_ED( "CharFontName", FO, font_family, XML_TYPE_TEXT_FONTFAMILYNAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTFAMILYNAME ), + M_ED( "CharFontName", FO, FONT_FAMILY, XML_TYPE_TEXT_FONTFAMILYNAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTFAMILYNAME ), #else - M_ED( "CharFontName", FO, font_family, XML_TYPE_TEXT_FONTFAMILYNAME, CTF_FONTFAMILYNAME ), + M_ED( "CharFontName", FO, FONT_FAMILY, XML_TYPE_TEXT_FONTFAMILYNAME, CTF_FONTFAMILYNAME ), #endif - M_ED( "CharFontStyleName",STYLE, font_style_name, XML_TYPE_STRING, CTF_FONTSTYLENAME ), - M_ED( "CharFontFamily", STYLE, font_family_generic,XML_TYPE_TEXT_FONTFAMILY, CTF_FONTFAMILY ), - M_ED( "CharFontPitch", STYLE, font_pitch, XML_TYPE_TEXT_FONTPITCH, CTF_FONTPITCH ), - M_ED( "CharFontCharSet", STYLE, font_charset, XML_TYPE_TEXT_FONTENCODING, CTF_FONTCHARSET ), + M_ED( "CharFontStyleName",STYLE, FONT_STYLE_NAME, XML_TYPE_STRING, CTF_FONTSTYLENAME ), + M_ED( "CharFontFamily", STYLE, FONT_FAMILY_GENERIC,XML_TYPE_TEXT_FONTFAMILY, CTF_FONTFAMILY ), + M_ED( "CharFontPitch", STYLE, FONT_PITCH, XML_TYPE_TEXT_FONTPITCH, CTF_FONTPITCH ), + M_ED( "CharFontCharSet", STYLE, FONT_CHARSET, XML_TYPE_TEXT_FONTENCODING, CTF_FONTCHARSET ), // RES_CHRATR_FONTSIZE - M_ED( "CharHeight", FO, font_size, XML_TYPE_CHAR_HEIGHT|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT ), - M_ED( "CharPropHeight",FO, font_size, XML_TYPE_CHAR_HEIGHT_PROP|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_REL ), - M_ED( "CharDiffHeight",STYLE,font_size_rel, XML_TYPE_CHAR_HEIGHT_DIFF, CTF_CHARHEIGHT_DIFF ), + M_ED( "CharHeight", FO, FONT_SIZE, XML_TYPE_CHAR_HEIGHT|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT ), + M_ED( "CharPropHeight",FO, FONT_SIZE, XML_TYPE_CHAR_HEIGHT_PROP|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_REL ), + M_ED( "CharDiffHeight",STYLE,FONT_SIZE_REL, XML_TYPE_CHAR_HEIGHT_DIFF, CTF_CHARHEIGHT_DIFF ), // RES_CHRATR_KERNING - M_E( "CharKerning", FO, letter_spacing, XML_TYPE_TEXT_KERNING, 0 ), + M_E( "CharKerning", FO, LETTER_SPACING, XML_TYPE_TEXT_KERNING, 0 ), // RES_CHRATR_LANGUAGE - M_ED( "CharLocale", FO, language, XML_TYPE_CHAR_LANGUAGE|MID_FLAG_MERGE_PROPERTY, 0 ), - M_ED( "CharLocale", FO, country, XML_TYPE_CHAR_COUNTRY|MID_FLAG_MERGE_PROPERTY, 0 ), + M_ED( "CharLocale", FO, LANGUAGE, XML_TYPE_CHAR_LANGUAGE|MID_FLAG_MERGE_PROPERTY, 0 ), + M_ED( "CharLocale", FO, COUNTRY, XML_TYPE_CHAR_COUNTRY|MID_FLAG_MERGE_PROPERTY, 0 ), // RES_CHRATR_POSTURE - M_E( "CharPosture", FO, font_style, XML_TYPE_TEXT_POSTURE, 0 ), + M_E( "CharPosture", FO, FONT_STYLE, XML_TYPE_TEXT_POSTURE, 0 ), // RES_CHRATR_PROPORTIONALFONTSIZE // TODO: not used? // RES_CHRATR_SHADOWED - M_E( "CharShadowed", FO, text_shadow, XML_TYPE_TEXT_SHADOWED, 0 ), + M_E( "CharShadowed", FO, TEXT_SHADOW, XML_TYPE_TEXT_SHADOWED, 0 ), // RES_CHRATR_UNDERLINE - M_E( "CharUnderline", STYLE, text_underline, XML_TYPE_TEXT_UNDERLINE, CTF_UNDERLINE ), - M_E( "CharUnderlineColor", STYLE, text_underline_color, XML_TYPE_TEXT_UNDERLINE_COLOR|MID_FLAG_MULTI_PROPERTY, CTF_UNDERLINE_COLOR ), - M_E( "CharUnderlineHasColor", STYLE, text_underline_color, XML_TYPE_TEXT_UNDERLINE_HASCOLOR|MID_FLAG_MERGE_ATTRIBUTE, CTF_UNDERLINE_HASCOLOR ), + M_E( "CharUnderline", STYLE, TEXT_UNDERLINE, XML_TYPE_TEXT_UNDERLINE, CTF_UNDERLINE ), + M_E( "CharUnderlineColor", STYLE, TEXT_UNDERLINE_COLOR, XML_TYPE_TEXT_UNDERLINE_COLOR|MID_FLAG_MULTI_PROPERTY, CTF_UNDERLINE_COLOR ), + M_E( "CharUnderlineHasColor", STYLE, TEXT_UNDERLINE_COLOR, XML_TYPE_TEXT_UNDERLINE_HASCOLOR|MID_FLAG_MERGE_ATTRIBUTE, CTF_UNDERLINE_HASCOLOR ), // RES_CHRATR_WEIGHT - M_E( "CharWeight", FO, font_weight, XML_TYPE_TEXT_WEIGHT, 0 ), + M_E( "CharWeight", FO, FONT_WEIGHT, XML_TYPE_TEXT_WEIGHT, 0 ), // RES_CHRATR_WORDLINEMODE - M_E( "CharWordMode", FO, score_spaces, XML_TYPE_NBOOL, 0 ), + M_E( "CharWordMode", FO, SCORE_SPACES, XML_TYPE_NBOOL, 0 ), // RES_CHRATR_AUTOKERN - M_E( "CharAutoKerning", STYLE, letter_kerning, XML_TYPE_BOOL, 0 ), + M_E( "CharAutoKerning", STYLE, LETTER_KERNING, XML_TYPE_BOOL, 0 ), // RES_CHRATR_BLINK - M_E( "CharFlash", STYLE, text_blinking, XML_TYPE_BOOL, 0 ), + M_E( "CharFlash", STYLE, TEXT_BLINKING, XML_TYPE_BOOL, 0 ), // RES_CHRATR_NOHYPHEN // TODO: not used? // RES_CHRATR_NOLINEBREAK // TODO: not used? // RES_CHRATR_BACKGROUND - M_E( "CharBackColor", STYLE, text_background_color, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ), - M_E( "CharBackTransparent", STYLE, text_background_color, XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE, 0 ), - M_E( "CharBackColor", FO, text_background_color, XML_TYPE_COLOR|MID_FLAG_SPECIAL_ITEM_EXPORT, CTF_OLDTEXTBACKGROUND ), + M_E( "CharBackColor", STYLE, TEXT_BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ), + M_E( "CharBackTransparent", STYLE, TEXT_BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE, 0 ), + M_E( "CharBackColor", FO, TEXT_BACKGROUND_COLOR, XML_TYPE_COLOR|MID_FLAG_SPECIAL_ITEM_EXPORT, CTF_OLDTEXTBACKGROUND ), // RES_CHRATR_CJK_FONT - M_ED( "CharFontNameAsian", STYLE, font_name_asian, XML_TYPE_STRING|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTNAME_CJK ), + M_ED( "CharFontNameAsian", STYLE, FONT_NAME_ASIAN, XML_TYPE_STRING|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTNAME_CJK ), #ifdef CONV_STAR_FONTS - M_ED( "CharFontNameAsian", STYLE, font_family_asian, XML_TYPE_TEXT_FONTFAMILYNAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTFAMILYNAME_CJK ), + M_ED( "CharFontNameAsian", STYLE, FONT_FAMILY_ASIAN, XML_TYPE_TEXT_FONTFAMILYNAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTFAMILYNAME_CJK ), #else - M_ED( "CharFontNameAsian", STYLE, font_family_asian, XML_TYPE_TEXT_FONTFAMILYNAME, CTF_FONTFAMILYNAME_CJK ), + M_ED( "CharFontNameAsian", STYLE, FONT_FAMILY_ASIAN, XML_TYPE_TEXT_FONTFAMILYNAME, CTF_FONTFAMILYNAME_CJK ), #endif - M_ED( "CharFontStyleNameAsian",STYLE, font_style_name_asian, XML_TYPE_STRING, CTF_FONTSTYLENAME_CJK ), - M_ED( "CharFontFamilyAsian", STYLE, font_family_generic_asian,XML_TYPE_TEXT_FONTFAMILY, CTF_FONTFAMILY_CJK ), - M_ED( "CharFontPitchAsian", STYLE, font_pitch_asian, XML_TYPE_TEXT_FONTPITCH, CTF_FONTPITCH_CJK ), - M_ED( "CharFontCharSetAsian", STYLE, font_charset_asian, XML_TYPE_TEXT_FONTENCODING, CTF_FONTCHARSET_CJK ), + M_ED( "CharFontStyleNameAsian",STYLE, FONT_STYLE_NAME_ASIAN, XML_TYPE_STRING, CTF_FONTSTYLENAME_CJK ), + M_ED( "CharFontFamilyAsian", STYLE, FONT_FAMILY_GENERIC_ASIAN,XML_TYPE_TEXT_FONTFAMILY, CTF_FONTFAMILY_CJK ), + M_ED( "CharFontPitchAsian", STYLE, FONT_PITCH_ASIAN, XML_TYPE_TEXT_FONTPITCH, CTF_FONTPITCH_CJK ), + M_ED( "CharFontCharSetAsian", STYLE, FONT_CHARSET_ASIAN, XML_TYPE_TEXT_FONTENCODING, CTF_FONTCHARSET_CJK ), // RES_CHRATR_CJK_FONTSIZE - M_ED( "CharHeightAsian", STYLE, font_size_asian, XML_TYPE_CHAR_HEIGHT|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_CJK ), - M_ED( "CharPropHeightAsian",STYLE, font_size_asian, XML_TYPE_CHAR_HEIGHT_PROP|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_REL_CJK ), - M_ED( "CharDiffHeightAsian",STYLE,font_size_rel_asian, XML_TYPE_CHAR_HEIGHT_DIFF, CTF_CHARHEIGHT_DIFF_CJK ), + M_ED( "CharHeightAsian", STYLE, FONT_SIZE_ASIAN, XML_TYPE_CHAR_HEIGHT|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_CJK ), + M_ED( "CharPropHeightAsian",STYLE, FONT_SIZE_ASIAN, XML_TYPE_CHAR_HEIGHT_PROP|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_REL_CJK ), + M_ED( "CharDiffHeightAsian",STYLE,FONT_SIZE_REL_ASIAN, XML_TYPE_CHAR_HEIGHT_DIFF, CTF_CHARHEIGHT_DIFF_CJK ), // RES_CHRATR_CJK_LANGUAGE - M_ED( "CharLocaleAsian", STYLE, language_asian, XML_TYPE_CHAR_LANGUAGE|MID_FLAG_MERGE_PROPERTY, 0 ), - M_ED( "CharLocaleAsian", STYLE, country_asian, XML_TYPE_CHAR_COUNTRY|MID_FLAG_MERGE_PROPERTY, 0 ), + M_ED( "CharLocaleAsian", STYLE, LANGUAGE_ASIAN, XML_TYPE_CHAR_LANGUAGE|MID_FLAG_MERGE_PROPERTY, 0 ), + M_ED( "CharLocaleAsian", STYLE, COUNTRY_ASIAN, XML_TYPE_CHAR_COUNTRY|MID_FLAG_MERGE_PROPERTY, 0 ), // RES_CHRATR_CJK_POSTURE - M_E( "CharPostureAsian", STYLE, font_style_asian, XML_TYPE_TEXT_POSTURE, 0 ), + M_E( "CharPostureAsian", STYLE, FONT_STYLE_ASIAN, XML_TYPE_TEXT_POSTURE, 0 ), // RES_CHRATR_CJK_WEIGHT - M_E( "CharWeightAsian", STYLE, font_weight_asian, XML_TYPE_TEXT_WEIGHT, 0 ), + M_E( "CharWeightAsian", STYLE, FONT_WEIGHT_ASIAN, XML_TYPE_TEXT_WEIGHT, 0 ), // RES_CHRATR_CTL_FONT - M_ED( "CharFontNameComplex", STYLE, font_name_complex, XML_TYPE_STRING|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTNAME_CTL ), + M_ED( "CharFontNameComplex", STYLE, FONT_NAME_COMPLEX, XML_TYPE_STRING|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTNAME_CTL ), #ifdef CONV_STAR_FONTS - M_ED( "CharFontNameComplex", STYLE, font_family_complex, XML_TYPE_TEXT_FONTFAMILYNAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTFAMILYNAME_CTL ), + M_ED( "CharFontNameComplex", STYLE, FONT_FAMILY_COMPLEX, XML_TYPE_TEXT_FONTFAMILYNAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTFAMILYNAME_CTL ), #else - M_ED( "CharFontNameComplex", STYLE, font_family_complex, XML_TYPE_TEXT_FONTFAMILYNAME, CTF_FONTFAMILYNAME_CTL ), + M_ED( "CharFontNameComplex", STYLE, FONT_FAMILY_COMPLEX, XML_TYPE_TEXT_FONTFAMILYNAME, CTF_FONTFAMILYNAME_CTL ), #endif - M_ED( "CharFontStyleNameComplex",STYLE, font_style_name_complex, XML_TYPE_STRING, CTF_FONTSTYLENAME_CTL ), - M_ED( "CharFontFamilyComplex", STYLE, font_family_generic_complex,XML_TYPE_TEXT_FONTFAMILY, CTF_FONTFAMILY_CTL ), - M_ED( "CharFontPitchComplex", STYLE, font_pitch_complex, XML_TYPE_TEXT_FONTPITCH, CTF_FONTPITCH_CTL ), - M_ED( "CharFontCharSetComplex", STYLE, font_charset_complex, XML_TYPE_TEXT_FONTENCODING, CTF_FONTCHARSET_CTL ), + M_ED( "CharFontStyleNameComplex",STYLE, FONT_STYLE_NAME_COMPLEX, XML_TYPE_STRING, CTF_FONTSTYLENAME_CTL ), + M_ED( "CharFontFamilyComplex", STYLE, FONT_FAMILY_GENERIC_COMPLEX,XML_TYPE_TEXT_FONTFAMILY, CTF_FONTFAMILY_CTL ), + M_ED( "CharFontPitchComplex", STYLE, FONT_PITCH_COMPLEX, XML_TYPE_TEXT_FONTPITCH, CTF_FONTPITCH_CTL ), + M_ED( "CharFontCharSetComplex", STYLE, FONT_CHARSET_COMPLEX, XML_TYPE_TEXT_FONTENCODING, CTF_FONTCHARSET_CTL ), // RES_CHRATR_CTL_FONTSIZE - M_ED( "CharHeightComplex", STYLE, font_size_complex, XML_TYPE_CHAR_HEIGHT|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_CTL ), - M_ED( "CharPropHeightComplex",STYLE, font_size_complex, XML_TYPE_CHAR_HEIGHT_PROP|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_REL_CTL ), - M_ED( "CharDiffHeightComplex",STYLE,font_size_rel_complex, XML_TYPE_CHAR_HEIGHT_DIFF, CTF_CHARHEIGHT_DIFF_CTL ), + M_ED( "CharHeightComplex", STYLE, FONT_SIZE_COMPLEX, XML_TYPE_CHAR_HEIGHT|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_CTL ), + M_ED( "CharPropHeightComplex",STYLE, FONT_SIZE_COMPLEX, XML_TYPE_CHAR_HEIGHT_PROP|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_REL_CTL ), + M_ED( "CharDiffHeightComplex",STYLE,FONT_SIZE_REL_COMPLEX, XML_TYPE_CHAR_HEIGHT_DIFF, CTF_CHARHEIGHT_DIFF_CTL ), // RES_CHRATR_CTL_LANGUAGE - M_ED( "CharLocaleComplex", STYLE, language_complex, XML_TYPE_CHAR_LANGUAGE|MID_FLAG_MERGE_PROPERTY, 0 ), - M_ED( "CharLocaleComplex", STYLE, country_complex, XML_TYPE_CHAR_COUNTRY|MID_FLAG_MERGE_PROPERTY, 0 ), + M_ED( "CharLocaleComplex", STYLE, LANGUAGE_COMPLEX, XML_TYPE_CHAR_LANGUAGE|MID_FLAG_MERGE_PROPERTY, 0 ), + M_ED( "CharLocaleComplex", STYLE, COUNTRY_COMPLEX, XML_TYPE_CHAR_COUNTRY|MID_FLAG_MERGE_PROPERTY, 0 ), // RES_CHRATR_CTL_POSTURE - M_E( "CharPostureComplex", STYLE, font_style_complex, XML_TYPE_TEXT_POSTURE, 0 ), + M_E( "CharPostureComplex", STYLE, FONT_STYLE_COMPLEX, XML_TYPE_TEXT_POSTURE, 0 ), // RES_CHRATR_CTL_WEIGHT - M_E( "CharWeightComplex", STYLE, font_weight_complex, XML_TYPE_TEXT_WEIGHT, 0 ), + M_E( "CharWeightComplex", STYLE, FONT_WEIGHT_COMPLEX, XML_TYPE_TEXT_WEIGHT, 0 ), // RES_CHRATR_ROTATE - M_E( "CharRotation", STYLE, text_rotation_angle, XML_TYPE_TEXT_ROTATION_ANGLE, 0 ), - M_E( "CharRotationIsFitToLine", STYLE, text_rotation_scale, XML_TYPE_TEXT_ROTATION_SCALE, 0 ), + M_E( "CharRotation", STYLE, TEXT_ROTATION_ANGLE, XML_TYPE_TEXT_ROTATION_ANGLE, 0 ), + M_E( "CharRotationIsFitToLine", STYLE, TEXT_ROTATION_SCALE, XML_TYPE_TEXT_ROTATION_SCALE, 0 ), // RES_CHRATR_EMPHASIS_MARK - M_E( "CharEmphasis", STYLE, text_emphasize, XML_TYPE_TEXT_EMPHASIZE, 0 ), + M_E( "CharEmphasis", STYLE, TEXT_EMPHASIZE, XML_TYPE_TEXT_EMPHASIZE, 0 ), // RES_CHRATR_TWO_LINES - M_E( "CharCombineIsOn", STYLE, text_combine, XML_TYPE_TEXT_COMBINE, 0 ), - M_E( "CharCombinePrefix", STYLE, text_combine_start_char, XML_TYPE_TEXT_COMBINECHAR, 0 ), - M_E( "CharCombineSuffix", STYLE, text_combine_end_char, XML_TYPE_TEXT_COMBINECHAR, 0 ), + M_E( "CharCombineIsOn", STYLE, TEXT_COMBINE, XML_TYPE_TEXT_COMBINE, 0 ), + M_E( "CharCombinePrefix", STYLE, TEXT_COMBINE_START_CHAR, XML_TYPE_TEXT_COMBINECHAR, 0 ), + M_E( "CharCombineSuffix", STYLE, TEXT_COMBINE_END_CHAR, XML_TYPE_TEXT_COMBINECHAR, 0 ), // RES_CHRATR_SCALEW - M_E( "CharScaleWidth", STYLE, text_scale, XML_TYPE_PERCENT16, 0 ), + M_E( "CharScaleWidth", STYLE, TEXT_SCALE, XML_TYPE_PERCENT16, 0 ), //RES_CHRATR_RELIEF - M_E( "CharRelief", STYLE, font_relief, XML_TYPE_TEXT_FONT_RELIEF, 0 ), + M_E( "CharRelief", STYLE, FONT_RELIEF, XML_TYPE_TEXT_FONT_RELIEF, 0 ), // RES_TXTATR_INETFMT // TODO // RES_TXTATR_REFMARK @@ -236,35 +237,35 @@ XMLPropertyMapEntry aXMLParaPropMap[] = // TODO // RES_PARATR_LINESPACING - M_E( "ParaLineSpacing", FO, line_height, XML_TYPE_LINE_SPACE_FIXED, 0 ), - M_E( "ParaLineSpacing", STYLE, line_height_at_least, XML_TYPE_LINE_SPACE_MINIMUM, 0 ), - M_E( "ParaLineSpacing", STYLE, line_spacing, XML_TYPE_LINE_SPACE_DISTANCE, 0 ), + M_E( "ParaLineSpacing", FO, LINE_HEIGHT, XML_TYPE_LINE_SPACE_FIXED, 0 ), + M_E( "ParaLineSpacing", STYLE, LINE_HEIGHT_AT_LEAST, XML_TYPE_LINE_SPACE_MINIMUM, 0 ), + M_E( "ParaLineSpacing", STYLE, LINE_SPACING, XML_TYPE_LINE_SPACE_DISTANCE, 0 ), // RES_PARATR_ADJUST - M_E( "ParaAdjust", FO, text_align, XML_TYPE_TEXT_ADJUST, 0 ), - M_E( "ParaLastLineAdjust", FO, text_align_last, XML_TYPE_TEXT_ADJUSTLAST, 0 ), - M_E( "ParaExpandSingleWord",STYLE, justify_single_word,XML_TYPE_BOOL, 0 ), + M_E( "ParaAdjust", FO, TEXT_ALIGN, XML_TYPE_TEXT_ADJUST, 0 ), + M_E( "ParaLastLineAdjust", FO, TEXT_ALIGN_LAST, XML_TYPE_TEXT_ADJUSTLAST, 0 ), + M_E( "ParaExpandSingleWord",STYLE, JUSTIFY_SINGLE_WORD,XML_TYPE_BOOL, 0 ), // RES_PARATR_SPLIT - M_E( "ParaSplit", STYLE, break_inside, XML_TYPE_TEXT_SPLIT, 0 ), + M_E( "ParaSplit", STYLE, BREAK_INSIDE, XML_TYPE_TEXT_SPLIT, 0 ), // RES_PARATR_ORPHANS - M_E( "ParaOrphans", FO, orphans, XML_TYPE_NUMBER8, 0 ), + M_E( "ParaOrphans", FO, ORPHANS, XML_TYPE_NUMBER8, 0 ), // RES_PARATR_WIDOWS - M_E( "ParaWidows", FO, widows, XML_TYPE_NUMBER8, 0 ), + M_E( "ParaWidows", FO, WIDOWS, XML_TYPE_NUMBER8, 0 ), // RES_PARATR_TABSTOP - M_ED( "ParaTabStops", STYLE, tab_stops, MID_FLAG_ELEMENT_ITEM|XML_TYPE_TEXT_TABSTOP, CTF_TABSTOP ), // this is not realy a string! + M_ED( "ParaTabStops", STYLE, TAB_STOPS, MID_FLAG_ELEMENT_ITEM|XML_TYPE_TEXT_TABSTOP, CTF_TABSTOP ), // this is not realy a string! // RES_PARATR_HYPHENZONE - M_E( "ParaIsHyphenation", FO, hyphenate, XML_TYPE_BOOL, 0 ), - M_E( "ParaHyphenationMaxLeadingChars", FO, hyphenation_remain_char_count, XML_TYPE_NUMBER16, 0 ), - M_E( "ParaHyphenationMaxTrailingChars",FO, hyphenation_push_char_count, XML_TYPE_NUMBER16, 0 ), - M_E( "ParaHyphenationMaxHyphens", FO, hyphenation_ladder_count, XML_TYPE_NUMBER16_NONE, 0 ), + M_E( "ParaIsHyphenation", FO, HYPHENATE, XML_TYPE_BOOL, 0 ), + M_E( "ParaHyphenationMaxLeadingChars", FO, HYPHENATION_REMAIN_CHAR_COUNT, XML_TYPE_NUMBER16, 0 ), + M_E( "ParaHyphenationMaxTrailingChars",FO, HYPHENATION_PUSH_CHAR_COUNT, XML_TYPE_NUMBER16, 0 ), + M_E( "ParaHyphenationMaxHyphens", FO, HYPHENATION_LADDER_COUNT, XML_TYPE_NUMBER16_NONE, 0 ), // RES_PARATR_DROP - M_E( "DropCapWholeWord", STYLE, length, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BOOL, CTF_DROPCAPWHOLEWORD ), - M_E( "DropCapCharStyleName", STYLE, style_name, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_DROPCAPCHARSTYLE ), - M_E( "DropCapFormat", STYLE, drop_cap, MID_FLAG_ELEMENT_ITEM|XML_TYPE_TEXT_DROPCAP, CTF_DROPCAPFORMAT ), + M_E( "DropCapWholeWord", STYLE, LENGTH, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BOOL, CTF_DROPCAPWHOLEWORD ), + M_E( "DropCapCharStyleName", STYLE, STYLE_NAME, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_DROPCAPCHARSTYLE ), + M_E( "DropCapFormat", STYLE, DROP_CAP, MID_FLAG_ELEMENT_ITEM|XML_TYPE_TEXT_DROPCAP, CTF_DROPCAPFORMAT ), // RES_PARATR_REGISTER - M_E( "ParaRegisterModeActive", STYLE, register_true, XML_TYPE_BOOL, 0 ), + M_E( "ParaRegisterModeActive", STYLE, REGISTER_TRUE, XML_TYPE_BOOL, 0 ), // RES_PARATR_NUMRULE - M_E( "NumberingStyleName", STYLE, list_style_name, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_NUMBERINGSTYLENAME ), - M_E( "IsNumbering", TEXT, enable_numbering, XML_TYPE_BOOL, 0 ), + M_E( "NumberingStyleName", STYLE, LIST_STYLE_NAME, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_NUMBERINGSTYLENAME ), + M_E( "IsNumbering", TEXT, ENABLE_NUMBERING, XML_TYPE_BOOL, 0 ), // RES_FILL_ORDER // not required @@ -274,15 +275,15 @@ XMLPropertyMapEntry aXMLParaPropMap[] = // not required // RES_LR_SPACE - M_E( "ParaFirstLineIndent", FO, text_indent, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARAFIRSTLINE ), - M_E( "ParaFirstLineIndentRelative", FO, text_indent, XML_TYPE_PERCENT, CTF_PARAFIRSTLINE_REL ), - M_E( "ParaIsAutoFirstLineIndent", STYLE, auto_text_indent, XML_TYPE_BOOL, 0 ), + M_E( "ParaFirstLineIndent", FO, TEXT_INDENT, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARAFIRSTLINE ), + M_E( "ParaFirstLineIndentRelative", FO, TEXT_INDENT, XML_TYPE_PERCENT, CTF_PARAFIRSTLINE_REL ), + M_E( "ParaIsAutoFirstLineIndent", STYLE, AUTO_TEXT_INDENT, XML_TYPE_BOOL, 0 ), // RES_PAGEDESC - M_E( "PageDescName", STYLE, master_page_name, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_PAGEDESCNAME ), - M_E( "PageNumberOffset", STYLE, page_number, XML_TYPE_NUMBER16, 0 ), + M_E( "PageDescName", STYLE, MASTER_PAGE_NAME, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_PAGEDESCNAME ), + M_E( "PageNumberOffset", STYLE, PAGE_NUMBER, XML_TYPE_NUMBER16, 0 ), // RES_BREAK : TODO: does this work? - M_E( "BreakType", FO, break_before, XML_TYPE_TEXT_BREAKBEFORE|MID_FLAG_MULTI_PROPERTY, 0 ), - M_E( "BreakType", FO, break_after, XML_TYPE_TEXT_BREAKAFTER, 0 ), + M_E( "BreakType", FO, BREAK_BEFORE, XML_TYPE_TEXT_BREAKBEFORE|MID_FLAG_MULTI_PROPERTY, 0 ), + M_E( "BreakType", FO, BREAK_AFTER, XML_TYPE_TEXT_BREAKAFTER, 0 ), // RES_CNTNT // not required // RES_HEADER @@ -304,37 +305,37 @@ XMLPropertyMapEntry aXMLParaPropMap[] = // RES_ANCHOR // not required // RES_BACKGROUND - M_E( "ParaBackColor", FO, background_color, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ), - M_E( "ParaBackTransparent", FO, background_color, XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE, 0 ), - M_E( "ParaBackGraphicLocation", STYLE, position, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BUILDIN_CMP_ONLY, CTF_BACKGROUND_POS ), - M_E( "ParaBackGraphicFilter",STYLE, filter_name, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_BACKGROUND_FILTER ), - M_E( "ParaBackGraphicURL", STYLE, background_image, MID_FLAG_ELEMENT_ITEM|XML_TYPE_STRING, CTF_BACKGROUND_URL ), + M_E( "ParaBackColor", FO, BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ), + M_E( "ParaBackTransparent", FO, BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE, 0 ), + M_E( "ParaBackGraphicLocation", STYLE, POSITION, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BUILDIN_CMP_ONLY, CTF_BACKGROUND_POS ), + M_E( "ParaBackGraphicFilter",STYLE, FILTER_NAME, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_BACKGROUND_FILTER ), + M_E( "ParaBackGraphicURL", STYLE, BACKGROUND_IMAGE, MID_FLAG_ELEMENT_ITEM|XML_TYPE_STRING, CTF_BACKGROUND_URL ), // RES_BOX - M_E( "LeftBorder", STYLE, border_line_width, XML_TYPE_BORDER_WIDTH, CTF_ALLBORDERWIDTH ), - M_E( "LeftBorder", STYLE, border_line_width_left, XML_TYPE_BORDER_WIDTH, CTF_LEFTBORDERWIDTH ), - M_E( "RightBorder", STYLE, border_line_width_right, XML_TYPE_BORDER_WIDTH, CTF_RIGHTBORDERWIDTH ), - M_E( "TopBorder", STYLE, border_line_width_top, XML_TYPE_BORDER_WIDTH, CTF_TOPBORDERWIDTH ), - M_E( "BottomBorder", STYLE, border_line_width_bottom, XML_TYPE_BORDER_WIDTH, CTF_BOTTOMBORDERWIDTH ), - - M_E( "LeftBorderDistance", FO, padding, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_ALLBORDERDISTANCE ), // need special import filtering - M_E( "LeftBorderDistance", FO, padding_left, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_LEFTBORDERDISTANCE ), - M_E( "RightBorderDistance", FO, padding_right, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_RIGHTBORDERDISTANCE ), - M_E( "TopBorderDistance", FO, padding_top, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_TOPBORDERDISTANCE ), - M_E( "BottomBorderDistance",FO, padding_bottom, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_BOTTOMBORDERDISTANCE ), - - M_E( "LeftBorder", FO, border, XML_TYPE_BORDER, CTF_ALLBORDER ), - M_E( "LeftBorder", FO, border_left, XML_TYPE_BORDER, CTF_LEFTBORDER ), - M_E( "RightBorder", FO, border_right, XML_TYPE_BORDER, CTF_RIGHTBORDER ), - M_E( "TopBorder", FO, border_top, XML_TYPE_BORDER, CTF_TOPBORDER ), - M_E( "BottomBorder", FO, border_bottom, XML_TYPE_BORDER, CTF_BOTTOMBORDER ), + M_E( "LeftBorder", STYLE, BORDER_LINE_WIDTH, XML_TYPE_BORDER_WIDTH, CTF_ALLBORDERWIDTH ), + M_E( "LeftBorder", STYLE, BORDER_LINE_WIDTH_LEFT, XML_TYPE_BORDER_WIDTH, CTF_LEFTBORDERWIDTH ), + M_E( "RightBorder", STYLE, BORDER_LINE_WIDTH_RIGHT, XML_TYPE_BORDER_WIDTH, CTF_RIGHTBORDERWIDTH ), + M_E( "TopBorder", STYLE, BORDER_LINE_WIDTH_TOP, XML_TYPE_BORDER_WIDTH, CTF_TOPBORDERWIDTH ), + M_E( "BottomBorder", STYLE, BORDER_LINE_WIDTH_BOTTOM, XML_TYPE_BORDER_WIDTH, CTF_BOTTOMBORDERWIDTH ), + + M_E( "LeftBorderDistance", FO, PADDING, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_ALLBORDERDISTANCE ), // need special import filtering + M_E( "LeftBorderDistance", FO, PADDING_LEFT, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_LEFTBORDERDISTANCE ), + M_E( "RightBorderDistance", FO, PADDING_RIGHT, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_RIGHTBORDERDISTANCE ), + M_E( "TopBorderDistance", FO, PADDING_TOP, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_TOPBORDERDISTANCE ), + M_E( "BottomBorderDistance",FO, PADDING_BOTTOM, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_BOTTOMBORDERDISTANCE ), + + M_E( "LeftBorder", FO, BORDER, XML_TYPE_BORDER, CTF_ALLBORDER ), + M_E( "LeftBorder", FO, BORDER_LEFT, XML_TYPE_BORDER, CTF_LEFTBORDER ), + M_E( "RightBorder", FO, BORDER_RIGHT, XML_TYPE_BORDER, CTF_RIGHTBORDER ), + M_E( "TopBorder", FO, BORDER_TOP, XML_TYPE_BORDER, CTF_TOPBORDER ), + M_E( "BottomBorder", FO, BORDER_BOTTOM, XML_TYPE_BORDER, CTF_BOTTOMBORDER ), // RES_SHADOW - M_E( "ParaShadowFormat", STYLE, shadow, XML_TYPE_TEXT_SHADOW, 0 ), + M_E( "ParaShadowFormat", STYLE, SHADOW, XML_TYPE_TEXT_SHADOW, 0 ), // RES_FRMMACRO // not required // RES_COL // not required // RES_KEEP - M_E( "ParaKeepTogether", FO, keep_with_next, XML_TYPE_BOOL, 0 ), + M_E( "ParaKeepTogether", FO, KEEP_WITH_NEXT, XML_TYPE_BOOL, 0 ), // RES_URL // not required // RES_EDIT_IN_READONLY @@ -345,146 +346,146 @@ XMLPropertyMapEntry aXMLParaPropMap[] = // not required // RES_LINENUMBER - M_E( "ParaLineNumberCount", TEXT, number_lines, XML_TYPE_BOOL, 0 ), - M_E( "ParaLineNumberStartValue", TEXT, line_number, XML_TYPE_NUMBER, 0 ), + M_E( "ParaLineNumberCount", TEXT, NUMBER_LINES, XML_TYPE_BOOL, 0 ), + M_E( "ParaLineNumberStartValue", TEXT, LINE_NUMBER, XML_TYPE_NUMBER, 0 ), // RES_FTN_AT_TXTEND // not required // RES_END_AT_TXTEND // not required // RES_UNKNOWNATR_CONTAINER - M_E( "UserDefinedAttributes", TEXT, xmlns, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ), - M_ED( "ParaIsCharacterDistance", STYLE, text_autospace, XML_TYPE_TEXT_AUTOSPACE, 0 ), - M_ED( "ParaIsHangingPunctuation", STYLE, punctuation_wrap, XML_TYPE_TEXT_PUNCTUATION_WRAP, 0 ), - M_ED( "ParaIsForbiddenRules", STYLE, line_break, XML_TYPE_TEXT_LINE_BREAK, 0 ), - M_E( "TabStopDistance", STYLE, tab_stop_distance, XML_TYPE_MEASURE, 0 ), + M_E( "UserDefinedAttributes", TEXT, XMLNS, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ), + M_ED( "ParaIsCharacterDistance", STYLE, TEXT_AUTOSPACE, XML_TYPE_TEXT_AUTOSPACE, 0 ), + M_ED( "ParaIsHangingPunctuation", STYLE, PUNCTUATION_WRAP, XML_TYPE_TEXT_PUNCTUATION_WRAP, 0 ), + M_ED( "ParaIsForbiddenRules", STYLE, LINE_BREAK, XML_TYPE_TEXT_LINE_BREAK, 0 ), + M_E( "TabStopDistance", STYLE, TAB_STOP_DISTANCE, XML_TYPE_MEASURE, 0 ), // RES_PARATR_VERTALIGN - M_E( "ParaVertAlignment", STYLE, vertical_align, XML_TYPE_TEXT_VERTICAL_ALIGN, 0 ), - { 0, 0, 0, 0 } + M_E( "ParaVertAlignment", STYLE, VERTICAL_ALIGN, XML_TYPE_TEXT_VERTICAL_ALIGN, 0 ), + { 0, 0, XML_TOKEN_INVALID, 0 } }; XMLPropertyMapEntry aXMLTextPropMap[] = { // RES_CHRATR_CASEMAP - M_E( "CharCaseMap", FO, font_variant, XML_TYPE_TEXT_CASEMAP_VAR, 0 ), - M_E( "CharCaseMap", FO, text_transform, XML_TYPE_TEXT_CASEMAP, 0 ), + M_E( "CharCaseMap", FO, FONT_VARIANT, XML_TYPE_TEXT_CASEMAP_VAR, 0 ), + M_E( "CharCaseMap", FO, TEXT_TRANSFORM, XML_TYPE_TEXT_CASEMAP, 0 ), // RES_CHRATR_COLOR - M_ED( "CharColor", FO, color, XML_TYPE_COLORAUTO|MID_FLAG_MERGE_PROPERTY, 0 ), - M_ED( "CharColor", STYLE, use_window_font_color, XML_TYPE_ISAUTOCOLOR|MID_FLAG_MERGE_PROPERTY, 0 ), + M_ED( "CharColor", FO, COLOR, XML_TYPE_COLORAUTO|MID_FLAG_MERGE_PROPERTY, 0 ), + M_ED( "CharColor", STYLE, USE_WINDOW_FONT_COLOR, XML_TYPE_ISAUTOCOLOR|MID_FLAG_MERGE_PROPERTY, 0 ), // RES_CHRATR_CONTOUR - M_E( "CharContoured", STYLE, text_outline, XML_TYPE_BOOL, 0 ), + M_E( "CharContoured", STYLE, TEXT_OUTLINE, XML_TYPE_BOOL, 0 ), // RES_CHRATR_CROSSEDOUT - M_E( "CharStrikeout", STYLE, text_crossing_out, XML_TYPE_TEXT_CROSSEDOUT, 0), + M_E( "CharStrikeout", STYLE, TEXT_CROSSING_OUT, XML_TYPE_TEXT_CROSSEDOUT, 0), // RES_CHRATR_ESCAPEMENT - M_E( "CharEscapement", STYLE, text_position, XML_TYPE_TEXT_ESCAPEMENT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ), - M_E( "CharEscapementHeight", STYLE, text_position, XML_TYPE_TEXT_ESCAPEMENT_HEIGHT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ), + M_E( "CharEscapement", STYLE, TEXT_POSITION, XML_TYPE_TEXT_ESCAPEMENT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ), + M_E( "CharEscapementHeight", STYLE, TEXT_POSITION, XML_TYPE_TEXT_ESCAPEMENT_HEIGHT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ), // RES_CHRATR_FONT - M_ED( "CharFontName", STYLE, font_name, XML_TYPE_STRING|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTNAME ), + M_ED( "CharFontName", STYLE, FONT_NAME, XML_TYPE_STRING|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTNAME ), #ifdef CONV_STAR_FONTS - M_ED( "CharFontName", FO, font_family, XML_TYPE_TEXT_FONTFAMILYNAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTFAMILYNAME ), + M_ED( "CharFontName", FO, FONT_FAMILY, XML_TYPE_TEXT_FONTFAMILYNAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTFAMILYNAME ), #else - M_ED( "CharFontName", FO, font_family, XML_TYPE_TEXT_FONTFAMILYNAME, CTF_FONTFAMILYNAME ), + M_ED( "CharFontName", FO, FONT_FAMILY, XML_TYPE_TEXT_FONTFAMILYNAME, CTF_FONTFAMILYNAME ), #endif - M_ED( "CharFontStyleName",STYLE, font_style_name, XML_TYPE_STRING, CTF_FONTSTYLENAME ), - M_ED( "CharFontFamily", STYLE, font_family_generic,XML_TYPE_TEXT_FONTFAMILY, CTF_FONTFAMILY ), - M_ED( "CharFontPitch", STYLE, font_pitch, XML_TYPE_TEXT_FONTPITCH, CTF_FONTPITCH ), - M_ED( "CharFontCharSet", STYLE, font_charset, XML_TYPE_TEXT_FONTENCODING, CTF_FONTCHARSET ), + M_ED( "CharFontStyleName",STYLE, FONT_STYLE_NAME, XML_TYPE_STRING, CTF_FONTSTYLENAME ), + M_ED( "CharFontFamily", STYLE, FONT_FAMILY_GENERIC,XML_TYPE_TEXT_FONTFAMILY, CTF_FONTFAMILY ), + M_ED( "CharFontPitch", STYLE, FONT_PITCH, XML_TYPE_TEXT_FONTPITCH, CTF_FONTPITCH ), + M_ED( "CharFontCharSet", STYLE, FONT_CHARSET, XML_TYPE_TEXT_FONTENCODING, CTF_FONTCHARSET ), // RES_CHRATR_FONTSIZE - M_ED( "CharHeight", FO, font_size, XML_TYPE_CHAR_HEIGHT|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT ), - M_ED( "CharPropHeight",FO, font_size, XML_TYPE_CHAR_HEIGHT_PROP|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_REL ), - M_ED( "CharDiffHeight",STYLE,font_size_rel, XML_TYPE_CHAR_HEIGHT_DIFF, CTF_CHARHEIGHT_DIFF ), + M_ED( "CharHeight", FO, FONT_SIZE, XML_TYPE_CHAR_HEIGHT|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT ), + M_ED( "CharPropHeight",FO, FONT_SIZE, XML_TYPE_CHAR_HEIGHT_PROP|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_REL ), + M_ED( "CharDiffHeight",STYLE,FONT_SIZE_REL, XML_TYPE_CHAR_HEIGHT_DIFF, CTF_CHARHEIGHT_DIFF ), // RES_CHRATR_KERNING - M_E( "CharKerning", FO, letter_spacing, XML_TYPE_TEXT_KERNING, 0 ), + M_E( "CharKerning", FO, LETTER_SPACING, XML_TYPE_TEXT_KERNING, 0 ), // RES_CHRATR_LANGUAGE - M_ED( "CharLocale", FO, language, XML_TYPE_CHAR_LANGUAGE|MID_FLAG_MERGE_PROPERTY, 0 ), - M_ED( "CharLocale", FO, country, XML_TYPE_CHAR_COUNTRY|MID_FLAG_MERGE_PROPERTY, 0 ), + M_ED( "CharLocale", FO, LANGUAGE, XML_TYPE_CHAR_LANGUAGE|MID_FLAG_MERGE_PROPERTY, 0 ), + M_ED( "CharLocale", FO, COUNTRY, XML_TYPE_CHAR_COUNTRY|MID_FLAG_MERGE_PROPERTY, 0 ), // RES_CHRATR_POSTURE - M_E( "CharPosture", FO, font_style, XML_TYPE_TEXT_POSTURE, 0 ), + M_E( "CharPosture", FO, FONT_STYLE, XML_TYPE_TEXT_POSTURE, 0 ), // RES_CHRATR_PROPORTIONALFONTSIZE // TODO: not used? // RES_CHRATR_SHADOWED - M_E( "CharShadowed", FO, text_shadow, XML_TYPE_TEXT_SHADOWED, 0 ), + M_E( "CharShadowed", FO, TEXT_SHADOW, XML_TYPE_TEXT_SHADOWED, 0 ), // BIS HIER GEPRUEFT! // RES_CHRATR_UNDERLINE - M_E( "CharUnderline", STYLE, text_underline, XML_TYPE_TEXT_UNDERLINE, CTF_UNDERLINE ), - M_E( "CharUnderlineColor", STYLE, text_underline_color, XML_TYPE_TEXT_UNDERLINE_COLOR|MID_FLAG_MULTI_PROPERTY, CTF_UNDERLINE_COLOR ), - M_E( "CharUnderlineHasColor", STYLE, text_underline_color, XML_TYPE_TEXT_UNDERLINE_HASCOLOR|MID_FLAG_MERGE_ATTRIBUTE, CTF_UNDERLINE_HASCOLOR ), + M_E( "CharUnderline", STYLE, TEXT_UNDERLINE, XML_TYPE_TEXT_UNDERLINE, CTF_UNDERLINE ), + M_E( "CharUnderlineColor", STYLE, TEXT_UNDERLINE_COLOR, XML_TYPE_TEXT_UNDERLINE_COLOR|MID_FLAG_MULTI_PROPERTY, CTF_UNDERLINE_COLOR ), + M_E( "CharUnderlineHasColor", STYLE, TEXT_UNDERLINE_COLOR, XML_TYPE_TEXT_UNDERLINE_HASCOLOR|MID_FLAG_MERGE_ATTRIBUTE, CTF_UNDERLINE_HASCOLOR ), // RES_CHRATR_WEIGHT - M_E( "CharWeight", FO, font_weight, XML_TYPE_TEXT_WEIGHT, 0 ), + M_E( "CharWeight", FO, FONT_WEIGHT, XML_TYPE_TEXT_WEIGHT, 0 ), // RES_CHRATR_WORDLINEMODE - M_E( "CharWordMode", FO, score_spaces, XML_TYPE_NBOOL, 0 ), + M_E( "CharWordMode", FO, SCORE_SPACES, XML_TYPE_NBOOL, 0 ), // RES_CHRATR_AUTOKERN - M_E( "CharAutoKerning", STYLE, letter_kerning, XML_TYPE_BOOL, 0 ), + M_E( "CharAutoKerning", STYLE, LETTER_KERNING, XML_TYPE_BOOL, 0 ), // RES_CHRATR_BLINK - M_E( "CharFlash", STYLE, text_blinking, XML_TYPE_BOOL, 0 ), + M_E( "CharFlash", STYLE, TEXT_BLINKING, XML_TYPE_BOOL, 0 ), // RES_CHRATR_NOHYPHEN // TODO: not used? // RES_CHRATR_NOLINEBREAK // TODO: not used? // RES_CHRATR_BACKGROUND - M_E( "CharBackColor", STYLE, text_background_color, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ), - M_E( "CharBackTransparent", STYLE, text_background_color, XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE, 0 ), - M_E( "CharBackColor", FO, text_background_color, XML_TYPE_COLOR|MID_FLAG_SPECIAL_ITEM_EXPORT, CTF_OLDTEXTBACKGROUND ), + M_E( "CharBackColor", STYLE, TEXT_BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ), + M_E( "CharBackTransparent", STYLE, TEXT_BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE, 0 ), + M_E( "CharBackColor", FO, TEXT_BACKGROUND_COLOR, XML_TYPE_COLOR|MID_FLAG_SPECIAL_ITEM_EXPORT, CTF_OLDTEXTBACKGROUND ), // RES_CHRATR_CJK_FONT - M_ED( "CharFontNameAsian", STYLE, font_name_asian, XML_TYPE_STRING|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTNAME_CJK ), + M_ED( "CharFontNameAsian", STYLE, FONT_NAME_ASIAN, XML_TYPE_STRING|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTNAME_CJK ), #ifdef CONV_STAR_FONTS - M_ED( "CharFontNameAsian", STYLE, font_family_asian, XML_TYPE_TEXT_FONTFAMILYNAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTFAMILYNAME_CJK ), + M_ED( "CharFontNameAsian", STYLE, FONT_FAMILY_ASIAN, XML_TYPE_TEXT_FONTFAMILYNAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTFAMILYNAME_CJK ), #else - M_ED( "CharFontNameAsian", STYLE, font_family_asian, XML_TYPE_TEXT_FONTFAMILYNAME, CTF_FONTFAMILYNAME_CJK ), + M_ED( "CharFontNameAsian", STYLE, FONT_FAMILY_ASIAN, XML_TYPE_TEXT_FONTFAMILYNAME, CTF_FONTFAMILYNAME_CJK ), #endif - M_ED( "CharFontStyleNameAsian",STYLE, font_style_name_asian, XML_TYPE_STRING, CTF_FONTSTYLENAME_CJK ), - M_ED( "CharFontFamilyAsian", STYLE, font_family_generic_asian,XML_TYPE_TEXT_FONTFAMILY, CTF_FONTFAMILY_CJK ), - M_ED( "CharFontPitchAsian", STYLE, font_pitch_asian, XML_TYPE_TEXT_FONTPITCH, CTF_FONTPITCH_CJK ), - M_ED( "CharFontCharSetAsian", STYLE, font_charset_asian, XML_TYPE_TEXT_FONTENCODING, CTF_FONTCHARSET_CJK ), + M_ED( "CharFontStyleNameAsian",STYLE, FONT_STYLE_NAME_ASIAN, XML_TYPE_STRING, CTF_FONTSTYLENAME_CJK ), + M_ED( "CharFontFamilyAsian", STYLE, FONT_FAMILY_GENERIC_ASIAN,XML_TYPE_TEXT_FONTFAMILY, CTF_FONTFAMILY_CJK ), + M_ED( "CharFontPitchAsian", STYLE, FONT_PITCH_ASIAN, XML_TYPE_TEXT_FONTPITCH, CTF_FONTPITCH_CJK ), + M_ED( "CharFontCharSetAsian", STYLE, FONT_CHARSET_ASIAN, XML_TYPE_TEXT_FONTENCODING, CTF_FONTCHARSET_CJK ), // RES_CHRATR_CJK_FONTSIZE - M_ED( "CharHeightAsian", STYLE, font_size_asian, XML_TYPE_CHAR_HEIGHT|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_CJK ), - M_ED( "CharPropHeightAsian",STYLE, font_size_asian, XML_TYPE_CHAR_HEIGHT_PROP|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_REL_CJK ), - M_ED( "CharDiffHeightAsian",STYLE,font_size_rel_asian, XML_TYPE_CHAR_HEIGHT_DIFF, CTF_CHARHEIGHT_DIFF_CJK ), + M_ED( "CharHeightAsian", STYLE, FONT_SIZE_ASIAN, XML_TYPE_CHAR_HEIGHT|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_CJK ), + M_ED( "CharPropHeightAsian",STYLE, FONT_SIZE_ASIAN, XML_TYPE_CHAR_HEIGHT_PROP|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_REL_CJK ), + M_ED( "CharDiffHeightAsian",STYLE,FONT_SIZE_REL_ASIAN, XML_TYPE_CHAR_HEIGHT_DIFF, CTF_CHARHEIGHT_DIFF_CJK ), // RES_CHRATR_CJK_LANGUAGE - M_ED( "CharLocaleAsian", STYLE, language_asian, XML_TYPE_CHAR_LANGUAGE|MID_FLAG_MERGE_PROPERTY, 0 ), - M_ED( "CharLocaleAsian", STYLE, country_asian, XML_TYPE_CHAR_COUNTRY|MID_FLAG_MERGE_PROPERTY, 0 ), + M_ED( "CharLocaleAsian", STYLE, LANGUAGE_ASIAN, XML_TYPE_CHAR_LANGUAGE|MID_FLAG_MERGE_PROPERTY, 0 ), + M_ED( "CharLocaleAsian", STYLE, COUNTRY_ASIAN, XML_TYPE_CHAR_COUNTRY|MID_FLAG_MERGE_PROPERTY, 0 ), // RES_CHRATR_CJK_POSTURE - M_E( "CharPostureAsian", STYLE, font_style_asian, XML_TYPE_TEXT_POSTURE, 0 ), + M_E( "CharPostureAsian", STYLE, FONT_STYLE_ASIAN, XML_TYPE_TEXT_POSTURE, 0 ), // RES_CHRATR_CJK_WEIGHT - M_E( "CharWeightAsian", STYLE, font_weight_asian, XML_TYPE_TEXT_WEIGHT, 0 ), + M_E( "CharWeightAsian", STYLE, FONT_WEIGHT_ASIAN, XML_TYPE_TEXT_WEIGHT, 0 ), // RES_CHRATR_CTL_FONT - M_ED( "CharFontNameComplex", STYLE, font_name_complex, XML_TYPE_STRING|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTNAME_CTL ), + M_ED( "CharFontNameComplex", STYLE, FONT_NAME_COMPLEX, XML_TYPE_STRING|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTNAME_CTL ), #ifdef CONV_STAR_FONTS - M_ED( "CharFontNameComplex", STYLE, font_family_complex, XML_TYPE_TEXT_FONTFAMILYNAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTFAMILYNAME_CTL ), + M_ED( "CharFontNameComplex", STYLE, FONT_FAMILY_COMPLEX, XML_TYPE_TEXT_FONTFAMILYNAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTFAMILYNAME_CTL ), #else - M_ED( "CharFontNameComplex", STYLE, font_family_complex, XML_TYPE_TEXT_FONTFAMILYNAME, CTF_FONTFAMILYNAME_CTL ), + M_ED( "CharFontNameComplex", STYLE, FONT_FAMILY_COMPLEX, XML_TYPE_TEXT_FONTFAMILYNAME, CTF_FONTFAMILYNAME_CTL ), #endif - M_ED( "CharFontStyleNameComplex",STYLE, font_style_name_complex, XML_TYPE_STRING, CTF_FONTSTYLENAME_CTL ), - M_ED( "CharFontFamilyComplex", STYLE, font_family_generic_complex,XML_TYPE_TEXT_FONTFAMILY, CTF_FONTFAMILY_CTL ), - M_ED( "CharFontPitchComplex", STYLE, font_pitch_complex, XML_TYPE_TEXT_FONTPITCH, CTF_FONTPITCH_CTL ), - M_ED( "CharFontCharSetComplex", STYLE, font_charset_complex, XML_TYPE_TEXT_FONTENCODING, CTF_FONTCHARSET_CTL ), + M_ED( "CharFontStyleNameComplex",STYLE, FONT_STYLE_NAME_COMPLEX, XML_TYPE_STRING, CTF_FONTSTYLENAME_CTL ), + M_ED( "CharFontFamilyComplex", STYLE, FONT_FAMILY_GENERIC_COMPLEX,XML_TYPE_TEXT_FONTFAMILY, CTF_FONTFAMILY_CTL ), + M_ED( "CharFontPitchComplex", STYLE, FONT_PITCH_COMPLEX, XML_TYPE_TEXT_FONTPITCH, CTF_FONTPITCH_CTL ), + M_ED( "CharFontCharSetComplex", STYLE, FONT_CHARSET_COMPLEX, XML_TYPE_TEXT_FONTENCODING, CTF_FONTCHARSET_CTL ), // RES_CHRATR_CTL_FONTSIZE - M_ED( "CharHeightComplex", STYLE, font_size_complex, XML_TYPE_CHAR_HEIGHT|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_CTL ), - M_ED( "CharPropHeightComplex",STYLE, font_size_complex, XML_TYPE_CHAR_HEIGHT_PROP|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_REL_CTL ), - M_ED( "CharDiffHeightComplex",STYLE,font_size_rel_complex, XML_TYPE_CHAR_HEIGHT_DIFF, CTF_CHARHEIGHT_DIFF_CTL ), + M_ED( "CharHeightComplex", STYLE, FONT_SIZE_COMPLEX, XML_TYPE_CHAR_HEIGHT|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_CTL ), + M_ED( "CharPropHeightComplex",STYLE, FONT_SIZE_COMPLEX, XML_TYPE_CHAR_HEIGHT_PROP|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_REL_CTL ), + M_ED( "CharDiffHeightComplex",STYLE,FONT_SIZE_REL_COMPLEX, XML_TYPE_CHAR_HEIGHT_DIFF, CTF_CHARHEIGHT_DIFF_CTL ), // RES_CHRATR_CTL_LANGUAGE - M_ED( "CharLocaleComplex", STYLE, language_complex, XML_TYPE_CHAR_LANGUAGE|MID_FLAG_MERGE_PROPERTY, 0 ), - M_ED( "CharLocaleComplex", STYLE, country_complex, XML_TYPE_CHAR_COUNTRY|MID_FLAG_MERGE_PROPERTY, 0 ), + M_ED( "CharLocaleComplex", STYLE, LANGUAGE_COMPLEX, XML_TYPE_CHAR_LANGUAGE|MID_FLAG_MERGE_PROPERTY, 0 ), + M_ED( "CharLocaleComplex", STYLE, COUNTRY_COMPLEX, XML_TYPE_CHAR_COUNTRY|MID_FLAG_MERGE_PROPERTY, 0 ), // RES_CHRATR_CTL_POSTURE - M_E( "CharPostureComplex", STYLE, font_style_complex, XML_TYPE_TEXT_POSTURE, 0 ), + M_E( "CharPostureComplex", STYLE, FONT_STYLE_COMPLEX, XML_TYPE_TEXT_POSTURE, 0 ), // RES_CHRATR_CTL_WEIGHT - M_E( "CharWeightComplex", STYLE, font_weight_complex, XML_TYPE_TEXT_WEIGHT, 0 ), + M_E( "CharWeightComplex", STYLE, FONT_WEIGHT_COMPLEX, XML_TYPE_TEXT_WEIGHT, 0 ), // RES_CHRATR_ROTATE - M_E( "CharRotation", STYLE, text_rotation_angle, XML_TYPE_TEXT_ROTATION_ANGLE, 0 ), - M_E( "CharRotationIsFitToLine", STYLE, text_rotation_scale, XML_TYPE_TEXT_ROTATION_SCALE, 0 ), + M_E( "CharRotation", STYLE, TEXT_ROTATION_ANGLE, XML_TYPE_TEXT_ROTATION_ANGLE, 0 ), + M_E( "CharRotationIsFitToLine", STYLE, TEXT_ROTATION_SCALE, XML_TYPE_TEXT_ROTATION_SCALE, 0 ), // RES_CHRATR_EMPHASIS_MARK - M_E( "CharEmphasis", STYLE, text_emphasize, XML_TYPE_TEXT_EMPHASIZE, 0 ), + M_E( "CharEmphasis", STYLE, TEXT_EMPHASIZE, XML_TYPE_TEXT_EMPHASIZE, 0 ), // RES_CHRATR_TWO_LINES - M_E( "CharCombineIsOn", STYLE, text_combine, XML_TYPE_TEXT_COMBINE|MID_FLAG_MULTI_PROPERTY, 0 ), - M_E( "CharCombinePrefix", STYLE, text_combine_start_char, XML_TYPE_TEXT_COMBINECHAR, 0 ), - M_E( "CharCombineSuffix", STYLE, text_combine_end_char, XML_TYPE_TEXT_COMBINECHAR, 0 ), + M_E( "CharCombineIsOn", STYLE, TEXT_COMBINE, XML_TYPE_TEXT_COMBINE|MID_FLAG_MULTI_PROPERTY, 0 ), + M_E( "CharCombinePrefix", STYLE, TEXT_COMBINE_START_CHAR, XML_TYPE_TEXT_COMBINECHAR, 0 ), + M_E( "CharCombineSuffix", STYLE, TEXT_COMBINE_END_CHAR, XML_TYPE_TEXT_COMBINECHAR, 0 ), // RES_CHRATR_SCALEW - M_E( "CharScaleWidth", STYLE, text_scale, XML_TYPE_PERCENT16, 0 ), + M_E( "CharScaleWidth", STYLE, TEXT_SCALE, XML_TYPE_PERCENT16, 0 ), // combined characters field, does not correspond to a property - M_E( "", STYLE, text_combine, XML_TYPE_TEXT_COMBINE_CHARACTERS|MID_FLAG_NO_PROPERTY, CTF_COMBINED_CHARACTERS_FIELD ), + M_E( "", STYLE, TEXT_COMBINE, XML_TYPE_TEXT_COMBINE_CHARACTERS|MID_FLAG_NO_PROPERTY, CTF_COMBINED_CHARACTERS_FIELD ), //RES_CHRATR_RELIEF - M_E( "CharRelief", STYLE, font_relief, XML_TYPE_TEXT_FONT_RELIEF, 0 ), + M_E( "CharRelief", STYLE, FONT_RELIEF, XML_TYPE_TEXT_FONT_RELIEF, 0 ), // RES_TXTATR_INETFMT // TODO @@ -507,12 +508,12 @@ XMLPropertyMapEntry aXMLTextPropMap[] = // RES_TXTATR_HARDBLANK // TODO // RES_UNKNOWNATR_CONTAINER - M_E( "UserDefinedAttributes", TEXT, xmlns, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ), - M_ED( "ParaIsCharacterDistance", STYLE, text_autospace, XML_TYPE_TEXT_AUTOSPACE, 0 ), - M_ED( "ParaIsHangingPunctuation", STYLE, punctuation_wrap, XML_TYPE_TEXT_PUNCTUATION_WRAP, 0 ), - M_ED( "ParaIsForbiddenRules", STYLE, line_break, XML_TYPE_TEXT_LINE_BREAK, 0 ), - M_E( "TabStopDistance", STYLE, tab_stop_distance, XML_TYPE_MEASURE, 0 ), - { 0, 0, 0, 0 } + M_E( "UserDefinedAttributes", TEXT, XMLNS, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ), + M_ED( "ParaIsCharacterDistance", STYLE, TEXT_AUTOSPACE, XML_TYPE_TEXT_AUTOSPACE, 0 ), + M_ED( "ParaIsHangingPunctuation", STYLE, PUNCTUATION_WRAP, XML_TYPE_TEXT_PUNCTUATION_WRAP, 0 ), + M_ED( "ParaIsForbiddenRules", STYLE, LINE_BREAK, XML_TYPE_TEXT_LINE_BREAK, 0 ), + M_E( "TabStopDistance", STYLE, TAB_STOP_DISTANCE, XML_TYPE_MEASURE, 0 ), + { 0, 0, XML_TOKEN_INVALID, 0 } }; XMLPropertyMapEntry aXMLFramePropMap[] = @@ -520,34 +521,34 @@ XMLPropertyMapEntry aXMLFramePropMap[] = // RES_FILL_ORDER // TODO: not required??? // RES_FRM_SIZE - M_ED( "Width", SVG, width, XML_TYPE_MEASURE, 0 ), - M_ED( "RelativeWidth", STYLE, rel_width, XML_TYPE_TEXT_REL_WIDTH_HEIGHT, 0 ), -// M_ED( "RelativeWidth", STYLE, rel_width, XML_TYPE_TEXT_REL_WIDTH_HEIGHT|MID_FLAG_MULTI_PROPERTY, 0 ), -// M_ED( "IsSyncWidthToHeight",STYLE, rel_width, XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT|MID_FLAG_MULTI_PROPERTY, 0 ), - - M_ED( "Height", SVG, height, XML_TYPE_MEASURE, CTF_FRAMEHEIGHT_ABS ), - M_ED( "Height", FO, min_height, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_FRAMEHEIGHT_MIN_ABS ), - M_ED( "RelativeHeight", FO, min_height, XML_TYPE_TEXT_REL_WIDTH_HEIGHT, CTF_FRAMEHEIGHT_MIN_REL ), - M_ED( "RelativeHeight", STYLE, rel_height, XML_TYPE_TEXT_REL_WIDTH_HEIGHT, CTF_FRAMEHEIGHT_REL ), -// M_ED( "RelativeHeight", STYLE, rel_height, XML_TYPE_TEXT_REL_WIDTH_HEIGHT|MID_FLAG_MULTI_PROPERTY, CTF_FRAMEHEIGHT_REL ), -// M_ED( "IsSyncHeightToWidth",STYLE, rel_height, XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT|MID_FLAG_MULTI_PROPERTY, CTF_SYNCHEIGHT ), -// M_ED( "IsSyncHeightToWidth",STYLE, rel_height, XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT_MIN, CTF_SYNCHEIGHT_MIN ), - M_ED( "SizeType", FO, text_box, XML_TYPE_NUMBER16|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_SIZETYPE ), + M_ED( "Width", SVG, WIDTH, XML_TYPE_MEASURE, 0 ), + M_ED( "RelativeWidth", STYLE, REL_WIDTH, XML_TYPE_TEXT_REL_WIDTH_HEIGHT, 0 ), +// M_ED( "RelativeWidth", STYLE, REL_WIDTH, XML_TYPE_TEXT_REL_WIDTH_HEIGHT|MID_FLAG_MULTI_PROPERTY, 0 ), +// M_ED( "IsSyncWidthToHeight",STYLE, REL_WIDTH, XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT|MID_FLAG_MULTI_PROPERTY, 0 ), + + M_ED( "Height", SVG, HEIGHT, XML_TYPE_MEASURE, CTF_FRAMEHEIGHT_ABS ), + M_ED( "Height", FO, MIN_HEIGHT, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_FRAMEHEIGHT_MIN_ABS ), + M_ED( "RelativeHeight", FO, MIN_HEIGHT, XML_TYPE_TEXT_REL_WIDTH_HEIGHT, CTF_FRAMEHEIGHT_MIN_REL ), + M_ED( "RelativeHeight", STYLE, REL_HEIGHT, XML_TYPE_TEXT_REL_WIDTH_HEIGHT, CTF_FRAMEHEIGHT_REL ), +// M_ED( "RelativeHeight", STYLE, REL_HEIGHT, XML_TYPE_TEXT_REL_WIDTH_HEIGHT|MID_FLAG_MULTI_PROPERTY, CTF_FRAMEHEIGHT_REL ), +// M_ED( "IsSyncHeightToWidth",STYLE, REL_HEIGHT, XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT|MID_FLAG_MULTI_PROPERTY, CTF_SYNCHEIGHT ), +// M_ED( "IsSyncHeightToWidth",STYLE, REL_HEIGHT, XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT_MIN, CTF_SYNCHEIGHT_MIN ), + M_ED( "SizeType", FO, TEXT_BOX, XML_TYPE_NUMBER16|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_SIZETYPE ), // RES_PAPER_BIN // not required // RES_ANCHOR // moved to here because it is not used for automatic styles - M_ED( "AnchorType", TEXT, anchor_type, XML_TYPE_TEXT_ANCHOR_TYPE, CTF_ANCHORTYPE ), + M_ED( "AnchorType", TEXT, ANCHOR_TYPE, XML_TYPE_TEXT_ANCHOR_TYPE, CTF_ANCHORTYPE ), // AnchorPage number is not required for styles! - M_ED( "HoriOrientPosition", SVG, x, XML_TYPE_MEASURE, 0 ), - M_ED( "VertOrientPosition", SVG, y, XML_TYPE_MEASURE, 0 ), + M_ED( "HoriOrientPosition", SVG, X, XML_TYPE_MEASURE, 0 ), + M_ED( "VertOrientPosition", SVG, Y, XML_TYPE_MEASURE, 0 ), // ***** The map for automatic styles starts here ***** // RES_LR_SPACE - M_E( "LeftMargin", FO, margin_left, XML_TYPE_MEASURE, 0), - M_E( "RightMargin", FO, margin_right, XML_TYPE_MEASURE, 0 ), + M_E( "LeftMargin", FO, MARGIN_LEFT, XML_TYPE_MEASURE, 0), + M_E( "RightMargin", FO, MARGIN_RIGHT, XML_TYPE_MEASURE, 0 ), // RES_UL_SPACE - M_E( "TopMargin", FO, margin_top, XML_TYPE_MEASURE, 0 ), - M_E( "BottomMargin", FO, margin_bottom, XML_TYPE_MEASURE, 0 ), + M_E( "TopMargin", FO, MARGIN_TOP, XML_TYPE_MEASURE, 0 ), + M_E( "BottomMargin", FO, MARGIN_BOTTOM, XML_TYPE_MEASURE, 0 ), // RES_PAGEDESC // not required // RES_BREAK @@ -559,69 +560,69 @@ XMLPropertyMapEntry aXMLFramePropMap[] = // RES_FOOTER // not required // RES_PRINT - M_E( "Print", STYLE, print_content, XML_TYPE_BOOL, 0 ), + M_E( "Print", STYLE, PRINT_CONTENT, XML_TYPE_BOOL, 0 ), // RES_OPAQUE - M_ED( "Opaque", STYLE, run_through, XML_TYPE_TEXT_OPAQUE, 0 ), + M_ED( "Opaque", STYLE, RUN_THROUGH, XML_TYPE_TEXT_OPAQUE, 0 ), // RES_PROTECT - M_E( "ContentProtected", STYLE, protect, XML_TYPE_TEXT_PROTECT_CONTENT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ), - M_E( "SizeProtected", STYLE, protect, XML_TYPE_TEXT_PROTECT_SIZE|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ), - M_E( "PositionProtected", STYLE, protect, XML_TYPE_TEXT_PROTECT_POSITION|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ), + M_E( "ContentProtected", STYLE, PROTECT, XML_TYPE_TEXT_PROTECT_CONTENT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ), + M_E( "SizeProtected", STYLE, PROTECT, XML_TYPE_TEXT_PROTECT_SIZE|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ), + M_E( "PositionProtected", STYLE, PROTECT, XML_TYPE_TEXT_PROTECT_POSITION|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ), // RES_SURROUND - M_ED( "TextWrap", STYLE, wrap, XML_TYPE_TEXT_WRAP, CTF_WRAP ), - M_ED( "SurroundAnchorOnly", STYLE, number_wrapped_paragraphs, XML_TYPE_TEXT_PARAGRAPH_ONLY, CTF_WRAP_PARAGRAPH_ONLY ), - M_E( "SurroundContour", STYLE, wrap_contour, XML_TYPE_BOOL, CTF_WRAP_CONTOUR ), - M_E( "ContourOutside", STYLE, wrap_contour_mode, XML_TYPE_TEXT_WRAP_OUTSIDE, CTF_WRAP_CONTOUR_MODE ), + M_ED( "TextWrap", STYLE, WRAP, XML_TYPE_TEXT_WRAP, CTF_WRAP ), + M_ED( "SurroundAnchorOnly", STYLE, NUMBER_WRAPPED_PARAGRAPHS, XML_TYPE_TEXT_PARAGRAPH_ONLY, CTF_WRAP_PARAGRAPH_ONLY ), + M_E( "SurroundContour", STYLE, WRAP_CONTOUR, XML_TYPE_BOOL, CTF_WRAP_CONTOUR ), + M_E( "ContourOutside", STYLE, WRAP_CONTOUR_MODE, XML_TYPE_TEXT_WRAP_OUTSIDE, CTF_WRAP_CONTOUR_MODE ), // RES_VERT_ORIENT - M_ED( "VertOrient", STYLE, vertical_pos, XML_TYPE_TEXT_VERTICAL_POS, CTF_VERTICALPOS ), - M_ED( "VertOrient", STYLE, vertical_rel, XML_TYPE_TEXT_VERTICAL_REL_AS_CHAR|MID_FLAG_MULTI_PROPERTY, CTF_VERTICALREL_ASCHAR ), - M_ED( "VertOrientRelation", STYLE, vertical_rel, XML_TYPE_TEXT_VERTICAL_REL, CTF_VERTICALREL ), - M_ED( "VertOrientRelation", STYLE, vertical_rel, XML_TYPE_TEXT_VERTICAL_REL_PAGE|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_VERTICALREL_PAGE ), - M_ED( "VertOrientRelation", STYLE, vertical_rel, XML_TYPE_TEXT_VERTICAL_REL_FRAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_VERTICALREL_FRAME ), + M_ED( "VertOrient", STYLE, VERTICAL_POS, XML_TYPE_TEXT_VERTICAL_POS, CTF_VERTICALPOS ), + M_ED( "VertOrient", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_AS_CHAR|MID_FLAG_MULTI_PROPERTY, CTF_VERTICALREL_ASCHAR ), + M_ED( "VertOrientRelation", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL, CTF_VERTICALREL ), + M_ED( "VertOrientRelation", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_PAGE|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_VERTICALREL_PAGE ), + M_ED( "VertOrientRelation", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_FRAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_VERTICALREL_FRAME ), // RES_HORI_ORIENT - M_ED( "HoriOrient", STYLE, horizontal_pos, XML_TYPE_TEXT_HORIZONTAL_POS|MID_FLAG_MULTI_PROPERTY, CTF_HORIZONTALPOS ), - M_ED( "PageToggle", STYLE, horizontal_pos, XML_TYPE_TEXT_HORIZONTAL_MIRROR, CTF_HORIZONTALMIRROR ), - M_ED( "HoriOrient", STYLE, horizontal_pos, XML_TYPE_TEXT_HORIZONTAL_POS_MIRRORED|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_HORIZONTALPOS_MIRRORED ), - M_ED( "HoriOrientRelation", STYLE, horizontal_rel, XML_TYPE_TEXT_HORIZONTAL_REL, CTF_HORIZONTALREL ), - M_ED( "HoriOrientRelation", STYLE, horizontal_rel, XML_TYPE_TEXT_HORIZONTAL_REL_FRAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_HORIZONTALREL_FRAME ), + M_ED( "HoriOrient", STYLE, HORIZONTAL_POS, XML_TYPE_TEXT_HORIZONTAL_POS|MID_FLAG_MULTI_PROPERTY, CTF_HORIZONTALPOS ), + M_ED( "PageToggle", STYLE, HORIZONTAL_POS, XML_TYPE_TEXT_HORIZONTAL_MIRROR, CTF_HORIZONTALMIRROR ), + M_ED( "HoriOrient", STYLE, HORIZONTAL_POS, XML_TYPE_TEXT_HORIZONTAL_POS_MIRRORED|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_HORIZONTALPOS_MIRRORED ), + M_ED( "HoriOrientRelation", STYLE, HORIZONTAL_REL, XML_TYPE_TEXT_HORIZONTAL_REL, CTF_HORIZONTALREL ), + M_ED( "HoriOrientRelation", STYLE, HORIZONTAL_REL, XML_TYPE_TEXT_HORIZONTAL_REL_FRAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_HORIZONTALREL_FRAME ), // RES_ANCHOR // see above // RES_BACKGROUND - M_ED( "BackColor", FO, background_color, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ), - M_ED( "BackTransparent", FO, background_color, XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ), - M_E( "BackGraphicLocation", STYLE, position, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BUILDIN_CMP_ONLY, CTF_BACKGROUND_POS ), - M_E( "BackGraphicFilter",STYLE, filter_name, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_BACKGROUND_FILTER ), - M_E( "BackGraphicURL", STYLE, background_image, MID_FLAG_ELEMENT_ITEM|XML_TYPE_STRING, CTF_BACKGROUND_URL ), + M_ED( "BackColor", FO, BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ), + M_ED( "BackTransparent", FO, BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ), + M_E( "BackGraphicLocation", STYLE, POSITION, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BUILDIN_CMP_ONLY, CTF_BACKGROUND_POS ), + M_E( "BackGraphicFilter",STYLE, FILTER_NAME, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_BACKGROUND_FILTER ), + M_E( "BackGraphicURL", STYLE, BACKGROUND_IMAGE, MID_FLAG_ELEMENT_ITEM|XML_TYPE_STRING, CTF_BACKGROUND_URL ), // RES_BOX - M_ED( "LeftBorder", STYLE, border_line_width, XML_TYPE_BORDER_WIDTH, CTF_ALLBORDERWIDTH ), - M_ED( "LeftBorder", STYLE, border_line_width_left, XML_TYPE_BORDER_WIDTH, CTF_LEFTBORDERWIDTH ), - M_ED( "RightBorder", STYLE, border_line_width_right, XML_TYPE_BORDER_WIDTH, CTF_RIGHTBORDERWIDTH ), - M_ED( "TopBorder", STYLE, border_line_width_top, XML_TYPE_BORDER_WIDTH, CTF_TOPBORDERWIDTH ), - M_ED( "BottomBorder", STYLE, border_line_width_bottom, XML_TYPE_BORDER_WIDTH, CTF_BOTTOMBORDERWIDTH ), - - M_ED( "LeftBorderDistance", FO, padding, XML_TYPE_MEASURE, CTF_ALLBORDERDISTANCE ), // need special import filtering - M_ED( "LeftBorderDistance", FO, padding_left, XML_TYPE_MEASURE, CTF_LEFTBORDERDISTANCE ), - M_ED( "RightBorderDistance", FO, padding_right, XML_TYPE_MEASURE, CTF_RIGHTBORDERDISTANCE ), - M_ED( "TopBorderDistance", FO, padding_top, XML_TYPE_MEASURE, CTF_TOPBORDERDISTANCE ), - M_ED( "BottomBorderDistance",FO, padding_bottom, XML_TYPE_MEASURE, CTF_BOTTOMBORDERDISTANCE ), + M_ED( "LeftBorder", STYLE, BORDER_LINE_WIDTH, XML_TYPE_BORDER_WIDTH, CTF_ALLBORDERWIDTH ), + M_ED( "LeftBorder", STYLE, BORDER_LINE_WIDTH_LEFT, XML_TYPE_BORDER_WIDTH, CTF_LEFTBORDERWIDTH ), + M_ED( "RightBorder", STYLE, BORDER_LINE_WIDTH_RIGHT, XML_TYPE_BORDER_WIDTH, CTF_RIGHTBORDERWIDTH ), + M_ED( "TopBorder", STYLE, BORDER_LINE_WIDTH_TOP, XML_TYPE_BORDER_WIDTH, CTF_TOPBORDERWIDTH ), + M_ED( "BottomBorder", STYLE, BORDER_LINE_WIDTH_BOTTOM, XML_TYPE_BORDER_WIDTH, CTF_BOTTOMBORDERWIDTH ), + + M_ED( "LeftBorderDistance", FO, PADDING, XML_TYPE_MEASURE, CTF_ALLBORDERDISTANCE ), // need special import filtering + M_ED( "LeftBorderDistance", FO, PADDING_LEFT, XML_TYPE_MEASURE, CTF_LEFTBORDERDISTANCE ), + M_ED( "RightBorderDistance", FO, PADDING_RIGHT, XML_TYPE_MEASURE, CTF_RIGHTBORDERDISTANCE ), + M_ED( "TopBorderDistance", FO, PADDING_TOP, XML_TYPE_MEASURE, CTF_TOPBORDERDISTANCE ), + M_ED( "BottomBorderDistance",FO, PADDING_BOTTOM, XML_TYPE_MEASURE, CTF_BOTTOMBORDERDISTANCE ), // There is an additional property for controls! - M_ED( "LeftBorder", FO, border, XML_TYPE_BORDER|MID_FLAG_MULTI_PROPERTY, CTF_ALLBORDER ), - M_ED( "LeftBorder", FO, border_left, XML_TYPE_BORDER, CTF_LEFTBORDER ), - M_ED( "RightBorder", FO, border_right, XML_TYPE_BORDER, CTF_RIGHTBORDER ), - M_ED( "TopBorder", FO, border_top, XML_TYPE_BORDER, CTF_TOPBORDER ), - M_ED( "BottomBorder", FO, border_bottom, XML_TYPE_BORDER, CTF_BOTTOMBORDER ), + M_ED( "LeftBorder", FO, BORDER, XML_TYPE_BORDER|MID_FLAG_MULTI_PROPERTY, CTF_ALLBORDER ), + M_ED( "LeftBorder", FO, BORDER_LEFT, XML_TYPE_BORDER, CTF_LEFTBORDER ), + M_ED( "RightBorder", FO, BORDER_RIGHT, XML_TYPE_BORDER, CTF_RIGHTBORDER ), + M_ED( "TopBorder", FO, BORDER_TOP, XML_TYPE_BORDER, CTF_TOPBORDER ), + M_ED( "BottomBorder", FO, BORDER_BOTTOM, XML_TYPE_BORDER, CTF_BOTTOMBORDER ), // RES_SHADOW - M_E( "ShadowFormat", STYLE, shadow, XML_TYPE_TEXT_SHADOW, 0 ), + M_E( "ShadowFormat", STYLE, SHADOW, XML_TYPE_TEXT_SHADOW, 0 ), // RES_FRMMACRO // TODO // RES_COL - M_E( "TextColumns", STYLE, columns, MID_FLAG_ELEMENT_ITEM|XML_TYPE_TEXT_COLUMNS, CTF_TEXTCOLUMNS ), + M_E( "TextColumns", STYLE, COLUMNS, MID_FLAG_ELEMENT_ITEM|XML_TYPE_TEXT_COLUMNS, CTF_TEXTCOLUMNS ), // RES_KEEP // not required // RES_URL // not required (exprted as draw:a element) // RES_EDIT_IN_READONLY - M_ED( "EditInReadonly", STYLE, editable, XML_TYPE_BOOL, 0 ), + M_ED( "EditInReadonly", STYLE, EDITABLE, XML_TYPE_BOOL, 0 ), // RES_LAYOUT_SPLIT // not required // RES_CHAIN @@ -637,118 +638,118 @@ XMLPropertyMapEntry aXMLFramePropMap[] = // RES_UNKNOWNATR_CONTAINER // M_E_SE( TEXT, xmlns, RES_UNKNOWNATR_CONTAINER, 0 ), // RES_GRFATR_MIRRORGRF (vertical MUST be processed after horizontal!) - M_E( "HoriMirroredOnEvenPages", STYLE, mirror, XML_TYPE_TEXT_MIRROR_HORIZONTAL_LEFT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ), - M_E( "HoriMirroredOnOddPages", STYLE, mirror, XML_TYPE_TEXT_MIRROR_HORIZONTAL_RIGHT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ), - M_E( "VertMirrored", STYLE, mirror, XML_TYPE_TEXT_MIRROR_VERTICAL|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ), + M_E( "HoriMirroredOnEvenPages", STYLE, MIRROR, XML_TYPE_TEXT_MIRROR_HORIZONTAL_LEFT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ), + M_E( "HoriMirroredOnOddPages", STYLE, MIRROR, XML_TYPE_TEXT_MIRROR_HORIZONTAL_RIGHT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ), + M_E( "VertMirrored", STYLE, MIRROR, XML_TYPE_TEXT_MIRROR_VERTICAL|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ), // RES_GRFATR_CROPGRF - M_E( "GraphicCrop", FO, clip, XML_TYPE_TEXT_CLIP, 0 ), + M_E( "GraphicCrop", FO, CLIP, XML_TYPE_TEXT_CLIP, 0 ), // RES_GRFATR_ROTATION // not required (exported as svg:transform attribute) // RES_GRFATR_LUMINANCE - { "AdjustLuminance", XML_NAMESPACE_DRAW, sXML_luminance, XML_TYPE_PERCENT16, 0 }, // signed? + { "AdjustLuminance", XML_NAMESPACE_DRAW, XML_LUMINANCE, XML_TYPE_PERCENT16, 0 }, // signed? // RES_GRFATR_CONTRAST - { "AdjustContrast", XML_NAMESPACE_DRAW, sXML_contrast, XML_TYPE_PERCENT16, 0 }, // signed? + { "AdjustContrast", XML_NAMESPACE_DRAW, XML_CONTRAST, XML_TYPE_PERCENT16, 0 }, // signed? // RES_GRFATR_CHANNELR - { "AdjustRed", XML_NAMESPACE_DRAW, sXML_red, XML_TYPE_PERCENT16, 0 }, // signed? + { "AdjustRed", XML_NAMESPACE_DRAW, XML_RED, XML_TYPE_PERCENT16, 0 }, // signed? // RES_GRFATR_CHANNELG - { "AdjustGreen", XML_NAMESPACE_DRAW, sXML_green, XML_TYPE_PERCENT16, 0 }, // signed? + { "AdjustGreen", XML_NAMESPACE_DRAW, XML_GREEN, XML_TYPE_PERCENT16, 0 }, // signed? // RES_GRFATR_CHANNELB - { "AdjustBlue", XML_NAMESPACE_DRAW, sXML_blue, XML_TYPE_PERCENT16, 0 }, // signed? + { "AdjustBlue", XML_NAMESPACE_DRAW, XML_BLUE, XML_TYPE_PERCENT16, 0 }, // signed? // RES_GRFATR_GAMMA - { "Gamma", XML_NAMESPACE_DRAW, sXML_gamma, XML_TYPE_DOUBLE, 0 }, // signed? + { "Gamma", XML_NAMESPACE_DRAW, XML_GAMMA, XML_TYPE_DOUBLE, 0 }, // signed? // RES_GRFATR_INVERT - { "GraphicIsInverted", XML_NAMESPACE_DRAW, sXML_color_inversion, XML_TYPE_BOOL, 0 }, + { "GraphicIsInverted", XML_NAMESPACE_DRAW, XML_COLOR_INVERSION, XML_TYPE_BOOL, 0 }, // RES_GRFATR_TRANSPARENCY - { "Transparency", XML_NAMESPACE_DRAW, sXML_transparency, XML_TYPE_PERCENT16|MID_FLAG_MULTI_PROPERTY, 0 }, + { "Transparency", XML_NAMESPACE_DRAW, XML_TRANSPARENCY, XML_TYPE_PERCENT16|MID_FLAG_MULTI_PROPERTY, 0 }, // RES_GRFATR_DRAWMODE - { "GraphicColorMode", XML_NAMESPACE_DRAW, sXML_color_mode, XML_TYPE_COLOR_MODE, 0 }, + { "GraphicColorMode", XML_NAMESPACE_DRAW, XML_COLOR_MODE, XML_TYPE_COLOR_MODE, 0 }, // special entries for floating frames - M_E( "", DRAW, frame_display_scrollbar, XML_TYPE_BOOL|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_FRAME_DISPLAY_SCROLLBAR ), - M_E( "", DRAW, frame_display_border, XML_TYPE_BOOL|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_FRAME_DISPLAY_BORDER ), - M_E( "", DRAW, frame_margin_horizontal, XML_TYPE_MEASURE_PX|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_FRAME_MARGIN_HORI ), - M_E( "", DRAW, frame_margin_vertical, XML_TYPE_MEASURE_PX|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_FRAME_MARGIN_VERT ), - M_E( "", DRAW, visible_area_left, XML_TYPE_MEASURE|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_OLE_VIS_AREA_LEFT ), - M_E( "", DRAW, visible_area_top, XML_TYPE_MEASURE|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_OLE_VIS_AREA_TOP ), - M_E( "", DRAW, visible_area_width, XML_TYPE_MEASURE|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_OLE_VIS_AREA_WIDTH ), - M_E( "", DRAW, visible_area_height, XML_TYPE_MEASURE|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_OLE_VIS_AREA_HEIGHT ), - M_E( "", DRAW, draw_aspect, XML_TYPE_TEXT_DRAW_ASPECT|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_OLE_DRAW_ASPECT ), - M_E( "UserDefinedAttributes", TEXT, xmlns, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ), - - { 0, 0, 0, 0 } + M_E( "", DRAW, FRAME_DISPLAY_SCROLLBAR, XML_TYPE_BOOL|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_FRAME_DISPLAY_SCROLLBAR ), + M_E( "", DRAW, FRAME_DISPLAY_BORDER, XML_TYPE_BOOL|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_FRAME_DISPLAY_BORDER ), + M_E( "", DRAW, FRAME_MARGIN_HORIZONTAL, XML_TYPE_MEASURE_PX|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_FRAME_MARGIN_HORI ), + M_E( "", DRAW, FRAME_MARGIN_VERTICAL, XML_TYPE_MEASURE_PX|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_FRAME_MARGIN_VERT ), + M_E( "", DRAW, VISIBLE_AREA_LEFT, XML_TYPE_MEASURE|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_OLE_VIS_AREA_LEFT ), + M_E( "", DRAW, VISIBLE_AREA_TOP, XML_TYPE_MEASURE|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_OLE_VIS_AREA_TOP ), + M_E( "", DRAW, VISIBLE_AREA_WIDTH, XML_TYPE_MEASURE|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_OLE_VIS_AREA_WIDTH ), + M_E( "", DRAW, VISIBLE_AREA_HEIGHT, XML_TYPE_MEASURE|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_OLE_VIS_AREA_HEIGHT ), + M_E( "", DRAW, DRAW_ASPECT, XML_TYPE_TEXT_DRAW_ASPECT|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_OLE_DRAW_ASPECT ), + M_E( "UserDefinedAttributes", TEXT, XMLNS, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ), + + { 0, 0, XML_TOKEN_INVALID, 0 } }; XMLPropertyMapEntry aXMLShapePropMap[] = { // RES_LR_SPACE - M_E( "LeftMargin", FO, margin_left, XML_TYPE_MEASURE, 0), - M_E( "RightMargin", FO, margin_right, XML_TYPE_MEASURE, 0 ), + M_E( "LeftMargin", FO, MARGIN_LEFT, XML_TYPE_MEASURE, 0), + M_E( "RightMargin", FO, MARGIN_RIGHT, XML_TYPE_MEASURE, 0 ), // RES_UL_SPACE - M_E( "TopMargin", FO, margin_top, XML_TYPE_MEASURE, 0 ), - M_E( "BottomMargin", FO, margin_bottom, XML_TYPE_MEASURE, 0 ), + M_E( "TopMargin", FO, MARGIN_TOP, XML_TYPE_MEASURE, 0 ), + M_E( "BottomMargin", FO, MARGIN_BOTTOM, XML_TYPE_MEASURE, 0 ), // RES_OPAQUE - M_ED( "Opaque", STYLE, run_through, XML_TYPE_TEXT_OPAQUE, 0 ), + M_ED( "Opaque", STYLE, RUN_THROUGH, XML_TYPE_TEXT_OPAQUE, 0 ), // RES_SURROUND - M_E( "TextWrap", STYLE, wrap, XML_TYPE_TEXT_WRAP, CTF_WRAP ), - M_E( "SurroundAnchorOnly", STYLE, number_wrapped_paragraphs, XML_TYPE_TEXT_PARAGRAPH_ONLY, CTF_WRAP_PARAGRAPH_ONLY ), - M_E( "SurroundContour", STYLE, wrap_contour, XML_TYPE_BOOL, CTF_WRAP_CONTOUR ), - M_E( "ContourOutside", STYLE, wrap_contour_mode, XML_TYPE_TEXT_WRAP_OUTSIDE, CTF_WRAP_CONTOUR_MODE ), + M_E( "TextWrap", STYLE, WRAP, XML_TYPE_TEXT_WRAP, CTF_WRAP ), + M_E( "SurroundAnchorOnly", STYLE, NUMBER_WRAPPED_PARAGRAPHS, XML_TYPE_TEXT_PARAGRAPH_ONLY, CTF_WRAP_PARAGRAPH_ONLY ), + M_E( "SurroundContour", STYLE, WRAP_CONTOUR, XML_TYPE_BOOL, CTF_WRAP_CONTOUR ), + M_E( "ContourOutside", STYLE, WRAP_CONTOUR_MODE, XML_TYPE_TEXT_WRAP_OUTSIDE, CTF_WRAP_CONTOUR_MODE ), // RES_VERT_ORIENT - M_E( "VertOrient", STYLE, vertical_pos, XML_TYPE_TEXT_VERTICAL_POS, CTF_VERTICALPOS ), - M_E( "VertOrient", STYLE, vertical_rel, XML_TYPE_TEXT_VERTICAL_REL_AS_CHAR|MID_FLAG_MULTI_PROPERTY, CTF_VERTICALREL_ASCHAR ), - M_E( "VertOrientRelation", STYLE, vertical_rel, XML_TYPE_TEXT_VERTICAL_REL, CTF_VERTICALREL ), - M_E( "VertOrientRelation", STYLE, vertical_rel, XML_TYPE_TEXT_VERTICAL_REL_PAGE|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_VERTICALREL_PAGE ), - M_E( "VertOrientRelation", STYLE, vertical_rel, XML_TYPE_TEXT_VERTICAL_REL_FRAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_VERTICALREL_FRAME ), + M_E( "VertOrient", STYLE, VERTICAL_POS, XML_TYPE_TEXT_VERTICAL_POS, CTF_VERTICALPOS ), + M_E( "VertOrient", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_AS_CHAR|MID_FLAG_MULTI_PROPERTY, CTF_VERTICALREL_ASCHAR ), + M_E( "VertOrientRelation", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL, CTF_VERTICALREL ), + M_E( "VertOrientRelation", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_PAGE|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_VERTICALREL_PAGE ), + M_E( "VertOrientRelation", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_FRAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_VERTICALREL_FRAME ), // RES_HORI_ORIENT - M_E( "HoriOrient", STYLE, horizontal_pos, XML_TYPE_TEXT_HORIZONTAL_POS|MID_FLAG_MULTI_PROPERTY, CTF_HORIZONTALPOS ), - M_E( "PageToggle", STYLE, horizontal_pos, XML_TYPE_TEXT_HORIZONTAL_MIRROR, CTF_HORIZONTALMIRROR ), - M_E( "HoriOrient", STYLE, horizontal_pos, XML_TYPE_TEXT_HORIZONTAL_POS_MIRRORED|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_HORIZONTALPOS_MIRRORED ), - M_E( "HoriOrientRelation", STYLE, horizontal_rel, XML_TYPE_TEXT_HORIZONTAL_REL, CTF_HORIZONTALREL ), - M_E( "HoriOrientRelation", STYLE, horizontal_rel, XML_TYPE_TEXT_HORIZONTAL_REL_FRAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_HORIZONTALREL_FRAME ), - M_E( "UserDefinedAttributes", TEXT, xmlns, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ), - { 0, 0, 0, 0 } + M_E( "HoriOrient", STYLE, HORIZONTAL_POS, XML_TYPE_TEXT_HORIZONTAL_POS|MID_FLAG_MULTI_PROPERTY, CTF_HORIZONTALPOS ), + M_E( "PageToggle", STYLE, HORIZONTAL_POS, XML_TYPE_TEXT_HORIZONTAL_MIRROR, CTF_HORIZONTALMIRROR ), + M_E( "HoriOrient", STYLE, HORIZONTAL_POS, XML_TYPE_TEXT_HORIZONTAL_POS_MIRRORED|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_HORIZONTALPOS_MIRRORED ), + M_E( "HoriOrientRelation", STYLE, HORIZONTAL_REL, XML_TYPE_TEXT_HORIZONTAL_REL, CTF_HORIZONTALREL ), + M_E( "HoriOrientRelation", STYLE, HORIZONTAL_REL, XML_TYPE_TEXT_HORIZONTAL_REL_FRAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_HORIZONTALREL_FRAME ), + M_E( "UserDefinedAttributes", TEXT, XMLNS, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ), + { 0, 0, XML_TOKEN_INVALID, 0 } }; XMLPropertyMapEntry aXMLSectionPropMap[] = { // RES_COL - M_E( "TextColumns", STYLE, columns, MID_FLAG_ELEMENT_ITEM|XML_TYPE_TEXT_COLUMNS, CTF_TEXTCOLUMNS ), + M_E( "TextColumns", STYLE, COLUMNS, MID_FLAG_ELEMENT_ITEM|XML_TYPE_TEXT_COLUMNS, CTF_TEXTCOLUMNS ), // RES_BACKGROUND - M_E( "BackColor", FO, background_color, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ), - M_E( "BackTransparent", FO, background_color, XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE, 0 ), - M_E( "BackGraphicLocation", STYLE, position, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BUILDIN_CMP_ONLY, CTF_BACKGROUND_POS ), - M_E( "BackGraphicFilter",STYLE, filter_name, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_BACKGROUND_FILTER ), - M_E( "BackGraphicURL", STYLE, background_image, MID_FLAG_ELEMENT_ITEM|XML_TYPE_STRING, CTF_BACKGROUND_URL ), + M_E( "BackColor", FO, BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ), + M_E( "BackTransparent", FO, BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE, 0 ), + M_E( "BackGraphicLocation", STYLE, POSITION, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BUILDIN_CMP_ONLY, CTF_BACKGROUND_POS ), + M_E( "BackGraphicFilter",STYLE, FILTER_NAME, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_BACKGROUND_FILTER ), + M_E( "BackGraphicURL", STYLE, BACKGROUND_IMAGE, MID_FLAG_ELEMENT_ITEM|XML_TYPE_STRING, CTF_BACKGROUND_URL ), // move protect-flag into section element -// M_E( "IsProtected", STYLE, protect, XML_TYPE_BOOL, 0 ), +// M_E( "IsProtected", STYLE, PROTECT, XML_TYPE_BOOL, 0 ), // section footnote settings - M_E( "FootnoteIsOwnNumbering", TEXT, _empty, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BOOL, CTF_SECTION_FOOTNOTE_NUM_OWN ), - M_E( "FootnoteIsRestartNumbering", TEXT, _empty, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BOOL, CTF_SECTION_FOOTNOTE_NUM_RESTART ), - M_E( "FootnoteRestartNumberingAt", TEXT, _empty, MID_FLAG_SPECIAL_ITEM|XML_TYPE_NUMBER16,CTF_SECTION_FOOTNOTE_NUM_RESTART_AT ), - M_E( "FootnoteNumberingType", TEXT, _empty, MID_FLAG_SPECIAL_ITEM|XML_TYPE_NUMBER16,CTF_SECTION_FOOTNOTE_NUM_TYPE ), - M_E( "FootnoteNumberingPrefix", TEXT, _empty, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_SECTION_FOOTNOTE_NUM_PREFIX ), - M_E( "FootnoteNumberingSuffix", TEXT, _empty, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_SECTION_FOOTNOTE_NUM_SUFFIX ), - M_E( "FootnoteIsCollectAtTextEnd", TEXT, footnotes_configuration, MID_FLAG_ELEMENT_ITEM|XML_TYPE_BOOL, CTF_SECTION_FOOTNOTE_END ), + M_E( "FootnoteIsOwnNumbering", TEXT, _EMPTY, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BOOL, CTF_SECTION_FOOTNOTE_NUM_OWN ), + M_E( "FootnoteIsRestartNumbering", TEXT, _EMPTY, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BOOL, CTF_SECTION_FOOTNOTE_NUM_RESTART ), + M_E( "FootnoteRestartNumberingAt", TEXT, _EMPTY, MID_FLAG_SPECIAL_ITEM|XML_TYPE_NUMBER16,CTF_SECTION_FOOTNOTE_NUM_RESTART_AT ), + M_E( "FootnoteNumberingType", TEXT, _EMPTY, MID_FLAG_SPECIAL_ITEM|XML_TYPE_NUMBER16,CTF_SECTION_FOOTNOTE_NUM_TYPE ), + M_E( "FootnoteNumberingPrefix", TEXT, _EMPTY, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_SECTION_FOOTNOTE_NUM_PREFIX ), + M_E( "FootnoteNumberingSuffix", TEXT, _EMPTY, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_SECTION_FOOTNOTE_NUM_SUFFIX ), + M_E( "FootnoteIsCollectAtTextEnd", TEXT, FOOTNOTES_CONFIGURATION, MID_FLAG_ELEMENT_ITEM|XML_TYPE_BOOL, CTF_SECTION_FOOTNOTE_END ), // section footnote settings - M_E( "EndnoteIsOwnNumbering", TEXT, _empty, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BOOL, CTF_SECTION_ENDNOTE_NUM_OWN ), - M_E( "EndnoteIsRestartNumbering", TEXT, _empty, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BOOL, CTF_SECTION_ENDNOTE_NUM_RESTART ), - M_E( "EndnoteRestartNumberingAt", TEXT, _empty, MID_FLAG_SPECIAL_ITEM|XML_TYPE_NUMBER16,CTF_SECTION_ENDNOTE_NUM_RESTART_AT ), - M_E( "EndnoteNumberingType", TEXT, _empty, MID_FLAG_SPECIAL_ITEM|XML_TYPE_NUMBER16,CTF_SECTION_ENDNOTE_NUM_TYPE ), - M_E( "EndnoteNumberingPrefix", TEXT, _empty, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_SECTION_ENDNOTE_NUM_PREFIX ), - M_E( "EndnoteNumberingSuffix", TEXT, _empty, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_SECTION_ENDNOTE_NUM_SUFFIX ), - M_E( "EndnoteIsCollectAtTextEnd", TEXT, endnotes_configuration, MID_FLAG_ELEMENT_ITEM|XML_TYPE_BOOL, CTF_SECTION_ENDNOTE_END ), - - { 0, 0, 0, 0 } + M_E( "EndnoteIsOwnNumbering", TEXT, _EMPTY, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BOOL, CTF_SECTION_ENDNOTE_NUM_OWN ), + M_E( "EndnoteIsRestartNumbering", TEXT, _EMPTY, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BOOL, CTF_SECTION_ENDNOTE_NUM_RESTART ), + M_E( "EndnoteRestartNumberingAt", TEXT, _EMPTY, MID_FLAG_SPECIAL_ITEM|XML_TYPE_NUMBER16,CTF_SECTION_ENDNOTE_NUM_RESTART_AT ), + M_E( "EndnoteNumberingType", TEXT, _EMPTY, MID_FLAG_SPECIAL_ITEM|XML_TYPE_NUMBER16,CTF_SECTION_ENDNOTE_NUM_TYPE ), + M_E( "EndnoteNumberingPrefix", TEXT, _EMPTY, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_SECTION_ENDNOTE_NUM_PREFIX ), + M_E( "EndnoteNumberingSuffix", TEXT, _EMPTY, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_SECTION_ENDNOTE_NUM_SUFFIX ), + M_E( "EndnoteIsCollectAtTextEnd", TEXT, ENDNOTES_CONFIGURATION, MID_FLAG_ELEMENT_ITEM|XML_TYPE_BOOL, CTF_SECTION_ENDNOTE_END ), + + { 0, 0, XML_TOKEN_INVALID, 0 } }; XMLPropertyMapEntry aXMLRubyPropMap[] = { - M_E( "RubyAdjust", STYLE, ruby_align, XML_TYPE_TEXT_RUBY_ADJUST, 0 ), - M_E( "RubyIsAbove", STYLE, ruby_position, XML_TYPE_TEXT_RUBY_POSITION, 0 ), - { 0, 0, 0, 0 } + M_E( "RubyAdjust", STYLE, RUBY_ALIGN, XML_TYPE_TEXT_RUBY_ADJUST, 0 ), + M_E( "RubyIsAbove", STYLE, RUBY_POSITION, XML_TYPE_TEXT_RUBY_POSITION, 0 ), + { 0, 0, XML_TOKEN_INVALID, 0 } }; XMLPropertyMapEntry *lcl_txtprmap_getMap( sal_uInt16 nType ) @@ -767,7 +768,7 @@ XMLPropertyMapEntry *lcl_txtprmap_getMap( sal_uInt16 nType ) break; case TEXT_PROP_MAP_AUTO_FRAME: pMap = &(aXMLFramePropMap[10]); - DBG_ASSERT( pMap->msXMLName == sXML_margin_left, "frame map changed" ); + DBG_ASSERT( pMap->meXMLName == XML_MARGIN_LEFT, "frame map changed" ); break; case TEXT_PROP_MAP_SHAPE: pMap = aXMLShapePropMap; @@ -780,7 +781,7 @@ XMLPropertyMapEntry *lcl_txtprmap_getMap( sal_uInt16 nType ) break; case TEXT_PROP_MAP_SHAPE_PARA: pMap = &aXMLParaPropMap[8]; - DBG_ASSERT( pMap->msXMLName == sXML_font_variant, + DBG_ASSERT( pMap->meXMLName == XML_FONT_VARIANT, "paragraph map changed" ); break; } diff --git a/xmloff/source/text/txtsecte.cxx b/xmloff/source/text/txtsecte.cxx index 4bd5ac229089..594773e2a664 100644 --- a/xmloff/source/text/txtsecte.cxx +++ b/xmloff/source/text/txtsecte.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtsecte.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: dvo $ $Date: 2001-05-14 13:03:17 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -122,10 +122,6 @@ #include <com/sun/star/text/XDocumentIndex.hpp> #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" -#endif - #ifndef _XMLOFF_XMLNMSPE_HXX #include "xmlnmspe.hxx" #endif diff --git a/xmloff/source/text/txtstyle.cxx b/xmloff/source/text/txtstyle.cxx index f1601a9fecec..e76fd562b14b 100644 --- a/xmloff/source/text/txtstyle.cxx +++ b/xmloff/source/text/txtstyle.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtstyle.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: mib $ $Date: 2001-04-10 12:35:52 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,8 +77,8 @@ #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_PROPERTYSETMAPPER_HXX @@ -119,6 +119,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::style; using namespace ::com::sun::star::container; using namespace ::com::sun::star::beans; +using namespace ::xmloff::token; void XMLTextParagraphExport::exportStyleAttributes( const ::com::sun::star::uno::Reference< @@ -133,34 +134,33 @@ void XMLTextParagraphExport::exportStyleAttributes( aAny = xPropSet->getPropertyValue( sCategory ); sal_Int16 nCategory; aAny >>= nCategory; - const sal_Char *pValue = 0; + enum XMLTokenEnum eValue = XML_TOKEN_INVALID; if( -1 != nCategory ) { switch( nCategory ) { case ParagraphStyleCategory::TEXT: - pValue = sXML_text; + eValue = XML_TEXT; break; case ParagraphStyleCategory::CHAPTER: - pValue = sXML_chapter; + eValue = XML_CHAPTER; break; case ParagraphStyleCategory::LIST: - pValue = sXML_list; + eValue = XML_LIST; break; case ParagraphStyleCategory::INDEX: - pValue = sXML_index; + eValue = XML_INDEX; break; case ParagraphStyleCategory::EXTRA: - pValue = sXML_extra; + eValue = XML_EXTRA; break; case ParagraphStyleCategory::HTML: - pValue = sXML_html; + eValue = XML_HTML; break; } } - if( pValue ) - GetExport().AddAttributeASCII( XML_NAMESPACE_STYLE, sXML_class, - pValue ); + if( eValue != XML_TOKEN_INVALID ) + GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_CLASS, eValue); } if( xPropSetInfo->hasPropertyByName( sPageDescName ) ) { @@ -172,7 +172,7 @@ void XMLTextParagraphExport::exportStyleAttributes( OUString sName; aAny >>= sName; GetExport().AddAttribute( XML_NAMESPACE_STYLE, - sXML_master_page_name, + XML_MASTER_PAGE_NAME, sName ); } } @@ -204,16 +204,16 @@ void XMLTextParagraphExport::exportTextStyles( sal_Bool bUsed, sal_Bool bProg ) { Reference < XPropertySet > xPropSet (xInt, UNO_QUERY); if (xPropSet.is()) - exportDefaultStyle( xPropSet, sXML_paragraph, GetParaPropMapper()); + exportDefaultStyle( xPropSet, GetXMLToken(XML_PARAGRAPH), GetParaPropMapper()); } } - exportStyleFamily( "ParagraphStyles", sXML_paragraph, GetParaPropMapper(), + exportStyleFamily( "ParagraphStyles", GetXMLToken(XML_PARAGRAPH), GetParaPropMapper(), bUsed, XML_STYLE_FAMILY_TEXT_PARAGRAPH, 0); - exportStyleFamily( "CharacterStyles", sXML_text, GetTextPropMapper(), + exportStyleFamily( "CharacterStyles", GetXMLToken(XML_TEXT), GetTextPropMapper(), bUsed, XML_STYLE_FAMILY_TEXT_TEXT ); // get shape export to make sure the the frame family is added correctly. GetExport().GetShapeExport(); - exportStyleFamily( "FrameStyles", XML_STYLE_FAMILY_SD_GRAPHICS_NAME, GetFramePropMapper(), + exportStyleFamily( "FrameStyles", OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)), GetFramePropMapper(), bUsed, XML_STYLE_FAMILY_TEXT_FRAME, 0); exportNumStyles( bUsed ); if( !IsBlockMode() ) diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx index 0dc12195b3a7..058560843b60 100644 --- a/xmloff/source/text/txtstyli.cxx +++ b/xmloff/source/text/txtstyli.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtstyli.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: dvo $ $Date: 2001-06-25 17:22:38 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -84,8 +84,8 @@ #ifndef _XMLOFF_XMLNMSPE_HXX #include "xmlnmspe.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_FAMILIES_HXX #include "families.hxx" @@ -158,21 +158,21 @@ void XMLTextStyleContext::SetAttribute( sal_uInt16 nPrefixKey, if( XML_NAMESPACE_STYLE == nPrefixKey ) { // TODO: use a map here - if( rLocalName.compareToAscii( sXML_auto_update ) == 0 ) + if( IsXMLToken( rLocalName, XML_AUTO_UPDATE ) ) { - if( rValue.compareToAscii( sXML_true ) == 0 ) + if( IsXMLToken( rValue, XML_TRUE ) ) bAutoUpdate = sal_True; } - else if( rLocalName.compareToAscii( sXML_list_style_name ) == 0 ) + else if( IsXMLToken( rLocalName, XML_LIST_STYLE_NAME ) ) { sListStyleName = rValue; } - else if( rLocalName.compareToAscii( sXML_master_page_name ) == 0 ) + else if( IsXMLToken( rLocalName, XML_MASTER_PAGE_NAME ) ) { sMasterPageName = rValue; bHasMasterPageName = sal_True; } - else if( rLocalName.compareToAscii( sXML_class ) == 0 ) + else if( IsXMLToken( rLocalName, XML_CLASS ) ) { sCategoryVal = rValue; } @@ -220,7 +220,7 @@ SvXMLImportContext *XMLTextStyleContext::CreateChildContext( SvXMLImportContext *pContext = 0; if( XML_NAMESPACE_STYLE == nPrefix && - rLocalName.compareToAscii( sXML_properties ) == 0 ) + IsXMLToken( rLocalName, XML_PROPERTIES ) ) { UniReference < SvXMLImportPropertyMapper > xImpPrMap = GetStyles()->GetImportPropertyMapper( GetFamily() ); @@ -232,7 +232,7 @@ SvXMLImportContext *XMLTextStyleContext::CreateChildContext( sDropCapTextStyleName ); } else if ( (XML_NAMESPACE_OFFICE == nPrefix) && - rLocalName.equalsAsciiL( sXML_events, sizeof(sXML_events)-1 ) ) + IsXMLToken( rLocalName, XML_EVENTS ) ) { // create and remember events import context // (for delayed processing of events) diff --git a/xmloff/source/text/txtvfldi.cxx b/xmloff/source/text/txtvfldi.cxx index ae49d99a4ee3..15059514e2bc 100644 --- a/xmloff/source/text/txtvfldi.cxx +++ b/xmloff/source/text/txtvfldi.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtvfldi.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: dvo $ $Date: 2001-06-15 10:37:08 $ + * last change: $Author: dvo $ $Date: 2001-06-29 21:07:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -68,8 +68,8 @@ #include "txtvfldi.hxx" #endif -#ifndef _XMLOFF_XMLKYWD_HXX -#include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLTOKEN_HXX +#include "xmltoken.hxx" #endif #ifndef _XMLOFF_TEXTIMP_HXX_ @@ -250,19 +250,19 @@ void XMLVarFieldImportContext::ProcessAttribute( bFormulaOK = sal_True; break; case XML_TOK_TEXTFIELD_DISPLAY: - if (0 == sAttrValue.compareToAscii(sXML_formula)) + if (IsXMLToken(sAttrValue, XML_FORMULA)) { bDisplayFormula = sal_True; bDisplayNone = sal_False; bDisplayOK = sal_True; } - else if (0 == sAttrValue.compareToAscii(sXML_value)) + else if (IsXMLToken(sAttrValue, XML_VALUE)) { bDisplayFormula = sal_False; bDisplayNone = sal_False; bDisplayOK = sal_True; } - else if (0 == sAttrValue.compareToAscii(sXML_none)) + else if (IsXMLToken(sAttrValue, XML_NONE)) { bDisplayFormula = sal_False; bDisplayNone = sal_True; @@ -447,8 +447,8 @@ XMLSequenceFieldImportContext::XMLSequenceFieldImportContext( sal_True, sal_True, sal_True, sal_False, sal_False, sal_False, sal_False, sal_False, sal_False, sal_True), - sNumFormat(sal_Unicode('1')), - sNumFormatSync(RTL_CONSTASCII_USTRINGPARAM(sXML_false)), + sNumFormat(OUString::valueOf(sal_Unicode('1'))), + sNumFormatSync(GetXMLToken(XML_FALSE)), sRefName(), bRefNameOK(sal_False), sPropertyNumberFormat(RTL_CONSTASCII_USTRINGPARAM(sAPI_number_format)), @@ -768,25 +768,28 @@ SvXMLImportContext* XMLVariableDeclsImportContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference<xml::sax::XAttributeList> & xAttrList ) { - sal_Char* sElementName; + enum XMLTokenEnum eElementName; SvXMLImportContext* pImportContext = NULL; - if (XML_NAMESPACE_TEXT == nPrefix) { - switch (eVarDeclsContextType) { - case VarTypeSequence: - sElementName = sXML_sequence_decl; - break; - case VarTypeSimple: - sElementName = sXML_variable_decl; - break; - case VarTypeUserField: - sElementName = sXML_user_field_decl; - break; - default: - DBG_ERROR("unknown field type!"); + if( XML_NAMESPACE_TEXT == nPrefix ) + { + switch (eVarDeclsContextType) + { + case VarTypeSequence: + eElementName = XML_SEQUENCE_DECL; + break; + case VarTypeSimple: + eElementName = XML_VARIABLE_DECL; + break; + case VarTypeUserField: + eElementName = XML_USER_FIELD_DECL; + break; + default: + DBG_ERROR("unknown field type!"); } - if (0 == rLocalName.compareToAscii(sElementName)) { + if( IsXMLToken( rLocalName, eElementName ) ) + { pImportContext = new XMLVariableDeclImportContext( GetImport(), rImportHelper, nPrefix, rLocalName, xAttrList, eVarDeclsContextType); @@ -829,9 +832,9 @@ XMLVariableDeclImportContext::XMLVariableDeclImportContext( sPropertyIsExpression(RTL_CONSTASCII_USTRINGPARAM(sAPI_is_expression)) { if ( (XML_NAMESPACE_TEXT == nPrfx) && - ( (0 == rLocalName.compareToAscii(sXML_sequence_decl)) || - (0 == rLocalName.compareToAscii(sXML_variable_decl)) || - (0 == rLocalName.compareToAscii(sXML_user_field_decl)) )) { + ( ( IsXMLToken( rLocalName, XML_SEQUENCE_DECL )) || + ( IsXMLToken( rLocalName, XML_VARIABLE_DECL)) || + ( IsXMLToken( rLocalName, XML_USER_FIELD_DECL)) )) { // TODO: check validity (need name!) @@ -892,7 +895,7 @@ XMLVariableDeclImportContext::XMLVariableDeclImportContext( if (nNumLevel >= 0) { - OUString sStr(cSeparationChar); + OUString sStr(&cSeparationChar, 1); aAny <<= sStr; xFieldMaster->setPropertyValue( sPropertyNumberingSeparator, aAny); |