Kaydet (Commit) 68c1111c authored tarafından Michael Stahl's avatar Michael Stahl

GenericSalLayout::KashidaJustify: STL assertion

error: attempt to dereference a singular iterator.
(regression from 6bb68cae)
üst d07567fe
...@@ -1196,10 +1196,11 @@ void GenericSalLayout::KashidaJustify( long nKashidaIndex, int nKashidaWidth ) ...@@ -1196,10 +1196,11 @@ void GenericSalLayout::KashidaJustify( long nKashidaIndex, int nKashidaWidth )
nKashidaCount = 0; nKashidaCount = 0;
Point aPos = pG->maLinearPos; Point aPos = pG->maLinearPos;
aPos.X() -= nGapWidth; // cluster is already right aligned aPos.X() -= nGapWidth; // cluster is already right aligned
int const nCharPos = pG->mnCharPos;
GlyphVector::iterator pG2 = pG; GlyphVector::iterator pG2 = pG;
for(; nGapWidth > nKashidaWidth; nGapWidth -= nKashidaWidth, ++nKashidaCount ) for(; nGapWidth > nKashidaWidth; nGapWidth -= nKashidaWidth, ++nKashidaCount )
{ {
pG2 = m_GlyphItems.insert(pG2, GlyphItem( pG->mnCharPos, nKashidaIndex, aPos, pG2 = m_GlyphItems.insert(pG2, GlyphItem(nCharPos, nKashidaIndex, aPos,
GlyphItem::IS_IN_CLUSTER|GlyphItem::IS_RTL_GLYPH, nKashidaWidth )); GlyphItem::IS_IN_CLUSTER|GlyphItem::IS_RTL_GLYPH, nKashidaWidth ));
++pG2; ++pG2;
aPos.X() += nKashidaWidth; aPos.X() += nKashidaWidth;
...@@ -1208,7 +1209,7 @@ void GenericSalLayout::KashidaJustify( long nKashidaIndex, int nKashidaWidth ) ...@@ -1208,7 +1209,7 @@ void GenericSalLayout::KashidaJustify( long nKashidaIndex, int nKashidaWidth )
// fixup rightmost kashida for gap remainder // fixup rightmost kashida for gap remainder
if( nGapWidth > 0 ) if( nGapWidth > 0 )
{ {
pG2 = m_GlyphItems.insert(pG2, GlyphItem( pG->mnCharPos, nKashidaIndex, aPos, pG2 = m_GlyphItems.insert(pG2, GlyphItem(nCharPos, nKashidaIndex, aPos,
GlyphItem::IS_IN_CLUSTER|GlyphItem::IS_RTL_GLYPH, nKashidaCount ? nGapWidth : nGapWidth/2 )); GlyphItem::IS_IN_CLUSTER|GlyphItem::IS_RTL_GLYPH, nKashidaCount ? nGapWidth : nGapWidth/2 ));
++pG2; ++pG2;
aPos.X() += nGapWidth; aPos.X() += nGapWidth;
......
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