Bug 166779 - Unable to export a Draw / Impress document to SVG from Basic IDE
Summary: Unable to export a Draw / Impress document to SVG from Basic IDE
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:25.8.0 target:25.2.5
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-29 05:34 UTC by Mike Kaganski
Modified: 2025-06-04 08:10 UTC (History)
0 users

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 2025-05-29 05:34:11 UTC
Open a Draw / Impress document.
Open Basic IDE, and run the following code from there:

Sub ExportAsSvg
 Dim args(0) As New com.sun.star.beans.PropertyValue
  args(0).Name  = "FilterName"
  args(0).Value = "draw_svg_Export"

  target = ThisComponent.URL + ".svg"
  ThisComponent.storeToUrl(target, args())
End Sub

This code fails in storeToUrl:

> BASIC runtime error.
> An exception occurred 
> Type: com.sun.star.io.IOException
> Message: SfxBaseModel::impl_store
> <file:///C:/D/Downloads/VCT/1005875/magicDraw1.odg.svg> failed:
> 0xc10(Error Area:Io Class:Write Code:16).

Running the same code from the Draw / Impress window, using Tools->Macros->Run Macro succeeds.
Comment 1 Mike Kaganski 2025-05-29 05:55:32 UTC
https://gerrit.libreoffice.org/c/core/+/185983
Comment 2 Commit Notification 2025-05-29 08:24:37 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/58ba249df589b0c9f91667f2938bfa18d2a1ce61

tdf#166779: use model first to obtain selection

It will be available in 25.8.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 2025-06-04 08:10:24 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-25-2":

https://git.libreoffice.org/core/commit/cde5aa1e55bc5af29e484bd6da9078d49a825edc

tdf#166779: use model first to obtain selection

It will be available in 25.2.5.

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.