// Parse the line
LPCTSTR pszChars = GetLineChars (nLineIndex);
DWORD dwCookie = GetParseCookie (nLineIndex - 1);
- TEXTBLOCK *pBuf = (TEXTBLOCK *) _alloca (sizeof (TEXTBLOCK) * nLength * 3);
+ TEXTBLOCK *pBuf = new TEXTBLOCK[nLength * 3];
int nBlocks = 0;
//BEGIN SW
// insert at least one textblock of normal color at the beginning
int nActualItem = 0;
// Wrap the line
- int *anBreaks = (int*)_alloca( sizeof( int ) * nLength );
+ int *anBreaks = new int[nLength];
int nBreaks = 0;
WrapLineCached( nLineIndex, GetScreenChars(), anBreaks, nBreaks );
}
*/
//END SW
+ delete anBreaks;
+ delete pBuf;
}
COLORREF CCrystalTextView::
*/
// line is wrapped
- int *anBreaks = (int*)_alloca( sizeof( int ) * GetLineLength( nLineIndex ) );
+ int *anBreaks = new int[GetLineLength( nLineIndex )];
int nBreaks = 0;
WrapLineCached( nLineIndex, GetScreenChars(), anBreaks, nBreaks );
charPoint.x = (i >= 0)? nCharPos - anBreaks[i] : nCharPos;
charPoint.y = i + 1;
- return (i >= 0)? anBreaks[i] : 0;
+ int nReturnVal = (i >= 0)? anBreaks[i] : 0;
+ delete anBreaks;
+
+ return nReturnVal;
}
int CCrystalTextView::CursorPointToCharPos( int nLineIndex, const CPoint &curPoint )
LPCTSTR szLine = GetLineChars( nLineIndex );
// wrap line
- int *anBreaks = (int*)_alloca( sizeof( int ) * nLength );
+ int *anBreaks = new int[nLength];
int nBreaks = 0;
WrapLineCached( nLineIndex, nScreenChars, anBreaks, nBreaks );
break;
}
}
+ delete anBreaks;
return nIndex;
}
return nLength;
// wrap line
- int *anBreaks = (int*)_alloca( sizeof( int ) * nLength );
+ int *anBreaks = new int[nLength];
int nBreaks = 0;
WrapLineCached( nLineIndex, GetScreenChars(), anBreaks, nBreaks );
// compute character position for end of subline
ASSERT( nSubLineOffset >= 0 && nSubLineOffset <= nBreaks );
- return anBreaks[nSubLineOffset] - 1;
+ int nReturnVal = anBreaks[nSubLineOffset] - 1;
+ delete anBreaks;
+
+ return nReturnVal;
}
int CCrystalTextView::SubLineHomeToCharPos( int nLineIndex, int nSubLineOffset )
return 0;
// wrap line
- int *anBreaks = (int*)_alloca( sizeof( int ) * nLength );
+ int *anBreaks = new int[nLength];
int nBreaks = 0;
WrapLineCached( nLineIndex, GetScreenChars(), anBreaks, nBreaks );
// compute character position for end of subline
ASSERT( nSubLineOffset > 0 && nSubLineOffset <= nBreaks );
- return anBreaks[nSubLineOffset - 1];
+ int nReturnVal = anBreaks[nSubLineOffset - 1];
+ delete anBreaks;
+
+ return nReturnVal;
}
//END SW
if (pt.y >= 0 && pt.y < nLineCount)
{
nLength = GetLineLength( pt.y );
- anBreaks = (int*)_alloca( sizeof( int ) * nLength );
+ anBreaks = new int[nLength];
pszLine = GetLineChars(pt.y);
WrapLineCached( pt.y, GetScreenChars(), anBreaks, nBreaks );
nIndex ++;
}
+ delete anBreaks;
+
ASSERT(nIndex >= 0 && nIndex <= nLength);
pt.x = nIndex;
return pt;
int nOffset = 0;
int nTabSize = GetTabSize ();
//BEGIN SW
- int *anBreaks = (int*)_alloca( sizeof( int ) * nLength );
+ int *anBreaks = new int[nLength];
int nBreaks = 0;
/*if( nLength > GetScreenChars() )*/
for( int J = nBreaks - 1; J >= 0 && nCharIndex < anBreaks[J]; J-- );
nPreBreak = anBreaks[J];
}
+ delete anBreaks;
//END SW
for (int I = 0; I < nCharIndex; I++)
{