[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sc/source

Eike Rathke erack at redhat.com
Tue Oct 18 07:56:34 UTC 2016


 sc/source/filter/xml/xmlexprt.cxx |   31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

New commits:
commit 46ecb53fe18acef193314306355252363fe76ff9
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Oct 17 21:01:13 2016 +0200

    Resolves: tdf#102357 export correct locale attribution, not just country
    
    So all XMLPropertyHandler derived XMLCharLanguageHdl, XMLCharScriptHdl,
    XMLCharCountryHdl and XMLCharRfcLanguageTagHdl are actually called.
    
    Broken since
    
        commit 21661ebfbec9ea162582bbc7ab46607eb9095f1a
        Date:   Wed Aug 21 19:16:23 2013 -0400
    
            fdo#60740: Populate auto styles from edit cells without using UNO API.
    
    (cherry picked from commit c3f096c7630994450625307091a0e6009fb02bc4)
    
    pamper over-pessimistic whining compilers, tdf#102357 follow-up
    
    No, stupid, the switch-cases really cover all possible cases we entered this
    block for.
    
    (cherry picked from commit 27466acb4eda3ec6432d575091effe6c3a780950)
    
    1abbe2d784d5bbcc29c4c929adb622d9fe92fe54
    
    Change-Id: If0523752a4dea4e18d3d86ca5a2735fbcf39c3e3
    Reviewed-on: https://gerrit.libreoffice.org/29986
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 9d8a265..2d87d33 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -1219,7 +1219,36 @@ const SvxFieldData* toXMLPropertyStates(
                 if (!static_cast<const SvxLanguageItem*>(p)->QueryValue(aAny, pEntry->mnFlag))
                     continue;
 
-                rPropStates.push_back(XMLPropertyState(nIndex, aAny));
+                // Export multiple entries.
+                sal_Int32 nIndexLanguage, nIndexCountry, nIndexScript, nIndexTag;
+                switch (p->Which())
+                {
+                    case EE_CHAR_LANGUAGE:
+                        nIndexLanguage = xMapper->GetEntryIndex( XML_NAMESPACE_FO, "language", 0);
+                        nIndexCountry = xMapper->GetEntryIndex( XML_NAMESPACE_FO, "country", 0);
+                        nIndexScript = xMapper->GetEntryIndex( XML_NAMESPACE_FO, "script", 0);
+                        nIndexTag = xMapper->GetEntryIndex( XML_NAMESPACE_STYLE, "rfc-language-tag", 0);
+                    break;
+                    case EE_CHAR_LANGUAGE_CJK:
+                        nIndexLanguage = xMapper->GetEntryIndex( XML_NAMESPACE_STYLE, "language-asian", 0);
+                        nIndexCountry = xMapper->GetEntryIndex( XML_NAMESPACE_STYLE, "country-asian", 0);
+                        nIndexScript = xMapper->GetEntryIndex( XML_NAMESPACE_STYLE, "script-asian", 0);
+                        nIndexTag = xMapper->GetEntryIndex( XML_NAMESPACE_STYLE, "rfc-language-tag-asian", 0);
+                    break;
+                    case EE_CHAR_LANGUAGE_CTL:
+                        nIndexLanguage = xMapper->GetEntryIndex( XML_NAMESPACE_STYLE, "language-complex", 0);
+                        nIndexCountry = xMapper->GetEntryIndex( XML_NAMESPACE_STYLE, "country-complex", 0);
+                        nIndexScript = xMapper->GetEntryIndex( XML_NAMESPACE_STYLE, "script-complex", 0);
+                        nIndexTag = xMapper->GetEntryIndex( XML_NAMESPACE_STYLE, "rfc-language-tag-complex", 0);
+                    break;
+                    default:
+                        nIndexLanguage = nIndexCountry = nIndexScript = nIndexTag = -1;
+                }
+                assert( nIndexLanguage >= 0 && nIndexCountry >= 0 && nIndexScript >= 0 && nIndexTag >= 0);
+                rPropStates.push_back( XMLPropertyState( nIndexLanguage, aAny));
+                rPropStates.push_back( XMLPropertyState( nIndexCountry, aAny));
+                rPropStates.push_back( XMLPropertyState( nIndexScript, aAny));
+                rPropStates.push_back( XMLPropertyState( nIndexTag, aAny));
             }
             break;
             default:


More information about the Libreoffice-commits mailing list