aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2002-02-03 01:02:22 +0000
committernyamatongwe <unknown>2002-02-03 01:02:22 +0000
commite28676e3fa6cf50b7891ba9c0a1db713ed8f78a8 (patch)
tree13a6af966216ecbd30a7eaf8b1a18d78979f90c7
parent9ff488f2b820009a716396d90302c40547a34c9b (diff)
downloadscintilla-mirror-e28676e3fa6cf50b7891ba9c0a1db713ed8f78a8.tar.gz
When changing document, ensured rewrap performed.
Made memory allocation a little safer in ContractionState.
-rw-r--r--src/ContractionState.cxx10
-rw-r--r--src/Editor.cxx1
2 files changed, 7 insertions, 4 deletions
diff --git a/src/ContractionState.cxx b/src/ContractionState.cxx
index 3d2dde3c6..aadf98ed9 100644
--- a/src/ContractionState.cxx
+++ b/src/ContractionState.cxx
@@ -44,12 +44,14 @@ void ContractionState::MakeValid() const {
}
if (sizeDocLines < linesInDisplay) {
delete []docLines;
- docLines = new int[linesInDisplay + growSize];
- if (docLines) {
- sizeDocLines = linesInDisplay + growSize;
- } else {
+ int *docLinesNew = new int[linesInDisplay + growSize];
+ if (!docLinesNew) {
+ docLines = 0;
+ sizeDocLines = 0;
return;
}
+ docLines = docLinesNew;
+ sizeDocLines = linesInDisplay + growSize;
}
int lineInDisplay=0;
diff --git a/src/Editor.cxx b/src/Editor.cxx
index e8086770e..461460f69 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -3685,6 +3685,7 @@ void Editor::SetDocPointer(Document *document) {
// Reset the contraction state to fully shown.
cs.Clear();
cs.InsertLines(0, pdoc->LinesTotal() - 1);
+ NeedWrapping();
pdoc->AddWatcher(this, 0);
Redraw();