This BASIC code: sub test oSheet = ThisComponent oSheet = calcDoc.createInstance ("com.sun.star.sheet.Spreadsheet") calcDoc.Sheets.insertByName ("NewName", oSheet) end sub fails in "calcDoc.Sheets.insertByName ("NewName", oSheet)" with com.sun.star.lang.IllegalArgumentException. This happens in ScTableSheetsObj::insertByName, because it checks that pSheetObj->GetDocShell() must be nullptr (= sheet not inserted yet). This broke in https://git.libreoffice.org/core/+/009e7a54f40ebacd9dd4a394504c277789699801, where ScServiceProvider::MakeInstance was changed to pass pDocShell to ScTableSheetObj ctor. Noel: could you please take a look?
https://gerrit.libreoffice.org/83464
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/2a16decdcccf36f9fa4a1764f68e59c33517b892 tdf#128951: restore passing nullptr to ScTableSheetObj when not inserted yet It will be available in 6.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Mike Kaganski committed a patch related to this issue. It has been pushed to "libreoffice-6-4": https://git.libreoffice.org/core/commit/7eac47252e03bd7072f62cc1a23d441171619d57 tdf#128951: restore passing nullptr to ScTableSheetObj when not inserted yet It will be available in 6.4.0.1. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.