Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


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.faure@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


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.