From e59c7b66eaee45895be4e9e66d4cc30dc22277e1 Mon Sep 17 00:00:00 2001 From: shatty Date: Sun, 27 Jul 2003 07:36:49 +0000 Subject: [PATCH] fixed annoying print before page setup aborts print bug git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4105 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/stylededit/StyledEditWindow.cpp | 31 +++++++++++------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/src/apps/stylededit/StyledEditWindow.cpp b/src/apps/stylededit/StyledEditWindow.cpp index 6886638232..831fe286ee 100644 --- a/src/apps/stylededit/StyledEditWindow.cpp +++ b/src/apps/stylededit/StyledEditWindow.cpp @@ -1036,22 +1036,20 @@ StyledEditWindow::RevertToSaved() status_t StyledEditWindow::PageSetup(const char *documentname) { - status_t result= B_ERROR; + status_t result = B_OK; BPrintJob printJob(documentname); - if (fPrintSettings!= NULL) + if (fPrintSettings != NULL) { printJob.SetSettings(fPrintSettings); - //else - //; ///?? + } + + result = printJob.ConfigPage(); - result= printJob.ConfigPage(); - - if (result== B_NO_ERROR){ -// delete fPrintSettings; - fPrintSettings= printJob.Settings(); + if (result == B_NO_ERROR) { + fPrintSettings = printJob.Settings(); } - + return result; }/***StyledEditWindow::PageSetup()***/ @@ -1059,17 +1057,16 @@ void StyledEditWindow::Print(const char *documentname) { status_t result = B_OK; - BPrintJob printJob(documentname); - + if (fPrintSettings == NULL) { - result = PageSetup(fTextView->Window()->Title()); - if (result != B_NO_ERROR) { + result = PageSetup(documentname); + if (result != B_OK) { return; } - } else { - printJob.SetSettings(fPrintSettings); - } + } + BPrintJob printJob(documentname); + printJob.SetSettings(fPrintSettings); result = printJob.ConfigJob(); if (result != B_OK) { return;