Bug 162673 - gtk4 VCL: can't choose output format (always saves in OpenDocument Text)
Summary: gtk4 VCL: can't choose output format (always saves in OpenDocument Text)
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.8.0.3 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Save
  Show dependency treegraph
 
Reported: 2024-08-28 19:34 UTC by darkblaze69
Modified: 2024-12-06 15:54 UTC (History)
3 users (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 darkblaze69 2024-08-28 19:34:08 UTC
Description:
* Arch Linux
* GNOME 47.beta

With SAL_USE_VCLPLUGIN=gtk4 the output format is always "OpenDocument Text" no matter what format I chose on saving. Tried docx, txt.

In gtk3 it saves correctly.

Steps to Reproduce:
1. run SAL_USE_VCLPLUGIN=gtk4 soffice --writer 
2. write something
3. "Save As", choose format like docx or txt. 

Actual Results:
Tthe result file is "OpenDocument Text" (use "file" program to verify).

Expected Results:
Saved to the desired format.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 24.8.0.3 (X86_64) / LibreOffice Community
Build ID: 480(Build:3)
CPU threads: 22; OS: Linux 6.11; UI render: default; VCL: gtk4
Locale: en-US (en_US.UTF-8); UI: en-US
24.8.0-2
Calc: threaded
Comment 1 Julien Nabet 2024-08-29 19:39:12 UTC
On pc Debian x86-64 with master sources updated today, I could reproduce this.

Precisely, if you export the file as docx with name test.docx, it will generate a test.docx file BUT the file is in fact an odt.

Caolán: thought you might be interested in this one since it concerns gtk.
Comment 2 Caolán McNamara 2024-08-30 09:47:08 UTC
The problem is SalGtkFilePicker::UpdateFilterfromUI where mnHID_FolderChange and mnHID_SelectionChange are 0 so UpdateFilterfromUI doesn't do anything

Those are 0 because of the reasons mentioned in https://cgit.freedesktop.org/libreoffice/core/commit/?id=71dd1d72358a862b4cf36d5014624ab9d8c8a402

Changing 

    if (!mnHID_FolderChange || !mnHID_SelectionChange)
        return;

to

#if !GTK_CHECK_VERSION(4, 0, 0)
    // Update the filtername from the users selection if they have had a chance to do so.
    // If the user explicitly sets a type then use that, if not then take the implicit type
    // from the filter of the files glob on which he is currently searching
    if (!mnHID_FolderChange || !mnHID_SelectionChange)
        return;
#endif

in vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx probably gets past that hurdle. But then there are possible further problems that might arise.