From 657dbfccd617711db443ec25f84ab918698814b8 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 16 Jan 2004 00:52:17 +0000 Subject: [PATCH] Patch [ 877891 ] Share the DC from DoPaint with FullPaint in ScintillaWX git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25202 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/src/stc/ScintillaWX.cpp | 14 +++++++------- contrib/src/stc/ScintillaWX.h | 2 +- src/stc/ScintillaWX.cpp | 14 +++++++------- src/stc/ScintillaWX.h | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/contrib/src/stc/ScintillaWX.cpp b/contrib/src/stc/ScintillaWX.cpp index 1fbbf77860..26e966cf36 100644 --- a/contrib/src/stc/ScintillaWX.cpp +++ b/contrib/src/stc/ScintillaWX.cpp @@ -528,7 +528,7 @@ void ScintillaWX::DoPaint(wxDC* dc, wxRect rect) { delete surfaceWindow; if (paintState == paintAbandoned) { // Painting area was insufficient to cover new styling or brace highlight positions - FullPaint(); + FullPaint(dc); } paintState = notPainting; } @@ -833,18 +833,18 @@ void ScintillaWX::DoDragLeave() { //---------------------------------------------------------------------- // Redraw all of text area. This paint will not be abandoned. -void ScintillaWX::FullPaint() { +void ScintillaWX::FullPaint(wxDC *dc) { + wxCHECK_RET(dc != NULL, wxT("Invalid wxDC in ScintillaWX::FillPaint")); paintState = painting; rcPaint = GetClientRectangle(); paintingAllText = true; - wxClientDC dc(stc); Surface* surfaceWindow = Surface::Allocate(); - surfaceWindow->Init(&dc, wMain.GetID()); + surfaceWindow->Init(dc, wMain.GetID()); - dc.BeginDrawing(); - ClipChildren(dc, rcPaint); + dc->BeginDrawing(); + ClipChildren(*dc, rcPaint); Paint(surfaceWindow, rcPaint); - dc.EndDrawing(); + dc->EndDrawing(); delete surfaceWindow; paintState = notPainting; diff --git a/contrib/src/stc/ScintillaWX.h b/contrib/src/stc/ScintillaWX.h index d0d383d507..799e58ed5a 100644 --- a/contrib/src/stc/ScintillaWX.h +++ b/contrib/src/stc/ScintillaWX.h @@ -156,7 +156,7 @@ public: // helpers - void FullPaint(); + void FullPaint(wxDC *dc); bool CanPaste(); bool GetHideSelection() { return hideSelection; } void DoScrollToLine(int line); diff --git a/src/stc/ScintillaWX.cpp b/src/stc/ScintillaWX.cpp index 1fbbf77860..26e966cf36 100644 --- a/src/stc/ScintillaWX.cpp +++ b/src/stc/ScintillaWX.cpp @@ -528,7 +528,7 @@ void ScintillaWX::DoPaint(wxDC* dc, wxRect rect) { delete surfaceWindow; if (paintState == paintAbandoned) { // Painting area was insufficient to cover new styling or brace highlight positions - FullPaint(); + FullPaint(dc); } paintState = notPainting; } @@ -833,18 +833,18 @@ void ScintillaWX::DoDragLeave() { //---------------------------------------------------------------------- // Redraw all of text area. This paint will not be abandoned. -void ScintillaWX::FullPaint() { +void ScintillaWX::FullPaint(wxDC *dc) { + wxCHECK_RET(dc != NULL, wxT("Invalid wxDC in ScintillaWX::FillPaint")); paintState = painting; rcPaint = GetClientRectangle(); paintingAllText = true; - wxClientDC dc(stc); Surface* surfaceWindow = Surface::Allocate(); - surfaceWindow->Init(&dc, wMain.GetID()); + surfaceWindow->Init(dc, wMain.GetID()); - dc.BeginDrawing(); - ClipChildren(dc, rcPaint); + dc->BeginDrawing(); + ClipChildren(*dc, rcPaint); Paint(surfaceWindow, rcPaint); - dc.EndDrawing(); + dc->EndDrawing(); delete surfaceWindow; paintState = notPainting; diff --git a/src/stc/ScintillaWX.h b/src/stc/ScintillaWX.h index d0d383d507..799e58ed5a 100644 --- a/src/stc/ScintillaWX.h +++ b/src/stc/ScintillaWX.h @@ -156,7 +156,7 @@ public: // helpers - void FullPaint(); + void FullPaint(wxDC *dc); bool CanPaste(); bool GetHideSelection() { return hideSelection; } void DoScrollToLine(int line); -- 2.45.2