https://bz.apache.org/ooo/show_bug.cgi?id=128551

--- Comment #3 from dam...@apache.org ---
When SheetDataBuffer::setStringCell() is called on a working document, this is
the stack trace to it:

---snip---
#0  oox::xls::SheetDataBuffer::setStringCell(oox::xls::CellModel const&, int)
(this=0x80dcd1d20, rModel=..., nStringId=0) at
source/xls/sheetdatabuffer.cxx:373
#1  0x000000080eac9f43 in oox::xls::SheetDataContext::onEndElement()
(this=0x80dfa3980) at source/xls/sheetdatacontext.cxx:223
#2  0x000000080e711c63 in oox::core::ContextHandler2Helper::implEndElement(int)
(this=0x80dfa39c0, nElement=852948) at source/core/contexthandler2.cxx:120
#3  0x000000080e71220f in oox::core::ContextHandler2::endFastElement(int)
(this=0x80dfa3980, nElement=852948) at source/core/contexthandler2.cxx:209
#4  0x000000080ee3f4cc in
sax_fastparser::FastSaxParser::callbackEndElement(char const*)
(this=0x80dbd27c0) at source/fastparser/fastparser.cxx:849
#5  0x0000000807afed94 in  () at /usr/local/lib/libexpat.so.1
#6  0x0000000807afbd37 in  () at /usr/local/lib/libexpat.so.1
#7  0x0000000807afaaf9 in  () at /usr/local/lib/libexpat.so.1
#8  0x0000000807af7567 in  () at /usr/local/lib/libexpat.so.1
#9  0x0000000807af6d8b in XML_ParseBuffer () at /usr/local/lib/libexpat.so.1
#10 0x000000080ee3e39f in sax_fastparser::FastSaxParser::parse()
(this=this@entry=0x80dbd27c0) at source/fastparser/fastparser.cxx:646
---snip---

Frame #1, oox::xls::SheetDataContext::onEndElement(), is helpful.

---snip---
    167 void SheetDataContext::onEndElement()
    168 {
    169     if( getCurrentElement() == XLS_TOKEN( c ) )
    170     {
    171         // try to create a formula cell
    172         if( mbHasFormula ) switch( maFmlaData.mnFormulaType )
    173         {
...
    205         if( !mbHasFormula )
    206         {
    207             // no formula created: try to set the cell value
    208             if( maCellValue.getLength() > 0 ) switch(
maCellData.mnCellType )
    209             {
    210                 case XML_n:
    211                     mrSheetData.setValueCell( maCellData,
maCellValue.toDouble() );
    212                 break;
    213                 case XML_b:
    214                     mrSheetData.setBooleanCell( maCellData,
maCellValue.toDouble() != 0.0 );
    215                 break;
    216                 case XML_e:
    217                     mrSheetData.setErrorCell( maCellData, maCellValue
);
    218                 break;
    219                 case XML_str:
    220                     mrSheetData.setStringCell( maCellData, maCellValue
);
    221                 break;
    222                 case XML_s:
    223                     mrSheetData.setStringCell( maCellData,
maCellValue.toInt32() );
    224                 break;
    225             }
    226             else if( (maCellData.mnCellType == XML_inlineStr) &&
mxInlineStr.get() )
    227             {
    228                 mxInlineStr->finalizeImport();
    229                 mrSheetData.setStringCell( maCellData, mxInlineStr );
    230             }
    231             else
    232             {
    233                 // empty cell, update cell type
    234                 maCellData.mnCellType = XML_TOKEN_INVALID;
    235                 mrSheetData.setBlankCell( maCellData );
    236             }
    237         }
---snip---


Putting a breakpoint on line 172 with the condition "maCellValue.getLength() >
0" shows it is never triggered, and stepping through shows we always end in
lines 234-235, with the "empty cell, update cell type" comment.

So what on earth is going wrong with maCellValue?

-- 
You are receiving this mail because:
You are the assignee for the issue.

Reply via email to