Using fast tokens directly:
Replacing integer-to-integer mapped tokens with fast Tokens direcly for branching. Adding a macro XML_ELEMENT that combines namespace and element tokens. Change-Id: I8701c8af9607392843460fe726bffb6556cf9b33 Reviewed-on: https://gerrit.libreoffice.org/39275 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
This commit is contained in:
committed by
Michael Meeks
parent
d109948f0d
commit
c44d9f9e62
@@ -64,6 +64,7 @@
|
||||
#include <memory>
|
||||
|
||||
#define NAMESPACE_TOKEN( prefixToken ) ( ( sal_Int32( prefixToken + 1 ) ) << NMSP_SHIFT )
|
||||
#define XML_ELEMENT( prefix, name ) ( NAMESPACE_TOKEN( XML_NAMESPACE_##prefix ) | name )
|
||||
|
||||
const size_t NMSP_SHIFT = 16;
|
||||
const sal_Int32 TOKEN_MASK = 0xffff;
|
||||
|
@@ -111,8 +111,7 @@ ScXMLBodyContext::ScXMLBodyContext( ScXMLImport& rImport,
|
||||
else if ( nLocalToken == XML_PROTECTION_KEY_DIGEST_ALGORITHM_2 )
|
||||
meHash2 = ScPassHashHelper::getHashTypeFromURI( it.toString() );
|
||||
}
|
||||
else if ( nToken == ( NAMESPACE_TOKEN( XML_NAMESPACE_LO_EXT ) |
|
||||
XML_PROTECTION_KEY_DIGEST_ALGORITHM_2 ) )
|
||||
else if ( nToken == XML_ELEMENT( LO_EXT, XML_PROTECTION_KEY_DIGEST_ALGORITHM_2 ) )
|
||||
{
|
||||
meHash2 = ScPassHashHelper::getHashTypeFromURI( it.toString() );
|
||||
}
|
||||
@@ -205,10 +204,9 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
|
||||
|
||||
SvXMLImportContext *pContext = nullptr;
|
||||
|
||||
const SvXMLTokenMap& rTokenMap = GetScImport().GetBodyElemTokenMap();
|
||||
switch( rTokenMap.Get( nElement ) )
|
||||
switch( nElement )
|
||||
{
|
||||
case XML_TOK_BODY_TABLE:
|
||||
case XML_ELEMENT( TABLE, XML_TABLE ):
|
||||
if (GetScImport().GetTables().GetCurrentSheet() >= MAXTAB)
|
||||
{
|
||||
GetScImport().SetRangeOverflowType(SCWARN_IMPORT_SHEET_OVERFLOW);
|
||||
|
@@ -158,7 +158,6 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
|
||||
|
||||
std::unique_ptr<OUString> xStyleName;
|
||||
std::unique_ptr<OUString> xCurrencySymbol;
|
||||
const SvXMLTokenMap& rTokenMap = rImport.GetTableRowCellAttrTokenMap();
|
||||
if( xAttrList.is() )
|
||||
{
|
||||
sax_fastparser::FastAttributeList *pAttribList;
|
||||
@@ -167,43 +166,42 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
|
||||
|
||||
for ( auto it = pAttribList->begin(); it != pAttribList->end(); ++it)
|
||||
{
|
||||
sal_uInt16 nToken = rTokenMap.Get( it.getToken() );
|
||||
switch ( nToken )
|
||||
switch ( it.getToken() )
|
||||
{
|
||||
case XML_TOK_TABLE_ROW_CELL_ATTR_STYLE_NAME:
|
||||
case XML_ELEMENT( TABLE, XML_STYLE_NAME ):
|
||||
xStyleName.reset( new OUString( it.toString() ) );
|
||||
mbHasStyle = true;
|
||||
break;
|
||||
case XML_TOK_TABLE_ROW_CELL_ATTR_CONTENT_VALIDATION_NAME:
|
||||
case XML_ELEMENT( TABLE, XML_CONTENT_VALIDATION_NAME ):
|
||||
OSL_ENSURE(!maContentValidationName, "here should be only one Validation Name");
|
||||
if (!it.isEmpty())
|
||||
maContentValidationName.reset(it.toString());
|
||||
break;
|
||||
case XML_TOK_TABLE_ROW_CELL_ATTR_SPANNED_ROWS:
|
||||
case XML_ELEMENT( TABLE, XML_NUMBER_ROWS_SPANNED ):
|
||||
bIsMerged = true;
|
||||
nMergedRows = static_cast<SCROW>(it.toInt32());
|
||||
break;
|
||||
case XML_TOK_TABLE_ROW_CELL_ATTR_SPANNED_COLS:
|
||||
case XML_ELEMENT( TABLE, XML_NUMBER_COLUMNS_SPANNED ):
|
||||
bIsMerged = true;
|
||||
nMergedCols = static_cast<SCCOL>(it.toInt32());
|
||||
break;
|
||||
case XML_TOK_TABLE_ROW_CELL_ATTR_SPANNED_MATRIX_COLS:
|
||||
case XML_ELEMENT( TABLE, XML_NUMBER_MATRIX_COLUMNS_SPANNED ):
|
||||
bIsMatrix = true;
|
||||
nMatrixCols = static_cast<SCCOL>(it.toInt32());
|
||||
break;
|
||||
case XML_TOK_TABLE_ROW_CELL_ATTR_SPANNED_MATRIX_ROWS:
|
||||
case XML_ELEMENT( TABLE, XML_NUMBER_MATRIX_ROWS_SPANNED ):
|
||||
bIsMatrix = true;
|
||||
nMatrixRows = static_cast<SCROW>(it.toInt32());
|
||||
break;
|
||||
case XML_TOK_TABLE_ROW_CELL_ATTR_REPEATED:
|
||||
case XML_ELEMENT( TABLE, XML_NUMBER_COLUMNS_REPEATED ):
|
||||
nColsRepeated = static_cast<SCCOL>(std::min<sal_Int32>( MAXCOLCOUNT,
|
||||
std::max( it.toInt32(), static_cast<sal_Int32>(1) ) ));
|
||||
break;
|
||||
case XML_TOK_TABLE_ROW_CELL_ATTR_VALUE_TYPE:
|
||||
case XML_ELEMENT( OFFICE, XML_VALUE_TYPE ):
|
||||
nCellType = GetScImport().GetCellType(it.toString());
|
||||
bIsEmpty = false;
|
||||
break;
|
||||
case XML_TOK_TABLE_ROW_CELL_ATTR_NEW_VALUE_TYPE:
|
||||
case XML_ELEMENT( CALC_EXT, XML_VALUE_TYPE ):
|
||||
if(it.isString( "error" ) )
|
||||
mbErrorValue = true;
|
||||
else
|
||||
@@ -211,7 +209,7 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
|
||||
bIsEmpty = false;
|
||||
mbNewValueType = true;
|
||||
break;
|
||||
case XML_TOK_TABLE_ROW_CELL_ATTR_VALUE:
|
||||
case XML_ELEMENT( OFFICE, XML_VALUE ):
|
||||
{
|
||||
if (!it.isEmpty())
|
||||
{
|
||||
@@ -226,7 +224,7 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
|
||||
}
|
||||
}
|
||||
break;
|
||||
case XML_TOK_TABLE_ROW_CELL_ATTR_DATE_VALUE:
|
||||
case XML_ELEMENT( OFFICE, XML_DATE_VALUE ):
|
||||
{
|
||||
if (!it.isEmpty() && rXMLImport.SetNullDateOnUnitConverter())
|
||||
{
|
||||
@@ -235,7 +233,7 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
|
||||
}
|
||||
}
|
||||
break;
|
||||
case XML_TOK_TABLE_ROW_CELL_ATTR_TIME_VALUE:
|
||||
case XML_ELEMENT( OFFICE, XML_TIME_VALUE ):
|
||||
{
|
||||
if (!it.isEmpty())
|
||||
{
|
||||
@@ -244,7 +242,7 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
|
||||
}
|
||||
}
|
||||
break;
|
||||
case XML_TOK_TABLE_ROW_CELL_ATTR_STRING_VALUE:
|
||||
case XML_ELEMENT( OFFICE, XML_STRING_VALUE ):
|
||||
{
|
||||
if (!it.isEmpty())
|
||||
{
|
||||
@@ -254,7 +252,7 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
|
||||
}
|
||||
}
|
||||
break;
|
||||
case XML_TOK_TABLE_ROW_CELL_ATTR_BOOLEAN_VALUE:
|
||||
case XML_ELEMENT( OFFICE , XML_BOOLEAN_VALUE ):
|
||||
{
|
||||
if (!it.isEmpty())
|
||||
{
|
||||
@@ -268,7 +266,7 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
|
||||
}
|
||||
}
|
||||
break;
|
||||
case XML_TOK_TABLE_ROW_CELL_ATTR_FORMULA:
|
||||
case XML_ELEMENT( TABLE, XML_FORMULA ):
|
||||
{
|
||||
if (!it.isEmpty())
|
||||
{
|
||||
@@ -279,7 +277,7 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
|
||||
}
|
||||
}
|
||||
break;
|
||||
case XML_TOK_TABLE_ROW_CELL_ATTR_CURRENCY:
|
||||
case XML_ELEMENT( OFFICE, XML_CURRENCY ):
|
||||
xCurrencySymbol.reset( new OUString( it.toString() ) );
|
||||
break;
|
||||
default:
|
||||
|
@@ -57,13 +57,13 @@ ScXMLExternalRefTabSourceContext::ScXMLExternalRefTabSourceContext(
|
||||
for ( auto it = pAttribList->begin(); it != pAttribList->end(); ++it)
|
||||
{
|
||||
sal_Int32 nAttrToken = it.getToken();
|
||||
if ( nAttrToken == ( NAMESPACE_TOKEN( XML_NAMESPACE_XLINK ) | XML_HREF ) )
|
||||
if ( nAttrToken == XML_ELEMENT( XLINK, XML_HREF ) )
|
||||
maRelativeUrl = it.toString();
|
||||
else if ( nAttrToken == ( NAMESPACE_TOKEN( XML_NAMESPACE_TABLE ) | XML_TABLE_NAME ) )
|
||||
else if ( nAttrToken == XML_ELEMENT( TABLE, XML_TABLE_NAME ) )
|
||||
maTableName = it.toString();
|
||||
else if ( nAttrToken == ( NAMESPACE_TOKEN( XML_NAMESPACE_TABLE ) | XML_FILTER_NAME ) )
|
||||
else if ( nAttrToken == XML_ELEMENT( TABLE, XML_FILTER_NAME ) )
|
||||
maFilterName = it.toString();
|
||||
else if ( nAttrToken == ( NAMESPACE_TOKEN( XML_NAMESPACE_TABLE ) | XML_FILTER_OPTIONS ) )
|
||||
else if ( nAttrToken == XML_ELEMENT( TABLE, XML_FILTER_OPTIONS ) )
|
||||
maFilterOptions = it.toString();
|
||||
}
|
||||
}
|
||||
|
@@ -332,7 +332,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
|
||||
ScXMLFlatDocContext_Impl::createFastChildContext( sal_Int32 nElement,
|
||||
const uno::Reference< xml::sax::XFastAttributeList > & xAttrList )
|
||||
{
|
||||
if ( nElement != ( NAMESPACE_TOKEN( XML_NAMESPACE_OFFICE ) | XML_META ) )
|
||||
if ( nElement != XML_ELEMENT( OFFICE, XML_META ) )
|
||||
return ScXMLDocContext_Impl::createFastChildContext( nElement, xAttrList );
|
||||
else
|
||||
return new SvXMLImportContext( GetImport() );
|
||||
@@ -422,10 +422,9 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
|
||||
{
|
||||
SvXMLImportContext *pContext(nullptr);
|
||||
|
||||
const SvXMLTokenMap& rTokenMap(GetScImport().GetDocElemTokenMap());
|
||||
switch( rTokenMap.Get( nElement ) )
|
||||
switch( nElement )
|
||||
{
|
||||
case XML_TOK_DOC_BODY:
|
||||
case XML_ELEMENT( OFFICE, XML_BODY ):
|
||||
if (GetScImport().getImportFlags() & SvXMLImportFlags::CONTENT)
|
||||
pContext = new ScXMLBodyContext_Impl( GetScImport() );
|
||||
break;
|
||||
@@ -2046,13 +2045,13 @@ SvXMLImportContext *ScXMLImport::CreateFastContext( sal_Int32 nElement,
|
||||
|
||||
switch( nElement )
|
||||
{
|
||||
case ( NAMESPACE_TOKEN( XML_NAMESPACE_OFFICE ) | XML_DOCUMENT_STYLES ):
|
||||
case ( NAMESPACE_TOKEN( XML_NAMESPACE_OFFICE ) | XML_DOCUMENT_CONTENT ):
|
||||
case ( NAMESPACE_TOKEN( XML_NAMESPACE_OFFICE ) | XML_DOCUMENT_SETTINGS ):
|
||||
case XML_ELEMENT( OFFICE, XML_DOCUMENT_STYLES ):
|
||||
case XML_ELEMENT( OFFICE, XML_DOCUMENT_CONTENT ):
|
||||
case XML_ELEMENT( OFFICE, XML_DOCUMENT_SETTINGS ):
|
||||
pContext = new ScXMLDocContext_Impl( *this );
|
||||
break;
|
||||
|
||||
case ( NAMESPACE_TOKEN( XML_NAMESPACE_OFFICE ) | XML_DOCUMENT ):
|
||||
case XML_ELEMENT( OFFICE, XML_DOCUMENT ):
|
||||
{
|
||||
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
|
||||
GetModel(), uno::UNO_QUERY_THROW);
|
||||
|
@@ -51,7 +51,6 @@ ScXMLTableRowContext::ScXMLTableRowContext( ScXMLImport& rImport,
|
||||
bHasCell(false)
|
||||
{
|
||||
OUString sCellStyleName;
|
||||
const SvXMLTokenMap& rAttrTokenMap(GetScImport().GetTableRowAttrTokenMap());
|
||||
if ( xAttrList.is() )
|
||||
{
|
||||
sax_fastparser::FastAttributeList *pAttribList;
|
||||
@@ -60,30 +59,30 @@ ScXMLTableRowContext::ScXMLTableRowContext( ScXMLImport& rImport,
|
||||
|
||||
for ( auto it = pAttribList->begin(); it != pAttribList->end(); ++it)
|
||||
{
|
||||
switch( rAttrTokenMap.Get( it.getToken() ) )
|
||||
switch( it.getToken() )
|
||||
{
|
||||
case XML_TOK_TABLE_ROW_ATTR_STYLE_NAME:
|
||||
case XML_ELEMENT( TABLE, XML_STYLE_NAME ):
|
||||
{
|
||||
sStyleName = it.toString();
|
||||
}
|
||||
break;
|
||||
case XML_TOK_TABLE_ROW_ATTR_VISIBILITY:
|
||||
case XML_ELEMENT( TABLE, XML_VISIBILITY ):
|
||||
{
|
||||
sVisibility = it.toString();
|
||||
}
|
||||
break;
|
||||
case XML_TOK_TABLE_ROW_ATTR_REPEATED:
|
||||
case XML_ELEMENT( TABLE, XML_NUMBER_ROWS_REPEATED ):
|
||||
{
|
||||
nRepeatedRows = std::max( it.toInt32(), (sal_Int32) 1 );
|
||||
nRepeatedRows = std::min( nRepeatedRows, MAXROWCOUNT );
|
||||
}
|
||||
break;
|
||||
case XML_TOK_TABLE_ROW_ATTR_DEFAULT_CELL_STYLE_NAME:
|
||||
case XML_ELEMENT( TABLE, XML_DEFAULT_CELL_STYLE_NAME ):
|
||||
{
|
||||
sCellStyleName = it.toString();
|
||||
}
|
||||
break;
|
||||
/*case XML_TOK_TABLE_ROW_ATTR_USE_OPTIMAL_HEIGHT:
|
||||
/*case XML_ELEMENT( TABLE, XML_USE_OPTIMAL_HEIGHT ):
|
||||
{
|
||||
sOptimalHeight = it.toString();
|
||||
}
|
||||
@@ -106,10 +105,9 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
|
||||
{
|
||||
SvXMLImportContext *pContext(nullptr);
|
||||
|
||||
const SvXMLTokenMap& rTokenMap(GetScImport().GetTableRowElemTokenMap());
|
||||
switch( rTokenMap.Get( nElement ) )
|
||||
switch( nElement )
|
||||
{
|
||||
case XML_TOK_TABLE_ROW_CELL:
|
||||
case XML_ELEMENT( TABLE, XML_TABLE_CELL ):
|
||||
// if( IsInsertCellPossible() )
|
||||
{
|
||||
bHasCell = true;
|
||||
@@ -119,7 +117,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
|
||||
);
|
||||
}
|
||||
break;
|
||||
case XML_TOK_TABLE_ROW_COVERED_CELL:
|
||||
case XML_ELEMENT( TABLE, XML_COVERED_TABLE_CELL ):
|
||||
// if( IsInsertCellPossible() )
|
||||
{
|
||||
bHasCell = true;
|
||||
@@ -231,10 +229,10 @@ ScXMLTableRowsContext::ScXMLTableRowsContext( ScXMLImport& rImport,
|
||||
nGroupStartRow = rImport.GetTables().GetCurrentRow();
|
||||
++nGroupStartRow;
|
||||
if ( xAttrList.is() &&
|
||||
xAttrList->hasAttribute( NAMESPACE_TOKEN( XML_NAMESPACE_TABLE ) | XML_DISPLAY ) )
|
||||
xAttrList->hasAttribute( XML_ELEMENT( TABLE, XML_DISPLAY ) ) )
|
||||
{
|
||||
bGroupDisplay = IsXMLToken( xAttrList->getValue(
|
||||
NAMESPACE_TOKEN( XML_NAMESPACE_TABLE ) | XML_DISPLAY ), XML_TRUE );
|
||||
XML_ELEMENT( TABLE, XML_DISPLAY ) ), XML_TRUE );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -249,22 +247,21 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
|
||||
{
|
||||
SvXMLImportContext *pContext(nullptr);
|
||||
|
||||
const SvXMLTokenMap& rTokenMap(GetScImport().GetTableRowsElemTokenMap());
|
||||
switch( rTokenMap.Get( nElement ) )
|
||||
switch( nElement )
|
||||
{
|
||||
case XML_TOK_TABLE_ROWS_ROW_GROUP:
|
||||
case XML_ELEMENT( TABLE, XML_TABLE_ROW_GROUP ):
|
||||
pContext = new ScXMLTableRowsContext( GetScImport(), xAttrList,
|
||||
false, true );
|
||||
break;
|
||||
case XML_TOK_TABLE_ROWS_HEADER_ROWS:
|
||||
case XML_ELEMENT( TABLE, XML_TABLE_HEADER_ROWS ):
|
||||
pContext = new ScXMLTableRowsContext( GetScImport(), xAttrList,
|
||||
true, false );
|
||||
break;
|
||||
case XML_TOK_TABLE_ROWS_ROWS:
|
||||
case XML_ELEMENT( TABLE, XML_TABLE_ROWS ):
|
||||
pContext = new ScXMLTableRowsContext( GetScImport(), xAttrList,
|
||||
false, false );
|
||||
break;
|
||||
case XML_TOK_TABLE_ROWS_ROW:
|
||||
case XML_ELEMENT( TABLE, XML_TABLE_ROW ):
|
||||
pContext = new ScXMLTableRowContext( GetScImport(), xAttrList );
|
||||
break;
|
||||
}
|
||||
|
@@ -39,6 +39,7 @@
|
||||
#include <xmloff/xmltkmap.hxx>
|
||||
#include <xmloff/nmspmap.hxx>
|
||||
#include <xmloff/xmltoken.hxx>
|
||||
#include <xmloff/xmlnmspe.hxx>
|
||||
#include <xmloff/XMLEventsImportContext.hxx>
|
||||
|
||||
#include <tools/urlobj.hxx>
|
||||
@@ -149,33 +150,33 @@ ScXMLTableContext::ScXMLTableContext( ScXMLImport& rImport,
|
||||
assert( dynamic_cast< sax_fastparser::FastAttributeList *>( xAttrList.get() ) != nullptr );
|
||||
pAttribList = static_cast< sax_fastparser::FastAttributeList *>( xAttrList.get() );
|
||||
|
||||
const SvXMLTokenMap& rAttrTokenMap = GetScImport().GetTableAttrTokenMap();
|
||||
for ( auto it = pAttribList->begin(); it != pAttribList->end(); ++it)
|
||||
{
|
||||
switch( rAttrTokenMap.Get( it.getToken() ) )
|
||||
switch( it.getToken() )
|
||||
{
|
||||
case XML_TOK_TABLE_NAME:
|
||||
case XML_ELEMENT( TABLE, XML_NAME ):
|
||||
sName = it.toString();
|
||||
break;
|
||||
case XML_TOK_TABLE_STYLE_NAME:
|
||||
case XML_ELEMENT( TABLE, XML_STYLE_NAME ):
|
||||
sStyleName = it.toString();
|
||||
break;
|
||||
case XML_TOK_TABLE_PROTECTED:
|
||||
case XML_ELEMENT( TABLE, XML_PROTECTED ):
|
||||
aProtectData.mbProtected = IsXMLToken( it.toCString(), XML_TRUE );
|
||||
break;
|
||||
case XML_TOK_TABLE_PRINT_RANGES:
|
||||
case XML_ELEMENT( TABLE, XML_PRINT_RANGES ):
|
||||
sPrintRanges = it.toString();
|
||||
break;
|
||||
case XML_TOK_TABLE_PASSWORD:
|
||||
case XML_ELEMENT( TABLE, XML_PROTECTION_KEY ):
|
||||
aProtectData.maPassword = it.toString();
|
||||
break;
|
||||
case XML_TOK_TABLE_PASSHASH:
|
||||
case XML_ELEMENT( TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM ):
|
||||
aProtectData.meHash1 = ScPassHashHelper::getHashTypeFromURI( it.toString() );
|
||||
break;
|
||||
case XML_TOK_TABLE_PASSHASH_2:
|
||||
case XML_ELEMENT( TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM_2 ):
|
||||
case XML_ELEMENT( LO_EXT, XML_PROTECTION_KEY_DIGEST_ALGORITHM_2 ):
|
||||
aProtectData.meHash2 = ScPassHashHelper::getHashTypeFromURI( it.toString() );
|
||||
break;
|
||||
case XML_TOK_TABLE_PRINT:
|
||||
case XML_ELEMENT( TABLE, XML_PRINT ):
|
||||
{
|
||||
if (IsXMLToken( it.toCString(), XML_FALSE) )
|
||||
bPrintEntireSheet = false;
|
||||
@@ -300,24 +301,22 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
|
||||
ScXMLTableContext::createFastChildContext( sal_Int32 nElement,
|
||||
const uno::Reference< xml::sax::XFastAttributeList > & xAttrList )
|
||||
{
|
||||
const SvXMLTokenMap& rTokenMap(GetScImport().GetTableElemTokenMap());
|
||||
sal_uInt16 nToken = rTokenMap.Get( nElement );
|
||||
if (pExternalRefInfo.get())
|
||||
{
|
||||
// We only care about the table-row and table-source elements for
|
||||
// external cache data.
|
||||
switch (nToken)
|
||||
switch ( nElement )
|
||||
{
|
||||
case XML_TOK_TABLE_ROW_GROUP:
|
||||
case XML_TOK_TABLE_HEADER_ROWS:
|
||||
case XML_TOK_TABLE_ROWS:
|
||||
case XML_ELEMENT( TABLE, XML_TABLE_ROW_GROUP ):
|
||||
case XML_ELEMENT( TABLE, XML_TABLE_HEADER_ROWS ):
|
||||
case XML_ELEMENT( TABLE, XML_TABLE_ROWS ):
|
||||
// #i101319# don't discard rows in groups or header (repeat range)
|
||||
return new ScXMLExternalRefRowsContext(
|
||||
GetScImport(), nElement, xAttrList, *pExternalRefInfo);
|
||||
case XML_TOK_TABLE_ROW:
|
||||
case XML_ELEMENT( TABLE, XML_TABLE_ROW ):
|
||||
return new ScXMLExternalRefRowContext(
|
||||
GetScImport(), nElement, xAttrList, *pExternalRefInfo);
|
||||
case XML_TOK_TABLE_SOURCE:
|
||||
case XML_ELEMENT( TABLE, XML_TABLE_SOURCE ):
|
||||
return new ScXMLExternalRefTabSourceContext(
|
||||
GetScImport(), nElement, xAttrList, *pExternalRefInfo);
|
||||
default:
|
||||
@@ -328,21 +327,21 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
|
||||
|
||||
SvXMLImportContext *pContext(nullptr);
|
||||
|
||||
switch (nToken)
|
||||
switch ( nElement )
|
||||
{
|
||||
case XML_TOK_TABLE_ROW_GROUP:
|
||||
case XML_ELEMENT( TABLE, XML_TABLE_ROW_GROUP ):
|
||||
pContext = new ScXMLTableRowsContext( GetScImport(), xAttrList,
|
||||
false, true );
|
||||
break;
|
||||
case XML_TOK_TABLE_HEADER_ROWS:
|
||||
case XML_ELEMENT( TABLE, XML_TABLE_HEADER_ROWS ):
|
||||
pContext = new ScXMLTableRowsContext( GetScImport(), xAttrList,
|
||||
true, false );
|
||||
break;
|
||||
case XML_TOK_TABLE_ROWS:
|
||||
case XML_ELEMENT( TABLE, XML_TABLE_ROWS ):
|
||||
pContext = new ScXMLTableRowsContext( GetScImport(), xAttrList,
|
||||
false, false );
|
||||
break;
|
||||
case XML_TOK_TABLE_ROW:
|
||||
case XML_ELEMENT( TABLE, XML_TABLE_ROW ):
|
||||
pContext = new ScXMLTableRowContext( GetScImport(),xAttrList );
|
||||
break;
|
||||
default:
|
||||
|
@@ -789,9 +789,9 @@ void SAL_CALL SvXMLImport::setDocumentLocator( const uno::Reference< xml::sax::X
|
||||
void SAL_CALL SvXMLImport::startFastElement (sal_Int32 Element,
|
||||
const uno::Reference< xml::sax::XFastAttributeList > & Attribs)
|
||||
{
|
||||
if ( Attribs.is() && Attribs->hasAttribute( NAMESPACE_TOKEN( XML_NAMESPACE_OFFICE ) | XML_VERSION ) )
|
||||
if ( Attribs.is() && Attribs->hasAttribute( XML_ELEMENT( OFFICE, XML_VERSION ) ) )
|
||||
{
|
||||
mpImpl->aODFVersion = Attribs->getValue( NAMESPACE_TOKEN( XML_NAMESPACE_OFFICE ) | XML_VERSION );
|
||||
mpImpl->aODFVersion = Attribs->getValue( XML_ELEMENT( OFFICE, XML_VERSION ) );
|
||||
|
||||
// the ODF version in content.xml and manifest.xml must be the same starting from ODF1.2
|
||||
if ( mpImpl->mStreamName == "content.xml" && !IsODFVersionConsistent( mpImpl->aODFVersion ) )
|
||||
|
@@ -94,7 +94,7 @@ void XMLGradientStyleImport::importXML(
|
||||
{ XML_NAMESPACE_DRAW, XML_END_INTENSITY, XML_TOK_GRADIENT_ENDINT },
|
||||
{ XML_NAMESPACE_DRAW, XML_GRADIENT_ANGLE, XML_TOK_GRADIENT_ANGLE },
|
||||
{ XML_NAMESPACE_DRAW, XML_GRADIENT_BORDER, XML_TOK_GRADIENT_BORDER,
|
||||
NAMESPACE_TOKEN( XML_NAMESPACE_DRAW ) | XML_BORDER },
|
||||
XML_ELEMENT( DRAW, XML_BORDER ) },
|
||||
// XML_GRADIENT_BORDER is a duplicate of XML_BORDER
|
||||
XML_TOKEN_MAP_END
|
||||
};
|
||||
|
@@ -79,7 +79,7 @@ void XMLHatchStyleImport::importXML(
|
||||
{ XML_NAMESPACE_DRAW, XML_STYLE, XML_TOK_HATCH_STYLE },
|
||||
{ XML_NAMESPACE_DRAW, XML_COLOR, XML_TOK_HATCH_COLOR },
|
||||
{ XML_NAMESPACE_DRAW, XML_HATCH_DISTANCE, XML_TOK_HATCH_DISTANCE,
|
||||
NAMESPACE_TOKEN( XML_NAMESPACE_DRAW ) | XML_DISTANCE },
|
||||
XML_ELEMENT( DRAW, XML_DISTANCE ) },
|
||||
// XML_HATCH_DISTANCE is a duplicate of XML_DISTANCE
|
||||
{ XML_NAMESPACE_DRAW, XML_ROTATION, XML_TOK_HATCH_ROTATION },
|
||||
XML_TOKEN_MAP_END
|
||||
|
@@ -99,7 +99,7 @@ void XMLTransGradientStyleImport::importXML(
|
||||
{ XML_NAMESPACE_DRAW, XML_END, XML_TOK_GRADIENT_END },
|
||||
{ XML_NAMESPACE_DRAW, XML_GRADIENT_ANGLE, XML_TOK_GRADIENT_ANGLE },
|
||||
{ XML_NAMESPACE_DRAW, XML_GRADIENT_BORDER, XML_TOK_GRADIENT_BORDER,
|
||||
NAMESPACE_TOKEN( XML_NAMESPACE_DRAW ) | XML_BORDER },
|
||||
XML_ELEMENT( DRAW, XML_BORDER ) },
|
||||
// XML_GRADIENT_BORDER is a duplicate of XML_BORDER
|
||||
XML_TOKEN_MAP_END
|
||||
};
|
||||
|
Reference in New Issue
Block a user