diff options
author | Mark Hung <marklh9@gmail.com> | 2019-10-01 21:46:15 +0800 |
---|---|---|
committer | Mark Hung <marklh9@gmail.com> | 2019-10-10 13:25:32 +0200 |
commit | 175ab303958809391bfd985729f177d26ba35cbb (patch) | |
tree | ef07c6b578fb9eaf15cf8bcc66cd0d5473c90edf /include | |
parent | 70ae1da67310a596e5bc49f1053c7ff72c84f539 (diff) |
tdf#98603 export runs with correct lang attribute (2/2).
Obtain lang attribute of rPr element from CharLocale,
CharLocaleAsian, or CharLocaleComplex based on the script
type of exported text.
There are several other call sites of WriteRunProperties,
like those in chartexport, and those for text fields,
Here I leave the default to CharLocale so it fallback
to western locale as it did before.
Change-Id: I33679517dd88f9e415933decc02f10afc807ad3b
Reviewed-on: https://gerrit.libreoffice.org/79973
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/oox/export/drawingml.hxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx index 95c105ee6c4c..c0d451fdf0f4 100644 --- a/include/oox/export/drawingml.hxx +++ b/include/oox/export/drawingml.hxx @@ -29,6 +29,7 @@ #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/style/ParagraphAdjust.hpp> #include <com/sun/star/drawing/Hatch.hpp> +#include <com/sun/star/i18n/ScriptType.hpp> #include <oox/dllapi.h> #include <oox/drawingml/drawingmltypes.hxx> #include <oox/token/tokens.hxx> @@ -251,7 +252,7 @@ public: void WriteRun( const css::uno::Reference< css::text::XTextRange >& rRun, bool& rbOverridingCharHeight, sal_Int32& rnCharHeight ); void WriteRunProperties( const css::uno::Reference< css::beans::XPropertySet >& rRun, bool bIsField, sal_Int32 nElement, bool bCheckDirect, - bool& rbOverridingCharHeight, sal_Int32& rnCharHeight ); + bool& rbOverridingCharHeight, sal_Int32& rnCharHeight, sal_Int16 nScriptType = css::i18n::ScriptType::LATIN); void WritePresetShape( const char* pShape , std::vector< std::pair<sal_Int32,sal_Int32>> & rAvList ); void WritePresetShape( const char* pShape ); @@ -283,6 +284,9 @@ public: static void ResetCounters(); + // A Helper to decide the script type for given text in order to call WriteRunProperties. + static sal_Int16 GetScriptType(const OUString& rStr); + static sal_Unicode SubstituteBullet( sal_Unicode cBulletId, css::awt::FontDescriptor& rFontDesc ); static ::Color ColorWithIntensity( sal_uInt32 nColor, sal_uInt32 nIntensity ); |