From a0dcc8f78061d22d925f31ef8d03ca751ad6dc19 Mon Sep 17 00:00:00 2001 From: Ariel Constenla-Haile Date: Wed, 6 Mar 2013 12:15:24 +0000 Subject: Resolves: #i121857# Presentation Minimizer: fix filter naming (cherry picked from commit 75833fdb6ede664fdcef38a16ecf1f8d3f3adc7d) Conflicts: sdext/source/minimizer/fileopendialog.cxx Change-Id: I164cc6d9916ddf9dba9da273b5181e5728127292 --- sdext/source/minimizer/fileopendialog.cxx | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'sdext') diff --git a/sdext/source/minimizer/fileopendialog.cxx b/sdext/source/minimizer/fileopendialog.cxx index 93f2cb76a702..bb3bb5c9e8a4 100644 --- a/sdext/source/minimizer/fileopendialog.cxx +++ b/sdext/source/minimizer/fileopendialog.cxx @@ -46,6 +46,7 @@ #include #include +#include using namespace ::rtl; using namespace ::com::sun::star::uno; @@ -140,7 +141,27 @@ FileOpenDialog::FileOpenDialog( const Reference< XComponentContext >& rxContext } if ( aExtensions.getLength() ) { - mxFilePicker->appendFilter( aIter->maUIName, aExtensions[ 0 ] ); + OUString aExtension = aExtensions[0]; + + const char filter[] = "*."; + // the filter title must be formed in the same it is currently done + // in the internal implementation: "UIName (.)" + OUStringBuffer aUIName; + // the filter must be in the form "*." + OUStringBuffer aFilter; + + // form the title: " (.maUIName ); + aUIName.appendAscii( RTL_CONSTASCII_STRINGPARAM( " (." )); + aUIName.append( aExtension ); + aUIName.append( sal_Unicode( ')' ) ); + // form the filter: "(*.)" + aFilter.appendAscii( RTL_CONSTASCII_STRINGPARAM( filter ) ); + aFilter.append( aExtensions[0] ); + + mxFilePicker->appendFilter( aUIName.makeStringAndClear(), + aFilter.makeStringAndClear() ); + if ( aIter->maFlags & 0x100 ) mxFilePicker->setCurrentFilter( aIter->maUIName ); } -- cgit