fix indentation
Change-Id: Ie70d580cd2a4ad88751672fd257c825b9813c86e
This commit is contained in:
@@ -2870,90 +2870,88 @@ void ScXMLExport::WriteCell(ScMyCell& aCell, sal_Int32 nEqualCellCount)
|
|||||||
bool bIsEmpty(false);
|
bool bIsEmpty(false);
|
||||||
switch (aCell.nType)
|
switch (aCell.nType)
|
||||||
{
|
{
|
||||||
case table::CellContentType_EMPTY :
|
case table::CellContentType_EMPTY :
|
||||||
{
|
|
||||||
bIsEmpty = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case table::CellContentType_VALUE :
|
|
||||||
{
|
|
||||||
if (!aCell.bHasDoubleValue)
|
|
||||||
{
|
{
|
||||||
aCell.fValue = pDoc->GetValue( aCellPos );
|
bIsEmpty = true;
|
||||||
aCell.bHasDoubleValue = true;
|
|
||||||
}
|
}
|
||||||
GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes(
|
break;
|
||||||
aCell.nNumberFormat, aCell.fValue);
|
case table::CellContentType_VALUE :
|
||||||
}
|
|
||||||
break;
|
|
||||||
case table::CellContentType_TEXT :
|
|
||||||
{
|
|
||||||
if (GetCellText(aCell, aCellPos))
|
|
||||||
{
|
{
|
||||||
OUString sFormula(lcl_GetRawString(pDoc, aCellPos));
|
if (!aCell.bHasDoubleValue)
|
||||||
|
{
|
||||||
|
aCell.fValue = pDoc->GetValue( aCellPos );
|
||||||
|
aCell.bHasDoubleValue = true;
|
||||||
|
}
|
||||||
GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes(
|
GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes(
|
||||||
sFormula, aCell.sStringValue, true, true);
|
aCell.nNumberFormat, aCell.fValue);
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
break;
|
case table::CellContentType_TEXT :
|
||||||
case table::CellContentType_FORMULA :
|
|
||||||
{
|
|
||||||
ScRefCellValue aCellVal;
|
|
||||||
aCellVal.assign(*pDoc, aCellPos);
|
|
||||||
if (aCellVal.meType == CELLTYPE_FORMULA)
|
|
||||||
{
|
{
|
||||||
OUStringBuffer sFormula;
|
if (GetCellText(aCell, aCellPos))
|
||||||
ScFormulaCell* pFormulaCell = aCellVal.mpFormula;
|
|
||||||
if (!bIsMatrix || (bIsMatrix && bIsFirstMatrixCell))
|
|
||||||
{
|
{
|
||||||
const formula::FormulaGrammar::Grammar eGrammar = pDoc->GetStorageGrammar();
|
OUString sFormula(lcl_GetRawString(pDoc, aCellPos));
|
||||||
sal_uInt16 nNamespacePrefix = (eGrammar == formula::FormulaGrammar::GRAM_ODFF ? XML_NAMESPACE_OF : XML_NAMESPACE_OOOC);
|
GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes(
|
||||||
pFormulaCell->GetFormula(sFormula, eGrammar);
|
sFormula, aCell.sStringValue, true, true);
|
||||||
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 ));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (pFormulaCell->IsValue())
|
|
||||||
{
|
|
||||||
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
|
|
||||||
{
|
|
||||||
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;
|
case table::CellContentType_FORMULA :
|
||||||
|
{
|
||||||
|
ScRefCellValue aCellVal;
|
||||||
|
aCellVal.assign(*pDoc, aCellPos);
|
||||||
|
if (aCellVal.meType == CELLTYPE_FORMULA)
|
||||||
|
{
|
||||||
|
OUStringBuffer sFormula;
|
||||||
|
ScFormulaCell* pFormulaCell = aCellVal.mpFormula;
|
||||||
|
if (!bIsMatrix || (bIsMatrix && bIsFirstMatrixCell))
|
||||||
|
{
|
||||||
|
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 ));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (pFormulaCell->IsValue())
|
||||||
|
{
|
||||||
|
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
|
||||||
|
{
|
||||||
|
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;
|
||||||
default:
|
default:
|
||||||
{
|
break;
|
||||||
// added to avoid warnings
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
OUString* pCellString(&sElemCell);
|
OUString* pCellString(&sElemCell);
|
||||||
if (aCell.bIsCovered)
|
if (aCell.bIsCovered)
|
||||||
|
Reference in New Issue
Block a user