summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmloff/source/core/makefile.mk7
-rw-r--r--xmloff/source/core/xmlimp.cxx6
-rw-r--r--xmloff/source/draw/XMLReplacementImageContext.cxx1
-rw-r--r--xmloff/source/style/WordWrapPropertyHdl.cxx1
-rw-r--r--xmloff/source/style/XMLClipPropertyHandler.cxx3
-rw-r--r--xmloff/source/style/styleexp.cxx1
-rw-r--r--xmloff/source/style/xmlimppr.cxx1
-rw-r--r--xmloff/source/text/XMLIndexTOCContext.cxx31
-rw-r--r--xmloff/source/text/XMLIndexTOCContext.hxx3
-rw-r--r--xmloff/source/text/XMLSectionExport.cxx190
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx6
-rw-r--r--xmloff/source/text/txtparae.cxx1
12 files changed, 118 insertions, 133 deletions
diff --git a/xmloff/source/core/makefile.mk b/xmloff/source/core/makefile.mk
index b9cb8e9c1b60..81d8f1511fe1 100644
--- a/xmloff/source/core/makefile.mk
+++ b/xmloff/source/core/makefile.mk
@@ -42,12 +42,6 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
.INCLUDE: $(PRJ)$/util$/makefile.pmk
-# --- to build xmlkywd.obj in obj, too -----------------------------
-
-OBJFILES = $(OBJ)$/xmlkywd.obj
-LIB2TARGET =$(LB)$/xmlkywd.lib
-LIB2OBJFILES =$(OBJFILES)
-
# --- Files --------------------------------------------------------
SLOFILES = \
@@ -63,7 +57,6 @@ SLOFILES = \
$(SLO)$/xmlexp.obj \
$(SLO)$/xmlictxt.obj \
$(SLO)$/xmlimp.obj \
- $(SLO)$/xmlkywd.obj \
$(SLO)$/xmltkmap.obj \
$(SLO)$/xmltoken.obj \
$(SLO)$/xmluconv.obj \
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 0dece7c6965c..91f3d9a26fe5 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -41,7 +41,6 @@
#include <xmloff/nmspmap.hxx>
#include <xmloff/xmluconv.hxx>
#include "xmlnmspe.hxx"
-#include "xmlkywd.hxx"
#include <xmloff/xmltoken.hxx>
#include <xmloff/XMLFontStylesContext.hxx>
#include <xmloff/xmlictxt.hxx>
@@ -292,8 +291,7 @@ void SvXMLImport::_InitCtor()
mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__math) ),
GetXMLToken(XML_N_MATH),
XML_NAMESPACE_MATH );
- mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_namespace_form) ),
- GetXMLToken(XML_N_FORM),
+ mpNamespaceMap->Add(GetXMLToken(XML_N_FORM), GetXMLToken(XML_N_FORM),
XML_NAMESPACE_FORM );
mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__script) ),
GetXMLToken(XML_N_SCRIPT),
@@ -674,7 +672,7 @@ void SAL_CALL SvXMLImport::startElement( const OUString& rName,
}
}
else if( ( rAttrName.getLength() >= 5 ) &&
- ( rAttrName.compareToAscii( sXML_xmlns, 5 ) == 0 ) &&
+ ( rAttrName.compareTo( GetXMLToken(XML_XMLNS), 5 ) == 0 ) &&
( rAttrName.getLength() == 5 || ':' == rAttrName[5] ) )
{
if( !pRewindMap )
diff --git a/xmloff/source/draw/XMLReplacementImageContext.cxx b/xmloff/source/draw/XMLReplacementImageContext.cxx
index 88eae0fe85ea..e1adcf5fa0f5 100644
--- a/xmloff/source/draw/XMLReplacementImageContext.cxx
+++ b/xmloff/source/draw/XMLReplacementImageContext.cxx
@@ -36,7 +36,6 @@
#include <xmloff/xmlimp.hxx>
#include <xmloff/xmltoken.hxx>
#include "xmlnmspe.hxx"
-#include "xmlkywd.hxx"
#include <xmloff/nmspmap.hxx>
#include <xmloff/XMLBase64ImportContext.hxx>
#include "XMLReplacementImageContext.hxx"
diff --git a/xmloff/source/style/WordWrapPropertyHdl.cxx b/xmloff/source/style/WordWrapPropertyHdl.cxx
index 128efe4a2a8b..f3ac876bed78 100644
--- a/xmloff/source/style/WordWrapPropertyHdl.cxx
+++ b/xmloff/source/style/WordWrapPropertyHdl.cxx
@@ -32,7 +32,6 @@
#include "precompiled_xmloff.hxx"
#include <xmloff/xmlimp.hxx>
#include <xmloff/WordWrapPropertyHdl.hxx>
-#include "xmlkywd.hxx"
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmluconv.hxx>
#include <comphelper/extract.hxx>
diff --git a/xmloff/source/style/XMLClipPropertyHandler.cxx b/xmloff/source/style/XMLClipPropertyHandler.cxx
index b5e61e886f0a..eadf52a333b5 100644
--- a/xmloff/source/style/XMLClipPropertyHandler.cxx
+++ b/xmloff/source/style/XMLClipPropertyHandler.cxx
@@ -35,7 +35,6 @@
#include <rtl/ustrbuf.hxx>
#include <com/sun/star/text/GraphicCrop.hpp>
#include <xmloff/xmluconv.hxx>
-#include <xmlkywd.hxx>
#include <xmloff/xmltoken.hxx>
using ::rtl::OUString;
@@ -80,7 +79,7 @@ sal_Bool XMLClipPropertyHandler::importXML( const OUString& rStrImpValue, uno::A
sal_Bool bRet = sal_False;
sal_Int32 nLen = rStrImpValue.getLength();
if( nLen > 6 &&
- 0 == rStrImpValue.compareToAscii( sXML_rect, 4 ) &&
+ 0 == rStrImpValue.compareTo( GetXMLToken(XML_RECT), 4 ) &&
rStrImpValue[4] == '(' &&
rStrImpValue[nLen-1] == ')' )
{
diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx
index f822239d3106..46af65c79ade 100644
--- a/xmloff/source/style/styleexp.cxx
+++ b/xmloff/source/style/styleexp.cxx
@@ -42,7 +42,6 @@
//#include "xmlitmap.hxx"
#endif
#include <xmloff/xmluconv.hxx>
-#include "xmlkywd.hxx"
#include <xmloff/attrlist.hxx>
#include <xmloff/xmlprmap.hxx>
#include <xmloff/xmlexppr.hxx>
diff --git a/xmloff/source/style/xmlimppr.cxx b/xmloff/source/style/xmlimppr.cxx
index 71ac9c5aac4c..7858c8e6cdee 100644
--- a/xmloff/source/style/xmlimppr.cxx
+++ b/xmloff/source/style/xmlimppr.cxx
@@ -43,7 +43,6 @@
#include <xmloff/xmlimppr.hxx>
#include <xmloff/xmlimp.hxx>
-#include "xmlkywd.hxx"
#include "unoatrcn.hxx"
#include "xmlnmspe.hxx"
#include <xmloff/xmltoken.hxx>
diff --git a/xmloff/source/text/XMLIndexTOCContext.cxx b/xmloff/source/text/XMLIndexTOCContext.cxx
index 92f015344948..b318f01f473b 100644
--- a/xmloff/source/text/XMLIndexTOCContext.cxx
+++ b/xmloff/source/text/XMLIndexTOCContext.cxx
@@ -53,14 +53,11 @@
#include <xmloff/txtimp.hxx>
#include <xmloff/nmspmap.hxx>
#include "xmlnmspe.hxx"
-#include "xmlkywd.hxx"
#include <xmloff/xmltoken.hxx>
#include <xmloff/prstylei.hxx>
#include "xmlerror.hxx"
#include <xmloff/xmluconv.hxx>
-#include <tools/debug.hxx>
#include <rtl/ustring.hxx>
-#include <tools/debug.hxx>
using namespace ::com::sun::star::uno;
@@ -88,15 +85,15 @@ static const sal_Char* aIndexServiceMap[] =
"com.sun.star.text.IllustrationsIndex"
};
-static const sal_Char* aIndexSourceElementMap[] =
+static const XMLTokenEnum aIndexSourceElementMap[] =
{
- sXML_table_of_content_source,
- sXML_alphabetical_index_source,
- sXML_table_index_source,
- sXML_object_index_source,
- sXML_bibliography_source,
- sXML_user_index_source,
- sXML_illustration_index_source
+ XML_TABLE_OF_CONTENT_SOURCE,
+ XML_ALPHABETICAL_INDEX_SOURCE,
+ XML_TABLE_INDEX_SOURCE,
+ XML_OBJECT_INDEX_SOURCE,
+ XML_BIBLIOGRAPHY_SOURCE,
+ XML_USER_INDEX_SOURCE,
+ XML_ILLUSTRATION_INDEX_SOURCE
};
SvXMLEnumMapEntry __READONLY_DATA aIndexTypeMap[] =
@@ -120,7 +117,6 @@ XMLIndexTOCContext::XMLIndexTOCContext(
, sTitle(RTL_CONSTASCII_USTRINGPARAM("Title"))
, sIsProtected(RTL_CONSTASCII_USTRINGPARAM("IsProtected"))
, sName(RTL_CONSTASCII_USTRINGPARAM("Name"))
-, pSourceElementName(NULL)
, bValid(sal_False)
{
if (XML_NAMESPACE_TEXT == nPrfx)
@@ -129,13 +125,12 @@ XMLIndexTOCContext::XMLIndexTOCContext(
if (SvXMLUnitConverter::convertEnum(nTmp, rLocalName, aIndexTypeMap))
{
// check for array index:
- DBG_ASSERT(nTmp < (sizeof(aIndexServiceMap)/sizeof(sal_Char*)), "index out of range");
- DBG_ASSERT(sizeof(aIndexServiceMap) ==
+ OSL_ENSURE(nTmp < (sizeof(aIndexServiceMap)/sizeof(sal_Char*)), "index out of range");
+ OSL_ENSURE(sizeof(aIndexServiceMap) ==
sizeof(aIndexSourceElementMap),
"service and source element maps must be same size");
- eIndexType = (enum IndexTypeEnum)nTmp;
- pSourceElementName = aIndexSourceElementMap[eIndexType];
+ eIndexType = static_cast<IndexTypeEnum>(nTmp);
bValid = sal_True;
}
}
@@ -329,7 +324,7 @@ SvXMLImportContext* XMLIndexTOCContext::CreateChildContext(
xBodyContextRef = pContext;
}
}
- else if (0 == rLocalName.compareToAscii(pSourceElementName))
+ else if (IsXMLToken(rLocalName, aIndexSourceElementMap[eIndexType]))
{
// instantiate source context for the appropriate index type
switch (eIndexType)
@@ -370,7 +365,7 @@ SvXMLImportContext* XMLIndexTOCContext::CreateChildContext(
break;
default:
- DBG_ERROR("index type not implemented");
+ OSL_ENSURE(false, "index type not implemented");
break;
}
}
diff --git a/xmloff/source/text/XMLIndexTOCContext.hxx b/xmloff/source/text/XMLIndexTOCContext.hxx
index 02a3e61e37e1..4f07de0c770e 100644
--- a/xmloff/source/text/XMLIndexTOCContext.hxx
+++ b/xmloff/source/text/XMLIndexTOCContext.hxx
@@ -76,9 +76,6 @@ class XMLIndexTOCContext : public SvXMLImportContext
enum IndexTypeEnum eIndexType;
- /** source element name (for CreateChildContext) */
- const sal_Char* pSourceElementName;
-
sal_Bool bValid;
SvXMLImportContextRef xBodyContextRef;
diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx
index e80109ff53f0..a5f1f166cf3d 100644
--- a/xmloff/source/text/XMLSectionExport.cxx
+++ b/xmloff/source/text/XMLSectionExport.cxx
@@ -31,7 +31,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
#include "XMLSectionExport.hxx"
-#include <tools/debug.hxx>
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
@@ -56,7 +55,6 @@
#include <com/sun/star/text/XTextFieldsSupplier.hpp>
#include <com/sun/star/text/XChapterNumberingSupplier.hpp>
#include <com/sun/star/text/ChapterFormat.hpp> //i90246
-#include "xmlkywd.hxx"
#include <xmloff/xmltoken.hxx>
#include "xmlnmspe.hxx"
#include <xmloff/families.hxx>
@@ -309,7 +307,7 @@ void XMLSectionExport::ExportSectionEnd(
break;
default:
- DBG_ERROR("unknown index type");
+ OSL_ENSURE(false, "unknown index type");
// default: skip index!
break;
}
@@ -335,7 +333,7 @@ void XMLSectionExport::ExportSectionEnd(
}
else
{
- DBG_ERROR("Need element name!");
+ OSL_ENSURE(false, "Need element name!");
}
}
// else: autostyles -> ignore
@@ -379,7 +377,7 @@ void XMLSectionExport::ExportIndexStart(
default:
// skip index
- DBG_ERROR("unknown index type");
+ OSL_ENSURE(false, "unknown index type");
break;
}
}
@@ -812,15 +810,15 @@ void XMLSectionExport::ExportBaseIndexStart(
GetExport().StartElement( XML_NAMESPACE_TEXT, eElement, sal_False );
}
-static const sal_Char* aTypeSourceElementNameMap[] =
+static const XMLTokenEnum aTypeSourceElementNameMap[] =
{
- sXML_table_of_content_source, // TOC
- sXML_table_index_source, // table index
- sXML_illustration_index_source, // illustration index
- sXML_object_index_source, // object index
- sXML_user_index_source, // user index
- sXML_alphabetical_index_source, // alphabetical index
- sXML_bibliography_source // bibliography
+ XML_TABLE_OF_CONTENT_SOURCE, // TOC
+ XML_TABLE_INDEX_SOURCE, // table index
+ XML_ILLUSTRATION_INDEX_SOURCE, // illustration index
+ XML_OBJECT_INDEX_SOURCE, // object index
+ XML_USER_INDEX_SOURCE, // user index
+ XML_ALPHABETICAL_INDEX_SOURCE, // alphabetical index
+ XML_BIBLIOGRAPHY_SOURCE // bibliography
};
void XMLSectionExport::ExportBaseIndexSource(
@@ -828,8 +826,8 @@ void XMLSectionExport::ExportBaseIndexSource(
const Reference<XPropertySet> & rPropertySet)
{
// check type
- DBG_ASSERT(eType >= TEXT_SECTION_TYPE_TOC, "illegal index type");
- DBG_ASSERT(eType <= TEXT_SECTION_TYPE_BIBLIOGRAPHY, "illegal index type");
+ OSL_ENSURE(eType >= TEXT_SECTION_TYPE_TOC, "illegal index type");
+ OSL_ENSURE(eType <= TEXT_SECTION_TYPE_BIBLIOGRAPHY, "illegal index type");
Any aAny;
@@ -857,8 +855,9 @@ void XMLSectionExport::ExportBaseIndexSource(
// the index source element (all indices)
SvXMLElementExport aElem(GetExport(),
XML_NAMESPACE_TEXT,
- aTypeSourceElementNameMap[
- eType - TEXT_SECTION_TYPE_TOC],
+ GetXMLToken(
+ aTypeSourceElementNameMap[
+ eType - TEXT_SECTION_TYPE_TOC]),
sal_True, sal_True);
// scope for title template (all indices)
@@ -928,8 +927,8 @@ void XMLSectionExport::ExportBaseIndexBody(
const Reference<XPropertySet> &)
{
// type not used; checked anyway.
- DBG_ASSERT(eType >= TEXT_SECTION_TYPE_TOC, "illegal index type");
- DBG_ASSERT(eType <= TEXT_SECTION_TYPE_BIBLIOGRAPHY, "illegal index type");
+ OSL_ENSURE(eType >= TEXT_SECTION_TYPE_TOC, "illegal index type");
+ OSL_ENSURE(eType <= TEXT_SECTION_TYPE_BIBLIOGRAPHY, "illegal index type");
// export start only
@@ -972,23 +971,23 @@ void XMLSectionExport::ExportTableAndIllustrationIndexSourceAttributes(
// map index of LevelFormats to attribute value;
// level 0 is always the header
-static const sal_Char* aLevelNameTOCMap[] =
- { NULL, sXML_1, sXML_2, sXML_3, sXML_4, sXML_5, sXML_6, sXML_7,
- sXML_8, sXML_9, sXML_10, NULL };
-static const sal_Char* aLevelNameTableMap[] =
- { NULL, "", NULL };
-static const sal_Char* aLevelNameAlphaMap[] =
- { NULL, sXML_separator, sXML_1, sXML_2, sXML_3, NULL };
-static const sal_Char* aLevelNameBibliographyMap[] =
- { NULL, sXML_article, sXML_book, sXML_booklet, sXML_conference,
- sXML_custom1, sXML_custom2, sXML_custom3, sXML_custom4,
- sXML_custom5, sXML_email, sXML_inbook, sXML_incollection,
- sXML_inproceedings, sXML_journal,
- sXML_manual, sXML_mastersthesis, sXML_misc, sXML_phdthesis,
- sXML_proceedings, sXML_techreport, sXML_unpublished, sXML_www,
- NULL };
-
-static const sal_Char** aTypeLevelNameMap[] =
+static const XMLTokenEnum aLevelNameTOCMap[] =
+ { XML_TOKEN_INVALID, XML_1, XML_2, XML_3, XML_4, XML_5, XML_6, XML_7,
+ XML_8, XML_9, XML_10, XML_TOKEN_INVALID };
+static const XMLTokenEnum aLevelNameTableMap[] =
+ { XML_TOKEN_INVALID, XML__EMPTY, XML_TOKEN_INVALID };
+static const XMLTokenEnum aLevelNameAlphaMap[] =
+ { XML_TOKEN_INVALID, XML_SEPARATOR, XML_1, XML_2, XML_3, XML_TOKEN_INVALID };
+static const XMLTokenEnum aLevelNameBibliographyMap[] =
+ { XML_TOKEN_INVALID, XML_ARTICLE, XML_BOOK, XML_BOOKLET, XML_CONFERENCE,
+ XML_CUSTOM1, XML_CUSTOM2, XML_CUSTOM3, XML_CUSTOM4,
+ XML_CUSTOM5, XML_EMAIL, XML_INBOOK, XML_INCOLLECTION,
+ XML_INPROCEEDINGS, XML_JOURNAL,
+ XML_MANUAL, XML_MASTERSTHESIS, XML_MISC, XML_PHDTHESIS,
+ XML_PROCEEDINGS, XML_TECHREPORT, XML_UNPUBLISHED, XML_WWW,
+ XML_TOKEN_INVALID };
+
+static const XMLTokenEnum* aTypeLevelNameMap[] =
{
aLevelNameTOCMap, // TOC
aLevelNameTableMap, // table index
@@ -1032,26 +1031,26 @@ static const sal_Char** aTypeLevelStylePropNameMap[] =
aLevelStylePropNameBibliographyMap // bibliography
};
-static const sal_Char* aTypeLevelAttrMap[] =
+static const XMLTokenEnum aTypeLevelAttrMap[] =
{
- sXML_outline_level, // TOC
- NULL, // table index
- NULL, // illustration index
- NULL, // object index
- sXML_outline_level, // user index
- sXML_outline_level, // alphabetical index
- sXML_bibliography_type // bibliography
+ XML_OUTLINE_LEVEL, // TOC
+ XML_TOKEN_INVALID, // table index
+ XML_TOKEN_INVALID, // illustration index
+ XML_TOKEN_INVALID, // object index
+ XML_OUTLINE_LEVEL, // user index
+ XML_OUTLINE_LEVEL, // alphabetical index
+ XML_BIBLIOGRAPHY_TYPE // bibliography
};
-static const sal_Char* aTypeElementNameMap[] =
+static const XMLTokenEnum aTypeElementNameMap[] =
{
- sXML_table_of_content_entry_template, // TOC
- sXML_table_index_entry_template, // table index
- sXML_illustration_index_entry_template, // illustration index
- sXML_object_index_entry_template, // object index
- sXML_user_index_entry_template, // user index
- sXML_alphabetical_index_entry_template, // alphabetical index
- sXML_bibliography_entry_template // bibliography
+ XML_TABLE_OF_CONTENT_ENTRY_TEMPLATE, // TOC
+ XML_TABLE_INDEX_ENTRY_TEMPLATE, // table index
+ XML_ILLUSTRATION_INDEX_ENTRY_TEMPLATE, // illustration index
+ XML_OBJECT_INDEX_ENTRY_TEMPLATE, // object index
+ XML_USER_INDEX_ENTRY_TEMPLATE, // user index
+ XML_ALPHABETICAL_INDEX_ENTRY_TEMPLATE, // alphabetical index
+ XML_BIBLIOGRAPHY_ENTRY_TEMPLATE // bibliography
};
@@ -1061,44 +1060,44 @@ sal_Bool XMLSectionExport::ExportIndexTemplate(
const Reference<XPropertySet> & rPropertySet,
Sequence<Sequence<PropertyValue> > & rValues)
{
- DBG_ASSERT(eType >= TEXT_SECTION_TYPE_TOC, "illegal index type");
- DBG_ASSERT(eType <= TEXT_SECTION_TYPE_BIBLIOGRAPHY, "illegal index type");
- DBG_ASSERT(nOutlineLevel >= 0, "illegal outline level");
+ OSL_ENSURE(eType >= TEXT_SECTION_TYPE_TOC, "illegal index type");
+ OSL_ENSURE(eType <= TEXT_SECTION_TYPE_BIBLIOGRAPHY, "illegal index type");
+ OSL_ENSURE(nOutlineLevel >= 0, "illegal outline level");
if ( (eType >= TEXT_SECTION_TYPE_TOC) &&
(eType <= TEXT_SECTION_TYPE_BIBLIOGRAPHY) &&
(nOutlineLevel >= 0) )
{
// get level name and level attribute name from aLevelNameMap;
- const sal_Char* pLevelAttrName =
- aTypeLevelAttrMap[eType-TEXT_SECTION_TYPE_TOC];
- const sal_Char* pLevelName =
- aTypeLevelNameMap[eType-TEXT_SECTION_TYPE_TOC][nOutlineLevel];
+ const XMLTokenEnum eLevelAttrName(
+ aTypeLevelAttrMap[eType-TEXT_SECTION_TYPE_TOC]);
+ const XMLTokenEnum eLevelName(
+ aTypeLevelNameMap[eType-TEXT_SECTION_TYPE_TOC][nOutlineLevel]);
// #92124#: some old documents may be broken, then they have
// too many template levels; we need to recognize this and
// export only as many as is legal for the respective index
// type. To do this, we simply return an error flag, which
// will then abort further template level exports.
- DBG_ASSERT(NULL != pLevelName, "can't find level name");
- if ( NULL == pLevelName )
+ OSL_ENSURE(XML_TOKEN_INVALID != eLevelName, "can't find level name");
+ if ( XML_TOKEN_INVALID == eLevelName )
{
// output level not found? Then end of templates! #91214#
return sal_False;
}
// output level name
- if ((NULL != pLevelName) && (NULL != pLevelAttrName))
+ if ((XML_TOKEN_INVALID != eLevelName) && (XML_TOKEN_INVALID != eLevelAttrName))
{
- GetExport().AddAttributeASCII(XML_NAMESPACE_TEXT,
- pLevelAttrName,
- pLevelName);
+ GetExport().AddAttribute(XML_NAMESPACE_TEXT,
+ GetXMLToken(eLevelAttrName),
+ GetXMLToken(eLevelName));
}
// paragraph level style name
- const sal_Char* pPropName =
- aTypeLevelStylePropNameMap[eType-TEXT_SECTION_TYPE_TOC][nOutlineLevel];
- DBG_ASSERT(NULL != pPropName, "can't find property name");
+ const sal_Char* pPropName(
+ aTypeLevelStylePropNameMap[eType-TEXT_SECTION_TYPE_TOC][nOutlineLevel]);
+ OSL_ENSURE(NULL != pPropName, "can't find property name");
if (NULL != pPropName)
{
Any aAny = rPropertySet->getPropertyValue(
@@ -1111,11 +1110,11 @@ sal_Bool XMLSectionExport::ExportIndexTemplate(
}
// template element
- const sal_Char* pElementName =
- aTypeElementNameMap[eType - TEXT_SECTION_TYPE_TOC];
+ const XMLTokenEnum eElementName(
+ aTypeElementNameMap[eType - TEXT_SECTION_TYPE_TOC]);
SvXMLElementExport aLevelTemplate(GetExport(),
XML_NAMESPACE_TEXT,
- pElementName,
+ GetXMLToken(eElementName),
sal_True, sal_True);
// export sequence
@@ -1356,39 +1355,46 @@ void XMLSectionExport::ExportIndexTemplateElement(
}
// convert type to token (and check validity) ...
- sal_Char* pElement = NULL;
+ XMLTokenEnum eElement(XML_TOKEN_INVALID);
switch(nTokenType)
{
case TOK_TTYPE_ENTRY_TEXT:
- pElement = sXML_index_entry_text;
+ eElement = XML_INDEX_ENTRY_TEXT;
break;
case TOK_TTYPE_TAB_STOP:
// test validity
- pElement = ( bRightAligned || bTabPositionOK || bFillCharOK )
- ? sXML_index_entry_tab_stop : NULL;
+ if ( bRightAligned || bTabPositionOK || bFillCharOK )
+ {
+ eElement = XML_INDEX_ENTRY_TAB_STOP;
+ }
break;
case TOK_TTYPE_TEXT:
// test validity
- pElement = bTextOK ? sXML_index_entry_span : NULL;
+ if (bTextOK)
+ {
+ eElement = XML_INDEX_ENTRY_SPAN;
+ }
break;
case TOK_TTYPE_PAGE_NUMBER:
- pElement = sXML_index_entry_page_number;
+ eElement = XML_INDEX_ENTRY_PAGE_NUMBER;
break;
case TOK_TTYPE_CHAPTER_INFO: // keyword index
- pElement = sXML_index_entry_chapter;
+ eElement = XML_INDEX_ENTRY_CHAPTER;
break;
case TOK_TTYPE_ENTRY_NUMBER: // table of content
- pElement = sXML_index_entry_chapter;
+ eElement = XML_INDEX_ENTRY_CHAPTER;
break;
case TOK_TTYPE_HYPERLINK_START:
- pElement = sXML_index_entry_link_start;
+ eElement = XML_INDEX_ENTRY_LINK_START;
break;
case TOK_TTYPE_HYPERLINK_END:
- pElement = sXML_index_entry_link_end;
+ eElement = XML_INDEX_ENTRY_LINK_END;
break;
case TOK_TTYPE_BIBLIOGRAPHY:
- pElement = bBibliographyDataOK
- ? sXML_index_entry_bibliography : NULL;
+ if (bBibliographyDataOK)
+ {
+ eElement = XML_INDEX_ENTRY_BIBLIOGRAPHY;
+ }
break;
default:
; // unknown/unimplemented template
@@ -1407,7 +1413,7 @@ void XMLSectionExport::ExportIndexTemplateElement(
//it's not permitted in other indexes
if (eType != TEXT_SECTION_TYPE_ALPHABETICAL)
{
- pElement = NULL; //not permitted, null the element
+ eElement = XML_TOKEN_INVALID; //not permitted, invalidate the element
}
else //maps format for 1.1 & 1.0
{
@@ -1450,7 +1456,7 @@ void XMLSectionExport::ExportIndexTemplateElement(
//<---
// ... and write Element
- if (pElement != NULL)
+ if (eElement != XML_TOKEN_INVALID)
{
// character style (for most templates)
if (bCharStyleOK)
@@ -1513,7 +1519,7 @@ void XMLSectionExport::ExportIndexTemplateElement(
// bibliography data
if (TOK_TTYPE_BIBLIOGRAPHY == nTokenType)
{
- DBG_ASSERT(bBibliographyDataOK, "need bibl data");
+ OSL_ENSURE(bBibliographyDataOK, "need bibl data");
OUStringBuffer sBuf;
if (SvXMLUnitConverter::convertEnum( sBuf, nBibliographyData,
aBibliographyDataFieldMap ) )
@@ -1527,7 +1533,7 @@ void XMLSectionExport::ExportIndexTemplateElement(
// chapter info
if (TOK_TTYPE_CHAPTER_INFO == nTokenType)
{
- DBG_ASSERT(bChapterFormatOK, "need chapter info");
+ OSL_ENSURE(bChapterFormatOK, "need chapter info");
GetExport().AddAttribute(
XML_NAMESPACE_TEXT, XML_DISPLAY,
XMLTextFieldExport::MapChapterDisplayFormat(nChapterFormat));
@@ -1553,7 +1559,9 @@ void XMLSectionExport::ExportIndexTemplateElement(
//<---
// export template
SvXMLElementExport aTemplateElement(GetExport(), XML_NAMESPACE_TEXT,
- pElement, sal_True, sal_False);
+ GetXMLToken(eElement),
+ sal_True, sal_False)
+ ;
// entry text or span element: write text
if (TOK_TTYPE_TEXT == nTokenType)
@@ -1617,7 +1625,7 @@ void XMLSectionExport::ExportBoolean(
sal_Bool bDefault,
sal_Bool bInvert)
{
- DBG_ASSERT(eAttributeName != XML_TOKEN_INVALID, "Need attribute name");
+ OSL_ENSURE(eAttributeName != XML_TOKEN_INVALID, "Need attribute name");
Any aAny = rPropSet->getPropertyValue(sPropertyName);
sal_Bool bTmp = *(sal_Bool*)aAny.getValue();
@@ -1659,7 +1667,7 @@ void XMLSectionExport::ExportBibliographyConfiguration(SvXMLExport& rExport)
Reference<XPropertySet> xPropSet;
aAny >>= xPropSet;
- DBG_ASSERT( xPropSet.is(), "field master must have XPropSet" );
+ OSL_ENSURE( xPropSet.is(), "field master must have XPropSet" );
const OUString sBracketBefore(
RTL_CONSTASCII_USTRINGPARAM("BracketBefore"));
@@ -1846,7 +1854,7 @@ sal_Bool XMLSectionExport::IsInSection(
{
// default: like default argument
sal_Bool bRet = bDefault;
- DBG_ASSERT(rEnclosingSection.is(), "enclosing section expected");
+ OSL_ENSURE(rEnclosingSection.is(), "enclosing section expected");
Reference<XPropertySet> xPropSet(rContent, UNO_QUERY);
if (xPropSet.is())
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index c3ff9abebd90..6eaa0f10b0ef 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -46,7 +46,6 @@
#include <xmloff/xmlimp.hxx>
#include <xmloff/xmltoken.hxx>
#include "xmlnmspe.hxx"
-#include "xmlkywd.hxx"
#include <xmloff/nmspmap.hxx>
#include <xmloff/xmluconv.hxx>
#include "XMLAnchorTypePropHdl.hxx"
@@ -1035,10 +1034,11 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl(
{
OUString sValue( rValue );
sValue.trim();
- const sal_Int32 nRotateLen = sizeof(sXML_rotate)-1;
+ const OUString aRotate(GetXMLToken(XML_ROTATE));
+ const sal_Int32 nRotateLen(aRotate.getLength());
sal_Int32 nLen = sValue.getLength();
if( nLen >= nRotateLen+3 &&
- 0 == sValue.compareToAscii( sXML_rotate, nRotateLen ) &&
+ 0 == sValue.compareTo( aRotate, nRotateLen ) &&
'(' == sValue[nRotateLen] &&
')' == sValue[nLen-1] )
{
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 2c160eabd334..2c3891b7d3b0 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -93,7 +93,6 @@
#include <com/sun/star/text/XEndnotesSupplier.hpp>
#include <com/sun/star/drawing/XControlShape.hpp>
#include <com/sun/star/util/DateTime.hpp>
-#include "xmlkywd.hxx"
#include "xmlnmspe.hxx"
#include <xmloff/xmlaustp.hxx>
#include <xmloff/families.hxx>