Skip to content

Fix: some bugs in UBDocument#1390

Open
letsfindaway wants to merge 2 commits intoOpenBoard-org:devfrom
letsfindaway:improve-ubdocument-checks
Open

Fix: some bugs in UBDocument#1390
letsfindaway wants to merge 2 commits intoOpenBoard-org:devfrom
letsfindaway:improve-ubdocument-checks

Conversation

@letsfindaway
Copy link
Collaborator

This draft PR is used to make further improvements to UBDocument and UBDocumentToc. It fixes some errors I found when testing and adds success/failure feedback for the page manipulation functions of UBDocument.

I start this with a Draft PR, as I might add more commits when I find more problems or improvements.

The first commit adds a bool return value for page manipulation functions in UBDocument. It also adds a parameter to suppress the confirmation dialog when deleting pages. This might be useful later for the widget API. Additionally it fixes an issue that thumbnail and assets list have not been created when adding a new page.

The second commit fixes a crash which could occur when deleting the current scene. The function deleteScene() in the UBBoardController did already handle this problem using the variable mDeletingSceneIndex. But this function is no longer used. I now added code to the callback documentSceneDeleted() to handle this case. deleteScene() is removed, as it is no longer used.

@letsfindaway letsfindaway linked an issue Feb 11, 2026 that may be closed by this pull request
4 tasks
- return boolean success indicator for page operations
- add parameter to suppress confirmation dialog when deleting pages
- create TOC assets entry when creating a page
- create thumbnail when creating a page
- add common function to UBDocumentToc to check index bounds

Signed-off-by: letsfindaway <me@letsfindaway.de>
- do not attempt to save current page when it was deleted
- set mDeletingSceneIndex while switching to other scene
- remove `UBBoardController::deleteScene()` as it is no longer used
- remove `UBBoardController::setActiveSceneIndex` as it is not used
  and would break internal consistency of the board controller

Signed-off-by: letsfindaway <me@letsfindaway.de>
@letsfindaway letsfindaway force-pushed the improve-ubdocument-checks branch from e75be60 to e0211bb Compare February 11, 2026 14:40
@letsfindaway letsfindaway marked this pull request as ready for review February 11, 2026 14:40
@letsfindaway
Copy link
Collaborator Author

Ready for merging. I'm not adding more changes to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Improvement] UBDocument failure handling

1 participant