[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - sc/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Jun 21 12:36:48 UTC 2019


 sc/source/core/data/dociter.cxx |   18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

New commits:
commit b9518dc46fdc6bd4e3c656e51bdc9c54f99f80fa
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu May 9 14:08:44 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Jun 21 14:35:47 2019 +0200

    crashtesting: failure importing gnome545630-1.xlsx
    
    with bt of...
    
     #18 0x00007fb7734e3a9b in ScColContainer::operator[] (this=0x6571840, nIndex=234) at sc/inc/colcontainer.hxx:44
     #19 0x00007fb77352daf7 in ScValueIterator::GetFirst (this=0x7fb7629205b0, rValue=@0x7fb762920320: 0, rErr=@0x7fb762920570: NONE)
         at sc/source/core/data/dociter.cxx:295
     #20 0x00007fb773a04130 in ScInterpreter::GetStVarParams (this=0x35d30d0, bTextAsZero=false, VarResult=
         0x7fb773a04dfb <ScInterpreter::<lambda(double, size_t)>::_FUN(double, size_t)>) at sc/source/core/tool/interpr1.cxx:4040
     #21 0x00007fb773a04e85 in ScInterpreter::ScStDev (this=0x35d30d0, bTextAsZero=false) at sc/source/core/tool/interpr1.cxx:4180
     #22 0x00007fb773a7152d in ScInterpreter::Interpret (this=0x35d30d0) at sc/source/core/tool/interpr4.cxx:4142
     #23 0x00007fb77378cbbf in ScFormulaCell::InterpretTail (this=0x6dcf7a0, rContext=..., eTailParam=ScFormulaCell::SCITP_NORMAL)
         at sc/source/core/data/formulacell.cxx:1905
     #24 0x00007fb77378b8ab in ScFormulaCell::Interpret (this=0x6dcf7a0, nStartOffset=-1, nEndOffset=-1)
         at sc/source/core/data/formulacell.cxx:1611
     #25 0x00007fb7733f82fe in (anonymous namespace)::CalcAllHandler::operator() (this=0x7fb762920e67, pCell=0x6dcf7a0)
     #26 0x00007fb773404240 in sc::EachElem<mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>, __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<ScFormulaCell**, std::__cxx1998::vector<ScFormulaCell*, std::allocator<ScFormulaCell*> > >, std::__debug::vector<ScFormulaCell*> >, mdds::detail::mtv::iterator_value_node<unsigned long, mdds::mtv::base_element_block>, (anonymous namespace)::CalcAllHandler> (rNode=..., rFuncElem=...)
         at sc/inc/mtvfunctions.hxx:120
     #27 0x00007fb773400dd6 in sc::ProcessElements1<mdds::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell> >, sc::CellStoreEvent>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>, (anonymous namespace)::CalcAllHandler, sc::FuncElseNoOp<unsigned long> > (rStore=..., rFuncElem=...,
         rFuncElse=...) at sc/inc/mtvfunctions.hxx:310
     #28 0x00007fb7733fd4df in sc::ProcessFormula<(anonymous namespace)::CalcAllHandler> (rStore=..., rFunc=...)
         at sc/inc/mtvcellfunc.hxx:24
     #29 0x00007fb7733faf4f in ScColumn::CalcAll (this=0x6340910) at sc/source/core/data/column.cxx:3482
     #30 0x00007fb77384a213 in ScTable::CalcAll (this=0x6571840) at sc/source/core/data/table2.cxx:1882
     #31 0x00007fb7735cf141 in ScDocument::CalcAll (this=0x6241ee0) at sc/source/core/data/document.cxx:3955
     #32 0x00007fb774062aeb in ScDocShell::DoHardRecalc (this=0x6241e80) at sc/source/ui/docshell/docsh4.cxx:1379
     #33 0x00007fb77437a66c in ScModelObj::calculateAll (this=0x3654970) at sc/source/ui/unoobj/docuno.cxx:2254
     #34 0x00007fb77b1099ac in gcc3::callVirtualMethod (pThis=0x3654af8, nVtableIndex=4, pRegisterReturn=0x0, pReturnTypeRef=0x1ccf710, bSimpleReturn=true,
        pStack=0x7fb7629212f0, nStack=0, pGPR=0x7fb762921420, pFPR=0x7fb762921450)
        at bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:133
    
    Change-Id: Ica4c9e9860768d9c84be89be36644126095f62f3
    Reviewed-on: https://gerrit.libreoffice.org/74492
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index be38db769be4..9772d7e82073 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -152,15 +152,17 @@ bool ScValueIterator::GetThis(double& rValue, FormulaError& rErr)
 {
     while (true)
     {
-        bool bNextColumn = maCurPos.first == mpCells->end();
+        bool bNextColumn = !mpCells || maCurPos.first == mpCells->end();
         if (!bNextColumn)
         {
             if (GetRow() > maEndPos.Row())
                 bNextColumn = true;
         }
 
-        ScColumn* pCol = &(pDoc->maTabs[mnTab])->aCol[mnCol];
-        if (bNextColumn)
+        ScColumn* pCol;
+        if (!bNextColumn)
+            pCol = &(pDoc->maTabs[mnTab])->aCol[mnCol];
+        else
         {
             // Find the next available column.
             do
@@ -292,8 +294,14 @@ bool ScValueIterator::GetFirst(double& rValue, FormulaError& rErr)
     pAttrArray = nullptr;
     nAttrEndRow = 0;
 
-    mpCells = &pTab->aCol[maStartPos.Col()].maCells;
-    maCurPos = mpCells->position(maStartPos.Row());
+    auto nCol = maStartPos.Col();
+    if (nCol < pTab->GetAllocatedColumnsCount())
+    {
+        mpCells = &pTab->aCol[nCol].maCells;
+        maCurPos = mpCells->position(maStartPos.Row());
+    }
+    else
+        mpCells = nullptr;
     return GetThis(rValue, rErr);
 }
 


More information about the Libreoffice-commits mailing list