Updated Scintilla to add GetTargetTextRaw (closes #17426).

This commit is contained in:
Paul Kulchenko
2016-05-23 21:37:21 -07:00
parent c03ce59b86
commit 36c5b5f9ca
6 changed files with 38 additions and 0 deletions

View File

@@ -5020,6 +5020,9 @@ public:
// Retrieve the selected text.
wxCharBuffer GetSelectedTextRaw();
// Retrieve the target text.
wxCharBuffer GetTargetTextRaw();
// Retrieve a range of text.
wxCharBuffer GetTextRangeRaw(int startPos, int endPos);

View File

@@ -6357,6 +6357,11 @@ public:
*/
wxCharBuffer GetSelectedTextRaw();
/**
Retrieve the target text.
*/
wxCharBuffer GetTargetTextRaw();
/**
Retrieve a range of text.
*/

View File

@@ -5009,6 +5009,17 @@ wxCharBuffer wxStyledTextCtrl::GetSelectedTextRaw()
return buf;
}
wxCharBuffer wxStyledTextCtrl::GetTargetTextRaw()
{
// Calculate the length needed first.
const int len = SendMsg(SCI_GETTARGETEND, 0, 0) - SendMsg(SCI_GETTARGETSTART, 0, 0);
// And then really get the data.
wxCharBuffer buf(len);
SendMsg(SCI_GETTARGETTEXT, 0, (sptr_t)buf.data());
return buf;
}
wxCharBuffer wxStyledTextCtrl::GetTextRangeRaw(int startPos, int endPos)
{
if (endPos < startPos) {

View File

@@ -715,6 +715,17 @@ wxCharBuffer wxStyledTextCtrl::GetSelectedTextRaw()
return buf;
}
wxCharBuffer wxStyledTextCtrl::GetTargetTextRaw()
{
// Calculate the length needed first.
const int len = SendMsg(SCI_GETTARGETEND, 0, 0) - SendMsg(SCI_GETTARGETSTART, 0, 0);
// And then really get the data.
wxCharBuffer buf(len);
SendMsg(SCI_GETTARGETTEXT, 0, (sptr_t)buf.data());
return buf;
}
wxCharBuffer wxStyledTextCtrl::GetTextRangeRaw(int startPos, int endPos)
{
if (endPos < startPos) {

View File

@@ -273,6 +273,9 @@ public:
// Retrieve the selected text.
wxCharBuffer GetSelectedTextRaw();
// Retrieve the target text.
wxCharBuffer GetTargetTextRaw();
// Retrieve a range of text.
wxCharBuffer GetTextRangeRaw(int startPos, int endPos);

View File

@@ -342,6 +342,11 @@ public:
*/
wxCharBuffer GetSelectedTextRaw();
/**
Retrieve the target text.
*/
wxCharBuffer GetTargetTextRaw();
/**
Retrieve a range of text.
*/