[Libreoffice-commits] core.git: 3 commits - include/svtools include/tools svtools/source tools/source

Eike Rathke erack at redhat.com
Fri May 9 15:40:18 PDT 2014


 include/svtools/langtab.hxx     |    8 ++++++++
 include/tools/resary.hxx        |    2 ++
 svtools/source/misc/langtab.cxx |   11 +++++++++++
 tools/source/rc/resary.cxx      |    6 ++++++
 4 files changed, 27 insertions(+)

New commits:
commit 07481fd864a1826c29a9e6bdf6c08dac4cc56ba7
Author: Eike Rathke <erack at redhat.com>
Date:   Sat May 10 00:33:00 2014 +0200

    add on-the-fly language tags to the language table
    
    Change-Id: I5ca9e212374821de425729863c82f7b4699487a7

diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index d97f382..b8eeec0 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -163,6 +163,12 @@ const OUString SvtLanguageTableImpl::GetString( const LanguageType eType, bool b
         << std::hex << eType
         << " with unknown name, so returning lang-tag of: "
         << sLangTag);
+
+    // And add it to the table if it is an on-the-fly-id, which it usually is,
+    // so it is available in all subsequent language boxes.
+    if (LanguageTag::isOnTheFlyID( eType))
+        const_cast<SvtLanguageTableImpl*>(this)->AddItem( sLangTag, eType);
+
     return sLangTag;
 }
 
commit 1564b0fe7c00902b076725b0693cc60aec0e0916
Author: Eike Rathke <erack at redhat.com>
Date:   Fri May 9 21:43:55 2014 +0200

    added SvtLanguageTable::AddLanguageTag()
    
    Change-Id: Ic8be508bff3767f2f8ab1146447b3fe4bffff3b3

diff --git a/include/svtools/langtab.hxx b/include/svtools/langtab.hxx
index 14b506b..f8e6363 100644
--- a/include/svtools/langtab.hxx
+++ b/include/svtools/langtab.hxx
@@ -40,6 +40,14 @@ public:
                       parameter.
      */
     static OUString     GetLanguageString( const LanguageType eType, bool bUserInterfaceSelection );
+
+    /** Add a language tag to the table.
+
+        @param  rString
+                UI visible description string. If empty, the rLanguageTag Bcp47
+                string is used instead.
+     */
+    static sal_uInt32   AddLanguageTag( const LanguageTag& rLanguageTag, const OUString& rString );
 };
 
 // Add LRE or RLE embedding characters to the string based on the
diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index 08d50bd..d97f382 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -227,5 +227,10 @@ LanguageType SvtLanguageTable::GetLanguageTypeAtIndex( sal_uInt32 nIndex )
 }
 
 
+sal_uInt32 SvtLanguageTable::AddLanguageTag( const LanguageTag& rLanguageTag, const OUString& rString )
+{
+    return theLanguageTable::get().AddItem( (rString.isEmpty() ? rLanguageTag.getBcp47() : rString),
+            rLanguageTag.getLanguageType());
+}
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 0b2c8a8b2b7cd41ed8e25d2e184a8e7241abed02
Author: Eike Rathke <erack at redhat.com>
Date:   Fri May 9 20:51:12 2014 +0200

    added ResStringArray::AddItem()
    
    Change-Id: I361cd4256c0816a46ea6e37dd9fd2680d3dba9fb

diff --git a/include/tools/resary.hxx b/include/tools/resary.hxx
index b29d67b..21a6625 100644
--- a/include/tools/resary.hxx
+++ b/include/tools/resary.hxx
@@ -53,6 +53,8 @@ public:
     sal_uInt32          Count() const { return sal_uInt32(m_aStrings.size()); }
 
     sal_uInt32          FindIndex( sal_IntPtr nValue ) const;
+
+    sal_uInt32          AddItem( const OUString& rString, sal_IntPtr nValue );
 };
 
 #endif
diff --git a/tools/source/rc/resary.cxx b/tools/source/rc/resary.cxx
index 77f3ee7..dac1d94 100644
--- a/tools/source/rc/resary.cxx
+++ b/tools/source/rc/resary.cxx
@@ -60,4 +60,10 @@ sal_uInt32 ResStringArray::FindIndex( sal_IntPtr nValue ) const
     return RESARRAY_INDEX_NOTFOUND;
 }
 
+sal_uInt32 ResStringArray::AddItem( const OUString& rString, sal_IntPtr nValue )
+{
+    m_aStrings.push_back( ImplResStringItem( rString, nValue));
+    return m_aStrings.size();
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list