summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorAriel Constenla-Haile <arielch@apache.org>2013-03-06 12:15:24 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-05-23 20:26:50 +0100
commita0dcc8f78061d22d925f31ef8d03ca751ad6dc19 (patch)
treeb01efa0e6e1c37bba82b0bf946cd52614fae655b /sdext
parentb1e751d665599eeb7445b20837c079d84de2113f (diff)
Resolves: #i121857# Presentation Minimizer: fix filter naming
(cherry picked from commit 75833fdb6ede664fdcef38a16ecf1f8d3f3adc7d) Conflicts: sdext/source/minimizer/fileopendialog.cxx Change-Id: I164cc6d9916ddf9dba9da273b5181e5728127292
Diffstat (limited to 'sdext')
-rw-r--r--sdext/source/minimizer/fileopendialog.cxx23
1 files changed, 22 insertions, 1 deletions
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 <com/sun/star/view/XControlAccess.hpp>
#include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp>
+#include <rtl/ustrbuf.hxx>
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 (.<extension>)"
+ OUStringBuffer aUIName;
+ // the filter must be in the form "*.<extension>"
+ OUStringBuffer aFilter;
+
+ // form the title: "<UIName> (.<extension)"
+ aUIName.append( aIter->maUIName );
+ aUIName.appendAscii( RTL_CONSTASCII_STRINGPARAM( " (." ));
+ aUIName.append( aExtension );
+ aUIName.append( sal_Unicode( ')' ) );
+ // form the filter: "(*.<extension>)"
+ aFilter.appendAscii( RTL_CONSTASCII_STRINGPARAM( filter ) );
+ aFilter.append( aExtensions[0] );
+
+ mxFilePicker->appendFilter( aUIName.makeStringAndClear(),
+ aFilter.makeStringAndClear() );
+
if ( aIter->maFlags & 0x100 )
mxFilePicker->setCurrentFilter( aIter->maUIName );
}