[Libreoffice-commits] core.git: sfx2/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Sat Jun 1 09:47:05 UTC 2019


 sfx2/source/dialog/filedlghelper.cxx |   20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

New commits:
commit c6c14f6ae7f6d7768b450e7776db917bb662f3cf
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri May 31 15:33:00 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Jun 1 11:46:27 2019 +0200

    Resolves: rhbz#1715109 add All files to the graphic import dialog
    
    to pick up things without extensions, for consistency with file->open
    
    Change-Id: Ib119fb0d053d1d288eee7cd17fa4f12dcb9956d7
    Reviewed-on: https://gerrit.libreoffice.org/73276
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index 747a3e5cf2b0..682eca3a864b 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -1897,11 +1897,23 @@ void FileDialogHelper_Impl::addGraphicFilter()
 
     try
     {
-        OUString aAllFilterName = SfxResId(STR_SFX_IMPORT_ALL_IMAGES);
-        aAllFilterName = ::sfx2::addExtension( aAllFilterName, aExtensions, bIsInOpenMode, *this );
+        // if the extension is not "All files", insert "All images"
+        if (aExtensions != FILEDIALOG_FILTER_ALL)
+        {
+            OUString aAllFilterName = SfxResId(STR_SFX_IMPORT_ALL_IMAGES);
+            aAllFilterName = ::sfx2::addExtension( aAllFilterName, aExtensions, bIsInOpenMode, *this );
+            xFltMgr->appendFilter( aAllFilterName, aExtensions );
+            maSelectFilter = aAllFilterName; // and make it the default
+        }
+
+        // rhbz#1715109 always include All files *.* or *
+        OUString aAllFilesName = SfxResId( STR_SFX_FILTERNAME_ALL );
+        aAllFilesName = ::sfx2::addExtension( aAllFilesName, FILEDIALOG_FILTER_ALL, bIsInOpenMode, *this );
+        xFltMgr->appendFilter( aAllFilesName, FILEDIALOG_FILTER_ALL );
 
-        xFltMgr->appendFilter( aAllFilterName, aExtensions );
-        maSelectFilter = aAllFilterName;
+        // if the extension is "All files", make that the default
+        if (aExtensions == FILEDIALOG_FILTER_ALL)
+            maSelectFilter = maSelectFilter;
     }
     catch( const IllegalArgumentException& )
     {


More information about the Libreoffice-commits mailing list