path: root/writerfilter/source/dmapper/ThemeTable.hxx
diff options
authorJacobo Aragunde Pérez <>2013-12-10 10:53:29 +0100
committerJacobo Aragunde Pérez <>2013-12-11 17:38:56 +0100
commit1835074d525d12629008f8a6d5ed27402d18f4b3 (patch)
treeb2a5fe34f61da528fa1f269815430b0abb3988ca /writerfilter/source/dmapper/ThemeTable.hxx
parent0f5a7bc99fff074336b8d122a0bcc8f3c8e79a7f (diff)
fdo#64232: fix theme fonts application
We were applying the theme fonts taking only into account the <a:latin>, <a:ea> and <a:cs> tags to set latin, eastAsia and cs fonts respectively. Word uses in addition the <a:font> tags to define a font name per language, in combination with <w:themeFontLang> tag in settings.xml file which indicates the default language for latin, cs and eastAsia. For example, with <w:themeFontLang w:bidi="he-IL" /> the default language for cs text is Hebrew, if the theme says <a:font script="Hebr" typeface="Arial"/> then the selected font for those sections of text should be Arial. In theory, Word would also be able to define the language for a specific section of text and that should receive the proper font from the theme definition, but we are currently not supporting it. More info: 22/office-open-xml-themes-schemes-and-fonts.aspx Main changes in this patch: * Added setter and getter values to ThemeTable and SettingsTable to be able to pass the values read in <w:themeFontLang> tag. * Added support to manage the values in <w:themeFontLang> and <a:font> tags, which used to be discarded. * Added methods to translate locale definitions to the language codes used in the <a:font>, using a table defined in the link above. Change-Id: I78e6da5feab34cb9ff770a2c60e2f7229e7fb140
Diffstat (limited to 'writerfilter/source/dmapper/ThemeTable.hxx')
1 files changed, 7 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/ThemeTable.hxx b/writerfilter/source/dmapper/ThemeTable.hxx
index 75145555f576..190da8504e21 100644
--- a/writerfilter/source/dmapper/ThemeTable.hxx
+++ b/writerfilter/source/dmapper/ThemeTable.hxx
@@ -22,7 +22,9 @@
#include <WriterFilterDllApi.hxx>
#include <resourcemodel/LoggedResources.hxx>
+#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/lang/XComponent.hpp>
+#include <i18nlangtag/languagetag.hxx>
#include <map>
namespace writerfilter {
@@ -41,6 +43,7 @@ public:
const OUString getFontNameForTheme(const Id id) const;
static OUString getStringForTheme(const Id id);
+ void setThemeFontLangProperties(uno::Sequence<beans::PropertyValue> aPropSeq);
// Properties
@@ -49,6 +52,10 @@ public:
// Table
virtual void lcl_entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
+ // Helper methods
+ OUString fromLocaleToScriptTag(OUString sLocale);
+ OUString fromLCIDToScriptTag(LanguageType lang);
typedef boost::shared_ptr< ThemeTable > ThemeTablePtr;