[Libreoffice-commits] core.git: sc/source

Eike Rathke erack at redhat.com
Mon Oct 17 19:10:24 UTC 2016


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

New commits:
commit c3f096c7630994450625307091a0e6009fb02bc4
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.
    
    Change-Id: If0523752a4dea4e18d3d86ca5a2735fbcf39c3e3

diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index c9aeb29..bfd1efd 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -1218,7 +1218,34 @@ 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;
+                }
+                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