summaryrefslogtreecommitdiff
path: root/psprint
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2007-07-03 12:59:32 +0000
committerRüdiger Timm <rt@openoffice.org>2007-07-03 12:59:32 +0000
commite0188a81956f6f8639e1789760474b35b0d60832 (patch)
tree07c9cac034e4a1a1e8335cc9329b739a0c1514cc /psprint
parent04e9d69f1dfea29a00c94bedb08d1156b3fffd0d (diff)
INTEGRATION: CWS vcl79 (1.44.2); FILE MERGED
2007/06/19 08:53:21 pl 1.44.2.2: #i78617# work around stderr of shell 2007/06/18 17:21:45 pl 1.44.2.1: #i78617# silence paperconf
Diffstat (limited to 'psprint')
-rw-r--r--psprint/source/printer/printerinfomanager.cxx24
1 files changed, 15 insertions, 9 deletions
diff --git a/psprint/source/printer/printerinfomanager.cxx b/psprint/source/printer/printerinfomanager.cxx
index f90379e1d17b..6ffe8e3b532d 100644
--- a/psprint/source/printer/printerinfomanager.cxx
+++ b/psprint/source/printer/printerinfomanager.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: printerinfomanager.cxx,v $
*
- * $Revision: 1.44 $
+ * $Revision: 1.45 $
*
- * last change: $Author: obo $ $Date: 2007-06-11 14:20:51 $
+ * last change: $Author: rt $ $Date: 2007-07-03 13:59:32 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -145,18 +145,24 @@ void PrinterInfoManager::initSystemDefaultPaper()
bool bSuccess = false;
// try libpaper
- FILE* pPipe = popen( "paperconf", "r" );
+ #ifdef SOLARIS
+ // #i78617# workaround missing paperconf command; on e.g. Linux
+ // the 2>/dev/null works on the started shell also
+ FILE* pPipe = popen( "sh -c paperconf 2>/dev/null", "r" );
+ #else
+ FILE* pPipe = popen( "paperconf 2>/dev/null", "r" );
+ #endif
if( pPipe )
{
char pBuffer[ 1024 ];
- *pBuffer = 0;
+ *pBuffer = 0;
fgets( pBuffer, sizeof(pBuffer)-1, pPipe );
- pclose( pPipe );
+ pclose( pPipe );
- ByteString aPaper( pBuffer );
- aPaper = WhitespaceToSpace( aPaper );
- if( aPaper.Len() )
- {
+ ByteString aPaper( pBuffer );
+ aPaper = WhitespaceToSpace( aPaper );
+ if( aPaper.Len() )
+ {
m_aSystemDefaultPaper = OUString( OStringToOUString( aPaper, osl_getThreadTextEncoding() ) );
bSuccess = true;
#if OSL_DEBUG_LEVEL > 1