diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2004-07-13 06:47:55 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2004-07-13 06:47:55 +0000 |
commit | 690256a4e5c7742ef666f172fe1283d39cfead3f (patch) | |
tree | 499e02badc02ce0da8d9d548b05c565ab2084b3c /sc/source/filter/xml/xmlcelli.cxx | |
parent | 2e0264707ba9ccc351c82ca530b1cb81a40a0040 (diff) |
INTEGRATION: CWS oasis (1.76.16); FILE MERGED
2004/07/01 13:04:42 sab 1.76.16.2: #i20153#; oasis changes
2004/06/24 14:58:52 sab 1.76.16.1: #i20153#; oasis changes
Diffstat (limited to 'sc/source/filter/xml/xmlcelli.cxx')
-rw-r--r-- | sc/source/filter/xml/xmlcelli.cxx | 164 |
1 files changed, 99 insertions, 65 deletions
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 0ffd0807f273..402669a07dfb 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlcelli.cxx,v $ * - * $Revision: 1.76 $ + * $Revision: 1.77 $ * - * last change: $Author: obo $ $Date: 2004-06-04 11:12:22 $ + * last change: $Author: rt $ $Date: 2004-07-13 07:47:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -229,26 +229,98 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport, switch (nLength) { - case 5 : + case 7 : { - if (IsXMLToken(aLocalName, XML_VALUE)) + if (IsXMLToken(aLocalName, XML_FORMULA)) { if (sValue.getLength()) { - rXMLImport.GetMM100UnitConverter().convertDouble(fValue, sValue); - bIsEmpty = sal_False; + DBG_ASSERT(!pOUFormula, "here should be only one formula"); + pOUFormula = new rtl::OUString(); + sal_uInt16 nPrefix = GetImport().GetNamespaceMap(). + GetKeyByAttrName( sValue, pOUFormula ); + if (XML_NAMESPACE_OOOC != nPrefix) + { + delete pOUFormula; + pOUFormula = new rtl::OUString(sValue); + } } } } break; - case 7 : + case 10 : { - if (IsXMLToken(aLocalName, XML_FORMULA)) + if (IsXMLToken(aLocalName, XML_STYLE_NAME)) + pStyleName = new rtl::OUString(sValue); + } + break; + case 15 : + { + if (IsXMLToken(aLocalName, XML_CONTENT_VALIDATION_NAME)) //#109340# the string in this constant is different to the name; should be changed ASAP + { + DBG_ASSERT(!pContentValidationName, "here should be only one Validation Name"); + pContentValidationName = new rtl::OUString(sValue); + } + } + break; + case 19 : + { + if (IsXMLToken(aLocalName, XML_NUMBER_ROWS_SPANNED)) + { + bIsMerged = sal_True; + nMergedRows = sValue.toInt32(); + } + } + break; + case 22 : + { + if (IsXMLToken(aLocalName, XML_NUMBER_COLUMNS_SPANNED)) + { + bIsMerged = sal_True; + nMergedCols = sValue.toInt32(); + } + } + break; + case 23 : + { + if (IsXMLToken(aLocalName, XML_NUMBER_COLUMNS_REPEATED)) + nCellsRepeated = sValue.toInt32(); + } + break; + case 26 : + { + if (IsXMLToken(aLocalName, XML_NUMBER_MATRIX_ROWS_SPANNED)) + { + bIsMatrix = sal_True; + nMatrixRows = sValue.toInt32(); + } + } + break; + case 29 : + { + if (IsXMLToken(aLocalName, XML_NUMBER_MATRIX_COLUMNS_SPANNED)) + { + bIsMatrix = sal_True; + nMatrixCols = sValue.toInt32(); + } + } + break; + } + } + else if (nPrefix == XML_NAMESPACE_OFFICE) + { + sal_uInt32 nLength(aLocalName.getLength()); + + switch (nLength) + { + case 5 : + { + if (IsXMLToken(aLocalName, XML_VALUE)) { if (sValue.getLength()) { - DBG_ASSERT(!pOUFormula, "here should be only one formula"); - pOUFormula = new rtl::OUString(sValue); + rXMLImport.GetMM100UnitConverter().convertDouble(fValue, sValue); + bIsEmpty = sal_False; } } } @@ -266,8 +338,6 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport, nCellType = GetCellType(sValue); bIsEmpty = sal_False; } - else if (IsXMLToken(aLocalName, XML_STYLE_NAME)) - pStyleName = new rtl::OUString(sValue); else if (IsXMLToken(aLocalName, XML_DATE_VALUE)) { if (sValue.getLength() && rXMLImport.SetNullDateOnUnitConverter()) @@ -316,57 +386,6 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport, } } break; - case 15 : - { - if (IsXMLToken(aLocalName, XML_CONTENT_VALIDATION_NAME)) //#109340# the string in this constant is different to the name; should be changed ASAP - { - DBG_ASSERT(!pContentValidationName, "here should be only one Validation Name"); - pContentValidationName = new rtl::OUString(sValue); - } - } - break; - case 19 : - { - if (IsXMLToken(aLocalName, XML_NUMBER_ROWS_SPANNED)) - { - bIsMerged = sal_True; - nMergedRows = sValue.toInt32(); - } - } - break; - case 22 : - { - if (IsXMLToken(aLocalName, XML_NUMBER_COLUMNS_SPANNED)) - { - bIsMerged = sal_True; - nMergedCols = sValue.toInt32(); - } - } - break; - case 23 : - { - if (IsXMLToken(aLocalName, XML_NUMBER_COLUMNS_REPEATED)) - nCellsRepeated = sValue.toInt32(); - } - break; - case 26 : - { - if (IsXMLToken(aLocalName, XML_NUMBER_MATRIX_ROWS_SPANNED)) - { - bIsMatrix = sal_True; - nMatrixRows = sValue.toInt32(); - } - } - break; - case 29 : - { - if (IsXMLToken(aLocalName, XML_NUMBER_MATRIX_COLUMNS_SPANNED)) - { - bIsMatrix = sal_True; - nMatrixCols = sValue.toInt32(); - } - } - break; } } } @@ -529,9 +548,24 @@ SvXMLImportContext *ScXMLTableRowCellContext::CreateChildContext( USHORT nPrefix } } break; - case XML_TOK_TABLE_ROW_CELL_SUBTABLE: + case XML_TOK_TABLE_ROW_CELL_TABLE: { - bHasSubTable = sal_True; + sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; + rtl::OUString aLocalName; + rtl::OUString sValue; + for( sal_Int16 i=0; i < nAttrCount; i++ ) + { + sal_uInt16 nPrefix = rXMLImport.GetNamespaceMap().GetKeyByAttrName( + xAttrList->getNameByIndex( i ), &aLocalName ); + sValue = xAttrList->getValueByIndex( i ); + + if (nPrefix == XML_NAMESPACE_TABLE) + { + if (IsXMLToken(aLocalName, XML_IS_SUB_TABLE)) + bHasSubTable = IsXMLToken(sValue, XML_TRUE); + } + } + DBG_ASSERT(bHasSubTable, "it should be a subtable"); pContext = new ScXMLTableContext( rXMLImport , nPrefix, rLName, xAttrList, sal_True, nMergedCols); |