Bug 128951 - API: inserting a sheet fails with IllegalArgumentException
Summary: API: inserting a sheet fails with IllegalArgumentException
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.4.0.0.beta1+
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:6.5.0 target:6.4.0.1
Keywords: bibisectNotNeeded, regression
Depends on:
Blocks: Regressions-1024plus-Columns
  Show dependency treegraph
 
Reported: 2019-11-22 10:34 UTC by Mike Kaganski
Modified: 2020-06-03 02:35 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2019-11-22 10:34:55 UTC
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?
Comment 1 Mike Kaganski 2019-11-22 10:56:30 UTC
https://gerrit.libreoffice.org/83464
Comment 2 Commit Notification 2019-11-22 16:06:04 UTC
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.
Comment 3 Commit Notification 2019-11-23 05:41:57 UTC
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.