diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2013-02-08 17:07:17 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-02-08 17:10:16 +0100 |
commit | fd44b28e6880b3a976b876a03bb4bc0280b47eae (patch) | |
tree | f0bc5fb479f92d7bfaf8e7e415378e09589223a3 /vcl | |
parent | 706d193698eda2ef81ab7b9301d3b0240bc588b9 (diff) |
what a convoluted way to split path into dir and file; and broken, too
This should make it handle paths with spaces properly.
Change-Id: Ic4e36449435e1bab2441ea011ccea018f14b98cf
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/generic/fontmanager/fontmanager.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx index f2ccc291d0c1..b57195505893 100644 --- a/vcl/generic/fontmanager/fontmanager.cxx +++ b/vcl/generic/fontmanager/fontmanager.cxx @@ -1049,9 +1049,10 @@ int PrintFontManager::getDirectoryAtom( const OString& rDirectory, bool bCreate std::vector<fontID> PrintFontManager::addFontFile( const ::rtl::OString& rFileName ) { rtl_TextEncoding aEncoding = osl_getThreadTextEncoding(); - INetURLObject aPath( OStringToOUString( rFileName, aEncoding ), INET_PROT_FILE, INetURLObject::ENCODE_ALL ); - OString aName( OUStringToOString( aPath.GetName(), aEncoding ) ); - OString aDir( OUStringToOString( aPath.GetPath(), aEncoding ) ); + INetURLObject aPath( OStringToOUString( rFileName, aEncoding ), INetURLObject::FSYS_DETECT ); + OString aName( OUStringToOString( aPath.GetName( INetURLObject::DECODE_WITH_CHARSET, aEncoding ), aEncoding ) ); + OString aDir( OUStringToOString( + INetURLObject::decode( aPath.GetPath(), '%', INetURLObject::DECODE_WITH_CHARSET, aEncoding ), aEncoding ) ); int nDirID = getDirectoryAtom( aDir, true ); std::vector<fontID> aFontIds = findFontFileIDs( nDirID, aName ); |