[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - vcl/generic

Khaled Hosny khaledhosny at eglug.org
Mon Nov 25 03:21:50 PST 2013


 vcl/generic/fontmanager/fontmanager.cxx |   14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

New commits:
commit 4d174557c04a48efa5661c5e6e2c1295b68f3681
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Sat Nov 23 13:12:59 2013 +0200

    Make TTC fonts work again
    
    osl::File::getFileURLFromSystemPath() does not return a boolean. I
    wonder how this worked before, if it worked at all.
    
    Change-Id: Iadc0e06236f43c24cbcd42e4fd79ac9116a58c13
    Reviewed-on: https://gerrit.libreoffice.org/6769
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index 418f480..5e92170 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -1176,20 +1176,14 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, ::
             fprintf( stderr, "ttc: %s contains %d fonts\n", aFullPath.getStr(), nLength );
 #endif
 
-            sal_uInt64 fileSize;
+            sal_uInt64 fileSize = 0;
 
             OUString aURL;
-            if (!osl::File::getFileURLFromSystemPath(OStringToOUString(aFullPath, osl_getThreadTextEncoding()),
-                aURL))
-            {
-                fileSize = 0;
-            }
-            else
+            if (osl::File::getFileURLFromSystemPath(OStringToOUString(aFullPath, osl_getThreadTextEncoding()),
+                aURL) == osl::File::E_None)
             {
                 osl::File aFile(aURL);
-                if (aFile.open(osl_File_OpenFlag_Read | osl_File_OpenFlag_NoLock) != osl::File::E_None)
-                    fileSize = 0;
-                else
+                if (aFile.open(osl_File_OpenFlag_Read | osl_File_OpenFlag_NoLock) == osl::File::E_None)
                 {
                     osl::DirectoryItem aItem;
                     osl::DirectoryItem::get( aURL, aItem );


More information about the Libreoffice-commits mailing list