Correct way of modyfing stc.cpp. Thanks Robin for quick guide :-)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30893 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -520,6 +520,7 @@ void wxStyledTextCtrl::MarkerDefineBitmap(int markerNumber, const wxBitmap& bmp)
|
|||||||
buff[len] = 0;
|
buff[len] = 0;
|
||||||
SendMsg(2049, markerNumber, (long)buff);
|
SendMsg(2049, markerNumber, (long)buff);
|
||||||
delete [] buff;
|
delete [] buff;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set a margin to be either numeric or symbolic.
|
// Set a margin to be either numeric or symbolic.
|
||||||
@@ -903,6 +904,7 @@ void wxStyledTextCtrl::RegisterImage(int type, const wxBitmap& bmp) {
|
|||||||
buff[len] = 0;
|
buff[len] = 0;
|
||||||
SendMsg(2405, type, (long)buff);
|
SendMsg(2405, type, (long)buff);
|
||||||
delete [] buff;
|
delete [] buff;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear all the registered images.
|
// Clear all the registered images.
|
||||||
|
@@ -46,7 +46,9 @@ static long wxColourAsLong(const wxColour& co) {
|
|||||||
|
|
||||||
static wxColour wxColourFromLong(long c) {
|
static wxColour wxColourFromLong(long c) {
|
||||||
wxColour clr;
|
wxColour clr;
|
||||||
clr.Set(c & 0xff, (c >> 8) & 0xff, (c >> 16) & 0xff);
|
clr.Set((unsigned char)(c & 0xff),
|
||||||
|
(unsigned char)((c >> 8) & 0xff),
|
||||||
|
(unsigned char)((c >> 16) & 0xff));
|
||||||
return clr;
|
return clr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,7 +62,9 @@ static wxColour wxColourFromSpec(const wxString& spec) {
|
|||||||
spec.Mid(1,2).ToLong(&red, 16);
|
spec.Mid(1,2).ToLong(&red, 16);
|
||||||
spec.Mid(3,2).ToLong(&green, 16);
|
spec.Mid(3,2).ToLong(&green, 16);
|
||||||
spec.Mid(5,2).ToLong(&blue, 16);
|
spec.Mid(5,2).ToLong(&blue, 16);
|
||||||
return wxColour(red, green, blue);
|
return wxColour((unsigned char)red,
|
||||||
|
(unsigned char)green,
|
||||||
|
(unsigned char)blue);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return wxColour(spec);
|
return wxColour(spec);
|
||||||
@@ -377,7 +381,9 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
|
|||||||
if (file.IsOpened())
|
if (file.IsOpened())
|
||||||
{
|
{
|
||||||
wxString contents;
|
wxString contents;
|
||||||
size_t len = (size_t)file.Length();
|
// get the file size (assume it is not huge file...)
|
||||||
|
ssize_t len = (ssize_t)file.Length();
|
||||||
|
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
{
|
{
|
||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
@@ -394,7 +400,12 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (len == 0)
|
||||||
success = true; // empty file is ok
|
success = true; // empty file is ok
|
||||||
|
else
|
||||||
|
success = false; // len == wxInvalidOffset
|
||||||
|
}
|
||||||
|
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
|
@@ -520,6 +520,7 @@ void wxStyledTextCtrl::MarkerDefineBitmap(int markerNumber, const wxBitmap& bmp)
|
|||||||
buff[len] = 0;
|
buff[len] = 0;
|
||||||
SendMsg(2049, markerNumber, (long)buff);
|
SendMsg(2049, markerNumber, (long)buff);
|
||||||
delete [] buff;
|
delete [] buff;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set a margin to be either numeric or symbolic.
|
// Set a margin to be either numeric or symbolic.
|
||||||
@@ -903,6 +904,7 @@ void wxStyledTextCtrl::RegisterImage(int type, const wxBitmap& bmp) {
|
|||||||
buff[len] = 0;
|
buff[len] = 0;
|
||||||
SendMsg(2405, type, (long)buff);
|
SendMsg(2405, type, (long)buff);
|
||||||
delete [] buff;
|
delete [] buff;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear all the registered images.
|
// Clear all the registered images.
|
||||||
|
@@ -46,7 +46,9 @@ static long wxColourAsLong(const wxColour& co) {
|
|||||||
|
|
||||||
static wxColour wxColourFromLong(long c) {
|
static wxColour wxColourFromLong(long c) {
|
||||||
wxColour clr;
|
wxColour clr;
|
||||||
clr.Set(c & 0xff, (c >> 8) & 0xff, (c >> 16) & 0xff);
|
clr.Set((unsigned char)(c & 0xff),
|
||||||
|
(unsigned char)((c >> 8) & 0xff),
|
||||||
|
(unsigned char)((c >> 16) & 0xff));
|
||||||
return clr;
|
return clr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,7 +62,9 @@ static wxColour wxColourFromSpec(const wxString& spec) {
|
|||||||
spec.Mid(1,2).ToLong(&red, 16);
|
spec.Mid(1,2).ToLong(&red, 16);
|
||||||
spec.Mid(3,2).ToLong(&green, 16);
|
spec.Mid(3,2).ToLong(&green, 16);
|
||||||
spec.Mid(5,2).ToLong(&blue, 16);
|
spec.Mid(5,2).ToLong(&blue, 16);
|
||||||
return wxColour(red, green, blue);
|
return wxColour((unsigned char)red,
|
||||||
|
(unsigned char)green,
|
||||||
|
(unsigned char)blue);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return wxColour(spec);
|
return wxColour(spec);
|
||||||
@@ -377,7 +381,9 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
|
|||||||
if (file.IsOpened())
|
if (file.IsOpened())
|
||||||
{
|
{
|
||||||
wxString contents;
|
wxString contents;
|
||||||
size_t len = (size_t)file.Length();
|
// get the file size (assume it is not huge file...)
|
||||||
|
ssize_t len = (ssize_t)file.Length();
|
||||||
|
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
{
|
{
|
||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
@@ -394,7 +400,12 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (len == 0)
|
||||||
success = true; // empty file is ok
|
success = true; // empty file is ok
|
||||||
|
else
|
||||||
|
success = false; // len == wxInvalidOffset
|
||||||
|
}
|
||||||
|
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user