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

Michael Meeks michael.meeks at collabora.com
Thu Apr 14 09:30:17 UTC 2016


 vcl/unx/generic/fontmanager/fontmanager.cxx |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

New commits:
commit 19219efc8610f25fe6b3277b99c8607847ecc8b1
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Wed Apr 13 17:19:57 2016 +0100

    Unit test hook for online / fonts.
    
    Change-Id: I2ae50c826f7fc66367a379447ab3b99cd1f29b4d
    Reviewed-on: https://gerrit.libreoffice.org/24077
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx
index 7a660e7..5cc202c 100644
--- a/vcl/unx/generic/fontmanager/fontmanager.cxx
+++ b/vcl/unx/generic/fontmanager/fontmanager.cxx
@@ -2216,4 +2216,25 @@ std::list< sal_Unicode >  PrintFontManager::getUnicodeFromAdobeName( const OStri
     return aRet;
 }
 
+/// used by online unit tests via dlopen.
+extern "C" {
+SAL_DLLPUBLIC_EXPORT const char * unit_online_get_fonts(void)
+{
+    std::list< fontID > aFontIDs;
+    PrintFontManager &rMgr = PrintFontManager::get();
+    rMgr.getFontList(aFontIDs);
+    OStringBuffer aBuf;
+    aBuf.append( (sal_Int32)aFontIDs.size() );
+    aBuf.append( " PS fonts.\n" );
+    for( auto nId : aFontIDs )
+    {
+        const OUString& rName = rMgr.getPSName( nId );
+        aBuf.append( OUStringToOString( rName, RTL_TEXTENCODING_UTF8 ) );
+        aBuf.append( "\n" );
+    }
+    static OString aResult = aBuf.makeStringAndClear();
+    return aResult.getStr();
+}
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list