aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/LineMarker.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2003-01-03 02:45:30 +0000
committernyamatongwe <unknown>2003-01-03 02:45:30 +0000
commit5374c3fabbc53e567c55cb9546e705b49791a1c7 (patch)
treed3c8c057328f8cbba002e33559f9f608a3bb9fdc /src/LineMarker.cxx
parent4ccb201634926f148ead6154e25b6ebeceb442ab (diff)
downloadscintilla-mirror-5374c3fabbc53e567c55cb9546e705b49791a1c7.tar.gz
Enable text form XPM for autocompletion lists.
Enable line form XPM for markers.
Diffstat (limited to 'src/LineMarker.cxx')
-rw-r--r--src/LineMarker.cxx15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx
index 99e54072f..faf265475 100644
--- a/src/LineMarker.cxx
+++ b/src/LineMarker.cxx
@@ -5,6 +5,7 @@
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
+#include <string.h>
#include <stdlib.h>
#include "Platform.h"
@@ -151,9 +152,17 @@ void LineMarker::RefreshColourPalette(Palette &pal, bool want) {
}
void LineMarker::SetXPM(const char *textForm) {
- delete pxpm;
- pxpm = new XPM(textForm);
- markType = SC_MARK_PIXMAP;
+ // Test done is two parts to avoid possibility of overstepping the memory
+ // if memcmp implemented strangely. Must be 4 bytes at least at destination.
+ if ((0 == memcmp(textForm, "/* X", 4)) && (0 == memcmp(textForm, "/* XPM */", 9))) {
+ // It is in text form
+ delete pxpm;
+ pxpm = new XPM(textForm);
+ markType = SC_MARK_PIXMAP;
+ } else {
+ // It is really in line form
+ SetXPM(reinterpret_cast<const char * const *>(textForm));
+ }
}
void LineMarker::SetXPM(const char * const *linesForm) {