summaryrefslogtreecommitdiff
path: root/psprint
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2006-08-11 16:41:43 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2006-08-11 16:41:43 +0000
commit83bfe106d9b993b72c01712120498036103d9f04 (patch)
tree84a078ae8a68d7598b269fd01ca944f92b5d46da /psprint
parenta8f9fef0e53cd4ed1a218ec244ba2a3ab8d2ab44 (diff)
INTEGRATION: CWS svp01 (1.67.6); FILE MERGED
2006/06/27 11:37:22 pl 1.67.6.2: RESYNC: (1.67-1.70); FILE MERGED 2006/06/09 13:19:34 pl 1.67.6.1: #135265# do not open an X connection in headless case
Diffstat (limited to 'psprint')
-rw-r--r--psprint/source/fontmanager/fontmanager.cxx21
1 files changed, 18 insertions, 3 deletions
diff --git a/psprint/source/fontmanager/fontmanager.cxx b/psprint/source/fontmanager/fontmanager.cxx
index ecf1997cf77b..512ec12f2b66 100644
--- a/psprint/source/fontmanager/fontmanager.cxx
+++ b/psprint/source/fontmanager/fontmanager.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: fontmanager.cxx,v $
*
- * $Revision: 1.70 $
+ * $Revision: 1.71 $
*
- * last change: $Author: hr $ $Date: 2006-06-19 10:24:03 $
+ * last change: $Author: hr $ $Date: 2006-08-11 17:41:43 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -2146,7 +2146,22 @@ void PrintFontManager::initialize( void* pInitDisplay )
Display *pDisplay = (Display*)pInitDisplay;
if( ! pDisplay )
- pDisplay = XOpenDisplay( NULL );
+ {
+ int nParams = osl_getCommandArgCount();
+ OUString aParam;
+ bool bIsHeadless = false;
+ for( int i = 0; i < nParams; i++ )
+ {
+ osl_getCommandArg( i, &aParam.pData );
+ if( aParam.equalsAscii( "-headless" ) )
+ {
+ bIsHeadless = true;
+ break;
+ }
+ }
+ if( ! bIsHeadless )
+ pDisplay = XOpenDisplay( NULL );
+ }
if( pDisplay )
{