Bug 143993 - FilePicker unexpectedly opens instead of FolderPicker
Summary: FilePicker unexpectedly opens instead of FolderPicker
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.3.0.0 alpha0+
Hardware: All Windows (All)
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.3.0
Keywords:
: 143090 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-08-21 15:29 UTC by himajin100000
Modified: 2021-08-24 13:07 UTC (History)
2 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 himajin100000 2021-08-21 15:29:27 UTC
Description:
see steps to reproducible


Steps to Reproduce:
1. open LibreOffice
2. [Tools]-[Options]
3. [Paths]-[My Documents]
4. Edit

Actual Results:
You can specify files only. 

Expected Results:
You can specify folders, not files.


Reproducible: Always


User Profile Reset: No



Additional Info:
reproducible with:

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 05924f9b2e651f545d8ceea883d9b1729257349d
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: default; VCL: win
Locale: ja-JP (ja_JP); UI: en-US
Calc: threaded

non-reproducible with:

Version: 7.2.0.4 (x64) / LibreOffice Community
Build ID: 9a9c6381e3f7a62afc1329bd359cc48accb6435b
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: ja-JP (ja_JP); UI: ja-JP
Calc: CL
Comment 1 himajin100000 2021-08-21 15:34:09 UTC
I don't have a good knowledge in C++, but it is possible that 

https://opengrok.libreoffice.org/diff/core/sfx2/source/dialog/filedlghelper.cxx?r1=%2Fcore%2Fsfx2%2Fsource%2Fdialog%2Ffiledlghelper.cxx%40a8f97e5f&r2=%2Fcore%2Fsfx2%2Fsource%2Fdialog%2Ffiledlghelper.cxx%40203d9678

m_bInitialized is set to true before the request is set ?
or...VistaFilePicker constructor isn't called with bFolderPicker = tue ? 

https://opengrok.libreoffice.org/xref/core/fpicker/source/win32/VistaFilePicker.cxx?r=c384c7d7#200
Comment 2 [REDACTED] 2021-08-22 15:41:33 UTC
Repro

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 10c742afd5f04c2c3a3e1f881fd6a8c61d364c03
CPU threads: 1; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: en-US (en_DE); UI: de-DE
Calc: threaded
Comment 3 Caolán McNamara 2021-08-22 18:44:50 UTC
looks like the vista file/folder picker impl will default back to "file open" if initialization is explicitly called on the folder service
Comment 4 Caolán McNamara 2021-08-22 18:46:05 UTC
which would mean a regression since

commit 203d96787969f707c78101be18d51b44ace98f93
Author: Caolán McNamara <caolanm@redhat.com>
Date:   Mon Jun 21 13:01:52 2021 +0100

    give folderpicker an optional parent
Comment 5 Caolán McNamara 2021-08-22 19:39:15 UTC
*** Bug 143090 has been marked as a duplicate of this bug. ***
Comment 6 Caolán McNamara 2021-08-22 19:40:10 UTC
https://gerrit.libreoffice.org/c/core/+/120853 fixes this. Won't need backporting to 7-2 as this is an issue in trunk towards 7-3 only
Comment 7 Commit Notification 2021-08-23 08:00:56 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/4b366aa7b21318c2dcb84e1014c59b49ed155b9a

Resolves: tdf#143993 don't change FolderPicker to FilePicker if init called

It will be available in 7.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 himajin100000 2021-08-24 13:07:10 UTC
non-reproducible with:

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 3ee22d95d3e1e9ce1d2ff8311e51d600179370f9
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: default; VCL: win
Locale: ja-JP (ja_JP); UI: en-US
Calc: threaded