[Libreoffice-bugs] [Bug 52546] New: Inconsistent behavior with filenames with dots under KDE

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Jul 26 23:05:33 CEST 2012


https://bugs.freedesktop.org/show_bug.cgi?id=52546

             Bug #: 52546
           Summary: Inconsistent behavior with filenames with dots under
                    KDE
    Classification: Unclassified
           Product: LibreOffice
           Version: 3.5.5.3 release
          Platform: x86-64 (AMD64)
        OS/Version: Linux (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: filters and storage
        AssignedTo: libreoffice-bugs at lists.freedesktop.org
        ReportedBy: miniopl at poczta.onet.pl


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

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Libreoffice-bugs mailing list