From 99f3d9895f63ed19496bbe47bd36899b0f39dbce Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Mon, 7 Aug 2017 22:31:58 +0900 Subject: [PATCH] tdf#95309 Add a filter to show all files for "Insert > File" in Draw and Impress. Change-Id: Ia6721f4a25af9fe8b6edd143ecb7ba3f5f3e8a89 Reviewed-on: https://gerrit.libreoffice.org/40834 Tested-by: Jenkins Reviewed-by: Katarina Behrens --- sd/inc/strings.hrc | 1 + sd/source/ui/func/fuinsfil.cxx | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sd/inc/strings.hrc b/sd/inc/strings.hrc index e3d350063c0a..76ff0a0e060d 100644 --- a/sd/inc/strings.hrc +++ b/sd/inc/strings.hrc @@ -96,6 +96,7 @@ #define STR_SD_PAGE NC_("STR_SD_PAGE", "Slide") #define STR_SD_PAGE_COUNT NC_("STR_SD_PAGE_COUNT", "Slide %1 of %2") #define STR_SD_PAGE_COUNT_CUSTOM NC_("STR_SD_PAGE_COUNT_CUSTOM", "Slide %1 of %2 (%3)") +#define STR_ALL_SUPPORTED_FORMATS NC_("STR_ALL_SUPPORTED_FORMATS", "All supported formats") #define STR_ALL_FILES NC_("STR_ALL_FILES", "All files") #define STR_UNDO_INSERT_TEXTFRAME NC_("STR_UNDO_INSERT_TEXTFRAME", "Insert text frame") #define STR_ACTION_NOTPOSSIBLE NC_("STR_ACTION_NOTPOSSIBLE", "This function cannot be run \nwith the selected objects.") diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx index 3bcbc78db3dc..d72701c527e9 100644 --- a/sd/source/ui/func/fuinsfil.cxx +++ b/sd/source/ui/func/fuinsfil.cxx @@ -214,15 +214,15 @@ void FuInsertFile::DoExecute( SfxRequest& rReq ) ++aOtherIter; } - // set default-filter () - OUString aAllSpec( SdResId( STR_ALL_FILES ) ); + // set "All supported formats" as the default filter + OUString aAllSpec( SdResId( STR_ALL_SUPPORTED_FORMATS ) ); OUString aExtensions = lcl_GetExtensionsList( aFilterVector ); OUString aGUIName = aAllSpec + " (" + aExtensions + ")"; xFilterManager->appendFilter( aGUIName, aExtensions ); xFilterManager->setCurrentFilter( aAllSpec ); - // add filters to filter manager finally + // append individual filters ::std::vector< ::std::pair < OUString, OUString > >::const_iterator aIter( aFilterVector.begin() ); while( aIter != aFilterVector.end() ) @@ -231,6 +231,8 @@ void FuInsertFile::DoExecute( SfxRequest& rReq ) ++aIter; } + // end with "All files" as fallback + xFilterManager->appendFilter( SdResId( STR_ALL_FILES ), "*.*" ); } catch (const IllegalArgumentException&) {