Bug 120950 - kde4, kde5, gtk3_kde5: Filter "Office Open XML" in fpicker sometimes not applied instantly
Summary: kde4, kde5, gtk3_kde5: Filter "Office Open XML" in fpicker sometimes not appl...
Status: RESOLVED NOTOURBUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
6.2.0.0.alpha1+
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: KDE, KF5
  Show dependency treegraph
 
Reported: 2018-10-27 10:05 UTC by Michael Weghorn
Modified: 2019-05-22 07:00 UTC (History)
1 user (show)

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 Michael Weghorn 2018-10-27 10:05:03 UTC
Version: 6.2.0.0.alpha1+
Build ID: 5690acdb44e8017055bb88e86e19d207836bb95c
CPU threads: 4; OS: Linux 4.18; UI render: default; VCL: gtk3_kde5; 
Locale: en-GB (en_GB.UTF-8); Calc: threaded

Steps to reproduce:

1) open an existing ODT document in Writer
2) "File" -> "Save as"
3) Select filter "Office Open XML Text .docx" in the file dialog

Result: The filter "Word 2007-2019 (.docx)" is shown as selected.

Expected result: The selected filter "Office Open XML Text .docx" should be selected.

Notes:

* It's not reproducible when using a new, unsaved document, rather than an existing ODT document.
* After selecting "Office Open XML Text .docx" a second time, this is also shown correctly in the dialog.
* This is reproducible with the gtk3_kde5 and kde5 VCL plugins (and probably kde4, where it was initially reported with some custom 5.2-based LibreOffice version, but I don't have a current master build with kde4 at hand to retest).
Comment 1 Michael Weghorn 2018-10-27 10:06:56 UTC
I'm self-confirming according to [1], since the bug was initially reported by another user in our internal bug tracker.

[1] https://wiki.documentfoundation.org/QA/Guidelines_for_public_and_private_sector_deployments
Comment 2 Michael Weghorn 2018-10-27 21:04:42 UTC
After closer examination, I am quite sure that it's not LibreOffice's fault, but rather a bug in KDE software (probably "kio" or "plasma-integration").

This can be reproduced without actually using LibreOffice by this small sample program using the Qt print dialog:

    #include <QApplication>
    #include <QFileDialog>

    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);

        QFileDialog *dialog = new QFileDialog(nullptr);

        QStringList filters;
        filters << "ODF Text Document (.odt) (*.odt)"
                << "ODF Text Document Template (.ott) (*.ott)"
                << "Flat XML ODF Text Document (.fodt) (*.fodt)"
                << "Unified Office Format text (.uot) (*.uot)"
                << "Word 2007–2019 (.docx) (*.docx)"
                << "Word 2003 XML (.xml) (*.xml)"
                << "Word 97–2003 (.doc) (*.doc)"
                << "Word 97–2003 Template (.dot) (*.dot)"
                << "DocBook (.xml) (*.xml)"
                << "HTML Document (Writer) (.html) (*.html)"
                << "Rich Text (.rtf) (*.rtf)"
                << "Text (.txt) (*.txt)"
                << "Text - Choose Encoding (.txt) (*.txt)"
                << "Office Open XML Text (.docx) (*.docx)"
                << "Word 2007–2019 VBA (.docm) (*.docm)";

        dialog->setAcceptMode(QFileDialog::AcceptMode::AcceptSave);

        dialog->setNameFilters(filters);

        dialog->setOption(QFileDialog::HideNameFilterDetails);

        dialog->exec();

        return a.exec();
    }

When run under KDE Plasma, the following steps reproduce the issue there, too:

1) enable the checkbox "Automatically select filename extension"
2) type "test.odt" into the "Filename" textbox 
3) select filter "Office Open XML Text (.docx)

The problem no longer occurs when run e.g. in XFCE or disabling the native (KDE/Plasma) file dialog by adding

    dialog->setOption(QFileDialog::DontUseNativeDialog);

(or running LibreOffice with the 'qt5' VCL plugin instead of the kde5 one).

Therefore, this should to be fixed outside LibreOffice.
Comment 3 Jan-Marek Glogowski 2019-05-17 14:39:53 UTC
I've created https://bugs.kde.org/show_bug.cgi?id=407642 to fix it upstream.
Comment 4 Michael Weghorn 2019-05-22 07:00:12 UTC
(In reply to Jan-Marek Glogowski from comment #3)
> I've created https://bugs.kde.org/show_bug.cgi?id=407642 to fix it upstream.

Thanks! The patch has just been integrated upstream.