Commit 487b4a3c authored by Martin Wierich's avatar Martin Wierich
Browse files

bugfix

parent d5ba91c0
......@@ -288,6 +288,10 @@ void printSetup(int calledFromCleanThread, int devmodeSize,
// Open print dialog
*ok = PrintDlg(&pd);
*pdPtr = &pd;
if (hDevnames!=pd.hDevNames) LocalFree(hDevnames);
if (hDevmode!=pd.hDevMode) LocalFree(hDevmode);
}
......@@ -378,6 +382,7 @@ void getDC( int doDialog, int emulateScreen, int calledFromCleanThread, int devm
{
static PRINTDLG pd;
HDC hdcPrint;
int ok;
*err = -1;
......@@ -421,12 +426,19 @@ void getDC( int doDialog, int emulateScreen, int calledFromCleanThread, int devm
// Open print dialog
if (!PrintDlg(&pd))
{
*err = CommDlgExtendedError(); // will return 0 iff user canceled
return; // otherwise a positive value
}
ok = PrintDlg(&pd);
if (hDevnames!=pd.hDevNames) LocalFree(hDevnames);
if (hDevmode!=pd.hDevMode) LocalFree(hDevmode);
if (!ok)
{
*err = CommDlgExtendedError(); // will return 0 iff user canceled, otherwise positive value
release_memory_handles(&pd, 0);
return;
}
if (pd.Flags & PD_PAGENUMS)
{ *first = pd.nFromPage;
*last = pd.nToPage;
......@@ -440,8 +452,7 @@ void getDC( int doDialog, int emulateScreen, int calledFromCleanThread, int devm
hdcPrint = pd.hDC;
}
else // get dc for default printer
// This method searches in the WIN.INI file for th default printer name.
else
{
hdcPrint = CreateDC(driver, device, output, NULL);
......@@ -452,6 +463,7 @@ void getDC( int doDialog, int emulateScreen, int calledFromCleanThread, int devm
*first = 1;
*last = 9999;
*copies = 1;
*ppPrintDlg = NULL;
};
if (emulateScreen)
......
......@@ -2,9 +2,8 @@ implementation module osprint
// Clean Standard Object I/O library, version 1.2
// MW11 was import StdEnv,intrface,clCrossCall_12, iostate, scheduler
import StdEnv,clCCall_12,clCrossCall_12, iostate, scheduler
import ospicture, osevent/*, StdPicture*/, StdWindow, StdPSt
import ospicture, osevent, StdWindow, StdPSt
:: PrintSetup
= { devmode :: !String
......@@ -176,7 +175,6 @@ printPagePerPageBoth doDialog emulateScreen x initFun transFun printSetup mb_con
# picture = initPicture zeroOrigin (hdc,os)
(endOrig,(initState,picture)) = initFun x printInfo picture
// MW11 was (_,_,hdc,os) = unpackPicture picture
(_,_,_,hdc,os) = unpackPicture picture
// now print all pages
......@@ -207,7 +205,6 @@ printPages pageNr fun (_,origin) state hdc mb_context os
// apply drawfunctions contained in this page
((endOfDoc,nextOrigin),(state`,picture)) = fun (state,picture)
// finish drawing
// MW11 was # (_,_,hdc,os) = unpackPicture picture
# (_,_,_,hdc,os) = unpackPicture picture
(ok, os) = endPage hdc os
// (not ok) should not cause an abort, because endPage returns an error, when user chooses
......@@ -239,7 +236,6 @@ getPrintInfo doDialog emulateScreen {devmode, device, driver, output} mb_context
# (setup_strings, os) = get_printSetup_with_PRINTDLG pdPtr os
os = release_memory_handles pdPtr os
= continuation err data mb_context (setup_strings, os)
# os = release_memory_handles pdPtr os
= continuation err data mb_context ((devmode,device,driver,output),os)
where
continuation err (first,last,copies,hdc) mb_context ((devmode,device,driver,output),os)
......@@ -261,7 +257,6 @@ handleContextOSEvent` :: !OSEvent !Context !*OSToolbox -> (!CrossCallInfo,!Conte
handleContextOSEvent` osEvent context tb
# (return,context) = handleContextOSEvent osEvent context
= (setReplyInOSEvent return,context,tb)
// MW11 was = (replytocrosscallinfo return,context,tb)
CCgetDC :: !.Int !.Int !.Int !.Int !.Int !.Int !.Int !*(Maybe !*Context) !*OSToolbox -> *(!Int,!(!Int,!Int,!Int,!Int),!Int,!*Maybe *Context,!.OSToolbox);
......@@ -331,7 +326,6 @@ evtlSwitchToOS pageNr hdc (Just context) os
initPicture :: !.Origin !*(!.OSPictContext,!*OSToolbox) -> !.Picture
initPicture origin intPict
// MW11 was = packPicture origin defaultPen (fst intPict) (snd intPict)
= packPicture origin defaultPen False (fst intPict) (snd intPict)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment