{
CPoint originalOrigin = ptOrigin;
CRect frect = rcClip;
- const int nLineLength = GetLineLength( ptTextPos.y );
+ const int nLineLength = GetViewableLineLength( ptTextPos.y );
const int nLineHeight = GetLineHeight();
frect.top = ptOrigin.y;
COLORREF crBkgnd, crText;
GetLineColors (nLineIndex, crBkgnd, crText, bDrawWhitespace);
- int nLength = GetLineLength (nLineIndex);
+ int nLength = GetViewableLineLength (nLineIndex);
LPCTSTR pszChars = GetLineChars (nLineIndex);
- if (m_bViewEols)
- { // Display EOL (end of line) characters too
- nLength = GetFullLineLength(nLineIndex);
- }
// Parse the line
DWORD dwCookie = GetParseCookie (nLineIndex - 1);
return m_pTextBuffer->GetFullLineLength (nLineIndex);
}
+// How many bytes of line are displayed on-screen?
+int CCrystalTextView::
+GetViewableLineLength (int nLineIndex) const
+{
+ if (m_bViewEols)
+ return GetFullLineLength(nLineIndex);
+ else
+ return GetLineLength(nLineIndex);
+}
+
LPCTSTR CCrystalTextView::
GetLineChars (int nLineIndex) const
{
{
ASSERT (m_nTopLine >= 0 && m_nOffsetChar >= 0);
ASSERT (point.y >= 0 && point.y < GetLineCount ());
- ASSERT (point.x >= 0 && point.x <= GetLineLength (point.y));
+ ASSERT (point.x >= 0 && point.x <= GetViewableLineLength (point.y));
}
}
#endif
public:
virtual int GetLineLength (int nLineIndex) const;
virtual int GetFullLineLength (int nLineIndex) const;
+ virtual int GetViewableLineLength(int nLineIndex) const;
virtual int GetLineActualLength (int nLineIndex);
virtual LPCTSTR GetLineChars (int nLineIndex) const;
protected:
+2005-03-06 Perry
+ PATCH: [ 1157524 ] Fix view line length
+ editlib: ccrystaltextview.cpp ccrystaltextview.h
+
2005-03-05 Perry
Rename CDirFrame::SetFilter to CDirFrame::SetFilterStatusDisplay for easier greps.
Src: DirDoc.cpp DirFrame.cpp DirFrame.h