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

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 27 16:52:16 UTC 2019


 vcl/inc/unx/fontmanager.hxx                 |    2 +-
 vcl/unx/generic/fontmanager/fontmanager.cxx |    4 ++--
 vcl/unx/generic/print/genpspgraphics.cxx    |    6 +-----
 3 files changed, 4 insertions(+), 8 deletions(-)

New commits:
commit 654a1e6b3345d098e24dcdd0d81bb49add996d0b
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Aug 27 16:54:51 2019 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Tue Aug 27 18:50:26 2019 +0200

    Let PrintFontManager::addFontFile directly take a file URL
    
    ...instead of converting from a file URL to a filesystem pathname at the (sole)
    call site and then back to a file URL in addFontFile
    
    Change-Id: I468dbfc183b062668209c6bd84fcfed122ceff37
    Reviewed-on: https://gerrit.libreoffice.org/78202
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/vcl/inc/unx/fontmanager.hxx b/vcl/inc/unx/fontmanager.hxx
index 88187efeb384..3c67adc70d8f 100644
--- a/vcl/inc/unx/fontmanager.hxx
+++ b/vcl/inc/unx/fontmanager.hxx
@@ -199,7 +199,7 @@ public:
     static PrintFontManager& get(); // one instance only
 
     // There may be multiple font ids for font collections
-    std::vector<fontID> addFontFile( const OString& rFileName );
+    std::vector<fontID> addFontFile( const OUString& rFileUrl );
 
     void initialize();
 
diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx
index 8389ba279ba1..a4d07ec3bdbe 100644
--- a/vcl/unx/generic/fontmanager/fontmanager.cxx
+++ b/vcl/unx/generic/fontmanager/fontmanager.cxx
@@ -163,10 +163,10 @@ int PrintFontManager::getDirectoryAtom( const OString& rDirectory )
     return nAtom;
 }
 
-std::vector<fontID> PrintFontManager::addFontFile( const OString& rFileName )
+std::vector<fontID> PrintFontManager::addFontFile( const OUString& rFileUrl )
 {
     rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
-    INetURLObject aPath( OStringToOUString( rFileName, aEncoding ), FSysStyle::Detect );
+    INetURLObject aPath( rFileUrl );
     OString aName(OUStringToOString(aPath.GetLastName(INetURLObject::DecodeMechanism::WithCharset, aEncoding), aEncoding));
     OString aDir( OUStringToOString(
         INetURLObject::decode( aPath.GetPath(), INetURLObject::DecodeMechanism::WithCharset, aEncoding ), aEncoding ) );
diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx
index 1eb73401d4ef..38a39e729fc3 100644
--- a/vcl/unx/generic/print/genpspgraphics.cxx
+++ b/vcl/unx/generic/print/genpspgraphics.cxx
@@ -671,12 +671,8 @@ bool GenPspGraphics::AddTempDevFontHelper( PhysicalFontCollection* pFontCollecti
                                            GlyphCache &rGC )
 {
     // inform PSP font manager
-    OUString aUSystemPath;
-    OSL_VERIFY( !osl::FileBase::getSystemPathFromFileURL( rFileURL, aUSystemPath ) );
-    rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
-    OString aOFileName( OUStringToOString( aUSystemPath, aEncoding ) );
     psp::PrintFontManager& rMgr = psp::PrintFontManager::get();
-    std::vector<psp::fontID> aFontIds = rMgr.addFontFile( aOFileName );
+    std::vector<psp::fontID> aFontIds = rMgr.addFontFile( rFileURL );
     if( aFontIds.empty() )
         return false;
 


More information about the Libreoffice-commits mailing list