diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2003-04-11 14:54:51 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2003-04-11 14:54:51 +0000 |
commit | 9f534f060c781e20d0ea658090923f1fbfd07640 (patch) | |
tree | e41c244c44c611a9024ad7d65e3f84b7ae52e3e9 | |
parent | 49d2042f21ffaf619b1eb6eae64a92392acf9cf6 (diff) |
INTEGRATION: CWS vcl07 (1.12.8.2.18); FILE MERGED
2003/04/03 10:28:11 cd 1.12.8.2.18.1: #i6367# Update OK button state when printer changes
-rw-r--r-- | sfx2/source/view/viewprn.cxx | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index b907b3a217e9..5af68c2e4fc8 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -2,9 +2,9 @@ * * $RCSfile: viewprn.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: hr $ $Date: 2003-03-27 11:29:26 $ + * last change: $Author: vg $ $Date: 2003-04-11 15:54:51 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -416,10 +416,13 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) if( !pPrinter || !pPrinter->IsValid() ) { // no valid printer either in ItemSet or at the document - if ( !bSilent ) + if ( bSilent ) + { + rReq.SetReturnValue(SfxBoolItem(0,FALSE)); + return; + } + else ErrorBox( NULL, WB_OK | WB_DEF_OK, String( SfxResId( STR_NODEFPRINTER ) ) ).Execute(); - rReq.SetReturnValue(SfxBoolItem(0,FALSE)); - return; } if ( !pPrinter->IsOriginal() && rReq.GetArgs() && !UseStandardPrinter_Impl( NULL, pPrinter ) ) @@ -651,6 +654,14 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) if ( !pPrinter ) pPrinter = GetPrinter(TRUE); + if( !pPrinter->IsValid() ) + { + // redirect slot to call the print dialog if the document's printer is not valid! + rReq.SetSlot( SID_PRINTDOC ); + ExecPrint_Impl( rReq ); + return; + } + if( pPrinter->IsOriginal() && pPrinter->GetName() != Printer::GetDefaultPrinterName() ) { // redirect slot to call the print dialog if the document's printer is available but not system default |