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 e314e1b8aa.

Change-Id: Ia9f7167251bce7166c4087b347788a7b89e8b347
Reviewed-on: https://gerrit.libreoffice.org/51208
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
This commit is contained in:
Khaled Hosny
2018-03-13 13:08:14 +02:00
parent 4e2e1d04d8
commit 7024f73e08
2 changed files with 4 additions and 2 deletions

View File

@@ -54,7 +54,7 @@
</child>
<child>
<object class="GtkCheckButton" id="checkApplySpacing">
<property name="label" translatable="yes" context="asiantypography|checkApplySpacing">Apply spacing between Asian, Latin and complex text</property>
<property name="label" translatable="yes" context="asiantypography|checkApplySpacing">Apply spacing between Asian and non-Asian text</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>

View File

@@ -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);