[Libreoffice-commits] .: 2 commits - sw/qa vcl/generic

Caolán McNamara caolan at kemper.freedesktop.org
Sat Jul 14 06:07:54 PDT 2012


 sw/qa/extras/swmodeltestbase.hxx  |    4 ++--
 vcl/generic/glyphs/gcach_ftyp.cxx |   11 +++++++----
 2 files changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 9b3348597520781497082a09b1ff8fb4a8709463
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jul 14 14:07:08 2012 +0100

    WaE: possibly uninitialized values
    
    Change-Id: Ic4d21f9a2a3389d915620331463d32f27101fd77

diff --git a/sw/qa/extras/swmodeltestbase.hxx b/sw/qa/extras/swmodeltestbase.hxx
index 8792eb3..39e41da 100644
--- a/sw/qa/extras/swmodeltestbase.hxx
+++ b/sw/qa/extras/swmodeltestbase.hxx
@@ -147,7 +147,7 @@ protected:
     T getProperty( uno::Any obj, const rtl::OUString& name ) const
     {
         uno::Reference< beans::XPropertySet > properties( obj, uno::UNO_QUERY );
-        T data;
+        T data = T();
         properties->getPropertyValue( name ) >>= data;
         return data;
     }
@@ -156,7 +156,7 @@ protected:
     T getProperty( uno::Reference< uno::XInterface > obj, const rtl::OUString& name ) const
     {
         uno::Reference< beans::XPropertySet > properties( obj, uno::UNO_QUERY );
-        T data;
+        T data = T();
         properties->getPropertyValue( name ) >>= data;
         return data;
     }
commit 50d0b31d330b3eb245e96d9950328261e89e00cd
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jul 14 14:03:56 2012 +0100

    Related: fdo#31821 pull tables from otf fonts as well
    
    Change-Id: If3bd4ac640aaf6b68fa4ae2a363f691601ff942b

diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx
index 9da8993..d186aef 100644
--- a/vcl/generic/glyphs/gcach_ftyp.cxx
+++ b/vcl/generic/glyphs/gcach_ftyp.cxx
@@ -449,7 +449,9 @@ static unsigned GetUInt( const unsigned char* p ) { return((p[0]<<24)+(p[1]<<16)
 static unsigned GetUShort( const unsigned char* p ){ return((p[0]<<8)+p[1]);}
 //static signed GetSShort( const unsigned char* p ){ return((short)((p[0]<<8)+p[1]));}
 
-// -----------------------------------------------------------------------
+static const sal_uInt32 T_true = 0x74727565;        /* 'true' */
+static const sal_uInt32 T_ttcf = 0x74746366;        /* 'ttcf' */
+static const sal_uInt32 T_otto = 0x4f54544f;        /* 'OTTO' */
 
 const unsigned char* FtFontInfo::GetTable( const char* pTag, sal_uLong* pLength ) const
 {
@@ -458,12 +460,13 @@ const unsigned char* FtFontInfo::GetTable( const char* pTag, sal_uLong* pLength
     if( !pBuffer || nFileSize<1024 )
         return NULL;
 
-    // we currently only handle TTF and TTC headers
+    // we currently handle TTF, TTC and OTF headers
     unsigned nFormat = GetUInt( pBuffer );
+
     const unsigned char* p = pBuffer + 12;
-    if( nFormat == 0x74746366 )         // TTC_MAGIC
+    if( nFormat == T_ttcf )         // TTC_MAGIC
         p += GetUInt( p + 4 * mnFaceNum );
-    else if( (nFormat!=0x00010000) && (nFormat!=0x74727565) )    // TTF_MAGIC and Apple TTF Magic
+    else if( nFormat != 0x00010000 && nFormat != T_true && nFormat != T_otto) // TTF_MAGIC and Apple TTF Magic and PS-OpenType font
         return NULL;
 
     // walk table directory until match


More information about the Libreoffice-commits mailing list