diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-11-26 16:59:52 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-11-27 17:26:41 +0100 |
commit | 1e396675d81b740a6c04afed58eed6468e5c249a (patch) | |
tree | 8269b23f990697eaf8d145b58e4b3fe496556a39 | |
parent | aa0a2266f0fd9f53b50944aa183b7e78fe675300 (diff) |
set png filter for import dialog in a more robust way
Change-Id: Iec25e214b19e5a2ab8a7305aad307c3f03e67401
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125913
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | cui/source/customize/cfg.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 970002d1949c..29ca8ccb96f6 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -28,6 +28,7 @@ #include <vcl/commandinfoprovider.hxx> #include <vcl/event.hxx> #include <vcl/graph.hxx> +#include <vcl/graphicfilter.hxx> #include <vcl/svapp.hxx> #include <vcl/toolbox.hxx> #include <vcl/weld.hxx> @@ -2888,8 +2889,9 @@ IMPL_LINK_NOARG(SvxIconSelectorDialog, ImportHdl, weld::Button&, void) false); } - aImportDialog.SetCurrentFilter( - "PNG - Portable Network Graphics"); + GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter(); + sal_uInt16 nFilter = rFilter.GetImportFormatNumberForShortName(u"png"); + aImportDialog.SetCurrentFilter(rFilter.GetImportFormatName(nFilter)); if ( ERRCODE_NONE == aImportDialog.Execute() ) { |