summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2018-03-13 13:08:14 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2018-03-24 21:29:47 +0100
commit7024f73e088b741a3024f6934d04620d7ed73de4 (patch)
tree7f8fecffde8e41c6bc625cc52a53d09de86e1bff /sw
parent4e2e1d04d8f9a38d76c259bb21fbf53b1088b813 (diff)
tdf#97622: Apply Asian spacing only to Asian text
The option “Apply spacing between Asian, Latin and complex text” (which is on by default) should only apply the extra spacing if one side of the text is Asian since that is the requirement of CJK typography, but Writer seems to apply it to any script change (e.g. between CTL and Western). This matches the behaviour in edit engine wich was changed back in 2002 in commit e314e1b8aa3f1d98f2b33ce3f546d07eafa0f799. Change-Id: Ia9f7167251bce7166c4087b347788a7b89e8b347 Reviewed-on: https://gerrit.libreoffice.org/51208 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/text/itrform2.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index fd91902a920c..7fc2ae4005df 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -606,7 +606,9 @@ void SwTextFormatter::BuildPortions( SwTextFormatInfo &rInf )
// to 20% of the fontheight.
sal_Int32 nTmp = rInf.GetIdx() + pPor->GetLen();
if( nTmp == m_pScriptInfo->NextScriptChg( nTmp - 1 ) &&
- nTmp != rInf.GetText().getLength() )
+ nTmp != rInf.GetText().getLength() &&
+ (m_pScriptInfo->ScriptType(nTmp - 1) == css::i18n::ScriptType::ASIAN ||
+ m_pScriptInfo->ScriptType(nTmp) == css::i18n::ScriptType::ASIAN) )
{
const sal_uInt16 nDist = static_cast<sal_uInt16>(rInf.GetFont()->GetHeight()/5);