Kaydet (Commit) 40f6dab9 authored tarafından Michael Stahl's avatar Michael Stahl

sw_redlinehide: SwScriptInfo conversion in itradj.cxx

Have to reinterpret_cast arrays here to pass them to VCL.

Change-Id: Ia0d1b9ab159e55bae01f1cabf3c137a9c8676c79
üst f041a3d0
...@@ -131,8 +131,8 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTextSizeInfo& rInf, ...@@ -131,8 +131,8 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTextSizeInfo& rInf,
// kashida positions found in SwScriptInfo are not necessarily valid in every font // kashida positions found in SwScriptInfo are not necessarily valid in every font
// if two characters are replaced by a ligature glyph, there will be no place for a kashida // if two characters are replaced by a ligature glyph, there will be no place for a kashida
std::unique_ptr<sal_Int32[]> pKashidaPos( new sal_Int32[ rKashidas ] ); std::unique_ptr<TextFrameIndex[]> pKashidaPos(new TextFrameIndex[rKashidas]);
std::unique_ptr<sal_Int32[]> pKashidaPosDropped( new sal_Int32[ rKashidas ] ); std::unique_ptr<TextFrameIndex[]> pKashidaPosDropped(new TextFrameIndex[rKashidas]);
rSI.GetKashidaPositions ( nIdx, rItr.GetLength(), pKashidaPos.get() ); rSI.GetKashidaPositions ( nIdx, rItr.GetLength(), pKashidaPos.get() );
sal_Int32 nKashidaIdx = 0; sal_Int32 nKashidaIdx = 0;
while ( rKashidas && nIdx < nEnd ) while ( rKashidas && nIdx < nEnd )
...@@ -142,7 +142,7 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTextSizeInfo& rInf, ...@@ -142,7 +142,7 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTextSizeInfo& rInf,
// is there also a script change before? // is there also a script change before?
// if there is, nNext should point to the script change // if there is, nNext should point to the script change
sal_Int32 nNextScript = rSI.NextScriptChg( nIdx ); TextFrameIndex const nNextScript = rSI.NextScriptChg( nIdx );
if( nNextScript < nNext ) if( nNextScript < nNext )
nNext = nNextScript; nNext = nNextScript;
...@@ -161,15 +161,17 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTextSizeInfo& rInf, ...@@ -161,15 +161,17 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTextSizeInfo& rInf,
{ {
ComplexTextLayoutFlags nOldLayout = rInf.GetOut()->GetLayoutMode(); ComplexTextLayoutFlags nOldLayout = rInf.GetOut()->GetLayoutMode();
rInf.GetOut()->SetLayoutMode ( nOldLayout | ComplexTextLayoutFlags::BiDiRtl ); rInf.GetOut()->SetLayoutMode ( nOldLayout | ComplexTextLayoutFlags::BiDiRtl );
nKashidasDropped = rInf.GetOut()->ValidateKashidas ( rInf.GetText(), nIdx, nNext - nIdx, nKashidasDropped = rInf.GetOut()->ValidateKashidas(
nKashidasInAttr, pKashidaPos.get() + nKashidaIdx, rInf.GetText(), sal_Int32(nIdx), sal_Int32(nNext - nIdx),
pKashidaPosDropped.get() ); nKashidasInAttr,
reinterpret_cast<sal_Int32*>(pKashidaPos.get() + nKashidaIdx),
reinterpret_cast<sal_Int32*>(pKashidaPosDropped.get()));
rInf.GetOut()->SetLayoutMode ( nOldLayout ); rInf.GetOut()->SetLayoutMode ( nOldLayout );
if ( nKashidasDropped ) if ( nKashidasDropped )
{ {
rSI.MarkKashidasInvalid(nKashidasDropped, pKashidaPosDropped.get()); rSI.MarkKashidasInvalid(nKashidasDropped, pKashidaPosDropped.get());
rKashidas -= nKashidasDropped; rKashidas -= nKashidasDropped;
nGluePortion -= nKashidasDropped; nGluePortion -= TextFrameIndex(nKashidasDropped);
} }
} }
nKashidaIdx += nKashidasInAttr; nKashidaIdx += nKashidasInAttr;
...@@ -199,11 +201,11 @@ static bool lcl_CheckKashidaWidth ( SwScriptInfo& rSI, SwTextSizeInfo& rInf, SwT ...@@ -199,11 +201,11 @@ static bool lcl_CheckKashidaWidth ( SwScriptInfo& rSI, SwTextSizeInfo& rInf, SwT
// is there also a script change before? // is there also a script change before?
// if there is, nNext should point to the script change // if there is, nNext should point to the script change
sal_Int32 nNextScript = rSI.NextScriptChg( nIdx ); TextFrameIndex const nNextScript = rSI.NextScriptChg( nIdx );
if( nNextScript < nNext ) if( nNextScript < nNext )
nNext = nNextScript; nNext = nNextScript;
if ( nNext == COMPLETE_STRING || nNext > nEnd ) if (nNext == TextFrameIndex(COMPLETE_STRING) || nNext > nEnd)
nNext = nEnd; nNext = nEnd;
sal_Int32 nKashidasInAttr = rSI.KashidaJustify ( nullptr, nullptr, nIdx, nNext - nIdx ); sal_Int32 nKashidasInAttr = rSI.KashidaJustify ( nullptr, nullptr, nIdx, nNext - nIdx );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment