summaryrefslogtreecommitdiffstats
path: root/win/tkWinGDI.c
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2021-05-11 14:23:39 (GMT)
committerKevin Walzer <kw@codebykevin.com>2021-05-11 14:23:39 (GMT)
commitfd1203830ab296fbe4f8418f64c49a0fd84f3c0d (patch)
treee94011de0245577458d1aa9278f3e5aa5713bfed /win/tkWinGDI.c
parenteb310d37135b849847f7f7e28b9fa68dc25ca0da (diff)
downloadtk-fd1203830ab296fbe4f8418f64c49a0fd84f3c0d.zip
tk-fd1203830ab296fbe4f8418f64c49a0fd84f3c0d.tar.gz
tk-fd1203830ab296fbe4f8418f64c49a0fd84f3c0d.tar.bz2
Make sure printDC is set throughout this file
Diffstat (limited to 'win/tkWinGDI.c')
-rw-r--r--win/tkWinGDI.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/win/tkWinGDI.c b/win/tkWinGDI.c
index deec192..d394dad 100644
--- a/win/tkWinGDI.c
+++ b/win/tkWinGDI.c
@@ -255,6 +255,8 @@ static int GdiArc(
return TCL_ERROR;
}
+ hDC = printDC;
+
x1 = atoi(argv[1]);
y1 = atoi(argv[2]);
x2 = atoi(argv[3]);
@@ -483,6 +485,8 @@ static int GdiPhoto(
return TCL_ERROR;
}
+ dst = printDC;
+
/*
* Next, check to see if 'dst' can support BitBlt.
* If not, raise an error.
@@ -753,6 +757,8 @@ static int GdiLine(
return TCL_ERROR;
}
+ hDC = printDC;
+
if ( (polypoints = (POINT *)Tcl_Alloc(argc * sizeof(POINT))) == 0 )
{
Tcl_AppendResult(interp, "Out of memory in GdiLine", NULL);
@@ -1075,6 +1081,8 @@ static int GdiOval(
return TCL_ERROR;
}
+ hDC = printDC;
+
x1 = atol(argv[1]);
y1 = atol(argv[2]);
x2 = atol(argv[3]);
@@ -1208,6 +1216,8 @@ static int GdiPolygon(
return TCL_ERROR;
}
+ hDC = printDC;
+
if ( (polypoints = (POINT *)Tcl_Alloc(argc * sizeof(POINT))) == 0 )
{
Tcl_AppendResult(interp, "Out of memory in GdiLine", NULL);
@@ -1390,6 +1400,8 @@ static int GdiRectangle(
return TCL_ERROR;
}
+ hDC = printDC;
+
x1 = atol(argv[1]);
y1 = atol(argv[2]);
x2 = atol(argv[3]);
@@ -1521,6 +1533,8 @@ static int GdiCharWidths(
return TCL_ERROR;
}
+ hDC = printDC;
+
argc--;
argv++;
@@ -1670,6 +1684,8 @@ int GdiText(
return TCL_ERROR;
}
+ hDC = printDC;
+
x = atol(argv[1]);
y = atol(argv[2]);
argc -= 3;
@@ -2099,6 +2115,8 @@ static int GdiMap(
return TCL_ERROR;
}
+ hDC = printDC;
+
if ( (mapmode = GdiGetHdcInfo(hdc, &worigin, &wextent, &vorigin, &vextent)) == 0 )
{
/* Failed!. */
@@ -2346,6 +2364,8 @@ static int GdiCopyBits (
return TCL_ERROR;
}
+ dst = printDC;
+
/*
* Next, check to see if 'dst' can support BitBlt.
* If not, raise an error.
@@ -4639,13 +4659,12 @@ static int PalEntriesOnDevice(HDC hDC)
static HDC get_dc(Tcl_Interp *interp)
{
- /*
+ /*
* Check for valid DC, create or restore as needed.
*/
if (printDC == NULL) {
printDC = CreateDC (driver, printerName, output, returnedDevmode);
-
- }
+ }
DWORD objtype = GetObjectType((HGDIOBJ)printDC);
if (objtype = OBJ_DC) {