Le 30/05/2011 09:23, Cedric Bosdonnat a écrit :
> On Sun, 2011-05-29 at 11:40 +0200, Jean-Baptiste Faure wrote:
>> It works if I add a break statement when UIName is found :
>>
>>     for(int nProp = 0; nProp < rProperties.getLength(); nProp++)
>>     {
>>         if(!pProperties[nProp].Name.compareToAscii("UIName"))
>>         {
>>             pProperties[nProp].Value >>= sRet;
>> +            break;
>>         }
>>
>> If UIName is found first then the loop terminates. Is it a good method
>> to fix the problem ?
> 
> A algorithm teacher would tell you it's ugly... Do we want to possibly
> use the two other fallbacks? In that case you would need to set some
> priority between the two remaining properties that are looked for. But
> may by just greping through the filters definitions you'll find out that
> it's pointless ;)
> 
> Thanks for your investigations on that bug.
> 
Hi,

Well, after having discussed with Cédric, it is not so ugly.
Here is the patch: it adds the break statement and removes the third
case "Flags" which has nothing to do with the aim of the function "find
the human readable name of the filter".

Best regards
JBF

-- 
Seuls des formats ouverts peuvent assurer la pérennité de vos documents.
>From 4fa64ee71ba7ce969a00b662e85202a69fbda98b Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Faure <jbf.fa...@orange.fr>
Date: Wed, 1 Jun 2011 13:14:49 +0200
Subject: [PATCH] fix for bug fdo 36519

Use human readable format name instead of internal filter names in Load/save options UI
---
 cui/source/options/optsave.cxx |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index c0719b4..c0dd83a 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -558,20 +558,13 @@ IMPL_LINK( SfxSaveTabPage, AutoClickHdl_Impl, CheckBox *, pBox )
 OUString lcl_ExtracUIName(const Sequence<PropertyValue> rProperties)
 {
     OUString sRet;
-    sal_Int32 nFlags;
     const PropertyValue* pProperties = rProperties.getConstArray();
     for(int nProp = 0; nProp < rProperties.getLength(); nProp++)
     {
         if(!pProperties[nProp].Name.compareToAscii("UIName"))
         {
             pProperties[nProp].Value >>= sRet;
-        }
-        else if(!pProperties[nProp].Name.compareToAscii("Flags"))
-        {
-            if ( pProperties[nProp].Value >>= nFlags )
-            {
-                nFlags &= 0x100;
-            }
+            break;
         }
         else if(!pProperties[nProp].Name.compareToAscii("Name"))
         {
-- 
1.7.0.4

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to