summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/text/itradj.cxx11
-rw-r--r--sw/source/core/text/portxt.cxx3
-rw-r--r--sw/source/core/txtnode/fntcache.cxx9
3 files changed, 11 insertions, 12 deletions
diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx
index 047e26b6220e..0065e7e5c5e8 100644
--- a/sw/source/core/text/itradj.cxx
+++ b/sw/source/core/text/itradj.cxx
@@ -113,9 +113,6 @@ void SwTextAdjuster::FormatBlock( )
static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTextSizeInfo& rInf, SwTextIter& rItr,
sal_Int32& rKashidas, TextFrameIndex& nGluePortion)
{
- if ( rInf.GetOut()->GetMinKashida() <= 0 )
- return false;
-
// i60594 validate Kashida justification
TextFrameIndex nIdx = rItr.GetStart();
TextFrameIndex nEnd = rItr.GetEnd();
@@ -153,6 +150,12 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTextSizeInfo& rInf,
sal_Int32 nKashidasInAttr = rSI.KashidaJustify ( nullptr, nullptr, nIdx, nNext - nIdx );
if (nKashidasInAttr > 0)
{
+ // Kashida glyph looks suspicious, skip Kashida justification
+ if ( rInf.GetOut()->GetMinKashida() <= 0 )
+ {
+ return false;
+ }
+
sal_Int32 nKashidasDropped = 0;
if ( !SwScriptInfo::IsArabicText( rInf.GetText(), nIdx, nNext - nIdx ) )
{
@@ -212,7 +215,7 @@ static bool lcl_CheckKashidaWidth ( SwScriptInfo& rSI, SwTextSizeInfo& rInf, SwT
sal_Int32 nKashidasInAttr = rSI.KashidaJustify ( nullptr, nullptr, nIdx, nNext - nIdx );
long nFontMinKashida = rInf.GetOut()->GetMinKashida();
- if ( nKashidasInAttr > 0 && SwScriptInfo::IsArabicText( rInf.GetText(), nIdx, nNext - nIdx ) )
+ if ( nFontMinKashida && nKashidasInAttr > 0 && SwScriptInfo::IsArabicText( rInf.GetText(), nIdx, nNext - nIdx ) )
{
sal_Int32 nKashidasDropped = 0;
while ( rKashidas && nGluePortion && nKashidasInAttr > 0 &&
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index eb3937d10702..fdf8925fb31f 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -115,8 +115,7 @@ static TextFrameIndex lcl_AddSpace(const SwTextSizeInfo &rInf,
// Kashida Justification: Insert Kashidas
if ( nEnd > nPos && pSI && COMPLEX == nScript )
{
- if ( SwScriptInfo::IsArabicText( *pStr, nPos, nEnd - nPos ) && rInf.GetOut()->GetMinKashida()
- && pSI->CountKashida() )
+ if ( SwScriptInfo::IsArabicText( *pStr, nPos, nEnd - nPos ) && pSI->CountKashida() )
{
const sal_Int32 nKashRes = pSI->KashidaJustify( nullptr, nullptr, nPos, nEnd - nPos );
// i60591: need to check result of KashidaJustify
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index f9352dcc5936..ed39672d4f5a 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -1319,8 +1319,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// Kashida Justification
if ( SwFontScript::CTL == nActual && nSpaceAdd )
{
- if ( SwScriptInfo::IsArabicText( rInf.GetText(), rInf.GetIdx(), rInf.GetLen() )
- && rInf.GetOut().GetMinKashida() )
+ if ( SwScriptInfo::IsArabicText( rInf.GetText(), rInf.GetIdx(), rInf.GetLen() ) )
{
if ( pSI && pSI->CountKashida() &&
pSI->KashidaJustify( pKernArray.get(), nullptr, rInf.GetIdx(),
@@ -1530,8 +1529,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// Kashida Justification
if ( SwFontScript::CTL == nActual && nSpaceAdd )
{
- if ( SwScriptInfo::IsArabicText( rInf.GetText(), rInf.GetIdx(), rInf.GetLen() )
- && rInf.GetOut().GetMinKashida() )
+ if ( SwScriptInfo::IsArabicText( rInf.GetText(), rInf.GetIdx(), rInf.GetLen() ) )
{
if ( pSI && pSI->CountKashida() &&
pSI->KashidaJustify( pKernArray.get(), pScrArray.get(), rInf.GetIdx(),
@@ -2131,8 +2129,7 @@ TextFrameIndex SwFntObj::GetCursorOfst(SwDrawTextInfo &rInf)
// Kashida Justification
if ( SwFontScript::CTL == nActual && rInf.GetSpace() )
{
- if ( SwScriptInfo::IsArabicText( rInf.GetText(), rInf.GetIdx(), rInf.GetLen() )
- && rInf.GetOut().GetMinKashida() )
+ if ( SwScriptInfo::IsArabicText( rInf.GetText(), rInf.GetIdx(), rInf.GetLen() ) )
{
if ( pSI && pSI->CountKashida() &&
pSI->KashidaJustify( pKernArray.get(), nullptr, rInf.GetIdx(), rInf.GetLen(),