[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sdext/source

Ariel Constenla-Haile arielch at apache.org
Thu May 23 12:29:58 PDT 2013


 sdext/source/minimizer/fileopendialog.cxx |   23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

New commits:
commit d443bfea35c97cdb10e72e0eab5fb19845fc4447
Author: Ariel Constenla-Haile <arielch at apache.org>
Date:   Wed Mar 6 12:15:24 2013 +0000

    Resolves: #i121857# Presentation Minimizer: fix filter naming
    
    (cherry picked from commit 75833fdb6ede664fdcef38a16ecf1f8d3f3adc7d)
    
    Conflicts:
    	sdext/source/minimizer/fileopendialog.cxx
    
    Change-Id: I164cc6d9916ddf9dba9da273b5181e5728127292
    (cherry picked from commit a0dcc8f78061d22d925f31ef8d03ca751ad6dc19)

diff --git a/sdext/source/minimizer/fileopendialog.cxx b/sdext/source/minimizer/fileopendialog.cxx
index 93f2cb7..bb3bb5c 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 );
                 }


More information about the Libreoffice-commits mailing list