[Libreoffice-commits] core.git: 3 commits - vcl/generic

Khaled Hosny khaledhosny at eglug.org
Sat Nov 23 03:46:23 PST 2013


 vcl/generic/fontmanager/fontmanager.cxx |   14 ++++----------
 vcl/generic/print/genpspgraphics.cxx    |    2 +-
 2 files changed, 5 insertions(+), 11 deletions(-)

New commits:
commit c46d63aeef6d2c7bb768abf90060f0a400785b3a
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Sat Nov 23 13:40:50 2013 +0200

    Correctly check getFileURLFromSystemPath() success
    
    Change-Id: Iadc34171235fec2d6aafd601f62a0bff8ed5b3ee

diff --git a/vcl/generic/print/genpspgraphics.cxx b/vcl/generic/print/genpspgraphics.cxx
index 04b41fe..542986a 100644
--- a/vcl/generic/print/genpspgraphics.cxx
+++ b/vcl/generic/print/genpspgraphics.cxx
@@ -1382,7 +1382,7 @@ const void* GenPspGraphics::DoGetEmbedFontData( psp::fontID aFont, const sal_Ucs
 #else
     // FIXME: test me ! ...
     OUString aURL;
-    if( !osl::File::getFileURLFromSystemPath( OStringToOUString( aSysPath, osl_getThreadTextEncoding() ), aURL ) )
+    if( osl::File::getFileURLFromSystemPath( OStringToOUString( aSysPath, osl_getThreadTextEncoding() ), aURL ) != osl::File::E_None )
         return NULL;
     osl::File aFile( aURL );
     if( aFile.open( osl_File_OpenFlag_Read | osl_File_OpenFlag_NoLock ) != osl::File::E_None )
commit ed913215e3ddc398486e69e680da73d6538f270e
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Sat Nov 23 13:24: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

diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index e4ce215..9f545cc 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -907,7 +907,7 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, ::
 
             OUString aURL;
             if (osl::File::getFileURLFromSystemPath(OStringToOUString(aFullPath, osl_getThreadTextEncoding()),
-                aURL))
+                aURL) == osl::File::E_None)
             {
                 osl::File aFile(aURL);
                 if (aFile.open(osl_File_OpenFlag_Read | osl_File_OpenFlag_NoLock) == osl::File::E_None)
commit ec5b894ef814d53653abdac9da4140a0cef95c8c
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Sat Nov 23 13:12:59 2013 +0200

    Simplify this code a bit
    
    Change-Id: I591484788c5bcb9b9cde9696b149ede7298015a5

diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index 57307c2..e4ce215 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -903,20 +903,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()),
+            if (osl::File::getFileURLFromSystemPath(OStringToOUString(aFullPath, osl_getThreadTextEncoding()),
                 aURL))
             {
-                fileSize = 0;
-            }
-            else
-            {
                 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