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
This commit is contained in:
parent
04e9d69f1d
commit
e0188a8195
1 changed files with 15 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue