aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Document.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2017-04-22 09:16:08 +1000
committerNeil <nyamatongwe@gmail.com>2017-04-22 09:16:08 +1000
commitb201e09daf251a0e3e5576b79643f6c4f841a4a9 (patch)
treebc7d0caf7e5a4d0635b7ee7ba593f4ee830a6072 /src/Document.cxx
parent0801e0084a5cf87f424235d5947f5158474d5da4 (diff)
downloadscintilla-mirror-b201e09daf251a0e3e5576b79643f6c4f841a4a9.tar.gz
Using unique_ptr to simplify ownership of images, case folder, and list box.
Diffstat (limited to 'src/Document.cxx')
-rw-r--r--src/Document.cxx12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/Document.cxx b/src/Document.cxx
index b4ab37244..581358e52 100644
--- a/src/Document.cxx
+++ b/src/Document.cxx
@@ -95,7 +95,6 @@ int LexInterface::LineEndTypesSupported() {
Document::Document() {
refCount = 0;
- pcf = NULL;
#ifdef _WIN32
eolMode = SC_EOL_CRLF;
#else
@@ -118,7 +117,6 @@ Document::Document() {
durationStyleOneLine = 0.00001;
matchesValid = false;
- regex = 0;
UTF8BytesOfLeadInitialise();
@@ -139,9 +137,6 @@ Document::~Document() {
delete pl;
pl = nullptr;
}
- regex.release();
- delete pcf;
- pcf = 0;
}
void Document::Init() {
@@ -161,7 +156,7 @@ int Document::LineEndTypesSupported() const {
bool Document::SetDBCSCodePage(int dbcsCodePage_) {
if (dbcsCodePage != dbcsCodePage_) {
dbcsCodePage = dbcsCodePage_;
- SetCaseFolder(NULL);
+ SetCaseFolder(nullptr);
cb.SetLineEndTypes(lineEndBitSet & LineEndTypesSupported());
return true;
} else {
@@ -1802,12 +1797,11 @@ bool Document::MatchesWordOptions(bool word, bool wordStart, Sci::Position pos,
}
bool Document::HasCaseFolder() const {
- return pcf != 0;
+ return pcf != nullptr;
}
void Document::SetCaseFolder(CaseFolder *pcf_) {
- delete pcf;
- pcf = pcf_;
+ pcf.reset(pcf_);
}
Document::CharacterExtracted Document::ExtractCharacter(Sci::Position position) const {