avoid crash in 130+ odt export tests
e.g. fdo44181-1.ott to odt Change-Id: I23403415378ddf50ff007fb4b5d88b4009668bf6
This commit is contained in:
@@ -1196,14 +1196,14 @@ void SwTextPaintInfo::DrawBackBrush( const SwLinePortion &rPor ) const
|
|||||||
nLen = pPos->GetLen();
|
nLen = pPos->GetLen();
|
||||||
for ( int i = nIdx; i < (nIdx + nLen); ++i )
|
for ( int i = nIdx; i < (nIdx + nLen); ++i )
|
||||||
{
|
{
|
||||||
if ( GetText()[i] == CH_TXTATR_NEWLINE )
|
if (i < GetText().getLength() && GetText()[i] == CH_TXTATR_NEWLINE)
|
||||||
{
|
{
|
||||||
if ( i >= (GetIdx() + rPor.GetLen()) )
|
if ( i >= (GetIdx() + rPor.GetLen()) )
|
||||||
{
|
{
|
||||||
goto drawcontinue;
|
goto drawcontinue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( GetText()[i] != CH_BLANK )
|
if (i >= GetText().getLength() || GetText()[i] != CH_BLANK)
|
||||||
{
|
{
|
||||||
draw = true;
|
draw = true;
|
||||||
if ( i >= (GetIdx() + rPor.GetLen()) )
|
if ( i >= (GetIdx() + rPor.GetLen()) )
|
||||||
@@ -1230,11 +1230,11 @@ void SwTextPaintInfo::DrawBackBrush( const SwLinePortion &rPor ) const
|
|||||||
nLen = pPos->GetLen();
|
nLen = pPos->GetLen();
|
||||||
for ( int i = (nIdx + nLen - 1); i >= nIdx; --i )
|
for ( int i = (nIdx + nLen - 1); i >= nIdx; --i )
|
||||||
{
|
{
|
||||||
if ( GetText()[i] == CH_TXTATR_NEWLINE )
|
if (i < GetText().getLength() && GetText()[i] == CH_TXTATR_NEWLINE)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ( GetText()[i] != CH_BLANK )
|
if (i >= GetText().getLength() || GetText()[i] != CH_BLANK)
|
||||||
{
|
{
|
||||||
sal_uInt16 nOldWidth = rPor.Width();
|
sal_uInt16 nOldWidth = rPor.Width();
|
||||||
sal_uInt16 nNewWidth = GetTextSize( m_pOut, nullptr, GetText(), nIdx, (i + 1 - nIdx) ).Width();
|
sal_uInt16 nNewWidth = GetTextSize( m_pOut, nullptr, GetText(), nIdx, (i + 1 - nIdx) ).Width();
|
||||||
|
Reference in New Issue
Block a user