null settings reveal improper ownership bugs which are now fixed, no more luck needed, fixed a missing delete in destructor

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4267 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
shatty 2003-08-10 10:33:36 +00:00
parent 54b7d67454
commit d727a85b3b

View File

@ -51,11 +51,8 @@ StyledEditWindow::StyledEditWindow(BRect frame, entry_ref *ref, uint32 encoding)
StyledEditWindow::~StyledEditWindow()
{
if (fSaveMessage)
delete fSaveMessage;
// if (fPrintSettings)
// delete fPrintSettings;
delete fPrintSettings;
delete fSavePanel;
} /***~StyledEditWindow()***/
@ -1118,13 +1115,13 @@ StyledEditWindow::PageSetup(const char *documentname)
BPrintJob printJob(documentname);
if (fPrintSettings != NULL) {
printJob.SetSettings(fPrintSettings);
fPrintSettings = NULL;
printJob.SetSettings(new BMessage(*fPrintSettings));
}
result = printJob.ConfigPage();
if (result == B_NO_ERROR) {
delete fPrintSettings;
fPrintSettings = printJob.Settings();
}
@ -1144,14 +1141,12 @@ StyledEditWindow::Print(const char *documentname)
}
BPrintJob printJob(documentname);
printJob.SetSettings(fPrintSettings);
fPrintSettings = NULL;
printJob.SetSettings(new BMessage(*fPrintSettings));
result = printJob.ConfigJob();
if (result != B_OK) {
return;
}
// information from printJob
fPrintSettings = printJob.Settings();
BRect paper_rect = printJob.PaperRect();
BRect printable_rect = printJob.PrintableRect();
int32 firstPage = printJob.FirstPage();