summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-05-31 15:33:00 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-06-01 18:26:23 +0200
commitffc3975ef5dd1f3df35892d2ba2add7f09bd5a0d (patch)
tree95cd16caf2f9b3edab01c2e4a01b5b5ed25bada4 /sfx2
parent219e128553645911685b6061f7c5ea359a4c551c (diff)
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/73304 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/filedlghelper.cxx20
1 files changed, 16 insertions, 4 deletions
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index 747a3e5cf2b0..dd6cde167da1 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 = aAllFilesName;
}
catch( const IllegalArgumentException& )
{