Commits

Anonymous committed 7e59ee0

#i112365# ignore missing fc_local.conf files but complain about parse error in them

Comments (0)

Files changed (1)

vcl/unx/source/fontmanager/fontconfig.cxx

     fprintf( stderr, "FcConfigAppFontAddDir( \"%s\") => %d\n", pDirName, bRet );
 #endif
 
-    if( bDirOk )
+    if( !bDirOk )
+        return false;
+
+    // load dir-specific fc-config file too if available
+    const rtl::OString aConfFileName = rDirName + "/fc_local.conf";
+    FILE* pCfgFile = fopen( aConfFileName.getStr(), "rb" );
+    if( pCfgFile )
     {
-        const rtl::OString aConfFileName = rDirName + "/fc_local.conf";
+        fclose( pCfgFile);
         bool bCfgOk = rWrapper.FcConfigParseAndLoad( rWrapper.FcConfigGetCurrent(),
-                            (FcChar8*)aConfFileName.getStr(), FcTrue );
-        (void)bCfgOk; // silence compiler warning
-
-#if OSL_DEBUG_LEVEL > 1
-        fprintf( stderr, "FcConfigParseAndLoad( \"%s\") => %d\n", aConfFileName.getStr(), bCfgOk );
-#endif
+                        (FcChar8*)aConfFileName.getStr(), FcTrue );
+        if( !bCfgOk )
+            fprintf( stderr, "FcConfigParseAndLoad( \"%s\") => %d\n", aConfFileName.getStr(), bCfgOk );
     }
 
-    return bDirOk;
+    return true;
 }
 
 static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern,