Libre Calc -- importing a previously exported dialog is problematic

In MyMacrosAndDialogs.Standard I have created a dialog named Dialog1.

I exported the dialog as Dialog2.xdl.

When I try to import Dialog2.xdl a messagebox with title “Dialog Import - Name already used” opens.

DialogImport

The following code is from the Dialog2.xdl file. dlg:id is still represented as “Dialog1”.

<?xml version="1.0" encoding="UTF-8"?>

<dlg:window xmlns:dlg=“http://openoffice.org/2000/dialog” xmlns:script=“http://openoffice.org/2000/script” dlg:id=“Dialog1” dlg:left=“163” dlg:top=“46” dlg:width=“196” dlg:height=“135” dlg:closeable=“true” dlg:moveable=“true”>

I expected Dialog2.xdl to be imported without further fidgeting about.

Is this an undocumented feature?

Hello,

No. It is a naming error. My test has a slightly different dialog name: Buttonsss
.
Here is IDE:
Screenshot at 2023-03-23 15-59-35
.

.
Exported with 2 appended:

Screenshot at 2023-03-23 16-00-24
.
Then imported and got your error:
.
.


.
.
Reason is that the dialog name is not taken from the file name given. There is an internal name in the dialog in the general properties.
.
Screenshot at 2023-03-23 16-01-28
.
If I rename the tab(which then will reset the internal name to same) in the IDE to Buttonsss2 and do the same import I now get:
.
Screenshot at 2023-03-23 16-03-18
,
an accepted import. Note that in my test I renamed the original (tab which reset name) to Buttonsss2 and the imported was Buttonsss even though the file I imported was not that name.
.
BTW - To rename tab, right mouse click & select Rename.

1 Like

Thanks for looking into this little matter. Renaming the dialog before exporting it is perhaps the easiest way of solving the problem; quicker than editing the .xdl file, though I think I will have a crack at writing a dialog that does the job in a single step.