https://bugs.freedesktop.org/show_bug.cgi?id=75718

Julien Nabet <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected],
                   |                            |[email protected],
                   |                            |markus.mohrhard@googlemail.
                   |                            |com

--- Comment #7 from Julien Nabet <[email protected]> ---
Keeping on with debugging (trying to fill A1/A7), I got this bt :
#0  ScColumn::GetEmptyLinesInBlock (this=0x2aaacdf7b010, nStartRow=0,
nEndRow=6, eDir=DIR_BOTTOM) at
/home/julien/compile-libreoffice/libo/sc/source/core/data/column2.cxx:1238
#1  0x00002aaac8fd1ccb in ScTable::GetEmptyLinesInBlock (this=0x2aaacdf7b010,
nStartCol=0, nStartRow=0, nEndCol=0, nEndRow=6, eDir=DIR_BOTTOM)
    at
/home/julien/compile-libreoffice/libo/sc/source/core/data/table1.cxx:1012
#2  0x00002aaac8e2d346 in ScDocument::GetEmptyLinesInBlock (this=0x1602238,
nStartCol=0, nStartRow=0, nStartTab=0, nEndCol=0, nEndRow=6, nEndTab=0,
eDir=DIR_BOTTOM)
    at
/home/julien/compile-libreoffice/libo/sc/source/core/data/document.cxx:5681
#3  0x00002aaac94a3a9f in ScDocFunc::FillSeries (this=0x1605840, rRange=...,
pTabMark=0x16f0810, eDir=FILL_TO_BOTTOM, eCmd=FILL_AUTO, eDateCmd=FILL_DAY, 
    fStart=1.6999999999999999e+307, fStep=1, fMax=1.6999999999999999e+307,
bRecord=true, bApi=false)
    at
/home/julien/compile-libreoffice/libo/sc/source/ui/docshell/docfunc.cxx:4450

and ScTable::GetEmptyLinesInBlock returns 5 (instead of expected value 6).
Then I unwinded from there.
   1235         case DIR_BOTTOM:
   1236         {
   1237             // Determine the length empty tail segment.
   1238             size_t nLength = nEndRow - nStartRow + 1;
   1239             std::pair<sc::CellStoreType::const_iterator,size_t> aPos =
maCells.position(nEndRow);
   1240             sc::CellStoreType::const_iterator it = aPos.first;
   1241             if (it->type != sc::element_type_empty)
   1242                 // end row is already not empty.
   1243                 return 0;
   1244 
   1245             // length of this empty block from the tip to the end row
position.
   1246             size_t nThisLen = aPos.second;
   1247             return std::min(nThisLen, nLength);
   1248         }
nLength = 6 but nThisLen = 5 which brought me there:
workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector_def.inl
   1231 template<typename _CellBlockFunc>
   1232 typename multi_type_vector<_CellBlockFunc>::const_position_type
   1233 multi_type_vector<_CellBlockFunc>::position(size_type pos) const
   1234 {
   1235     size_type start_row = 0;
   1236     size_type block_index = 0;
   1237     if (!get_block_position(pos, start_row, block_index))
   1238         throw std::out_of_range("Block position not found!");
   1239 
   1240     typename blocks_type::const_iterator block_pos = m_blocks.begin();
   1241     std::advance(block_pos, block_index);
   1242     const_iterator it = const_iterator(block_pos, m_blocks.end(),
start_row, block_index);
   1243     return const_position_type(it, pos - start_row);
   1244 }
start_row = 1 (instead of 0).
which finally brought me here:
    551 template<typename _CellBlockFunc>
    552 bool multi_type_vector<_CellBlockFunc>::get_block_position(
    553     size_type row, size_type& start_row, size_type& block_index) const
    554 {
    555     for (size_type i = block_index, n = m_blocks.size(); i < n; ++i)
    556     {
    557         const block& blk = *m_blocks[i];
    558         if (row < start_row + blk.m_size)
    559         {
    560             // Row is in this block.
    561             block_index = i;
    562             return true;
    563         }
    564 
    565         // Specified row is not in this block.
    566         start_row += blk.m_size;
    567     }
    568 
    569     return false;
    570 }
We don't go line 562 at the first time so start_row is incremented.
Now I'm quite stuck because I don't know how blocks work.

Kohei/Eike/Markus: any idea?

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to