diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-04-24 15:19:35 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-04-25 17:02:31 +0200 |
commit | 6bec369008596f74dfa49721f52d16a684fc4581 (patch) | |
tree | f26e7240e2123fad59c87f6777f7e5d68600d5c5 /sc | |
parent | 26ef3153f3cd35ff1198a48479facea1d97b8fcd (diff) |
fix indentation
Change-Id: Ie70d580cd2a4ad88751672fd257c825b9813c86e
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/xml/xmlexprt.cxx | 132 |
1 files changed, 65 insertions, 67 deletions
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 2248f903f59a..8b86e6086324 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -2870,90 +2870,88 @@ void ScXMLExport::WriteCell(ScMyCell& aCell, sal_Int32 nEqualCellCount) bool bIsEmpty(false); switch (aCell.nType) { - case table::CellContentType_EMPTY : - { - bIsEmpty = true; - } - break; - case table::CellContentType_VALUE : - { - if (!aCell.bHasDoubleValue) + case table::CellContentType_EMPTY : { - aCell.fValue = pDoc->GetValue( aCellPos ); - aCell.bHasDoubleValue = true; + bIsEmpty = true; } - GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes( - aCell.nNumberFormat, aCell.fValue); - } - break; - case table::CellContentType_TEXT : - { - if (GetCellText(aCell, aCellPos)) + break; + case table::CellContentType_VALUE : { - OUString sFormula(lcl_GetRawString(pDoc, aCellPos)); + if (!aCell.bHasDoubleValue) + { + aCell.fValue = pDoc->GetValue( aCellPos ); + aCell.bHasDoubleValue = true; + } GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes( - sFormula, aCell.sStringValue, true, true); + aCell.nNumberFormat, aCell.fValue); } - } - break; - case table::CellContentType_FORMULA : - { - ScRefCellValue aCellVal; - aCellVal.assign(*pDoc, aCellPos); - if (aCellVal.meType == CELLTYPE_FORMULA) + break; + case table::CellContentType_TEXT : { - OUStringBuffer sFormula; - ScFormulaCell* pFormulaCell = aCellVal.mpFormula; - if (!bIsMatrix || (bIsMatrix && bIsFirstMatrixCell)) + if (GetCellText(aCell, aCellPos)) { - const formula::FormulaGrammar::Grammar eGrammar = pDoc->GetStorageGrammar(); - sal_uInt16 nNamespacePrefix = (eGrammar == formula::FormulaGrammar::GRAM_ODFF ? XML_NAMESPACE_OF : XML_NAMESPACE_OOOC); - pFormulaCell->GetFormula(sFormula, eGrammar); - OUString sOUFormula(sFormula.makeStringAndClear()); - if (!bIsMatrix) - { - AddAttribute(sAttrFormula, GetNamespaceMap().GetQNameByKey( nNamespacePrefix, sOUFormula, false )); - } - else - { - AddAttribute(sAttrFormula, GetNamespaceMap().GetQNameByKey( nNamespacePrefix, sOUFormula.copy(1, sOUFormula.getLength() - 2), false )); - } + OUString sFormula(lcl_GetRawString(pDoc, aCellPos)); + GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes( + sFormula, aCell.sStringValue, true, true); } - if (pFormulaCell->IsValue()) + } + break; + case table::CellContentType_FORMULA : + { + ScRefCellValue aCellVal; + aCellVal.assign(*pDoc, aCellPos); + if (aCellVal.meType == CELLTYPE_FORMULA) { - bool bIsStandard; - OUString sCurrency; - GetNumberFormatAttributesExportHelper()->GetCellType(aCell.nNumberFormat, sCurrency, bIsStandard); - if (bIsStandard) + OUStringBuffer sFormula; + ScFormulaCell* pFormulaCell = aCellVal.mpFormula; + if (!bIsMatrix || (bIsMatrix && bIsFirstMatrixCell)) { - if (pDoc) - GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes( - pFormulaCell->GetStandardFormat(*pDoc->GetFormatTable(), 0), - pDoc->GetValue( aCellPos )); + const formula::FormulaGrammar::Grammar eGrammar = pDoc->GetStorageGrammar(); + sal_uInt16 nNamespacePrefix = (eGrammar == formula::FormulaGrammar::GRAM_ODFF ? XML_NAMESPACE_OF : XML_NAMESPACE_OOOC); + pFormulaCell->GetFormula(sFormula, eGrammar); + OUString sOUFormula(sFormula.makeStringAndClear()); + if (!bIsMatrix) + { + AddAttribute(sAttrFormula, GetNamespaceMap().GetQNameByKey( nNamespacePrefix, sOUFormula, false )); + } + else + { + AddAttribute(sAttrFormula, GetNamespaceMap().GetQNameByKey( nNamespacePrefix, sOUFormula.copy(1, sOUFormula.getLength() - 2), false )); + } } - else + if (pFormulaCell->IsValue()) { - if (pDoc) - GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes( - aCell.nNumberFormat, pDoc->GetValue( aCellPos )); - } - } - else - { - if (GetCellText(aCell, aCellPos)) - if (!aCell.sStringValue.isEmpty()) + bool bIsStandard; + OUString sCurrency; + GetNumberFormatAttributesExportHelper()->GetCellType(aCell.nNumberFormat, sCurrency, bIsStandard); + if (bIsStandard) + { + if (pDoc) + GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes( + pFormulaCell->GetStandardFormat(*pDoc->GetFormatTable(), 0), + pDoc->GetValue( aCellPos )); + } + else { - AddAttribute(sAttrValueType, XML_STRING); - AddAttribute(sAttrStringValue, aCell.sStringValue); + if (pDoc) + GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes( + aCell.nNumberFormat, pDoc->GetValue( aCellPos )); } + } + else + { + if (GetCellText(aCell, aCellPos)) + if (!aCell.sStringValue.isEmpty()) + { + AddAttribute(sAttrValueType, XML_STRING); + AddAttribute(sAttrStringValue, aCell.sStringValue); + } + } } } - } - break; + break; default: - { - // added to avoid warnings - } + break; } OUString* pCellString(&sElemCell); if (aCell.bIsCovered) |