LO under KDE strips too many components from filename when saving files with dots in names. It does behave in a way that is unpredictable for both LO and KDE users. I have made a little experiment that shows what is done. I did: 1. Create 1.2.3.4.txt file (command: 'date > 1.2.3.4.txt') 2. Create 1.2.3.4.jpg file (copied another JPG image) 3. Open TXT file in LO (run under newly created profile) in different conditions and then "Saved as" (did not change file type) and "Saved as" with changing file type. 4. Open JPG file in Kolourpaint and then "Saved as" (did not change file type) and "Saved as" with changing file type. Results are in tables below. Both KDE and LO under pure X11 has "Automatically select filename extension". I tried it both checked on and off. To save space, I cropped it to only "Automatic..." in tables. First column shows conditions that has been checked (LO desktop and "Automatic..." state). Second is filename that was proposed in save dialog. Third is name of file that was actually changed. Fourth is output of 'file' command run on saved file. When saving as plain text file, LO did ask if I want to save in "Text" or "OpenDocument" format. I have always choosen "Text". Table 1. LibreOffice; File: 1.2.3.4.txt; "Save as" proposed name file after export 'file' command output KDE, Automatic... on 1.2.3.odt 1.2.3.odt OpenDocument Text KDE, Automatic... off 1.2.3.4 1.2.3.4 OpenDocument Text GNOME 1.2.3.4 1.2.3.4.txt UTF-8 Unicode (with BOM) text pure X11, Automatic... on 1.2.3.4 1.2.3.4.txt UTF-8 Unicode (with BOM) text pure X11, Automatic... off 1.2.3.4.txt 1.2.3.4.txt UTF-8 Unicode (with BOM) text Table 2. LibreOffice; File: 1.2.3.4.txt; "Save as", filetype changed to OTT proposed name file after export 'file' command output KDE, Automatic... on 1.2.3.ott 1.2.3.ott OpenDocument Text Template KDE, Automatic... off 1.2.3.4 1.2.3.4 OpenDocument Text Template GNOME 1.2.3.4 1.2.3.4.ott OpenDocument Text Template pure X11, Automatic... on 1.2.3.4 1.2.3.4.ott OpenDocument Text Template pure X11, Automatic... off 1.2.3.4.txt 1.2.3.4.txt OpenDocument Text Template Table 3. Kolourpaint; File: 1.2.3.4.jpg; "Save as" proposed name file after export 'file' command output Automatic... on 1.2.3.4.jpg 1.2.3.4.jpg JPEG image data Automatic... off 1.2.3.4.jpg 1.2.3.4.jpg JPEG image data Table 4. Kolourpaint; File: 1.2.3.4.jpg; "Save as", filetype changed to PNG proposed name file after export 'file' command output Automatic... on 1.2.3.4.png 1.2.3.4.png PNG image data Automatic... off 1.2.3.4.jpg 1.2.3.4.jpg PNG image data Conclusions: 1. As we can see (tables 3 and 4), KDE may handle file type and extensions for applications. It will use last component as extension and change it automatically, *IF* "Automatic..." is turned on. If it is turned off, KDE will leave filename alone. 2. LO does not trust KDE that it will strip extension from file name and does it by itself (tables 1 and 2, rows 1 and 2, compare to wrows 4 and 5). But LO DOES trust KDE that it will add that extension (tables 1 and 2, rows 2, 3 and 4). 3. Behavior of LO under KDE is different than LO under GNOME/X11 AND other KDE apps. It does not fit into known patterns. This means that it certainly is bug in LO, not KDE. What should be done: LO should detect if it is run under KDE (we have OOO_FORCE_DESKTOP and SAL_USE_VCLPLUGIN variables for this, right?). If it does, then it should leave filename alone, trusting that KDE will do it's job. Do not strip anything (column two), do not add anything (column three). Then LO will work in the same way as other KDE apps and it's behaviour will be consistent. Additional informations: This issue has been discussed on KDE users mailing list. Link to discussion: http://comments.gmane.org/gmane.comp.kde.general/26110 Especially second post provides deeper knowledge about a way that KDE handles file extensions. Best regards Mirosław Zalewski
Created attachment 64738 [details] Table with filenames in OpenDocument format, for better reading
Reproducible with the exact same libreoffice version.
LuboÅ¡ LuÅak committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=e62c67d8d47231e3ff0df440642dfcabac4f3f81 do not let LO's autoextension handling interfere with KFileDialog's(fdo#52546)
LuboÅ¡ LuÅak committed a patch related to this issue. It has been pushed to "libreoffice-3-6": http://cgit.freedesktop.org/libreoffice/core/commit/?id=c921fc0ae2b20de1953e7558fce6b9ddb94c56d3&g=libreoffice-3-6 do not let LO's autoextension handling interfere with KFileDialog's(fdo#52546) It will be available in LibreOffice 3.6.1.
I can confirm that this is fixed as of LibreOffice 3.6.1. Thanks! :)
*** Bug 64203 has been marked as a duplicate of this bug. ***