https://bugs.documentfoundation.org/show_bug.cgi?id=166653

            Bug ID: 166653
           Summary: Cannot save a document containing a dialog, after
                    setting a listbox Selection property
           Product: LibreOffice
           Version: 7.2.1.2 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: LibreOffice
          Assignee: libreoffice-bugs@lists.freedesktop.org
          Reporter: alfi...@inwind.it

Description:
In the Dialog Editor, setting the "Selection" property for a Listbox control,
the interface allows the users to insert twice (or more) the same item. This
can happens intentionally, inserting two same indexes, or unintentionally,
caused by the bug 166613.
When this happens, the XML code of the dialog became invalid, because an XML
element violate the attribute unicity rule, as in:
<dlg:menuitem dlg:value="--something--" dlg:selected="true"
dlg:selected="true"/>
Then, the entire document containing the dialog cannot be saved. The saving
procedure aborts, leaves a temporary file lu*.tmp and shows this message:
"Error saving the document <filename>. General Error. General input/output
error".


Steps to Reproduce:
1. Type Ctrl+N to create a new document with Calc or Writer
2. Click the menu Tools > Macros > Organize Dialogs...
3. In the list on the left, click the new document tmporary name
4. Click the "New..." button 
5. Click the "Ok" button to confirm the name of the new dialog
6. Click the name "Standard" immediately above the dialog name, then click the
dialog name: the Edit button become enabled.
7. Click the Edit button: a draft of the new dialog become visibile
8. The Toolbox toolbar should be visible: else put a check on the menu View >
Toolbars > Toolbox.
9. On the Toolbox click the List Box icon.
10. Put the mouse cursor over the dialog draft, then drag it diagonally. A
ListBox control will be created and selected.
11. While it is selected, enlarge the Property pane to see all icons in the
rows
12. In the "List entries" property, click the Multiline Editing button, write
at least 2 rows (the items), then click Ok
13. In the "Selected" property, click the Multiline Editing button, write two
rows containing both 1, then click Ok
14. Go to the document window.
15. Try to save the document

Actual Results:
1. The interface for Selected (step 13) do not filter the duplicated input. 
2. The procedure that generate XML make invalid elements.
3. The document is not saved and the error message do not tell why.
4. A new lu*.tmp file is added.


Expected Results:
1. The interface automatically removes the duplicated input and shows the
corrected Selection property value. (Alternatively, it could sollecitate the
user to correct the problem)
2. Furthermore, for security robustness, the procedures that generate XML code
checks for the attribute unicity rule, every time they add an attribute to an
element.
3. If possible, the document saving procedure ignores the correctness of the
dialog, saving it as is, as a draft. Checking the correctness of the dialog is
up to the document loading procedure.
4. If the inner dialog is a real impediment to save the document, the
application shows a message suggesting the user to correct the dialog. 
5. No file *.tmp remains, also when the document can be saved


Reproducible: Always


User Profile Reset: No

Additional Info:
Tested on version 7.2.1.2, 25.2.3.2 and
Version: 25.8.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 6190fe56f72008e0b6d0e502bf94099e72b9d202
CPU threads: 2; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Raster;
VCL: win
Locale: it-IT (it_IT); UI: it-IT
Calc: threaded

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to