[Libreoffice-commits] core.git: vcl/inc

Khaled Hosny (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 27 17:45:30 UTC 2019


 vcl/inc/fontinstance.hxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c997a32dbfddf791a309f179adca961336423293
Author:     Khaled Hosny <khaledhosny at eglug.org>
AuthorDate: Tue Aug 27 11:07:53 2019 +0200
Commit:     Khaled Hosny <khaledhosny at eglug.org>
CommitDate: Tue Aug 27 19:43:54 2019 +0200

    Return empty HarfBuzz font instead of nullptr
    
    hb_font_get_empty() returns an empty, singleton font object that can be
    safely passed to HarfBuzz API that would otherwise crash if given a
    nullptr. Keep the assert to catch calls to this code in debug builds,
    since it is really a bug for LogicalFontInstance implementations without
    a backed HarfBuzz font to call code that requires it.
    
    Change-Id: I93e2b3204eb08b0c4c54587bc0f60cbf3c18c7d7
    Reviewed-on: https://gerrit.libreoffice.org/78178
    Tested-by: Jenkins
    Reviewed-by: Khaled Hosny <khaledhosny at eglug.org>

diff --git a/vcl/inc/fontinstance.hxx b/vcl/inc/fontinstance.hxx
index b22d76e3b070..b57955f82a9e 100644
--- a/vcl/inc/fontinstance.hxx
+++ b/vcl/inc/fontinstance.hxx
@@ -86,7 +86,7 @@ protected:
 
     // Takes ownership of pHbFace.
     static hb_font_t* InitHbFont(hb_face_t* pHbFace);
-    virtual hb_font_t* ImplInitHbFont() { assert(false); return nullptr; }
+    virtual hb_font_t* ImplInitHbFont() { assert(false); return hb_font_get_empty(); }
     inline void ReleaseHbFont();
 
 private:


More information about the Libreoffice-commits mailing list