don't write new elements/attribs to ODF namespaces
Related to validation errors with fdo#31296 Change-Id: I1b76e05a9996b1123db164629475a3f7b07dda69
This commit is contained in:
@@ -2886,12 +2886,12 @@ void ScXMLExport::WriteTable(sal_Int32 nTable, const Reference<sheet::XSpreadshe
|
||||
if (pProtect && pProtect->isProtected() && getDefaultVersion() > SvtSaveOptions::ODFVER_012)
|
||||
{
|
||||
if (pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS))
|
||||
AddAttribute(XML_NAMESPACE_TABLE, XML_SELECT_PROTECTED_CELLS, XML_TRUE);
|
||||
AddAttribute(XML_NAMESPACE_OFFICE_EXT, XML_SELECT_PROTECTED_CELLS, XML_TRUE);
|
||||
if (pProtect->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS))
|
||||
AddAttribute(XML_NAMESPACE_TABLE, XML_SELECT_UNPROTECTED_CELLS, XML_TRUE);
|
||||
AddAttribute(XML_NAMESPACE_OFFICE_EXT, XML_SELECT_UNPROTECTED_CELLS, XML_TRUE);
|
||||
|
||||
OUString aElemName = GetNamespaceMap().GetQNameByKey(
|
||||
XML_NAMESPACE_TABLE, GetXMLToken(XML_TABLE_PROTECTION));
|
||||
XML_NAMESPACE_OFFICE_EXT, GetXMLToken(XML_TABLE_PROTECTION));
|
||||
|
||||
SvXMLElementExport aElemProtected(*this, aElemName, true, true);
|
||||
}
|
||||
|
@@ -829,6 +829,7 @@ const SvXMLTokenMap& ScXMLImport::GetTableElemTokenMap()
|
||||
{ XML_NAMESPACE_TABLE, XML_TABLE_COLUMNS, XML_TOK_TABLE_COLS },
|
||||
{ XML_NAMESPACE_TABLE, XML_TABLE_COLUMN, XML_TOK_TABLE_COL },
|
||||
{ XML_NAMESPACE_TABLE, XML_TABLE_PROTECTION, XML_TOK_TABLE_PROTECTION },
|
||||
{ XML_NAMESPACE_OFFICE_EXT, XML_TABLE_PROTECTION, XML_TOK_TABLE_PROTECTION_EXT },
|
||||
{ XML_NAMESPACE_TABLE, XML_TABLE_ROW_GROUP, XML_TOK_TABLE_ROW_GROUP },
|
||||
{ XML_NAMESPACE_TABLE, XML_TABLE_HEADER_ROWS, XML_TOK_TABLE_HEADER_ROWS },
|
||||
{ XML_NAMESPACE_TABLE, XML_TABLE_ROWS, XML_TOK_TABLE_ROWS },
|
||||
@@ -857,6 +858,8 @@ const SvXMLTokenMap& ScXMLImport::GetTableProtectionAttrTokenMap()
|
||||
{
|
||||
{ XML_NAMESPACE_TABLE, XML_SELECT_PROTECTED_CELLS, XML_TOK_TABLE_SELECT_PROTECTED_CELLS },
|
||||
{ XML_NAMESPACE_TABLE, XML_SELECT_UNPROTECTED_CELLS, XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS },
|
||||
{ XML_NAMESPACE_OFFICE_EXT, XML_SELECT_PROTECTED_CELLS, XML_TOK_TABLE_SELECT_PROTECTED_CELLS_EXT },
|
||||
{ XML_NAMESPACE_OFFICE_EXT, XML_SELECT_UNPROTECTED_CELLS, XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS_EXT },
|
||||
XML_TOKEN_MAP_END
|
||||
};
|
||||
pTableProtectionElemTokenMap = new SvXMLTokenMap(aTableProtectionTokenMap);
|
||||
|
@@ -247,6 +247,7 @@ enum ScXMLTableTokens
|
||||
XML_TOK_TABLE_ROW_GROUP,
|
||||
XML_TOK_TABLE_HEADER_ROWS,
|
||||
XML_TOK_TABLE_PROTECTION,
|
||||
XML_TOK_TABLE_PROTECTION_EXT,
|
||||
XML_TOK_TABLE_ROWS,
|
||||
XML_TOK_TABLE_ROW,
|
||||
XML_TOK_TABLE_SOURCE,
|
||||
@@ -261,7 +262,9 @@ enum ScXMLTableTokens
|
||||
enum ScXMLTokenProtectionTokens
|
||||
{
|
||||
XML_TOK_TABLE_SELECT_PROTECTED_CELLS,
|
||||
XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS
|
||||
XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS,
|
||||
XML_TOK_TABLE_SELECT_PROTECTED_CELLS_EXT,
|
||||
XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS_EXT
|
||||
};
|
||||
|
||||
enum ScXMLTableRowsTokens
|
||||
|
@@ -286,6 +286,7 @@ SvXMLImportContext *ScXMLTableContext::CreateChildContext( sal_uInt16 nPrefix,
|
||||
rLName, xAttrList );
|
||||
break;
|
||||
case XML_TOK_TABLE_PROTECTION:
|
||||
case XML_TOK_TABLE_PROTECTION_EXT:
|
||||
pContext = new ScXMLTableProtectionContext( GetScImport(), nPrefix, rLName, xAttrList );
|
||||
break;
|
||||
case XML_TOK_TABLE_ROW_GROUP:
|
||||
@@ -454,9 +455,11 @@ ScXMLTableProtectionContext::ScXMLTableProtectionContext(
|
||||
switch (rAttrTokenMap.Get(nLocalPrefix, aLocalName))
|
||||
{
|
||||
case XML_TOK_TABLE_SELECT_PROTECTED_CELLS:
|
||||
case XML_TOK_TABLE_SELECT_PROTECTED_CELLS_EXT:
|
||||
bSelectProtectedCells = IsXMLToken(aValue, XML_TRUE);
|
||||
break;
|
||||
case XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS:
|
||||
case XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS_EXT:
|
||||
bSelectUnprotectedCells = IsXMLToken(aValue, XML_TRUE);
|
||||
break;
|
||||
default:
|
||||
|
Reference in New Issue
Block a user