From e9280bf01239e81b01899992647766d0c073253b Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 19 Oct 2022 13:36:08 +1100 Subject: Feature [feature-requests:#1455] Implement GetStyledTextFull as a 64-bit safe version of GetStyledText. --- doc/ScintillaDoc.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'doc/ScintillaDoc.html') diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index fb5d59dfd..f9a973892 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -536,6 +536,7 @@ SCI_GETSTYLEAT(position pos) → int
SCI_GETSTYLEINDEXAT(position pos) → int
SCI_GETSTYLEDTEXT(<unused>, Sci_TextRange *tr) → position
+ SCI_GETSTYLEDTEXTFULL(<unused>, Sci_TextRangeFull *tr) → position
SCI_RELEASEALLEXTENDEDSTYLES
SCI_ALLOCATEEXTENDEDSTYLES(int numberStyles) → int
SCI_TARGETASUTF8(<unused>, char *s) → position
@@ -623,15 +624,19 @@ SCI_GETSTYLEDTEXT, SCI_GETTEXT

-

SCI_GETSTYLEDTEXT(<unused>, Sci_TextRange *tr) → position
+

+ SCI_GETSTYLEDTEXT(<unused>, Sci_TextRange *tr) → position
+ SCI_GETSTYLEDTEXTFULL(<unused>, Sci_TextRangeFull *tr) → position
This collects styled text into a buffer using two bytes for each cell, with the character at the lower address of each pair and the style byte at the upper address. Characters between the positions cpMin and cpMax are copied to lpstrText (see - struct Sci_TextRange in Scintilla.h). Two 0 bytes are added to the end of + struct Sci_TextRange and struct Sci_TextRangeFull in Scintilla.h). Two 0 bytes are added to the end of the text, so the buffer that lpstrText points at must be at least 2*(cpMax-cpMin)+2 bytes long. No check is made for sensible values of cpMin or cpMax. Positions outside the document return character codes and style bytes of 0.

+

SCI_GETSTYLEDTEXTFULL uses 64-bit positions on all platforms so is safe for documents larger than 2GB. + It should always be used in preference to SCI_GETSTYLEDTEXT which will be deprecated in a future release.

See also: SCI_GETSELTEXT, SCI_GETLINE, -- cgit v1.2.3