aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Document.h
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2013-04-28 09:53:27 +1000
committernyamatongwe <devnull@localhost>2013-04-28 09:53:27 +1000
commitcf77a05fe164e7d8dc9b41d8261f38d75094891e (patch)
tree00a6e959ee720442bc1e4aab36bc2d4e35f9d0ef /src/Document.h
parent8909e16511e850c20780f37c29c40d655ecb5bf8 (diff)
downloadscintilla-mirror-cf77a05fe164e7d8dc9b41d8261f38d75094891e.tar.gz
Use std::vector for list of watchers instead of manual management.
Diffstat (limited to 'src/Document.h')
-rw-r--r--src/Document.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Document.h b/src/Document.h
index 285134503..cb2f00d7a 100644
--- a/src/Document.h
+++ b/src/Document.h
@@ -198,13 +198,14 @@ class Document : PerLine, public IDocumentWithLineEnd, public ILoader {
public:
/** Used to pair watcher pointer with user data. */
- class WatcherWithUserData {
- public:
+ struct WatcherWithUserData {
DocWatcher *watcher;
void *userData;
- WatcherWithUserData() {
- watcher = 0;
- userData = 0;
+ WatcherWithUserData(DocWatcher *watcher_=0, void *userData_=0) :
+ watcher(watcher_), userData(userData_) {
+ }
+ bool operator==(const WatcherWithUserData &other) {
+ return (watcher == other.watcher) && (userData == other.userData);
}
};
@@ -220,8 +221,7 @@ private:
int enteredStyling;
int enteredReadOnlyCount;
- WatcherWithUserData *watchers;
- int lenWatchers;
+ std::vector<WatcherWithUserData> watchers;
// ldSize is not real data - it is for dimensions and loops
enum lineData { ldMarkers, ldLevels, ldState, ldMargin, ldAnnotation, ldSize };