summaryrefslogtreecommitdiff
path: root/psprint
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2003-07-01 13:52:08 +0000
committerVladimir Glazounov <vg@openoffice.org>2003-07-01 13:52:08 +0000
commita834ee2ee10724412c8727f1f0734f5061e147f3 (patch)
tree7e832060f5f0ab9da81a40a6d845258e6e730716 /psprint
parent3acce2e5dc43c508a4ca0ffb93643abd147b3bec (diff)
INTEGRATION: CWS vcl14 (1.37.8); FILE MERGED
2003/06/30 12:20:43 pl 1.37.8.1: #110445# XOpenDisplay may fail
Diffstat (limited to 'psprint')
-rw-r--r--psprint/source/fontmanager/fontmanager.cxx54
1 files changed, 28 insertions, 26 deletions
diff --git a/psprint/source/fontmanager/fontmanager.cxx b/psprint/source/fontmanager/fontmanager.cxx
index 90f237f67043..b5026ae1270e 100644
--- a/psprint/source/fontmanager/fontmanager.cxx
+++ b/psprint/source/fontmanager/fontmanager.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fontmanager.cxx,v $
*
- * $Revision: 1.38 $
+ * $Revision: 1.39 $
*
- * last change: $Author: hr $ $Date: 2003-06-30 14:26:22 $
+ * last change: $Author: vg $ $Date: 2003-07-01 14:52:08 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1680,35 +1680,37 @@ void PrintFontManager::initialize( void* pInitDisplay )
if( ! pDisplay )
pDisplay = XOpenDisplay( NULL );
-
- // get font paths to look for fonts
- int nPaths = 0, i;
- char** pPaths = XGetFontPath( pDisplay, &nPaths );
-
- int nPos = 0;
- bool bServerDirs = false;
- for( i = 0; i < nPaths; i++ )
+ if( pDisplay )
{
- ByteString aPath( pPaths[i] );
- if( ! bServerDirs
- && ( nPos = aPath.Search( ':' ) ) != STRING_NOTFOUND
- && ( !aPath.Equals( ":unscaled", nPos, 9 ) ) )
- {
- bServerDirs = true;
- getServerDirectories();
- }
- else
+ // get font paths to look for fonts
+ int nPaths = 0, i;
+ char** pPaths = XGetFontPath( pDisplay, &nPaths );
+
+ int nPos = 0;
+ bool bServerDirs = false;
+ for( i = 0; i < nPaths; i++ )
{
- normPath( aPath );
- m_aFontDirectories.push_back( aPath );
+ ByteString aPath( pPaths[i] );
+ if( ! bServerDirs
+ && ( nPos = aPath.Search( ':' ) ) != STRING_NOTFOUND
+ && ( !aPath.Equals( ":unscaled", nPos, 9 ) ) )
+ {
+ bServerDirs = true;
+ getServerDirectories();
+ }
+ else
+ {
+ normPath( aPath );
+ m_aFontDirectories.push_back( aPath );
+ }
}
- }
- if( nPaths )
- XFreeFontPath( pPaths );
+ if( nPaths )
+ XFreeFontPath( pPaths );
- if( ! pInitDisplay )
- XCloseDisplay( pDisplay );
+ if( ! pInitDisplay )
+ XCloseDisplay( pDisplay );
+ }
// insert some standard directories
m_aFontDirectories.push_back( "/usr/openwin/lib/X11/fonts/Type1" );