https://bugs.documentfoundation.org/show_bug.cgi?id=112423

--- Comment #18 from Julien Nabet <serval2...@yahoo.fr> ---
Lionel: some details about the fix for the crash
Let's start from frame of the bt of this tdf:
    frame #3: 0x000000018521c305
libdbulo.dylib`dbaui::SbaTableQueryBrowser::implSelect(this=<unavailable>,
_rDataSourceName=0x00007fff5fbfde48, _rCommand=<unavailable>, _nCommandType=0,
_bEscapeProcessing=<unavailable>, _rxConnection=0x00007fff5fbfde00,
_bSelectDirect=<unavailable>) at unodatbr.cxx:2458


2442          SvTreeListEntry* pCommand = getObjectEntry( _rDataSourceName,
_rCommand, _nCommandType, &pDataSource, &pCommandType, true, _rxConnection );
2443  
2444          if (pCommand)
2445          {
2446              bool bSuccess = true;
2447              if ( _bSelectDirect )
2448              {
2449                  bSuccess = implSelect( pCommand );
2450              }
2451              else
2452              {
2453                  m_pTreeView->getListBox().Select( pCommand );
2454              }
2455  
2456              if ( bSuccess )
2457              {
2458                  m_pTreeView->getListBox().MakeVisible(pCommand);
2459                  m_pTreeView->getListBox().SetCursor(pCommand);
(see
https://opengrok.libreoffice.org/xref/core/dbaccess/source/ui/browser/unodatbr.cxx#2442)


The pb of the crash was pCommand retrieved by getObjectEntry was not ok.
So the result was we entered in a catch in the method implSelect (line 2449)
but the catch didn't set the return to false.
So LO went to line 2458 to execute MakeVisible and since this method needs a
correct entry (so a correct pCommand), it crashed.

Unwinding to the getObjectEntry, I wanted to call ensureEntryObject before the
if:
1200                      pObject =
m_pTreeView->getListBox().GetEntryPosByName(sPath, pCommandType);
1201                      pCommandType = pObject;
1202                      if ( nIndex >= 0 )
1203                      {
1204                          if (ensureEntryObject(pObject))
1205                          {
(see
https://opengrok.libreoffice.org/xref/core/dbaccess/source/ui/browser/unodatbr.cxx#1200)
since nIndex = -1 at this moment. Indeed we would have returned nullptr instead
of an incorrect object. But then, even if there was no crash when opening the
table, I hadn't the popup error "Commands out of sync; you can't run command
now". So the cause of the empty table was unknown.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to