EnsureValidMessenger returns a boolean value now. Fixed indentation
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16446 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2001-2005, Haiku.
|
* Copyright 2001-2006, Haiku.
|
||||||
* Distributed under the terms of the MIT license.
|
* Distributed under the terms of the MIT license.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
static BMessenger *sPrintServer = NULL;
|
static BMessenger *sPrintServer = NULL;
|
||||||
|
|
||||||
|
|
||||||
static void
|
static bool
|
||||||
EnsureValidMessenger()
|
EnsureValidMessenger()
|
||||||
{
|
{
|
||||||
if (sPrintServer == NULL)
|
if (sPrintServer == NULL)
|
||||||
@@ -37,6 +37,8 @@ EnsureValidMessenger()
|
|||||||
|
|
||||||
if (!sPrintServer->IsValid())
|
if (!sPrintServer->IsValid())
|
||||||
*sPrintServer = BMessenger(PSRV_SIGNATURE_TYPE);
|
*sPrintServer = BMessenger(PSRV_SIGNATURE_TYPE);
|
||||||
|
|
||||||
|
return sPrintServer->IsValid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -109,7 +111,9 @@ BPrintJob::CommitJob()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
EnsureValidMessenger();
|
if (!EnsureValidMessenger())
|
||||||
|
return;
|
||||||
|
|
||||||
BMessage *message = new BMessage(PSRV_GET_ACTIVE_PRINTER);
|
BMessage *message = new BMessage(PSRV_GET_ACTIVE_PRINTER);
|
||||||
BMessage *reply = new BMessage;
|
BMessage *reply = new BMessage;
|
||||||
|
|
||||||
@@ -313,7 +317,9 @@ BPrintJob::LastPage()
|
|||||||
int32
|
int32
|
||||||
BPrintJob::PrinterType(void *) const
|
BPrintJob::PrinterType(void *) const
|
||||||
{
|
{
|
||||||
EnsureValidMessenger();
|
|
||||||
|
if (!EnsureValidMessenger())
|
||||||
|
return B_COLOR_PRINTER; // default
|
||||||
|
|
||||||
BMessage message(PSRV_GET_ACTIVE_PRINTER);
|
BMessage message(PSRV_GET_ACTIVE_PRINTER);
|
||||||
BMessage reply;
|
BMessage reply;
|
||||||
@@ -420,7 +426,8 @@ BPrintJob::AddPicture(BPicture *picture, BRect *rect, BPoint where)
|
|||||||
char *
|
char *
|
||||||
BPrintJob::GetCurrentPrinterName() const
|
BPrintJob::GetCurrentPrinterName() const
|
||||||
{
|
{
|
||||||
EnsureValidMessenger();
|
if (!EnsureValidMessenger())
|
||||||
|
return NULL;
|
||||||
|
|
||||||
BMessage message(PSRV_GET_ACTIVE_PRINTER);
|
BMessage message(PSRV_GET_ACTIVE_PRINTER);
|
||||||
BMessage reply;
|
BMessage reply;
|
||||||
@@ -437,7 +444,9 @@ BPrintJob::GetCurrentPrinterName() const
|
|||||||
void
|
void
|
||||||
BPrintJob::LoadDefaultSettings()
|
BPrintJob::LoadDefaultSettings()
|
||||||
{
|
{
|
||||||
EnsureValidMessenger();
|
if (!EnsureValidMessenger())
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
BMessage message(PSRV_GET_DEFAULT_SETTINGS);
|
BMessage message(PSRV_GET_DEFAULT_SETTINGS);
|
||||||
BMessage *reply = new BMessage;
|
BMessage *reply = new BMessage;
|
||||||
|
|||||||
Reference in New Issue
Block a user