From 4cfb8cc97a58ffc06e361d121f5c19e61b32700a Mon Sep 17 00:00:00 2001 From: Elena Subbotina Date: Wed, 31 Jul 2024 21:51:15 +0300 Subject: [PATCH] fix bug #69104 --- OOXML/Binary/Sheets/Writer/CSVWriter.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/OOXML/Binary/Sheets/Writer/CSVWriter.cpp b/OOXML/Binary/Sheets/Writer/CSVWriter.cpp index 46bcffdc06..ea7518827c 100644 --- a/OOXML/Binary/Sheets/Writer/CSVWriter.cpp +++ b/OOXML/Binary/Sheets/Writer/CSVWriter.cpp @@ -731,7 +731,12 @@ void CSVWriter::Impl::WriteCell(OOX::Spreadsheet::CCell *pCell) //} //else bool bString = false; - if (pCell->m_oValue.IsInit()) + + if (pCell->m_oFormula.IsInit()) + { + sCellValue = pCell->m_oFormula->m_sText; + } + else if (pCell->m_oValue.IsInit()) { sCellValue = pCell->m_oValue->ToString(); @@ -796,10 +801,7 @@ void CSVWriter::Impl::WriteCell(OOX::Spreadsheet::CCell *pCell) } } - else if (pCell->m_oFormula.IsInit()) - { - sCellValue = pCell->m_oFormula->m_sText; - } + // Escape cell value if (m_bJSON)