summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2004-11-09 15:50:55 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2004-11-09 15:50:55 +0000
commit1857da8fc83165b385c4e2d0fc2577cc416cb0e1 (patch)
tree7a0a3c75030a4939a736744534f7f85a443fa53d
parent9f5334e21de037e4c4cfb85d775f7e0a70049611 (diff)
INTEGRATION: CWS vcl28 (1.12.30); FILE MERGED
2004/10/07 16:32:03 pl 1.12.30.1: #i34799# make CUPSManager fall back to PrinterInfoManager as long as no dests are delivered
-rw-r--r--padmin/source/padialog.cxx36
1 files changed, 24 insertions, 12 deletions
diff --git a/padmin/source/padialog.cxx b/padmin/source/padialog.cxx
index d30c5de7c2d4..ef016a77a029 100644
--- a/padmin/source/padialog.cxx
+++ b/padmin/source/padialog.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: padialog.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: kz $ $Date: 2004-05-18 10:59:50 $
+ * last change: $Author: hr $ $Date: 2004-11-09 16:50:55 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -284,15 +284,27 @@ void PADialog::UpdateDefPrt()
void PADialog::UpdateText()
{
- const PrinterInfo& rInfo = m_rPIManager.getPrinterInfo( getSelectedDevice() );
- String aDriver( rInfo.m_aPrinterName );
- aDriver.AppendAscii( " (" );
- aDriver += String( rInfo.m_aDriverName );
- aDriver.Append( ')' );
- m_aDriver.SetText( aDriver );
- m_aCommand.SetText( rInfo.m_aCommand );
- m_aComment.SetText( rInfo.m_aComment );
- m_aLocation.SetText( rInfo.m_aLocation );
+ OUString aDev( getSelectedDevice() );
+ if( aDev.getLength() )
+ {
+ const PrinterInfo& rInfo = m_rPIManager.getPrinterInfo( aDev );
+ String aDriver( rInfo.m_aPrinterName );
+ aDriver.AppendAscii( " (" );
+ aDriver += String( rInfo.m_aDriverName );
+ aDriver.Append( ')' );
+ m_aDriver.SetText( aDriver );
+ m_aCommand.SetText( rInfo.m_aCommand );
+ m_aComment.SetText( rInfo.m_aComment );
+ m_aLocation.SetText( rInfo.m_aLocation );
+ }
+ else // nothing selected
+ {
+ String aEmpty;
+ m_aDriver.SetText( aEmpty );
+ m_aCommand.SetText( aEmpty );
+ m_aComment.SetText( aEmpty );
+ m_aLocation.SetText( aEmpty );
+ }
}
static Point project( const Point& rPoint )
@@ -447,7 +459,7 @@ void PADialog::PrintTestPage()
{ NULL, RID_TXT_TESTPAGE_TIME }
};
- for( int i = 0; i < sizeof(aResIds)/sizeof(aResIds[0]); i++ )
+ for( unsigned int i = 0; i < sizeof(aResIds)/sizeof(aResIds[0]); i++ )
{
if( aResIds[i].pDirect )
aToken = String::CreateFromAscii( aResIds[i].pDirect );